From a8c382379bed4d1419011d5b9d26e7f772e9afd3 Mon Sep 17 00:00:00 2001 From: archos Date: Mon, 30 Dec 2024 07:44:29 +0100 Subject: [PATCH] =?UTF-8?q?nov=C3=A9=20vyd=C3=A1n=C3=AD=20phanpy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/compose-8rrDtgaW.js | 26 +++ assets/compose-8rrDtgaW.js.map | 1 + assets/compose-Ig15wqnf.css | 1 + assets/compose-_EXIhB02.js | 2 + assets/compose-_EXIhB02.js.map | 1 + assets/fuse-1Fw6A_G2.js | 189 +++++++++++++++++++ assets/fuse-1Fw6A_G2.js.map | 1 + assets/fuse-f4VJQFfi.css | 1 + assets/locales/ar-SA-5vi9L0Lg.js | 2 + assets/locales/ar-SA-5vi9L0Lg.js.map | 1 + assets/locales/ca-ES-9Rcd-17T.js | 2 + assets/locales/ca-ES-9Rcd-17T.js.map | 1 + assets/locales/cs-CZ-mYBe-Tzn.js | 2 + assets/locales/cs-CZ-mYBe-Tzn.js.map | 1 + assets/locales/de-DE-TrpOuRPl.js | 2 + assets/locales/de-DE-TrpOuRPl.js.map | 1 + assets/locales/eo-UY-3qbhV29w.js | 2 + assets/locales/eo-UY-3qbhV29w.js.map | 1 + assets/locales/es-ES-qCsZs9qF.js | 2 + assets/locales/es-ES-qCsZs9qF.js.map | 1 + assets/locales/eu-ES-pdu2Slk_.js | 2 + assets/locales/eu-ES-pdu2Slk_.js.map | 1 + assets/locales/fa-IR-sFBoEs2o.js | 2 + assets/locales/fa-IR-sFBoEs2o.js.map | 1 + assets/locales/fi-FI-LFKpfhO-.js | 2 + assets/locales/fi-FI-LFKpfhO-.js.map | 1 + assets/locales/fr-FR-doHguYIC.js | 2 + assets/locales/fr-FR-doHguYIC.js.map | 1 + assets/locales/gl-ES-2UZGtZN0.js | 2 + assets/locales/gl-ES-2UZGtZN0.js.map | 1 + assets/locales/he-IL-5vi9L0Lg.js | 2 + assets/locales/he-IL-5vi9L0Lg.js.map | 1 + assets/locales/it-IT-u5hFTJKZ.js | 2 + assets/locales/it-IT-u5hFTJKZ.js.map | 1 + assets/locales/ja-JP-5vi9L0Lg.js | 2 + assets/locales/ja-JP-5vi9L0Lg.js.map | 1 + assets/locales/kab-NWP-Wcac.js | 2 + assets/locales/kab-NWP-Wcac.js.map | 1 + assets/locales/ko-KR-hywLI6mb.js | 2 + assets/locales/ko-KR-hywLI6mb.js.map | 1 + assets/locales/lt-LT-FaveWVQW.js | 2 + assets/locales/lt-LT-FaveWVQW.js.map | 1 + assets/locales/nb-NO-5vi9L0Lg.js | 2 + assets/locales/nb-NO-5vi9L0Lg.js.map | 1 + assets/locales/nl-NL-40ssIsHe.js | 2 + assets/locales/nl-NL-40ssIsHe.js.map | 1 + assets/locales/oc-FR-5vi9L0Lg.js | 2 + assets/locales/oc-FR-5vi9L0Lg.js.map | 1 + assets/locales/pl-PL-5vi9L0Lg.js | 2 + assets/locales/pl-PL-5vi9L0Lg.js.map | 1 + assets/locales/pseudo-LOCALE-JLsu8lB6.js | 2 + assets/locales/pseudo-LOCALE-JLsu8lB6.js.map | 1 + assets/locales/pt-BR-xGT4Z199.js | 2 + assets/locales/pt-BR-xGT4Z199.js.map | 1 + assets/locales/pt-PT-Pq3lqcXt.js | 2 + assets/locales/pt-PT-Pq3lqcXt.js.map | 1 + assets/locales/ru-RU-ZQRFix3Y.js | 2 + assets/locales/ru-RU-ZQRFix3Y.js.map | 1 + assets/locales/th-TH-5vi9L0Lg.js | 2 + assets/locales/th-TH-5vi9L0Lg.js.map | 1 + assets/locales/tr-TR-5vi9L0Lg.js | 2 + assets/locales/tr-TR-5vi9L0Lg.js.map | 1 + assets/locales/uk-UA-LoamWSTx.js | 2 + assets/locales/uk-UA-LoamWSTx.js.map | 1 + assets/locales/zh-CN-CiFeHAH_.js | 2 + assets/locales/zh-CN-CiFeHAH_.js.map | 1 + assets/locales/zh-TW-5vi9L0Lg.js | 2 + assets/locales/zh-TW-5vi9L0Lg.js.map | 1 + assets/main-B7dDrG0m.js | 34 ++++ assets/main-B7dDrG0m.js.map | 1 + assets/main-e8VGlmdR.css | 1 + assets/polyfill-force-epwvp7Bv.js | 9 + assets/polyfill-force-epwvp7Bv.js.map | 1 + assets/useTitle-YidSUFJs.css | 7 + assets/useTitle-jLgT0T3g.js | 46 +++++ assets/useTitle-jLgT0T3g.js.map | 1 + compose/index.html | 8 +- index.html | 12 +- version.json | 2 +- 79 files changed, 422 insertions(+), 12 deletions(-) create mode 100644 assets/compose-8rrDtgaW.js create mode 100644 assets/compose-8rrDtgaW.js.map create mode 100644 assets/compose-Ig15wqnf.css create mode 100644 assets/compose-_EXIhB02.js create mode 100644 assets/compose-_EXIhB02.js.map create mode 100644 assets/fuse-1Fw6A_G2.js create mode 100644 assets/fuse-1Fw6A_G2.js.map create mode 100644 assets/fuse-f4VJQFfi.css create mode 100644 assets/locales/ar-SA-5vi9L0Lg.js create mode 100644 assets/locales/ar-SA-5vi9L0Lg.js.map create mode 100644 assets/locales/ca-ES-9Rcd-17T.js create mode 100644 assets/locales/ca-ES-9Rcd-17T.js.map create mode 100644 assets/locales/cs-CZ-mYBe-Tzn.js create mode 100644 assets/locales/cs-CZ-mYBe-Tzn.js.map create mode 100644 assets/locales/de-DE-TrpOuRPl.js create mode 100644 assets/locales/de-DE-TrpOuRPl.js.map create mode 100644 assets/locales/eo-UY-3qbhV29w.js create mode 100644 assets/locales/eo-UY-3qbhV29w.js.map create mode 100644 assets/locales/es-ES-qCsZs9qF.js create mode 100644 assets/locales/es-ES-qCsZs9qF.js.map create mode 100644 assets/locales/eu-ES-pdu2Slk_.js create mode 100644 assets/locales/eu-ES-pdu2Slk_.js.map create mode 100644 assets/locales/fa-IR-sFBoEs2o.js create mode 100644 assets/locales/fa-IR-sFBoEs2o.js.map create mode 100644 assets/locales/fi-FI-LFKpfhO-.js create mode 100644 assets/locales/fi-FI-LFKpfhO-.js.map create mode 100644 assets/locales/fr-FR-doHguYIC.js create mode 100644 assets/locales/fr-FR-doHguYIC.js.map create mode 100644 assets/locales/gl-ES-2UZGtZN0.js create mode 100644 assets/locales/gl-ES-2UZGtZN0.js.map create mode 100644 assets/locales/he-IL-5vi9L0Lg.js create mode 100644 assets/locales/he-IL-5vi9L0Lg.js.map create mode 100644 assets/locales/it-IT-u5hFTJKZ.js create mode 100644 assets/locales/it-IT-u5hFTJKZ.js.map create mode 100644 assets/locales/ja-JP-5vi9L0Lg.js create mode 100644 assets/locales/ja-JP-5vi9L0Lg.js.map create mode 100644 assets/locales/kab-NWP-Wcac.js create mode 100644 assets/locales/kab-NWP-Wcac.js.map create mode 100644 assets/locales/ko-KR-hywLI6mb.js create mode 100644 assets/locales/ko-KR-hywLI6mb.js.map create mode 100644 assets/locales/lt-LT-FaveWVQW.js create mode 100644 assets/locales/lt-LT-FaveWVQW.js.map create mode 100644 assets/locales/nb-NO-5vi9L0Lg.js create mode 100644 assets/locales/nb-NO-5vi9L0Lg.js.map create mode 100644 assets/locales/nl-NL-40ssIsHe.js create mode 100644 assets/locales/nl-NL-40ssIsHe.js.map create mode 100644 assets/locales/oc-FR-5vi9L0Lg.js create mode 100644 assets/locales/oc-FR-5vi9L0Lg.js.map create mode 100644 assets/locales/pl-PL-5vi9L0Lg.js create mode 100644 assets/locales/pl-PL-5vi9L0Lg.js.map create mode 100644 assets/locales/pseudo-LOCALE-JLsu8lB6.js create mode 100644 assets/locales/pseudo-LOCALE-JLsu8lB6.js.map create mode 100644 assets/locales/pt-BR-xGT4Z199.js create mode 100644 assets/locales/pt-BR-xGT4Z199.js.map create mode 100644 assets/locales/pt-PT-Pq3lqcXt.js create mode 100644 assets/locales/pt-PT-Pq3lqcXt.js.map create mode 100644 assets/locales/ru-RU-ZQRFix3Y.js create mode 100644 assets/locales/ru-RU-ZQRFix3Y.js.map create mode 100644 assets/locales/th-TH-5vi9L0Lg.js create mode 100644 assets/locales/th-TH-5vi9L0Lg.js.map create mode 100644 assets/locales/tr-TR-5vi9L0Lg.js create mode 100644 assets/locales/tr-TR-5vi9L0Lg.js.map create mode 100644 assets/locales/uk-UA-LoamWSTx.js create mode 100644 assets/locales/uk-UA-LoamWSTx.js.map create mode 100644 assets/locales/zh-CN-CiFeHAH_.js create mode 100644 assets/locales/zh-CN-CiFeHAH_.js.map create mode 100644 assets/locales/zh-TW-5vi9L0Lg.js create mode 100644 assets/locales/zh-TW-5vi9L0Lg.js.map create mode 100644 assets/main-B7dDrG0m.js create mode 100644 assets/main-B7dDrG0m.js.map create mode 100644 assets/main-e8VGlmdR.css create mode 100644 assets/polyfill-force-epwvp7Bv.js create mode 100644 assets/polyfill-force-epwvp7Bv.js.map create mode 100644 assets/useTitle-YidSUFJs.css create mode 100644 assets/useTitle-jLgT0T3g.js create mode 100644 assets/useTitle-jLgT0T3g.js.map diff --git a/assets/compose-8rrDtgaW.js b/assets/compose-8rrDtgaW.js new file mode 100644 index 0000000..11f110b --- /dev/null +++ b/assets/compose-8rrDtgaW.js @@ -0,0 +1,26 @@ +var qt=s=>{throw TypeError(s)};var xt=(s,t,n)=>t.has(s)||qt("Cannot "+n);var B=(s,t,n)=>(xt(s,t,"read from private field"),n?n.call(s):t.get(s)),de=(s,t,n)=>t.has(s)?qt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,n),ge=(s,t,n,a)=>(xt(s,t,"write to private field"),a?a.call(s,n):t.set(s,n),n),te=(s,t,n)=>(xt(s,t,"access private method"),n);import{x as An,s as ce,V as on,u as ze,a as Bt,h as H,A as q,K as Sn,aD as rn,e as Te,y as oe,w as _n,aE as In,r as Oe,i as Ne,d as e,T as G,b as Bn,k as qe,v as dt,o as Tn,ae as Mn,P as Rn,c as Dn,q as Wt,M as ln}from"./useTitle-jLgT0T3g.js";import{j as Le,G as $n,$ as jn,a as Ke,a9 as Pn,y as Ut,u as On,aa as Hn,m as cn,b as Kn,I as N,B as Vt,i as st,ab as Nn,c as un,d as Be,l as Ct,M as at,s as Se,a5 as qn,a1 as Wn,r as Un,Q as Vn,Y as ht,p as nt,z as Gn}from"./fuse-1Fw6A_G2.js";class Yn{constructor(t,n,{tabInsertsSuggestions:a,defaultFirstOption:l}={}){this.input=t,this.list=n,this.tabInsertsSuggestions=a??!0,this.defaultFirstOption=l??!1,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=d=>Zn(d,this),this.compositionEventHandler=d=>Xn(d,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",Gt),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",Gt)}indicateDefaultOption(){var t;this.defaultFirstOption&&((t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(yt)[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(yt)[0],a=Array.from(this.list.querySelectorAll('[role="option"]')).filter(yt),l=a.indexOf(n);if(l===a.length-1&&t===1||l===0&&t===-1){this.clearSelection(),this.input.focus();return}let d=t===1?0:a.length-1;if(n&&l>=0){const p=l+t;p>=0&&p0||s.offsetHeight>0)}function Xn(s,t){t.isComposing=s.type==="compositionstart",document.getElementById(t.input.getAttribute("aria-controls")||"")&&t.clearSelection()}function Qn(s,t){ei(s,t)||(s.scrollTop=t.offsetTop)}function ei(s,t){const n=s.scrollTop,a=n+s.clientHeight,l=t.offsetTop,d=l+t.clientHeight;return l>=n&&d<=a}const ti=/\s|\(|\[/;function ni(s,t,n,{multiWord:a,lookBackIndex:l,lastMatchPosition:d}={multiWord:!1,lookBackIndex:0,lastMatchPosition:null}){let r=s.lastIndexOf(t,n-1);if(r===-1||r=r+t.length+1||s.lastIndexOf(` +`,n-1)>r||s.lastIndexOf(".",n-1)>r)return}else if(s.lastIndexOf(" ",n-1)>r)return;const p=s[r-1];return p&&!ti.test(p)?void 0:{text:s.substring(r+t.length,n),position:r+t.length}}class ii extends HTMLElement{}class si extends Event{constructor(){super("update")}}const wt=new WeakMap;var We,Ue,Ve,ke,Y,zt,Ie,Me,Re,Lt,De,ot,rt,lt,Ge,_e;const Mt=class Mt extends ii{constructor(){super(...arguments);de(this,Y);de(this,We,new MutationObserver(()=>te(this,Y,rt).call(this)));de(this,Ue,new ResizeObserver(()=>te(this,Y,ot).call(this)));de(this,Ve);de(this,ke);de(this,Me,0);de(this,Re,0);de(this,De,!1);de(this,Ge,()=>te(this,Y,lt).call(this));de(this,_e,n=>{te(this,Y,Ie).call(this,a=>{(n.target===document||n.target===window||n.target instanceof Node&&n.target.contains(a))&&te(this,Y,ot).call(this)})})}static for(n){let a=wt.get(n);return a||(a=new Mt,a.connect(n),wt.set(n,a)),a}connect(n){ge(this,Ve,new WeakRef(n)),ge(this,ke,document.createElement("div")),B(this,ke).style.position="absolute",B(this,ke).style.pointerEvents="none",n.after(B(this,ke)),B(this,ke).appendChild(this)}forceUpdate(){te(this,Y,rt).call(this),te(this,Y,lt).call(this)}connectedCallback(){te(this,Y,Ie).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"),te(this,Y,rt).call(this),te(this,Y,lt).call(this),B(this,We).observe(n,{attributeFilter:["style","dir"]}),B(this,Ue).observe(n),document.addEventListener("scroll",B(this,_e),{capture:!0}),window.addEventListener("resize",B(this,_e),{capture:!0}),n.addEventListener("input",B(this,Ge),{capture:!0})})}disconnectedCallback(){var a;(a=B(this,ke))==null||a.remove(),B(this,We).disconnect(),B(this,Ue).disconnect(),document.removeEventListener("scroll",B(this,_e),{capture:!0}),window.removeEventListener("resize",B(this,_e),{capture:!0});const n=B(this,Y,zt);n&&(n.removeEventListener("input",B(this,Ge),{capture:!0}),wt.delete(n))}};We=new WeakMap,Ue=new WeakMap,Ve=new WeakMap,ke=new WeakMap,Y=new WeakSet,zt=function(){var n;return(n=B(this,Ve))==null?void 0:n.deref()},Ie=function(n){const a=B(this,Y,zt);return a?n(a):this.remove()},Me=new WeakMap,Re=new WeakMap,Lt=function(){te(this,Y,Ie).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 l=n.getBoundingClientRect(),d=this.getBoundingClientRect();ge(this,Me,B(this,Me)+l.left-d.left),ge(this,Re,B(this,Re)+l.top-d.top),this.style.transform=`translate(${B(this,Me)}px, ${B(this,Re)}px)`,this.scrollTop=n.scrollTop,this.scrollLeft=n.scrollLeft,this.dispatchEvent(new si)})},De=new WeakMap,ot=function(){B(this,De)||(ge(this,De,!0),requestAnimationFrame(()=>{te(this,Y,Lt).call(this),ge(this,De,!1)}))},rt=function(){te(this,Y,Ie).call(this,n=>{const a=window.getComputedStyle(n);for(const l of ai)this.style[l]=a[l];te(this,Y,ot).call(this)})},lt=function(){te(this,Y,Ie).call(this,n=>{this.textContent=n.value,te(this,Y,Lt).call(this)})},Ge=new WeakMap,_e=new WeakMap;let ct=Mt;const ai=["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",ct)}catch(s){if(!(s instanceof DOMException&&s.name==="NotSupportedError"))throw s}var ye,$e,je,he,St,dn,_t,He;const ut=class ut{constructor(t,n=0,a=n){de(this,he);de(this,ye);de(this,$e);de(this,je);ge(this,ye,t),ge(this,$e,n),ge(this,je,a)}static fromSelection(t){const{selectionStart:n,selectionEnd:a}=t;return new ut(t,n??void 0,a??void 0)}get collapsed(){return this.startOffset===this.endOffset}get commonAncestorContainer(){return B(this,ye)}get endContainer(){return B(this,ye)}get startContainer(){return B(this,ye)}get startOffset(){return B(this,$e)}get endOffset(){return B(this,je)}setStartOffset(t){ge(this,$e,te(this,he,_t).call(this,t))}setEndOffset(t){ge(this,je,te(this,he,_t).call(this,t))}collapse(t=!1){t?this.setEndOffset(this.startOffset):this.setStartOffset(this.endOffset)}cloneContents(){return te(this,he,He).call(this).cloneContents()}cloneRange(){return new ut(B(this,ye),this.startOffset,this.endOffset)}getBoundingClientRect(){return te(this,he,He).call(this).getBoundingClientRect()}getClientRects(){return te(this,he,He).call(this).getClientRects()}toString(){return te(this,he,He).call(this).toString()}getStyleClone(){return B(this,he,St)}};ye=new WeakMap,$e=new WeakMap,je=new WeakMap,he=new WeakSet,St=function(){return ct.for(B(this,ye))},dn=function(){return B(this,he,St)},_t=function(t){return Math.max(0,Math.min(t,B(this,ye).value.length))},He=function(){const t=document.createRange(),n=B(this,he,dn).childNodes[0];return n&&(t.setStart(n,this.startOffset),t.setEnd(n,this.endOffset)),t};let At=ut;const it=new WeakMap;class oi{constructor(t,n){this.expander=t,this.input=n,this.combobox=null,this.menu=null,this.match=null,this.justPasted=!1,this.lookBackIndex=0,this.oninput=this.onInput.bind(this),this.onpaste=this.onPaste.bind(this),this.onkeydown=this.onKeydown.bind(this),this.oncommit=this.onCommit.bind(this),this.onmousedown=this.onMousedown.bind(this),this.onblur=this.onBlur.bind(this),this.interactingWithList=!1,n.addEventListener("paste",this.onpaste),n.addEventListener("input",this.oninput),n.addEventListener("keydown",this.onkeydown),n.addEventListener("blur",this.onblur)}destroy(){this.input.removeEventListener("paste",this.onpaste),this.input.removeEventListener("input",this.oninput),this.input.removeEventListener("keydown",this.onkeydown),this.input.removeEventListener("blur",this.onblur)}dismissMenu(){this.deactivate()&&(this.lookBackIndex=this.input.selectionEnd||this.lookBackIndex)}activate(t,n){var a,l;this.input!==document.activeElement&&this.input!==((l=(a=document.activeElement)===null||a===void 0?void 0:a.shadowRoot)===null||l===void 0?void 0:l.activeElement)||(this.deactivate(),this.menu=n,n.id||(n.id=`text-expander-${Math.floor(Math.random()*1e5).toString()}`),this.expander.append(n),this.combobox=new Yn(this.input,n),this.expander.dispatchEvent(new Event("text-expander-activate")),this.positionMenu(n,t.position),this.combobox.start(),n.addEventListener("combobox-commit",this.oncommit),n.addEventListener("mousedown",this.onmousedown),this.combobox.navigate(1))}positionMenu(t,n){const a=new At(this.input,n).getBoundingClientRect(),l={left:a.left,top:a.top+a.height},d=t.getBoundingClientRect(),r={left:l.left-d.left,top:l.top-d.top};if(r.left!==0||r.top!==0){const p=getComputedStyle(t);t.style.left=p.left?`calc(${p.left} + ${r.left}px)`:`${r.left}px`,t.style.top=p.top?`calc(${p.top} + ${r.top}px)`:`${r.top}px`}}deactivate(){const t=this.menu;return!t||!this.combobox?!1:(this.expander.dispatchEvent(new Event("text-expander-deactivate")),this.menu=null,t.removeEventListener("combobox-commit",this.oncommit),t.removeEventListener("mousedown",this.onmousedown),this.combobox.destroy(),this.combobox=null,t.remove(),!0)}onCommit({target:t}){var n;const a=t;if(!(a instanceof HTMLElement)||!this.combobox)return;const l=this.match;if(!l)return;const d=this.input.value.substring(0,l.position-l.key.length),r=this.input.value.substring(l.position+l.text.length),p={item:a,key:l.key,value:null,continue:!1};if(!this.expander.dispatchEvent(new CustomEvent("text-expander-value",{cancelable:!0,detail:p}))||!p.value)return;let v=(n=this.expander.getAttribute("suffix"))!==null&&n!==void 0?n:" ";p.continue&&(v="");const re=`${p.value}${v}`;this.input.value=d+re+r;const T=d.length+re.length;this.deactivate(),this.input.focus({preventScroll:!0}),this.input.selectionStart=T,this.input.selectionEnd=T,p.continue||(this.lookBackIndex=T,this.match=null),this.expander.dispatchEvent(new CustomEvent("text-expander-committed",{cancelable:!1,detail:{input:this.input}}))}onBlur(){if(this.interactingWithList){this.interactingWithList=!1;return}this.deactivate()}onPaste(){this.justPasted=!0}async onInput(){if(this.justPasted){this.justPasted=!1;return}const t=this.findMatch();if(t){this.match=t;const n=await this.notifyProviders(t);if(!this.match)return;n?this.activate(t,n):this.deactivate()}else this.match=null,this.deactivate()}findMatch(){const t=this.input.selectionEnd||0,n=this.input.value;t<=this.lookBackIndex&&(this.lookBackIndex=t-1);for(const{key:a,multiWord:l}of this.expander.keys){const d=ni(n,a,t,{multiWord:l,lookBackIndex:this.lookBackIndex,lastMatchPosition:this.match?this.match.position:null});if(d)return{text:d.text,key:a,position:d.position}}}async notifyProviders(t){const n=[],a=p=>n.push(p);return this.expander.dispatchEvent(new CustomEvent("text-expander-change",{cancelable:!0,detail:{provide:a,text:t.text,key:t.key}}))?(await Promise.all(n)).filter(p=>p.matched).map(p=>p.fragment)[0]:void 0}onMousedown(){this.interactingWithList=!0}onKeydown(t){t.key==="Escape"&&(this.match=null,this.deactivate()&&(this.lookBackIndex=this.input.selectionEnd||this.lookBackIndex,t.stopImmediatePropagation(),t.preventDefault()))}}class Zt extends HTMLElement{get keys(){const t=this.getAttribute("keys"),n=t?t.split(" "):[],a=this.getAttribute("multiword"),l=a?a.split(" "):[],d=l.length===0&&this.hasAttribute("multiword");return n.map(r=>({key:r,multiWord:d||l.includes(r)}))}set keys(t){this.setAttribute("keys",t)}connectedCallback(){const t=this.querySelector('input[type="text"], textarea');if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;const n=new oi(this,t);it.set(this,n)}disconnectedCallback(){const t=it.get(this);t&&(t.destroy(),it.delete(this))}dismiss(){const t=it.get(this);t&&t.dismissMenu()}}window.customElements.get("text-expander")||(window.TextExpanderElement=Zt,window.customElements.define("text-expander",Zt));function ri({onlyFirst:s=!1}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,s?void 0:"g")}const li=ri();function ci(s){if(typeof s!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof s}\``);return s.replace(li,"")}const ui=new Intl.Segmenter;function Jt(s,{countAnsiEscapeCodes:t=!1}={}){if(s===""||(t||(s=ci(s)),s===""))return 0;let n=0;for(const a of ui.segment(s))n++;return n}const di="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.0'%20viewBox='0%200%20641%20223'%3e%3cpath%20fill='%23aaa'%20d='M86%20214c-9-1-17-4-24-8l-6-3-5-5-5-4-4-6-4-6-3-8-2-8v-27l2-9%203-9%204-6%204-6%205-5%205-5%207-3%206-4%207-2%207-2%2012-1h12l7%201%208%202%207%204%207%203%205%205%205%204-10%2010-10%209-4-3-10-5-5-1H88l-5%202-6%203-3%204-4%204-2%205-2%206v6l-1%207%201%207%202%207%203%205%202%204%204%203%204%203%205%202%206%202h9l10-1%205-2%206-3v-16H91v-27h59v54l-1%203-2%203-5%204-4%204-5%203-5%202-8%202-8%202-10%201H92l-6-1zm266-62V91h34v46h44V91h34v121h-34v-46h-44v46h-34v-61zm-182-1V90h34v121h-34v-60zm59-1V90h35l36%201%205%202c3%200%208%202%2010%204l5%202%204%205%205%204%203%207%203%207%201%2013v13l-4%206-3%207-4%204-5%205-5%202-5%203-6%202-5%201-18%201h-18v32h-34v-61zm67-2%203-2%202-4%202-5v-5l-2-4-2-4-3-2-3-3h-30v31h30l3-2zm226%2039v-24l-8-12-18-28a1751%201751%200%200%200-20-31v-2h39l7%2012%2012%2021%206%209%2013-21%2013-21h38v2l-41%2061-7%2010v48h-34v-24zM109%2066l-4-1-5-5-5-4-1-5-3-9v-5l1-5c2-7%203-10%208-15l4-4%207-2%207-2h7l6%201%205%202%205%202%203%204%204%203%202%206%202%205v13l-2%205-2%206-4%204-3%203-5%202-4%202-9%201h-9l-5-2zm22-11%204-2%203-4%202-5V34l-2-4-2-4-3-2-4-3-5-1h-6l-4%202-5%202-2%204-3%205-1%203v4l1%205%202%205%202%202%205%203%204%202h10l4-2zM37%2039V11h33l3%201%203%202%204%203%203%203%201%205%201%204v5l-1%204-3%204-3%205-4%201-3%202-11%201H49v16H37V39zm31%200%203-2%201-2%201-2v-4l-1-3-3-2-2-2H49v18h15l4-1zm107%2025a512%20512%200%200%200-19-53h14l4%2014%206%2019%201%204%201-1%207-19%205-17h9l6%2019%207%2018v-1l2-6%205-17%204-13h14v1l-4%2012-16%2041v2h-5l-5-1-6-15-6-15-1%201-3%207-6%2015-2%208h-11l-1-3zm74-25V11h42v11h-29v2l-1%205v4h29v11h-28v11h2l15%201h13v11h-43V39zm55%200V11h33l5%203%205%202%202%204%202%205v10l-2%203-1%204-5%203-5%203%205%205%208%2010%203%204h-14l-7-9-8-10h-9v19h-12V39zm33-3%202-3v-6l-3-3-2-3h-18v16h1v1h17l2-2zm26%203V11h42v11h-29l-1%206v5h29v11h-28v5l-1%205%201%201v1h30v11h-43V39zm54%200V11h17l18%201%204%202%205%203%202%204%203%204%202%206%201%206v5c-1%206-3%2012-6%2015l-3%204-5%203-5%202-17%201h-16V39zm33%2014%205-5%202-3v-6l-1-6-1-3-1-3-4-3-3-2h-5l-6-1-3%201h-3v34h9l8-1%203-2zm50-14V11h34l5%202%204%202%202%203%202%203v9l-2%202-3%204-1%201%203%203%203%204%201%203%201%204-1%204-1%204-3%203-3%203-5%201-5%201h-31V39zm34%2015%202-1v-6l-2-2-2-2h-20v13h20l2-2zm-3-22%204-2v-6l-2-1-2-2h-19v12h16l4-1zm42%2024V45l-6-9-11-17-5-8h15l4%208%207%2011%202%203%207-11%207-11h14l-11%2016-11%2017v23h-12V56z'/%3e%3c/svg%3e",Tt=[["aa","Afar","Afaraf"],["ab","Abkhaz","аҧсуа бызшәа"],["ae","Avestan","avesta"],["af","Afrikaans","Afrikaans"],["ak","Akan","Akan"],["am","Amharic","አማርኛ"],["an","Aragonese","aragonés"],["ar","Arabic","اللغة العربية"],["as","Assamese","অসমীয়া"],["av","Avaric","авар мацӀ"],["ay","Aymara","aymar aru"],["az","Azerbaijani","azərbaycan dili"],["ba","Bashkir","башҡорт теле"],["be","Belarusian","беларуская мова"],["bg","Bulgarian","български език"],["bh","Bihari","भोजपुरी"],["bi","Bislama","Bislama"],["bm","Bambara","bamanankan"],["bn","Bengali","বাংলা"],["bo","Tibetan","བོད་ཡིག"],["br","Breton","brezhoneg"],["bs","Bosnian","bosanski jezik"],["ca","Catalan","Català"],["ce","Chechen","нохчийн мотт"],["ch","Chamorro","Chamoru"],["co","Corsican","corsu"],["cr","Cree","ᓀᐦᐃᔭᐍᐏᐣ"],["cs","Czech","čeština"],["cu","Old Church Slavonic","ѩзыкъ словѣньскъ"],["cv","Chuvash","чӑваш чӗлхи"],["cy","Welsh","Cymraeg"],["da","Danish","dansk"],["de","German","Deutsch"],["dv","Divehi","Dhivehi"],["dz","Dzongkha","རྫོང་ཁ"],["ee","Ewe","Eʋegbe"],["el","Greek","Ελληνικά"],["en","English","English"],["eo","Esperanto","Esperanto"],["es","Spanish","Español"],["et","Estonian","eesti"],["eu","Basque","euskara"],["fa","Persian","فارسی"],["ff","Fula","Fulfulde"],["fi","Finnish","suomi"],["fj","Fijian","Vakaviti"],["fo","Faroese","føroyskt"],["fr","French","Français"],["fy","Western Frisian","Frysk"],["ga","Irish","Gaeilge"],["gd","Scottish Gaelic","Gàidhlig"],["gl","Galician","galego"],["gu","Gujarati","ગુજરાતી"],["gv","Manx","Gaelg"],["ha","Hausa","هَوُسَ"],["he","Hebrew","עברית"],["hi","Hindi","हिन्दी"],["ho","Hiri Motu","Hiri Motu"],["hr","Croatian","Hrvatski"],["ht","Haitian","Kreyòl ayisyen"],["hu","Hungarian","magyar"],["hy","Armenian","Հայերեն"],["hz","Herero","Otjiherero"],["ia","Interlingua","Interlingua"],["id","Indonesian","Bahasa Indonesia"],["ie","Interlingue","Interlingue"],["ig","Igbo","Asụsụ Igbo"],["ii","Nuosu","ꆈꌠ꒿ Nuosuhxop"],["ik","Inupiaq","Iñupiaq"],["io","Ido","Ido"],["is","Icelandic","Íslenska"],["it","Italian","Italiano"],["iu","Inuktitut","ᐃᓄᒃᑎᑐᑦ"],["ja","Japanese","日本語"],["jv","Javanese","basa Jawa"],["ka","Georgian","ქართული"],["kg","Kongo","Kikongo"],["ki","Kikuyu","Gĩkũyũ"],["kj","Kwanyama","Kuanyama"],["kk","Kazakh","қазақ тілі"],["kl","Kalaallisut","kalaallisut"],["km","Khmer","ខេមរភាសា"],["kn","Kannada","ಕನ್ನಡ"],["ko","Korean","한국어"],["kr","Kanuri","Kanuri"],["ks","Kashmiri","कश्मीरी"],["ku","Kurmanji (Kurdish)","Kurmancî"],["kv","Komi","коми кыв"],["kw","Cornish","Kernewek"],["ky","Kyrgyz","Кыргызча"],["la","Latin","latine"],["lb","Luxembourgish","Lëtzebuergesch"],["lg","Ganda","Luganda"],["li","Limburgish","Limburgs"],["ln","Lingala","Lingála"],["lo","Lao","ລາວ"],["lt","Lithuanian","lietuvių kalba"],["lu","Luba-Katanga","Tshiluba"],["lv","Latvian","latviešu valoda"],["mg","Malagasy","fiteny malagasy"],["mh","Marshallese","Kajin M̧ajeļ"],["mi","Māori","te reo Māori"],["mk","Macedonian","македонски јазик"],["ml","Malayalam","മലയാളം"],["mn","Mongolian","Монгол хэл"],["mr","Marathi","मराठी"],["ms","Malay","Bahasa Melayu"],["ms-Arab","Jawi Malay","بهاس ملايو"],["mt","Maltese","Malti"],["my","Burmese","ဗမာစာ"],["na","Nauru","Ekakairũ Naoero"],["nb","Norwegian Bokmål","Norsk bokmål"],["nd","Northern Ndebele","isiNdebele"],["ne","Nepali","नेपाली"],["ng","Ndonga","Owambo"],["nl","Dutch","Nederlands"],["nn","Norwegian Nynorsk","Norsk Nynorsk"],["no","Norwegian","Norsk"],["nr","Southern Ndebele","isiNdebele"],["nv","Navajo","Diné bizaad"],["ny","Chichewa","chiCheŵa"],["oc","Occitan","occitan"],["oj","Ojibwe","ᐊᓂᔑᓈᐯᒧᐎᓐ"],["om","Oromo","Afaan Oromoo"],["or","Oriya","ଓଡ଼ିଆ"],["os","Ossetian","ирон æвзаг"],["pa","Punjabi","ਪੰਜਾਬੀ"],["pi","Pāli","पाऴि"],["pl","Polish","Polski"],["ps","Pashto","پښتو"],["pt","Portuguese","Português"],["qu","Quechua","Runa Simi"],["rm","Romansh","rumantsch grischun"],["rn","Kirundi","Ikirundi"],["ro","Romanian","Română"],["ru","Russian","Русский"],["rw","Kinyarwanda","Ikinyarwanda"],["sa","Sanskrit","संस्कृतम्"],["sc","Sardinian","sardu"],["sd","Sindhi","सिन्धी"],["se","Northern Sami","Davvisámegiella"],["sg","Sango","yângâ tî sängö"],["si","Sinhala","සිංහල"],["sk","Slovak","slovenčina"],["sl","Slovenian","slovenščina"],["sn","Shona","chiShona"],["so","Somali","Soomaaliga"],["sq","Albanian","Shqip"],["sr","Serbian","српски језик"],["ss","Swati","SiSwati"],["st","Southern Sotho","Sesotho"],["su","Sundanese","Basa Sunda"],["sv","Swedish","Svenska"],["sw","Swahili","Kiswahili"],["ta","Tamil","தமிழ்"],["te","Telugu","తెలుగు"],["tg","Tajik","тоҷикӣ"],["th","Thai","ไทย"],["ti","Tigrinya","ትግርኛ"],["tk","Turkmen","Türkmen"],["tl","Tagalog","Wikang Tagalog"],["tn","Tswana","Setswana"],["to","Tonga","faka Tonga"],["tr","Turkish","Türkçe"],["ts","Tsonga","Xitsonga"],["tt","Tatar","татар теле"],["tw","Twi","Twi"],["ty","Tahitian","Reo Tahiti"],["ug","Uyghur","ئۇيغۇرچە‎"],["uk","Ukrainian","Українська"],["ur","Urdu","اردو"],["uz","Uzbek","Ўзбек"],["ve","Venda","Tshivenḓa"],["vi","Vietnamese","Tiếng Việt"],["vo","Volapük","Volapük"],["wa","Walloon","walon"],["wo","Wolof","Wollof"],["xh","Xhosa","isiXhosa"],["yi","Yiddish","ייִדיש"],["yo","Yoruba","Yorùbá"],["za","Zhuang","Saɯ cueŋƅ"],["zh","Chinese","中文"],["zu","Zulu","isiZulu"],["zh-CN","Chinese (China)","简体中文"],["zh-HK","Chinese (Hong Kong)","繁體中文(香港)"],["zh-TW","Chinese (Taiwan)","繁體中文(臺灣)"],["zh-YUE","Cantonese","廣東話"],["ast","Asturian","Asturianu"],["chr","Cherokee","ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ"],["ckb","Sorani (Kurdish)","سۆرانی"],["cnr","Montenegrin","crnogorski"],["csb","Kashubian","Kaszëbsczi"],["jbo","Lojban","la .lojban."],["kab","Kabyle","Taqbaylit"],["ldn","Láadan","Láadan"],["lfn","Lingua Franca Nova","lingua franca nova"],["moh","Mohawk","Kanienʼkéha"],["nds","Low German","Plattdüütsch"],["pdc","Pennsylvania Dutch","Pennsilfaani-Deitsch"],["sco","Scots","Scots"],["sma","Southern Sami","Åarjelsaemien Gïele"],["smj","Lule Sami","Julevsámegiella"],["szl","Silesian","ślůnsko godka"],["tok","Toki Pona","toki pona"],["vai","Vai","ꕙꔤ"],["xal","Kalmyk","Хальмг келн"],["zba","Balaibalan","باليبلن"],["zgh","Standard Moroccan Tamazight","ⵜⴰⵎⴰⵣⵉⵖⵜ"]],hi="(((?:[^A-Za-z0-9@@$##\\uFFFE\\uFEFF\\uFFFF]|[\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069]|^))((https?:\\/\\/)((?:(?:(?:[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/](?:[_-]|[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/])*)?[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/]\\.)*(?:(?:[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/](?:-|[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/])*)?[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/]\\.)(?:(?:(?:삼성|닷컴|닷넷|香格里拉|餐厅|食品|飞利浦|電訊盈科|集团|通販|购物|谷歌|诺基亚|联通|网络|网站|网店|网址|组织机构|移动|珠宝|点看|游戏|淡马锡|机构|書籍|时尚|新闻|政府|政务|招聘|手表|手机|我爱你|慈善|微博|广东|工行|家電|娱乐|天主教|大拿|大众汽车|在线|嘉里大酒店|嘉里|商标|商店|商城|公益|公司|八卦|健康|信息|佛山|企业|中文网|中信|世界|ポイント|ファッション|セール|ストア|コム|グーグル|クラウド|みんな|คอม|संगठन|नेट|कॉम|همراه|موقع|موبايلي|كوم|كاثوليك|عرب|شبكة|بيتك|بازار|العليان|ارامكو|اتصالات|ابوظبي|קום|сайт|рус|орг|онлайн|москва|ком|католик|дети|zuerich|zone|zippo|zip|zero|zara|zappos|yun|youtube|you|yokohama|yoga|yodobashi|yandex|yamaxun|yahoo|yachts|xyz|xxx|xperia|xin|xihuan|xfinity|xerox|xbox|wtf|wtc|wow|world|works|work|woodside|wolterskluwer|wme|winners|wine|windows|win|williamhill|wiki|wien|whoswho|weir|weibo|wedding|wed|website|weber|webcam|weatherchannel|weather|watches|watch|warman|wanggou|wang|walter|walmart|wales|vuelos|voyage|voto|voting|vote|volvo|volkswagen|vodka|vlaanderen|vivo|viva|vistaprint|vista|vision|visa|virgin|vip|vin|villas|viking|vig|video|viajes|vet|versicherung|vermögensberatung|vermögensberater|verisign|ventures|vegas|vanguard|vana|vacations|ups|uol|uno|university|unicom|uconnect|ubs|ubank|tvs|tushu|tunes|tui|tube|trv|trust|travelersinsurance|travelers|travelchannel|travel|training|trading|trade|toys|toyota|town|tours|total|toshiba|toray|top|tools|tokyo|today|tmall|tkmaxx|tjx|tjmaxx|tirol|tires|tips|tiffany|tienda|tickets|tiaa|theatre|theater|thd|teva|tennis|temasek|telefonica|telecity|tel|technology|tech|team|tdk|tci|taxi|tax|tattoo|tatar|tatamotors|target|taobao|talk|taipei|tab|systems|symantec|sydney|swiss|swiftcover|swatch|suzuki|surgery|surf|support|supply|supplies|sucks|style|study|studio|stream|store|storage|stockholm|stcgroup|stc|statoil|statefarm|statebank|starhub|star|staples|stada|srt|srl|spreadbetting|spot|sport|spiegel|space|soy|sony|song|solutions|solar|sohu|software|softbank|social|soccer|sncf|smile|smart|sling|skype|sky|skin|ski|site|singles|sina|silk|shriram|showtime|show|shouji|shopping|shop|shoes|shiksha|shia|shell|shaw|sharp|shangrila|sfr|sexy|sex|sew|seven|ses|services|sener|select|seek|security|secure|seat|search|scot|scor|scjohnson|science|schwarz|schule|school|scholarships|schmidt|schaeffler|scb|sca|sbs|sbi|saxo|save|sas|sarl|sapo|sap|sanofi|sandvikcoromant|sandvik|samsung|samsclub|salon|sale|sakura|safety|safe|saarland|ryukyu|rwe|run|ruhr|rugby|rsvp|room|rogers|rodeo|rocks|rocher|rmit|rip|rio|ril|rightathome|ricoh|richardli|rich|rexroth|reviews|review|restaurant|rest|republican|report|repair|rentals|rent|ren|reliance|reit|reisen|reise|rehab|redumbrella|redstone|red|recipes|realty|realtor|realestate|read|raid|radio|racing|qvc|quest|quebec|qpon|pwc|pub|prudential|pru|protection|property|properties|promo|progressive|prof|productions|prod|pro|prime|press|praxi|pramerica|post|porn|politie|poker|pohl|pnc|plus|plumbing|playstation|play|place|pizza|pioneer|pink|ping|pin|pid|pictures|pictet|pics|piaget|physio|photos|photography|photo|phone|philips|phd|pharmacy|pfizer|pet|pccw|pay|passagens|party|parts|partners|pars|paris|panerai|panasonic|pamperedchef|page|ovh|ott|otsuka|osaka|origins|orientexpress|organic|org|orange|oracle|open|ooo|onyourside|online|onl|ong|one|omega|ollo|oldnavy|olayangroup|olayan|okinawa|office|off|observer|obi|nyc|ntt|nrw|nra|nowtv|nowruz|now|norton|northwesternmutual|nokia|nissay|nissan|ninja|nikon|nike|nico|nhk|ngo|nfl|nexus|nextdirect|next|news|newholland|new|neustar|network|netflix|netbank|net|nec|nba|navy|natura|nationwide|name|nagoya|nadex|nab|mutuelle|mutual|museum|mtr|mtpc|mtn|msd|movistar|movie|mov|motorcycles|moto|moscow|mortgage|mormon|mopar|montblanc|monster|money|monash|mom|moi|moe|moda|mobily|mobile|mobi|mma|mls|mlb|mitsubishi|mit|mint|mini|mil|microsoft|miami|metlife|merckmsd|meo|menu|men|memorial|meme|melbourne|meet|media|med|mckinsey|mcdonalds|mcd|mba|mattel|maserati|marshalls|marriott|markets|marketing|market|map|mango|management|man|makeup|maison|maif|madrid|macys|luxury|luxe|lupin|lundbeck|ltda|ltd|lplfinancial|lpl|love|lotto|lotte|london|lol|loft|locus|locker|loans|loan|llp|llc|lixil|living|live|lipsy|link|linde|lincoln|limo|limited|lilly|like|lighting|lifestyle|lifeinsurance|life|lidl|liaison|lgbt|lexus|lego|legal|lefrak|leclerc|lease|lds|lawyer|law|latrobe|latino|lat|lasalle|lanxess|landrover|land|lancome|lancia|lancaster|lamer|lamborghini|ladbrokes|lacaixa|kyoto|kuokgroup|kred|krd|kpn|kpmg|kosher|komatsu|koeln|kiwi|kitchen|kindle|kinder|kim|kia|kfh|kerryproperties|kerrylogistics|kerryhotels|kddi|kaufen|juniper|juegos|jprs|jpmorgan|joy|jot|joburg|jobs|jnj|jmp|jll|jlc|jio|jewelry|jetzt|jeep|jcp|jcb|java|jaguar|iwc|iveco|itv|itau|istanbul|ist|ismaili|iselect|irish|ipiranga|investments|intuit|international|intel|int|insure|insurance|institute|ink|ing|info|infiniti|industries|inc|immobilien|immo|imdb|imamat|ikano|iinet|ifm|ieee|icu|ice|icbc|ibm|hyundai|hyatt|hughes|htc|hsbc|how|house|hotmail|hotels|hoteles|hot|hosting|host|hospital|horse|honeywell|honda|homesense|homes|homegoods|homedepot|holiday|holdings|hockey|hkt|hiv|hitachi|hisamitsu|hiphop|hgtv|hermes|here|helsinki|help|healthcare|health|hdfcbank|hdfc|hbo|haus|hangout|hamburg|hair|guru|guitars|guide|guge|gucci|guardian|group|grocery|gripe|green|gratis|graphics|grainger|gov|got|gop|google|goog|goodyear|goodhands|goo|golf|goldpoint|gold|godaddy|gmx|gmo|gmbh|gmail|globo|global|gle|glass|glade|giving|gives|gifts|gift|ggee|george|genting|gent|gea|gdn|gbiz|gay|garden|gap|games|game|gallup|gallo|gallery|gal|fyi|futbol|furniture|fund|fun|fujixerox|fujitsu|ftr|frontier|frontdoor|frogans|frl|fresenius|free|fox|foundation|forum|forsale|forex|ford|football|foodnetwork|food|foo|fly|flsmidth|flowers|florist|flir|flights|flickr|fitness|fit|fishing|fish|firmdale|firestone|fire|financial|finance|final|film|fido|fidelity|fiat|ferrero|ferrari|feedback|fedex|fast|fashion|farmers|farm|fans|fan|family|faith|fairwinds|fail|fage|extraspace|express|exposed|expert|exchange|everbank|events|eus|eurovision|etisalat|esurance|estate|esq|erni|ericsson|equipment|epson|epost|enterprises|engineering|engineer|energy|emerck|email|education|edu|edeka|eco|eat|earth|dvr|dvag|durban|dupont|duns|dunlop|duck|dubai|dtv|drive|download|dot|doosan|domains|doha|dog|dodge|doctor|docs|dnp|diy|dish|discover|discount|directory|direct|digital|diet|diamonds|dhl|dev|design|desi|dentist|dental|democrat|delta|deloitte|dell|delivery|degree|deals|dealer|deal|dds|dclk|day|datsun|dating|date|data|dance|dad|dabur|cyou|cymru|cuisinella|csc|cruises|cruise|crs|crown|cricket|creditunion|creditcard|credit|cpa|courses|coupons|coupon|country|corsica|coop|cool|cookingchannel|cooking|contractors|contact|consulting|construction|condos|comsec|computer|compare|company|community|commbank|comcast|com|cologne|college|coffee|codes|coach|clubmed|club|cloud|clothing|clinique|clinic|click|cleaning|claims|cityeats|city|citic|citi|citadel|cisco|circle|cipriani|church|chrysler|chrome|christmas|chloe|chintai|cheap|chat|chase|charity|channel|chanel|cfd|cfa|cern|ceo|center|ceb|cbs|cbre|cbn|cba|catholic|catering|cat|casino|cash|caseih|case|casa|cartier|cars|careers|career|care|cards|caravan|car|capitalone|capital|capetown|canon|cancerresearch|camp|camera|cam|calvinklein|call|cal|cafe|cab|bzh|buzz|buy|business|builders|build|bugatti|budapest|brussels|brother|broker|broadway|bridgestone|bradesco|box|boutique|bot|boston|bostik|bosch|boots|booking|book|boo|bond|bom|bofa|boehringer|boats|bnpparibas|bnl|bmw|bms|blue|bloomberg|blog|blockbuster|blanco|blackfriday|black|biz|bio|bingo|bing|bike|bid|bible|bharti|bet|bestbuy|best|berlin|bentley|beer|beauty|beats|bcn|bcg|bbva|bbt|bbc|bayern|bauhaus|basketball|baseball|bargains|barefoot|barclays|barclaycard|barcelona|bar|bank|band|bananarepublic|banamex|baidu|baby|azure|axa|aws|avianca|autos|auto|author|auspost|audio|audible|audi|auction|attorney|athleta|associates|asia|asda|arte|art|arpa|army|archi|aramco|arab|aquarelle|apple|app|apartments|aol|anz|anquan|android|analytics|amsterdam|amica|amfam|amex|americanfamily|americanexpress|alstom|alsace|ally|allstate|allfinanz|alipay|alibaba|alfaromeo|akdn|airtel|airforce|airbus|aigo|aig|agency|agakhan|africa|afl|afamilycompany|aetna|aero|aeg|adult|ads|adac|actor|active|aco|accountants|accountant|accenture|academy|abudhabi|abogado|able|abc|abbvie|abbott|abb|abarth|aarp|aaa|onion)(?=[^0-9a-zA-Z@+-]|$))|(?:(?:한국|香港|澳門|新加坡|台灣|台湾|中國|中国|გე|ລາວ|ไทย|ලංකා|ഭാരതം|ಭಾರತ|భారత్|சிங்கப்பூர்|இலங்கை|இந்தியா|ଭାରତ|ભારત|ਭਾਰਤ|ভাৰত|ভারত|বাংলা|भारोत|भारतम्|भारत|ڀارت|پاکستان|موريتانيا|مليسيا|مصر|قطر|فلسطين|عمان|عراق|سورية|سودان|تونس|بھارت|بارت|ایران|امارات|المغرب|السعودية|الجزائر|البحرين|الاردن|հայ|қаз|укр|срб|рф|мон|мкд|ею|бел|бг|ευ|ελ|zw|zm|za|yt|ye|ws|wf|vu|vn|vi|vg|ve|vc|va|uz|uy|us|um|uk|ug|ua|tz|tw|tv|tt|tr|tp|to|tn|tm|tl|tk|tj|th|tg|tf|td|tc|sz|sy|sx|sv|su|st|ss|sr|so|sn|sm|sl|sk|sj|si|sh|sg|se|sd|sc|sb|sa|rw|ru|rs|ro|re|qa|py|pw|pt|ps|pr|pn|pm|pl|pk|ph|pg|pf|pe|pa|om|nz|nu|nr|np|no|nl|ni|ng|nf|ne|nc|na|mz|my|mx|mw|mv|mu|mt|ms|mr|mq|mp|mo|mn|mm|ml|mk|mh|mg|mf|me|md|mc|ma|ly|lv|lu|lt|ls|lr|lk|li|lc|lb|la|kz|ky|kw|kr|kp|kn|km|ki|kh|kg|ke|jp|jo|jm|je|it|is|ir|iq|io|in|im|il|ie|id|hu|ht|hr|hn|hm|hk|gy|gw|gu|gt|gs|gr|gq|gp|gn|gm|gl|gi|gh|gg|gf|ge|gd|gb|ga|fr|fo|fm|fk|fj|fi|eu|et|es|er|eh|eg|ee|ec|dz|do|dm|dk|dj|de|cz|cy|cx|cw|cv|cu|cr|co|cn|cm|cl|ck|ci|ch|cg|cf|cd|cc|ca|bz|by|bw|bv|bt|bs|br|bq|bo|bn|bm|bl|bj|bi|bh|bg|bf|be|bd|bb|ba|az|ax|aw|au|at|as|ar|aq|ao|an|am|al|ai|ag|af|ae|ad|ac)(?=[^0-9a-zA-Z@+-]|$))|(?:xn--[\\-0-9a-z]+))))(?::([0-9]+))?(\\/(?:(?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*(?:\\((?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+|(?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*\\([a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+\\)[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*))\\)[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*)*[\\+\\-a-z\\u0400-\\u04FF0-9=_#\\/\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]|(?:\\((?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+|(?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*\\([a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+\\)[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*))\\)))|(?:@[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+\\/))*)?(\\?[a-z0-9!?\\*'@\\(\\);:&=\\+\\$\\/%#\\[\\]\\-_\\.,~|]*[a-z0-9\\-_&=#\\/])?))",pi="gi",Xt={source:hi,flags:pi},mi={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_IMG_ALT_API_URL:kt,PHANPY_GIPHY_API_KEY:gi}=mi,fi=Tt.reduce((s,t)=>{const[n,a,l]=t;return s[n]={common:a,native:l},s},{}),hn={300:Le(5,"minute"),1800:Le(30,"minute"),3600:Le(1,"hour"),21600:Le(6,"hour"),86400:Le(1,"day"),259200:Le(3,"day"),604800:Le(1,"week")},vi=Object.keys(hn),Qt=24*60*60,en=s=>{if(!s)return Qt;const t=(new Date(s).getTime()-Date.now())/1e3;return vi.find(n=>n>=t)||Qt},Ce=document.createElement("ul");Ce.role="listbox";Ce.className="text-expander-menu";const bi=16,xi=new IntersectionObserver(s=>{s.forEach(t=>{if(t.isIntersecting){const{left:n,width:a}=t.boundingClientRect,{innerWidth:l}=window;if(n+a>l){const d=$n()?"right":"left";Ce.style[d]=l-a-bi+"px"}}})});xi.observe(Ce);const Ae=An([new Intl.DateTimeFormat().resolvedOptions().locale,...navigator.languages],Tt.map(s=>s[0]),"en"),pn=new RegExp(Xt.source,Xt.flags),yi=/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/gi,wi="$2xxxxxxxxxxxxxxxxxxxxxxx";function ki(s){return s.replace(pn,wi).replace(yi,"$1@$3")}const Ei=/[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?/i,Fi=new RegExp(`(^|[^=\\/\\w])(@${Ei.source}(?:@[\\p{L}\\w.-]+[\\w]+)?)`,"uig"),Ci=new RegExp("(^|[^=\\/\\w])(#[a-z0-9_]+([a-z0-9_.]+[a-z0-9_]+)?)(?![\\/\\w])","ig"),zi="[a-zA-Z0-9_]{2,}",Li=new RegExp(`(^|[^=\\/\\w])(:${zi}:)(?=[^A-Za-z0-9_:]|$)`,"g"),Ai=new Intl.Segmenter;function Et(s){return s.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Si(s,{maxCharacters:t=1/0}){const{composerCharacterCount:n}=ce;if(n>t){let a="",l="";const d=Ai.segment(s);for(const{segment:r,index:p}of d)p"),Et(a)+l}return Et(s).replace(pn,'$2$3').replace(Fi,'$1$2').replace(Ci,'$1$2').replace(Li,'$1$2')}const _i=on(s=>new Intl.RelativeTimeFormat(s||void 0)),Ii=on(s=>new Intl.ListFormat(s||void 0)),It=100,Ee={media:{id:"MfJ43d"},customEmoji:{id:"ggiJLM"},gif:{id:"Fm6c4W"},poll:{id:"cZJ92q"}};function Wi({onClose:s,replyToStatus:t,editStatus:n,draftStatus:a,standalone:l,hasOpener:d}){var Nt;const{i18n:r,_:p,_:F}=ze(),v=_i(r.locale),re=Ii(r.locale),{masto:T,instance:g}=Bt(),[E,R]=H("default"),W=q((a==null?void 0:a.uid)||jn()),$=Sn(),P=$.info,le=rn(),{statuses:{maxCharacters:w,maxMediaAttachments:c,charactersReservedPerUrl:f}={},mediaAttachments:{supportedMimeTypes:b,imageSizeLimit:y,imageMatrixLimit:M,videoSizeLimit:z,videoMatrixLimit:J,videoFrameRateLimit:ne}={},polls:{maxOptions:X,maxCharactersPerOption:U,maxExpiration:ve,minExpiration:pe}={}}=le||{},_=q(),j=q(),[Z,se]=H("public"),[V,ie]=H(!1),[Q,I]=H(Te.session.get("currentLanguage")||Ae),K=q(Q),[m,ee]=H([]),[D,ue]=H(null),ae=Te.account.get("preferences")||{},be=()=>{_.current&&_.current.dispatchEvent(new Event("input"))},xe=()=>{setTimeout(()=>{var o,u,k;_.current&&((u=(o=a==null?void 0:a.status)==null?void 0:o.startsWith)!=null&&u.call(o,` +`)&&(_.current.selectionStart=0,_.current.selectionEnd=0),(k=_.current)==null||k.focus())},300)};oe(()=>{var o,u;if(t){const{spoilerText:k,visibility:h,language:A,sensitive:L}=t;k&&j.current&&(j.current.value=k);const x=[...new Set([t.account.acct,...t.mentions.map(C=>C.acct)])].filter(C=>C!==P.acct);x.length>0&&(_.current.value=`${x.map(C=>`@${C}`).join(" ")} `,be()),xe(),se(h==="public"&&ae["posting:default:visibility"]?ae["posting:default:visibility"].toLowerCase():h),I(A||((o=ae["posting:default:language"])==null?void 0:o.toLowerCase())||Ae),ie(L&&!!k)}else if(n){const{visibility:k,language:h,sensitive:A,poll:L,mediaAttachments:S}=n,x=!!(L!=null&&L.options)&&{...L,options:L.options.map(C=>(C==null?void 0:C.title)||C),expiresIn:(L==null?void 0:L.expiresIn)||en(L.expiresAt)};R("loading"),(async()=>{var C;try{const O=await T.v1.statuses.$select(n.id).source.fetch(),{text:me,spoilerText:fe}=O;_.current.value=me,_.current.dataset.source=me,be(),xe(),j.current.value=fe,se(k),I(h||((C=ae["posting:default:language"])==null?void 0:C.toLowerCase())||Ae),ie(A),x&&ue(x),ee(S),R("default")}catch(O){alert((O==null?void 0:O.reason)||O),R("error")}})()}else xe(),ae["posting:default:visibility"]&&se(ae["posting:default:visibility"].toLowerCase()),ae["posting:default:language"]&&I(ae["posting:default:language"].toLowerCase()),ae["posting:default:sensitive"]&&ie(!!ae["posting:default:sensitive"]);if(a){const{status:k,spoilerText:h,visibility:A,language:L,sensitive:S,poll:x,mediaAttachments:C}=a,O=!!(x!=null&&x.options)&&{...x,options:x.options.map(me=>(me==null?void 0:me.title)||me),expiresIn:(x==null?void 0:x.expiresIn)||en(x.expiresAt)};_.current.value=k,be(),xe(),h&&(j.current.value=h),A&&se(A),I(L||((u=ae["posting:default:language"])==null?void 0:u.toLowerCase())||Ae),S!==null&&ie(S),O&&ue(O),C&&ee(C)}},[a,n,t]);const Ye=q(),Rt=F({id:"hR9gtK"}),pt=()=>{const{value:o,dataset:u}=_.current;if(E==="loading")return!1;const k=(o||"").trim().replace(new RegExp("^\\p{White_Space}+|\\p{White_Space}+$","gu"),""),h=m.length>0;if(!k&&!h||m.length>0&&m.every(C=>C.id))return!0;const L=(t==null?void 0:t.account.id)===P.id,S=t&&o.trim()===`@${t.account.acct}`;return!!(!L&&S||o===(u==null?void 0:u.source))},Ze=()=>pt()?!0:confirm(Rt);oe(()=>{const o=u=>{pt()||(u.preventDefault(),u.returnValue=Rt)};return window.addEventListener("beforeunload",o,{capture:!0}),()=>window.removeEventListener("beforeunload",o,{capture:!0})},[]);const fn=()=>{const{value:o}=_.current,{value:u}=j.current;return Jt(ki(o))+Jt(u)},mt=()=>{const o=fn();ce.composerCharacterCount=o};oe(mt,[]);const Dt=window.CloseWatcher,gt=q(!1);Ke("esc",()=>{gt.current=!0},{enabled:!Dt,enableOnFormTags:!0}),Ke("esc",()=>{!l&>.current&&Ze()&&s(),gt.current=!1},{enabled:!Dt,enableOnFormTags:!0,keyup:!0,ignoreEventWhen:o=>{const u=document.querySelectorAll("#modal-container > *"),k=!!u,h=u.length===1&&u[0].querySelector("#compose-container");return k&&!h}}),Pn(()=>{!l&&Ze()&&s()},[l,Ze,s]);const $t=q({}),jt=()=>`${_n()}#${W.current}`,ft=()=>{if(n||ce.composerState.minimized)return;const o=jt(),u={key:o,replyTo:t?{id:t.id,account:{id:t.account.id,username:t.account.username,acct:t.account.acct}}:null,draftStatus:{uid:W.current,status:_.current.value,spoilerText:j.current.value,visibility:Z,language:Q,sensitive:V,poll:D,mediaAttachments:m}};!In(u,$t.current)&&!pt()&&(Ut.drafts.set(o,{...u,state:"unsaved",updatedAt:Date.now()}).then(()=>{}).catch(k=>{}),$t.current=structuredClone(u))};On(ft,5e3),oe(()=>(ft(),()=>{Ut.drafts.del(jt())}),[]),oe(()=>{const o=k=>{const{items:h}=k.clipboardData||k.dataTransfer,A=[],L=[];for(let S=0;S0&&alert(Oe._({id:"rpXAF6",values:{0:L.length,1:L[0].name,2:re.format(L.map(S=>S.name))}})),A.length>0&&m.length>=c){alert(Oe._({id:"ctFhjs",values:{maxMediaAttachments:c}}));return}if(A.length>0){k.preventDefault(),k.stopPropagation();let S=A;if(c!==void 0){const C=c-m.length;if(S=S.slice(0,C),S.length<=0){alert(Oe._({id:"ctFhjs",values:{maxMediaAttachments:c}}));return}}const x=S.map(C=>({file:C,type:C.type,size:C.size,url:URL.createObjectURL(C),id:null,description:null}));ee([...m,...x])}};window.addEventListener("paste",o);const u=k=>{k.dataTransfer.items.length>0&&(k.preventDefault(),k.stopPropagation())};return window.addEventListener("dragover",u),window.addEventListener("drop",o),()=>{window.removeEventListener("paste",o),window.removeEventListener("dragover",u),window.removeEventListener("drop",o)}},[m]);const[Je,vt]=H(!1),[Xe,Pe]=H(!1),[vn,Qe]=H(!1),[we,bn]=H(null),[xn,yn]=Ne(()=>{const o=[],u=[],{contentTranslationHideLanguages:k=[]}=ce.settings;return Tt.forEach(h=>{const[A]=h;A===Q||A===K.current||A===Ae||k.includes(A)||we!=null&&we.length&&we.includes(A)?o.push(h):u.push(h)}),o.sort(([h,A],[L,S])=>h===Q?-1:L===Q?1:A.localeCompare(S)),u.sort(([h,A],[L,S])=>A.localeCompare(S)),[o,u]},[Q,we]),Pt=Ne(()=>!!(t!=null&&t.createdAt)&&Math.floor((Date.now()-new Date(t.createdAt))/(1e3*60*60*24*30)),[t]),wn=()=>{ft(),ce.composerState.minimized=!0},Ot=E==="loading"||c!==void 0&&m.length>=c||!!D,kn=X==null||X>1,Ht=E==="loading"||!!D||!!m.length,Kt=()=>{ue({options:["",""],expiresIn:24*60*60,multiple:!1})},et=q(),[En,Fn]=H(!1);return Hn({ref:et,box:"border-box",onResize:({width:o})=>{const{scrollWidth:u}=et.current,k=u>o,h=o<84;Fn(h||k),et.current.hidden=h}}),e("div",{id:"compose-container-outer",children:[e("div",{id:"compose-container",class:l?"standalone":"",children:[e("div",{class:"compose-top",children:[(P==null?void 0:P.avatarStatic)&&e(cn,{account:P,accountInstance:$.instanceURL,hideDisplayName:!0,useAvatarStatic:!0}),l?d&&e("button",{type:"button",class:"light pop-button",disabled:E==="loading",onClick:()=>{var o;if(!window.opener){alert(F({id:"qiPXgY"}));return}if(window.opener.__STATES__.showCompose){if((o=window.opener.__STATES__.composerState)!=null&&o.publishing){alert(F({id:"Z2l5Bt"}));return}let u=F({id:"AB/GtR"});if(!confirm(u))return}s({fn:()=>{const u={editStatus:n,replyToStatus:t,draftStatus:{uid:W.current,status:_.current.value,spoilerText:j.current.value,visibility:Z,language:Q,sensitive:V,poll:D,mediaAttachments:m}};window.opener.__COMPOSE__=u,window.opener.__STATES__.showCompose?(window.opener.__STATES__.showCompose=!1,setTimeout(()=>{window.opener.__STATES__.showCompose=!0},10)):window.opener.__STATES__.showCompose=!0,window.opener.__STATES__.composerState.minimized&&(window.opener.__STATES__.composerState.minimized=!1)}})},children:e(N,{icon:"popin",alt:F({id:"/5ZKeE"})})}):e("span",{class:"compose-controls",children:[e("button",{type:"button",class:"plain4 pop-button",disabled:E==="loading",onClick:()=>{Kn({editStatus:n,replyToStatus:t,draftStatus:{uid:W.current,status:_.current.value,spoilerText:j.current.value,visibility:Z,language:Q,sensitive:V,poll:D,mediaAttachments:m}})&&s()},children:e(N,{icon:"popout",alt:F({id:"JsU2En"})})}),e("button",{type:"button",class:"plain4 min-button",onClick:wn,children:e(N,{icon:"minimize",alt:F({id:"3TSz9S"})})})," ",e("button",{type:"button",class:"light close-button",disabled:E==="loading",onClick:()=>{Ze()&&s()},children:e(N,{icon:"x",alt:F({id:"yz7wBu"})})})]})]}),!!t&&e("div",{class:"status-preview",children:[e(Vt,{status:t,size:"s",previewMode:!0}),e("div",{class:"status-preview-legend reply-to",children:Pt>0?e(G,{id:"Q1Huya",values:{0:t.account.acct||t.account.username,1:v.format(-Pt,"month")},components:{0:e("strong",{})}}):e(G,{id:"dwLCPZ",values:{0:t.account.acct||t.account.username}})})]}),!!n&&e("div",{class:"status-preview",children:[e(Vt,{status:n,size:"s",previewMode:!0}),e("div",{class:"status-preview-legend",children:e(G,{id:"wKtOLH"})})]}),e("form",{ref:Ye,class:`form-visibility-${Z}`,style:{pointerEvents:E==="loading"?"none":"auto",opacity:E==="loading"?.5:1},onKeyDown:o=>{o.key==="Enter"&&(o.ctrlKey||o.metaKey)&&Ye.current.dispatchEvent(new Event("submit",{cancelable:!0}))},onSubmit:o=>{o.preventDefault();const u=new FormData(o.target),k=Object.fromEntries(u.entries());let{status:h,visibility:A,sensitive:L,spoilerText:S}=k;if(L=L==="on",D){if(D.options.length<2){alert(F({id:"zhrMYj"}));return}if(D.options.some(x=>x==="")){alert(F({id:"uNVxXX"}));return}}m.length>0&&m.some(C=>{var O,me;return!((me=(O=C.description)==null?void 0:O.trim)!=null&&me.call(O))})&&!confirm(F({id:"MQYucx"}))||(S=L&&S||void 0,h=h===""?void 0:h,ce.composerState.publishing=!0,R("loading"),(async()=>{try{if(m.length>0){const O=m.map(fe=>{const{file:tt,description:Cn,id:zn}=fe;if(zn)return fe;{const Ln=an({file:tt,description:Cn});return T.v2.media.create(Ln).then(bt=>(bt.id&&(fe.id=bt.id),bt))}}),me=await Promise.allSettled(O);if(me.some(fe=>{var tt;return fe.status==="rejected"||!((tt=fe.value)!=null&&tt.id)})){ce.composerState.publishing=!1,ce.composerState.publishingError=!0,R("error"),me.forEach(fe=>{fe.status==="rejected"&&alert(fe.reason||F({id:"eIiurD",values:{i}}))});return}}let x={status:h,spoiler_text:S,language:Q,sensitive:L,poll:D,media_ids:m.map(O=>O.id)};n&&st("@mastodon/edit-media-attributes")?x.media_attributes=m.map(O=>({id:O.id,description:O.description})):n||(x.visibility=A,x.in_reply_to_id=(t==null?void 0:t.id)||void 0),x=an(x);let C;if(n)C=await T.v1.statuses.$select(n.id).update(x),Bn(C,g,{skipThreading:!0});else try{C=await T.v1.statuses.create(x,{requestInit:{headers:{"Idempotency-Key":W.current}}})}catch{C=await T.v1.statuses.create(x)}ce.composerState.minimized=!1,ce.composerState.publishing=!1,R("default"),s({type:n?"edit":t?"reply":"post",newStatus:C,instance:g})}catch(x){ce.composerState.publishing=!1,ce.composerState.publishingError=!0,alert((x==null?void 0:x.reason)||x),R("error")}})())},children:[e("div",{class:"toolbar stretch",children:[e("input",{ref:j,type:"text",name:"spoilerText",placeholder:F({id:"gnKo7f"}),disabled:E==="loading",class:"spoiler-text-field",lang:Q,spellCheck:"true",dir:"auto",style:{opacity:V?1:0,pointerEvents:V?"auto":"none"},onInput:()=>{mt()}}),e("label",{class:`toolbar-button ${V?"highlight":""}`,title:F({id:"zKu2Aq"}),children:[e("input",{name:"sensitive",type:"checkbox",checked:V,disabled:E==="loading",onChange:o=>{var k,h;const u=o.target.checked;ie(u),u?(k=j.current)==null||k.focus():(h=_.current)==null||h.focus()}}),e(N,{icon:`eye-${V?"close":"open"}`})]})," ",e("label",{class:`toolbar-button ${Z!=="public"&&!V?"show-field":""} ${Z!=="public"?"highlight":""}`,title:Z,children:[e(N,{icon:Nn[Z],alt:Z}),e("select",{name:"visibility",value:Z,onChange:o=>{se(o.target.value)},disabled:E==="loading"||!!n,dir:"auto",children:[e("option",{value:"public",children:e(G,{id:"7d1a0d"})}),(st("@pleroma/local-visibility-post")||st("@akkoma/local-visibility-post"))&&e("option",{value:"local",children:e(G,{id:"d5zxa4"})}),e("option",{value:"unlisted",children:e(G,{id:"WDcQq9"})}),e("option",{value:"private",children:e(G,{id:"o34OrG"})}),e("option",{value:"direct",children:e(G,{id:"IV4QaU"})})]})]})," "]}),e(Mi,{ref:_,placeholder:F(t?{id:"Sjj+EN"}:n?{id:"qzVesX"}:{id:"owpNF1"}),required:(m==null?void 0:m.length)===0,disabled:E==="loading",lang:Q,onInput:()=>{mt()},maxCharacters:w,performSearch:o=>{const{type:u,q:k,limit:h}=o;return u==="accounts"?T.v1.accounts.search.list({q:k,limit:h,resolve:!1}):T.v2.search.fetch(o)},onTrigger:o=>{(o==null?void 0:o.name)==="custom-emojis"?Pe({defaultSearchTerm:(o==null?void 0:o.defaultSearchTerm)||null}):(o==null?void 0:o.name)==="mention"?vt({defaultSearchTerm:(o==null?void 0:o.defaultSearchTerm)||null}):(o==null?void 0:o.name)==="auto-detect-language"&&(o!=null&&o.languages)&&bn(o.languages)}}),(m==null?void 0:m.length)>0&&e("div",{class:"media-attachments",children:[m.map((o,u)=>{const{id:k,file:h}=o,A=(h==null?void 0:h.size)+(h==null?void 0:h.type)+(h==null?void 0:h.name);return e(Di,{attachment:o,disabled:E==="loading",lang:Q,onDescriptionChange:L=>{ee(S=>{const x=[...S];return x[u]={...x[u],description:L},x})},onRemove:()=>{ee(L=>L.filter((S,x)=>x!==u))}},k||A||u)}),e("label",{class:"media-sensitive",children:[e("input",{name:"sensitive",type:"checkbox",checked:V,disabled:E==="loading",onChange:o=>{const u=o.target.checked;ie(u)}})," ",e("span",{children:e(G,{id:"jER18a"})})," ",e(N,{icon:`eye-${V?"close":"open"}`})]})]}),!!D&&e($i,{lang:Q,maxOptions:X,maxExpiration:ve,minExpiration:pe,maxCharactersPerOption:U,poll:D,disabled:E==="loading",onInput:o=>{if(o){const u={...o};ue(u)}else ue(null)}}),e("div",{class:"toolbar compose-footer",children:[e("span",{class:"add-toolbar-button-group spacer",children:[En&&e(un,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},menuButton:({open:o})=>e("button",{type:"button",class:`toolbar-button add-button ${o?"active":""}`,children:e(N,{icon:"plus",title:F({id:"m16xKo"})})}),children:[e(Be,{className:"compose-menu-add-media",children:[e("label",{class:"compose-menu-add-media-field",children:e(tn,{hidden:!0,supportedMimeTypes:b,maxMediaAttachments:c,mediaAttachments:m,disabled:E==="loading"||m.length>=c||!!D,setMediaAttachments:ee})}),e(N,{icon:"media"})," ",e("span",{children:p(Ee.media)})]}),e(Be,{onClick:()=>{Pe(!0)},children:[e(N,{icon:"emoji2"})," ",e("span",{children:p(Ee.customEmoji)})]}),!!ce.settings.composerGIFPicker&&e(Be,{disabled:Ot,onClick:()=>{Qe(!0)},children:[e("span",{class:"icon icon-gif",role:"img"}),e("span",{children:p(Ee.gif)})]}),e(Be,{disabled:Ht,onClick:Kt,children:[e(N,{icon:"poll"})," ",e("span",{children:p(Ee.poll)})]})]}),e("span",{class:"add-sub-toolbar-button-group",ref:et,children:[e("label",{class:"toolbar-button",children:[e(tn,{supportedMimeTypes:b,maxMediaAttachments:c,mediaAttachments:m,disabled:E==="loading"||m.length>=c||!!D,setMediaAttachments:ee}),e(N,{icon:"media",alt:p(Ee.media)})]}),e("button",{type:"button",class:"toolbar-button",disabled:E==="loading",onClick:()=>{Pe(!0)},children:e(N,{icon:"emoji2",alt:p(Ee.customEmoji)})}),!!ce.settings.composerGIFPicker&&e("button",{type:"button",class:"toolbar-button gif-picker-button",disabled:Ot,onClick:()=>{Qe(!0)},children:e("span",{class:"icon icon-gif","aria-label":p(Ee.gif)})}),kn&&e(qe,{children:e("button",{type:"button",class:"toolbar-button",disabled:Ht,onClick:Kt,children:e(N,{icon:"poll",alt:p(Ee.poll)})})})]})]}),E==="loading"?e(dt,{abrupt:!0}):e(Ri,{maxCharacters:w,hidden:E==="loading"}),e("label",{class:`toolbar-button ${Q!==K.current||we!=null&&we.length&&!we.includes(Q)?"highlight":""}`,children:[e("span",{class:"icon-text",children:(Nt=fi[Q])==null?void 0:Nt.native}),e("select",{name:"language",value:Q,onChange:o=>{const{value:u}=o.target;I(u||Ae),Te.session.set("currentLanguage",u||Ae)},disabled:E==="loading",dir:"auto",children:[xn.map(([o,u,k])=>{const h=Ct({code:o,fallback:u});return e("option",{value:o,children:h!==k?`${k} - ${h}`:h},o)}),e("hr",{}),yn.map(([o,u,k])=>{const h=Ct({code:o,fallback:u});return e("option",{value:o,children:h!==k?`${k} - ${h}`:h},o)})]})]})," ",e("button",{type:"submit",disabled:E==="loading",children:F(t?{id:"ImOQa9"}:n?{id:"EkH9pt"}:{id:"GMe2XV"})})]})]})]}),Je&&e(at,{onClick:o=>{o.target===o.currentTarget&&vt(!1)},children:e(ji,{masto:T,instance:g,onClose:()=>{vt(!1)},defaultSearchTerm:Je==null?void 0:Je.defaultSearchTerm,onSelect:o=>{const u=_.current;if(!u)return;const{selectionStart:k,selectionEnd:h}=u,A=u.value,L=A.slice(0,k),S=L?/[\s\t\n\r]$/.test(L)?"":" ":"",x=A.slice(h),C=/^[\s\t\n\r]/.test(x)?"":" ",O=L+S+"@"+o+C+x;u.value=O,u.selectionStart=u.selectionEnd=h+1+o.length+C.length,u.focus(),u.dispatchEvent(new Event("input"))}})}),Xe&&e(at,{onClick:o=>{o.target===o.currentTarget&&Pe(!1)},children:e(Pi,{masto:T,instance:g,onClose:()=>{Pe(!1)},defaultSearchTerm:Xe==null?void 0:Xe.defaultSearchTerm,onSelect:o=>{const u=_.current;if(!u)return;const{selectionStart:k,selectionEnd:h}=u,A=u.value,L=A.slice(0,k),S=L?/[\s\t\n\r]$/.test(L)?"":" ":"",x=A.slice(h),C=/^[\s\t\n\r]/.test(x)?"":" ",O=L+S+o+C+x;u.value=O,u.selectionStart=u.selectionEnd=h+o.length+C.length,u.focus(),u.dispatchEvent(new Event("input"))}})}),vn&&e(at,{onClick:o=>{o.target===o.currentTarget&&Qe(!1)},children:e(Hi,{onClose:()=>Qe(!1),onSelect:({url:o,type:u,alt_text:k})=>{if(m.length>=c){alert(Oe._({id:"ctFhjs",values:{maxMediaAttachments:c}}));return}(async()=>{var A,L;let h;try{h=Se({text:F({id:"/Cw4Tx"}),duration:-1});const S=await fetch(o,{referrerPolicy:"no-referrer"}).then(O=>O.blob()),x=new File([S],u==="video/mp4"?"video.mp4":"image.gif",{type:u}),C=[...m,{file:x,type:u,size:x.size,id:null,description:k||""}];ee(C),(A=h==null?void 0:h.hideToast)==null||A.call(h)}catch{(L=h==null?void 0:h.hideToast)==null||L.call(h),Se(F({id:"VKDnAx"}))}})()}})})]})}function tn({hidden:s,supportedMimeTypes:t,maxMediaAttachments:n,mediaAttachments:a,disabled:l=!1,setMediaAttachments:d}){return e("input",{type:"file",hidden:s,accept:t==null?void 0:t.join(","),multiple:n===void 0||n-a>=2,disabled:l,onChange:r=>{const p=r.target.files;if(!p)return;const F=Array.from(p).map(v=>({file:v,type:v.type,size:v.size,url:URL.createObjectURL(v),id:null,description:null}));a.length+F.length>n?alert(Oe._({id:"ctFhjs",values:{maxMediaAttachments:n}})):d(v=>v.concat(F)),r.target.value=""}})}function nn(s){if(!s)return;const{value:t,offsetHeight:n,scrollHeight:a,clientHeight:l}=s;if(nd.visibleInPicker),l=new qn(a,{keys:["shortcode"],findAllMatches:!0});return[a,l]}const mn=Tn(Bi,{matchesArg:(s,t)=>s.instance===t.instance,maxAge:30*60*1e3}),Ti=async s=>{const{detectAll:t}=await Mn(async()=>{const{detectAll:a}=await import("./tinyld-light-tbgyvj3S.js");return{detectAll:a}},[],import.meta.url),n=t(s);return n!=null&&n.length?n.slice(0,2).map(a=>a.lang):null},Mi=Rn((s,t)=>{var w;const{_:n}=ze(),{masto:a,instance:l}=Bt(),[d,r]=H(((w=t.current)==null?void 0:w.value)||""),{maxCharacters:p,performSearch:F=()=>{},onTrigger:v=()=>{},...re}=s,T=q();oe(()=>{mn(l,a).then(c=>{const[f,b]=c;T.current=b}).catch(c=>{})},[]);const g=q(),E=q(""),R=q(!1);oe(()=>{let c,f,b,y,M;return g.current&&(c=z=>{var ve;const{key:J,provide:ne,text:X}=z.detail;if(E.current=X,X===""){ne(Promise.resolve({matched:!1}));return}if(J===":"){const pe=(ve=T.current)==null?void 0:ve.search(X,{limit:5});let _="";pe.forEach(({item:j})=>{const{shortcode:Z,url:se}=j;_+=` +
  • + + ${Fe(Z)} +
  • `}),_+=`
  • ${n({id:"24misb"})}
  • `,Ce.innerHTML=_,ne(Promise.resolve({matched:pe.length>0,fragment:Ce}));return}const U={"@":"accounts","#":"hashtags"}[J];ne(new Promise(pe=>{F({type:U,q:X,limit:5}).then(j=>{if(X!==E.current)return;const Z=j[U]||j;let se="";Z.forEach(V=>{var ae;const{name:ie,avatarStatic:Q,displayName:I,username:K,acct:m,emojis:ee,history:D}=V,ue=Wn(I,ee);if(m)se+=` +
  • + + + + + ${ue||K} +
    @${Fe(m)} +
    +
  • + `;else{const be=(ae=D==null?void 0:D.reduce)==null?void 0:ae.call(D,(xe,Ye)=>xe+ +Ye.uses,0);se+=` +
  • + #${Fe(ie)} + ${be?`${Un(be)}`:""} +
  • + `}}),U==="accounts"&&(se+=`
  • ${n({id:"24misb"})}
  • `),Ce.innerHTML=se,pe({matched:Z.length>0,fragment:Ce})})}))},g.current.addEventListener("text-expander-change",c),f=z=>{const{key:J,item:ne}=z.detail,{value:X,more:U}=ne.dataset;J===":"?(z.detail.value=X?`:${X}:`:"​",U&&(z.detail.continue=!0,setTimeout(()=>{v==null||v({name:"custom-emojis",defaultSearchTerm:U})},300))):J==="@"?(z.detail.value=X?`@${X} `:"​",U&&(z.detail.continue=!0,setTimeout(()=>{v==null||v({name:"mention",defaultSearchTerm:U})},300))):z.detail.value=`${J}${X}`},g.current.addEventListener("text-expander-value",f),b=z=>{const{input:J}=z.detail;if(r(J.value),t.current){const ne=new Event("input",{bubbles:!0});t.current.dispatchEvent(ne)}},g.current.addEventListener("text-expander-committed",b),y=()=>{R.current=!0},g.current.addEventListener("text-expander-activate",y),M=()=>{R.current=!1},g.current.addEventListener("text-expander-deactivate",M)),()=>{g.current&&(g.current.removeEventListener("text-expander-change",c),g.current.removeEventListener("text-expander-value",f),g.current.removeEventListener("text-expander-committed",b),g.current.removeEventListener("text-expander-activate",y),g.current.removeEventListener("text-expander-deactivate",M))}},[]),oe(()=>{const c=t.current;if(!c)return;new ResizeObserver(()=>{if(g.current){const{height:b}=c.getBoundingClientRect();g.current.style.height=b+"px"}}).observe(c)},[]);const W=q(0),$=q(),P=Vn(c=>{var y;if(!$.current)return;if(W.current>3){$.current.innerHTML="",$.current=null,(y=P==null?void 0:P.cancel)==null||y.call(P);return}let f,b;W.current<=3&&(f=Date.now()),$.current.innerHTML=Si(c,{maxCharacters:p})+` +`,W.current<=3&&(b=Date.now()),f&&b&&b-f>50&&W.current++},500),le=ht(()=>{var b,y;const c=(b=$.current)==null?void 0:b.cloneNode(!0);if(!c)return;c.querySelectorAll("mark").forEach(M=>{M.remove()});const f=(y=c.innerText)==null?void 0:y.trim();f&&(async()=>{const M=await Ti(f);M!=null&&M.length&&(v==null||v({name:"auto-detect-language",languages:M}))})()},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",...re,ref:t,name:"status",value:d,onKeyDown:c=>{const{key:f,target:b}=c,y=R.current;if(f==="Enter"&&!(c.ctrlKey||c.metaKey||y))try{const{value:M,selectionStart:z}=b,ne=M.slice(0,z).split(` +`).slice(-1)[0];if(ne&&/^\s*(-|\d+\.)\s/.test(ne)){const[X,U,ve,pe,_]=ne.match(/^(\s*)(-|\d+\.)(\s+)(.+)?/)||[];if(_){c.preventDefault();const[j]=ve.match(/\d+/)||[],Z=j?`${+j+1}.`:"-",se=` +${U}${Z}${pe}`;b.setRangeText(se,z,z);const V=z+se.length;b.setSelectionRange(V,V)}else{const j=z-ne.length;b.setRangeText("",j,z)}nn(b),b.dispatchEvent(new Event("input"))}}catch{}$.current&&($.current.scrollTop=b.scrollTop)},onInput:c=>{var y;const{target:f}=c,b=f.value.replace(/\u200b/g,"");r(b),nn(f),(y=s.onInput)==null||y.call(s,c),P(b),le()},style:{width:"100%",height:"4em"},onScroll:c=>{if($.current){const{scrollTop:f}=c.target;$.current.scrollTop=f}}}),e("div",{ref:$,class:"compose-highlight","aria-hidden":"true"})]})});function Ri({maxCharacters:s=500,hidden:t}){const a=Dn(ce).composerCharacterCount,l=s-a;return t?e("span",{class:"char-counter",hidden:!0}):e("span",{class:"char-counter",title:`${l}/${s}`,style:{"--percentage":a/s*100},children:[e("meter",{class:`${l<=-10?"explode":l<=0?"danger":l<=20?"warning":""}`,value:a,max:s}),e("span",{class:"counter",children:l})]})}function sn(s,t,n,a){const l=Math.sqrt(t/s),d=Math.floor(n*l),r=Math.floor(a*l);return{newWidth:d,newHeight:r}}function Di({attachment:s,disabled:t,lang:n,onDescriptionChange:a=()=>{},onRemove:l=()=>{}}){const{i18n:d,_:r}=ze(),[p,F]=H("default"),v=st("@mastodon/edit-media-attributes"),{type:re,id:T,file:g}=s,E=Ne(()=>g?URL.createObjectURL(g):s.url,[g,s.url]),R=!!(g!=null&&g.size),W=R?rn():{},{mediaAttachments:{imageSizeLimit:$,imageMatrixLimit:P,videoSizeLimit:le,videoMatrixLimit:w,videoFrameRateLimit:c}={}}=W||{},[f,b]=H(()=>R?re.startsWith("image")&&$&&g.size>$?{type:"imageSizeLimit",details:{imageSize:g.size,imageSizeLimit:$}}:re.startsWith("video")&&le&&g.size>le?{type:"videoSizeLimit",details:{videoSize:g.size,videoSizeLimit:le}}:null:null),[y,M]=H({});oe(()=>{!R||!P||(y==null?void 0:y.matrix)>P&&b({type:"imageMatrixLimit",details:{imageMatrix:y==null?void 0:y.matrix,imageMatrixLimit:P,width:y==null?void 0:y.width,height:y==null?void 0:y.height}})},[y,P,R]);const[z,J]=H({});oe(()=>{!R||!w||(z==null?void 0:z.matrix)>w&&b({type:"videoMatrixLimit",details:{videoMatrix:z==null?void 0:z.matrix,videoMatrixLimit:w,width:z==null?void 0:z.width,height:z==null?void 0:z.height}})},[z,w,R]);const[ne,X]=H(s.description),[U,ve]=re.split("/"),pe=ht(a,250);oe(()=>{pe(ne)},[ne,pe]);const[_,j]=H(!1),Z=q(null);oe(()=>{let I;return _&&Z.current&&(I=setTimeout(()=>{Z.current.focus()},100)),()=>{clearTimeout(I)}},[_]);const se=e(qe,{children:T&&!v?e("div",{class:"media-desc",children:[e("span",{class:"tag",children:e(G,{id:"3wG7HI"})}),e("p",{title:ne,children:s.description||e("i",{children:"No description"})})]}):e("textarea",{ref:Z,value:ne||"",lang:n,placeholder:{image:r({id:"Lh8B0N"}),video:r({id:"mN4S+e"}),audio:r({id:"ieZytw"})}[U],autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",disabled:t||p==="loading",class:p==="loading"?"loading":"",maxlength:"1500",onInput:I=>{const{value:K}=I.target;X(K)}})}),V=q(null);oe(()=>()=>{var I,K;(K=(I=V.current)==null?void 0:I.hideToast)==null||K.call(I)},[]);const ie=q(null),Q=I=>{const{type:K,details:m}=I;switch(K){case"imageSizeLimit":{const{imageSize:ee,imageSizeLimit:D}=m;return r({id:"d83/LB",values:{0:nt(ee),1:nt(D)}})}case"imageMatrixLimit":{const{imageMatrix:ee,imageMatrixLimit:D,width:ue,height:ae}=m,{newWidth:be,newHeight:xe}=sn(ee,D,ue,ae);return r({id:"TQrVea",values:{2:d.number(ue),3:d.number(ae),4:d.number(be),5:d.number(xe)}})}case"videoSizeLimit":{const{videoSize:ee,videoSizeLimit:D}=m;return r({id:"J5GTer",values:{6:nt(ee),7:nt(D)}})}case"videoMatrixLimit":{const{videoMatrix:ee,videoMatrixLimit:D,width:ue,height:ae}=m,{newWidth:be,newHeight:xe}=sn(ee,D,ue,ae);return r({id:"OG73zj",values:{8:d.number(ue),9:d.number(ae),10:d.number(be),11:d.number(xe)}})}case"videoFrameRateLimit":return r({id:"S1fBwy"})}};return e(qe,{children:[e("div",{class:"media-attachment",children:[e("div",{class:"media-preview",tabIndex:"0",onClick:()=>{j(!0)},children:U==="image"?e("img",{src:E,alt:"",onLoad:I=>{if(!R)return;const{naturalWidth:K,naturalHeight:m}=I.target;M({matrix:K*m,width:K,height:m})}}):U==="video"||U==="gifv"?e("video",{src:E+"#t=0.1",playsinline:!0,muted:!0,disablePictureInPicture:!0,preload:"metadata",onLoadedMetadata:I=>{if(!R)return;const{videoWidth:K,videoHeight:m}=I.target;K&&m&&J({matrix:K*m,width:K,height:m})}}):U==="audio"?e("audio",{src:E,controls:!0}):null}),se,e("div",{class:"media-aside",children:[e("button",{type:"button",class:"plain close-button",disabled:t,onClick:l,children:e(N,{icon:"x",alt:r({id:"t/YqKh"})})}),!!f&&e("button",{type:"button",class:"media-error",title:Q(f),onClick:()=>{ie.current&&ie.current.hideToast(),ie.current=Se({text:Q(f),duration:1e4})},children:e(N,{icon:"alert",alt:r({id:"SlfejT"})})})]})]}),_&&e(at,{onClose:()=>{j(!1)},children:e("div",{id:"media-sheet",class:"sheet sheet-max",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>{j(!1)},children:e(N,{icon:"x",alt:r({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:{image:r({id:"oMslIB"}),video:r({id:"WZw+zB"}),audio:r({id:"KMtgtM"})}[U]})}),e("main",{tabIndex:"-1",children:[e("div",{class:"media-preview",children:U==="image"?e("img",{src:E,alt:""}):U==="video"||U==="gifv"?e("video",{src:E,playsinline:!0,controls:!0}):U==="audio"?e("audio",{src:E,controls:!0}):null}),e("div",{class:"media-form",children:[se,e("footer",{children:[U==="image"&&/^(png|jpe?g|gif|webp)$/i.test(ve)&&!!ce.settings.mediaAltGenerator&&!!kt&&e(un,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",class:"plain",children:e(N,{icon:"more",size:"l",alt:r({id:"2FYpfJ"})})}),children:[e(Be,{disabled:p==="loading",onClick:()=>{F("loading"),V.current=Se({text:r({id:"8zsp51"}),duration:-1}),async function(){var I,K;try{const m=new FormData;m.append("image",g);const ee=await fetch(kt,{method:"POST",body:m}).then(D=>D.json());if(ee.error)throw new Error(ee.error);X(ee.description)}catch(m){Se(m.message?r({id:"jnKLR+",values:{12:m.message}}):r({id:"xhYfVj"}))}finally{F("default"),(K=(I=V.current)==null?void 0:I.hideToast)==null||K.call(I)}}()},children:[e(N,{icon:"sparkles2"}),n&&n!=="en"?e("small",{children:[e(G,{id:"o5sTJw"}),e("br",{}),"(English)"]}):e("span",{children:e(G,{id:"o5sTJw"})})]}),!!n&&n!=="en"&&e(Be,{disabled:p==="loading",onClick:()=>{F("loading"),V.current=Se({text:r({id:"8zsp51"}),duration:-1}),async function(){var I,K;try{const m=new FormData;m.append("image",g);const ee=`?lang=${n}`,D=await fetch(kt+ee,{method:"POST",body:m}).then(ue=>ue.json());if(D.error)throw new Error(D.error);X(D.description)}catch(m){Se(r({id:"kZwVke",values:{13:m!=null&&m.message?`: ${m.message}`:""}}))}finally{F("default"),(K=(I=V.current)==null?void 0:I.hideToast)==null||K.call(I)}}()},children:[e(N,{icon:"sparkles2"}),e("small",{children:[e(G,{id:"o5sTJw"}),e("br",{}),e(G,{id:"m+pAEQ",values:{0:Ct(n)},components:{0:e("span",{class:"more-insignificant"})}})]})]})]}),e("button",{type:"button",class:"light block",onClick:()=>{j(!1)},disabled:p==="loading",children:e(G,{id:"DPfwMq"})})]})]})]})]})})]})}function $i({lang:s,poll:t,disabled:n,onInput:a=()=>{},maxOptions:l,maxExpiration:d,minExpiration:r,maxCharactersPerOption:p}){const{_:F}=ze(),{options:v,expiresIn:re,multiple:T}=t;return e("div",{class:`poll ${T?"multiple":""}`,children:[e("div",{class:"poll-choices",children:v.map((g,E)=>e("div",{class:"poll-choice",children:[e("input",{required:!0,type:"text",value:g,disabled:n,maxlength:p,placeholder:F({id:"LDUSXg",values:{0:E+1}}),lang:s,spellCheck:"true",dir:"auto",onInput:R=>{const{value:W}=R.target;v[E]=W,a(t)}}),e("button",{type:"button",class:"plain2 poll-button",disabled:n||v.length<=1,onClick:()=>{v.splice(E,1),a(t)},children:e(N,{icon:"x",size:"s",alt:F({id:"t/YqKh"})})})]},E))}),e("div",{class:"poll-toolbar",children:[e("button",{type:"button",class:"plain2 poll-button",disabled:n||v.length>=l,onClick:()=>{v.push(""),a(t)},children:"+"})," ",e("label",{class:"multiple-choices",children:[e("input",{type:"checkbox",checked:T,disabled:n,onChange:g=>{const{checked:E}=g.target;t.multiple=E,a(t)}})," ",e(G,{id:"T57mm9"})]}),e("label",{class:"expires-in",children:[e(G,{id:"lkz6PL"})," ",e("select",{value:re,disabled:n,onChange:g=>{const{value:E}=g.target;t.expiresIn=E,a(t)},children:Object.entries(hn).filter(([g])=>g>=r&&g<=d).map(([g,E])=>e("option",{value:g,children:E()},g))})]})]}),e("div",{class:"poll-toolbar",children:e("button",{type:"button",class:"plain remove-poll-button",disabled:n,onClick:()=>{a(null)},children:e(G,{id:"CDpQAX"})})})]})}function Fe(s){return s.replace(/[&<>"']/g,function(t){return"&#"+t.charCodeAt(0)+";"})}function an(s){for(let t in s)(s[t]===null||s[t]===void 0)&&delete s[t];return s}function ji({onClose:s=()=>{},onSelect:t=()=>{},defaultSearchTerm:n}){const{_:a}=ze(),{masto:l}=Bt(),[d,r]=H("default"),[p,F]=H([]),[v,re]=H({}),[T,g]=H(0),E=async w=>{if(!(w!=null&&w.length))return;const c=await Gn(w,v);c&&re({...v,...c})},R=w=>{w&&(r("loading"),(async()=>{try{const c=await l.v1.accounts.search.list({q:w,limit:40,resolve:!1});F(c),E(c),r("default")}catch{r("error")}})())},W=ht(R,1e3);oe(()=>{R()},[R]);const $=q();oe(()=>{$.current&&($.current.focus(),$.current.value&&($.current.selectionStart=$.current.value.length,$.current.selectionEnd=$.current.value.length))},[]),oe(()=>{n&&R(n)},[n]);const P=w=>{const c=w.acct;t(c),s()};Ke("enter",()=>{const w=p[T];w&&P(w)},{preventDefault:!0,enableOnFormTags:["input"]});const le=q();return Ke("down",()=>{T{const w=le.current.querySelector(".selected");w&&w.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},1)},{preventDefault:!0,enableOnFormTags:["input"]}),Ke("up",()=>{T>0?g(T-1):g(p.length-1),setTimeout(()=>{const w=le.current.querySelector(".selected");w&&w.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},1)},{preventDefault:!0,enableOnFormTags:["input"]}),e("div",{id:"mention-sheet",class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(N,{icon:"x",alt:a({id:"yz7wBu"})})}),e("header",{children:e("form",{onSubmit:w=>{var c;w.preventDefault(),(c=W.flush)==null||c.call(W)},children:e("input",{ref:$,required:!0,type:"search",class:"block",placeholder:a({id:"eH1bqp"}),onInput:w=>{const{value:c}=w.target;W(c)},autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",defaultValue:n||""})})}),e("main",{children:(p==null?void 0:p.length)>0?e("ul",{ref:le,class:`accounts-list ${d==="loading"?"loading":""}`,children:p.map((w,c)=>{const f=v[w.id];return e("li",{class:c===T?"selected":"",children:[e(cn,{avatarSize:"xxl",account:w,relationship:f,showStats:!0,showActivity:!0}),e("button",{type:"button",class:"plain2",onClick:()=>{P(w)},children:e(N,{icon:"plus",size:"xl",alt:a({id:"m16xKo"})})})]},w.id)})}):d==="loading"?e("div",{class:"ui-state",children:e(dt,{abrupt:!0})}):d==="error"?e("div",{class:"ui-state",children:e("p",{children:e(G,{id:"AThL/k"})})}):null})]})}function Pi({masto:s,instance:t,onClose:n=()=>{},onSelect:a=()=>{},defaultSearchTerm:l}){const{_:d}=ze(),[r,p]=H("default"),F=q([]),[v,re]=H([]),T=Ne(()=>Te.account.get("recentlyUsedCustomEmojis")||[]),g=q();oe(()=>{p("loading"),(async()=>{try{const[c,f]=await mn(t,s);g.current=f,re(c),p("default")}catch{p("error")}})()},[]);const E=Ne(()=>{const c={"--recent--":T.filter(b=>v.find(y=>y.shortcode===b.shortcode))},f=[];return v.forEach(b=>{var y,M;if((M=(y=F.current)==null?void 0:y.push)==null||M.call(y,b),!b.category){f.push(b);return}c[b.category]||(c[b.category]=[]),c[b.category].push(b)}),f.length&&(c["--others--"]=f),c},[v]),R=q(),[W,$]=H(null),P=Wt(c=>{var b,y,M;const{value:f}=c.target;if(f){const z=(b=g.current)==null?void 0:b.search(f,{limit:It});$(z.map(J=>J.item)),(M=(y=R.current)==null?void 0:y.scrollTo)==null||M.call(y,0,0)}else $(null)},[v]);oe(()=>{l&&(v!=null&&v.length)&&P({target:{value:l}})},[l,P,v]);const le=Wt(c=>{a==null||a(c),n==null||n(),queueMicrotask(()=>{let f=Te.account.get("recentlyUsedCustomEmojis")||[];const b=f.findIndex(y=>y.shortcode===c.shortcode);b!==-1?(f.splice(b,1),f.unshift(c)):(f.unshift(c),f=f.filter(y=>{var M,z;return(z=(M=F.current)==null?void 0:M.find)==null?void 0:z.call(M,J=>J.shortcode===y.shortcode)}),f=f.slice(0,10)),Te.account.set("recentlyUsedCustomEmojis",f)})},[a]),w=q();return oe(()=>{w.current&&(w.current.focus(),w.current.value&&(w.current.selectionStart=w.current.value.length,w.current.selectionEnd=w.current.value.length))},[]),e("div",{id:"custom-emojis-sheet",class:"sheet",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(N,{icon:"x",alt:d({id:"yz7wBu"})})}),e("header",{children:[e("div",{children:[e("b",{children:e(G,{id:"8i6Ueo"})})," ",r==="loading"?e(dt,{}):e("small",{class:"insignificant",children:[" • ",t]})]}),e("form",{onSubmit:c=>{c.preventDefault();const f=W[0];f&&le(`:${f.shortcode}:`)},children:e("input",{ref:w,type:"search",placeholder:d({id:"EarrCe"}),onInput:P,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",defaultValue:l||""})})]}),e("main",{ref:R,children:W!==null?e("ul",{class:"custom-emojis-matches custom-emojis-list",children:W.map(c=>e("li",{class:"custom-emojis-match",children:e(gn,{emoji:c,onClick:()=>{le(`:${c.shortcode}:`)},showCode:!0})},c.shortcode))}):e("div",{class:"custom-emojis-list",children:[r==="error"&&e("div",{class:"ui-state",children:e("p",{children:e(G,{id:"Kzwsg2"})})}),r==="default"&&Object.entries(E).map(([c,f])=>!!(f!=null&&f.length)&&e("div",{class:"section-container",children:[e("div",{class:"section-header",children:{"--recent--":d({id:"uabU9X"}),"--others--":d({id:"NuKR0h"})}[c]||c}),e(Oi,{emojis:f,onSelect:le})]}))]})})]})}const Oi=ln(({emojis:s,onSelect:t})=>{const{i18n:n}=ze(),[a,l]=H(It),d=s.length>a;return e("section",{children:[s.slice(0,a).map(r=>e(gn,{emoji:r,onClick:()=>{t(`:${r.shortcode}:`)}},r.shortcode)),d&&e("button",{type:"button",class:"plain small",onClick:()=>l(a+It),children:e(G,{id:"iAB71E",values:{0:n.number(s.length-a)}})})]})}),gn=ln(({emoji:s,onClick:t,showCode:n})=>{const a=l=>{const r=l.currentTarget.closest("main");if(r){const p=r.getBoundingClientRect(),F=l.currentTarget.getBoundingClientRect(),v=l.currentTarget.classList;F.leftp.right-88?(v.add("edge-right"),v.remove("edge-left")):v.remove("edge-left","edge-right")}};return e("button",{type:"button",className:"plain4",onClick:t,"data-title":n?void 0:s.shortcode,onPointerEnter:a,onFocus:a,children:[e("picture",{children:[!!s.staticUrl&&e("source",{srcSet:s.staticUrl,media:"(prefers-reduced-motion: reduce)"}),e("img",{className:"shortcode-emoji",src:s.url||s.staticUrl,alt:s.shortcode,width:"24",height:"24",loading:"lazy",decoding:"async"})]}),n&&e(qe,{children:[" ",e("code",{children:s.shortcode})]})]})}),Ft=20;function Hi({onClose:s=()=>{},onSelect:t=()=>{}}){var R,W,$,P,le,w;const{i18n:n,_:a}=ze(),[l,d]=H("default"),[r,p]=H([]),F=q(null),v=q(null),re=q(0),T=q(null);function g({offset:c}){var f,b,y;(f=v.current)!=null&&f.value&&(d("loading"),(y=(b=T.current)==null?void 0:b.scrollTo)==null||y.call(b,{top:0,left:0,behavior:"smooth"}),(async()=>{var M;try{const z={api_key:gi,q:v.current.value,rating:"g",limit:Ft,bundle:"messaging_non_clips",offset:c,lang:n.locale||"en"},J=await fetch("https://api.giphy.com/v1/gifs/search?"+new URLSearchParams(z),{referrerPolicy:"no-referrer"}).then(ne=>ne.json());re.current=((M=J.pagination)==null?void 0:M.offset)||0,p(J),d("results")}catch{d("error")}})())}oe(()=>{var c;(c=v.current)==null||c.focus()},[]);const E=ht(()=>{g({offset:0})},1e3);return e("div",{id:"gif-picker-sheet",class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(N,{icon:"x",alt:a({id:"yz7wBu"})})}),e("header",{children:e("form",{ref:F,onSubmit:c=>{c.preventDefault(),g({offset:0})},children:[e("input",{ref:v,type:"search",name:"q",placeholder:a({id:"wxlF9B"}),required:!0,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",onInput:E}),e("input",{type:"image",class:"powered-button",src:di,width:"86",height:"30",alt:a({id:"c1Q/eU"})})]})}),e("main",{ref:T,class:l==="loading"?"loading":"",children:[l==="default"&&e("div",{class:"ui-state",children:e("p",{class:"insignificant",children:e(G,{id:"9KEidY"})})}),l==="loading"&&!((R=r==null?void 0:r.data)!=null&&R.length)&&e("div",{class:"ui-state",children:e(dt,{abrupt:!0})}),((W=r==null?void 0:r.data)==null?void 0:W.length)>0?e(qe,{children:[e("ul",{children:r.data.map(c=>{const{id:f,images:b,title:y,alt_text:M}=c,{fixed_height_small:z,fixed_height_downsampled:J,fixed_height:ne,original:X}=b,U=z!=null&&z.url?z:J!=null&&J.url?J:ne;let{url:ve,webp:pe,width:_,height:j}=U;+j>100&&(_=_/j*100,j=100);const Z=URL.parse(ve),se=Z.origin+Z.pathname;let V;if(pe){const ie=URL.parse(pe);V=ie.origin+ie.pathname}return e("li",{children:e("button",{type:"button",onClick:()=>{const{mp4:ie,url:Q}=X,I=ie||Q,K=URL.parse(I),m=K.origin+K.pathname;s(),t({url:m,type:ie?"video/mp4":"image/gif",alt_text:M||y})},children:e("figure",{style:{"--figure-width":_+"px"},children:[e("picture",{children:[V&&e("source",{srcset:V,type:"image/webp"}),e("img",{src:se,width:_,height:j,loading:"lazy",decoding:"async",alt:M,referrerpolicy:"no-referrer",onLoad:ie=>{ie.target.style.backgroundColor="transparent"}})]}),e("figcaption",{children:M||y})]})})},f)})}),e("p",{class:"pagination",children:[(($=r.pagination)==null?void 0:$.offset)>0&&e("button",{type:"button",class:"light small",disabled:l==="loading",onClick:()=>{var c;g({offset:((c=r.pagination)==null?void 0:c.offset)-Ft})},children:[e(N,{icon:"chevron-left"}),e("span",{children:e(G,{id:"DHhJ7s"})})]}),e("span",{}),((P=r.pagination)==null?void 0:P.offset)+((le=r.pagination)==null?void 0:le.count)<((w=r.pagination)==null?void 0:w.total_count)&&e("button",{type:"button",class:"light small",disabled:l==="loading",onClick:()=>{var c;g({offset:((c=r.pagination)==null?void 0:c.offset)+Ft})},children:[e("span",{children:e(G,{id:"hXzOVo"})})," ",e(N,{icon:"chevron-right"})]})]})]}):l==="results"&&e("div",{class:"ui-state",children:e("p",{children:"No results"})}),l==="error"&&e("div",{class:"ui-state",children:e("p",{children:e(G,{id:"PbFw9n"})})})]})]})}export{Wi as default}; +//# sourceMappingURL=compose-8rrDtgaW.js.map diff --git a/assets/compose-8rrDtgaW.js.map b/assets/compose-8rrDtgaW.js.map new file mode 100644 index 0000000..a864afd --- /dev/null +++ b/assets/compose-8rrDtgaW.js.map @@ -0,0 +1 @@ +{"version":3,"mappings":"02BAAe,MAAMA,EAAS,CAC1B,YAAYC,EAAOC,EAAM,CAAE,sBAAAC,EAAuB,mBAAAC,CAAoB,EA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,OACvBzB,EACE,CACGyB,aAAajO,aAAbiO,cAA0B,QAAAiS,EACnB,EAAE9d,EAAI4e,eAAQ7R,oBAAOqD,YAAalQ,cAClC,YACJ2e,EACAC,GACAC,6JACAO,cACF,MAAIV,cACJ,aAAqC/V,UAKjC,mBAAEA,GAAKoW,mDAAMriB,CAAOoU,EAAO,SAAIgO,WAC/B,WAAe7T,EAAA,CACjBvO,WACS,GACX,MAAAoN,EAAAW,EAAA,CACMuU,oBACAC,GACFC,GACJ,GACQO,kBAAcC,EAAU,OACfD,iBACjB,SAAA3V,EAAA,KACA,qBACE,CAAAI,CACE,GAAAjJ,IACO,SAAA6I,EAAA,wBAEG,SAAAA,EAAA,KAAEwV,yBAAK3W,EACb,EACMqW,GACAC,GACE,EACC","names":["Combobox","input","list","tabInsertsSuggestions","defaultFirstOption","event","keyboardBindings","trackComposition","commitWithElement","_a","visible","indexDiff","focusEl","els","focusIndex","indexOfItem","newIndex","target","el","scrollTo","combobox","commit","fireCommitEvent","container","inViewport","element","scrollTop","containerBottom","top","bottom","boundary","query","text","key","cursor","multiWord","lookBackIndex","lastMatchPosition","keyIndex","pre","CustomHTMLElement","InputStyleCloneUpdateEvent","CloneRegistry","_InputStyleCloneElement","__privateAdd","_InputStyleCloneElement_instances","_styleObserver","__privateMethod","updateStyles_fn","_resizeObserver","requestUpdateLayout_fn","_inputRef","_container","_xOffset","_yOffset","_isLayoutUpdating","_onInput","updateText_fn","_onDocumentScrollOrResize","usingInput_fn","clone","__privateSet","__privateGet","input_get","fn","updateLayout_fn","inputStyle","inputRect","cloneRect","prop","propertiesToCopy","InputStyleCloneElement","e","_InputRange","startOffset","endOffset","_InputRange_instances","_inputElement","_startOffset","_endOffset","selectionStart","selectionEnd","offset","clampOffset_fn","toStart","createCloneRange_fn","styleClone_get","cloneElement_get","range","textNode","InputRange","states","TextExpander","expander","match","menu","_b","position","caretRect","targetPosition","currentPosition","delta","currentStyle","item","beginning","remaining","detail","suffix","value","found","providers","provide","result","x","TextExpanderElement","keysAttr","keys","multiWordAttr","globalMultiWord","state","ansiRegex","onlyFirst","pattern","regex","stripAnsi","string","segmenter","stringLength","countAnsiEscapeCodes","length","_","poweredByGiphyURL","PHANPY_IMG_ALT_API_URL","IMG_ALT_API_URL","PHANPY_GIPHY_API_KEY","GIPHY_API_KEY","import","supportedLanguagesMap","supportedLanguages","reduce","acc","l","code","common","native","expiryOptions","i18nDuration","expirySeconds","Object","oneDay","expiresInFromExpiresAt","expiresAt","Date","getTime","now","find","s","document","createElement","role","className","windowMargin","observer","IntersectionObserver","entries","forEach","entry","isIntersecting","left","width","boundingClientRect","innerWidth","window","insetInlineStart","isRTL","style","observe","DEFAULT_LANG","localeMatch","Intl","DateTimeFormat","resolvedOptions","locale","navigator","languages","map","urlRegexObj","RegExp","urlRegex","source","flags","usernameRegex","urlPlaceholder","countableText","inputText","replace","USERNAME_RE","MENTION_RE","HASHTAG_RE","SHORTCODE_RE_FRAGMENT","SCAN_RE","Segmenter","escapeHTML","highlightText","maxCharacters","Infinity","composerCharacterCount","withinLimitHTML","exceedLimitHTML","htmlSegments","segment","index","RTF","mem","RelativeTimeFormat","undefined","LF","ListFormat","CUSTOM_EMOJIS_COUNT","ADD_LABELS","media","id","customEmoji","gif","poll","Compose","onClose","replyToStatus","editStatus","draftStatus","standalone","hasOpener","i18n","t","_useLingui","rtf","lf","console","masto","instance","uiState","setUIState","useState","UID","uid","log","currentAccount","currentAccountInfo","maxMediaAttachments","charactersReservedPerUrl","imageMatrixLimit","supportedMimeTypes","imageSizeLimit","videoSizeLimit","videoMatrixLimit","videoFrameRateLimit","maxExpiration","maxOptions","maxCharactersPerOption","minExpiration","spoilerTextRef","useRef","textareaRef","store","prevLanguage","language","sensitive","setMediaAttachments","setLanguage","oninputTextarea","account","focusTextarea","dispatchEvent","setTimeout","spoilerText","useEffect","visibility2","language2","sensitive2","visibility","current","m","allMentions","prefs","setSensitive","poll2","mediaAttachments","options","expiresIn","statusSource","dataset","mediaAttachments2","setVisibility","composablePoll","status","o","formRef","canClose","_t","hasValue","hasMediaAttachments","isSelf","hasOnlyAcct","confirmClose","hasIDMediaAttachments","beforeUnloadCopy","handleBeforeUnload","sameWithSource","getCharCount","updateCharCount","supportsCloseWatcher","useHotkeys","yes","addEventListener","capture","modals","hasModal","hasOnlyComposer","prevBackgroundDraft","count","escDownRef","ignoreEventWhen","useCloseWatcher","draftKey","getCurrentAccountNS","backgroundDraft","useInterval","db","handleItems","username","acct","i2","items","unsupportedFiles","_i18n","drafts","set","updatedAt","f","debug","error","files","clipboardData","max","file","alert","mediaFiles","allowedFiles","1","2","handleDragover","setShowMentionPicker","showEmoji2Picker","showGIFPicker","useMemo","contentTranslationHideLanguages","autoDetectedLanguages","topLanguages","restLanguages","commonB","type","size","url","codeA","commonA","codeB","onMinimize","saveUnsavedDraft","gifPickerDisabled","onPollButtonClick","setPoll","removeEventListener","addSubToolbarRef","setShowAddButton","useResizeObserver","showMentionPicker","scrollWidth","settings","push","_jsxs","sort","_jsx","AccountBlock","showPollButton","pollButtonDisabled","children","class","confirmText","passData","__STATES__","opener","composerState","Icon","openCompose","showAddButton","avatarStatic","disabled","onClick","Status","replyToStatusMonthsAgo","_Trans","formData","components","0","onKeyDown","onSubmit","description","params2","res","attachment","results","mediaPromises","hasNoDescriptions","params","removeNullUndefined","newStatus","saveStatus","i","e2","media_attributes","in_reply_to_id","statuses","visibilityIconsMap","opacity","pointerEvents","checked","onChange","icon","title","limit","action","setShowEmoji2Picker","setAutoDetectedLanguages","Textarea","ref","fileID","newAttachments","attachments","_2","j","performSearch","q","v1","resolve","v2","fetch","onTrigger","defaultSearchTerm","Poll","newPoll","onDescriptionChange","Menu2","open","MenuItem","FilePickerInput","onInput","setShowGIFPicker","body","zIndex","_Fragment","Loader","CharCountMeter","alt","localeCode2Text","commonText","composerGIFPicker","restSupportedLanguages","textarea","textBeforeMention","spaceAfterMention","textAfterMention","newText","Modal","CustomEmojisModal","textBeforeEmoji","textAfterEmoji","spaceBeforeEmoji","emojiShortcode","spaceAfterEmoji","onSelect","GIFPickerModal","alt_text","slice","theToast","showToast","blob","newMediaAttachments","hidden","then","autoResizeTextarea","offsetHeight","scrollHeight","clientHeight","height","visibleEmojis","__vitePreload","langs","detectAll","lang","_t2","api","setText","textareaProps","props","searcherRef","getCustomEmojis","r","hasTextExpanderRef","textExpanderRef","handleChange","_getCustomEmojis","searcher","textExpanderTextRef","text2","cacheKeyArg","detectLangs","shortcode","emoji","html","encodeHTML","emojis","history","displayNameWithEmoji","emojifyText","displayName","search","total","cur","name","shortenNumber","Promise","matched","v","more","handleValue","handleCommited","handleActivate","handleDeactivate","slowHighlightPerf","composeHighlightRef","useThrottledCallback","throttleHighlightText","start","end","useDebouncedCallback","dom","Event","resizeObserver","hasTextExpander","lastLine","bullet","postSpaces","anything","number","preSpaces","pos","debouncedAutoDetectLanguage","cloneNode","mark","spellCheck","rows","cols","charCount","leftChars","setRangeText","setSelectionRange","scaleDimension","matrix","matrixLimit","scalingFactor","newHeight","newWidth","MediaAttachment","supportsEdit","supports","onScroll","checkMaxError","configuration","getCurrentInstanceConfiguration","maxError","setMaxError","snapStates","imageMatrix","setImageMatrix","Math","videoMatrix","setVideoMatrix","debouncedOnDescriptionChange","timer","details","_t3","toastRef","setDescription","showModal","imageSizeLimit2","descTextarea","prettyBytes","videoSize","videoSizeLimit2","videoMatrixLimit2","videoMatrix2","maxErrorToast","maxErrorText","err","imageSize","suffixType","naturalWidth","naturalHeight","3","4","5","videoWidth","videoHeight","6","7","values","9","10","11","setShowModal","src","onLoad","onLoadedMetadata","onRemove","subtype","response","menuButton","append","_t4","multiple","option","required","label","splice","str","char","obj","MentionModal","accounts","setAccounts","setRelationshipsMap","selectedIndex","setSelectedIndex","loadRelationships","accounts2","term","debouncedLoadAccounts","loadAccounts","inputRef","filterShortcodes","searchTerm","aLower","a","bLower","b","aContains","bContains","bothStartWith","selectAccount","selectedAccount","listRef","selectedItem","relationshipsMap","relationships","socialAddress","_t5","enableOnFormTags","relationship","_t6","customEmojisList","customEmojis","setCustomEmojis","recentlyUsedCustomEmojis","emojisCat","othersCat","scrollableRef","matches","setMatches","onFind","_c","onSelectEmoji","useCallback","recentlyUsedCustomEmojis2","recentlyUsedEmojiIndex","emoji2","customEmojisCatList","category","queueMicrotask","CustomEmojisList","memo","setMax","CustomEmojiButton","showMore","showCode","parent","selfRect","rect","targetClassList","addEdges","GIFS_PER_PAGE","_t7","setResults","fetchGIFs","qRef","closest","currentTarget","remove","debouncedOnInput","onPointerEnter","onFocus","staticUrl","loading","currentOffset","images","fixed_height_small","fixed_height_downsampled","fixed_height","theImage","webp","urlObj","strippedURL","strippedWebP","preventDefault","original","theURL","mp4","url2","strippedURL2","webpObj","parse"],"ignoreList":[0,1,2,3,4],"sources":["../../node_modules/@github/combobox-nav/dist/index.js","../../node_modules/@github/text-expander-element/dist/index.js","../../node_modules/ansi-regex/index.js","../../node_modules/strip-ansi/index.js","../../node_modules/string-length/index.js","../../src/assets/powered-by-giphy.svg","../../src/components/compose.jsx"],"sourcesContent":["export default class Combobox {\n constructor(input, list, { tabInsertsSuggestions, defaultFirstOption } = {}) {\n this.input = input;\n this.list = list;\n this.tabInsertsSuggestions = tabInsertsSuggestions !== null && tabInsertsSuggestions !== void 0 ? tabInsertsSuggestions : true;\n this.defaultFirstOption = defaultFirstOption !== null && defaultFirstOption !== void 0 ? defaultFirstOption : false;\n this.isComposing = false;\n if (!list.id) {\n list.id = `combobox-${Math.random().toString().slice(2, 6)}`;\n }\n this.ctrlBindings = !!navigator.userAgent.match(/Macintosh/);\n this.keyboardEventHandler = event => keyboardBindings(event, this);\n this.compositionEventHandler = event => trackComposition(event, this);\n this.inputHandler = this.clearSelection.bind(this);\n input.setAttribute('role', 'combobox');\n input.setAttribute('aria-controls', list.id);\n input.setAttribute('aria-expanded', 'false');\n input.setAttribute('aria-autocomplete', 'list');\n input.setAttribute('aria-haspopup', 'listbox');\n }\n destroy() {\n this.clearSelection();\n this.stop();\n this.input.removeAttribute('role');\n this.input.removeAttribute('aria-controls');\n this.input.removeAttribute('aria-expanded');\n this.input.removeAttribute('aria-autocomplete');\n this.input.removeAttribute('aria-haspopup');\n }\n start() {\n this.input.setAttribute('aria-expanded', 'true');\n this.input.addEventListener('compositionstart', this.compositionEventHandler);\n this.input.addEventListener('compositionend', this.compositionEventHandler);\n this.input.addEventListener('input', this.inputHandler);\n this.input.addEventListener('keydown', this.keyboardEventHandler);\n this.list.addEventListener('click', commitWithElement);\n this.indicateDefaultOption();\n }\n stop() {\n this.clearSelection();\n this.input.setAttribute('aria-expanded', 'false');\n this.input.removeEventListener('compositionstart', this.compositionEventHandler);\n this.input.removeEventListener('compositionend', this.compositionEventHandler);\n this.input.removeEventListener('input', this.inputHandler);\n this.input.removeEventListener('keydown', this.keyboardEventHandler);\n this.list.removeEventListener('click', commitWithElement);\n }\n indicateDefaultOption() {\n var _a;\n if (this.defaultFirstOption) {\n (_a = Array.from(this.list.querySelectorAll('[role=\"option\"]:not([aria-disabled=\"true\"])'))\n .filter(visible)[0]) === null || _a === void 0 ? void 0 : _a.setAttribute('data-combobox-option-default', 'true');\n }\n }\n navigate(indexDiff = 1) {\n const focusEl = Array.from(this.list.querySelectorAll('[aria-selected=\"true\"]')).filter(visible)[0];\n const els = Array.from(this.list.querySelectorAll('[role=\"option\"]')).filter(visible);\n const focusIndex = els.indexOf(focusEl);\n if ((focusIndex === els.length - 1 && indexDiff === 1) || (focusIndex === 0 && indexDiff === -1)) {\n this.clearSelection();\n this.input.focus();\n return;\n }\n let indexOfItem = indexDiff === 1 ? 0 : els.length - 1;\n if (focusEl && focusIndex >= 0) {\n const newIndex = focusIndex + indexDiff;\n if (newIndex >= 0 && newIndex < els.length)\n indexOfItem = newIndex;\n }\n const target = els[indexOfItem];\n if (!target)\n return;\n for (const el of els) {\n el.removeAttribute('data-combobox-option-default');\n if (target === el) {\n this.input.setAttribute('aria-activedescendant', target.id);\n target.setAttribute('aria-selected', 'true');\n scrollTo(this.list, target);\n }\n else {\n el.removeAttribute('aria-selected');\n }\n }\n }\n clearSelection() {\n this.input.removeAttribute('aria-activedescendant');\n for (const el of this.list.querySelectorAll('[aria-selected=\"true\"]')) {\n el.removeAttribute('aria-selected');\n }\n this.indicateDefaultOption();\n }\n}\nfunction keyboardBindings(event, combobox) {\n if (event.shiftKey || event.metaKey || event.altKey)\n return;\n if (!combobox.ctrlBindings && event.ctrlKey)\n return;\n if (combobox.isComposing)\n return;\n switch (event.key) {\n case 'Enter':\n if (commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Tab':\n if (combobox.tabInsertsSuggestions && commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Escape':\n combobox.clearSelection();\n break;\n case 'ArrowDown':\n combobox.navigate(1);\n event.preventDefault();\n break;\n case 'ArrowUp':\n combobox.navigate(-1);\n event.preventDefault();\n break;\n case 'n':\n if (combobox.ctrlBindings && event.ctrlKey) {\n combobox.navigate(1);\n event.preventDefault();\n }\n break;\n case 'p':\n if (combobox.ctrlBindings && event.ctrlKey) {\n combobox.navigate(-1);\n event.preventDefault();\n }\n break;\n default:\n if (event.ctrlKey)\n break;\n combobox.clearSelection();\n }\n}\nfunction commitWithElement(event) {\n if (!(event.target instanceof Element))\n return;\n const target = event.target.closest('[role=\"option\"]');\n if (!target)\n return;\n if (target.getAttribute('aria-disabled') === 'true')\n return;\n fireCommitEvent(target);\n}\nfunction commit(input, list) {\n const target = list.querySelector('[aria-selected=\"true\"], [data-combobox-option-default=\"true\"]');\n if (!target)\n return false;\n if (target.getAttribute('aria-disabled') === 'true')\n return true;\n target.click();\n return true;\n}\nfunction fireCommitEvent(target) {\n target.dispatchEvent(new CustomEvent('combobox-commit', { bubbles: true }));\n}\nfunction visible(el) {\n return (!el.hidden &&\n !(el instanceof HTMLInputElement && el.type === 'hidden') &&\n (el.offsetWidth > 0 || el.offsetHeight > 0));\n}\nfunction trackComposition(event, combobox) {\n combobox.isComposing = event.type === 'compositionstart';\n const list = document.getElementById(combobox.input.getAttribute('aria-controls') || '');\n if (!list)\n return;\n combobox.clearSelection();\n}\nfunction scrollTo(container, target) {\n if (!inViewport(container, target)) {\n container.scrollTop = target.offsetTop;\n }\n}\nfunction inViewport(container, element) {\n const scrollTop = container.scrollTop;\n const containerBottom = scrollTop + container.clientHeight;\n const top = element.offsetTop;\n const bottom = top + element.clientHeight;\n return top >= scrollTop && bottom <= containerBottom;\n}\n","import Combobox from '@github/combobox-nav';\n\nconst boundary = /\\s|\\(|\\[/;\nfunction query(text, key, cursor, { multiWord, lookBackIndex, lastMatchPosition } = {\n multiWord: false,\n lookBackIndex: 0,\n lastMatchPosition: null\n}) {\n let keyIndex = text.lastIndexOf(key, cursor - 1);\n if (keyIndex === -1)\n return;\n if (keyIndex < lookBackIndex)\n return;\n if (multiWord) {\n if (lastMatchPosition != null) {\n if (lastMatchPosition === keyIndex)\n return;\n keyIndex = lastMatchPosition - key.length;\n }\n const charAfterKey = text[keyIndex + 1];\n if (charAfterKey === ' ' && cursor >= keyIndex + key.length + 1)\n return;\n const newLineIndex = text.lastIndexOf('\\n', cursor - 1);\n if (newLineIndex > keyIndex)\n return;\n const dotIndex = text.lastIndexOf('.', cursor - 1);\n if (dotIndex > keyIndex)\n return;\n }\n else {\n const spaceIndex = text.lastIndexOf(' ', cursor - 1);\n if (spaceIndex > keyIndex)\n return;\n }\n const pre = text[keyIndex - 1];\n if (pre && !boundary.test(pre))\n return;\n const queryString = text.substring(keyIndex + key.length, cursor);\n return {\n text: queryString,\n position: keyIndex + key.length\n };\n}\n\n/**\n * A custom element is implemented as a class which extends HTMLElement (in the\n * case of autonomous elements) or the interface you want to customize (in the\n * case of customized built-in elements).\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#custom_element_lifecycle_callbacks\n */\nclass CustomHTMLElement extends HTMLElement {\n}\n\nclass InputStyleCloneUpdateEvent extends Event {\n constructor() {\n super(\"update\");\n }\n}\nconst CloneRegistry = new WeakMap();\n/**\n * Create an element that exactly matches an input pixel-for-pixel and automatically stays in sync with it. This\n * is a non-interactive overlay on to the input and can be used to affect the visual appearance of the input\n * without modifying its behavior. The clone element is hidden by default.\n *\n * This lower level API powers the `InputRange` but provides more advanced functionality including event updates.\n *\n * Emits `update` events whenever anything is recalculated: when the layout changes, when the user scrolls, when the\n * input is updated, etc. This event may be emitted more than once per change.\n *\n * @note There may be cases in which the clone cannot observe changes to the input and fails to automatically update.\n * For example, if the `value` property on the input is written to directly, no `input` event is emitted by the input\n * and the clone does not automatically update. In these cases, `forceUpdate` can be used to manually trigger an update.\n */\n// PRIOR ART: This approach was adapted from the following MIT-licensed sources:\n// - primer/react (Copyright (c) 2018 GitHub, Inc.): https://github.com/primer/react/blob/a0db832302702b869aa22b0c4049ad9305ef631f/src/drafts/utils/character-coordinates.ts\n// - component/textarea-caret-position (Copyright (c) 2015 Jonathan Ong me@jongleberry.com): https://github.com/component/textarea-caret-position/blob/b5db7a7e47dd149c2a66276183c69234e4dabe30/index.js\n// - koddsson/textarea-caret-position (Copyright (c) 2015 Jonathan Ong me@jongleberry.com): https://github.com/koddsson/textarea-caret-position/blob/eba40ec8488eed4d77815f109af22e1d9c0751d3/index.js\nclass InputStyleCloneElement extends CustomHTMLElement {\n #styleObserver = new MutationObserver(() => this.#updateStyles());\n #resizeObserver = new ResizeObserver(() => this.#requestUpdateLayout());\n // This class is unique in that it will prevent itself from getting garbage collected because of the subscribed\n // observers (if never detached). Because of this, we want to avoid preventing the existence of this class from also\n // preventing the garbage collection of the associated input. This also allows us to automatically detach if the\n // input gets collected.\n #inputRef;\n #container;\n /**\n * Get the clone for an input, reusing an existing one if available. This avoids creating unecessary clones, which\n * have a performance cost due to their high-frequency event-based updates. Because these elements are shared, they\n * should be mutated with caution.\n *\n * Upon initial creation the clone element will automatically be inserted into the DOM and begin observing the\n * linked input. Only one clone per input can ever exist at a time.\n * @param input The target input to clone.\n */\n static for(input) {\n let clone = CloneRegistry.get(input);\n if (!clone) {\n clone = new InputStyleCloneElement();\n clone.connect(input);\n CloneRegistry.set(input, clone);\n }\n return clone;\n }\n /**\n * Connect this instance to a target input element and insert this instance into the DOM in the correct location.\n *\n * NOTE: calling the static `for` method is nearly always preferable as it will reuse an existing clone if available.\n * However, if reusing clones is problematic (ie, if the clone needs to be mutated), a clone can be constructed\n * directly with `new InputStyleCloneElement()` and then bound to an input and inserted into the DOM with\n * `clone.connect(target)`.\n */\n connect(input) {\n this.#inputRef = new WeakRef(input);\n // We want position:absolute so it doesn't take space in the layout, but that doesn't work with display:table-cell\n // used in the HTMLInputElement approach. So we need a wrapper.\n this.#container = document.createElement(\"div\");\n this.#container.style.position = \"absolute\";\n this.#container.style.pointerEvents = \"none\";\n input.after(this.#container);\n this.#container.appendChild(this);\n }\n /**\n * Force a recalculation. Will emit an `update` event. This is typically not needed unless the input has changed in\n * an unobservable way, eg by directly writing to the `value` property.\n */\n forceUpdate() {\n this.#updateStyles();\n this.#updateText();\n }\n /** @private */\n connectedCallback() {\n this.#usingInput((input) => {\n this.style.pointerEvents = \"none\";\n this.style.userSelect = \"none\";\n this.style.overflow = \"hidden\";\n this.style.display = \"block\";\n // Important not to use display:none which would not render the content at all\n this.style.visibility = \"hidden\";\n if (input instanceof HTMLTextAreaElement) {\n this.style.whiteSpace = \"pre-wrap\";\n this.style.wordWrap = \"break-word\";\n }\n else {\n this.style.whiteSpace = \"nowrap\";\n // text in single-line inputs is vertically centered\n this.style.display = \"table-cell\";\n this.style.verticalAlign = \"middle\";\n }\n this.setAttribute(\"aria-hidden\", \"true\");\n this.#updateStyles();\n this.#updateText();\n this.#styleObserver.observe(input, {\n attributeFilter: [\n \"style\",\n \"dir\", // users can right-click in some browsers to change the text direction dynamically\n ],\n });\n this.#resizeObserver.observe(input);\n document.addEventListener(\"scroll\", this.#onDocumentScrollOrResize, { capture: true });\n window.addEventListener(\"resize\", this.#onDocumentScrollOrResize, { capture: true });\n // capture so this happens first, so other things can respond to `input` events after this data updates\n input.addEventListener(\"input\", this.#onInput, { capture: true });\n });\n }\n /** @private */\n disconnectedCallback() {\n this.#container?.remove();\n this.#styleObserver.disconnect();\n this.#resizeObserver.disconnect();\n document.removeEventListener(\"scroll\", this.#onDocumentScrollOrResize, { capture: true });\n window.removeEventListener(\"resize\", this.#onDocumentScrollOrResize, { capture: true });\n // Can't use `usingInput` here since that could infinitely recurse\n const input = this.#input;\n if (input) {\n input.removeEventListener(\"input\", this.#onInput, { capture: true });\n CloneRegistry.delete(input);\n }\n }\n // --- private ---\n get #input() {\n return this.#inputRef?.deref();\n }\n /** Perform `fn` using the `input` if it is still available. If not, clean up the clone instead. */\n #usingInput(fn) {\n const input = this.#input;\n if (!input)\n return this.remove();\n return fn(input);\n }\n /** Current relative x-adjustment in pixels, executed via CSS transform. */\n #xOffset = 0;\n /** Current relative y-adjustment in pixels, executed via CSS transform. */\n #yOffset = 0;\n /**\n * Update only geometric properties without recalculating styles. Typically call `#requestUpdateLayout` instead to\n * only update once per animation frame.\n */\n #updateLayout() {\n // This runs often, so keep it as fast as possible! Avoid all unecessary updates.\n this.#usingInput((input) => {\n const inputStyle = window.getComputedStyle(input);\n this.style.height = inputStyle.height;\n this.style.width = inputStyle.width;\n // Immediately re-adjust for browser inconsistencies in scrollbar handling, if necessary\n if (input.clientHeight !== this.clientHeight)\n this.style.height = `calc(${inputStyle.height} + ${input.clientHeight - this.clientHeight}px)`;\n if (input.clientWidth !== this.clientWidth)\n this.style.width = `calc(${inputStyle.width} + ${input.clientWidth - this.clientWidth}px)`;\n // Position on top of the input\n const inputRect = input.getBoundingClientRect();\n const cloneRect = this.getBoundingClientRect();\n this.#xOffset = this.#xOffset + inputRect.left - cloneRect.left;\n this.#yOffset = this.#yOffset + inputRect.top - cloneRect.top;\n this.style.transform = `translate(${this.#xOffset}px, ${this.#yOffset}px)`;\n this.scrollTop = input.scrollTop;\n this.scrollLeft = input.scrollLeft;\n this.dispatchEvent(new InputStyleCloneUpdateEvent());\n });\n }\n #isLayoutUpdating = false;\n /** Request a layout update. Will only happen once per animation frame, to avoid unecessary updates. */\n #requestUpdateLayout() {\n if (this.#isLayoutUpdating)\n return;\n this.#isLayoutUpdating = true;\n requestAnimationFrame(() => {\n this.#updateLayout();\n this.#isLayoutUpdating = false;\n });\n }\n /** Update the styles of the clone based on the styles of the input, then request a layout update. */\n #updateStyles() {\n this.#usingInput((input) => {\n const inputStyle = window.getComputedStyle(input);\n for (const prop of propertiesToCopy)\n this.style[prop] = inputStyle[prop];\n this.#requestUpdateLayout();\n });\n }\n /**\n * Update the text content of the clone based on the text content of the input. Triggers a layout update in case the\n * text update caused scrolling.\n */\n #updateText() {\n this.#usingInput((input) => {\n this.textContent = input.value;\n // This is often unecessary on a pure text update, but text updates could potentially cause layout updates like\n // scrolling or resizing. And we run the update on _every frame_ when scrolling, so this isn't that expensive.\n // We don't requestUpdateLayout here because this one should happen synchronously, so that clients can react\n // within their own `input` event handlers.\n this.#updateLayout();\n });\n }\n #onInput = () => this.#updateText();\n #onDocumentScrollOrResize = (event) => {\n this.#usingInput((input) => {\n if (event.target === document ||\n event.target === window ||\n (event.target instanceof Node && event.target.contains(input)))\n this.#requestUpdateLayout();\n });\n };\n}\n// Note that some browsers, such as Firefox, do not concatenate properties\n// into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),\n// so we have to list every single property explicitly.\nconst propertiesToCopy = [\n // RTL / vertical writing modes support:\n \"direction\",\n \"writingMode\",\n \"unicodeBidi\",\n \"textOrientation\",\n \"boxSizing\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderStyle\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n // https://developer.mozilla.org/en-US/docs/Web/CSS/font\n \"fontStyle\",\n \"fontVariant\",\n \"fontWeight\",\n \"fontStretch\",\n \"fontSize\",\n \"fontSizeAdjust\",\n \"lineHeight\",\n \"fontFamily\",\n \"textAlign\",\n \"textTransform\",\n \"textIndent\",\n \"textDecoration\",\n \"letterSpacing\",\n \"wordSpacing\",\n \"tabSize\",\n \"MozTabSize\",\n];\n// Inspired by https://github.com/github/catalyst/blob/dc284dcf4f82329a9cac5c867462a8fa529b6c40/src/register.ts\ntry {\n customElements.define(\"input-style-clone\", InputStyleCloneElement);\n}\ncatch (e) {\n // Throws DOMException with NotSupportedError if already defined\n if (!(e instanceof DOMException && e.name === \"NotSupportedError\"))\n throw e;\n}\n\nclass InputRange {\n #inputElement;\n #startOffset;\n #endOffset;\n /**\n * Construct a new `InputRange`.\n * @param element The target input element that contains the content for the range.\n * @param startOffset The inclusive 0-based start index for the range. Will be adjusted to fit in the input contents.\n * @param endOffset The exclusive 0-based end index for the range. Will be adjusted to fit in the input contents.\n */\n constructor(element, startOffset = 0, endOffset = startOffset) {\n this.#inputElement = element;\n this.#startOffset = startOffset;\n this.#endOffset = endOffset;\n }\n /**\n * Create a new range from the current user selection. If the input is not focused, the range will just be the start\n * of the input (offsets `0` to `0`).\n *\n * This can be used to get the caret coordinates: if the resulting range is `collapsed`, the location of the\n * `getBoundingClientRect` will be the location of the caret caret (note, however, that the width will be `0` in\n * this case).\n */\n static fromSelection(input) {\n const { selectionStart, selectionEnd } = input;\n return new InputRange(input, selectionStart ?? undefined, selectionEnd ?? undefined);\n }\n /** Returns true if the start is equal to the end of this range. */\n get collapsed() {\n return this.startOffset === this.endOffset;\n }\n /** Always returns the containing input element. */\n get commonAncestorContainer() {\n return this.#inputElement;\n }\n /** Always returns the containing input element. */\n get endContainer() {\n return this.#inputElement;\n }\n /** Always returns the containing input element. */\n get startContainer() {\n return this.#inputElement;\n }\n get startOffset() {\n return this.#startOffset;\n }\n get endOffset() {\n return this.#endOffset;\n }\n /** Update the inclusive start offset. Will be adjusted to fit within the content size. */\n setStartOffset(offset) {\n this.#startOffset = this.#clampOffset(offset);\n }\n /** Update the exclusive end offset. Will be adjusted to fit within the content size. */\n setEndOffset(offset) {\n this.#endOffset = this.#clampOffset(offset);\n }\n /**\n * Collapse this range to one side.\n * @param toStart If `true`, will collapse to the start side. Otherwise, will collapse to the end.\n */\n collapse(toStart = false) {\n if (toStart)\n this.setEndOffset(this.startOffset);\n else\n this.setStartOffset(this.endOffset);\n }\n /** Returns a `DocumentFragment` containing a new `Text` node containing the content in the range. */\n cloneContents() {\n return this.#createCloneRange().cloneContents();\n }\n /** Create a copy of this range. */\n cloneRange() {\n return new InputRange(this.#inputElement, this.startOffset, this.endOffset);\n }\n /**\n * Obtain one rect that contains the entire contents of the range. If the range spans multiple lines, this box will\n * contain all pieces of the range but may also contain some space outside the range.\n * @see https://iansan5653.github.io/dom-input-range/demos/playground/\n */\n getBoundingClientRect() {\n return this.#createCloneRange().getBoundingClientRect();\n }\n /**\n * Obtain the rects that contain contents of this range. If the range spans multiple lines, there will be multiple\n * bounding boxes. These boxes can be used, for example, to draw a highlight over the range.\n * @see https://iansan5653.github.io/dom-input-range/demos/playground/\n */\n getClientRects() {\n return this.#createCloneRange().getClientRects();\n }\n /** Get the contents of the range as a string. */\n toString() {\n return this.#createCloneRange().toString();\n }\n /**\n * Get the underlying `InputStyleClone` instance powering these calculations. This can be used to listen for\n * updates to trigger layout recalculation.\n */\n getStyleClone() {\n return this.#styleClone;\n }\n // --- private ---\n get #styleClone() {\n return InputStyleCloneElement.for(this.#inputElement);\n }\n get #cloneElement() {\n return this.#styleClone;\n }\n #clampOffset(offset) {\n return Math.max(0, Math.min(offset, this.#inputElement.value.length));\n }\n #createCloneRange() {\n // It's tempting to create a single Range and reuse it across the lifetime of the class. However, this wouldn't be\n // accurate because the contents of the input can change and the contents of the range would become stale. So we\n // must create a new range every time we need it.\n const range = document.createRange();\n const textNode = this.#cloneElement.childNodes[0];\n if (textNode) {\n range.setStart(textNode, this.startOffset);\n range.setEnd(textNode, this.endOffset);\n }\n return range;\n }\n}\n\nconst states = new WeakMap();\nclass TextExpander {\n constructor(expander, input) {\n this.expander = expander;\n this.input = input;\n this.combobox = null;\n this.menu = null;\n this.match = null;\n this.justPasted = false;\n this.lookBackIndex = 0;\n this.oninput = this.onInput.bind(this);\n this.onpaste = this.onPaste.bind(this);\n this.onkeydown = this.onKeydown.bind(this);\n this.oncommit = this.onCommit.bind(this);\n this.onmousedown = this.onMousedown.bind(this);\n this.onblur = this.onBlur.bind(this);\n this.interactingWithList = false;\n input.addEventListener('paste', this.onpaste);\n input.addEventListener('input', this.oninput);\n input.addEventListener('keydown', this.onkeydown);\n input.addEventListener('blur', this.onblur);\n }\n destroy() {\n this.input.removeEventListener('paste', this.onpaste);\n this.input.removeEventListener('input', this.oninput);\n this.input.removeEventListener('keydown', this.onkeydown);\n this.input.removeEventListener('blur', this.onblur);\n }\n dismissMenu() {\n if (this.deactivate()) {\n this.lookBackIndex = this.input.selectionEnd || this.lookBackIndex;\n }\n }\n activate(match, menu) {\n var _a, _b;\n if (this.input !== document.activeElement && this.input !== ((_b = (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.activeElement)) {\n return;\n }\n this.deactivate();\n this.menu = menu;\n if (!menu.id)\n menu.id = `text-expander-${Math.floor(Math.random() * 100000).toString()}`;\n this.expander.append(menu);\n this.combobox = new Combobox(this.input, menu);\n this.expander.dispatchEvent(new Event('text-expander-activate'));\n this.positionMenu(menu, match.position);\n this.combobox.start();\n menu.addEventListener('combobox-commit', this.oncommit);\n menu.addEventListener('mousedown', this.onmousedown);\n this.combobox.navigate(1);\n }\n positionMenu(menu, position) {\n const caretRect = new InputRange(this.input, position).getBoundingClientRect();\n const targetPosition = { left: caretRect.left, top: caretRect.top + caretRect.height };\n const currentPosition = menu.getBoundingClientRect();\n const delta = {\n left: targetPosition.left - currentPosition.left,\n top: targetPosition.top - currentPosition.top\n };\n if (delta.left !== 0 || delta.top !== 0) {\n const currentStyle = getComputedStyle(menu);\n menu.style.left = currentStyle.left ? `calc(${currentStyle.left} + ${delta.left}px)` : `${delta.left}px`;\n menu.style.top = currentStyle.top ? `calc(${currentStyle.top} + ${delta.top}px)` : `${delta.top}px`;\n }\n }\n deactivate() {\n const menu = this.menu;\n if (!menu || !this.combobox)\n return false;\n this.expander.dispatchEvent(new Event('text-expander-deactivate'));\n this.menu = null;\n menu.removeEventListener('combobox-commit', this.oncommit);\n menu.removeEventListener('mousedown', this.onmousedown);\n this.combobox.destroy();\n this.combobox = null;\n menu.remove();\n return true;\n }\n onCommit({ target }) {\n var _a;\n const item = target;\n if (!(item instanceof HTMLElement))\n return;\n if (!this.combobox)\n return;\n const match = this.match;\n if (!match)\n return;\n const beginning = this.input.value.substring(0, match.position - match.key.length);\n const remaining = this.input.value.substring(match.position + match.text.length);\n const detail = { item, key: match.key, value: null, continue: false };\n const canceled = !this.expander.dispatchEvent(new CustomEvent('text-expander-value', { cancelable: true, detail }));\n if (canceled)\n return;\n if (!detail.value)\n return;\n let suffix = (_a = this.expander.getAttribute('suffix')) !== null && _a !== void 0 ? _a : ' ';\n if (detail.continue) {\n suffix = '';\n }\n const value = `${detail.value}${suffix}`;\n this.input.value = beginning + value + remaining;\n const cursor = beginning.length + value.length;\n this.deactivate();\n this.input.focus({\n preventScroll: true\n });\n this.input.selectionStart = cursor;\n this.input.selectionEnd = cursor;\n if (!detail.continue) {\n this.lookBackIndex = cursor;\n this.match = null;\n }\n this.expander.dispatchEvent(new CustomEvent('text-expander-committed', { cancelable: false, detail: { input: this.input } }));\n }\n onBlur() {\n if (this.interactingWithList) {\n this.interactingWithList = false;\n return;\n }\n this.deactivate();\n }\n onPaste() {\n this.justPasted = true;\n }\n async onInput() {\n if (this.justPasted) {\n this.justPasted = false;\n return;\n }\n const match = this.findMatch();\n if (match) {\n this.match = match;\n const menu = await this.notifyProviders(match);\n if (!this.match)\n return;\n if (menu) {\n this.activate(match, menu);\n }\n else {\n this.deactivate();\n }\n }\n else {\n this.match = null;\n this.deactivate();\n }\n }\n findMatch() {\n const cursor = this.input.selectionEnd || 0;\n const text = this.input.value;\n if (cursor <= this.lookBackIndex) {\n this.lookBackIndex = cursor - 1;\n }\n for (const { key, multiWord } of this.expander.keys) {\n const found = query(text, key, cursor, {\n multiWord,\n lookBackIndex: this.lookBackIndex,\n lastMatchPosition: this.match ? this.match.position : null\n });\n if (found) {\n return { text: found.text, key, position: found.position };\n }\n }\n }\n async notifyProviders(match) {\n const providers = [];\n const provide = (result) => providers.push(result);\n const canceled = !this.expander.dispatchEvent(new CustomEvent('text-expander-change', { cancelable: true, detail: { provide, text: match.text, key: match.key } }));\n if (canceled)\n return;\n const all = await Promise.all(providers);\n const fragments = all.filter(x => x.matched).map(x => x.fragment);\n return fragments[0];\n }\n onMousedown() {\n this.interactingWithList = true;\n }\n onKeydown(event) {\n if (event.key === 'Escape') {\n this.match = null;\n if (this.deactivate()) {\n this.lookBackIndex = this.input.selectionEnd || this.lookBackIndex;\n event.stopImmediatePropagation();\n event.preventDefault();\n }\n }\n }\n}\nclass TextExpanderElement extends HTMLElement {\n get keys() {\n const keysAttr = this.getAttribute('keys');\n const keys = keysAttr ? keysAttr.split(' ') : [];\n const multiWordAttr = this.getAttribute('multiword');\n const multiWord = multiWordAttr ? multiWordAttr.split(' ') : [];\n const globalMultiWord = multiWord.length === 0 && this.hasAttribute('multiword');\n return keys.map(key => ({ key, multiWord: globalMultiWord || multiWord.includes(key) }));\n }\n set keys(value) {\n this.setAttribute('keys', value);\n }\n connectedCallback() {\n const input = this.querySelector('input[type=\"text\"], textarea');\n if (!(input instanceof HTMLInputElement || input instanceof HTMLTextAreaElement))\n return;\n const state = new TextExpander(this, input);\n states.set(this, state);\n }\n disconnectedCallback() {\n const state = states.get(this);\n if (!state)\n return;\n state.destroy();\n states.delete(this);\n }\n dismiss() {\n const state = states.get(this);\n if (!state)\n return;\n state.dismissMenu();\n }\n}\n\nif (!window.customElements.get('text-expander')) {\n window.TextExpanderElement = TextExpanderElement;\n window.customElements.define('text-expander', TextExpanderElement);\n}\n\nexport { TextExpanderElement as default };\n","export default function ansiRegex({onlyFirst = false} = {}) {\n\tconst pattern = [\n\t '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)',\n\t\t'(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~]))'\n\t].join('|');\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n","import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n","import stripAnsi from 'strip-ansi';\n\nconst segmenter = new Intl.Segmenter();\n\nexport default function stringLength(string, {countAnsiEscapeCodes = false} = {}) {\n\tif (string === '') {\n\t\treturn 0;\n\t}\n\n\tif (!countAnsiEscapeCodes) {\n\t\tstring = stripAnsi(string);\n\t}\n\n\tif (string === '') {\n\t\treturn 0;\n\t}\n\n\tlet length = 0;\n\n\tfor (const _ of segmenter.segment(string)) { // eslint-disable-line no-unused-vars\n\t\tlength++;\n\t}\n\n\treturn length;\n}\n","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.0'%20viewBox='0%200%20641%20223'%3e%3cpath%20fill='%23aaa'%20d='M86%20214c-9-1-17-4-24-8l-6-3-5-5-5-4-4-6-4-6-3-8-2-8v-27l2-9%203-9%204-6%204-6%205-5%205-5%207-3%206-4%207-2%207-2%2012-1h12l7%201%208%202%207%204%207%203%205%205%205%204-10%2010-10%209-4-3-10-5-5-1H88l-5%202-6%203-3%204-4%204-2%205-2%206v6l-1%207%201%207%202%207%203%205%202%204%204%203%204%203%205%202%206%202h9l10-1%205-2%206-3v-16H91v-27h59v54l-1%203-2%203-5%204-4%204-5%203-5%202-8%202-8%202-10%201H92l-6-1zm266-62V91h34v46h44V91h34v121h-34v-46h-44v46h-34v-61zm-182-1V90h34v121h-34v-60zm59-1V90h35l36%201%205%202c3%200%208%202%2010%204l5%202%204%205%205%204%203%207%203%207%201%2013v13l-4%206-3%207-4%204-5%205-5%202-5%203-6%202-5%201-18%201h-18v32h-34v-61zm67-2%203-2%202-4%202-5v-5l-2-4-2-4-3-2-3-3h-30v31h30l3-2zm226%2039v-24l-8-12-18-28a1751%201751%200%200%200-20-31v-2h39l7%2012%2012%2021%206%209%2013-21%2013-21h38v2l-41%2061-7%2010v48h-34v-24zM109%2066l-4-1-5-5-5-4-1-5-3-9v-5l1-5c2-7%203-10%208-15l4-4%207-2%207-2h7l6%201%205%202%205%202%203%204%204%203%202%206%202%205v13l-2%205-2%206-4%204-3%203-5%202-4%202-9%201h-9l-5-2zm22-11%204-2%203-4%202-5V34l-2-4-2-4-3-2-4-3-5-1h-6l-4%202-5%202-2%204-3%205-1%203v4l1%205%202%205%202%202%205%203%204%202h10l4-2zM37%2039V11h33l3%201%203%202%204%203%203%203%201%205%201%204v5l-1%204-3%204-3%205-4%201-3%202-11%201H49v16H37V39zm31%200%203-2%201-2%201-2v-4l-1-3-3-2-2-2H49v18h15l4-1zm107%2025a512%20512%200%200%200-19-53h14l4%2014%206%2019%201%204%201-1%207-19%205-17h9l6%2019%207%2018v-1l2-6%205-17%204-13h14v1l-4%2012-16%2041v2h-5l-5-1-6-15-6-15-1%201-3%207-6%2015-2%208h-11l-1-3zm74-25V11h42v11h-29v2l-1%205v4h29v11h-28v11h2l15%201h13v11h-43V39zm55%200V11h33l5%203%205%202%202%204%202%205v10l-2%203-1%204-5%203-5%203%205%205%208%2010%203%204h-14l-7-9-8-10h-9v19h-12V39zm33-3%202-3v-6l-3-3-2-3h-18v16h1v1h17l2-2zm26%203V11h42v11h-29l-1%206v5h29v11h-28v5l-1%205%201%201v1h30v11h-43V39zm54%200V11h17l18%201%204%202%205%203%202%204%203%204%202%206%201%206v5c-1%206-3%2012-6%2015l-3%204-5%203-5%202-17%201h-16V39zm33%2014%205-5%202-3v-6l-1-6-1-3-1-3-4-3-3-2h-5l-6-1-3%201h-3v34h9l8-1%203-2zm50-14V11h34l5%202%204%202%202%203%202%203v9l-2%202-3%204-1%201%203%203%203%204%201%203%201%204-1%204-1%204-3%203-3%203-5%201-5%201h-31V39zm34%2015%202-1v-6l-2-2-2-2h-20v13h20l2-2zm-3-22%204-2v-6l-2-1-2-2h-19v12h16l4-1zm42%2024V45l-6-9-11-17-5-8h15l4%208%207%2011%202%203%207-11%207-11h14l-11%2016-11%2017v23h-12V56z'/%3e%3c/svg%3e\"","import './compose.css';\nimport '@github/text-expander-element';\n\nimport { msg, plural } from '@lingui/core/macro';\nimport { Trans, useLingui } from '@lingui/react/macro';\nimport { MenuItem } from '@szhsin/react-menu';\nimport { deepEqual } from 'fast-equals';\nimport Fuse from 'fuse.js';\nimport { forwardRef, memo } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport stringLength from 'string-length';\n// import { detectAll } from 'tinyld/light';\nimport { uid } from 'uid/single';\nimport { useDebouncedCallback, useThrottledCallback } from 'use-debounce';\nimport useResizeObserver from 'use-resize-observer';\nimport { useSnapshot } from 'valtio';\n\nimport poweredByGiphyURL from '../assets/powered-by-giphy.svg';\n\nimport Menu2 from '../components/menu2';\nimport supportedLanguages from '../data/status-supported-languages';\nimport urlRegex from '../data/url-regex';\nimport { api } from '../utils/api';\nimport db from '../utils/db';\nimport emojifyText from '../utils/emojify-text';\nimport i18nDuration from '../utils/i18n-duration';\nimport isRTL from '../utils/is-rtl';\nimport localeMatch from '../utils/locale-match';\nimport localeCode2Text from '../utils/localeCode2Text';\nimport mem from '../utils/mem';\nimport openCompose from '../utils/open-compose';\nimport pmem from '../utils/pmem';\nimport prettyBytes from '../utils/pretty-bytes';\nimport { fetchRelationships } from '../utils/relationships';\nimport shortenNumber from '../utils/shorten-number';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport store from '../utils/store';\nimport {\n getCurrentAccount,\n getCurrentAccountNS,\n getCurrentInstance,\n getCurrentInstanceConfiguration,\n} from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport useCloseWatcher from '../utils/useCloseWatcher';\nimport useInterval from '../utils/useInterval';\nimport visibilityIconsMap from '../utils/visibility-icons-map';\n\nimport AccountBlock from './account-block';\n// import Avatar from './avatar';\nimport Icon from './icon';\nimport Loader from './loader';\nimport Modal from './modal';\nimport Status from './status';\n\nconst {\n PHANPY_IMG_ALT_API_URL: IMG_ALT_API_URL,\n PHANPY_GIPHY_API_KEY: GIPHY_API_KEY,\n} = import.meta.env;\n\nconst supportedLanguagesMap = supportedLanguages.reduce((acc, l) => {\n const [code, common, native] = l;\n acc[code] = {\n common,\n native,\n };\n return acc;\n}, {});\n\n/* NOTES:\n - Max character limit includes BOTH status text and Content Warning text\n*/\n\nconst expiryOptions = {\n 300: i18nDuration(5, 'minute'),\n 1_800: i18nDuration(30, 'minute'),\n 3_600: i18nDuration(1, 'hour'),\n 21_600: i18nDuration(6, 'hour'),\n 86_400: i18nDuration(1, 'day'),\n 259_200: i18nDuration(3, 'day'),\n 604_800: i18nDuration(1, 'week'),\n};\nconst expirySeconds = Object.keys(expiryOptions);\nconst oneDay = 24 * 60 * 60;\n\nconst expiresInFromExpiresAt = (expiresAt) => {\n if (!expiresAt) return oneDay;\n const delta = (new Date(expiresAt).getTime() - Date.now()) / 1000;\n return expirySeconds.find((s) => s >= delta) || oneDay;\n};\n\nconst menu = document.createElement('ul');\nmenu.role = 'listbox';\nmenu.className = 'text-expander-menu';\n\n// Set IntersectionObserver on menu, reposition it because text-expander doesn't handle it\nconst windowMargin = 16;\nconst observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n const { left, width } = entry.boundingClientRect;\n const { innerWidth } = window;\n if (left + width > innerWidth) {\n const insetInlineStart = isRTL() ? 'right' : 'left';\n menu.style[insetInlineStart] = innerWidth - width - windowMargin + 'px';\n }\n }\n });\n});\nobserver.observe(menu);\n\nconst DEFAULT_LANG = localeMatch(\n [new Intl.DateTimeFormat().resolvedOptions().locale, ...navigator.languages],\n supportedLanguages.map((l) => l[0]),\n 'en',\n);\n\n// https://github.com/mastodon/mastodon/blob/c4a429ed47e85a6bbf0d470a41cc2f64cf120c19/app/javascript/mastodon/features/compose/util/counter.js\nconst urlRegexObj = new RegExp(urlRegex.source, urlRegex.flags);\nconst usernameRegex = /(^|[^\\/\\w])@(([a-z0-9_]+)@[a-z0-9\\.\\-]+[a-z0-9]+)/gi;\nconst urlPlaceholder = '$2xxxxxxxxxxxxxxxxxxxxxxx';\nfunction countableText(inputText) {\n return inputText\n .replace(urlRegexObj, urlPlaceholder)\n .replace(usernameRegex, '$1@$3');\n}\n\n// https://github.com/mastodon/mastodon/blob/c03bd2a238741a012aa4b98dc4902d6cf948ab63/app/models/account.rb#L69\nconst USERNAME_RE = /[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?/i;\nconst MENTION_RE = new RegExp(\n `(^|[^=\\\\/\\\\w])(@${USERNAME_RE.source}(?:@[\\\\p{L}\\\\w.-]+[\\\\w]+)?)`,\n 'uig',\n);\n\n// AI-generated, all other regexes are too complicated\nconst HASHTAG_RE = new RegExp(\n `(^|[^=\\\\/\\\\w])(#[a-z0-9_]+([a-z0-9_.]+[a-z0-9_]+)?)(?![\\\\/\\\\w])`,\n 'ig',\n);\n\n// https://github.com/mastodon/mastodon/blob/23e32a4b3031d1da8b911e0145d61b4dd47c4f96/app/models/custom_emoji.rb#L31\nconst SHORTCODE_RE_FRAGMENT = '[a-zA-Z0-9_]{2,}';\nconst SCAN_RE = new RegExp(\n `(^|[^=\\\\/\\\\w])(:${SHORTCODE_RE_FRAGMENT}:)(?=[^A-Za-z0-9_:]|$)`,\n 'g',\n);\n\nconst segmenter = new Intl.Segmenter();\nfunction escapeHTML(text) {\n return text\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\nfunction highlightText(text, { maxCharacters = Infinity }) {\n // Exceeded characters limit\n const { composerCharacterCount } = states;\n if (composerCharacterCount > maxCharacters) {\n // Highlight exceeded characters\n let withinLimitHTML = '',\n exceedLimitHTML = '';\n const htmlSegments = segmenter.segment(text);\n for (const { segment, index } of htmlSegments) {\n if (index < maxCharacters) {\n withinLimitHTML += segment;\n } else {\n exceedLimitHTML += segment;\n }\n }\n if (exceedLimitHTML) {\n exceedLimitHTML =\n '' +\n escapeHTML(exceedLimitHTML) +\n '';\n }\n return escapeHTML(withinLimitHTML) + exceedLimitHTML;\n }\n\n return escapeHTML(text)\n .replace(urlRegexObj, '$2$3') // URLs\n .replace(MENTION_RE, '$1$2') // Mentions\n .replace(HASHTAG_RE, '$1$2') // Hashtags\n .replace(\n SCAN_RE,\n '$1$2',\n ); // Emoji shortcodes\n}\n\n// const rtf = new Intl.RelativeTimeFormat();\nconst RTF = mem((locale) => new Intl.RelativeTimeFormat(locale || undefined));\nconst LF = mem((locale) => new Intl.ListFormat(locale || undefined));\n\nconst CUSTOM_EMOJIS_COUNT = 100;\n\nconst ADD_LABELS = {\n media: msg`Add media`,\n customEmoji: msg`Add custom emoji`,\n gif: msg`Add GIF`,\n poll: msg`Add poll`,\n};\n\nfunction Compose({\n onClose,\n replyToStatus,\n editStatus,\n draftStatus,\n standalone,\n hasOpener,\n}) {\n const { i18n, _, t } = useLingui();\n const rtf = RTF(i18n.locale);\n const lf = LF(i18n.locale);\n\n console.warn('RENDER COMPOSER');\n const { masto, instance } = api();\n const [uiState, setUIState] = useState('default');\n const UID = useRef(draftStatus?.uid || uid());\n console.log('Compose UID', UID.current);\n\n const currentAccount = getCurrentAccount();\n const currentAccountInfo = currentAccount.info;\n\n const configuration = getCurrentInstanceConfiguration();\n console.log('⚙️ Configuration', configuration);\n\n const {\n statuses: {\n maxCharacters,\n maxMediaAttachments, // Beware: it can be undefined!\n charactersReservedPerUrl,\n } = {},\n mediaAttachments: {\n supportedMimeTypes,\n imageSizeLimit,\n imageMatrixLimit,\n videoSizeLimit,\n videoMatrixLimit,\n videoFrameRateLimit,\n } = {},\n polls: {\n maxOptions,\n maxCharactersPerOption,\n maxExpiration,\n minExpiration,\n } = {},\n } = configuration || {};\n\n const textareaRef = useRef();\n const spoilerTextRef = useRef();\n const [visibility, setVisibility] = useState('public');\n const [sensitive, setSensitive] = useState(false);\n const [language, setLanguage] = useState(\n store.session.get('currentLanguage') || DEFAULT_LANG,\n );\n const prevLanguage = useRef(language);\n const [mediaAttachments, setMediaAttachments] = useState([]);\n const [poll, setPoll] = useState(null);\n\n const prefs = store.account.get('preferences') || {};\n\n const oninputTextarea = () => {\n if (!textareaRef.current) return;\n textareaRef.current.dispatchEvent(new Event('input'));\n };\n const focusTextarea = () => {\n setTimeout(() => {\n if (!textareaRef.current) return;\n // status starts with newline, focus on first position\n if (draftStatus?.status?.startsWith?.('\\n')) {\n textareaRef.current.selectionStart = 0;\n textareaRef.current.selectionEnd = 0;\n }\n console.debug('FOCUS textarea');\n textareaRef.current?.focus();\n }, 300);\n };\n\n useEffect(() => {\n if (replyToStatus) {\n const { spoilerText, visibility, language, sensitive } = replyToStatus;\n if (spoilerText && spoilerTextRef.current) {\n spoilerTextRef.current.value = spoilerText;\n }\n const mentions = new Set([\n replyToStatus.account.acct,\n ...replyToStatus.mentions.map((m) => m.acct),\n ]);\n const allMentions = [...mentions].filter(\n (m) => m !== currentAccountInfo.acct,\n );\n if (allMentions.length > 0) {\n textareaRef.current.value = `${allMentions\n .map((m) => `@${m}`)\n .join(' ')} `;\n oninputTextarea();\n }\n focusTextarea();\n setVisibility(\n visibility === 'public' && prefs['posting:default:visibility']\n ? prefs['posting:default:visibility'].toLowerCase()\n : visibility,\n );\n setLanguage(\n language ||\n prefs['posting:default:language']?.toLowerCase() ||\n DEFAULT_LANG,\n );\n setSensitive(sensitive && !!spoilerText);\n } else if (editStatus) {\n const { visibility, language, sensitive, poll, mediaAttachments } =\n editStatus;\n const composablePoll = !!poll?.options && {\n ...poll,\n options: poll.options.map((o) => o?.title || o),\n expiresIn: poll?.expiresIn || expiresInFromExpiresAt(poll.expiresAt),\n };\n setUIState('loading');\n (async () => {\n try {\n const statusSource = await masto.v1.statuses\n .$select(editStatus.id)\n .source.fetch();\n console.log({ statusSource });\n const { text, spoilerText } = statusSource;\n textareaRef.current.value = text;\n textareaRef.current.dataset.source = text;\n oninputTextarea();\n focusTextarea();\n spoilerTextRef.current.value = spoilerText;\n setVisibility(visibility);\n setLanguage(\n language ||\n prefs['posting:default:language']?.toLowerCase() ||\n DEFAULT_LANG,\n );\n setSensitive(sensitive);\n if (composablePoll) setPoll(composablePoll);\n setMediaAttachments(mediaAttachments);\n setUIState('default');\n } catch (e) {\n console.error(e);\n alert(e?.reason || e);\n setUIState('error');\n }\n })();\n } else {\n focusTextarea();\n console.log('Apply prefs', prefs);\n if (prefs['posting:default:visibility']) {\n setVisibility(prefs['posting:default:visibility'].toLowerCase());\n }\n if (prefs['posting:default:language']) {\n setLanguage(prefs['posting:default:language'].toLowerCase());\n }\n if (prefs['posting:default:sensitive']) {\n setSensitive(!!prefs['posting:default:sensitive']);\n }\n }\n if (draftStatus) {\n const {\n status,\n spoilerText,\n visibility,\n language,\n sensitive,\n poll,\n mediaAttachments,\n } = draftStatus;\n const composablePoll = !!poll?.options && {\n ...poll,\n options: poll.options.map((o) => o?.title || o),\n expiresIn: poll?.expiresIn || expiresInFromExpiresAt(poll.expiresAt),\n };\n textareaRef.current.value = status;\n oninputTextarea();\n focusTextarea();\n if (spoilerText) spoilerTextRef.current.value = spoilerText;\n if (visibility) setVisibility(visibility);\n setLanguage(\n language ||\n prefs['posting:default:language']?.toLowerCase() ||\n DEFAULT_LANG,\n );\n if (sensitive !== null) setSensitive(sensitive);\n if (composablePoll) setPoll(composablePoll);\n if (mediaAttachments) setMediaAttachments(mediaAttachments);\n }\n }, [draftStatus, editStatus, replyToStatus]);\n\n const formRef = useRef();\n\n const beforeUnloadCopy = t`You have unsaved changes. Discard this post?`;\n const canClose = () => {\n const { value, dataset } = textareaRef.current;\n\n // check if loading\n if (uiState === 'loading') {\n console.log('canClose', { uiState });\n return false;\n }\n\n // check for status and media attachments\n const hasValue = (value || '')\n .trim()\n .replace(/^\\p{White_Space}+|\\p{White_Space}+$/gu, '');\n const hasMediaAttachments = mediaAttachments.length > 0;\n if (!hasValue && !hasMediaAttachments) {\n console.log('canClose', { value, mediaAttachments });\n return true;\n }\n\n // check if all media attachments have IDs\n const hasIDMediaAttachments =\n mediaAttachments.length > 0 &&\n mediaAttachments.every((media) => media.id);\n if (hasIDMediaAttachments) {\n console.log('canClose', { hasIDMediaAttachments });\n return true;\n }\n\n // check if status contains only \"@acct\", if replying\n const isSelf = replyToStatus?.account.id === currentAccountInfo.id;\n const hasOnlyAcct =\n replyToStatus && value.trim() === `@${replyToStatus.account.acct}`;\n // TODO: check for mentions, or maybe just generic \"@username\", including multiple mentions like \"@username1@username2\"\n if (!isSelf && hasOnlyAcct) {\n console.log('canClose', { isSelf, hasOnlyAcct });\n return true;\n }\n\n // check if status is same with source\n const sameWithSource = value === dataset?.source;\n if (sameWithSource) {\n console.log('canClose', { sameWithSource });\n return true;\n }\n\n console.log('canClose', {\n value,\n hasMediaAttachments,\n hasIDMediaAttachments,\n poll,\n isSelf,\n hasOnlyAcct,\n sameWithSource,\n uiState,\n });\n\n return false;\n };\n\n const confirmClose = () => {\n if (!canClose()) {\n const yes = confirm(beforeUnloadCopy);\n return yes;\n }\n return true;\n };\n\n useEffect(() => {\n // Show warning if user tries to close window with unsaved changes\n const handleBeforeUnload = (e) => {\n if (!canClose()) {\n e.preventDefault();\n e.returnValue = beforeUnloadCopy;\n }\n };\n window.addEventListener('beforeunload', handleBeforeUnload, {\n capture: true,\n });\n return () =>\n window.removeEventListener('beforeunload', handleBeforeUnload, {\n capture: true,\n });\n }, []);\n\n const getCharCount = () => {\n const { value } = textareaRef.current;\n const { value: spoilerText } = spoilerTextRef.current;\n return stringLength(countableText(value)) + stringLength(spoilerText);\n };\n const updateCharCount = () => {\n const count = getCharCount();\n states.composerCharacterCount = count;\n };\n useEffect(updateCharCount, []);\n\n const supportsCloseWatcher = window.CloseWatcher;\n const escDownRef = useRef(false);\n useHotkeys(\n 'esc',\n () => {\n escDownRef.current = true;\n // This won't be true if this event is already handled and not propagated 🤞\n },\n {\n enabled: !supportsCloseWatcher,\n enableOnFormTags: true,\n },\n );\n useHotkeys(\n 'esc',\n () => {\n if (!standalone && escDownRef.current && confirmClose()) {\n onClose();\n }\n escDownRef.current = false;\n },\n {\n enabled: !supportsCloseWatcher,\n enableOnFormTags: true,\n // Use keyup because Esc keydown will close the confirm dialog on Safari\n keyup: true,\n ignoreEventWhen: (e) => {\n const modals = document.querySelectorAll('#modal-container > *');\n const hasModal = !!modals;\n const hasOnlyComposer =\n modals.length === 1 && modals[0].querySelector('#compose-container');\n return hasModal && !hasOnlyComposer;\n },\n },\n );\n useCloseWatcher(() => {\n if (!standalone && confirmClose()) {\n onClose();\n }\n }, [standalone, confirmClose, onClose]);\n\n const prevBackgroundDraft = useRef({});\n const draftKey = () => {\n const ns = getCurrentAccountNS();\n return `${ns}#${UID.current}`;\n };\n const saveUnsavedDraft = () => {\n // Not enabling this for editing status\n // I don't think this warrant a draft mode for a status that's already posted\n // Maybe it could be a big edit change but it should be rare\n if (editStatus) return;\n if (states.composerState.minimized) return;\n const key = draftKey();\n const backgroundDraft = {\n key,\n replyTo: replyToStatus\n ? {\n /* Smaller payload of replyToStatus. Reasons:\n - No point storing whole thing\n - Could have media attachments\n - Could be deleted/edited later\n */\n id: replyToStatus.id,\n account: {\n id: replyToStatus.account.id,\n username: replyToStatus.account.username,\n acct: replyToStatus.account.acct,\n },\n }\n : null,\n draftStatus: {\n uid: UID.current,\n status: textareaRef.current.value,\n spoilerText: spoilerTextRef.current.value,\n visibility,\n language,\n sensitive,\n poll,\n mediaAttachments,\n },\n };\n if (\n !deepEqual(backgroundDraft, prevBackgroundDraft.current) &&\n !canClose()\n ) {\n console.debug('not equal', backgroundDraft, prevBackgroundDraft.current);\n db.drafts\n .set(key, {\n ...backgroundDraft,\n state: 'unsaved',\n updatedAt: Date.now(),\n })\n .then(() => {\n console.debug('DRAFT saved', key, backgroundDraft);\n })\n .catch((e) => {\n console.error('DRAFT failed', key, e);\n });\n prevBackgroundDraft.current = structuredClone(backgroundDraft);\n }\n };\n useInterval(saveUnsavedDraft, 5000); // background save every 5s\n useEffect(() => {\n saveUnsavedDraft();\n // If unmounted, means user discarded the draft\n // Also means pop-out 🙈, but it's okay because the pop-out will persist the ID and re-create the draft\n return () => {\n db.drafts.del(draftKey());\n };\n }, []);\n\n useEffect(() => {\n const handleItems = (e) => {\n const { items } = e.clipboardData || e.dataTransfer;\n const files = [];\n const unsupportedFiles = [];\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (item.kind === 'file') {\n const file = item.getAsFile();\n if (\n supportedMimeTypes !== undefined &&\n !supportedMimeTypes.includes(file.type)\n ) {\n unsupportedFiles.push(file);\n } else {\n files.push(file);\n }\n }\n }\n if (unsupportedFiles.length > 0) {\n alert(\n plural(unsupportedFiles.length, {\n one: `File ${unsupportedFiles[0].name} is not supported.`,\n other: `Files ${lf.format(\n unsupportedFiles.map((f) => f.name),\n )} are not supported.`,\n }),\n );\n }\n if (files.length > 0 && mediaAttachments.length >= maxMediaAttachments) {\n alert(\n plural(maxMediaAttachments, {\n one: 'You can only attach up to 1 file.',\n other: 'You can only attach up to # files.',\n }),\n );\n return;\n }\n console.log({ files });\n if (files.length > 0) {\n e.preventDefault();\n e.stopPropagation();\n // Auto-cut-off files to avoid exceeding maxMediaAttachments\n let allowedFiles = files;\n if (maxMediaAttachments !== undefined) {\n const max = maxMediaAttachments - mediaAttachments.length;\n allowedFiles = allowedFiles.slice(0, max);\n if (allowedFiles.length <= 0) {\n alert(\n plural(maxMediaAttachments, {\n one: 'You can only attach up to 1 file.',\n other: 'You can only attach up to # files.',\n }),\n );\n return;\n }\n }\n const mediaFiles = allowedFiles.map((file) => ({\n file,\n type: file.type,\n size: file.size,\n url: URL.createObjectURL(file),\n id: null,\n description: null,\n }));\n setMediaAttachments([...mediaAttachments, ...mediaFiles]);\n }\n };\n window.addEventListener('paste', handleItems);\n const handleDragover = (e) => {\n // Prevent default if there's files\n if (e.dataTransfer.items.length > 0) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n window.addEventListener('dragover', handleDragover);\n window.addEventListener('drop', handleItems);\n return () => {\n window.removeEventListener('paste', handleItems);\n window.removeEventListener('dragover', handleDragover);\n window.removeEventListener('drop', handleItems);\n };\n }, [mediaAttachments]);\n\n const [showMentionPicker, setShowMentionPicker] = useState(false);\n const [showEmoji2Picker, setShowEmoji2Picker] = useState(false);\n const [showGIFPicker, setShowGIFPicker] = useState(false);\n\n const [autoDetectedLanguages, setAutoDetectedLanguages] = useState(null);\n const [topSupportedLanguages, restSupportedLanguages] = useMemo(() => {\n const topLanguages = [];\n const restLanguages = [];\n const { contentTranslationHideLanguages = [] } = states.settings;\n supportedLanguages.forEach((l) => {\n const [code] = l;\n if (\n code === language ||\n code === prevLanguage.current ||\n code === DEFAULT_LANG ||\n contentTranslationHideLanguages.includes(code) ||\n (autoDetectedLanguages?.length && autoDetectedLanguages.includes(code))\n ) {\n topLanguages.push(l);\n } else {\n restLanguages.push(l);\n }\n });\n topLanguages.sort(([codeA, commonA], [codeB, commonB]) => {\n if (codeA === language) return -1;\n if (codeB === language) return 1;\n return commonA.localeCompare(commonB);\n });\n restLanguages.sort(([codeA, commonA], [codeB, commonB]) =>\n commonA.localeCompare(commonB),\n );\n return [topLanguages, restLanguages];\n }, [language, autoDetectedLanguages]);\n\n const replyToStatusMonthsAgo = useMemo(\n () =>\n !!replyToStatus?.createdAt &&\n Math.floor(\n (Date.now() - new Date(replyToStatus.createdAt)) /\n (1000 * 60 * 60 * 24 * 30),\n ),\n [replyToStatus],\n );\n\n const onMinimize = () => {\n saveUnsavedDraft();\n states.composerState.minimized = true;\n };\n\n const gifPickerDisabled =\n uiState === 'loading' ||\n (maxMediaAttachments !== undefined &&\n mediaAttachments.length >= maxMediaAttachments) ||\n !!poll;\n\n // If maxOptions is not defined or defined and is greater than 1, show poll button\n const showPollButton = maxOptions == null || maxOptions > 1;\n const pollButtonDisabled =\n uiState === 'loading' || !!poll || !!mediaAttachments.length;\n const onPollButtonClick = () => {\n setPoll({\n options: ['', ''],\n expiresIn: 24 * 60 * 60, // 1 day\n multiple: false,\n });\n };\n\n const addSubToolbarRef = useRef();\n const [showAddButton, setShowAddButton] = useState(false);\n useResizeObserver({\n ref: addSubToolbarRef,\n box: 'border-box',\n onResize: ({ width }) => {\n // If scrollable, it's truncated\n const { scrollWidth } = addSubToolbarRef.current;\n const truncated = scrollWidth > width;\n const overTruncated = width < 84; // roughly two buttons width\n setShowAddButton(overTruncated || truncated);\n addSubToolbarRef.current.hidden = overTruncated;\n },\n });\n\n return (\n
    \n
    \n
    \n {currentAccountInfo?.avatarStatic && (\n // \n \n )}\n {!standalone ? (\n \n {\n // If there are non-ID media attachments (not yet uploaded), show confirmation dialog because they are not going to be passed to the new window\n // const containNonIDMediaAttachments =\n // mediaAttachments.length > 0 &&\n // mediaAttachments.some((media) => !media.id);\n // if (containNonIDMediaAttachments) {\n // const yes = confirm(\n // 'You have media attachments that are not yet uploaded. Opening a new window will discard them and you will need to re-attach them. Are you sure you want to continue?',\n // );\n // if (!yes) {\n // return;\n // }\n // }\n\n // const mediaAttachmentsWithIDs = mediaAttachments.filter(\n // (media) => media.id,\n // );\n\n const newWin = openCompose({\n editStatus,\n replyToStatus,\n draftStatus: {\n uid: UID.current,\n status: textareaRef.current.value,\n spoilerText: spoilerTextRef.current.value,\n visibility,\n language,\n sensitive,\n poll,\n mediaAttachments,\n },\n });\n\n if (!newWin) {\n return;\n }\n\n onClose();\n }}\n >\n \n \n \n \n {' '}\n {\n if (confirmClose()) {\n onClose();\n }\n }}\n >\n \n \n \n ) : (\n hasOpener && (\n {\n // If there are non-ID media attachments (not yet uploaded), show confirmation dialog because they are not going to be passed to the new window\n // const containNonIDMediaAttachments =\n // mediaAttachments.length > 0 &&\n // mediaAttachments.some((media) => !media.id);\n // if (containNonIDMediaAttachments) {\n // const yes = confirm(\n // 'You have media attachments that are not yet uploaded. Opening a new window will discard them and you will need to re-attach them. Are you sure you want to continue?',\n // );\n // if (!yes) {\n // return;\n // }\n // }\n\n if (!window.opener) {\n alert(t`Looks like you closed the parent window.`);\n return;\n }\n\n if (window.opener.__STATES__.showCompose) {\n if (window.opener.__STATES__.composerState?.publishing) {\n alert(\n t`Looks like you already have a compose field open in the parent window and currently publishing. Please wait for it to be done and try again later.`,\n );\n return;\n }\n\n let confirmText = t`Looks like you already have a compose field open in the parent window. Popping in this window will discard the changes you made in the parent window. Continue?`;\n const yes = confirm(confirmText);\n if (!yes) return;\n }\n\n // const mediaAttachmentsWithIDs = mediaAttachments.filter(\n // (media) => media.id,\n // );\n\n onClose({\n fn: () => {\n const passData = {\n editStatus,\n replyToStatus,\n draftStatus: {\n uid: UID.current,\n status: textareaRef.current.value,\n spoilerText: spoilerTextRef.current.value,\n visibility,\n language,\n sensitive,\n poll,\n mediaAttachments,\n },\n };\n window.opener.__COMPOSE__ = passData; // Pass it here instead of `showCompose` due to some weird proxy issue again\n if (window.opener.__STATES__.showCompose) {\n window.opener.__STATES__.showCompose = false;\n setTimeout(() => {\n window.opener.__STATES__.showCompose = true;\n }, 10);\n } else {\n window.opener.__STATES__.showCompose = true;\n }\n if (window.opener.__STATES__.composerState.minimized) {\n // Maximize it\n window.opener.__STATES__.composerState.minimized = false;\n }\n },\n });\n }}\n >\n \n \n )\n )}\n
    \n {!!replyToStatus && (\n
    \n \n
    \n {replyToStatusMonthsAgo > 0 ? (\n \n Replying to @\n {replyToStatus.account.acct || replyToStatus.account.username}\n ’s post (\n \n {rtf.format(-replyToStatusMonthsAgo, 'month')}\n \n )\n \n ) : (\n \n Replying to @\n {replyToStatus.account.acct || replyToStatus.account.username}\n ’s post\n \n )}\n
    \n
    \n )}\n {!!editStatus && (\n
    \n \n
    \n Editing source post\n
    \n
    \n )}\n {\n if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) {\n formRef.current.dispatchEvent(\n new Event('submit', { cancelable: true }),\n );\n }\n }}\n onSubmit={(e) => {\n e.preventDefault();\n\n const formData = new FormData(e.target);\n const entries = Object.fromEntries(formData.entries());\n console.log('ENTRIES', entries);\n let { status, visibility, sensitive, spoilerText } = entries;\n\n // Pre-cleanup\n sensitive = sensitive === 'on'; // checkboxes return \"on\" if checked\n\n // Validation\n /* Let the backend validate this\n if (stringLength(status) > maxCharacters) {\n alert(`Status is too long! Max characters: ${maxCharacters}`);\n return;\n }\n if (\n sensitive &&\n stringLength(status) + stringLength(spoilerText) > maxCharacters\n ) {\n alert(\n `Status and content warning is too long! Max characters: ${maxCharacters}`,\n );\n return;\n }\n */\n if (poll) {\n if (poll.options.length < 2) {\n alert(t`Poll must have at least 2 options`);\n return;\n }\n if (poll.options.some((option) => option === '')) {\n alert(t`Some poll choices are empty`);\n return;\n }\n }\n // TODO: check for URLs and use `charactersReservedPerUrl` to calculate max characters\n\n if (mediaAttachments.length > 0) {\n // If there are media attachments, check if they have no descriptions\n const hasNoDescriptions = mediaAttachments.some(\n (media) => !media.description?.trim?.(),\n );\n if (hasNoDescriptions) {\n const yes = confirm(\n t`Some media have no descriptions. Continue?`,\n );\n if (!yes) return;\n }\n }\n\n // Post-cleanup\n spoilerText = (sensitive && spoilerText) || undefined;\n status = status === '' ? undefined : status;\n\n // states.composerState.minimized = true;\n states.composerState.publishing = true;\n setUIState('loading');\n (async () => {\n try {\n console.log('MEDIA ATTACHMENTS', mediaAttachments);\n if (mediaAttachments.length > 0) {\n // Upload media attachments first\n const mediaPromises = mediaAttachments.map((attachment) => {\n const { file, description, id } = attachment;\n console.log('UPLOADING', attachment);\n if (id) {\n // If already uploaded\n return attachment;\n } else {\n const params = removeNullUndefined({\n file,\n description,\n });\n return masto.v2.media.create(params).then((res) => {\n if (res.id) {\n attachment.id = res.id;\n }\n return res;\n });\n }\n });\n const results = await Promise.allSettled(mediaPromises);\n\n // If any failed, return\n if (\n results.some((result) => {\n return result.status === 'rejected' || !result.value?.id;\n })\n ) {\n states.composerState.publishing = false;\n states.composerState.publishingError = true;\n setUIState('error');\n // Alert all the reasons\n results.forEach((result) => {\n if (result.status === 'rejected') {\n console.error(result);\n alert(result.reason || t`Attachment #${i} failed`);\n }\n });\n return;\n }\n\n console.log({ results, mediaAttachments });\n }\n\n /* NOTE:\n Using snakecase here because masto.js's `isObject` returns false for `params`, ONLY happens when opening in pop-out window. This is maybe due to `window.masto` variable being passed from the parent window. The check that failed is `x.constructor === Object`, so maybe the `Object` in new window is different than parent window's?\n Code: https://github.com/neet/masto.js/blob/dd0d649067b6a2b6e60fbb0a96597c373a255b00/src/serializers/is-object.ts#L2\n\n // TODO: Note above is no longer true in Masto.js v6. Revisit this.\n */\n let params = {\n status,\n // spoilerText,\n spoiler_text: spoilerText,\n language,\n sensitive,\n poll,\n // mediaIds: mediaAttachments.map((attachment) => attachment.id),\n media_ids: mediaAttachments.map(\n (attachment) => attachment.id,\n ),\n };\n if (editStatus && supports('@mastodon/edit-media-attributes')) {\n params.media_attributes = mediaAttachments.map(\n (attachment) => {\n return {\n id: attachment.id,\n description: attachment.description,\n // focus\n // thumbnail\n };\n },\n );\n } else if (!editStatus) {\n params.visibility = visibility;\n // params.inReplyToId = replyToStatus?.id || undefined;\n params.in_reply_to_id = replyToStatus?.id || undefined;\n }\n params = removeNullUndefined(params);\n console.log('POST', params);\n\n let newStatus;\n if (editStatus) {\n newStatus = await masto.v1.statuses\n .$select(editStatus.id)\n .update(params);\n saveStatus(newStatus, instance, {\n skipThreading: true,\n });\n } else {\n try {\n newStatus = await masto.v1.statuses.create(params, {\n requestInit: {\n headers: {\n 'Idempotency-Key': UID.current,\n },\n },\n });\n } catch (_) {\n // If idempotency key fails, try again without it\n newStatus = await masto.v1.statuses.create(params);\n }\n }\n states.composerState.minimized = false;\n states.composerState.publishing = false;\n setUIState('default');\n\n // Close\n onClose({\n // type: post, reply, edit\n type: editStatus ? 'edit' : replyToStatus ? 'reply' : 'post',\n newStatus,\n instance,\n });\n } catch (e) {\n states.composerState.publishing = false;\n states.composerState.publishingError = true;\n console.error(e);\n alert(e?.reason || e);\n setUIState('error');\n }\n })();\n }}\n >\n
    \n {\n updateCharCount();\n }}\n />\n \n {\n const sensitive = e.target.checked;\n setSensitive(sensitive);\n if (sensitive) {\n spoilerTextRef.current?.focus();\n } else {\n textareaRef.current?.focus();\n }\n }}\n />\n \n {' '}\n \n \n {\n setVisibility(e.target.value);\n }}\n disabled={uiState === 'loading' || !!editStatus}\n dir=\"auto\"\n >\n \n {(supports('@pleroma/local-visibility-post') ||\n supports('@akkoma/local-visibility-post')) && (\n \n )}\n \n \n \n \n {' '}\n
    \n {\n updateCharCount();\n }}\n maxCharacters={maxCharacters}\n performSearch={(params) => {\n const { type, q, limit } = params;\n if (type === 'accounts') {\n return masto.v1.accounts.search.list({\n q,\n limit,\n resolve: false,\n });\n }\n return masto.v2.search.fetch(params);\n }}\n onTrigger={(action) => {\n if (action?.name === 'custom-emojis') {\n setShowEmoji2Picker({\n defaultSearchTerm: action?.defaultSearchTerm || null,\n });\n } else if (action?.name === 'mention') {\n setShowMentionPicker({\n defaultSearchTerm: action?.defaultSearchTerm || null,\n });\n } else if (\n action?.name === 'auto-detect-language' &&\n action?.languages\n ) {\n setAutoDetectedLanguages(action.languages);\n }\n }}\n />\n {mediaAttachments?.length > 0 && (\n
    \n {mediaAttachments.map((attachment, i) => {\n const { id, file } = attachment;\n const fileID = file?.size + file?.type + file?.name;\n return (\n {\n setMediaAttachments((attachments) => {\n const newAttachments = [...attachments];\n newAttachments[i] = {\n ...newAttachments[i],\n description: value,\n };\n return newAttachments;\n });\n }}\n onRemove={() => {\n setMediaAttachments((attachments) => {\n return attachments.filter((_, j) => j !== i);\n });\n }}\n />\n );\n })}\n \n
    \n )}\n {!!poll && (\n {\n if (poll) {\n const newPoll = { ...poll };\n setPoll(newPoll);\n } else {\n setPoll(null);\n }\n }}\n />\n )}\n
    \n \n {showAddButton && (\n (\n \n \n \n )}\n >\n \n \n {_(ADD_LABELS.media)}\n \n {\n setShowEmoji2Picker(true);\n }}\n >\n {' '}\n {_(ADD_LABELS.customEmoji)}\n \n {!!states.settings.composerGIFPicker && (\n {\n setShowGIFPicker(true);\n }}\n >\n \n {_(ADD_LABELS.gif)}\n \n )}\n \n {_(ADD_LABELS.poll)}\n \n \n )}\n \n \n {/* {\n setShowMentionPicker(true);\n }}\n >\n \n */}\n {\n setShowEmoji2Picker(true);\n }}\n >\n \n \n {!!states.settings.composerGIFPicker && (\n {\n setShowGIFPicker(true);\n }}\n >\n \n \n )}\n {}\n {showPollButton && (\n <>\n \n \n \n \n )}\n \n \n {/*
    */}\n {uiState === 'loading' ? (\n \n ) : (\n
    \n \n
    \n {showMentionPicker && (\n {\n if (e.target === e.currentTarget) {\n setShowMentionPicker(false);\n }\n }}\n >\n {\n setShowMentionPicker(false);\n }}\n defaultSearchTerm={showMentionPicker?.defaultSearchTerm}\n onSelect={(socialAddress) => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n const { selectionStart, selectionEnd } = textarea;\n const text = textarea.value;\n const textBeforeMention = text.slice(0, selectionStart);\n const spaceBeforeMention = textBeforeMention\n ? /[\\s\\t\\n\\r]$/.test(textBeforeMention)\n ? ''\n : ' '\n : '';\n const textAfterMention = text.slice(selectionEnd);\n const spaceAfterMention = /^[\\s\\t\\n\\r]/.test(textAfterMention)\n ? ''\n : ' ';\n const newText =\n textBeforeMention +\n spaceBeforeMention +\n '@' +\n socialAddress +\n spaceAfterMention +\n textAfterMention;\n textarea.value = newText;\n textarea.selectionStart = textarea.selectionEnd =\n selectionEnd +\n 1 +\n socialAddress.length +\n spaceAfterMention.length;\n textarea.focus();\n textarea.dispatchEvent(new Event('input'));\n }}\n />\n \n )}\n {showEmoji2Picker && (\n {\n if (e.target === e.currentTarget) {\n setShowEmoji2Picker(false);\n }\n }}\n >\n {\n setShowEmoji2Picker(false);\n }}\n defaultSearchTerm={showEmoji2Picker?.defaultSearchTerm}\n onSelect={(emojiShortcode) => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n const { selectionStart, selectionEnd } = textarea;\n const text = textarea.value;\n const textBeforeEmoji = text.slice(0, selectionStart);\n const spaceBeforeEmoji = textBeforeEmoji\n ? /[\\s\\t\\n\\r]$/.test(textBeforeEmoji)\n ? ''\n : ' '\n : '';\n const textAfterEmoji = text.slice(selectionEnd);\n const spaceAfterEmoji = /^[\\s\\t\\n\\r]/.test(textAfterEmoji)\n ? ''\n : ' ';\n const newText =\n textBeforeEmoji +\n spaceBeforeEmoji +\n emojiShortcode +\n spaceAfterEmoji +\n textAfterEmoji;\n textarea.value = newText;\n textarea.selectionStart = textarea.selectionEnd =\n selectionEnd + emojiShortcode.length + spaceAfterEmoji.length;\n textarea.focus();\n textarea.dispatchEvent(new Event('input'));\n }}\n />\n \n )}\n {showGIFPicker && (\n {\n if (e.target === e.currentTarget) {\n setShowGIFPicker(false);\n }\n }}\n >\n setShowGIFPicker(false)}\n onSelect={({ url, type, alt_text }) => {\n console.log('GIF URL', url);\n if (mediaAttachments.length >= maxMediaAttachments) {\n alert(\n plural(maxMediaAttachments, {\n one: 'You can only attach up to 1 file.',\n other: 'You can only attach up to # files.',\n }),\n );\n return;\n }\n // Download the GIF and insert it as media attachment\n (async () => {\n let theToast;\n try {\n theToast = showToast({\n text: t`Downloading GIF…`,\n duration: -1,\n });\n const blob = await fetch(url, {\n referrerPolicy: 'no-referrer',\n }).then((res) => res.blob());\n const file = new File(\n [blob],\n type === 'video/mp4' ? 'video.mp4' : 'image.gif',\n {\n type,\n },\n );\n const newMediaAttachments = [\n ...mediaAttachments,\n {\n file,\n type,\n size: file.size,\n id: null,\n description: alt_text || '',\n },\n ];\n setMediaAttachments(newMediaAttachments);\n theToast?.hideToast?.();\n } catch (err) {\n console.error(err);\n theToast?.hideToast?.();\n showToast(t`Failed to download GIF`);\n }\n })();\n }}\n />\n \n )}\n
    \n );\n}\n\nfunction FilePickerInput({\n hidden,\n supportedMimeTypes,\n maxMediaAttachments,\n mediaAttachments,\n disabled = false,\n setMediaAttachments,\n}) {\n return (\n
    \n {showModal && (\n {\n setShowModal(false);\n }}\n >\n
    \n {\n setShowModal(false);\n }}\n >\n \n \n
    \n

    \n {\n {\n image: t`Edit image description`,\n video: t`Edit video description`,\n audio: t`Edit audio description`,\n }[suffixType]\n }\n

    \n
    \n
    \n
    \n {suffixType === 'image' ? (\n \"\"\n ) : suffixType === 'video' || suffixType === 'gifv' ? (\n
    \n
    \n {descTextarea}\n
    \n {suffixType === 'image' &&\n /^(png|jpe?g|gif|webp)$/i.test(subtype) &&\n !!states.settings.mediaAltGenerator &&\n !!IMG_ALT_API_URL && (\n \n \n \n }\n >\n {\n setUIState('loading');\n toastRef.current = showToast({\n text: t`Generating description. Please wait…`,\n duration: -1,\n });\n // POST with multipart\n (async function () {\n try {\n const body = new FormData();\n body.append('image', file);\n const response = await fetch(IMG_ALT_API_URL, {\n method: 'POST',\n body,\n }).then((r) => r.json());\n if (response.error) {\n throw new Error(response.error);\n }\n setDescription(response.description);\n } catch (e) {\n console.error(e);\n showToast(\n e.message\n ? t`Failed to generate description: ${e.message}`\n : t`Failed to generate description`,\n );\n } finally {\n setUIState('default');\n toastRef.current?.hideToast?.();\n }\n })();\n }}\n >\n \n {lang && lang !== 'en' ? (\n \n Generate description…\n
    \n (English)\n
    \n ) : (\n \n Generate description…\n \n )}\n \n {!!lang && lang !== 'en' && (\n {\n setUIState('loading');\n toastRef.current = showToast({\n text: t`Generating description. Please wait…`,\n duration: -1,\n });\n // POST with multipart\n (async function () {\n try {\n const body = new FormData();\n body.append('image', file);\n const params = `?lang=${lang}`;\n const response = await fetch(\n IMG_ALT_API_URL + params,\n {\n method: 'POST',\n body,\n },\n ).then((r) => r.json());\n if (response.error) {\n throw new Error(response.error);\n }\n setDescription(response.description);\n } catch (e) {\n console.error(e);\n showToast(\n t`Failed to generate description${\n e?.message ? `: ${e.message}` : ''\n }`,\n );\n } finally {\n setUIState('default');\n toastRef.current?.hideToast?.();\n }\n })();\n }}\n >\n \n \n Generate description…\n
    \n \n ({localeCode2Text(lang)}){' '}\n \n — experimental\n \n \n
    \n \n )}\n \n )}\n {\n setShowModal(false);\n }}\n disabled={uiState === 'loading'}\n >\n Done\n \n
    \n
    \n
    \n
    \n \n )}\n \n );\n}\n\nfunction Poll({\n lang,\n poll,\n disabled,\n onInput = () => {},\n maxOptions,\n maxExpiration,\n minExpiration,\n maxCharactersPerOption,\n}) {\n const { t } = useLingui();\n const { options, expiresIn, multiple } = poll;\n\n return (\n
    \n
    \n {options.map((option, i) => (\n
    \n {\n const { value } = e.target;\n options[i] = value;\n onInput(poll);\n }}\n />\n {\n options.splice(i, 1);\n onInput(poll);\n }}\n >\n \n \n
    \n ))}\n
    \n
    \n = maxOptions}\n onClick={() => {\n options.push('');\n onInput(poll);\n }}\n >\n +\n {' '}\n \n \n
    \n
    \n {\n onInput(null);\n }}\n >\n Remove poll\n \n
    \n
    \n );\n}\n\nfunction filterShortcodes(emojis, searchTerm) {\n searchTerm = searchTerm.toLowerCase();\n\n // Return an array of shortcodes that start with or contain the search term, sorted by relevance and limited to the first 5\n return emojis\n .sort((a, b) => {\n let aLower = a.shortcode.toLowerCase();\n let bLower = b.shortcode.toLowerCase();\n\n let aStartsWith = aLower.startsWith(searchTerm);\n let bStartsWith = bLower.startsWith(searchTerm);\n let aContains = aLower.includes(searchTerm);\n let bContains = bLower.includes(searchTerm);\n let bothStartWith = aStartsWith && bStartsWith;\n let bothContain = aContains && bContains;\n\n return bothStartWith\n ? a.length - b.length\n : aStartsWith\n ? -1\n : bStartsWith\n ? 1\n : bothContain\n ? a.length - b.length\n : aContains\n ? -1\n : bContains\n ? 1\n : 0;\n })\n .slice(0, 5);\n}\n\nfunction encodeHTML(str) {\n return str.replace(/[&<>\"']/g, function (char) {\n return '&#' + char.charCodeAt(0) + ';';\n });\n}\n\nfunction removeNullUndefined(obj) {\n for (let key in obj) {\n if (obj[key] === null || obj[key] === undefined) {\n delete obj[key];\n }\n }\n return obj;\n}\n\nfunction MentionModal({\n onClose = () => {},\n onSelect = () => {},\n defaultSearchTerm,\n}) {\n const { t } = useLingui();\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [accounts, setAccounts] = useState([]);\n const [relationshipsMap, setRelationshipsMap] = useState({});\n\n const [selectedIndex, setSelectedIndex] = useState(0);\n\n const loadRelationships = async (accounts) => {\n if (!accounts?.length) return;\n const relationships = await fetchRelationships(accounts, relationshipsMap);\n if (relationships) {\n setRelationshipsMap({\n ...relationshipsMap,\n ...relationships,\n });\n }\n };\n\n const loadAccounts = (term) => {\n if (!term) return;\n setUIState('loading');\n (async () => {\n try {\n const accounts = await masto.v1.accounts.search.list({\n q: term,\n limit: 40,\n resolve: false,\n });\n setAccounts(accounts);\n loadRelationships(accounts);\n setUIState('default');\n } catch (e) {\n setUIState('error');\n console.error(e);\n }\n })();\n };\n\n const debouncedLoadAccounts = useDebouncedCallback(loadAccounts, 1000);\n\n useEffect(() => {\n loadAccounts();\n }, [loadAccounts]);\n\n const inputRef = useRef();\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n // Put cursor at the end\n if (inputRef.current.value) {\n inputRef.current.selectionStart = inputRef.current.value.length;\n inputRef.current.selectionEnd = inputRef.current.value.length;\n }\n }\n }, []);\n\n useEffect(() => {\n if (defaultSearchTerm) {\n loadAccounts(defaultSearchTerm);\n }\n }, [defaultSearchTerm]);\n\n const selectAccount = (account) => {\n const socialAddress = account.acct;\n onSelect(socialAddress);\n onClose();\n };\n\n useHotkeys(\n 'enter',\n () => {\n const selectedAccount = accounts[selectedIndex];\n if (selectedAccount) {\n selectAccount(selectedAccount);\n }\n },\n {\n preventDefault: true,\n enableOnFormTags: ['input'],\n },\n );\n\n const listRef = useRef();\n useHotkeys(\n 'down',\n () => {\n if (selectedIndex < accounts.length - 1) {\n setSelectedIndex(selectedIndex + 1);\n } else {\n setSelectedIndex(0);\n }\n setTimeout(() => {\n const selectedItem = listRef.current.querySelector('.selected');\n if (selectedItem) {\n selectedItem.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n }\n }, 1);\n },\n {\n preventDefault: true,\n enableOnFormTags: ['input'],\n },\n );\n\n useHotkeys(\n 'up',\n () => {\n if (selectedIndex > 0) {\n setSelectedIndex(selectedIndex - 1);\n } else {\n setSelectedIndex(accounts.length - 1);\n }\n setTimeout(() => {\n const selectedItem = listRef.current.querySelector('.selected');\n if (selectedItem) {\n selectedItem.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n }\n }, 1);\n },\n {\n preventDefault: true,\n enableOnFormTags: ['input'],\n },\n );\n\n return (\n
    \n {!!onClose && (\n \n )}\n
    \n {\n e.preventDefault();\n debouncedLoadAccounts.flush?.();\n // const searchTerm = inputRef.current.value;\n // debouncedLoadAccounts(searchTerm);\n }}\n >\n {\n const { value } = e.target;\n debouncedLoadAccounts(value);\n }}\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellCheck=\"false\"\n dir=\"auto\"\n defaultValue={defaultSearchTerm || ''}\n />\n \n
    \n
    \n {accounts?.length > 0 ? (\n \n {accounts.map((account, i) => {\n const relationship = relationshipsMap[account.id];\n return (\n \n \n {\n selectAccount(account);\n }}\n >\n \n \n \n );\n })}\n \n ) : uiState === 'loading' ? (\n
    \n \n
    \n ) : uiState === 'error' ? (\n
    \n

    \n Error loading accounts\n

    \n
    \n ) : null}\n
    \n
    \n );\n}\n\nfunction CustomEmojisModal({\n masto,\n instance,\n onClose = () => {},\n onSelect = () => {},\n defaultSearchTerm,\n}) {\n const { t } = useLingui();\n const [uiState, setUIState] = useState('default');\n const customEmojisList = useRef([]);\n const [customEmojis, setCustomEmojis] = useState([]);\n const recentlyUsedCustomEmojis = useMemo(\n () => store.account.get('recentlyUsedCustomEmojis') || [],\n );\n const searcherRef = useRef();\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const [emojis, searcher] = await getCustomEmojis(instance, masto);\n console.log('emojis', emojis);\n searcherRef.current = searcher;\n setCustomEmojis(emojis);\n setUIState('default');\n } catch (e) {\n setUIState('error');\n console.error(e);\n }\n })();\n }, []);\n\n const customEmojisCatList = useMemo(() => {\n // Group emojis by category\n const emojisCat = {\n '--recent--': recentlyUsedCustomEmojis.filter((emoji) =>\n customEmojis.find((e) => e.shortcode === emoji.shortcode),\n ),\n };\n const othersCat = [];\n customEmojis.forEach((emoji) => {\n customEmojisList.current?.push?.(emoji);\n if (!emoji.category) {\n othersCat.push(emoji);\n return;\n }\n if (!emojisCat[emoji.category]) {\n emojisCat[emoji.category] = [];\n }\n emojisCat[emoji.category].push(emoji);\n });\n if (othersCat.length) {\n emojisCat['--others--'] = othersCat;\n }\n return emojisCat;\n }, [customEmojis]);\n\n const scrollableRef = useRef();\n const [matches, setMatches] = useState(null);\n const onFind = useCallback(\n (e) => {\n const { value } = e.target;\n if (value) {\n const results = searcherRef.current?.search(value, {\n limit: CUSTOM_EMOJIS_COUNT,\n });\n setMatches(results.map((r) => r.item));\n scrollableRef.current?.scrollTo?.(0, 0);\n } else {\n setMatches(null);\n }\n },\n [customEmojis],\n );\n useEffect(() => {\n if (defaultSearchTerm && customEmojis?.length) {\n onFind({ target: { value: defaultSearchTerm } });\n }\n }, [defaultSearchTerm, onFind, customEmojis]);\n\n const onSelectEmoji = useCallback(\n (emoji) => {\n onSelect?.(emoji);\n onClose?.();\n\n queueMicrotask(() => {\n let recentlyUsedCustomEmojis =\n store.account.get('recentlyUsedCustomEmojis') || [];\n const recentlyUsedEmojiIndex = recentlyUsedCustomEmojis.findIndex(\n (e) => e.shortcode === emoji.shortcode,\n );\n if (recentlyUsedEmojiIndex !== -1) {\n // Move emoji to index 0\n recentlyUsedCustomEmojis.splice(recentlyUsedEmojiIndex, 1);\n recentlyUsedCustomEmojis.unshift(emoji);\n } else {\n recentlyUsedCustomEmojis.unshift(emoji);\n // Remove unavailable ones\n recentlyUsedCustomEmojis = recentlyUsedCustomEmojis.filter((e) =>\n customEmojisList.current?.find?.(\n (emoji) => emoji.shortcode === e.shortcode,\n ),\n );\n // Limit to 10\n recentlyUsedCustomEmojis = recentlyUsedCustomEmojis.slice(0, 10);\n }\n\n // Store back\n store.account.set('recentlyUsedCustomEmojis', recentlyUsedCustomEmojis);\n });\n },\n [onSelect],\n );\n\n const inputRef = useRef();\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n // Put cursor at the end\n if (inputRef.current.value) {\n inputRef.current.selectionStart = inputRef.current.value.length;\n inputRef.current.selectionEnd = inputRef.current.value.length;\n }\n }\n }, []);\n\n return (\n
    \n {!!onClose && (\n \n )}\n
    \n
    \n \n Custom emojis\n {' '}\n {uiState === 'loading' ? (\n \n ) : (\n • {instance}\n )}\n
    \n {\n e.preventDefault();\n const emoji = matches[0];\n if (emoji) {\n onSelectEmoji(`:${emoji.shortcode}:`);\n }\n }}\n >\n \n \n
    \n
    \n {matches !== null ? (\n
      \n {matches.map((emoji) => (\n
    • \n {\n onSelectEmoji(`:${emoji.shortcode}:`);\n }}\n showCode\n />\n
    • \n ))}\n
    \n ) : (\n
    \n {uiState === 'error' && (\n
    \n

    \n Error loading custom emojis\n

    \n
    \n )}\n {uiState === 'default' &&\n Object.entries(customEmojisCatList).map(\n ([category, emojis]) =>\n !!emojis?.length && (\n
    \n
    \n {{\n '--recent--': t`Recently used`,\n '--others--': t`Others`,\n }[category] || category}\n
    \n \n
    \n ),\n )}\n
    \n )}\n
    \n
    \n );\n}\n\nconst CustomEmojisList = memo(({ emojis, onSelect }) => {\n const { i18n } = useLingui();\n const [max, setMax] = useState(CUSTOM_EMOJIS_COUNT);\n const showMore = emojis.length > max;\n return (\n
    \n {emojis.slice(0, max).map((emoji) => (\n {\n onSelect(`:${emoji.shortcode}:`);\n }}\n />\n ))}\n {showMore && (\n setMax(max + CUSTOM_EMOJIS_COUNT)}\n >\n {i18n.number(emojis.length - max)} more…\n \n )}\n
    \n );\n});\n\nconst CustomEmojiButton = memo(({ emoji, onClick, showCode }) => {\n const addEdges = (e) => {\n // Add edge-left or edge-right class based on self position relative to scrollable parent\n // If near left edge, add edge-left, if near right edge, add edge-right\n const buffer = 88;\n const parent = e.currentTarget.closest('main');\n if (parent) {\n const rect = parent.getBoundingClientRect();\n const selfRect = e.currentTarget.getBoundingClientRect();\n const targetClassList = e.currentTarget.classList;\n if (selfRect.left < rect.left + buffer) {\n targetClassList.add('edge-left');\n targetClassList.remove('edge-right');\n } else if (selfRect.right > rect.right - buffer) {\n targetClassList.add('edge-right');\n targetClassList.remove('edge-left');\n } else {\n targetClassList.remove('edge-left', 'edge-right');\n }\n }\n };\n\n return (\n \n \n {!!emoji.staticUrl && (\n \n )}\n \n \n {showCode && (\n <>\n {' '}\n {emoji.shortcode}\n \n )}\n \n );\n});\n\nconst GIFS_PER_PAGE = 20;\nfunction GIFPickerModal({ onClose = () => {}, onSelect = () => {} }) {\n const { i18n, t } = useLingui();\n const [uiState, setUIState] = useState('default');\n const [results, setResults] = useState([]);\n const formRef = useRef(null);\n const qRef = useRef(null);\n const currentOffset = useRef(0);\n const scrollableRef = useRef(null);\n\n function fetchGIFs({ offset }) {\n console.log('fetchGIFs', { offset });\n if (!qRef.current?.value) return;\n setUIState('loading');\n scrollableRef.current?.scrollTo?.({\n top: 0,\n left: 0,\n behavior: 'smooth',\n });\n (async () => {\n try {\n const query = {\n api_key: GIPHY_API_KEY,\n q: qRef.current.value,\n rating: 'g',\n limit: GIFS_PER_PAGE,\n bundle: 'messaging_non_clips',\n offset,\n lang: i18n.locale || 'en',\n };\n const response = await fetch(\n 'https://api.giphy.com/v1/gifs/search?' + new URLSearchParams(query),\n {\n referrerPolicy: 'no-referrer',\n },\n ).then((r) => r.json());\n currentOffset.current = response.pagination?.offset || 0;\n setResults(response);\n setUIState('results');\n } catch (e) {\n setUIState('error');\n console.error(e);\n }\n })();\n }\n\n useEffect(() => {\n qRef.current?.focus();\n }, []);\n\n const debouncedOnInput = useDebouncedCallback(() => {\n fetchGIFs({ offset: 0 });\n }, 1000);\n\n return (\n
    \n {!!onClose && (\n \n )}\n
    \n {\n e.preventDefault();\n fetchGIFs({ offset: 0 });\n }}\n >\n \n \n \n
    \n
    \n {uiState === 'default' && (\n
    \n

    \n Type to search GIFs\n

    \n
    \n )}\n {uiState === 'loading' && !results?.data?.length && (\n
    \n \n
    \n )}\n {results?.data?.length > 0 ? (\n <>\n
      \n {results.data.map((gif) => {\n const { id, images, title, alt_text } = gif;\n const {\n fixed_height_small,\n fixed_height_downsampled,\n fixed_height,\n original,\n } = images;\n const theImage = fixed_height_small?.url\n ? fixed_height_small\n : fixed_height_downsampled?.url\n ? fixed_height_downsampled\n : fixed_height;\n let { url, webp, width, height } = theImage;\n if (+height > 100) {\n width = (width / height) * 100;\n height = 100;\n }\n const urlObj = URL.parse(url);\n const strippedURL = urlObj.origin + urlObj.pathname;\n let strippedWebP;\n if (webp) {\n const webpObj = URL.parse(webp);\n strippedWebP = webpObj.origin + webpObj.pathname;\n }\n return (\n
    • \n {\n const { mp4, url } = original;\n const theURL = mp4 || url;\n const urlObj = URL.parse(theURL);\n const strippedURL = urlObj.origin + urlObj.pathname;\n onClose();\n onSelect({\n url: strippedURL,\n type: mp4 ? 'video/mp4' : 'image/gif',\n alt_text: alt_text || title,\n });\n }}\n >\n \n \n {strippedWebP && (\n \n )}\n {\n e.target.style.backgroundColor = 'transparent';\n }}\n />\n \n
      {alt_text || title}
      \n \n \n
    • \n );\n })}\n
    \n

    \n {results.pagination?.offset > 0 && (\n {\n fetchGIFs({\n offset: results.pagination?.offset - GIFS_PER_PAGE,\n });\n }}\n >\n \n \n Previous\n \n \n )}\n \n {results.pagination?.offset + results.pagination?.count <\n results.pagination?.total_count && (\n {\n fetchGIFs({\n offset: results.pagination?.offset + GIFS_PER_PAGE,\n });\n }}\n >\n \n Next\n {' '}\n \n \n )}\n

    \n \n ) : (\n uiState === 'results' && (\n
    \n

    No results

    \n
    \n )\n )}\n {uiState === 'error' && (\n
    \n

    \n Error loading GIFs\n

    \n
    \n )}\n
    \n
    \n );\n}\n\nexport default Compose;\n"],"file":"assets/compose-8rrDtgaW.js"} \ No newline at end of file diff --git a/assets/compose-Ig15wqnf.css b/assets/compose-Ig15wqnf.css new file mode 100644 index 0000000..7b657c4 --- /dev/null +++ b/assets/compose-Ig15wqnf.css @@ -0,0 +1 @@ +#compose-container-outer{width:100%;height:100vh;height:100dvh;overflow:auto;align-self:flex-start;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}#compose-container{margin:auto;width:var(--main-width);max-width:100vw;align-self:stretch;-webkit-animation:fade-in .2s ease-out;animation:fade-in .2s ease-out}#compose-container .compose-top{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;gap:8px;-webkit-box-align:center;align-items:center;padding:8px;position:sticky;top:0;z-index:100;white-space:nowrap}@media (min-width: 480px){#compose-container .compose-top{padding:16px}}#compose-container .compose-top .account-block{text-align:start;pointer-events:none;overflow:hidden;color:var(--text-insignificant-color);line-height:1.1;font-size:90%;background-color:var(--bg-faded-blur-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);-webkit-padding-end:1em;padding-inline-end:1em;border-radius:9999px}@-webkit-keyframes appear-up{0%{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes appear-up{0%{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}#compose-container .status-preview{border-radius:16px 16px 0 0;max-height:160px;background-color:var(--bg-color);margin:0 12px;border:1px solid var(--outline-color);border-bottom:0;-webkit-animation:appear-up 1s ease-in-out;animation:appear-up 1s ease-in-out;overflow:auto;box-shadow:0 -3px 12px -3px var(--drop-shadow-color)}#compose-container .status-preview:has(.status-badge:not(:empty)){border-start-end-radius:8px}#compose-container .status-preview .content-container,#compose-container .status-preview .time,#compose-container.standalone .status-preview *{pointer-events:none}#compose-container .status-preview-legend{pointer-events:none;position:sticky;bottom:0;padding:8px;font-size:80%;font-weight:700;text-align:center;color:var(--text-insignificant-color);background-color:var(--bg-blur-color);border-top:var(--hairline-width) solid var(--outline-color);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);text-shadow:0 1px 10px var(--bg-color),0 1px 10px var(--bg-color),0 1px 10px var(--bg-color),0 1px 10px var(--bg-color),0 1px 10px var(--bg-color);z-index:2}#compose-container .status-preview-legend strong{color:var(--red-color)}#_compose-container .status-preview-legend.reply-to{color:var(--reply-to-color);background-color:var(--reply-to-faded-color)}#compose-container form{--form-spacing-inline: 4px;--form-spacing-block: 0;padding:0 4px;padding:var(--form-spacing-block) var(--form-spacing-inline);background-color:var(--bg-blur-color);position:relative;z-index:2;--drop-shadow: 0 3px 6px -3px var(--drop-shadow-color);box-shadow:var(--drop-shadow)}@media (min-width: 480px){#compose-container form{--form-spacing-inline: 8px}}@media (min-width: 40em){#compose-container form{border-radius:16px}}#compose-container .status-preview~form{box-shadow:var(--drop-shadow),0 -3px 6px -3px var(--drop-shadow-color)}#compose-container textarea{width:100%;max-width:100%;height:5em;min-height:5em;max-height:50vh;resize:vertical;line-height:1.4;border-color:transparent}@media (min-width: 40em){#compose-container textarea.compose-field{max-height:65vh}}#compose-container textarea:hover{border-color:var(--divider-color)}#compose-container .toolbar{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center;padding:var(--form-spacing-inline) 0;gap:var(--form-spacing-inline)}#compose-container .toolbar.wrap{flex-wrap:wrap}#compose-container .toolbar.stretch{-webkit-box-pack:stretch;justify-content:stretch}#compose-container .toolbar .spoiler-text-field{-webkit-box-flex:1;flex:1;min-width:0}#compose-container .toolbar-button{display:inline-block;color:var(--link-color);background-color:transparent;padding:0 8px;border-radius:8px;min-height:2.4em;line-height:2.4em;min-width:2.6em;text-align:center;overflow:hidden;position:relative;white-space:nowrap;border:2px solid transparent;vertical-align:middle}#compose-container .toolbar-button.active{-webkit-filter:brightness(.8);filter:brightness(.8);background-color:var(--bg-color)}#compose-container .toolbar-button>*{vertical-align:middle;cursor:inherit;outline:0}#compose-container .toolbar-button:has([disabled]),#compose-container .toolbar-button[disabled]{pointer-events:none;background-color:transparent;opacity:.5}#compose-container .toolbar-button:not(.show-field) input[type=checkbox],#compose-container .toolbar-button:not(.show-field) select:not(.does-not-exist),#compose-container .toolbar-button:not(.show-field) input[type=file]{opacity:0;position:absolute;left:0;height:100%;margin:0}#compose-container .toolbar-button input[type=file]{left:-100vw!important}#compose-container .toolbar-button select{background-color:inherit;border:0;padding:0 0 0 8px;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;line-height:1em}#compose-container .toolbar-button:not(.show-field) select{inset-inline-end:0;inset-inline-start:auto!important}#compose-container .toolbar-button:not(:disabled):hover{cursor:pointer;-webkit-filter:none;filter:none;background-color:var(--bg-color);border-color:var(--link-faded-color);outline:0}#compose-container .toolbar-button:not(:disabled):focus{cursor:pointer;-webkit-filter:none;filter:none;background-color:var(--bg-color);border-color:var(--link-faded-color);outline:0}#compose-container .toolbar-button:not(:disabled):focus-within{cursor:pointer;-webkit-filter:none;filter:none;background-color:var(--bg-color);border-color:var(--link-faded-color);outline:0}#compose-container .toolbar-button:not(:disabled):focus-visible{cursor:pointer;-webkit-filter:none;filter:none;background-color:var(--bg-color);border-color:var(--link-faded-color);outline:0}#compose-container .toolbar-button:not(:disabled).highlight{border-color:var(--link-color);box-shadow:inset 0 0 8px var(--link-faded-color)}#compose-container .toolbar-button:not(:disabled):active{-webkit-filter:brightness(.8);filter:brightness(.8)}#compose-container .toolbar-button .icon-text{display:inline-block;font-size:14px;font-weight:500;text-overflow:ellipsis;overflow:hidden;max-width:100%;min-width:4ch}#compose-container .compose-footer .add-toolbar-button-group{display:-webkit-box;display:flex;overflow:auto}#compose-container .compose-footer .add-sub-toolbar-button-group{-webkit-box-flex:1;flex-grow:1;display:-webkit-box;display:flex;overflow:auto;-webkit-transition:.5s ease-in-out;transition:.5s ease-in-out;-webkit-transition-property:opacity,width;transition-property:opacity,width;scrollbar-width:none;-webkit-padding-end:16px;padding-inline-end:16px;-webkit-mask-image:-webkit-linear-gradient(var(--to-backward),transparent 0,black 16px,black 100%);mask-image:linear-gradient(var(--to-backward),transparent 0,black 16px,black 100%)}#compose-container .compose-footer .add-sub-toolbar-button-group::-webkit-scrollbar{display:none}#compose-container .compose-footer .add-sub-toolbar-button-group[hidden]{opacity:0;pointer-events:none;width:0}#compose-container text-expander{position:relative;display:block}#compose-container .text-expander-menu{color:var(--text-color);background-color:var(--bg-color);position:absolute;margin-top:2em;padding:0;list-style:none;border:1px solid var(--outline-color);box-shadow:0 4px 24px var(--drop-shadow-color);border-radius:8px;overflow:hidden;z-index:100;min-width:10em;max-width:90vw}#compose-container .text-expander-menu li{white-space:nowrap;padding:8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;display:flex;gap:8px;-webkit-box-align:center;align-items:center;font-size:90%}#compose-container .text-expander-menu li .grow{-webkit-box-flex:1;flex-grow:1}#compose-container .text-expander-menu li .count{font-size:80%;opacity:.5}#compose-container .text-expander-menu li b img{width:.9em;height:.9em}#compose-container .text-expander-menu li .avatar{width:2.2em;height:2.2em}#compose-container .text-expander-menu li:hover,#compose-container .text-expander-menu li:focus,#compose-container .text-expander-menu li[aria-selected]{background-color:var(--link-bg-color);color:var(--text-color)}#compose-container .text-expander-menu li[aria-selected]{box-shadow:inset 4px 0 0 0 var(--button-bg-color)}[dir=rtl] :is(#compose-container .text-expander-menu li[aria-selected]){box-shadow:inset -4px 0 0 0 var(--button-bg-color)}#compose-container .text-expander-menu li[data-more]:not(:hover):not(:focus):not([aria-selected]){color:var(--text-insignificant-color);background-color:var(--bg-faded-color)}#compose-container .text-expander-menu li[data-more]{font-size:.8em;-webkit-box-pack:center;justify-content:center}#compose-container .form-visibility-direct{--yellow-stripes: repeating-linear-gradient( 135deg, var(--reply-to-faded-color), var(--reply-to-faded-color) 10px, var(--reply-to-faded-color) 10px, transparent 10px, transparent 20px );background-image:var(--yellow-stripes)}#compose-container .media-attachments{background-color:var(--bg-faded-color);padding:8px;border-radius:8px;margin:8px 0 0;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;gap:8px}#compose-container .media-attachment{display:-webkit-box;display:flex;gap:8px;-webkit-box-align:stretch;align-items:stretch}#compose-container .media-attachment .media-error{padding:2px;color:var(--orange-fg-color);background-color:transparent;border:1.5px dashed transparent;line-height:1;border-radius:4px;display:-webkit-box;display:flex}#compose-container .media-attachment .media-error:hover,#compose-container .media-attachment .media-error:focus{background-color:var(--bg-color);border-color:var(--orange-fg-color)}#compose-container .media-preview{flex-shrink:0;border:1px solid var(--outline-color);border-radius:4px;overflow:hidden;width:80px;height:80px;background-image:-webkit-linear-gradient(45deg,var(--img-bg-color) 25%,transparent 25%),-webkit-linear-gradient(135deg,var(--img-bg-color) 25%,transparent 25%),-webkit-linear-gradient(45deg,transparent 75%,var(--img-bg-color) 75%),-webkit-linear-gradient(135deg,transparent 75%,var(--img-bg-color) 75%);background-image:linear-gradient(45deg,var(--img-bg-color) 25%,transparent 25%),linear-gradient(-45deg,var(--img-bg-color) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--img-bg-color) 75%),linear-gradient(-45deg,transparent 75%,var(--img-bg-color) 75%);background-size:10px 10px;background-position:0 0,0 5px,5px -5px,-5px 0px}#compose-container .media-preview>*{width:80px;height:80px;-o-object-fit:scale-down;object-fit:scale-down;vertical-align:middle;pointer-events:none}#compose-container .media-preview:hover{box-shadow:0 0 0 2px var(--link-light-color);cursor:pointer}#compose-container .media-attachment textarea{height:80px;-webkit-box-flex:1;flex-grow:1;resize:none}#compose-container .media-attachments .media-desc{-webkit-box-flex:1;flex-grow:1}#compose-container .media-attachments .media-desc p{font-size:90%;margin:0;padding:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}#compose-container .media-attachments .media-desc p i{color:var(--text-insignificant-color)}#compose-container .media-aside{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center}#compose-container .media-aside .close-button{padding:4px;align-self:flex-start;color:var(--text-insignificant-color)}#compose-container .media-aside .close-button:hover,#compose-container .media-aside .close-button:focus{color:var(--text-color)}#compose-container .media-aside .uploaded{color:var(--green-color);margin-bottom:4px}#compose-container .media-sensitive{padding:8px;background-color:var(--bg-blur-color);border-radius:8px;cursor:pointer}#compose-container .media-sensitive>*{vertical-align:middle}#compose-container form .poll{background-color:var(--bg-faded-color);border-radius:8px;margin:8px 0 0;display:block}#compose-container .poll-choices{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;gap:8px;padding:8px}#compose-container .poll-choice{display:-webkit-box;display:flex;gap:8px;-webkit-box-align:center;align-items:center;-webkit-box-pack:stretch;justify-content:stretch;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;flex-direction:row-reverse}#compose-container .poll-choice input{-webkit-box-flex:1;flex-grow:1;min-width:0}#compose-container .poll-button{border:2px solid var(--outline-color);width:28px;height:28px;padding:0;flex-shrink:0;line-height:0;overflow:hidden;-webkit-transition:border-radius 1s ease-out;transition:border-radius 1s ease-out;font-size:14px}#compose-container .multiple .poll-button{border-radius:4px}#compose-container .poll-toolbar{display:-webkit-box;display:flex;gap:8px;-webkit-box-align:stretch;align-items:stretch;-webkit-box-pack:justify;justify-content:space-between;font-size:90%;border-top:1px solid var(--outline-color);padding:8px}#compose-container .poll-toolbar select{padding:4px}#compose-container .multiple-choices{-webkit-box-flex:1;flex-grow:1;display:-webkit-box;display:flex;gap:4px;-webkit-box-align:center;align-items:center;-webkit-border-start:1px solid var(--outline-color);border-inline-start:1px solid var(--outline-color);-webkit-padding-start:8px;padding-inline-start:8px}#compose-container .expires-in{-webkit-box-flex:1;flex-grow:1;-webkit-border-start:1px solid var(--outline-color);border-inline-start:1px solid var(--outline-color);-webkit-padding-start:8px;padding-inline-start:8px;display:-webkit-box;display:flex;gap:4px;flex-wrap:wrap;-webkit-box-align:center;align-items:center;-webkit-box-pack:end;justify-content:flex-end}#compose-container .remove-poll-button{width:100%;color:var(--red-color)}.compose-menu-add-media{position:relative}.compose-menu-add-media .compose-menu-add-media-field{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;cursor:inherit}.icon-gif{display:inline-block!important;min-width:16px;height:16px;font-size:10px!important;letter-spacing:-.5px;font-size-adjust:none;overflow:hidden;white-space:nowrap;text-align:center;line-height:16px;font-weight:700;text-rendering:optimizeSpeed}.icon-gif:after{display:block;content:"GIF"}@media (display-mode: standalone){#compose-container .pop-button{display:none}}#compose-container button[type=submit]{border-radius:8px}@media (min-width: 480px){#compose-container button[type=submit]{padding-inline:24px;font-size:125%}}@-webkit-keyframes breathe{0%{opacity:1}40%{opacity:.4}to{opacity:1}}@keyframes breathe{0%{opacity:1}40%{opacity:.4}to{opacity:1}}#media-sheet .media-form{-webkit-box-flex:1;flex:1;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;gap:8px;min-height:50vh}#media-sheet .media-form textarea{-webkit-box-flex:1;flex-grow:1;resize:none;width:100%}#media-sheet .media-form textarea.loading{-webkit-animation:skeleton-breathe 1.5s linear infinite;animation:skeleton-breathe 1.5s linear infinite}#media-sheet .media-form footer{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center}#media-sheet main{padding-top:8px;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-flex:1;flex:1;gap:8px}#media-sheet .media-preview{border:2px solid var(--outline-color);border-radius:8px;overflow:hidden;box-shadow:0 2px 16px var(--img-bg-color);background-image:-webkit-linear-gradient(45deg,var(--img-bg-color) 25%,transparent 25%),-webkit-linear-gradient(135deg,var(--img-bg-color) 25%,transparent 25%),-webkit-linear-gradient(45deg,transparent 75%,var(--img-bg-color) 75%),-webkit-linear-gradient(135deg,transparent 75%,var(--img-bg-color) 75%);background-image:linear-gradient(45deg,var(--img-bg-color) 25%,transparent 25%),linear-gradient(-45deg,var(--img-bg-color) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--img-bg-color) 75%),linear-gradient(-45deg,transparent 75%,var(--img-bg-color) 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0px;-webkit-box-flex:.8;flex:.8}#media-sheet .media-preview>*{width:100%;height:100%;max-height:50vh;-o-object-fit:scale-down;object-fit:scale-down;vertical-align:middle}@media (min-width: 50em){#media-sheet main{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}#media-sheet .media-preview{-webkit-box-flex:2;flex:2}#media-sheet .media-preview>*{max-height:none}}#mention-sheet{height:50vh}#mention-sheet .accounts-list{--list-gap: 1px;list-style:none;margin:0;padding:8px 0;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;row-gap:1px;row-gap:var(--list-gap)}#mention-sheet .accounts-list.loading{opacity:.5}#mention-sheet .accounts-list li{display:-webkit-box;display:flex;-webkit-box-flex:1;flex-grow:1;margin:0 -8px;padding:8px;gap:8px;position:relative;-webkit-box-pack:justify;justify-content:space-between;border-radius:8px}#mention-sheet .accounts-list li:hover{background-image:-webkit-linear-gradient(var(--to-forward),transparent 75%,var(--link-bg-color));background-image:linear-gradient(var(--to-forward),transparent 75%,var(--link-bg-color))}#mention-sheet .accounts-list li.selected{background-image:-webkit-linear-gradient(var(--to-forward),var(--bg-faded-color) 75%,var(--link-bg-color));background-image:linear-gradient(var(--to-forward),var(--bg-faded-color) 75%,var(--link-bg-color))}#mention-sheet .accounts-list li:before{content:"";display:block;border-top:var(--hairline-width) solid var(--divider-color);position:absolute;bottom:0;inset-inline-start:58px;inset-inline-end:0}#mention-sheet .accounts-list li:has(+li:is(.selected,:hover)):before{opacity:0}#mention-sheet .accounts-list li.selected:before{opacity:0}#mention-sheet .accounts-list li:hover:before{opacity:0}#mention-sheet .accounts-list li>button{border-radius:4px}#mention-sheet .accounts-list li>button:hover{outline:2px solid var(--button-bg-blur-color)}#custom-emojis-sheet{max-height:50vh;max-height:50dvh}#custom-emojis-sheet header .loader-container{margin:0}#custom-emojis-sheet header form{margin:8px 0 0}#custom-emojis-sheet header form input{width:100%;min-width:0}#custom-emojis-sheet main{-webkit-mask-image:none;mask-image:none;min-height:40vh;padding-bottom:88px}#custom-emojis-sheet .custom-emojis-matches{margin:0;padding:0;list-style:none;display:-webkit-box;display:flex;flex-wrap:wrap}#custom-emojis-sheet .custom-emojis-list .section-container{position:relative;content-visibility:auto;content-intrinsic-size:auto 88px}#custom-emojis-sheet .custom-emojis-list .section-header{font-size:80%;text-transform:uppercase;color:var(--text-insignificant-color);padding:8px 0 4px;position:sticky;top:0;background-color:var(--bg-color);z-index:1;display:inline-block;-webkit-padding-end:8px;padding-inline-end:8px;pointer-events:none;border-end-end-radius:8px}#custom-emojis-sheet .custom-emojis-list section{display:-webkit-box;display:flex;flex-wrap:wrap}#custom-emojis-sheet .custom-emojis-list button{color:var(--text-color);border-radius:8px;background-image:-webkit-radial-gradient(closest-side,var(--img-bg-color),transparent);background-image:radial-gradient(closest-side,var(--img-bg-color),transparent);text-shadow:0 1px 0 var(--bg-color);position:relative;min-width:44px;min-height:44px;font-variant-numeric:slashed-zero;-webkit-font-feature-settings:"ss01","zero","zero","zero";font-feature-settings:"ss01","zero","zero","zero"}#custom-emojis-sheet .custom-emojis-list button[data-title]:after{max-width:50vw;pointer-events:none;position:absolute;content:attr(data-title);left:50%;top:0;background-color:var(--bg-color);padding:2px 4px;border-radius:4px;font-size:12px;border:1px solid var(--text-color);-webkit-transform:translate(-50%,-110%);transform:translate(-50%,-110%);opacity:0;-webkit-transition:opacity .1s ease-out .1s;transition:opacity .1s ease-out .1s;font-family:var(--monospace-font);line-height:1}#custom-emojis-sheet .custom-emojis-list button.edge-left[data-title]:after{left:0;-webkit-transform:translate(0,-110%);transform:translateY(-110%)}#custom-emojis-sheet .custom-emojis-list button.edge-right[data-title]:after{left:100%;-webkit-transform:translate(-100%,-110%);transform:translate(-100%,-110%)}#custom-emojis-sheet .custom-emojis-list button:hover,#custom-emojis-sheet .custom-emojis-list button:focus{z-index:1;-webkit-filter:none;filter:none;background-color:var(--bg-faded-color)}#custom-emojis-sheet .custom-emojis-list button[data-title]:hover:after{opacity:1}#custom-emojis-sheet .custom-emojis-list button[data-title]:focus:after{opacity:1}#custom-emojis-sheet .custom-emojis-list button img{-webkit-transition:-webkit-transform .1s ease-out;transition:-webkit-transform .1s ease-out;transition:transform .1s ease-out;transition:transform .1s ease-out,-webkit-transform .1s ease-out}#custom-emojis-sheet .custom-emojis-list button:hover img,#custom-emojis-sheet .custom-emojis-list button:focus img{-webkit-transform:scale(2);transform:scale(2)}#custom-emojis-sheet .custom-emojis-list button.edge-left img{-webkit-transform-origin:left center;transform-origin:left center}#custom-emojis-sheet .custom-emojis-list button.edge-right img{-webkit-transform-origin:right center;transform-origin:right center}#custom-emojis-sheet .custom-emojis-list button code{font-size:.8em}.compose-field-container{display:grid!important}@media (max-width: 479.98px){.compose-field-container{margin-inline:calc(-1 * var(--form-spacing-inline));width:100vw!important;max-width:100vw}.compose-field-container .compose-field{border-radius:0;outline-offset:-2px}}.compose-field-container.debug{grid-template-columns:1fr 1fr}.compose-field-container>.compose-field,.compose-field-container>.compose-highlight{grid-area:1 / 1 / 2 / 2}.compose-field-container .compose-highlight{user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;touch-action:none;padding:8px;color:transparent;background-color:transparent;border:2px solid transparent;line-height:1.4;overflow:auto;unicode-bidi:plaintext;-webkit-rtl-ordering:logical;rtl-ordering:logical;word-wrap:break-word;white-space:pre-wrap;min-height:5em;max-height:50vh;scrollbar-width:none}.compose-field-container .compose-highlight::-webkit-scrollbar{display:none}@media (min-width: 40em){.compose-field-container .compose-highlight{max-height:65vh}}.compose-field-container .compose-highlight mark{color:inherit}.compose-field-container .compose-highlight .compose-highlight-url,.compose-field-container .compose-highlight .compose-highlight-hashtag{background-color:transparent;-webkit-text-decoration:underline;text-decoration:underline;text-decoration-color:var(--link-faded-color);text-decoration-thickness:2px;text-underline-offset:2px}.compose-field-container .compose-highlight .compose-highlight-mention,.compose-field-container .compose-highlight .compose-highlight-emoji-shortcode,.compose-field-container .compose-highlight .compose-highlight-exceeded{mix-blend-mode:multiply;border-radius:4px;box-shadow:0 0 0 1px}.compose-field-container .compose-highlight .compose-highlight-mention{background-color:var(--orange-light-bg-color);box-shadow-color:var(--orange-light-bg-color)}.compose-field-container .compose-highlight .compose-highlight-emoji-shortcode{background-color:var(--bg-faded-color);box-shadow-color:var(--bg-faded-color)}.compose-field-container .compose-highlight .compose-highlight-exceeded{background-color:var(--red-bg-color);box-shadow-color:var(--red-bg-color)}@media (prefers-color-scheme: dark){:where(html:not(.is-light)) .compose-field-container .compose-highlight .compose-highlight-mention,:where(html:not(.is-light)) .compose-field-container .compose-highlight .compose-highlight-emoji-shortcode,:where(html:not(.is-light)) .compose-field-container .compose-highlight .compose-highlight-exceeded{mix-blend-mode:screen}}:where(html.is-dark) .compose-field-container .compose-highlight .compose-highlight-mention,:where(html.is-dark) .compose-field-container .compose-highlight .compose-highlight-emoji-shortcode,:where(html.is-dark) .compose-field-container .compose-highlight .compose-highlight-exceeded{mix-blend-mode:screen}@-webkit-keyframes gif-shake{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}25%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}50%{-webkit-transform:rotate(0deg);transform:rotate(0)}75%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}to{-webkit-transform:rotate(0deg);transform:rotate(0)}}@keyframes gif-shake{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}25%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}50%{-webkit-transform:rotate(0deg);transform:rotate(0)}75%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}to{-webkit-transform:rotate(0deg);transform:rotate(0)}}@-webkit-keyframes jump-scare{0%{opacity:.5;-webkit-transform:scale(.25) translateX(80px);transform:scale(.25) translate(80px)}to{opacity:1;-webkit-transform:scale(1) translateX(0);transform:scale(1) translate(0)}}@keyframes jump-scare{0%{opacity:.5;-webkit-transform:scale(.25) translateX(80px);transform:scale(.25) translate(80px)}to{opacity:1;-webkit-transform:scale(1) translateX(0);transform:scale(1) translate(0)}}@-webkit-keyframes jump-scare-rtl{0%{opacity:.5;-webkit-transform:scale(.25) translateX(-80px);transform:scale(.25) translate(-80px)}to{opacity:1;-webkit-transform:scale(1) translateX(0);transform:scale(1) translate(0)}}@keyframes jump-scare-rtl{0%{opacity:.5;-webkit-transform:scale(.25) translateX(-80px);transform:scale(.25) translate(-80px)}to{opacity:1;-webkit-transform:scale(1) translateX(0);transform:scale(1) translate(0)}}.add-button{-webkit-transform-origin:var(--forward) center;transform-origin:var(--forward) center;background-color:var(--bg-blur-color)!important;-webkit-animation:jump-scare .2s ease-in-out both;animation:jump-scare .2s ease-in-out both}[dir=rtl] .add-button{-webkit-animation-name:jump-scare-rtl;animation-name:jump-scare-rtl}.add-button .icon{-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}.add-button.active .icon{-webkit-transform:rotate(135deg);transform:rotate(135deg)}.gif-picker-button:hover .icon,.gif-picker-button:focus .icon{-webkit-animation:gif-shake .3s 3;animation:gif-shake .3s 3}#gif-picker-sheet{height:50vh}#gif-picker-sheet form{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;gap:8px;-webkit-box-align:center;align-items:center}#gif-picker-sheet form input[type=search]{-webkit-box-flex:1;flex-grow:1;min-width:0}#gif-picker-sheet main{overflow-x:auto;overflow-y:hidden;-webkit-mask-image:-webkit-linear-gradient(var(--to-forward),transparent 2px,black 16px,black calc(100% - 16px),transparent calc(100% - 2px));mask-image:linear-gradient(var(--to-forward),transparent 2px,black 16px,black calc(100% - 16px),transparent calc(100% - 2px))}@media (min-height: 480px){#gif-picker-sheet main{overflow-y:auto;max-height:50vh}}#gif-picker-sheet main.loading{opacity:.25}#gif-picker-sheet main .ui-state{min-height:100px}#gif-picker-sheet main ul{min-height:100px;display:-webkit-box;display:flex;gap:4px;list-style:none;padding:8px 2px;margin:0}@media (min-height: 480px){#gif-picker-sheet main ul{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));grid-auto-rows:1fr}}#gif-picker-sheet main ul li{list-style:none;padding:0;margin:0;max-width:100%;display:-webkit-box;display:flex}#gif-picker-sheet main ul li button{padding:4px;margin:0;border:none;background-color:transparent;color:inherit;cursor:pointer;border-radius:8px;background-color:var(--bg-faded-color)}@media (min-height: 480px){#gif-picker-sheet main ul li button{width:100%;text-align:center}}#gif-picker-sheet main ul li button:hover,#gif-picker-sheet main ul li button:focus{background-color:var(--link-bg-color);box-shadow:0 0 0 2px var(--link-light-color);-webkit-filter:none;filter:none}#gif-picker-sheet main ul li figure{margin:0;padding:0;width:var(--figure-width);max-width:100%}@media (min-height: 480px){#gif-picker-sheet main ul li figure{width:100%;text-align:center}}#gif-picker-sheet main ul li figure figcaption{font-size:.8em;padding:2px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--text-insignificant-color)}#gif-picker-sheet main ul li img{background-color:var(--img-bg-color);border-radius:4px;vertical-align:top;-o-object-fit:contain;object-fit:contain}#gif-picker-sheet main .pagination{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;gap:8px;padding:0;margin:0;position:sticky;bottom:0;left:0;right:0}@media (min-height: 480px){#gif-picker-sheet main .pagination{position:static}} diff --git a/assets/compose-_EXIhB02.js b/assets/compose-_EXIhB02.js new file mode 100644 index 0000000..09dfbe3 --- /dev/null +++ b/assets/compose-_EXIhB02.js @@ -0,0 +1,2 @@ +import{a9 as _,u as g,h as l,U as v,K as T,a3 as m,y as u,T as t,d as e,H as y,v as C,aa as I,r as x,ac as E}from"./useTitle-jLgT0T3g.js";_();window.opener&&(console=window.opener.console);function L(){var d,r;const{_:i}=g(),[o,p]=l("default"),[a,f]=l(null),{editStatus:c,replyToStatus:s,draftStatus:h}=window.__COMPOSE__||{};return v(i(c?{id:"Txus+H"}:s?{id:"03vjxE",values:{0:((d=s.account)==null?void 0:d.acct)||((r=s.account)==null?void 0:r.username)}}:{id:"QOhkyl"})),u(()=>{const n=T();f(!!n),n&&m()},[]),u(()=>{if(o==="closed"){try{window.opener.focus()}catch{}window.close()}},[o]),o==="closed"?e("div",{class:"box",children:[e("p",{children:e(t,{id:"mBdQnV"})}),e("p",{children:e("button",{onClick:()=>{window.close()},children:e(t,{id:"rf8fiC"})})})]}):a===!1?e("div",{class:"box",children:[e("h1",{children:e(t,{id:"SlfejT"})}),e("p",{children:e(t,{id:"D3vX+9"})}),e("p",{children:e("a",{href:"/",children:e(t,{id:"iWpEwy"})})})]}):a?e(y,{editStatus:c,replyToStatus:s,draftStatus:h,standalone:!0,hasOpener:window.opener,onClose:n=>{const{newStatus:w,fn:S=()=>{}}=n||{};try{w&&window.opener.__STATES__.reloadStatusPage++,S(),p("closed")}catch{}}}):e("div",{class:"box",children:e(C,{})})}E(e(I,{i18n:x,children:e(L,{})}),document.getElementById("app-standalone")); +//# sourceMappingURL=compose-_EXIhB02.js.map diff --git a/assets/compose-_EXIhB02.js.map b/assets/compose-_EXIhB02.js.map new file mode 100644 index 0000000..4868057 --- /dev/null +++ b/assets/compose-_EXIhB02.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compose-_EXIhB02.js","sources":["../../src/compose.jsx"],"sourcesContent":["import './index.css';\nimport './app.css';\nimport './polyfills';\n\nimport { i18n } from '@lingui/core';\nimport { I18nProvider } from '@lingui/react';\nimport { Trans, useLingui } from '@lingui/react/macro';\nimport { render } from 'preact';\nimport { useEffect, useState } from 'preact/hooks';\n\nimport ComposeSuspense from './components/compose-suspense';\nimport Loader from './components/loader';\nimport { initActivateLang } from './utils/lang';\nimport { initStates } from './utils/states';\nimport { getCurrentAccount } from './utils/store-utils';\nimport useTitle from './utils/useTitle';\n\ninitActivateLang();\n\nif (window.opener) {\n console = window.opener.console;\n}\n\nfunction App() {\n const { t } = useLingui();\n const [uiState, setUIState] = useState('default');\n const [isLoggedIn, setIsLoggedIn] = useState(null);\n\n const { editStatus, replyToStatus, draftStatus } = window.__COMPOSE__ || {};\n\n useTitle(\n editStatus\n ? t`Editing source status`\n : replyToStatus\n ? t`Replying to @${\n replyToStatus.account?.acct || replyToStatus.account?.username\n }`\n : t`Compose`,\n );\n\n useEffect(() => {\n const account = getCurrentAccount();\n setIsLoggedIn(!!account);\n if (account) {\n initStates();\n }\n }, []);\n\n useEffect(() => {\n if (uiState === 'closed') {\n try {\n // Focus parent window\n window.opener.focus();\n } catch (e) {}\n window.close();\n }\n }, [uiState]);\n\n if (uiState === 'closed') {\n return (\n
    \n

    \n You may close this page now.\n

    \n

    \n {\n window.close();\n }}\n >\n Close window\n \n

    \n
    \n );\n }\n\n console.debug('OPEN COMPOSE');\n\n if (isLoggedIn === false) {\n return (\n
    \n

    \n Error\n

    \n

    \n Login required.\n

    \n

    \n \n Go home\n \n

    \n
    \n );\n }\n\n if (isLoggedIn) {\n return (\n {\n const { newStatus, fn = () => {} } = results || {};\n try {\n if (newStatus) {\n window.opener.__STATES__.reloadStatusPage++;\n }\n fn();\n setUIState('closed');\n } catch (e) {}\n }}\n />\n );\n }\n\n return (\n
    \n \n
    \n );\n}\n\nrender(\n \n \n ,\n document.getElementById('app-standalone'),\n);\n"],"names":["initActivateLang","window","opener","console","App","t","_useLingui","uiState","setUIState","useState","isLoggedIn","setIsLoggedIn","editStatus","replyToStatus","draftStatus","__COMPOSE__","useTitle","_t","id","values","0","account","acct","username","useEffect","getCurrentAccount","initStates","focus","close","_jsxs","class","children","_jsx","_Trans","onClick","href","ComposeSuspense","standalone","hasOpener","newStatus","results","fn","Loader","render","I18nProvider","i18n"],"mappings":"0IAiBAA,IAEIC,OAAOC,SACTC,QAAUF,OAAOC,OAAOC,SAG1B,SAASC,GAAM,SACP,KAAA,CAAEC,EAAAA,GAAGC,EAAc,EACnB,CAACC,EAASC,CAAU,EAAIC,EAAS,SAAS,EAC1C,CAACC,EAAYC,CAAa,EAAIF,EAAS,IAAI,EAE3C,CAAEG,WAAAA,EAAYC,cAAAA,EAAeC,YAAAA,CAAAA,EAAgBb,OAAOc,aAAe,GA8BzE,OA5BAC,EACYC,EAAVL,EACI,CAAAM,GAAA,QAAuB,EACvBL,EACE,CAAAK,GAAA,SAAAC,OAAA,CAAAC,IACEP,EAAAA,EAAcQ,UAAdR,YAAAA,EAAuBS,SAAQT,EAAAA,EAAcQ,UAAdR,YAAAA,EAAuBU,SAAQ,CAC/D,EACD,CAAAL,GAAA,QAAS,EACjB,EAEAM,EAAU,IAAM,CACd,MAAMH,EAAUI,IACFd,EAAA,CAAC,CAACU,CAAO,EACnBA,GACSK,GAEf,EAAG,CAAE,CAAA,EAELF,EAAU,IAAM,CACd,GAAIjB,IAAY,SAAU,CACpB,GAAA,CAEFN,OAAOC,OAAOyB,aACJ,CAAC,CACb1B,OAAO2B,MAAM,CACf,CAAA,EACC,CAACrB,CAAO,CAAC,EAERA,IAAY,SAEZsB,EAAA,MAAA,CAAKC,MAAM,MAAKC,UACdC,EAAA,IAAA,CAAAD,SACEC,EAAAC,EAAA,CAAAf,GAAA,QAAA,CAA0C,CAAA,CACzC,EACHc,EAAA,IAAA,CAAAD,SACEC,EAAA,SAAA,CACEE,QAASA,IAAM,CACbjC,OAAO2B,MAAM,CACf,EAAEG,SAEFC,EAAAC,EAAA,CAAAf,GAAA,QAAA,CAA0B,CAAA,CACpB,CAAA,CACP,CAAC,CAAA,CACD,EAITf,IAA4B,WAEF,CACxB,YACO2B,SAAM,CAAAE,EAAA,KAAA,CAAKD,SACdC,EAAAC,EAAA,CAAAF,GAAAA,QACE,CAAA,CAAA,CAAA,EAAmBC,EAAA,IAAA,CAErBA,SAAAA,EAAAC,EAAA,CAAAF,GAAAA,QACE,CAAA,CAAA,CAAA,EAA6BC,EAAA,IAAA,CAE/BA,SAAAA,EAAA,IAAA,CAAAD,KAAAA,IACKI,SAAKH,EAAAC,EAAA,CAAGF,GAAAA,QACT,CAAA,CAAA,CAAA,CAAqB,CAAA,CAAC,CACrB,CAAA,EAIXrB,EAEgBsB,EAAAI,EAAA,CACd,WAAAxB,EAEIA,cAAAA,EACAC,YAAAA,EACAC,WAAAA,GACAuB,UAAU,OAAA,OACVC,WAAkBpC,OAEV,UAAAqC,EAAEA,GAAAA,EAAAA,IAAAA,EAAsB,EAACC,GAAA,CAAA,EAAE,GAAIA,CACjCD,GACF,OAAe,OAAA,WAAA,mBAEfE,IACGjC,EAAA,QAAA,CACHA,MAAAA,EACW,CAAA,CACf,EAGNwB,EAAA,MAAA,CAEA,YACOF,SAAME,EAAAU,EAAA,EAAA,CAAA,CAAA,CACA,CAGfC,EAAAX,EAAAY,EAAA,CAEAD,KAAAA,EACgBE,SAAAA,EAAAA,EAAAA,EAAAA,CAAAA,CAAAA,EACZb,SAAAA,eAAM,gBAAA,CAAA"} \ No newline at end of file diff --git a/assets/fuse-1Fw6A_G2.js b/assets/fuse-1Fw6A_G2.js new file mode 100644 index 0000000..47a323b --- /dev/null +++ b/assets/fuse-1Fw6A_G2.js @@ -0,0 +1,189 @@ +import{ad as lt,Q as Ne,d as r,h as K,q as ke,A as D,_ as Rt,y as J,B as kr,r as Ie,ae as k,af as Va,e as ir,ag as co,ah as Ha,i as se,P as bt,p as cs,ai as Ba,aj as ls,O as us,k as $,M as Qt,V as Le,n as Ua,s as V,ak as ja,u as tt,a as lo,x as En,z as Wa,al as Ka,T as O,am as ds,an as Za,ao as fs,o as vo,v as hs,g as Ir,ap as qa,aq as De,ar as Ga,as as Ya,at as jn,I as it,c as Pn,b as mt,W as ps,au as Xa,av as Qa,aw as Ja}from"./useTitle-jLgT0T3g.js";function sr(){return sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var cc=function(t,n,o){o===void 0&&(o=!1);var i=n.alt,a=n.meta,s=n.mod,c=n.shift,l=n.ctrl,u=n.keys,f=t.key,d=t.code,h=t.ctrlKey,p=t.metaKey,m=t.shiftKey,_=t.altKey,v=vt(d),T=f.toLowerCase();if(!(u!=null&&u.includes(v))&&!(u!=null&&u.includes(T))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(v))return!1;if(!o){if(i===!_&&T!=="alt"||c===!m&&T!=="shift")return!1;if(s){if(!p&&!h)return!1}else if(a===!p&&T!=="meta"&&T!=="os"||l===!h&&T!=="ctrl"&&T!=="control")return!1}return u&&u.length===1&&(u.includes(T)||u.includes(v))?!0:u?nc(u):!u},lc=lt(void 0),uc=function(){return Ne(lc)};function ys(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,o){return n&&ys(e[o],t[o])},!0):e===t}var dc=lt({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),fc=function(){return Ne(dc)};function hc(e){var t=D(void 0);return ys(t.current,e)||(t.current=e),t.current}var ai=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},pc=typeof window<"u"?Rt:J;function Bt(e,t,n,o){var i=K(null),a=i[0],s=i[1],c=D(!1),l=n instanceof Array?o instanceof Array?void 0:o:n,u=Ar(e)?e.join(l==null?void 0:l.splitKey):e,f=n instanceof Array?n:o instanceof Array?o:void 0,d=ke(t,f??[]),h=D(d);f?h.current=d:h.current=t;var p=hc(l),m=fc(),_=m.enabledScopes,v=uc();return pc(function(){if(!((p==null?void 0:p.enabled)===!1||!ac(_,p==null?void 0:p.scopes))){var T=function(x,E){var A;if(E===void 0&&(E=!1),!(ic(x)&&!_s(x,p==null?void 0:p.enableOnFormTags))){if(a!==null){var M=a.getRootNode();if((M instanceof Document||M instanceof ShadowRoot)&&M.activeElement!==a&&!a.contains(M.activeElement)){ai(x);return}}(A=x.target)!=null&&A.isContentEditable&&!(p!=null&&p.enableOnContentEditable)||Ao(u,p==null?void 0:p.splitKey).forEach(function(R){var S,C=Co(R,p==null?void 0:p.combinationKey);if(cc(x,C,p==null?void 0:p.ignoreModifiers)||(S=C.keys)!=null&&S.includes("*")){if(p!=null&&p.ignoreEventWhen!=null&&p.ignoreEventWhen(x)||E&&c.current)return;if(oc(x,C,p==null?void 0:p.preventDefault),!rc(x,C,p==null?void 0:p.enabled)){ai(x);return}h.current(x,C),E||(c.current=!0)}})}},b=function(x){x.key!==void 0&&(gs(vt(x.code)),((p==null?void 0:p.keydown)===void 0&&(p==null?void 0:p.keyup)!==!0||p!=null&&p.keydown)&&T(x))},w=function(x){x.key!==void 0&&(vs(vt(x.code)),c.current=!1,p!=null&&p.keyup&&T(x,!0))},I=a||(l==null?void 0:l.document)||document;return I.addEventListener("keyup",w),I.addEventListener("keydown",b),v&&Ao(u,p==null?void 0:p.splitKey).forEach(function(g){return v.addHotkey(Co(g,p==null?void 0:p.combinationKey,p==null?void 0:p.description))}),function(){I.removeEventListener("keyup",w),I.removeEventListener("keydown",b),v&&Ao(u,p==null?void 0:p.splitKey).forEach(function(g){return v.removeHotkey(Co(g,p==null?void 0:p.combinationKey,p==null?void 0:p.description))})}}},[a,u,p,_]),s}var no={exports:{}};/*! + * Toastify js 1.12.0 + * https://github.com/apvarun/toastify-js + * @license MIT licensed + * + * Copyright (C) 2018 Varun A P + */var mc=no.exports,ci;function gc(){return ci||(ci=1,function(e){(function(t,n){e.exports?e.exports=n():t.Toastify=n()})(mc,function(t){var n=function(s){return new n.lib.init(s)},o="1.12.0";n.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,ariaLive:"polite",style:{background:""}},n.lib=n.prototype={toastify:o,constructor:n,init:function(s){return s||(s={}),this.options={},this.toastElement=null,this.options.text=s.text||n.defaults.text,this.options.node=s.node||n.defaults.node,this.options.duration=s.duration===0?0:s.duration||n.defaults.duration,this.options.selector=s.selector||n.defaults.selector,this.options.callback=s.callback||n.defaults.callback,this.options.destination=s.destination||n.defaults.destination,this.options.newWindow=s.newWindow||n.defaults.newWindow,this.options.close=s.close||n.defaults.close,this.options.gravity=s.gravity==="bottom"?"toastify-bottom":n.defaults.gravity,this.options.positionLeft=s.positionLeft||n.defaults.positionLeft,this.options.position=s.position||n.defaults.position,this.options.backgroundColor=s.backgroundColor||n.defaults.backgroundColor,this.options.avatar=s.avatar||n.defaults.avatar,this.options.className=s.className||n.defaults.className,this.options.stopOnFocus=s.stopOnFocus===void 0?n.defaults.stopOnFocus:s.stopOnFocus,this.options.onClick=s.onClick||n.defaults.onClick,this.options.offset=s.offset||n.defaults.offset,this.options.escapeMarkup=s.escapeMarkup!==void 0?s.escapeMarkup:n.defaults.escapeMarkup,this.options.ariaLive=s.ariaLive||n.defaults.ariaLive,this.options.style=s.style||n.defaults.style,s.backgroundColor&&(this.options.style.background=s.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var s=document.createElement("div");s.className="toastify on "+this.options.className,this.options.position?s.className+=" toastify-"+this.options.position:this.options.positionLeft===!0?(s.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):s.className+=" toastify-right",s.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');for(var c in this.options.style)s.style[c]=this.options.style[c];if(this.options.ariaLive&&s.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)s.appendChild(this.options.node);else if(this.options.escapeMarkup?s.innerText=this.options.text:s.innerHTML=this.options.text,this.options.avatar!==""){var l=document.createElement("img");l.src=this.options.avatar,l.className="toastify-avatar",this.options.position=="left"||this.options.positionLeft===!0?s.appendChild(l):s.insertAdjacentElement("afterbegin",l)}if(this.options.close===!0){var u=document.createElement("button");u.type="button",u.setAttribute("aria-label","Close"),u.className="toast-close",u.innerHTML="✖",u.addEventListener("click",(function(v){v.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}).bind(this));var f=window.innerWidth>0?window.innerWidth:screen.width;(this.options.position=="left"||this.options.positionLeft===!0)&&f>360?s.insertAdjacentElement("afterbegin",u):s.appendChild(u)}if(this.options.stopOnFocus&&this.options.duration>0){var d=this;s.addEventListener("mouseover",function(v){window.clearTimeout(s.timeOutValue)}),s.addEventListener("mouseleave",function(){s.timeOutValue=window.setTimeout(function(){d.removeElement(s)},d.options.duration)})}if(typeof this.options.destination<"u"&&s.addEventListener("click",(function(v){v.stopPropagation(),this.options.newWindow===!0?window.open(this.options.destination,"_blank"):window.location=this.options.destination}).bind(this)),typeof this.options.onClick=="function"&&typeof this.options.destination>"u"&&s.addEventListener("click",(function(v){v.stopPropagation(),this.options.onClick()}).bind(this)),typeof this.options.offset=="object"){var h=i("x",this.options),p=i("y",this.options),m=this.options.position=="left"?h:"-"+h,_=this.options.gravity=="toastify-top"?p:"-"+p;s.style.transform="translate("+m+","+_+")"}return s},showToast:function(){this.toastElement=this.buildToast();var s;if(typeof this.options.selector=="string"?s=document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||typeof ShadowRoot<"u"&&this.options.selector instanceof ShadowRoot?s=this.options.selector:s=document.body,!s)throw"Root element is not defined";var c=n.defaults.oldestFirst?s.firstChild:s.lastChild;return s.insertBefore(this.toastElement,c),n.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout((function(){this.removeElement(this.toastElement)}).bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(s){s.className=s.className.replace(" on",""),window.setTimeout((function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),s.parentNode&&s.parentNode.removeChild(s),this.options.callback.call(s),n.reposition()}).bind(this),400)}},n.reposition=function(){for(var s={top:15,bottom:15},c={top:15,bottom:15},l={top:15,bottom:15},u=document.getElementsByClassName("toastify"),f,d=0;d0?window.innerWidth:screen.width;m<=360?(u[d].style[f]=l[f]+"px",l[f]+=h+p):a(u[d],"toastify-left")===!0?(u[d].style[f]=s[f]+"px",s[f]+=h+p):(u[d].style[f]=c[f]+"px",c[f]+=h+p)}return this};function i(s,c){return c.offset[s]?isNaN(c.offset[s])?c.offset[s]:c.offset[s]+"px":"0px"}function a(s,c){return!s||typeof c!="string"?!1:!!(s.className&&s.className.trim().split(/\s+/gi).indexOf(c)>-1)}return n.lib.init.prototype=n.lib,n})}(no)),no.exports}var vc=gc();const _c=kr(vc);window._showToast=Re;function Re(e){typeof e=="string"&&(e={text:e});const{onClick:t,delay:n,...o}=e,i=_c({className:`${t||e.destination?"shiny-pill":""}`,gravity:"bottom",position:"center",...o,onClick:()=>{t==null||t(i)}});return n?setTimeout(()=>{i.showToast()},n):i.showToast(),i}function nh(e,t,n,o){const i=D(e);J(()=>{i.current=e},[e,n]),J(()=>{!o||t===null||t===!1||i.current()},[o]),J(()=>{if(t===null||t===!1)return;const s=setInterval(()=>i.current(),t);return()=>clearInterval(s)},[t])}function yc(e){const t=URL.parse("/compose/",window.location),{width:n,height:o}=window.screen,i=Math.max(0,(n-600)/2),a=Math.max(0,(o-450)/2),s=Math.min(n,600),c=Math.min(o,450),l=(e==null?void 0:e.uid)||Math.random(),u=window.open(t,"compose"+l,`width=${s},height=${c},left=${i},top=${a}`);return u?u.__COMPOSE__=e:alert(Ie._({id:"4S86wI"})),u}const bc=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Tc(){if(bc){const e=document.createElement("input");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.opacity="0",document.body.appendChild(e),e.focus(),setTimeout(()=>{document.body.removeChild(e)},500)}}const bs={x:()=>k(()=>import("./icons/close-line-YTE7hIJE.js"),[],import.meta.url),heart:()=>k(()=>import("./icons/heart-line-VwvWYh8h.js"),[],import.meta.url),bookmark:()=>k(()=>import("./icons/bookmark-line-D6jQ7QFs.js"),[],import.meta.url),"check-circle":()=>k(()=>import("./icons/check-circle-line-sE41WGxF.js"),[],import.meta.url),"x-circle":()=>k(()=>import("./icons/close-circle-line-qd3g541O.js"),[],import.meta.url),transfer:()=>k(()=>import("./icons/transfer-4-line-Q9QJoxz3.js"),[],import.meta.url),rocket:()=>k(()=>import("./icons/rocket-line-rZbVYYCZ.js"),[],import.meta.url),"arrow-left":{module:()=>k(()=>import("./icons/arrow-left-line-_YC6-XGG.js"),[],import.meta.url),rtl:!0},"arrow-right":{module:()=>k(()=>import("./icons/arrow-right-line-PypiEqpu.js"),[],import.meta.url),rtl:!0},"arrow-up":()=>k(()=>import("./icons/arrow-up-line-fcuKqhVE.js"),[],import.meta.url),"arrow-down":()=>k(()=>import("./icons/arrow-down-line-0TRJUP_K.js"),[],import.meta.url),earth:()=>k(()=>import("./icons/earth-line-t1Um8wpQ.js"),[],import.meta.url),lock:()=>k(()=>import("./icons/lock-line-0jNHqZpm.js"),[],import.meta.url),unlock:()=>k(()=>import("./icons/unlock-line-w3piJMVb.js"),[],import.meta.url),"eye-close":()=>k(()=>import("./icons/eye-close-line-lBiePPv9.js"),[],import.meta.url),"eye-open":()=>k(()=>import("./icons/eye-2-line-vz_Kw-rK.js"),[],import.meta.url),message:()=>k(()=>import("./icons/mail-line-5XLS6FEo.js"),[],import.meta.url),comment:{module:()=>k(()=>import("./icons/chat-3-line-F0xcdpXY.js"),[],import.meta.url),rtl:!0},comment2:{module:()=>k(()=>import("./icons/comment-2-line-xEXuT-Ip.js"),[],import.meta.url),rtl:!0},home:()=>k(()=>import("./icons/home-3-line-qJiZhXUH.js"),[],import.meta.url),notification:()=>k(()=>import("./icons/notification-line-olNPLtgS.js"),[],import.meta.url),follow:()=>k(()=>import("./icons/user-follow-line-k_GCWTtp.js"),[],import.meta.url),"follow-add":()=>k(()=>import("./icons/user-add-line-zzW9OULB.js"),[],import.meta.url),poll:[()=>k(()=>import("./icons/chart-bar-line-5r_DfN2w.js"),[],import.meta.url),"90deg"],pencil:()=>k(()=>import("./icons/pencil-line-bKXqElLR.js"),[],import.meta.url),quill:()=>k(()=>import("./icons/quill-pen-line-h_5-FsGz.js"),[],import.meta.url),at:()=>k(()=>import("./icons/at-line-9vJS_Hnl.js"),[],import.meta.url),attachment:()=>k(()=>import("./icons/attachment-line-C2PUa1Ke.js"),[],import.meta.url),upload:()=>k(()=>import("./icons/upload-3-line-Qsjvubiw.js"),[],import.meta.url),gear:()=>k(()=>import("./icons/settings-3-line-kt4MSpRv.js"),[],import.meta.url),more:()=>k(()=>import("./icons/more-3-line-wUD-Yhmj.js"),[],import.meta.url),more2:()=>k(()=>import("./icons/more-1-fill-je1-slyh.js"),[],import.meta.url),external:{module:()=>k(()=>import("./icons/external-link-line-8nOOkmFu.js"),[],import.meta.url),rtl:!0},popout:{module:()=>k(()=>import("./icons/external-link-line-8nOOkmFu.js"),[],import.meta.url),rtl:!0},popin:{module:()=>k(()=>import("./icons/external-link-line-8nOOkmFu.js"),[],import.meta.url),rotate:"180deg",rtl:!0},plus:()=>k(()=>import("./icons/add-circle-line--O-MfyNy.js"),[],import.meta.url),"chevron-left":{module:()=>k(()=>import("./icons/left-line-Jck0yVmC.js"),[],import.meta.url),rtl:!0},"chevron-right":{module:()=>k(()=>import("./icons/right-line-7VBoqLdz.js"),[],import.meta.url),rtl:!0},"chevron-down":()=>k(()=>import("./icons/down-line-9PeS5YhF.js"),[],import.meta.url),reply:{module:()=>k(()=>import("./icons/share-forward-line-4jL-2Q4u.js"),[],import.meta.url),rotate:"180deg",flip:"horizontal",rtl:!0},thread:()=>k(()=>import("./icons/route-line-2YYy3958.js"),[],import.meta.url),group:{module:()=>k(()=>import("./icons/group-line-JvhJklhQ.js"),[],import.meta.url),rtl:!0},bot:()=>k(()=>import("./icons/android-2-line-uPwvVubH.js"),[],import.meta.url),menu:()=>k(()=>import("./icons/rows-4-line-SxGPYpTa.js"),[],import.meta.url),list:{module:()=>k(()=>import("./icons/list-check-line-qNqx9Mm4.js"),[],import.meta.url),rtl:!0},search:()=>k(()=>import("./icons/search-2-line-G39AynEw.js"),[],import.meta.url),hashtag:()=>k(()=>import("./icons/hashtag-line-SS3QMu1R.js"),[],import.meta.url),info:()=>k(()=>import("./icons/information-line-8SOch6cR.js"),[],import.meta.url),shortcut:()=>k(()=>import("./icons/lightning-line-JMYUlCZM.js"),[],import.meta.url),user:()=>k(()=>import("./icons/user-4-line-zT_bpOrS.js"),[],import.meta.url),following:()=>k(()=>import("./icons/walk-line-CF7a5s4t.js"),[],import.meta.url),pin:()=>k(()=>import("./icons/pin-line-ULyRQyWZ.js"),[],import.meta.url),unpin:[()=>k(()=>import("./icons/pin-line-ULyRQyWZ.js"),[],import.meta.url),"180deg"],bus:()=>k(()=>import("./icons/bus-2-line-XuQdDZ_w.js"),[],import.meta.url),link:()=>k(()=>import("./icons/link-2-line-BUqp1EwN.js"),[],import.meta.url),history:()=>k(()=>import("./icons/history-line-yoG7K8wL.js"),[],import.meta.url),share:()=>k(()=>import("./icons/share-2-line-PYo-zN94.js"),[],import.meta.url),sparkles:()=>k(()=>import("./icons/sparkles-line-wjZWGZ1a.js"),[],import.meta.url),sparkles2:()=>k(()=>import("./icons/sparkles-2-line-g2FqdZ0R.js"),[],import.meta.url),exit:{module:()=>k(()=>import("./icons/exit-line-l-1uUgI7.js"),[],import.meta.url),rtl:!0},translate:()=>k(()=>import("./icons/translate-line-HpDtlqS2.js"),[],import.meta.url),play:()=>k(()=>import("./icons/play-fill-Ey-zv2eL.js"),[],import.meta.url),trash:()=>k(()=>import("./icons/delete-2-line-pjUduCFs.js"),[],import.meta.url),mute:{module:()=>k(()=>import("./icons/volume-mute-line-WthBoXru.js"),[],import.meta.url),rtl:!0},unmute:{module:()=>k(()=>import("./icons/volume-line-PZujbN8h.js"),[],import.meta.url),rtl:!0},block:()=>k(()=>import("./icons/forbid-circle-line-3FxopGoP.js"),[],import.meta.url),unblock:[()=>k(()=>import("./icons/forbid-circle-line-3FxopGoP.js"),[],import.meta.url),"180deg"],flag:()=>k(()=>import("./icons/flag-1-line-xvcg7G7Q.js"),[],import.meta.url),time:()=>k(()=>import("./icons/time-line-ThP0kTRr.js"),[],import.meta.url),refresh:()=>k(()=>import("./icons/refresh-2-line-t42qqclb.js"),[],import.meta.url),emoji2:()=>k(()=>import("./icons/emoji-2-line--uNVc2IC.js"),[],import.meta.url),filter:()=>k(()=>import("./icons/filter-2-line-KyjbFYlO.js"),[],import.meta.url),filters:()=>k(()=>import("./icons/filter-line-1KEfnWDm.js"),[],import.meta.url),chart:()=>k(()=>import("./icons/chart-line-line-pHaLt6yC.js"),[],import.meta.url),react:()=>k(()=>import("./icons/react-line-YfZPqZem.js"),[],import.meta.url),layout4:{module:()=>k(()=>import("./icons/layout-4-line-FOdnyEcZ.js"),[],import.meta.url),rtl:!0},layout5:()=>k(()=>import("./icons/layout-5-line-9Kks7dle.js"),[],import.meta.url),announce:{module:()=>k(()=>import("./icons/announcement-line-MSlAmDH1.js"),[],import.meta.url),rtl:!0},alert:()=>k(()=>import("./icons/alert-line-zyc6hy8V.js"),[],import.meta.url),round:()=>k(()=>import("./icons/round-fill-a0rplSmV.js"),[],import.meta.url),"arrow-up-circle":()=>k(()=>import("./icons/arrow-up-circle-line-e3kZqEZN.js"),[],import.meta.url),"arrow-down-circle":()=>k(()=>import("./icons/arrow-down-circle-line-mpqFtRtO.js"),[],import.meta.url),clipboard:{module:()=>k(()=>import("./icons/clipboard-line-9F_Yeo71.js"),[],import.meta.url),rtl:!0},"account-edit":()=>k(()=>import("./icons/user-edit-line-9VnWCh0X.js"),[],import.meta.url),"account-warning":()=>k(()=>import("./icons/user-warning-line-gL3RGb1N.js"),[],import.meta.url),keyboard:()=>k(()=>import("./icons/keyboard-line-10AZQcVH.js"),[],import.meta.url),cloud:()=>k(()=>import("./icons/cloud-line-abe0HgFS.js"),[],import.meta.url),month:{module:()=>k(()=>import("./icons/calendar-month-line-VoXZVWAe.js"),[],import.meta.url),rtl:!0},media:()=>k(()=>import("./icons/photo-album-line--GdJqjfq.js"),[],import.meta.url),speak:()=>k(()=>import("./icons/radar-line-ndI8IhOG.js"),[],import.meta.url),building:()=>k(()=>import("./icons/building-5-line-ew7lu83B.js"),[],import.meta.url),history2:{module:()=>k(()=>import("./icons/history-2-line-3yIVzoWo.js"),[],import.meta.url),rtl:!0},document:()=>k(()=>import("./icons/document-line--D6ooZg1.js"),[],import.meta.url),"arrows-right":{module:()=>k(()=>import("./icons/arrows-right-line-HF4HILdT.js"),[],import.meta.url),rtl:!0},code:()=>k(()=>import("./icons/code-line-h4RWLaak.js"),[],import.meta.url),copy:()=>k(()=>import("./icons/copy-2-line-mPSDKieb.js"),[],import.meta.url),quote:{module:()=>k(()=>import("./icons/quote-left-line-NQzeELMO.js"),[],import.meta.url),rtl:!0},settings:()=>k(()=>import("./icons/settings-6-line-ZgCBilgF.js"),[],import.meta.url),"heart-break":()=>k(()=>import("./icons/heart-crack-line-P3DoKfTT.js"),[],import.meta.url),"user-x":()=>k(()=>import("./icons/user-x-line-zIdph-gu.js"),[],import.meta.url),minimize:()=>k(()=>import("./icons/arrows-down-line-ovOF9r0o.js"),[],import.meta.url),celebrate:()=>k(()=>import("./icons/celebrate-line-2j4SZgI5.js"),[],import.meta.url)},wc={s:12,m:16,l:20,xl:24,xxl:32},li={},Ec=Va(function({width:e,height:t,body:n,rotate:o,flip:i}){return r("svg",{viewBox:`0 0 ${e} ${t}`,dangerouslySetInnerHTML:{__html:n},style:{transform:`${o?`rotate(${o})`:""} ${i?"scaleX(-1)":""}`}})},{isShallowEqual:!0,maxSize:Object.keys(bs).length,matchesArg:(e,t)=>e.icon===t.icon&&e.body===t.body});function L({icon:e,size:t="m",alt:n,title:o,class:i="",style:a={}}){if(!e)return null;const s=wc[t];let c=bs[e];if(!c)return null;let l,u,f=!1;Array.isArray(c)?[c,l,u]=c:typeof c=="object"&&({rotate:l,flip:u,rtl:f}=c,c=c.module);const[d,h]=K(li[e]),p=D(e);return J(()=>{d&&p.current===e||((async()=>{const m=await c();h(m.default),li[e]=m.default})(),p.current=e)},[e]),r("span",{class:`icon ${i} ${f?"rtl-flip":""}`,title:o||n,style:{width:`${s}px`,height:`${s}px`,...a},"data-icon":e,children:d&&r(Ec,{icon:e,width:d.width,height:d.height,body:d.body,rotate:l,flip:u})})}function xc(e,t=[]){!e||typeof e!="function"||J(()=>{const n=new CloseWatcher;return n.addEventListener("close",e),()=>{n.destroy()}},t)}const Sc=window.CloseWatcher?xc:()=>{},kc=document.getElementById("modal-container");function ui(){return getComputedStyle(document.documentElement).getPropertyValue("--backdrop-theme-color")}function ar({children:e,onClose:t,onClick:n,class:o,minimized:i}){if(!e)return null;const a=D();J(()=>{let d=setTimeout(()=>{var p;const h=(p=a.current)==null?void 0:p.querySelector('[tabindex="-1"]');h&&h.focus()},100);return()=>clearTimeout(d)},[]);const s=window.CloseWatcher,c=Bt("esc",()=>{setTimeout(()=>{t==null||t()},0)},{enabled:!s&&!!t,keydown:!1,keyup:!0},[t]);Sc(t,[t]),J(()=>{const d=document.querySelectorAll(".deck-container");if(i){const h=d[d.length-1];h&&h.tabIndex===-1&&h.focus()}else e?d.forEach(h=>{h.setAttribute("inert","")}):d.forEach(h=>{h.removeAttribute("inert")});return()=>{d.forEach(h=>{h.removeAttribute("inert")})}},[e,i]);const l=D(),u=D();Rt(()=>{if(e&&!i)if(ir.local.get("theme")){const h=ui();l.current=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),l.current&&(u.current=l.current.content,l.current.content=h)}else{const h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",p=ui();l.current=document.querySelector(`meta[name="theme-color"][media*="${h}"]`),l.current&&(u.current=l.current.content,l.current.content=p)}else l.current&&u.current&&(l.current.content=u.current);return()=>{l.current&&u.current&&(l.current.content=u.current)}},[e,i]);const f=r("div",{ref:d=>{var h;a.current=d,c(((h=d==null?void 0:d.querySelector)==null?void 0:h.call(d,'[tabindex="-1"]'))||d)},className:o,onClick:d=>{n==null||n(d),d.target===d.currentTarget&&(t==null||t(d))},tabIndex:i?0:"-1",inert:i,onFocus:d=>{var h,p;try{if(d.target===d.currentTarget){const m=(h=a.current)==null?void 0:h.querySelector('[tabindex="-1"]'),_=!!m&&((p=getComputedStyle(m))==null?void 0:p.pointerEvents)!=="none";m&&_&&m.focus()}}catch{}},children:e});return co(f,kc)}var oo={exports:{}},Po,di;function Ic(){if(di)return Po;di=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Po=e,Po}var Ro,fi;function Ac(){if(fi)return Ro;fi=1;var e=Ic();function t(){}function n(){}return n.resetWarningCache=t,Ro=function(){function o(s,c,l,u,f,d){if(d!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}o.isRequired=o;function i(){return o}var a={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:i,element:o,elementType:o,instanceOf:i,node:o,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},Ro}var oh=oo.exports,hi;function Cc(){if(hi)return oo.exports;if(hi=1,0)var e,t;else oo.exports=Ac()();return oo.exports}var U=Cc();const Cr=e=>!!e&&e[0]==="o",cr=Ha||(e=>e());const xn=(e,t)=>e===!0||!!(e&&e[t]),ze=(e,t)=>typeof e=="function"?e(t):e,Pc="_szhsinMenu",Rc=e=>e[Pc];const Jt=(e,t)=>(t&&Object.keys(t).forEach(n=>{const o=e[n],i=t[n];typeof i=="function"&&o?e[n]=(...a)=>{i(...a),o(...a)}:e[n]=i}),e),Lc=e=>{if(typeof e!="string")return{top:0,right:0,bottom:0,left:0};const t=e.trim().split(/\s+/,4).map(parseFloat),n=isNaN(t[0])?0:t[0],o=isNaN(t[1])?n:t[1];return{top:n,right:o,bottom:isNaN(t[2])?n:t[2],left:isNaN(t[3])?o:t[3]}},Lo=e=>{for(;e;){if(e=e.parentNode,!e||e===document.body||!e.parentNode)return;const{overflow:t,overflowX:n,overflowY:o}=getComputedStyle(e);if(/auto|scroll|overlay|hidden/.test(t+o+n))return e}};function _o(e,t){return{"aria-disabled":e||void 0,tabIndex:t?0:-1}}function pi(e,t){for(let n=0;n({[e?`${e}ClassName`:"className"]:U.oneOfType([U.string,U.func])}),Oc={className:U.string,...Mc("menu"),arrowProps:U.object,focusProps:U.object,menuStyle:U.object,arrow:U.bool,setDownOverflow:U.bool,gap:U.number,shift:U.number,align:U.oneOf(["start","center","end"]),direction:U.oneOf(["left","right","top","bottom"]),position:U.oneOf(["auto","anchor","initial"]),overflow:U.oneOf(["auto","visible","hidden"])},rh={...Oc,containerProps:U.object,initialMounted:U.bool,unmountOnClose:U.bool,transition:U.oneOfType([U.bool,U.exact({open:U.bool,close:U.bool,item:U.bool})]),transitionTimeout:U.number,boundingBoxRef:U.object,boundingBoxPadding:U.string,reposition:U.oneOf(["auto","initial"]),repositionFlag:U.oneOfType([U.string,U.number]),viewScroll:U.oneOf(["auto","close","initial"]),submenuOpenDelay:U.number,submenuCloseDelay:U.number,portal:U.oneOfType([U.bool,U.exact({target:U.object,stablePosition:U.bool})]),theming:U.string,onItemClick:U.func},ih={instanceRef:U.oneOfType([U.object,U.func]),onMenuChange:U.func},et=({block:e,element:t,modifiers:n,className:o})=>se(()=>{const i=t?`${e}__${t}`:e;let a=i;n&&Object.keys(n).forEach(c=>{const l=n[c];l&&(a+=` ${i}--${l===!0?c:`${c}-${l}`}`)});let s=typeof o=="function"?o(n):o;return typeof s=="string"&&(s=s.trim(),s&&(a+=` ${s}`)),a},[e,t,n,o]),Dc="szh-menu-container",Je="szh-menu";const $c="arrow",Pr="item",Nc="divider",Fc="header",zc="group",Vc="submenu";const Ts=lt(),Rr=lt({}),uo=lt({}),Lr=lt({}),Hc=lt({}),yo=lt({}),$e=Object.freeze({ENTER:"Enter",ESC:"Escape",SPACE:" ",HOME:"Home",END:"End",LEFT:"ArrowLeft",RIGHT:"ArrowRight",UP:"ArrowUp",DOWN:"ArrowDown"}),we=Object.freeze({RESET:0,SET:1,UNSET:2,INCREASE:3,DECREASE:4,FIRST:5,LAST:6,SET_INDEX:7}),Sn=Object.freeze({CLICK:"click",CANCEL:"cancel",BLUR:"blur",SCROLL:"scroll"}),jt=Object.freeze({FIRST:"first",LAST:"last"}),Bc=Object.freeze({entering:"opening",entered:"open",exiting:"closing",exited:"closed"}),Mo="absolute",kn="none",Mr="menuitem";const Uc=({className:e,containerRef:t,containerProps:n,children:o,isOpen:i,theming:a,transition:s,onClose:c})=>{const l=xn(s,"item");return r("div",{...Jt({onKeyDown:({key:d})=>{switch(d){case $e.ESC:ze(c,{key:d,reason:Sn.CANCEL});break}},onBlur:d=>{i&&!d.currentTarget.contains(d.relatedTarget)&&ze(c,{reason:Sn.BLUR})}},n),className:et({block:Dc,modifiers:se(()=>({theme:a,itemTransition:l}),[a,l]),className:e}),style:{position:"absolute",...n==null?void 0:n.style},ref:t,children:o})},jc=()=>{let e,t=0;return{toggle:n=>{n?t++:t--,t=Math.max(t,0)},on:(n,o,i)=>{t?e||(e=setTimeout(()=>{e=0,o()},n)):i==null||i()},off:()=>{e&&(clearTimeout(e),e=0)}}},Wc=(e,t)=>{const[n,o]=K(),a=D({items:[],hoverIndex:-1,sorted:!1}).current,s=ke((l,u)=>{const{items:f}=a;if(!l)a.items=[];else if(u)f.push(l);else{const d=f.indexOf(l);d>-1&&(f.splice(d,1),l.contains(document.activeElement)&&(t.current.focus(),o()))}a.hoverIndex=-1,a.sorted=!1},[a,t]),c=ke((l,u,f)=>{const{items:d,hoverIndex:h}=a,p=()=>{if(a.sorted)return;const v=e.current.querySelectorAll(".szh-menu__item");d.sort((T,b)=>pi(v,T)-pi(v,b)),a.sorted=!0};let m=-1,_;switch(l){case we.RESET:break;case we.SET:_=u;break;case we.UNSET:_=v=>v===u?void 0:v;break;case we.FIRST:p(),m=0,_=d[m];break;case we.LAST:p(),m=d.length-1,_=d[m];break;case we.SET_INDEX:p(),m=f,_=d[m];break;case we.INCREASE:p(),m=h,m<0&&(m=d.indexOf(u)),m++,m>=d.length&&(m=0),_=d[m];break;case we.DECREASE:p(),m=h,m<0&&(m=d.indexOf(u)),m--,m<0&&(m=d.length-1),_=d[m];break;default:}_||(m=-1),o(_),a.hoverIndex=m},[e,a]);return{hoverItem:n,dispatch:c,updateItems:s}},mi=(e,t)=>Math.round(e)===t?e:t,ws=e=>{const t=e.getBoundingClientRect();return t.width=mi(t.width,e.offsetWidth),t.height=mi(t.height,e.offsetHeight),t},Kc=(e,t,n,o)=>{const i=ws(t.current),a=e.current.getBoundingClientRect(),s=n===window?{left:0,top:0,right:document.documentElement.clientWidth,bottom:window.innerHeight}:n.getBoundingClientRect(),c=Lc(o),l=m=>m+a.left-s.left-c.left,u=m=>m+a.left+i.width-s.right+c.right,f=m=>m+a.top-s.top-c.top,d=m=>m+a.top+i.height-s.bottom+c.bottom;return{menuRect:i,containerRect:a,getLeftOverflow:l,getRightOverflow:u,getTopOverflow:f,getBottomOverflow:d,confineHorizontally:m=>{let _=l(m);if(_<0)m-=_;else{const v=u(m);v>0&&(m-=v,_=l(m),_<0&&(m-=_))}return m},confineVertically:m=>{let _=f(m);if(_<0)m-=_;else{const v=d(m);v>0&&(m-=v,_=f(m),_<0&&(m-=_))}return m}}},Zc=({arrowRef:e,menuY:t,anchorRect:n,containerRect:o,menuRect:i})=>{let a=n.top-o.top-t+n.height/2;const s=e.current.offsetHeight*1.25;return a=Math.max(s,a),a=Math.min(a,i.height-s),a},qc=({anchorRect:e,containerRect:t,menuRect:n,placeLeftorRightY:o,placeLeftX:i,placeRightX:a,getLeftOverflow:s,getRightOverflow:c,confineHorizontally:l,confineVertically:u,arrowRef:f,arrow:d,direction:h,position:p})=>{let m=h,_=o;p!=="initial"&&(_=u(_),p==="anchor"&&(_=Math.min(_,e.bottom-t.top),_=Math.max(_,e.top-t.top-n.height)));let v,T,b;return m==="left"?(v=i,p!=="initial"&&(T=s(v),T<0&&(b=c(a),(b<=0||-T>b)&&(v=a,m="right")))):(v=a,p!=="initial"&&(b=c(v),b>0&&(T=s(i),(T>=0||-T{let a=n.left-o.left-t+n.width/2;const s=e.current.offsetWidth*1.25;return a=Math.max(s,a),a=Math.min(a,i.width-s),a},Yc=({anchorRect:e,containerRect:t,menuRect:n,placeToporBottomX:o,placeTopY:i,placeBottomY:a,getTopOverflow:s,getBottomOverflow:c,confineHorizontally:l,confineVertically:u,arrowRef:f,arrow:d,direction:h,position:p})=>{let m=h==="top"?"top":"bottom",_=o;p!=="initial"&&(_=l(_),p==="anchor"&&(_=Math.min(_,e.right-t.left),_=Math.max(_,e.left-t.left-n.width)));let v,T,b;return m==="top"?(v=i,p!=="initial"&&(T=s(v),T<0&&(b=c(a),(b<=0||-T>b)&&(v=a,m="bottom")))):(v=a,p!=="initial"&&(b=c(v),b>0&&(T=s(i),(T>=0||-T{const{menuRect:u,containerRect:f}=l,d=n==="left"||n==="right";let h=d?o:i,p=d?i:o;if(e){const g=c.current;d?h+=g.offsetWidth:p+=g.offsetHeight}const m=s.left-f.left-u.width-h,_=s.right-f.left+h,v=s.top-f.top-u.height-p,T=s.bottom-f.top+p;let b,w;t==="end"?(b=s.right-f.left-u.width,w=s.bottom-f.top-u.height):t==="center"?(b=s.left-f.left-(u.width-s.width)/2,w=s.top-f.top-(u.height-s.height)/2):(b=s.left-f.left,w=s.top-f.top),b+=h,w+=p;const I={...l,anchorRect:s,placeLeftX:m,placeRightX:_,placeLeftorRightY:w,placeTopY:v,placeBottomY:T,placeToporBottomX:b,arrowRef:c,arrow:e,direction:n,position:a};switch(n){case"left":case"right":return qc(I);case"top":case"bottom":default:return Yc(I)}},Wt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Rt:J;function gi(e,t){typeof e=="function"?e(t):e.current=t}const en=(e,t)=>se(()=>e?t?n=>{gi(e,n),gi(t,n)}:e:t,[e,t]),vi=-9999,Es=({ariaLabel:e,menuClassName:t,menuStyle:n,arrow:o,arrowProps:i={},anchorPoint:a,anchorRef:s,containerRef:c,containerProps:l,focusProps:u,externalRef:f,parentScrollingRef:d,align:h="start",direction:p="bottom",position:m="auto",overflow:_="visible",setDownOverflow:v,repositionFlag:T,captureFocus:b=!0,state:w,endTransition:I,isDisabled:g,menuItemFocus:x,gap:E=0,shift:A=0,children:M,onClose:R,...S})=>{const[C,N]=K({x:vi,y:vi}),[q,B]=K({}),[X,ae]=K(),[ie,ee]=K(p),[Q]=K(jc),[me,he]=cs(ne=>ne+1,1),{transition:z,boundingBoxRef:ce,boundingBoxPadding:le,rootMenuRef:Me,rootAnchorRef:ge,scrollNodesRef:Ve,reposition:Ae,viewScroll:ye,submenuCloseDelay:He}=Ne(yo),{submenuCtx:Ce,reposSubmenu:F=T}=Ne(uo),Y=D(null),Ze=D(),nt=D(),re=D(!1),{hoverItem:H,dispatch:Z,updateItems:te}=Wc(Y,Ze),oe=Cr(w),ue=xn(z,"open"),Fe=xn(z,"close"),W=Ve.current,We=ne=>{switch(ne.key){case $e.HOME:Z(we.FIRST);break;case $e.END:Z(we.LAST);break;case $e.UP:Z(we.DECREASE,H);break;case $e.DOWN:Z(we.INCREASE,H);break;case $e.SPACE:ne.target&&ne.target.className.indexOf(Je)!==-1&&ne.preventDefault();return;default:return}ne.preventDefault(),ne.stopPropagation()},Ln=()=>{w==="closing"&&ae(),ze(I)},pe=ne=>{ne.stopPropagation(),Q.on(He,()=>{Z(we.RESET),Ze.current.focus()})},be=ne=>{ne.target===ne.currentTarget&&Q.off()},Se=ke(ne=>{var _e;const Pe=s?(_e=s.current)==null?void 0:_e.getBoundingClientRect():a?{left:a.x,right:a.x,top:a.y,bottom:a.y,width:0,height:0}:null;if(!Pe)return;W.menu||(W.menu=(ce?ce.current:Lo(Me.current))||window);const Te=Kc(c,Y,W.menu,le);let{arrowX:xe,arrowY:ht,x:Ot,y:Et,computedDirection:Mn}=Xc({arrow:o,align:h,direction:p,gap:E,shift:A,position:m,anchorRect:Pe,arrowRef:nt,positionHelpers:Te});const{menuRect:Ge}=Te,on=Ge.height;if(!ne&&_!=="visible"){const{getTopOverflow:Ke,getBottomOverflow:xt}=Te;let St,rn;const fe=xt(Et);if(fe>0)St=on-fe,rn=fe;else{const pt=Ke(Et);pt<0&&(St=on+pt,rn=0-pt,St>=0&&(Et-=pt))}St>=0&&ae({height:St,overflowAmt:rn})}o&&B({x:xe,y:ht}),N({x:Ot,y:Et}),ee(Mn)},[o,h,le,p,E,A,m,_,a,s,c,ce,Me,W]);Wt(()=>{oe&&(Se(),re.current&&he()),re.current=oe},[oe,Se,F]),Wt(()=>{X&&!v&&(Y.current.scrollTop=0)},[X,v]),Wt(()=>te,[te]),J(()=>{let{menu:ne}=W;if(!oe||!ne)return;if(ne=ne.addEventListener?ne:window,!W.anchors){W.anchors=[];let xe=Lo(ge&&ge.current);for(;xe&&xe!==ne;)W.anchors.push(xe),xe=Lo(xe)}let _e=ye;if(W.anchors.length&&_e==="initial"&&(_e="auto"),_e==="initial")return;const Pe=()=>{_e==="auto"?cr(()=>Se(!0)):ze(R,{reason:Sn.SCROLL})},Te=W.anchors.concat(ye!=="initial"?ne:[]);return Te.forEach(xe=>xe.addEventListener("scroll",Pe)),()=>Te.forEach(xe=>xe.removeEventListener("scroll",Pe))},[ge,W,oe,R,ye,Se]);const Oe=!!X&&X.overflowAmt>0;J(()=>{if(Oe||!oe||!d)return;const ne=()=>cr(Se),_e=d.current;return _e.addEventListener("scroll",ne),()=>_e.removeEventListener("scroll",ne)},[oe,Oe,d,Se]),J(()=>{if(!oe||typeof ResizeObserver!="function"||Ae==="initial")return;const ne=[],_e=new ResizeObserver(xe=>xe.forEach(({target:ht})=>{ne.indexOf(ht)<0?ne.push(ht):Ba(()=>{Se(),he()})})),Pe={box:"border-box"};_e.observe(Y.current,Pe);const Te=s==null?void 0:s.current;return Te&&_e.observe(Te,Pe),()=>_e.disconnect()},[oe,Ae,s,Se]),J(()=>{if(!oe){Z(we.RESET),Fe||ae();return}const{position:ne,alwaysUpdate:_e}=x||{},Pe=()=>{ne===jt.FIRST?Z(we.FIRST):ne===jt.LAST?Z(we.LAST):ne>=-1&&Z(we.SET_INDEX,void 0,ne)};if(_e)Pe();else if(b){const Te=setTimeout(()=>{const xe=Y.current;xe&&!xe.contains(document.activeElement)&&(Ze.current.focus(),Pe())},ue?170:100);return()=>clearTimeout(Te)}},[oe,ue,Fe,b,x,Z]);const dt=se(()=>({isParentOpen:oe,submenuCtx:Q,dispatch:Z,updateItems:te}),[oe,Q,Z,te]);let Mt,ft;X&&(v?ft=X.overflowAmt:Mt=X.height);const tn=se(()=>({reposSubmenu:me,submenuCtx:Q,overflow:_,overflowAmt:ft,parentMenuRef:Y,parentDir:ie}),[me,Q,_,ft,ie]),To=Mt>=0?{maxHeight:Mt,overflow:_}:void 0,ve=se(()=>({state:w,align:h,dir:ie}),[w,h,ie]),nn=se(()=>({dir:ie}),[ie]),wt=et({block:Je,element:$c,modifiers:nn,className:i.className}),qe=r("ul",{role:"menu","aria-label":e,..._o(g),...Jt({onPointerEnter:Ce==null?void 0:Ce.off,onPointerMove:pe,onPointerLeave:be,onKeyDown:We,onAnimationEnd:Ln},S),ref:en(f,Y),className:et({block:Je,modifiers:ve,className:t}),style:{...n,...To,margin:0,display:w==="closed"?"none":void 0,position:Mo,left:C.x,top:C.y},children:[r("li",{tabIndex:-1,role:kn,style:{position:Mo,left:0,top:0,display:"block",outline:"none"},ref:Ze,...u}),o&&r("li",{role:kn,...i,className:wt,style:{display:"block",position:Mo,left:q.x,top:q.y,...i.style},ref:nt}),r(uo.Provider,{value:tn,children:r(Rr.Provider,{value:dt,children:r(Ts.Provider,{value:H,children:ze(M,ve)})})})]});return l?r(Uc,{...l,isOpen:oe,children:qe}):qe},xs=bt(function({"aria-label":t,className:n,containerProps:o,initialMounted:i,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:u,reposition:f="auto",submenuOpenDelay:d=300,submenuCloseDelay:h=150,viewScroll:p="initial",portal:m,theming:_,onItemClick:v,...T},b){const w=D(null),I=D({}),{anchorRef:g,state:x,onClose:E}=T,A=se(()=>({initialMounted:i,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:u,rootMenuRef:w,rootAnchorRef:g,scrollNodesRef:I,reposition:f,viewScroll:p,submenuOpenDelay:d,submenuCloseDelay:h}),[i,a,s,c,g,l,u,f,p,d,h]),M=se(()=>({handleClick(S,C){S.stopPropagation||ze(v,S);let N=S.keepOpen;N===void 0&&(N=C&&S.key===$e.SPACE),N||ze(E,{value:S.value,key:S.key,reason:Sn.CLICK})},handleClose(S){ze(E,{key:S,reason:Sn.CLICK})}}),[v,E]);if(!x)return null;const R=r(yo.Provider,{value:A,children:r(Lr.Provider,{value:M,children:r(Es,{...T,ariaLabel:t||"Menu",externalRef:b,containerRef:w,containerProps:{className:n,containerRef:w,containerProps:o,theming:_,transition:s,onClose:E}})})});return m===!0&&typeof document<"u"?co(R,document.body):m?m.target?co(R,m.target):m.stablePosition?null:R:R}),lr=0,ur=1,fo=2,ho=3,po=4,Qc=5,Ss=6,Jc=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],ks=e=>({_s:e,status:Jc[e],isEnter:epo}),dr=e=>e?Ss:Qc,el=(e,t)=>{switch(e){case ur:case lr:return fo;case po:case ho:return dr(t)}},tl=e=>typeof e=="object"?[e.enter,e.exit]:[e,e],nl=(e,t)=>setTimeout(()=>{isNaN(document.body.offsetTop)||e(t+1)},0),_i=(e,t,n,o,i)=>{clearTimeout(o.current);const a=ks(e);t(a),n.current=a,i&&i({current:a})},ol=({enter:e=!0,exit:t=!0,preEnter:n,preExit:o,timeout:i,initialEntered:a,mountOnEnter:s,unmountOnExit:c,onStateChange:l}={})=>{const[u,f]=K(()=>ks(a?fo:dr(s))),d=D(u),h=D(),[p,m]=tl(i),_=ke(()=>{const T=el(d.current._s,c);T&&_i(T,f,d,h,l)},[l,c]),v=ke(T=>{const b=I=>{switch(_i(I,f,d,h,l),I){case ur:p>=0&&(h.current=setTimeout(_,p));break;case po:m>=0&&(h.current=setTimeout(_,m));break;case lr:case ho:h.current=nl(b,I);break}},w=d.current.isEnter;typeof T!="boolean"&&(T=!w),T?!w&&b(e?n?lr:ur:fo):w&&b(t?o?ho:po:dr(c))},[_,l,e,t,n,o,p,m,c]);return J(()=>()=>clearTimeout(h.current),[]),[u,v,_]};const rl=({initialOpen:e,initialMounted:t,unmountOnClose:n,transition:o,transitionTimeout:i=500}={})=>{const[{status:a},s,c]=ol({initialEntered:e,mountOnEnter:!t,unmountOnExit:n,timeout:i,enter:xn(o,"open"),exit:xn(o,"close")});return[{state:Bc[a],endTransition:c},s]},Is=e=>{const[t,n]=rl(e),[o,i]=K(),a=(s,c)=>{i({position:s,alwaysUpdate:c}),n(!0)};return[{menuItemFocus:o,...t},n,a]},il=(e,t)=>{const[n]=K({});return{onMouseDown:()=>{n.v=e&&e!=="closed"},onClick:o=>n.v?n.v=!1:t(!0,o)}},As=(e,t)=>{const n=D(t);J(()=>{n.current!==t&&ze(e,{open:t}),n.current=t},[e,t])},sl=bt(function({"aria-label":t,captureFocus:n,initialOpen:o,menuButton:i,instanceRef:a,onMenuChange:s,...c},l){const[u,f,d]=Is(c),{state:h}=u,p=Cr(h),m=D(null),_=il(h,(g,x)=>d(x.detail?void 0:jt.FIRST)),v=ke(g=>{f(!1),g.key&&m.current.focus()},[f]),T=g=>{switch(g.key){case $e.UP:d(jt.LAST);break;case $e.DOWN:d(jt.FIRST);break;default:return}g.preventDefault()},b=ze(i,{open:p});if(!b||!b.type)throw new Error("Menu requires a menuButton prop.");const w={ref:en(b.ref,m),...Jt({onKeyDown:T,..._},b.props)};Rc(b.type)==="MenuButton"&&(w.isOpen=p);const I=ls(b,w);return As(s,p),us(a,()=>({openMenu:d,closeMenu:()=>f(!1)})),r($,{children:[I,r(xs,{...c,...u,"aria-label":t||(typeof b.props.children=="string"?b.props.children:"Menu"),anchorRef:m,ref:l,onClose:v})]})}),Or=(e,t)=>{const n=Qt(t),o=bt((i,a)=>{const s=D(null);return r(n,{...i,itemRef:s,externalRef:a,isHovering:Ne(Ts)===s.current})});return o.displayName=`WithHovering(${e})`,o},Cs=(e,t,n)=>{Wt(()=>{if(e)return;const o=t.current;return n(o,!0),()=>{n(o)}},[e,t,n])},al=Or("SubMenu",function({"aria-label":t,className:n,disabled:o,direction:i,label:a,openTrigger:s,onMenuChange:c,isHovering:l,instanceRef:u,itemRef:f,captureFocus:d,repositionFlag:h,itemProps:p={},...m}){const _=Ne(yo),{rootMenuRef:v,submenuOpenDelay:T,submenuCloseDelay:b}=_,{parentMenuRef:w,parentDir:I,overflow:g}=Ne(uo),{isParentOpen:x,submenuCtx:E,dispatch:A,updateItems:M}=Ne(Rr),R=g!=="visible",[S,C,N]=Is(_),{state:q}=S,B=!!o,X=Cr(q),ae=D(null),[ie]=K({v:0}),ee=()=>{E.off(),ie.v&&(clearTimeout(ie.v),ie.v=0)},Q=(...F)=>{ee(),me(),!B&&N(...F)},me=()=>!l&&!B&&A(we.SET,f.current),he=F=>{me(),s||(ie.v=setTimeout(()=>cr(Q),Math.max(F,0)))},z=F=>{B||(F.stopPropagation(),!(ie.v||X)&&E.on(b,()=>he(T-b),()=>he(T)))},ce=()=>{ee(),X||A(we.UNSET,f.current)},le=F=>{if(l)switch(F.key){case $e.ENTER:F.preventDefault();case $e.SPACE:case $e.RIGHT:s!=="none"&&Q(jt.FIRST)}},Me=F=>{let Y=!1;switch(F.key){case $e.LEFT:X&&(f.current.focus(),C(!1),Y=!0);break;case $e.RIGHT:X||(Y=!0);break}Y&&(F.preventDefault(),F.stopPropagation())};Cs(B,f,M),As(c,X),J(()=>E.toggle(X),[E,X]),J(()=>()=>clearTimeout(ie.v),[ie]),J(()=>{l&&x?f.current.focus():C(!1)},[l,x,C,f]),us(u,()=>({openMenu:(...F)=>{x&&Q(...F)},closeMenu:()=>{X&&(f.current.focus(),C(!1))}}));const ge=se(()=>({open:X,hover:l,disabled:B,submenu:!0}),[X,l,B]),{ref:Ve,className:Ae,...ye}=p,He=Jt({onPointerEnter:E.off,onPointerMove:z,onPointerLeave:ce,onKeyDown:le,onClick:()=>s!=="none"&&Q()},ye),Ce=()=>{const F=r(Es,{...m,...S,ariaLabel:t||(typeof a=="string"?a:"Submenu"),anchorRef:f,containerRef:R?v:ae,direction:i||(I==="right"||I==="left"?I:"right"),parentScrollingRef:R&&w,isDisabled:B}),Y=v.current;return R&&Y?co(F,Y):F};return r("li",{className:et({block:Je,element:Vc,className:n}),style:{position:"relative"},role:kn,ref:ae,onKeyDown:Me,children:[r("div",{role:Mr,"aria-haspopup":!0,"aria-expanded":X,..._o(B,l),...He,ref:en(Ve,f),className:et({block:Je,element:Pr,modifiers:ge,className:Ae}),children:se(()=>ze(a,ge),[a,ge])}),q&&Ce()]})}),Ps=(e,t,n,o)=>{const{submenuCloseDelay:i}=Ne(yo),{isParentOpen:a,submenuCtx:s,dispatch:c,updateItems:l}=Ne(Rr),u=()=>{!n&&!o&&c(we.SET,e.current)},f=()=>{!o&&c(we.UNSET,e.current)},d=m=>{n&&!m.currentTarget.contains(m.relatedTarget)&&f()},h=m=>{o||(m.stopPropagation(),s.on(i,u,u))},p=(m,_)=>{s.off(),!_&&f()};return Cs(o,e,l),J(()=>{n&&a&&t.current&&t.current.focus()},[t,n,a]),{setHover:u,onBlur:d,onPointerMove:h,onPointerLeave:p}},Ee=Or("MenuItem",function({className:t,value:n,href:o,type:i,checked:a,disabled:s,children:c,onClick:l,isHovering:u,itemRef:f,externalRef:d,...h}){const p=!!s,{setHover:m,..._}=Ps(f,f,u,p),v=Ne(Lr),T=Ne(Hc),b=i==="radio",w=i==="checkbox",I=!!o&&!p&&!b&&!w,g=b?T.value===n:w?!!a:!1,x=S=>{if(p){S.stopPropagation(),S.preventDefault();return}const C={value:n,syntheticEvent:S};S.key!==void 0&&(C.key=S.key),w&&(C.checked=!g),b&&(C.name=T.name),ze(l,C),b&&ze(T.onRadioChange,C),v.handleClick(C,w||b)},E=S=>{if(u)switch(S.key){case $e.ENTER:S.preventDefault();case $e.SPACE:I?f.current.click():x(S)}},A=se(()=>({type:i,disabled:p,hover:u,checked:g,anchor:I}),[i,p,u,g,I]),M=Jt({..._,onPointerDown:m,onKeyDown:E,onClick:x},h),R={role:b?"menuitemradio":w?"menuitemcheckbox":Mr,"aria-checked":b||w?g:void 0,..._o(p,u),...M,ref:en(d,f),className:et({block:Je,element:Pr,modifiers:A,className:t}),children:se(()=>ze(c,A),[c,A])};return I?r("li",{role:kn,children:r("a",{href:o,...R})}):r("li",{...R})}),cl=Or("FocusableItem",function({className:t,disabled:n,children:o,isHovering:i,itemRef:a,externalRef:s,...c}){const l=!!n,u=D(null),{setHover:f,onPointerLeave:d,...h}=Ps(a,u,i,l),{handleClose:p}=Ne(Lr),m=se(()=>({disabled:l,hover:i,focusable:!0}),[l,i]),_=se(()=>ze(o,{...m,ref:u,closeMenu:p}),[o,m,p]),v=Jt({...h,onPointerLeave:T=>d(T,!0),onFocus:f},c);return r("li",{role:Mr,..._o(l),...v,ref:en(s,a),className:et({block:Je,element:Pr,modifiers:m,className:t}),children:_})}),un=Qt(bt(function({className:t,...n},o){return r("li",{role:"separator",...n,ref:o,className:et({block:Je,element:Nc,className:t})})})),sh=Qt(bt(function({className:t,...n},o){return r("li",{role:kn,...n,ref:o,className:et({block:Je,element:Fc,className:t})})})),ah=bt(function({className:t,style:n,takeOverflow:o,...i},a){const s=D(null),[c,l]=K(),{overflow:u,overflowAmt:f}=Ne(uo);return Wt(()=>{let d;o&&f>=0&&(d=ws(s.current).height-f,d<0&&(d=0)),l(d>=0?{maxHeight:d,overflow:u}:void 0)},[o,u,f]),Wt(()=>{c&&(s.current.scrollTop=0)},[c]),r("div",{...i,ref:en(a,s),className:et({block:Je,element:zc,className:t}),style:{...n,...c}})});const yi={s:16,m:20,l:24,xl:32,xxl:50,xxxl:64},dn={},mn=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),ro=mn.getContext("2d",{willReadFrequently:!0});ro.imageSmoothingEnabled=!1;const ll=/missing\.png$/;function ul({url:e,size:t,alt:n="",squircle:o,...i}){t=yi[t]||t||yi.m;const a=D(),s=ll.test(e);return r("span",{ref:a,class:`avatar ${o?"squircle":""} ${dn[e]?"has-alpha":""}`,style:{width:t,height:t},title:n,...i,children:!!e&&r("img",{src:e,width:t,height:t,alt:n,loading:"lazy",decoding:"async",fetchPriority:"low",crossOrigin:dn[e]===void 0&&!s?"anonymous":void 0,onError:c=>{c.target.crossOrigin&&(c.target.crossOrigin=null,c.target.src=e)},onLoad:c=>{a.current&&(a.current.dataset.loaded=!0),dn[e]===void 0&&(s||setTimeout(()=>{try{const{width:l,height:u}=c.target;mn.width!==l&&(mn.width=l),mn.height!==u&&(mn.height=u),ro.drawImage(c.target,0,0);const f=ro.getImageData(0,0,l,u),d=f.data.filter((h,p)=>p%4===3&&h<=128).length/(f.data.length/4)>.1;d&&a.current.classList.add("has-alpha"),dn[e]=d,ro.clearRect(0,0,l,u)}catch{dn[e]=!1}},1))}})})}const st=Le(ul),Zt=bt((e,t)=>{var c;let n;try{n=Ua()}catch{}let o=(location.hash||"").replace(/^#/,"").trim();o===""&&(o="/");const{to:i,...a}=e;if(o&&o!=="/"&&o.includes("?")){const l=URL.parse(o,location.origin);if((c=l==null?void 0:l.searchParams)!=null&&c.size){const u=Array.from(l.searchParams.entries()).map(([f,d])=>`${f}=${encodeURIComponent(d)}`).join("&");o=l.pathname+"?"+u}}const s=o===i||decodeURIComponent(o)===i;return r("a",{ref:t,href:`#${i}`,...a,class:`${e.class||""} ${s?"is-active":""}`,onClick:l=>{var u,f,d;(f=(u=l.currentTarget)==null?void 0:u.parentNode)!=null&&f.closest("a")&&l.stopPropagation(),n&&(V.prevLocation=n),(d=e.onClick)==null||d.call(e,l)}})});let fr=!1;const dl=new MutationObserver(e=>{e.forEach(t=>{if(t.type==="attributes"){const{dir:n}=t.target;n==="rtl"?fr=!0:fr=!1}})});dl.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});function hr(){return fr}const fl=document.documentElement,Wn=getComputedStyle(fl),hl=8;let Rs=[0,0,0,0];function Ls(){const e=Wn.getPropertyValue("--sai-top"),t=Wn.getPropertyValue("--sai-right"),n=Wn.getPropertyValue("--sai-bottom"),o=Wn.getPropertyValue("--sai-left");Rs=[Math.max(0,parseInt(e,10)),Math.max(0,parseInt(t,10)),Math.max(0,parseInt(n,10)),Math.max(0,parseInt(o,10))]}requestAnimationFrame(Ls);function Ms(e=[]){return Rs.map((n,o)=>(n||hl)+(e[o]||0)).join(" ")}CSS.supports("top: env(safe-area-inset-top)")&&window.addEventListener("resize",Ls,{passive:!0});function pl(){const[e,t]=K({width:null,height:null});return Rt(()=>{const n=()=>{t({width:window.innerWidth,height:window.innerHeight})};return n(),window.addEventListener("resize",n,{passive:!0}),()=>{window.removeEventListener("resize",n)}},[]),e}function Os(e){const{containerProps:t,instanceRef:n,align:o}=e,i=pl(),a=n!=null&&n.current?n:D(),s=hr()?o==="end"?"start":o==="start"?"end":o:o;return r(sl,{boundingBoxPadding:Ms(),repositionFlag:`${i.width}x${i.height}`,unmountOnClose:!0,...e,align:s,instanceRef:a,containerProps:{onClick:c=>{var l,u,f;c.target===c.currentTarget&&((u=(l=a.current)==null?void 0:l.closeMenu)==null||u.call(l)),(f=t==null?void 0:t.onClick)==null||f.call(t,c)},...t}})}function ml(e){const t=D();return r(al,{...e,instanceRef:t,itemProps:{onPointerMove:n=>{var o,i;n.pointerType==="touch"&&((i=(o=t.current)==null?void 0:o.openMenu)==null||i.call(o))},onPointerLeave:n=>{var o,i;n.pointerType==="touch"&&((i=(o=t.current)==null?void 0:o.openMenu)==null||i.call(o))},...e.itemProps}})}function Oo({subMenu:e=!1,confirm:t=!0,confirmLabel:n,menuItemClassName:o,menuFooter:i,menuExtras:a,...s}){const{children:c,onClick:l,...u}=s;return t?r(e?ml:Os,{openTrigger:"clickOnly",direction:"bottom",overflow:"auto",gap:-8,shift:8,menuClassName:"menu-emphasized",...u,menuButton:e?void 0:c,label:e?c:void 0,children:[r(Ee,{className:o,onClick:l,children:n}),a,i]}):e?r(Ee,{...s}):l?ja(c,{onClick:l}):c}function bi(e){const{className:t,disabled:n,...o}=e;return r(cl,{className:t,disabled:n,children:({ref:i,closeMenu:a})=>r(Zt,{...o,ref:i,onClick:({detail:s})=>a(s===0?"Enter":void 0)})})}function pr({staticUrl:e,alt:t,url:n}){return r("picture",{children:[e&&r("source",{srcset:e,media:"(prefers-reduced-motion: reduce)"}),r("img",{src:n,alt:t,class:"shortcode-emoji emoji",width:"16",height:"16",loading:"lazy",decoding:"async",fetchPriority:"low"},t||n)]})}const gl=Le(e=>new RegExp(`:(${e.join("|")}):`,"g"));function vl({text:e,emojis:t}){if(!e)return"";if(!(t!=null&&t.length)||e.indexOf(":")===-1)return e;const n=gl(t.map(i=>i.shortcode));return e.split(n).map((i,a)=>{const s=t.find(c=>c.shortcode===i);if(s){const{url:c,staticUrl:l}=s;return r(pr,{staticUrl:l,alt:i,url:c},i+"-"+a)}return i})}const qt=Le(vl),_l=Le(e=>{const t={sensitivity:"base"};try{return new Intl.Collator(e||void 0,t)}catch{return new Intl.Collator(void 0,t)}}),yl=/([^@]+)(@.+)/i,bl=/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/g,Tl=/\s+/g,wl=/[^a-z0-9@\.]/gi;function El({account:e,instance:t,showAvatar:n,showAcct:o,short:i,external:a,onClick:s}){const{i18n:c}=tt(),{acct:l,avatar:u,avatarStatic:f,id:d,url:h,displayName:p,emojis:m,bot:_,username:v}=e,[T,b,w]=l.match(yl)||[,l];t||(t=lo().instance);const I=v.toLowerCase().trim(),g=(p||"").toLowerCase().trim(),x=g.replace(bl,"").replace(Tl,""),E=x.replace(wl,""),A=!i&&(I===g||I===x||I===E||_l(c.locale).compare(I,x)===0)||E===l.toLowerCase();return r("a",{class:`name-text ${o?"show-acct":""} ${i?"short":""}`,href:h,target:a?"_blank":null,title:p?`${p} (${w?"":"@"}${l})`:`${w?"":"@"}${l}`,onClick:M=>{if(!a&&!M.shiftKey){if(M.preventDefault(),M.stopPropagation(),s)return s(M);if(M.metaKey||M.ctrlKey||M.shiftKey||M.which===2){const R=`#/${t}/a/${d}`;window.open(R,"_blank");return}V.showAccount={account:e,instance:t}}},children:[n&&r($,{children:[r(st,{url:f||u,squircle:_})," "]}),p&&!i?r($,{children:[r("b",{dir:"auto",children:r(qt,{text:p,emojis:m})}),!o&&!A&&r($,{children:[" ",r("i",{class:"bidi-isolate",children:["@",v]})]})]}):i?r("i",{children:v}):r("b",{children:v}),o&&r($,{children:[r("br",{}),r("i",{class:"bidi-isolate",children:[w?"":"@",b,!!w&&r("span",{class:"ib",children:w})]})]})]})}const yt=Le(El),Kn={"zh-YUE":"YUE",zh_HANT:"zh-Hant"},Do=Le(e=>new Intl.DisplayNames(e||void 0,{type:"language"}));function xl(e){let t,n;typeof e=="object"&&({code:e,locale:t,fallback:n}=e);try{const o=Do(t||Ie.locale).of(e);if(o!==e)return o;if(!n){const i=Do(e).of(e);if(i!==e)return i}return n||""}catch{if(Kn[e])try{const i=Do(Kn[t]||t||Ie.locale).of(Kn[e]);return i!==Kn[e]?i:n||""}catch{}return n||""}}const fn=Le(xl);function Ti(e){if(e instanceof Date)return!isNaN(e.getTime());{const t=new Date(e);return!isNaN(t.getTime())}}const Sl=Le(()=>new Intl.DateTimeFormat().resolvedOptions().locale),wi=Le((e,t={})=>{const n=e.replace(/-[a-z]+$/i,""),o=En([n],[Sl()],e);try{return new Intl.DateTimeFormat(o,t)}catch{}try{return new Intl.DateTimeFormat(e,t)}catch{}return new Intl.DateTimeFormat(void 0,t)}),kl=Le(e=>new Intl.RelativeTimeFormat(e||void 0)),Gt=60,Yt=60*Gt,mr=24*Yt,Il=e=>{const t=kl(Ie.locale),n=(e.getTime()-Date.now())/1e3,o=Math.abs(n);return o{const t=(Date.now()-e.getTime())/1e3;return tl+1,0),i=se(()=>new Date(e),[e]),[a,s,c]=se(()=>{if(!Ti(i))return[""+e,"",""];let l;if(t==="micro"){const u=new Date;(u.getTime()-i.getTime())/1e3/mr<=1?l=Al(i):u.getFullYear()===i.getFullYear()?l=wi(Ie.locale,{year:void 0,month:"short",day:"numeric"}).format(i):l=wi(Ie.locale,{dateStyle:"short"}).format(i)}return l||(l=Il(i)),[l,i.toISOString(),i.toLocaleString()]},[i,t,n]);return J(()=>{if(!Ti(i))return;let l,u;function f(){u=requestAnimationFrame(()=>{o(),d()})}function d(){const h=(Date.now()-i.getTime())/1e3;h{clearTimeout(l),cancelAnimationFrame(u)}},[]),r("time",{datetime:s,title:c,children:a})}const Cl=[{code:"af",name:"Afrikaans"},{code:"sq",name:"Albanian"},{code:"am",name:"Amharic"},{code:"ar",name:"Arabic"},{code:"hy",name:"Armenian"},{code:"as",name:"Assamese"},{code:"ay",name:"Aymara"},{code:"az",name:"Azerbaijani"},{code:"bm",name:"Bambara"},{code:"eu",name:"Basque"},{code:"be",name:"Belarusian"},{code:"bn",name:"Bengali"},{code:"bho",name:"Bhojpuri"},{code:"bs",name:"Bosnian"},{code:"bg",name:"Bulgarian"},{code:"ca",name:"Catalan"},{code:"ceb",name:"Cebuano"},{code:"ny",name:"Chichewa"},{code:"zh",name:"Chinese"},{code:"zh_HANT",name:"Chinese (Traditional)"},{code:"co",name:"Corsican"},{code:"hr",name:"Croatian"},{code:"cs",name:"Czech"},{code:"da",name:"Danish"},{code:"dv",name:"Dhivehi"},{code:"doi",name:"Dogri"},{code:"nl",name:"Dutch"},{code:"en",name:"English"},{code:"eo",name:"Esperanto"},{code:"et",name:"Estonian"},{code:"ee",name:"Ewe"},{code:"tl",name:"Filipino"},{code:"fi",name:"Finnish"},{code:"fr",name:"French"},{code:"fy",name:"Frisian"},{code:"gl",name:"Galician"},{code:"ka",name:"Georgian"},{code:"de",name:"German"},{code:"el",name:"Greek"},{code:"gn",name:"Guarani"},{code:"gu",name:"Gujarati"},{code:"ht",name:"Haitian Creole"},{code:"ha",name:"Hausa"},{code:"haw",name:"Hawaiian"},{code:"iw",name:"Hebrew"},{code:"hi",name:"Hindi"},{code:"hmn",name:"Hmong"},{code:"hu",name:"Hungarian"},{code:"is",name:"Icelandic"},{code:"ig",name:"Igbo"},{code:"ilo",name:"Ilocano"},{code:"id",name:"Indonesian"},{code:"ga",name:"Irish"},{code:"it",name:"Italian"},{code:"ja",name:"Japanese"},{code:"jw",name:"Javanese"},{code:"kn",name:"Kannada"},{code:"kk",name:"Kazakh"},{code:"km",name:"Khmer"},{code:"rw",name:"Kinyarwanda"},{code:"gom",name:"Konkani"},{code:"ko",name:"Korean"},{code:"kri",name:"Krio"},{code:"ku",name:"Kurdish (Kurmanji)"},{code:"ckb",name:"Kurdish (Sorani)"},{code:"ky",name:"Kyrgyz"},{code:"lo",name:"Lao"},{code:"la",name:"Latin"},{code:"lv",name:"Latvian"},{code:"ln",name:"Lingala"},{code:"lt",name:"Lithuanian"},{code:"lg",name:"Luganda"},{code:"lb",name:"Luxembourgish"},{code:"mk",name:"Macedonian"},{code:"mai",name:"Maithili"},{code:"mg",name:"Malagasy"},{code:"ms",name:"Malay"},{code:"ml",name:"Malayalam"},{code:"mt",name:"Maltese"},{code:"mi",name:"Maori"},{code:"mr",name:"Marathi"},{code:"mni-Mtei",name:"Meiteilon (Manipuri)"},{code:"lus",name:"Mizo"},{code:"mn",name:"Mongolian"},{code:"my",name:"Myanmar (Burmese)"},{code:"ne",name:"Nepali"},{code:"no",name:"Norwegian"},{code:"or",name:"Odia (Oriya)"},{code:"om",name:"Oromo"},{code:"ps",name:"Pashto"},{code:"fa",name:"Persian"},{code:"pl",name:"Polish"},{code:"pt",name:"Portuguese"},{code:"pa",name:"Punjabi"},{code:"qu",name:"Quechua"},{code:"ro",name:"Romanian"},{code:"ru",name:"Russian"},{code:"sm",name:"Samoan"},{code:"sa",name:"Sanskrit"},{code:"gd",name:"Scots Gaelic"},{code:"nso",name:"Sepedi"},{code:"sr",name:"Serbian"},{code:"st",name:"Sesotho"},{code:"sn",name:"Shona"},{code:"sd",name:"Sindhi"},{code:"si",name:"Sinhala"},{code:"sk",name:"Slovak"},{code:"sl",name:"Slovenian"},{code:"so",name:"Somali"},{code:"es",name:"Spanish"},{code:"su",name:"Sundanese"},{code:"sw",name:"Swahili"},{code:"sv",name:"Swedish"},{code:"tg",name:"Tajik"},{code:"ta",name:"Tamil"},{code:"tt",name:"Tatar"},{code:"te",name:"Telugu"},{code:"th",name:"Thai"},{code:"ti",name:"Tigrinya"},{code:"ts",name:"Tsonga"},{code:"tr",name:"Turkish"},{code:"tk",name:"Turkmen"},{code:"ak",name:"Twi"},{code:"uk",name:"Ukrainian"},{code:"ur",name:"Urdu"},{code:"ug",name:"Uyghur"},{code:"uz",name:"Uzbek"},{code:"vi",name:"Vietnamese"},{code:"cy",name:"Welsh"},{code:"xh",name:"Xhosa"},{code:"yi",name:"Yiddish"},{code:"yo",name:"Yoruba"},{code:"zu",name:"Zulu"}],Pl=Le(()=>[new Intl.DateTimeFormat().resolvedOptions().locale,...navigator.languages]),Rl=()=>En(Pl(),Cl.map(e=>e.code.replace("_","-")),"en");function Ds(e=!1){if(e){const{contentTranslationTargetLanguage:t}=V.settings;if(t)return t}return Rl()}const Ei=["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"];function ch(e){const t=Math.min(Math.floor(Math.log2(e)/10),Ei.length-1),n=e/1024**t;return Ie.number(n,{style:"unit",unit:Ei[t],unitDisplay:"narrow",maximumFractionDigits:0})}const Ll=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,mo=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Ll);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},xi=e=>e==="*"||e==="x"||e==="X",Si=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Ml=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Ol=(e,t)=>{if(xi(e)||xi(t))return 0;const[n,o]=Ml(Si(e),Si(t));return n>o?1:n{for(let n=0;n{const n=mo(e),o=mo(t),i=n.pop(),a=o.pop(),s=Ut(n,o);return s!==0?s:i&&a?Ut(i.split("."),a.split(".")):i||a?i?-1:1:0},$l=(e,t,n)=>{Nl(n);const o=Dl(e,t);return $s[n].includes(o)},$s={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},ki=Object.keys($s),Nl=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(ki.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${ki.join("|")}`)},io=(e,t)=>{if(t=t.replace(/([><=]+)\s+/g,"$1"),t.includes("||"))return t.split("||").some(v=>io(e,v));if(t.includes(" - ")){const[v,T]=t.split(" - ",2);return io(e,`>=${v} <=${T}`)}else if(t.includes(" "))return t.trim().replace(/\s{2,}/g," ").split(" ").every(v=>io(e,v));const n=t.match(/^([<>=~^]+)/),o=n?n[1]:"=";if(o!=="^"&&o!=="~")return $l(e,t,o);const[i,a,s,,c]=mo(e),[l,u,f,,d]=mo(t),h=[i,a,s],p=[l,u??"x",f??"x"];if(d&&(!c||Ut(h,p)!==0||Ut(c.split("."),d.split("."))===-1))return!1;const m=p.findIndex(v=>v!=="0")+1,_=o==="~"?2:m>1?m:1;return!(Ut(h.slice(0,_),p.slice(0,_))!==0||Ut(h.slice(_),p.slice(_))===-1)};const Fl={"@mastodon/edit-media-attributes":">=4.1","@mastodon/list-exclusive":">=4.2","@gotosocial/list-exclusive":">=0.17","@mastodon/filtered-notifications":"~4.3 || >=4.3","@mastodon/fetch-multiple-statuses":"~4.3 || >=4.3","@mastodon/trending-link-posts":"~4.3 || >=4.3","@mastodon/grouped-notifications":"~4.3 || >=4.3","@mastodon/annual-report":"~4.4 || >=4.4"},$o=/pixelfed/i,ot=/^(?!.*pixelfed).*$/i,zl=/pleroma/i,Vl=/akkoma/i;const Ii={"@mastodon/lists":ot,"@mastodon/filters":ot,"@mastodon/mentions":ot,"@mastodon/trending-hashtags":ot,"@mastodon/trending-links":ot,"@mastodon/post-bookmark":ot,"@mastodon/post-edit":ot,"@mastodon/profile-edit":ot,"@mastodon/profile-private-note":ot,"@pixelfed/trending":$o,"@pixelfed/home-include-reblogs":$o,"@pixelfed/global-feed":$o,"@pleroma/local-visibility-post":zl,"@akkoma/local-visibility-post":Vl},Zn={};function qn(e){var t,n;try{let{version:o,domain:i}=Wa(),a=((n=(t=Ka())==null?void 0:t.software)==null?void 0:n.name)||"mastodon";a==="hometown"&&(a="mastodon");const s=`${i}-${e}`;if(Zn[s])return Zn[s];if(Ii[e])return Zn[s]=Ii[e].test(o);const c=Fl[e];if(!c)return!1;const u=e.match(/^@([a-z]+)\//)[1]===a.toLowerCase();return Zn[s]=u&&io(o,c,{includePrerelease:!0,loose:!0})}catch{return!1}}const Kt=2147483647,Ye=36,Dr=1,In=26,Hl=38,Bl=700,Ns=72,Fs=128,zs="-",Ul=/^xn--/,jl=/[^\0-\x7F]/,Wl=/[\x2E\u3002\uFF0E\uFF61]/g,Kl={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},No=Ye-Dr,Xe=Math.floor,Fo=String.fromCharCode;function gt(e){throw new RangeError(Kl[e])}function Zl(e,t){const n=[];let o=e.length;for(;o--;)n[o]=t(e[o]);return n}function Vs(e,t){const n=e.split("@");let o="";n.length>1&&(o=n[0]+"@",e=n[1]),e=e.replace(Wl,".");const i=e.split("."),a=Zl(i,t).join(".");return o+a}function Hs(e){const t=[];let n=0;const o=e.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...e),Gl=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Ye},Ai=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Bs=function(e,t,n){let o=0;for(e=n?Xe(e/Bl):e>>1,e+=Xe(e/t);e>No*In>>1;o+=Ye)e=Xe(e/No);return Xe(o+(No+1)*e/(e+Hl))},Us=function(e){const t=[],n=e.length;let o=0,i=Fs,a=Ns,s=e.lastIndexOf(zs);s<0&&(s=0);for(let c=0;c=128&>("not-basic"),t.push(e.charCodeAt(c));for(let c=s>0?s+1:0;c=n&>("invalid-input");const h=Gl(e.charCodeAt(c++));h>=Ye&>("invalid-input"),h>Xe((Kt-o)/f)&>("overflow"),o+=h*f;const p=d<=a?Dr:d>=a+In?In:d-a;if(hXe(Kt/m)&>("overflow"),f*=m}const u=t.length+1;a=Bs(o-l,u,l==0),Xe(o/u)>Kt-i&>("overflow"),i+=Xe(o/u),o%=u,t.splice(o++,0,i)}return String.fromCodePoint(...t)},js=function(e){const t=[];e=Hs(e);const n=e.length;let o=Fs,i=0,a=Ns;for(const l of e)l<128&&t.push(Fo(l));const s=t.length;let c=s;for(s&&t.push(zs);c=o&&fXe((Kt-i)/u)&>("overflow"),i+=(l-o)*u,o=l;for(const f of e)if(fKt&>("overflow"),f===o){let d=i;for(let h=Ye;;h+=Ye){const p=h<=a?Dr:h>=a+In?In:h-a;if(d{const{shortcode:o,staticUrl:i,url:a}=n;e=e.replace(new RegExp(`:${o}:`,"g"),`:${o}:`)}),e):""}const Ft=document.createElement("div"),Ql=["u-url","mention","hashtag"],Jl=/[&<>]/g;function zo(e){return e.replace(Jl,t=>({"&":"&","<":"<",">":">"})[t])}const eu=/{}}=t;let a=e;const s=fu(a,o),c=eu.test(a),l=a.includes("```");if(c){const f=s.querySelectorAll('a:not([target="_blank"])');for(const h of f)h.setAttribute("target","_blank");const d=s.querySelectorAll("a[class]");for(const h of d)for(const p of h.classList)Ql.includes(p)||h.classList.remove(p)}if(c){const f=s.querySelectorAll("a[href]");for(const d of f)tu.test(d.textContent.trim())&&(d.classList.add("has-url-text"),vu(d))}if(c){const f=s.querySelectorAll("a[href]"),d=[];for(const h of f){const p=h.innerText.trim(),m=h.querySelector("*");if(nu.test(p)){const[_,v,T]=p.split("@");m||(!d.some(([b])=>b===v)||d.some(([b,w])=>b===v&&w===T)?(h.innerHTML=`@${v}`,d.push([v,T])):h.innerHTML=`@${v}@${T}`),h.classList.add("mention")}ou.test(p)&&(m||(h.innerHTML=`#${p.slice(1)}`),h.classList.add("mention","hashtag"))}}let u;if(a.includes(":")&&(n!=null&&n.length)){u=Ho(s);for(const f of u){let d=zo(f.nodeValue);d=gr(d,n),Ft.innerHTML=d,f.replaceWith(...Ft.childNodes)}}if(l){const f=[...s.querySelectorAll("p")].filter(d=>ru.test(d.innerText.trim()));for(const d of f){const h=document.createElement("pre");for(const p of d.querySelectorAll("br"))p.replaceWith(` +`);h.innerHTML=`${d.innerHTML.trim()}`,d.replaceWith(h)}}if(l){const d=[...s.querySelectorAll("p")].filter(h=>iu.test(h.innerText));for(const h of d){const p=[h];let m=!1,_=h;for(;_.nextElementSibling;){const v=_.nextElementSibling;if(v&&v.tagName==="P")if(su.test(v.innerText)){p.push(v),m=!0;break}else p.push(v);else break;_=v}if(m){const v=document.createElement("pre");for(const b of p)for(const w of b.querySelectorAll("br"))w.replaceWith(` +`);const T=p.map(b=>b.innerHTML).join(` + +`);v.innerHTML=`${T}`,h.replaceWith(v);for(const b of p)b.remove()}}}if(a.includes("`")){u=Ho(s);for(const f of u){let d=zo(f.nodeValue);au.test(d)&&(d=d.replaceAll(du,"$1")),Ft.innerHTML=d,f.replaceWith(...Ft.childNodes)}}if(cu.test(a)){u=Ho(s,{rejectFilter:["A"]});for(const f of u){let d=zo(f.nodeValue);lu.test(d)&&(d=d.replaceAll(uu,'$1')),Ft.innerHTML=d,f.replaceWith(...Ft.childNodes)}}if(a.includes("#")){let f=null;const d=[...s.querySelectorAll("p")].filter((h,p)=>{let m=0;for(let _=0;_3||m>1&&f&&p===f+1)return f=p,!0});if(d!=null&&d.length)for(const h of d)h.classList.add("hashtag-stuffing"),h.title=h.innerText}if(a.includes("i(s)),o?s:s.innerHTML}const Ks=Le(hu),pu=["STYLE","IMG","VIDEO","AUDIO","AREA","MAP","TRACK","EMBED","IFRAME","OBJECT","PICTURE","PORTAL","SOURCE","SVG","MATH","CANVAS","NOSCRIPT","SCRIPT","INPUT","OPTION","TEXTAREA","SLOT","TEMPLATE"],mu=Object.fromEntries(pu.map(e=>[e,!0])),gu=/^(https?:\/\/(www\.)?|xmpp:)/,Vo=30;function vu(e){var t;if(!(!e||(t=e.querySelector)!=null&&t.call(e,"*")))try{const n=e.innerText.trim(),o=(n.match(gu)||[])[0]||"";if(!o)return;const i=n.slice(o.length,o.length+Vo),a=n.slice(o.length+Vo),s=n.slice(o.length).length>Vo;e.innerHTML=`${i}`}catch{}}function Ho(e,t={}){var s;const n=[],o=Object.assign({},mu,(s=t.rejectFilter)==null?void 0:s.reduce((c,l)=>(c[l]=!0,c),{})),i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(c){return o[c.parentNode.nodeName]?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}},!1);let a;for(;a=i.nextNode();)n.push(a);return n}const zt=document.createElement("div");function _u(e,t){if(!e)return"";const{preProcess:n}=t||{};return zt.innerHTML=e.replace(/<\/p>/g,`

    + +`).replace(/<\/li>/g,` +`),zt.querySelectorAll("br").forEach(o=>{o.replaceWith(` +`)}),n==null||n(zt),zt.querySelectorAll(".invisible").forEach(o=>{o.remove()}),zt.querySelectorAll(".ellipsis").forEach(o=>{o.append("...")}),zt.innerText.replace(/[\r\n]{3,}/g,` + +`).trim()}const bo=Le(_u);function yu(e){const{mentions:t=[],instance:n,previewMode:o,statusURL:i}=e||{};return a=>{var f,d;let{target:s}=a;if(s=s.closest("a"),!s||a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||a.which===2)return;const c=(f=s.previousSibling)==null?void 0:f.textContent,l=c==null?void 0:c.endsWith("@"),u=s.innerText.startsWith("@");if((s.classList.contains("u-url")||s.classList.contains("mention"))&&u||l&&!u){const h=(s.querySelector("span")||s).innerText.trim(),p=h.replace(/^@/,""),m=s.getAttribute("href"),_=t.find(v=>v.url===m)||t.find(v=>v.acct===p||v.username===p);if(_)a.preventDefault(),a.stopPropagation(),V.showAccount={account:_.acct,instance:n};else if(!/^http/i.test(h)){a.preventDefault(),a.stopPropagation();const v=s.getAttribute("href");V.showAccount={account:v,instance:n}}}else if(!o){const h=c==null?void 0:c.endsWith("#");if(s.classList.contains("hashtag")||h){a.preventDefault(),a.stopPropagation();const p=s.innerText.replace(/^#/,"").trim(),m=n?`#/${n}/t/${p}`:`#/t/${p}`;location.hash=m}else(d=V.unfurledLinks[s.href])!=null&&d.url&&i!==s.href&&(a.preventDefault(),a.stopPropagation(),V.prevLocation={pathname:location.hash.replace(/^#/,"")},location.hash=`#${V.unfurledLinks[s.href].url}`)}}}function lh(e,t){return()=>Ie.number(e,{style:"unit",unit:t,unitDisplay:"long"})}const bu=Le(()=>new Intl.DateTimeFormat().resolvedOptions().locale),Tu=e=>{const{locale:t,dateYear:n,hideTime:o,formatOpts:i,forceOpts:a}=e||{},s=t.replace(/-[a-z]+$/i,""),c=En([s],[bu],t),l=new Date().getFullYear(),u=a||{year:n===l?void 0:"numeric",month:"short",day:"numeric",hour:o?void 0:"numeric",minute:o?void 0:"numeric",...i};try{return Intl.DateTimeFormat(c,u)}catch{}try{return Intl.DateTimeFormat(t,u)}catch{}return Intl.DateTimeFormat(void 0,u)},wu=Le(Tu);function An(e,t){return e instanceof Date||(e=new Date(e)),wu({dateYear:e.getFullYear(),locale:Ie.locale,...t}).format(e)}function rt(e){try{return Ie.number(e,{notation:"compact",roundingMode:"floor"})}catch{return e}}const Ci=5e3;function Gn(e){if(e||(e=!0),V.showCompose){V.composerState.minimized?Re({duration:Ci,text:Ie._({id:"/4fHR1"})}):Re({duration:Ci,text:Ie._({id:"vvl08N"})});return}Tc(),V.showCompose=e}function uh({skeleton:e,account:t,avatarSize:n="xl",useAvatarStatic:o=!1,instance:i,external:a,internal:s,onClick:c,showActivity:l=!1,showStats:u=!1,accountInstance:f,hideDisplayName:d=!1,relationship:h={},excludeRelationshipAttrs:p=[]}){const{_:m}=tt();if(e)return r("div",{class:"account-block skeleton",children:[r(st,{size:n}),r("span",{children:[r("b",{children:"████████"}),r("br",{}),r("span",{class:"account-block-acct",children:"██████"})]})]});if(!t)return null;const{id:_,acct:v,avatar:T,avatarStatic:b,displayName:w,username:I,emojis:g,url:x,statusesCount:E,lastStatusAt:A,bot:M,fields:R,note:S,group:C,followersCount:N,createdAt:q,locked:B}=t;let[X,ae,ie]=v.match(/([^@]+)(@.+)/i)||[,v];f&&(ie=`@${f}`);const ee=R==null?void 0:R.find(he=>!!he.verifiedAt&&!!he.value),Q={};for(const he in h)p.includes(he)||(Q[he]=h[he]);const me=Q.following||Q.followedBy||Q.requested;return r("a",{class:"account-block",href:x,target:a?"_blank":null,title:ie?v:`@${v}`,onClick:he=>{if(!a){if(he.preventDefault(),c)return c(he);s?location.hash=`/${i}/a/${_}`:V.showAccount={account:t,instance:i}}},children:[r("div",{class:"avatar-container",children:r(st,{url:o?b:T||b,size:n,squircle:M})}),r("span",{class:"account-block-content",children:[!d&&r($,{children:w?r("b",{children:r(qt,{text:w,emojis:g})}):r("b",{children:I})})," ",r("span",{class:"account-block-acct bidi-isolate",children:[ie?"":"@",ae,r("wbr",{}),ie,B&&r($,{children:[" ",r(L,{icon:"lock",size:"s",alt:m({id:"G2fuEb"})})]})]}),l&&r("div",{class:"account-block-stats",children:[r(O,{id:"ajzDof",values:{0:rt(E)}}),!!A&&r($,{children:[" ","·"," ",r(O,{id:"f8bJ3C",values:{0:An(A,{hideTime:!0})}})]})]}),u&&r("div",{class:"account-block-stats",children:[M&&r($,{children:r("span",{class:"tag collapsed",children:[r(L,{icon:"bot"})," ",r(O,{id:"9Vdq+j"})]})}),!!C&&r($,{children:r("span",{class:"tag collapsed",children:[r(L,{icon:"group"})," ",r(O,{id:"L8fEEm"})]})}),me&&r("div",{class:"shazam-container-horizontal",children:r("div",{class:"shazam-container-inner",children:Q.following&&Q.followedBy?r("span",{class:"tag minimal",children:r(O,{id:"7oRLbi"})}):Q.requested?r("span",{class:"tag minimal",children:r(O,{id:"Yx0Ud8"})}):Q.following?r("span",{class:"tag minimal",children:r(O,{id:"y6sq5j"})}):Q.followedBy?r("span",{class:"tag minimal",children:r(O,{id:"p3UO/y"})}):null})},h.id),!!N&&r("span",{class:"ib",children:r(O,{id:"Mn1E9C",values:{followersCount:N}})}),!!ee&&r("span",{class:"verified-field",children:[r(L,{icon:"check-circle",size:"s",alt:m({id:"QDEWii"})})," ",r("span",{dangerouslySetInnerHTML:{__html:Ks(ee.value,{emojis:g})}})]}),!M&&!C&&!me&&!N&&!ee&&!!q&&r("span",{class:"created-at",children:r(O,{id:"PCcEFZ",values:{0:An(q,{hideTime:!0})},components:{0:r("time",{datetime:q})}})})]})]})]})}var Bo={},Uo,Pi;function Eu(){if(Pi)return Uo;Pi=1;function e(t,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=n||{},this._maxRetryTime=n&&n.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return Uo=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var n=new Date().getTime();if(t&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var o=this._timeouts.shift();if(o===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),o=this._cachedTimeouts.slice(-1);else return!1;var i=this;return this._timer=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},o),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,n){this._fn=t,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var o=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){o._operationTimeoutCb()},o._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},n=null,o=0,i=0;i=o&&(n=a,o=c)}return n},Uo}var Ri;function xu(){return Ri||(Ri=1,function(e){var t=Eu();e.operation=function(n){var o=e.timeouts(n);return new t(o,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(n){if(n instanceof Array)return[].concat(n);var o={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in n)o[i]=n[i];if(o.minTimeout>o.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var a=[],s=0;sAu.call(e)==="[object Error]",Pu=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed"]);function Ru(e){return e&&Cu(e)&&e.name==="TypeError"&&typeof e.message=="string"?e.message==="Load failed"?e.stack===void 0:Pu.has(e.message):!1}class Lu extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}const Mi=(e,t,n)=>{const o=n.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=o,e};async function Mu(e,t){return new Promise((n,o)=>{t={...t},t.onFailedAttempt??(t.onFailedAttempt=()=>{}),t.shouldRetry??(t.shouldRetry=()=>!0),t.retries??(t.retries=10);const i=Iu.operation(t),a=()=>{var c;i.stop(),o((c=t.signal)==null?void 0:c.reason)};t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",a,{once:!0});const s=()=>{var c;(c=t.signal)==null||c.removeEventListener("abort",a),i.stop()};i.attempt(async c=>{try{const l=await e(c);s(),n(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof Lu)throw l.originalError;if(l instanceof TypeError&&!Ru(l))throw l;if(Mi(l,c,t),await t.shouldRetry(l)||(i.stop(),o(l)),await t.onFailedAttempt(l),!i.retry(l))throw i.mainError()}catch(u){Mi(u,c,t),s(),o(u)}}})})}const Ou=[{code:"auto",name:"Detect"},{code:"af",name:"Afrikaans"},{code:"sq",name:"Albanian"},{code:"am",name:"Amharic"},{code:"ar",name:"Arabic"},{code:"hy",name:"Armenian"},{code:"as",name:"Assamese"},{code:"ay",name:"Aymara"},{code:"az",name:"Azerbaijani"},{code:"bm",name:"Bambara"},{code:"eu",name:"Basque"},{code:"be",name:"Belarusian"},{code:"bn",name:"Bengali"},{code:"bho",name:"Bhojpuri"},{code:"bs",name:"Bosnian"},{code:"bg",name:"Bulgarian"},{code:"ca",name:"Catalan"},{code:"ceb",name:"Cebuano"},{code:"ny",name:"Chichewa"},{code:"zh",name:"Chinese"},{code:"co",name:"Corsican"},{code:"hr",name:"Croatian"},{code:"cs",name:"Czech"},{code:"da",name:"Danish"},{code:"dv",name:"Dhivehi"},{code:"doi",name:"Dogri"},{code:"nl",name:"Dutch"},{code:"en",name:"English"},{code:"eo",name:"Esperanto"},{code:"et",name:"Estonian"},{code:"ee",name:"Ewe"},{code:"tl",name:"Filipino"},{code:"fi",name:"Finnish"},{code:"fr",name:"French"},{code:"fy",name:"Frisian"},{code:"gl",name:"Galician"},{code:"ka",name:"Georgian"},{code:"de",name:"German"},{code:"el",name:"Greek"},{code:"gn",name:"Guarani"},{code:"gu",name:"Gujarati"},{code:"ht",name:"Haitian Creole"},{code:"ha",name:"Hausa"},{code:"haw",name:"Hawaiian"},{code:"iw",name:"Hebrew"},{code:"hi",name:"Hindi"},{code:"hmn",name:"Hmong"},{code:"hu",name:"Hungarian"},{code:"is",name:"Icelandic"},{code:"ig",name:"Igbo"},{code:"ilo",name:"Ilocano"},{code:"id",name:"Indonesian"},{code:"ga",name:"Irish"},{code:"it",name:"Italian"},{code:"ja",name:"Japanese"},{code:"jw",name:"Javanese"},{code:"kn",name:"Kannada"},{code:"kk",name:"Kazakh"},{code:"km",name:"Khmer"},{code:"rw",name:"Kinyarwanda"},{code:"gom",name:"Konkani"},{code:"ko",name:"Korean"},{code:"kri",name:"Krio"},{code:"ku",name:"Kurdish (Kurmanji)"},{code:"ckb",name:"Kurdish (Sorani)"},{code:"ky",name:"Kyrgyz"},{code:"lo",name:"Lao"},{code:"la",name:"Latin"},{code:"lv",name:"Latvian"},{code:"ln",name:"Lingala"},{code:"lt",name:"Lithuanian"},{code:"lg",name:"Luganda"},{code:"lb",name:"Luxembourgish"},{code:"mk",name:"Macedonian"},{code:"mai",name:"Maithili"},{code:"mg",name:"Malagasy"},{code:"ms",name:"Malay"},{code:"ml",name:"Malayalam"},{code:"mt",name:"Maltese"},{code:"mi",name:"Maori"},{code:"mr",name:"Marathi"},{code:"mni-Mtei",name:"Meiteilon (Manipuri)"},{code:"lus",name:"Mizo"},{code:"mn",name:"Mongolian"},{code:"my",name:"Myanmar (Burmese)"},{code:"ne",name:"Nepali"},{code:"no",name:"Norwegian"},{code:"or",name:"Odia (Oriya)"},{code:"om",name:"Oromo"},{code:"ps",name:"Pashto"},{code:"fa",name:"Persian"},{code:"pl",name:"Polish"},{code:"pt",name:"Portuguese"},{code:"pa",name:"Punjabi"},{code:"qu",name:"Quechua"},{code:"ro",name:"Romanian"},{code:"ru",name:"Russian"},{code:"sm",name:"Samoan"},{code:"sa",name:"Sanskrit"},{code:"gd",name:"Scots Gaelic"},{code:"nso",name:"Sepedi"},{code:"sr",name:"Serbian"},{code:"st",name:"Sesotho"},{code:"sn",name:"Shona"},{code:"sd",name:"Sindhi"},{code:"si",name:"Sinhala"},{code:"sk",name:"Slovak"},{code:"sl",name:"Slovenian"},{code:"so",name:"Somali"},{code:"es",name:"Spanish"},{code:"su",name:"Sundanese"},{code:"sw",name:"Swahili"},{code:"sv",name:"Swedish"},{code:"tg",name:"Tajik"},{code:"ta",name:"Tamil"},{code:"tt",name:"Tatar"},{code:"te",name:"Telugu"},{code:"th",name:"Thai"},{code:"ti",name:"Tigrinya"},{code:"ts",name:"Tsonga"},{code:"tr",name:"Turkish"},{code:"tk",name:"Turkmen"},{code:"ak",name:"Twi"},{code:"uk",name:"Ukrainian"},{code:"ur",name:"Urdu"},{code:"ug",name:"Uyghur"},{code:"uz",name:"Uzbek"},{code:"vi",name:"Vietnamese"},{code:"cy",name:"Welsh"},{code:"xh",name:"Xhosa"},{code:"yi",name:"Yiddish"},{code:"yo",name:"Yoruba"},{code:"zu",name:"Zulu"}];var Du=Object.defineProperty,$u=(e,t,n)=>t in e?Du(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yn=(e,t,n)=>$u(e,typeof t!="symbol"?t+"":t,n),vr=new Map,Xn=new WeakMap,Oi=0,Nu=void 0;function Fu(e){return e?(Xn.has(e)||(Oi+=1,Xn.set(e,Oi.toString())),Xn.get(e)):"0"}function zu(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?Fu(e.root):e[t]}`).toString()}function Vu(e){const t=zu(e);let n=vr.get(t);if(!n){const o=new Map;let i;const a=new IntersectionObserver(s=>{s.forEach(c=>{var l;const u=c.isIntersecting&&i.some(f=>c.intersectionRatio>=f);e.trackVisibility&&typeof c.isVisible>"u"&&(c.isVisible=u),(l=o.get(c.target))==null||l.forEach(f=>{f(u,c)})})},e);i=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:a,elements:o},vr.set(t,n)}return n}function Zs(e,t,n={},o=Nu){if(typeof window.IntersectionObserver>"u"&&o!==void 0){const l=e.getBoundingClientRect();return t(o,{isIntersecting:o,target:e,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:i,observer:a,elements:s}=Vu(n),c=s.get(e)||[];return s.has(e)||s.set(e,c),c.push(t),a.observe(e),function(){c.splice(c.indexOf(t),1),c.length===0&&(s.delete(e),a.unobserve(e)),s.size===0&&(a.disconnect(),vr.delete(i))}}function Hu(e){return typeof e.children!="function"}var dh=class extends ds{constructor(e){super(e),Yn(this,"node",null),Yn(this,"_unobserveCb",null),Yn(this,"handleNode",t=>{this.node&&(this.unobserve(),!t&&!this.props.triggerOnce&&!this.props.skip&&this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=t||null,this.observeNode()}),Yn(this,"handleChange",(t,n)=>{t&&this.props.triggerOnce&&this.unobserve(),Hu(this.props)||this.setState({inView:t,entry:n}),this.props.onChange&&this.props.onChange(t,n)}),this.state={inView:!!e.initialInView,entry:void 0}}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(e){(e.rootMargin!==this.props.rootMargin||e.root!==this.props.root||e.threshold!==this.props.threshold||e.skip!==this.props.skip||e.trackVisibility!==this.props.trackVisibility||e.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;const{threshold:e,root:t,rootMargin:n,trackVisibility:o,delay:i,fallbackInView:a}=this.props;this._unobserveCb=Zs(this.node,this.handleChange,{threshold:e,root:t,rootMargin:n,trackVisibility:o,delay:i},a)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:e}=this.props;if(typeof e=="function"){const{inView:p,entry:m}=this.state;return e({inView:p,entry:m,ref:this.handleNode})}const{as:t,triggerOnce:n,threshold:o,root:i,rootMargin:a,onChange:s,skip:c,trackVisibility:l,delay:u,initialInView:f,fallbackInView:d,...h}=this.props;return Za(t||"div",{ref:this.handleNode,...h},e)}};function Bu({threshold:e,delay:t,trackVisibility:n,rootMargin:o,root:i,triggerOnce:a,skip:s,initialInView:c,fallbackInView:l,onChange:u}={}){var f;const[d,h]=K(null),p=D(u),[m,_]=K({inView:!!c,entry:void 0});p.current=u,J(()=>{if(s||!d)return;let w;return w=Zs(d,(I,g)=>{_({inView:I,entry:g}),p.current&&p.current(I,g),g.isIntersecting&&a&&w&&(w(),w=void 0)},{root:i,rootMargin:o,threshold:e,trackVisibility:n,delay:t},l),()=>{w&&w()}},[Array.isArray(e)?e.toString():e,d,i,o,a,s,n,l,t]);const v=(f=m.entry)==null?void 0:f.target,T=D(void 0);!d&&v&&!a&&!s&&T.current!==v&&(T.current=v,_({inView:!!c,entry:void 0}));const b=[h,m.inView,m.entry];return b.ref=b[0],b.inView=b[1],b.entry=b[2],b}const Di=48,Wo={};function qs({id:e,children:t}){const n=D(),o=!!Wo[e],[i,a]=K(!1),[s,c]=K(o||!1),{ref:l}=Bu({root:null,rootMargin:`-${Di}px 0px 0px 0px`,trackVisibility:!0,delay:1e3,onChange:u=>{u&&(a(!0),e&&(Wo[e]=!0))},triggerOnce:!0,skip:s||i});return J(()=>{if(!n.current)return;const u=n.current.getBoundingClientRect();u.bottom>Di&&(u.top{let i=yn[Ko];return fetch(`https://${i}/api/v1/${t}/${n}/${encodeURIComponent(e)}`).then(a=>{if(!a.ok)throw new Error(a.statusText);return a.json()}).then(a=>{var s;return{provider:"lingva",content:a.translation,detectedSourceLanguage:(s=a.info)==null?void 0:s.detectedSource,info:a.info}})},{retries:3,onFailedAttempt:i=>{Ko=(Ko+1)%yn.length}})}const Gs=1e3*60*60,Ys=vo(Wu,{maxAge:Gs}),Ku=vo(ju(Ys),{maxAge:Gs});function Zu({forceTranslate:e,sourceLanguage:t,onTranslate:n,text:o="",mini:i,autoDetected:a}){const{_:s}=tt(),c=Ds(!0),[l,u]=K("default"),[f,d]=K(null),[h,p]=K(null),[m,_]=K(null),v=D(),T=t?fn(t):null,b=fn(c),w=D("auto");n||(n=i?Ku:Ys);const I=async()=>{var g,x;u("loading");try{const{content:E,detectedSourceLanguage:A,provider:M,error:R,...S}=await n(o,w.current,c);if(E){if(A){const C=fn(A);_(C)}if(M==="lingva"){const C=(x=(g=S==null?void 0:S.info)==null?void 0:g.pronunciation)==null?void 0:x.query;C&&d(C)}p(E),u("default"),!i&&E.trim()!==o.trim()&&(v.current.open=!0,v.current.scrollIntoView({behavior:"smooth",block:"nearest"}))}else u("error")}catch{u("error")}};return J(()=>{e&&I()},[e]),i?h&&h.trim()!==o.trim()&&m!==b?r(qs,{children:r("div",{class:"status-translation-block-mini",children:[r(L,{icon:"translate",alt:s({id:"zVJKbG",values:{sourceLangText:T}})}),r("output",{lang:c,dir:"auto",title:f||"",children:h})]})}):null:r("div",{class:"status-translation-block",onClick:g=>{g.preventDefault()},children:r("details",{ref:v,children:[r("summary",{children:r("button",{type:"button",onClick:async g=>{g.preventDefault(),g.stopPropagation(),v.current.open=!v.current.open,l!=="loading"&&(h||I())},children:[r(L,{icon:"translate"})," ",r("span",{children:s(l==="loading"?{id:"Zxkt/v"}:t&&T&&!m?a?{id:"R20Yf9",values:{sourceLangText:T}}:{id:"h8zDAI",values:{sourceLangText:T}}:{id:"pi8x/S"})})]})}),r("div",{class:"translated-block",children:[r("div",{class:"translation-info insignificant",children:[r("select",{class:"translated-source-select",disabled:l==="loading",onChange:g=>{w.current=g.target.value,I()},children:Ou.map(g=>{const x=fn({code:g.code,fallback:g.name}),E=fn({code:g.code,locale:g.code}),A=x!==E;return r("option",{value:g.code,children:g.code==="auto"?s({id:"Bze3gr",values:{0:m??"…"}}):A?`${E} - ${x}`:E})})})," ",r("span",{children:["→ ",b]}),r(hs,{abrupt:!0,hidden:l!=="loading"})]}),l==="error"?r("p",{class:"ui-state",children:r(O,{id:"m5LihO"})}):!!h&&r($,{children:[r("output",{class:"translated-content",lang:c,dir:"auto",children:h}),!!f&&r("output",{class:"translated-pronunciation-content",tabIndex:-1,onClick:g=>{g.target.classList.toggle("expand")},children:f})]})]})]})})}const qu=yn!=null&&yn.length?Zu:()=>null;function ut(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Xs(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const o=ut(n);return(i,a)=>o.then(s=>a(s.transaction(t,i).objectStore(t)))}let Zo;function Lt(){return Zo||(Zo=Xs("keyval-store","keyval")),Zo}function Gu(e,t=Lt()){return t("readonly",n=>ut(n.get(e)))}function Yu(e,t,n=Lt()){return n("readwrite",o=>(o.put(t,e),ut(o.transaction)))}function Xu(e,t=Lt()){return t("readonly",n=>Promise.all(e.map(o=>ut(n.get(o)))))}function Qu(e,t=Lt()){return t("readwrite",n=>(n.delete(e),ut(n.transaction)))}function Ju(e,t=Lt()){return t("readwrite",n=>(e.forEach(o=>n.delete(o)),ut(n.transaction)))}function ed(e=Lt()){return e("readwrite",t=>(t.clear(),ut(t.transaction)))}function td(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},ut(e.transaction)}function nd(e=Lt()){return e("readonly",t=>{if(t.getAllKeys)return ut(t.getAllKeys());const n=[];return td(t,o=>n.push(o.key)).then(()=>n)})}function Ni(e,t){const n=Xs(e,t);return{set:(o,i)=>Yu(o,i,n),get:o=>Gu(o,n),getMany:o=>Xu(o,n),del:o=>Qu(o,n),delMany:o=>Ju(o,n),clear:()=>ed(n),keys:()=>nd(n)}}const fh={drafts:Ni("drafts-db","drafts-store"),catchup:Ni("catchup-db","catchup-store")};async function hh(e,t={}){if(!(e!=null&&e.length))return;const{masto:n}=lo(),o=Ir(),i=e.reduce((a,s)=>(!a.includes(s.id)&&!t[s.id]&&s.id!==o&&a.push(s.id),a),[]);if(!i.length)return null;try{return(await n.v1.accounts.relationships.fetch({id:i})).reduce((c,l)=>(c[l.id]=l,c),{})}catch{return null}}class Be extends HTMLElement{constructor(){super(),this.isIframeLoaded=!1,this.setupDom()}static get observedAttributes(){return["videoid","playlistid","videoplay","videotitle"]}connectedCallback(){this.addEventListener("pointerover",()=>Be.warmConnections(this),{once:!0}),this.addEventListener("click",()=>this.addIframe())}get videoId(){return encodeURIComponent(this.getAttribute("videoid")||"")}set videoId(t){this.setAttribute("videoid",t)}get playlistId(){return encodeURIComponent(this.getAttribute("playlistid")||"")}set playlistId(t){this.setAttribute("playlistid",t)}get videoTitle(){return this.getAttribute("videotitle")||"Video"}set videoTitle(t){this.setAttribute("videotitle",t)}get videoPlay(){return this.getAttribute("videoplay")||"Play"}set videoPlay(t){this.setAttribute("videoplay",t)}get videoStartAt(){return this.getAttribute("videoStartAt")||"0"}get autoLoad(){return this.hasAttribute("autoload")}get autoPause(){return this.hasAttribute("autopause")}get noCookie(){return this.hasAttribute("nocookie")}get posterQuality(){return this.getAttribute("posterquality")||"hqdefault"}get posterLoading(){return this.getAttribute("posterloading")||"lazy"}get params(){return`start=${this.videoStartAt}&${this.getAttribute("params")}`}set params(t){this.setAttribute("params",t)}setupDom(){const t=this.attachShadow({mode:"open"});let n="";window.liteYouTubeNonce&&(n=`nonce="${window.liteYouTubeNonce}"`),t.innerHTML=` + +
    + + + + + + + + +
    + `,this.domRefFrame=t.querySelector("#frame"),this.domRefImg={fallback:t.querySelector("#fallbackPlaceholder"),webp:t.querySelector("#webpPlaceholder"),jpeg:t.querySelector("#jpegPlaceholder")},this.domRefPlayButton=t.querySelector("#playButton")}setupComponent(){this.initImagePlaceholder(),this.domRefPlayButton.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),this.setAttribute("title",`${this.videoPlay}: ${this.videoTitle}`),(this.autoLoad||this.isYouTubeShort()||this.autoPause)&&this.initIntersectionObserver()}attributeChangedCallback(t,n,o){n!==o&&(this.setupComponent(),this.domRefFrame.classList.contains("activated")&&(this.domRefFrame.classList.remove("activated"),this.shadowRoot.querySelector("iframe").remove(),this.isIframeLoaded=!1))}addIframe(t=!1){if(!this.isIframeLoaded){let n=t?0:1;const o=this.noCookie?"-nocookie":"";let i;this.playlistId?i=`?listType=playlist&list=${this.playlistId}&`:i=`${this.videoId}?`,this.autoPause&&(this.params="enablejsapi=1"),this.isYouTubeShort()&&(this.params=`loop=1&mute=1&modestbranding=1&playsinline=1&rel=0&enablejsapi=1&playlist=${this.videoId}`,n=1);const a=` +`;this.domRefFrame.insertAdjacentHTML("beforeend",a),this.domRefFrame.classList.add("activated"),this.isIframeLoaded=!0,this.attemptShortAutoPlay(),this.dispatchEvent(new CustomEvent("liteYoutubeIframeLoaded",{detail:{videoId:this.videoId},bubbles:!0,cancelable:!0}))}}initImagePlaceholder(){var o,i;const t=`https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`,n=`https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`;this.domRefImg.fallback.loading=this.posterLoading,this.domRefImg.webp.srcset=t,this.domRefImg.jpeg.srcset=n,this.domRefImg.fallback.src=n,this.domRefImg.fallback.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),(i=(o=this.domRefImg)==null?void 0:o.fallback)==null||i.setAttribute("alt",`${this.videoPlay}: ${this.videoTitle}`)}initIntersectionObserver(){const t={root:null,rootMargin:"0px",threshold:0};new IntersectionObserver((o,i)=>{o.forEach(a=>{a.isIntersecting&&!this.isIframeLoaded&&(Be.warmConnections(this),this.addIframe(!0),i.unobserve(this))})},t).observe(this),this.autoPause&&new IntersectionObserver((i,a)=>{i.forEach(s=>{var c,l;s.intersectionRatio!==1&&((l=(c=this.shadowRoot.querySelector("iframe"))==null?void 0:c.contentWindow)==null||l.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"))})},{threshold:1}).observe(this)}attemptShortAutoPlay(){this.isYouTubeShort()&&setTimeout(()=>{var t,n;(n=(t=this.shadowRoot.querySelector("iframe"))==null?void 0:t.contentWindow)==null||n.postMessage('{"event":"command","func":"playVideo","args":""}',"*")},2e3)}isYouTubeShort(){return this.getAttribute("short")===""&&window.matchMedia("(max-width: 40em)").matches}static addPrefetch(t,n){const o=document.createElement("link");o.rel=t,o.href=n,o.crossOrigin="true",document.head.append(o)}static warmConnections(t){Be.isPreconnected||window.liteYouTubeIsPreconnected||(Be.addPrefetch("preconnect","https://i.ytimg.com/"),Be.addPrefetch("preconnect","https://s.ytimg.com"),t.noCookie?Be.addPrefetch("preconnect","https://www.youtube-nocookie.com"):(Be.addPrefetch("preconnect","https://www.youtube.com"),Be.addPrefetch("preconnect","https://www.google.com"),Be.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),Be.addPrefetch("preconnect","https://static.doubleclick.net")),Be.isPreconnected=!0,window.liteYouTubeIsPreconnected=!0)}}Be.isPreconnected=!1;customElements.define("lite-youtube",Be);const Qs=new Uint8Array(128);for(let e=0;e<83;e++)Qs["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~".charCodeAt(e)]=e;const so=(e,t,n)=>{let o=0;for(;te>10.31475?Js(e/ta+.052132,2.4):e/ea,qo=e=>~~(e>1227e-8?ta*Js(e,.416666)-13.025:e*ea+1),bn=e=>(e<0?-1:1)*e*e,Fi=e=>{for(e+=Cn/2;e>Cn;)e-=od;const t=1.27323954*e-.405284735*bn(e);return .225*(bn(t)-t)+t};function $r(e){const t=so(e,2,6);return[t>>16,t>>8&255,t&255]}function id(e,t,n,o){const i=so(e,0,1),a=i%9+1,s=~~(i/9)+1,c=a*s;let l=0,u=0,f=0,d=0,h=0,p=0,m=0,_=0,v=0,T=0,b=0,w=0;const I=(so(e,1,2)+1)/13446*(o|1),g=new Float64Array(c*3),x=$r(e);for(l=0;l<3;l++)g[l]=rd(x[l]);for(l=1;l{const o=n.char||" ",i=n.count||2;let a=0;const s=[];return t.reverse().reduce((c,l)=>{s.length&&a&&s[a]&&s[a]===l.substring(1,s[a].length+1)&&(s.splice(a,1),a--);const f=[`${o.repeat(a?a*i:0)}${l}`,...c];return l.substring(0,2)==="n.trim().replace(/(^(\s|\t)+|(( |\t)+)$)/gm,"");return Yo={mergeAttributesWithElements:n=>{const o=e(n).split(` +`),i=[];let a="";for(let s=0;s")){i.push(`${a}${c.slice(0,-2)} />`),a="";continue}if(c.endsWith(">")){i.push(`${a}${c.startsWith(">")||c.startsWith("<")?"":" "}${c}`),a="";continue}a+=a.length?` ${c}`:c}return i},removeEmptyLines:e},Yo}var Xo,Hi;function cd(){if(Hi)return Xo;Hi=1;const e=sd(),{mergeAttributesWithElements:t}=ad();return Xo=(o,i={})=>{const a=t(o);return e(a,i)},Xo}var ld=cd();const ud=kr(ld);var gn=(e=>(e.Mouse="mouse",e.Touch="touch",e.Pointer="pointer",e))(gn||{}),vn=(e=>(e.CancelledByMovement="cancelled-by-movement",e.CancelledByRelease="cancelled-by-release",e.CancelledOutsideElement="cancelled-outside-element",e))(vn||{});const na=()=>typeof window=="object"?(window==null?void 0:window.PointerEvent)??null:null,dd=()=>typeof window=="object"?(window==null?void 0:window.TouchEvent)??null:null;function oa(e){const{nativeEvent:t}=e,n=dd();return n&&t instanceof n||"touches"in e}function ra(e){const t=na();return e.nativeEvent instanceof MouseEvent&&!(t&&e.nativeEvent instanceof t)}function ia(e){const{nativeEvent:t}=e;if(!t)return!1;const n=na();return n&&t instanceof n||"pointerId"in t}function Bi(e){return ra(e)||oa(e)||ia(e)}function Ui(e){return oa(e)?{x:e.touches[0].pageX,y:e.touches[0].pageY}:ra(e)||ia(e)?{x:e.pageX,y:e.pageY}:null}function fd(e){return{target:e.target,currentTarget:e.currentTarget,nativeEvent:e,persist:()=>{}}}function sa(e,{threshold:t=400,captureEvent:n=!1,detect:o=gn.Pointer,cancelOnMovement:i=!1,cancelOutsideElement:a=!0,filterEvents:s,onStart:c,onMove:l,onFinish:u,onCancel:f}={}){const d=D(!1),h=D(!1),p=D(),m=D(),_=D(e),v=D(null),T=ke(g=>x=>{h.current||Bi(x)&&(s!==void 0&&!s(x)||(n&&x.persist(),c==null||c(x,{context:g}),v.current=Ui(x),h.current=!0,p.current=x.currentTarget,m.current=setTimeout(()=>{_.current&&(_.current(x,{context:g}),d.current=!0)},t)))},[n,s,c,t]),b=ke(g=>(x,E)=>{Bi(x)&&h.current&&(v.current=null,n&&x.persist(),d.current?u==null||u(x,{context:g}):h.current&&(f==null||f(x,{context:g,reason:E??vn.CancelledByRelease})),d.current=!1,h.current=!1,m.current!==void 0&&clearTimeout(m.current))},[n,u,f]),w=ke(g=>x=>{if(l==null||l(x,{context:g}),i!==!1&&v.current){const E=Ui(x);if(E){const A=i===!0?25:i,M={x:Math.abs(E.x-v.current.x),y:Math.abs(E.y-v.current.y)};(M.x>A||M.y>A)&&b(g)(x,vn.CancelledByMovement)}}},[b,i,l]),I=ke(g=>{if(e===null)return{};switch(o){case gn.Mouse:{const x={onMouseDown:T(g),onMouseMove:w(g),onMouseUp:b(g)};return a&&(x.onMouseLeave=E=>{b(g)(E,vn.CancelledOutsideElement)}),x}case gn.Touch:return{onTouchStart:T(g),onTouchMove:w(g),onTouchEnd:b(g)};case gn.Pointer:{const x={onPointerDown:T(g),onPointerMove:w(g),onPointerUp:b(g)};return a&&(x.onPointerLeave=E=>b(g)(E,vn.CancelledOutsideElement)),x}}},[e,b,a,o,w,T]);return J(()=>{if(!window)return;function g(x){const E=fd(x);b()(E)}return window.addEventListener("mouseup",g),window.addEventListener("touchend",g),window.addEventListener("pointerup",g),()=>{window.removeEventListener("mouseup",g),window.removeEventListener("touchend",g),window.removeEventListener("pointerup",g)}},[b]),J(()=>()=>{m.current!==void 0&&clearTimeout(m.current)},[]),J(()=>{_.current=e},[e]),I}function hd({poll:e,lang:t,readOnly:n,refresh:o=()=>{},votePoll:i=()=>{}}){const{_:a}=tt(),[s,c]=K("default"),{expired:l,expiresAt:u,id:f,multiple:d,options:h,ownVotes:p,voted:m,votersCount:_,votesCount:v,emojis:T}=e,b=!!u&&new Date(u),w=d?_:v;let I=0;w<=1e3?I=0:w<=1e4?I=1:w<=1e5&&(I=2);const[g,x]=K(!1),E=h.every(A=>A.votesCount!==null);return r("div",{lang:t,dir:"auto",class:`poll ${n?"read-only":""} ${s==="loading"?"loading":""}`,children:[g&&E||m||l?r($,{children:[r("div",{class:"poll-options",children:h.map((A,M)=>{const{title:R,votesCount:S}=A,C=w?S/w:0,N=C?C.toLocaleString(Ie.locale||void 0,{style:"percent",maximumFractionDigits:I}):"0%",q=S>0&&S===Math.max(...h.map(B=>B.votesCount));return r("div",{class:`poll-option poll-result ${q?"poll-option-leading":""}`,style:{"--percentage":`${C*100}%`},children:[r("div",{class:"poll-option-title",children:[r("span",{children:r(qt,{text:R,emojis:T})}),m&&p.includes(M)&&r($,{children:[" ",r(L,{icon:"check-circle",alt:a({id:"IeO7us"})})]})]}),r("div",{class:"poll-option-votes",title:Ie._({id:"+syLpm",values:{optionVotesCount:S}}),children:N})]},`${M}-${R}-${S}`)})}),!l&&!m&&r("button",{class:"poll-vote-button plain2",disabled:s==="loading",onClick:A=>{A.preventDefault(),x(!1)},children:[r(L,{icon:"arrow-left",size:"s"})," ",r(O,{id:"L96xSt"})]})]}):r("form",{onSubmit:async A=>{A.preventDefault();const M=A.target,R=new FormData(M),S=[];R.forEach((C,N)=>{N==="poll"&&S.push(C)}),S.length&&(c("loading"),await i(S),c("default"))},children:[r("div",{class:"poll-options",children:h.map((A,M)=>{const{title:R}=A;return r("div",{class:"poll-option",children:r("label",{class:"poll-label",children:[r("input",{type:d?"checkbox":"radio",name:"poll",value:M,disabled:s==="loading",readOnly:n}),r("span",{class:"poll-option-title",children:r(qt,{text:R,emojis:T})})]})})})}),!n&&r("button",{class:"poll-vote-button",type:"submit",disabled:s==="loading",children:r(O,{id:"lQXQKs"})})]}),r("p",{class:"poll-meta",children:[!l&&!n&&r("button",{type:"button",class:"plain small",disabled:s==="loading",onClick:A=>{A.preventDefault(),c("loading"),(async()=>(await o(),c("default")))()},title:a({id:"lCF0wC"}),children:r(L,{icon:"refresh",alt:a({id:"lCF0wC"})})}),!m&&!l&&!n&&E&&r("button",{type:"button",class:"plain small",disabled:s==="loading",onClick:A=>{A.preventDefault(),x(!g)},title:a(g?{id:"L96xSt"}:{id:"zCjei3"}),children:[r(L,{icon:g?"eye-open":"eye-close",alt:a(g?{id:"L96xSt"}:{id:"zCjei3"})})," "]}),!l&&!n&&" ",r(O,{id:"k7v0Rh",values:{0:rt(v),1:rt(v),votesCount:v},components:{0:r("span",{title:v}),1:r("span",{title:v})}}),!!_&&_!==v&&r($,{children:[" ","•"," ",r(O,{id:"jf1i1L",values:{0:rt(_),1:rt(_),votersCount:_},components:{0:r("span",{title:_}),1:r("span",{title:_})}})]})," ","•"," ",l?b?r(O,{id:"5LwCCI",components:{0:r(at,{datetime:b})}}):a({id:"237hSL"}):b?r(O,{id:"ooHDPY",components:{0:r(at,{datetime:b})}}):a({id:"O2tNG0"})]})]})}const aa=lt();function pd(e,t){if(!(e!=null&&e.length))return!1;const n=e.filter(a=>{const{filter:s}=a,c=s.context.includes(t);return c?s.expiresAt?new Date(s.expiresAt)>new Date:c:!1});if(!n.length)return!1;if(n.some(a=>a.filter.filterAction==="hide"))return{action:"hide"};if(n.some(a=>a.filter.filterAction==="warn")){const a=n.map(s=>s.filter.title);return{action:"warn",titles:a,titlesStr:a.join(" • ")}}return!1}const Nr=Le(pd);function md(e,t,n){var s;const{filtered:o}=e;if(!(o!=null&&o.length)||n&&((s=e.account)==null?void 0:s.id)===n)return!0;const a=Nr(o,t);return a?a.action!=="hide":!0}function ph(e,t){if(!(e!=null&&e.length))return[];if(!t)return e;const n=Ir();return e.filter(o=>md(o,t,n))}const Qo=document.createElement("div");function Jo(e){return e?(Qo.innerHTML=e,Qo.querySelectorAll(".invisible").forEach(t=>{t.remove()}),Qo.innerText.length):0}const _n="speechSynthesis"in window;function ji(e,t){if(_n)try{speechSynthesis.speaking&&speechSynthesis.cancel();const n=new SpeechSynthesisUtterance(e);t&&(n.lang=t),speechSynthesis.speak(n)}catch(n){alert(n)}}function ca(e){var s;const{spoilerText:t,content:n,poll:o,mediaAttachments:i}=e;let a="";return t!=null&&t.trim()?a+=t:a+=bo(n),a=a.trim(),(s=o==null?void 0:o.options)!=null&&s.length&&(a+=` + +📊: +${o.options.map(c=>`${o.multiple?"▪️":"•"} ${c.title}`).join(` +`)}`),i!=null&&i.length&&(a+=" "+i.map(c=>({image:"🖼️",gifv:"🎞️",video:"📹",audio:"🎵",unknown:""})[c.type]||"").join("")),a}function gd(e,t,n){var o=this,i=D(null),a=D(0),s=D(null),c=D([]),l=D(),u=D(),f=D(e),d=D(!0);f.current=e;var h=typeof window<"u",p=!t&&t!==0&&h;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var m=!!(n=n||{}).leading,_=!("trailing"in n)||!!n.trailing,v="maxWait"in n,T="debounceOnServer"in n&&!!n.debounceOnServer,b=v?Math.max(+n.maxWait||0,t):null;J(function(){return d.current=!0,function(){d.current=!1}},[]);var w=se(function(){var I=function(R){var S=c.current,C=l.current;return c.current=l.current=null,a.current=R,u.current=f.current.apply(C,S)},g=function(R,S){p&&cancelAnimationFrame(s.current),s.current=p?requestAnimationFrame(R):setTimeout(R,S)},x=function(R){if(!d.current)return!1;var S=R-i.current;return!i.current||S>=t||S<0||v&&R-a.current>=b},E=function(R){return s.current=null,_&&c.current?I(R):(c.current=l.current=null,u.current)},A=function R(){var S=Date.now();if(x(S))return E(S);if(d.current){var C=t-(S-i.current),N=v?Math.min(C,b-(S-a.current)):C;g(R,N)}},M=function(){if(h||T){var R=Date.now(),S=x(R);if(c.current=[].slice.call(arguments),l.current=o,i.current=R,S){if(!s.current&&d.current)return a.current=i.current,g(A,t),m?I(i.current):u.current;if(v)return g(A,t),I(i.current)}return s.current||g(A,t),u.current}};return M.cancel=function(){s.current&&(p?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,c.current=i.current=l.current=s.current=null},M.isPending=function(){return!!s.current},M.flush=function(){return s.current?E(Date.now()):u.current},M},[m,v,t,b,_,p,h,T]);return w}function vd(e,t,n){var o=n===void 0?{}:n,i=o.leading,a=o.trailing;return gd(e,t,{maxWait:t,leading:i===void 0||i,trailing:a===void 0||a})}function _d(e,t){var n=D(null),o=D(null);o.current=t;var i=D(null);J(function(){a()});var a=ke(function(){var s=i.current,c=o.current,l=s||(c?c instanceof Element?c:c.current:null);n.current&&n.current.element===l&&n.current.subscriber===e||(n.current&&n.current.cleanup&&n.current.cleanup(),n.current={element:l,subscriber:e,cleanup:l?e(l):void 0})},[e]);return J(function(){return function(){n.current&&n.current.cleanup&&(n.current.cleanup(),n.current=null)}},[]),ke(function(s){i.current=s,a()},[a])}function Wi(e,t,n){return e[t]?e[t][0]?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function yd(e){e===void 0&&(e={});var t=e.onResize,n=D(void 0);n.current=t;var o=e.round||Math.round,i=D(),a=K({width:void 0,height:void 0}),s=a[0],c=a[1],l=D(!1);J(function(){return l.current=!1,function(){l.current=!0}},[]);var u=D({width:void 0,height:void 0}),f=_d(ke(function(d){return(!i.current||i.current.box!==e.box||i.current.round!==o)&&(i.current={box:e.box,round:o,instance:new ResizeObserver(function(h){var p=h[0],m=e.box==="border-box"?"borderBoxSize":e.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",_=Wi(p,m,"inlineSize"),v=Wi(p,m,"blockSize"),T=_?o(_):void 0,b=v?o(v):void 0;if(u.current.width!==T||u.current.height!==b){var w={width:T,height:b};u.current.width=T,u.current.height=b,n.current?n.current(w):l.current||c(w)}})}),i.current.instance.observe(d,{box:e.box}),function(){i.current&&i.current.instance.unobserve(d)}},[e.box,o]),e.ref);return se(function(){return{ref:f,width:s.width,height:s.height}},[f,s.width,s.height])}function ao({className:e="truncated"}={}){const t=D(),n=vd(({height:o})=>{if(t.current){const{scrollHeight:i}=t.current;let a=i>o;if(a){const{height:s,maxHeight:c}=getComputedStyle(t.current),l=parseInt(c||s,10);a=i>l}t.current.classList.toggle(e,a)}},300);return yd({ref:t,box:"border-box",onResize:n}),t}const Tn={public:"earth",unlisted:"group",private:"lock",direct:"message",local:"building"};var la="kvfysmfp",ua="ufhsfnkm",bd=".".concat(la,"{overflow:hidden;touch-action:none}.").concat(ua,"{transform-origin: 0 0}"),Td=typeof window>"u",wd=function(){return!Td&&("ontouchstart"in window||navigator.maxTouchPoints>0)};var Ed=function(e){var t=e.x,n=e.y,o=e.scale;return"scale3d(".concat(o,",").concat(o,", 1) translate3d(").concat(t,"px, ").concat(n,"px, 0)")};var xd=Math.min,Sd=Math.max;function Ki(e){var t=e.containerDimension,n=e.childDimension,o=e.padding,i=e.centerContained,a=n-t;return a+2*o<=0&&i?[a/2,a/2]:[xd(a+o,0)-o,Sd(0,a+o)]}var Zi=function(e,t){return t?"".concat(e," ").concat(t):e},Qn=Math.abs,kd=Math.min,Id=Math.sqrt,da=typeof window>"u",Ad=da?!1:/(Mac)/i.test(navigator.platform),Vt=function(e){return e==="drag"},hn=function(e){return e==="zoom"},Cd=function(e){return Ad&&e.ctrlKey},pn=function(e){e.stopPropagation(),e.preventDefault()},qi=function(e,t){var n=e.x-t.x,o=e.y-t.y;return Id(n*n+o*o)},Pd=function(e,t){var n=qi(e[0],e[1]),o=qi(t[0],t[1]);return o/n},Rd=function(e,t){return e>t-.01&&et?t:n},Dd=function(e){return!(e.ctrlKey||e.metaKey)},$d=function(e){if(e){var t=e.offsetWidth,n=e.offsetHeight;if(t&&n)return{width:t,height:n};var o=getComputedStyle(e),i=parseFloat(o.width),a=parseFloat(o.height);if(a&&i)return{width:i,height:a}}return{width:0,height:0}},Nd=function(e,t){return{x:t.x-e.x,y:t.y-e.y}},Fd=function(e,t){return e.x===t.x&&e.y===t.y},At=function(){},eo={x:0,y:0},Yi=function(e){qa(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n._prevDragMovePoint=null,n._containerObserver=null,n._fingers=0,n._firstMove=!0,n._initialOffset=De({},eo),n._interaction=null,n._isDoubleTap=!1,n._isOffsetsSet=!1,n._lastDragPosition=null,n._lastScale=1,n._lastTouchStart=0,n._lastZoomCenter=null,n._listenMouseMove=!1,n._nthZoom=0,n._offset=De({},eo),n._startOffset=De({},eo),n._startTouches=null,n._updatePlaned=!1,n._wheelTimeOut=null,n._zoomFactor=1,n._initialZoomFactor=1,n._draggingPoint=De({},eo),n._ignoreNextClick=!1,n._containerRef=Ga(),n._handleClick=function(o){n._ignoreNextClick&&(n._ignoreNextClick=!1,o.stopPropagation())},n._onResize=function(){var o;!((o=n._containerRef)===null||o===void 0)&&o.current&&(n._updateInitialZoomFactor(),n._setupOffsets(),n._update())},n._handlerOnTouchEnd=n._handlerIfEnable(function(o){n._fingers=o.touches.length,n.props.shouldCancelHandledTouchEndEvents&&(hn(n._interaction)||Vt(n._interaction)&&(n._startOffset.x!==n._offset.x||n._startOffset.y!==n._offset.y))&&pn(o),Vt(n._interaction)&&!n._enoughToDrag()&&n._handleClick(o),n._updateInteraction(o)}),n._handlerOnTouchStart=n._handlerIfEnable(function(o){n._firstMove=!0,n._fingers=o.touches.length,n._detectDoubleTap(o)}),n._handlerOnTouchMove=n._handlerIfEnable(function(o){n._isDoubleTap||(n._collectInertia(o),n._firstMove?(n._updateInteraction(o),n._interaction&&pn(o),n._startOffset=De({},n._offset),n._startTouches=Jn(o.touches)):(hn(n._interaction)?n._startTouches&&n._startTouches.length===2&&o.touches.length===2&&n._handleZoom(o,Pd(n._startTouches,Jn(o.touches))):Vt(n._interaction)&&n._handleDrag(o),n._interaction&&(pn(o),n._update())),n._firstMove=!1)}),n._handlerWheel=function(o){if(!n.props.shouldInterceptWheel(o)){pn(o);var i=o.pageX,a=o.pageY,s=o.deltaY,c=o.deltaMode,l=1;(Cd(o)||c===1)&&(l=15);var u={touches:[{pageX:i,pageY:a}]},f=n._getOffsetByFirstTouch(u),d=s*l;n._stopAnimation(),n._scaleTo(n._zoomFactor-d/n.props.wheelScaleFactor,f),n._update(),clearTimeout(n._wheelTimeOut),n._wheelTimeOut=setTimeout(function(){return n._sanitize()},100)}},n._handlers=n.props.isTouch()?[["touchstart",n._handlerOnTouchStart],["touchend",n._handlerOnTouchEnd],["touchmove",n._handlerOnTouchMove]]:[["mousemove",n.simulate(n._handlerOnTouchMove),n.props._document],["mouseup",n.simulate(n._handlerOnTouchEnd),n.props._document],["mousedown",n.simulate(n._handlerOnTouchStart)],["click",n._handleClick],["wheel",n._handlerWheel]],n}return t.prototype._handleDragStart=function(n){this._ignoreNextClick=!0,this.props.onDragStart(),this._stopAnimation(),this._resetInertia(),this._lastDragPosition=null,this._hasInteraction=!0,this._draggingPoint=this._offset,this._handleDrag(n)},t.prototype._handleDrag=function(n){var o=this._getOffsetByFirstTouch(n);this._enoughToDrag()?this._drag(o,this._lastDragPosition):this._virtualDrag(o,this._lastDragPosition),this._offset=this._sanitizeOffset(this._offset),this._lastDragPosition=o},t.prototype._resetInertia=function(){this._velocity=null,this._prevDragMovePoint=null},t.prototype._realizeInertia=function(){var n=this,o=this.props,i=o.inertiaFriction,a=o.inertia;if(!(!a||!this._velocity)){var s=this._velocity,c=s.x,l=s.y;if(c||l){this._stopAnimation(),this._resetInertia();var u=function(){if(c*=i,l*=i,!c&&!l)return n._stopAnimation();var f=De({},n._offset);if(n._addOffset({x:c,y:l}),n._offset=n._sanitizeOffset(n._offset),Fd(f,n._offset))return n._stopAnimation();n._update({isAnimation:!0})};this._animate(u,{duration:9999})}}},t.prototype._collectInertia=function(n){var o=n.touches;if(this.props.inertia){var i=Jn(o)[0],a=this._prevDragMovePoint;a&&(this._velocity=Nd(i,a)),this._prevDragMovePoint=i}},t.prototype._handleDragEnd=function(){this.props.onDragEnd(),this._end(),this._realizeInertia()},t.prototype._handleZoomStart=function(){this.props.onZoomStart(),this._stopAnimation(),this._lastScale=1,this._nthZoom=0,this._lastZoomCenter=null,this._hasInteraction=!0},t.prototype._handleZoom=function(n,o){var i=Od(this._getOffsetTouches(n)),a=o/this._lastScale;this._lastScale=o,this._nthZoom+=1,this._nthZoom>3&&(this._scale(a,i),this._drag(i,this._lastZoomCenter),this.props.enforceBoundsDuringZoom&&(this._offset=this._sanitizeOffset(this._offset))),this._lastZoomCenter=i},t.prototype._handleZoomEnd=function(){this.props.onZoomEnd(),this._end()},t.prototype._handleDoubleTap=function(n){var o=this;if(!(this._hasInteraction||this.props.tapZoomFactor===0)){var i=this.props.doubleTapZoomOutOnMaxScale&&this._zoomFactor===this.props.maxZoom||this.props.doubleTapToggleZoom&&this._zoomFactor>1;this.props.onDoubleTap(),this._ignoreNextClick=!0;var a=this._zoomFactor+this.props.tapZoomFactor,s=this._zoomFactor,c=function(u){o._scaleTo(s+u*(a-s),l)},l=this._getOffsetByFirstTouch(n);this._isDoubleTap=!0,s>a&&(l=this._getCurrentZoomCenter()),i?this._zoomOutAnimation():this._animate(c)}},t.prototype._computeInitialOffset=function(){var n=this._getContainerRect(),o=this._getChildSize(),i=o.width,a=o.height,s=-Qn(i*this._getInitialZoomFactor()-n.width)/2,c=-Qn(a*this._getInitialZoomFactor()-n.height)/2;this._initialOffset={x:s,y:c}},t.prototype._resetOffset=function(){this._offset=De({},this._initialOffset)},t.prototype._setupOffsets=function(){this.props.setOffsetsOnce&&this._isOffsetsSet||(this._isOffsetsSet=!0,this._computeInitialOffset(),this._resetOffset())},t.prototype._sanitizeOffset=function(n){var o=this._getContainerRect(),i=this._getChildSize(),a=i.width,s=i.height,c=a*this._getInitialZoomFactor()*this._zoomFactor,l=s*this._getInitialZoomFactor()*this._zoomFactor,u=Ki({containerDimension:o.width,childDimension:c,padding:this.props.horizontalPadding,centerContained:this.props.centerContained}),f=u[0],d=u[1],h=Ki({containerDimension:o.height,childDimension:l,padding:this.props.verticalPadding,centerContained:this.props.centerContained}),p=h[0],m=h[1];return{x:er(f,d,n.x),y:er(p,m,n.y)}},t.prototype.alignCenter=function(n){var o=this,i=De({duration:250,animated:!0},n),a=i.x,s=i.y,c=i.scale,l=i.animated,u=i.duration,f=a*this._initialZoomFactor,d=s*this._initialZoomFactor,h=this._zoomFactor,p=De({},this._offset),m=this._getContainerRect(),_={x:m.width/2,y:m.height/2};if(this._zoomFactor=1,this._offset={x:-(_.x-f),y:-(_.y-d)},this._scaleTo(c,_),this._stopAnimation(),!l)return this._update();var v=this._zoomFactor-h,T={x:this._offset.x-p.x,y:this._offset.y-p.y};this._zoomFactor=h,this._offset=De({},p);var b=function(w){var I=p.x+T.x*w,g=p.y+T.y*w;o._zoomFactor=h+v*w,o._offset=o._sanitizeOffset({x:I,y:g}),o._update()};this._animate(b,{callback:function(){return o._sanitize()},duration:u})},t.prototype.scaleTo=function(n){var o=this,i=De({duration:250,animated:!0},n),a=i.x,s=i.y,c=i.scale,l=i.animated,u=i.duration,f=this._zoomFactor,d=De({},this._offset);if(this._zoomFactor=1,this._offset={x:0,y:0},this._scaleTo(c,{x:a,y:s}),this._stopAnimation(),!l)return this._update();var h=this._zoomFactor-f,p={x:this._offset.x-d.x,y:this._offset.y-d.y};this._zoomFactor=f,this._offset=De({},d);var m=function(_){var v=d.x+p.x*_,T=d.y+p.y*_;o._zoomFactor=f+h*_,o._offset={x:v,y:T},o._update()};this._animate(m,{callback:function(){return o._sanitize()},duration:u})},t.prototype._scaleTo=function(n,o){this._scale(n/this._zoomFactor,o),this._offset=this._sanitizeOffset(this._offset)},t.prototype._scale=function(n,o){n=this._scaleZoomFactor(n),this._addOffset({x:(n-1)*(o.x+this._offset.x),y:(n-1)*(o.y+this._offset.y)}),this.props.onZoomUpdate()},t.prototype._scaleZoomFactor=function(n){var o=this._zoomFactor;return this._zoomFactor*=n,this._zoomFactor=er(this.props.minZoom,this.props.maxZoom,this._zoomFactor),this._zoomFactor/o},t.prototype._canDrag=function(){return this.props.draggableUnZoomed||!Rd(this._zoomFactor,1)},t.prototype._drag=function(n,o){if(o){var i=-(n.y-o.y),a=-(n.x-o.x);this.props.lockDragAxis?Qn(a)>Qn(i)?this._addOffset({x:a,y:0}):this._addOffset({y:i,x:0}):this._addOffset({x:a,y:i}),this.props.onDragUpdate()}},t.prototype._virtualDrag=function(n,o){if(o){var i=-(n.y-o.y),a=-(n.x-o.x);this._draggingPoint={x:a+this._draggingPoint.x,y:i+this._draggingPoint.y}}},t.prototype._addOffset=function(n){var o=this._offset,i=o.x,a=o.y;this._offset={x:i+n.x,y:a+n.y}},t.prototype._sanitize=function(){this._zoomFactor=u?(n(1),i._stopAnimation(),l(),i._update()):(h=c(h),n(h),i._update({isAnimation:!0}),requestAnimationFrame(f))}};this._inAnimation=!0,requestAnimationFrame(f)},t.prototype._stopAnimation=function(){this._inAnimation=!1},t.prototype._end=function(){this._hasInteraction=!1,this._sanitize(),this._update()},t.prototype._getContainerRect=function(){var n=this._containerRef.current;return n.getBoundingClientRect()},t.prototype._getChildSize=function(){var n=this._containerRef.current;return $d(n==null?void 0:n.firstElementChild)},t.prototype._updateInitialZoomFactor=function(){var n=this._getContainerRect(),o=this._getChildSize(),i=n.width/o.width,a=n.height/o.height;this._initialZoomFactor=kd(i,a)},t.prototype._bindEvents=function(){var n=this,o=this._containerRef.current;window.ResizeObserver?(this._containerObserver=new ResizeObserver(this._onResize),this._containerObserver.observe(o)):window.addEventListener("resize",this._onResize),this._handlers.forEach(function(i){var a=i[0],s=i[1],c=i[2];(c||o).addEventListener(a,s,!0)}),Array.from(o.querySelectorAll("img")).forEach(function(i){return i.addEventListener("load",n._onResize)})},t.prototype._unSubscribe=function(){var n=this,o=this._containerRef.current;this._containerObserver&&(this._containerObserver.disconnect(),this._containerObserver=null),window.removeEventListener("resize",this._onResize),this._handlers.forEach(function(i){var a=i[0],s=i[1],c=i[2];(c||o).removeEventListener(a,s,!0)}),Array.from(o.querySelectorAll("img")).forEach(function(i){return i.removeEventListener("load",n._onResize)})},t.prototype._update=function(n){var o=this;if(!this._updatePlaned){var i=function(){var a=o._getInitialZoomFactor()*o._zoomFactor,s=-o._offset.x/a,c=-o._offset.y/a;o.props.onUpdate({scale:a,x:s,y:c})};if(n!=null&&n.isAnimation)return i();this._updatePlaned=!0,requestAnimationFrame(function(){o._updatePlaned=!1,i()})}},t.prototype._handlerIfEnable=function(n){var o=this;return function(){for(var i=[],a=0;ao?n-o:o-n},t.prototype._enoughToDrag=function(){return this._distanceBetweenNumbers(this._startOffset.x,this._draggingPoint.x)>5||this._distanceBetweenNumbers(this._startOffset.y,this._draggingPoint.y)>5},t.prototype._updateInteraction=function(n){var o=this._fingers;if(o===2)return this._setInteraction("zoom",n);if(o===1&&this._canDrag())return this._setInteraction("drag",n);this._setInteraction(null,n)},t.prototype._detectDoubleTap=function(n){var o=new Date().getTime();this._fingers>1&&(this._lastTouchStart=0),o-this._lastTouchStart<300?(pn(n),this._handleDoubleTap(n),hn(this._interaction)?this._handleZoomEnd():Vt(this._interaction)&&this._handleDragEnd()):this._isDoubleTap=!1,this._fingers===1&&(this._lastTouchStart=o)},t.prototype.simulate=function(n){var o=this;return function(i){var a=i.pageX,s=i.pageY,c=i.type,l=c==="mouseup",u=c==="mousedown";u&&(i.preventDefault(),o._listenMouseMove=!0),o._listenMouseMove&&(i.touches=l?[]:[{pageX:a,pageY:s}],n(i)),l&&(o._listenMouseMove=!1)}},t.prototype.componentDidMount=function(){this._bindEvents(),this._update()},t.prototype.componentWillUnmount=function(){this._stopAnimation(),this._unSubscribe()},t.prototype.render=function(){var n=this.props,o=n.children,i=n.containerProps,a=Ya.only(o),s=i||{};return jn.createElement(jn.Fragment,null,jn.createElement("style",null,bd),jn.createElement("div",De({},s,{ref:this._containerRef,className:Zi(la,s.className)}),ls(a,{className:Zi(ua,a.props.className)})))},t.defaultProps={animationDuration:250,draggableUnZoomed:!0,enforceBoundsDuringZoom:!1,centerContained:!1,enabled:!0,inertia:!0,inertiaFriction:.96,horizontalPadding:0,isTouch:wd,lockDragAxis:!1,maxZoom:5,minZoom:.5,onDoubleTap:At,onDragEnd:At,onDragStart:At,onDragUpdate:At,onZoomEnd:At,onZoomStart:At,onZoomUpdate:At,setOffsetsOnce:!1,shouldInterceptWheel:Dd,shouldCancelHandledTouchEndEvents:!1,tapZoomFactor:1,verticalPadding:0,wheelScaleFactor:1500,zoomOutFactor:1.3,doubleTapZoomOutOnMaxScale:!1,doubleTapToggleZoom:!1,_document:da?null:window.document},t}(ds);if(0)var mh,gh,vh,_h,yh,bh,Th;function tr(e){if(!e)return;let t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.round(e%60);return t===0?`${n}:${o.toString().padStart(2,"0")}`:`${t}:${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`}const zd=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Vd="ALT",nr=e=>{const{_:t}=tt(),{alt:n,lang:o,index:i,...a}=e;return!n||!n.trim()?null:r("button",{type:"button",class:"alt-badge clickable",...a,onClick:s=>{s.stopPropagation(),s.preventDefault(),V.showMediaAlt={alt:n,lang:o}},title:t({id:"5gfDMm"}),children:[Vd,!!i&&r("sup",{children:i})]})},Hd=140,Bd=280,fa=Le(e=>e!=null&&e.length?e.length>Hd||/[\n\r].*[\n\r]/.test(e.trim()):!1);function Ud({class:e="",media:t,to:n,lang:o,showOriginal:i,autoAnimate:a,showCaption:s,allowLongerCaption:c,altIndex:l,checkAspectRatio:u=!0,onClick:f=()=>{}}){let{blurhash:d,description:h,meta:p,previewRemoteUrl:m,previewUrl:_,remoteUrl:v,url:T,type:b}=t;/no\-preview\./i.test(_)&&(_=null);const{original:w={},small:I,focus:g}=p||{},x=i?w==null?void 0:w.width:(I==null?void 0:I.width)||(w==null?void 0:w.width),E=i?w==null?void 0:w.height:(I==null?void 0:I.height)||(w==null?void 0:w.height),A=i?T:_||T,M=i?v:m||v,R=x&&E,S=R?x>E?"landscape":"portrait":null,C=d?$r(d):null,N=D();let q;if(g){const re=(g.x+1)/2*100,H=(1-g.y)/2*100;q=`${re.toFixed(0)}% ${H.toFixed(0)}%`}const B=D(),X=ke(({x:re,y:H,scale:Z})=>{const{current:te}=B;if(te){const oe=Ed({x:re,y:H,scale:Z});Z===1?te.style.removeProperty("transform"):te.style.setProperty("transform",oe),te.closest(".media-zoom").style.touchAction=Z<=1.01?"pan-x":""}},[]),[ae,ie]=K(!1),ee={enabled:ae,draggableUnZoomed:!1,inertiaFriction:.9,tapZoomFactor:2,doubleTapToggleZoom:!0,containerProps:{className:"media-zoom",style:{overflow:"visible"}},onUpdate:X},Q=se(()=>n?re=>r(Zt,{to:n,...re}):"div",[n]),me=M?jd(M):null,he=b==="unknown"&&me&&/\.(mp4|m4r|m4v|mov|webm)$/i.test(me.pathname),z=b==="unknown"&&me&&/\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(me.pathname),ce=b==="image"||b==="unknown"&&_&&!he&&!z,le=D(),[Me,ge]=K(!1);Rt(()=>{if(!ce||!i||!le.current)return;const{offsetWidth:re,offsetHeight:H}=le.current,Z=x{const{children:H,...Z}=re;return r("figure",{...Z,children:[H,r("figcaption",{class:"media-caption",lang:o,dir:"auto",onClick:te=>{te.preventDefault(),te.stopPropagation(),V.showMediaAlt={alt:h,lang:o}},children:h})]})}:$,[Ze,nt]=K(void 0);if(ce)return ee.containerProps.style.display="inherit",Rt(()=>{zd&&i&&(async()=>{try{await fetch(A,{mode:"no-cors"}),B.current.src=A}catch{}})()},[A]),r(Y,{children:r(Q,{ref:le,class:`media media-image ${e}`,onClick:f,"data-orientation":S,"data-has-alt":!F||void 0,"data-has-natural-aspect-ratio":Ze||void 0,style:i?{backgroundImage:`url(${_})`,backgroundSize:Me?`${x}px ${E}px`:void 0,...ye}:He,children:i?r(Yi,{...ee,children:r("img",{ref:B,src:A,alt:h,width:x,height:E,"data-orientation":S,loading:"eager",decoding:"sync",onLoad:re=>{re.target.closest(".media-image").style.backgroundImage="",re.target.closest(".media-zoom").style.display="",ie(!0)},onError:re=>{const{src:H}=re.target;H===A&&M&&A!==M&&(re.target.src=M)}})}):r($,{children:[r("img",{src:A,alt:F?"":h,width:x,height:E,"data-orientation":S,loading:"lazy",style:{objectPosition:q||"center","--anim-duration":`${Math.min(Math.max(Math.max(x,E)/100,5),120)}s`},onLoad:re=>{re.target.dataset.loaded=!0;const H=re.target.closest(".media");if(!R&&H){const{naturalWidth:Z,naturalHeight:te}=re.target;H.dataset.orientation=Z>te?"landscape":"portrait",H.style.setProperty("--width",`${Z}px`),H.style.setProperty("--height",`${te}px`),H.style.aspectRatio=`${Z}/${te}`}if(u&&H){const{clientWidth:Z,clientHeight:te,naturalWidth:oe,naturalHeight:ue}=re.target;if(Z&&te&&oe&&ue)if(oe<88||ue<88)H.dataset.hasSmallDimension=!0;else{const W=ue*Z/oe;Math.abs(W-te)<5&&nt(!0)}}},onError:re=>{const{src:H}=re.target;H===A&&A!==M&&(re.target.src=M)}}),!F&&r(nr,{alt:h,lang:o,index:l})]})})});if(b==="gifv"||b==="video"||he){const re=w.duration>0,H=w.duration<31,Z=b==="gifv"&&H,te=w.duration<61,oe=tr(w.duration),ue=!i&&!a&&Z,Fe=!i&&a&&Z,W=w.duration>5,We=` + + `,Ln=` + + `;return r(Y,{children:r(Q,{class:`media ${e} media-${Z?"gif":"video"} ${Fe?"media-contain":""} ${ue?"media-hover-animate":""}`,"data-orientation":S,"data-formatted-duration":i?void 0:oe,"data-label":Z&&!i&&!Fe?"GIF":void 0,"data-has-alt":!F||void 0,style:!i&&He,onClick:pe=>{if(ue)try{N.current.pause()}catch{}f(pe)},onMouseEnter:()=>{if(ue)try{N.current.play()}catch{}},onMouseLeave:()=>{if(ue)try{N.current.pause()}catch{}},onFocus:()=>{if(ue)try{N.current.play()}catch{}},onBlur:()=>{if(ue)try{N.current.pause()}catch{}},children:[i||Fe?Z&&i?r(Yi,{...ee,enabled:!0,children:r("div",{ref:B,dangerouslySetInnerHTML:{__html:We}})}):Z?r("div",{class:"video-container",dangerouslySetInnerHTML:{__html:We}}):r("div",{class:"video-container",dangerouslySetInnerHTML:{__html:Ln}}):Z?r("video",{ref:N,src:T,poster:_,width:x,height:E,"data-orientation":S,preload:"auto",playsinline:!0,loop:!0,muted:!0,onTimeUpdate:W?pe=>{const{target:be}=pe,Se=be==null?void 0:be.closest(".media-gif");if(Se){const Oe=be.currentTime/be.duration*100;Se.style.setProperty("--progress",`${Oe}%`)}}:void 0}):r($,{children:[_?r("img",{src:_,alt:F?"":h,width:x,height:E,"data-orientation":S,loading:"lazy",decoding:"async",onLoad:pe=>{if(!R){const be=pe.target.closest(".media");if(be){const{naturalHeight:Se,naturalWidth:Oe}=pe.target;be.dataset.orientation=Oe>Se?"landscape":"portrait",be.style.setProperty("--width",`${Oe}px`),be.style.setProperty("--height",`${Se}px`),be.style.aspectRatio=`${Oe}/${Se}`}}}}):r("video",{src:T+"#t=0.1",width:x,height:E,"data-orientation":S,preload:"metadata",muted:!0,disablePictureInPicture:!0,onLoadedMetadata:pe=>{if(!re){const{duration:be}=pe.target;if(be){const Se=tr(be),Oe=pe.target.closest(".media-video");Oe&&(Oe.dataset.formattedDuration=Se)}}}}),r("div",{class:"media-play",children:r(L,{icon:"play",size:"xl",alt:"▶"})})]}),!i&&!F&&r(nr,{alt:h,lang:o,index:l})]})})}else if(b==="audio"||z){const re=tr(w.duration);return r(Y,{children:r(Q,{class:`media media-audio ${e}`,"data-formatted-duration":i?void 0:re,"data-has-alt":!F||void 0,onClick:f,style:!i&&He,children:[i?r("audio",{src:v||T,preload:"none",controls:!0,autoPlay:!0}):_?r("img",{src:_,alt:F?"":h,width:x,height:E,"data-orientation":S,loading:"lazy",onError:H=>{var Z,te;try{(te=(Z=H.target)==null?void 0:Z.remove)==null||te.call(Z)}catch{}}}):null,!i&&r($,{children:[r("div",{class:"media-play",children:r(L,{icon:"play",size:"xl",alt:"▶"})}),!F&&r(nr,{alt:h,lang:o,index:l})]})]})})}}function jd(e){return URL.parse(e,location.origin)}const _r=Qt(Ud,(e,t)=>{const n=e.media||{},o=t.media||{};return(n==null?void 0:n.id)===(o==null?void 0:o.id)&&n.url===o.url&&e.to===t.to&&e.class===t.class}),Wd=280,Kd=140,Zd=fs({limit:1,interval:1e3});function qd(e,t){return t.v1.accounts.$select(e).fetch()}const Gd=vo(Zd(qd)),Pt={public:{id:"7d1a0d"},local:{id:"d5zxa4"},unlisted:{id:"WDcQq9"},private:{id:"o34OrG"},direct:{id:"IV4QaU"}},Yd=window.ontouchstart!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent),Xd=new Intl.RelativeTimeFormat,Xi=80;function Qd(e){var t;return(t=e==null?void 0:e.options)!=null&&t.length?`📊: +${e.options.map(n=>`- ${n.title}${n.votesCount>=0?` (${n.votesCount})`:""}`).join(` +`)}`:""}function or(e){const{spoilerText:t,content:n,poll:o}=e;return(t?`${t} + +`:"")+bo(n)+Qd(o)}function ha(e=[],t=document){for(const n of e)try{return t.querySelectorAll(n)}catch{}return[]}function Jd(e){return!e||(e=e.trim(),!e)?!1:!!bo(e,{preProcess:n=>{for(const o of ha([".mention, pre, code, a:has(.invisible)",".mention, pre, code"],n))o.remove()}})}function ef(e){return bo(e,{preProcess:t=>{for(const n of ha([".mention, .hashtag, pre, code, a:has(.invisible)",".mention, .hashtag, pre, code"],t))n.remove();for(const n of t.querySelectorAll("a")){const o=n.innerText.trim();(o.startsWith("https://")||o.startsWith("http://"))&&n.remove()}}})}const tf=/^http/i,Qi=({post:e,instance:t,previewMode:n})=>{const{content:o,emojis:i,language:a,mentions:s,url:c}=e,l=D();return Rt(()=>{if(!l.current)return;const u=Ks(o,{emojis:i,returnDOM:!0});for(const f of u.querySelectorAll('a.u-url[target="_blank"]'))tf.test(f.innerText.trim())||f.removeAttribute("target");l.current.replaceChildren(u.cloneNode(!0))},[o,i.length]),r("div",{ref:l,lang:a,dir:"auto",class:"inner-content",onClick:yu({mentions:s,instance:t,previewMode:n,statusURL:c})})},nf={s:"small",m:"medium",l:"large"},of=vo(async e=>{const{detectAll:t}=await k(async()=>{const{detectAll:i}=await import("./tinyld-light-tbgyvj3S.js");return{detectAll:i}},[],import.meta.url);if(e=e==null?void 0:e.trim(),(e==null?void 0:e.length)>500)return null;const o=t(e)[0];return o!=null&&o.lang&&(o==null?void 0:o.accuracy)>.5?o.lang:null}),wn={id:"8fZueG"},yr={},Ji=(e,t=[])=>{if(!e)return!1;const n=Ds(!0),o=e!==n&&!En([e],[n])&&!t.find(i=>e===i||En([e],[i]));return yr[e+t]=!0,o};function Xt({statusID:e,status:t,instance:n,size:o="m",contentTextWeight:i,readOnly:a,enableCommentHint:s,withinContext:c,skeleton:l,enableTranslate:u,forceTranslate:f,previewMode:d,onMediaClick:h,quoted:p,onStatusLinkClick:m=()=>{},showFollowedTags:_,allowContextMenu:v,showActionsBar:T,showReplyParent:b,mediaFirst:w}){var oi,ri,ii,si;const{_:I,_:g}=tt();if(l)return r("div",{class:`status skeleton ${w?"status-media-first small":""}`,children:[!w&&r(st,{size:"xxl"}),r("div",{class:"container",children:[r("div",{class:"meta",children:[(o==="s"||w)&&r(st,{size:"m"})," ███ ████████"]}),r("div",{class:"content-container",children:[w&&r("div",{class:"media-first-container"}),r("div",{class:`content ${w?"media-first-content":""}`,children:r("p",{children:"████ ████████"})})]})]})]});const{masto:x,instance:E,authenticated:A}=lo({instance:n}),{instance:M}=lo(),R=E===M;let S=it(e||(t==null?void 0:t.id),E);const C=Pn(V);if(t||(t=C.statuses[S]||C.statuses[e],S=it(t==null?void 0:t.id,E)),!t)return null;const{account:{acct:N,avatar:q,avatarStatic:B,id:X,url:ae,displayName:ie,username:ee,emojis:Q,bot:me,group:he},id:z,repliesCount:ce,reblogged:le,reblogsCount:Me,favourited:ge,favouritesCount:Ve,bookmarked:Ae,poll:ye,muted:He,sensitive:Ce,spoilerText:F,visibility:Y,language:Ze,editedAt:nt,filtered:re,card:H,createdAt:Z,inReplyToId:te,inReplyToAccountId:oe,content:ue,mentions:Fe,mediaAttachments:W,reblog:We,uri:Ln,url:pe,emojis:be,tags:Se,pinned:Oe,_deleted:dt,_pinned:Mt,emojiReactions:ft}=t,[tn,To]=K(null);J(()=>{if(!ue||Ze||tn)return;let y;return y=setTimeout(async()=>{let P=await of(ef(ue));To(P)},1e3),()=>clearTimeout(y)},[ue,Ze]);const ve=Ze||tn,nn=!!(W!=null&&W.length);w&&nn&&(o="s");const wt=se(()=>Ir(),[]),qe=se(()=>wt&&wt===X,[X,wt]),ne=Ne(aa),_e=!qe&&!a&&!d&&Nr(re,ne);if((_e==null?void 0:_e.action)==="hide")return null;const Pe=y=>{y.shiftKey};if(o!=="l"&&_e)return r(hf,{status:t,filterInfo:_e,instance:E,containerProps:{onMouseEnter:Pe},showFollowedTags:!0,quoted:p});const Te=new Date(Z),xe=new Date(nt);let ht=Fe==null?void 0:Fe.find(y=>y.id===oe);!ht&&oe===z&&(ht={url:ae,username:ee,displayName:ie});const[Ot,Et]=K(ht);if(!c&&!Ot&&oe){const y=V.accounts[oe];y?Et(y):Gd(oe,x).then(P=>{Et(P),V.accounts[P.id]=P}).catch(P=>{})}const Mn=oe===wt||(Fe==null?void 0:Fe.find(y=>y.id===wt)),Ge=se(()=>!!(ir.account.get("preferences")||{})["reading:expand:spoilers"],[]),on=se(()=>{var P;return((P=(ir.account.get("preferences")||{})["reading:expand:media"])==null?void 0:P.toLowerCase())||"default"},[]),Ke=d||Ge||!!C.spoilers[z],xt=d||on==="show_all"||!!C.spoilersMedia[z];if(We)return he?r("div",{"data-state-post-id":S,class:"status-group",onMouseEnter:Pe,children:[r("div",{class:"status-pre-meta",children:[r(L,{icon:"group",size:"l",alt:g({id:"L8fEEm"})})," ",r(yt,{account:t.account,instance:E,showAvatar:!0})]}),r(Xt,{status:e?null:We,statusID:e?We.id:null,instance:E,size:o,contentTextWeight:i,readOnly:a,mediaFirst:w})]}):r("div",{"data-state-post-id":S,class:"status-reblog",onMouseEnter:Pe,children:[r("div",{class:"status-pre-meta",children:[r(L,{icon:"rocket",size:"l"})," ",r(O,{id:"DlhB4J",components:{0:r(yt,{account:t.account,instance:E,showAvatar:!0}),1:r("span",{})}})]}),r(Xt,{status:e?null:We,statusID:e?We.id:null,instance:E,size:o,contentTextWeight:i,readOnly:a,enableCommentHint:!0,mediaFirst:w})]});const St=ke(({children:y})=>r("div",{"data-state-post-id":S,class:"status-followed-tags",onMouseEnter:Pe,children:[r("div",{class:"status-pre-meta",children:[r(L,{icon:"hashtag",size:"l"})," ",C.statusFollowedTags[S].slice(0,3).map(P=>r(Zt,{to:E?`/${E}/t/${P}`:`/t/${P}`,class:"status-followed-tag-item",children:P},P))]}),y]}),[S,E,C.statusFollowedTags[S]]),rn=_&&((oi=C.statusFollowedTags[S])!=null&&oi.length)?St:$,fe=o==="l",[pt,Sa]=K(f),{contentTranslation:wo,contentTranslationAutoInline:zr}=C.settings;wo||(u=!1);const Vr=se(()=>{if(!wo||!zr||a||c&&!fe||d||F||Ce||ye||H||W!=null&&W.length)return!1;const y=Jo(ue);return y>0&&y<=Kd},[wo,zr,a,c,fe,d,F,Ce,ye,H,W,ue]),[Eo,On]=K(!1),[ka,xo]=K(!1),Hr=ao(),Br=ao(),Ia=ao(),Dt=D(null),Dn=g({id:"7jyUKe"}),Ur=ke(()=>Math.max(Math.round((F.length+Jo(ue))/140)||1,1),[F,ue]),jr=An(Te),Wr=nt&&An(xe);let sn=A&&Y!=="direct"&&Y!=="private";Y==="private"&&qe&&(sn=!0);const $n=y=>{var P;if(!R||!A)return alert(Dn);(y!=null&&y.shiftKey||(P=y==null?void 0:y.syntheticEvent)!=null&&P.shiftKey)&&yc({replyToStatus:t})||Gn({replyToStatus:t})},Kr=se(()=>W.some(y=>{var P,G;return!((G=(P=y.description)==null?void 0:P.trim)!=null&&G.call(P))}),[W]),Zr=se(()=>Math.floor((new Date-Te)/(1e3*60*60*24*30)),[Te]),So=async()=>{if(!R||!A)return alert(Dn),!1;try{if(V.statuses[S]={...t,reblogged:!le,reblogsCount:Me+(le?-1:1)},le){const y=await x.v1.statuses.$select(z).unreblog();mt(y,E)}else{const y=await x.v1.statuses.$select(z).reblog();mt(y,E)}return!0}catch{return V.statuses[S]=t,!1}},qr=async()=>{if(!R||!A)return alert(Dn),!1;try{if(V.statuses[S]={...t,favourited:!ge,favouritesCount:Ve+(ge?-1:1)},ge){const y=await x.v1.statuses.$select(z).unfavourite();mt(y,E)}else{const y=await x.v1.statuses.$select(z).favourite();mt(y,E)}return!0}catch{return V.statuses[S]=t,!1}},ko=async()=>{try{const y=await qr();!fe&&y&&Re(g(ge?{id:"sZvpIt",values:{0:ee||N}}:{id:"QB/n+J",values:{1:ee||N}}))}catch{}},Gr=async()=>{if(qn("@mastodon/post-bookmark")){if(!R||!A)return alert(Dn),!1;try{if(V.statuses[S]={...t,bookmarked:!Ae},Ae){const y=await x.v1.statuses.$select(z).unbookmark();mt(y,E)}else{const y=await x.v1.statuses.$select(z).bookmark();mt(y,E)}return!0}catch{return V.statuses[S]=t,!1}}},Yr=async()=>{try{const y=await Gr();!fe&&y&&Re(g(Ae?{id:"+Q6x2B",values:{2:ee||N}}:{id:"cQEDZY",values:{3:ee||N}}))}catch{}},an=C.settings.contentTranslationHideLanguages||[],[$t,Aa]=K(yr[ve+an]?Ji(ve,an):!1);J(()=>{if(!ve||$t||yr[ve+an])return;let y=setTimeout(()=>{const P=Ji(ve,an);P&&Aa(P)},1);return()=>clearTimeout(y)},[ve,$t,an]);const Xr=D(),Qr=D();async function Ca(y){var de,Ue,Nt,Io;y&&(Xr.current=x.v1.statuses.$select(e).rebloggedBy.list({limit:Xi}),Qr.current=x.v1.statuses.$select(e).favouritedBy.list({limit:Xi}));const[{value:P},{value:G}]=await Promise.allSettled([Xr.current.next(),Qr.current.next()]);if((de=P.value)!=null&&de.length||(Ue=G.value)!=null&&Ue.length){const kt=[];return(Nt=P.value)!=null&&Nt.length&&kt.push(...P.value.map(It=>(It._types=["reblog"],It))),(Io=G.value)!=null&&Io.length&&kt.push(...G.value.map(It=>(It._types=["favourite"],It))),{value:kt,done:P.done&&G.done}}return{value:[],done:!0}}const Pa=D(),Jr=["public","unlisted"].includes(Y),Ra=["public","unlisted","private"].includes(Y),ei=r($,{children:[!fe&&R&&r($,{children:r("div",{class:"menu-control-group-horizontal status-menu",children:[r(Ee,{onClick:$n,children:[r(L,{icon:"comment"}),r("span",{children:ce>0?rt(ce):g({id:"ImOQa9"})})]}),r(Oo,{subMenu:!0,confirmLabel:r($,{children:[r(L,{icon:"rocket"}),r("span",{children:g(le?{id:"QzzGsY"}:{id:"kulphB"})})]}),className:`menu-reblog ${le?"checked":""}`,menuExtras:r(Ee,{onClick:()=>{Gn({draftStatus:{status:` +${pe}`}})},children:[r(L,{icon:"quote"}),r("span",{children:r(O,{id:"ZhhOwV"})})]}),menuFooter:Kr&&!le?r("div",{class:"footer",children:[r(L,{icon:"alert"}),r(O,{id:"MB+wJL"})]}):Zr>=3&&r("div",{class:"footer",children:[r(L,{icon:"info"}),r("span",{children:r(O,{id:"dBme/4",values:{0:Xd.format(-Zr,"month")},components:{0:r("strong",{})}})})]}),disabled:!sn,onClick:async()=>{try{const y=await So();!fe&&y&&Re(g(le?{id:"BgT3ls",values:{4:ee||N}}:{id:"iSYdyi",values:{5:ee||N}}))}catch{}},children:[r(L,{icon:"rocket"}),r("span",{children:Me>0?rt(Me):g(le?{id:"QzzGsY"}:{id:"PiVIlD"})})]}),r(Ee,{onClick:ko,className:`menu-favourite ${ge?"checked":""}`,children:[r(L,{icon:"heart"}),r("span",{children:Ve>0?rt(Ve):g(ge?{id:"OcUmcH"}:{id:"W9FRBT"})})]}),qn("@mastodon/post-bookmark")&&r(Ee,{onClick:Yr,className:`menu-bookmark ${Ae?"checked":""}`,children:[r(L,{icon:"bookmark"}),r("span",{children:g(Ae?{id:"q8EQYI"}:{id:"PZlHt8"})})]})]})}),!fe&&R&&(fe||T)&&r(un,{}),(fe||T)&&r($,{children:r(Ee,{onClick:()=>{V.showGenericAccounts={heading:g({id:"+XOeb+"}),fetchAccounts:Ca,instance:E,showReactions:!0,postID:S}},children:[r(L,{icon:"react"}),r("span",{children:r(O,{id:"+XOeb+"})})]})}),!w&&r($,{children:[(u||!ve||$t)&&r(un,{}),u?r("div",{class:_n?"menu-horizontal":"",children:[r(Ee,{disabled:pt,onClick:()=>{Sa(!0)},children:[r(L,{icon:"translate"}),r("span",{children:r(O,{id:"pi8x/S"})})]}),_n&&r(Ee,{onClick:()=>{const y=or(t);y&&ji(y,ve)},children:[r(L,{icon:"speak"}),r("span",{children:r(O,{id:"yIBLq8"})})]})]}):(!ve||$t)&&r("div",{class:_n?"menu-horizontal":"",children:[r(bi,{to:`${E?`/${E}`:""}/s/${z}?translate=1`,children:[r(L,{icon:"translate"}),r("span",{children:r(O,{id:"pi8x/S"})})]}),_n&&r(Ee,{onClick:()=>{const y=or(t);y&&ji(y,ve)},children:[r(L,{icon:"speak"}),r("span",{children:r(O,{id:"yIBLq8"})})]})]})]}),(!fe&&R||u||!ve||$t)&&r(un,{}),!fe&&r($,{children:r(bi,{to:E?`/${E}/s/${z}`:`/s/${z}`,onClick:y=>{m(y,t)},children:[r(L,{icon:"arrows-right"}),r("small",{children:[r(O,{id:"8MkSAW",values:{0:ee||N},components:{0:r("span",{class:"bidi-isolate"})}}),r("br",{}),r("span",{class:"more-insignificant",children:[I(Pt[Y])," • ",jr]})]})]})}),!!nt&&r($,{children:r(Ee,{onClick:()=>{On(z)},children:[r(L,{icon:"history"}),r("small",{children:[r(O,{id:"QL+7Jw"}),r("br",{}),r("span",{class:"more-insignificant",children:r(O,{id:"DuJJm9",values:{editedDateText:Wr}})})]})]})}),r(Ee,{href:pe,target:"_blank",children:[r(L,{icon:"external"}),r("small",{class:"menu-double-lines",style:{maxWidth:"16em"},children:df(pe)})]}),r("div",{class:"menu-horizontal",children:[r(Ee,{onClick:()=>{try{navigator.clipboard.writeText(pe),Re(g({id:"edWbV6"}))}catch{Re(g({id:"W1ewR0"}))}},children:[r(L,{icon:"link"}),r("span",{children:r(O,{id:"he3ygx"})})]}),Jr&&(navigator==null?void 0:navigator.share)&&((ri=navigator==null?void 0:navigator.canShare)==null?void 0:ri.call(navigator,{url:pe}))&&r(Ee,{onClick:()=>{try{navigator.share({url:pe})}catch{alert(g({id:"TtG3Uh"}))}},children:[r(L,{icon:"share"}),r("span",{children:r(O,{id:"LFKLqp"})})]})]}),Jr&&fe&&r(Ee,{onClick:()=>{xo(!0)},children:[r(L,{icon:"code"}),r("span",{children:r(O,{id:"jdVwsS"})})]}),(qe||Mn)&&r(un,{}),(qe||Mn)&&r(Ee,{onClick:async()=>{try{const y=await x.v1.statuses.$select(z)[He?"unmute":"mute"]();mt(y,E),Re(g(He?{id:"Pm+5jw"}:{id:"ywB7JM"}))}catch{Re(g(He?{id:"c6jxNY"}:{id:"8SN9kN"}))}},children:He?r($,{children:[r(L,{icon:"unmute"}),r("span",{children:r(O,{id:"i51zUR"})})]}):r($,{children:[r(L,{icon:"mute"}),r("span",{children:r(O,{id:"OiUYO5"})})]})}),qe&&Ra&&r(Ee,{onClick:async()=>{try{const y=await x.v1.statuses.$select(z)[Oe?"unpin":"pin"]();mt(y,E),Re(g(Oe?{id:"Yx809+"}:{id:"S6P6E+"}))}catch{Re(g(Oe?{id:"A6cs15"}:{id:"vgUfWO"}))}},children:Oe?r($,{children:[r(L,{icon:"unpin"}),r("span",{children:r(O,{id:"XQMQZw"})})]}):r($,{children:[r(L,{icon:"pin"}),r("span",{children:r(O,{id:"lfHLsx"})})]})}),qe&&r("div",{class:"menu-horizontal",children:[qn("@mastodon/post-edit")&&r(Ee,{onClick:()=>{Gn({editStatus:t})},children:[r(L,{icon:"pencil"}),r("span",{children:r(O,{id:"ePK91l"})})]}),fe&&r(Oo,{subMenu:!0,confirmLabel:r($,{children:[r(L,{icon:"trash"}),r("span",{children:r(O,{id:"FbPNuJ"})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{(async()=>{try{await x.v1.statuses.$select(z).remove();const y=ps(z,E);y._deleted=!0,Re(g({id:"KiyvHV"}))}catch{Re(g({id:"Yb6p2q"}))}})()},children:[r(L,{icon:"trash"}),r("span",{children:r(O,{id:"Jb6/SB"})})]})]}),!qe&&fe&&r($,{children:[r(un,{}),r(Ee,{className:"danger",onClick:()=>{V.showReportModal={account:t.account,post:t}},children:[r(L,{icon:"flag"}),r("span",{children:r(O,{id:"7PQAMY"})})]})]})]}),ti=D(),[Nn,cn]=K(!1),[Fn,zn]=K({}),Vn=v||!fe&&!d&&!dt&&!p,La=sa(Yd&&Vn?y=>{var Ue;if(y.pointerType==="mouse")return;const{clientX:P,clientY:G}=((Ue=y.touches)==null?void 0:Ue[0])||y,de=y.target.closest("a");de&&Dt.current.contains(de)&&!de.getAttribute("href").startsWith("#")||(y.preventDefault(),zn({anchorPoint:{x:P,y:G},direction:"right"}),cn(!0))}:null,{threshold:600,captureEvent:!0,detect:"touch",cancelOnMovement:2}),Hn=!a&&!d&&!p,Ma=Bt("r, shift+r",$n,{enabled:Hn}),Oa=Bt("f, l",ko,{enabled:Hn}),Da=Bt("d",Yr,{enabled:Hn}),$a=Bt("shift+b",()=>{(async()=>{try{const y=await So();!fe&&y&&Re(g(le?{id:"G3tPNv",values:{6:ee||N}}:{id:"r8jwY4",values:{7:ee||N}}))}catch{}})()},{enabled:Hn&&sn}),Na=Bt("x",y=>{const P=document.activeElement.closest(".status-link, .status-focus");if(P){const G=P.querySelector(".spoiler-button:not(.spoiling)");if(G)y.stopPropagation(),G.click();else{const de=P.querySelector(".spoiler-media-button:not(.spoiling)");de&&(y.stopPropagation(),de.click())}}}),Bn=W.slice(0,fe?void 0:4),Un=W.length>1&&Bn.some(y=>!!y.description&&!fa(y.description)),Fa=se(()=>{if(!Un)return null;const y=[];return Bn.forEach((P,G)=>{if(!P.description)return;const de=y.findIndex(Ue=>Ue.media.description===P.description);de===-1?y.push({media:P,indices:[G]}):y[de].indices.push(G)}),y.map(({media:P,indices:G})=>r("div",{"data-caption-index":G.map(de=>de+1).join(" "),onClick:de=>{de.preventDefault(),de.stopPropagation(),V.showMediaAlt={alt:P.description,lang:ve}},title:P.description,children:[r("sup",{children:G.map(de=>de+1).join(" ")})," ",P.description]},P.id))},[Un,Bn,ve]),ln=se(()=>{var y;return!!te&&oe===((y=t.account)==null?void 0:y.id)||!!C.statusThreadNumber[S]},[te,oe,(ii=t.account)==null?void 0:ii.id,C.statusThreadNumber[S]]),za=se(()=>s&&!ln&&!c&&!te&&Y==="public"&&ce>0,[s,ln,c,te,ce,Y]),ni=se(()=>{if(H||ye||Ce||F||W!=null&&W.length||ln||c||te||ce<=0||!/[???︖❓❔⁇⁈⁉¿‽؟]/.test(ue))return!1;const G=Jo(ue);if(G>0&&G<=Wd)return!0},[H,ye,Ce,F,W,We,ln,c,te,ce,ue]);return r(rn,{children:[b&&!!(te&&oe)&&r(ff,{sKey:S}),r("article",{"data-state-post-id":S,ref:y=>{var G;Dt.current=y;const P=((G=y==null?void 0:y.closest)==null?void 0:G.call(y,".timeline-item, .timeline-item-alt, .status-link, .status-focus"))||y;Ma(P),Oa(P),Da(P),$a(P),Na(P)},tabindex:"-1",class:`status ${!c&&te&&Ot?"status-reply-to":""} visibility-${Y} ${Mt?"status-pinned":""} ${nf[o]} ${dt?"status-deleted":""} ${p?"status-card":""} ${Nn?"status-menu-open":""} ${w&&nn?"status-media-first":""}`,onMouseEnter:Pe,onContextMenu:y=>{var de,Ue;if(!Vn||y.metaKey)return;const P=y.target.closest("a");if(P&&Dt.current.contains(P)&&!P.getAttribute("href").startsWith("#"))return;const G=(de=window.getSelection)==null?void 0:de.call(window);if(G.toString().length>0){const{anchorNode:Nt}=G;if((Ue=Dt.current)!=null&&Ue.contains(Nt))return}y.preventDefault(),zn({anchorPoint:{x:y.clientX,y:y.clientY},direction:"right"}),cn(!0)},...Vn?La():{},children:[Vn&&r(xs,{ref:ti,state:Nn?"open":void 0,...Fn,onClose:y=>{var P,G,de;cn(!1),(y==null?void 0:y.reason)==="click"&&((de=(G=(P=Dt.current)==null?void 0:P.closest("[tabindex]"))==null?void 0:G.focus)==null||de.call(G))},portal:{target:document.body},containerProps:{style:{zIndex:1001},onClick:()=>{var y,P;(P=(y=ti.current)==null?void 0:y.closeMenu)==null||P.call(y)}},overflow:"auto",boundingBoxPadding:Ms(),unmountOnClose:!0,children:ei}),T&&o!=="l"&&!d&&!a&&!dt&&!p&&r("div",{class:`status-actions ${Nn==="actions-bar"?"open":""}`,ref:Pa,children:[r(Ht,{size:"s",title:g({id:"ImOQa9"}),alt:g({id:"ImOQa9"}),class:"reply-button",icon:"comment",iconSize:"m",onClick:$n}),r(Ht,{size:"s",checked:ge,title:[g({id:"W9FRBT"}),g({id:"OcUmcH"})],alt:[g({id:"W9FRBT"}),g({id:"8ab1sR"})],class:"favourite-button",icon:"heart",iconSize:"m",count:Ve,onClick:ko}),r("button",{type:"button",title:g({id:"2FYpfJ"}),class:"plain more-button",onClick:y=>{y.preventDefault(),y.stopPropagation(),zn({anchorRef:{current:y.currentTarget},align:"start",direction:"left",gap:0,shift:-8}),cn("actions-bar")},children:r(L,{icon:"more2",size:"m",alt:g({id:"2FYpfJ"})})})]}),o!=="l"&&r("div",{class:"status-badge",children:[le&&r(L,{class:"reblog",icon:"rocket",size:"s",alt:g({id:"b7T5Zj"})}),ge&&r(L,{class:"favourite",icon:"heart",size:"s",alt:g({id:"8ab1sR"})}),Ae&&r(L,{class:"bookmark",icon:"bookmark",size:"s",alt:g({id:"1C/9Sa"})}),Mt&&r(L,{class:"pin",icon:"pin",size:"s",alt:g({id:"kNiQp6"})})]}),o!=="s"&&r("a",{href:ae,tabindex:"-1",title:`@${N}`,onClick:y=>{y.preventDefault(),y.stopPropagation(),V.showAccount={account:t.account,instance:E}},children:r(st,{url:B||q,size:"xxl",squircle:me})}),r("div",{class:"container",children:[r("div",{class:"meta",children:[r("span",{class:"meta-name",children:r(yt,{account:t.account,instance:E,showAvatar:o==="s",showAcct:fe})})," ",o!=="l"&&(dt?r("span",{class:"status-deleted-tag",children:r(O,{id:"vGjmyl"})}):pe&&!d&&!a&&!p?r(Zt,{to:E?`/${E}/s/${z}`:`/s/${z}`,onClick:y=>{y.metaKey||y.ctrlKey||y.shiftKey||y.altKey||y.which===2||(y.preventDefault(),y.stopPropagation(),m==null||m(y,t),zn({anchorRef:{current:y.currentTarget},align:"end",direction:"bottom",gap:4}),cn(!0))},class:`time ${Nn&&(Fn!=null&&Fn.anchorRef)?"is-open":""}`,children:[za&&!ni?r(L,{icon:"comment2",size:"s",alt:Ie._({id:"RXmXDR",values:{repliesCount:ce}})}):Y!=="public"&&Y!=="direct"&&r(L,{icon:Tn[Y],alt:I(Pt[Y]),size:"s"})," ",r(at,{datetime:Te,format:"micro"}),!d&&!a&&r(L,{icon:"more2",class:"more",alt:g({id:"2FYpfJ"})})]}):r("span",{class:"time",children:[Y!=="public"&&Y!=="direct"&&r($,{children:[r(L,{icon:Tn[Y],alt:I(Pt[Y]),size:"s"})," "]}),r(at,{datetime:Te,format:"micro"})]}))]}),Y==="direct"&&r($,{children:[r("div",{class:"status-direct-badge",children:r(O,{id:"IV4QaU"})})," "]}),!c&&r($,{children:ln?r("div",{class:"status-thread-badge",children:[r(L,{icon:"thread",size:"s"}),r(O,{id:"lQ8zCz",values:{0:C.statusThreadNumber[S]?` ${C.statusThreadNumber[S]}/X`:""}})]}):!!te&&!!Ot&&(!!F||!Fe.find(y=>y.id===oe))&&r("div",{class:"status-reply-badge",children:[r(L,{icon:"reply"})," ",r(yt,{account:Ot,instance:E,short:!0})]})}),r("div",{class:`content-container ${F||Ce?"has-spoiler":""} ${Ke?"show-spoiler":""} ${xt?"show-media":""}`,"data-content-text-weight":i?Ur():null,style:(fe||i)&&{"--content-text-weight":Ur()},children:w&&nn?r($,{children:[(!!F||!!Ce)&&!Ge&&r($,{children:[!!F&&r("span",{class:"spoiler-content media-first-spoiler-content",lang:ve,dir:"auto",ref:Hr,"data-read-more":I(wn),children:[r(qt,{text:F,emojis:be})," "]}),r("button",{class:`light spoiler-button media-first-spoiler-button ${Ke?"spoiling":""}`,type:"button",onClick:y=>{y.preventDefault(),y.stopPropagation(),Ke?(delete V.spoilers[z],Ge||delete V.spoilersMedia[z]):(V.spoilers[z]=!0,Ge||(V.spoilersMedia[z]=!0))},children:[r(L,{icon:Ke?"eye-open":"eye-close"})," ",g(Ke?{id:"6lGV3K"}:{id:"lqBX03"})]})]}),r(sf,{mediaAttachments:W,language:ve,postID:z,instance:E}),!!ue&&r("div",{class:"media-first-content content",ref:Br,children:r(Qi,{post:t,instance:E,previewMode:d})})]}):r($,{children:[!!F&&r($,{children:[r("div",{class:"content spoiler-content",lang:ve,dir:"auto",ref:Hr,"data-read-more":I(wn),children:r("p",{children:r(qt,{text:F,emojis:be})})}),Ge||d?r("div",{class:"spoiler-divider",children:[r(L,{icon:"eye-open"})," ",r(O,{id:"gnKo7f"})]}):r("button",{class:`light spoiler-button ${Ke?"spoiling":""}`,type:"button",onClick:y=>{y.preventDefault(),y.stopPropagation(),Ke?(delete V.spoilers[z],Ge||delete V.spoilersMedia[z]):(V.spoilers[z]=!0,Ge||(V.spoilersMedia[z]=!0))},children:[r(L,{icon:Ke?"eye-open":"eye-close"})," ",g(Ke?{id:"6lGV3K"}:{id:"lqBX03"})]})]}),!!ue&&r("div",{class:"content",ref:Br,"data-read-more":I(wn),inert:F&&!Ke?!0:void 0,children:[r(Qi,{post:t,instance:E,previewMode:d}),r(pf,{id:z,instance:E,level:p})]}),!!ye&&r(hd,{lang:ve,poll:ye,readOnly:a||!R||!A,onUpdate:y=>{V.statuses[S].poll=y},refresh:()=>x.v1.polls.$select(ye.id).fetch().then(y=>{V.statuses[S].poll=y}).catch(y=>{}),votePoll:y=>x.v1.polls.$select(ye.id).votes.create({choices:y}).then(P=>{V.statuses[S].poll=P}).catch(P=>{})}),((u||Vr)&&Jd(ue)&&$t||pt)&&r(qu,{forceTranslate:pt||Vr,mini:!fe&&!c,sourceLanguage:ve,autoDetected:tn,text:or(t)}),!d&&Ce&&!!W.length&&on!=="show_all"&&r("button",{class:`plain spoiler-media-button ${xt?"spoiling":""}`,type:"button",hidden:!Ge&&!!F,onClick:y=>{y.preventDefault(),y.stopPropagation(),xt?delete V.spoilersMedia[z]:V.spoilersMedia[z]=!0},children:[r(L,{icon:xt?"eye-open":"eye-close"})," ",g(xt?{id:"6lGV3K"}:{id:"9ZCilh"})]}),!!W.length&&(W.length>1&&(fe||c&&o==="m")?r("div",{class:"media-large-container",children:W.map((y,P)=>r("div",{class:"media-container media-eq1",children:r(_r,{media:y,autoAnimate:!0,showCaption:!0,allowLongerCaption:!ue,lang:ve,to:`/${E}/s/${z}?${c?"media":"media-only"}=${P+1}`,onClick:h?G=>h(G,P,y,t):void 0})},y.id))}):r(rf,{lang:ve,enabled:Un,captionChildren:Fa,children:r("div",{ref:Ia,class:`media-container media-eq${W.length} ${W.length>2?"media-gt2":""} ${W.length>4?"media-gt4":""}`,children:Bn.map((y,P)=>r(_r,{media:y,autoAnimate:fe,showCaption:W.length===1,allowLongerCaption:!ue&&W.length===1,lang:ve,altIndex:Un&&!!y.description&&P+1,to:`/${E}/s/${z}?${c?"media":"media-only"}=${P+1}`,onClick:h?G=>{h(G,P,y,t)}:void 0,checkAspectRatio:W.length===1},y.id))})})),!!H&&/^https/i.test(H==null?void 0:H.url)&&!Ce&&!F&&!ye&&!W.length&&!C.statusQuotes[S]&&r(cf,{card:H,selfReferential:(H==null?void 0:H.url)===t.url||(H==null?void 0:H.url)===t.uri,selfAuthor:(si=H==null?void 0:H.authors)==null?void 0:si.some(y=>{var P;return((P=y.account)==null?void 0:P.url)===ae}),instance:M})]})}),!fe&&ni&&r("div",{class:"content-comment-hint insignificant",children:[r(L,{icon:"comment2",alt:g({id:"N8UzTV"})})," ",ce]}),fe&&r($,{children:[r("div",{class:"extra-meta",children:dt?r("span",{class:"status-deleted-tag",children:r(O,{id:"vGjmyl"})}):r($,{children:[r("span",{children:I(Pt[Y])})," •"," ",r("a",{href:pe,target:"_blank",rel:"noopener noreferrer",children:[new Date().getTime()-Te.getTime()<864e5&&r($,{children:[r(at,{datetime:Te,format:"micro"})," ","‒"," "]}),r("time",{class:"created",datetime:Te.toISOString(),title:Te.toLocaleString(),children:jr})]}),nt&&r($,{children:[" ","• ",r(L,{icon:"pencil",alt:g({id:"MRZxAn"})})," ",r("time",{tabIndex:"0",class:"edited",datetime:xe.toISOString(),onClick:()=>{On(z)},children:Wr})]})]})}),!!(ft!=null&&ft.length)&&r("div",{class:"emoji-reactions",children:ft.map(y=>{const{name:P,count:G,me:de,url:Ue,staticUrl:Nt}=y;if(Ue)return r("span",{class:`emoji-reaction tag ${de?"":"insignificant"}`,children:[r(pr,{alt:P,url:Ue,staticUrl:Nt})," ",G]});if(/^:.+?:$/.test(P)){const kt=be.find(It=>It.shortcode===P.replace(/^:/,"").replace(/:$/,""));if(kt)return r("span",{class:`emoji-reaction tag ${de?"":"insignificant"}`,children:[r(pr,{alt:P,url:kt.url,staticUrl:kt.staticUrl})," ",G]})}return r("span",{class:`emoji-reaction tag ${de?"":"insignificant"}`,children:[P," ",G]})})}),r("div",{class:`actions ${dt?"disabled":""}`,children:[r("div",{class:"action has-count",children:r(Ht,{title:g({id:"ImOQa9"}),alt:g({id:"VbyRUy"}),class:"reply-button",icon:"comment",count:ce,onClick:$n})}),r("div",{class:"action has-count",children:r(Oo,{disabled:!sn,onClick:So,confirmLabel:r($,{children:[r(L,{icon:"rocket"}),r("span",{children:g(le?{id:"QzzGsY"}:{id:"kulphB"})})]}),menuExtras:r(Ee,{onClick:()=>{Gn({draftStatus:{status:` +${pe}`}})},children:[r(L,{icon:"quote"}),r("span",{children:r(O,{id:"ZhhOwV"})})]}),menuFooter:Kr&&!le&&r("div",{class:"footer",children:[r(L,{icon:"alert"}),r(O,{id:"MB+wJL"})]}),children:r(Ht,{checked:le,title:[g({id:"kulphB"}),g({id:"QzzGsY"})],alt:[g({id:"kulphB"}),g({id:"b7T5Zj"})],class:"reblog-button",icon:"rocket",count:Me,disabled:!sn})})}),r("div",{class:"action has-count",children:r(Ht,{checked:ge,title:[g({id:"W9FRBT"}),g({id:"OcUmcH"})],alt:[g({id:"W9FRBT"}),g({id:"8ab1sR"})],class:"favourite-button",icon:"heart",count:Ve,onClick:qr})}),qn("@mastodon/post-bookmark")&&r("div",{class:"action",children:r(Ht,{checked:Ae,title:[g({id:"PZlHt8"}),g({id:"q8EQYI"})],alt:[g({id:"PZlHt8"}),g({id:"1C/9Sa"})],class:"bookmark-button",icon:"bookmark",onClick:Gr})}),r(Os,{portal:{target:document.querySelector(".status-deck")||document.body},align:"end",gap:4,overflow:"auto",viewScroll:"close",menuButton:r("div",{class:"action",children:r("button",{type:"button",title:g({id:"2FYpfJ"}),class:"plain more-button",children:r(L,{icon:"more",size:"l",alt:g({id:"2FYpfJ"})})})}),children:ei})]})]})]}),!!Eo&&r(ar,{onClick:y=>{y.target===y.currentTarget&&On(!1)},children:r(lf,{statusID:Eo,instance:E,fetchStatusHistory:()=>x.v1.statuses.$select(Eo).history.list(),onClose:()=>{var y;On(!1),(y=Dt.current)==null||y.focus()}})}),!!ka&&r(ar,{onClick:y=>{y.target===y.currentTarget&&xo(!1)},children:r(uf,{post:t,instance:E,onClose:()=>{xo(!1)}})})]})]})}function rf(e){const{enabled:t,children:n,lang:o,captionChildren:i}=e;return!t||!i?n:r("figure",{class:"media-figure-multiple",children:[n,r("figcaption",{lang:o,dir:"auto",children:i})]})}function sf(e){const{mediaAttachments:t,language:n,postID:o,instance:i}=e,a=t.length>1,s=D(),[c,l]=K(0);return J(()=>{let u=()=>{const{clientWidth:f,scrollLeft:d}=s.current,h=Math.round(Math.abs(d)/f);l(h)};return s.current&&s.current.addEventListener("scroll",u,{passive:!0}),()=>{s.current&&s.current.removeEventListener("scroll",u)}},[]),r($,{children:[r("div",{class:"media-first-container",children:[r("div",{class:"media-first-carousel",ref:s,children:t.map((u,f)=>r("div",{class:"media-first-item",children:r(_r,{media:u,lang:n,to:`/${i}/s/${o}?media=${f+1}`})},u.id))}),a&&r("div",{class:"media-carousel-controls",children:[r("div",{class:"carousel-indexer",children:[c+1,"/",t.length]}),r("label",{class:"media-carousel-button",children:r("button",{type:"button",class:"carousel-button",hidden:c===0,onClick:u=>{u.preventDefault(),u.stopPropagation(),s.current.focus(),s.current.scrollTo({left:s.current.clientWidth*(c-1)*(hr()?-1:1),behavior:"smooth"})},children:r(L,{icon:"arrow-left"})})}),r("label",{class:"media-carousel-button",children:r("button",{type:"button",class:"carousel-button",hidden:c===t.length-1,onClick:u=>{u.preventDefault(),u.stopPropagation(),s.current.focus(),s.current.scrollTo({left:s.current.clientWidth*(c+1)*(hr()?-1:1),behavior:"smooth"})},children:r(L,{icon:"arrow-right"})})})]})]}),a&&r("div",{class:"media-carousel-dots",style:{"--dots-count":t.length},children:t.map((u,f)=>r("span",{class:`carousel-dot ${f===c?"active":""}`},u.id))})]})}function es(e){return Ws.toUnicode(URL.parse(e).hostname.replace(/^www\./,"").replace(/\/$/,""))}function ts(e){return["x.com","twitter.com","threads.net","bsky.app"].includes(e)}function af({authors:e,hidden:t,children:n}){var i,a;if(t||!((a=(i=e==null?void 0:e[0])==null?void 0:i.account)!=null&&a.id))return n;const o=e[0].account;return r("div",{class:"card-byline",children:[n,r("div",{class:"card-byline-author",children:[r(L,{icon:"link",size:"s"})," ",r("small",{children:r(O,{id:"4LHHK6",components:{0:r(yt,{account:o,showAvatar:!0})}})})]})]})}function cf({card:e,selfReferential:t,selfAuthor:n,instance:o}){var X;const i=Pn(V),{blurhash:a,title:s,description:c,html:l,providerName:u,providerUrl:f,authorName:d,authorUrl:h,width:p,height:m,image:_,imageDescription:v,url:T,type:b,embedUrl:w,language:I,publishedAt:g,authors:x}=e,E=s||u||d,M=p/m>=1.2?"large":"",[R,S]=K(null);if(J(()=>{E&&_&&!t&&Xa(T)&&Qa(o,T).then(ae=>{if(!ae)return;const{id:ie,url:ee}=ae;S("#"+ee)})},[E,_,t]),i.unfurledLinks[T])return null;const C=/`;\n this.domRefFrame.insertAdjacentHTML('beforeend', iframeHTML);\n this.domRefFrame.classList.add('activated');\n this.isIframeLoaded = true;\n this.attemptShortAutoPlay();\n this.dispatchEvent(new CustomEvent('liteYoutubeIframeLoaded', {\n detail: {\n videoId: this.videoId,\n },\n bubbles: true,\n cancelable: true,\n }));\n }\n }\n initImagePlaceholder() {\n const posterUrlWebp = `https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;\n const posterUrlJpeg = `https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`;\n this.domRefImg.fallback.loading = this.posterLoading;\n this.domRefImg.webp.srcset = posterUrlWebp;\n this.domRefImg.jpeg.srcset = posterUrlJpeg;\n this.domRefImg.fallback.src = posterUrlJpeg;\n this.domRefImg.fallback.setAttribute('aria-label', `${this.videoPlay}: ${this.videoTitle}`);\n this.domRefImg?.fallback?.setAttribute('alt', `${this.videoPlay}: ${this.videoTitle}`);\n }\n initIntersectionObserver() {\n const options = {\n root: null,\n rootMargin: '0px',\n threshold: 0,\n };\n const observer = new IntersectionObserver((entries, observer) => {\n entries.forEach(entry => {\n if (entry.isIntersecting && !this.isIframeLoaded) {\n LiteYTEmbed.warmConnections(this);\n this.addIframe(true);\n observer.unobserve(this);\n }\n });\n }, options);\n observer.observe(this);\n if (this.autoPause) {\n const windowPause = new IntersectionObserver((e, o) => {\n e.forEach(entry => {\n if (entry.intersectionRatio !== 1) {\n this.shadowRoot\n .querySelector('iframe')\n ?.contentWindow?.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}', '*');\n }\n });\n }, { threshold: 1 });\n windowPause.observe(this);\n }\n }\n attemptShortAutoPlay() {\n if (this.isYouTubeShort()) {\n setTimeout(() => {\n this.shadowRoot\n .querySelector('iframe')\n ?.contentWindow?.postMessage('{\"event\":\"command\",\"func\":\"' + 'playVideo' + '\",\"args\":\"\"}', '*');\n }, 2000);\n }\n }\n isYouTubeShort() {\n return (this.getAttribute('short') === '' &&\n window.matchMedia('(max-width: 40em)').matches);\n }\n static addPrefetch(kind, url) {\n const linkElem = document.createElement('link');\n linkElem.rel = kind;\n linkElem.href = url;\n linkElem.crossOrigin = 'true';\n document.head.append(linkElem);\n }\n static warmConnections(context) {\n if (LiteYTEmbed.isPreconnected || window.liteYouTubeIsPreconnected)\n return;\n LiteYTEmbed.addPrefetch('preconnect', 'https://i.ytimg.com/');\n LiteYTEmbed.addPrefetch('preconnect', 'https://s.ytimg.com');\n if (!context.noCookie) {\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube.com');\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.google.com');\n LiteYTEmbed.addPrefetch('preconnect', 'https://googleads.g.doubleclick.net');\n LiteYTEmbed.addPrefetch('preconnect', 'https://static.doubleclick.net');\n }\n else {\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube-nocookie.com');\n }\n LiteYTEmbed.isPreconnected = true;\n window.liteYouTubeIsPreconnected = true;\n }\n}\nLiteYTEmbed.isPreconnected = false;\ncustomElements.define('lite-youtube', LiteYTEmbed);\n//# sourceMappingURL=lite-youtube.js.map","const digitLookup = new Uint8Array(128);\nfor (let i = 0; i < 83; i++) {\n digitLookup[\n '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~'.charCodeAt(\n i,\n )\n ] = i;\n}\nconst decode83 = (str, start, end) => {\n let value = 0;\n while (start < end) {\n value *= 83;\n value += digitLookup[str.charCodeAt(start++)];\n }\n return value;\n};\n\nconst pow = Math.pow;\nconst PI = Math.PI;\nconst PI2 = PI * 2;\n\nconst d = 3294.6;\nconst e = 269.025;\nconst sRGBToLinear = (value) =>\n value > 10.31475 ? pow(value / e + 0.052132, 2.4) : value / d;\n\nconst linearTosRGB = (v) =>\n ~~(v > 0.00001227 ? e * pow(v, 0.416666) - 13.025 : v * d + 1);\n\nconst signSqr = (x) => (x < 0 ? -1 : 1) * x * x;\n\n/**\n * Fast approximate cosine implementation\n * Based on FTrig https://github.com/netcell/FTrig\n */\nconst fastCos = (x) => {\n x += PI / 2;\n while (x > PI) {\n x -= PI2;\n }\n const cos = 1.27323954 * x - 0.405284735 * signSqr(x);\n return 0.225 * (signSqr(cos) - cos) + cos;\n};\n\n/**\n * Extracts average color from BlurHash image\n * @param {string} blurHash BlurHash image string\n * @returns {[number, number, number]}\n */\nexport function getBlurHashAverageColor(blurHash) {\n const val = decode83(blurHash, 2, 6);\n return [val >> 16, (val >> 8) & 255, val & 255];\n}\n\n/**\n * Decodes BlurHash image\n * @param {string} blurHash BlurHash image string\n * @param {number} width Output image width\n * @param {number} height Output image height\n * @param {?number} punch\n * @returns {Uint8ClampedArray}\n */\nexport function decodeBlurHash(blurHash, width, height, punch) {\n const sizeFlag = decode83(blurHash, 0, 1);\n const numX = (sizeFlag % 9) + 1;\n const numY = ~~(sizeFlag / 9) + 1;\n const size = numX * numY;\n\n let i = 0,\n j = 0,\n x = 0,\n y = 0,\n r = 0,\n g = 0,\n b = 0,\n basis = 0,\n basisY = 0,\n colorIndex = 0,\n pixelIndex = 0,\n value = 0;\n\n const maximumValue = ((decode83(blurHash, 1, 2) + 1) / 13446) * (punch | 1);\n\n const colors = new Float64Array(size * 3);\n\n const averageColor = getBlurHashAverageColor(blurHash);\n for (i = 0; i < 3; i++) {\n colors[i] = sRGBToLinear(averageColor[i]);\n }\n\n for (i = 1; i < size; i++) {\n value = decode83(blurHash, 4 + i * 2, 6 + i * 2);\n colors[i * 3] = signSqr(~~(value / 361) - 9) * maximumValue;\n colors[i * 3 + 1] = signSqr((~~(value / 19) % 19) - 9) * maximumValue;\n colors[i * 3 + 2] = signSqr((value % 19) - 9) * maximumValue;\n }\n\n const cosinesY = new Float64Array(numY * height);\n const cosinesX = new Float64Array(numX * width);\n for (j = 0; j < numY; j++) {\n for (y = 0; y < height; y++) {\n cosinesY[j * height + y] = fastCos((PI * y * j) / height);\n }\n }\n for (i = 0; i < numX; i++) {\n for (x = 0; x < width; x++) {\n cosinesX[i * width + x] = fastCos((PI * x * i) / width);\n }\n }\n\n const bytesPerRow = width * 4;\n const pixels = new Uint8ClampedArray(bytesPerRow * height);\n\n for (y = 0; y < height; y++) {\n for (x = 0; x < width; x++) {\n r = g = b = 0;\n for (j = 0; j < numY; j++) {\n basisY = cosinesY[j * height + y];\n for (i = 0; i < numX; i++) {\n basis = cosinesX[i * width + x] * basisY;\n colorIndex = (i + j * numX) * 3;\n r += colors[colorIndex] * basis;\n g += colors[colorIndex + 1] * basis;\n b += colors[colorIndex + 2] * basis;\n }\n }\n\n pixelIndex = 4 * x + y * bytesPerRow;\n pixels[pixelIndex] = linearTosRGB(r);\n pixels[pixelIndex + 1] = linearTosRGB(g);\n pixels[pixelIndex + 2] = linearTosRGB(b);\n pixels[pixelIndex + 3] = 255; // alpha\n }\n }\n return pixels;\n}\n","/**\n * @param {string[]} splittedHtml\n * @param {{ char?: string; count?: number}} options\n * @returns {string}\n */\nconst addIndentation = (splittedHtml, options = {}) => {\n const char = options.char || ' '\n const count = options.count || 2\n\n let level = 0\n const opened = []\n\n return splittedHtml.reverse().reduce((indented, elTag) => {\n if (opened.length\n && level\n && opened[level]\n /* if current element tag is the same as previously opened one */\n && opened[level] === elTag.substring(1, opened[level].length + 1)\n ) {\n opened.splice(level, 1)\n level--\n }\n\n const indentation = char.repeat(level ? level * count : 0)\n\n const newIndented = [\n `${indentation}${elTag}`,\n ...indented,\n ]\n\n // if current element tag is closing tag\n // add it to opened elements\n if (elTag.substring(0, 2) === ' (\n // Replace\n // - 1 or more spaces or tabs at the start of line\n // - 1 or more spaces or tabs at the end of line\n // - empty lines\n // with empty string\n nonFormattedString.trim().replace(/(^(\\s|\\t)+|(( |\\t)+)$)/gm, '')\n)\n\n/**\n * @param {string} markup\n * @returns {string[]} Array of strings splitted on new lines without empty lines\n */\nconst mergeAttributesWithElements = (markup) => {\n const splittedMarkup = removeEmptyLines(markup).split('\\n')\n\n const mergedLines = []\n let currentElement = ''\n for (let i = 0; i < splittedMarkup.length; i += 1) {\n const line = splittedMarkup[i]\n\n // If line is closing element/tag separate closing tag from rest of the line with space\n if (line.endsWith('/>')) {\n mergedLines.push(`${currentElement}${line.slice(0, -2)} />`)\n currentElement = ''\n // eslint-disable-next-line no-continue\n continue\n }\n\n if (line.endsWith('>')) {\n mergedLines.push(`${currentElement}${\n line.startsWith('>') || line.startsWith('<') ? '' : ' '\n }${line}`)\n currentElement = ''\n // eslint-disable-next-line no-continue\n continue\n }\n\n currentElement += currentElement.length ? ` ${line}` : line\n }\n\n return mergedLines\n}\n\nmodule.exports = {\n mergeAttributesWithElements,\n removeEmptyLines,\n}\n","const addIndentation = require('./utils/addIndentation')\nconst { mergeAttributesWithElements } = require('./utils/toLines')\n\n/**\n * @param {string} markup\n * @param {{ char?: string; count?: number }} options\n * @returns {string}\n */\nconst prettify = (markup, options = {}) => {\n const splitted = mergeAttributesWithElements(markup)\n\n return addIndentation(splitted, options)\n}\n\nmodule.exports = prettify\n","import { useRef as s, useCallback as h, useEffect as g } from \"react\";\nvar l = /* @__PURE__ */ ((e) => (e.Mouse = \"mouse\", e.Touch = \"touch\", e.Pointer = \"pointer\", e))(l || {}), d = /* @__PURE__ */ ((e) => (e.CancelledByMovement = \"cancelled-by-movement\", e.CancelledByRelease = \"cancelled-by-release\", e.CancelledOutsideElement = \"cancelled-outside-element\", e))(d || {});\nconst A = () => typeof window == \"object\" ? window?.PointerEvent ?? null : null, z = () => typeof window == \"object\" ? window?.TouchEvent ?? null : null;\nfunction U(e) {\n const { nativeEvent: t } = e, u = z();\n return u && t instanceof u || \"touches\" in e;\n}\nfunction X(e) {\n const t = A();\n return e.nativeEvent instanceof MouseEvent && !(t && e.nativeEvent instanceof t);\n}\nfunction Y(e) {\n const { nativeEvent: t } = e;\n if (!t)\n return !1;\n const u = A();\n return u && t instanceof u || \"pointerId\" in t;\n}\nfunction R(e) {\n return X(e) || U(e) || Y(e);\n}\nfunction j(e) {\n return U(e) ? {\n x: e.touches[0].pageX,\n y: e.touches[0].pageY\n } : X(e) || Y(e) ? {\n x: e.pageX,\n y: e.pageY\n } : null;\n}\nfunction G(e) {\n return {\n target: e.target,\n currentTarget: e.currentTarget,\n nativeEvent: e,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n persist: () => {\n }\n };\n}\nfunction J(e, {\n threshold: t = 400,\n captureEvent: u = !1,\n detect: y = l.Pointer,\n cancelOnMovement: w = !1,\n cancelOutsideElement: v = !0,\n filterEvents: p,\n onStart: M,\n onMove: C,\n onFinish: L,\n onCancel: b\n} = {}) {\n const P = s(!1), c = s(!1), I = s(), a = s(), T = s(e), f = s(null), E = h(\n (n) => (r) => {\n c.current || R(r) && (p !== void 0 && !p(r) || (u && r.persist(), M?.(r, { context: n }), f.current = j(r), c.current = !0, I.current = r.currentTarget, a.current = setTimeout(() => {\n T.current && (T.current(r, { context: n }), P.current = !0);\n }, t)));\n },\n [u, p, M, t]\n ), i = h(\n (n) => (r, o) => {\n R(r) && c.current && (f.current = null, u && r.persist(), P.current ? L?.(r, { context: n }) : c.current && b?.(r, { context: n, reason: o ?? d.CancelledByRelease }), P.current = !1, c.current = !1, a.current !== void 0 && clearTimeout(a.current));\n },\n [u, L, b]\n ), m = h(\n (n) => (r) => {\n if (C?.(r, { context: n }), w !== !1 && f.current) {\n const o = j(r);\n if (o) {\n const B = w === !0 ? 25 : w, D = {\n x: Math.abs(o.x - f.current.x),\n y: Math.abs(o.y - f.current.y)\n };\n (D.x > B || D.y > B) && i(n)(r, d.CancelledByMovement);\n }\n }\n },\n [i, w, C]\n ), q = h(\n (n) => {\n if (e === null)\n return {};\n switch (y) {\n case l.Mouse: {\n const r = {\n onMouseDown: E(n),\n onMouseMove: m(n),\n onMouseUp: i(n)\n };\n return v && (r.onMouseLeave = (o) => {\n i(n)(o, d.CancelledOutsideElement);\n }), r;\n }\n case l.Touch:\n return {\n onTouchStart: E(n),\n onTouchMove: m(n),\n onTouchEnd: i(n)\n };\n case l.Pointer: {\n const r = {\n onPointerDown: E(n),\n onPointerMove: m(n),\n onPointerUp: i(n)\n };\n return v && (r.onPointerLeave = (o) => i(n)(o, d.CancelledOutsideElement)), r;\n }\n }\n },\n [e, i, v, y, m, E]\n );\n return g(() => {\n if (!window)\n return;\n function n(r) {\n const o = G(r);\n i()(o);\n }\n return window.addEventListener(\"mouseup\", n), window.addEventListener(\"touchend\", n), window.addEventListener(\"pointerup\", n), () => {\n window.removeEventListener(\"mouseup\", n), window.removeEventListener(\"touchend\", n), window.removeEventListener(\"pointerup\", n);\n };\n }, [i]), g(\n () => () => {\n a.current !== void 0 && clearTimeout(a.current);\n },\n []\n ), g(() => {\n T.current = e;\n }, [e]), q;\n}\nexport {\n d as LongPressCallbackReason,\n l as LongPressEventType,\n J as useLongPress\n};\n","import { i18n } from '@lingui/core';\nimport { plural } from '@lingui/core/macro';\nimport { Plural, Trans, useLingui } from '@lingui/react/macro';\nimport { useState } from 'preact/hooks';\n\nimport shortenNumber from '../utils/shorten-number';\n\nimport EmojiText from './emoji-text';\nimport Icon from './icon';\nimport RelativeTime from './relative-time';\n\nexport default function Poll({\n poll,\n lang,\n readOnly,\n refresh = () => {},\n votePoll = () => {},\n}) {\n const { t } = useLingui();\n const [uiState, setUIState] = useState('default');\n const {\n expired,\n expiresAt,\n id,\n multiple,\n options,\n ownVotes,\n voted,\n votersCount,\n votesCount,\n emojis,\n } = poll;\n const expiresAtDate = !!expiresAt && new Date(expiresAt); // Update poll at point of expiry\n // NOTE: Disable this because setTimeout runs immediately if delay is too large\n // https://stackoverflow.com/a/56718027/20838\n // useEffect(() => {\n // let timeout;\n // if (!expired && expiresAtDate) {\n // const ms = expiresAtDate.getTime() - Date.now() + 1; // +1 to give it a little buffer\n // if (ms > 0) {\n // timeout = setTimeout(() => {\n // setUIState('loading');\n // (async () => {\n // // await refresh();\n // setUIState('default');\n // })();\n // }, ms);\n // }\n // }\n // return () => {\n // clearTimeout(timeout);\n // };\n // }, [expired, expiresAtDate]);\n\n const pollVotesCount = multiple ? votersCount : votesCount;\n let roundPrecision = 0;\n\n if (pollVotesCount <= 1000) {\n roundPrecision = 0;\n } else if (pollVotesCount <= 10000) {\n roundPrecision = 1;\n } else if (pollVotesCount <= 100000) {\n roundPrecision = 2;\n }\n\n const [showResults, setShowResults] = useState(false);\n const optionsHaveVoteCounts = options.every((o) => o.votesCount !== null);\n\n return (\n \n {(showResults && optionsHaveVoteCounts) || voted || expired ? (\n <>\n
    \n {options.map((option, i) => {\n const { title, votesCount: optionVotesCount } = option;\n const ratio = pollVotesCount\n ? optionVotesCount / pollVotesCount\n : 0;\n const percentage = ratio\n ? ratio.toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n maximumFractionDigits: roundPrecision,\n })\n : '0%';\n\n const isLeading =\n optionVotesCount > 0 &&\n optionVotesCount ===\n Math.max(...options.map((o) => o.votesCount));\n return (\n \n
    \n \n \n \n {voted && ownVotes.includes(i) && (\n <>\n {' '}\n \n \n )}\n
    \n \n {percentage}\n
    \n \n );\n })}\n \n {!expired && !voted && (\n {\n e.preventDefault();\n setShowResults(false);\n }}\n >\n Hide results\n \n )}\n \n ) : (\n {\n e.preventDefault();\n const form = e.target;\n const formData = new FormData(form);\n const choices = [];\n formData.forEach((value, key) => {\n if (key === 'poll') {\n choices.push(value);\n }\n });\n if (!choices.length) return;\n setUIState('loading');\n await votePoll(choices);\n setUIState('default');\n }}\n >\n
    \n {options.map((option, i) => {\n const { title } = option;\n return (\n
    \n \n
    \n );\n })}\n
    \n {!readOnly && (\n \n Vote\n \n )}\n \n )}\n

    \n {!expired && !readOnly && (\n {\n e.preventDefault();\n setUIState('loading');\n\n (async () => {\n await refresh();\n setUIState('default');\n })();\n }}\n title={t`Refresh`}\n >\n \n \n )}\n {!voted && !expired && !readOnly && optionsHaveVoteCounts && (\n {\n e.preventDefault();\n setShowResults(!showResults);\n }}\n title={showResults ? t`Hide results` : t`Show results`}\n >\n {' '}\n \n )}\n {!expired && !readOnly && ' '}\n \n {shortenNumber(votesCount)} vote\n \n }\n other={\n \n {shortenNumber(votesCount)} votes\n \n }\n />\n {!!votersCount && votersCount !== votesCount && (\n <>\n {' '}\n •{' '}\n \n {shortenNumber(votersCount)}{' '}\n voter\n \n }\n other={\n \n {shortenNumber(votersCount)}{' '}\n voters\n \n }\n />\n \n )}{' '}\n •{' '}\n {expired ? (\n !!expiresAtDate ? (\n \n Ended \n \n ) : (\n t`Ended`\n )\n ) : !!expiresAtDate ? (\n \n Ending \n \n ) : (\n t`Ending`\n )}\n

    \n \n );\n}\n","import { createContext } from 'preact';\n\nconst FilterContext = createContext();\nexport default FilterContext;\n","import mem from './mem';\nimport { getCurrentAccountID } from './store-utils';\n\nfunction _isFiltered(filtered, filterContext) {\n if (!filtered?.length) return false;\n const appliedFilters = filtered.filter((f) => {\n const { filter } = f;\n const hasContext = filter.context.includes(filterContext);\n if (!hasContext) return false;\n if (!filter.expiresAt) return hasContext;\n return new Date(filter.expiresAt) > new Date();\n });\n if (!appliedFilters.length) return false;\n const isHidden = appliedFilters.some((f) => f.filter.filterAction === 'hide');\n if (isHidden)\n return {\n action: 'hide',\n };\n const isWarn = appliedFilters.some((f) => f.filter.filterAction === 'warn');\n if (isWarn) {\n const filterTitles = appliedFilters.map((f) => f.filter.title);\n return {\n action: 'warn',\n titles: filterTitles,\n titlesStr: filterTitles.join(' • '),\n };\n }\n return false;\n}\nexport const isFiltered = mem(_isFiltered);\n\nexport function filteredItem(item, filterContext, currentAccountID) {\n const { filtered } = item;\n if (!filtered?.length) return true;\n const isSelf = currentAccountID && item.account?.id === currentAccountID;\n if (isSelf) return true;\n const filterState = isFiltered(filtered, filterContext);\n if (!filterState) return true;\n if (filterState.action === 'hide') return false;\n // item._filtered = filterState;\n return true;\n}\nexport function filteredItems(items, filterContext) {\n if (!items?.length) return [];\n if (!filterContext) return items;\n const currentAccountID = getCurrentAccountID();\n return items.filter((item) =>\n filteredItem(item, filterContext, currentAccountID),\n );\n}\n","const div = document.createElement('div');\nexport default function htmlContentLength(html) {\n if (!html) return 0;\n div.innerHTML = html;\n // .invisible spans for links\n // e.g. https://mastodon.social\n div.querySelectorAll('.invisible').forEach((el) => {\n el.remove();\n });\n return div.innerText.length;\n}\n","export const supportsTTS = 'speechSynthesis' in window;\n\nexport function speak(text, lang) {\n if (!supportsTTS) return;\n try {\n if (speechSynthesis.speaking) {\n speechSynthesis.cancel();\n }\n const utterance = new SpeechSynthesisUtterance(text);\n if (lang) utterance.lang = lang;\n speechSynthesis.speak(utterance);\n } catch (e) {\n alert(e);\n }\n}\n","import getHTMLText from './getHTMLText';\n\nfunction statusPeek(status) {\n const { spoilerText, content, poll, mediaAttachments } = status;\n let text = '';\n if (spoilerText?.trim()) {\n text += spoilerText;\n } else {\n text += getHTMLText(content);\n }\n text = text.trim();\n if (poll?.options?.length) {\n text += `\\n\\n📊:\\n${poll.options\n .map((o) => `${poll.multiple ? '▪️' : '•'} ${o.title}`)\n .join('\\n')}`;\n }\n if (mediaAttachments?.length) {\n text +=\n ' ' +\n mediaAttachments\n .map(\n (m) =>\n ({\n image: '🖼️',\n gifv: '🎞️',\n video: '📹',\n audio: '🎵',\n unknown: '',\n })[m.type] || '',\n )\n .join('');\n }\n return text;\n}\n\nexport default statusPeek;\n","import{useRef as r,useEffect as n,useMemo as t,useState as e,useCallback as u}from\"react\";function c(e,u,c){var i=this,a=r(null),o=r(0),f=r(null),l=r([]),v=r(),m=r(),d=r(e),g=r(!0);d.current=e;var p=\"undefined\"!=typeof window,w=!u&&0!==u&&p;if(\"function\"!=typeof e)throw new TypeError(\"Expected a function\");u=+u||0;var s=!!(c=c||{}).leading,x=!(\"trailing\"in c)||!!c.trailing,h=\"maxWait\"in c,y=\"debounceOnServer\"in c&&!!c.debounceOnServer,F=h?Math.max(+c.maxWait||0,u):null;n(function(){return g.current=!0,function(){g.current=!1}},[]);var A=t(function(){var r=function(r){var n=l.current,t=v.current;return l.current=v.current=null,o.current=r,m.current=d.current.apply(t,n)},n=function(r,n){w&&cancelAnimationFrame(f.current),f.current=w?requestAnimationFrame(r):setTimeout(r,n)},t=function(r){if(!g.current)return!1;var n=r-a.current;return!a.current||n>=u||n<0||h&&r-o.current>=F},e=function(n){return f.current=null,x&&l.current?r(n):(l.current=v.current=null,m.current)},c=function r(){var c=Date.now();if(t(c))return e(c);if(g.current){var i=u-(c-a.current),f=h?Math.min(i,F-(c-o.current)):i;n(r,f)}},A=function(){if(p||y){var e=Date.now(),d=t(e);if(l.current=[].slice.call(arguments),v.current=i,a.current=e,d){if(!f.current&&g.current)return o.current=a.current,n(c,u),s?r(a.current):m.current;if(h)return n(c,u),r(a.current)}return f.current||n(c,u),m.current}};return A.cancel=function(){f.current&&(w?cancelAnimationFrame(f.current):clearTimeout(f.current)),o.current=0,l.current=a.current=v.current=f.current=null},A.isPending=function(){return!!f.current},A.flush=function(){return f.current?e(Date.now()):m.current},A},[s,h,u,F,x,w,p,y]);return A}function i(r,n){return r===n}function a(n,t,a){var o=a&&a.equalityFn||i,f=r(n),l=e({})[1],v=c(u(function(r){f.current=r,l({})},[l]),t,a),m=r(n);return o(m.current,n)||(v(n),m.current=n),[f.current,v]}function o(r,n,t){var e=void 0===t?{}:t,u=e.leading,i=e.trailing;return c(r,n,{maxWait:n,leading:void 0===u||u,trailing:void 0===i||i})}export{a as useDebounce,c as useDebouncedCallback,o as useThrottledCallback};\n//# sourceMappingURL=index.module.js.map\n","import { useRef, useEffect, useCallback, useState, useMemo } from 'react';\n\n// This could've been more streamlined with internal state instead of abusing\n// refs to such extent, but then composing hooks and components could not opt out of unnecessary renders.\nfunction useResolvedElement(subscriber, refOrElement) {\n var lastReportRef = useRef(null);\n var refOrElementRef = useRef(null);\n refOrElementRef.current = refOrElement;\n var cbElementRef = useRef(null); // Calling re-evaluation after each render without using a dep array,\n // as the ref object's current value could've changed since the last render.\n\n useEffect(function () {\n evaluateSubscription();\n });\n var evaluateSubscription = useCallback(function () {\n var cbElement = cbElementRef.current;\n var refOrElement = refOrElementRef.current; // Ugly ternary. But smaller than an if-else block.\n\n var element = cbElement ? cbElement : refOrElement ? refOrElement instanceof Element ? refOrElement : refOrElement.current : null;\n\n if (lastReportRef.current && lastReportRef.current.element === element && lastReportRef.current.subscriber === subscriber) {\n return;\n }\n\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n }\n\n lastReportRef.current = {\n element: element,\n subscriber: subscriber,\n // Only calling the subscriber, if there's an actual element to report.\n // Setting cleanup to undefined unless a subscriber returns one, as an existing cleanup function would've been just called.\n cleanup: element ? subscriber(element) : undefined\n };\n }, [subscriber]); // making sure we call the cleanup function on unmount\n\n useEffect(function () {\n return function () {\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n lastReportRef.current = null;\n }\n };\n }, []);\n return useCallback(function (element) {\n cbElementRef.current = element;\n evaluateSubscription();\n }, [evaluateSubscription]);\n}\n\n// We're only using the first element of the size sequences, until future versions of the spec solidify on how\n// exactly it'll be used for fragments in multi-column scenarios:\n// From the spec:\n// > The box size properties are exposed as FrozenArray in order to support elements that have multiple fragments,\n// > which occur in multi-column scenarios. However the current definitions of content rect and border box do not\n// > mention how those boxes are affected by multi-column layout. In this spec, there will only be a single\n// > ResizeObserverSize returned in the FrozenArray, which will correspond to the dimensions of the first column.\n// > A future version of this spec will extend the returned FrozenArray to contain the per-fragment size information.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-entry-interface)\n//\n// Also, testing these new box options revealed that in both Chrome and FF everything is returned in the callback,\n// regardless of the \"box\" option.\n// The spec states the following on this:\n// > This does not have any impact on which box dimensions are returned to the defined callback when the event\n// > is fired, it solely defines which box the author wishes to observe layout changes on.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// I'm not exactly clear on what this means, especially when you consider a later section stating the following:\n// > This section is non-normative. An author may desire to observe more than one CSS box.\n// > In this case, author will need to use multiple ResizeObservers.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// Which is clearly not how current browser implementations behave, and seems to contradict the previous quote.\n// For this reason I decided to only return the requested size,\n// even though it seems we have access to results for all box types.\n// This also means that we get to keep the current api, being able to return a simple { width, height } pair,\n// regardless of box option.\nfunction extractSize(entry, boxProp, sizeType) {\n if (!entry[boxProp]) {\n if (boxProp === \"contentBoxSize\") {\n // The dimensions in `contentBoxSize` and `contentRect` are equivalent according to the spec.\n // See the 6th step in the description for the RO algorithm:\n // https://drafts.csswg.org/resize-observer/#create-and-populate-resizeobserverentry-h\n // > Set this.contentRect to logical this.contentBoxSize given target and observedBox of \"content-box\".\n // In real browser implementations of course these objects differ, but the width/height values should be equivalent.\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n\n return undefined;\n } // A couple bytes smaller than calling Array.isArray() and just as effective here.\n\n\n return entry[boxProp][0] ? entry[boxProp][0][sizeType] : // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current\n // behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.\n // @ts-ignore\n entry[boxProp][sizeType];\n}\n\nfunction useResizeObserver(opts) {\n if (opts === void 0) {\n opts = {};\n }\n\n // Saving the callback as a ref. With this, I don't need to put onResize in the\n // effect dep array, and just passing in an anonymous function without memoising\n // will not reinstantiate the hook's ResizeObserver.\n var onResize = opts.onResize;\n var onResizeRef = useRef(undefined);\n onResizeRef.current = onResize;\n var round = opts.round || Math.round; // Using a single instance throughout the hook's lifetime\n\n var resizeObserverRef = useRef();\n\n var _useState = useState({\n width: undefined,\n height: undefined\n }),\n size = _useState[0],\n setSize = _useState[1]; // In certain edge cases the RO might want to report a size change just after\n // the component unmounted.\n\n\n var didUnmount = useRef(false);\n useEffect(function () {\n didUnmount.current = false;\n return function () {\n didUnmount.current = true;\n };\n }, []); // Using a ref to track the previous width / height to avoid unnecessary renders.\n\n var previous = useRef({\n width: undefined,\n height: undefined\n }); // This block is kinda like a useEffect, only it's called whenever a new\n // element could be resolved based on the ref option. It also has a cleanup\n // function.\n\n var refCallback = useResolvedElement(useCallback(function (element) {\n // We only use a single Resize Observer instance, and we're instantiating it on demand, only once there's something to observe.\n // This instance is also recreated when the `box` option changes, so that a new observation is fired if there was a previously observed element with a different box option.\n if (!resizeObserverRef.current || resizeObserverRef.current.box !== opts.box || resizeObserverRef.current.round !== round) {\n resizeObserverRef.current = {\n box: opts.box,\n round: round,\n instance: new ResizeObserver(function (entries) {\n var entry = entries[0];\n var boxProp = opts.box === \"border-box\" ? \"borderBoxSize\" : opts.box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n var reportedWidth = extractSize(entry, boxProp, \"inlineSize\");\n var reportedHeight = extractSize(entry, boxProp, \"blockSize\");\n var newWidth = reportedWidth ? round(reportedWidth) : undefined;\n var newHeight = reportedHeight ? round(reportedHeight) : undefined;\n\n if (previous.current.width !== newWidth || previous.current.height !== newHeight) {\n var newSize = {\n width: newWidth,\n height: newHeight\n };\n previous.current.width = newWidth;\n previous.current.height = newHeight;\n\n if (onResizeRef.current) {\n onResizeRef.current(newSize);\n } else {\n if (!didUnmount.current) {\n setSize(newSize);\n }\n }\n }\n })\n };\n }\n\n resizeObserverRef.current.instance.observe(element, {\n box: opts.box\n });\n return function () {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.instance.unobserve(element);\n }\n };\n }, [opts.box, round]), opts.ref);\n return useMemo(function () {\n return {\n ref: refCallback,\n width: size.width,\n height: size.height\n };\n }, [refCallback, size.width, size.height]);\n}\n\nexport { useResizeObserver as default };\n","import { useRef } from 'preact/hooks';\nimport { useThrottledCallback } from 'use-debounce';\nimport useResizeObserver from 'use-resize-observer';\n\nexport default function useTruncated({ className = 'truncated' } = {}) {\n const ref = useRef();\n const onResize = useThrottledCallback(({ height }) => {\n if (ref.current) {\n const { scrollHeight } = ref.current;\n let truncated = scrollHeight > height;\n if (truncated) {\n const { height: _height, maxHeight } = getComputedStyle(ref.current);\n const computedHeight = parseInt(maxHeight || _height, 10);\n truncated = scrollHeight > computedHeight;\n }\n ref.current.classList.toggle(className, truncated);\n }\n }, 300);\n useResizeObserver({\n ref,\n box: 'border-box',\n onResize,\n });\n return ref;\n}\n","export default {\n public: 'earth',\n unlisted: 'group',\n private: 'lock',\n direct: 'message',\n local: 'building',\n};\n","export var styleRoot = 'kvfysmfp';\nexport var styleChild = 'ufhsfnkm';\nexport var styles = \".\".concat(styleRoot, \"{overflow:hidden;touch-action:none}.\").concat(styleChild, \"{transform-origin: 0 0}\");\n","var isSsr = typeof window === 'undefined';\nexport var isTouch = function () {\n return !isSsr && ('ontouchstart' in window || navigator.maxTouchPoints > 0);\n};\nexport var make2dTransformValue = function (_a) {\n var x = _a.x, y = _a.y, scale = _a.scale;\n return \"scale(\".concat(scale, \") translate(\").concat(x, \"px, \").concat(y, \"px)\");\n};\nexport var make3dTransformValue = function (_a) {\n var x = _a.x, y = _a.y, scale = _a.scale;\n return \"scale3d(\".concat(scale, \",\").concat(scale, \", 1) translate3d(\").concat(x, \"px, \").concat(y, \"px, 0)\");\n};\nexport var hasTranslate3DSupport = function () {\n var css = !isSsr && window.CSS;\n return css && css.supports && css.supports('transform', 'translate3d(0,0,0)');\n};\n","var min = Math.min, max = Math.max;\nexport function getOffsetBounds(_a) {\n var containerDimension = _a.containerDimension, childDimension = _a.childDimension, padding = _a.padding, centerContained = _a.centerContained;\n var diff = childDimension - containerDimension;\n if (diff + 2 * padding <= 0 && centerContained) {\n return [diff / 2, diff / 2];\n }\n else {\n return [min(diff + padding, 0) - padding, max(0, diff + padding)];\n }\n}\n","import { __assign, __extends } from \"tslib\";\nimport React, { Component, createRef, Children, cloneElement } from 'react';\nimport { styleRoot, styleChild, styles } from './styles.css';\nimport { isTouch } from '../utils';\nimport { getOffsetBounds } from './getOffsetBounds';\nvar classnames = function (base, other) {\n return other ? \"\".concat(base, \" \").concat(other) : base;\n};\nvar abs = Math.abs, min = Math.min, sqrt = Math.sqrt;\nvar isSsr = typeof window === 'undefined';\nvar isMac = isSsr ? false : /(Mac)/i.test(navigator.platform);\nvar isDragInteraction = function (i) { return i === 'drag'; };\nvar isZoomInteraction = function (i) { return i === 'zoom'; };\nvar isZoomGesture = function (wheelEvent) { return isMac && wheelEvent.ctrlKey; };\nvar cancelEvent = function (event) {\n event.stopPropagation();\n event.preventDefault();\n};\nvar getDistance = function (a, b) {\n var x = a.x - b.x;\n var y = a.y - b.y;\n return sqrt(x * x + y * y);\n};\nvar calculateScale = function (startTouches, endTouches) {\n var startDistance = getDistance(startTouches[0], startTouches[1]);\n var endDistance = getDistance(endTouches[0], endTouches[1]);\n return endDistance / startDistance;\n};\nvar isCloseTo = function (value, expected) {\n return value > expected - 0.01 && value < expected + 0.01;\n};\nvar swing = function (p) { return -Math.cos(p * Math.PI) / 2 + 0.5; };\nvar getPointByPageCoordinates = function (touch) { return ({\n x: touch.pageX,\n y: touch.pageY,\n}); };\nvar getPageCoordinatesByTouches = function (touches) {\n return Array.from(touches).map(getPointByPageCoordinates);\n};\nvar sum = function (a, b) { return a + b; };\nvar getVectorAvg = function (vectors) { return ({\n x: vectors.map(function (_a) {\n var x = _a.x;\n return x;\n }).reduce(sum, 0) / vectors.length,\n y: vectors.map(function (_a) {\n var y = _a.y;\n return y;\n }).reduce(sum, 0) / vectors.length,\n}); };\nvar clamp = function (min, max, value) {\n return value < min ? min : value > max ? max : value;\n};\nvar shouldInterceptWheel = function (event) {\n return !(event.ctrlKey || event.metaKey);\n};\nvar getElementSize = function (element) {\n if (element) {\n var offsetWidth = element.offsetWidth, offsetHeight = element.offsetHeight;\n // Any DOMElement\n if (offsetWidth && offsetHeight) {\n return { width: offsetWidth, height: offsetHeight };\n }\n // Svg support\n var style = getComputedStyle(element);\n var width = parseFloat(style.width);\n var height = parseFloat(style.height);\n if (height && width) {\n return { width: width, height: height };\n }\n }\n return { width: 0, height: 0 };\n};\nvar calculateVelocity = function (startPoint, endPoint) { return ({\n x: endPoint.x - startPoint.x,\n y: endPoint.y - startPoint.y,\n}); };\nvar comparePoints = function (p1, p2) { return p1.x === p2.x && p1.y === p2.y; };\nvar noup = function () { };\nvar zeroPoint = { x: 0, y: 0 };\nvar PinchZoom = /** @class */ (function (_super) {\n __extends(PinchZoom, _super);\n function PinchZoom() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._prevDragMovePoint = null;\n _this._containerObserver = null;\n _this._fingers = 0;\n _this._firstMove = true;\n _this._initialOffset = __assign({}, zeroPoint);\n _this._interaction = null;\n _this._isDoubleTap = false;\n _this._isOffsetsSet = false;\n _this._lastDragPosition = null;\n _this._lastScale = 1;\n _this._lastTouchStart = 0;\n _this._lastZoomCenter = null;\n _this._listenMouseMove = false;\n _this._nthZoom = 0;\n _this._offset = __assign({}, zeroPoint);\n _this._startOffset = __assign({}, zeroPoint);\n _this._startTouches = null;\n _this._updatePlaned = false;\n _this._wheelTimeOut = null;\n _this._zoomFactor = 1;\n _this._initialZoomFactor = 1;\n _this._draggingPoint = __assign({}, zeroPoint);\n // It help reduce behavior difference between touch and mouse events\n _this._ignoreNextClick = false;\n // @ts-ignore\n _this._containerRef = createRef();\n _this._handleClick = function (clickEvent) {\n if (_this._ignoreNextClick) {\n _this._ignoreNextClick = false;\n clickEvent.stopPropagation();\n }\n };\n _this._onResize = function () {\n var _a;\n if ((_a = _this._containerRef) === null || _a === void 0 ? void 0 : _a.current) {\n _this._updateInitialZoomFactor();\n _this._setupOffsets();\n _this._update();\n }\n };\n _this._handlerOnTouchEnd = _this._handlerIfEnable(function (touchEndEvent) {\n _this._fingers = touchEndEvent.touches.length;\n if (_this.props.shouldCancelHandledTouchEndEvents &&\n (isZoomInteraction(_this._interaction) ||\n (isDragInteraction(_this._interaction) &&\n (_this._startOffset.x !== _this._offset.x ||\n _this._startOffset.y !== _this._offset.y)))) {\n cancelEvent(touchEndEvent);\n }\n if (isDragInteraction(_this._interaction) && !_this._enoughToDrag()) {\n _this._handleClick(touchEndEvent);\n }\n _this._updateInteraction(touchEndEvent);\n });\n _this._handlerOnTouchStart = _this._handlerIfEnable(function (touchStartEvent) {\n _this._firstMove = true;\n _this._fingers = touchStartEvent.touches.length;\n _this._detectDoubleTap(touchStartEvent);\n });\n _this._handlerOnTouchMove = _this._handlerIfEnable(function (touchMoveEvent) {\n if (_this._isDoubleTap) {\n return;\n }\n _this._collectInertia(touchMoveEvent);\n if (_this._firstMove) {\n _this._updateInteraction(touchMoveEvent);\n if (_this._interaction) {\n cancelEvent(touchMoveEvent);\n }\n _this._startOffset = __assign({}, _this._offset);\n _this._startTouches = getPageCoordinatesByTouches(touchMoveEvent.touches);\n }\n else {\n if (isZoomInteraction(_this._interaction)) {\n if (_this._startTouches &&\n _this._startTouches.length === 2 &&\n touchMoveEvent.touches.length === 2) {\n _this._handleZoom(touchMoveEvent, calculateScale(_this._startTouches, getPageCoordinatesByTouches(touchMoveEvent.touches)));\n }\n }\n else if (isDragInteraction(_this._interaction)) {\n _this._handleDrag(touchMoveEvent);\n }\n if (_this._interaction) {\n cancelEvent(touchMoveEvent);\n _this._update();\n }\n }\n _this._firstMove = false;\n });\n _this._handlerWheel = function (wheelEvent) {\n if (_this.props.shouldInterceptWheel(wheelEvent)) {\n return;\n }\n cancelEvent(wheelEvent);\n var pageX = wheelEvent.pageX, pageY = wheelEvent.pageY, deltaY = wheelEvent.deltaY, deltaMode = wheelEvent.deltaMode;\n var scaleDelta = 1;\n if (isZoomGesture(wheelEvent) || deltaMode === 1) {\n scaleDelta = 15;\n }\n var likeTouchEvent = {\n touches: [\n // @ts-ignore\n { pageX: pageX, pageY: pageY },\n ],\n };\n var center = _this._getOffsetByFirstTouch(likeTouchEvent);\n var dScale = deltaY * scaleDelta;\n _this._stopAnimation();\n _this._scaleTo(_this._zoomFactor - dScale / _this.props.wheelScaleFactor, center);\n _this._update();\n clearTimeout(\n // @ts-ignore\n _this._wheelTimeOut);\n _this._wheelTimeOut = setTimeout(function () { return _this._sanitize(); }, 100);\n };\n // @ts-ignore\n _this._handlers = _this.props.isTouch()\n ? [\n ['touchstart', _this._handlerOnTouchStart],\n ['touchend', _this._handlerOnTouchEnd],\n ['touchmove', _this._handlerOnTouchMove],\n ]\n : [\n [\n 'mousemove',\n _this.simulate(_this._handlerOnTouchMove),\n _this.props._document,\n ],\n [\n 'mouseup',\n _this.simulate(_this._handlerOnTouchEnd),\n _this.props._document,\n ],\n ['mousedown', _this.simulate(_this._handlerOnTouchStart)],\n ['click', _this._handleClick],\n ['wheel', _this._handlerWheel],\n ];\n return _this;\n }\n PinchZoom.prototype._handleDragStart = function (event) {\n this._ignoreNextClick = true;\n this.props.onDragStart();\n this._stopAnimation();\n this._resetInertia();\n this._lastDragPosition = null;\n this._hasInteraction = true;\n this._draggingPoint = this._offset;\n this._handleDrag(event);\n };\n PinchZoom.prototype._handleDrag = function (event) {\n var touch = this._getOffsetByFirstTouch(event);\n if (this._enoughToDrag()) {\n this._drag(touch, this._lastDragPosition);\n }\n else {\n this._virtualDrag(touch, this._lastDragPosition);\n }\n this._offset = this._sanitizeOffset(this._offset);\n this._lastDragPosition = touch;\n };\n PinchZoom.prototype._resetInertia = function () {\n this._velocity = null;\n this._prevDragMovePoint = null;\n };\n PinchZoom.prototype._realizeInertia = function () {\n var _this = this;\n var _a = this.props, inertiaFriction = _a.inertiaFriction, inertia = _a.inertia;\n if (!inertia || !this._velocity) {\n return;\n }\n var _b = this._velocity, x = _b.x, y = _b.y;\n if (x || y) {\n this._stopAnimation();\n this._resetInertia();\n var renderFrame = function () {\n x *= inertiaFriction;\n y *= inertiaFriction;\n if (!x && !y) {\n return _this._stopAnimation();\n }\n var prevOffset = __assign({}, _this._offset);\n _this._addOffset({ x: x, y: y });\n _this._offset = _this._sanitizeOffset(_this._offset);\n if (comparePoints(prevOffset, _this._offset)) {\n return _this._stopAnimation();\n }\n _this._update({ isAnimation: true });\n };\n this._animate(renderFrame, { duration: 9999 });\n }\n };\n PinchZoom.prototype._collectInertia = function (_a) {\n var touches = _a.touches;\n if (!this.props.inertia) {\n return;\n }\n var currentCoordinates = getPageCoordinatesByTouches(touches)[0];\n var prevPoint = this._prevDragMovePoint;\n if (prevPoint) {\n this._velocity = calculateVelocity(currentCoordinates, prevPoint);\n }\n this._prevDragMovePoint = currentCoordinates;\n };\n PinchZoom.prototype._handleDragEnd = function () {\n this.props.onDragEnd();\n this._end();\n this._realizeInertia();\n };\n PinchZoom.prototype._handleZoomStart = function () {\n this.props.onZoomStart();\n this._stopAnimation();\n this._lastScale = 1;\n this._nthZoom = 0;\n this._lastZoomCenter = null;\n this._hasInteraction = true;\n };\n PinchZoom.prototype._handleZoom = function (event, newScale) {\n var touchCenter = getVectorAvg(this._getOffsetTouches(event));\n var scale = newScale / this._lastScale;\n this._lastScale = newScale;\n // The first touch events are thrown away since they are not precise\n this._nthZoom += 1;\n if (this._nthZoom > 3) {\n this._scale(scale, touchCenter);\n this._drag(touchCenter, this._lastZoomCenter);\n if (this.props.enforceBoundsDuringZoom) {\n this._offset = this._sanitizeOffset(this._offset);\n }\n }\n this._lastZoomCenter = touchCenter;\n };\n PinchZoom.prototype._handleZoomEnd = function () {\n this.props.onZoomEnd();\n this._end();\n };\n PinchZoom.prototype._handleDoubleTap = function (event) {\n var _this = this;\n if (this._hasInteraction || this.props.tapZoomFactor === 0) {\n return;\n }\n var needZoomOut = (this.props.doubleTapZoomOutOnMaxScale &&\n this._zoomFactor === this.props.maxZoom) ||\n (this.props.doubleTapToggleZoom && this._zoomFactor > 1);\n this.props.onDoubleTap();\n this._ignoreNextClick = true;\n var zoomFactor = this._zoomFactor + this.props.tapZoomFactor;\n var startZoomFactor = this._zoomFactor;\n var updateProgress = function (progress) {\n _this._scaleTo(startZoomFactor + progress * (zoomFactor - startZoomFactor), center);\n };\n var center = this._getOffsetByFirstTouch(event);\n this._isDoubleTap = true;\n if (startZoomFactor > zoomFactor) {\n center = this._getCurrentZoomCenter();\n }\n needZoomOut ? this._zoomOutAnimation() : this._animate(updateProgress);\n };\n PinchZoom.prototype._computeInitialOffset = function () {\n var rect = this._getContainerRect();\n var _a = this._getChildSize(), width = _a.width, height = _a.height;\n var x = -abs(width * this._getInitialZoomFactor() - rect.width) / 2;\n var y = -abs(height * this._getInitialZoomFactor() - rect.height) / 2;\n this._initialOffset = { x: x, y: y };\n };\n PinchZoom.prototype._resetOffset = function () {\n this._offset = __assign({}, this._initialOffset);\n };\n PinchZoom.prototype._setupOffsets = function () {\n if (this.props.setOffsetsOnce && this._isOffsetsSet) {\n return;\n }\n this._isOffsetsSet = true;\n this._computeInitialOffset();\n this._resetOffset();\n };\n PinchZoom.prototype._sanitizeOffset = function (offset) {\n var rect = this._getContainerRect();\n var _a = this._getChildSize(), width = _a.width, height = _a.height;\n var elWidth = width * this._getInitialZoomFactor() * this._zoomFactor;\n var elHeight = height * this._getInitialZoomFactor() * this._zoomFactor;\n var _b = getOffsetBounds({\n containerDimension: rect.width,\n childDimension: elWidth,\n padding: this.props.horizontalPadding,\n centerContained: this.props.centerContained,\n }), minOffsetX = _b[0], maxOffsetX = _b[1];\n var _c = getOffsetBounds({\n containerDimension: rect.height,\n childDimension: elHeight,\n padding: this.props.verticalPadding,\n centerContained: this.props.centerContained,\n }), minOffsetY = _c[0], maxOffsetY = _c[1];\n return {\n x: clamp(minOffsetX, maxOffsetX, offset.x),\n y: clamp(minOffsetY, maxOffsetY, offset.y),\n };\n };\n PinchZoom.prototype.alignCenter = function (options) {\n var _this = this;\n var _a = __assign({ duration: 250, animated: true }, options), __x = _a.x, __y = _a.y, scale = _a.scale, animated = _a.animated, duration = _a.duration;\n // Bug-Fix: https://github.com/retyui/react-quick-pinch-zoom/issues/58\n var x = __x * this._initialZoomFactor;\n var y = __y * this._initialZoomFactor;\n var startZoomFactor = this._zoomFactor;\n var startOffset = __assign({}, this._offset);\n var rect = this._getContainerRect();\n var containerCenter = { x: rect.width / 2, y: rect.height / 2 };\n this._zoomFactor = 1;\n this._offset = { x: -(containerCenter.x - x), y: -(containerCenter.y - y) };\n this._scaleTo(scale, containerCenter);\n this._stopAnimation();\n if (!animated) {\n return this._update();\n }\n var diffZoomFactor = this._zoomFactor - startZoomFactor;\n var diffOffset = {\n x: this._offset.x - startOffset.x,\n y: this._offset.y - startOffset.y,\n };\n this._zoomFactor = startZoomFactor;\n this._offset = __assign({}, startOffset);\n var updateFrame = function (progress) {\n var x = startOffset.x + diffOffset.x * progress;\n var y = startOffset.y + diffOffset.y * progress;\n _this._zoomFactor = startZoomFactor + diffZoomFactor * progress;\n _this._offset = _this._sanitizeOffset({ x: x, y: y });\n _this._update();\n };\n this._animate(updateFrame, {\n callback: function () { return _this._sanitize(); },\n duration: duration,\n });\n };\n PinchZoom.prototype.scaleTo = function (options) {\n var _this = this;\n var _a = __assign({ duration: 250, animated: true }, options), x = _a.x, y = _a.y, scale = _a.scale, animated = _a.animated, duration = _a.duration;\n var startZoomFactor = this._zoomFactor;\n var startOffset = __assign({}, this._offset);\n this._zoomFactor = 1;\n this._offset = { x: 0, y: 0 };\n this._scaleTo(scale, { x: x, y: y });\n this._stopAnimation();\n if (!animated) {\n return this._update();\n }\n var diffZoomFactor = this._zoomFactor - startZoomFactor;\n var diffOffset = {\n x: this._offset.x - startOffset.x,\n y: this._offset.y - startOffset.y,\n };\n this._zoomFactor = startZoomFactor;\n this._offset = __assign({}, startOffset);\n var updateFrame = function (progress) {\n var x = startOffset.x + diffOffset.x * progress;\n var y = startOffset.y + diffOffset.y * progress;\n _this._zoomFactor = startZoomFactor + diffZoomFactor * progress;\n _this._offset = { x: x, y: y };\n _this._update();\n };\n this._animate(updateFrame, { callback: function () { return _this._sanitize(); }, duration: duration });\n };\n PinchZoom.prototype._scaleTo = function (zoomFactor, center) {\n this._scale(zoomFactor / this._zoomFactor, center);\n this._offset = this._sanitizeOffset(this._offset);\n };\n PinchZoom.prototype._scale = function (scale, center) {\n scale = this._scaleZoomFactor(scale);\n this._addOffset({\n x: (scale - 1) * (center.x + this._offset.x),\n y: (scale - 1) * (center.y + this._offset.y),\n });\n this.props.onZoomUpdate();\n };\n PinchZoom.prototype._scaleZoomFactor = function (scale) {\n var originalZoomFactor = this._zoomFactor;\n this._zoomFactor *= scale;\n this._zoomFactor = clamp(this.props.minZoom, this.props.maxZoom, this._zoomFactor);\n return this._zoomFactor / originalZoomFactor;\n };\n PinchZoom.prototype._canDrag = function () {\n return this.props.draggableUnZoomed || !isCloseTo(this._zoomFactor, 1);\n };\n PinchZoom.prototype._drag = function (center, lastCenter) {\n if (lastCenter) {\n var y = -(center.y - lastCenter.y);\n var x = -(center.x - lastCenter.x);\n if (!this.props.lockDragAxis) {\n this._addOffset({\n x: x,\n y: y,\n });\n }\n else {\n // lock scroll to position that was changed the most\n if (abs(x) > abs(y)) {\n this._addOffset({\n x: x,\n y: 0,\n });\n }\n else {\n this._addOffset({\n y: y,\n x: 0,\n });\n }\n }\n this.props.onDragUpdate();\n }\n };\n PinchZoom.prototype._virtualDrag = function (center, lastCenter) {\n if (lastCenter) {\n var y = -(center.y - lastCenter.y);\n var x = -(center.x - lastCenter.x);\n this._draggingPoint = {\n x: x + this._draggingPoint.x,\n y: y + this._draggingPoint.y,\n };\n }\n };\n PinchZoom.prototype._addOffset = function (offset) {\n var _a = this._offset, x = _a.x, y = _a.y;\n this._offset = {\n x: x + offset.x,\n y: y + offset.y,\n };\n };\n PinchZoom.prototype._sanitize = function () {\n if (this._zoomFactor < this.props.zoomOutFactor) {\n this._resetInertia();\n this._zoomOutAnimation();\n }\n else if (this._isInsaneOffset()) {\n this._sanitizeOffsetAnimation();\n }\n };\n PinchZoom.prototype._isInsaneOffset = function () {\n var offset = this._offset;\n var sanitizedOffset = this._sanitizeOffset(offset);\n return sanitizedOffset.x !== offset.x || sanitizedOffset.y !== offset.y;\n };\n PinchZoom.prototype._sanitizeOffsetAnimation = function () {\n var _this = this;\n var targetOffset = this._sanitizeOffset(this._offset);\n var startOffset = __assign({}, this._offset);\n var updateProgress = function (progress) {\n var x = startOffset.x + progress * (targetOffset.x - startOffset.x);\n var y = startOffset.y + progress * (targetOffset.y - startOffset.y);\n _this._offset = { x: x, y: y };\n _this._update();\n };\n this._animate(updateProgress);\n };\n PinchZoom.prototype._zoomOutAnimation = function () {\n var _this = this;\n if (this._zoomFactor === 1) {\n return;\n }\n var startZoomFactor = this._zoomFactor;\n var zoomFactor = 1;\n var center = this._getCurrentZoomCenter();\n var updateProgress = function (progress) {\n var scaleFactor = startZoomFactor + progress * (zoomFactor - startZoomFactor);\n _this._scaleTo(scaleFactor, center);\n };\n this._animate(updateProgress);\n };\n PinchZoom.prototype._getInitialZoomFactor = function () {\n return this._initialZoomFactor;\n };\n PinchZoom.prototype._getCurrentZoomCenter = function () {\n var _a = this._offset, x = _a.x, y = _a.y;\n var offsetLeft = x - this._initialOffset.x;\n var offsetTop = y - this._initialOffset.y;\n return {\n x: -1 * x - offsetLeft / (1 / this._zoomFactor - 1),\n y: -1 * y - offsetTop / (1 / this._zoomFactor - 1),\n };\n };\n PinchZoom.prototype._getOffsetByFirstTouch = function (event) {\n return this._getOffsetTouches(event)[0];\n };\n PinchZoom.prototype._getOffsetTouches = function (event) {\n var _document = this.props._document;\n var _html = _document.documentElement;\n var _body = _document.body;\n var _a = this._getContainerRect(), top = _a.top, left = _a.left;\n var scrollTop = _html.scrollTop || _body.scrollTop;\n var scrollLeft = _html.scrollLeft || _body.scrollLeft;\n var posTop = top + scrollTop;\n var posLeft = left + scrollLeft;\n return getPageCoordinatesByTouches(event.touches).map(function (_a) {\n var x = _a.x, y = _a.y;\n return ({\n x: x - posLeft,\n y: y - posTop,\n });\n });\n };\n PinchZoom.prototype._animate = function (frameFn, options) {\n var _this = this;\n var startTime = new Date().getTime();\n var _a = __assign({ timeFn: swing, callback: function () { }, duration: this.props.animationDuration }, options), timeFn = _a.timeFn, callback = _a.callback, duration = _a.duration;\n var renderFrame = function () {\n if (!_this._inAnimation) {\n return;\n }\n var frameTime = new Date().getTime() - startTime;\n var progress = frameTime / duration;\n if (frameTime >= duration) {\n frameFn(1);\n _this._stopAnimation();\n callback();\n _this._update();\n }\n else {\n progress = timeFn(progress);\n frameFn(progress);\n _this._update({ isAnimation: true });\n requestAnimationFrame(renderFrame);\n }\n };\n this._inAnimation = true;\n requestAnimationFrame(renderFrame);\n };\n PinchZoom.prototype._stopAnimation = function () {\n this._inAnimation = false;\n };\n PinchZoom.prototype._end = function () {\n this._hasInteraction = false;\n this._sanitize();\n this._update();\n };\n PinchZoom.prototype._getContainerRect = function () {\n var div = this._containerRef.current;\n return div.getBoundingClientRect();\n };\n PinchZoom.prototype._getChildSize = function () {\n var div = this._containerRef.current;\n return getElementSize(div === null || div === void 0 ? void 0 : div.firstElementChild);\n };\n PinchZoom.prototype._updateInitialZoomFactor = function () {\n var rect = this._getContainerRect();\n var size = this._getChildSize();\n var xZoomFactor = rect.width / size.width;\n var yZoomFactor = rect.height / size.height;\n this._initialZoomFactor = min(xZoomFactor, yZoomFactor);\n };\n PinchZoom.prototype._bindEvents = function () {\n var _this = this;\n var div = this._containerRef.current;\n if (window.ResizeObserver) {\n this._containerObserver = new ResizeObserver(this._onResize);\n this._containerObserver.observe(div);\n }\n else {\n window.addEventListener('resize', this._onResize);\n }\n this._handlers.forEach(function (_a) {\n var eventName = _a[0], fn = _a[1], target = _a[2];\n (target || div).addEventListener(eventName, fn, true);\n });\n Array.from(div.querySelectorAll('img')).forEach(function (img) {\n return img.addEventListener('load', _this._onResize);\n });\n };\n PinchZoom.prototype._unSubscribe = function () {\n var _this = this;\n var div = this._containerRef.current;\n if (this._containerObserver) {\n this._containerObserver.disconnect();\n this._containerObserver = null;\n }\n window.removeEventListener('resize', this._onResize);\n this._handlers.forEach(function (_a) {\n var eventName = _a[0], fn = _a[1], target = _a[2];\n (target || div).removeEventListener(eventName, fn, true);\n });\n Array.from(div.querySelectorAll('img')).forEach(function (img) {\n return img.removeEventListener('load', _this._onResize);\n });\n };\n PinchZoom.prototype._update = function (options) {\n var _this = this;\n if (this._updatePlaned) {\n return;\n }\n var updateFrame = function () {\n var scale = _this._getInitialZoomFactor() * _this._zoomFactor;\n var x = -_this._offset.x / scale;\n var y = -_this._offset.y / scale;\n _this.props.onUpdate({ scale: scale, x: x, y: y });\n };\n if (options === null || options === void 0 ? void 0 : options.isAnimation) {\n return updateFrame();\n }\n this._updatePlaned = true;\n requestAnimationFrame(function () {\n _this._updatePlaned = false;\n updateFrame();\n });\n };\n PinchZoom.prototype._handlerIfEnable = function (fn) {\n var _this = this;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (_this.props.enabled) {\n fn.apply(void 0, args);\n }\n };\n };\n PinchZoom.prototype._setInteraction = function (newInteraction, event) {\n var interaction = this._interaction;\n if (interaction !== newInteraction) {\n if (interaction && !newInteraction) {\n if (isZoomInteraction(interaction)) {\n this._handleZoomEnd();\n }\n else if (isDragInteraction(interaction)) {\n this._handleDragEnd();\n }\n }\n if (isZoomInteraction(newInteraction)) {\n this._handleZoomStart();\n }\n else if (isDragInteraction(newInteraction)) {\n this._handleDragStart(event);\n }\n }\n this._interaction = newInteraction;\n };\n PinchZoom.prototype._distanceBetweenNumbers = function (a, b) {\n return a > b ? a - b : b - a;\n };\n PinchZoom.prototype._enoughToDrag = function () {\n if (this._distanceBetweenNumbers(this._startOffset.x, this._draggingPoint.x) >\n 5 ||\n this._distanceBetweenNumbers(this._startOffset.y, this._draggingPoint.y) >\n 5)\n return true;\n return false;\n };\n PinchZoom.prototype._updateInteraction = function (event) {\n var fingers = this._fingers;\n if (fingers === 2) {\n return this._setInteraction('zoom', event);\n }\n if (fingers === 1 && this._canDrag()) {\n return this._setInteraction('drag', event);\n }\n this._setInteraction(null, event);\n };\n PinchZoom.prototype._detectDoubleTap = function (event) {\n var time = new Date().getTime();\n if (this._fingers > 1) {\n this._lastTouchStart = 0;\n }\n if (time - this._lastTouchStart < 300) {\n cancelEvent(event);\n this._handleDoubleTap(event);\n if (isZoomInteraction(this._interaction)) {\n this._handleZoomEnd();\n }\n else if (isDragInteraction(this._interaction)) {\n this._handleDragEnd();\n }\n }\n else {\n this._isDoubleTap = false;\n }\n if (this._fingers === 1) {\n this._lastTouchStart = time;\n }\n };\n PinchZoom.prototype.simulate = function (fn) {\n var _this = this;\n return function (mouseEvent) {\n var pageX = mouseEvent.pageX, pageY = mouseEvent.pageY, type = mouseEvent.type;\n var isEnd = type === 'mouseup';\n var isStart = type === 'mousedown';\n if (isStart) {\n mouseEvent.preventDefault();\n _this._listenMouseMove = true;\n }\n if (_this._listenMouseMove) {\n // @ts-ignore\n mouseEvent.touches = isEnd ? [] : [{ pageX: pageX, pageY: pageY }];\n fn(\n // @ts-ignore\n mouseEvent);\n }\n if (isEnd) {\n _this._listenMouseMove = false;\n }\n };\n };\n PinchZoom.prototype.componentDidMount = function () {\n this._bindEvents();\n this._update();\n };\n PinchZoom.prototype.componentWillUnmount = function () {\n this._stopAnimation();\n this._unSubscribe();\n };\n PinchZoom.prototype.render = function () {\n var _a = this.props, children = _a.children, containerProps = _a.containerProps;\n var child = Children.only(children);\n var props = containerProps || {};\n return (React.createElement(React.Fragment, null,\n React.createElement(\"style\", null, styles),\n React.createElement(\"div\", __assign({}, props, { ref: this._containerRef, className: classnames(styleRoot, props.className) }), cloneElement(child, {\n className: classnames(styleChild, child.props.className),\n }))));\n };\n PinchZoom.defaultProps = {\n animationDuration: 250,\n draggableUnZoomed: true,\n enforceBoundsDuringZoom: false,\n centerContained: false,\n enabled: true,\n inertia: true,\n inertiaFriction: 0.96,\n horizontalPadding: 0,\n isTouch: isTouch,\n lockDragAxis: false,\n maxZoom: 5,\n minZoom: 0.5,\n onDoubleTap: noup,\n onDragEnd: noup,\n onDragStart: noup,\n onDragUpdate: noup,\n onZoomEnd: noup,\n onZoomStart: noup,\n onZoomUpdate: noup,\n setOffsetsOnce: false,\n shouldInterceptWheel: shouldInterceptWheel,\n shouldCancelHandledTouchEndEvents: false,\n tapZoomFactor: 1,\n verticalPadding: 0,\n wheelScaleFactor: 1500,\n zoomOutFactor: 1.3,\n doubleTapZoomOutOnMaxScale: false,\n doubleTapToggleZoom: false,\n // @ts-expect-error\n _document: isSsr ? null : window.document,\n };\n return PinchZoom;\n}(Component));\nif (process.env.NODE_ENV !== 'production') {\n var _a = require('prop-types'), any = _a.any, element = _a.element, object = _a.object, number = _a.number, func = _a.func, bool = _a.bool;\n // @ts-ignore\n PinchZoom.propTypes = {\n children: element,\n containerProps: object,\n wheelScaleFactor: number,\n animationDuration: number,\n draggableUnZoomed: bool,\n enforceBoundsDuringZoom: bool,\n centerContained: bool,\n enabled: bool,\n horizontalPadding: number,\n lockDragAxis: bool,\n onUpdate: func.isRequired,\n maxZoom: number,\n minZoom: number,\n onDoubleTap: func,\n onDragEnd: func,\n onDragStart: func,\n onDragUpdate: func,\n onZoomEnd: func,\n onZoomStart: func,\n onZoomUpdate: func,\n setOffsetsOnce: bool,\n tapZoomFactor: number,\n verticalPadding: number,\n zoomOutFactor: number,\n doubleTapZoomOutOnMaxScale: bool,\n doubleTapToggleZoom: bool,\n isTouch: func,\n _document: any,\n };\n}\nexport default PinchZoom;\n","export default function formatDuration(time) {\n if (!time) return;\n let hours = Math.floor(time / 3600);\n let minutes = Math.floor((time % 3600) / 60);\n let seconds = Math.round(time % 60);\n\n if (hours === 0) {\n return `${minutes}:${seconds.toString().padStart(2, '0')}`;\n } else {\n return `${hours}:${minutes.toString().padStart(2, '0')}:${seconds\n .toString()\n .padStart(2, '0')}`;\n }\n}\n","import { useLingui } from '@lingui/react/macro';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport QuickPinchZoom, { make3dTransformValue } from 'react-quick-pinch-zoom';\n\nimport formatDuration from '../utils/format-duration';\nimport mem from '../utils/mem';\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Link from './link';\n\nconst isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // https://stackoverflow.com/a/23522755\n\n/*\nMedia type\n===\nunknown = unsupported or unrecognized file type\nimage = Static image\ngifv = Looping, soundless animation\nvideo = Video clip\naudio = Audio track\n*/\n\nconst dataAltLabel = 'ALT';\nconst AltBadge = (props) => {\n const { t } = useLingui();\n const { alt, lang, index, ...rest } = props;\n if (!alt || !alt.trim()) return null;\n return (\n {\n e.stopPropagation();\n e.preventDefault();\n states.showMediaAlt = {\n alt,\n lang,\n };\n }}\n title={t`Media description`}\n >\n {dataAltLabel}\n {!!index && {index}}\n \n );\n};\n\nconst MEDIA_CAPTION_LIMIT = 140;\nconst MEDIA_CAPTION_LIMIT_LONGER = 280;\nexport const isMediaCaptionLong = mem((caption) =>\n caption?.length\n ? caption.length > MEDIA_CAPTION_LIMIT ||\n /[\\n\\r].*[\\n\\r]/.test(caption.trim())\n : false,\n);\n\nfunction Media({\n class: className = '',\n media,\n to,\n lang,\n showOriginal,\n autoAnimate,\n showCaption,\n allowLongerCaption,\n altIndex,\n checkAspectRatio = true,\n onClick = () => {},\n}) {\n let {\n blurhash,\n description,\n meta,\n previewRemoteUrl,\n previewUrl,\n remoteUrl,\n url,\n type,\n } = media;\n if (/no\\-preview\\./i.test(previewUrl)) {\n previewUrl = null;\n }\n const { original = {}, small, focus } = meta || {};\n\n const width = showOriginal\n ? original?.width\n : small?.width || original?.width;\n const height = showOriginal\n ? original?.height\n : small?.height || original?.height;\n const mediaURL = showOriginal ? url : previewUrl || url;\n const remoteMediaURL = showOriginal\n ? remoteUrl\n : previewRemoteUrl || remoteUrl;\n const hasDimensions = width && height;\n const orientation = hasDimensions\n ? width > height\n ? 'landscape'\n : 'portrait'\n : null;\n\n const rgbAverageColor = blurhash ? getBlurHashAverageColor(blurhash) : null;\n\n const videoRef = useRef();\n\n let focalPosition;\n if (focus) {\n // Convert focal point to CSS background position\n // Formula from jquery-focuspoint\n // x = -1, y = 1 => 0% 0%\n // x = 0, y = 0 => 50% 50%\n // x = 1, y = -1 => 100% 100%\n const x = ((focus.x + 1) / 2) * 100;\n const y = ((1 - focus.y) / 2) * 100;\n focalPosition = `${x.toFixed(0)}% ${y.toFixed(0)}%`;\n }\n\n const mediaRef = useRef();\n const onUpdate = useCallback(({ x, y, scale }) => {\n const { current: media } = mediaRef;\n\n if (media) {\n const value = make3dTransformValue({ x, y, scale });\n\n if (scale === 1) {\n media.style.removeProperty('transform');\n } else {\n media.style.setProperty('transform', value);\n }\n\n media.closest('.media-zoom').style.touchAction =\n scale <= 1.01 ? 'pan-x' : '';\n }\n }, []);\n\n const [pinchZoomEnabled, setPinchZoomEnabled] = useState(false);\n const quickPinchZoomProps = {\n enabled: pinchZoomEnabled,\n draggableUnZoomed: false,\n inertiaFriction: 0.9,\n tapZoomFactor: 2,\n doubleTapToggleZoom: true,\n containerProps: {\n className: 'media-zoom',\n style: {\n overflow: 'visible',\n // width: 'inherit',\n // height: 'inherit',\n // justifyContent: 'inherit',\n // alignItems: 'inherit',\n // display: 'inherit',\n },\n },\n onUpdate,\n };\n\n const Parent = useMemo(\n () => (to ? (props) => : 'div'),\n [to],\n );\n\n const remoteMediaURLObj = remoteMediaURL ? getURLObj(remoteMediaURL) : null;\n const isVideoMaybe =\n type === 'unknown' &&\n remoteMediaURLObj &&\n /\\.(mp4|m4r|m4v|mov|webm)$/i.test(remoteMediaURLObj.pathname);\n const isAudioMaybe =\n type === 'unknown' &&\n remoteMediaURLObj &&\n /\\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(remoteMediaURLObj.pathname);\n const isImage =\n type === 'image' ||\n (type === 'unknown' && previewUrl && !isVideoMaybe && !isAudioMaybe);\n\n const parentRef = useRef();\n const [imageSmallerThanParent, setImageSmallerThanParent] = useState(false);\n useLayoutEffect(() => {\n if (!isImage) return;\n if (!showOriginal) return;\n if (!parentRef.current) return;\n const { offsetWidth, offsetHeight } = parentRef.current;\n const smaller = width < offsetWidth && height < offsetHeight;\n if (smaller) setImageSmallerThanParent(smaller);\n }, [width, height]);\n\n const maxAspectHeight =\n window.innerHeight * (orientation === 'portrait' ? 0.45 : 0.33);\n const maxHeight = orientation === 'portrait' ? 0 : 160;\n const averageColorStyle = {\n '--average-color': rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,\n };\n const mediaStyles =\n width && height\n ? {\n '--width': `${width}px`,\n '--height': `${height}px`,\n // Calculate '--aspectWidth' based on aspect ratio calculated from '--width' and '--height', max height has to be 160px\n '--aspectWidth': `${\n (width / height) * Math.max(maxHeight, maxAspectHeight)\n }px`,\n aspectRatio: `${width} / ${height}`,\n ...averageColorStyle,\n }\n : {\n ...averageColorStyle,\n };\n\n const longDesc = isMediaCaptionLong(description);\n let showInlineDesc =\n !!showCaption && !showOriginal && !!description && !longDesc;\n if (\n allowLongerCaption &&\n !showInlineDesc &&\n description?.length <= MEDIA_CAPTION_LIMIT_LONGER\n ) {\n showInlineDesc = true;\n }\n const Figure = !showInlineDesc\n ? Fragment\n : (props) => {\n const { children, ...restProps } = props;\n return (\n
    \n {children}\n {\n e.preventDefault();\n e.stopPropagation();\n states.showMediaAlt = {\n alt: description,\n lang,\n };\n }}\n >\n {description}\n \n
    \n );\n };\n\n const [hasNaturalAspectRatio, setHasNaturalAspectRatio] = useState(undefined);\n\n if (isImage) {\n // Note: type: unknown might not have width/height\n quickPinchZoomProps.containerProps.style.display = 'inherit';\n\n useLayoutEffect(() => {\n if (!isSafari) return;\n if (!showOriginal) return;\n (async () => {\n try {\n await fetch(mediaURL, { mode: 'no-cors' });\n mediaRef.current.src = mediaURL;\n } catch (e) {\n // Ignore\n }\n })();\n }, [mediaURL]);\n\n return (\n
    \n \n {showOriginal ? (\n \n {\n e.target.closest('.media-image').style.backgroundImage = '';\n e.target.closest('.media-zoom').style.display = '';\n setPinchZoomEnabled(true);\n }}\n onError={(e) => {\n const { src } = e.target;\n if (\n src === mediaURL &&\n remoteMediaURL &&\n mediaURL !== remoteMediaURL\n ) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n \n ) : (\n <>\n {\n // e.target.closest('.media-image').style.backgroundImage = '';\n e.target.dataset.loaded = true;\n const $media = e.target.closest('.media');\n if (!hasDimensions && $media) {\n const { naturalWidth, naturalHeight } = e.target;\n $media.dataset.orientation =\n naturalWidth > naturalHeight ? 'landscape' : 'portrait';\n $media.style.setProperty('--width', `${naturalWidth}px`);\n $media.style.setProperty('--height', `${naturalHeight}px`);\n $media.style.aspectRatio = `${naturalWidth}/${naturalHeight}`;\n }\n\n // Check natural aspect ratio vs display aspect ratio\n if (checkAspectRatio && $media) {\n const {\n clientWidth,\n clientHeight,\n naturalWidth,\n naturalHeight,\n } = e.target;\n if (\n clientWidth &&\n clientHeight &&\n naturalWidth &&\n naturalHeight\n ) {\n const minDimension = 88;\n if (\n naturalWidth < minDimension ||\n naturalHeight < minDimension\n ) {\n $media.dataset.hasSmallDimension = true;\n } else {\n const displayNaturalHeight =\n (naturalHeight * clientWidth) / naturalWidth;\n const almostSimilarHeight =\n Math.abs(displayNaturalHeight - clientHeight) < 5;\n\n if (almostSimilarHeight) {\n setHasNaturalAspectRatio(true);\n }\n }\n }\n }\n }}\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL && mediaURL !== remoteMediaURL) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n {!showInlineDesc && (\n \n )}\n \n )}\n \n
    \n );\n } else if (type === 'gifv' || type === 'video' || isVideoMaybe) {\n const hasDuration = original.duration > 0;\n const shortDuration = original.duration < 31;\n const isGIF = type === 'gifv' && shortDuration;\n // If GIF is too long, treat it as a video\n const loopable = original.duration < 61;\n const formattedDuration = formatDuration(original.duration);\n const hoverAnimate = !showOriginal && !autoAnimate && isGIF;\n const autoGIFAnimate = !showOriginal && autoAnimate && isGIF;\n const showProgress = original.duration > 5;\n\n // This string is only for autoplay + muted to work on Mobile Safari\n const gifHTML = `\n \n `;\n\n const videoHTML = `\n \n `;\n\n return (\n
    \n {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n onClick(e);\n }}\n onMouseEnter={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.play();\n } catch (e) {}\n }\n }}\n onMouseLeave={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n }}\n onFocus={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.play();\n } catch (e) {}\n }\n }}\n onBlur={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n }}\n >\n {showOriginal || autoGIFAnimate ? (\n isGIF && showOriginal ? (\n \n \n \n ) : isGIF ? (\n \n ) : (\n \n )\n ) : isGIF ? (\n {\n const { target } = e;\n const container = target?.closest('.media-gif');\n if (container) {\n const percentage =\n (target.currentTime / target.duration) * 100;\n container.style.setProperty(\n '--progress',\n `${percentage}%`,\n );\n }\n }\n : undefined\n }\n />\n ) : (\n <>\n {previewUrl ? (\n {\n if (!hasDimensions) {\n const $media = e.target.closest('.media');\n if ($media) {\n const { naturalHeight, naturalWidth } = e.target;\n $media.dataset.orientation =\n naturalWidth > naturalHeight\n ? 'landscape'\n : 'portrait';\n $media.style.setProperty(\n '--width',\n `${naturalWidth}px`,\n );\n $media.style.setProperty(\n '--height',\n `${naturalHeight}px`,\n );\n $media.style.aspectRatio = `${naturalWidth}/${naturalHeight}`;\n }\n }\n }}\n />\n ) : (\n {\n if (!hasDuration) {\n const { duration } = e.target;\n if (duration) {\n const formattedDuration = formatDuration(duration);\n const container = e.target.closest('.media-video');\n if (container) {\n container.dataset.formattedDuration =\n formattedDuration;\n }\n }\n }\n }}\n />\n )}\n
    \n \n
    \n \n )}\n {!showOriginal && !showInlineDesc && (\n \n )}\n \n
    \n );\n } else if (type === 'audio' || isAudioMaybe) {\n const formattedDuration = formatDuration(original.duration);\n return (\n
    \n \n {showOriginal ? (\n
    \n );\n }\n}\n\nfunction getURLObj(url) {\n // Fake base URL if url doesn't have https:// prefix\n return URL.parse(url, location.origin);\n}\n\nexport default memo(Media, (oldProps, newProps) => {\n const oldMedia = oldProps.media || {};\n const newMedia = newProps.media || {};\n\n return (\n oldMedia?.id === newMedia?.id &&\n oldMedia.url === newMedia.url &&\n oldProps.to === newProps.to &&\n oldProps.class === newProps.class\n );\n});\n","import './status.css';\nimport '@justinribeiro/lite-youtube';\n\nimport { msg, plural } from '@lingui/core/macro';\nimport { Trans, useLingui } from '@lingui/react/macro';\nimport {\n ControlledMenu,\n Menu,\n MenuDivider,\n MenuHeader,\n MenuItem,\n} from '@szhsin/react-menu';\nimport { decodeBlurHash, getBlurHashAverageColor } from 'fast-blurhash';\nimport { shallowEqual } from 'fast-equals';\nimport prettify from 'html-prettify';\nimport pThrottle from 'p-throttle';\nimport { Fragment } from 'preact';\nimport { forwardRef, memo } from 'preact/compat';\nimport {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useHotkeys } from 'react-hotkeys-hook';\n// import { detectAll } from 'tinyld/light';\nimport { useLongPress } from 'use-long-press';\nimport { useSnapshot } from 'valtio';\n\nimport CustomEmoji from '../components/custom-emoji';\nimport EmojiText from '../components/emoji-text';\nimport LazyShazam from '../components/lazy-shazam';\nimport Loader from '../components/loader';\nimport MenuConfirm from '../components/menu-confirm';\nimport Menu2 from '../components/menu2';\nimport Modal from '../components/modal';\nimport NameText from '../components/name-text';\nimport Poll from '../components/poll';\nimport { api } from '../utils/api';\nimport emojifyText from '../utils/emojify-text';\nimport enhanceContent from '../utils/enhance-content';\nimport FilterContext from '../utils/filter-context';\nimport { isFiltered } from '../utils/filters';\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport getHTMLText from '../utils/getHTMLText';\nimport handleContentLinks from '../utils/handle-content-links';\nimport htmlContentLength from '../utils/html-content-length';\nimport isRTL from '../utils/is-rtl';\nimport isMastodonLinkMaybe from '../utils/isMastodonLinkMaybe';\nimport localeMatch from '../utils/locale-match';\nimport niceDateTime from '../utils/nice-date-time';\nimport openCompose from '../utils/open-compose';\nimport pmem from '../utils/pmem';\nimport safeBoundingBoxPadding from '../utils/safe-bounding-box-padding';\nimport shortenNumber from '../utils/shorten-number';\nimport showCompose from '../utils/show-compose';\nimport showToast from '../utils/show-toast';\nimport { speak, supportsTTS } from '../utils/speech';\nimport states, { getStatus, saveStatus, statusKey } from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport unfurlMastodonLink from '../utils/unfurl-link';\nimport useTruncated from '../utils/useTruncated';\nimport visibilityIconsMap from '../utils/visibility-icons-map';\n\nimport Avatar from './avatar';\nimport Icon from './icon';\nimport Link from './link';\nimport Media, { isMediaCaptionLong } from './media';\nimport MenuLink from './menu-link';\nimport RelativeTime from './relative-time';\nimport TranslationBlock from './translation-block';\n\nconst SHOW_COMMENT_COUNT_LIMIT = 280;\nconst INLINE_TRANSLATE_LIMIT = 140;\n\nconst throttle = pThrottle({\n limit: 1,\n interval: 1000,\n});\nfunction fetchAccount(id, masto) {\n return masto.v1.accounts.$select(id).fetch();\n}\nconst memFetchAccount = pmem(throttle(fetchAccount));\n\nconst visibilityText = {\n public: msg`Public`,\n local: msg`Local`,\n unlisted: msg`Unlisted`,\n private: msg`Followers only`,\n direct: msg`Private mention`,\n};\n\nconst isIOS =\n window.ontouchstart !== undefined &&\n /iPad|iPhone|iPod/.test(navigator.userAgent);\n\nconst rtf = new Intl.RelativeTimeFormat();\n\nconst REACTIONS_LIMIT = 80;\n\nfunction getPollText(poll) {\n if (!poll?.options?.length) return '';\n return `📊:\\n${poll.options\n .map(\n (option) =>\n `- ${option.title}${\n option.votesCount >= 0 ? ` (${option.votesCount})` : ''\n }`,\n )\n .join('\\n')}`;\n}\nfunction getPostText(status) {\n const { spoilerText, content, poll } = status;\n return (\n (spoilerText ? `${spoilerText}\\n\\n` : '') +\n getHTMLText(content) +\n getPollText(poll)\n );\n}\n\nfunction forgivingQSA(selectors = [], dom = document) {\n // Run QSA for list of selectors\n // If a selector return invalid selector error, try the next one\n for (const selector of selectors) {\n try {\n return dom.querySelectorAll(selector);\n } catch (e) {}\n }\n return [];\n}\n\nfunction isTranslateble(content) {\n if (!content) return false;\n content = content.trim();\n if (!content) return false;\n const text = getHTMLText(content, {\n preProcess: (dom) => {\n // Remove .mention, pre, code, a:has(.invisible)\n for (const a of forgivingQSA(\n ['.mention, pre, code, a:has(.invisible)', '.mention, pre, code'],\n dom,\n )) {\n a.remove();\n }\n },\n });\n return !!text;\n}\n\nfunction getHTMLTextForDetectLang(content) {\n return getHTMLText(content, {\n preProcess: (dom) => {\n // Remove anything that can skew the language detection\n\n // Remove .mention, .hashtag, pre, code, a:has(.invisible)\n for (const a of forgivingQSA(\n [\n '.mention, .hashtag, pre, code, a:has(.invisible)',\n '.mention, .hashtag, pre, code',\n ],\n dom,\n )) {\n a.remove();\n }\n\n // Remove links that contains text that starts with https?://\n for (const a of dom.querySelectorAll('a')) {\n const text = a.innerText.trim();\n if (text.startsWith('https://') || text.startsWith('http://')) {\n a.remove();\n }\n }\n },\n });\n}\n\nconst HTTP_REGEX = /^http/i;\nconst PostContent =\n /*memo(*/\n ({ post, instance, previewMode }) => {\n const { content, emojis, language, mentions, url } = post;\n\n const divRef = useRef();\n useLayoutEffect(() => {\n if (!divRef.current) return;\n const dom = enhanceContent(content, {\n emojis,\n returnDOM: true,\n });\n // Remove target=\"_blank\" from links\n for (const a of dom.querySelectorAll('a.u-url[target=\"_blank\"]')) {\n if (!HTTP_REGEX.test(a.innerText.trim())) {\n a.removeAttribute('target');\n }\n }\n divRef.current.replaceChildren(dom.cloneNode(true));\n }, [content, emojis.length]);\n\n return (\n {\n // // Remove target=\"_blank\" from links\n // dom.querySelectorAll('a.u-url[target=\"_blank\"]').forEach((a) => {\n // if (!/http/i.test(a.innerText.trim())) {\n // a.removeAttribute('target');\n // }\n // });\n // },\n // }),\n // }}\n />\n );\n }; /*,\n (oldProps, newProps) => {\n const { post: oldPost } = oldProps;\n const { post: newPost } = newProps;\n return oldPost.content === newPost.content;\n },\n);*/\n\nconst SIZE_CLASS = {\n s: 'small',\n m: 'medium',\n l: 'large',\n};\n\nconst detectLang = pmem(async (text) => {\n const { detectAll } = await import('tinyld/light');\n text = text?.trim();\n\n // Ref: https://github.com/komodojp/tinyld/blob/develop/docs/benchmark.md\n // 500 should be enough for now, also the default max chars for Mastodon\n if (text?.length > 500) {\n return null;\n }\n const langs = detectAll(text);\n const lang = langs[0];\n if (lang?.lang && lang?.accuracy > 0.5) {\n // If > 50% accurate, use it\n // It can be accurate if < 50% but better be safe\n // Though > 50% also can be inaccurate 🤷‍♂️\n return lang.lang;\n }\n return null;\n});\n\nconst readMoreText = msg`Read more →`;\n\n// All this work just to make sure this only lazy-run once\n// Because first run is slow due to intl-localematcher\nconst DIFFERENT_LANG_CHECK = {};\nconst checkDifferentLanguage = (\n language,\n contentTranslationHideLanguages = [],\n) => {\n if (!language) return false;\n const targetLanguage = getTranslateTargetLanguage(true);\n const different =\n language !== targetLanguage &&\n !localeMatch([language], [targetLanguage]) &&\n !contentTranslationHideLanguages.find(\n (l) => language === l || localeMatch([language], [l]),\n );\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages] = true;\n return different;\n};\n\nfunction Status({\n statusID,\n status,\n instance: propInstance,\n size = 'm',\n contentTextWeight,\n readOnly,\n enableCommentHint,\n withinContext,\n skeleton,\n enableTranslate,\n forceTranslate: _forceTranslate,\n previewMode,\n // allowFilters,\n onMediaClick,\n quoted,\n onStatusLinkClick = () => {},\n showFollowedTags,\n allowContextMenu,\n showActionsBar,\n showReplyParent,\n mediaFirst,\n}) {\n const { _, t } = useLingui();\n\n if (skeleton) {\n return (\n \n {!mediaFirst && }\n
    \n
    \n {(size === 's' || mediaFirst) && } ███ ████████\n
    \n
    \n {mediaFirst &&
    }\n
    \n

    ████ ████████

    \n
    \n
    \n
    \n
    \n );\n }\n const { masto, instance, authenticated } = api({ instance: propInstance });\n const { instance: currentInstance } = api();\n const sameInstance = instance === currentInstance;\n\n let sKey = statusKey(statusID || status?.id, instance);\n const snapStates = useSnapshot(states);\n if (!status) {\n status = snapStates.statuses[sKey] || snapStates.statuses[statusID];\n sKey = statusKey(status?.id, instance);\n }\n if (!status) {\n return null;\n }\n\n const {\n account: {\n acct,\n avatar,\n avatarStatic,\n id: accountId,\n url: accountURL,\n displayName,\n username,\n emojis: accountEmojis,\n bot,\n group,\n },\n id,\n repliesCount,\n reblogged,\n reblogsCount,\n favourited,\n favouritesCount,\n bookmarked,\n poll,\n muted,\n sensitive,\n spoilerText,\n visibility, // public, unlisted, private, direct\n language: _language,\n editedAt,\n filtered,\n card,\n createdAt,\n inReplyToId,\n inReplyToAccountId,\n content,\n mentions,\n mediaAttachments,\n reblog,\n uri,\n url,\n emojis,\n tags,\n pinned,\n // Non-API props\n _deleted,\n _pinned,\n // _filtered,\n // Non-Mastodon\n emojiReactions,\n } = status;\n\n const [languageAutoDetected, setLanguageAutoDetected] = useState(null);\n useEffect(() => {\n if (!content) return;\n if (_language) return;\n if (languageAutoDetected) return;\n let timer;\n timer = setTimeout(async () => {\n let detected = await detectLang(getHTMLTextForDetectLang(content));\n setLanguageAutoDetected(detected);\n }, 1000);\n return () => clearTimeout(timer);\n }, [content, _language]);\n const language = _language || languageAutoDetected;\n\n // if (!mediaAttachments?.length) mediaFirst = false;\n const hasMediaAttachments = !!mediaAttachments?.length;\n if (mediaFirst && hasMediaAttachments) size = 's';\n\n const currentAccount = useMemo(() => {\n return getCurrentAccountID();\n }, []);\n const isSelf = useMemo(() => {\n return currentAccount && currentAccount === accountId;\n }, [accountId, currentAccount]);\n\n const filterContext = useContext(FilterContext);\n const filterInfo =\n !isSelf && !readOnly && !previewMode && isFiltered(filtered, filterContext);\n\n if (filterInfo?.action === 'hide') {\n return null;\n }\n\n console.debug('RENDER Status', id, status?.account.displayName, quoted);\n\n const debugHover = (e) => {\n if (e.shiftKey) {\n console.log({\n ...status,\n });\n }\n };\n\n if (/*allowFilters && */ size !== 'l' && filterInfo) {\n return (\n \n );\n }\n\n const createdAtDate = new Date(createdAt);\n const editedAtDate = new Date(editedAt);\n\n let inReplyToAccountRef = mentions?.find(\n (mention) => mention.id === inReplyToAccountId,\n );\n if (!inReplyToAccountRef && inReplyToAccountId === id) {\n inReplyToAccountRef = { url: accountURL, username, displayName };\n }\n const [inReplyToAccount, setInReplyToAccount] = useState(inReplyToAccountRef);\n if (!withinContext && !inReplyToAccount && inReplyToAccountId) {\n const account = states.accounts[inReplyToAccountId];\n if (account) {\n setInReplyToAccount(account);\n } else {\n memFetchAccount(inReplyToAccountId, masto)\n .then((account) => {\n setInReplyToAccount(account);\n states.accounts[account.id] = account;\n })\n .catch((e) => {});\n }\n }\n const mentionSelf =\n inReplyToAccountId === currentAccount ||\n mentions?.find((mention) => mention.id === currentAccount);\n\n const readingExpandSpoilers = useMemo(() => {\n const prefs = store.account.get('preferences') || {};\n return !!prefs['reading:expand:spoilers'];\n }, []);\n const readingExpandMedia = useMemo(() => {\n // default | show_all | hide_all\n // Ignore hide_all because it means hide *ALL* media including non-sensitive ones\n const prefs = store.account.get('preferences') || {};\n return prefs['reading:expand:media']?.toLowerCase() || 'default';\n }, []);\n // FOR TESTING:\n // const readingExpandSpoilers = true;\n // const readingExpandMedia = 'show_all';\n const showSpoiler =\n previewMode || readingExpandSpoilers || !!snapStates.spoilers[id];\n const showSpoilerMedia =\n previewMode ||\n readingExpandMedia === 'show_all' ||\n !!snapStates.spoilersMedia[id];\n\n if (reblog) {\n // If has statusID, means useItemID (cached in states)\n\n if (group) {\n return (\n \n
    \n {' '}\n \n
    \n \n \n );\n }\n\n return (\n \n
    \n {' '}\n \n {' '}\n boosted\n \n
    \n \n \n );\n }\n\n // Check followedTags\n const FollowedTagsParent = useCallback(\n ({ children }) => (\n \n
    \n {' '}\n {snapStates.statusFollowedTags[sKey].slice(0, 3).map((tag) => (\n \n {tag}\n \n ))}\n
    \n {children}\n \n ),\n [sKey, instance, snapStates.statusFollowedTags[sKey]],\n );\n const StatusParent =\n showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length\n ? FollowedTagsParent\n : Fragment;\n\n const isSizeLarge = size === 'l';\n\n const [forceTranslate, setForceTranslate] = useState(_forceTranslate);\n // const targetLanguage = getTranslateTargetLanguage(true);\n // const contentTranslationHideLanguages =\n // snapStates.settings.contentTranslationHideLanguages || [];\n const { contentTranslation, contentTranslationAutoInline } =\n snapStates.settings;\n if (!contentTranslation) enableTranslate = false;\n const inlineTranslate = useMemo(() => {\n if (\n !contentTranslation ||\n !contentTranslationAutoInline ||\n readOnly ||\n (withinContext && !isSizeLarge) ||\n previewMode ||\n spoilerText ||\n sensitive ||\n poll ||\n card ||\n mediaAttachments?.length\n ) {\n return false;\n }\n const contentLength = htmlContentLength(content);\n return contentLength > 0 && contentLength <= INLINE_TRANSLATE_LIMIT;\n }, [\n contentTranslation,\n contentTranslationAutoInline,\n readOnly,\n withinContext,\n isSizeLarge,\n previewMode,\n spoilerText,\n sensitive,\n poll,\n card,\n mediaAttachments,\n content,\n ]);\n\n const [showEdited, setShowEdited] = useState(false);\n const [showEmbed, setShowEmbed] = useState(false);\n\n const spoilerContentRef = useTruncated();\n const contentRef = useTruncated();\n const mediaContainerRef = useTruncated();\n\n const statusRef = useRef(null);\n\n const unauthInteractionErrorMessage = t`Sorry, your current logged-in instance can't interact with this post from another instance.`;\n\n const textWeight = useCallback(\n () =>\n Math.max(\n Math.round((spoilerText.length + htmlContentLength(content)) / 140) ||\n 1,\n 1,\n ),\n [spoilerText, content],\n );\n\n const createdDateText = niceDateTime(createdAtDate);\n const editedDateText = editedAt && niceDateTime(editedAtDate);\n\n // Can boost if:\n // - authenticated AND\n // - visibility != direct OR\n // - visibility = private AND isSelf\n let canBoost =\n authenticated && visibility !== 'direct' && visibility !== 'private';\n if (visibility === 'private' && isSelf) {\n canBoost = true;\n }\n\n const replyStatus = (e) => {\n if (!sameInstance || !authenticated) {\n return alert(unauthInteractionErrorMessage);\n }\n // syntheticEvent comes from MenuItem\n if (e?.shiftKey || e?.syntheticEvent?.shiftKey) {\n const newWin = openCompose({\n replyToStatus: status,\n });\n if (newWin) return;\n }\n showCompose({\n replyToStatus: status,\n });\n };\n\n // Check if media has no descriptions\n const mediaNoDesc = useMemo(() => {\n return mediaAttachments.some(\n (attachment) => !attachment.description?.trim?.(),\n );\n }, [mediaAttachments]);\n\n const statusMonthsAgo = useMemo(() => {\n return Math.floor(\n (new Date() - createdAtDate) / (1000 * 60 * 60 * 24 * 30),\n );\n }, [createdAtDate]);\n\n // const boostStatus = async () => {\n // if (!sameInstance || !authenticated) {\n // alert(unauthInteractionErrorMessage);\n // return false;\n // }\n // try {\n // if (!reblogged) {\n // let confirmText = 'Boost this post?';\n // if (mediaNoDesc) {\n // confirmText += '\\n\\n⚠️ Some media have no descriptions.';\n // }\n // const yes = confirm(confirmText);\n // if (!yes) {\n // return false;\n // }\n // }\n // // Optimistic\n // states.statuses[sKey] = {\n // ...status,\n // reblogged: !reblogged,\n // reblogsCount: reblogsCount + (reblogged ? -1 : 1),\n // };\n // if (reblogged) {\n // const newStatus = await masto.v1.statuses.$select(id).unreblog();\n // saveStatus(newStatus, instance);\n // return true;\n // } else {\n // const newStatus = await masto.v1.statuses.$select(id).reblog();\n // saveStatus(newStatus, instance);\n // return true;\n // }\n // } catch (e) {\n // console.error(e);\n // // Revert optimistism\n // states.statuses[sKey] = status;\n // return false;\n // }\n // };\n const confirmBoostStatus = async () => {\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n reblogged: !reblogged,\n reblogsCount: reblogsCount + (reblogged ? -1 : 1),\n };\n if (reblogged) {\n const newStatus = await masto.v1.statuses.$select(id).unreblog();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).reblog();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n\n const favouriteStatus = async () => {\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n favourited: !favourited,\n favouritesCount: favouritesCount + (favourited ? -1 : 1),\n };\n if (favourited) {\n const newStatus = await masto.v1.statuses.$select(id).unfavourite();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).favourite();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n const favouriteStatusNotify = async () => {\n try {\n const done = await favouriteStatus();\n if (!isSizeLarge && done) {\n showToast(\n favourited\n ? t`Unliked @${username || acct}'s post`\n : t`Liked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n };\n\n const bookmarkStatus = async () => {\n if (!supports('@mastodon/post-bookmark')) return;\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n bookmarked: !bookmarked,\n };\n if (bookmarked) {\n const newStatus = await masto.v1.statuses.$select(id).unbookmark();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).bookmark();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n const bookmarkStatusNotify = async () => {\n try {\n const done = await bookmarkStatus();\n if (!isSizeLarge && done) {\n showToast(\n bookmarked\n ? t`Unbookmarked @${username || acct}'s post`\n : t`Bookmarked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n };\n\n // const differentLanguage =\n // !!language &&\n // language !== targetLanguage &&\n // !localeMatch([language], [targetLanguage]) &&\n // !contentTranslationHideLanguages.find(\n // (l) => language === l || localeMatch([language], [l]),\n // );\n const contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages || [];\n const [differentLanguage, setDifferentLanguage] = useState(\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages]\n ? checkDifferentLanguage(language, contentTranslationHideLanguages)\n : false,\n );\n useEffect(() => {\n if (\n !language ||\n differentLanguage ||\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages]\n ) {\n return;\n }\n let timeout = setTimeout(() => {\n const different = checkDifferentLanguage(\n language,\n contentTranslationHideLanguages,\n );\n if (different) setDifferentLanguage(different);\n }, 1);\n return () => clearTimeout(timeout);\n }, [language, differentLanguage, contentTranslationHideLanguages]);\n\n const reblogIterator = useRef();\n const favouriteIterator = useRef();\n async function fetchBoostedLikedByAccounts(firstLoad) {\n if (firstLoad) {\n reblogIterator.current = masto.v1.statuses\n .$select(statusID)\n .rebloggedBy.list({\n limit: REACTIONS_LIMIT,\n });\n favouriteIterator.current = masto.v1.statuses\n .$select(statusID)\n .favouritedBy.list({\n limit: REACTIONS_LIMIT,\n });\n }\n const [{ value: reblogResults }, { value: favouriteResults }] =\n await Promise.allSettled([\n reblogIterator.current.next(),\n favouriteIterator.current.next(),\n ]);\n if (reblogResults.value?.length || favouriteResults.value?.length) {\n const accounts = [];\n if (reblogResults.value?.length) {\n accounts.push(\n ...reblogResults.value.map((a) => {\n a._types = ['reblog'];\n return a;\n }),\n );\n }\n if (favouriteResults.value?.length) {\n accounts.push(\n ...favouriteResults.value.map((a) => {\n a._types = ['favourite'];\n return a;\n }),\n );\n }\n return {\n value: accounts,\n done: reblogResults.done && favouriteResults.done,\n };\n }\n return {\n value: [],\n done: true,\n };\n }\n\n const actionsRef = useRef();\n const isPublic = ['public', 'unlisted'].includes(visibility);\n const isPinnable = ['public', 'unlisted', 'private'].includes(visibility);\n const StatusMenuItems = (\n <>\n {!isSizeLarge && sameInstance && (\n <>\n
    \n \n \n \n {repliesCount > 0 ? shortenNumber(repliesCount) : t`Reply`}\n \n \n \n \n {reblogged ? t`Unboost` : t`Boost`}\n \n }\n className={`menu-reblog ${reblogged ? 'checked' : ''}`}\n menuExtras={\n {\n showCompose({\n draftStatus: {\n status: `\\n${url}`,\n },\n });\n }}\n >\n \n \n Quote\n \n \n }\n menuFooter={\n mediaNoDesc && !reblogged ? (\n
    \n \n Some media have no descriptions.\n
    \n ) : (\n statusMonthsAgo >= 3 && (\n
    \n \n \n \n Old post (\n \n {rtf.format(-statusMonthsAgo, 'month')}\n \n )\n \n \n
    \n )\n )\n }\n disabled={!canBoost}\n onClick={async () => {\n try {\n const done = await confirmBoostStatus();\n if (!isSizeLarge && done) {\n showToast(\n reblogged\n ? t`Unboosted @${username || acct}'s post`\n : t`Boosted @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n }}\n >\n \n \n {reblogsCount > 0\n ? shortenNumber(reblogsCount)\n : reblogged\n ? t`Unboost`\n : t`Boost…`}\n \n \n \n \n \n {favouritesCount > 0\n ? shortenNumber(favouritesCount)\n : favourited\n ? t`Unlike`\n : t`Like`}\n \n \n {supports('@mastodon/post-bookmark') && (\n \n \n {bookmarked ? t`Unbookmark` : t`Bookmark`}\n \n )}\n
    \n \n )}\n {!isSizeLarge && sameInstance && (isSizeLarge || showActionsBar) && (\n \n )}\n {(isSizeLarge || showActionsBar) && (\n <>\n {\n states.showGenericAccounts = {\n heading: t`Boosted/Liked by…`,\n fetchAccounts: fetchBoostedLikedByAccounts,\n instance,\n showReactions: true,\n postID: sKey,\n };\n }}\n >\n \n \n Boosted/Liked by…\n \n \n \n )}\n {!mediaFirst && (\n <>\n {(enableTranslate || !language || differentLanguage) && (\n \n )}\n {enableTranslate ? (\n
    \n {\n setForceTranslate(true);\n }}\n >\n \n \n Translate\n \n \n {supportsTTS && (\n {\n const postText = getPostText(status);\n if (postText) {\n speak(postText, language);\n }\n }}\n >\n \n \n Speak\n \n \n )}\n
    \n ) : (\n (!language || differentLanguage) && (\n
    \n \n \n \n Translate\n \n \n {supportsTTS && (\n {\n const postText = getPostText(status);\n if (postText) {\n speak(postText, language);\n }\n }}\n >\n \n \n Speak\n \n \n )}\n
    \n )\n )}\n \n )}\n {((!isSizeLarge && sameInstance) ||\n enableTranslate ||\n !language ||\n differentLanguage) && }\n {!isSizeLarge && (\n <>\n {\n onStatusLinkClick(e, status);\n }}\n >\n \n \n \n View post by{' '}\n @{username || acct}\n \n
    \n \n {_(visibilityText[visibility])} • {createdDateText}\n \n
    \n \n \n )}\n {!!editedAt && (\n <>\n {\n setShowEdited(id);\n }}\n >\n \n \n Show Edit History\n
    \n \n Edited: {editedDateText}\n \n
    \n \n \n )}\n \n \n \n {nicePostURL(url)}\n \n \n
    \n {\n // Copy url to clipboard\n try {\n navigator.clipboard.writeText(url);\n showToast(t`Link copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy link`);\n }\n }}\n >\n \n \n Copy\n \n \n {isPublic &&\n navigator?.share &&\n navigator?.canShare?.({\n url,\n }) && (\n {\n try {\n navigator.share({\n url,\n });\n } catch (e) {\n console.error(e);\n alert(t`Sharing doesn't seem to work.`);\n }\n }}\n >\n \n \n Share…\n \n \n )}\n
    \n {isPublic && isSizeLarge && (\n {\n setShowEmbed(true);\n }}\n >\n \n \n Embed post\n \n \n )}\n {(isSelf || mentionSelf) && }\n {(isSelf || mentionSelf) && (\n {\n try {\n const newStatus = await masto.v1.statuses\n .$select(id)\n [muted ? 'unmute' : 'mute']();\n saveStatus(newStatus, instance);\n showToast(\n muted ? t`Conversation unmuted` : t`Conversation muted`,\n );\n } catch (e) {\n console.error(e);\n showToast(\n muted\n ? t`Unable to unmute conversation`\n : t`Unable to mute conversation`,\n );\n }\n }}\n >\n {muted ? (\n <>\n \n \n Unmute conversation\n \n \n ) : (\n <>\n \n \n Mute conversation\n \n \n )}\n \n )}\n {isSelf && isPinnable && (\n {\n try {\n const newStatus = await masto.v1.statuses\n .$select(id)\n [pinned ? 'unpin' : 'pin']();\n saveStatus(newStatus, instance);\n showToast(\n pinned\n ? t`Post unpinned from profile`\n : t`Post pinned to profile`,\n );\n } catch (e) {\n console.error(e);\n showToast(\n pinned ? t`Unable to unpin post` : t`Unable to pin post`,\n );\n }\n }}\n >\n {pinned ? (\n <>\n \n \n Unpin from profile\n \n \n ) : (\n <>\n \n \n Pin to profile\n \n \n )}\n \n )}\n {isSelf && (\n
    \n {supports('@mastodon/post-edit') && (\n {\n showCompose({\n editStatus: status,\n });\n }}\n >\n \n \n Edit\n \n \n )}\n {isSizeLarge && (\n \n \n \n Delete this post?\n \n \n }\n itemProps={{\n className: 'danger',\n }}\n menuItemClassName=\"danger\"\n onClick={() => {\n // const yes = confirm('Delete this post?');\n // if (yes) {\n (async () => {\n try {\n await masto.v1.statuses.$select(id).remove();\n const cachedStatus = getStatus(id, instance);\n cachedStatus._deleted = true;\n showToast(t`Post deleted`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to delete post`);\n }\n })();\n // }\n }}\n >\n \n \n Delete…\n \n \n )}\n
    \n )}\n {!isSelf && isSizeLarge && (\n <>\n \n {\n states.showReportModal = {\n account: status.account,\n post: status,\n };\n }}\n >\n \n \n Report post…\n \n \n \n )}\n \n );\n\n const contextMenuRef = useRef();\n const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);\n const [contextMenuProps, setContextMenuProps] = useState({});\n\n const showContextMenu =\n allowContextMenu || (!isSizeLarge && !previewMode && !_deleted && !quoted);\n\n // Only iOS/iPadOS browsers don't support contextmenu\n // Some comments report iPadOS might support contextmenu if a mouse is connected\n const bindLongPressContext = useLongPress(\n isIOS && showContextMenu\n ? (e) => {\n if (e.pointerType === 'mouse') return;\n // There's 'pen' too, but not sure if contextmenu event would trigger from a pen\n\n const { clientX, clientY } = e.touches?.[0] || e;\n // link detection copied from onContextMenu because here it works\n const link = e.target.closest('a');\n if (\n link &&\n statusRef.current.contains(link) &&\n !link.getAttribute('href').startsWith('#')\n )\n return;\n e.preventDefault();\n setContextMenuProps({\n anchorPoint: {\n x: clientX,\n y: clientY,\n },\n direction: 'right',\n });\n setIsContextMenuOpen(true);\n }\n : null,\n {\n threshold: 600,\n captureEvent: true,\n detect: 'touch',\n cancelOnMovement: 2, // true allows movement of up to 25 pixels\n },\n );\n\n const hotkeysEnabled = !readOnly && !previewMode && !quoted;\n const rRef = useHotkeys('r, shift+r', replyStatus, {\n enabled: hotkeysEnabled,\n });\n const fRef = useHotkeys('f, l', favouriteStatusNotify, {\n enabled: hotkeysEnabled,\n });\n const dRef = useHotkeys('d', bookmarkStatusNotify, {\n enabled: hotkeysEnabled,\n });\n const bRef = useHotkeys(\n 'shift+b',\n () => {\n (async () => {\n try {\n const done = await confirmBoostStatus();\n if (!isSizeLarge && done) {\n showToast(\n reblogged\n ? t`Unboosted @${username || acct}'s post`\n : t`Boosted @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n })();\n },\n {\n enabled: hotkeysEnabled && canBoost,\n },\n );\n const xRef = useHotkeys('x', (e) => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n if (activeStatus) {\n const spoilerButton = activeStatus.querySelector(\n '.spoiler-button:not(.spoiling)',\n );\n if (spoilerButton) {\n e.stopPropagation();\n spoilerButton.click();\n } else {\n const spoilerMediaButton = activeStatus.querySelector(\n '.spoiler-media-button:not(.spoiling)',\n );\n if (spoilerMediaButton) {\n e.stopPropagation();\n spoilerMediaButton.click();\n }\n }\n }\n });\n\n const displayedMediaAttachments = mediaAttachments.slice(\n 0,\n isSizeLarge ? undefined : 4,\n );\n const showMultipleMediaCaptions =\n mediaAttachments.length > 1 &&\n displayedMediaAttachments.some(\n (media) => !!media.description && !isMediaCaptionLong(media.description),\n );\n const captionChildren = useMemo(() => {\n if (!showMultipleMediaCaptions) return null;\n const attachments = [];\n displayedMediaAttachments.forEach((media, i) => {\n if (!media.description) return;\n const index = attachments.findIndex(\n (attachment) => attachment.media.description === media.description,\n );\n if (index === -1) {\n attachments.push({\n media,\n indices: [i],\n });\n } else {\n attachments[index].indices.push(i);\n }\n });\n return attachments.map(({ media, indices }) => (\n i + 1).join(' ')}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n states.showMediaAlt = {\n alt: media.description,\n lang: language,\n };\n }}\n title={media.description}\n >\n {indices.map((i) => i + 1).join(' ')} {media.description}\n \n ));\n\n // return displayedMediaAttachments.map(\n // (media, i) =>\n // !!media.description && (\n // {\n // e.preventDefault();\n // e.stopPropagation();\n // states.showMediaAlt = {\n // alt: media.description,\n // lang: language,\n // };\n // }}\n // title={media.description}\n // >\n // {i + 1} {media.description}\n // \n // ),\n // );\n }, [showMultipleMediaCaptions, displayedMediaAttachments, language]);\n\n const isThread = useMemo(() => {\n return (\n (!!inReplyToId && inReplyToAccountId === status.account?.id) ||\n !!snapStates.statusThreadNumber[sKey]\n );\n }, [\n inReplyToId,\n inReplyToAccountId,\n status.account?.id,\n snapStates.statusThreadNumber[sKey],\n ]);\n\n const showCommentHint = useMemo(() => {\n return (\n enableCommentHint &&\n !isThread &&\n !withinContext &&\n !inReplyToId &&\n visibility === 'public' &&\n repliesCount > 0\n );\n }, [\n enableCommentHint,\n isThread,\n withinContext,\n inReplyToId,\n repliesCount,\n visibility,\n ]);\n const showCommentCount = useMemo(() => {\n if (\n card ||\n poll ||\n sensitive ||\n spoilerText ||\n mediaAttachments?.length ||\n isThread ||\n withinContext ||\n inReplyToId ||\n repliesCount <= 0\n ) {\n return false;\n }\n const questionRegex = /[???︖❓❔⁇⁈⁉¿‽؟]/;\n const containsQuestion = questionRegex.test(content);\n if (!containsQuestion) return false;\n const contentLength = htmlContentLength(content);\n if (contentLength > 0 && contentLength <= SHOW_COMMENT_COUNT_LIMIT) {\n return true;\n }\n }, [\n card,\n poll,\n sensitive,\n spoilerText,\n mediaAttachments,\n reblog,\n isThread,\n withinContext,\n inReplyToId,\n repliesCount,\n content,\n ]);\n\n return (\n \n {showReplyParent && !!(inReplyToId && inReplyToAccountId) && (\n \n )}\n {\n statusRef.current = node;\n // Use parent node if it's in focus\n // Use case: \n // When navigating (j/k), the is focused instead of \n // Hotkey binding doesn't bubble up thus this hack\n const nodeRef =\n node?.closest?.(\n '.timeline-item, .timeline-item-alt, .status-link, .status-focus',\n ) || node;\n rRef(nodeRef);\n fRef(nodeRef);\n dRef(nodeRef);\n bRef(nodeRef);\n xRef(nodeRef);\n }}\n tabindex=\"-1\"\n class={`status ${\n !withinContext && inReplyToId && inReplyToAccount\n ? 'status-reply-to'\n : ''\n } visibility-${visibility} ${_pinned ? 'status-pinned' : ''} ${\n SIZE_CLASS[size]\n } ${_deleted ? 'status-deleted' : ''} ${quoted ? 'status-card' : ''} ${\n isContextMenuOpen ? 'status-menu-open' : ''\n } ${mediaFirst && hasMediaAttachments ? 'status-media-first' : ''}`}\n onMouseEnter={debugHover}\n onContextMenu={(e) => {\n if (!showContextMenu) return;\n if (e.metaKey) return;\n // console.log('context menu', e);\n const link = e.target.closest('a');\n if (\n link &&\n statusRef.current.contains(link) &&\n !link.getAttribute('href').startsWith('#')\n )\n return;\n\n // If there's selected text, don't show custom context menu\n const selection = window.getSelection?.();\n if (selection.toString().length > 0) {\n const { anchorNode } = selection;\n if (statusRef.current?.contains(anchorNode)) {\n return;\n }\n }\n e.preventDefault();\n setContextMenuProps({\n anchorPoint: {\n x: e.clientX,\n y: e.clientY,\n },\n direction: 'right',\n });\n setIsContextMenuOpen(true);\n }}\n {...(showContextMenu ? bindLongPressContext() : {})}\n >\n {showContextMenu && (\n {\n setIsContextMenuOpen(false);\n // statusRef.current?.focus?.();\n if (e?.reason === 'click') {\n statusRef.current?.closest('[tabindex]')?.focus?.();\n }\n }}\n portal={{\n target: document.body,\n }}\n containerProps={{\n style: {\n // Higher than the backdrop\n zIndex: 1001,\n },\n onClick: () => {\n contextMenuRef.current?.closeMenu?.();\n },\n }}\n overflow=\"auto\"\n boundingBoxPadding={safeBoundingBoxPadding()}\n unmountOnClose\n >\n {StatusMenuItems}\n \n )}\n {showActionsBar &&\n size !== 'l' &&\n !previewMode &&\n !readOnly &&\n !_deleted &&\n !quoted && (\n \n \n \n {\n e.preventDefault();\n e.stopPropagation();\n setContextMenuProps({\n anchorRef: {\n current: e.currentTarget,\n },\n align: 'start',\n direction: 'left',\n gap: 0,\n shift: -8,\n });\n setIsContextMenuOpen('actions-bar');\n }}\n >\n \n \n \n )}\n {size !== 'l' && (\n
    \n {reblogged && (\n \n )}\n {favourited && (\n \n )}\n {bookmarked && (\n \n )}\n {_pinned && (\n \n )}\n
    \n )}\n {size !== 's' && (\n {\n e.preventDefault();\n e.stopPropagation();\n states.showAccount = {\n account: status.account,\n instance,\n };\n }}\n >\n \n
    \n )}\n
    \n
    \n \n \n \n {/* {inReplyToAccount && !withinContext && size !== 's' && (\n <>\n {' '}\n \n {' '}\n \n \n \n )} */}\n {/* */}{' '}\n {size !== 'l' &&\n (_deleted ? (\n \n Deleted\n \n ) : url && !previewMode && !readOnly && !quoted ? (\n {\n if (\n e.metaKey ||\n e.ctrlKey ||\n e.shiftKey ||\n e.altKey ||\n e.which === 2\n ) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n onStatusLinkClick?.(e, status);\n setContextMenuProps({\n anchorRef: {\n current: e.currentTarget,\n },\n align: 'end',\n direction: 'bottom',\n gap: 4,\n });\n setIsContextMenuOpen(true);\n }}\n class={`time ${\n isContextMenuOpen && contextMenuProps?.anchorRef\n ? 'is-open'\n : ''\n }`}\n >\n {showCommentHint && !showCommentCount ? (\n \n ) : (\n visibility !== 'public' &&\n visibility !== 'direct' && (\n \n )\n )}{' '}\n \n {!previewMode && !readOnly && (\n \n )}\n \n ) : (\n // {\n // if (e.target === e.currentTarget)\n // menuInstanceRef.current?.closeMenu?.();\n // },\n // }}\n // align=\"end\"\n // gap={4}\n // overflow=\"auto\"\n // viewScroll=\"close\"\n // boundingBoxPadding=\"8 8 8 8\"\n // unmountOnClose\n // menuButton={({ open }) => (\n // {\n // e.preventDefault();\n // e.stopPropagation();\n // onStatusLinkClick?.(e, status);\n // }}\n // class={`time ${open ? 'is-open' : ''}`}\n // >\n // {' '}\n // \n // \n // )}\n // >\n // {StatusMenuItems}\n // \n \n {visibility !== 'public' && visibility !== 'direct' && (\n <>\n {' '}\n \n )}\n \n \n ))}\n
    \n {visibility === 'direct' && (\n <>\n
    \n Private mention\n
    {' '}\n \n )}\n {!withinContext && (\n <>\n {isThread ? (\n
    \n \n \n Thread\n {snapStates.statusThreadNumber[sKey]\n ? ` ${snapStates.statusThreadNumber[sKey]}/X`\n : ''}\n \n
    \n ) : (\n !!inReplyToId &&\n !!inReplyToAccount &&\n (!!spoilerText ||\n !mentions.find((mention) => {\n return mention.id === inReplyToAccountId;\n })) && (\n
    \n {' '}\n \n
    \n )\n )}\n \n )}\n \n {mediaFirst && hasMediaAttachments ? (\n <>\n {(!!spoilerText || !!sensitive) && !readingExpandSpoilers && (\n <>\n {!!spoilerText && (\n \n {' '}\n \n )}\n {\n e.preventDefault();\n e.stopPropagation();\n if (showSpoiler) {\n delete states.spoilers[id];\n if (!readingExpandSpoilers) {\n delete states.spoilersMedia[id];\n }\n } else {\n states.spoilers[id] = true;\n if (!readingExpandSpoilers) {\n states.spoilersMedia[id] = true;\n }\n }\n }}\n >\n {' '}\n {showSpoiler ? t`Show less` : t`Show content`}\n \n \n )}\n \n {!!content && (\n
    \n \n
    \n )}\n \n ) : (\n <>\n {!!spoilerText && (\n <>\n \n

    \n \n

    \n
    \n {readingExpandSpoilers || previewMode ? (\n
    \n Content warning\n
    \n ) : (\n {\n e.preventDefault();\n e.stopPropagation();\n if (showSpoiler) {\n delete states.spoilers[id];\n if (!readingExpandSpoilers) {\n delete states.spoilersMedia[id];\n }\n } else {\n states.spoilers[id] = true;\n if (!readingExpandSpoilers) {\n states.spoilersMedia[id] = true;\n }\n }\n }}\n >\n {' '}\n {showSpoiler ? t`Show less` : t`Show content`}\n \n )}\n \n )}\n {!!content && (\n \n \n \n \n )}\n {!!poll && (\n {\n states.statuses[sKey].poll = newPoll;\n }}\n refresh={() => {\n return masto.v1.polls\n .$select(poll.id)\n .fetch()\n .then((pollResponse) => {\n states.statuses[sKey].poll = pollResponse;\n })\n .catch((e) => {}); // Silently fail\n }}\n votePoll={(choices) => {\n return masto.v1.polls\n .$select(poll.id)\n .votes.create({\n choices,\n })\n .then((pollResponse) => {\n states.statuses[sKey].poll = pollResponse;\n })\n .catch((e) => {}); // Silently fail\n }}\n />\n )}\n {(((enableTranslate || inlineTranslate) &&\n isTranslateble(content) &&\n differentLanguage) ||\n forceTranslate) && (\n \n )}\n {!previewMode &&\n sensitive &&\n !!mediaAttachments.length &&\n readingExpandMedia !== 'show_all' && (\n
    \n );\n}\n\nfunction MultipleMediaFigure(props) {\n const { enabled, children, lang, captionChildren } = props;\n if (!enabled || !captionChildren) return children;\n return (\n
    \n {children}\n
    \n {captionChildren}\n
    \n
    \n );\n}\n\nfunction MediaFirstContainer(props) {\n const { mediaAttachments, language, postID, instance } = props;\n const moreThanOne = mediaAttachments.length > 1;\n\n const carouselRef = useRef();\n const [currentIndex, setCurrentIndex] = useState(0);\n\n useEffect(() => {\n let handleScroll = () => {\n const { clientWidth, scrollLeft } = carouselRef.current;\n const index = Math.round(Math.abs(scrollLeft) / clientWidth);\n setCurrentIndex(index);\n };\n if (carouselRef.current) {\n carouselRef.current.addEventListener('scroll', handleScroll, {\n passive: true,\n });\n }\n return () => {\n if (carouselRef.current) {\n carouselRef.current.removeEventListener('scroll', handleScroll);\n }\n };\n }, []);\n\n return (\n <>\n
    \n
    \n {mediaAttachments.map((media, i) => (\n
    \n \n
    \n ))}\n
    \n {moreThanOne && (\n \n )}\n
    \n {moreThanOne && (\n \n {mediaAttachments.map((media, i) => (\n \n ))}\n \n )}\n \n );\n}\n\nfunction getDomain(url) {\n return punycode.toUnicode(\n URL.parse(url)\n .hostname.replace(/^www\\./, '')\n .replace(/\\/$/, ''),\n );\n}\n\n// \"Post\": Quote post + card link preview combo\n// Assume all links from these domains are \"posts\"\n// Mastodon links are \"posts\" too but they are converted to real quote posts and there's too many domains to check\n// This is just \"Progressive Enhancement\"\nfunction isCardPost(domain) {\n return ['x.com', 'twitter.com', 'threads.net', 'bsky.app'].includes(domain);\n}\n\nfunction Byline({ authors, hidden, children }) {\n if (hidden) return children;\n if (!authors?.[0]?.account?.id) return children;\n const author = authors[0].account;\n\n return (\n \n );\n}\n\nfunction Card({ card, selfReferential, selfAuthor, instance }) {\n const snapStates = useSnapshot(states);\n const {\n blurhash,\n title,\n description,\n html,\n providerName,\n providerUrl,\n authorName,\n authorUrl,\n width,\n height,\n image,\n imageDescription,\n url,\n type,\n embedUrl,\n language,\n publishedAt,\n authors,\n } = card;\n\n /* type\n link = Link OEmbed\n photo = Photo OEmbed\n video = Video OEmbed\n rich = iframe OEmbed. Not currently accepted, so won’t show up in practice.\n */\n\n const hasText = title || providerName || authorName;\n const isLandscape = width / height >= 1.2;\n const size = isLandscape ? 'large' : '';\n\n const [cardStatusURL, setCardStatusURL] = useState(null);\n // const [cardStatusID, setCardStatusID] = useState(null);\n useEffect(() => {\n if (hasText && image && !selfReferential && isMastodonLinkMaybe(url)) {\n unfurlMastodonLink(instance, url).then((result) => {\n if (!result) return;\n const { id, url } = result;\n setCardStatusURL('#' + url);\n\n // NOTE: This is for quote post\n // (async () => {\n // const { masto } = api({ instance });\n // const status = await masto.v1.statuses.$select(id).fetch();\n // saveStatus(status, instance);\n // setCardStatusID(id);\n // })();\n });\n }\n }, [hasText, image, selfReferential]);\n\n // if (cardStatusID) {\n // return (\n // \n // );\n // }\n\n if (snapStates.unfurledLinks[url]) return null;\n\n const hasIframeHTML = /