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