'+st+"");const En=w?w.createHTML(st):st;if(yt===rt)try{Ne=new g().parseFromString(En,Dt)}catch{}if(!Ne||!Ne.documentElement){Ne=C.createDocument(yt,"template",null);try{Ne.documentElement.innerHTML=Rt?y:En}catch{}}const Cn=Ne.body||Ne.documentElement;return st&&Lt&&Cn.insertBefore(n.createTextNode(Lt),Cn.childNodes[0]||null),yt===rt?S.call(Ne,Y?"html":"body")[0]:Y?Ne.documentElement:Cn},Rs=function(st){return x.call(st.ownerDocument||st,st,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Es=function(st){return st instanceof f&&(typeof st.nodeName!="string"||typeof st.textContent!="string"||typeof st.removeChild!="function"||!(st.attributes instanceof h)||typeof st.removeAttribute!="function"||typeof st.setAttribute!="function"||typeof st.namespaceURI!="string"||typeof st.insertBefore!="function"||typeof st.hasChildNodes!="function")},dt=function(st){return typeof l=="function"&&st instanceof l};function lt(zn,st,Ne){tce(zn,Lt=>{Lt.call(t,st,Ne,di)})}const Ht=function(st){let Ne=null;if(lt(Q.beforeSanitizeElements,st,null),Es(st))return Ti(st),!0;const Lt=Fn(st.nodeName);if(lt(Q.uponSanitizeElement,st,{tagName:Lt,allowedTags:H}),Ae&&st.hasChildNodes()&&!dt(st.firstElementChild)&&qm(/<[/\w!]/g,st.innerHTML)&&qm(/<[/\w!]/g,st.textContent)||st.nodeType===jX.progressingInstruction||Ae&&st.nodeType===jX.comment&&qm(/<[/\w]/g,st.data))return Ti(st),!0;if(!H[Lt]||ee[Lt]){if(!ee[Lt]&&kn(Lt)&&(X.tagNameCheck instanceof RegExp&&qm(X.tagNameCheck,Lt)||X.tagNameCheck instanceof Function&&X.tagNameCheck(Lt)))return!1;if(ve&&!xe[Lt]){const En=O(st)||st.parentNode,Cn=b(st)||st.childNodes;if(Cn&&En){const Bn=Cn.length;for(let bi=Bn-1;bi>=0;--bi){const Ue=m(Cn[bi],!0);Ue.__removalCount=(st.__removalCount||0)+1,En.insertBefore(Ue,p(st))}}}return Ti(st),!0}return st instanceof d&&!Po(st)||(Lt==="noscript"||Lt==="noembed"||Lt==="noframes")&&qm(/<\/no(script|embed|frames)/i,st.innerHTML)?(Ti(st),!0):(ne&&st.nodeType===jX.text&&(Ne=st.textContent,tce([T,M,B],En=>{Ne=IX(Ne,En," ")}),st.textContent!==Ne&&(RX(t.removed,{element:st.cloneNode()}),st.textContent=Ne)),lt(Q.afterSanitizeElements,st,null),!1)},Tt=function(st,Ne,Lt){if(pe&&(Ne==="id"||Ne==="name")&&(Lt in n||Lt in Pi))return!1;if(!(oe&&!q[Ne]&&qm(P,Ne))){if(!($&&qm(F,Ne))){if(!Z[Ne]||q[Ne]){if(!(kn(st)&&(X.tagNameCheck instanceof RegExp&&qm(X.tagNameCheck,st)||X.tagNameCheck instanceof Function&&X.tagNameCheck(st))&&(X.attributeNameCheck instanceof RegExp&&qm(X.attributeNameCheck,Ne)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(Ne,st))||Ne==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&qm(X.tagNameCheck,Lt)||X.tagNameCheck instanceof Function&&X.tagNameCheck(Lt))))return!1}else if(!Xe[Ne]){if(!qm(W,IX(Lt,N,""))){if(!((Ne==="src"||Ne==="xlink:href"||Ne==="href")&&st!=="script"&&d4o(Lt,"data:")===0&&Fe[st])){if(!(de&&!qm(R,IX(Lt,N,"")))){if(Lt)return!1}}}}}}return!0},kn=function(st){return st!=="annotation-xml"&&f9e(st,I)},qt=function(st){lt(Q.beforeSanitizeAttributes,st,null);const{attributes:Ne}=st;if(!Ne||Es(st))return;const Lt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let En=Ne.length;for(;En--;){const Cn=Ne[En],{name:Bn,namespaceURI:bi,value:Ue}=Cn,We=Fn(Bn),Bt=Ue;let fn=Bn==="value"?Bt:u4o(Bt);if(Lt.attrName=We,Lt.attrValue=fn,Lt.keepAttr=!0,Lt.forceKeepAttr=void 0,lt(Q.uponSanitizeAttribute,st,Lt),fn=Lt.attrValue,Le&&(We==="id"||We==="name")&&(ri(Bn,st),fn=Be+fn),Ae&&qm(/((--!?|])>)|<\/(style|title|textarea)/i,fn)){ri(Bn,st);continue}if(We==="attributename"&&f9e(fn,"href")){ri(Bn,st);continue}if(Lt.forceKeepAttr)continue;if(!Lt.keepAttr){ri(Bn,st);continue}if(!ke&&qm(/\/>/i,fn)){ri(Bn,st);continue}ne&&tce([T,M,B],kr=>{fn=IX(fn,kr," ")});const Sn=Fn(st.nodeName);if(!Tt(Sn,We,fn)){ri(Bn,st);continue}if(w&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!bi)switch(k.getAttributeType(Sn,We)){case"TrustedHTML":{fn=w.createHTML(fn);break}case"TrustedScriptURL":{fn=w.createScriptURL(fn);break}}if(fn!==Bt)try{bi?st.setAttributeNS(bi,Bn,fn):st.setAttribute(Bn,fn),Es(st)?Ti(st):iyt(t.removed)}catch{ri(Bn,st)}}lt(Q.afterSanitizeAttributes,st,null)},oo=function zn(st){let Ne=null;const Lt=Rs(st);for(lt(Q.beforeSanitizeShadowDOM,st,null);Ne=Lt.nextNode();)lt(Q.uponSanitizeShadowNode,Ne,null),Ht(Ne),qt(Ne),Ne.content instanceof s&&zn(Ne.content);lt(Q.afterSanitizeShadowDOM,st,null)};return t.sanitize=function(zn){let st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ne=null,Lt=null,En=null,Cn=null;if(Rt=!zn,Rt&&(zn="\x3C!-->"),typeof zn!="string"&&!dt(zn))if(typeof zn.toString=="function"){if(zn=zn.toString(),typeof zn!="string")throw NX("dirty is not a string, aborting")}else throw NX("toString is not a function");if(!t.isSupported)return zn;if(re||Ir(st),t.removed=[],typeof zn=="string"&&(ue=!1),ue){if(zn.nodeName){const Ue=Fn(zn.nodeName);if(!H[Ue]||ee[Ue])throw NX("root node is forbidden and cannot be sanitized in-place")}}else if(zn instanceof l)Ne=or("\x3C!---->"),Lt=Ne.ownerDocument.importNode(zn,!0),Lt.nodeType===jX.element&&Lt.nodeName==="BODY"||Lt.nodeName==="HTML"?Ne=Lt:Ne.appendChild(Lt);else{if(!ie&&!ne&&!Y&&zn.indexOf("<")===-1)return w&&he?w.createHTML(zn):zn;if(Ne=or(zn),!Ne)return ie?null:he?y:""}Ne&&ce&&Ti(Ne.firstChild);const Bn=Rs(ue?zn:Ne);for(;En=Bn.nextNode();)Ht(En),qt(En),En.content instanceof s&&oo(En.content);if(ue)return zn;if(ie){if(J)for(Cn=L.call(Ne.ownerDocument);Ne.firstChild;)Cn.appendChild(Ne.firstChild);else Cn=Ne;return(Z.shadowroot||Z.shadowrootmode)&&(Cn=E.call(r,Cn,!0)),Cn}let bi=Y?Ne.outerHTML:Ne.innerHTML;return Y&&H["!doctype"]&&Ne.ownerDocument&&Ne.ownerDocument.doctype&&Ne.ownerDocument.doctype.name&&qm(zBn,Ne.ownerDocument.doctype.name)&&(bi=" `+bi),ne&&tce([T,M,B],Ue=>{bi=IX(bi,Ue," ")}),w&&he?w.createHTML(bi):bi},t.setConfig=function(){let zn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ir(zn),re=!0},t.clearConfig=function(){di=null,re=!1},t.isValidAttribute=function(zn,st,Ne){di||Ir({});const Lt=Fn(zn),En=Fn(st);return Tt(Lt,En,Ne)},t.addHook=function(zn,st){typeof st=="function"&&RX(Q[zn],st)},t.removeHook=function(zn,st){if(st!==void 0){const Ne=l4o(Q[zn],st);return Ne===-1?void 0:c4o(Q[zn],Ne,1)[0]}return iyt(Q[zn])},t.removeHooks=function(zn){Q[zn]=[]},t.removeAllHooks=function(){Q=cyt()},t}var zN=ZBn();const YBn=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","s","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]),XBn=Object.freeze(["href","target","src","alt","title","for","name","role","tabindex","x-dispatch","required","checked","placeholder","type","start","width","height","align"]),p9e="vscode-relative-path";function dyt(e,t){if(t.override==="*")return!0;try{const n=new URL(e,p9e+"://");return!!(t.override.includes(n.protocol.replace(/:$/,""))||t.allowRelativePaths&&n.protocol===p9e+":"&&!e.trim().toLowerCase().startsWith(p9e))}catch{return!1}}function L4o(e,t){zN.addHook("afterSanitizeAttributes",n=>{for(const r of["href","src"])if(n.hasAttribute(r)){const o=n.getAttribute(r);r==="href"?!o.startsWith("#")&&!dyt(o,e)&&n.removeAttribute(r):dyt(o,t)||n.removeAttribute(r)}})}const S4o=Object.freeze({ALLOWED_TAGS:[...YBn],ALLOWED_ATTR:[...XBn],ALLOW_UNKNOWN_PROTOCOLS:!0});function T4o(e,t){return qBn(e,t,"trusted")}function qBn(e,t,n){var r,o;try{const s={...S4o};t!=null&&t.allowedTags&&(t.allowedTags.override&&(s.ALLOWED_TAGS=[...t.allowedTags.override]),t.allowedTags.augment&&(s.ALLOWED_TAGS=[...s.ALLOWED_TAGS??[],...t.allowedTags.augment]));let a=[...XBn];t!=null&&t.allowedAttributes&&(t.allowedAttributes.override&&(a=[...t.allowedAttributes.override]),t.allowedAttributes.augment&&(a=[...a,...t.allowedAttributes.augment])),a=a.map(u=>typeof u=="string"?u.toLowerCase():{attributeName:u.attributeName.toLowerCase(),shouldKeep:u.shouldKeep});const l=new Set(a.map(u=>typeof u=="string"?u:u.attributeName)),d=new Map;for(const u of a)typeof u=="string"?d.delete(u):d.set(u.attributeName,u);return s.ALLOWED_ATTR=Array.from(l),L4o({override:((r=t==null?void 0:t.allowedLinkProtocols)==null?void 0:r.override)??[Li.http,Li.https],allowRelativePaths:(t==null?void 0:t.allowRelativeLinkPaths)??!1},{override:((o=t==null?void 0:t.allowedMediaProtocols)==null?void 0:o.override)??[Li.http,Li.https],allowRelativePaths:(t==null?void 0:t.allowRelativeMediaPaths)??!1}),t!=null&&t.replaceWithPlaintext&&zN.addHook("uponSanitizeElement",D4o),d.size&&zN.addHook("uponSanitizeAttribute",(u,h)=>{const f=d.get(h.attrName);if(f){const g=f.shouldKeep(u,h);typeof g=="string"?(h.keepAttr=!0,h.attrValue=g):h.keepAttr=g}else h.keepAttr=l.has(h.attrName)}),n==="dom"?zN.sanitize(e,{...s,RETURN_DOM_FRAGMENT:!0}):zN.sanitize(e,{...s,RETURN_TRUSTED_TYPE:!0})}finally{zN.removeAllHooks()}}const E4o=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D4o=(e,t,n)=>{var r,o;if(!t.allowedTags[t.tagName]&&t.tagName!=="body"){const s=GBn(e);s&&(e.nodeType===Node.COMMENT_NODE?(r=e.parentElement)==null||r.insertBefore(s,e):(o=e.parentElement)==null||o.replaceChild(s,e))}};function GBn(e){if(!e.ownerDocument)return;let t,n;if(e.nodeType===Node.COMMENT_NODE)t=`\x3C!--${e.textContent}-->`;else if(e instanceof Element){const a=e.tagName.toLowerCase(),l=E4o.includes(a),d=e.attributes.length?" "+Array.from(e.attributes).map(u=>`${u.name}="${u.value}"`).join(" "):"";t=`<${a}${d}>`,l||(n=``)}else return;const r=document.createDocumentFragment(),o=e.ownerDocument.createTextNode(t);for(r.appendChild(o);e.firstChild;)r.appendChild(e.firstChild);const s=n?e.ownerDocument.createTextNode(n):void 0;return s&&r.appendChild(s),r}function KBn(e,t,n){const r=qBn(t,n,"dom");Ou(e,r)}const Q4o=new RegExp(`(\\\\)?\\$\\((${mi.iconNameExpression}(?:${mi.iconModifierExpression})?)\\)`,"g");function K5(e){const t=new Array;let n,r=0,o=0;for(;(n=Q4o.exec(e))!==null;){o=n.index||0,r{let r=[],o=[];return e&&({href:e,dimensions:r}=ypo(e),o.push(`src="${$le(e)}"`)),n&&o.push(`alt="${$le(n)}"`),t&&o.push(`title="${$le(t)}"`),r.length&&(o=o.concat(r)),""},paragraph({tokens:e}){return`

${this.parser.parseInline(e)}

`},link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n);return typeof e!="string"?"":(e===r&&(r=h9e(r)),t=typeof t=="string"?$le(h9e(t)):"",e=h9e(e),e=e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`${r}`)}});function B4o(e){return function(t){const{tokens:n}=t,r=n[0];if((r==null?void 0:r.type)!=="paragraph")return e.call(this,t);const o=r.tokens;if(!o||o.length===0)return e.call(this,t);const s=o[0];if((s==null?void 0:s.type)!=="text")return e.call(this,t);const a=/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*?\n*/i,l=s.raw.match(a);if(!l)return e.call(this,t);s.raw=s.raw.replace(a,""),s.text=s.text.replace(a,"");const d={note:"info",tip:"light-bulb",important:"comment",warning:"alert",caution:"stop"},u=l[1],h=u.charAt(0).toUpperCase()+u.slice(1).toLowerCase(),f=u.toLowerCase(),g=TO({id:d[f]}).outerHTML,k=this.parser.parse(n);return`

${g}${h}${k.substring(3)}

`}}function lre(e,t={},n){var A,m,v;const r=new Pt;let o=!1;const s=new jBn(...t.markedExtensions??[]),{renderer:a,codeBlocks:l,syncCodeBlocks:d}=P4o(s,t,e),u=M4o(e);let h;if(t.fillInIncompleteTokens){const p={...s.defaults,...t.markedOptions,renderer:a},b=s.lexer(u,p),O=q4o(b);h=s.parser(O,p)}else h=s.parse(u,{...t==null?void 0:t.markedOptions,renderer:a,async:!1});e.supportThemeIcons&&(h=K5(h).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const f=document.createElement("div"),g=JBn(e,t.sanitizerConfig??{});KBn(f,h,g),F4o(e,t,f);let k;if(n?(k=n,Ou(n,...f.children)):k=f,l.length>0)Promise.all(l).then(p=>{var w;if(o)return;const b=new Map(p),O=k.querySelectorAll("div[data-code]");for(const y of O){const C=b.get(y.dataset.code??"");C&&Ou(y,C)}(w=t.asyncRenderCallback)==null||w.call(t)});else if(d.length>0){const p=new Map(d),b=k.querySelectorAll("div[data-code]");for(const O of b){const w=p.get(O.dataset.code??"");w&&Ou(O,w)}}if(t.asyncRenderCallback)for(const p of k.getElementsByTagName("img")){const b=r.add(pt(p,"load",()=>{b.dispose(),t.asyncRenderCallback()}))}if(t.actionHandler){const p=b=>{const O=new $h(oi(k),b);!O.leftButton&&!O.middleButton||uyt(e,t,O)};r.add(pt(k,"click",p)),r.add(pt(k,"auxclick",p)),r.add(pt(k,"keydown",b=>{const O=new Hs(b);!O.equals(10)&&!O.equals(3)||uyt(e,t,O)}))}for(const p of[...k.getElementsByTagName("input")])if(((A=p.attributes.getNamedItem("type"))==null?void 0:A.value)==="checkbox")p.setAttribute("disabled","");else if((m=t.sanitizerConfig)!=null&&m.replaceWithPlaintext){const b=GBn(p);b?(v=p.parentElement)==null||v.replaceChild(b,p):p.remove()}else p.remove();return{element:k,dispose:()=>{o=!0,r.dispose()}}}function F4o(e,t,n){var r;for(const o of n.querySelectorAll("img, audio, video, source")){const s=o.getAttribute("src");if(s){let a=s;try{e.baseUri&&(a=wWe(pi.from(e.baseUri),a))}catch{}if(o.setAttribute("src",hyt(e,a,!0)),(r=t.sanitizerConfig)!=null&&r.remoteImageIsAllowed){const l=pi.parse(a);l.scheme!==Li.file&&l.scheme!==Li.data&&!t.sanitizerConfig.remoteImageIsAllowed(l)&&o.replaceWith(ln("",void 0,o.outerHTML))}}}for(const o of n.querySelectorAll("a")){const s=o.getAttribute("href");if(o.setAttribute("href",""),!s||/^data:|javascript:/i.test(s)||/^command:/i.test(s)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(s))o.replaceWith(...o.childNodes);else{let a=hyt(e,s,!1);e.baseUri&&(a=wWe(pi.from(e.baseUri),s)),o.dataset.href=a}}}function P4o(e,t,n){const r=new e.Renderer(t.markedOptions);r.image=b9e.image,r.link=b9e.link,r.paragraph=b9e.paragraph,n.supportAlertSyntax&&(r.blockquote=B4o(r.blockquote));const o=[],s=[];return t.codeBlockRendererSync?r.code=({text:a,lang:l,raw:d})=>{const u=fWe.nextId(),h=t.codeBlockRendererSync(Ayt(l),a,d);return s.push([u,h]),`
${_p(a)}
`}:t.codeBlockRenderer&&(r.code=({text:a,lang:l})=>{const d=fWe.nextId(),u=t.codeBlockRenderer(Ayt(l),a);return o.push(u.then(h=>[d,h])),`
${_p(a)}
`}),n.supportHtml||(r.html=({text:a})=>{var d;return(d=t.sanitizerConfig)!=null&&d.replaceWithPlaintext?_p(a):(n.isTrusted?a.match(/^(]+>)|(<\/\s*span>)$/):void 0)?a:""}),{renderer:r,codeBlocks:o,syncCodeBlocks:s}}function M4o(e){let t=e.value;return t.length>1e5&&(t=`${t.substr(0,1e5)}…`),e.supportThemeIcons&&(t=vpo(t)),t}function uyt(e,t,n){var o;const r=n.target.closest("a[data-href]");if(oc(r))try{let s=r.dataset.href;s&&(e.baseUri&&(s=wWe(pi.from(e.baseUri),s)),(o=t.actionHandler)==null||o.call(t,s,e))}catch(s){Yi(s)}finally{n.preventDefault()}}function R4o(e,t){let n;try{n=vWe(decodeURIComponent(t))}catch{}return n?(n=$7n(n,r=>{if(e.uris&&e.uris[r])return pi.revive(e.uris[r])}),encodeURIComponent(JSON.stringify(n))):t}function hyt(e,t,n){const r=e.uris&&e.uris[t];let o=pi.revive(r);return n?t.startsWith(Li.data+":")?t:(o||(o=pi.parse(t)),d7n.uriToBrowserUri(o).toString(!0)):!o||pi.parse(t).toString()===o.toString()?t:(o.query&&(o=o.with({query:R4o(e,o.query)})),o.toString())}function Ayt(e){if(!e)return"";const t=e.split(/[\s+|:|,|\{|\?]/,1);return t.length?t[0]:e}function wWe(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?XOt(e,t).toString():XOt(Jbe(e),t).toString()}function I4o(e,t,n={}){const r=JBn(t,n);return T4o(e,r)}const N4o=Object.freeze([...YBn,"input"]),U4o=Object.freeze(["align","autoplay","alt","colspan","controls","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","target","title","type","width","start","checked","disabled","value","data-code","data-href","data-severity",{attributeName:"style",shouldKeep:(e,t)=>e.tagName==="SPAN"&&t.attrName==="style"?/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(border-radius:[0-9]+px;)?$/.test(t.attrValue):!1},{attributeName:"class",shouldKeep:(e,t)=>e.tagName==="SPAN"&&t.attrName==="class"?/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue):!1}]);function JBn(e,t){var o,s,a;const n=e.isTrusted??!1,r=[Li.http,Li.https,Li.mailto,Li.file,Li.vscodeFileResource,Li.vscodeRemote,Li.vscodeRemoteResource,Li.vscodeNotebookCell];return n&&r.push(Li.command),(o=t.allowedLinkSchemes)!=null&&o.augment&&r.push(...t.allowedLinkSchemes.augment),{allowedTags:{override:((s=t.allowedTags)==null?void 0:s.override)??N4o},allowedAttributes:{override:((a=t.allowedAttributes)==null?void 0:a.override)??U4o},allowedLinkProtocols:{override:r},allowRelativeLinkPaths:!!e.baseUri,allowedMediaProtocols:{override:[Li.http,Li.https,Li.data,Li.file,Li.vscodeFileResource,Li.vscodeRemote,Li.vscodeRemoteResource]},allowRelativeMediaPaths:!!e.baseUri,replaceWithPlaintext:t.replaceWithPlaintext}}function j4o(e,t){if(typeof e=="string")return e;let n=e.value??"";n.length>1e5&&(n=`${n.substr(0,1e5)}…`);const r=n4o(n,{async:!1,renderer:H4o.value});return I4o(r,{isTrusted:!1},{}).toString().replace(/&(#\d+|[a-zA-Z]+);/g,o=>W4o.get(o)??o).trim()}const W4o=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function _Bn(){const e=new Z$;return e.code=({text:t})=>_p(t),e.blockquote=({text:t})=>t+` `,e.html=t=>"",e.heading=function({tokens:t}){return this.parser.parseInline(t)+` `},e.hr=()=>"",e.list=function({items:t}){return t.map(n=>this.listitem(n)).join(` `)+` `},e.listitem=({text:t})=>t+` `,e.paragraph=function({tokens:t}){return this.parser.parseInline(t)+` `},e.table=function({header:t,rows:n}){return t.map(r=>this.tablecell(r)).join(" ")+` `+n.map(r=>r.map(o=>this.tablecell(o)).join(" ")).join(` `)+` `},e.tablerow=({text:t})=>t,e.tablecell=function({tokens:t}){return this.parser.parseInline(t)},e.strong=({text:t})=>t,e.em=({text:t})=>t,e.codespan=({text:t})=>_p(t),e.br=t=>` `,e.del=({text:t})=>t,e.image=t=>"",e.text=({text:t})=>t,e.link=({text:t})=>t,e}const H4o=new Kh(_Bn);new Kh(()=>{const e=_Bn();return e.code=({text:t})=>` \`\`\` ${_p(t)} \`\`\` `,e});function X$(e){let t="";return e.forEach(n=>{t+=n.raw}),t}function $Bn(e){var t,n;if(e.tokens)for(let r=e.tokens.length-1;r>=0;r--){const o=e.tokens[r];if(o.type==="text"){const s=o.raw.split(` `),a=s[s.length-1];if(a.includes("`"))return K4o(e);if(a.includes("**"))return nbo(e);if(a.match(/\*\w/))return J4o(e);if(a.match(/(^|\s)__\w/))return ibo(e);if(a.match(/(^|\s)_\w/))return _4o(e);if(V4o(a)||z4o(a)&&e.tokens.slice(0,r).some(l=>l.type==="text"&&l.raw.match(/\[[^\]]*$/))){const l=e.tokens.slice(r+1);return((t=l[0])==null?void 0:t.type)==="link"&&((n=l[1])==null?void 0:n.type)==="text"&&l[1].raw.match(/^ *"[^"]*$/)||a.match(/^[^"]* +"[^"]*$/)?ebo(e):$4o(e)}else if(a.match(/(^|\s)\[\w*[^\]]*$/))return tbo(e)}}}function V4o(e){return!!e.match(/(^|\s)\[.*\]\(\w*/)}function z4o(e){return!!e.match(/^[^\[]*\]\([^\)]*$/)}function Z4o(e){var u;const t=e.items[e.items.length-1],n=t.tokens?t.tokens[t.tokens.length-1]:void 0,r=h=>{const f=h.items.at(-1),g=f==null?void 0:f.tokens.at(-1);return(g==null?void 0:g.type)==="heading"||(g==null?void 0:g.type)==="list"&&r(g)};let o;if((n==null?void 0:n.type)==="text"&&!("inRawBlock"in t))o=$Bn(n);else if(r(e)){const h=Y$(e.raw.trim()+"  ")[0];return h.type!=="list"?void 0:h}if(!o||o.type!=="paragraph")return;const s=X$(e.items.slice(0,-1)),a=(u=t.raw.match(/^(\s*(-|\d+\.|\*) +)/))==null?void 0:u[0];if(!a)return;const l=a+X$(t.tokens.slice(0,-1))+o.raw,d=Y$(s+l)[0];if(d.type==="list")return d}function Y4o(e,t){if(e.raw.match(/-\s*$/))return Y$(t+"  ")}const X4o=3;function q4o(e){for(let t=0;t"u"&&a.match(/^\s*\|/)){const l=a.match(/(\|[^\|]+)(?=\||$)/g);l&&(r=l.length)}else if(typeof r=="number")if(a.match(/^\s*\|/)){if(s!==n.length-1)return;o=!0}else return}if(typeof r=="number"&&r>0){const s=o?n.slice(0,-1).join(` `):t,a=!!s.match(/\|\s*$/),l=s+(a?"":"|")+` |${" --- |".repeat(r)}`;return Y$(l)}}let eFn={showInstantHover:()=>{},showDelayedHover:()=>{},setupDelayedHover:()=>ct.None,setupDelayedHoverAtMouse:()=>ct.None,hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>({dispose:()=>{},show:()=>{},hide:()=>{},update:()=>{}}),showManagedHover:()=>{}};function obo(e){eFn=e}function E4(){return eFn}class sbo{constructor(t){this.spliceables=t}splice(t,n,r){this.spliceables.forEach(o=>o.splice(t,n,r))}}function ng(e,t,n){return Math.min(Math.max(e,t),n)}class tFn{constructor(){this._n=1,this._val=0}update(t){return this._val=this._val+(t-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class abo{constructor(t){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(t),this._values.fill(0,0,t)}update(t){const n=this._values[this._index];return this._values[this._index]=t,this._index=(this._index+1)%this._values.length,this._sum-=n,this._sum+=t,this._n=a.end||a.start>=s.end)return{start:0,end:0};const l=Math.max(s.start,a.start),d=Math.min(s.end,a.end);return d-l<=0?{start:0,end:0}:{start:l,end:d}}e.intersect=t;function n(s){return s.end-s.start<=0}e.isEmpty=n;function r(s,a){return!n(t(s,a))}e.intersects=r;function o(s,a){const l=[],d={start:s.start,end:Math.min(a.start,s.end)},u={start:Math.max(a.end,s.start),end:s.end};return n(d)||l.push(d),n(u)||l.push(u),l}e.relativeComplement=o})(bA||(bA={}));function fyt(e,t){const n=[];for(const r of t){if(e.start>=r.range.end)continue;if(e.endt.concat(n),[]))}class dbo{get paddingTop(){return this._paddingTop}set paddingTop(t){this._size=this._size+t-this._paddingTop,this._paddingTop=t}constructor(t){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=t??0,this._size=this._paddingTop}splice(t,n,r=[]){const o=r.length-n,s=fyt({start:0,end:t},this.groups),a=fyt({start:t+n,end:Number.POSITIVE_INFINITY},this.groups).map(d=>({range:yWe(d.range,o),size:d.size})),l=r.map((d,u)=>({range:{start:t+u,end:t+u+1},size:d.size}));this.groups=cbo(s,l,a),this._size=this._paddingTop+this.groups.reduce((d,u)=>d+u.size*(u.range.end-u.range.start),0)}get count(){const t=this.groups.length;return t?this.groups[t-1].range.end:0}get size(){return this._size}indexAt(t){if(t<0)return-1;if(t{for(const r of t)this.getRenderer(n).disposeTemplate(r.templateData),r.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(t){const n=this.renderers.get(t);if(!n)throw new Error(`No renderer found for ${t}`);return n}}function hbo(e,t,n,r=[]){if(!e.dataTransfer)return;const o=ln(".monaco-drag-image");o.textContent=n,o.classList.add(...r),(l=>{for(;l&&!l.classList.contains("monaco-workbench");)l=l.parentElement;return l||t.ownerDocument.body})(t).appendChild(o),e.dataTransfer.setDragImage(o,-10,-10),setTimeout(()=>o.remove(),0)}var D6=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};const F7={CurrentDragAndDropData:void 0},x3={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(e){return[e]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class cre{constructor(t){this.elements=t}update(){}getData(){return this.elements}}class Abo{constructor(t){this.elements=t}update(){}getData(){return this.elements}}class fbo{constructor(){this.types=[],this.files=[]}update(t){if(t.types&&this.types.splice(0,this.types.length,...t.types),t.files){this.files.splice(0,this.files.length);for(let n=0;no,t!=null&&t.getPosInSet?this.getPosInSet=t.getPosInSet.bind(t):this.getPosInSet=(n,r)=>r+1,t!=null&&t.getRole?this.getRole=t.getRole.bind(t):this.getRole=n=>"listitem",t!=null&&t.isChecked?this.isChecked=t.isChecked.bind(t):this.isChecked=n=>{}}}const s2e=class s2e{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(t){if(t!==this._horizontalScrolling){if(t&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=t,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const n of this.items)this.measureItemWidth(n);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:y6e(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(t,n,r,o=x3){var a,l;if(this.virtualDelegate=n,this.domId=`list_id_${++s2e.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new A2(50),this.splicing=!1,this.dragOverAnimationStopDisposable=ct.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=ct.None,this.onDragLeaveTimeout=ct.None,this.currentSelectionDisposable=ct.None,this.disposables=new Pt,this._onDidChangeContentHeight=new it,this._onDidChangeContentWidth=new it,this.onDidChangeContentHeight=un.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,o.horizontalScrolling&&o.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(o.paddingTop??0);for(const d of r)this.renderers.set(d.templateId,d);if(this.cache=this.disposables.add(new ubo(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof o.mouseSupport=="boolean"?o.mouseSupport:!0),this._horizontalScrolling=o.horizontalScrolling??x3.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof o.paddingBottom>"u"?0:o.paddingBottom,this.accessibilityProvider=new mbo(o.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(o.transformOptimization??x3.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(NA.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new pZ({forceIntegerValues:!0,smoothScrollDuration:o.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:d=>Cm(oi(this.domNode),d)})),this.scrollableElement=this.disposables.add(new vOe(this.rowsContainer,{alwaysConsumeMouseWheel:o.alwaysConsumeMouseWheel??x3.alwaysConsumeMouseWheel,horizontal:1,vertical:o.verticalScrollMode??x3.verticalScrollMode,useShadows:o.useShadows??x3.useShadows,mouseWheelScrollSensitivity:o.mouseWheelScrollSensitivity,fastScrollSensitivity:o.fastScrollSensitivity,scrollByPage:o.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),t.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(pt(this.rowsContainer,pa.Change,d=>this.onTouchChange(d))),this.disposables.add(pt(this.scrollableElement.getDomNode(),"scroll",d=>{const u=d.target,h=u.scrollTop;u.scrollTop=0,o.scrollToActiveElement&&this.setScrollTop(this.scrollTop+h)})),this.disposables.add(pt(this.domNode,"dragover",d=>this.onDragOver(this.toDragEvent(d)))),this.disposables.add(pt(this.domNode,"drop",d=>this.onDrop(this.toDragEvent(d)))),this.disposables.add(pt(this.domNode,"dragleave",d=>this.onDragLeave(this.toDragEvent(d)))),this.disposables.add(pt(this.domNode,"dragend",d=>this.onDragEnd(d))),o.userSelection){if(o.dnd)throw new Error("DND and user selection cannot be used simultaneously");this.disposables.add(pt(this.domNode,"mousedown",d=>this.onPotentialSelectionStart(d)))}this.setRowLineHeight=o.setRowLineHeight??x3.setRowLineHeight,this.setRowHeight=o.setRowHeight??x3.setRowHeight,this.supportDynamicHeights=o.supportDynamicHeights??x3.supportDynamicHeights,this.dnd=o.dnd??this.disposables.add(x3.dnd),this.layout((a=o.initialSize)==null?void 0:a.height,(l=o.initialSize)==null?void 0:l.width),o.scrollToActiveElement&&this._setupFocusObserver(t)}_setupFocusObserver(t){this.disposables.add(pt(t,"focus",()=>{const n=Zd();this.activeElement!==n&&n!==null&&(this.activeElement=n,this._scrollToActiveElement(this.activeElement,t))},!0))}_scrollToActiveElement(t,n){const r=n.getBoundingClientRect(),s=t.getBoundingClientRect().top-r.top;s<0&&this.setScrollTop(this.scrollTop+s)}updateOptions(t){t.paddingBottom!==void 0&&(this.paddingBottom=t.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),t.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(t.smoothScrolling?125:0),t.horizontalScrolling!==void 0&&(this.horizontalScrolling=t.horizontalScrolling);let n;if(t.scrollByPage!==void 0&&(n={...n??{},scrollByPage:t.scrollByPage}),t.mouseWheelScrollSensitivity!==void 0&&(n={...n??{},mouseWheelScrollSensitivity:t.mouseWheelScrollSensitivity}),t.fastScrollSensitivity!==void 0&&(n={...n??{},fastScrollSensitivity:t.fastScrollSensitivity}),n&&this.scrollableElement.updateOptions(n),t.paddingTop!==void 0&&t.paddingTop!==this.rangeMap.paddingTop){const r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o=t.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=t.paddingTop,this.render(r,Math.max(0,this.lastRenderTop+o),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(t){return new dbo(t)}splice(t,n,r=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(t,n,r)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(t,n,r=[]){const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s={start:t,end:t+n},a=bA.intersect(o,s),l=new Map;for(let y=a.end-1;y>=a.start;y--){const C=this.items[y];if(C.dragStartDisposable.dispose(),C.checkedDisposable.dispose(),C.row){let x=l.get(C.templateId);x||(x=[],l.set(C.templateId,x));const L=this.renderers.get(C.templateId);L&&L.disposeElement&&L.disposeElement(C.element,y,C.row.templateData,{height:C.size}),x.unshift(C.row)}C.row=null,C.stale=!0}const d={start:t+n,end:this.items.length},u=bA.intersect(d,o),h=bA.relativeComplement(d,o),f=r.map(y=>({id:String(this.itemId++),element:y,templateId:this.virtualDelegate.getTemplateId(y),size:this.virtualDelegate.getHeight(y),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(y),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:ct.None,checkedDisposable:ct.None,stale:!1}));let g;t===0&&n>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,f),g=this.items,this.items=f):(this.rangeMap.splice(t,n,f),g=Yge(this.items,t,n,f));const k=r.length-n,A=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=yWe(u,k),v=bA.intersect(A,m);for(let y=v.start;yyWe(y,k)),w=[{start:t,end:t+r.length},...b].map(y=>bA.intersect(A,y)).reverse();for(const y of w)for(let C=y.end-1;C>=y.start;C--){const x=this.items[C],L=l.get(x.templateId),S=L==null?void 0:L.pop();this.insertItemInDOM(C,S)}for(const y of l.values())for(const C of y)this.cache.release(C);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),g.map(y=>y.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Cm(oi(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let t=0;for(const n of this.items)typeof n.width<"u"&&(t=Math.max(t,n.width));this.scrollWidth=t,this.scrollableElement.setScrollDimensions({scrollWidth:t===0?0:t+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const t of this.items)t.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getVisibleRange(this.lastRenderTop,this.lastRenderHeight).start}element(t){return this.items[t].element}indexOf(t){return this.items.findIndex(n=>n.element===t)}domElement(t){const n=this.items[t].row;return n&&n.domNode}elementHeight(t){return this.items[t].size}elementTop(t){return this.rangeMap.positionAt(t)}indexAt(t){return this.rangeMap.indexAt(t)}indexAfter(t){return this.rangeMap.indexAfter(t)}layout(t,n){const r={height:typeof t=="number"?t:lco(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,r.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(r),typeof n<"u"&&(this.renderWidth=n,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof n=="number"?n:y6e(this.domNode)})}render(t,n,r,o,s,a=!1,l=!1){const d=this.getRenderRange(n,r),u=bA.relativeComplement(d,t).reverse(),h=bA.relativeComplement(t,d);if(a){const f=bA.intersect(t,d);for(let g=f.start;g{for(const f of h)for(let g=f.start;g=f.start;g--)this.insertItemInDOM(g)}),o!==void 0&&(this.rowsContainer.style.left=`-${o}px`),this.rowsContainer.style.top=`-${n}px`,this.horizontalScrolling&&s!==void 0&&(this.rowsContainer.style.width=`${Math.max(s,this.renderWidth)}px`),this.lastRenderTop=n,this.lastRenderHeight=r}insertItemInDOM(t,n){var u,h;const r=this.items[t];if(!r.row)if(n)r.row=n,r.stale=!0;else{const f=this.cache.alloc(r.templateId);r.row=f.row,r.stale||(r.stale=f.isReusingConnectedDomNode)}const o=this.accessibilityProvider.getRole(r.element)||"listitem";r.row.domNode.setAttribute("role",o);const s=this.accessibilityProvider.isChecked(r.element),a=f=>f==="mixed"?"mixed":String(!!f);if(typeof s=="boolean"||s==="mixed")r.row.domNode.setAttribute("aria-checked",a(s));else if(s){const f=g=>r.row.domNode.setAttribute("aria-checked",a(g));f(s.value),r.checkedDisposable=s.onDidChange(()=>f(s.value))}if(r.stale||!r.row.domNode.parentElement){const f=((h=(u=this.items.at(t+1))==null?void 0:u.row)==null?void 0:h.domNode)??null;(r.row.domNode.parentElement!==this.rowsContainer||r.row.domNode.nextElementSibling!==f)&&this.rowsContainer.insertBefore(r.row.domNode,f),r.stale=!1}this.updateItemInDOM(r,t);const l=this.renderers.get(r.templateId);if(!l)throw new Error(`No renderer found for template id ${r.templateId}`);l==null||l.renderElement(r.element,t,r.row.templateData,{height:r.size});const d=this.dnd.getDragURI(r.element);r.dragStartDisposable.dispose(),r.row.domNode.draggable=!!d,d&&(r.dragStartDisposable=pt(r.row.domNode,"dragstart",f=>this.onDragStart(r.element,d,f))),this.horizontalScrolling&&(this.measureItemWidth(r),this.eventuallyUpdateScrollWidth())}measureItemWidth(t){if(!t.row||!t.row.domNode)return;t.row.domNode.style.width="fit-content",t.width=y6e(t.row.domNode);const n=oi(t.row.domNode).getComputedStyle(t.row.domNode);n.paddingLeft&&(t.width+=parseFloat(n.paddingLeft)),n.paddingRight&&(t.width+=parseFloat(n.paddingRight)),t.row.domNode.style.width=""}updateItemInDOM(t,n){t.row.domNode.style.top=`${this.elementTop(n)}px`,this.setRowHeight&&(t.row.domNode.style.height=`${t.size}px`),this.setRowLineHeight&&(t.row.domNode.style.lineHeight=`${t.size}px`),t.row.domNode.setAttribute("data-index",`${n}`),t.row.domNode.setAttribute("data-last-element",n===this.length-1?"true":"false"),t.row.domNode.setAttribute("data-parity",n%2===0?"even":"odd"),t.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t.element,n,this.length))),t.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t.element,n))),t.row.domNode.setAttribute("id",this.getElementDomId(n)),t.row.domNode.classList.toggle("drop-target",t.dropTarget)}removeItemFromDOM(t,n){const r=this.items[t];if(r.dragStartDisposable.dispose(),r.checkedDisposable.dispose(),r.row){const o=this.renderers.get(r.templateId);o&&o.disposeElement&&o.disposeElement(r.element,t,r.row.templateData,{height:r.size,onScroll:n}),this.cache.release(r.row),r.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(t,n){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:t,reuseAnimation:n})}get scrollTop(){return this.getScrollTop()}set scrollTop(t){this.setScrollTop(t)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return un.map(this.disposables.add(new ms(this.domNode,"click")).event,t=>this.toMouseEvent(t),this.disposables)}get onMouseDblClick(){return un.map(this.disposables.add(new ms(this.domNode,"dblclick")).event,t=>this.toMouseEvent(t),this.disposables)}get onMouseMiddleClick(){return un.filter(un.map(this.disposables.add(new ms(this.domNode,"auxclick")).event,t=>this.toMouseEvent(t),this.disposables),t=>t.browserEvent.button===1,this.disposables)}get onMouseDown(){return un.map(this.disposables.add(new ms(this.domNode,"mousedown")).event,t=>this.toMouseEvent(t),this.disposables)}get onMouseOver(){return un.map(this.disposables.add(new ms(this.domNode,"mouseover")).event,t=>this.toMouseEvent(t),this.disposables)}get onMouseOut(){return un.map(this.disposables.add(new ms(this.domNode,"mouseout")).event,t=>this.toMouseEvent(t),this.disposables)}get onContextMenu(){return un.any(un.map(this.disposables.add(new ms(this.domNode,"contextmenu")).event,t=>this.toMouseEvent(t),this.disposables),un.map(this.disposables.add(new ms(this.domNode,pa.Contextmenu)).event,t=>this.toGestureEvent(t),this.disposables))}get onTouchStart(){return un.map(this.disposables.add(new ms(this.domNode,"touchstart")).event,t=>this.toTouchEvent(t),this.disposables)}get onTap(){return un.map(this.disposables.add(new ms(this.rowsContainer,pa.Tap)).event,t=>this.toGestureEvent(t),this.disposables)}toMouseEvent(t){const n=this.getItemIndexFromEventTarget(t.target||null),r=typeof n>"u"?void 0:this.items[n],o=r&&r.element;return{browserEvent:t,index:n,element:o}}toTouchEvent(t){const n=this.getItemIndexFromEventTarget(t.target||null),r=typeof n>"u"?void 0:this.items[n],o=r&&r.element;return{browserEvent:t,index:n,element:o}}toGestureEvent(t){const n=this.getItemIndexFromEventTarget(t.initialTarget||null),r=typeof n>"u"?void 0:this.items[n],o=r&&r.element;return{browserEvent:t,index:n,element:o}}toDragEvent(t){const n=this.getItemIndexFromEventTarget(t.target||null),r=typeof n>"u"?void 0:this.items[n],o=r&&r.element,s=this.getTargetSector(t,n);return{browserEvent:t,index:n,element:o,sector:s}}onScroll(t){try{const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(n,t.scrollTop,t.height,t.scrollLeft,t.scrollWidth,void 0,!0),this.supportDynamicHeights&&this._rerender(t.scrollTop,t.height,t.inSmoothScrolling)}catch(n){throw console.error("Got bad scroll event:",t),n}}onTouchChange(t){t.preventDefault(),t.stopPropagation(),this.scrollTop-=t.translationY}onDragStart(t,n,r){var a,l;if(!r.dataTransfer)return;const o=this.dnd.getDragElements(t);r.dataTransfer.effectAllowed="copyMove",r.dataTransfer.setData(EP.TEXT,n);let s;this.dnd.getDragLabel&&(s=this.dnd.getDragLabel(o,r)),typeof s>"u"&&(s=String(o.length)),hbo(r,this.domNode,s,[this.domId]),this.domNode.classList.add("dragging"),this.currentDragData=new cre(o),F7.CurrentDragAndDropData=new Abo(o),(l=(a=this.dnd).onDragStart)==null||l.call(a,this.currentDragData,r)}onPotentialSelectionStart(t){this.currentSelectionDisposable.dispose();const n=$lo(this.domNode),r=this.currentSelectionDisposable=new Pt,o=r.add(new Pt);o.add(pt(this.domNode,"selectstart",()=>{o.add(pt(n,"mousemove",s=>{var a;((a=n.getSelection())==null?void 0:a.isCollapsed)===!1&&this.setupDragAndDropScrollTopAnimation(s)})),r.add(Gn(()=>{const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.currentSelectionBounds=void 0,this.render(s,this.lastRenderTop,this.lastRenderHeight,void 0,void 0)})),r.add(pt(n,"selectionchange",()=>{const s=n.getSelection();if(!s||s.isCollapsed){o.isDisposed&&r.dispose();return}let a=this.getIndexOfListElement(s.anchorNode),l=this.getIndexOfListElement(s.focusNode);a!==void 0&&l!==void 0&&(l{var s;o.dispose(),this.teardownDragAndDropScrollTopAnimation(),((s=n.getSelection())==null?void 0:s.isCollapsed)!==!1&&r.dispose()}))}getIndexOfListElement(t){var n;if(!(!t||!this.domNode.contains(t)))for(;t&&t!==this.domNode;){if((n=t.dataset)!=null&&n.index)return Number(t.dataset.index);t=t.parentElement}}onDragOver(t){var s,a;if(t.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),F7.CurrentDragAndDropData&&F7.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(t.browserEvent),!t.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(F7.CurrentDragAndDropData)this.currentDragData=F7.CurrentDragAndDropData;else{if(!t.browserEvent.dataTransfer.types)return!1;this.currentDragData=new fbo}const n=this.dnd.onDragOver(this.currentDragData,t.element,t.index,t.sector,t.browserEvent);if(this.canDrop=typeof n=="boolean"?n:n.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;t.browserEvent.dataTransfer.dropEffect=typeof n!="boolean"&&((s=n.effect)==null?void 0:s.type)===0?"copy":"move";let r;typeof n!="boolean"&&n.feedback?r=n.feedback:typeof t.index>"u"?r=[-1]:r=[t.index],r=X8(r).filter(l=>l>=-1&&ll-d),r=r[0]===-1?[-1]:r;let o=typeof n!="boolean"&&n.effect&&n.effect.position?n.effect.position:"drop-target";if(gbo(this.currentDragFeedback,r)&&this.currentDragFeedbackPosition===o)return!0;if(this.currentDragFeedback=r,this.currentDragFeedbackPosition=o,this.currentDragFeedbackDisposable.dispose(),r[0]===-1)this.domNode.classList.add(o),this.rowsContainer.classList.add(o),this.currentDragFeedbackDisposable=Gn(()=>{this.domNode.classList.remove(o),this.rowsContainer.classList.remove(o)});else{if(r.length>1&&o!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");o==="drop-target-after"&&r[0]{var l;for(const d of r){const u=this.items[d];u.dropTarget=!1,(l=u.row)==null||l.domNode.classList.remove(o)}})}return!0}onDragLeave(t){var n,r;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=z8(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((r=(n=this.dnd).onDragLeave)==null||r.call(n,this.currentDragData,t.element,t.index,t.browserEvent))}onDrop(t){if(!this.canDrop)return;const n=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,F7.CurrentDragAndDropData=void 0,!(!n||!t.browserEvent.dataTransfer)&&(t.browserEvent.preventDefault(),n.update(t.browserEvent.dataTransfer),this.dnd.drop(n,t.element,t.index,t.sector,t.browserEvent))}onDragEnd(t){var n,r;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,F7.CurrentDragAndDropData=void 0,(r=(n=this.dnd).onDragEnd)==null||r.call(n,t)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=ct.None}setupDragAndDropScrollTopAnimation(t){if(!this.dragOverAnimationDisposable){const n=L7n(this.domNode).top;this.dragOverAnimationDisposable=vco(oi(this.domNode),this.animateDragAndDropScrollTop.bind(this,n))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=z8(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=t.pageY}animateDragAndDropScrollTop(t){if(this.dragOverMouseY===void 0)return;const n=this.dragOverMouseY-t,r=this.renderHeight-35;n<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(n-35))):n>r&&(this.scrollTop+=Math.min(14,Math.floor(.3*(n-r))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(t,n){if(n===void 0)return;const r=t.offsetY/this.items[n].size,o=Math.floor(r/.25);return ng(o,0,3)}getItemIndexFromEventTarget(t){const n=this.scrollableElement.getDomNode();let r=t;for(;(oc(r)||D7n(r))&&r!==this.rowsContainer&&n.contains(r);){const o=r.getAttribute("data-index");if(o){const s=Number(o);if(!isNaN(s))return s}r=r.parentElement}}getVisibleRange(t,n){return{start:this.rangeMap.indexAt(t),end:this.rangeMap.indexAfter(t+n-1)}}getRenderRange(t,n){const r=this.getVisibleRange(t,n);if(this.currentSelectionBounds){const o=this.rangeMap.count;r.start=Math.min(r.start,this.currentSelectionBounds.start,o),r.end=Math.min(Math.max(r.end,this.currentSelectionBounds.end+1),o)}return r}_rerender(t,n,r){const o=this.getRenderRange(t,n);let s,a;t===this.elementTop(o.start)?(s=o.start,a=0):o.end-o.start>1&&(s=o.start+1,a=this.elementTop(s)-t);let l=0;for(;;){const d=this.getRenderRange(t,n);let u=!1;for(let h=d.start;h=g.start;k--)this.insertItemInDOM(k);for(let g=d.start;g=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};class kbo{constructor(t){this.trait=t,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(t){return t}renderElement(t,n,r){const o=this.renderedElements.findIndex(s=>s.templateData===r);if(o>=0){const s=this.renderedElements[o];this.trait.unrender(r),s.index=n}else{const s={index:n,templateData:r};this.renderedElements.push(s)}this.trait.renderIndex(n,r)}splice(t,n,r){const o=[];for(const s of this.renderedElements)s.index=t+n&&o.push({index:s.index+r-n,templateData:s.templateData});this.renderedElements=o}renderIndexes(t){for(const{index:n,templateData:r}of this.renderedElements)t.indexOf(n)>-1&&this.trait.renderIndex(n,r)}disposeTemplate(t){const n=this.renderedElements.findIndex(r=>r.templateData===t);n<0||this.renderedElements.splice(n,1)}}let Zme=class{get onChange(){return this._onChange.event}get name(){return this._trait}get renderer(){return new kbo(this)}constructor(t){this._trait=t,this.indexes=[],this.sortedIndexes=[],this._onChange=new it}splice(t,n,r){const o=r.length-n,s=t+n,a=[];let l=0;for(;l=s;)a.push(this.sortedIndexes[l++]+o);this.renderer.splice(t,n,r.length),this._set(a,a)}renderIndex(t,n){n.classList.toggle(this._trait,this.contains(t))}unrender(t){t.classList.remove(this._trait)}set(t,n){return this._set(t,[...t].sort(myt),n)}_set(t,n,r){const o=this.indexes,s=this.sortedIndexes;this.indexes=t,this.sortedIndexes=n;const a=CWe(s,t);return this.renderer.renderIndexes(a),this._onChange.fire({indexes:t,browserEvent:r}),o}get(){return this.indexes}contains(t){return Zge(this.sortedIndexes,t,myt)>=0}dispose(){hs(this._onChange)}};yE([bc],Zme.prototype,"renderer",null);class vbo extends Zme{constructor(t){super("selected"),this.setAriaSelected=t}renderIndex(t,n){super.renderIndex(t,n),this.setAriaSelected&&(this.contains(t)?n.setAttribute("aria-selected","true"):n.setAttribute("aria-selected","false"))}}class O9e{constructor(t,n,r){this.trait=t,this.view=n,this.identityProvider=r}splice(t,n,r){if(!this.identityProvider)return this.trait.splice(t,n,new Array(r.length).fill(!1));const o=this.trait.get().map(l=>this.identityProvider.getId(this.view.element(l)).toString());if(o.length===0)return this.trait.splice(t,n,new Array(r.length).fill(!1));const s=new Set(o),a=r.map(l=>s.has(this.identityProvider.getId(l).toString()));this.trait.splice(t,n,a)}}function dre(e,t){return e.classList.contains(t)?!0:e.classList.contains("monaco-list")||!e.parentElement?!1:dre(e.parentElement,t)}function iG(e){return dre(e,"monaco-editor")}function pbo(e){return dre(e,"monaco-custom-toggle")}function bbo(e){return dre(e,"action-item")}function YK(e){return dre(e,"monaco-tree-sticky-row")}function q$(e){return e.classList.contains("monaco-tree-sticky-container")}function nFn(e){return e.tagName==="A"&&e.classList.contains("monaco-button")||e.tagName==="DIV"&&e.classList.contains("monaco-button-dropdown")?!0:e.classList.contains("monaco-list")||!e.parentElement?!1:nFn(e.parentElement)}class iFn{get onKeyDown(){return un.chain(this.disposables.add(new ms(this.view.domNode,"keydown")).event,t=>t.filter(n=>!uO(n.target)).map(n=>new Hs(n)))}constructor(t,n,r){this.list=t,this.view=n,this.disposables=new Pt,this.multipleSelectionDisposables=new Pt,this.multipleSelectionSupport=r.multipleSelectionSupport,this.disposables.add(this.onKeyDown(o=>{switch(o.keyCode){case 3:return this.onEnter(o);case 16:return this.onUpArrow(o);case 18:return this.onDownArrow(o);case 11:return this.onPageUpArrow(o);case 12:return this.onPageDownArrow(o);case 9:return this.onEscape(o);case 31:this.multipleSelectionSupport&&(Pr?o.metaKey:o.ctrlKey)&&this.onCtrlA(o)}}))}updateOptions(t){t.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=t.multipleSelectionSupport)}onEnter(t){t.preventDefault(),t.stopPropagation(),this.list.setSelection(this.list.getFocus(),t.browserEvent)}onUpArrow(t){t.preventDefault(),t.stopPropagation(),this.list.focusPrevious(1,!1,t.browserEvent);const n=this.list.getFocus()[0];this.list.setAnchor(n),this.list.reveal(n),this.view.domNode.focus()}onDownArrow(t){t.preventDefault(),t.stopPropagation(),this.list.focusNext(1,!1,t.browserEvent);const n=this.list.getFocus()[0];this.list.setAnchor(n),this.list.reveal(n),this.view.domNode.focus()}onPageUpArrow(t){t.preventDefault(),t.stopPropagation(),this.list.focusPreviousPage(t.browserEvent);const n=this.list.getFocus()[0];this.list.setAnchor(n),this.list.reveal(n),this.view.domNode.focus()}onPageDownArrow(t){t.preventDefault(),t.stopPropagation(),this.list.focusNextPage(t.browserEvent);const n=this.list.getFocus()[0];this.list.setAnchor(n),this.list.reveal(n),this.view.domNode.focus()}onCtrlA(t){t.preventDefault(),t.stopPropagation(),this.list.setSelection(eg(this.list.length),t.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(t){this.list.getSelection().length&&(t.preventDefault(),t.stopPropagation(),this.list.setSelection([],t.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}yE([bc],iFn.prototype,"onKeyDown",null);var Fw;(function(e){e[e.Automatic=0]="Automatic",e[e.Trigger=1]="Trigger"})(Fw||(Fw={}));var MU;(function(e){e[e.Idle=0]="Idle",e[e.Typing=1]="Typing"})(MU||(MU={}));const Obo=new class{mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey||e.altKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=98&&e.keyCode<=107||e.keyCode>=85&&e.keyCode<=95}};class wbo{constructor(t,n,r,o,s){this.list=t,this.view=n,this.keyboardNavigationLabelProvider=r,this.keyboardNavigationEventFilter=o,this.delegate=s,this.enabled=!1,this.state=MU.Idle,this.mode=Fw.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Pt,this.disposables=new Pt,this.updateOptions(t.options)}updateOptions(t){t.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=t.typeNavigationMode??Fw.Automatic}enable(){if(this.enabled)return;let t=!1;const n=un.chain(this.enabledDisposables.add(new ms(this.view.domNode,"keydown")).event,s=>s.filter(a=>!uO(a.target)).filter(()=>this.mode===Fw.Automatic||this.triggered).map(a=>new Hs(a)).filter(a=>t||this.keyboardNavigationEventFilter(a)).filter(a=>this.delegate.mightProducePrintableCharacter(a)).forEach(a=>Bo.stop(a,!0)).map(a=>a.browserEvent.key)),r=un.debounce(n,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);un.reduce(un.any(n,r),(s,a)=>a===null?null:(s||"")+a,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),r(this.onClear,this,this.enabledDisposables),n(()=>t=!0,void 0,this.enabledDisposables),r(()=>t=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var n;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const r=(n=this.list.options.accessibilityProvider)==null?void 0:n.getAriaLabel(this.list.element(t[0]));typeof r=="string"?kg(r):r&&kg(r.get())}this.previouslyFocused=-1}onInput(t){if(!t){this.state=MU.Idle,this.triggered=!1;return}const n=this.list.getFocus(),r=n.length>0?n[0]:0,o=this.state===MU.Idle?1:0;this.state=MU.Typing;for(let s=0;s1&&u.length===1){this.previouslyFocused=r,this.list.setFocus([a]),this.list.reveal(a);return}}}else if(typeof d>"u"||V$(t,d)){this.previouslyFocused=r,this.list.setFocus([a]),this.list.reveal(a);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class ybo{constructor(t,n){this.list=t,this.view=n,this.disposables=new Pt;const r=un.chain(this.disposables.add(new ms(n.domNode,"keydown")).event,s=>s.filter(a=>!uO(a.target)).map(a=>new Hs(a)));un.chain(r,s=>s.filter(a=>a.keyCode===2&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&!a.altKey))(this.onTab,this,this.disposables)}onTab(t){if(t.target!==this.view.domNode)return;const n=this.list.getFocus();if(n.length===0)return;const r=this.view.domElement(n[0]);if(!r)return;const o=r.querySelector("[tabIndex]");if(!o||!oc(o)||o.tabIndex===-1)return;const s=oi(o).getComputedStyle(o);s.visibility==="hidden"||s.display==="none"||(t.preventDefault(),t.stopPropagation(),o.focus())}dispose(){this.disposables.dispose()}}function rFn(e){return Pr?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function oFn(e){return e.browserEvent.shiftKey}function Cbo(e){return Ret(e)&&e.button===2}const gyt={isSelectionSingleChangeEvent:rFn,isSelectionRangeChangeEvent:oFn};class sFn{get onPointer(){return this._onPointer.event}constructor(t){this.list=t,this.disposables=new Pt,this._onPointer=this.disposables.add(new it),t.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||gyt),this.mouseSupport=typeof t.options.mouseSupport>"u"||!!t.options.mouseSupport,this.mouseSupport&&(t.onMouseDown(this.onMouseDown,this,this.disposables),t.onContextMenu(this.onContextMenu,this,this.disposables),t.onMouseDblClick(this.onDoubleClick,this,this.disposables),t.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(NA.addTarget(t.getHTMLElement()))),un.any(t.onMouseClick,t.onMouseMiddleClick,t.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(t){t.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,t.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||gyt))}isSelectionSingleChangeEvent(t){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(t):!1}isSelectionRangeChangeEvent(t){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(t):!1}isSelectionChangeEvent(t){return this.isSelectionSingleChangeEvent(t)||this.isSelectionRangeChangeEvent(t)}onMouseDown(t){iG(t.browserEvent.target)||Zd()!==t.browserEvent.target&&this.list.domFocus()}onContextMenu(t){if(uO(t.browserEvent.target)||iG(t.browserEvent.target))return;const n=typeof t.index>"u"?[]:[t.index];this.list.setFocus(n,t.browserEvent)}onViewPointer(t){if(!this.mouseSupport||uO(t.browserEvent.target)||iG(t.browserEvent.target)||t.browserEvent.isHandledByList)return;t.browserEvent.isHandledByList=!0;const n=t.index;if(typeof n>"u"){this.list.setFocus([],t.browserEvent),this.list.setSelection([],t.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(t))return this.changeSelection(t);this.list.setFocus([n],t.browserEvent),this.list.setAnchor(n),Cbo(t.browserEvent)||this.list.setSelection([n],t.browserEvent),this._onPointer.fire(t)}onDoubleClick(t){if(uO(t.browserEvent.target)||iG(t.browserEvent.target)||this.isSelectionChangeEvent(t)||t.browserEvent.isHandledByList)return;t.browserEvent.isHandledByList=!0;const n=this.list.getFocus();this.list.setSelection(n,t.browserEvent)}changeSelection(t){const n=t.index;let r=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(t)){typeof r>"u"&&(r=this.list.getFocus()[0]??n,this.list.setAnchor(r));const o=Math.min(r,n),s=Math.max(r,n),a=eg(o,s+1),l=this.list.getSelection(),d=Tbo(CWe(l,[r]),r);if(d.length===0)return;const u=CWe(a,Ebo(l,d));this.list.setSelection(u,t.browserEvent),this.list.setFocus([n],t.browserEvent)}else if(this.isSelectionSingleChangeEvent(t)){const o=this.list.getSelection(),s=o.filter(a=>a!==n);this.list.setFocus([n]),this.list.setAnchor(n),o.length===s.length?this.list.setSelection([...s,n],t.browserEvent):this.list.setSelection(s,t.browserEvent)}}dispose(){this.disposables.dispose()}}class xbo{constructor(t,n){this.styleElement=t,this.selectorSuffix=n}style(t){const n=this.selectorSuffix&&`.${this.selectorSuffix}`,r=[];t.listBackground&&r.push(`.monaco-list${n} .monaco-list-rows { background: ${t.listBackground}; }`),t.listFocusBackground&&(r.push(`.monaco-list${n}:focus .monaco-list-row.focused { background-color: ${t.listFocusBackground}; }`),r.push(`.monaco-list${n}:focus .monaco-list-row.focused:hover { background-color: ${t.listFocusBackground}; }`)),t.listFocusForeground&&r.push(`.monaco-list${n}:focus .monaco-list-row.focused { color: ${t.listFocusForeground}; }`),t.listActiveSelectionBackground&&(r.push(`.monaco-list${n}:focus .monaco-list-row.selected { background-color: ${t.listActiveSelectionBackground}; }`),r.push(`.monaco-list${n}:focus .monaco-list-row.selected:hover { background-color: ${t.listActiveSelectionBackground}; }`)),t.listActiveSelectionForeground&&r.push(`.monaco-list${n}:focus .monaco-list-row.selected { color: ${t.listActiveSelectionForeground}; }`),t.listActiveSelectionIconForeground&&r.push(`.monaco-list${n}:focus .monaco-list-row.selected .codicon { color: ${t.listActiveSelectionIconForeground}; }`),t.listFocusAndSelectionBackground&&r.push(` .monaco-drag-image${n}, .monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${t.listFocusAndSelectionBackground}; } `),t.listFocusAndSelectionForeground&&r.push(` .monaco-drag-image${n}, .monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${t.listFocusAndSelectionForeground}; } `),t.listInactiveFocusForeground&&(r.push(`.monaco-list${n} .monaco-list-row.focused { color: ${t.listInactiveFocusForeground}; }`),r.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${t.listInactiveFocusForeground}; }`)),t.listInactiveSelectionIconForeground&&r.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${t.listInactiveSelectionIconForeground}; }`),t.listInactiveFocusBackground&&(r.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${t.listInactiveFocusBackground}; }`),r.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${t.listInactiveFocusBackground}; }`)),t.listInactiveSelectionBackground&&(r.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${t.listInactiveSelectionBackground}; }`),r.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${t.listInactiveSelectionBackground}; }`)),t.listInactiveSelectionForeground&&r.push(`.monaco-list${n} .monaco-list-row.selected { color: ${t.listInactiveSelectionForeground}; }`),t.listHoverBackground&&r.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${t.listHoverBackground}; }`),t.listHoverForeground&&r.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${t.listHoverForeground}; }`);const o=h8(t.listFocusAndSelectionOutline,h8(t.listSelectionOutline,t.listFocusOutline??""));o&&r.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),t.listFocusOutline&&r.push(` .monaco-drag-image${n}, .monaco-list${n}:focus .monaco-list-row.focused, .context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${t.listFocusOutline}; outline-offset: -1px; } `);const s=h8(t.listSelectionOutline,t.listInactiveFocusOutline??"");s&&r.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${s}; outline-offset: -1px; }`),t.listSelectionOutline&&r.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${t.listSelectionOutline}; outline-offset: -1px; }`),t.listInactiveFocusOutline&&r.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${t.listInactiveFocusOutline}; outline-offset: -1px; }`),t.listHoverOutline&&r.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${t.listHoverOutline}; outline-offset: -1px; }`),t.listDropOverBackground&&r.push(` .monaco-list${n}.drop-target, .monaco-list${n} .monaco-list-rows.drop-target, .monaco-list${n} .monaco-list-row.drop-target { background-color: ${t.listDropOverBackground} !important; color: inherit !important; } `),t.listDropBetweenBackground&&(r.push(` .monaco-list${n} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before, .monaco-list${n} .monaco-list-row.drop-target-before::before { content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px; background-color: ${t.listDropBetweenBackground}; }`),r.push(` .monaco-list${n} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after, .monaco-list${n} .monaco-list-row.drop-target-after::after { content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px; background-color: ${t.listDropBetweenBackground}; }`)),t.tableColumnsBorder&&r.push(` .monaco-table > .monaco-split-view2, .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before, .monaco-enable-motion .monaco-table:hover > .monaco-split-view2, .monaco-enable-motion .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before { border-color: ${t.tableColumnsBorder}; } .monaco-enable-motion .monaco-table > .monaco-split-view2, .monaco-enable-motion .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before { border-color: transparent; } `),t.tableOddRowsBackgroundColor&&r.push(` .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr { background-color: ${t.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=r.join(` `)}}const Lbo={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:Ut.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:Ut.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:Ut.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},Sbo={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Tbo(e,t){const n=e.indexOf(t);if(n===-1)return[];const r=[];let o=n-1;for(;o>=0&&e[o]===t-(n-o);)r.push(e[o--]);for(r.reverse(),o=n;o=e.length)n.push(t[o++]);else if(o>=t.length)n.push(e[r++]);else if(e[r]===t[o]){n.push(e[r]),r++,o++;continue}else e[r]=e.length)n.push(t[o++]);else if(o>=t.length)n.push(e[r++]);else if(e[r]===t[o]){r++,o++;continue}else e[r]e-t;class Dbo{constructor(t,n){this._templateId=t,this.renderers=n}get templateId(){return this._templateId}renderTemplate(t){return this.renderers.map(n=>n.renderTemplate(t))}renderElement(t,n,r,o){let s=0;for(const a of this.renderers)a.renderElement(t,n,r[s++],o)}disposeElement(t,n,r,o){var a;let s=0;for(const l of this.renderers)(a=l.disposeElement)==null||a.call(l,t,n,r[s],o),s+=1}disposeTemplate(t){let n=0;for(const r of this.renderers)r.disposeTemplate(t[n++])}}class Qbo{constructor(t){this.accessibilityProvider=t,this.templateId="a18n"}renderTemplate(t){return{container:t,disposables:new Pt}}renderElement(t,n,r){const o=this.accessibilityProvider.getAriaLabel(t),s=o&&typeof o!="string"?o:ha(o);r.disposables.add(xi(l=>{this.setAriaLabel(l.readObservable(s),r.container)}));const a=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);typeof a=="number"?r.container.setAttribute("aria-level",`${a}`):r.container.removeAttribute("aria-level")}setAriaLabel(t,n){t?n.setAttribute("aria-label",t):n.removeAttribute("aria-label")}disposeElement(t,n,r){r.disposables.clear()}disposeTemplate(t){t.disposables.dispose()}}class Bbo{constructor(t,n){this.list=t,this.dnd=n}getDragElements(t){const n=this.list.getSelectedElements();return n.indexOf(t)>-1?n:[t]}getDragURI(t){return this.dnd.getDragURI(t)}getDragLabel(t,n){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(t,n)}onDragStart(t,n){var r,o;(o=(r=this.dnd).onDragStart)==null||o.call(r,t,n)}onDragOver(t,n,r,o,s){return this.dnd.onDragOver(t,n,r,o,s)}onDragLeave(t,n,r,o){var s,a;(a=(s=this.dnd).onDragLeave)==null||a.call(s,t,n,r,o)}onDragEnd(t){var n,r;(r=(n=this.dnd).onDragEnd)==null||r.call(n,t)}drop(t,n,r,o,s){this.dnd.drop(t,n,r,o,s)}dispose(){this.dnd.dispose()}}class Tk{get onDidChangeFocus(){return un.map(this.eventBufferer.wrapEvent(this.focus.onChange),t=>this.toListEvent(t),this.disposables)}get onDidChangeSelection(){return un.map(this.eventBufferer.wrapEvent(this.selection.onChange),t=>this.toListEvent(t),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let t=!1;const n=un.chain(this.disposables.add(new ms(this.view.domNode,"keydown")).event,s=>s.map(a=>new Hs(a)).filter(a=>t=a.keyCode===58||a.shiftKey&&a.keyCode===68).map(a=>Bo.stop(a,!0)).filter(()=>!1)),r=un.chain(this.disposables.add(new ms(this.view.domNode,"keyup")).event,s=>s.forEach(()=>t=!1).map(a=>new Hs(a)).filter(a=>a.keyCode===58||a.shiftKey&&a.keyCode===68).map(a=>Bo.stop(a,!0)).map(({browserEvent:a})=>{const l=this.getFocus(),d=l.length?l[0]:void 0,u=typeof d<"u"?this.view.element(d):void 0,h=typeof d<"u"?this.view.domElement(d):this.view.domNode;return{index:d,element:u,anchor:h,browserEvent:a}})),o=un.chain(this.view.onContextMenu,s=>s.filter(a=>!t).map(({element:a,index:l,browserEvent:d})=>({element:a,index:l,anchor:new $h(oi(this.view.domNode),d),browserEvent:d})));return un.any(n,r,o)}get onKeyDown(){return this.disposables.add(new ms(this.view.domNode,"keydown")).event}get onDidFocus(){return un.signal(this.disposables.add(new ms(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return un.signal(this.disposables.add(new ms(this.view.domNode,"blur",!0)).event)}constructor(t,n,r,o,s=Sbo){var u,h,f;this.user=t,this._options=s,this.focus=new Zme("focused"),this.anchor=new Zme("anchor"),this.eventBufferer=new Vie,this._ariaLabel="",this.disposables=new Pt,this._onDidDispose=new it,this.onDidDispose=this._onDidDispose.event;const a=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(u=this._options.accessibilityProvider)==null?void 0:u.getWidgetRole():"list";this.selection=new vbo(a!=="listbox");const l=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(l.push(new Qbo(this.accessibilityProvider)),(f=(h=this.accessibilityProvider).onDidChangeActiveDescendant)==null||f.call(h,this.onDidChangeActiveDescendant,this,this.disposables)),o=o.map(g=>new Dbo(g.templateId,[...l,g]));const d={...s,dnd:s.dnd&&new Bbo(this,s.dnd)};if(this.view=this.createListView(n,r,o,d),this.view.domNode.setAttribute("role",a),s.styleController)this.styleController=s.styleController(this.view.domId);else{const g=v2(this.view.domNode);this.styleController=new xbo(g,this.view.domId)}if(this.spliceable=new sbo([new O9e(this.focus,this.view,s.identityProvider),new O9e(this.selection,this.view,s.identityProvider),new O9e(this.anchor,this.view,s.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new ybo(this,this.view)),(typeof s.keyboardSupport!="boolean"||s.keyboardSupport)&&(this.keyboardController=new iFn(this,this.view,s),this.disposables.add(this.keyboardController)),s.keyboardNavigationLabelProvider){const g=s.keyboardNavigationDelegate||Obo;this.typeNavigationController=new wbo(this,this.view,s.keyboardNavigationLabelProvider,s.keyboardNavigationEventFilter??(()=>!0),g),this.disposables.add(this.typeNavigationController)}if(this.mouseController=this.createMouseController(s),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider){const g=this.accessibilityProvider.getWidgetAriaLabel(),k=g&&typeof g!="string"?g:ha(g);this.disposables.add(xi(A=>{this.ariaLabel=A.readObservable(k)}))}this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(t,n,r,o){return new m4(t,n,r,o)}createMouseController(t){return new sFn(this)}updateOptions(t={}){var n,r;this._options={...this._options,...t},(n=this.typeNavigationController)==null||n.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(t),(r=this.keyboardController)==null||r.updateOptions(t),this.view.updateOptions(t)}get options(){return this._options}splice(t,n,r=[]){if(t<0||t>this.view.length)throw new B7(this.user,`Invalid start index: ${t}`);if(n<0)throw new B7(this.user,`Invalid delete count: ${n}`);n===0&&r.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(t,n,r))}rerender(){this.view.rerender()}element(t){return this.view.element(t)}indexOf(t){return this.view.indexOf(t)}indexAt(t){return this.view.indexAt(t)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(t){this.view.setScrollTop(t)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(t){this._ariaLabel=t,this.view.domNode.setAttribute("aria-label",t)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(t,n){this.view.layout(t,n)}setSelection(t,n){for(const r of t)if(r<0||r>=this.length)throw new B7(this.user,`Invalid index ${r}`);this.selection.set(t,n)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(t=>this.view.element(t))}setAnchor(t){if(typeof t>"u"){this.anchor.set([]);return}if(t<0||t>=this.length)throw new B7(this.user,`Invalid index ${t}`);this.anchor.set([t])}getAnchor(){return this.anchor.get().at(0)}getAnchorElement(){const t=this.getAnchor();return typeof t>"u"?void 0:this.element(t)}setFocus(t,n){for(const r of t)if(r<0||r>=this.length)throw new B7(this.user,`Invalid index ${r}`);this.focus.set(t,n)}focusNext(t=1,n=!1,r,o){if(this.length===0)return;const s=this.focus.get(),a=this.findNextIndex(s.length>0?s[0]+t:0,n,o);a>-1&&this.setFocus([a],r)}focusPrevious(t=1,n=!1,r,o){if(this.length===0)return;const s=this.focus.get(),a=this.findPreviousIndex(s.length>0?s[0]-t:0,n,o);a>-1&&this.setFocus([a],r)}async focusNextPage(t,n){let r=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);r=r===0?0:r-1;const o=this.getFocus()[0];if(o!==r&&(o===void 0||r>o)){const s=this.findPreviousIndex(r,!1,n);s>-1&&o!==s?this.setFocus([s],t):this.setFocus([r],t)}else{const s=this.view.getScrollTop();let a=s+this.view.renderHeight;r>o&&(a-=this.view.elementHeight(r)),this.view.setScrollTop(a),this.view.getScrollTop()!==s&&(this.setFocus([]),await My(0),await this.focusNextPage(t,n))}}async focusPreviousPage(t,n,r=()=>0){let o;const s=r(),a=this.view.getScrollTop()+s;a===0?o=this.view.indexAt(a):o=this.view.indexAfter(a-1);const l=this.getFocus()[0];if(l!==o&&(l===void 0||l>=o)){const d=this.findNextIndex(o,!1,n);d>-1&&l!==d?this.setFocus([d],t):this.setFocus([o],t)}else{const d=a;this.view.setScrollTop(a-this.view.renderHeight-s),this.view.getScrollTop()+r()!==d&&(this.setFocus([]),await My(0),await this.focusPreviousPage(t,n,r))}}focusLast(t,n){if(this.length===0)return;const r=this.findPreviousIndex(this.length-1,!1,n);r>-1&&this.setFocus([r],t)}focusFirst(t,n){this.focusNth(0,t,n)}focusNth(t,n,r){if(this.length===0)return;const o=this.findNextIndex(t,!1,r);o>-1&&this.setFocus([o],n)}findNextIndex(t,n=!1,r){for(let o=0;o=this.length&&!n)return-1;if(t=t%this.length,!r||r(this.element(t)))return t;t++}return-1}findPreviousIndex(t,n=!1,r){for(let o=0;othis.view.element(t))}reveal(t,n,r=0){if(t<0||t>=this.length)throw new B7(this.user,`Invalid index ${t}`);const o=this.view.getScrollTop(),s=this.view.elementTop(t),a=this.view.elementHeight(t);if(H8(n)){const l=a-this.view.renderHeight+r;this.view.setScrollTop(l*ng(n,0,1)+s-r)}else{const l=s+a,d=o+this.view.renderHeight;s=d||(s=d&&a>=this.view.renderHeight?this.view.setScrollTop(s-r):l>=d&&this.view.setScrollTop(l-this.view.renderHeight))}}getRelativeTop(t,n=0){if(t<0||t>=this.length)throw new B7(this.user,`Invalid index ${t}`);const r=this.view.getScrollTop(),o=this.view.elementTop(t),s=this.view.elementHeight(t);if(or+this.view.renderHeight)return null;const a=s-this.view.renderHeight+n;return Math.abs((r+n-o)/a)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(t){return this.view.getElementDomId(t)}getElementTop(t){return this.view.elementTop(t)}style(t){this.styleController.style(t)}toListEvent({indexes:t,browserEvent:n}){return{indexes:t,elements:t.map(r=>this.view.element(r)),browserEvent:n}}_onFocusChange(){const t=this.focus.get();this.view.domNode.classList.toggle("element-focused",t.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var n;const t=this.focus.get();if(t.length>0){let r;(n=this.accessibilityProvider)!=null&&n.getActiveDescendantId&&(r=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",r||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const t=this.selection.get();this.view.domNode.classList.toggle("selection-none",t.length===0),this.view.domNode.classList.toggle("selection-single",t.length===1),this.view.domNode.classList.toggle("selection-multiple",t.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}yE([bc],Tk.prototype,"onDidChangeFocus",null);yE([bc],Tk.prototype,"onDidChangeSelection",null);yE([bc],Tk.prototype,"onContextMenu",null);yE([bc],Tk.prototype,"onKeyDown",null);yE([bc],Tk.prototype,"onDidFocus",null);yE([bc],Tk.prototype,"onDidBlur",null);const EQ=ln,aFn="selectOption.entry.template";class Fbo{get templateId(){return aFn}renderTemplate(t){const n=Object.create(null);return n.root=t,n.text=tn(t,EQ(".option-text")),n.detail=tn(t,EQ(".option-detail")),n.decoratorRight=tn(t,EQ(".option-decorator-right")),n}renderElement(t,n,r){const o=r,s=t.text,a=t.detail,l=t.decoratorRight,d=t.isDisabled;o.text.textContent=s,o.detail.textContent=a||"",o.decoratorRight.textContent=l||"",d?o.root.classList.add("option-disabled"):o.root.classList.remove("option-disabled")}disposeTemplate(t){}}const ew=class ew extends ct{constructor(t,n,r,o,s){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._selectionDetailsDisposables=this._register(new Pt),this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=o,this.selectBoxOptions=s||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=ew.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new it,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(r),this.selected=n||0,t&&this.setOptions(t,n),this.initStyleSheet()}setTitle(t){!this._hover&&t?this._hover=this._register(E4().setupManagedHover(dC("mouse"),this.selectElement,t)):this._hover&&this._hover.update(t)}getHeight(){return 22}getTemplateId(){return aFn}constructSelectDropDown(t){this.contextViewProvider=t,this.selectDropDownContainer=ln(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=tn(this.selectDropDownContainer,EQ(".select-box-details-pane"));const n=tn(this.selectDropDownContainer,EQ(".select-box-dropdown-container-width-control")),r=tn(n,EQ(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",tn(r,this.widthControlElement),this._dropDownPosition=0,this.styleElement=v2(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(pt(this.selectDropDownContainer,cn.DRAG_START,o=>{Bo.stop(o,!0)}))}registerListeners(){this._register(Sc(this.selectElement,"change",n=>{this.selected=n.target.selectedIndex,this._onDidSelect.fire({index:n.target.selectedIndex,selected:n.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(pt(this.selectElement,cn.CLICK,n=>{Bo.stop(n),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(pt(this.selectElement,cn.MOUSE_DOWN,n=>{Bo.stop(n)}));let t;this._register(pt(this.selectElement,"touchstart",n=>{t=this._isVisible})),this._register(pt(this.selectElement,"touchend",n=>{Bo.stop(n),t?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(pt(this.selectElement,cn.KEY_DOWN,n=>{const r=new Hs(n);let o=!1;Pr?(r.keyCode===18||r.keyCode===16||r.keyCode===10||r.keyCode===3)&&(o=!0):(r.keyCode===18&&r.altKey||r.keyCode===16&&r.altKey||r.keyCode===10||r.keyCode===3)&&(o=!0),o&&(this.showSelectDropDown(),Bo.stop(n,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(t,n){za(this.options,t)||(this.options=t,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((r,o)=>{this.selectElement.add(this.createOption(r.text,o,r.isDisabled)),typeof r.description=="string"&&(this._hasDetails=!0)})),n!==void 0&&(this.select(n),this._currentSelection=this.selected)}setOptionsList(){var t;(t=this.selectList)==null||t.splice(0,this.selectList.length,this.options)}select(t){t>=0&&tthis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(t){this.selectElement.tabIndex=t?0:-1}render(t){this.container=t,t.classList.add("select-container"),t.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const t=[];this.styles.listFocusBackground&&t.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&t.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&t.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(t.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),t.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),t.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(t.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),t.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&t.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&t.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&t.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&t.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),t.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),t.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=t.join(` `)}styleSelectElement(){const t=this.styles.selectBackground??"",n=this.styles.selectForeground??"",r=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=t,this.selectElement.style.color=n,this.selectElement.style.borderColor=r}styleList(){const t=this.styles.selectBackground??"",n=h8(this.styles.selectListBackground,t);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const r=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=r,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(t,n,r){const o=document.createElement("option");return o.value=t,o.text=t,o.disabled=!!r,o}showSelectDropDown(){this.selectionDetailsPane.textContent="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:t=>this.renderSelectDropDown(t,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:t=>this.renderSelectDropDown(t),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(t){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),t&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(t,n){return t.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(n),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let t=0;return this.options.forEach((n,r)=>{this.updateDetail(r),this.selectionDetailsPane.offsetHeight>t&&(t=this.selectionDetailsPane.offsetHeight)}),t}layoutSelectDropDown(t){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const n=oi(this.selectElement),r=ic(this.selectElement),o=oi(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(o.getPropertyValue("--dropdown-padding-top"))+parseFloat(o.getPropertyValue("--dropdown-padding-bottom")),a=n.innerHeight-r.top-r.height-(this.selectBoxOptions.minBottomMargin||0),l=r.top-ew.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,d=this.selectElement.offsetWidth,u=this.setWidthControlElement(this.widthControlElement),h=Math.max(u,Math.round(d)).toString()+"px";this.selectDropDownContainer.style.width=h,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let f=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const g=this._hasDetails?this._cachedMaxDetailsHeight:0,k=f+s+g,A=Math.floor((a-s-g)/this.getHeight()),m=Math.floor((l-s-g)/this.getHeight());if(t)return r.top+r.height>n.innerHeight-22||r.topA&&this.options.length>A?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(r.top+r.height>n.innerHeight-22||r.topa&&(f=A*this.getHeight())}else k>l&&(f=m*this.getHeight());return this.selectList.layout(f),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=f+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=f+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=h,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(t){let n=0;if(t){let r=0,o=0;this.options.forEach((s,a)=>{const l=s.detail?s.detail.length:0,d=s.decoratorRight?s.decoratorRight.length:0,u=s.text.length+l+d;u>o&&(r=a,o=u)}),t.textContent=this.options[r].text+(this.options[r].decoratorRight?this.options[r].decoratorRight+" ":""),n=h1(t)}return n}createSelectList(t){if(this.selectList)return;this.selectDropDownListContainer=tn(t,EQ(".select-box-dropdown-list-container")),this.listRenderer=new Fbo,this.selectList=this._register(new Tk("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:o=>{let s=o.text;return o.detail&&(s+=`. ${o.detail}`),o.decoratorRight&&(s+=`. ${o.decoratorRight}`),o.description&&(s+=`. ${o.description}`),s},getWidgetAriaLabel:()=>j(16,"Select Box"),getRole:()=>Pr?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const n=this._register(new ms(this.selectDropDownListContainer,"keydown")),r=un.chain(n.event,o=>o.filter(()=>this.selectList.length>0).map(s=>new Hs(s)));this._register(un.chain(r,o=>o.filter(s=>s.keyCode===3))(this.onEnter,this)),this._register(un.chain(r,o=>o.filter(s=>s.keyCode===2))(this.onEnter,this)),this._register(un.chain(r,o=>o.filter(s=>s.keyCode===9))(this.onEscape,this)),this._register(un.chain(r,o=>o.filter(s=>s.keyCode===16))(this.onUpArrow,this)),this._register(un.chain(r,o=>o.filter(s=>s.keyCode===18))(this.onDownArrow,this)),this._register(un.chain(r,o=>o.filter(s=>s.keyCode===12))(this.onPageDown,this)),this._register(un.chain(r,o=>o.filter(s=>s.keyCode===11))(this.onPageUp,this)),this._register(un.chain(r,o=>o.filter(s=>s.keyCode===14))(this.onHome,this)),this._register(un.chain(r,o=>o.filter(s=>s.keyCode===13))(this.onEnd,this)),this._register(un.chain(r,o=>o.filter(s=>s.keyCode>=21&&s.keyCode<=56||s.keyCode>=85&&s.keyCode<=113))(this.onCharacter,this)),this._register(pt(this.selectList.getHTMLElement(),cn.POINTER_UP,o=>this.onPointerUp(o))),this._register(this.selectList.onMouseOver(o=>typeof o.index<"u"&&this.selectList.setFocus([o.index]))),this._register(this.selectList.onDidChangeFocus(o=>this.onListFocus(o))),this._register(pt(this.selectDropDownContainer,cn.FOCUS_OUT,o=>{!this._isVisible||bu(o.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(t){if(!this.selectList.length)return;Bo.stop(t);const n=t.target;if(!n||n.classList.contains("slider"))return;const r=n.closest(".monaco-list-row");if(!r)return;const o=Number(r.getAttribute("data-index")),s=r.classList.contains("option-disabled");o>=0&&o{for(let a=0;athis.selected+2)this.selected+=2;else{if(n)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(t){this.selected>0&&(Bo.stop(t,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(t){Bo.stop(t),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(t){Bo.stop(t),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(t){Bo.stop(t),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(t){const n=LL.toString(t.keyCode);let r=-1;for(let o=0;o{this._register(pt(this.selectElement,t,n=>{this.selectElement.focus()}))}),this._register(Sc(this.selectElement,"click",t=>{Bo.stop(t,!0)})),this._register(Sc(this.selectElement,"change",t=>{this.selectElement.title=t.target.value,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value})})),this._register(Sc(this.selectElement,"keydown",t=>{let n=!1;Pr?(t.keyCode===18||t.keyCode===16||t.keyCode===10)&&(n=!0):(t.keyCode===18&&t.altKey||t.keyCode===10||t.keyCode===3)&&(n=!0),n&&t.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(t,n){(!this.options||!za(this.options,t))&&(this.options=t,this.selectElement.options.length=0,this.options.forEach((r,o)=>{this.selectElement.add(this.createOption(r.text,o,r.isDisabled))})),n!==void 0&&this.select(n)}select(t){this.options.length===0?this.selected=0:t>=0&&tthis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(o)}))}handleActionChangeEvent(t){t.enabled!==void 0&&this.updateEnabled(),t.checked!==void 0&&this.updateChecked(),t.class!==void 0&&this.updateClass(),t.label!==void 0&&(this.updateLabel(),this.updateTooltip()),t.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new bP)),this._actionRunner}set actionRunner(t){this._actionRunner=t}isEnabled(){return this._action.enabled}setActionContext(t){this._context=t}render(t){const n=this.element=t;this._register(NA.addTarget(t));const r=this.options&&this.options.draggable;r&&(t.draggable=!0,wm&&this._register(pt(t,cn.DRAG_START,o=>{var s;return(s=o.dataTransfer)==null?void 0:s.setData(EP.TEXT,this._action.label)}))),this._register(pt(n,pa.Tap,o=>this.onClick(o,!0))),this._register(pt(n,cn.MOUSE_DOWN,o=>{r||Bo.stop(o,!0),this._action.enabled&&o.button===0&&n.classList.add("active")})),Pr&&this._register(pt(n,cn.CONTEXT_MENU,o=>{o.button===0&&o.ctrlKey===!0&&this.onClick(o)})),this._register(pt(n,cn.CLICK,o=>{Bo.stop(o,!0),this.options&&this.options.isMenu||this.onClick(o)})),this._register(pt(n,cn.DBLCLICK,o=>{Bo.stop(o,!0)})),[cn.MOUSE_UP,cn.MOUSE_OUT].forEach(o=>{this._register(pt(n,o,s=>{Bo.stop(s),n.classList.remove("active")}))})}onClick(t,n=!1){var o;Bo.stop(t,!0);const r=Pv(this._context)?(o=this.options)!=null&&o.useEventAsContext?t:{preserveFocus:n}:this._context;this.actionRunner.run(this._action,r)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(t){this.element&&(this.element.tabIndex=t?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}getHoverContents(){return this.getTooltip()}updateTooltip(){if(!this.element)return;const t=this.getHoverContents()??"";if(this.updateAriaLabel(),!this.customHover&&t!==""){const n=this.options.hoverDelegate??dC("element");this.customHover=this._store.add(E4().setupManagedHover(n,this.element,t))}else this.customHover&&this.customHover.update(t)}updateAriaLabel(){if(this.element){const t=this.getTooltip()??"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class QV extends Vb{constructor(t,n,r){r={...r,icon:r.icon!==void 0?r.icon:!1,label:r.label!==void 0?r.label:!0},super(t,n,r),this.options=r,this.cssClass=""}render(t){super.render(t),yo(this.element);const n=document.createElement("a");if(n.classList.add("action-label"),n.setAttribute("role",this.getDefaultAriaRole()),this.label=n,this.element.appendChild(n),this.options.label&&this.options.keybinding&&!this.options.keybindingNotRenderedWithLabel){const r=document.createElement("span");r.classList.add("keybinding"),r.textContent=this.options.keybinding,this.element.appendChild(r)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Ld.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(t){this.label&&(this.label.tabIndex=t?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let t=null;return this.action.tooltip?t=this.action.tooltip:this.action.label&&(t=this.action.label,this.options.keybinding&&(t=j(0,"{0} ({1})",t,this.options.keybinding))),t??void 0}updateClass(){var t;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(t=this.label)==null||t.classList.remove("codicon")}updateEnabled(){var t,n;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(t=this.element)==null||t.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(n=this.element)==null||n.classList.add("disabled"))}updateAriaLabel(){if(this.label){const t=this.getTooltip()??"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Rbo extends Vb{constructor(t,n,r,o,s,a,l){super(t,n),this.selectBox=new Mbo(r,o,s,a,l),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(t){this.selectBox.select(t)}registerListeners(){this._register(this.selectBox.onDidSelect(t=>this.runAction(t.selected,t.index)))}runAction(t,n){this.actionRunner.run(this._action,this.getActionContext(t,n))}getActionContext(t,n){return t}setFocusable(t){this.selectBox.setFocusable(t)}focus(){var t;(t=this.selectBox)==null||t.focus()}blur(){var t;(t=this.selectBox)==null||t.blur()}render(t){this.selectBox.render(t)}}class bm extends ct{get onDidBlur(){return this._onDidBlur.event}get onDidCancel(){return this._onDidCancel.event}get onDidRun(){return this._onDidRun.event}get onWillRun(){return this._onWillRun.event}constructor(t,n={}){var s,a;super(),this._actionRunnerDisposables=this._register(new Pt),this.viewItemDisposables=this._register(new Pbe),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new it),this._onDidCancel=this._register(new it({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.cancelHasListener=!1,this._onDidRun=this._register(new it),this._onWillRun=this._register(new it),this.options=n,this._context=n.context??null,this._orientation=this.options.orientation??0,this._triggerKeys={keyDown:((s=this.options.triggerKeys)==null?void 0:s.keyDown)??!1,keys:((a=this.options.triggerKeys)==null?void 0:a.keys)??[3,10]},this._hoverDelegate=n.hoverDelegate??this._register(mBn()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new bP,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(l=>this._onDidRun.fire(l))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(l=>this._onWillRun.fire(l))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let r,o;switch(this._orientation){case 0:r=[15],o=[17];break;case 1:r=[16],o=[18],this.domNode.className+=" vertical";break}this._register(pt(this.domNode,cn.KEY_DOWN,l=>{const d=new Hs(l);let u=!0;const h=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;r&&(d.equals(r[0])||d.equals(r[1]))?u=this.focusPrevious():o&&(d.equals(o[0])||d.equals(o[1]))?u=this.focusNext():d.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():d.equals(14)?u=this.focusFirst():d.equals(13)?u=this.focusLast():d.equals(2)&&h instanceof Vb&&h.trapsArrowNavigation?u=this.focusNext(void 0,!0):this.isTriggerKeyEvent(d)?this._triggerKeys.keyDown?this.doTrigger(d):this.triggerKeyDown=!0:u=!1,u&&(d.preventDefault(),d.stopPropagation())})),this._register(pt(this.domNode,cn.KEY_UP,l=>{const d=new Hs(l);this.isTriggerKeyEvent(d)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(d)),d.preventDefault(),d.stopPropagation()):(d.equals(2)||d.equals(1026)||d.equals(16)||d.equals(18)||d.equals(15)||d.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(f2(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Zd()===this.domNode||!bu(Zd(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),t.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(t){if(this.focusable=t,this.focusable){const n=this.viewItems.find(r=>r instanceof Vb&&r.isEnabled());n instanceof Vb&&n.setFocusable(!0)}else this.viewItems.forEach(n=>{n instanceof Vb&&n.setFocusable(!1)})}isTriggerKeyEvent(t){let n=!1;return this._triggerKeys.keys.forEach(r=>{n=n||t.equals(r)}),n}updateFocusedItem(){var t,n;for(let r=0;rn.setActionContext(t))}get actionRunner(){return this._actionRunner}set actionRunner(t){this._actionRunner=t,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(n=>this._onDidRun.fire(n))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(n=>this._onWillRun.fire(n))),this.viewItems.forEach(n=>n.actionRunner=t)}getContainer(){return this.domNode}getAction(t){var n;if(typeof t=="number")return(n=this.viewItems[t])==null?void 0:n.action;if(oc(t)){for(;t.parentElement!==this.actionsList;){if(!t.parentElement)return;t=t.parentElement}for(let r=0;r{const a=document.createElement("li");a.className="action-item",a.setAttribute("role","presentation");let l;const d={hoverDelegate:this._hoverDelegate,...n,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(l=this.options.actionViewItemProvider(s,d)),l||(l=new QV(this.context,s,d)),this.options.allowContextMenu||this.viewItemDisposables.set(l,pt(a,cn.CONTEXT_MENU,u=>{Bo.stop(u,!0)})),l.actionRunner=this._actionRunner,l.setActionContext(this.context),l.render(a),o===null||o<0||o>=this.actionsList.children.length?(this.actionsList.appendChild(a),this.viewItems.push(l)):(this.actionsList.insertBefore(a,this.actionsList.children[o]),this.viewItems.splice(o,0,l),o++)}),this.focusable){let s=!1;for(const a of this.viewItems){if(!(a instanceof Vb))continue;let l;s||a.action.id===Ld.ID||!a.isEnabled()&&this.options.focusOnlyEnabledItems?l=!1:l=!0,l?(a.setFocusable(!0),s=!0):a.setFocusable(!1)}}typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}getWidth(t){if(t>=0&&t=0&&t"u"){const o=this.viewItems.findIndex(s=>s.isEnabled());this.focusedItem=o===-1?void 0:o,this.updateFocus(void 0,void 0,!0)}else r!==void 0&&(this.focusedItem=r),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(t,n){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const r=this.focusedItem;let o;do{if(!t&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=r,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,o=this.viewItems[this.focusedItem]}while(this.focusedItem!==r&&(this.options.focusOnlyEnabledItems&&!o.isEnabled()||o.action.id===Ld.ID));return this.updateFocus(void 0,void 0,n),!0}focusPrevious(t){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const n=this.focusedItem;let r;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!t&&this.options.preventLoopNavigation)return this.focusedItem=n,!1;this.focusedItem=this.viewItems.length-1}r=this.viewItems[this.focusedItem]}while(this.focusedItem!==n&&(this.options.focusOnlyEnabledItems&&!r.isEnabled()||r.action.id===Ld.ID));return this.updateFocus(!0),!0}updateFocus(t,n,r=!1){var s,a;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:n}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((s=this.viewItems[this.previouslyFocusedItem])==null||s.blur());const o=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(o){let l=!0;gP(o.focus)||(l=!1),this.options.focusOnlyEnabledItems&&gP(o.isEnabled)&&!o.isEnabled()&&(l=!1),o.action.id===Ld.ID&&(l=!1),l?(r||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(t),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:n}),this.previouslyFocusedItem=void 0),l&&((a=o.showHover)==null||a.call(o))}}doTrigger(t){if(typeof this.focusedItem>"u")return;const n=this.viewItems[this.focusedItem];if(n instanceof Vb){const r=n._context===null||n._context===void 0?t:n._context;this.run(n._action,r)}}async run(t,n){await this._actionRunner.run(t,n)}dispose(){this._context=void 0,this.viewItems=hs(this.viewItems),this.getContainer().remove(),super.dispose()}}function Ibo(e,t,n,r){if(e.length===0)return t;if(t.length===0)return e;const o=[];let s=0,a=0;for(;sh?(o.push(d),a++):(o.push(r(l,d)),s++,a++)}for(;s`Apply decorations from ${t.debugName}`},o=>{const s=t.read(o);r.set(s)})),n.add({dispose:()=>{r.clear()}}),n}function RU(e,t){return e.appendChild(t),Gn(()=>{t.remove()})}function Nbo(e,t){return e.prepend(t),Gn(()=>{t.remove()})}class lFn extends ct{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(t,n){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new kDn(t,n)),this._width=Bi(this,this.elementSizeObserver.getWidth()),this._height=Bi(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(r=>ua(o=>{this._width.set(this.elementSizeObserver.getWidth(),o),this._height.set(this.elementSizeObserver.getHeight(),o)})))}observe(t){this.elementSizeObserver.observe(t)}setAutomaticLayout(t){this._automaticLayout=t,t?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function kyt(e,t,n){let r=t.get(),o=r,s=r;const a=Bi("animatedValue",r);let l=-1;const d=300;let u;n.add(aZ({changeTracker:{createChangeSummary:()=>({animate:!1}),handleChange:(f,g)=>(f.didChange(t)&&(g.animate=g.animate||f.change),!0)}},(f,g)=>{u!==void 0&&(e.cancelAnimationFrame(u),u=void 0),o=s,r=t.read(f),l=Date.now()-(g.animate?0:d),h()}));function h(){const f=Date.now()-l;s=Math.floor(Ubo(f,o,r-o,d)),f{this._actualTop.set(r,void 0)},this.onComputedHeight=r=>{this._actualHeight.set(r,void 0)}}}const a2e=class a2e{constructor(t,n){this._editor=t,this._domElement=n,this._overlayWidgetId=`managedOverlayWidget-${a2e._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};a2e._counter=0;let LWe=a2e;function zT(e,t){return xi(n=>{for(let[r,o]of Object.entries(t))o&&typeof o=="object"&&"read"in o&&(o=o.read(n)),typeof o=="number"&&(o=`${o}px`),r=r.replace(/[A-Z]/g,s=>"-"+s.toLowerCase()),e.style[r]=o})}function Xme(e,t,n,r){const o=new Pt,s=[];return o.add(PA((a,l)=>{const d=t.read(a),u=new Map,h=new Map;n&&n(!0),e.changeViewZones(f=>{for(const g of s)f.removeZone(g),r==null||r.delete(g);s.length=0;for(const g of d){const k=f.addZone(g);g.setZoneId&&g.setZoneId(k),s.push(k),r==null||r.add(k),u.set(g,k)}}),n&&n(!1),l.add(aZ({changeTracker:{createChangeSummary(){return{zoneIds:[]}},handleChange(f,g){const k=h.get(f.changedObservable);return k!==void 0&&g.zoneIds.push(k),!0}}},(f,g)=>{for(const k of d)k.onChange&&(h.set(k.onChange,u.get(k)),k.onChange.read(f));n&&n(!0),e.changeViewZones(k=>{for(const A of g.zoneIds)k.layoutZone(A)}),n&&n(!1)}))})),o.add({dispose(){n&&n(!0),e.changeViewZones(a=>{for(const l of s)a.removeZone(l)}),r==null||r.clear(),n&&n(!1)}}),o}class jbo extends Ya{dispose(){super.dispose(!0)}}function vyt(e,t){const n=S$(t,o=>o.original.startLineNumber<=e.lineNumber);if(!n)return De.fromPositions(e);if(n.original.endLineNumberExclusive<=e.lineNumber){const o=e.lineNumber-n.original.endLineNumberExclusive+n.modified.endLineNumberExclusive;return De.fromPositions(new tt(o,e.column))}if(!n.innerChanges)return De.fromPositions(new tt(n.modified.startLineNumber,1));const r=S$(n.innerChanges,o=>o.originalRange.getStartPosition().isBeforeOrEqual(e));if(!r){const o=e.lineNumber-n.original.startLineNumber+n.modified.startLineNumber;return De.fromPositions(new tt(o,e.column))}if(r.originalRange.containsPosition(e))return r.modifiedRange;{const o=Wbo(r.originalRange.getEndPosition(),e);return De.fromPositions(o.addToPosition(r.modifiedRange.getEndPosition()))}}function Wbo(e,t){return e.lineNumber===t.lineNumber?new Yd(0,t.column-e.column):new Yd(t.lineNumber-e.lineNumber,t.column-1)}function Hbo(e,t){let n;return e.filter(r=>{const o=t(r,n);return n=r,o})}class qme{static create(t,n=void 0){return new pyt(t,t,n)}static createWithDisposable(t,n,r=void 0){const o=new Pt;return o.add(n),o.add(t),new pyt(t,o,r)}}class pyt extends qme{constructor(t,n,r){super(),this.object=t,this._disposable=n,this._debugOwner=r,this._refCount=1,this._isDisposed=!1,this._owners=[],r&&this._addOwner(r)}_addOwner(t){t&&this._owners.push(t)}createNewRef(t){return this._refCount++,t&&this._addOwner(t),new Vbo(this,t)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(t){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),t){const n=this._owners.indexOf(t);n!==-1&&this._owners.splice(n,1)}}}class Vbo extends qme{constructor(t,n){super(),this._base=t,this._debugOwner=n,this._isDisposed=!1}get object(){return this._base.object}createNewRef(t){return this._base.createNewRef(t)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}class Lf{static inverse(t,n,r){const o=[];let s=1,a=1;for(const d of t){const u=new Lf(new Qi(s,d.original.startLineNumber),new Qi(a,d.modified.startLineNumber));u.modified.isEmpty||o.push(u),s=d.original.endLineNumberExclusive,a=d.modified.endLineNumberExclusive}const l=new Lf(new Qi(s,n+1),new Qi(a,r+1));return l.modified.isEmpty||o.push(l),o}static clip(t,n,r){const o=[];for(const s of t){const a=s.original.intersect(n),l=s.modified.intersect(r);a&&!a.isEmpty&&l&&!l.isEmpty&&o.push(new Lf(a,l))}return o}constructor(t,n){this.original=t,this.modified=n}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Lf(this.modified,this.original)}join(t){return new Lf(this.original.join(t.original),this.modified.join(t.modified))}toRangeMapping(){const t=this.original.toInclusiveRange(),n=this.modified.toInclusiveRange();if(t&&n)return new cg(t,n);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Ai("not a valid diff");return new cg(new De(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new De(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new cg(new De(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new De(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(t,n){if(byt(this.original.endLineNumberExclusive,t)&&byt(this.modified.endLineNumberExclusive,n))return new cg(new De(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new De(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new cg(De.fromPositions(new tt(this.original.startLineNumber,1),jI(new tt(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)),De.fromPositions(new tt(this.modified.startLineNumber,1),jI(new tt(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new cg(De.fromPositions(jI(new tt(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),jI(new tt(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)),De.fromPositions(jI(new tt(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),n),jI(new tt(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));throw new Ai}}function jI(e,t){if(e.lineNumber<1)return new tt(1,1);if(e.lineNumber>t.length)return new tt(t.length,t[t.length-1].length+1);const n=t[e.lineNumber-1];return e.column>n.length+1?new tt(e.lineNumber,n.length+1):e}function byt(e,t){return e>=1&&e<=t.length}class uk extends Lf{static fromRangeMappings(t){const n=Qi.join(t.map(o=>Qi.fromRangeInclusive(o.originalRange))),r=Qi.join(t.map(o=>Qi.fromRangeInclusive(o.modifiedRange)));return new uk(n,r,t)}constructor(t,n,r){super(t,n),this.innerChanges=r}flip(){var t;return new uk(this.modified,this.original,(t=this.innerChanges)==null?void 0:t.map(n=>n.flip()))}withInnerChangesFromLineRanges(){return new uk(this.original,this.modified,[this.toRangeMapping()])}}class cg{static fromEdit(t){const n=t.getNewRanges();return t.replacements.map((o,s)=>new cg(o.range,n[s]))}static assertSorted(t){for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new cg(this.modifiedRange,this.originalRange)}toTextEdit(t){const n=t.getValueOfRange(this.modifiedRange);return new Zc(this.originalRange,n)}}function Gme(e,t,n,r=!1){const o=[];for(const s of xet(e.map(a=>zbo(a,t,n)),(a,l)=>a.original.intersectsOrTouches(l.original)||a.modified.intersectsOrTouches(l.modified))){const a=s[0],l=s[s.length-1];o.push(new uk(a.original.join(l.original),a.modified.join(l.modified),s.map(d=>d.innerChanges[0])))}return FT(()=>!r&&o.length>0&&(o[0].modified.startLineNumber!==o[0].original.startLineNumber||n.length.lineCount-o[o.length-1].modified.endLineNumberExclusive!==t.length.lineCount-o[o.length-1].original.endLineNumberExclusive)?!1:jie(o,(s,a)=>a.original.startLineNumber-s.original.endLineNumberExclusive===a.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive=n.getLineLength(e.modifiedRange.startLineNumber)&&e.originalRange.startColumn-1>=t.getLineLength(e.originalRange.startLineNumber)&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+o&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+o&&(r=1);const s=new Qi(e.originalRange.startLineNumber+r,e.originalRange.endLineNumber+1+o),a=new Qi(e.modifiedRange.startLineNumber+r,e.modifiedRange.endLineNumber+1+o);return new uk(s,a,[e])}const Zbo={IconContribution:"base.contributions.icons"};var Oyt;(function(e){function t(n,r){let o=n.defaults;for(;mi.isThemeIcon(o);){const s=VM.getIcon(o.id);if(!s)return;o=s.defaults}return o}e.getDefinition=t})(Oyt||(Oyt={}));var wyt;(function(e){function t(r){return{weight:r.weight,style:r.style,src:r.src.map(o=>({format:o.format,location:o.location.toString()}))}}e.toJSONObject=t;function n(r){const o=s=>pu(s)?s:void 0;if(r&&Array.isArray(r.src)&&r.src.every(s=>pu(s.format)&&pu(s.location)))return{weight:o(r.weight),style:o(r.style),src:r.src.map(s=>({format:s.format,location:pi.parse(s.location)}))}}e.fromJSONObject=n})(wyt||(wyt={}));const Ybo=/^([\w_-]+)$/,Xbo=j(2024,"The font ID must only contain letters, numbers, underscores and dashes.");class qbo extends ct{constructor(){super(),this._onDidChange=this._register(new it),this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:j(2025,"The id of the font to use. If not set, the font that is defined first is used."),pattern:Ybo.source,patternErrorMessage:Xbo},fontCharacter:{type:"string",description:j(2026,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${mi.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(t,n,r,o){const s=this.iconsById[t];if(s){if(r&&!s.description){s.description=r,this.iconSchema.properties[t].markdownDescription=`${r} $(${t})`;const d=this.iconReferenceSchema.enum.indexOf(t);d!==-1&&(this.iconReferenceSchema.enumDescriptions[d]=r),this._onDidChange.fire()}return s}const a={id:t,description:r,defaults:n,deprecationMessage:o};this.iconsById[t]=a;const l={$ref:"#/definitions/icons"};return o&&(l.deprecationMessage=o),r&&(l.markdownDescription=`${r}: $(${t})`),this.iconSchema.properties[t]=l,this.iconReferenceSchema.enum.push(t),this.iconReferenceSchema.enumDescriptions.push(r||""),this._onDidChange.fire(),{id:t}}getIcons(){return Object.keys(this.iconsById).map(t=>this.iconsById[t])}getIcon(t){return this.iconsById[t]}getIconSchema(){return this.iconSchema}toString(){const t=(s,a)=>s.id.localeCompare(a.id),n=s=>{for(;mi.isThemeIcon(s.defaults);)s=this.iconsById[s.defaults.id];return`codicon codicon-${s?s.id:""}`},r=[];r.push("| preview | identifier | default codicon ID | description"),r.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const o=Object.keys(this.iconsById).map(s=>this.iconsById[s]);for(const s of o.filter(a=>!!a.description).sort(t))r.push(`||${s.id}|${mi.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);r.push("| preview | identifier "),r.push("| ----------- | --------------------------------- |");for(const s of o.filter(a=>!mi.isThemeIcon(a.defaults)).sort(t))r.push(`||${s.id}|`);return r.join(` `)}}const VM=new qbo;Rl.add(Zbo.IconContribution,VM);function Ra(e,t,n,r){return VM.registerIcon(e,t,n,r)}function cFn(){return VM}function Gbo(){const e=R7n();for(const t in e){const n="\\"+e[t].toString(16);VM.registerIcon(t,{fontCharacter:n})}}Gbo();const dFn="vscode://schemas/icons",uFn=Rl.as(rOe.JSONContribution);uFn.registerSchema(dFn,VM.getIconSchema());const yyt=new Ss(()=>uFn.notifySchemaChanged(dFn),200);VM.onDidChange(()=>{yyt.isScheduled()||yyt.schedule()});const hFn=Ra("widget-close",Jt.close,j(2027,"Icon for the close action in widgets."));Ra("goto-previous-location",Jt.arrowUp,j(2028,"Icon for goto previous editor location."));Ra("goto-next-location",Jt.arrowDown,j(2029,"Icon for goto next editor location."));mi.modify(Jt.sync,"spin");mi.modify(Jt.loading,"spin");var ant=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},lnt=function(e,t){return function(n,r){t(n,r,e)}};const Kbo=Ra("diff-review-insert",Jt.add,j(97,"Icon for 'Insert' in accessible diff viewer.")),Jbo=Ra("diff-review-remove",Jt.remove,j(98,"Icon for 'Remove' in accessible diff viewer.")),_bo=Ra("diff-review-close",Jt.close,j(99,"Icon for 'Close' in accessible diff viewer."));var sH;let DQ=(sH=class extends ct{constructor(t,n,r,o,s,a,l,d,u){super(),this._parentNode=t,this._visible=n,this._setVisible=r,this._canClose=o,this._width=s,this._height=a,this._diffs=l,this._models=d,this._instantiationService=u,this._state=Wt(this,h=>{const f=this._visible.read(h);if(this._parentNode.style.visibility=f?"visible":"hidden",!f)return null;const g=h.store.add(this._instantiationService.createInstance(SWe,this._diffs,this._models,this._setVisible,this._canClose)),k=h.store.add(this._instantiationService.createInstance(TWe,this._parentNode,g,this._width,this._height,this._models));return{model:g,view:k}}).recomputeInitiallyAndOnChange(this._store)}next(){ua(t=>{const n=this._visible.get();this._setVisible(!0,t),n&&this._state.get().model.nextGroup(t)})}prev(){ua(t=>{this._setVisible(!0,t),this._state.get().model.previousGroup(t)})}close(){ua(t=>{this._setVisible(!1,t)})}},sH._ttPolicy=cC("diffReview",{createHTML:t=>t}),sH);DQ=ant([lnt(8,$n)],DQ);let SWe=class extends ct{constructor(t,n,r,o,s){super(),this._diffs=t,this._models=n,this._setVisible=r,this.canClose=o,this._accessibilitySignalService=s,this._groups=Bi(this,[]),this._currentGroupIdx=Bi(this,0),this._currentElementIdx=Bi(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((a,l)=>this._groups.read(l)[a]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((a,l)=>{var d;return(d=this.currentGroup.read(l))==null?void 0:d.lines[a]}),this._register(xi(a=>{const l=this._diffs.read(a);if(!l){this._groups.set([],void 0);return}const d=$bo(l,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());ua(u=>{const h=this._models.getModifiedPosition();if(h){const f=d.findIndex(g=>(h==null?void 0:h.lineNumber){const l=this.currentElement.read(a);(l==null?void 0:l.type)===dg.Deleted?this._accessibilitySignalService.playSignal(lg.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(l==null?void 0:l.type)===dg.Added&&this._accessibilitySignalService.playSignal(lg.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(xi(a=>{const l=this.currentElement.read(a);if(l&&l.type!==dg.Header){const d=l.modifiedLineNumber??l.diff.modified.startLineNumber;this._models.modifiedSetSelection(De.fromPositions(new tt(d,1)))}}))}_goToGroupDelta(t,n){const r=this.groups.get();!r||r.length<=1||fV(n,o=>{this._currentGroupIdx.set(Jn.ofLength(r.length).clipCyclic(this._currentGroupIdx.get()+t),o),this._currentElementIdx.set(0,o)})}nextGroup(t){this._goToGroupDelta(1,t)}previousGroup(t){this._goToGroupDelta(-1,t)}_goToLineDelta(t){const n=this.currentGroup.get();!n||n.lines.length<=1||ua(r=>{this._currentElementIdx.set(Jn.ofLength(n.lines.length).clip(this._currentElementIdx.get()+t),r)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(t){const n=this.currentGroup.get();if(!n)return;const r=n.lines.indexOf(t);r!==-1&&ua(o=>{this._currentElementIdx.set(r,o)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const t=this.currentElement.get();t&&(t.type===dg.Deleted?this._models.originalReveal(De.fromPositions(new tt(t.originalLineNumber,1))):this._models.modifiedReveal(t.type!==dg.Header?De.fromPositions(new tt(t.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};SWe=ant([lnt(4,E6)],SWe);const WX=3;function $bo(e,t,n){const r=[];for(const o of xet(e,(s,a)=>a.modified.startLineNumber-s.modified.endLineNumberExclusive<2*WX)){const s=[];s.push(new tOo);const a=new Qi(Math.max(1,o[0].original.startLineNumber-WX),Math.min(o[o.length-1].original.endLineNumberExclusive+WX,t+1)),l=new Qi(Math.max(1,o[0].modified.startLineNumber-WX),Math.min(o[o.length-1].modified.endLineNumberExclusive+WX,n+1));u7n(o,(h,f)=>{const g=new Qi(h?h.original.endLineNumberExclusive:a.startLineNumber,f?f.original.startLineNumber:a.endLineNumberExclusive),k=new Qi(h?h.modified.endLineNumberExclusive:l.startLineNumber,f?f.modified.startLineNumber:l.endLineNumberExclusive);g.forEach(A=>{s.push(new rOo(A,k.startLineNumber+(A-g.startLineNumber)))}),f&&(f.original.forEach(A=>{s.push(new nOo(f,A))}),f.modified.forEach(A=>{s.push(new iOo(f,A))}))});const d=o[0].modified.join(o[o.length-1].modified),u=o[0].original.join(o[o.length-1].original);r.push(new eOo(new Lf(d,u),s))}return r}var dg;(function(e){e[e.Header=0]="Header",e[e.Unchanged=1]="Unchanged",e[e.Deleted=2]="Deleted",e[e.Added=3]="Added"})(dg||(dg={}));class eOo{constructor(t,n){this.range=t,this.lines=n}}class tOo{constructor(){this.type=dg.Header}}class nOo{constructor(t,n){this.diff=t,this.originalLineNumber=n,this.type=dg.Deleted,this.modifiedLineNumber=void 0}}class iOo{constructor(t,n){this.diff=t,this.modifiedLineNumber=n,this.type=dg.Added,this.originalLineNumber=void 0}}class rOo{constructor(t,n){this.originalLineNumber=t,this.modifiedLineNumber=n,this.type=dg.Unchanged}}let TWe=class extends ct{constructor(t,n,r,o,s,a){super(),this._element=t,this._model=n,this._width=r,this._height=o,this._models=s,this._languageService=a,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const l=document.createElement("div");l.className="diff-review-actions",this._actionBar=this._register(new bm(l)),this._register(xi(d=>{this._actionBar.clear(),this._model.canClose.read(d)&&this._actionBar.push(CB({id:"diffreview.close",label:j(100,"Close"),class:"close-diff-review "+mi.asClassName(_bo),enabled:!0,run:async()=>n.close()}),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new tre(this._content,{})),Ou(this.domNode,this._scrollbar.getDomNode(),l),this._register(xi(d=>{this._height.read(d),this._width.read(d),this._scrollbar.scanDomNode()})),this._register(Gn(()=>{Ou(this.domNode)})),this._register(zT(this.domNode,{width:this._width,height:this._height})),this._register(zT(this._content,{width:this._width,height:this._height})),this._register(PA((d,u)=>{this._model.currentGroup.read(d),this._render(u)})),this._register(Sc(this.domNode,"keydown",d=>{(d.equals(18)||d.equals(2066)||d.equals(530))&&(d.preventDefault(),this._model.goToNextLine()),(d.equals(16)||d.equals(2064)||d.equals(528))&&(d.preventDefault(),this._model.goToPreviousLine()),(d.equals(9)||d.equals(2057)||d.equals(521)||d.equals(1033))&&(d.preventDefault(),this._model.close()),(d.equals(10)||d.equals(3))&&(d.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(t){const n=this._models.getOriginalOptions(),r=this._models.getModifiedOptions(),o=document.createElement("div");o.className="diff-review-table",o.setAttribute("role","list"),o.setAttribute("aria-label",j(101,"Accessible Diff Viewer. Use arrow up and down to navigate.")),zu(o,r.get(59)),Ou(this._content,o);const s=this._models.getOriginalModel(),a=this._models.getModifiedModel();if(!s||!a)return;const l=s.getOptions(),d=a.getOptions(),u=r.get(75),h=this._model.currentGroup.get();for(const f of(h==null?void 0:h.lines)||[]){if(!h)break;let g;if(f.type===dg.Header){const A=document.createElement("div");A.className="diff-review-row",A.setAttribute("role","listitem");const m=h.range,v=this._model.currentGroupIndex.get(),p=this._model.groups.get().length,b=C=>C===0?j(102,"no lines changed"):C===1?j(103,"1 line changed"):j(104,"{0} lines changed",C),O=b(m.original.length),w=b(m.modified.length);A.setAttribute("aria-label",j(105,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,p,m.original.startLineNumber,O,m.modified.startLineNumber,w));const y=document.createElement("div");y.className="diff-review-cell diff-review-summary",y.appendChild(document.createTextNode(`${v+1}/${p}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),A.appendChild(y),g=A}else g=this._createRow(f,u,this._width.get(),n,s,l,r,a,d);o.appendChild(g);const k=Wt(A=>this._model.currentElement.read(A)===f);t.add(xi(A=>{const m=k.read(A);g.tabIndex=m?0:-1,m&&g.focus()})),t.add(pt(g,"focus",()=>{this._model.goToLine(f)}))}this._scrollbar.scanDomNode()}_createRow(t,n,r,o,s,a,l,d,u){const h=o.get(165),f=h.glyphMarginWidth+h.lineNumbersWidth,g=l.get(165),k=10+g.glyphMarginWidth+g.lineNumbersWidth;let A="diff-review-row",m="";const v="diff-review-spacer";let p=null;switch(t.type){case dg.Added:A="diff-review-row line-insert",m=" char-insert",p=Kbo;break;case dg.Deleted:A="diff-review-row line-delete",m=" char-delete",p=Jbo;break}const b=document.createElement("div");b.style.minWidth=r+"px",b.className=A,b.setAttribute("role","listitem"),b.ariaLevel="";const O=document.createElement("div");O.className="diff-review-cell",O.style.height=`${n}px`,b.appendChild(O);const w=document.createElement("span");w.style.width=f+"px",w.style.minWidth=f+"px",w.className="diff-review-line-number"+m,t.originalLineNumber!==void 0?w.appendChild(document.createTextNode(String(t.originalLineNumber))):w.innerText=" ",O.appendChild(w);const y=document.createElement("span");y.style.width=k+"px",y.style.minWidth=k+"px",y.style.paddingRight="10px",y.className="diff-review-line-number"+m,t.modifiedLineNumber!==void 0?y.appendChild(document.createTextNode(String(t.modifiedLineNumber))):y.innerText=" ",O.appendChild(y);const C=document.createElement("span");if(C.className=v,p){const S=document.createElement("span");S.className=mi.asClassName(p),S.innerText="  ",C.appendChild(S)}else C.innerText="  ";O.appendChild(C);let x;if(t.modifiedLineNumber!==void 0){let S=this._getLineHtml(d,l,u.tabSize,t.modifiedLineNumber,this._languageService.languageIdCodec);DQ._ttPolicy&&(S=DQ._ttPolicy.createHTML(S)),O.insertAdjacentHTML("beforeend",S),x=d.getLineContent(t.modifiedLineNumber)}else{let S=this._getLineHtml(s,o,a.tabSize,t.originalLineNumber,this._languageService.languageIdCodec);DQ._ttPolicy&&(S=DQ._ttPolicy.createHTML(S)),O.insertAdjacentHTML("beforeend",S),x=s.getLineContent(t.originalLineNumber)}x.length===0&&(x=j(106,"blank"));let L="";switch(t.type){case dg.Unchanged:t.originalLineNumber===t.modifiedLineNumber?L=j(107,"{0} unchanged line {1}",x,t.originalLineNumber):L=j(108,"{0} original line {1} modified line {2}",x,t.originalLineNumber,t.modifiedLineNumber);break;case dg.Added:L=j(109,"+ {0} modified line {1}",x,t.modifiedLineNumber);break;case dg.Deleted:L=j(110,"- {0} original line {1}",x,t.originalLineNumber);break}return b.setAttribute("aria-label",L),b}_getLineHtml(t,n,r,o,s){const a=t.getLineContent(o),l=n.get(59),d=n.get(117).verticalScrollbarSize,u=kc.createEmpty(a,s),h=pk.isBasicASCII(a,t.mightContainNonBasicASCII()),f=pk.containsRTL(a,h,t.mightContainRTL());return kOe(new T6(l.isMonospace&&!n.get(40),l.canUseHalfwidthRightwardsArrow,a,!1,h,f,0,u,[],r,0,l.spaceWidth,l.middotWidth,l.wsmiddotWidth,n.get(133),n.get(113),n.get(108),n.get(60)!==G8.OFF,null,null,d)).html}};TWe=ant([lnt(5,lc)],TWe);class oOo{constructor(t){this.editors=t}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(t){this.editors.original.revealRange(t),this.editors.original.setSelection(t),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(t){t&&(this.editors.modified.revealRange(t),this.editors.modified.setSelection(t)),this.editors.modified.focus()}modifiedSetSelection(t){this.editors.modified.setSelection(t)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}He("diffEditor.move.border","#8b8b8b9c",j(137,"The border color for text that got moved in the diff editor."));He("diffEditor.moveActive.border","#FFA500",j(138,"The active border color for text that got moved in the diff editor."));He("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},j(139,"The color of the shadow around unchanged region widgets."));const sOo=Ra("diff-insert",Jt.add,j(140,"Line decoration for inserts in the diff editor.")),AFn=Ra("diff-remove",Jt.remove,j(141,"Line decoration for removals in the diff editor.")),Cyt=Ki.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+mi.asClassName(sOo),marginClassName:"gutter-insert"}),xyt=Ki.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+mi.asClassName(AFn),marginClassName:"gutter-delete"}),Lyt=Ki.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),Syt=Ki.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),Tyt=Ki.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),aOo=Ki.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),lOo=Ki.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),EWe=Ki.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),cOo=Ki.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),dOo=Ki.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),Bm=Lr("editorWorkerService");var fFn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},DWe=function(e,t){return function(n,r){t(n,r,e)}},cD;const gFn=Lr("diffProviderFactoryService");let QWe=class{constructor(t){this.instantiationService=t}createDiffProvider(t){return this.instantiationService.createInstance(BWe,t)}};QWe=fFn([DWe(0,$n)],QWe);qr(gFn,QWe,1);var XB;let BWe=(XB=class{constructor(t,n,r){this.editorWorkerService=n,this.telemetryService=r,this.onDidChangeEventEmitter=new it,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(t)}dispose(){var t;(t=this.diffAlgorithmOnDidChangeSubscription)==null||t.dispose()}async computeDiff(t,n,r,o){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(t,n,r,o);if(t.isDisposed()||n.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(t.getLineCount()===1&&t.getLineMaxColumn(1)===1)return n.getLineCount()===1&&n.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new uk(new Qi(1,2),new Qi(1,n.getLineCount()+1),[new cg(t.getFullModelRange(),n.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const s=JSON.stringify([t.uri.toString(),n.uri.toString()]),a=JSON.stringify([t.id,n.id,t.getAlternativeVersionId(),n.getAlternativeVersionId(),JSON.stringify(r)]),l=cD.diffCache.get(s);if(l&&l.context===a)return l.result;const d=wu.create(),u=await this.editorWorkerService.computeDiff(t.uri,n.uri,r,this.diffAlgorithm),h=d.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(u==null?void 0:u.quitEarly)??!0,detectedMoves:r.computeMoves?(u==null?void 0:u.moves.length)??0:-1}),o.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!u)throw new Error("no diff result available");return cD.diffCache.size>10&&cD.diffCache.delete(cD.diffCache.keys().next().value),cD.diffCache.set(s,{result:u,context:a}),u}setOptions(t){var r;let n=!1;t.diffAlgorithm&&this.diffAlgorithm!==t.diffAlgorithm&&((r=this.diffAlgorithmOnDidChangeSubscription)==null||r.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=t.diffAlgorithm,typeof t.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=t.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),n=!0),n&&this.onDidChangeEventEmitter.fire()}},cD=XB,XB.diffCache=new Map,XB);BWe=cD=fFn([DWe(1,Bm),DWe(2,zA)],BWe);class f8{static trivial(t,n){return new f8([new hu(Jn.ofLength(t.length),Jn.ofLength(n.length))],!1)}static trivialTimedOut(t,n){return new f8([new hu(Jn.ofLength(t.length),Jn.ofLength(n.length))],!0)}constructor(t,n){this.diffs=t,this.hitTimeout=n}}class hu{static invert(t,n){const r=[];return u7n(t,(o,s)=>{r.push(hu.fromOffsetPairs(o?o.getEndExclusives():zL.zero,s?s.getStarts():new zL(n,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+n)))}),r}static fromOffsetPairs(t,n){return new hu(new Jn(t.offset1,n.offset1),new Jn(t.offset2,n.offset2))}static assertSorted(t){let n;for(const r of t){if(n&&!(n.seq1Range.endExclusive<=r.seq1Range.start&&n.seq2Range.endExclusive<=r.seq2Range.start))throw new Ai("Sequence diffs must be sorted");n=r}}constructor(t,n){this.seq1Range=t,this.seq2Range=n}swap(){return new hu(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(t){return new hu(this.seq1Range.join(t.seq1Range),this.seq2Range.join(t.seq2Range))}delta(t){return t===0?this:new hu(this.seq1Range.delta(t),this.seq2Range.delta(t))}deltaStart(t){return t===0?this:new hu(this.seq1Range.deltaStart(t),this.seq2Range.deltaStart(t))}deltaEnd(t){return t===0?this:new hu(this.seq1Range.deltaEnd(t),this.seq2Range.deltaEnd(t))}intersect(t){const n=this.seq1Range.intersect(t.seq1Range),r=this.seq2Range.intersect(t.seq2Range);if(!(!n||!r))return new hu(n,r)}getStarts(){return new zL(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new zL(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const oQ=class oQ{constructor(t,n){this.offset1=t,this.offset2=n}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(t){return t===0?this:new oQ(this.offset1+t,this.offset2+t)}equals(t){return this.offset1===t.offset1&&this.offset2===t.offset2}};oQ.zero=new oQ(0,0),oQ.max=new oQ(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let zL=oQ;const l2e=class l2e{isValid(){return!0}};l2e.instance=new l2e;let G$=l2e;class uOo{constructor(t){if(this.timeout=t,this.startTime=Date.now(),this.valid=!0,t<=0)throw new Ai("timeout must be positive")}isValid(){return!(Date.now()-this.startTimeo!=null),new Promise((o,s)=>{let a=!0,l=!1;const d=e.map(h=>({isFinished:t(h),error:n?n(h):!1,state:h})),u=xi(h=>{const{isFinished:f,error:g,state:k}=d.read(h);(f||g)&&(a?l=!0:u.dispose(),g?s(g===!0?k:g):o(k))});if(r){const h=r.onCancellationRequested(()=>{u.dispose(),h.dispose(),s(new u2)});if(r.isCancellationRequested){u.dispose(),h.dispose(),s(new u2);return}}a=!1,l&&u.dispose()})}function y1(e,t,n=_d.ofCaller()){return new hOo(typeof e=="string"?e:new sA(e,void 0,void 0),t,n)}class hOo extends sZ{constructor(t,n,r){super(r),this.event=n,this.handleEvent=()=>{ua(o=>{for(const s of this._observers)o.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof t=="string"?t:t.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}var AOo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},fOo=function(e,t){return function(n,r){t(n,r,e)}};let PWe=class extends ct{setActiveMovedText(t){this._activeMovedText.set(t,void 0)}constructor(t,n,r){super(),this.model=t,this._options=n,this._diffProviderFactoryService=r,this._isDiffUpToDate=Bi(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Bi(this,void 0),this.diff=this._diff,this._unchangedRegions=Bi(this,void 0),this.unchangedRegions=Wt(this,l=>{var d;return this._options.hideUnchangedRegions.read(l)?((d=this._unchangedRegions.read(l))==null?void 0:d.regions)??[]:(ua(u=>{var h;for(const f of((h=this._unchangedRegions.read(void 0))==null?void 0:h.regions)||[])f.collapseAll(u)}),[])}),this.movedTextToCompare=Bi(this,void 0),this._activeMovedText=Bi(this,void 0),this._hoveredMovedText=Bi(this,void 0),this.activeMovedText=Wt(this,l=>this.movedTextToCompare.read(l)??this._hoveredMovedText.read(l)??this._activeMovedText.read(l)),this._cancellationTokenSource=new Ya,this._diffProvider=Wt(this,l=>{const d=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(l)}),u=y1("onDidChange",d.onDidChange);return{diffProvider:d,onChangeSignal:u}}),this._register(Gn(()=>this._cancellationTokenSource.cancel()));const o=Uv("contentChangedSignal"),s=this._register(new Ss(()=>o.trigger(void 0),200));this._register(xi(l=>{const d=this._unchangedRegions.read(l);if(!d||d.regions.some(A=>A.isDragged.read(l)))return;const u=d.originalDecorationIds.map(A=>t.original.getDecorationRange(A)).map(A=>A?Qi.fromRangeInclusive(A):void 0),h=d.modifiedDecorationIds.map(A=>t.modified.getDecorationRange(A)).map(A=>A?Qi.fromRangeInclusive(A):void 0),f=d.regions.map((A,m)=>!u[m]||!h[m]?void 0:new D5(u[m].startLineNumber,h[m].startLineNumber,u[m].length,A.visibleLineCountTop.read(l),A.visibleLineCountBottom.read(l))).filter(Uu),g=[];let k=!1;for(const A of xet(f,(m,v)=>m.getHiddenModifiedRange(l).endLineNumberExclusive===v.getHiddenModifiedRange(l).startLineNumber))if(A.length>1){k=!0;const m=A.reduce((p,b)=>p+b.lineCount,0),v=new D5(A[0].originalLineNumber,A[0].modifiedLineNumber,m,A[0].visibleLineCountTop.read(void 0),A[A.length-1].visibleLineCountBottom.read(void 0));g.push(v)}else g.push(A[0]);if(k){const A=t.original.deltaDecorations(d.originalDecorationIds,g.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=t.modified.deltaDecorations(d.modifiedDecorationIds,g.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));ua(v=>{this._unchangedRegions.set({regions:g,originalDecorationIds:A,modifiedDecorationIds:m},v)})}}));const a=(l,d,u)=>{const h=D5.fromDiffs(l.changes,t.original.getLineCount(),t.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(u),this._options.hideUnchangedRegionsContextLineCount.read(u));let f;const g=this._unchangedRegions.get();if(g){const v=g.originalDecorationIds.map(w=>t.original.getDecorationRange(w)).map(w=>w?Qi.fromRangeInclusive(w):void 0),p=g.modifiedDecorationIds.map(w=>t.modified.getDecorationRange(w)).map(w=>w?Qi.fromRangeInclusive(w):void 0);let O=Hbo(g.regions.map((w,y)=>{if(!v[y]||!p[y])return;const C=v[y].length;return new D5(v[y].startLineNumber,p[y].startLineNumber,C,Math.min(w.visibleLineCountTop.get(),C),Math.min(w.visibleLineCountBottom.get(),C-w.visibleLineCountTop.get()))}).filter(Uu),(w,y)=>!y||w.modifiedLineNumber>=y.modifiedLineNumber+y.lineCount&&w.originalLineNumber>=y.originalLineNumber+y.lineCount).map(w=>new Lf(w.getHiddenOriginalRange(u),w.getHiddenModifiedRange(u)));O=Lf.clip(O,Qi.ofLength(1,t.original.getLineCount()),Qi.ofLength(1,t.modified.getLineCount())),f=Lf.inverse(O,t.original.getLineCount(),t.modified.getLineCount())}const k=[];if(f)for(const v of h){const p=f.filter(b=>b.original.intersectsStrict(v.originalUnchangedRange)&&b.modified.intersectsStrict(v.modifiedUnchangedRange));k.push(...v.setVisibleRanges(p,d))}else k.push(...h);const A=t.original.deltaDecorations((g==null?void 0:g.originalDecorationIds)||[],k.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=t.modified.deltaDecorations((g==null?void 0:g.modifiedDecorationIds)||[],k.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:k,originalDecorationIds:A,modifiedDecorationIds:m},d)};this._register(t.modified.onDidChangeContent(l=>{if(this._diff.get()){const u=VL.fromModelContentChanges(l.changes);this._lastDiff,t.original,t.modified}this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(t.original.onDidChangeContent(l=>{if(this._diff.get()){const u=VL.fromModelContentChanges(l.changes);this._lastDiff,t.original,t.modified}this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(PA(async(l,d)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l),s.cancel(),o.read(l);const u=this._diffProvider.read(l);u.onChangeSignal.read(l),this._isDiffUpToDate.set(!1,void 0);let h=[];d.add(t.original.onDidChangeContent(k=>{const A=VL.fromModelContentChanges(k.changes);h=Ime(h,A)}));let f=[];d.add(t.modified.onDidChangeContent(k=>{const A=VL.fromModelContentChanges(k.changes);f=Ime(f,A)}));let g=await u.diffProvider.computeDiff(t.original,t.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(l),maxComputationTimeMs:this._options.maxComputationTimeMs.read(l),computeMoves:this._options.showMoves.read(l)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||t.original.isDisposed()||t.modified.isDisposed()||(g=gOo(g,t.original,t.modified),g=(t.original,t.modified,void 0)??g,g=(t.original,t.modified,void 0)??g,ua(k=>{a(g,k),this._lastDiff=g;const A=cnt.fromDiffResult(g);this._diff.set(A,k),this._isDiffUpToDate.set(!0,k);const m=this.movedTextToCompare.read(void 0);this.movedTextToCompare.set(m?this._lastDiff.moves.find(v=>v.lineRangeMapping.modified.intersect(m.lineRangeMapping.modified)):void 0,k)}))}))}ensureModifiedLineIsVisible(t,n,r){var s,a;if(((s=this.diff.get())==null?void 0:s.mappings.length)===0)return;const o=((a=this._unchangedRegions.get())==null?void 0:a.regions)||[];for(const l of o)if(l.getHiddenModifiedRange(void 0).contains(t)){l.showModifiedLine(t,n,r);return}}ensureOriginalLineIsVisible(t,n,r){var s,a;if(((s=this.diff.get())==null?void 0:s.mappings.length)===0)return;const o=((a=this._unchangedRegions.get())==null?void 0:a.regions)||[];for(const l of o)if(l.getHiddenOriginalRange(void 0).contains(t)){l.showOriginalLine(t,n,r);return}}async waitForDiff(){await mFn(this.isDiffUpToDate,t=>t)}serializeState(){const t=this._unchangedRegions.get();return{collapsedRegions:t==null?void 0:t.regions.map(n=>({range:n.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(t){var o;const n=(o=t.collapsedRegions)==null?void 0:o.map(s=>Qi.deserialize(s.range)),r=this._unchangedRegions.get();!r||!n||ua(s=>{for(const a of r.regions)for(const l of n)if(a.modifiedUnchangedRange.intersect(l)){a.setHiddenModifiedRange(l,s);break}})}};PWe=AOo([fOo(2,gFn)],PWe);function gOo(e,t,n){return{changes:e.changes.map(r=>new uk(r.original,r.modified,r.innerChanges?r.innerChanges.map(o=>mOo(o,t,n)):void 0)),moves:e.moves,identical:e.identical,quitEarly:e.quitEarly}}function mOo(e,t,n){let r=e.originalRange,o=e.modifiedRange;return r.startColumn===1&&o.startColumn===1&&(r.endColumn!==1||o.endColumn!==1)&&r.endColumn===t.getLineMaxColumn(r.endLineNumber)&&o.endColumn===n.getLineMaxColumn(o.endLineNumber)&&r.endLineNumbernew kFn(n)),t.moves||[],t.identical,t.quitEarly)}constructor(t,n,r,o){this.mappings=t,this.movedTexts=n,this.identical=r,this.quitEarly=o}}class kFn{constructor(t){this.lineRangeMapping=t}}class D5{static fromDiffs(t,n,r,o,s){const a=uk.inverse(t,n,r),l=[];for(const d of a){let u=d.original.startLineNumber,h=d.modified.startLineNumber,f=d.original.length;const g=u===1&&h===1,k=u+f===n+1&&h+f===r+1;(g||k)&&f>=s+o?(g&&!k&&(f-=s),k&&!g&&(u+=s,h+=s,f-=s),l.push(new D5(u,h,f,0,0))):f>=s*2+o&&(u+=s,h+=s,f-=s*2,l.push(new D5(u,h,f,0,0)))}return l}get originalUnchangedRange(){return Qi.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Qi.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(t,n,r,o,s){this.originalLineNumber=t,this.modifiedLineNumber=n,this.lineCount=r,this._visibleLineCountTop=Bi(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Bi(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Wt(this,d=>this.visibleLineCountTop.read(d)+this.visibleLineCountBottom.read(d)===this.lineCount&&!this.isDragged.read(d)),this.isDragged=Bi(this,void 0);const a=Math.max(Math.min(o,this.lineCount),0),l=Math.max(Math.min(s,this.lineCount-o),0);aOt(o===a),aOt(s===l),this._visibleLineCountTop.set(a,void 0),this._visibleLineCountBottom.set(l,void 0)}setVisibleRanges(t,n){const r=[],o=new Nv(t.map(d=>d.modified)).subtractFrom(this.modifiedUnchangedRange);let s=this.originalLineNumber,a=this.modifiedLineNumber;const l=this.modifiedLineNumber+this.lineCount;if(o.ranges.length===0)this.showAll(n),r.push(this);else{let d=0;for(const u of o.ranges){const h=d===o.ranges.length-1;d++;const f=(h?l:u.endLineNumberExclusive)-a,g=new D5(s,a,f,0,0);g.setHiddenModifiedRange(u,n),r.push(g),s=g.originalUnchangedRange.endLineNumberExclusive,a=g.modifiedUnchangedRange.endLineNumberExclusive}}return r}shouldHideControls(t){return this._shouldHideControls.read(t)}getHiddenOriginalRange(t){return Qi.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(t),this.lineCount-this._visibleLineCountTop.read(t)-this._visibleLineCountBottom.read(t))}getHiddenModifiedRange(t){return Qi.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(t),this.lineCount-this._visibleLineCountTop.read(t)-this._visibleLineCountBottom.read(t))}setHiddenModifiedRange(t,n){const r=t.startLineNumber-this.modifiedLineNumber,o=this.modifiedLineNumber+this.lineCount-t.endLineNumberExclusive;this.setState(r,o,n)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(t=10,n){const r=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+t,r),n)}showMoreBelow(t=10,n){const r=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+t,r),n)}showAll(t){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),t)}showModifiedLine(t,n,r){const o=t+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-t;n===0&&o{l.preventDefault();const d=t.ownerDocument.getSelection();if(!d||d.rangeCount===0)return;const u=d.getRangeAt(0);if(!u||u.collapsed)return;const h=u.startContainer.nodeType===Node.TEXT_NODE?u.startContainer.parentElement:u.startContainer,f=u.endContainer.nodeType===Node.TEXT_NODE?u.endContainer.parentElement:u.endContainer;if(!h||!f)return;const g=n.getModelPositionAt(h,u.startOffset),k=n.getModelPositionAt(f,u.endOffset);if(!g||!k)return;const A=g.delta(r.original.startLineNumber-1),m=k.delta(r.original.startLineNumber-1),v=m.isBefore(A)?De.fromPositions(m,A):De.fromPositions(A,m),p=o.getValueInRange(v);s.writeText(p)})),a}class vOo extends ct{get visibility(){return this._visibility}set visibility(t){this._visibility!==t&&(this._visibility=t,this._diffActions.style.visibility=t?"visible":"hidden")}constructor(t,n,r,o,s,a,l,d,u,h){super(),this._getViewZoneId=t,this._marginDomNode=n,this._deletedCodeDomNode=r,this._modifiedEditor=o,this._diff=s,this._editor=a,this._renderLinesResult=l,this._originalTextModel=d,this._contextMenuService=u,this._clipboardService=h,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=mi.asClassName(Jt.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const f=this._modifiedEditor.getOption(75);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${f}px`,this._diffActions.style.lineHeight=`${f}px`,this._marginDomNode.appendChild(this._diffActions);let g=0;const k=o.getOption(144)&&!h2,A=(m,v,p)=>{this._contextMenuService.showContextMenu({domForShadowRoot:k?o.getDomNode()??void 0:void 0,getAnchor:()=>m,onHide:p,getActions:()=>{const b=[],O=s.modified.isEmpty;return b.push(new ak("diff.clipboard.copyDeletedContent",O?s.original.length>1?j(112,"Copy deleted lines"):j(113,"Copy deleted line"):s.original.length>1?j(114,"Copy changed lines"):j(115,"Copy changed line"),void 0,!0,async()=>{const y=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());await this._clipboardService.writeText(y)})),s.original.length>1&&b.push(new ak("diff.clipboard.copyDeletedLineContent",O?j(116,"Copy deleted line ({0})",s.original.startLineNumber+g):j(117,"Copy changed line ({0})",s.original.startLineNumber+g),void 0,!0,async()=>{let y=this._originalTextModel.getLineContent(s.original.startLineNumber+g);y===""&&(y=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r `),await this._clipboardService.writeText(y)})),o.getOption(104)||b.push(new ak("diff.inline.revertChange",j(118,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),b},autoSelectFirstItem:!0})};this._register(Sc(this._diffActions,"mousedown",m=>{if(!m.leftButton)return;const{top:v,height:p}=ic(this._diffActions),b=Math.floor(f/3);m.preventDefault(),A({x:m.posx,y:v+p+b})})),this._register(o.onMouseMove(m=>{(m.target.type===8||m.target.type===5)&&m.target.detail.viewZoneId===this._getViewZoneId()?(g=this._updateLightBulbPosition(this._marginDomNode,m.event.browserEvent.y,f),this.visibility=!0):this.visibility=!1})),this._register(kOo({domNode:this._deletedCodeDomNode,diffEntry:s,originalModel:this._originalTextModel,renderLinesResult:this._renderLinesResult,clipboardService:h}))}_updateLightBulbPosition(t,n,r){const{top:o}=ic(t),s=n-o,a=Math.floor(s/r),l=a*r;if(this._diffActions.style.top=`${l}px`,this._renderLinesResult.viewLineCounts){let d=0;for(let u=0;ue});function ure(e,t,n,r,o=!1){zu(r,t.fontInfo);const s=n.length>0,a=new pE(1e4);let l=0,d=0;const u=[],h=[];for(let A=0;Anull),r=!0,o=!0){this.lineTokens=t,this.lineBreakData=n,this.mightContainNonBasicASCII=r,this.mightContainRTL=o}}class g8{static fromEditor(t){var s;const n=t.getOptions(),r=n.get(59),o=n.get(165);return new g8(((s=t.getModel())==null?void 0:s.getOptions().tabSize)||0,r,n.get(40),r.typicalHalfwidthCharacterWidth,n.get(118),n.get(75),o.decorationsWidth,n.get(133),n.get(113),n.get(108),n.get(60),n.get(117).verticalScrollbarSize)}constructor(t,n,r,o,s,a,l,d,u,h,f,g,k=!0){this.tabSize=t,this.fontInfo=n,this.disableMonospaceOptimizations=r,this.typicalHalfwidthCharacterWidth=o,this.scrollBeyondLastColumn=s,this.lineHeight=a,this.lineDecorationsWidth=l,this.stopRenderingLineAfter=d,this.renderWhitespace=u,this.renderControlCharacters=h,this.fontLigatures=f,this.verticalScrollbarSize=g,this.setWidth=k}withSetWidth(t){return new g8(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,this.scrollBeyondLastColumn,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,t)}withScrollBeyondLastColumn(t){return new g8(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,t,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,this.setWidth)}}class pOo{constructor(t,n,r,o,s){this.heightInLines=t,this.minWidthInPx=n,this.viewLineCounts=r,this._renderOutputs=o,this._source=s}getModelPositionAt(t,n){let r=t;for(;r&&!r.classList.contains("view-line");)r=r.parentElement;if(!r)return;const o=r.parentElement;if(!o)return;const s=o.querySelectorAll(".view-line");let a=-1;for(let f=0;f=this._renderOutputs.length)return;let l=1,d=a;for(let f=0;fthis._source.lineTokens.length)return;const u=this._renderOutputs[a];if(!u)return;const h=OV(u.characterMapping,t,n)+u.offset;return new tt(l,h)}}class Dyt extends pme{constructor(t,n,r){super(t,n),this.offset=r}}function Qyt(e,t,n,r,o,s,a,l,d){l.appendString('
'):l.appendString('px;">');const u=t.getLineContent(),h=pk.isBasicASCII(u,o),f=pk.containsRTL(u,h,s),g=vZ(new T6(a.fontInfo.isMonospace&&!a.disableMonospaceOptimizations,a.fontInfo.canUseHalfwidthRightwardsArrow,u,!1,h,f,0,t,n,a.tabSize,0,a.fontInfo.spaceWidth,a.fontInfo.middotWidth,a.fontInfo.wsmiddotWidth,a.stopRenderingLineAfter,a.renderWhitespace,a.renderControlCharacters,a.fontLigatures!==G8.OFF,null,null,a.verticalScrollbarSize),l);l.appendString("
");const k=g.characterMapping.getHorizontalOffset(g.characterMapping.length);return{output:g,maxCharWidth:k}}const z1=Lr("clipboardService"),Q6=Lr("contextViewService"),Ek=Lr("contextMenuService");var bOo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Byt=function(e,t){return function(n,r){t(n,r,e)}};let MWe=class extends ct{constructor(t,n,r,o,s,a,l,d,u,h){super(),this._targetWindow=t,this._editors=n,this._diffModel=r,this._options=o,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=a,this._origViewZonesToIgnore=l,this._modViewZonesToIgnore=d,this._clipboardService=u,this._contextMenuService=h,this._originalTopPadding=Bi(this,0),this._originalScrollOffset=Bi(this,0),this._originalScrollOffsetAnimated=kyt(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Bi(this,0),this._modifiedScrollOffset=Bi(this,0),this._modifiedScrollOffsetAnimated=kyt(this._targetWindow,this._modifiedScrollOffset,this._store);const f=Bi("invalidateAlignmentsState",0),g=this._register(new Ss(()=>{f.set(f.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(O=>{this._canIgnoreViewZoneUpdateEvent()||g.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(O=>{this._canIgnoreViewZoneUpdateEvent()||g.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(O=>{(O.hasChanged(166)||O.hasChanged(75))&&g.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(O=>{(O.hasChanged(166)||O.hasChanged(75))&&g.schedule()}));const k=this._diffModel.map(O=>O?es(this,O.model.original.onDidChangeTokens,()=>O.model.original.tokenization.backgroundTokenizationState===2):void 0).map((O,w)=>O==null?void 0:O.read(w)),A=Wt(O=>{const w=this._diffModel.read(O),y=w==null?void 0:w.diff.read(O);if(!w||!y)return null;f.read(O);const x=this._options.renderSideBySide.read(O);return Fyt(this._editors.original,this._editors.modified,y.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,x)}),m=Wt(O=>{var C;const w=(C=this._diffModel.read(O))==null?void 0:C.movedTextToCompare.read(O);if(!w)return null;f.read(O);const y=w.changes.map(x=>new kFn(x));return Fyt(this._editors.original,this._editors.modified,y,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function v(){const O=document.createElement("div");return O.className="diagonal-fill",O}const p=this._register(new Pt);this.viewZones=Wt(this,O=>{var N,I,W,H;p.clear();const w=A.read(O)||[],y=[],C=[],x=this._modifiedTopPadding.read(O);x>0&&C.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:x,showInHiddenAreas:!0,suppressMouseDown:!0});const L=this._originalTopPadding.read(O);L>0&&y.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:L,showInHiddenAreas:!0,suppressMouseDown:!0});const S=this._options.renderSideBySide.read(O),E=S||(N=this._editors.modified._getViewModel())==null?void 0:N.createLineBreaksComputer();if(E){const V=this._editors.original.getModel();for(const Z of w)if(Z.diff)for(let K=Z.originalRange.startLineNumber;KV.getLineCount())return{orig:y,mod:C};E==null||E.addRequest(V.getLineContent(K),null,null)}}const Q=(E==null?void 0:E.finalize())??[];let T=0;const M=this._editors.modified.getOption(75),B=(I=this._diffModel.read(O))==null?void 0:I.movedTextToCompare.read(O),P=((W=this._editors.original.getModel())==null?void 0:W.mightContainNonBasicASCII())??!1,F=((H=this._editors.original.getModel())==null?void 0:H.mightContainRTL())??!1,R=g8.fromEditor(this._editors.modified);for(const V of w)if(V.diff&&!S&&(!this._options.useTrueInlineDiffRendering.read(O)||!dnt(V.diff))){if(!V.originalRange.isEmpty){k.read(O);const K=document.createElement("div");K.classList.add("view-lines","line-delete","line-delete-selectable","monaco-mouse-cursor-text");const X=this._editors.original.getModel();if(V.originalRange.endLineNumberExclusive-1>X.getLineCount())return{orig:y,mod:C};const ee=new hre(V.originalRange.mapToLineArray(ke=>X.tokenization.getLineTokens(ke)),V.originalRange.mapToLineArray(ke=>Q[T++]),P,F),q=[];for(const ke of V.diff.innerChanges||[])q.push(new BB(ke.originalRange.delta(-(V.diff.original.startLineNumber-1)),EWe.className,0));const $=ure(ee,R,q,K),oe=document.createElement("div");if(oe.className="inline-deleted-margin-view-zone",zu(oe,R.fontInfo),this._options.renderIndicators.read(O))for(let ke=0;ke<$.heightInLines;ke++){const ne=document.createElement("div");ne.className=`delete-sign ${mi.asClassName(AFn)}`,ne.setAttribute("style",`position:absolute;top:${ke*M}px;width:${R.lineDecorationsWidth}px;height:${M}px;right:0;`),oe.appendChild(ne)}let de;p.add(new vOo(()=>p5(de),oe,K,this._editors.modified,V.diff,this._diffEditorWidget,$,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let ke=0;ke<$.viewLineCounts.length;ke++){const ne=$.viewLineCounts[ke];ne>1&&y.push({afterLineNumber:V.originalRange.startLineNumber+ke,domNode:v(),heightInPx:(ne-1)*M,showInHiddenAreas:!0,suppressMouseDown:!0})}C.push({afterLineNumber:V.modifiedRange.startLineNumber-1,domNode:K,heightInPx:$.heightInLines*M,minWidthInPx:$.minWidthInPx,marginDomNode:oe,setZoneId(ke){de=ke},showInHiddenAreas:!0,suppressMouseDown:!1})}const Z=document.createElement("div");Z.className="gutter-delete",y.push({afterLineNumber:V.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:V.modifiedHeightInPx,marginDomNode:Z,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Z=V.modifiedHeightInPx-V.originalHeightInPx;if(Z>0){if(B!=null&&B.lineRangeMapping.original.delta(-1).deltaLength(2).contains(V.originalRange.endLineNumberExclusive-1))continue;y.push({afterLineNumber:V.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Z,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let K=function(){const ee=document.createElement("div");return ee.className="arrow-revert-change "+mi.asClassName(Jt.arrowRight),O.store.add(pt(ee,"mousedown",q=>q.stopPropagation())),O.store.add(pt(ee,"click",q=>{q.stopPropagation(),s.revert(V.diff)})),ln("div",{},ee)};if(B!=null&&B.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(V.modifiedRange.endLineNumberExclusive-1))continue;let X;V.diff&&V.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(O)&&(X=K()),C.push({afterLineNumber:V.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Z,marginDomNode:X,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const V of m.read(O)??[]){if(!(B!=null&&B.lineRangeMapping.original.intersect(V.originalRange))||!(B!=null&&B.lineRangeMapping.modified.intersect(V.modifiedRange)))continue;const Z=V.modifiedHeightInPx-V.originalHeightInPx;Z>0?y.push({afterLineNumber:V.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Z,showInHiddenAreas:!0,suppressMouseDown:!0}):C.push({afterLineNumber:V.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-Z,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:y,mod:C}});let b=!1;this._register(this._editors.original.onDidScrollChange(O=>{O.scrollLeftChanged&&!b&&(b=!0,this._editors.modified.setScrollLeft(O.scrollLeft),b=!1)})),this._register(this._editors.modified.onDidScrollChange(O=>{O.scrollLeftChanged&&!b&&(b=!0,this._editors.original.setScrollLeft(O.scrollLeft),b=!1)})),this._originalScrollTop=es(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=es(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(xi(O=>{const w=this._originalScrollTop.read(O)-(this._originalScrollOffsetAnimated.read(void 0)-this._modifiedScrollOffsetAnimated.read(O))-(this._originalTopPadding.read(void 0)-this._modifiedTopPadding.read(O));w!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(w,1)})),this._register(xi(O=>{const w=this._modifiedScrollTop.read(O)-(this._modifiedScrollOffsetAnimated.read(void 0)-this._originalScrollOffsetAnimated.read(O))-(this._modifiedTopPadding.read(void 0)-this._originalTopPadding.read(O));w!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(w,1)})),this._register(xi(O=>{var C;const w=(C=this._diffModel.read(O))==null?void 0:C.movedTextToCompare.read(O);let y=0;if(w){const x=this._editors.original.getTopForLineNumber(w.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.read(void 0);y=this._editors.modified.getTopForLineNumber(w.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.read(void 0)-x}y>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(y,void 0)):y<0?(this._modifiedTopPadding.set(-y,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0)-y,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0)+y,void 0,!0)}))}};MWe=bOo([Byt(8,z1),Byt(9,Ek)],MWe);function Fyt(e,t,n,r,o,s){const a=new q8(Pyt(e,r)),l=new q8(Pyt(t,o)),d=e.getOption(75),u=t.getOption(75),h=[];let f=0,g=0;function k(A,m){for(;;){let v=a.peek(),p=l.peek();if(v&&v.lineNumber>=A&&(v=void 0),p&&p.lineNumber>=m&&(p=void 0),!v&&!p)break;const b=v?v.lineNumber-f:Number.MAX_VALUE,O=p?p.lineNumber-g:Number.MAX_VALUE;bO?(l.dequeue(),v={lineNumber:p.lineNumber-g+f,heightInPx:0}):(a.dequeue(),l.dequeue()),h.push({originalRange:Qi.ofLength(v.lineNumber,1),modifiedRange:Qi.ofLength(p.lineNumber,1),originalHeightInPx:d+v.heightInPx,modifiedHeightInPx:u+p.heightInPx,diff:void 0})}}for(const A of n){let O=function(w,y,C=!1){var Q,T;if(wM.lineNumberM+B.heightInPx,0))??0,E=((T=l.takeWhile(M=>M.lineNumberM+B.heightInPx,0))??0;h.push({originalRange:x,modifiedRange:L,originalHeightInPx:x.length*d+S,modifiedHeightInPx:L.length*u+E,diff:A.lineRangeMapping}),b=w,p=y};const m=A.lineRangeMapping;k(m.original.startLineNumber,m.modified.startLineNumber);let v=!0,p=m.modified.startLineNumber,b=m.original.startLineNumber;if(s)for(const w of m.innerChanges||[]){w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&O(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber);const y=e.getModel(),C=w.originalRange.endLineNumber<=y.getLineCount()?y.getLineMaxColumn(w.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;w.originalRange.endColumn1&&r.push({lineNumber:d,heightInPx:a*(u-1)})}for(const d of e.getWhitespaces()){if(t.has(d.id))continue;const u=d.afterLineNumber===0?0:s.convertViewPositionToModelPosition(new tt(d.afterLineNumber,1)).lineNumber;n.push({lineNumber:u,heightInPx:d.height})}return Ibo(n,r,d=>d.lineNumber,(d,u)=>({lineNumber:d.lineNumber,heightInPx:d.heightInPx+u.heightInPx}))}function dnt(e){return e.innerChanges?e.innerChanges.every(t=>Jme(t.modifiedRange)&&Jme(t.originalRange)||t.originalRange.equalsRange(new De(1,1,1,1))):!1}function Jme(e){return e.startLineNumber===e.endLineNumber}const WJ=class WJ extends ct{constructor(t,n,r,o,s){super(),this._rootElement=t,this._diffModel=n,this._originalEditorLayoutInfo=r,this._modifiedEditorLayoutInfo=o,this._editors=s,this._originalScrollTop=es(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=es(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=y1("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Bi(this,0),this._modifiedViewZonesChangedSignal=y1("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=y1("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=Wt(this,h=>{var C;this._element.replaceChildren();const f=this._diffModel.read(h),g=(C=f==null?void 0:f.diff.read(h))==null?void 0:C.movedTexts;if(!g||g.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const k=this._originalEditorLayoutInfo.read(h),A=this._modifiedEditorLayoutInfo.read(h);if(!k||!A){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const m=g.map(x=>{function L(R,N){const I=N.getTopForLineNumber(R.startLineNumber,!0),W=N.getTopForLineNumber(R.endLineNumberExclusive,!0);return(I+W)/2}const S=L(x.lineRangeMapping.original,this._editors.original),E=this._originalScrollTop.read(h),Q=L(x.lineRangeMapping.modified,this._editors.modified),T=this._modifiedScrollTop.read(h),M=S-E,B=Q-T,P=Math.min(S,Q),F=Math.max(S,Q);return{range:new Jn(P,F),from:M,to:B,fromWithoutScroll:S,toWithoutScroll:Q,move:x}});m.sort(Qlo(nA(x=>x.fromWithoutScroll>x.toWithoutScroll,f7n),nA(x=>x.fromWithoutScroll>x.toWithoutScroll?x.fromWithoutScroll:-x.toWithoutScroll,P1)));const v=unt.compute(m.map(x=>x.range)),p=10,b=k.verticalScrollbarWidth,O=(v.getTrackCount()-1)*10+p*2,w=b+O+(A.contentLeft-WJ.movedCodeBlockPadding);let y=0;for(const x of m){const L=v.getTrack(y),S=b+p+L*10,E=15,Q=15,T=w,M=A.glyphMarginWidth+A.lineNumbersWidth,B=18,P=document.createElementNS("http://www.w3.org/2000/svg","rect");P.classList.add("arrow-rectangle"),P.setAttribute("x",`${T-M}`),P.setAttribute("y",`${x.to-B/2}`),P.setAttribute("width",`${M}`),P.setAttribute("height",`${B}`),this._element.appendChild(P);const F=document.createElementNS("http://www.w3.org/2000/svg","g"),R=document.createElementNS("http://www.w3.org/2000/svg","path");R.setAttribute("d",`M 0 ${x.from} L ${S} ${x.from} L ${S} ${x.to} L ${T-Q} ${x.to}`),R.setAttribute("fill","none"),F.appendChild(R);const N=document.createElementNS("http://www.w3.org/2000/svg","polygon");N.classList.add("arrow"),h.store.add(xi(I=>{R.classList.toggle("currentMove",x.move===f.activeMovedText.read(I)),N.classList.toggle("currentMove",x.move===f.activeMovedText.read(I))})),N.setAttribute("points",`${T-Q},${x.to-E/2} ${T},${x.to} ${T-Q},${x.to+E/2}`),F.appendChild(N),this._element.appendChild(F),y++}this.width.set(O,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Gn(()=>this._element.remove())),this._register(xi(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left=`${f.width-f.verticalScrollbarWidth}px`,this._element.style.height=`${f.height}px`,this._element.style.width=`${f.verticalScrollbarWidth+f.contentLeft-WJ.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(gV(this._state));const a=Wt(h=>{const f=this._diffModel.read(h),g=f==null?void 0:f.diff.read(h);return g?g.movedTexts.map(k=>({move:k,original:new IU(ha(k.lineRangeMapping.original.startLineNumber-1),18),modified:new IU(ha(k.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(Xme(this._editors.original,a.map(h=>h.map(f=>f.original)))),this._register(Xme(this._editors.modified,a.map(h=>h.map(f=>f.modified)))),this._register(PA((h,f)=>{const g=a.read(h);for(const k of g)f.add(new Myt(this._editors.original,k.original,k.move,"original",this._diffModel.get())),f.add(new Myt(this._editors.modified,k.modified,k.move,"modified",this._diffModel.get()))}));const l=y1("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),d=y1("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let u="modified";this._register(aZ({changeTracker:{createChangeSummary:()=>{},handleChange:(h,f)=>(h.didChange(l)&&(u="original"),h.didChange(d)&&(u="modified"),!0)}},h=>{l.read(h),d.read(h);const f=this._diffModel.read(h);if(!f)return;const g=f.diff.read(h);let k;if(g&&u==="original"){const A=this._editors.originalCursor.read(h);A&&(k=g.movedTexts.find(m=>m.lineRangeMapping.original.contains(A.lineNumber)))}if(g&&u==="modified"){const A=this._editors.modifiedCursor.read(h);A&&(k=g.movedTexts.find(m=>m.lineRangeMapping.modified.contains(A.lineNumber)))}k!==f.movedTextToCompare.read(void 0)&&f.movedTextToCompare.set(void 0,void 0),f.setActiveMovedText(k)}))}};WJ.movedCodeBlockPadding=4;let oW=WJ;class unt{static compute(t){const n=[],r=[];for(const o of t){let s=n.findIndex(a=>!a.intersectsStrict(o));s===-1&&(n.length>=6?s=Vmo(n,nA(l=>l.intersectWithRangeLength(o),P1)):(s=n.length,n.push(new Zet))),n[s].addRange(o),r.push(s)}return new unt(n.length,r)}constructor(t,n){this._trackCount=t,this.trackPerLineIdx=n}getTrack(t){return this.trackPerLineIdx[t]}getTrackCount(){return this._trackCount}}class Myt extends snt{constructor(t,n,r,o,s){const a=wo("div.diff-hidden-lines-widget");super(t,n,a.root),this._editor=t,this._move=r,this._kind=o,this._diffModel=s,this._nodes=wo("div.diff-moved-code-block",{style:{marginRight:"4px"}},[wo("div.text-content@textContent"),wo("div.action-bar@actionBar")]),a.root.appendChild(this._nodes.root);const l=es(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(zT(this._nodes.root,{paddingRight:l.map(g=>g.verticalScrollbarWidth)}));let d;r.changes.length>0?d=this._kind==="original"?j(131,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):j(132,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):d=this._kind==="original"?j(133,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):j(134,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const u=this._register(new bm(this._nodes.actionBar,{highlightToggledItems:!0})),h=new ak("",d,"",!1);u.push(h,{icon:!1,label:!0});const f=new ak("","Compare",mi.asClassName(Jt.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===r?void 0:this._move,void 0)});this._register(xi(g=>{const k=this._diffModel.movedTextToCompare.read(g)===r;f.checked=k})),u.push(f,{icon:!1,label:!0})}}class OOo extends ct{constructor(t,n,r,o){super(),this._editors=t,this._diffModel=n,this._options=r,this._decorations=Wt(this,s=>{const a=this._diffModel.read(s),l=a==null?void 0:a.diff.read(s);if(!l)return null;const d=this._diffModel.read(s).movedTextToCompare.read(s),u=this._options.renderIndicators.read(s),h=this._options.showEmptyDecorations.read(s),f=[],g=[];if(!d)for(const A of l.mappings)if(A.lineRangeMapping.original.isEmpty||f.push({range:A.lineRangeMapping.original.toInclusiveRange(),options:u?xyt:Syt}),A.lineRangeMapping.modified.isEmpty||g.push({range:A.lineRangeMapping.modified.toInclusiveRange(),options:u?Cyt:Lyt}),A.lineRangeMapping.modified.isEmpty||A.lineRangeMapping.original.isEmpty)A.lineRangeMapping.original.isEmpty||f.push({range:A.lineRangeMapping.original.toInclusiveRange(),options:cOo}),A.lineRangeMapping.modified.isEmpty||g.push({range:A.lineRangeMapping.modified.toInclusiveRange(),options:aOo});else{const m=this._options.useTrueInlineDiffRendering.read(s)&&dnt(A.lineRangeMapping);for(const v of A.lineRangeMapping.innerChanges||[])if(A.lineRangeMapping.original.contains(v.originalRange.startLineNumber)&&f.push({range:v.originalRange,options:v.originalRange.isEmpty()&&h?dOo:EWe}),A.lineRangeMapping.modified.contains(v.modifiedRange.startLineNumber)&&g.push({range:v.modifiedRange,options:v.modifiedRange.isEmpty()&&h&&!m?lOo:Tyt}),m){const p=a.model.original.getValueInRange(v.originalRange);g.push({range:v.modifiedRange,options:{description:"deleted-text",before:{content:p,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(d)for(const A of d.changes){const m=A.original.toInclusiveRange();m&&f.push({range:m,options:u?xyt:Syt});const v=A.modified.toInclusiveRange();v&&g.push({range:v,options:u?Cyt:Lyt});for(const p of A.innerChanges||[])f.push({range:p.originalRange,options:EWe}),g.push({range:p.modifiedRange,options:Tyt})}const k=this._diffModel.read(s).activeMovedText.read(s);for(const A of l.movedTexts)f.push({range:A.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(A===k?" currentMove":""),blockPadding:[oW.movedCodeBlockPadding,0,oW.movedCodeBlockPadding,oW.movedCodeBlockPadding]}}),g.push({range:A.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(A===k?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:f,modifiedDecorations:g}}),this._register(Yme(this._editors.original,this._decorations.map(s=>(s==null?void 0:s.originalDecorations)||[]))),this._register(Yme(this._editors.modified,this._decorations.map(s=>(s==null?void 0:s.modifiedDecorations)||[])))}}class mu{static equals(t,n){return t.x===n.x&&t.y===n.y}constructor(t,n){this.x=t,this.y=n}add(t){return new mu(this.x+t.x,this.y+t.y)}deltaX(t){return new mu(this.x+t,this.y)}deltaY(t){return new mu(this.x,this.y+t)}toString(){return`(${this.x},${this.y})`}subtract(t){return new mu(this.x-t.x,this.y-t.y)}scale(t){return new mu(this.x*t,this.y*t)}mapComponents(t){return new mu(t(this.x),t(this.y))}isZero(){return this.x===0&&this.y===0}withThreshold(t){return this.mapComponents(n=>n>t?n-t:n<-t?n+t:0)}}function ml(e){return RWe.get(e)}const DS=class DS extends ct{static get(t){let n=DS._map.get(t);if(!n){n=new DS(t),DS._map.set(t,n);const r=t.onDidDispose(()=>{const o=DS._map.get(t);o&&(DS._map.delete(t),o.dispose(),r.dispose())})}return n}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new lZ(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const t=this._currentTransaction;this._currentTransaction=void 0,t.finish()}}constructor(t){var n;super(),this.editor=t,this._updateCounter=0,this._currentTransaction=void 0,this._model=Bi(this,this.editor.getModel()),this.model=this._model,this.isReadonly=es(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(104)),this._versionId=UK({owner:this,lazy:!0},((n=this.editor.getModel())==null?void 0:n.getVersionId())??null),this.versionId=this._versionId,this._selections=UK({owner:this,equalsFn:pQ(a$(Rn.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=Gh({owner:this,equalsFn:pQ(a$(tt.equals))},r=>{var o;return((o=this.selections.read(r))==null?void 0:o.map(s=>s.getStartPosition()))??null}),this.isFocused=es(this,r=>{const o=this.editor.onDidFocusEditorWidget(r),s=this.editor.onDidBlurEditorWidget(r);return{dispose(){o.dispose(),s.dispose()}}},()=>this.editor.hasWidgetFocus()),this.isTextFocused=es(this,r=>{const o=this.editor.onDidFocusEditorText(r),s=this.editor.onDidBlurEditorText(r);return{dispose(){o.dispose(),s.dispose()}}},()=>this.editor.hasTextFocus()),this.inComposition=es(this,r=>{const o=this.editor.onDidCompositionStart(()=>{r(void 0)}),s=this.editor.onDidCompositionEnd(()=>{r(void 0)});return{dispose(){o.dispose(),s.dispose()}}},()=>this.editor.inComposition),this.value=Qet(this,r=>{var o;return this.versionId.read(r),((o=this.model.read(r))==null?void 0:o.getValue())??""},(r,o)=>{const s=this.model.get();s!==null&&r!==s.getValue()&&s.setValue(r)}),this.valueIsEmpty=Wt(this,r=>{var o;return this.versionId.read(r),((o=this.editor.getModel())==null?void 0:o.getValueLength())===0}),this.cursorSelection=Gh({owner:this,equalsFn:pQ(Rn.selectionsEqual)},r=>{var o;return((o=this.selections.read(r))==null?void 0:o[0])??null}),this.cursorPosition=Gh({owner:this,equalsFn:tt.equals},r=>{var o,s;return((s=(o=this.selections.read(r))==null?void 0:o[0])==null?void 0:s.getPosition())??null}),this.cursorLineNumber=Wt(this,r=>{var o;return((o=this.cursorPosition.read(r))==null?void 0:o.lineNumber)??null}),this.onDidType=Uv(this),this.onDidPaste=Uv(this),this.scrollTop=es(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=es(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=es(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(r=>r.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(r=>r.decorationsLeft),this.layoutInfoWidth=this.layoutInfo.map(r=>r.width),this.layoutInfoHeight=this.layoutInfo.map(r=>r.height),this.layoutInfoMinimap=this.layoutInfo.map(r=>r.minimap),this.layoutInfoVerticalScrollbarWidth=this.layoutInfo.map(r=>r.verticalScrollbarWidth),this.contentWidth=es(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this.contentHeight=es(this.editor.onDidContentSizeChange,()=>this.editor.getContentHeight()),this._widgetCounter=0,this.openedPeekWidgets=Bi(this,0),this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(r=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,r)}finally{this._endUpdate()}})),this._register(this.editor.onDidPaste(r=>{this._beginUpdate();try{this._forceUpdate(),this.onDidPaste.trigger(this._currentTransaction,r)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(r=>{var o;this._beginUpdate();try{this._versionId.set(((o=this.editor.getModel())==null?void 0:o.getVersionId())??null,this._currentTransaction,r),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(r=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,r),this._forceUpdate()}finally{this._endUpdate()}})),this.domNode=Wt(r=>(this.model.read(r),this.editor.getDomNode()))}forceUpdate(t){this._beginUpdate();try{return this._forceUpdate(),t?t(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){var t;this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(((t=this.editor.getModel())==null?void 0:t.getVersionId())??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(t,n=_d.ofCaller()){return es(this,r=>this.editor.onDidChangeConfiguration(o=>{o.hasChanged(t)&&r(void 0)}),()=>this.editor.getOption(t),n)}setDecorations(t){const n=new Pt,r=this.editor.createDecorationsCollection();return n.add(Nbe({owner:this,debugName:()=>`Apply decorations from ${t.debugName}`},o=>{const s=t.read(o);r.set(s)})),n.add({dispose:()=>{r.clear()}}),n}createOverlayWidget(t){const n="observableOverlayWidget"+this._widgetCounter++,r={getDomNode:()=>t.domNode,getPosition:()=>t.position.get(),getId:()=>n,allowEditorOverflow:t.allowEditorOverflow,getMinContentWidthInPx:()=>t.minContentWidthInPx.get()};this.editor.addOverlayWidget(r);const o=xi(s=>{t.position.read(s),t.minContentWidthInPx.read(s),this.editor.layoutOverlayWidget(r)});return Gn(()=>{o.dispose(),this.editor.removeOverlayWidget(r)})}createContentWidget(t){const n="observableContentWidget"+this._widgetCounter++,r={getDomNode:()=>t.domNode,getPosition:()=>t.position.get(),getId:()=>n,allowEditorOverflow:t.allowEditorOverflow};this.editor.addContentWidget(r);const o=xi(s=>{t.position.read(s),this.editor.layoutContentWidget(r)});return Gn(()=>{o.dispose(),this.editor.removeContentWidget(r)})}observeLineOffsetRange(t,n){const r=this.observePosition(t.map(s=>new tt(s.startLineNumber,1)),n),o=this.observePosition(t.map(s=>new tt(s.endLineNumberExclusive+1,1)),n);return Wt(s=>{var h;r.read(s),o.read(s);const a=t.read(s),l=(h=this.model.read(s))==null?void 0:h.getLineCount(),d=(typeof l<"u"&&a.startLineNumber>l?this.editor.getBottomForLineNumber(l):this.editor.getTopForLineNumber(a.startLineNumber))-this.scrollTop.read(s),u=a.isEmpty?d:this.editor.getBottomForLineNumber(a.endLineNumberExclusive-1)-this.scrollTop.read(s);return new Jn(d,u)})}observePosition(t,n){let r=t.get();const o=UK({owner:this,debugName:()=>`topLeftOfPosition${r==null?void 0:r.toString()}`,equalsFn:pQ(mu.equals)},new mu(0,0)),s="observablePositionWidget"+this._widgetCounter++,a=document.createElement("div"),l={getDomNode:()=>a,getPosition:()=>r?{preference:[0],position:t.get()}:null,getId:()=>s,allowEditorOverflow:!1,afterRender:(d,u)=>{const h=this._model.get();h&&r&&r.lineNumber>h.getLineCount()?o.set(new mu(0,this.editor.getBottomForLineNumber(h.getLineCount())-this.scrollTop.get()),void 0):o.set(u?new mu(u.left,u.top):null,void 0)}};return this.editor.addContentWidget(l),n.add(xi(d=>{r=t.read(d),this.editor.layoutContentWidget(l)})),n.add(Gn(()=>{this.editor.removeContentWidget(l)})),o}isTargetHovered(t,n){const r=Bi("isInjectedTextHovered",!1);return n.add(this.editor.onMouseMove(o=>{const s=t(o);r.set(s,void 0)})),n.add(this.editor.onMouseLeave(o=>{r.set(!1,void 0)})),r}observeLineHeightForPosition(t){return Wt(n=>{const r=t instanceof tt?t:t.read(n);return r===null?null:(this.getOption(75).read(n),this.editor.getLineHeightForPosition(r))})}observeLineHeightForLine(t){return typeof t=="number"?this.observeLineHeightForPosition(new tt(t,1)):Wt(n=>{const r=t.read(n);return r===null?null:this.observeLineHeightForPosition(new tt(r,1)).read(n)})}observeLineHeightsForLineRange(t){return Wt(n=>{const r=t instanceof Qi?t:t.read(n),o=[];for(let s=r.startLineNumber;s=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},yOo=function(e,t){return function(n,r){t(n,r,e)}},sb,_L;let K$=(_L=class extends ct{constructor(t,n,r,o,s,a,l){super(),this._editors=t,this._rootElement=n,this._diffModel=r,this._rootWidth=o,this._rootHeight=s,this._modifiedEditorLayoutInfo=a,this._themeService=l,this.width=sb.ENTIRE_DIFF_OVERVIEW_WIDTH;const d=es(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),u=Wt(g=>{const k=d.read(g),A=k.getColor(bAo)||(k.getColor(yQ)||dje).transparent(2),m=k.getColor(OAo)||(k.getColor(C5)||uje).transparent(2);return{insertColor:A,removeColor:m}}),h=ns(document.createElement("div"));h.setClassName("diffViewport"),h.setPosition("absolute");const f=wo("div.diffOverview",{style:{position:"absolute",top:"0px",width:sb.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(RU(f,h.domNode)),this._register(Sc(f,cn.POINTER_DOWN,g=>{this._editors.modified.delegateVerticalScrollbarPointerDown(g)})),this._register(pt(f,cn.MOUSE_WHEEL,g=>{this._editors.modified.delegateScrollFromMouseWheelEvent(g)},{passive:!1})),this._register(RU(this._rootElement,f)),this._register(PA((g,k)=>{const A=this._diffModel.read(g),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(k.add(m),k.add(RU(f,m.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(k.add(v),k.add(RU(f,v.getDomNode()))),!m||!v)return;const p=y1("viewZoneChanged",this._editors.original.onDidChangeViewZones),b=y1("viewZoneChanged",this._editors.modified.onDidChangeViewZones),O=y1("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),w=y1("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);k.add(xi(y=>{var Q;p.read(y),b.read(y),O.read(y),w.read(y);const C=u.read(y),x=(Q=A==null?void 0:A.diff.read(y))==null?void 0:Q.mappings;function L(T,M,B){const P=B._getViewModel();return P?T.filter(F=>F.length>0).map(F=>{const R=P.coordinatesConverter.convertModelPositionToViewPosition(new tt(F.startLineNumber,1)),N=P.coordinatesConverter.convertModelPositionToViewPosition(new tt(F.endLineNumberExclusive,1)),I=N.lineNumber-R.lineNumber;return new SQn(R.lineNumber,N.lineNumber,I,M.toString())}):[]}const S=L((x||[]).map(T=>T.lineRangeMapping.original),C.removeColor,this._editors.original),E=L((x||[]).map(T=>T.lineRangeMapping.modified),C.insertColor,this._editors.modified);m==null||m.setZones(S),v==null||v.setZones(E)})),k.add(xi(y=>{const C=this._rootHeight.read(y),x=this._rootWidth.read(y),L=this._modifiedEditorLayoutInfo.read(y);if(L){const S=sb.ENTIRE_DIFF_OVERVIEW_WIDTH-2*sb.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:C,right:S+sb.ONE_OVERVIEW_WIDTH,width:sb.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:C,right:0,width:sb.ONE_OVERVIEW_WIDTH});const E=this._editors.modifiedScrollTop.read(y),Q=this._editors.modifiedScrollHeight.read(y),T=this._editors.modified.getOption(117),M=new CV(T.verticalHasArrows?T.arrowSize:0,T.verticalScrollbarSize,0,L.height,Q,E);h.setTop(M.getSliderPosition()),h.setHeight(M.getSliderSize())}else h.setTop(0),h.setHeight(0);f.style.height=C+"px",f.style.left=x-sb.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",h.setWidth(sb.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},sb=_L,_L.ONE_OVERVIEW_WIDTH=15,_L.ENTIRE_DIFF_OVERVIEW_WIDTH=_L.ONE_OVERVIEW_WIDTH*2,_L);K$=sb=wOo([yOo(6,Il)],K$);var COo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},y9e=function(e,t){return function(n,r){t(n,r,e)}};let IWe=class extends ct{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(t,n,r,o,s,a,l,d){super(),this.originalEditorElement=t,this.modifiedEditorElement=n,this._options=r,this._argCodeEditorWidgetOptions=o,this._createInnerEditor=s,this._contextKeyService=a,this._instantiationService=l,this._keybindingService=d,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new it),this.modifiedScrollTop=es(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=es(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=ml(this.modified),this.originalObs=ml(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=es(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=Gh({owner:this,equalsFn:tt.equals},u=>{var h;return((h=this.modifiedSelections.read(u)[0])==null?void 0:h.getPosition())??new tt(1,1)}),this.originalCursor=es(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new tt(1,1)),this.isOriginalFocused=ml(this.original).isFocused,this.isModifiedFocused=ml(this.modified).isFocused,this.isFocused=Wt(this,u=>this.isOriginalFocused.read(u)||this.isModifiedFocused.read(u)),this._argCodeEditorWidgetOptions=null,this._register(aZ({changeTracker:{createChangeSummary:()=>({}),handleChange:(u,h)=>(u.didChange(r.editorOptions)&&Object.assign(h,u.change.changedOptions),!0)}},(u,h)=>{r.editorOptions.read(u),this._options.renderSideBySide.read(u),this.modified.updateOptions(this._adjustOptionsForRightHandSide(u,h)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(u,h))}))}_createLeftHandSideEditor(t,n){const r=this._adjustOptionsForLeftHandSide(void 0,t),o=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,r,n),s=this._contextKeyService.createKey("isInDiffLeftEditor",o.hasWidgetFocus());return this._register(o.onDidFocusEditorWidget(()=>s.set(!0))),this._register(o.onDidBlurEditorWidget(()=>s.set(!1))),o}_createRightHandSideEditor(t,n){const r=this._adjustOptionsForRightHandSide(void 0,t),o=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,r,n),s=this._contextKeyService.createKey("isInDiffRightEditor",o.hasWidgetFocus());return this._register(o.onDidFocusEditorWidget(()=>s.set(!0))),this._register(o.onDidBlurEditorWidget(()=>s.set(!1))),o}_constructInnerEditor(t,n,r,o){const s=this._createInnerEditor(t,n,r,o);return this._register(s.onDidContentSizeChange(a=>{const l=this.original.getContentWidth()+this.modified.getContentWidth()+K$.ENTIRE_DIFF_OVERVIEW_WIDTH,d=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:d,contentWidth:l,contentHeightChanged:a.contentHeightChanged,contentWidthChanged:a.contentWidthChanged})})),s}_adjustOptionsForLeftHandSide(t,n){const r=this._adjustOptionsForSubEditor(n);return this._options.renderSideBySide.get()?(r.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},r.wordWrapOverride1=this._options.diffWordWrap.get()):(r.wordWrapOverride1="off",r.wordWrapOverride2="off",r.stickyScroll={enabled:!1},r.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),r.glyphMargin=this._options.renderSideBySide.get(),n.originalAriaLabel&&(r.ariaLabel=n.originalAriaLabel),r.ariaLabel=this._updateAriaLabel(r.ariaLabel),r.readOnly=!this._options.originalEditable.get(),r.dropIntoEditor={enabled:!r.readOnly},r.extraEditorClassName="original-in-monaco-diff-editor",r}_adjustOptionsForRightHandSide(t,n){const r=this._adjustOptionsForSubEditor(n);return n.modifiedAriaLabel&&(r.ariaLabel=n.modifiedAriaLabel),r.ariaLabel=this._updateAriaLabel(r.ariaLabel),r.wordWrapOverride1=this._options.diffWordWrap.get(),r.revealHorizontalRightPadding=bf.revealHorizontalRightPadding.defaultValue+K$.ENTIRE_DIFF_OVERVIEW_WIDTH,r.scrollbar.verticalHasArrows=!1,r.extraEditorClassName="modified-in-monaco-diff-editor",r}_adjustOptionsForSubEditor(t){const n={...t,dimension:{height:0,width:0}};return n.inDiffEditor=!0,n.automaticLayout=!1,n.allowVariableLineHeights=!1,n.allowVariableFonts=!1,n.allowVariableFontsInAccessibilityMode=!1,n.scrollbar={...n.scrollbar||{}},n.folding=!1,n.codeLens=this._options.diffCodeLens.get(),n.fixedOverflowWidgets=!0,n.minimap={...n.minimap||{}},n.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?n.stickyScroll={enabled:!1}:n.stickyScroll=this._options.editorOptions.get().stickyScroll,n}_updateAriaLabel(t){var r;t||(t="");const n=j(111," use {0} to open the accessibility help.",(r=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))==null?void 0:r.getAriaLabel());return this._options.accessibilityVerbose.get()?t+n:t?t.replaceAll(n,""):""}};IWe=COo([y9e(5,Fi),y9e(6,$n),y9e(7,Fo)],IWe);var wZ=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};const xOo=!1;var _me;(function(e){e.North="north",e.South="south",e.East="east",e.West="west"})(_me||(_me={}));let LOo=4;const SOo=new it;let TOo=300;const EOo=new it;class hnt{constructor(t){this.el=t,this.disposables=new Pt}get onPointerMove(){return this.disposables.add(new ms(oi(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new ms(oi(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}wZ([bc],hnt.prototype,"onPointerMove",null);wZ([bc],hnt.prototype,"onPointerUp",null);class Ant{get onPointerMove(){return this.disposables.add(new ms(this.el,pa.Change)).event}get onPointerUp(){return this.disposables.add(new ms(this.el,pa.End)).event}constructor(t){this.el=t,this.disposables=new Pt}dispose(){this.disposables.dispose()}}wZ([bc],Ant.prototype,"onPointerMove",null);wZ([bc],Ant.prototype,"onPointerUp",null);class $me{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(t){this.factory=t}dispose(){}}wZ([bc],$me.prototype,"onPointerMove",null);wZ([bc],$me.prototype,"onPointerUp",null);const Ryt="pointer-events-disabled";class OA extends ct{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(t){this._state!==t&&(this.el.classList.toggle("disabled",t===0),this.el.classList.toggle("minimum",t===1),this.el.classList.toggle("maximum",t===2),this._state=t,this.onDidEnablementChange.fire(t))}get onDidStart(){return this._onDidStart.event}get onDidChange(){return this._onDidChange.event}get onDidReset(){return this._onDidReset.event}get onDidEnd(){return this._onDidEnd.event}set orthogonalStartSash(t){if(this._orthogonalStartSash!==t){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),t){const n=r=>{this.orthogonalStartDragHandleDisposables.clear(),r!==0&&(this._orthogonalStartDragHandle=tn(this.el,ln(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Gn(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(pt(this._orthogonalStartDragHandle,"mouseenter",()=>OA.onMouseEnter(t))),this.orthogonalStartDragHandleDisposables.add(pt(this._orthogonalStartDragHandle,"mouseleave",()=>OA.onMouseLeave(t))))};this.orthogonalStartSashDisposables.add(t.onDidEnablementChange.event(n,this)),n(t.state)}this._orthogonalStartSash=t}}set orthogonalEndSash(t){if(this._orthogonalEndSash!==t){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),t){const n=r=>{this.orthogonalEndDragHandleDisposables.clear(),r!==0&&(this._orthogonalEndDragHandle=tn(this.el,ln(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Gn(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(pt(this._orthogonalEndDragHandle,"mouseenter",()=>OA.onMouseEnter(t))),this.orthogonalEndDragHandleDisposables.add(pt(this._orthogonalEndDragHandle,"mouseleave",()=>OA.onMouseLeave(t))))};this.orthogonalEndSashDisposables.add(t.onDidEnablementChange.event(n,this)),n(t.state)}this._orthogonalEndSash=t}}constructor(t,n,r){super(),this.hoverDelay=TOo,this.hoverDelayer=this._register(new A2(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new it),this._onDidStart=this._register(new it),this._onDidChange=this._register(new it),this._onDidReset=this._register(new it),this._onDidEnd=this._register(new it),this.orthogonalStartSashDisposables=this._register(new Pt),this.orthogonalStartDragHandleDisposables=this._register(new Pt),this.orthogonalEndSashDisposables=this._register(new Pt),this.orthogonalEndDragHandleDisposables=this._register(new Pt),this.linkedSash=void 0,this.el=tn(t,ln(".monaco-sash")),r.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${r.orthogonalEdge}`),Pr&&this.el.classList.add("mac"),this._register(pt(this.el,"mousedown",s=>this.onPointerStart(s,new hnt(t)))),this._register(pt(this.el,"dblclick",s=>this.onPointerDoublePress(s))),this._register(pt(this.el,"mouseenter",()=>OA.onMouseEnter(this))),this._register(pt(this.el,"mouseleave",()=>OA.onMouseLeave(this))),this._register(NA.addTarget(this.el)),this._register(pt(this.el,pa.Start,s=>this.onPointerStart(s,new Ant(this.el))));let o;this._register(pt(this.el,pa.Tap,s=>{if(o){clearTimeout(o),o=void 0,this.onPointerDoublePress(s);return}clearTimeout(o),o=setTimeout(()=>o=void 0,250)})),typeof r.size=="number"?(this.size=r.size,r.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=LOo,this._register(SOo.event(s=>{this.size=s,this.layout()}))),this._register(EOo.event(s=>this.hoverDelay=s)),this.layoutProvider=n,this.orthogonalStartSash=r.orthogonalStartSash,this.orthogonalEndSash=r.orthogonalEndSash,this.orientation=r.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",xOo),this.layout()}onPointerStart(t,n){Bo.stop(t);let r=!1;if(!t.__orthogonalSashEvent){const A=this.getOrthogonalSash(t);A&&(r=!0,t.__orthogonalSashEvent=!0,A.onPointerStart(t,new $me(n)))}if(this.linkedSash&&!t.__linkedSashEvent&&(t.__linkedSashEvent=!0,this.linkedSash.onPointerStart(t,new $me(n))),!this.state)return;const o=this.el.ownerDocument.getElementsByTagName("iframe");for(const A of o)A.classList.add(Ryt);const s=t.pageX,a=t.pageY,l=t.altKey,d={startX:s,currentX:s,startY:a,currentY:a,altKey:l};this.el.classList.add("active"),this._onDidStart.fire(d);const u=v2(this.el),h=()=>{let A="";r?A="all-scroll":this.orientation===1?this.state===1?A="s-resize":this.state===2?A="n-resize":A=Pr?"row-resize":"ns-resize":this.state===1?A="e-resize":this.state===2?A="w-resize":A=Pr?"col-resize":"ew-resize",u.textContent=`* { cursor: ${A} !important; }`},f=new Pt;h(),r||this.onDidEnablementChange.event(h,null,f);const g=A=>{Bo.stop(A,!1);const m={startX:s,currentX:A.pageX,startY:a,currentY:A.pageY,altKey:l};this._onDidChange.fire(m)},k=A=>{Bo.stop(A,!1),u.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),f.dispose();for(const m of o)m.classList.remove(Ryt)};n.onPointerMove(g,null,f),n.onPointerUp(k,null,f),f.add(n)}onPointerDoublePress(t){const n=this.getOrthogonalSash(t);n&&n._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(t,n=!1){t.el.classList.contains("active")?(t.hoverDelayer.cancel(),t.el.classList.add("hover")):t.hoverDelayer.trigger(()=>t.el.classList.add("hover"),t.hoverDelay).then(void 0,()=>{}),!n&&t.linkedSash&&OA.onMouseEnter(t.linkedSash,!0)}static onMouseLeave(t,n=!1){t.hoverDelayer.cancel(),t.el.classList.remove("hover"),!n&&t.linkedSash&&OA.onMouseLeave(t.linkedSash,!0)}clearSashHoverState(){OA.onMouseLeave(this)}layout(){if(this.orientation===0){const t=this.layoutProvider;this.el.style.left=t.getVerticalSashLeft(this)-this.size/2+"px",t.getVerticalSashTop&&(this.el.style.top=t.getVerticalSashTop(this)+"px"),t.getVerticalSashHeight&&(this.el.style.height=t.getVerticalSashHeight(this)+"px")}else{const t=this.layoutProvider;this.el.style.top=t.getHorizontalSashTop(this)-this.size/2+"px",t.getHorizontalSashLeft&&(this.el.style.left=t.getHorizontalSashLeft(this)+"px"),t.getHorizontalSashWidth&&(this.el.style.width=t.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(t){const n=t.initialTarget??t.target;if(!(!n||!oc(n))&&n.classList.contains("orthogonal-drag-handle"))return n.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}class DOo{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(t,n){this._options=t,this.dimensions=n,this.sashLeft=Qet(this,r=>{const o=this._sashRatio.read(r)??this._options.splitViewDefaultRatio.read(r);return this._computeSashLeft(o,r)},(r,o)=>{const s=this.dimensions.width.get();this._sashRatio.set(r/s,o)}),this._sashRatio=Bi(this,void 0)}_computeSashLeft(t,n){const r=this.dimensions.width.read(n),o=Math.floor(this._options.splitViewDefaultRatio.read(n)*r),s=this._options.enableSplitViewResizing.read(n)?Math.floor(t*r):o,a=100;return r<=a*2?o:sr-a?r-a:s}}class vFn extends ct{constructor(t,n,r,o,s,a){super(),this._domNode=t,this._dimensions=n,this._enabled=r,this._boundarySashes=o,this.sashLeft=s,this._resetSash=a,this._sash=this._register(new OA(this._domNode,{getVerticalSashTop:l=>0,getVerticalSashLeft:l=>this.sashLeft.get(),getVerticalSashHeight:l=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(l=>{this.sashLeft.set(this._startSashPosition+(l.currentX-l.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(xi(l=>{const d=this._boundarySashes.read(l);d&&(this._sash.orthogonalEndSash=d.bottom)})),this._register(xi(l=>{const d=this._enabled.read(l);this._sash.state=d?3:0,this.sashLeft.read(l),this._dimensions.height.read(l),this._sash.layout()}))}}const c2e=class c2e extends ct{constructor(){super(...arguments),this._id=++c2e.idCounter,this._onDidDispose=this._register(new it),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(t){return this._targetEditor.getVisibleColumnFromPosition(t)}getPosition(){return this._targetEditor.getPosition()}setPosition(t,n="api"){this._targetEditor.setPosition(t,n)}revealLine(t,n=0){this._targetEditor.revealLine(t,n)}revealLineInCenter(t,n=0){this._targetEditor.revealLineInCenter(t,n)}revealLineInCenterIfOutsideViewport(t,n=0){this._targetEditor.revealLineInCenterIfOutsideViewport(t,n)}revealLineNearTop(t,n=0){this._targetEditor.revealLineNearTop(t,n)}revealPosition(t,n=0){this._targetEditor.revealPosition(t,n)}revealPositionInCenter(t,n=0){this._targetEditor.revealPositionInCenter(t,n)}revealPositionInCenterIfOutsideViewport(t,n=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(t,n)}revealPositionNearTop(t,n=0){this._targetEditor.revealPositionNearTop(t,n)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(t,n="api"){this._targetEditor.setSelection(t,n)}setSelections(t,n="api"){this._targetEditor.setSelections(t,n)}revealLines(t,n,r=0){this._targetEditor.revealLines(t,n,r)}revealLinesInCenter(t,n,r=0){this._targetEditor.revealLinesInCenter(t,n,r)}revealLinesInCenterIfOutsideViewport(t,n,r=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(t,n,r)}revealLinesNearTop(t,n,r=0){this._targetEditor.revealLinesNearTop(t,n,r)}revealRange(t,n=0,r=!1,o=!0){this._targetEditor.revealRange(t,n,r,o)}revealRangeInCenter(t,n=0){this._targetEditor.revealRangeInCenter(t,n)}revealRangeInCenterIfOutsideViewport(t,n=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(t,n)}revealRangeNearTop(t,n=0){this._targetEditor.revealRangeNearTop(t,n)}revealRangeNearTopIfOutsideViewport(t,n=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(t,n)}revealRangeAtTop(t,n=0){this._targetEditor.revealRangeAtTop(t,n)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(t,n,r){this._targetEditor.trigger(t,n,r)}createDecorationsCollection(t){return this._targetEditor.createDecorationsCollection(t)}changeDecorations(t){return this._targetEditor.changeDecorations(t)}};c2e.idCounter=0;let NWe=c2e;const Eh={enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1};function QOo(e,t){return S6(e,(n,r)=>r??t(n))}var BOo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},FOo=function(e,t){return function(n,r){t(n,r,e)}};let UWe=class{get editorOptions(){return this._options}constructor(t,n){this._accessibilityService=n,this._diffEditorWidth=Bi(this,0),this._screenReaderMode=es(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=Wt(this,o=>this._options.read(o).renderSideBySide&&this._diffEditorWidth.read(o)<=this._options.read(o).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Wt(this,o=>this._options.read(o).renderOverviewRuler),this.renderSideBySide=Wt(this,o=>this.compactMode.read(o)&&this.shouldRenderInlineViewInSmartMode.read(o)?!1:this._options.read(o).renderSideBySide&&!(this._options.read(o).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(o)&&!this._screenReaderMode.read(o))),this.readOnly=Wt(this,o=>this._options.read(o).readOnly),this.shouldRenderOldRevertArrows=Wt(this,o=>!(!this._options.read(o).renderMarginRevertIcon||!this.renderSideBySide.read(o)||this.readOnly.read(o)||this.shouldRenderGutterMenu.read(o))),this.shouldRenderGutterMenu=Wt(this,o=>this._options.read(o).renderGutterMenu),this.renderIndicators=Wt(this,o=>this._options.read(o).renderIndicators),this.enableSplitViewResizing=Wt(this,o=>this._options.read(o).enableSplitViewResizing),this.splitViewDefaultRatio=Wt(this,o=>this._options.read(o).splitViewDefaultRatio),this.ignoreTrimWhitespace=Wt(this,o=>this._options.read(o).ignoreTrimWhitespace),this.maxComputationTimeMs=Wt(this,o=>this._options.read(o).maxComputationTime),this.showMoves=Wt(this,o=>this._options.read(o).experimental.showMoves&&this.renderSideBySide.read(o)),this.isInEmbeddedEditor=Wt(this,o=>this._options.read(o).isInEmbeddedEditor),this.diffWordWrap=Wt(this,o=>this._options.read(o).diffWordWrap),this.originalEditable=Wt(this,o=>this._options.read(o).originalEditable),this.diffCodeLens=Wt(this,o=>this._options.read(o).diffCodeLens),this.accessibilityVerbose=Wt(this,o=>this._options.read(o).accessibilityVerbose),this.diffAlgorithm=Wt(this,o=>this._options.read(o).diffAlgorithm),this.showEmptyDecorations=Wt(this,o=>this._options.read(o).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Wt(this,o=>this._options.read(o).onlyShowAccessibleDiffViewer),this.compactMode=Wt(this,o=>this._options.read(o).compactMode),this.trueInlineDiffRenderingEnabled=Wt(this,o=>this._options.read(o).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=Wt(this,o=>!this.renderSideBySide.read(o)&&this.trueInlineDiffRenderingEnabled.read(o)),this.hideUnchangedRegions=Wt(this,o=>this._options.read(o).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Wt(this,o=>this._options.read(o).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Wt(this,o=>this._options.read(o).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Wt(this,o=>this._options.read(o).hideUnchangedRegions.minimumLineCount),this._model=Bi(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,o=>QOo(this,s=>{const a=o==null?void 0:o.diff.read(s);return a?POo(a,this.trueInlineDiffRenderingEnabled.read(s)):void 0})).flatten().map(this,o=>!!o),this.inlineViewHideOriginalLineNumbers=this.compactMode;const r={...t,...Iyt(t,Eh)};this._options=Bi(this,r)}updateOptions(t){const n=Iyt(t,this._options.get()),r={...this._options.get(),...t,...n};this._options.set(r,void 0,{changedOptions:t})}setWidth(t){this._diffEditorWidth.set(t,void 0)}setModel(t){this._model.set(t,void 0)}};UWe=BOo([FOo(1,xh)],UWe);function POo(e,t){return e.mappings.every(n=>MOo(n.lineRangeMapping)||ROo(n.lineRangeMapping)||t&&dnt(n.lineRangeMapping))}function MOo(e){return e.original.length===0}function ROo(e){return e.modified.length===0}function Iyt(e,t){var n,r,o,s,a,l,d,u;return{enableSplitViewResizing:si(e.enableSplitViewResizing,t.enableSplitViewResizing),splitViewDefaultRatio:Yuo(e.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:si(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:si(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:uL(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:uL(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:si(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:si(e.renderIndicators,t.renderIndicators),originalEditable:si(e.originalEditable,t.originalEditable),diffCodeLens:si(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:si(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:Qa(e.diffWordWrap,t.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Qa(e.diffAlgorithm,t.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:si(e.accessibilityVerbose,t.accessibilityVerbose),experimental:{showMoves:si((n=e.experimental)==null?void 0:n.showMoves,t.experimental.showMoves),showEmptyDecorations:si((r=e.experimental)==null?void 0:r.showEmptyDecorations,t.experimental.showEmptyDecorations),useTrueInlineView:si((o=e.experimental)==null?void 0:o.useTrueInlineView,t.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:si(((s=e.hideUnchangedRegions)==null?void 0:s.enabled)??((a=e.experimental)==null?void 0:a.collapseUnchangedRegions),t.hideUnchangedRegions.enabled),contextLineCount:uL((l=e.hideUnchangedRegions)==null?void 0:l.contextLineCount,t.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:uL((d=e.hideUnchangedRegions)==null?void 0:d.minimumLineCount,t.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:uL((u=e.hideUnchangedRegions)==null?void 0:u.revealLineCount,t.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:si(e.isInEmbeddedEditor,t.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:si(e.onlyShowAccessibleDiffViewer,t.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:uL(e.renderSideBySideInlineBreakpoint,t.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:si(e.useInlineViewWhenSpaceIsLimited,t.useInlineViewWhenSpaceIsLimited),renderGutterMenu:si(e.renderGutterMenu,t.renderGutterMenu),compactMode:si(e.compactMode,t.compactMode)}}class IOo extends bP{constructor(t,n){super(),this._onDidChangeVisibility=this._register(new it),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=tn(t,ln(".monaco-dropdown")),this._label=tn(this._element,ln(".dropdown-label"));let r=n.labelRenderer;r||(r=s=>(s.textContent=n.label||"",null));for(const s of[cn.CLICK,cn.MOUSE_DOWN,pa.Tap])this._register(pt(this.element,s,a=>Bo.stop(a,!0)));for(const s of[cn.MOUSE_DOWN,pa.Tap])this._register(pt(this._label,s,a=>{Ret(a)&&a.button!==0||(this.visible?this.hide():this.show())}));this._register(pt(this._label,cn.KEY_DOWN,s=>{const a=new Hs(s);(a.equals(3)||a.equals(10))&&(Bo.stop(s,!0),this.visible?this.hide():this.show())}));const o=r(this._label);o&&this._register(o),this._register(NA.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class NOo extends IOo{constructor(t,n){super(t,n),this._options=n,this._actions=[],this.actions=n.actions||[]}set menuOptions(t){this._menuOptions=t}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(t){this._actions=t}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(t,n)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(t,n):void 0,getKeyBinding:t=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(t):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class e1e extends Vb{get onDidChangeVisibility(){return this._onDidChangeVisibility.event}constructor(t,n,r,o=Object.create(null)){super(null,t,o),this.actionItem=null,this._onDidChangeVisibility=this._register(new it),this.menuActionsOrProvider=n,this.contextMenuProvider=r,this.options=o,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(t){this.actionItem=t;const n=s=>(this.element=tn(s,ln("a.action-label")),this.renderLabel(this.element)),r=Array.isArray(this.menuActionsOrProvider),o={contextMenuProvider:this.contextMenuProvider,labelRenderer:n,menuAsChild:this.options.menuAsChild,actions:r?this.menuActionsOrProvider:void 0,actionProvider:r?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new NOo(t,o)),this._register(this.dropdownMenu.onDidChangeVisibility(s=>{var a;(a=this.element)==null||a.setAttribute("aria-expanded",`${s}`),this._onDidChangeVisibility.fire(s)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const s=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return s.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}renderLabel(t){let n=[];return typeof this.options.classNames=="string"?n=this.options.classNames.split(/\s+/g).filter(r=>!!r):this.options.classNames&&(n=this.options.classNames),n.find(r=>r==="icon")||n.push("codicon"),t.classList.add(...n),this._action.label&&this._register(E4().setupManagedHover(this.options.hoverDelegate??dC("mouse"),t,this._action.label)),null}getTooltip(){let t=null;return this.action.tooltip?t=this.action.tooltip:this.action.label&&(t=this.action.label),t??void 0}setActionContext(t){super.setActionContext(t),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=t:this.dropdownMenu.menuOptions={context:t})}show(){var t;(t=this.dropdownMenu)==null||t.show()}updateEnabled(){var n,r;const t=!this.action.enabled;(n=this.actionItem)==null||n.classList.toggle("disabled",t),(r=this.element)==null||r.classList.toggle("disabled",t)}}const Nyt=24;class UOo extends ct{get onDidChangeDropdownVisibility(){return this._onDidChangeDropdownVisibility.event}constructor(t,n,r={orientation:0}){if(super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new xao),this.originalPrimaryActions=[],this.originalSecondaryActions=[],this.hiddenActions=[],this.disposables=this._register(new Pt),r.hoverDelegate=r.hoverDelegate??this._register(mBn()),this.options=r,this.toggleMenuAction=this._register(new J$(()=>{var o;return(o=this.toggleMenuActionViewItem)==null?void 0:o.show()},r.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",t.appendChild(this.element),this.actionBar=this._register(new bm(this.element,{orientation:r.orientation,ariaLabel:r.ariaLabel,actionRunner:r.actionRunner,allowContextMenu:r.allowContextMenu,highlightToggledItems:r.highlightToggledItems,hoverDelegate:r.hoverDelegate,actionViewItemProvider:(o,s)=>{if(o.id===J$.ID)return this.toggleMenuActionViewItem=new e1e(o,{getActions:()=>this.toggleMenuAction.menuActions},n,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:mi.asClassNameArray(r.moreIcon??Jt.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(r.actionViewItemProvider){const a=r.actionViewItemProvider(o,s);if(a)return a}if(o instanceof mV){const a=new e1e(o,o.actions,n,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return a.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(a),this.disposables.add(this._onDidChangeDropdownVisibility.add(a.onDidChangeVisibility)),a}}})),this.options.responsive){this.element.classList.add("responsive");const o=new ResizeObserver(()=>{this.setToolbarMaxWidth(this.element.getBoundingClientRect().width)});o.observe(this.element),this._store.add(Gn(()=>o.disconnect()))}}set actionRunner(t){this.actionBar.actionRunner=t}get actionRunner(){return this.actionBar.actionRunner}set context(t){var n;this.actionBar.context=t,(n=this.toggleMenuActionViewItem)==null||n.setActionContext(t);for(const r of this.submenuActionViewItems)r.setActionContext(t)}getElement(){return this.element}getItemAction(t){return this.actionBar.getAction(t)}getItemWidth(t){return this.actionBar.getWidth(t)}setActions(t,n){this.clear(),this.originalPrimaryActions=t?t.slice(0):[],this.originalSecondaryActions=n?n.slice(0):[];const r=t?t.slice(0):[];this.hasSecondaryActions=!!(n&&n.length>0),this.hasSecondaryActions&&n&&(this.toggleMenuAction.menuActions=n.slice(0),r.push(this.toggleMenuAction)),r.length>0&&this.options.trailingSeparator&&r.push(new Ld),r.forEach(o=>{this.actionBar.push(o,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(o)})}),this.options.responsive&&(this.hiddenActions.length=0,this.setToolbarMaxWidth(this.element.getBoundingClientRect().width))}getKeybindingLabel(t){var r,o;const n=(o=(r=this.options).getKeyBinding)==null?void 0:o.call(r,t);return(n==null?void 0:n.getLabel())??void 0}getItemsWidthResponsive(){return this.actionBar.length()*Nyt}setToolbarMaxWidth(t){if(this.actionBar.isEmpty()||this.getItemsWidthResponsive()<=t&&this.hiddenActions.length===0)return;if(this.getItemsWidthResponsive()>t)for(;this.getItemsWidthResponsive()>t&&this.actionBar.length()>0;){const r=this.originalPrimaryActions.length-this.hiddenActions.length-1;if(r<0)break;const o=Math.min(Nyt,this.getItemWidth(r)),s=this.originalPrimaryActions[r];this.hiddenActions.unshift({action:s,size:o}),this.actionBar.pull(r),this.originalSecondaryActions.length===0&&this.hiddenActions.length===1&&this.actionBar.push(this.toggleMenuAction,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(this.toggleMenuAction)})}else for(;this.hiddenActions.length>0;){const r=this.hiddenActions.shift();if(this.getItemsWidthResponsive()+r.size>t){this.hiddenActions.unshift(r);break}this.actionBar.push(r.action,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(r.action),index:this.originalPrimaryActions.length-this.hiddenActions.length-1}),this.originalSecondaryActions.length===0&&this.hiddenActions.length===1&&(this.toggleMenuAction.menuActions=[],this.actionBar.pull(this.actionBar.length()-1))}const n=this.hiddenActions.map(r=>r.action);if(this.originalSecondaryActions.length>0||n.length>0){const r=this.originalSecondaryActions.slice(0);this.toggleMenuAction.menuActions=Ld.join(n,r)}}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const d2e=class d2e extends ak{constructor(t,n){n=n||j(17,"More Actions..."),super(d2e.ID,n,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=t}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(t){this._menuActions=t}};d2e.ID="toolbar.toggle.more";let J$=d2e;class QOe{constructor(t,n,r=n){this.modifierLabels=[null],this.modifierLabels[2]=t,this.modifierLabels[1]=n,this.modifierLabels[3]=r}toLabel(t,n,r){if(n.length===0)return null;const o=[];for(let s=0,a=n.length;sthis.onDidChangeItemsExternal(t)))}onDidChangeItemsExternal(t){var n,r;this._onDidChangeStorage.pause();try{(n=t.changed)==null||n.forEach((o,s)=>this.acceptExternal(s,o)),(r=t.deleted)==null||r.forEach(o=>this.acceptExternal(o,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(t,n){if(this.state===HD.Closed)return;let r=!1;Pv(n)?r=this.cache.delete(t):this.cache.get(t)!==n&&(this.cache.set(t,n),r=!0),r&&this._onDidChangeStorage.fire({key:t,external:!0})}get(t,n){const r=this.cache.get(t);return Pv(r)?n:r}getBoolean(t,n){const r=this.get(t);return Pv(r)?n:r==="true"}getNumber(t,n){const r=this.get(t);return Pv(r)?n:parseInt(r,10)}async set(t,n,r=!1){if(this.state===HD.Closed)return;if(Pv(n))return this.delete(t,r);const o=Vd(n)||Array.isArray(n)?i4o(n):String(n);if(this.cache.get(t)!==o)return this.cache.set(t,o),this.pendingInserts.set(t,o),this.pendingDeletes.delete(t),this._onDidChangeStorage.fire({key:t,external:r}),this.doFlush()}async delete(t,n=!1){if(!(this.state===HD.Closed||!this.cache.delete(t)))return this.pendingDeletes.has(t)||this.pendingDeletes.add(t),this.pendingInserts.delete(t),this._onDidChangeStorage.fire({key:t,external:n}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const t={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(t).finally(()=>{var n;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(n=this.whenFlushedCallbacks.pop())==null||n()})}async flush(t){if(!(this.state===HD.Closed||this.pendingClose))return this.doFlush(t)}async doFlush(t){return this.options.hint===sW.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),t)}async whenFlushed(){if(this.hasPending)return new Promise(t=>this.whenFlushedCallbacks.push(t))}},qB.DEFAULT_FLUSH_DELAY=100,qB);class x9e{constructor(){this.onDidChangeItemsExternal=un.None,this.items=new Map}async updateItems(t){var n,r;(n=t.insert)==null||n.forEach((o,s)=>this.items.set(s,o)),(r=t.delete)==null||r.forEach(o=>this.items.delete(o))}}const Dhe="__$__targetStorageMarker",jf=Lr("storageService");var J5;(function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"})(J5||(J5={}));function YOo(e){const t=e.get(Dhe);if(t)try{return JSON.parse(t)}catch{}return Object.create(null)}const u2e=class u2e extends ct{constructor(t={flushInterval:u2e.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new vP),this._onDidChangeTarget=this._register(new vP),this._onWillSaveState=this._register(new it),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new is),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new Ss(()=>this.doFlushWhenIdle(),t.flushInterval))}onDidChangeValue(t,n,r){return un.filter(this._onDidChangeValue.event,o=>o.scope===t&&(n===void 0||o.key===n),r)}doFlushWhenIdle(){this.runFlushWhenIdle.value=get(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}emitDidChangeValue(t,n){const{key:r,external:o}=n;if(r===Dhe){switch(t){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:t})}else this._onDidChangeValue.fire({scope:t,key:r,target:this.getKeyTargets(t)[r],external:o})}get(t,n,r){var o;return(o=this.getStorage(n))==null?void 0:o.get(t,r)}getBoolean(t,n,r){var o;return(o=this.getStorage(n))==null?void 0:o.getBoolean(t,r)}getNumber(t,n,r){var o;return(o=this.getStorage(n))==null?void 0:o.getNumber(t,r)}store(t,n,r,o,s=!1){if(Pv(n)){this.remove(t,r,s);return}this.withPausedEmitters(()=>{var a;this.updateKeyTarget(t,r,o),(a=this.getStorage(r))==null||a.set(t,n,s)})}remove(t,n,r=!1){this.withPausedEmitters(()=>{var o;this.updateKeyTarget(t,n,void 0),(o=this.getStorage(n))==null||o.delete(t,r)})}withPausedEmitters(t){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{t()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(t,n,r,o=!1){var a,l;const s=this.getKeyTargets(n);typeof r=="number"?s[t]!==r&&(s[t]=r,(a=this.getStorage(n))==null||a.set(Dhe,JSON.stringify(s),o)):typeof s[t]=="number"&&(delete s[t],(l=this.getStorage(n))==null||l.set(Dhe,JSON.stringify(s),o))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(t){switch(t){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(t){const n=this.getStorage(t);return n?YOo(n):Object.create(null)}async flush(t=J5.NONE){this._onWillSaveState.fire({reason:t});const n=this.getStorage(-1),r=this.getStorage(0),o=this.getStorage(1);switch(t){case J5.NONE:await r$.settled([(n==null?void 0:n.whenFlushed())??Promise.resolve(),(r==null?void 0:r.whenFlushed())??Promise.resolve(),(o==null?void 0:o.whenFlushed())??Promise.resolve()]);break;case J5.SHUTDOWN:await r$.settled([(n==null?void 0:n.flush(0))??Promise.resolve(),(r==null?void 0:r.flush(0))??Promise.resolve(),(o==null?void 0:o.flush(0))??Promise.resolve()]);break}}};u2e.DEFAULT_FLUSH_INTERVAL=60*1e3;let jWe=u2e;class XOo extends jWe{constructor(){super(),this.applicationStorage=this._register(new C9e(new x9e,{hint:sW.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new C9e(new x9e,{hint:sW.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new C9e(new x9e,{hint:sW.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(t=>this.emitDidChangeValue(1,t))),this._register(this.profileStorage.onDidChangeStorage(t=>this.emitDidChangeValue(0,t))),this._register(this.applicationStorage.onDidChangeStorage(t=>this.emitDidChangeValue(-1,t)))}getStorage(t){switch(t){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}shouldFlushWhenIdle(){return!1}}function qOo(e,t){const n={...t};for(const r in e){const o=e[r];n[r]=o!==void 0?sn(o):void 0}return n}const pFn={keybindingLabelBackground:sn(ifo),keybindingLabelForeground:sn(rfo),keybindingLabelBorder:sn(ofo),keybindingLabelBottomBorder:sn(sfo),keybindingLabelShadow:sn(mZ)},GOo={buttonForeground:sn(fOe),buttonSeparator:sn(zAo),buttonBackground:sn(CQ),buttonHoverBackground:sn(ZAo),buttonSecondaryForeground:sn(IDn),buttonSecondaryBackground:sn(mme),buttonSecondaryHoverBackground:sn(XAo),buttonBorder:sn(YAo)},KOo={progressBarBackground:sn(sAo)},t1e={inputActiveOptionBorder:sn(Jie),inputActiveOptionForeground:sn(_ie),inputActiveOptionBackground:sn(kZ)};sn($q),sn(qAo),sn(GAo),sn(KAo),sn(JAo),sn(_Ao),sn($Ao);const gnt={checkboxBackground:sn(utt),checkboxBorder:sn(efo),checkboxForeground:sn(htt),checkboxDisabledBackground:sn(tfo),checkboxDisabledForeground:sn(nfo)};sn(_0),sn(dOe),sn(mZ),sn(att),sn(xAo),sn(LAo),sn(SAo),sn(rAo);const n1e={inputBackground:sn(mje),inputForeground:sn(MDn),inputBorder:sn(RDn),inputValidationInfoBorder:sn(RAo),inputValidationInfoBackground:sn(PAo),inputValidationInfoForeground:sn(MAo),inputValidationWarningBorder:sn(UAo),inputValidationWarningBackground:sn(IAo),inputValidationWarningForeground:sn(NAo),inputValidationErrorBorder:sn(HAo),inputValidationErrorBackground:sn(jAo),inputValidationErrorForeground:sn(WAo)},JOo={listFilterWidgetBackground:sn(pfo),listFilterWidgetOutline:sn(bfo),listFilterWidgetNoMatchesOutline:sn(Ofo),listFilterWidgetShadow:sn(wfo),inputBoxStyles:n1e,toggleStyles:t1e},bFn={badgeBackground:sn(whe),badgeForeground:sn(oAo),badgeBorder:sn(uo)};sn(yAo),sn(wAo),sn(v3t),sn(v3t),sn(CAo);const yZ={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:sn(afo),listFocusForeground:sn(lfo),listFocusOutline:sn(cfo),listActiveSelectionBackground:sn(yP),listActiveSelectionForeground:sn(y$),listActiveSelectionIconForeground:sn(NDn),listFocusAndSelectionOutline:sn(dfo),listFocusAndSelectionBackground:sn(yP),listFocusAndSelectionForeground:sn(y$),listInactiveSelectionBackground:sn(ufo),listInactiveSelectionIconForeground:sn(Afo),listInactiveSelectionForeground:sn(hfo),listInactiveFocusBackground:sn(ffo),listInactiveFocusOutline:sn(gfo),listHoverBackground:sn(UDn),listHoverForeground:sn(jDn),listDropOverBackground:sn(mfo),listDropBetweenBackground:sn(kfo),listSelectionOutline:sn(qa),listHoverOutline:sn(qa),treeIndentGuidesStroke:sn(WDn),treeInactiveIndentGuidesStroke:sn(yfo),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:sn(cOe),tableColumnsBorder:sn(Cfo),tableOddRowsBackgroundColor:sn(xfo)};function zM(e){return qOo(e,yZ)}const _Oo={selectBackground:sn(AOe),selectListBackground:sn(VAo),selectForeground:sn(ctt),decoratorRightForeground:sn(HDn),selectBorder:sn(dtt),focusBorder:sn(Ry),listFocusBackground:sn(x$),listInactiveSelectionIconForeground:sn(Att),listFocusForeground:sn(C$),listFocusOutline:CDn(qa,Ut.transparent.toString()),listHoverBackground:sn(UDn),listHoverForeground:sn(jDn),listHoverOutline:sn(qa),selectListBorder:sn(ntt),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},$Oo={shadowColor:sn(mZ),borderColor:sn(Sfo),foregroundColor:sn(Tfo),backgroundColor:sn(Efo),selectionForegroundColor:sn(Dfo),selectionBackgroundColor:sn(Qfo),selectionBorderColor:sn(Bfo),separatorColor:sn(Ffo),scrollbarShadow:sn(cOe),scrollbarSliderBackground:sn(EDn),scrollbarSliderHoverBackground:sn(DDn),scrollbarSliderActiveBackground:sn(QDn)};function e3o(e,t){if(aC)return!1;const n=t3o(e,t),r=e.getValue("window");return(r==null?void 0:r.menuStyle)==="native"?!(!Pr&&!n):(r==null?void 0:r.menuStyle)==="custom"?!1:n}function t3o(e,t){return t||(t=OFn(e)),t==="native"}function OFn(e){if(aC)return"custom";const t=e.getValue("window");if(t){if(Pr&&t.nativeTabs===!0||Pr&&t.nativeFullScreen===!1)return"native";const o=t.titleBarStyle;if(o==="native"||o==="custom")return o}return"custom"}function n3o(e){if(aC||Pr||OFn(e)==="native")return"native";const t=e.getValue("window"),n=t==null?void 0:t.controlsStyle;return n==="custom"||n==="hidden"?n:"native"}var BOe=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},ug=function(e,t){return function(n,r){t(n,r,e)}};function i3o(e,t){const n=[];return r3o(e,n),n}function r3o(e,t,n){const r=jL.getInstance(),o=r.keyStatus.altKey||(wh||ym)&&r.keyStatus.shiftKey;CFn(e,t,o,s=>s==="navigation")}function wFn(e,t,n,r){const o={primary:[],secondary:[]};return yFn(e,o,t,n,r),o}function o3o(e,t,n,r){const o=[];return yFn(e,o,t,n,r),o}function yFn(e,t,n,r,o){CFn(e,t,!1,typeof n=="string"?a=>a===n:n,r,o)}function CFn(e,t,n,r=a=>a==="navigation",o=()=>!1,s=!1){let a,l;Array.isArray(t)?(a=t,l=t):(a=t.primary,l=t.secondary);const d=new Set;for(const[u,h]of e){let f;r(u)?(f=a,f.length>0&&s&&f.push(new Ld)):(f=l,f.length>0&&f.push(new Ld));for(let g of h){n&&(g=g instanceof lk&&g.alt?g.alt:g);const k=f.push(g);g instanceof mV&&d.add({group:u,action:g,index:k-1})}}for(const{group:u,action:h,index:f}of d){const g=r(u)?a:l,k=h.actions;o(h,u,g.length)&&g.splice(f,1,...k)}}let ZT=class extends QV{constructor(t,n,r,o,s,a,l,d){super(void 0,t,{icon:!!(t.class||t.item.icon),label:!t.class&&!t.item.icon,draggable:n==null?void 0:n.draggable,keybinding:n==null?void 0:n.keybinding,hoverDelegate:n==null?void 0:n.hoverDelegate,keybindingNotRenderedWithLabel:n==null?void 0:n.keybindingNotRenderedWithLabel}),this._options=n,this._keybindingService=r,this._notificationService=o,this._contextKeyService=s,this._themeService=a,this._contextMenuService=l,this._accessibilityService=d,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new is),this._altKey=jL.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(t){t.preventDefault(),t.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(n){this._notificationService.error(n)}}render(t){if(super.render(t),t.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let n=!1;const r=()=>{var s;const o=!!((s=this._menuItemAction.alt)!=null&&s.enabled)&&(!this._accessibilityService.isMotionReduced()||n)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&n);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(r)),this._register(pt(t,"mouseleave",o=>{n=!1,r()})),this._register(pt(t,"mouseenter",o=>{n=!0,r()})),r()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var s;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),n=t&&t.getLabel(),r=this._commandAction.tooltip||this._commandAction.label;let o=n?j(1644,"{0} ({1})",r,n):r;if(!this._wantsAltCommand&&((s=this._menuItemAction.alt)!=null&&s.enabled)){const a=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,l=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),d=l&&l.getLabel(),u=d?j(1645,"{0} ({1})",a,d):a;o=j(1646,`{0} [{1}] {2}`,o,fnt.modifierLabels[x1].altKey,u)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(t){this._itemClassDispose.value=void 0;const{element:n,label:r}=this;if(!n||!r)return;const o=this._commandAction.checked&&ZOo(t.toggled)&&t.toggled.icon?t.toggled.icon:t.icon;if(o)if(mi.isThemeIcon(o)){const s=mi.asClassNameArray(o);r.classList.add(...s),this._itemClassDispose.value=Gn(()=>{r.classList.remove(...s)})}else r.style.backgroundImage=_8(this._themeService.getColorTheme().type)?Uy(o.dark):Uy(o.light),r.classList.add("icon"),this._itemClassDispose.value=Jp(Gn(()=>{r.style.backgroundImage="",r.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};ZT=BOe([ug(2,Fo),ug(3,cc),ug(4,Fi),ug(5,Il),ug(6,Ek),ug(7,xh)],ZT);class mnt extends ZT{render(t){var n;this.options.label=!0,this.options.icon=!1,super.render(t),t.classList.add("text-only"),t.classList.toggle("use-comma",((n=this._options)==null?void 0:n.useComma)??!1)}updateLabel(){var n;const t=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!t)return super.updateLabel();if(this.label){const r=mnt._symbolPrintEnter(t);(n=this._options)!=null&&n.conversational?this.label.textContent=j(1647,"{1} to {0}",this._action.label,r):this.label.textContent=j(1648,"{0} ({1})",this._action.label,r)}}static _symbolPrintEnter(t){var n;return(n=t.getLabel())==null?void 0:n.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let WWe=class extends e1e{constructor(t,n,r,o,s){const a={...n,menuAsChild:(n==null?void 0:n.menuAsChild)??!1,classNames:(n==null?void 0:n.classNames)??(mi.isThemeIcon(t.item.icon)?mi.asClassName(t.item.icon):void 0),keybindingProvider:(n==null?void 0:n.keybindingProvider)??(l=>r.lookupKeybinding(l.id))};super(t,{getActions:()=>t.actions},o,a),this._keybindingService=r,this._contextMenuService=o,this._themeService=s}render(t){super.render(t),yo(this.element),t.classList.add("menu-entry");const n=this._action,{icon:r}=n.item;if(r&&!mi.isThemeIcon(r)){this.element.classList.add("icon");const o=()=>{this.element&&(this.element.style.backgroundImage=_8(this._themeService.getColorTheme().type)?Uy(r.dark):Uy(r.light))};o(),this._register(this._themeService.onDidColorThemeChange(()=>{o()}))}}};WWe=BOe([ug(2,Fo),ug(3,Ek),ug(4,Il)],WWe);let HWe=class extends Vb{constructor(t,n,r,o,s,a,l,d){super(null,t),this._keybindingService=r,this._notificationService=o,this._contextMenuService=s,this._menuService=a,this._instaService=l,this._storageService=d,this._defaultActionDisposables=this._register(new Pt),this._container=null,this._options=n,this._storageKey=`${t.item.submenu.id}_lastActionId`;let u;const h=n!=null&&n.togglePrimaryAction?d.get(this._storageKey,1):void 0;h&&(u=t.actions.find(g=>h===g.id)),u||(u=t.actions[0]),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(ZT,u,{keybinding:this._getDefaultActionKeybindingLabel(u)}));const f={keybindingProvider:g=>this._keybindingService.lookupKeybinding(g.id),...n,menuAsChild:(n==null?void 0:n.menuAsChild)??!0,classNames:(n==null?void 0:n.classNames)??["codicon","codicon-chevron-down"],actionRunner:(n==null?void 0:n.actionRunner)??this._register(new bP)};this._dropdown=this._register(new e1e(t,t.actions,this._contextMenuService,f)),n!=null&&n.togglePrimaryAction&&this._register(this._dropdown.actionRunner.onDidRun(g=>{g.action instanceof lk&&this.update(g.action)}))}update(t){var n;(n=this._options)!=null&&n.togglePrimaryAction&&this._storageService.store(this._storageKey,t.id,1,1),this._defaultActionDisposables.clear(),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(ZT,t,{keybinding:this._getDefaultActionKeybindingLabel(t)})),this._defaultAction.actionRunner=this._defaultActionDisposables.add(new class extends bP{async runAction(r,o){await r.run(void 0)}}),this._container&&this._defaultAction.render(Wbe(this._container,ln(".action-container")))}_getDefaultActionKeybindingLabel(t){var r;let n;if((r=this._options)!=null&&r.renderKeybindingWithDefaultActionLabel){const o=this._keybindingService.lookupKeybinding(t.id);o&&(n=`(${o.getLabel()})`)}return n}setActionContext(t){super.setActionContext(t),this._defaultAction.setActionContext(t),this._dropdown.setActionContext(t)}set actionRunner(t){super.actionRunner=t,this._defaultAction.actionRunner=t,this._dropdown.actionRunner=t}get actionRunner(){return super.actionRunner}render(t){this._container=t,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const n=ln(".action-container");this._defaultAction.render(tn(this._container,n)),this._register(pt(n,cn.KEY_DOWN,o=>{const s=new Hs(o);s.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())}));const r=ln(".dropdown-action-container");this._dropdown.render(tn(this._container,r)),this._register(pt(r,cn.KEY_DOWN,o=>{var a;const s=new Hs(o);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(a=this._defaultAction.element)==null||a.focus(),s.stopPropagation())}))}focus(t){t?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(t){t?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}};HWe=BOe([ug(2,Fo),ug(3,cc),ug(4,Ek),ug(5,y2),ug(6,$n),ug(7,jf)],HWe);let VWe=class extends Rbo{constructor(t,n,r){super(null,t,t.actions.map(o=>({text:o.id===Ld.ID?"─────────":o.label,isDisabled:!o.enabled})),0,n,_Oo,{ariaLabel:t.tooltip,optionsAsChildren:!0,useCustomDrawn:!e3o(r)}),this.select(Math.max(0,t.actions.findIndex(o=>o.checked)))}render(t){super.render(t),t.style.borderColor=sn(dtt)}runAction(t,n){const r=this.action.actions[n];r&&this.actionRunner.run(r)}};VWe=BOe([ug(1,Q6),ug(2,cr)],VWe);function knt(e,t,n){return t instanceof lk?e.createInstance(ZT,t,n):t instanceof xB?t.item.isSelection?e.createInstance(VWe,t):t.item.isSplitButton?e.createInstance(HWe,t,{...n,togglePrimaryAction:typeof t.item.isSplitButton!="boolean"?t.item.isSplitButton.togglePrimaryAction:!1}):e.createInstance(WWe,t,n):void 0}var FOe=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Oy=function(e,t){return function(n,r){t(n,r,e)}},ZN,rG;let zWe=class{constructor(t,n,r){this._commandService=t,this._keybindingService=n,this._hiddenStates=new ZWe(r)}createMenu(t,n,r){return new i1e(t,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...r},this._commandService,this._keybindingService,n)}getMenuActions(t,n,r){const o=new i1e(t,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...r},this._commandService,this._keybindingService,n),s=o.getActions(r);return o.dispose(),s}resetHiddenStates(t){this._hiddenStates.reset(t)}};zWe=FOe([Oy(0,Ca),Oy(1,Fo),Oy(2,jf)],zWe);var GB;let ZWe=(GB=class{constructor(t){this._storageService=t,this._disposables=new Pt,this._onDidChange=new it,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const n=t.get(ZN._key,0,"{}");this._data=JSON.parse(n)}catch{this._data=Object.create(null)}this._disposables.add(t.onDidChangeValue(0,ZN._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const n=t.get(ZN._key,0,"{}");this._data=JSON.parse(n)}catch(n){console.log("FAILED to read storage after UPDATE",n)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(t,n){return this._hiddenByDefaultCache.get(`${t.id}/${n}`)??!1}setDefaultState(t,n,r){this._hiddenByDefaultCache.set(`${t.id}/${n}`,r)}isHidden(t,n){var s;const r=this._isHiddenByDefault(t,n),o=((s=this._data[t.id])==null?void 0:s.includes(n))??!1;return r?!o:o}updateHidden(t,n,r){this._isHiddenByDefault(t,n)&&(r=!r);const s=this._data[t.id];if(r)s?s.indexOf(n)<0&&s.push(n):this._data[t.id]=[n];else if(s){const a=s.indexOf(n);a>=0&&Slo(s,a),s.length===0&&delete this._data[t.id]}this._persist()}reset(t){if(t===void 0)this._data=Object.create(null),this._persist();else{for(const{id:n}of t)this._data[n]&&delete this._data[n];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const t=JSON.stringify(this._data);this._storageService.store(ZN._key,t,0,0)}finally{this._ignoreChangeEvent=!1}}},ZN=GB,GB._key="menu.hiddenCommands",GB);ZWe=ZN=FOe([Oy(0,jf)],ZWe);class XK{constructor(t,n){this._id=t,this._collectContextKeysForSubmenus=n,this._menuGroups=[],this._allMenuIds=new Set,this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get allMenuIds(){return this._allMenuIds}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._allMenuIds.clear(),this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const t=this._sort(ju.getMenuItems(this._id));let n;for(const r of t){const o=r.group||"";(!n||n[0]!==o)&&(n=[o,[]],this._menuGroups.push(n)),n[1].push(r),this._collectContextKeysAndSubmenuIds(r)}this._allMenuIds.add(this._id)}_sort(t){return t}_collectContextKeysAndSubmenuIds(t){if(XK._fillInKbExprKeys(t.when,this._structureContextKeys),Zj(t)){if(t.command.precondition&&XK._fillInKbExprKeys(t.command.precondition,this._preconditionContextKeys),t.command.toggled){const n=t.command.toggled.condition||t.command.toggled;XK._fillInKbExprKeys(n,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&(ju.getMenuItems(t.submenu).forEach(this._collectContextKeysAndSubmenuIds,this),this._allMenuIds.add(t.submenu))}static _fillInKbExprKeys(t,n){if(t)for(const r of t.keys())n.add(r)}}let YWe=rG=class extends XK{constructor(t,n,r,o,s,a){super(t,r),this._hiddenStates=n,this._commandService=o,this._keybindingService=s,this._contextKeyService=a,this.refresh()}createActionGroups(t){const n=[];for(const r of this._menuGroups){const[o,s]=r;let a;for(const l of s)if(this._contextKeyService.contextMatchesRules(l.when)){const d=Zj(l);d&&this._hiddenStates.setDefaultState(this._id,l.command.id,!!l.isHiddenByDefault);const u=s3o(this._id,d?l.command:l,this._hiddenStates);if(d){const h=xFn(this._commandService,this._keybindingService,l.command.id,l.when);(a??(a=[])).push(new lk(l.command,l.alt,t,u,h,this._contextKeyService,this._commandService))}else{const h=new rG(l.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(t),f=Ld.join(...h.map(g=>g[1]));f.length>0&&(a??(a=[])).push(new xB(l,u,f))}}a&&a.length>0&&n.push([o,a])}return n}_sort(t){return t.sort(rG._compareMenuItems)}static _compareMenuItems(t,n){const r=t.group,o=n.group;if(r!==o){if(r){if(!o)return-1}else return 1;if(r==="navigation")return-1;if(o==="navigation")return 1;const l=r.localeCompare(o);if(l!==0)return l}const s=t.order||0,a=n.order||0;return sa?1:rG._compareTitles(Zj(t)?t.command.title:t.title,Zj(n)?n.command.title:n.title)}static _compareTitles(t,n){const r=typeof t=="string"?t:t.original,o=typeof n=="string"?n:n.original;return r.localeCompare(o)}};YWe=rG=FOe([Oy(3,Ca),Oy(4,Fo),Oy(5,Fi)],YWe);let i1e=class{constructor(t,n,r,o,s,a){this._disposables=new Pt,this._menuInfo=new YWe(t,n,r.emitEventsForSubmenuChanges,o,s,a);const l=new Ss(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},r.eventDebounceDelay);this._disposables.add(l),this._disposables.add(ju.onDidChangeMenu(f=>{for(const g of this._menuInfo.allMenuIds)if(f.has(g)){l.schedule();break}}));const d=this._disposables.add(new Pt),u=f=>{let g=!1,k=!1,A=!1;for(const m of f)if(g=g||m.isStructuralChange,k=k||m.isEnablementChange,A=A||m.isToggleChange,g&&k&&A)break;return{menu:this,isStructuralChange:g,isEnablementChange:k,isToggleChange:A}},h=()=>{d.add(a.onDidChangeContext(f=>{const g=f.affectsSome(this._menuInfo.structureContextKeys),k=f.affectsSome(this._menuInfo.preconditionContextKeys),A=f.affectsSome(this._menuInfo.toggledContextKeys);(g||k||A)&&this._onDidChange.fire({menu:this,isStructuralChange:g,isEnablementChange:k,isToggleChange:A})})),d.add(n.onDidChange(f=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new HEn({onWillAddFirstListener:h,onDidRemoveLastListener:d.clear.bind(d),delay:r.eventDebounceDelay,merge:u}),this.onDidChange=this._onDidChange.event}getActions(t){return this._menuInfo.createActionGroups(t)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};i1e=FOe([Oy(3,Ca),Oy(4,Fo),Oy(5,Fi)],i1e);function s3o(e,t,n){const r=zco(t)?t.submenu.id:t.id,o=typeof t.title=="string"?t.title:t.title.value,s=CB({id:`hide/${e.id}/${r}`,label:j(1651,"Hide '{0}'",o),run(){n.updateHidden(e,r,!0)}}),a=CB({id:`toggle/${e.id}/${r}`,label:o,get checked(){return!n.isHidden(e,r)},run(){n.updateHidden(e,r,!!this.checked)}});return{hide:s,toggle:a,get isHidden(){return!a.checked}}}function xFn(e,t,n,r=void 0,o=!0){return CB({id:`configureKeybinding/${n}`,label:j(1652,"Configure Keybinding"),enabled:o,run(){const a=!!!t.lookupKeybinding(n)&&r?r.serialize():void 0;e.executeCommand("workbench.action.openGlobalKeybindings",`@command:${n}`+(a?` +when:${a}`:""))}})}const LFn=Lr("IActionViewItemService");class a3o{constructor(){this._providers=new Map,this._onDidChange=new it,this.onDidChange=this._onDidChange.event}dispose(){this._onDidChange.dispose()}lookUp(t,n){return this._providers.get(this._makeKey(t,n))}_makeKey(t,n){return`${t.id}/${n instanceof Yn?n.id:n}`}}qr(LFn,a3o,1);var SFn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},N0=function(e,t){return function(n,r){t(n,r,e)}};let r1e=class extends UOo{constructor(t,n,r,o,s,a,l,d){super(t,s,{getKeyBinding:h=>a.lookupKeybinding(h.id)??void 0,...n,allowContextMenu:!0,skipTelemetry:typeof(n==null?void 0:n.telemetrySource)=="string"}),this._options=n,this._menuService=r,this._contextKeyService=o,this._contextMenuService=s,this._keybindingService=a,this._commandService=l,this._sessionDisposables=this._store.add(new Pt);const u=n==null?void 0:n.telemetrySource;u&&this._store.add(this.actionBar.onDidRun(h=>d.publicLog2("workbenchActionExecuted",{id:h.action.id,from:u})))}setActions(t,n=[],r){var h,f,g;this._sessionDisposables.clear();const o=t.slice(),s=n.slice(),a=[];let l=0;const d=[];let u=!1;if(((h=this._options)==null?void 0:h.hiddenItemStrategy)!==-1)for(let k=0;kv==null?void 0:v.id)),A=this._options.overflowBehavior.maxItems-k.size;let m=0;for(let v=0;v=A&&(o[v]=void 0,d[v]=p))}}OOt(o),OOt(d),super.setActions(o,Ld.join(d,s)),(a.length>0||o.length>0)&&this._sessionDisposables.add(pt(this.getElement(),"contextmenu",k=>{var b,O,w,y,C;const A=new $h(oi(this.getElement()),k),m=this.getItemAction(A.target);if(!m)return;A.preventDefault(),A.stopPropagation();const v=[];if(m instanceof lk&&m.menuKeybinding)v.push(m.menuKeybinding);else if(!(m instanceof xB||m instanceof J$)){const x=!!this._keybindingService.lookupKeybinding(m.id);v.push(xFn(this._commandService,this._keybindingService,m.id,void 0,x))}if(a.length>0){let x=!1;if(l===1&&((b=this._options)==null?void 0:b.hiddenItemStrategy)===0){x=!0;for(let L=0;Lthis._menuService.resetHiddenStates(r)}))),p.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>A,getActions:()=>p,menuId:(w=this._options)==null?void 0:w.contextMenu,menuActionOptions:{renderShortTitle:!0,...(y=this._options)==null?void 0:y.menuOptions},skipTelemetry:typeof((C=this._options)==null?void 0:C.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};r1e=SFn([N0(2,y2),N0(3,Fi),N0(4,Ek),N0(5,Fo),N0(6,Ca),N0(7,zA)],r1e);let _$=class extends r1e{get onDidChangeMenuItems(){return this._onDidChangeMenuItems.event}constructor(t,n,r,o,s,a,l,d,u,h,f){super(t,{resetMenu:n,...r,actionViewItemProvider:(A,m)=>{let v=h.lookUp(n,A instanceof xB?A.item.submenu.id:A.id);v||(v=r==null?void 0:r.actionViewItemProvider);const p=v==null?void 0:v(A,m,f,oi(t).vscodeWindowId);return p||knt(f,A,m)}},o,s,a,l,d,u),this._onDidChangeMenuItems=this._store.add(new it);const g=this._store.add(o.createMenu(n,s,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:r==null?void 0:r.eventDebounceDelay})),k=()=>{var v,p,b;const{primary:A,secondary:m}=wFn(g.getActions(r==null?void 0:r.menuOptions),(v=r==null?void 0:r.toolbarOptions)==null?void 0:v.primaryGroup,(p=r==null?void 0:r.toolbarOptions)==null?void 0:p.shouldInlineSubmenu,(b=r==null?void 0:r.toolbarOptions)==null?void 0:b.useSeparatorsInPrimaryActions);t.classList.toggle("has-no-actions",A.length===0&&m.length===0),super.setActions(A,m)};this._store.add(g.onDidChange(()=>{k(),this._onDidChangeMenuItems.fire(this)})),this._store.add(h.onDidChange(A=>{A===n&&k()})),k()}setActions(){throw new Ai("This toolbar is populated from a menu.")}};_$=SFn([N0(3,y2),N0(4,Fi),N0(5,Ek),N0(6,Fo),N0(7,Ca),N0(8,zA),N0(9,LFn),N0(10,$n)],_$);var l3o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Uyt=function(e,t){return function(n,r){t(n,r,e)}};const Lg=Lr("hoverService");let BV=class extends ct{get delay(){var t;return this.isInstantlyHovering()?0:(t=this.hoverOptions)!=null&&t.dynamicDelay?n=>{var r,o;return((o=(r=this.hoverOptions)==null?void 0:r.dynamicDelay)==null?void 0:o.call(r,n))??this._delay}:this._delay}constructor(t,n,r={},o,s){super(),this.placement=t,this.hoverOptions=n,this.overrideOptions=r,this.configurationService=o,this.hoverService=s,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new Pt),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(a=>{a.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(t,n){const r=typeof this.overrideOptions=="function"?this.overrideOptions(t,n):this.overrideOptions;this.hoverDisposables.clear();const o=oc(t.target)?[t.target]:t.target.targetElements;for(const a of o)this.hoverDisposables.add(Sc(a,"keydown",l=>{l.equals(9)&&this.hoverService.hideHover()}));const s=oc(t.content)?void 0:typeof t.content=="string"?t.content.toString():t.content.value;return this.hoverService.showInstantHover({...t,...r,persistence:{hideOnKeyDown:!0,...r.persistence},id:s,appearance:{...t.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...r.appearance}},n)}isInstantlyHovering(){var t;return!!((t=this.hoverOptions)!=null&&t.instantHover)&&Date.now()-this.lastHoverHideTimethis._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(a=>a===0),this.modelAttached=es(this,this._editor.onDidChangeModel,a=>this._editor.hasModel()),this.editorOnDidChangeViewZones=y1("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=y1("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=Uv("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const o=this._domNode.appendChild(wo("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),s=new ResizeObserver(()=>{ua(a=>{this.domNodeSizeChanged.trigger(a)})});s.observe(this._domNode),this._register(Gn(()=>s.disconnect())),this._register(xi(a=>{o.className=this.isScrollTopZero.read(a)?"":"scroll-decoration"})),this._register(xi(a=>this.render(a)))}dispose(){super.dispose(),Ou(this._domNode)}render(t){if(!this.modelAttached.read(t))return;this.domNodeSizeChanged.read(t),this.editorOnDidChangeViewZones.read(t),this.editorOnDidContentSizeChange.read(t);const n=this.scrollTop.read(t),r=this._editor.getVisibleRanges(),o=new Set(this.views.keys()),s=Jn.ofStartAndLength(0,this._domNode.clientHeight);if(!s.isEmpty)for(const a of r){const l=new Qi(a.startLineNumber,a.endLineNumber+1),d=this.itemProvider.getIntersectingGutterItems(l,t);ua(u=>{for(const h of d){if(!h.range.intersect(l))continue;o.delete(h.id);let f=this.views.get(h.id);if(f)f.item.set(h,u);else{const m=document.createElement("div");this._domNode.appendChild(m);const v=Bi("item",h),p=this.itemProvider.createView(v,m);f=new u3o(v,p,m),this.views.set(h.id,f)}const g=h.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(h.range.startLineNumber,!0)-n:h.range.startLineNumber>1?this._editor.getBottomForLineNumber(h.range.startLineNumber-1,!1)-n:0,A=(h.range.endLineNumberExclusive===1?Math.max(g,this._editor.getTopForLineNumber(h.range.startLineNumber,!1)-n):Math.max(g,this._editor.getBottomForLineNumber(h.range.endLineNumberExclusive-1,!0)-n))-g;f.domNode.style.top=`${g}px`,f.domNode.style.height=`${A}px`,f.gutterItemView.layout(Jn.ofStartAndLength(g,A),s)}})}for(const a of o){const l=this.views.get(a);l.gutterItemView.dispose(),l.domNode.remove(),this.views.delete(a)}}}class u3o{constructor(t,n,r){this.item=t,this.gutterItemView=n,this.domNode=r}}var EFn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Qhe=function(e,t){return function(n,r){t(n,r,e)}};const L9e=[],ice=35;let XWe=class extends ct{constructor(t,n,r,o,s,a,l,d,u){super(),this._diffModel=n,this._editors=r,this._options=o,this._sashLayout=s,this._boundarySashes=a,this._instantiationService=l,this._contextKeyService=d,this._menuService=u,this._menu=this._register(this._menuService.createMenu(Yn.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=es(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(f=>f.length>0),this._showSash=Wt(this,f=>this._options.renderSideBySide.read(f)&&this._hasActions.read(f)),this.width=Wt(this,f=>this._hasActions.read(f)?ice:0),this.elements=wo("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:ice+"px"}},[]),this._currentDiff=Wt(this,f=>{var m;const g=this._diffModel.read(f);if(!g)return;const k=(m=g.diff.read(f))==null?void 0:m.mappings,A=this._editors.modifiedCursor.read(f);if(A)return k==null?void 0:k.find(v=>v.lineRangeMapping.modified.contains(A.lineNumber))}),this._selectedDiffs=Wt(this,f=>{const g=this._diffModel.read(f),k=g==null?void 0:g.diff.read(f);if(!k)return L9e;const A=this._editors.modifiedSelections.read(f);if(A.every(b=>b.isEmpty()))return L9e;const m=new Nv(A.map(b=>Qi.fromRangeInclusive(b))),p=k.mappings.filter(b=>b.lineRangeMapping.innerChanges&&m.intersects(b.lineRangeMapping.modified)).map(b=>({mapping:b,rangeMappings:b.lineRangeMapping.innerChanges.filter(O=>A.some(w=>De.areIntersecting(O.modifiedRange,w)))}));return p.length===0||p.every(b=>b.rangeMappings.length===0)?L9e:p}),this._register(Nbo(t,this.elements.root)),this._register(pt(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(zT(this.elements.root,{display:this._hasActions.map(f=>f?"block":"none")})),bv(this,f=>this._showSash.read(f)?new vFn(t,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,Qet(this,k=>this._sashLayout.sashLeft.read(k)-ice,(k,A)=>this._sashLayout.sashLeft.set(k+ice,A)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store);const h=Wt(this,f=>{const g=this._diffModel.read(f);if(!g)return[];const k=g.diff.read(f);if(!k)return[];const A=this._selectedDiffs.read(f);if(A.length>0){const v=uk.fromRangeMappings(A.flatMap(p=>p.rangeMappings));return[new jyt(v,!0,Yn.DiffEditorSelectionToolbar,void 0,g.model.original.uri,g.model.modified.uri)]}const m=this._currentDiff.read(f);return k.mappings.map(v=>new jyt(v.lineRangeMapping.withInnerChangesFromLineRanges(),v.lineRangeMapping===(m==null?void 0:m.lineRangeMapping),Yn.DiffEditorHunkToolbar,void 0,g.model.original.uri,g.model.modified.uri))});this._register(new d3o(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(f,g)=>h.read(g),createView:(f,g)=>this._instantiationService.createInstance(qWe,f,g,this)})),this._register(pt(this.elements.gutter,cn.MOUSE_WHEEL,f=>{this._editors.modified.getOption(117).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(f)},{passive:!1}))}computeStagedValue(t){const n=t.innerChanges??[],r=new BP(this._editors.modifiedModel.get()),o=new BP(this._editors.original.getModel());return new Yp(n.map(l=>l.toTextEdit(r))).apply(o)}layout(t){this.elements.gutter.style.left=t+"px"}};XWe=EFn([Qhe(6,$n),Qhe(7,Fi),Qhe(8,y2)],XWe);class jyt{constructor(t,n,r,o,s,a){this.mapping=t,this.showAlways=n,this.menuId=r,this.rangeOverride=o,this.originalUri=s,this.modifiedUri=a}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let qWe=class extends ct{constructor(t,n,r,o){super(),this._item=t,this._elements=wo("div.gutterItem",{style:{height:"20px",width:"34px"}},[wo("div.background@background",{},[]),wo("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,a=>a.showAlways),this._menuId=this._item.map(this,a=>a.menuId),this._isSmall=Bi(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const s=this._register(o.createInstance(BV,"element",{instantHover:!0},{position:{hoverPosition:1}}));this._register(RU(n,this._elements.root)),this._register(xi(a=>{const l=this._showAlways.read(a);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",l),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(PA((a,l)=>{this._elements.buttons.replaceChildren();const d=l.add(o.createInstance(_$,this._elements.buttons,this._menuId.read(a),{orientation:1,hoverDelegate:s,toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(a)?1:3},hiddenItemStrategy:0,actionRunner:l.add(new TFn(()=>{const u=this._item.read(void 0),h=u.mapping;return{mapping:h,originalWithModifiedChanges:r.computeStagedValue(h),originalUri:u.originalUri,modifiedUri:u.modifiedUri}})),menuOptions:{shouldForwardArgs:!0}}));l.add(d.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(t,n){this._lastItemRange=t,this._lastViewRange=n;let r=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&t.length<30,void 0),r=this._elements.buttons.clientHeight;const o=t.length/2-r/2,s=r;let a=t.start+o;const l=Jn.tryCreate(s,n.endExclusive-s-r),d=Jn.tryCreate(t.start+s,t.endExclusive-r-s);d&&l&&d.start=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},A3o=function(e,t){return function(n,r){t(n,r,e)}},GWe,sT;let o1e=(sT=class extends ct{static setBreadcrumbsSourceFactory(t){this._breadcrumbsSourceFactory.set(t,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(t,n,r,o){super(),this._editors=t,this._diffModel=n,this._options=r,this._instantiationService=o,this._modifiedOutlineSource=bv(this,d=>{const u=this._editors.modifiedModel.read(d),h=GWe._breadcrumbsSourceFactory.read(d);return!u||!h?void 0:h(u,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(d=>{if(d.reason===1)return;const u=this._diffModel.get();ua(h=>{for(const f of this._editors.original.getSelections()||[])u==null||u.ensureOriginalLineIsVisible(f.getStartPosition().lineNumber,0,h),u==null||u.ensureOriginalLineIsVisible(f.getEndPosition().lineNumber,0,h)})})),this._register(this._editors.modified.onDidChangeCursorPosition(d=>{if(d.reason===1)return;const u=this._diffModel.get();ua(h=>{for(const f of this._editors.modified.getSelections()||[])u==null||u.ensureModifiedLineIsVisible(f.getStartPosition().lineNumber,0,h),u==null||u.ensureModifiedLineIsVisible(f.getEndPosition().lineNumber,0,h)})}));const s=this._diffModel.map((d,u)=>{var f;const h=(d==null?void 0:d.unchangedRegions.read(u))??[];return h.length===1&&h[0].modifiedLineNumber===1&&h[0].lineCount===((f=this._editors.modifiedModel.read(u))==null?void 0:f.getLineCount())?[]:h});this.viewZones=Wt(this,d=>{const u=this._modifiedOutlineSource.read(d);if(!u)return{origViewZones:[],modViewZones:[]};const h=[],f=[],g=this._options.renderSideBySide.read(d),k=this._options.compactMode.read(d),A=s.read(d);for(let m=0;mv.getHiddenOriginalRange(O).startLineNumber-1),b=new IU(p,12);h.push(b),d.store.add(new Wyt(this._editors.original,b,v,!g))}{const p=Wt(this,O=>v.getHiddenModifiedRange(O).startLineNumber-1),b=new IU(p,12);f.push(b),d.store.add(new Wyt(this._editors.modified,b,v))}}else{{const p=Wt(this,O=>v.getHiddenOriginalRange(O).startLineNumber-1),b=new IU(p,24);h.push(b),d.store.add(new Hyt(this._editors.original,b,v,v.originalUnchangedRange,!g,u,O=>this._diffModel.get().ensureModifiedLineIsVisible(O,2,void 0),this._options))}{const p=Wt(this,O=>v.getHiddenModifiedRange(O).startLineNumber-1),b=new IU(p,24);f.push(b),d.store.add(new Hyt(this._editors.modified,b,v,v.modifiedUnchangedRange,!1,u,O=>this._diffModel.get().ensureModifiedLineIsVisible(O,2,void 0),this._options))}}}return{origViewZones:h,modViewZones:f}});const a={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},l={description:"Fold Unchanged",glyphMarginHoverMessage:new xA(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(j(124,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+mi.asClassName(Jt.fold),zIndex:10001};this._register(Yme(this._editors.original,Wt(this,d=>{const u=s.read(d),h=u.map(f=>({range:f.originalUnchangedRange.toInclusiveRange(),options:a}));for(const f of u)f.shouldHideControls(d)&&h.push({range:De.fromPositions(new tt(f.originalLineNumber,1)),options:l});return h}))),this._register(Yme(this._editors.modified,Wt(this,d=>{const u=s.read(d),h=u.map(f=>({range:f.modifiedUnchangedRange.toInclusiveRange(),options:a}));for(const f of u)f.shouldHideControls(d)&&h.push({range:Qi.ofLength(f.modifiedLineNumber,1).toInclusiveRange(),options:l});return h}))),this._register(xi(d=>{const u=s.read(d);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(u.map(h=>h.getHiddenOriginalRange(d).toInclusiveRange()).filter(Uu)),this._editors.modified.setHiddenAreas(u.map(h=>h.getHiddenModifiedRange(d).toInclusiveRange()).filter(Uu))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(d=>{var u;if(!d.event.rightButton&&d.target.position&&((u=d.target.element)!=null&&u.className.includes("fold-unchanged"))){const h=d.target.position.lineNumber,f=this._diffModel.get();if(!f)return;const g=f.unchangedRegions.get().find(k=>k.modifiedUnchangedRange.contains(h));if(!g)return;g.collapseAll(void 0),d.event.stopPropagation(),d.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(d=>{var u;if(!d.event.rightButton&&d.target.position&&((u=d.target.element)!=null&&u.className.includes("fold-unchanged"))){const h=d.target.position.lineNumber,f=this._diffModel.get();if(!f)return;const g=f.unchangedRegions.get().find(k=>k.originalUnchangedRange.contains(h));if(!g)return;g.collapseAll(void 0),d.event.stopPropagation(),d.event.preventDefault()}}))}},GWe=sT,sT._breadcrumbsSourceFactory=Bi(sT,()=>({dispose(){},getBreadcrumbItems(t,n){return[]}})),sT);o1e=GWe=h3o([A3o(3,$n)],o1e);class Wyt extends snt{constructor(t,n,r,o=!1){const s=wo("div.diff-hidden-lines-widget");super(t,n,s.root),this._unchangedRegion=r,this._hide=o,this._nodes=wo("div.diff-hidden-lines-compact",[wo("div.line-left",[]),wo("div.text@text",[]),wo("div.line-right",[])]),s.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(xi(a=>{if(!this._hide){const l=this._unchangedRegion.getHiddenModifiedRange(a).length,d=j(125,"{0} hidden lines",l);this._nodes.text.innerText=d}}))}}class Hyt extends snt{constructor(t,n,r,o,s,a,l,d){const u=wo("div.diff-hidden-lines-widget");super(t,n,u.root),this._editor=t,this._unchangedRegion=r,this._unchangedRegionRange=o,this._hide=s,this._modifiedOutlineSource=a,this._revealModifiedHiddenLine=l,this._options=d,this._nodes=wo("div.diff-hidden-lines",[wo("div.top@top",{title:j(126,"Click or drag to show more above")}),wo("div.center@content",{style:{display:"flex"}},[wo("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[ln("a",{title:j(127,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...K5("$(unfold)"))]),wo("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),wo("div.bottom@bottom",{title:j(128,"Click or drag to show more below"),role:"button"})]),u.root.appendChild(this._nodes.root),this._hide?Ou(this._nodes.first):this._register(zT(this._nodes.first,{width:ml(this._editor).layoutInfoContentLeft})),this._register(xi(f=>{const g=this._unchangedRegion.visibleLineCountTop.read(f)+this._unchangedRegion.visibleLineCountBottom.read(f)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!g),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(f)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(f)>0),this._nodes.top.classList.toggle("canMoveBottom",!g);const k=this._unchangedRegion.isDragged.read(f),A=this._editor.getDomNode();A&&(A.classList.toggle("draggingUnchangedRegion",!!k),k==="top"?(A.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(f)>0),A.classList.toggle("canMoveBottom",!g)):k==="bottom"?(A.classList.toggle("canMoveTop",!g),A.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(f)>0)):(A.classList.toggle("canMoveTop",!1),A.classList.toggle("canMoveBottom",!1)))}));const h=this._editor;this._register(pt(this._nodes.top,"mousedown",f=>{if(f.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),f.preventDefault();const g=f.clientY;let k=!1;const A=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const m=oi(this._nodes.top),v=pt(m,"mousemove",b=>{const w=b.clientY-g;k=k||Math.abs(w)>2;const y=Math.round(w/h.getOption(75)),C=Math.max(0,Math.min(A+y,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(C,void 0)}),p=pt(m,"mouseup",b=>{k||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),v.dispose(),p.dispose()})})),this._register(pt(this._nodes.bottom,"mousedown",f=>{if(f.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),f.preventDefault();const g=f.clientY;let k=!1;const A=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const m=oi(this._nodes.bottom),v=pt(m,"mousemove",b=>{const w=b.clientY-g;k=k||Math.abs(w)>2;const y=Math.round(w/h.getOption(75)),C=Math.max(0,Math.min(A-y,this._unchangedRegion.getMaxVisibleLineCountBottom())),x=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(C,void 0);const L=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(L-x))}),p=pt(m,"mouseup",b=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!k){const O=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const w=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(w-O))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),p.dispose()})})),this._register(xi(f=>{const g=[];if(!this._hide){const k=r.getHiddenModifiedRange(f).length,A=j(129,"{0} hidden lines",k),m=ln("span",{title:j(130,"Double click to unfold")},A);m.addEventListener("dblclick",b=>{b.button===0&&(b.preventDefault(),this._unchangedRegion.showAll(void 0))}),g.push(m);const v=this._unchangedRegion.getHiddenModifiedRange(f),p=this._modifiedOutlineSource.getBreadcrumbItems(v,f);if(p.length>0){g.push(ln("span",void 0,"  |  "));for(let b=0;b{this._revealModifiedHiddenLine(O.startLineNumber)}}}}Ou(this._nodes.others,...g)}))}}const S9e=[];class f3o extends ct{constructor(t,n,r,o){super(),this._editors=t,this._diffModel=n,this._options=r,this._widget=o,this._selectedDiffs=Wt(this,s=>{const a=this._diffModel.read(s),l=a==null?void 0:a.diff.read(s);if(!l)return S9e;const d=this._editors.modifiedSelections.read(s);if(d.every(g=>g.isEmpty()))return S9e;const u=new Nv(d.map(g=>Qi.fromRangeInclusive(g))),f=l.mappings.filter(g=>g.lineRangeMapping.innerChanges&&u.intersects(g.lineRangeMapping.modified)).map(g=>({mapping:g,rangeMappings:g.lineRangeMapping.innerChanges.filter(k=>d.some(A=>De.areIntersecting(k.modifiedRange,A)))}));return f.length===0||f.every(g=>g.rangeMappings.length===0)?S9e:f}),this._register(PA((s,a)=>{if(!this._options.shouldRenderOldRevertArrows.read(s))return;const l=this._diffModel.read(s),d=l==null?void 0:l.diff.read(s);if(!l||!d||l.movedTextToCompare.read(s))return;const u=[],h=this._selectedDiffs.read(s),f=new Set(h.map(g=>g.mapping));if(h.length>0){const g=this._editors.modifiedSelections.read(s),k=a.add(new s1e(g[g.length-1].positionLineNumber,this._widget,h.flatMap(A=>A.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(k),u.push(k)}for(const g of d.mappings)if(!f.has(g)&&!g.lineRangeMapping.modified.isEmpty&&g.lineRangeMapping.innerChanges){const k=a.add(new s1e(g.lineRangeMapping.modified.startLineNumber,this._widget,g.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(k),u.push(k)}a.add(Gn(()=>{for(const g of u)this._editors.modified.removeGlyphMarginWidget(g)}))}))}}const h2e=class h2e extends ct{getId(){return this._id}constructor(t,n,r,o){super(),this._lineNumber=t,this._widget=n,this._diffs=r,this._revertSelection=o,this._id=`revertButton${h2e.counter++}`,this._domNode=wo("div.revertButton",{title:this._revertSelection?j(135,"Revert Selected Changes"):j(136,"Revert Change")},[TO(Jt.arrowRight)]).root,this._register(pt(this._domNode,cn.MOUSE_DOWN,s=>{s.button!==2&&(s.stopPropagation(),s.preventDefault())})),this._register(pt(this._domNode,cn.MOUSE_UP,s=>{s.stopPropagation(),s.preventDefault()})),this._register(pt(this._domNode,cn.CLICK,s=>{this._diffs instanceof Lf?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),s.stopPropagation(),s.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:CO.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};h2e.counter=0;let s1e=h2e;var g3o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},HX=function(e,t){return function(n,r){t(n,r,e)}};let jy=class extends NWe{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(t,n,r,o,s,a,l,d){super(),this._domElement=t,this._parentContextKeyService=o,this._parentInstantiationService=s,this._codeEditorService=a,this._accessibilitySignalService=l,this._editorProgressService=d,this.elements=wo("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[wo("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),wo("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),wo("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(Pet(this,void 0)),this._diffModel=Wt(this,w=>{var y;return(y=this._diffModelSrc.read(w))==null?void 0:y.object}),this.onDidChangeModel=un.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new OZ([Fi,this._contextKeyService]))),this._boundarySashes=Bi(this,void 0),this._accessibleDiffViewerShouldBeVisible=Bi(this,!1),this._accessibleDiffViewerVisible=Wt(this,w=>this._options.onlyShowAccessibleDiffViewer.read(w)?!0:this._accessibleDiffViewerShouldBeVisible.read(w)),this._movedBlocksLinesPart=Bi(this,void 0),this._layoutInfo=Wt(this,w=>{var R,N;const y=this._rootSizeObserver.width.read(w),C=this._rootSizeObserver.height.read(w);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=C+"px";const x=this._sash.read(w),L=this._gutter.read(w),S=(L==null?void 0:L.width.read(w))??0,E=((R=this._overviewRulerPart.read(w))==null?void 0:R.width)??0;let Q,T,M,B,P;if(!!x){const I=x.sashLeft.read(w),W=((N=this._movedBlocksLinesPart.read(w))==null?void 0:N.width.read(w))??0;Q=0,T=I-S-W,P=I-S,M=I,B=y-M-E}else{P=0;const I=this._options.inlineViewHideOriginalLineNumbers.read(w);Q=S,I?T=0:T=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(w)),M=S+T,B=y-M-E}return this.elements.original.style.left=Q+"px",this.elements.original.style.width=T+"px",this._editors.original.layout({width:T,height:C},!0),L==null||L.layout(P),this.elements.modified.style.left=M+"px",this.elements.modified.style.width=B+"px",this._editors.modified.layout({width:B,height:C},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((w,y)=>w==null?void 0:w.diff.read(y)),this.onDidUpdateDiff=un.fromObservableLight(this._diffValue),this._codeEditorService.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Gn(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new lFn(this.elements.root,n.dimension)),this._rootSizeObserver.setAutomaticLayout(n.automaticLayout??!1),this._options=this._instantiationService.createInstance(UWe,n),this._register(xi(w=>{this._options.setWidth(this._rootSizeObserver.width.read(w))})),this._contextKeyService.createKey(Ze.isEmbeddedDiffEditor.key,!1),this._register(W3(Ze.isEmbeddedDiffEditor,this._contextKeyService,w=>this._options.isInEmbeddedEditor.read(w))),this._register(W3(Ze.comparingMovedCode,this._contextKeyService,w=>{var y;return!!((y=this._diffModel.read(w))!=null&&y.movedTextToCompare.read(w))})),this._register(W3(Ze.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,w=>this._options.couldShowInlineViewBecauseOfSize.read(w))),this._register(W3(Ze.diffEditorInlineMode,this._contextKeyService,w=>!this._options.renderSideBySide.read(w))),this._register(W3(Ze.hasChanges,this._contextKeyService,w=>{var y,C;return(((C=(y=this._diffModel.read(w))==null?void 0:y.diff.read(w))==null?void 0:C.mappings.length)??0)>0})),this._editors=this._register(this._instantiationService.createInstance(IWe,this.elements.original,this.elements.modified,this._options,r,(w,y,C,x)=>this._createInnerEditor(w,y,C,x))),this._register(W3(Ze.diffEditorOriginalWritable,this._contextKeyService,w=>this._options.originalEditable.read(w))),this._register(W3(Ze.diffEditorModifiedWritable,this._contextKeyService,w=>!this._options.readOnly.read(w))),this._register(W3(Ze.diffEditorOriginalUri,this._contextKeyService,w=>{var y;return((y=this._diffModel.read(w))==null?void 0:y.model.original.uri.toString())??""})),this._register(W3(Ze.diffEditorModifiedUri,this._contextKeyService,w=>{var y;return((y=this._diffModel.read(w))==null?void 0:y.model.modified.uri.toString())??""})),this._overviewRulerPart=bv(this,w=>this._options.renderOverviewRuler.read(w)?this._instantiationService.createInstance(Tx(K$),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(y=>y.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const u={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((w,y)=>{var C;return w-(((C=this._overviewRulerPart.read(y))==null?void 0:C.width)??0)})};this._sashLayout=new DOo(this._options,u),this._sash=bv(this,w=>{const y=this._options.renderSideBySide.read(w);return this.elements.root.classList.toggle("side-by-side",y),y?new vFn(this.elements.root,u,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const h=bv(this,w=>this._instantiationService.createInstance(Tx(o1e),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);bv(this,w=>this._instantiationService.createInstance(Tx(OOo),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const f=new Set,g=new Set;let k=!1;const A=bv(this,w=>this._instantiationService.createInstance(Tx(MWe),oi(this._domElement),this._editors,this._diffModel,this._options,this,()=>k||h.read(void 0).isUpdatingHiddenAreas,f,g)).recomputeInitiallyAndOnChange(this._store),m=Wt(this,w=>{const y=A.read(w).viewZones.read(w).orig,C=h.read(w).viewZones.read(w).origViewZones;return y.concat(C)}),v=Wt(this,w=>{const y=A.read(w).viewZones.read(w).mod,C=h.read(w).viewZones.read(w).modViewZones;return y.concat(C)});this._register(Xme(this._editors.original,m,w=>{k=w},f));let p;this._register(Xme(this._editors.modified,v,w=>{k=w,k?p=SO.capture(this._editors.modified):(p==null||p.restore(this._editors.modified),p=void 0)},g)),this._accessibleDiffViewer=bv(this,w=>this._instantiationService.createInstance(Tx(DQ),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(y,C)=>this._accessibleDiffViewerShouldBeVisible.set(y,C),this._options.onlyShowAccessibleDiffViewer.map(y=>!y),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((y,C)=>{var x;return(x=y==null?void 0:y.diff.read(C))==null?void 0:x.mappings.map(L=>L.lineRangeMapping)}),new oOo(this._editors))).recomputeInitiallyAndOnChange(this._store);const b=this._accessibleDiffViewerVisible.map(w=>w?"hidden":"visible");this._register(zT(this.elements.modified,{visibility:b})),this._register(zT(this.elements.original,{visibility:b})),this._createDiffEditorContributions(),this._codeEditorService.addDiffEditor(this),this._register(Gn(()=>{this._codeEditorService.removeDiffEditor(this)})),this._gutter=bv(this,w=>this._options.shouldRenderGutterMenu.read(w)?this._instantiationService.createInstance(Tx(XWe),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(gV(this._layoutInfo)),bv(this,w=>new(Tx(oW))(this.elements.root,this._diffModel,this._layoutInfo.map(y=>y.originalEditor),this._layoutInfo.map(y=>y.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,w=>{this._movedBlocksLinesPart.set(w,void 0)}),this._register(un.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,w=>this._handleCursorPositionChange(w,!0))),this._register(un.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,w=>this._handleCursorPositionChange(w,!1)));const O=this._diffModel.map(this,(w,y)=>{if(w)return w.diff.read(y)===void 0&&!w.isDiffUpToDate.read(y)});this._register(PA((w,y)=>{if(O.read(w)===!0){const C=this._editorProgressService.show(!0,1e3);y.add(Gn(()=>C.done()))}})),this._register(PA((w,y)=>{y.add(new(Tx(f3o))(this._editors,this._diffModel,this._options,this))})),this._register(PA((w,y)=>{const C=this._diffModel.read(w);if(C)for(const x of[C.model.original,C.model.modified])y.add(x.onWillDispose(L=>{Yi(new Ai("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(xi(w=>{this._options.setModel(this._diffModel.read(w))}))}_createInnerEditor(t,n,r,o){return t.createInstance(TP,n,r,o)}_createDiffEditorContributions(){const t=Yj.getDiffEditorContributions();for(const n of t)try{this._register(this._instantiationService.createInstance(n.ctor,this))}catch(r){Yi(r)}}get _targetEditor(){return this._editors.modified}getEditorType(){return rre.IDiffEditor}layout(t){this._rootSizeObserver.observe(t)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var r;const t=this._editors.original.saveViewState(),n=this._editors.modified.saveViewState();return{original:t,modified:n,modelState:(r=this._diffModel.get())==null?void 0:r.serializeState()}}restoreViewState(t){var n;if(t&&t.original&&t.modified){const r=t;this._editors.original.restoreViewState(r.original),this._editors.modified.restoreViewState(r.modified),r.modelState&&((n=this._diffModel.get())==null||n.restoreSerializedState(r.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(t){return this._instantiationService.createInstance(PWe,t,this._options)}getModel(){var t;return((t=this._diffModel.get())==null?void 0:t.model)??null}setModel(t){const n=t?"model"in t?qme.create(t).createNewRef(this):qme.create(this.createViewModel(t),this):null;this.setDiffModel(n)}setDiffModel(t,n){const r=this._diffModel.get();!t&&r&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==(t==null?void 0:t.object)&&fV(n,o=>{var l;const s=t==null?void 0:t.object;es.batchEventsGlobally(o,()=>{this._editors.original.setModel(s?s.model.original:null),this._editors.modified.setModel(s?s.model.modified:null)});const a=(l=this._diffModelSrc.get())==null?void 0:l.createNewRef(this);this._diffModelSrc.set(t==null?void 0:t.createNewRef(this),o),setTimeout(()=>{a==null||a.dispose()},0)})}updateOptions(t){this._options.updateOptions(t)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var n;const t=(n=this._diffModel.get())==null?void 0:n.diff.get();return t?m3o(t):null}getDiffComputationResult(){var n;const t=(n=this._diffModel.get())==null?void 0:n.diff.get();return t?{changes:this.getLineChanges(),changes2:t.mappings.map(r=>r.lineRangeMapping),identical:t.identical,quitEarly:t.quitEarly}:null}revert(t){const n=this._diffModel.get();!n||!n.isDiffUpToDate.get()||(this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",[{range:t.modified.toExclusiveRange(),text:n.model.original.getValueInRange(t.original.toExclusiveRange())}]),this._editors.modified.pushUndoStop())}revertRangeMappings(t){const n=this._diffModel.get();if(!n||!n.isDiffUpToDate.get())return;const r=t.map(o=>({range:o.modifiedRange,text:n.model.original.getValueInRange(o.originalRange)}));this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",r),this._editors.modified.pushUndoStop()}revertFocusedRangeMappings(){var d,u;const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const n=(u=(d=this._diffModel.get())==null?void 0:d.diff.get())==null?void 0:u.mappings;if(!n||n.length===0)return;const r=this._editors.modified;if(!r.hasTextFocus())return;const o=r.getPosition().lineNumber,s=r.getSelection(),a=Qi.fromRange(s||new De(o,0,o,0)),l=n.filter(h=>h.lineRangeMapping.modified.intersect(a));r.pushUndoStop(),r.executeEdits("diffEditor",l.map(h=>({range:h.lineRangeMapping.modified.toExclusiveRange(),text:t.model.original.getValueInRange(h.lineRangeMapping.original.toExclusiveRange())}))),r.pushUndoStop()}_goTo(t){this._editors.modified.setPosition(new tt(t.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(t.lineRangeMapping.modified.toExclusiveRange())}goToDiff(t){var s,a;const n=(a=(s=this._diffModel.get())==null?void 0:s.diff.get())==null?void 0:a.mappings;if(!n||n.length===0)return;const r=this._editors.modified.getPosition().lineNumber;let o;t==="next"?this._editors.modified.getModel().getLineCount()===r?o=n[0]:o=n.find(d=>d.lineRangeMapping.modified.startLineNumber>r)??n[0]:o=S$(n,l=>l.lineRangeMapping.modified.startLineNumber{var r;const n=(r=t.diff.get())==null?void 0:r.mappings;!n||n.length===0||this._goTo(n[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const t=this._diffModel.get();t&&await t.waitForDiff()}mapToOtherSide(){var a,l;const t=this._editors.modified.hasWidgetFocus(),n=t?this._editors.modified:this._editors.original,r=t?this._editors.original:this._editors.modified;let o;const s=n.getSelection();if(s){const d=(l=(a=this._diffModel.get())==null?void 0:a.diff.get())==null?void 0:l.mappings.map(u=>t?u.lineRangeMapping.flip():u.lineRangeMapping);if(d){const u=vyt(s.getStartPosition(),d),h=vyt(s.getEndPosition(),d);o=De.plusRange(u,h)}}return{destination:r,destinationSelection:o}}switchSide(){const{destination:t,destinationSelection:n}=this.mapToOtherSide();t.focus(),n&&t.setSelection(n)}exitCompareMove(){const t=this._diffModel.get();t&&t.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var n;const t=(n=this._diffModel.get())==null?void 0:n.unchangedRegions.get();t&&ua(r=>{for(const o of t)o.collapseAll(r)})}showAllUnchangedRegions(){var n;const t=(n=this._diffModel.get())==null?void 0:n.unchangedRegions.get();t&&ua(r=>{for(const o of t)o.showAll(r)})}_handleCursorPositionChange(t,n){var r,o;if((t==null?void 0:t.reason)===3){const s=(o=(r=this._diffModel.get())==null?void 0:r.diff.get())==null?void 0:o.mappings.find(a=>n?a.lineRangeMapping.modified.contains(t.position.lineNumber):a.lineRangeMapping.original.contains(t.position.lineNumber));s!=null&&s.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(lg.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):s!=null&&s.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(lg.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):s&&this._accessibilitySignalService.playSignal(lg.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};jy=g3o([HX(3,Fi),HX(4,$n),HX(5,Co),HX(6,E6),HX(7,e6)],jy);function m3o(e){return e.mappings.map(t=>{const n=t.lineRangeMapping;let r,o,s,a,l=n.innerChanges;return n.original.isEmpty?(r=n.original.startLineNumber-1,o=0,l=void 0):(r=n.original.startLineNumber,o=n.original.endLineNumberExclusive-1),n.modified.isEmpty?(s=n.modified.startLineNumber-1,a=0,l=void 0):(s=n.modified.startLineNumber,a=n.modified.endLineNumberExclusive-1),{originalStartLineNumber:r,originalEndLineNumber:o,modifiedStartLineNumber:s,modifiedEndLineNumber:a,charChanges:l==null?void 0:l.map(d=>({originalStartLineNumber:d.originalRange.startLineNumber,originalStartColumn:d.originalRange.startColumn,originalEndLineNumber:d.originalRange.endLineNumber,originalEndColumn:d.originalRange.endColumn,modifiedStartLineNumber:d.modifiedRange.startLineNumber,modifiedStartColumn:d.modifiedRange.startColumn,modifiedEndLineNumber:d.modifiedRange.endLineNumber,modifiedEndColumn:d.modifiedRange.endColumn}))}})}class k3o extends Gu{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Et(85,"Toggle Collapse Unchanged Regions"),icon:Jt.map,toggled:zt.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:zt.has("isInDiffEditor"),menu:{when:zt.has("isInDiffEditor"),id:Yn.EditorTitle,order:22,group:"navigation"}})}run(t,...n){const r=t.get(cr),o=!r.getValue("diffEditor.hideUnchangedRegions.enabled");r.updateValue("diffEditor.hideUnchangedRegions.enabled",o)}}class DFn extends Gu{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Et(86,"Toggle Show Moved Code Blocks"),precondition:zt.has("isInDiffEditor")})}run(t,...n){const r=t.get(cr),o=!r.getValue("diffEditor.experimental.showMoves");r.updateValue("diffEditor.experimental.showMoves",o)}}class QFn extends Gu{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Et(87,"Toggle Use Inline View When Space Is Limited"),precondition:zt.has("isInDiffEditor")})}run(t,...n){const r=t.get(cr),o=!r.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");r.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",o)}}const Are=Et(88,"Diff Editor");class v3o extends T4{constructor(){super({id:"diffEditor.switchSide",title:Et(89,"Switch Side"),icon:Jt.arrowSwap,precondition:zt.has("isInDiffEditor"),f1:!0,category:Are})}runEditorCommand(t,n,r){const o=ZM(t);if(o instanceof jy){if(r&&r.dryRun)return{destinationSelection:o.mapToOtherSide().destinationSelection};o.switchSide()}}}class p3o extends T4{constructor(){super({id:"diffEditor.exitCompareMove",title:Et(90,"Exit Compare Move"),icon:Jt.close,precondition:Ze.comparingMovedCode,f1:!1,category:Are,keybinding:{weight:1e4,primary:9}})}runEditorCommand(t,n,...r){const o=ZM(t);o instanceof jy&&o.exitCompareMove()}}class b3o extends T4{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Et(91,"Collapse All Unchanged Regions"),icon:Jt.fold,precondition:zt.has("isInDiffEditor"),f1:!0,category:Are})}runEditorCommand(t,n,...r){const o=ZM(t);o instanceof jy&&o.collapseAllUnchangedRegions()}}class O3o extends T4{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Et(92,"Show All Unchanged Regions"),icon:Jt.unfold,precondition:zt.has("isInDiffEditor"),f1:!0,category:Are})}runEditorCommand(t,n,...r){const o=ZM(t);o instanceof jy&&o.showAllUnchangedRegions()}}class KWe extends Gu{constructor(){super({id:"diffEditor.revert",title:Et(93,"Revert"),f1:!0,category:Are,precondition:zt.has("isInDiffEditor")})}run(t,n){return n?this.runViaToolbarContext(t,n):this.runViaCursorOrSelection(t)}runViaCursorOrSelection(t){const n=ZM(t);n instanceof jy&&n.revertFocusedRangeMappings()}runViaToolbarContext(t,n){const r=w3o(t,n.originalUri,n.modifiedUri);r instanceof jy&&r.revertRangeMappings(n.mapping.innerChanges??[])}}const BFn=Et(94,"Accessible Diff Viewer"),A2e=class A2e extends Gu{constructor(){super({id:A2e.id,title:Et(95,"Go to Next Difference"),category:BFn,precondition:zt.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(t){const n=ZM(t);n==null||n.accessibleDiffViewerNext()}};A2e.id="editor.action.accessibleDiffViewer.next";let $$=A2e;const f2e=class f2e extends Gu{constructor(){super({id:f2e.id,title:Et(96,"Go to Previous Difference"),category:BFn,precondition:zt.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(t){const n=ZM(t);n==null||n.accessibleDiffViewerPrev()}};f2e.id="editor.action.accessibleDiffViewer.prev";let a1e=f2e;function w3o(e,t,n){return e.get(Co).listDiffEditors().find(s=>{var d,u;const a=s.getModifiedEditor(),l=s.getOriginalEditor();return a&&((d=a.getModel())==null?void 0:d.uri.toString())===n.toString()&&l&&((u=l.getModel())==null?void 0:u.uri.toString())===t.toString()})||null}function ZM(e){const n=e.get(Co).listDiffEditors(),r=Zd();if(r){for(const o of n)if(o.getContainerDomNode().contains(r))return o}return null}ws(k3o);ws(DFn);ws(QFn);ju.appendMenuItem(Yn.EditorTitle,{command:{id:new QFn().desc.id,title:j(119,"Use Inline View When Space Is Limited"),toggled:zt.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:zt.has("isInDiffEditor")},order:11,group:"1_diff",when:zt.and(Ze.diffEditorRenderSideBySideInlineBreakpointReached,zt.has("isInDiffEditor"))});ju.appendMenuItem(Yn.EditorTitle,{command:{id:new DFn().desc.id,title:j(120,"Show Moved Code Blocks"),icon:Jt.move,toggled:cZ.create("config.diffEditor.experimental.showMoves",!0),precondition:zt.has("isInDiffEditor")},order:10,group:"1_diff",when:zt.has("isInDiffEditor")});ws(KWe);for(const e of[{icon:Jt.arrowRight,key:Ze.diffEditorInlineMode.toNegated()},{icon:Jt.discard,key:Ze.diffEditorInlineMode}])ju.appendMenuItem(Yn.DiffEditorHunkToolbar,{command:{id:new KWe().desc.id,title:j(121,"Revert Block"),icon:e.icon},when:zt.and(Ze.diffEditorModifiedWritable,e.key),order:5,group:"primary"}),ju.appendMenuItem(Yn.DiffEditorSelectionToolbar,{command:{id:new KWe().desc.id,title:j(122,"Revert Selection"),icon:e.icon},when:zt.and(Ze.diffEditorModifiedWritable,e.key),order:5,group:"primary"});ws(v3o);ws(p3o);ws(b3o);ws(O3o);ju.appendMenuItem(Yn.EditorTitle,{command:{id:$$.id,title:j(123,"Open Accessible Diff Viewer"),precondition:zt.has("isInDiffEditor")},order:10,group:"2_diff",when:zt.and(Ze.accessibleDiffViewerVisible.negate(),zt.has("isInDiffEditor"))});ho.registerCommandAlias("editor.action.diffReview.next",$$.id);ws($$);ho.registerCommandAlias("editor.action.diffReview.prev",a1e.id);ws(a1e);var y3o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},C3o=function(e,t){return function(n,r){t(n,r,e)}},JWe;const POe=new Ln("selectionAnchorSet",!1);var KB;let YT=(KB=class{static get(t){return t.getContribution(JWe.ID)}constructor(t,n){this.editor=t,this.selectionAnchorSetContextKey=POe.bindTo(n),this.modelChangeListener=t.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const t=this.editor.getPosition();this.editor.changeDecorations(n=>{this.decorationId&&n.removeDecoration(this.decorationId),this.decorationId=n.addDecoration(Rn.fromPositions(t,t),{description:"selection-anchor",stickiness:1,hoverMessage:new xA().appendText(j(798,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),kg(j(799,"Anchor set at {0}:{1}",t.lineNumber,t.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const t=this.editor.getModel().getDecorationRange(this.decorationId);t&&this.editor.setPosition(t.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const t=this.editor.getModel().getDecorationRange(this.decorationId);if(t){const n=this.editor.getPosition();this.editor.setSelection(Rn.fromPositions(t.getStartPosition(),n)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const t=this.decorationId;this.editor.changeDecorations(n=>{n.removeDecoration(t),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},JWe=KB,KB.ID="editor.contrib.selectionAnchorController",KB);YT=JWe=y3o([C3o(1,Fi)],YT);class x3o extends Nn{constructor(){super({id:"editor.action.setSelectionAnchor",label:Et(800,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2080),weight:100}})}async run(t,n){var r;(r=YT.get(n))==null||r.setSelectionAnchor()}}class L3o extends Nn{constructor(){super({id:"editor.action.goToSelectionAnchor",label:Et(801,"Go to Selection Anchor"),precondition:POe})}async run(t,n){var r;(r=YT.get(n))==null||r.goToSelectionAnchor()}}class S3o extends Nn{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:Et(802,"Select from Anchor to Cursor"),precondition:POe,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2089),weight:100}})}async run(t,n){var r;(r=YT.get(n))==null||r.selectFromAnchorToCursor()}}class T3o extends Nn{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:Et(803,"Cancel Selection Anchor"),precondition:POe,kbOpts:{kbExpr:Ze.editorTextFocus,primary:9,weight:100}})}async run(t,n){var r;(r=YT.get(n))==null||r.cancelSelectionAnchor()}}mo(YT.ID,YT,4);gn(x3o);gn(L3o);gn(S3o);gn(T3o);const E3o=He("editorOverviewRuler.bracketMatchForeground","#A0A0A0",j(804,"Overview ruler marker color for matching brackets."));class D3o extends Nn{constructor(){super({id:"editor.action.jumpToBracket",label:Et(806,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:Ze.editorTextFocus,primary:3165,weight:100}})}run(t,n){var r;(r=FP.get(n))==null||r.jumpToBracket()}}class Q3o extends Nn{constructor(){super({id:"editor.action.selectToBracket",label:Et(807,"Select to Bracket"),precondition:void 0,metadata:{description:Et(808,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(t,n,r){var s;let o=!0;r&&r.selectBrackets===!1&&(o=!1),(s=FP.get(n))==null||s.selectToBracket(o)}}class B3o extends Nn{constructor(){super({id:"editor.action.removeBrackets",label:Et(809,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:Ze.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(t,n){var r;(r=FP.get(n))==null||r.removeBrackets(this.id)}}class F3o{constructor(t,n,r){this.position=t,this.brackets=n,this.options=r}}const QS=class QS extends ct{static get(t){return t.getContribution(QS.ID)}constructor(t){super(),this._editor=t,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Ss(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(t.onDidChangeCursorPosition(n=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(t.onDidChangeModelContent(n=>{this._updateBracketsSoon.schedule()})),this._register(t.onDidChangeModel(n=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(t.onDidChangeModelLanguageConfiguration(n=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(t.onDidChangeConfiguration(n=>{n.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(t.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(t.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=this._editor.getSelections().map(r=>{const o=r.getStartPosition(),s=t.bracketPairs.matchBracket(o);let a=null;if(s)s[0].containsPosition(o)&&!s[1].containsPosition(o)?a=s[1].getStartPosition():s[1].containsPosition(o)&&(a=s[0].getStartPosition());else{const l=t.bracketPairs.findEnclosingBrackets(o);if(l)a=l[1].getStartPosition();else{const d=t.bracketPairs.findNextBracket(o);d&&d.range&&(a=d.range.getStartPosition())}}return a?new Rn(a.lineNumber,a.column,a.lineNumber,a.column):new Rn(o.lineNumber,o.column,o.lineNumber,o.column)});this._editor.setSelections(n),this._editor.revealRange(n[0])}selectToBracket(t){if(!this._editor.hasModel())return;const n=this._editor.getModel(),r=[];this._editor.getSelections().forEach(o=>{const s=o.getStartPosition();let a=n.bracketPairs.matchBracket(s);if(!a&&(a=n.bracketPairs.findEnclosingBrackets(s),!a)){const u=n.bracketPairs.findNextBracket(s);u&&u.range&&(a=n.bracketPairs.matchBracket(u.range.getStartPosition()))}let l=null,d=null;if(a){a.sort(De.compareRangesUsingStarts);const[u,h]=a;if(l=t?u.getStartPosition():u.getEndPosition(),d=t?h.getEndPosition():h.getStartPosition(),h.containsPosition(s)){const f=l;l=d,d=f}}l&&d&&r.push(new Rn(l.lineNumber,l.column,d.lineNumber,d.column))}),r.length>0&&(this._editor.setSelections(r),this._editor.revealRange(r[0]))}removeBrackets(t){if(!this._editor.hasModel())return;const n=this._editor.getModel();this._editor.getSelections().forEach(r=>{const o=r.getPosition();let s=n.bracketPairs.matchBracket(o);s||(s=n.bracketPairs.findEnclosingBrackets(o)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(t,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const t=[];let n=0;for(const r of this._lastBracketsData){const o=r.brackets;o&&(t[n++]={range:o[0],options:r.options},t[n++]={range:o[1],options:r.options})}this._decorations.set(t)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getSelections();if(t.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const n=this._editor.getModel(),r=n.getVersionId();let o=[];this._lastVersionId===r&&(o=this._lastBracketsData);const s=[];let a=0;for(let f=0,g=t.length;f1&&s.sort(tt.compare);const l=[];let d=0,u=0;const h=o.length;for(let f=0,g=s.length;f0&&(n.pushUndoStop(),n.executeCommands(this.id,o),n.pushUndoStop())}}gn(I3o);const N3o=Lr("productService");function vnt(e,t){return{id:t,asString:async()=>e,asFile:()=>{},value:typeof e=="string"?e:void 0}}function U3o(e,t,n,r){const o={id:jM(),name:e,uri:t,data:n};return{id:r,asString:async()=>"",asFile:()=>o,value:void 0}}class PFn{constructor(){this._entries=new Map}get size(){let t=0;for(const n of this._entries)t++;return t}has(t){return this._entries.has(this.toKey(t))}matches(t){const n=[...this._entries.keys()];return lo.some(this,([r,o])=>o.asFile())&&n.push("files"),MFn(l1e(t),n)}get(t){var n;return(n=this._entries.get(this.toKey(t)))==null?void 0:n[0]}append(t,n){const r=this._entries.get(t);r?r.push(n):this._entries.set(this.toKey(t),[n])}replace(t,n){this._entries.set(this.toKey(t),[n])}delete(t){this._entries.delete(this.toKey(t))}*[Symbol.iterator](){for(const[t,n]of this._entries)for(const r of n)yield[t,r]}toKey(t){return l1e(t)}}function l1e(e){return e.toLowerCase()}function Vyt(e,t){return MFn(l1e(e),t.map(l1e))}function MFn(e,t){if(e==="*/*")return t.length>0;if(t.includes(e))return!0;const n=e.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!n)return!1;const[r,o,s]=n;return s==="*"?t.some(a=>a.startsWith(o+"/")):!1}const MOe=Object.freeze({create:e=>X8(e.map(t=>t.toString())).join(`\r `),split:e=>e.split(`\r `),parse:e=>MOe.split(e).filter(t=>!t.startsWith("#"))}),tw=class tw{constructor(t){this.value=t}equals(t){return this.value===t.value}contains(t){return this.equals(t)||this.value===""||t.value.startsWith(this.value+tw.sep)}intersects(t){return this.contains(t)||t.contains(this)}append(...t){return new tw((this.value?[this.value,...t]:t).join(tw.sep))}};tw.sep=".",tw.None=new tw("@@none@@"),tw.Empty=new tw("");let Fl=tw;const j3o={ctrlCmd:!1,alt:!1};var eee;(function(e){e[e.Blur=1]="Blur",e[e.Gesture=2]="Gesture",e[e.Other=3]="Other"})(eee||(eee={}));var Rb;(function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.SECOND=2]="SECOND",e[e.LAST=3]="LAST"})(Rb||(Rb={}));var Da;(function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage",e[e.NextSeparator=8]="NextSeparator",e[e.PreviousSeparator=9]="PreviousSeparator"})(Da||(Da={}));var c1e;(function(e){e[e.Title=1]="Title",e[e.Inline=2]="Inline",e[e.Input=3]="Input"})(c1e||(c1e={}));const UA=Lr("quickInputService"),zyt={EDITORS:"CodeEditors",FILES:"CodeFiles"};class W3o{}const H3o={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Rl.add(H3o.DragAndDropContribution,new W3o);const HJ=class HJ{constructor(){}static getInstance(){return HJ.INSTANCE}hasData(t){return t&&t===this.proto}getData(t){if(this.hasData(t))return this.data}};HJ.INSTANCE=new HJ;let _We=HJ;function RFn(e){var t,n,r,o;if(wO&&typeof((n=(t=globalThis.vscode)==null?void 0:t.webUtils)==null?void 0:n.getPathForFile)=="function")return(o=(r=globalThis.vscode)==null?void 0:r.webUtils)==null?void 0:o.getPathForFile(e)}function IFn(e){const t=new PFn;for(const n of e.items){const r=n.type;if(n.kind==="string"){const o=new Promise(s=>n.getAsString(s));t.append(r,vnt(o))}else if(n.kind==="file"){const o=n.getAsFile();o&&t.append(r,V3o(o))}}return t}function V3o(e){const t=RFn(e),n=t?pi.parse(t):void 0;return U3o(e.name,n,async()=>new Uint8Array(await e.arrayBuffer()))}const z3o=Object.freeze([zyt.EDITORS,zyt.FILES,EP.RESOURCES,EP.INTERNAL_URI_LIST]);function NFn(e,t=!1){const n=IFn(e),r=n.get(EP.INTERNAL_URI_LIST);if(r)n.replace(Ac.uriList,r);else if(t||!n.has(Ac.uriList)){const o=[];for(const s of e.items){const a=s.getAsFile();if(a){const l=RFn(a);try{l?o.push(pi.file(l).toString()):o.push(pi.parse(a.name,!0).toString())}catch{}}}o.length&&n.replace(Ac.uriList,vnt(MOe.create(o)))}for(const o of z3o)n.delete(o);return n}const fre=Lr("IWorkspaceEditService");class pnt{constructor(t){this.metadata=t}static convert(t){return t.edits.map(n=>{if(_5.is(n))return _5.lift(n);if(aW.is(n))return aW.lift(n);throw new Error("Unsupported edit")})}}class _5 extends pnt{static is(t){return t instanceof _5?!0:Vd(t)&&pi.isUri(t.resource)&&Vd(t.textEdit)}static lift(t){return t instanceof _5?t:new _5(t.resource,t.textEdit,t.versionId,t.metadata)}constructor(t,n,r=void 0,o){super(o),this.resource=t,this.textEdit=n,this.versionId=r}}class aW extends pnt{static is(t){return t instanceof aW?!0:Vd(t)&&(!!t.newResource||!!t.oldResource)}static lift(t){return t instanceof aW?t:new aW(t.oldResource,t.newResource,t.options,t.metadata)}constructor(t,n,r={},o){super(o),this.oldResource=t,this.newResource=n,this.options=r}}const bnt=Lr("IEditorCancelService"),UFn=new Ln("cancellableOperation",!1,j(939,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));qr(bnt,class{constructor(){this._tokens=new WeakMap}add(e,t){let n=this._tokens.get(e);n||(n=e.invokeWithinContext(o=>{const s=UFn.bindTo(o.get(Fi)),a=new Tf;return{key:s,tokens:a}}),this._tokens.set(e,n));let r;return n.key.set(!0),r=n.tokens.push(t),()=>{r&&(r(),n.key.set(!n.tokens.isEmpty()),r=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const n=t.tokens.pop();n&&(n.cancel(),t.key.set(!t.tokens.isEmpty()))}},1);class Z3o extends Ya{constructor(t,n){super(n),this.editor=t,this._unregister=t.invokeWithinContext(r=>r.get(bnt).add(t,this))}dispose(){this._unregister(),super.dispose()}}xn(new class extends $d{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:UFn})}runEditorCommand(e,t){e.get(bnt).cancel(t)}});let jFn=class $We{constructor(t,n){if(this.flags=n,this.flags&1){const r=t.getModel();this.modelVersionId=r?pP("{0}#{1}",r.uri.toString(),r.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=t.getPosition():this.position=null,this.flags&2?this.selection=t.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=t.getScrollLeft(),this.scrollTop=t.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(t){if(!(t instanceof $We))return!1;const n=t;return!(this.modelVersionId!==n.modelVersionId||this.scrollLeft!==n.scrollLeft||this.scrollTop!==n.scrollTop||!this.position&&n.position||this.position&&!n.position||this.position&&n.position&&!this.position.equals(n.position)||!this.selection&&n.selection||this.selection&&!n.selection||this.selection&&n.selection&&!this.selection.equalsRange(n.selection))}validate(t){return this._equals(new $We(t,this.flags))}};class t6 extends Z3o{constructor(t,n,r,o){super(t,o),this._listener=new Pt,n&4&&this._listener.add(t.onDidChangeCursorPosition(s=>{(!r||!De.containsPosition(r,s.position))&&this.cancel()})),n&2&&this._listener.add(t.onDidChangeCursorSelection(s=>{(!r||!De.containsRange(r,s.selection))&&this.cancel()})),n&8&&this._listener.add(t.onDidScrollChange(s=>this.cancel())),n&1&&(this._listener.add(t.onDidChangeModel(s=>this.cancel())),this._listener.add(t.onDidChangeModelContent(s=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class Ont extends Ya{constructor(t,n){super(n),this._listener=t.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}var Y3o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},X3o=function(e,t){return function(n,r){t(n,r,e)}};const q3o=Ki.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:n7n,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),g2e=class g2e extends ct{constructor(t,n,r,o,s){super(),this.typeId=t,this.editor=n,this.range=r,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(o),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(t){this.domNode=ln(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=t;const n=ln("span.icon");this.domNode.append(n),n.classList.add(...mi.asClassNameArray(Jt.loading),"codicon-modifier-spin");const r=()=>{const o=this.editor.getOption(75);this.domNode.style.height=`${o}px`,this.domNode.style.width=`${Math.ceil(.8*o)}px`};r(),this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(61)||o.hasChanged(75))&&r()})),this._register(pt(this.domNode,cn.CLICK,o=>{this.delegate.cancel()}))}getId(){return g2e.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};g2e.baseId="editor.widget.inlineProgressWidget";let eHe=g2e,d1e=class extends ct{constructor(t,n,r){super(),this.id=t,this._editor=n,this._instantiationService=r,this._showDelay=500,this._showPromise=this._register(new is),this._currentWidget=this._register(new is),this._operationIdPool=0,this._currentDecorations=n.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(t,n,r,o,s){const a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=z8(()=>{const l=De.fromPositions(t);this._currentDecorations.set([{range:l,options:q3o}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(eHe,this.id,this._editor,l,n,o))},s??this._showDelay);try{return await r}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};d1e=Y3o([X3o(2,$n)],d1e);const B6=Lr("openerService");function G3o(e,t){return e.with({fragment:`${t.startLineNumber},${t.startColumn}${t.endLineNumber?`-${t.endLineNumber}${t.endColumn?`,${t.endColumn}`:""}`:""}`})}function K3o(e){let t;const n=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return n&&(t={startLineNumber:parseInt(n[1]),startColumn:n[2]?parseInt(n[2]):1,endLineNumber:n[4]?parseInt(n[4]):void 0,endColumn:n[4]?n[5]?parseInt(n[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}var J3o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},_3o=function(e,t){return function(n,r){t(n,r,e)}};const D4=Lr("markdownRendererService");let tHe=class{constructor(t){this._openerService=t}render(t,n,r){const o={...n};o.actionHandler||(o.actionHandler=(a,l)=>WFn(this._openerService,a,l.isTrusted)),o.codeBlockRenderer||(o.codeBlockRenderer=(a,l)=>{var d;return((d=this._defaultCodeBlockRenderer)==null?void 0:d.renderCodeBlock(a,l,o??{}))??Promise.resolve(document.createElement("span"))});const s=lre(t,o,r);return s.element.classList.add("rendered-markdown"),s}setDefaultCodeBlockRenderer(t){this._defaultCodeBlockRenderer=t}};tHe=J3o([_3o(0,B6)],tHe);async function WFn(e,t,n,r){try{return await e.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:$3o(n),skipValidation:r})}catch(o){return Yi(o),!1}}function $3o(e){return e===!0?!0:e&&Array.isArray(e.enabledCommands)?e.enabledCommands:!1}qr(D4,tHe,1);var ewo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Zyt=function(e,t){return function(n,r){t(n,r,e)}},Bhe,aT;let R1=(aT=class{static get(t){return t.getContribution(Bhe.ID)}constructor(t,n,r){this._openerService=r,this._messageWidget=new is,this._messageListeners=new Pt,this._mouseOverMessage=!1,this._editor=t,this._visible=Bhe.MESSAGE_VISIBLE.bindTo(n)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(t,n){if(kg(A8(t)?t.value:t),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),A8(t)){const o=this._messageListeners.add(lre(t,{actionHandler:(s,a)=>{this.closeMessage(),WFn(this._openerService,s,a.isTrusted)}}));this._messageWidget.value=new T9e(this._editor,n,o.element)}else this._messageWidget.value=new T9e(this._editor,n,t);this._messageListeners.add(un.debounce(this._editor.onDidBlurEditorText,(o,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&bu(Zd(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(pt(this._messageWidget.value.getDomNode(),cn.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(pt(this._messageWidget.value.getDomNode(),cn.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let r;this._messageListeners.add(this._editor.onMouseMove(o=>{o.target.position&&(r?r.containsPosition(o.target.position)||this.closeMessage():r=new De(n.lineNumber-3,1,o.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(T9e.fadeOut(this._messageWidget.value))}},Bhe=aT,aT.ID="editor.contrib.messageController",aT.MESSAGE_VISIBLE=new Ln("messageVisible",!1,j(1287,"Whether the editor is currently showing an inline message")),aT);R1=Bhe=ewo([Zyt(1,Fi),Zyt(2,B6)],R1);const two=$d.bindToContribution(R1.get);xn(new two({id:"leaveEditorMessage",precondition:R1.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));let T9e=class{static fadeOut(t){const n=()=>{t.dispose(),clearTimeout(r),t.getDomNode().removeEventListener("animationend",n)},r=setTimeout(n,110);return t.getDomNode().addEventListener("animationend",n),t.getDomNode().classList.add("fadeOut"),{dispose:n}}constructor(t,{lineNumber:n,column:r},o){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=t,this._editor.revealLinesInCenterIfOutsideViewport(n,n,0),this._position={lineNumber:n,column:r},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const a=document.createElement("div");typeof o=="string"?(a.classList.add("message"),a.textContent=o):(o.classList.add("message"),a.appendChild(o)),this._domNode.appendChild(a);const l=document.createElement("div");l.classList.add("anchor","below"),this._domNode.appendChild(l),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(t){this._domNode.classList.toggle("below",t===2)}};mo(R1.ID,R1,4);class nwo{constructor(){this._value="",this._pos=0}reset(t){return this._value=t,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;n--,this._valueLen--){const r=this._value.charCodeAt(n);if(!(r===47||this._splitOnBackslash&&r===92))break}return this.next()}hasNext(){return this._to!1,n=()=>!1){return new lW(new owo(t,n))}static forStrings(){return new lW(new nwo)}static forConfigKeys(){return new lW(new iwo)}constructor(t){this._iter=t}clear(){this._root=void 0}set(t,n){const r=this._iter.reset(t);let o;this._root||(this._root=new rce,this._root.segment=r.value());const s=[];for(o=this._root;;){const l=r.cmp(o.segment);if(l>0)o.left||(o.left=new rce,o.left.segment=r.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new rce,o.right.segment=r.value()),s.push([1,o]),o=o.right;else if(r.hasNext())r.next(),o.mid||(o.mid=new rce,o.mid.segment=r.value()),s.push([0,o]),o=o.mid;else break}const a=Kx.unwrap(o.value);o.value=Kx.wrap(n),o.key=t;for(let l=s.length-1;l>=0;l--){const d=s[l][1];d.updateHeight();const u=d.balanceFactor();if(u<-1||u>1){const h=s[l][0],f=s[l+1][0];if(h===1&&f===1)s[l][1]=d.rotateLeft();else if(h===-1&&f===-1)s[l][1]=d.rotateRight();else if(h===1&&f===-1)d.right=s[l+1][1]=s[l+1][1].rotateRight(),s[l][1]=d.rotateLeft();else if(h===-1&&f===1)d.left=s[l+1][1]=s[l+1][1].rotateLeft(),s[l][1]=d.rotateRight();else throw new Error;if(l>0)switch(s[l-1][0]){case-1:s[l-1][1].left=s[l][1];break;case 1:s[l-1][1].right=s[l][1];break;case 0:s[l-1][1].mid=s[l][1];break}else this._root=s[0][1]}}return a}get(t){var n;return Kx.unwrap((n=this._getNode(t))==null?void 0:n.value)}_getNode(t){const n=this._iter.reset(t);let r=this._root;for(;r;){const o=n.cmp(r.segment);if(o>0)r=r.left;else if(o<0)r=r.right;else if(n.hasNext())n.next(),r=r.mid;else break}return r}has(t){const n=this._getNode(t);return!((n==null?void 0:n.value)===void 0&&(n==null?void 0:n.mid)===void 0)}delete(t){return this._delete(t,!1)}deleteSuperstr(t){return this._delete(t,!0)}_delete(t,n){const r=this._iter.reset(t),o=[];let s=this._root;for(;s;){const a=r.cmp(s.segment);if(a>0)o.push([-1,s]),s=s.left;else if(a<0)o.push([1,s]),s=s.right;else if(r.hasNext())r.next(),o.push([0,s]),s=s.mid;else break}if(s){if(n?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const a=[[1,s]],l=this._min(s.right,a);if(l.key){s.key=l.key,s.value=l.value,s.segment=l.segment;const d=l.right;if(a.length>1){const[h,f]=a[a.length-1];switch(h){case-1:f.left=d;break;case 0:t$(!1);case 1:t$(!1)}}else s.right=d;const u=this._balanceByStack(a);if(o.length>0){const[h,f]=o[o.length-1];switch(h){case-1:f.left=u;break;case 0:f.mid=u;break;case 1:f.right=u;break}}else this._root=u}}else{const a=s.left??s.right;if(o.length>0){const[l,d]=o[o.length-1];switch(l){case-1:d.left=a;break;case 0:d.mid=a;break;case 1:d.right=a;break}}else this._root=a}this._root=this._balanceByStack(o)??this._root}}_min(t,n){for(;t.left;)n.push([-1,t]),t=t.left;return t}_balanceByStack(t){for(let n=t.length-1;n>=0;n--){const r=t[n][1];r.updateHeight();const o=r.balanceFactor();if(o>1?(r.right.balanceFactor()>=0||(r.right=r.right.rotateRight()),t[n][1]=r.rotateLeft()):o<-1&&(r.left.balanceFactor()<=0||(r.left=r.left.rotateLeft()),t[n][1]=r.rotateRight()),n>0)switch(t[n-1][0]){case-1:t[n-1][1].left=t[n][1];break;case 1:t[n-1][1].right=t[n][1];break;case 0:t[n-1][1].mid=t[n][1];break}else return t[0][1]}}findSubstr(t){const n=this._iter.reset(t);let r=this._root,o;for(;r;){const s=n.cmp(r.segment);if(s>0)r=r.left;else if(s<0)r=r.right;else if(n.hasNext())n.next(),o=Kx.unwrap(r.value)||o,r=r.mid;else break}return r&&Kx.unwrap(r.value)||o}findSuperstr(t){return this._findSuperstrOrElement(t,!1)}_findSuperstrOrElement(t,n){const r=this._iter.reset(t);let o=this._root;for(;o;){const s=r.cmp(o.segment);if(s>0)o=o.left;else if(s<0)o=o.right;else if(r.hasNext())r.next(),o=o.mid;else return o.mid?this._entries(o.mid):n?Kx.unwrap(o.value):void 0}}forEach(t){for(const[n,r]of this)t(r,n)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(t){const n=[];return this._dfsEntries(t,n),n[Symbol.iterator]()}_dfsEntries(t,n){t&&(t.left&&this._dfsEntries(t.left,n),t.value!==void 0&&n.push([t.key,Kx.unwrap(t.value)]),t.mid&&this._dfsEntries(t.mid,n),t.right&&this._dfsEntries(t.right,n))}}const n6=Lr("contextService");function nHe(e){const t=e;return typeof(t==null?void 0:t.id)=="string"&&pi.isUri(t.uri)}function swo(e){const t=e;return typeof(t==null?void 0:t.id)=="string"&&!nHe(e)&&!cwo(e)}const awo={id:"empty-window"};function lwo(e,t){if(typeof e=="string"||typeof e>"u")return typeof e=="string"?{id:c8(e)}:awo;const n=e;return n.configuration?{id:n.id,configPath:n.configuration}:n.folders.length===1?{id:n.id,uri:n.folders[0].uri}:{id:n.id}}function cwo(e){const t=e;return typeof(t==null?void 0:t.id)=="string"&&pi.isUri(t.configPath)}let dwo=class{constructor(t,n){this.raw=n,this.uri=t.uri,this.index=t.index,this.name=t.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};const iHe="code-workspace";j(2050,"Code Workspace");const HFn="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function uwo(e){return e.id===HFn}var wnt=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},tee=function(e,t){return function(n,r){t(n,r,e)}};class ynt{constructor(t){this.copyMimeTypes=[],this.kind=t,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(t,n,r,o,s){const a=await this.getEdit(r,s);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(t,n,r,o){const s=await this.getEdit(r,o);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}const m2e=class m2e extends ynt{constructor(){super(Fl.Empty.append("text","plain")),this.id=m2e.id,this.dropMimeTypes=[Ac.text],this.pasteMimeTypes=[Ac.text]}async getEdit(t,n){const r=t.get(Ac.text);if(!r||t.has(Ac.uriList))return;const o=await r.asString();return{handledMimeType:Ac.text,title:j(926,"Insert Plain Text"),insertText:o,kind:this.kind}}};m2e.id="text";let PP=m2e;class VFn extends ynt{constructor(){super(Fl.Empty.append("uri","path","absolute")),this.dropMimeTypes=[Ac.uriList],this.pasteMimeTypes=[Ac.uriList]}async getEdit(t,n){const r=await zFn(t);if(!r.length||n.isCancellationRequested)return;let o=0;const s=r.map(({uri:l,originalText:d})=>l.scheme===Li.file?l.fsPath:(o++,d)).join(" ");let a;return o>0?a=r.length>1?j(927,"Insert Uris"):j(928,"Insert Uri"):a=r.length>1?j(929,"Insert Paths"):j(930,"Insert Path"),{handledMimeType:Ac.uriList,insertText:s,title:a,kind:this.kind}}}let u1e=class extends ynt{constructor(t){super(Fl.Empty.append("uri","path","relative")),this._workspaceContextService=t,this.dropMimeTypes=[Ac.uriList],this.pasteMimeTypes=[Ac.uriList]}async getEdit(t,n){const r=await zFn(t);if(!r.length||n.isCancellationRequested)return;const o=YO(r.map(({uri:s})=>{const a=this._workspaceContextService.getWorkspaceFolder(s);return a?ido(a.uri,s):void 0}));if(o.length)return{handledMimeType:Ac.uriList,insertText:o.join(" "),title:r.length>1?j(931,"Insert Relative Paths"):j(932,"Insert Relative Path"),kind:this.kind}}};u1e=wnt([tee(0,n6)],u1e);class hwo{constructor(){this.kind=new Fl("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Ac.text}]}async provideDocumentPasteEdits(t,n,r,o,s){var d;if(o.triggerKind!==D$.PasteAs&&!((d=o.only)!=null&&d.contains(this.kind)))return;const a=r.get("text/html"),l=await(a==null?void 0:a.asString());if(!(!l||s.isCancellationRequested))return{dispose(){},edits:[{insertText:l,yieldTo:this._yieldTo,title:j(933,"Insert HTML"),kind:this.kind}]}}}async function zFn(e){const t=e.get(Ac.uriList);if(!t)return[];const n=await t.asString(),r=[];for(const o of MOe.parse(n))try{r.push({uri:pi.parse(o),originalText:o})}catch{}return r}const QQ={scheme:"*",hasAccessToAllModels:!0};let rHe=class extends ct{constructor(t,n){super(),this._register(t.documentDropEditProvider.register(QQ,new PP)),this._register(t.documentDropEditProvider.register(QQ,new VFn)),this._register(t.documentDropEditProvider.register(QQ,new u1e(n)))}};rHe=wnt([tee(0,Zn),tee(1,n6)],rHe);let oHe=class extends ct{constructor(t,n){super(),this._register(t.documentPasteEditProvider.register(QQ,new PP)),this._register(t.documentPasteEditProvider.register(QQ,new VFn)),this._register(t.documentPasteEditProvider.register(QQ,new u1e(n))),this._register(t.documentPasteEditProvider.register(QQ,new hwo))}};oHe=wnt([tee(0,Zn),tee(1,n6)],oHe);const dp=class dp{constructor(){this.value="",this.pos=0}static isDigitCharacter(t){return t>=48&&t<=57}static isVariableCharacter(t){return t===95||t>=97&&t<=122||t>=65&&t<=90}text(t){this.value=t,this.pos=0}tokenText(t){return this.value.substr(t.pos,t.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const t=this.pos;let n=0,r=this.value.charCodeAt(t),o;if(o=dp._table[r],typeof o=="number")return this.pos+=1,{type:o,pos:t,len:1};if(dp.isDigitCharacter(r)){o=8;do n+=1,r=this.value.charCodeAt(t+n);while(dp.isDigitCharacter(r));return this.pos+=n,{type:o,pos:t,len:n}}if(dp.isVariableCharacter(r)){o=9;do r=this.value.charCodeAt(t+ ++n);while(dp.isVariableCharacter(r)||dp.isDigitCharacter(r));return this.pos+=n,{type:o,pos:t,len:n}}o=10;do n+=1,r=this.value.charCodeAt(t+n);while(!isNaN(r)&&typeof dp._table[r]>"u"&&!dp.isDigitCharacter(r)&&!dp.isVariableCharacter(r));return this.pos+=n,{type:o,pos:t,len:n}}};dp._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let sHe=dp;class CZ{constructor(){this._children=[]}appendChild(t){return t instanceof p1&&this._children[this._children.length-1]instanceof p1?this._children[this._children.length-1].value+=t.value:(t.parent=this,this._children.push(t)),this}replace(t,n){const{parent:r}=t,o=r.children.indexOf(t),s=r.children.slice(0);s.splice(o,1,...n),r._children=s,function a(l,d){for(const u of l)u.parent=d,a(u.children,u)}(n,r)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let t=this;for(;;){if(!t)return;if(t instanceof gre)return t;t=t.parent}}toString(){return this.children.reduce((t,n)=>t+n.toString(),"")}len(){return 0}}let p1=class ZFn extends CZ{constructor(t){super(),this.value=t}toString(){return this.value}len(){return this.value.length}clone(){return new ZFn(this.value)}};class YFn extends CZ{}class Ev extends YFn{static compareByIndex(t,n){return t.index===n.index?0:t.isFinalTabstop?1:n.isFinalTabstop||t.indexn.index?1:0}constructor(t){super(),this.index=t}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof xZ?this._children[0]:void 0}clone(){const t=new Ev(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(n=>n.clone()),t}}class xZ extends CZ{constructor(){super(...arguments),this.options=[]}appendChild(t){return t instanceof p1&&(t.parent=this,this.options.push(t)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const t=new xZ;return this.options.forEach(t.appendChild,t),t}}let Awo=class XFn extends CZ{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(t){const n=this;let r=!1,o=t.replace(this.regexp,function(){return r=!0,n._replace(Array.prototype.slice.call(arguments,0,-2))});return!r&&this._children.some(s=>s instanceof Ib&&!!s.elseValue)&&(o=this._replace([])),o}_replace(t){let n="";for(const r of this._children)if(r instanceof Ib){let o=t[r.index]||"";o=r.resolve(o),n+=o}else n+=r.toString();return n}toString(){return""}clone(){const t=new XFn;return t.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),t._children=this.children.map(n=>n.clone()),t}};class Ib extends CZ{constructor(t,n,r,o){super(),this.index=t,this.shorthandName=n,this.ifValue=r,this.elseValue=o}resolve(t){return this.shorthandName==="upcase"?t?t.toLocaleUpperCase():"":this.shorthandName==="downcase"?t?t.toLocaleLowerCase():"":this.shorthandName==="capitalize"?t?t[0].toLocaleUpperCase()+t.substr(1):"":this.shorthandName==="pascalcase"?t?this._toPascalCase(t):"":this.shorthandName==="camelcase"?t?this._toCamelCase(t):"":t&&typeof this.ifValue=="string"?this.ifValue:!t&&typeof this.elseValue=="string"?this.elseValue:t||""}_toPascalCase(t){const n=t.match(/[a-z0-9]+/gi);return n?n.map(r=>r.charAt(0).toUpperCase()+r.substr(1)).join(""):t}_toCamelCase(t){const n=t.match(/[a-z0-9]+/gi);return n?n.map((r,o)=>o===0?r.charAt(0).toLowerCase()+r.substr(1):r.charAt(0).toUpperCase()+r.substr(1)).join(""):t}clone(){return new Ib(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class nee extends YFn{constructor(t){super(),this.name=t}resolve(t){let n=t.resolve(this);return this.transform&&(n=this.transform.resolve(n||"")),n!==void 0?(this._children=[new p1(n)],!0):!1}clone(){const t=new nee(this.name);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(n=>n.clone()),t}}function Yyt(e,t){const n=[...e];for(;n.length>0;){const r=n.shift();if(!t(r))break;n.unshift(...r.children)}}class gre extends CZ{get placeholderInfo(){if(!this._placeholders){const t=[];let n;this.walk(function(r){return r instanceof Ev&&(t.push(r),n=!n||n.indexo===t?(r=!0,!1):(n+=o.len(),!0)),r?n:-1}fullLen(t){let n=0;return Yyt([t],r=>(n+=r.len(),!0)),n}enclosingPlaceholders(t){const n=[];let{parent:r}=t;for(;r;)r instanceof Ev&&n.push(r),r=r.parent;return n}resolveVariables(t){return this.walk(n=>(n instanceof nee&&n.resolve(t)&&(this._placeholders=void 0),!0)),this}appendChild(t){return this._placeholders=void 0,super.appendChild(t)}replace(t,n){return this._placeholders=void 0,super.replace(t,n)}clone(){const t=new gre;return this._children=this.children.map(n=>n.clone()),t}walk(t){Yyt(this.children,t)}}class MP{constructor(){this._scanner=new sHe,this._token={type:14,pos:0,len:0}}static escape(t){return t.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(t){return/\${?CLIPBOARD/.test(t)}parse(t,n,r){const o=new gre;return this.parseFragment(t,o),this.ensureFinalTabstop(o,r??!1,n??!1),o}parseFragment(t,n){const r=n.children.length;for(this._scanner.text(t),this._token=this._scanner.next();this._parse(n););const o=new Map,s=[];n.walk(d=>(d instanceof Ev&&(d.isFinalTabstop?o.set(0,void 0):!o.has(d.index)&&d.children.length>0?o.set(d.index,d.children):s.push(d)),!0));const a=(d,u)=>{const h=o.get(d.index);if(!h)return;const f=new Ev(d.index);f.transform=d.transform;for(const g of h){const k=g.clone();f.appendChild(k),k instanceof Ev&&o.has(k.index)&&!u.has(k.index)&&(u.add(k.index),a(k,u),u.delete(k.index))}n.replace(d,[f])},l=new Set;for(const d of s)a(d,l);return n.children.slice(r)}ensureFinalTabstop(t,n,r){(n||r&&t.placeholders.length>0)&&(t.placeholders.find(s=>s.index===0)||t.appendChild(new Ev(0)))}_accept(t,n){if(t===void 0||this._token.type===t){const r=n?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),r}return!1}_backTo(t){return this._scanner.pos=t.pos+t.len,this._token=t,!1}_until(t){const n=this._token;for(;this._token.type!==t;){if(this._token.type===14)return!1;if(this._token.type===5){const o=this._scanner.next();if(o.type!==0&&o.type!==4&&o.type!==5)return!1}this._token=this._scanner.next()}const r=this._scanner.value.substring(n.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),r}_parse(t){return this._parseEscaped(t)||this._parseTabstopOrVariableName(t)||this._parseComplexPlaceholder(t)||this._parseComplexVariable(t)||this._parseAnything(t)}_parseEscaped(t){let n;return(n=this._accept(5,!0))?(n=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||n,t.appendChild(new p1(n)),!0):!1}_parseTabstopOrVariableName(t){let n;const r=this._token;return this._accept(0)&&(n=this._accept(9,!0)||this._accept(8,!0))?(t.appendChild(/^\d+$/.test(n)?new Ev(Number(n)):new nee(n)),!0):this._backTo(r)}_parseComplexPlaceholder(t){let n;const r=this._token;if(!(this._accept(0)&&this._accept(3)&&(n=this._accept(8,!0))))return this._backTo(r);const s=new Ev(Number(n));if(this._accept(1))for(;;){if(this._accept(4))return t.appendChild(s),!0;if(!this._parse(s))return t.appendChild(new p1("${"+n+":")),s.children.forEach(t.appendChild,t),!0}else if(s.index>0&&this._accept(7)){const a=new xZ;for(;;){if(this._parseChoiceElement(a)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(a),this._accept(4)))return t.appendChild(s),!0}return this._backTo(r),!1}}else return this._accept(6)?this._parseTransform(s)?(t.appendChild(s),!0):(this._backTo(r),!1):this._accept(4)?(t.appendChild(s),!0):this._backTo(r)}_parseChoiceElement(t){const n=this._token,r=[];for(;!(this._token.type===2||this._token.type===7);){let o;if((o=this._accept(5,!0))?o=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||o:o=this._accept(void 0,!0),!o)return this._backTo(n),!1;r.push(o)}return r.length===0?(this._backTo(n),!1):(t.appendChild(new p1(r.join(""))),!0)}_parseComplexVariable(t){let n;const r=this._token;if(!(this._accept(0)&&this._accept(3)&&(n=this._accept(9,!0))))return this._backTo(r);const s=new nee(n);if(this._accept(1))for(;;){if(this._accept(4))return t.appendChild(s),!0;if(!this._parse(s))return t.appendChild(new p1("${"+n+":")),s.children.forEach(t.appendChild,t),!0}else return this._accept(6)?this._parseTransform(s)?(t.appendChild(s),!0):(this._backTo(r),!1):this._accept(4)?(t.appendChild(s),!0):this._backTo(r)}_parseTransform(t){const n=new Awo;let r="",o="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,r+=s;continue}if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,n.appendChild(new p1(s));continue}if(!(this._parseFormatString(n)||this._parseAnything(n)))return!1}for(;!this._accept(4);){if(this._token.type!==14){o+=this._accept(void 0,!0);continue}return!1}try{n.regexp=new RegExp(r,o)}catch{return!1}return t.transform=n,!0}_parseFormatString(t){const n=this._token;if(!this._accept(0))return!1;let r=!1;this._accept(3)&&(r=!0);const o=this._accept(8,!0);if(o)if(r){if(this._accept(4))return t.appendChild(new Ib(Number(o))),!0;if(!this._accept(1))return this._backTo(n),!1}else return t.appendChild(new Ib(Number(o))),!0;else return this._backTo(n),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(n),!1):(t.appendChild(new Ib(Number(o),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return t.appendChild(new Ib(Number(o),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return t.appendChild(new Ib(Number(o),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const a=this._until(4);if(a)return t.appendChild(new Ib(Number(o),void 0,s,a)),!0}}else{const s=this._until(4);if(s)return t.appendChild(new Ib(Number(o),void 0,void 0,s)),!0}return this._backTo(n),!1}_parseAnything(t){return this._token.type!==14?(t.appendChild(new p1(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function qFn(e,t,n){var r,o;return(typeof n.insertText=="string"?n.insertText==="":n.insertText.snippet==="")?{edits:((r=n.additionalEdit)==null?void 0:r.edits)??[]}:{edits:[...t.map(s=>new _5(e,{range:s,text:typeof n.insertText=="string"?MP.escape(n.insertText)+"$0":n.insertText.snippet,insertAsSnippet:!0})),...((o=n.additionalEdit)==null?void 0:o.edits)??[]]}}function GFn(e){function t(a,l){return"mimeType"in a?a.mimeType===l.handledMimeType:!!l.kind&&a.kind.contains(l.kind)}const n=new Map;for(const a of e)for(const l of a.yieldTo??[])for(const d of e)if(d!==a&&t(l,d)){let u=n.get(a);u||(u=[],n.set(a,u)),u.push(d)}if(!n.size)return Array.from(e);const r=new Set,o=[];function s(a){if(!a.length)return[];const l=a[0];if(o.includes(l))return console.warn("Yield to cycle detected",l),a;if(r.has(l))return s(a.slice(1));let d=[];const u=n.get(l);return u&&(o.push(l),d=s(u),o.pop()),r.add(l),[...d,l,...s(a.slice(1))]}return s(Array.from(e))}Ut.white.toString(),Ut.white.toString();const fwo=Object.freeze({allowedTags:{override:["b","i","u","code","span"]},allowedAttributes:{override:["class"]}});let h1e=class extends ct{get onDidClick(){return this._onDidClick.event}constructor(t,n){super(),this._label="",this._onDidClick=this._register(new it),this._onDidEscape=this._register(new it),this.options=n,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!n.secondary);const r=n.secondary?n.buttonSecondaryBackground:n.buttonBackground,o=n.secondary?n.buttonSecondaryForeground:n.buttonForeground;this._element.style.color=o||"",this._element.style.backgroundColor=r||"",n.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof n.title=="string"&&this.setTitle(n.title),typeof n.ariaLabel=="string"&&this._element.setAttribute("aria-label",n.ariaLabel),t.appendChild(this._element),this.enabled=!n.disabled,this._register(NA.addTarget(this._element)),[cn.CLICK,pa.Tap].forEach(s=>{this._register(pt(this._element,s,a=>{if(!this.enabled){Bo.stop(a);return}this._onDidClick.fire(a)}))}),this._register(pt(this._element,cn.KEY_DOWN,s=>{const a=new Hs(s);let l=!1;this.enabled&&(a.equals(3)||a.equals(10))?(this._onDidClick.fire(s),l=!0):a.equals(9)&&(this._onDidEscape.fire(s),this._element.blur(),l=!0),l&&Bo.stop(a,!0)})),this._register(pt(this._element,cn.MOUSE_OVER,s=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(pt(this._element,cn.MOUSE_OUT,s=>{this.updateBackground(!1)})),this.focusTracker=this._register(f2(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(t){const n=[];for(let r of K5(t))if(typeof r=="string"){if(r=r.trim(),r==="")continue;const o=document.createElement("span");o.textContent=r,n.push(o)}else n.push(r);return n}updateBackground(t){let n;this.options.secondary?n=t?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:n=t?this.options.buttonHoverBackground:this.options.buttonBackground,n&&(this._element.style.backgroundColor=n)}get element(){return this._element}set label(t){var o;if(this._label===t||A8(this._label)&&A8(t)&&bpo(this._label,t))return;this._element.classList.add("monaco-text-button");const n=this.options.supportShortLabel?this._labelElement:this._element;if(A8(t)){const s=lre(t,void 0,document.createElement("span"));s.dispose();const a=(o=s.element.querySelector("p"))==null?void 0:o.innerHTML;a?KBn(n,a,fwo):Ou(n)}else this.options.supportIcons?Ou(n,...this.getContentElements(t)):n.textContent=t;let r="";typeof this.options.title=="string"?r=this.options.title:this.options.title&&(r=j4o(t)),this.setTitle(r),this._setAriaLabel(),this._label=t}get label(){return this._label}_setAriaLabel(){typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):typeof this.options.title=="string"&&this._element.setAttribute("aria-label",this.options.title)}set icon(t){this._setAriaLabel();const n=Array.from(this._element.classList).filter(r=>r.startsWith("codicon-"));this._element.classList.remove(...n),this._element.classList.add(...mi.asClassNameArray(t))}set enabled(t){t?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(t){!this._hover&&t!==""?this._hover=this._register(E4().setupManagedHover(this.options.hoverDelegate??dC("element"),this._element,t)):this._hover&&this._hover.update(t)}};function E9e(e,t){return t&&(e.stack||e.stacktrace)?j(29,"{0}: {1}",qyt(e),Xyt(e.stack)||Xyt(e.stacktrace)):qyt(e)}function Xyt(e){return Array.isArray(e)?e.join(` `):e}function qyt(e){return e.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof e.code=="string"&&typeof e.errno=="number"&&typeof e.syscall=="string"?j(30,"A system error occurred ({0})",e.message):e.message||j(31,"An unknown error occurred. Please consult the log for more details.")}function A1e(e=null,t=!1){if(!e)return j(32,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(e)){const n=YO(e),r=A1e(n[0],t);return n.length>1?j(33,"{0} ({1} errors in total)",r,n.length):r}if(pu(e))return e;if(e.detail){const n=e.detail;if(n.error)return E9e(n.error,t);if(n.exception)return E9e(n.exception,t)}return e.stack?E9e(e,t):e.message?e.message:j(34,"An unknown error occurred. Please consult the log for more details.")}const oce=ln,gwo={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0};class LZ extends ct{constructor(t,n,r){super(),this.os=n,this.keyElements=new Set,this.options=r||Object.create(null);const o=this.options.keybindingLabelForeground;this.domNode=tn(t,oce(".monaco-keybinding")),o&&(this.domNode.style.color=o),this.hover=this._register(E4().setupManagedHover(dC("mouse"),this.domNode,"")),this.didEverRender=!1,t.appendChild(this.domNode)}set(t,n){this.didEverRender&&this.keybinding===t&&LZ.areSame(this.matches,n)||(this.keybinding=t,this.matches=n,this.render())}render(){if(this.clear(),this.keybinding){const t=this.keybinding.getChords();t[0]&&this.renderChord(this.domNode,t[0],this.matches?this.matches.firstPart:null);for(let r=1;r=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Fhe=function(e,t){return function(n,r){t(n,r,e)}};const JFn="acceptSelectedCodeAction",_Fn="previewSelectedCodeAction";class mwo{get templateId(){return"header"}renderTemplate(t){t.classList.add("group-header");const n=document.createElement("span");return t.append(n),{container:t,text:n}}renderElement(t,n,r){var o;r.text.textContent=((o=t.group)==null?void 0:o.title)??t.label??""}disposeTemplate(t){}}class kwo{get templateId(){return"separator"}renderTemplate(t){t.classList.add("separator");const n=document.createElement("span");return t.append(n),{container:t,text:n}}renderElement(t,n,r){r.text.textContent=t.label??""}disposeTemplate(t){}}let aHe=class{get templateId(){return"action"}constructor(t,n){this._supportsPreview=t,this._keybindingService=n}renderTemplate(t){t.classList.add(this.templateId);const n=document.createElement("div");n.className="icon",t.append(n);const r=document.createElement("span");r.className="title",t.append(r);const o=document.createElement("span");o.className="description",t.append(o);const s=new LZ(t,x1);return{container:t,icon:n,text:r,description:o,keybinding:s}}renderElement(t,n,r){var a,l,d;if((a=t.group)!=null&&a.icon?(r.icon.className=mi.asClassName(t.group.icon),t.group.icon.color&&(r.icon.style.color=sn(t.group.icon.color.id))):(r.icon.className=mi.asClassName(Jt.lightBulb),r.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!t.item||!t.label)return;kco(!t.hideIcon,r.icon),r.text.textContent=f1e(t.label),t.keybinding?(r.description.textContent=t.keybinding.getLabel(),r.description.style.display="inline",r.description.style.letterSpacing="0.5px"):t.description?(r.description.textContent=f1e(t.description),r.description.style.display="inline"):(r.description.textContent="",r.description.style.display="none");const o=(l=this._keybindingService.lookupKeybinding(JFn))==null?void 0:l.getLabel(),s=(d=this._keybindingService.lookupKeybinding(_Fn))==null?void 0:d.getLabel();r.container.classList.toggle("option-disabled",t.disabled),t.tooltip?r.container.title=t.tooltip:t.disabled?r.container.title=t.label:o&&s?this._supportsPreview&&t.canPreview?r.container.title=j(1653,"{0} to Apply, {1} to Preview",o,s):r.container.title=j(1654,"{0} to Apply",o):r.container.title=""}disposeTemplate(t){t.keybinding.dispose()}};aHe=KFn([Fhe(1,Fo)],aHe);class vwo extends UIEvent{constructor(){super("acceptSelectedAction")}}class Gyt extends UIEvent{constructor(){super("previewSelectedAction")}}function pwo(e){if(e.kind==="action")return e.label}let lHe=class extends ct{constructor(t,n,r,o,s,a,l,d){super(),this._delegate=o,this._contextViewService=a,this._keybindingService=l,this._layoutService=d,this._actionLineHeight=28,this._headerLineHeight=28,this._separatorLineHeight=8,this.cts=this._register(new Ya),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const u={getHeight:h=>{switch(h.kind){case"header":return this._headerLineHeight;case"separator":return this._separatorLineHeight;default:return this._actionLineHeight}},getTemplateId:h=>h.kind};this._list=this._register(new Tk(t,this.domNode,u,[new aHe(n,this._keybindingService),new mwo,new kwo],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:pwo},accessibilityProvider:{getAriaLabel:h=>{if(h.kind==="action"){let f=h.label?f1e(h==null?void 0:h.label):"";return h.description&&(f=f+", "+f1e(h.description)),h.disabled&&(f=j(1655,"{0}, Disabled Reason: {1}",f,h.disabled)),f}return null},getWidgetAriaLabel:()=>j(1656,"Action Widget"),getRole:h=>{switch(h.kind){case"action":return"option";case"separator":return"separator";default:return"separator"}},getWidgetRole:()=>"listbox",...s}})),this._list.style(yZ),this._register(this._list.onMouseClick(h=>this.onListClick(h))),this._register(this._list.onMouseOver(h=>this.onListHover(h))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(h=>this.onListSelection(h))),this._allMenuItems=r,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(t){return!t.disabled&&t.kind==="action"}hide(t){this._delegate.onHide(t),this.cts.cancel(),this._contextViewService.hideContextView()}layout(t){const n=this._allMenuItems.filter(h=>h.kind==="header").length,r=this._allMenuItems.filter(h=>h.kind==="separator").length,a=this._allMenuItems.length*this._actionLineHeight+n*this._headerLineHeight-n*this._actionLineHeight+r*this._separatorLineHeight-r*this._actionLineHeight;this._list.layout(a);let l=t;if(this._allMenuItems.length>=50)l=380;else{const h=this._allMenuItems.map((f,g)=>{const k=this.domNode.ownerDocument.getElementById(this._list.getElementID(g));if(k){k.style.width="auto";const A=k.getBoundingClientRect().width;return k.style.width="",A}return 0});l=Math.max(...h,t)}const u=Math.min(a,this._layoutService.getContainer(oi(this.domNode)).clientHeight*.7);return this._list.layout(u,l),this.domNode.style.height=`${u}px`,this._list.domFocus(),l}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(t){const n=this._list.getFocus();if(n.length===0)return;const r=n[0],o=this._list.element(r);if(!this.focusCondition(o))return;const s=t?new Gyt:new vwo;this._list.setSelection([r],s)}onListSelection(t){if(!t.elements.length)return;const n=t.elements[0];n.item&&this.focusCondition(n)?this._delegate.onSelect(n.item,t.browserEvent instanceof Gyt):this._list.setSelection([])}onFocus(){var o,s;const t=this._list.getFocus();if(t.length===0)return;const n=t[0],r=this._list.element(n);(s=(o=this._delegate).onFocus)==null||s.call(o,r.item)}async onListHover(t){const n=t.element;if(n&&n.item&&this.focusCondition(n)){if(this._delegate.onHover&&!n.disabled&&n.kind==="action"){const r=await this._delegate.onHover(n.item,this.cts.token);n.canPreview=r?r.canPreview:void 0}t.index&&this._list.splice(t.index,1,[n])}this._list.setFocus(typeof t.index=="number"?[t.index]:[])}onListClick(t){t.element&&this.focusCondition(t.element)&&this._list.setFocus([])}};lHe=KFn([Fhe(5,Q6),Fhe(6,Fo),Fhe(7,uC)],lHe);function f1e(e){return e.replace(/\r\n|\r|\n/g," ")}var bwo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},D9e=function(e,t){return function(n,r){t(n,r,e)}};He("actionBar.toggledBackground",kZ,j(1657,"Background color for toggled action items in action bar."));const RP={Visible:new Ln("codeActionMenuVisible",!1,j(1658,"Whether the action widget list is visible"))},CE=Lr("actionWidgetService");let IP=class extends ct{get isVisible(){return RP.Visible.getValue(this._contextKeyService)||!1}constructor(t,n,r){super(),this._contextViewService=t,this._contextKeyService=n,this._instantiationService=r,this._list=this._register(new is)}show(t,n,r,o,s,a,l,d){const u=RP.Visible.bindTo(this._contextKeyService),h=this._instantiationService.createInstance(lHe,t,n,r,o,d);this._contextViewService.showContextView({getAnchor:()=>s,render:f=>(u.set(!0),this._renderWidget(f,h,l??[])),onHide:f=>{u.reset(),this._onWidgetClosed(f)}},a,!1)}acceptSelected(t){var n;(n=this._list.value)==null||n.acceptSelected(t)}focusPrevious(){var t,n;(n=(t=this._list)==null?void 0:t.value)==null||n.focusPrevious()}focusNext(){var t,n;(n=(t=this._list)==null?void 0:t.value)==null||n.focusNext()}hide(t){var n;(n=this._list.value)==null||n.hide(t),this._list.clear()}_renderWidget(t,n,r){var k;const o=document.createElement("div");if(o.classList.add("action-widget"),t.appendChild(o),this._list.value=n,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Pt,a=document.createElement("div"),l=t.appendChild(a);l.classList.add("context-view-block"),s.add(pt(l,cn.MOUSE_DOWN,A=>A.stopPropagation()));const d=document.createElement("div"),u=t.appendChild(d);u.classList.add("context-view-pointerBlock"),s.add(pt(u,cn.POINTER_MOVE,()=>u.remove())),s.add(pt(u,cn.MOUSE_DOWN,()=>u.remove()));let h=0;if(r.length){const A=this._createActionBar(".action-widget-action-bar",r);A&&(o.appendChild(A.getContainer().parentElement),s.add(A),h=A.getContainer().offsetWidth)}const f=(k=this._list.value)==null?void 0:k.layout(h);o.style.width=`${f}px`;const g=s.add(f2(t));return s.add(g.onDidBlur(()=>this.hide(!0))),s}_createActionBar(t,n){if(!n.length)return;const r=ln(t),o=new bm(r);return o.push(n,{icon:!1,label:!0}),o}_onWidgetClosed(t){var n;(n=this._list.value)==null||n.hide(t)}};IP=bwo([D9e(0,Q6),D9e(1,Fi),D9e(2,$n)],IP);qr(CE,IP,1);const mre=1100;ws(class extends Gu{constructor(){super({id:"hideCodeActionWidget",title:Et(1659,"Hide action widget"),precondition:RP.Visible,keybinding:{weight:mre,primary:9,secondary:[1033]}})}run(e){e.get(CE).hide(!0)}});ws(class extends Gu{constructor(){super({id:"selectPrevCodeAction",title:Et(1660,"Select previous action"),precondition:RP.Visible,keybinding:{weight:mre,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){const t=e.get(CE);t instanceof IP&&t.focusPrevious()}});ws(class extends Gu{constructor(){super({id:"selectNextCodeAction",title:Et(1661,"Select next action"),precondition:RP.Visible,keybinding:{weight:mre,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){const t=e.get(CE);t instanceof IP&&t.focusNext()}});ws(class extends Gu{constructor(){super({id:JFn,title:Et(1662,"Accept selected action"),precondition:RP.Visible,keybinding:{weight:mre,primary:3,secondary:[2137]}})}run(e){const t=e.get(CE);t instanceof IP&&t.acceptSelected()}});ws(class extends Gu{constructor(){super({id:_Fn,title:Et(1663,"Preview selected action"),precondition:RP.Visible,keybinding:{weight:mre,primary:2051}})}run(e){const t=e.get(CE);t instanceof IP&&t.acceptSelected(!0)}});var $Fn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},cW=function(e,t){return function(n,r){t(n,r,e)}},cHe,JB;let dHe=(JB=class extends ct{constructor(t,n,r,o,s,a,l,d,u,h,f){super(),this.typeId=t,this.editor=n,this.showCommand=o,this.range=s,this.edits=a,this.onSelectNewEdit=l,this.additionalActions=d,this._keybindingService=h,this._actionWidgetService=f,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=r.bindTo(u),this.visibleContext.set(!0),this._register(Gn(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Gn(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(g=>{this.dispose()})),this._register(un.runAndSubscribe(h.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var n;const t=(n=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:n.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=ln(".post-edit-widget"),this.button=this._register(new h1e(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(pt(this.domNode,cn.CLICK,()=>this.showSelector()))}getId(){return cHe.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){const t=ic(this.button.element),n={x:t.left+t.width,y:t.top+t.height};this._actionWidgetService.show("postEditWidget",!1,this.edits.allEdits.map((r,o)=>({kind:"action",item:r,label:r.title,disabled:!1,canPreview:!1,group:{title:"",icon:mi.fromId(o===this.edits.activeEditIndex?Jt.check.id:Jt.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:r=>{this._actionWidgetService.hide(!1);const o=this.edits.allEdits.findIndex(s=>s===r);if(o!==this.edits.activeEditIndex)return this.onSelectNewEdit(o)}},n,this.editor.getDomNode()??void 0,this.additionalActions)}},cHe=JB,JB.baseId="editor.widget.postEditWidget",JB);dHe=cHe=$Fn([cW(8,Fi),cW(9,Fo),cW(10,CE)],dHe);let g1e=class extends ct{constructor(t,n,r,o,s,a,l,d){super(),this._id=t,this._editor=n,this._visibleContext=r,this._showCommand=o,this._getAdditionalActions=s,this._instantiationService=a,this._bulkEditService=l,this._notificationService=d,this._currentWidget=this._register(new is),this._register(un.any(n.onDidChangeModel,n.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(t,n,r,o,s){if(!t.length||!this._editor.hasModel())return;const a=this._editor.getModel(),l=n.allEdits.at(n.activeEditIndex);if(!l)return;const d=async p=>{const b=this._editor.getModel();b&&(await b.undo(),this.applyEditAndShowIfNeeded(t,{activeEditIndex:p,allEdits:n.allEdits},r,o,s))},u=(p,b)=>{Sk(p)||(this._notificationService.error(b),r&&this.show(t[0],n,d))},h=new t6(this._editor,3,void 0,s);let f;try{f=await Lao(o(l,h.token),h.token)}catch(p){return u(p,j(937,`Error resolving edit '{0}': {1}`,l.title,A1e(p)))}finally{h.dispose()}if(s.isCancellationRequested)return;const g=qFn(a.uri,t,f),k=t[0],A=a.deltaDecorations([],[{range:k,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let m,v;try{m=await this._bulkEditService.apply(g,{editor:this._editor,token:s}),v=a.getDecorationRange(A[0])}catch(p){return u(p,j(938,`Error applying edit '{0}': {1}`,l.title,A1e(p)))}finally{a.deltaDecorations(A,[])}s.isCancellationRequested||r&&m.isApplied&&n.allEdits.length>1&&this.show(v??k,n,d)}show(t,n,r){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(dHe,this._id,this._editor,this._visibleContext,this._showCommand,t,n,r,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){var t;(t=this._currentWidget.value)==null||t.showSelector()}};g1e=$Fn([cW(5,$n),cW(6,fre),cW(7,cc)],g1e);var Owo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},rx=function(e,t){return function(n,r){t(n,r,e)}},op;const ePn="editor.changePasteType",wwo="editor.pasteAs.preferences",Cnt=new Ln("pasteWidgetVisible",!1,j(917,"Whether the paste widget is showing")),Q9e="application/vnd.code.copymetadata";var _B;let i6=(_B=class extends ct{static get(t){return t.getContribution(op.ID)}constructor(t,n,r,o,s,a,l,d,u,h){super(),this._logService=r,this._bulkEditService=o,this._clipboardService=s,this._commandService=a,this._configService=l,this._languageFeaturesService=d,this._quickInputService=u,this._progressService=h,this._editor=t;const f=t.getContainerDomNode();this._register(pt(f,"copy",g=>this.handleCopy(g))),this._register(pt(f,"cut",g=>this.handleCopy(g))),this._register(pt(f,"paste",g=>this.handlePaste(g),!0)),this._pasteProgressManager=this._register(new d1e("pasteIntoEditor",t,n)),this._postPasteWidgetManager=this._register(n.createInstance(g1e,"pasteIntoEditor",t,Cnt,{id:ePn,label:j(918,"Show paste options...")},()=>op._configureDefaultAction?[op._configureDefaultAction]:[]))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}async pasteAs(t){this._logService.trace("CopyPasteController.pasteAs"),this._editor.focus();try{this._logService.trace("Before calling editor.action.clipboardPasteAction"),this._pasteAsActionContext={preferred:t},await this._commandService.executeCommand("editor.action.clipboardPasteAction")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(97).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(t){var v,p,b,O;let n=null;if(t.clipboardData){const[w,y]=LB.getTextData(t.clipboardData),C=y||vy.INSTANCE.get(w);n=(C==null?void 0:C.id)||null,this._logService.trace("CopyPasteController#handleCopy for id : ",n," with text.length : ",w.length)}else this._logService.trace("CopyPasteController#handleCopy");if(!this._editor.hasTextFocus()||((p=(v=this._clipboardService).clearInternalState)==null||p.call(v),!t.clipboardData||!this.isPasteAsEnabled()))return;const r=this._editor.getModel(),o=this._editor.getSelections();if(!r||!(o!=null&&o.length))return;const s=this._editor.getOption(45);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!s)return;a=[new De(a[0].startLineNumber,1,a[0].startLineNumber,1+r.getLineLength(a[0].startLineNumber))]}const d=(b=this._editor._getViewModel())==null?void 0:b.getPlainTextToCopy(o,s,wh),h={multicursorText:Array.isArray(d)?d:null,pasteOnNewLine:l,mode:null},f=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(w=>!!w.prepareDocumentPaste);if(!f.length){this.setCopyMetadata(t.clipboardData,{defaultPastePayload:h});return}const g=IFn(t.clipboardData),k=f.flatMap(w=>w.copyMimeTypes??[]),A=n??jM();this.setCopyMetadata(t.clipboardData,{id:A,providerCopyMimeTypes:k,defaultPastePayload:h});const m=f.map(w=>({providerMimeTypes:w.copyMimeTypes,operation:zd(y=>w.prepareDocumentPaste(r,a,g,y).catch(C=>{console.error(C)}))}));(O=op._currentCopyOperation)==null||O.operations.forEach(w=>w.operation.cancel()),op._currentCopyOperation={handle:A,operations:m}}async handlePaste(t){var u,h,f;if(t.clipboardData){const[g,k]=LB.getTextData(t.clipboardData),A=k||vy.INSTANCE.get(g);this._logService.trace("CopyPasteController#handlePaste for id : ",A==null?void 0:A.id)}else this._logService.trace("CopyPasteController#handlePaste");if(!t.clipboardData||!this._editor.hasTextFocus())return;(u=R1.get(this._editor))==null||u.closeMessage(),(h=this._currentPasteOperation)==null||h.cancel(),this._currentPasteOperation=void 0;const n=this._editor.getModel(),r=this._editor.getSelections();if(!(r!=null&&r.length)||!n||this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const o=this.fetchCopyMetadata(t);this._logService.trace("CopyPasteController#handlePaste with metadata : ",o==null?void 0:o.id," and text.length : ",t.clipboardData.getData("text/plain").length);const s=NFn(t.clipboardData);s.delete(Q9e);const a=Array.from(t.clipboardData.files).map(g=>g.type),l=[...t.clipboardData.types,...a,...(o==null?void 0:o.providerCopyMimeTypes)??[],Ac.uriList],d=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(g=>{var A,m;const k=(A=this._pasteAsActionContext)==null?void 0:A.preferred;return k&&!this.providerMatchesPreference(g,k)?!1:(m=g.pasteMimeTypes)==null?void 0:m.some(v=>Vyt(v,l))});if(!d.length){(f=this._pasteAsActionContext)!=null&&f.preferred&&(this.showPasteAsNoEditMessage(r,this._pasteAsActionContext.preferred),t.preventDefault(),t.stopImmediatePropagation());return}t.preventDefault(),t.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,d,r,s,o):this.doPasteInline(d,r,s,o,t)}showPasteAsNoEditMessage(t,n){var o;const r="only"in n?n.only.value:"preferences"in n?n.preferences.length?n.preferences.map(s=>s.value).join(", "):j(919,"empty"):n.providerId;(o=R1.get(this._editor))==null||o.showMessage(j(920,"No paste edits for '{0}' found",r),t[0].getStartPosition())}doPasteInline(t,n,r,o,s){this._logService.trace("CopyPasteController#doPasteInline");const a=this._editor;if(!a.hasModel())return;const l=new t6(a,3,void 0),d=zd(async u=>{const h=this._editor;if(!h.hasModel())return;const f=h.getModel(),g=new Pt,k=g.add(new Ya(u));g.add(l.token.onCancellationRequested(()=>k.cancel()));const A=k.token;try{if(await this.mergeInDataFromCopy(t,r,o,A),A.isCancellationRequested)return;const m=t.filter(b=>this.isSupportedPasteProvider(b,r));if(!m.length||m.length===1&&m[0]instanceof PP)return this.applyDefaultPasteHandler(r,o,A,s);const v={triggerKind:D$.Automatic},p=await this.getPasteEdits(m,r,f,n,v,A);if(g.add(p),A.isCancellationRequested)return;if(p.edits.length===1&&p.edits[0].provider instanceof PP)return this.applyDefaultPasteHandler(r,o,A,s);if(p.edits.length){const b=h.getOption(97).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(n,{activeEditIndex:this.getInitialActiveEditIndex(f,p.edits),allEdits:p.edits},b,async(O,w)=>{if(!O.provider.resolveDocumentPasteEdit)return O;const y=O.provider.resolveDocumentPasteEdit(O,w),C=new FM,x=await this._pasteProgressManager.showWhile(n[0].getEndPosition(),j(921,"Resolving paste edit for '{0}'. Click to cancel",O.title),hV(Promise.race([C.p,y]),w),{cancel:()=>C.cancel()},0);return x&&(O.insertText=x.insertText,O.additionalEdit=x.additionalEdit),O},A)}await this.applyDefaultPasteHandler(r,o,A,s)}finally{g.dispose(),this._currentPasteOperation===d&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(n[0].getEndPosition(),j(922,"Running paste handlers. Click to cancel and do basic paste"),d,{cancel:async()=>{d.cancel(),!l.token.isCancellationRequested&&await this.applyDefaultPasteHandler(r,o,l.token,s)}}).finally(()=>{l.dispose()}),this._currentPasteOperation=d}showPasteAsPick(t,n,r,o,s){this._logService.trace("CopyPasteController#showPasteAsPick");const a=zd(async l=>{var g;const d=this._editor;if(!d.hasModel())return;const u=d.getModel(),h=new Pt,f=h.add(new t6(d,3,void 0,l));try{if(await this.mergeInDataFromCopy(n,o,s,f.token),f.token.isCancellationRequested)return;let k=n.filter(b=>this.isSupportedPasteProvider(b,o,t));t&&(k=k.filter(b=>this.providerMatchesPreference(b,t)));const A={triggerKind:D$.PasteAs,only:t&&"only"in t?t.only:void 0};let m=h.add(await this.getPasteEdits(k,o,u,r,A,f.token));if(f.token.isCancellationRequested)return;if(t&&(m={edits:m.edits.filter(b=>"only"in t?t.only.contains(b.kind):"preferences"in t?t.preferences.some(O=>O.contains(b.kind)):t.providerId===b.provider.id),dispose:m.dispose}),!m.edits.length){t&&this.showPasteAsNoEditMessage(r,t);return}let v;if(t)v=m.edits.at(0);else{const b={id:"editor.pasteAs.default",label:j(923,"Configure default paste action"),edit:void 0},O=await this._quickInputService.pick([...m.edits.map(w=>{var y;return{label:w.title,description:(y=w.kind)==null?void 0:y.value,edit:w}}),...op._configureDefaultAction?[{type:"separator"},{label:op._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:j(924,"Select Paste Action")});if(O===b){(g=op._configureDefaultAction)==null||g.run();return}v=O==null?void 0:O.edit}if(!v)return;const p=qFn(u.uri,r,v);await this._bulkEditService.apply(p,{editor:this._editor})}finally{h.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:j(925,"Running paste handlers")},()=>a)}setCopyMetadata(t,n){this._logService.trace("CopyPasteController#setCopyMetadata new id : ",n.id),t.setData(Q9e,JSON.stringify(n))}fetchCopyMetadata(t){if(this._logService.trace("CopyPasteController#fetchCopyMetadata"),!t.clipboardData)return;const n=t.clipboardData.getData(Q9e);if(n)try{return JSON.parse(n)}catch{return}const[r,o]=LB.getTextData(t.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:o.multicursorText??null,pasteOnNewLine:!!o.isFromEmptySelection}}}async mergeInDataFromCopy(t,n,r,o){var s;if(this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ",r==null?void 0:r.id),r!=null&&r.id&&((s=op._currentCopyOperation)==null?void 0:s.handle)===r.id){const a=op._currentCopyOperation.operations.filter(d=>t.some(u=>u.pasteMimeTypes.some(h=>Vyt(h,d.providerMimeTypes)))).map(d=>d.operation),l=await Promise.all(a);if(o.isCancellationRequested)return;for(const d of l.reverse())if(d)for(const[u,h]of d)n.replace(u,h)}if(!n.has(Ac.uriList)){const a=await this._clipboardService.readResources();if(o.isCancellationRequested)return;a.length&&n.append(Ac.uriList,vnt(MOe.create(a)))}}async getPasteEdits(t,n,r,o,s,a){const l=new Pt,d=await hV(Promise.all(t.map(async h=>{var f,g;try{const k=await((f=h.provideDocumentPasteEdits)==null?void 0:f.call(h,r,o,n,s,a));return k&&l.add(k),(g=k==null?void 0:k.edits)==null?void 0:g.map(A=>({...A,provider:h}))}catch(k){Sk(k)||console.error(k);return}})),a),u=YO(d??[]).flat().filter(h=>!s.only||s.only.contains(h.kind));return{edits:GFn(u),dispose:()=>l.dispose()}}async applyDefaultPasteHandler(t,n,r,o){const s=t.get(Ac.text)??t.get("text"),a=await(s==null?void 0:s.asString())??"";if(r.isCancellationRequested)return;const l={clipboardEvent:o,text:a,pasteOnNewLine:(n==null?void 0:n.defaultPastePayload.pasteOnNewLine)??!1,multicursorText:(n==null?void 0:n.defaultPastePayload.multicursorText)??null,mode:null};this._logService.trace("CopyPasteController#applyDefaultPasteHandler for id : ",n==null?void 0:n.id),this._editor.trigger("keyboard","paste",l)}isSupportedPasteProvider(t,n,r){var o;return(o=t.pasteMimeTypes)!=null&&o.some(s=>n.matches(s))?!r||this.providerMatchesPreference(t,r):!1}providerMatchesPreference(t,n){return"only"in n?t.providedPasteEditKinds.some(r=>n.only.contains(r)):"preferences"in n?n.preferences.some(r=>n.preferences.some(o=>o.contains(r))):t.id===n.providerId}getInitialActiveEditIndex(t,n){const r=this._configService.getValue(wwo,{resource:t.uri});for(const o of Array.isArray(r)?r:[]){const s=new Fl(o),a=n.findIndex(l=>s.contains(l.kind));if(a>=0)return a}return 0}},op=_B,_B.ID="editor.contrib.copyPasteActionController",_B);i6=op=Owo([rx(1,$n),rx(2,Oa),rx(3,fre),rx(4,z1),rx(5,Ca),rx(6,cr),rx(7,Zn),rx(8,UA),rx(9,gBn)],i6);const NP="9_cutcopypaste",ywo=wO||document.queryCommandSupported("cut"),tPn=wO||document.queryCommandSupported("copy"),Cwo=typeof navigator.clipboard>"u"||wm?document.queryCommandSupported("paste"):!0;function xnt(e){return e.register(),e}const xwo=ywo?xnt(new dZ({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:wO?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:Yn.MenubarEditMenu,group:"2_ccp",title:j(813,"Cu&&t"),order:1},{menuId:Yn.EditorContext,group:NP,title:j(814,"Cut"),when:Ze.writable,order:1},{menuId:Yn.CommandPalette,group:"",title:j(815,"Cut"),order:1},{menuId:Yn.SimpleEditorContext,group:NP,title:j(816,"Cut"),when:Ze.writable,order:1}]})):void 0,Lwo=tPn?xnt(new dZ({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:wO?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:Yn.MenubarEditMenu,group:"2_ccp",title:j(817,"&&Copy"),order:2},{menuId:Yn.EditorContext,group:NP,title:j(818,"Copy"),order:2},{menuId:Yn.CommandPalette,group:"",title:j(819,"Copy"),order:1},{menuId:Yn.SimpleEditorContext,group:NP,title:j(820,"Copy"),order:2}]})):void 0;ju.appendMenuItem(Yn.MenubarEditMenu,{submenu:Yn.MenubarCopy,title:Et(825,"Copy As"),group:"2_ccp",order:3});ju.appendMenuItem(Yn.EditorContext,{submenu:Yn.EditorContextCopy,title:Et(826,"Copy As"),group:NP,order:3});ju.appendMenuItem(Yn.EditorContext,{submenu:Yn.EditorContextShare,title:Et(827,"Share"),group:"11_share",order:-1,when:zt.and(zt.notEquals("resourceScheme","output"),Ze.editorTextFocus)});ju.appendMenuItem(Yn.ExplorerContext,{submenu:Yn.ExplorerContextShare,title:Et(828,"Share"),group:"11_share",order:-1});const B9e=Cwo?xnt(new dZ({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:wO?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:Yn.MenubarEditMenu,group:"2_ccp",title:j(821,"&&Paste"),order:4},{menuId:Yn.EditorContext,group:NP,title:j(822,"Paste"),when:Ze.writable,order:4},{menuId:Yn.CommandPalette,group:"",title:j(823,"Paste"),order:1},{menuId:Yn.SimpleEditorContext,group:NP,title:j(824,"Paste"),when:Ze.writable,order:4}]})):void 0;class Swo extends Nn{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:Et(829,"Copy with Syntax Highlighting"),precondition:void 0,kbOpts:{kbExpr:Ze.textInputFocus,primary:0,weight:100}})}run(t,n){const r=t.get(Oa);r.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"),!(!n.hasModel()||!n.getOption(45)&&n.getSelection().isEmpty())&&(bje.forceCopyWithSyntaxHighlighting=!0,n.focus(),r.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"),n.getContainerDomNode().ownerDocument.execCommand("copy"),r.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"),bje.forceCopyWithSyntaxHighlighting=!1)}}function nPn(e,t){e&&(e.addImplementation(1e4,"code-editor",(n,r)=>{const o=n.get(Oa);o.trace("registerExecCommandImpl (addImplementation code-editor for : ",t,")");const s=n.get(Co).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const a=s.getOption(45),l=s.getSelection();return l&&l.isEmpty()&&!a||(s.getOption(170)&&t==="cut"?(Kyt(s),o.trace("registerExecCommandImpl (before execCommand copy)"),s.getContainerDomNode().ownerDocument.execCommand("copy"),s.trigger(void 0,"cut",void 0),o.trace("registerExecCommandImpl (after execCommand copy)")):(Kyt(s),o.trace("registerExecCommandImpl (before execCommand "+t+")"),s.getContainerDomNode().ownerDocument.execCommand(t),o.trace("registerExecCommandImpl (after execCommand "+t+")"))),!0}return!1}),e.addImplementation(0,"generic-dom",(n,r)=>{const o=n.get(Oa);return o.trace("registerExecCommandImpl (addImplementation generic-dom for : ",t,")"),o.trace("registerExecCommandImpl (before execCommand "+t+")"),qie().execCommand(t),o.trace("registerExecCommandImpl (after execCommand "+t+")"),!0}))}function Kyt(e){if(e.getOption(170)){const n=Ltt.get(e.getId());n&&n.onWillCopy()}}nPn(xwo,"cut");nPn(Lwo,"copy");B9e&&(B9e.addImplementation(1e4,"code-editor",(e,t)=>{const n=e.get(Oa);n.trace("registerExecCommandImpl (addImplementation code-editor for : paste)");const r=e.get(Co),o=e.get(z1),s=e.get(zA),a=e.get(N3o),l=r.getFocusedCodeEditor();if(l&&l.hasModel()&&l.hasTextFocus()){if(l.getOption(170)){const f=Ltt.get(l.getId());f&&f.onWillPaste()}const u=wu.create(!0);n.trace("registerExecCommandImpl (before triggerPaste)");const h=o.triggerPaste(ks().vscodeWindowId);return h?(n.trace("registerExecCommandImpl (triggerPaste defined)"),h.then(async()=>{var f;if(n.trace("registerExecCommandImpl (after triggerPaste)"),a.quality!=="stable"){const g=u.elapsed();s.publicLog2("editorAsyncPaste",{duration:g})}return((f=i6.get(l))==null?void 0:f.finishedPaste())??Promise.resolve()})):(n.trace("registerExecCommandImpl (triggerPaste undefined)"),aC?(n.trace("registerExecCommandImpl (Paste handling on web)"),(async()=>{const f=await o.readText();if(f!==""){const g=vy.INSTANCE.get(f);let k=!1,A=null,m=null;g&&(k=l.getOption(45)&&!!g.isFromEmptySelection,A=typeof g.multicursorText<"u"?g.multicursorText:null,m=g.mode),n.trace("registerExecCommandImpl (clipboardText.length : ",f.length," id : ",g==null?void 0:g.id,")"),l.trigger("keyboard","paste",{text:f,pasteOnNewLine:k,multicursorText:A,mode:m})}})()):!0)}return!1}),B9e.addImplementation(0,"generic-dom",(e,t)=>(e.get(Oa).trace("registerExecCommandImpl (addImplementation generic-dom for : paste)"),e.get(z1).triggerPaste(ks().vscodeWindowId)??!1)));tPn&&gn(Swo);const ROe=Object.freeze({id:"editor",order:5,type:"object",title:j(147,"Editor"),scope:6}),m1e={...ROe,properties:{"editor.tabSize":{type:"number",default:qh.tabSize,minimum:1,maximum:100,markdownDescription:j(148,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:j(149,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:qh.insertSpaces,markdownDescription:j(150,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:qh.detectIndentation,markdownDescription:j(151,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:qh.trimAutoWhitespace,description:j(152,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:qh.largeFileOptimizations,description:j(153,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[j(154,"Turn off Word Based Suggestions."),j(155,"Only suggest words from the active document."),j(156,"Suggest words from all open documents of the same language."),j(157,"Suggest words from all open documents.")],description:j(158,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[j(159,"Semantic highlighting enabled for all color themes."),j(160,"Semantic highlighting disabled for all color themes."),j(161,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:j(162,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:j(163,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:j(164,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!0,description:j(165,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:j(166,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:j(167,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.experimental.treeSitterTelemetry":{type:"boolean",default:!1,markdownDescription:j(168,"Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.css":{type:"boolean",default:!1,markdownDescription:j(169,"Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.typescript":{type:"boolean",default:!1,markdownDescription:j(170,"Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.ini":{type:"boolean",default:!1,markdownDescription:j(171,"Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.regex":{type:"boolean",default:!1,markdownDescription:j(172,"Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."),tags:["experimental"],experiment:{mode:"auto"}},"editor.language.brackets":{type:["array","null"],default:null,description:j(173,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:j(174,"The opening bracket character or string sequence.")},{type:"string",description:j(175,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:j(176,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:j(177,"The opening bracket character or string sequence.")},{type:"string",description:j(178,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Eh.maxComputationTime,description:j(179,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Eh.maxFileSize,description:j(180,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Eh.renderSideBySide,description:j(181,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Eh.renderSideBySideInlineBreakpoint,description:j(182,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Eh.useInlineViewWhenSpaceIsLimited,description:j(183,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Eh.renderMarginRevertIcon,description:j(184,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Eh.renderGutterMenu,description:j(185,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Eh.ignoreTrimWhitespace,description:j(186,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Eh.renderIndicators,description:j(187,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Eh.diffCodeLens,description:j(188,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Eh.diffWordWrap,markdownEnumDescriptions:[j(189,"Lines will never wrap."),j(190,"Lines will wrap at the viewport width."),j(191,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Eh.diffAlgorithm,markdownEnumDescriptions:[j(192,"Uses the legacy diffing algorithm."),j(193,"Uses the advanced diffing algorithm.")]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Eh.hideUnchangedRegions.enabled,markdownDescription:j(194,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Eh.hideUnchangedRegions.revealLineCount,markdownDescription:j(195,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Eh.hideUnchangedRegions.minimumLineCount,markdownDescription:j(196,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Eh.hideUnchangedRegions.contextLineCount,markdownDescription:j(197,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Eh.experimental.showMoves,markdownDescription:j(198,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Eh.experimental.showEmptyDecorations,description:j(199,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:Eh.experimental.useTrueInlineView,description:j(200,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function Two(e){return typeof e.type<"u"||typeof e.anyOf<"u"}for(const e of EU){const t=e.schema;if(typeof t<"u")if(Two(t))m1e.properties[`editor.${e.name}`]=t;else for(const n in t)Object.hasOwnProperty.call(t,n)&&(m1e.properties[n]=t[n])}let sce=null;function iPn(){return sce===null&&(sce=Object.create(null),Object.keys(m1e.properties).forEach(e=>{sce[e]=!0})),sce}function Ewo(e){return iPn()[`editor.${e}`]||!1}function Dwo(e){return iPn()[`diffEditor.${e}`]||!1}const Qwo=Rl.as(XO.Configuration);Qwo.registerConfiguration(m1e);const ja=new class{constructor(){this.QuickFix=new Fl("quickfix"),this.Refactor=new Fl("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new Fl("notebook"),this.Source=new Fl("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var Z1;(function(e){e.Refactor="refactor",e.RefactorPreview="refactor preview",e.Lightbulb="lightbulb",e.Default="other (default)",e.SourceAction="source action",e.QuickFix="quick fix action",e.FixAll="fix all",e.OrganizeImports="organize imports",e.AutoFix="auto fix",e.QuickFixHover="quick fix hover window",e.OnSave="save participants",e.ProblemsView="problems view"})(Z1||(Z1={}));function Bwo(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some(n=>rPn(t,n,e.include))||!e.includeSourceActions&&ja.Source.contains(t))}function Fwo(e,t){const n=t.kind?new Fl(t.kind):void 0;return!(e.include&&(!n||!e.include.contains(n))||e.excludes&&n&&e.excludes.some(r=>rPn(n,r,e.include))||!e.includeSourceActions&&n&&ja.Source.contains(n)||e.onlyIncludePreferredActions&&!t.isPreferred)}function rPn(e,t,n){return!(!t.contains(e)||n&&t.contains(n))}class Pw{static fromUser(t,n){return!t||typeof t!="object"?new Pw(n.kind,n.apply,!1):new Pw(Pw.getKindFromUser(t,n.kind),Pw.getApplyFromUser(t,n.apply),Pw.getPreferredUser(t))}static getApplyFromUser(t,n){switch(typeof t.apply=="string"?t.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return n}}static getKindFromUser(t,n){return typeof t.kind=="string"?new Fl(t.kind):n}static getPreferredUser(t){return typeof t.preferred=="boolean"?t.preferred:!1}constructor(t,n,r){this.kind=t,this.apply=n,this.preferred=r}}class Pwo{constructor(t,n,r){this.action=t,this.provider=n,this.highlightRange=r}async resolve(t){var n;if((n=this.provider)!=null&&n.resolveCodeAction&&!this.action.edit){let r;try{r=await this.provider.resolveCodeAction(this.action,t)}catch(o){Xc(o)}r&&(this.action.edit=r.edit)}return this}}const oPn="editor.action.codeAction",Lnt="editor.action.quickFix",sPn="editor.action.autoFix",aPn="editor.action.refactor",lPn="editor.action.sourceAction",uHe="editor.action.organizeImports",hHe="editor.action.fixAll",Mwo=1e3;class qK extends ct{static codeActionsPreferredComparator(t,n){return t.isPreferred&&!n.isPreferred?-1:!t.isPreferred&&n.isPreferred?1:0}static codeActionsComparator({action:t},{action:n}){return t.isAI&&!n.isAI?1:!t.isAI&&n.isAI?-1:Qf(t.diagnostics)?Qf(n.diagnostics)?qK.codeActionsPreferredComparator(t,n):-1:Qf(n.diagnostics)?1:qK.codeActionsPreferredComparator(t,n)}constructor(t,n,r){super(),this.documentation=n,this._register(r),this.allActions=[...t].sort(qK.codeActionsComparator),this.validActions=this.allActions.filter(({action:o})=>!o.disabled)}get hasAutoFix(){return this.validActions.some(({action:t})=>!!t.kind&&ja.QuickFix.contains(new Fl(t.kind))&&!!t.isPreferred)}get hasAIFix(){return this.validActions.some(({action:t})=>!!t.isAI)}get allAIFixes(){return this.validActions.every(({action:t})=>!!t.isAI)}}const Jyt={actions:[],documentation:void 0};async function NU(e,t,n,r,o,s){var m;const a=r.filter||{},l={...a,excludes:[...a.excludes||[],ja.Notebook]},d={only:(m=a.include)==null?void 0:m.value,trigger:r.type},u=new Ont(t,s),h=r.type===2,f=Rwo(e,t,h?l:a),g=new Pt,k=f.map(async v=>{const p=setTimeout(()=>o.report(v),1250);try{const b=await v.provideCodeActions(t,n,d,u.token);if(u.token.isCancellationRequested)return b==null||b.dispose(),Jyt;b&&g.add(b);const O=((b==null?void 0:b.actions)||[]).filter(y=>y&&Fwo(a,y)),w=Nwo(v,O,a.include);return{actions:O.map(y=>new Pwo(y,v)),documentation:w}}catch(b){if(Sk(b))throw b;return Xc(b),Jyt}finally{clearTimeout(p)}}),A=e.onDidChange(()=>{const v=e.all(t);za(v,f)||u.cancel()});try{const v=await Promise.all(k),p=v.map(w=>w.actions).flat(),b=[...YO(v.map(w=>w.documentation)),...Iwo(e,t,r,p)],O=new qK(p,b,g);return g.add(O),O}catch(v){throw g.dispose(),v}finally{A.dispose(),u.dispose()}}function Rwo(e,t,n){return e.all(t).filter(r=>r.providedCodeActionKinds?r.providedCodeActionKinds.some(o=>Bwo(n,new Fl(o))):!0)}function*Iwo(e,t,n,r){var o,s,a;if(t&&r.length)for(const l of e.all(t))l._getAdditionalMenuItems&&(yield*(a=l._getAdditionalMenuItems)==null?void 0:a.call(l,{trigger:n.type,only:(s=(o=n.filter)==null?void 0:o.include)==null?void 0:s.value},r.map(d=>d.action)))}function Nwo(e,t,n){if(!e.documentation)return;const r=e.documentation.map(o=>({kind:new Fl(o.kind),command:o.command}));if(n){let o;for(const s of r)s.kind.contains(n)&&(o?o.kind.contains(s.kind)&&(o=s):o=s);if(o)return o==null?void 0:o.command}for(const o of t)if(o.kind){for(const s of r)if(s.kind.contains(new Fl(o.kind)))return s.command}}var Q5;(function(e){e.OnSave="onSave",e.FromProblemsView="fromProblemsView",e.FromCodeActions="fromCodeActions",e.FromAILightbulb="fromAILightbulb",e.FromProblemsHover="fromProblemsHover"})(Q5||(Q5={}));async function Uwo(e,t,n,r,o=Fr.None){var h,f;const s=e.get(fre),a=e.get(Ca),l=e.get(zA),d=e.get(cc),u=e.get(E6);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:n}),u.playSignal(lg.codeActionTriggered),await t.resolve(o),!o.isCancellationRequested&&!((h=t.action.edit)!=null&&h.edits.length&&!(await s.apply(t.action.edit,{editor:r==null?void 0:r.editor,label:t.action.title,quotableLabel:t.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:n!==Q5.OnSave,showPreview:r==null?void 0:r.preview,reason:yA.codeAction({kind:t.action.kind,providerId:yOe.fromExtensionId((f=t.provider)==null?void 0:f.extensionId)})})).isApplied)){if(t.action.command)try{await a.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(g){const k=jwo(g);d.error(typeof k=="string"?k:j(830,"An unknown error occurred while applying the code action"))}setTimeout(()=>u.playSignal(lg.codeActionApplied),Mwo)}}function jwo(e){return typeof e=="string"?e:e instanceof Error&&typeof e.message=="string"?e.message:void 0}ho.registerCommand("_executeCodeActionProvider",async function(e,t,n,r,o){if(!(t instanceof pi))throw _v();const{codeActionProvider:s}=e.get(Zn),a=e.get(pl).getModel(t);if(!a)throw _v();const l=Rn.isISelection(n)?Rn.liftSelection(n):De.isIRange(n)?a.validateRange(n):void 0;if(!l)throw _v();const d=typeof r=="string"?new Fl(r):void 0,u=await NU(s,a,l,{type:1,triggerAction:Z1.Default,filter:{includeSourceActions:!0,include:d}},nO.None,Fr.None),h=[],f=Math.min(u.validActions.length,typeof o=="number"?o:0);for(let g=0;gg.action)}finally{setTimeout(()=>u.dispose(),100)}});var Bl;(function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"})(Bl||(Bl={}));(function(e){function t(d,u){return u-d}e.compare=t;const n=Object.create(null);n[e.Error]=j(1732,"Error"),n[e.Warning]=j(1733,"Warning"),n[e.Info]=j(1734,"Info");function r(d){return n[d]||""}e.toString=r;const o=Object.create(null);o[e.Error]=j(1735,"Errors"),o[e.Warning]=j(1736,"Warnings"),o[e.Info]=j(1737,"Infos");function s(d){return o[d]||""}e.toStringPlural=s;function a(d){switch(d){case Dl.Error:return e.Error;case Dl.Warning:return e.Warning;case Dl.Info:return e.Info;case Dl.Ignore:return e.Hint}}e.fromSeverity=a;function l(d){switch(d){case e.Error:return Dl.Error;case e.Warning:return Dl.Warning;case e.Info:return Dl.Info;case e.Hint:return Dl.Ignore}}e.toSeverity=l})(Bl||(Bl={}));var k1e;(function(e){const t="";function n(o){return r(o,!0)}e.makeKey=n;function r(o,s){const a=[t];return o.source?a.push(o.source.replace("¦","\\¦")):a.push(t),o.code?typeof o.code=="string"?a.push(o.code.replace("¦","\\¦")):a.push(o.code.value.replace("¦","\\¦")):a.push(t),o.severity!==void 0&&o.severity!==null?a.push(Bl.toString(o.severity)):a.push(t),o.message&&s?a.push(o.message.replace("¦","\\¦")):a.push(t),o.startLineNumber!==void 0&&o.startLineNumber!==null?a.push(o.startLineNumber.toString()):a.push(t),o.startColumn!==void 0&&o.startColumn!==null?a.push(o.startColumn.toString()):a.push(t),o.endLineNumber!==void 0&&o.endLineNumber!==null?a.push(o.endLineNumber.toString()):a.push(t),o.endColumn!==void 0&&o.endColumn!==null?a.push(o.endColumn.toString()):a.push(t),a.push(t),a.join("¦")}e.makeKeyOptionalMessage=r})(k1e||(k1e={}));const hC=Lr("markerService");var Wwo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Hwo=function(e,t){return function(n,r){t(n,r,e)}},AHe,$B;let fHe=($B=class{constructor(t){this.keybindingService=t}getResolver(){const t=new Kh(()=>this.keybindingService.getKeybindings().filter(n=>AHe.codeActionCommands.indexOf(n.command)>=0).filter(n=>n.resolvedKeybinding).map(n=>{let r=n.commandArgs;return n.command===uHe?r={kind:ja.SourceOrganizeImports.value}:n.command===hHe&&(r={kind:ja.SourceFixAll.value}),{resolvedKeybinding:n.resolvedKeybinding,...Pw.fromUser(r,{kind:Fl.None,apply:"never"})}}));return n=>{if(n.kind){const r=this.bestKeybindingForCodeAction(n,t.value);return r==null?void 0:r.resolvedKeybinding}}}bestKeybindingForCodeAction(t,n){if(!t.kind)return;const r=new Fl(t.kind);return n.filter(o=>o.kind.contains(r)).filter(o=>o.preferred?t.isPreferred:!0).reduceRight((o,s)=>o?o.kind.contains(s.kind)?s:o:s,void 0)}},AHe=$B,$B.codeActionCommands=[aPn,oPn,lPn,uHe,hHe],$B);fHe=AHe=Wwo([Hwo(0,Fo)],fHe);He("symbolIcon.arrayForeground",Hr,j(1495,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.booleanForeground",Hr,j(1496,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},j(1497,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.colorForeground",Hr,j(1498,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.constantForeground",Hr,j(1499,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},j(1500,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},j(1501,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},j(1502,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},j(1503,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},j(1504,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.fileForeground",Hr,j(1505,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.folderForeground",Hr,j(1506,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},j(1507,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},j(1508,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.keyForeground",Hr,j(1509,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.keywordForeground",Hr,j(1510,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},j(1511,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.moduleForeground",Hr,j(1512,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.namespaceForeground",Hr,j(1513,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.nullForeground",Hr,j(1514,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.numberForeground",Hr,j(1515,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.objectForeground",Hr,j(1516,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.operatorForeground",Hr,j(1517,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.packageForeground",Hr,j(1518,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.propertyForeground",Hr,j(1519,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.referenceForeground",Hr,j(1520,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.snippetForeground",Hr,j(1521,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.stringForeground",Hr,j(1522,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.structForeground",Hr,j(1523,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.textForeground",Hr,j(1524,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.typeParameterForeground",Hr,j(1525,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.unitForeground",Hr,j(1526,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));He("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},j(1527,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const cPn=Object.freeze({kind:Fl.Empty,title:j(866,"More Actions...")}),Vwo=Object.freeze([{kind:ja.QuickFix,title:j(867,"Quick Fix")},{kind:ja.RefactorExtract,title:j(868,"Extract"),icon:Jt.wrench},{kind:ja.RefactorInline,title:j(869,"Inline"),icon:Jt.wrench},{kind:ja.RefactorRewrite,title:j(870,"Rewrite"),icon:Jt.wrench},{kind:ja.RefactorMove,title:j(871,"Move"),icon:Jt.wrench},{kind:ja.SurroundWith,title:j(872,"Surround With"),icon:Jt.surroundWith},{kind:ja.Source,title:j(873,"Source Action"),icon:Jt.symbolFile},cPn]);function zwo(e,t,n){if(!t)return e.map(s=>{var a;return{kind:"action",item:s,group:cPn,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!((a=s.action.edit)!=null&&a.edits.length)}});const r=Vwo.map(s=>({group:s,actions:[]}));for(const s of e){const a=s.action.kind?new Fl(s.action.kind):Fl.None;for(const l of r)if(l.group.kind.contains(a)){l.actions.push(s);break}}const o=[];for(const s of r)if(s.actions.length){o.push({kind:"header",group:s.group});for(const a of s.actions){const l=s.group;o.push({kind:"action",item:a,group:a.action.isAI?{title:l.title,kind:l.kind,icon:Jt.sparkle}:l,label:a.action.title,disabled:!!a.action.disabled,keybinding:n(a.action)})}}return o}const dPn=new Ln("supportedCodeAction",""),_yt="_typescript.applyFixAllCodeAction";class Zwo extends ct{constructor(t,n,r,o=250){super(),this._editor=t,this._markerService=n,this._signalChange=r,this._delay=o,this._autoTriggerTimer=this._register(new U1),this._register(this._markerService.onMarkerChanged(s=>this._onMarkerChanges(s))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(t){const n=this._getRangeOfSelectionUnlessWhitespaceEnclosed(t);this._signalChange(n?{trigger:t,selection:n}:void 0)}_onMarkerChanges(t){const n=this._editor.getModel();n&&t.some(r=>IT(r,n.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Z1.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(t){if(!this._editor.hasModel())return;const n=this._editor.getSelection();if(t.type===1)return n;const r=this._editor.getOption(73).enabled;if(r!==xp.Off){{if(r===xp.On)return n;if(r===xp.OnCode){if(!n.isEmpty())return n;const s=this._editor.getModel(),{lineNumber:a,column:l}=n.getPosition(),d=s.getLineContent(a);if(d.length===0)return;if(l===1){if(/\s/.test(d[0]))return}else if(l===s.getLineMaxColumn(a)){if(/\s/.test(d[d.length-1]))return}else if(/\s/.test(d[l-2])&&/\s/.test(d[l-1]))return}}return n}}}var VD;(function(e){e.Empty={type:0};class t{constructor(r,o,s){this.trigger=r,this.position=o,this._cancellablePromise=s,this.type=1,this.actions=s.catch(a=>{if(Sk(a))return gHe;throw a})}cancel(){this._cancellablePromise.cancel()}}e.Triggered=t})(VD||(VD={}));const gHe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class Ywo extends ct{constructor(t,n,r,o,s,a){super(),this._editor=t,this._registry=n,this._markerService=r,this._progressService=s,this._configurationService=a,this._codeActionOracle=this._register(new is),this._state=VD.Empty,this._onDidChangeState=this._register(new it),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new is),this._disposed=!1,this._supportedCodeActions=dPn.bindTo(o),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(l=>{l.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(VD.Empty,!0))}_settingEnabledNearbyQuickfixes(){var n;const t=(n=this._editor)==null?void 0:n.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(VD.Empty);const t=this._editor.getModel();if(t&&this._registry.has(t)&&!this._editor.getOption(104)){const n=this._registry.all(t).flatMap(r=>r.providedCodeActionKinds??[]);this._supportedCodeActions.set(n.join(" ")),this._codeActionOracle.value=new Zwo(this._editor,this._markerService,r=>{var d;if(!r){this.setState(VD.Empty);return}const o=r.selection.getStartPosition(),s=zd(async u=>{var f,g,k,A,m,v,p,b,O,w;if(this._settingEnabledNearbyQuickfixes()&&r.trigger.type===1&&(r.trigger.triggerAction===Z1.QuickFix||(g=(f=r.trigger.filter)==null?void 0:f.include)!=null&&g.contains(ja.QuickFix))){const y=await NU(this._registry,t,r.selection,r.trigger,nO.None,u);this.codeActionsDisposable.value=y;const C=[...y.allActions];if(u.isCancellationRequested)return y.dispose(),gHe;const x=(k=y.validActions)==null?void 0:k.some(S=>S.action.kind&&ja.QuickFix.contains(new Fl(S.action.kind))&&!S.action.isAI),L=this._markerService.read({resource:t.uri});if(x){for(const S of y.validActions)(m=(A=S.action.command)==null?void 0:A.arguments)!=null&&m.some(E=>typeof E=="string"&&E.includes(_yt))&&(S.action.diagnostics=[...L.filter(E=>E.relatedInformation)]);return{validActions:y.validActions,allActions:C,documentation:y.documentation,hasAutoFix:y.hasAutoFix,hasAIFix:y.hasAIFix,allAIFixes:y.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=y}}}else if(!x&&L.length>0){const S=r.selection.getPosition();let E=S,Q=Number.MAX_VALUE;const T=[...y.validActions];for(const B of L){const P=B.endColumn,F=B.endLineNumber,R=B.startLineNumber;if(F===S.lineNumber||R===S.lineNumber){E=new tt(F,P);const N={type:r.trigger.type,triggerAction:r.trigger.triggerAction,filter:{include:(v=r.trigger.filter)!=null&&v.include?(p=r.trigger.filter)==null?void 0:p.include:ja.QuickFix},autoApply:r.trigger.autoApply,context:{notAvailableMessage:((b=r.trigger.context)==null?void 0:b.notAvailableMessage)||"",position:E}},I=new Rn(E.lineNumber,E.column,E.lineNumber,E.column),W=await NU(this._registry,t,I,N,nO.None,u);if(u.isCancellationRequested)return W.dispose(),gHe;if(W.validActions.length!==0){for(const H of W.validActions)(w=(O=H.action.command)==null?void 0:O.arguments)!=null&&w.some(V=>typeof V=="string"&&V.includes(_yt))&&(H.action.diagnostics=[...L.filter(V=>V.relatedInformation)]);y.allActions.length===0&&C.push(...W.allActions),Math.abs(S.column-P)F.findIndex(R=>R.action.title===B.action.title)===P);return M.sort((B,P)=>B.action.isPreferred&&!P.action.isPreferred?-1:!B.action.isPreferred&&P.action.isPreferred||B.action.isAI&&!P.action.isAI?1:!B.action.isAI&&P.action.isAI?-1:0),{validActions:M,allActions:C,documentation:y.documentation,hasAutoFix:y.hasAutoFix,hasAIFix:y.hasAIFix,allAIFixes:y.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=y}}}}if(r.trigger.type===1){const y=await NU(this._registry,t,r.selection,r.trigger,nO.None,u);return this.codeActionsDisposable.value=y,y}const h=await NU(this._registry,t,r.selection,r.trigger,nO.None,u);return this.codeActionsDisposable.value=h,h});r.trigger.type===1&&((d=this._progressService)==null||d.showWhile(s,250));const a=new VD.Triggered(r.trigger,o,s);let l=!1;this._state.type===1&&(l=this._state.trigger.type===1&&a.type===1&&a.trigger.type===2&&this._state.position!==a.position),l?setTimeout(()=>{this.setState(a)},500):this.setState(a)},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Z1.Default})}else this._supportedCodeActions.reset()}trigger(t){var n;(n=this._codeActionOracle.value)==null||n.trigger(t),this.codeActionsDisposable.dispose()}setState(t,n){t!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=t,!n&&!this._disposed&&this._onDidChangeState.fire(t))}}var Xwo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},qwo=function(e,t){return function(n,r){t(n,r,e)}},YN;const $yt=Ra("gutter-lightbulb",Jt.lightBulb,j(874,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),eCt=Ra("gutter-lightbulb-auto-fix",Jt.lightbulbAutofix,j(875,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),tCt=Ra("gutter-lightbulb-sparkle",Jt.lightbulbSparkle,j(876,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),nCt=Ra("gutter-lightbulb-aifix-auto-fix",Jt.lightbulbSparkleAutofix,j(877,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),iCt=Ra("gutter-lightbulb-sparkle-filled",Jt.sparkleFilled,j(878,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var gb;(function(e){e.Hidden={type:0};class t{constructor(r,o,s,a){this.actions=r,this.trigger=o,this.editorPosition=s,this.widgetPosition=a,this.type=1}}e.Showing=t})(gb||(gb={}));var $L;let iee=($L=class extends ct{constructor(t,n){super(),this._editor=t,this._keybindingService=n,this._onClick=this._register(new it),this.onClick=this._onClick.event,this._state=gb.Hidden,this._gutterState=gb.Hidden,this._iconClasses=[],this.lightbulbClasses=["codicon-"+$yt.id,"codicon-"+nCt.id,"codicon-"+eCt.id,"codicon-"+tCt.id,"codicon-"+iCt.id],this.gutterDecoration=YN.GUTTER_DECORATION,this._domNode=ln("div.lightBulbWidget"),this._domNode.role="listbox",this._register(NA.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(r=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide(),(this.gutterState.type!==1||!o||this.gutterState.editorPosition.lineNumber>=o.getLineCount())&&this.gutterHide()})),this._register(oco(this._domNode,r=>{if(this.state.type!==1)return;this._editor.focus(),r.preventDefault();const{top:o,height:s}=ic(this._domNode),a=this._editor.getOption(75);let l=Math.floor(a/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(r.buttons&1)===1&&this.hide()})),this._register(un.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var r,o;this._preferredKbLabel=((r=this._keybindingService.lookupKeybinding(sPn))==null?void 0:r.getLabel())??void 0,this._quickFixKbLabel=((o=this._keybindingService.lookupKeybinding(Lnt))==null?void 0:o.getLabel())??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async r=>{if(!r.target.element||!this.lightbulbClasses.some(d=>r.target.element&&r.target.element.classList.contains(d))||this.gutterState.type!==1)return;this._editor.focus();const{top:o,height:s}=ic(r.target.element),a=this._editor.getOption(75);let l=Math.floor(a/3);this.gutterState.widgetPosition.position!==null&&this.gutterState.widgetPosition.position.lineNumber22,A=y=>y>2&&this._editor.getTopForLineNumber(y)===this._editor.getTopForLineNumber(y-1),m=this._editor.getLineDecorations(l);let v=!1;if(m)for(const y of m){const C=y.options.glyphMarginClassName;if(C&&!this.lightbulbClasses.some(x=>C.includes(x))){v=!0;break}}let p=l,b=1;if(!k){const y=C=>{const x=a.getLineContent(C);return/^\s*$|^\s+/.test(x)||x.length<=b};if(l>1&&!A(l-1)){const C=a.getLineCount(),x=l===C,L=l>1&&y(l-1),S=!x&&y(l+1),E=y(l),Q=!S&&!L;if(!S&&!L&&!v)return this.gutterState=new gb.Showing(t,n,r,{position:{lineNumber:p,column:b},preference:YN._posPref}),this.renderGutterLightbub(),this.hide();L||x||L&&!E?p-=1:(S||Q&&E)&&(p+=1)}else if(l===1&&(l===a.getLineCount()||!y(l+1)&&!y(l)))if(this.gutterState=new gb.Showing(t,n,r,{position:{lineNumber:p,column:b},preference:YN._posPref}),v)this.gutterHide();else return this.renderGutterLightbub(),this.hide();else if(l{this._gutterDecorationID=n.addDecoration(new De(t,0,t,0),this.gutterDecoration)})}_removeGutterDecoration(t){this._editor.changeDecorations(n=>{n.removeDecoration(t),this._gutterDecorationID=void 0})}_updateGutterDecoration(t,n){this._editor.changeDecorations(r=>{r.changeDecoration(t,new De(n,0,n,0)),r.changeDecorationOptions(t,this.gutterDecoration)})}_updateLightbulbTitle(t,n){this.state.type===1&&(n?this.title=j(879,"Run: {0}",this.state.actions.validActions[0].action.title):t&&this._preferredKbLabel?this.title=j(880,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!t&&this._quickFixKbLabel?this.title=j(881,"Show Code Actions ({0})",this._quickFixKbLabel):t||(this.title=j(882,"Show Code Actions")))}set title(t){this._domNode.title=t}},YN=$L,$L.GUTTER_DECORATION=Ki.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:mi.asClassName(Jt.lightBulb),glyphMargin:{position:CO.Left},stickiness:1}),$L.ID="editor.contrib.lightbulbWidget",$L._posPref=[0],$L);iee=YN=Xwo([qwo(1,Fo)],iee);var Gwo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},L3=function(e,t){return function(n,r){t(n,r,e)}},XN;const Kwo="quickfix-edit-highlight";var lT;let UP=(lT=class extends ct{static get(t){return t.getContribution(XN.ID)}constructor(t,n,r,o,s,a,l,d,u,h,f){super(),this._commandService=l,this._configurationService=d,this._actionWidgetService=u,this._instantiationService=h,this._progressService=f,this._activeCodeActions=this._register(new is),this._showDisabled=!1,this._disposed=!1,this._editor=t,this._model=this._register(new Ywo(this._editor,s.codeActionProvider,n,r,a,d)),this._register(this._model.onDidChangeState(g=>this.update(g))),this._lightBulbWidget=new Kh(()=>{const g=this._editor.getContribution(iee.ID);return g&&this._register(g.onClick(k=>this.showCodeActionsFromLightbulb(k.actions,k))),g}),this._resolver=o.createInstance(fHe),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(t,n){if(t.allAIFixes&&t.validActions.length===1){const r=t.validActions[0],o=r.action.command;o&&o.id==="inlineChat.start"&&o.arguments&&o.arguments.length>=1&&o.arguments[0]&&(o.arguments[0]={...o.arguments[0],autoSend:!1}),await this.applyCodeAction(r,!1,!1,Q5.FromAILightbulb);return}await this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(t,n,r){return this.showCodeActionList(n,r,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(t,n,r,o){var a;if(!this._editor.hasModel())return;(a=R1.get(this._editor))==null||a.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:n,filter:r,autoApply:o,context:{notAvailableMessage:t,position:s}})}_trigger(t){return this._model.trigger(t)}async applyCodeAction(t,n,r,o){const s=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(Uwo,t,o,{preview:r,editor:this._editor})}finally{n&&this._trigger({type:2,triggerAction:Z1.QuickFix,filter:{}}),s.done()}}hideLightBulbWidget(){var t,n;(t=this._lightBulbWidget.rawValue)==null||t.hide(),(n=this._lightBulbWidget.rawValue)==null||n.gutterHide()}async update(t){var o,s,a,l,d;if(t.type!==1){this.hideLightBulbWidget();return}let n;try{n=await t.actions}catch(u){Yi(u);return}if(this._disposed)return;const r=this._editor.getSelection();if((r==null?void 0:r.startLineNumber)===t.position.lineNumber)if((o=this._lightBulbWidget.value)==null||o.update(n,t.trigger,t.position),t.trigger.type===1){if((s=t.trigger.filter)!=null&&s.include){const h=this.tryGetValidActionToApply(t.trigger,n);if(h){try{this.hideLightBulbWidget(),await this.applyCodeAction(h,!1,!1,Q5.FromCodeActions)}finally{n.dispose()}return}if(t.trigger.context){const f=this.getInvalidActionThatWouldHaveBeenApplied(t.trigger,n);if(f&&f.action.disabled){(a=R1.get(this._editor))==null||a.showMessage(f.action.disabled,t.trigger.context.position),n.dispose();return}}}const u=!!((l=t.trigger.filter)!=null&&l.include);if(t.trigger.context&&(!n.allActions.length||!u&&!n.validActions.length)){(d=R1.get(this._editor))==null||d.showMessage(t.trigger.context.notAvailableMessage,t.trigger.context.position),this._activeCodeActions.value=n,n.dispose();return}this._activeCodeActions.value=n,this.showCodeActionList(n,this.toCoords(t.position),{includeDisabledActions:u,fromLightbulb:!1})}else this._actionWidgetService.isVisible?n.dispose():this._activeCodeActions.value=n}getInvalidActionThatWouldHaveBeenApplied(t,n){if(n.allActions.length&&(t.autoApply==="first"&&n.validActions.length===0||t.autoApply==="ifSingle"&&n.allActions.length===1))return n.allActions.find(({action:r})=>r.disabled)}tryGetValidActionToApply(t,n){if(n.validActions.length&&(t.autoApply==="first"&&n.validActions.length>0||t.autoApply==="ifSingle"&&n.validActions.length===1))return n.validActions[0]}async showCodeActionList(t,n,r){const o=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const a=r.includeDisabledActions&&(this._showDisabled||t.validActions.length===0)?t.allActions:t.validActions;if(!a.length)return;const l=tt.isIPosition(n)?this.toCoords(n):n,d={onSelect:async(u,h)=>{this.applyCodeAction(u,!0,!!h,r.fromLightbulb?Q5.FromAILightbulb:Q5.FromCodeActions),this._actionWidgetService.hide(!1),o.clear()},onHide:u=>{var h;(h=this._editor)==null||h.focus(),o.clear()},onHover:async(u,h)=>{var k;if(h.isCancellationRequested)return;let f=!1;const g=u.action.kind;if(g){const A=new Fl(g);f=[ja.RefactorExtract,ja.RefactorInline,ja.RefactorRewrite,ja.RefactorMove,ja.Source].some(v=>v.contains(A))}return{canPreview:f||!!((k=u.action.edit)!=null&&k.edits.length)}},onFocus:u=>{var h,f;if(u&&u.action){const g=u.action.ranges,k=u.action.diagnostics;if(o.clear(),g&&g.length>0){const A=k&&(k==null?void 0:k.length)>1?k.map(m=>({range:m,options:XN.DECORATION})):g.map(m=>({range:m,options:XN.DECORATION}));o.set(A)}else if(k&&k.length>0){const A=k.map(v=>({range:v,options:XN.DECORATION}));o.set(A);const m=k[0];if(m.startLineNumber&&m.startColumn){const v=(f=(h=this._editor.getModel())==null?void 0:h.getWordAtPosition({lineNumber:m.startLineNumber,column:m.startColumn}))==null?void 0:f.word;yO(j(863,"Context: {0} at line {1} and column {2}.",v,m.startLineNumber,m.startColumn))}}}else o.clear()}};this._actionWidgetService.show("codeActionWidget",!0,zwo(a,this._shouldShowHeaders(),this._resolver.getResolver()),d,l,s,this._getActionBarActions(t,n,r))}toCoords(t){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(t,1),this._editor.render();const n=this._editor.getScrolledVisiblePosition(t),r=ic(this._editor.getDomNode()),o=r.left+n.left,s=r.top+n.top+n.height;return{x:o,y:s}}_shouldShowHeaders(){var n;const t=(n=this._editor)==null?void 0:n.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(t,n,r){if(r.fromLightbulb)return[];const o=t.documentation.map(s=>({id:s.id,label:s.title,tooltip:s.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(s.id,...s.arguments??[])}));return r.includeDisabledActions&&t.validActions.length>0&&t.allActions.length!==t.validActions.length&&o.push(this._showDisabled?{id:"hideMoreActions",label:j(864,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(t,n,r))}:{id:"showMoreActions",label:j(865,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(t,n,r))}),o}},XN=lT,lT.ID="editor.contrib.codeActionController",lT.DECORATION=Ki.register({description:"quickfix-highlight",className:Kwo}),lT);UP=XN=Gwo([L3(1,hC),L3(2,Fi),L3(3,$n),L3(4,Zn),L3(5,e6),L3(6,Ca),L3(7,cr),L3(8,CE),L3(9,$n),L3(10,e6)],UP);x2((e,t)=>{((o,s)=>{s&&t.addRule(`.monaco-editor ${o} { background-color: ${s}; }`)})(".quickfix-edit-highlight",e.getColor(WL));const r=e.getColor(y5);r&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${AO(e.type)?"dotted":"solid"} ${r}; box-sizing: border-box; }`)});function kre(e){return zt.regex(dPn.keys()[0],new RegExp("(\\s|^)"+j1(e.value)+"\\b"))}const Snt={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:j(831,"Kind of the code action to run.")},apply:{type:"string",description:j(832,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[j(833,"Always apply the first returned code action."),j(834,"Apply the first returned code action if it is the only one."),j(835,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:j(836,"Controls if only preferred code actions should be returned.")}}};function YM(e,t,n,r,o=Z1.Default){if(e.hasModel()){const s=UP.get(e);s==null||s.manualTriggerAtCurrentPosition(t,o,n,r)}}class Jwo extends Nn{constructor(){super({id:Lnt,label:Et(853,"Quick Fix..."),precondition:zt.and(Ze.writable,Ze.hasCodeActionsProvider),kbOpts:{kbExpr:Ze.textInputFocus,primary:2137,weight:100}})}run(t,n){return YM(n,j(837,"No code actions available"),void 0,void 0,Z1.QuickFix)}}class _wo extends $d{constructor(){super({id:oPn,precondition:zt.and(Ze.writable,Ze.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:Snt}]}})}runEditorCommand(t,n,r){const o=Pw.fromUser(r,{kind:Fl.Empty,apply:"ifSingle"});return YM(n,typeof(r==null?void 0:r.kind)=="string"?o.preferred?j(838,"No preferred code actions for '{0}' available",r.kind):j(839,"No code actions for '{0}' available",r.kind):o.preferred?j(840,"No preferred code actions available"):j(841,"No code actions available"),{include:o.kind,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply)}}class $wo extends Nn{constructor(){super({id:aPn,label:Et(854,"Refactor..."),precondition:zt.and(Ze.writable,Ze.hasCodeActionsProvider),kbOpts:{kbExpr:Ze.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:zt.and(Ze.writable,kre(ja.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:Snt}]}})}run(t,n,r){const o=Pw.fromUser(r,{kind:ja.Refactor,apply:"never"});return YM(n,typeof(r==null?void 0:r.kind)=="string"?o.preferred?j(842,"No preferred refactorings for '{0}' available",r.kind):j(843,"No refactorings for '{0}' available",r.kind):o.preferred?j(844,"No preferred refactorings available"):j(845,"No refactorings available"),{include:ja.Refactor.contains(o.kind)?o.kind:Fl.None,onlyIncludePreferredActions:o.preferred},o.apply,Z1.Refactor)}}class eyo extends Nn{constructor(){super({id:lPn,label:Et(855,"Source Action..."),precondition:zt.and(Ze.writable,Ze.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:zt.and(Ze.writable,kre(ja.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:Snt}]}})}run(t,n,r){const o=Pw.fromUser(r,{kind:ja.Source,apply:"never"});return YM(n,typeof(r==null?void 0:r.kind)=="string"?o.preferred?j(846,"No preferred source actions for '{0}' available",r.kind):j(847,"No source actions for '{0}' available",r.kind):o.preferred?j(848,"No preferred source actions available"):j(849,"No source actions available"),{include:ja.Source.contains(o.kind)?o.kind:Fl.None,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply,Z1.SourceAction)}}class tyo extends Nn{constructor(){super({id:uHe,label:Et(856,"Organize Imports"),precondition:zt.and(Ze.writable,kre(ja.SourceOrganizeImports)),kbOpts:{kbExpr:Ze.textInputFocus,primary:1581,weight:100},metadata:{description:Et(857,"Organize imports in the current file. Also called 'Optimize Imports' by some tools")}})}run(t,n){return YM(n,j(850,"No organize imports action available"),{include:ja.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Z1.OrganizeImports)}}class nyo extends Nn{constructor(){super({id:hHe,label:Et(858,"Fix All"),precondition:zt.and(Ze.writable,kre(ja.SourceFixAll))})}run(t,n){return YM(n,j(851,"No fix all action available"),{include:ja.SourceFixAll,includeSourceActions:!0},"ifSingle",Z1.FixAll)}}class iyo extends Nn{constructor(){super({id:sPn,label:Et(859,"Auto Fix..."),precondition:zt.and(Ze.writable,kre(ja.QuickFix)),kbOpts:{kbExpr:Ze.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(t,n){return YM(n,j(852,"No auto fixes available"),{include:ja.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Z1.AutoFix)}}mo(UP.ID,UP,3);mo(iee.ID,iee,4);gn(Jwo);gn($wo);gn(eyo);gn(tyo);gn(iyo);gn(nyo);xn(new _wo);Rl.as(XO.Configuration).registerConfiguration({...ROe,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:6,description:j(860,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});Rl.as(XO.Configuration).registerConfiguration({...ROe,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:6,description:j(861,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});Rl.as(XO.Configuration).registerConfiguration({...ROe,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:6,markdownDescription:j(862,"Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});const k2e=class k2e{constructor(){this.lenses=[]}dispose(){var t;(t=this._store)==null||t.dispose()}get isDisposed(){var t;return((t=this._store)==null?void 0:t.isDisposed)??!1}add(t,n){BM(t)&&(this._store??(this._store=new Pt),this._store.add(t));for(const r of t.lenses)this.lenses.push({symbol:r,provider:n})}};k2e.Empty=new k2e;let FV=k2e;async function uPn(e,t,n){const r=e.ordered(t),o=new Map,s=new FV,a=r.map(async(l,d)=>{o.set(l,d);try{const u=await Promise.resolve(l.provideCodeLenses(t,n));u&&s.add(u,l)}catch(u){Xc(u)}});return await Promise.all(a),n.isCancellationRequested?(s.dispose(),FV.Empty):(s.lenses=s.lenses.sort((l,d)=>l.symbol.range.startLineNumberd.symbol.range.startLineNumber?1:o.get(l.provider)o.get(d.provider)?1:l.symbol.range.startColumnd.symbol.range.startColumn?1:0),s)}ho.registerCommand("_executeCodeLensProvider",function(e,...t){let[n,r]=t;yo(pi.isUri(n)),yo(typeof r=="number"||!r);const{codeLensProvider:o}=e.get(Zn),s=e.get(pl).getModel(n);if(!s)throw _v();const a=[],l=new Pt;return uPn(o,s,Fr.None).then(d=>{l.add(d);const u=[];for(const h of d.lenses)r==null||h.symbol.command?a.push(h.symbol):r-- >0&&h.provider.resolveCodeLens&&u.push(Promise.resolve(h.provider.resolveCodeLens(s,h.symbol,Fr.None)).then(f=>a.push(f||h.symbol)));return Promise.all(u)}).then(()=>a).finally(()=>{setTimeout(()=>l.dispose(),100)})});var ryo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},oyo=function(e,t){return function(n,r){t(n,r,e)}};const hPn=Lr("ICodeLensCache");class rCt{constructor(t,n){this.lineCount=t,this.data=n}}let mHe=class{constructor(t){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new S4(20,.75);const n="codelens/cache";_q(Ls,()=>t.remove(n,1));const r="codelens/cache2",o=t.get(r,1,"{}");this._deserialize(o);const s=un.filter(t.onWillSaveState,a=>a.reason===J5.SHUTDOWN);un.once(s)(a=>{t.store(r,this._serialize(),1,1)})}put(t,n){const r=n.lenses.map(a=>{var l;return{range:a.symbol.range,command:a.symbol.command&&{id:"",title:(l=a.symbol.command)==null?void 0:l.title}}}),o=new FV;o.add({lenses:r},this._fakeProvider);const s=new rCt(t.getLineCount(),o);this._cache.set(t.uri.toString(),s)}get(t){const n=this._cache.get(t.uri.toString());return n&&n.lineCount===t.getLineCount()?n.data:void 0}delete(t){this._cache.delete(t.uri.toString())}_serialize(){const t=Object.create(null);for(const[n,r]of this._cache){const o=new Set;for(const s of r.data.lenses)o.add(s.symbol.range.startLineNumber);t[n]={lineCount:r.lineCount,lines:[...o.values()]}}return JSON.stringify(t)}_deserialize(t){try{const n=JSON.parse(t);for(const r in n){const o=n[r],s=[];for(const l of o.lines)s.push({range:new De(l,1,l,11)});const a=new FV;a.add({lenses:s},this._fakeProvider),this._cache.set(r,new rCt(o.lineCount,a))}}catch{}}};mHe=ryo([oyo(0,jf)],mHe);qr(hPn,mHe,1);class syo{constructor(t,n,r){this.afterColumn=1073741824,this.afterLineNumber=t,this.heightInPx=n,this._onHeight=r,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(t){this._lastHeight===void 0?this._lastHeight=t:this._lastHeight!==t&&(this._lastHeight=t,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}const zJ=class zJ{constructor(t,n){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=t,this._id=`codelens.widget-${zJ._idPool++}`,this.updatePosition(n),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(t,n){this._commands.clear();const r=[];let o=!1;for(let s=0;s{u.symbol.command&&d.push(u.symbol),r.addDecoration({range:u.symbol.range,options:oCt},f=>this._decorationIds[h]=f),l?l=De.plusRange(l,u.symbol.range):l=De.lift(u.symbol.range)}),this._viewZone=new syo(l.startLineNumber-1,s,a),this._viewZoneId=o.addZone(this._viewZone),d.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(d,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new kHe(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(t,n){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],n==null||n.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((t,n)=>{const r=this._editor.getModel().getDecorationRange(t),o=this._data[n].symbol;return!!(r&&De.isEmpty(o.range)===r.isEmpty())})}updateCodeLensSymbols(t,n){this._decorationIds.forEach(n.removeDecoration,n),this._decorationIds=[],this._data=t,this._data.forEach((r,o)=>{n.addDecoration({range:r.symbol.range,options:oCt},s=>this._decorationIds[o]=s)})}updateHeight(t,n){this._viewZone.heightInPx=t,n.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(t){if(!this._viewZone.isVisible())return null;for(let n=0;n=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},aCt=function(e,t){return function(n,r){t(n,r,e)}};const L2=Lr("ILanguageFeatureDebounceService");var v1e;(function(e){const t=new WeakMap;let n=0;function r(o){let s=t.get(o);return s===void 0&&(s=++n,t.set(o,s)),s}e.of=r})(v1e||(v1e={}));class lyo{constructor(t){this._default=t}get(t){return this._default}update(t,n){return this._default}default(){return this._default}}class cyo{constructor(t,n,r,o,s,a){this._logService=t,this._name=n,this._registry=r,this._default=o,this._min=s,this._max=a,this._cache=new S4(50,.7)}_key(t){return t.id+this._registry.all(t).reduce((n,r)=>Rbe(v1e.of(r),n),0)}get(t){const n=this._key(t),r=this._cache.get(n);return r?ng(r.value,this._min,this._max):this.default()}update(t,n){const r=this._key(t);let o=this._cache.get(r);o||(o=new abo(6),this._cache.set(r,o));const s=ng(o.update(n),this._min,this._max);return Mbe(t.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${t.uri.toString()} is ${s}ms`),s}_overall(){const t=new tFn;for(const[,n]of this._cache)t.update(n.value);return t.value}default(){const t=this._overall()|0||this._default;return ng(t,this._min,this._max)}}let vHe=class{constructor(t,n){this._logService=t,this._data=new Map,this._isDev=n.isExtensionDevelopment||!n.isBuilt}for(t,n,r){const o=(r==null?void 0:r.min)??50,s=(r==null?void 0:r.max)??o**2,a=(r==null?void 0:r.key)??void 0,l=`${v1e.of(t)},${o}${a?","+a:""}`;let d=this._data.get(l);return d||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${n}] is disabled in developed mode`),d=new lyo(o*1.5)):d=new cyo(this._logService,n,t,this._overallAverage()|0||o*1.5,o,s),this._data.set(l,d)),d}_overallAverage(){const t=new tFn;for(const n of this._data.values())t.update(n.default());return t.value}};vHe=ayo([aCt(0,Oa),aCt(1,Tnt)],vHe);qr(L2,vHe,1);var dyo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},VX=function(e,t){return function(n,r){t(n,r,e)}},aH;let ree=(aH=class{constructor(t,n,r,o,s,a){this._editor=t,this._languageFeaturesService=n,this._commandService=o,this._notificationService=s,this._codeLensCache=a,this._disposables=new Pt,this._localToDispose=new Pt,this._lenses=[],this._oldCodeLensModels=new Pt,this._provideCodeLensDebounce=r.for(n.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=r.for(n.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Ss(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(l=>{(l.hasChanged(59)||l.hasChanged(25)||l.hasChanged(24))&&this._updateLensStyle(),l.hasChanged(23)&&this._onModelChange()})),this._disposables.add(n.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var t;this._localDispose(),this._localToDispose.dispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(t=this._currentCodeLensModel)==null||t.dispose()}_getLayoutInfo(){const t=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61));let n=this._editor.getOption(25);return(!n||n<5)&&(n=this._editor.getOption(61)*.9|0),{fontSize:n,codeLensHeight:n*t|0}}_updateLensStyle(){const{codeLensHeight:t,fontSize:n}=this._getLayoutInfo(),r=this._editor.getOption(24),o=this._editor.getOption(59),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${n}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",o.fontFeatureSettings),r&&(s.setProperty("--vscode-editorCodeLens-fontFamily",r),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",pm.fontFamily)),this._editor.changeViewZones(a=>{for(const l of this._lenses)l.updateHeight(t,a)})}_localDispose(){var t,n,r;(t=this._getCodeLensModelPromise)==null||t.cancel(),this._getCodeLensModelPromise=void 0,(n=this._resolveCodeLensesPromise)==null||n.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(r=this._currentCodeLensModel)==null||r.dispose()}_onModelChange(){this._localDispose();const t=this._editor.getModel();if(!t||!this._editor.getOption(23)||t.isTooLargeForTokenization())return;const n=this._codeLensCache.get(t);if(n&&this._renderCodeLensSymbols(n),!this._languageFeaturesService.codeLensProvider.has(t)){n&&z8(()=>{const o=this._codeLensCache.get(t);n===o&&(this._codeLensCache.delete(t),this._onModelChange())},30*1e3,this._localToDispose);return}for(const o of this._languageFeaturesService.codeLensProvider.all(t))if(typeof o.onDidChange=="function"){const s=o.onDidChange(()=>r.schedule());this._localToDispose.add(s)}const r=new Ss(()=>{var s;const o=Date.now();(s=this._getCodeLensModelPromise)==null||s.cancel(),this._getCodeLensModelPromise=zd(a=>uPn(this._languageFeaturesService.codeLensProvider,t,a)),this._getCodeLensModelPromise.then(a=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=a,this._codeLensCache.put(t,a);const l=this._provideCodeLensDebounce.update(t,Date.now()-o);r.delay=l,this._renderCodeLensSymbols(a),this._resolveCodeLensesInViewportSoon()},Yi)},this._provideCodeLensDebounce.get(t));this._localToDispose.add(r),this._localToDispose.add(Gn(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var o;this._editor.changeDecorations(s=>{this._editor.changeViewZones(a=>{const l=[];let d=-1;this._lenses.forEach(h=>{!h.isValid()||d===h.getLineNumber()?l.push(h):(h.update(a),d=h.getLineNumber())});const u=new F9e;l.forEach(h=>{h.dispose(u,a),this._lenses.splice(this._lenses.indexOf(h),1)}),u.commit(s)})}),r.schedule(),this._resolveCodeLensesScheduler.cancel(),(o=this._resolveCodeLensesPromise)==null||o.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{r.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{r.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(o=>{o.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Gn(()=>{if(this._editor.getModel()){const o=SO.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(a=>{this._disposeAllLenses(s,a)})}),o.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(o=>{if(o.target.type!==9)return;let s=o.target.element;if((s==null?void 0:s.tagName)==="SPAN"&&(s=s.parentElement),(s==null?void 0:s.tagName)==="A")for(const a of this._lenses){const l=a.getCommand(s);if(l){this._commandService.executeCommand(l.id,...l.arguments||[]).catch(d=>this._notificationService.error(d));break}}})),r.schedule()}_disposeAllLenses(t,n){const r=new F9e;for(const o of this._lenses)o.dispose(r,n);t&&r.commit(t),this._lenses.length=0}_renderCodeLensSymbols(t){if(!this._editor.hasModel())return;const n=this._editor.getModel().getLineCount(),r=[];let o;for(const l of t.lenses){const d=l.symbol.range.startLineNumber;d<1||d>n||(o&&o[o.length-1].symbol.range.startLineNumber===d?o.push(l):(o=[l],r.push(o)))}if(!r.length&&!this._lenses.length)return;const s=SO.capture(this._editor),a=this._getLayoutInfo();this._editor.changeDecorations(l=>{this._editor.changeViewZones(d=>{const u=new F9e;let h=0,f=0;for(;fthis._resolveCodeLensesInViewportSoon())),h++,f++)}for(;hthis._resolveCodeLensesInViewportSoon())),f++;u.commit(l)})}),s.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var a;(a=this._resolveCodeLensesPromise)==null||a.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const n=[],r=[];if(this._lenses.forEach(l=>{const d=l.computeIfNecessary(t);d&&(n.push(d),r.push(l))}),n.length===0){this._oldCodeLensModels.clear();return}const o=Date.now(),s=zd(l=>{const d=n.map((u,h)=>{const f=new Array(u.length),g=u.map((k,A)=>!k.symbol.command&&typeof k.provider.resolveCodeLens=="function"?Promise.resolve(k.provider.resolveCodeLens(t,k.symbol,l)).then(m=>{f[A]=m},Xc):(f[A]=k.symbol,Promise.resolve(void 0)));return Promise.all(g).then(()=>{!l.isCancellationRequested&&!r[h].isDisposed()&&r[h].updateCommands(f)})});return Promise.all(d)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const l=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=l,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},l=>{Yi(l),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var t;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,(t=this._currentCodeLensModel)!=null&&t.isDisposed?void 0:this._currentCodeLensModel}},aH.ID="css.editor.codeLens",aH);ree=dyo([VX(1,Zn),VX(2,L2),VX(3,Ca),VX(4,cc),VX(5,hPn)],ree);mo(ree.ID,ree,1);gn(class extends Nn{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:Ze.hasCodeLensProvider,label:Et(884,"Show CodeLens Commands for Current Line")})}async run(t,n){if(!n.hasModel())return;const r=t.get(UA),o=t.get(Ca),s=t.get(cc),a=n.getSelection().positionLineNumber,l=n.getContribution(ree.ID);if(!l)return;const d=await l.getModel();if(!d)return;const u=[];for(const g of d.lenses)g.symbol.command&&g.symbol.range.startLineNumber===a&&u.push({label:g.symbol.command.title,command:g.symbol.command});if(u.length===0)return;const h=await r.pick(u,{canPickMany:!1,placeHolder:j(883,"Select a command")});if(!h)return;let f=h.command;if(d.isDisposed){const g=await l.getModel(),k=g==null?void 0:g.lenses.find(A=>{var m;return A.symbol.range.startLineNumber===a&&((m=A.symbol.command)==null?void 0:m.title)===f.title});if(!k||!k.symbol.command)return;f=k.symbol.command}try{await o.executeCommand(f.id,...f.arguments||[])}catch(g){s.error(g)}}});const APn=[];function SZ(e){APn.push(e)}function uyo(){return APn.slice(0)}class P9e{constructor(t,n,r,o){this.priority=t,this.range=n,this.initialMousePosX=r,this.initialMousePosY=o,this.type=1}equals(t){return t.type===1&&this.range.equalsRange(t.range)}canAdoptVisibleHover(t,n){return t.type===1&&n.lineNumber===this.range.startLineNumber}}class oG{constructor(t,n,r,o,s,a){this.priority=t,this.owner=n,this.range=r,this.initialMousePosX=o,this.initialMousePosY=s,this.supportsMarkerHover=a,this.type=2}equals(t){return t.type===2&&this.owner===t.owner}canAdoptVisibleHover(t,n){return t.type===2&&this.owner===t.owner}}class jP{constructor(t,n){this.renderedHoverParts=t,this.disposables=n}dispose(){var t;for(const n of this.renderedHoverParts)n.dispose();(t=this.disposables)==null||t.dispose()}}const XM=new class{constructor(){this._participants=[]}register(t){this._participants.push(t)}getAll(){return this._participants}};var fPn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},pHe=function(e,t){return function(n,r){t(n,r,e)}};let oee=class{constructor(t){this._editorWorkerService=t}async provideDocumentColors(t,n){return this._editorWorkerService.computeDefaultDocumentColors(t.uri)}provideColorPresentations(t,n,r){const o=n.range,s=n.color,a=s.alpha,l=new Ut(new Vt(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),a)),d=a?Ut.Format.CSS.formatRGBA(l):Ut.Format.CSS.formatRGB(l),u=a?Ut.Format.CSS.formatHSLA(l):Ut.Format.CSS.formatHSL(l),h=a?Ut.Format.CSS.formatHexA(l):Ut.Format.CSS.formatHex(l),f=[];return f.push({label:d,textEdit:{range:o,text:d}}),f.push({label:u,textEdit:{range:o,text:u}}),f.push({label:h,textEdit:{range:o,text:h}}),f}};oee=fPn([pHe(0,Bm)],oee);let bHe=class extends ct{constructor(t,n){super(),this._register(t.colorProvider.register("*",new oee(n)))}};bHe=fPn([pHe(0,Zn),pHe(1,Bm)],bHe);async function gPn(e,t,n,r="auto"){return Ent(new hyo,e,t,n,r)}function mPn(e,t,n,r){return Promise.resolve(n.provideColorPresentations(e,t,r))}class hyo{constructor(){}async compute(t,n,r,o){const s=await t.provideDocumentColors(n,r);if(Array.isArray(s))for(const a of s)o.push({colorInfo:a,provider:t});return Array.isArray(s)}}class Ayo{constructor(){}async compute(t,n,r,o){const s=await t.provideDocumentColors(n,r);if(Array.isArray(s))for(const a of s)o.push({range:a.range,color:[a.color.red,a.color.green,a.color.blue,a.color.alpha]});return Array.isArray(s)}}class fyo{constructor(t){this.colorInfo=t}async compute(t,n,r,o){const s=await t.provideColorPresentations(n,this.colorInfo,Fr.None);return Array.isArray(s)&&o.push(...s),Array.isArray(s)}}async function Ent(e,t,n,r,o){let s=!1,a;const l=[],d=t.ordered(n);for(let u=d.length-1;u>=0;u--){const h=d[u];if(o!=="always"&&h instanceof oee)a=h;else try{await e.compute(h,n,r,l)&&(s=!0)}catch(f){Xc(f)}}return s?l:a&&o!=="never"?(await e.compute(a,n,r,l),l):[]}function kPn(e,t){const{colorProvider:n}=e.get(Zn),r=e.get(pl).getModel(t);if(!r)throw _v();const o=e.get(cr).getValue("editor.defaultColorDecorators",{resource:t});return{model:r,colorProviderRegistry:n,defaultColorDecoratorsEnablement:o}}var gyo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},M9e=function(e,t){return function(n,r){t(n,r,e)}},OHe;const vPn=Object.create({});var cT;let PV=(cT=class extends ct{constructor(t,n,r,o){super(),this._editor=t,this._configurationService=n,this._languageFeaturesService=r,this._localToDispose=this._register(new Pt),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new myo),this._colorDecorationClassRefs=this._register(new Pt),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new kme(this._editor)),this._debounceInformation=o.for(r.colorProvider,"Document Colors",{min:OHe.RECOMPUTE_TIME}),this._register(t.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(t.onDidChangeModelLanguage(()=>this.updateColors())),this._register(r.colorProvider.onDidChange(()=>this.updateColors())),this._register(t.onDidChangeConfiguration(s=>{const a=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167);const l=a!==this._isColorDecoratorsEnabled||s.hasChanged(27),d=s.hasChanged(167);(l||d)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167),this.updateColors()}isEnabled(){const t=this._editor.getModel();if(!t)return!1;const n=t.getLanguageId(),r=this._configurationService.getValue(n);if(r&&typeof r=="object"){const o=r.colorDecorators;if(o&&o.enable!==void 0&&!o.enable)return o.enable}return this._editor.getOption(26)}static get(t){return t.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const t=this._editor.getModel();!t||!this._languageFeaturesService.colorProvider.has(t)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new U1,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(t)))})),this.beginCompute())}async beginCompute(){this._computePromise=zd(async t=>{const n=this._editor.getModel();if(!n)return[];const r=new wu(!1),o=await gPn(this._languageFeaturesService.colorProvider,n,t,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(n,r.elapsed()),o});try{const t=await this._computePromise;this.updateDecorations(t),this.updateColorDecorators(t),this._computePromise=null}catch(t){Yi(t)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(t){const n=t.map(r=>({range:{startLineNumber:r.colorInfo.range.startLineNumber,startColumn:r.colorInfo.range.startColumn,endLineNumber:r.colorInfo.range.endLineNumber,endColumn:r.colorInfo.range.endColumn},options:Ki.EMPTY}));this._editor.changeDecorations(r=>{this._decorationsIds=r.deltaDecorations(this._decorationsIds,n),this._colorDatas=new Map,this._decorationsIds.forEach((o,s)=>this._colorDatas.set(o,t[s]))})}updateColorDecorators(t){this._colorDecorationClassRefs.clear();const n=[],r=this._editor.getOption(27);for(let s=0;sthis._colorDatas.has(o.id));return r.length===0?null:this._colorDatas.get(r[0].id)}isColorDecoration(t){return this._colorDecoratorIds.has(t)}},OHe=cT,cT.ID="editor.contrib.colorDetector",cT.RECOMPUTE_TIME=1e3,cT);PV=OHe=gyo([M9e(1,cr),M9e(2,Zn),M9e(3,L2)],PV);class myo extends ct{constructor(){super(...arguments),this._onDidChange=this._register(new it),this._computed=0,this._limited=!1}update(t,n){(t!==this._computed||n!==this._limited)&&(this._computed=t,this._limited=n,this._onDidChange.fire())}}const pPn="editor.action.showHover",kyo="editor.action.showDefinitionPreviewHover",vyo="editor.action.hideHover",pyo="editor.action.scrollUpHover",byo="editor.action.scrollDownHover",Oyo="editor.action.scrollLeftHover",wyo="editor.action.scrollRightHover",yyo="editor.action.pageUpHover",Cyo="editor.action.pageDownHover",xyo="editor.action.goToTopHover",Lyo="editor.action.goToBottomHover",IOe="editor.action.increaseHoverVerbosityLevel",Syo=j(1102,"Increase Hover Verbosity Level"),NOe="editor.action.decreaseHoverVerbosityLevel",Tyo=j(1103,"Decrease Hover Verbosity Level"),see="editor.action.inlineSuggest.commit",bPn="editor.action.inlineSuggest.showPrevious",OPn="editor.action.inlineSuggest.showNext",Eyo="editor.action.inlineSuggest.jump",wPn="editor.action.inlineSuggest.hide",wHe="editor.action.inlineSuggest.toggleShowCollapsed";var Dnt=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Qp=function(e,t){return function(n,r){t(n,r,e)}},Phe;let yHe=class extends ct{constructor(t,n,r){super(),this.editor=t,this.model=n,this.instantiationService=r,this.alwaysShowToolbar=es(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar==="always"),this.sessionPosition=void 0,this.position=Wt(this,o=>{var d,u;const s=(d=this.model.read(o))==null?void 0:d.primaryGhostText.read(o);if(!this.alwaysShowToolbar.read(o)||!s||s.parts.length===0)return this.sessionPosition=void 0,null;const a=s.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==s.lineNumber&&(this.sessionPosition=void 0);const l=new tt(s.lineNumber,Math.min(a,((u=this.sessionPosition)==null?void 0:u.column)??Number.MAX_SAFE_INTEGER));return this.sessionPosition=l,l}),this._register(PA((o,s)=>{const a=this.model.read(o);if(!a||!this.alwaysShowToolbar.read(o))return;const l=Wt(u=>{const h=u.store.add(this.instantiationService.createInstance(MV.hot.read(u),this.editor,!0,this.position,a.selectedInlineCompletionIndex,a.inlineCompletionsCount,a.activeCommands,a.warning,()=>{}));return t.addContentWidget(h),u.store.add(Gn(()=>t.removeContentWidget(h))),u.store.add(xi(f=>{this.position.read(f)&&a.lastTriggerKind.read(f)!==im.Explicit&&a.triggerExplicitly()})),h}),d=S6(this,(u,h)=>!!this.position.read(u)||!!h);s.add(xi(u=>{d.read(u)&&l.read(u)}))}))}};yHe=Dnt([Qp(2,$n)],yHe);const Dyo=Ra("inline-suggestion-hints-next",Jt.chevronRight,j(1207,"Icon for show next parameter hint.")),Qyo=Ra("inline-suggestion-hints-previous",Jt.chevronLeft,j(1208,"Icon for show previous parameter hint."));var zw;let MV=(zw=class extends ct{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(t,n,r){const o=new ak(t,n,r,!0,()=>this._commandService.executeCommand(t)),s=this.keybindingService.lookupKeybinding(t,this._contextKeyService);let a=n;return s&&(a=j(1209,"{0} ({1})",n,s.getLabel())),o.tooltip=a,o}constructor(t,n,r,o,s,a,l,d,u,h,f,g,k){super(),this.editor=t,this.withBorder=n,this._position=r,this._currentSuggestionIdx=o,this._suggestionCount=s,this._extraCommands=a,this._warning=l,this._relayout=d,this._commandService=u,this.keybindingService=f,this._contextKeyService=g,this._menuService=k,this.id=`InlineSuggestionHintsContentWidget${Phe.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=Wt(A=>{const m=this._warning.read(A);return m?typeof m.message=="string"?m.message:A.store.add(lre(m.message)).element:void 0}),this._warningMessageNode=ur.div({class:"warningMessage",style:{maxWidth:400,margin:4,marginBottom:4,display:Wt(A=>this._warning.read(A)?"block":"none")}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=wo("div.inlineSuggestionsHints",{className:this.withBorder?"monaco-hover monaco-hover-content":""},[this._warningMessageNode.element,wo("div@toolBar")]),this.previousAction=this._register(this.createCommandAction(bPn,j(1210,"Previous"),mi.asClassName(Qyo))),this.availableSuggestionCountAction=this._register(new ak("inlineSuggestionHints.availableSuggestionCount","",void 0,!1)),this.nextAction=this._register(this.createCommandAction(OPn,j(1211,"Next"),mi.asClassName(Dyo))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Yn.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Ss(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Ss(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(xi(A=>{this._warningMessageContentNode.read(A),this._warningMessageNode.readEffect(A),this._relayout()})),this.toolBar=this._register(h.createInstance(CHe,this.nodes.toolBar,Yn.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:A=>A.startsWith("primary")},actionViewItemProvider:(A,m)=>{if(A instanceof lk)return h.createInstance(Fyo,A,void 0);if(A===this.availableSuggestionCountAction){const v=new Byo(void 0,A,{label:!0,icon:!1});return v.setClass("availableSuggestionCount"),v}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(A=>{Phe._dropDownVisible=A})),this._register(xi(A=>{this._position.read(A),this.editor.layoutContentWidget(this)})),this._register(xi(A=>{const m=this._suggestionCount.read(A),v=this._currentSuggestionIdx.read(A);m!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${v+1}/${m}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),m!==void 0&&m>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(xi(A=>{const v=this._extraCommands.read(A).map(p=>({class:void 0,id:p.command.id,enabled:!0,tooltip:p.command.tooltip||"",label:p.command.title,run:b=>this._commandService.executeCommand(p.command.id)}));for(const[p,b]of this.inlineCompletionsActionsMenus.getActions())for(const O of b)O instanceof lk&&v.push(O);v.length>0&&v.unshift(new Ld),this.toolBar.setAdditionalSecondaryActions(v)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}},Phe=zw,zw.hot=SOe(zw),zw._dropDownVisible=!1,zw.id=0,zw);MV=Phe=Dnt([Qp(8,Ca),Qp(9,$n),Qp(10,Fo),Qp(11,Fi),Qp(12,y2)],MV);class Byo extends QV{constructor(){super(...arguments),this._className=void 0}setClass(t){this._className=t}render(t){super.render(t),this._className&&t.classList.add(this._className)}updateTooltip(){}}class Fyo extends ZT{updateLabel(){const t=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!t)return super.updateLabel();if(this.label){const n=wo("div.keybinding").root;this._register(new LZ(n,x1,{disableTitle:!0,...gwo})).set(t),this.label.textContent=this._action.label,this.label.appendChild(n),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}}let CHe=class extends r1e{constructor(t,n,r,o,s,a,l,d,u){super(t,{resetMenu:n,...r},o,s,a,l,d,u),this.menuId=n,this.options2=r,this.menuService=o,this.contextKeyService=s,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this.additionalPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var r,o,s,a,l,d,u;const{primary:t,secondary:n}=wFn(this.menu.getActions((r=this.options2)==null?void 0:r.menuOptions),(s=(o=this.options2)==null?void 0:o.toolbarOptions)==null?void 0:s.primaryGroup,(l=(a=this.options2)==null?void 0:a.toolbarOptions)==null?void 0:l.shouldInlineSubmenu,(u=(d=this.options2)==null?void 0:d.toolbarOptions)==null?void 0:u.useSeparatorsInPrimaryActions);n.push(...this.additionalActions),t.unshift(...this.prependedPrimaryActions),t.push(...this.additionalPrimaryActions),this.setActions(t,n)}setPrependedPrimaryActions(t){za(this.prependedPrimaryActions,t,(n,r)=>n===r)||(this.prependedPrimaryActions=t,this.updateToolbar())}setAdditionalSecondaryActions(t){za(this.additionalActions,t,(n,r)=>n===r)||(this.additionalActions=t,this.updateToolbar())}};CHe=Dnt([Qp(3,y2),Qp(4,Fi),Qp(5,Ek),Qp(6,Fo),Qp(7,Ca),Qp(8,zA)],CHe);function UOe(e,t,n){const r=ic(e);return!(tr.left+r.width||nr.top+r.height)}class Pyo{constructor(t,n,r,o){this.value=t,this.isComplete=n,this.hasLoadingMessage=r,this.options=o}}class yPn extends ct{constructor(t,n){super(),this._editor=t,this._computer=n,this._onResult=this._register(new it),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new R9e(r=>this._triggerAsyncComputation(r),0)),this._syncComputationScheduler=this._register(new R9e(r=>this._triggerSyncComputation(r),0)),this._loadingMessageScheduler=this._register(new R9e(r=>this._triggerLoadingMessage(r),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._options=void 0,super.dispose()}get _hoverTime(){return this._editor.getOption(69).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(t,n){this._options=n,this._state=t,this._fireResult(n)}_triggerAsyncComputation(t){this._setState(2,t),this._syncComputationScheduler.schedule(t,this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=Bao(n=>this._computer.computeAsync(t,n)),(async()=>{try{for await(const n of this._asyncIterable)n&&(this._result.push(n),this._fireResult(t));this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0,t)}catch(n){Yi(n)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(t){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync(t))),this._setState(this._asyncIterableDone?0:3,t)}_triggerLoadingMessage(t){this._state===3&&this._setState(4,t)}_fireResult(t){if(this._state===1||this._state===2)return;const n=this._state===0,r=this._state===4;this._onResult.fire(new Pyo(this._result.slice(0),n,r,t))}start(t,n){if(t===0)this._state===0&&(this._setState(1,n),this._asyncComputationScheduler.schedule(n,this._firstWaitTime),this._loadingMessageScheduler.schedule(n,this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(n),this._syncComputationScheduler.cancel(),this._triggerSyncComputation(n);break;case 2:this._syncComputationScheduler.cancel(),this._triggerSyncComputation(n);break}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}}class R9e extends ct{constructor(t,n){super(),this._scheduler=this._register(new Ss(()=>t(this._options),n))}schedule(t,n){this._options=t,this._scheduler.schedule(n)}cancel(){this._scheduler.cancel()}}class Qnt{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new it,this._onDidResize=new it,this._sashListener=new Pt,this._size=new ds(0,0),this._minSize=new ds(0,0),this._maxSize=new ds(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new OA(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new OA(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new OA(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:_me.North}),this._southSash=new OA(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:_me.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let t,n=0,r=0;this._sashListener.add(un.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{t===void 0&&(this._onDidWillResize.fire(),t=this._size,n=0,r=0)})),this._sashListener.add(un.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{t!==void 0&&(t=void 0,n=0,r=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(o=>{t&&(r=o.currentX-o.startX,this.layout(t.height+n,t.width+r),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(o=>{t&&(r=-(o.currentX-o.startX),this.layout(t.height+n,t.width+r),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(o=>{t&&(n=-(o.currentY-o.startY),this.layout(t.height+n,t.width+r),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(o=>{t&&(n=o.currentY-o.startY,this.layout(t.height+n,t.width+r),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(un.any(this._eastSash.onDidReset,this._westSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(un.any(this._northSash.onDidReset,this._southSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(t,n,r,o){this._northSash.state=t?3:0,this._eastSash.state=n?3:0,this._southSash.state=r?3:0,this._westSash.state=o?3:0}layout(t=this.size.height,n=this.size.width){const{height:r,width:o}=this._minSize,{height:s,width:a}=this._maxSize;t=Math.max(r,Math.min(s,t)),n=Math.max(o,Math.min(a,n));const l=new ds(n,t);ds.equals(l,this._size)||(this.domNode.style.height=t+"px",this.domNode.style.width=n+"px",this._size=l,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(t){this._maxSize=t}get maxSize(){return this._maxSize}set minSize(t){this._minSize=t}get minSize(){return this._minSize}set preferredSize(t){this._preferredSize=t}get preferredSize(){return this._preferredSize}}const Myo=30,Ryo=24;class Iyo extends ct{constructor(t,n=new ds(10,10)){super(),this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new Qnt),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=ds.lift(n),this._resizableNode.layout(n.height,n.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(r=>{this._resize(new ds(r.dimension.width,r.dimension.height)),r.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var t;return(t=this._contentPosition)!=null&&t.position?tt.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(t){const n=this._editor.getDomNode(),r=this._editor.getScrolledVisiblePosition(t);return!n||!r?void 0:ic(n).top+r.top-Myo}_availableVerticalSpaceBelow(t){const n=this._editor.getDomNode(),r=this._editor.getScrolledVisiblePosition(t);if(!n||!r)return;const o=ic(n),s=MT(n.ownerDocument.body),a=o.top+r.top+r.height;return s.height-a-Ryo}_findPositionPreference(t,n){const r=Math.min(this._availableVerticalSpaceBelow(n)??1/0,t),o=Math.min(this._availableVerticalSpaceAbove(n)??1/0,t),s=Math.min(Math.max(o,r),t),a=Math.min(t,s);let l;return this._editor.getOption(69).above?l=a<=o?1:2:l=a<=r?2:1,l===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),l}_resize(t){this._resizableNode.layout(t.height,t.width)}}const ace=ln;let Bnt=class extends ct{constructor(t){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.classList.toggle("fade-in",!!t),this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new tre(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class jOe extends ct{static render(t,n,r){return new jOe(t,n,r)}constructor(t,n,r){super(),this.actionLabel=n.label,this.actionKeybindingLabel=r,this.actionContainer=tn(t,ace("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=tn(this.actionContainer,ace("a.action")),this.action.setAttribute("role","button"),n.iconClass&&tn(this.action,ace("span.icon")).classList.add(...n.iconClass.split(" ")),this.actionRenderedLabel=r?`${n.label} (${r})`:n.label;const o=tn(this.action,ace("span"));o.textContent=this.actionRenderedLabel,this._store.add(new xPn(this.actionContainer,n.run)),this._store.add(new LPn(this.actionContainer,n.run,[3,10])),this.setEnabled(!0)}setEnabled(t){t?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function CPn(e,t){return e&&t?j(7,"Inspect this in the accessible view with {0}.",t):e?j(8,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class xPn extends ct{constructor(t,n){super(),this._register(pt(t,cn.CLICK,r=>{r.stopPropagation(),r.preventDefault(),n(t)}))}}class LPn extends ct{constructor(t,n,r){super(),this._register(pt(t,cn.KEY_DOWN,o=>{const s=new Hs(o);r.some(a=>s.equals(a))&&(o.stopPropagation(),o.preventDefault(),n(t))}))}}var Nyo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},lce=function(e,t){return function(n,r){t(n,r,e)}},sp;const lCt=30;var dT;let xHe=(dT=class extends Iyo{get isVisibleFromKeyboard(){var t;return((t=this._renderedHover)==null?void 0:t.source)===2}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(t,n,r,o,s){const a=t.getOption(75)+8,l=150,d=new ds(l,a);super(t,d),this._configurationService=r,this._accessibilityService=o,this._keybindingService=s,this._hover=this._register(new Bnt(!0)),this._onDidResize=this._register(new it),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new it),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new it),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=d,this._hoverVisibleKey=Ze.hoverVisible.bindTo(n),this._hoverFocusedKey=Ze.hoverFocused.bindTo(n),tn(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._resizableNode.domNode.className="monaco-resizable-hover",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(h=>{h.hasChanged(59)&&this._updateFont()}));const u=this._register(f2(this._resizableNode.domNode));this._register(u.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(u.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._register(this._hover.scrollbar.onScroll(h=>{this._onDidScroll.fire(h)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){var t;super.dispose(),(t=this._renderedHover)==null||t.dispose(),this._editor.removeContentWidget(this)}getId(){return sp.ID}static _applyDimensions(t,n,r){const o=typeof n=="number"?`${n}px`:n,s=typeof r=="number"?`${r}px`:r;t.style.width=o,t.style.height=s}_setContentsDomNodeDimensions(t,n){const r=this._hover.contentsDomNode;return sp._applyDimensions(r,t,n)}_setContainerDomNodeDimensions(t,n){const r=this._hover.containerDomNode;return sp._applyDimensions(r,t,n)}_setScrollableElementDimensions(t,n){const r=this._hover.scrollbar.getDomNode();return sp._applyDimensions(r,t,n)}_setHoverWidgetDimensions(t,n){this._setContainerDomNodeDimensions(t,n),this._setScrollableElementDimensions(t,n),this._setContentsDomNodeDimensions(t,n),this._layoutContentWidget()}static _applyMaxDimensions(t,n,r){const o=typeof n=="number"?`${n}px`:n,s=typeof r=="number"?`${r}px`:r;t.style.maxWidth=o,t.style.maxHeight=s}_setHoverWidgetMaxDimensions(t,n){sp._applyMaxDimensions(this._hover.contentsDomNode,t,n),sp._applyMaxDimensions(this._hover.scrollbar.getDomNode(),t,n),sp._applyMaxDimensions(this._hover.containerDomNode,t,n),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof t=="number"?`${t}px`:t),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(t){this._setHoverWidgetMaxDimensions("none","none"),this._setHoverWidgetDimensions(t.width,t.height)}_updateResizableNodeMaxDimensions(){const t=this._findMaximumRenderingWidth()??1/0,n=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new ds(t,n),this._setHoverWidgetMaxDimensions(t,n)}_resize(t){sp._lastDimensions=new ds(t.width,t.height),this._setAdjustedHoverWidgetDimensions(t),this._resizableNode.layout(t.height,t.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){var n;const t=(n=this._renderedHover)==null?void 0:n.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const t=this._findAvailableSpaceVertically();if(!t)return;let r=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach(o=>{r+=o.clientHeight}),Math.min(t,r)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const t=Array.from(this._hover.contentsDomNode.children).some(n=>n.scrollWidth>n.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),t}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const t=this._isHoverTextOverflowing(),n=typeof this._contentWidth>"u"?0:this._contentWidth;return t||this._hover.containerDomNode.clientWidththis._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,o),!0)}_setRenderedHover(t){var n;(n=this._renderedHover)==null||n.dispose(),this._renderedHover=t,this._hoverVisibleKey.set(!!t),this._hover.containerDomNode.classList.toggle("hidden",!t)}_updateFont(){const{fontSize:t,lineHeight:n}=this._editor.getOption(59),r=this._hover.contentsDomNode;r.style.fontSize=`${t}px`,r.style.lineHeight=`${n/t}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(s=>this._editor.applyFontInfo(s))}_updateContent(t){const n=this._hover.contentsDomNode;n.style.paddingBottom="",n.textContent="",n.appendChild(t)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const t=Math.max(this._editor.getLayoutInfo().height/4,250,sp._lastDimensions.height),n=Math.max(this._editor.getLayoutInfo().width*.66,750,sp._lastDimensions.width);this._resizableNode.maxSize=new ds(n,t),this._setHoverWidgetMaxDimensions(n,t)}_render(t){this._setRenderedHover(t),this._updateFont(),this._updateContent(t.domNode),this.handleContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(t){var a;if(!this._editor||!this._editor.hasModel())return;this._render(t);const n=UL(this._hover.containerDomNode),r=t.showAtPosition;this._positionPreference=this._findPositionPreference(n,r)??1,this.handleContentsChanged(),t.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const s=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&CPn(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),((a=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))==null?void 0:a.getAriaLabel())??"");s&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+s)}hide(){if(!this._renderedHover)return;const t=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new ds(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),t&&this._editor.focus()}_removeConstraintsRenderNormally(){const t=this._editor.getLayoutInfo();this._resizableNode.layout(t.height,t.width),this._setHoverWidgetDimensions("auto","auto"),this._updateMaxDimensions()}setMinimumDimensions(t){this._minimumSize=new ds(Math.max(this._minimumSize.width,t.width),Math.max(this._minimumSize.height,t.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const t=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new ds(t,this._minimumSize.height)}handleContentsChanged(){var o;this._removeConstraintsRenderNormally();const t=this._hover.contentsDomNode;let n=UL(t),r=h1(t)+2;if(this._resizableNode.layout(n,r),this._setHoverWidgetDimensions(r,n),n=UL(t),r=h1(t),this._contentWidth=r,this._updateMinimumWidth(),this._resizableNode.layout(n,r),(o=this._renderedHover)!=null&&o.showAtPosition){const s=UL(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(s,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const t=this._hover.scrollbar.getScrollPosition().scrollTop,n=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:t-n.lineHeight})}scrollDown(){const t=this._hover.scrollbar.getScrollPosition().scrollTop,n=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:t+n.lineHeight})}scrollLeft(){const t=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:t-lCt})}scrollRight(){const t=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:t+lCt})}pageUp(){const t=this._hover.scrollbar.getScrollPosition().scrollTop,n=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:t-n})}pageDown(){const t=this._hover.scrollbar.getScrollPosition().scrollTop,n=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:t+n})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}},sp=dT,dT.ID="editor.contrib.resizableContentHoverWidget",dT._lastDimensions=new ds(0,0),dT);xHe=sp=Nyo([lce(1,Fi),lce(2,cr),lce(3,xh),lce(4,Fo)],xHe);function cCt(e,t,n,r,o,s){const a=n+o/2,l=r+s/2,d=Math.max(Math.abs(e-a)-o/2,0),u=Math.max(Math.abs(t-l)-s/2,0);return Math.sqrt(d*d+u*u)}class p1e{constructor(t,n){this._editor=t,this._participants=n}static _getLineDecorations(t,n){if(n.type!==1&&!n.supportsMarkerHover)return[];const r=t.getModel(),o=n.range.startLineNumber;if(o>r.getLineCount())return[];const s=r.getLineMaxColumn(o);return t.getLineDecorations(o).filter(a=>{if(a.options.isWholeLine)return!0;const l=a.range.startLineNumber===o?a.range.startColumn:1,d=a.range.endLineNumber===o?a.range.endColumn:s;if(a.options.showIfCollapsed){if(l>n.range.startColumn+1||n.range.endColumn-1>d)return!1}else if(l>n.range.startColumn||n.range.endColumn>d)return!1;return!0})}computeAsync(t,n){const r=t.anchor;if(!this._editor.hasModel()||!r)return $v.EMPTY;const o=p1e._getLineDecorations(this._editor,r);return $v.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(r,o,t.source,n):$v.EMPTY))}computeSync(t){if(!this._editor.hasModel())return[];const n=t.anchor,r=p1e._getLineDecorations(this._editor,n);let o=[];for(const s of this._participants)o=o.concat(s.computeSync(n,r,t.source));return YO(o)}}class SPn{constructor(t,n,r){this.hoverParts=t,this.isComplete=n,this.options=r}filter(t){const n=this.hoverParts.filter(r=>r.isValidForHoverAnchor(t));return n.length===this.hoverParts.length?this:new Uyo(this,n,this.isComplete,this.options)}}class Uyo extends SPn{constructor(t,n,r,o){super(n,r,o),this.original=t}filter(t){return this.original.filter(t)}}var jyo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},dCt=function(e,t){return function(n,r){t(n,r,e)}};const uCt=ln;let b1e=class extends ct{get hasContent(){return this._hasContent}constructor(t,n){super(),this._keybindingService=t,this._hoverService=n,this.actions=[],this._hasContent=!1,this.hoverElement=uCt("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=tn(this.hoverElement,uCt("div.actions"))}addAction(t){const n=this._keybindingService.lookupKeybinding(t.commandId),r=n?n.getLabel():null;this._hasContent=!0;const o=this._register(jOe.render(this.actionsElement,t,r));return this._register(this._hoverService.setupManagedHover(dC("element"),o.actionContainer,o.actionRenderedLabel)),this.actions.push(o),o}append(t){const n=tn(this.actionsElement,t);return this._hasContent=!0,n}};b1e=jyo([dCt(0,Fo),dCt(1,Lg)],b1e);const TPn={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class F6 extends $1{get onChange(){return this._onChange.event}get onKeyDown(){return this._onKeyDown.event}constructor(t){super(),this._onChange=this._register(new it),this._onKeyDown=this._register(new it),this._opts=t,this._title=this._opts.title,this._checked=this._opts.isChecked;const n=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,n.push(...mi.asClassNameArray(this._icon))),this._opts.actionClassName&&n.push(...this._opts.actionClassName.split(" ")),this._checked&&n.push("checked"),this.domNode=document.createElement("div"),this._register(E4().setupDelayedHover(this.domNode,()=>({content:this._title,style:1}),this._opts.hoverLifecycleOptions)),this.domNode.classList.add(...n),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.setTitle(this._opts.title),this.applyStyles(),this.onclick(this.domNode,r=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),r.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,r=>{if(this.enabled){if(r.keyCode===10||r.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),r.preventDefault(),r.stopPropagation();return}this._onKeyDown.fire(r)}})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(t){this._checked=t,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(t){this._icon&&this.domNode.classList.remove(...mi.asClassNameArray(this._icon)),this._icon=t,this._icon&&this.domNode.classList.add(...mi.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1)),this.domNode.classList.remove("disabled")}disable(){this.domNode.setAttribute("aria-disabled",String(!0)),this.domNode.classList.add("disabled")}setTitle(t){this._title=t,this.domNode.setAttribute("aria-label",t)}set visible(t){this.domNode.style.display=t?"":"none"}get visible(){return this.domNode.style.display!=="none"}}const _at=class _at extends $1{constructor(t,n,r){super(),this.checkbox=t,this.domNode=n,this.styles=r,this._onChange=this._register(new it),this.onChange=this._onChange.event,this.applyStyles()}get enabled(){return this.checkbox.enabled}enable(){this.checkbox.enable(),this.applyStyles(!0)}disable(){this.checkbox.disable(),this.applyStyles(!1)}setTitle(t){this.checkbox.setTitle(t)}applyStyles(t=this.enabled){this.domNode.style.color=(t?this.styles.checkboxForeground:this.styles.checkboxDisabledForeground)||"",this.domNode.style.backgroundColor=(t?this.styles.checkboxBackground:this.styles.checkboxDisabledBackground)||"",this.domNode.style.borderColor=(t?this.styles.checkboxBorder:this.styles.checkboxDisabledBackground)||"";const n=this.styles.size||18;this.domNode.style.width=this.domNode.style.height=this.domNode.style.fontSize=`${n}px`,this.domNode.style.fontSize=`${n-2}px`}};_at.CLASS_NAME="monaco-checkbox";let aee=_at,EPn=class extends aee{constructor(t,n,r){const o=new F6({title:t,isChecked:n,icon:Jt.check,actionClassName:aee.CLASS_NAME,hoverLifecycleOptions:r.hoverLifecycleOptions,...TPn});super(o,o.domNode,r),this._register(o),this._register(this.checkbox.onChange(s=>{this.applyStyles(),this._onChange.fire(s)}))}get checked(){return this.checkbox.checked}set checked(t){this.checkbox.checked=t,this.applyStyles()}applyStyles(t){this.checkbox.checked?this.checkbox.setIcon(Jt.check):this.checkbox.setIcon(void 0),super.applyStyles(t)}};class DPn extends aee{constructor(t,n,r){let o;switch(n){case!0:o=Jt.check;break;case"mixed":o=Jt.dash;break;case!1:o=void 0;break}const s=new F6({title:t,isChecked:n===!0,icon:o,actionClassName:EPn.CLASS_NAME,hoverLifecycleOptions:r.hoverLifecycleOptions,...TPn});super(s,s.domNode,r),this._state=n,this._register(s),this._register(this.checkbox.onChange(a=>{this._state=this.checkbox.checked,this.applyStyles(),this._onChange.fire(a)}))}get checked(){return this._state}set checked(t){this._state!==t&&(this._state=t,this.checkbox.checked=t===!0,this.applyStyles())}applyStyles(t){switch(this._state){case!0:this.checkbox.setIcon(Jt.check);break;case"mixed":this.checkbox.setIcon(Jt.dash);break;case!1:this.checkbox.setIcon(void 0);break}super.applyStyles(t)}}const sf=class sf{constructor(t){this._editor=t,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const t=this._findScopeDecorationIds.map(n=>this._editor.getModel().getDecorationRange(n)).filter(n=>!!n);if(t.length)return t}return null}getStartPosition(){return this._startPosition}setStartPosition(t){this._startPosition=t,this.setCurrentFindMatch(null)}_getDecorationIndex(t){const n=this._decorations.indexOf(t);return n>=0?n+1:1}getDecorationRangeAt(t){const n=t{if(this._highlightedDecorationId!==null&&(o.changeDecorationOptions(this._highlightedDecorationId,sf._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),n!==null&&(this._highlightedDecorationId=n,o.changeDecorationOptions(this._highlightedDecorationId,sf._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(o.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),n!==null){let s=this._editor.getModel().getDecorationRange(n);if(s.startLineNumber!==s.endLineNumber&&s.endColumn===1){const a=s.endLineNumber-1,l=this._editor.getModel().getLineMaxColumn(a);s=new De(s.startLineNumber,s.startColumn,a,l)}this._rangeHighlightDecorationId=o.addDecoration(s,sf._RANGE_HIGHLIGHT_DECORATION)}}),r}set(t,n){this._editor.changeDecorations(r=>{let o=sf._FIND_MATCH_DECORATION;const s=[];if(t.length>1e3){o=sf._FIND_MATCH_NO_OVERVIEW_DECORATION;const l=this._editor.getModel().getLineCount(),u=this._editor.getLayoutInfo().height/l,h=Math.max(2,Math.ceil(3/u));let f=t[0].range.startLineNumber,g=t[0].range.endLineNumber;for(let k=1,A=t.length;k=m.startLineNumber?m.endLineNumber>g&&(g=m.endLineNumber):(s.push({range:new De(f,1,g,1),options:sf._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),f=m.startLineNumber,g=m.endLineNumber)}s.push({range:new De(f,1,g,1),options:sf._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const a=new Array(t.length);for(let l=0,d=t.length;lr.removeDecoration(l)),this._findScopeDecorationIds=[]),n!=null&&n.length&&(this._findScopeDecorationIds=n.map(l=>r.addDecoration(l,sf._FIND_SCOPE_DECORATION)))})}matchBeforePosition(t){if(this._decorations.length===0)return null;for(let n=this._decorations.length-1;n>=0;n--){const r=this._decorations[n],o=this._editor.getModel().getDecorationRange(r);if(!(!o||o.endLineNumber>t.lineNumber)){if(o.endLineNumbert.column))return o}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(t){if(this._decorations.length===0)return null;for(let n=0,r=this._decorations.length;nt.lineNumber)return s;if(!(s.startColumn0){const r=[];for(let a=0;aDe.compareRangesUsingStarts(a.range,l.range));const o=[];let s=r[0];for(let a=1;a0?t[0].toUpperCase()+t.substr(1):e[0][0].toUpperCase()!==e[0][0]&&t.length>0?t[0].toLowerCase()+t.substr(1):t}else return t}function hCt(e,t,n){return e[0].indexOf(n)!==-1&&t.indexOf(n)!==-1&&e[0].split(n).length===t.split(n).length}function ACt(e,t,n){const r=t.split(n),o=e[0].split(n);let s="";return r.forEach((a,l)=>{s+=QPn([o[l]],a)+n}),s.slice(0,-1)}class fCt{constructor(t){this.staticValue=t,this.kind=0}}class Hyo{constructor(t){this.pieces=t,this.kind=1}}class RV{static fromStaticValue(t){return new RV([FB.staticValue(t)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(t){!t||t.length===0?this._state=new fCt(""):t.length===1&&t[0].staticValue!==null?this._state=new fCt(t[0].staticValue):this._state=new Hyo(t)}buildReplaceString(t,n){if(this._state.kind===0)return n?QPn(t,this._state.staticValue):this._state.staticValue;let r="";for(let o=0,s=this._state.pieces.length;o0){const d=[],u=a.caseOps.length;let h=0;for(let f=0,g=l.length;f=u){d.push(l.slice(f));break}switch(a.caseOps[h]){case"U":d.push(l[f].toUpperCase());break;case"u":d.push(l[f].toUpperCase()),h++;break;case"L":d.push(l[f].toLowerCase());break;case"l":d.push(l[f].toLowerCase()),h++;break;default:d.push(l[f])}}l=d.join("")}r+=l}return r}static _substitute(t,n){if(n===null)return"";if(t===0)return n[0];let r="";for(;t>0;){if(t=o)break;const a=e.charCodeAt(r);switch(a){case 92:n.emitUnchanged(r-1),n.emitStatic("\\",r+1);break;case 110:n.emitUnchanged(r-1),n.emitStatic(` `,r+1);break;case 116:n.emitUnchanged(r-1),n.emitStatic(" ",r+1);break;case 117:case 85:case 108:case 76:n.emitUnchanged(r-1),n.emitStatic("",r+1),t.push(String.fromCharCode(a));break}continue}if(s===36){if(r++,r>=o)break;const a=e.charCodeAt(r);if(a===36){n.emitUnchanged(r-1),n.emitStatic("$",r+1);continue}if(a===48||a===38){n.emitUnchanged(r-1),n.emitMatchIndex(0,r+1,t),t.length=0;continue}if(49<=a&&a<=57){let l=a-48;if(r+1{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(r=>{(r.reason===3||r.reason===5||r.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(r=>{this._ignoreModelContentChanged||(r.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(r=>this._onStateChanged(r))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,hs(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(t){this._isDisposed||this._editor.hasModel()&&(t.searchString||t.isReplaceRevealed||t.isRegex||t.wholeWord||t.matchCase||t.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{t.searchScope?this.research(t.moveCursor,this._state.searchScope):this.research(t.moveCursor)},Zyo)):t.searchScope?this.research(t.moveCursor,this._state.searchScope):this.research(t.moveCursor))}static _getSearchRange(t,n){return n||t.getFullModelRange()}research(t,n){let r=null;typeof n<"u"?n!==null&&(Array.isArray(n)?r=n:r=[n]):r=this._decorations.getFindScopes(),r!==null&&(r=r.map(l=>{if(l.startLineNumber!==l.endLineNumber){let d=l.endLineNumber;return l.endColumn===1&&(d=d-1),new De(l.startLineNumber,1,d,this._editor.getModel().getLineMaxColumn(d))}return l}));const o=this._findMatches(r,!1,B5);this._decorations.set(o,r);const s=this._editor.getSelection();let a=this._decorations.getCurrentMatchesPosition(s);if(a===0&&o.length>0){const l=T$(o.map(d=>d.range),d=>De.compareRangesUsingStarts(d,s)>=0);a=l>0?l-1+1:a}this._state.changeMatchInfo(a,this._decorations.getCount(),void 0),t&&this._editor.getOption(50).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const t=this._decorations.getFindScope();return t&&this._editor.revealRangeInCenterIfOutsideViewport(t,0),!0}return!1}_setCurrentFindMatch(t){const n=this._decorations.setCurrentFindMatch(t);this._state.changeMatchInfo(n,this._decorations.getCount(),t),this._editor.setSelection(t),this._editor.revealRangeInCenterIfOutsideViewport(t,0)}_prevSearchPosition(t){const n=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:r,column:o}=t;const s=this._editor.getModel();return n||o===1?(r===1?r=s.getLineCount():r--,o=s.getLineMaxColumn(r)):o--,new tt(r,o)}_moveToPrevMatch(t,n=!1){if(!this._state.canNavigateBack()){const h=this._decorations.matchAfterPosition(t);h&&this._setCurrentFindMatch(h);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:r,column:o}=t;const s=this._editor.getModel();return n||o===s.getLineMaxColumn(r)?(r===s.getLineCount()?r=1:r++,o=1):o++,new tt(r,o)}_moveToNextMatch(t){if(!this._state.canNavigateForward()){const r=this._decorations.matchBeforePosition(t);r&&this._setCurrentFindMatch(r);return}if(this._decorations.getCount()GK._getSearchRange(this._editor.getModel(),s));return this._editor.getModel().findMatches(this._state.searchString,o,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,n,r)}replaceAll(){if(!this._hasMatches())return;const t=this._decorations.getFindScopes();t===null&&this._state.matchesCount>=B5?this._largeReplaceAll():this._regularReplaceAll(t),this.research(!1)}_largeReplaceAll(){const n=new sD(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null).parseSearchRequest();if(!n)return;let r=n.regex;if(!r.multiline){let f="mu";r.ignoreCase&&(f+="i"),r.global&&(f+="g"),r=new RegExp(r.source,f)}const o=this._editor.getModel(),s=o.getValue(1),a=o.getFullModelRange(),l=this._getReplacePattern();let d;const u=this._state.preserveCase;l.hasReplacementPatterns||u?d=s.replace(r,function(){return l.buildReplaceString(arguments,u)}):d=s.replace(r,l.buildReplaceString(null,u));const h=new Wet(a,d,this._editor.getSelection());this._executeEditorCommand("replaceAll",h)}_regularReplaceAll(t){const n=this._getReplacePattern(),r=this._findMatches(t,n.hasReplacementPatterns||this._state.preserveCase,1073741824),o=[];for(let a=0,l=r.length;aa.range),o);this._executeEditorCommand("replaceAll",s)}selectAllMatches(){if(!this._hasMatches())return;const t=this._decorations.getFindScopes();let r=this._findMatches(t,!1,1073741824).map(s=>new Rn(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn));const o=this._editor.getSelection();for(let s=0,a=r.length;s=this.source.length}next(){const t=this.peek();return this.advance(),t}peek(){return this.source[this.index]}advance(){this.index++}}function MPn(e,t,n,r){let o;if(t.type===2)o=document.createTextNode(t.content||"");else if(t.type===3)o=document.createElement("b");else if(t.type===4)o=document.createElement("i");else if(t.type===7&&r)o=document.createElement("code");else if(t.type===5&&n){const s=document.createElement("a");n.disposables.add(Sc(s,"click",a=>{n.callback(String(t.index),a)})),o=s}else t.type===8?o=document.createElement("br"):t.type===1&&(o=e);o&&e!==o&&e.appendChild(o),o&&Array.isArray(t.children)&&t.children.forEach(s=>{MPn(o,s,n,r)})}function _yo(e,t){const n={type:1,children:[]};let r=0,o=n;const s=[],a=new Jyo(e);for(;!a.eos();){let l=a.next();const d=l==="\\"&&SHe(a.peek())!==0;if(d&&(l=a.next()),!d&&$yo(l)&&l===a.peek()){a.advance(),o.type===2&&(o=s.pop());const u=SHe(l);if(o.type===u||o.type===5&&u===6)o=s.pop();else{const h={type:u,children:[]};u===5&&(h.index=r,r++),o.children.push(h),s.push(o),o=h}}else if(l===` `)o.type===2&&(o=s.pop()),o.children.push({type:8});else if(o.type!==2){const u={type:2,content:l};o.children.push(u),s.push(o),o=u}else o.content+=l}return o.type===2&&(o=s.pop()),n}function $yo(e,t){return SHe(e)!==0}function SHe(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return 0;default:return 0}}class eCo{constructor(t,n=0,r=t.length,o=n-1){this.items=t,this.start=n,this.end=r,this.index=o}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class tCo{constructor(t=new Set,n=10){this._history=t,this._limit=n,this._onChange(),this._history.onDidChange&&(this._disposable=this._history.onDidChange(()=>this._onChange()))}getHistory(){return this._elements}add(t){this._history.delete(t),this._history.add(t),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(t){return this._history.has(t)}_onChange(){this._reduceToLimit();const t=this._elements;this._navigator=new eCo(t,0,t.length,t.length)}_reduceToLimit(){const t=this._elements;if(t.length>this._limit){const n=t.slice(t.length-this._limit);this._history.replace?this._history.replace(n):this._history=new Set(n)}}_currentPosition(){const t=this._navigator.current();return t?this._elements.indexOf(t):-1}get _elements(){const t=[];return this._history.forEach(n=>t.push(n)),t}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=void 0)}}const WI=ln;let nCo=class extends $1{get onDidChange(){return this._onDidChange.event}get onDidHeightChange(){return this._onDidHeightChange.event}constructor(t,n,r){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this.hover=this._register(new is),this._onDidChange=this._register(new it),this._onDidHeightChange=this._register(new it),this.contextViewProvider=n,this.options=r,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=tn(t,WI(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",s=tn(this.element,WI(".ibwrapper"));if(this.input=tn(s,WI(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=tn(s,WI("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new _Dn(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),tn(t,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(d=>this.input.scrollTop=d.scrollTop));const a=this._register(new ms(t.ownerDocument,"selectionchange")),l=un.filter(a.event,()=>{const d=t.ownerDocument.getSelection();return(d==null?void 0:d.anchorNode)===s});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new bm(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(t){this.placeholder=t,this.input.setAttribute("placeholder",t)}setTooltip(t){this.tooltip=t,this.hover.value||(this.hover.value=this._register(E4().setupDelayedHoverAtMouse(this.input,()=>({content:this.tooltip,appearance:{compact:!0}}))))}get inputElement(){return this.input}get value(){return this.input.value}set value(t){this.input.value!==t&&(this.input.value=t,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:UL(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return jbe(this.input)}select(t=null){this.input.select(),t&&(this.input.setSelectionRange(t.start,t.end),t.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const t=this.input.selectionStart;if(t===null)return null;const n=this.input.selectionEnd??t;return{start:t,end:n}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(t){this.input.style.width=`calc(100% - ${t}px)`,this.mirror&&(this.mirror.style.paddingRight=t+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const t=this.cachedContentHeight,n=this.cachedHeight,r=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:t,height:n}),this.scrollableElement.setScrollPosition({scrollTop:r})}showMessage(t,n){if(this.state==="open"&&M1(this.message,t))return;this.message=t,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(t.type));const r=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${h8(r.border,"transparent")}`,this.message.content&&(this.hasFocus()||n)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let t=null;return this.validation&&(t=this.validation(this.value),t?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(t)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),t==null?void 0:t.type}stylesForType(t){const n=this.options.inputBoxStyles;switch(t){case 1:return{border:n.inputValidationInfoBorder,background:n.inputValidationInfoBackground,foreground:n.inputValidationInfoForeground};case 2:return{border:n.inputValidationWarningBorder,background:n.inputValidationWarningBackground,foreground:n.inputValidationWarningForeground};default:return{border:n.inputValidationErrorBorder,background:n.inputValidationErrorBackground,foreground:n.inputValidationErrorForeground}}}classForType(t){switch(t){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let t;const n=()=>t.style.width=h1(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:o=>{if(!this.message)return null;t=tn(o,WI(".monaco-inputbox-container")),n();const s=WI("span.monaco-inputbox-message");this.message.formatContent?Kyo(this.message.content,void 0,s):Gyo(this.message.content,void 0,s),s.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return s.style.backgroundColor=a.background??"",s.style.color=a.foreground??"",s.style.border=a.border?`1px solid ${a.border}`:"",tn(t,s),null},onHide:()=>{this.state="closed"},layout:n});let r;this.message.type===3?r=j(9,"Error: {0}",this.message.content):this.message.type===2?r=j(10,"Warning: {0}",this.message.content):r=j(11,"Info: {0}",this.message.content),kg(r),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const t=this.value,r=t.charCodeAt(t.length-1)===10?" ":"";(t+r).replace(/\u000c/g,"")?this.mirror.textContent=t+r:this.mirror.innerText=" ",this.layout()}applyStyles(){const t=this.options.inputBoxStyles,n=t.inputBackground??"",r=t.inputForeground??"",o=t.inputBorder??"";this.element.style.backgroundColor=n,this.element.style.color=r,this.input.style.backgroundColor="inherit",this.input.style.color=r,this.element.style.border=`1px solid ${h8(o,"transparent")}`}layout(){if(!this.mirror)return;const t=this.cachedContentHeight;this.cachedContentHeight=UL(this.mirror),t!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(t){const n=this.inputElement,r=n.selectionStart,o=n.selectionEnd,s=n.value;r!==null&&o!==null&&(this.value=s.substr(0,r)+t+s.substr(o),n.setSelectionRange(r+1,r+1),this.layout())}dispose(){var t;this._hideMessage(),this.message=null,(t=this.actionbar)==null||t.dispose(),super.dispose()}};class RPn extends nCo{constructor(t,n,r){const o=j(12," or {0} for history","⇅"),s=j(13," ({0} for history)","⇅");super(t,n,r),this._onDidFocus=this._register(new it),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new it),this.onDidBlur=this._onDidBlur.event,this.history=this._register(new tCo(r.history,100));const a=()=>{if(r.showHistoryHint&&r.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?o:s,d=this.placeholder+l;r.showPlaceholderOnFocus&&!jbe(this.input)?this.placeholder=d:this.setPlaceHolder(d)}};this.observer=new MutationObserver((l,d)=>{l.forEach(u=>{u.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const l=d=>{if(this.placeholder.endsWith(d)){const u=this.placeholder.slice(0,this.placeholder.length-d.length);return r.showPlaceholderOnFocus?this.placeholder=u:this.setPlaceHolder(u),!0}else return!1};l(s)||l(o)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(t){this.value&&(t||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let t=this.getNextValue();t&&(t=t===this.value?this.getNextValue():t),this.value=t??"",yO(this.value?this.value:j(14,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let t=this.getPreviousValue();t&&(t=t===this.value?this.getPreviousValue():t),t&&(this.value=t,yO(this.value))}setPlaceHolder(t){super.setPlaceHolder(t),this.setTooltip(t)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let t=this.history.current();return t||(t=this.history.last(),this.history.next()),t}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const iCo=j(1,"input");class IPn extends $1{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onMouseDown(){return this._onMouseDown.event}get onCaseSensitiveKeyDown(){return this._onCaseSensitiveKeyDown.event}get onRegexKeyDown(){return this._onRegexKeyDown.event}constructor(t,n,r){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new is),this.additionalToggles=[],this._onDidOptionChange=this._register(new it),this._onKeyDown=this._register(new it),this._onMouseDown=this._register(new it),this._onInput=this._register(new it),this._onKeyUp=this._register(new it),this._onCaseSensitiveKeyDown=this._register(new it),this._onRegexKeyDown=this._register(new it),this._lastHighlightFindOptions=0,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||iCo,this.showCommonFindToggles=!!r.showCommonFindToggles;const o=r.appendCaseSensitiveLabel||"",s=r.appendWholeWordsLabel||"",a=r.appendRegexLabel||"",l=!!r.flexibleHeight,d=!!r.flexibleWidth,u=r.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new RPn(this.domNode,n,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},showHistoryHint:r.showHistoryHint,flexibleHeight:l,flexibleWidth:d,flexibleMaxHeight:u,inputBoxStyles:r.inputBoxStyles,history:r.history})),this.showCommonFindToggles){const h=(r==null?void 0:r.hoverLifecycleOptions)||{groupId:"find-input"};this.regex=this._register(new PPn({appendTitle:a,isChecked:!1,hoverLifecycleOptions:h,...r.toggleStyles})),this._register(this.regex.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(g=>{this._onRegexKeyDown.fire(g)})),this.wholeWords=this._register(new FPn({appendTitle:s,isChecked:!1,hoverLifecycleOptions:h,...r.toggleStyles})),this._register(this.wholeWords.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new BPn({appendTitle:o,isChecked:!1,hoverLifecycleOptions:h,...r.toggleStyles})),this._register(this.caseSensitive.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(g=>{this._onCaseSensitiveKeyDown.fire(g)}));const f=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,g=>{if(g.equals(15)||g.equals(17)||g.equals(9)){const k=f.indexOf(this.domNode.ownerDocument.activeElement);if(k>=0){let A=-1;g.equals(17)?A=(k+1)%f.length:g.equals(15)&&(k===0?A=f.length-1:A=k-1),g.equals(9)?(f[k].blur(),this.inputBox.focus()):A>=0&&f[A].focus(),Bo.stop(g,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(r==null?void 0:r.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),t==null||t.appendChild(this.domNode),this._register(pt(this.inputBox.inputElement,"compositionstart",h=>{this.imeSessionInProgress=!0})),this._register(pt(this.inputBox.inputElement,"compositionend",h=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}get onDidChange(){return this.inputBox.onDidChange}layout(t){this.inputBox.layout(),this.updateInputBoxPadding(t.collapsedFindWidget)}enable(){var t,n,r;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(t=this.regex)==null||t.enable(),(n=this.wholeWords)==null||n.enable(),(r=this.caseSensitive)==null||r.enable();for(const o of this.additionalToggles)o.enable()}disable(){var t,n,r;this.domNode.classList.add("disabled"),this.inputBox.disable(),(t=this.regex)==null||t.disable(),(n=this.wholeWords)==null||n.disable(),(r=this.caseSensitive)==null||r.disable();for(const o of this.additionalToggles)o.disable()}setFocusInputOnOptionClick(t){this.fixFocusOnOptionClickEnabled=t}setEnabled(t){t?this.enable():this.disable()}setAdditionalToggles(t){for(const n of this.additionalToggles)n.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new Pt;for(const n of t??[])this.additionalTogglesDisposables.value.add(n),this.controls.appendChild(n.domNode),this.additionalTogglesDisposables.value.add(n.onChange(r=>{this._onDidOptionChange.fire(r),!r&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(n);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(t=!1){var n,r,o;t?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(((n=this.caseSensitive)==null?void 0:n.width())??0)+(((r=this.wholeWords)==null?void 0:r.width())??0)+(((o=this.regex)==null?void 0:o.width())??0)+this.additionalToggles.reduce((s,a)=>s+a.width(),0)}getValue(){return this.inputBox.value}setValue(t){this.inputBox.value!==t&&(this.inputBox.value=t)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var t;return((t=this.caseSensitive)==null?void 0:t.checked)??!1}setCaseSensitive(t){this.caseSensitive&&(this.caseSensitive.checked=t)}getWholeWords(){var t;return((t=this.wholeWords)==null?void 0:t.checked)??!1}setWholeWords(t){this.wholeWords&&(this.wholeWords.checked=t)}getRegex(){var t;return((t=this.regex)==null?void 0:t.checked)??!1}setRegex(t){this.regex&&(this.regex.checked=t,this.validate())}focusOnCaseSensitive(){var t;(t=this.caseSensitive)==null||t.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(t){this.inputBox.showMessage(t)}clearMessage(){this.inputBox.hideMessage()}}const rCo=j(5,"input"),oCo=j(6,"Preserve Case");class sCo extends F6{constructor(t){super({icon:Jt.preserveCase,title:oCo+t.appendTitle,isChecked:t.isChecked,hoverLifecycleOptions:t.hoverLifecycleOptions,inputActiveOptionBorder:t.inputActiveOptionBorder,inputActiveOptionForeground:t.inputActiveOptionForeground,inputActiveOptionBackground:t.inputActiveOptionBackground})}}class aCo extends $1{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onPreserveCaseKeyDown(){return this._onPreserveCaseKeyDown.event}constructor(t,n,r,o){super(),this._showOptionButtons=r,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new it),this._onKeyDown=this._register(new it),this._onMouseDown=this._register(new it),this._onInput=this._register(new it),this._onKeyUp=this._register(new it),this._onPreserveCaseKeyDown=this._register(new it),this.contextViewProvider=n,this.placeholder=o.placeholder||"",this.validation=o.validation,this.label=o.label||rCo;const s=o.appendPreserveCaseLabel||"",a=o.history||new Set([]),l=!!o.flexibleHeight,d=!!o.flexibleWidth,u=o.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new RPn(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:o.showHistoryHint,flexibleHeight:l,flexibleWidth:d,flexibleMaxHeight:u,inputBoxStyles:o.inputBoxStyles})),this.preserveCase=this._register(new sCo({appendTitle:s,isChecked:!1,hoverLifecycleOptions:o.hoverLifecycleOptions,...o.toggleStyles})),this._register(this.preserveCase.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(g=>{this._onPreserveCaseKeyDown.fire(g)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const h=[this.preserveCase.domNode];this.onkeydown(this.domNode,g=>{if(g.equals(15)||g.equals(17)||g.equals(9)){const k=h.indexOf(this.domNode.ownerDocument.activeElement);if(k>=0){let A=-1;g.equals(17)?A=(k+1)%h.length:g.equals(15)&&(k===0?A=h.length-1:A=k-1),g.equals(9)?(h[k].blur(),this.inputBox.focus()):A>=0&&h[A].focus(),Bo.stop(g,!0)}}});const f=document.createElement("div");f.className="controls",f.style.display=this._showOptionButtons?"block":"none",f.appendChild(this.preserveCase.domNode),this.domNode.appendChild(f),t==null||t.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,g=>this._onKeyDown.fire(g)),this.onkeyup(this.inputBox.inputElement,g=>this._onKeyUp.fire(g)),this.oninput(this.inputBox.inputElement,g=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,g=>this._onMouseDown.fire(g))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(t){t?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(t){this.preserveCase.checked=t}focusOnPreserve(){this.preserveCase.focus()}validate(){var t;(t=this.inputBox)==null||t.validate()}set width(t){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=t+"px"}dispose(){super.dispose()}}var NPn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},UPn=function(e,t){return function(n,r){t(n,r,e)}};const Pnt=new Ln("suggestWidgetVisible",!1,j(1698,"Whether suggestion are visible")),Mnt="historyNavigationWidgetFocus",jPn="historyNavigationForwardsEnabled",WPn="historyNavigationBackwardsEnabled";let m8;const fce=[];function HPn(e,t){if(fce.includes(t))throw new Error("Cannot register the same widget multiple times");fce.push(t);const n=new Pt,r=new Ln(Mnt,!1).bindTo(e),o=new Ln(jPn,!0).bindTo(e),s=new Ln(WPn,!0).bindTo(e),a=()=>{r.set(!0),m8=t},l=()=>{r.set(!1),m8===t&&(m8=void 0)};return jbe(t.element)&&a(),n.add(t.onDidFocus(()=>a())),n.add(t.onDidBlur(()=>l())),n.add(Gn(()=>{fce.splice(fce.indexOf(t),1),l()})),{historyNavigationForwardsEnablement:o,historyNavigationBackwardsEnablement:s,dispose(){n.dispose()}}}let THe=class extends IPn{constructor(t,n,r,o){super(t,n,r);const s=this._register(o.createScoped(this.inputBox.element));this._register(HPn(s,this.inputBox))}};THe=NPn([UPn(3,Fi)],THe);let EHe=class extends aCo{constructor(t,n,r,o,s=!1){super(t,n,s,r);const a=this._register(o.createScoped(this.inputBox.element));this._register(HPn(a,this.inputBox))}};EHe=NPn([UPn(3,Fi)],EHe);Zu.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:zt.and(zt.has(Mnt),zt.equals(WPn,!0),zt.not("isComposing"),Pnt.isEqualTo(!1)),primary:16,secondary:[528],handler:e=>{m8==null||m8.showPreviousValue()}});Zu.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:zt.and(zt.has(Mnt),zt.equals(jPn,!0),zt.not("isComposing"),Pnt.isEqualTo(!1)),primary:18,secondary:[530],handler:e=>{m8==null||m8.showNextValue()}});function gCt(e){var t,n;return((t=e.lookupKeybinding("history.showPrevious"))==null?void 0:t.getElectronAccelerator())==="Up"&&((n=e.lookupKeybinding("history.showNext"))==null?void 0:n.getElectronAccelerator())==="Down"}const mCt=Ra("find-collapsed",Jt.chevronRight,j(956,"Icon to indicate that the editor find widget is collapsed.")),kCt=Ra("find-expanded",Jt.chevronDown,j(957,"Icon to indicate that the editor find widget is expanded.")),lCo=Ra("find-selection",Jt.selection,j(958,"Icon for 'Find in Selection' in the editor find widget.")),cCo=Ra("find-replace",Jt.replace,j(959,"Icon for 'Replace' in the editor find widget.")),dCo=Ra("find-replace-all",Jt.replaceAll,j(960,"Icon for 'Replace All' in the editor find widget.")),uCo=Ra("find-previous-match",Jt.arrowUp,j(961,"Icon for 'Find Previous' in the editor find widget.")),hCo=Ra("find-next-match",Jt.arrowDown,j(962,"Icon for 'Find Next' in the editor find widget.")),ACo=j(963,"Find / Replace"),fCo=j(964,"Find"),gCo=j(965,"Find"),mCo=j(966,"Previous Match"),kCo=j(967,"Next Match"),vCo=j(968,"Find in Selection"),pCo=j(969,"Close"),bCo=j(970,"Replace"),OCo=j(971,"Replace"),wCo=j(972,"Replace"),yCo=j(973,"Replace All"),CCo=j(974,"Toggle Replace"),xCo=j(975,"Only the first {0} results are highlighted, but all find operations work on the entire text.",B5),LCo=j(976,"{0} of {1}"),vCt=j(977,"No results"),S3=419,SCo=275,TCo=SCo-54;let zX=69;const ECo=33,pCt=Pr?256:2048;class I9e{constructor(t){this.afterLineNumber=t,this.heightInPx=ECo,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function bCt(e,t,n){const r=!!t.match(/\n/);if(n&&r&&n.selectionStart>0){e.stopPropagation();return}}function OCt(e,t,n){const r=!!t.match(/\n/);if(n&&r&&n.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(h=>this._onStateChanged(h))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(h=>{if(h.hasChanged(104)&&(this._codeEditor.getOption(104)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),h.hasChanged(165)&&this._tryUpdateWidgetWidth(),h.hasChanged(2)&&this.updateAccessibilitySupport(),h.hasChanged(50)){const f=this._codeEditor.getOption(50).loop;this._state.change({loop:f},!1);const g=this._codeEditor.getOption(50).addExtraSpaceOnTop;g&&!this._viewZone&&(this._viewZone=new I9e(0),this._showViewZone()),!g&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const h=await this._controller.getGlobalBufferTerm();h&&h!==this._state.searchString&&(this._state.change({searchString:h},!1),this._findInput.select())}})),this._findInputFocused=WOe.bindTo(a),this._findFocusTracker=this._register(f2(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=Fnt.bindTo(a),this._replaceFocusTracker=this._register(f2(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(50).addExtraSpaceOnTop&&(this._viewZone=new I9e(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(h=>{if(h.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return v2e.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(t){if(t.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(t.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),t.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),t.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(104)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=h1(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(t.isRevealed||t.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),t.isRegex&&this._findInput.setRegex(this._state.isRegex),t.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),t.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),t.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),t.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),t.searchString||t.matchesCount||t.matchesPosition){const n=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",n),this._updateMatchesCount(),this._updateButtons()}(t.searchString||t.currentMatch)&&this._layoutViewZone(),t.updateHistory&&this._delayedUpdateHistory(),t.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,Yi)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){var n;this._matchesCount.style.minWidth=zX+"px",this._state.matchesCount>=B5?this._matchesCount.title=xCo:this._matchesCount.title="",(n=this._matchesCount.firstChild)==null||n.remove();let t;if(this._state.matchesCount>0){let r=String(this._state.matchesCount);this._state.matchesCount>=B5&&(r+="+");let o=String(this._state.matchesPosition);o==="0"&&(o="?"),t=pP(LCo,o,r)}else t=vCt;this._matchesCount.appendChild(document.createTextNode(t)),kg(this._getAriaLabel(t,this._state.currentMatch,this._state.searchString)),zX=Math.max(zX,this._matchesCount.clientWidth)}_getAriaLabel(t,n,r){if(t===vCt)return r===""?j(978,"{0} found",t):j(979,"{0} found for '{1}'",t,r);if(n){const o=j(980,"{0} found for '{1}', at {2}",t,r,n.startLineNumber+":"+n.startColumn),s=this._codeEditor.getModel();return s&&n.startLineNumber<=s.getLineCount()&&n.startLineNumber>=1?`${s.getLineContent(n.startLineNumber)}, ${o}`:o}return j(981,"{0} found for '{1}'",t,r)}_updateToggleSelectionFindButton(){const t=this._codeEditor.getSelection(),n=t?t.startLineNumber!==t.endLineNumber||t.startColumn!==t.endColumn:!1,r=this._toggleSelectionFind.checked;this._isVisible&&(r||n)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const t=this._state.searchString.length>0,n=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&t&&n&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&t&&n&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&t),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&t),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const r=!this._codeEditor.getOption(104);this._toggleReplaceBtn.setEnabled(this._isVisible&&r)}_reveal(){if(this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const t=this._codeEditor.getSelection();switch(this._codeEditor.getOption(50).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const r=!!t&&t.startLineNumber!==t.endLineNumber;this._toggleSelectionFind.checked=r;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let n=!0;if(this._codeEditor.getOption(50).seedSearchStringFromSelection&&t){const r=this._codeEditor.getDomNode();if(r){const o=ic(r),s=this._codeEditor.getScrolledVisiblePosition(t.getStartPosition()),a=o.left+(s?s.left:0),l=s?s.top:0;if(this._viewZone&&lt.startLineNumber&&(n=!1);const d=L7n(this._domNode).left;a>d&&(n=!1);const u=this._codeEditor.getScrolledVisiblePosition(t.getEndPosition());o.left+(u?u.left:0)>d&&(n=!1)}}}this._showViewZone(n)}}_hide(t){this._revealTimeouts.forEach(n=>{clearTimeout(n)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),t&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(t){if(!this._codeEditor.getOption(50).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const r=this._viewZone;this._viewZoneId!==void 0||!r||this._codeEditor.changeViewZones(o=>{r.heightInPx=this._getHeight(),this._viewZoneId=o.addZone(r),this._codeEditor.setScrollTop(t||this._codeEditor.getScrollTop()+r.heightInPx)})}_showViewZone(t=!0){if(!this._isVisible||!this._codeEditor.getOption(50).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new I9e(0));const r=this._viewZone;this._codeEditor.changeViewZones(o=>{if(this._viewZoneId!==void 0){const s=this._getHeight();if(s===r.heightInPx)return;const a=s-r.heightInPx;r.heightInPx=s,o.layoutZone(this._viewZoneId),t&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+a);return}else{let s=this._getHeight();if(s-=this._codeEditor.getOption(96).top,s<=0)return;r.heightInPx=s,this._viewZoneId=o.addZone(r),t&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s)}})}_removeViewZone(){this._codeEditor.changeViewZones(t=>{this._viewZoneId!==void 0&&(t.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const t=this._codeEditor.getLayoutInfo();if(t.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const r=t.width,o=t.minimap.minimapWidth;let s=!1,a=!1,l=!1;if(this._resized&&h1(this._domNode)>S3){this._domNode.style.maxWidth=`${r-28-o-15}px`,this._replaceInput.width=h1(this._findInput.domNode);return}if(S3+28+o>=r&&(a=!0),S3+28+o-zX>=r&&(l=!0),S3+28+o-zX>=r+50&&(s=!0),this._domNode.classList.toggle("collapsed-find-widget",s),this._domNode.classList.toggle("narrow-find-widget",l),this._domNode.classList.toggle("reduced-find-widget",a),!l&&!s&&(this._domNode.style.maxWidth=`${r-28-o-15}px`),this._findInput.layout({collapsedFindWidget:s,narrowFindWidget:l,reducedFindWidget:a}),this._resized){const d=this._findInput.inputBox.element.clientWidth;d>0&&(this._replaceInput.width=d)}else this._isReplaceVisible&&(this._replaceInput.width=h1(this._findInput.domNode))}_getHeight(){let t=0;return t+=4,t+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(t+=4,t+=this._replaceInput.inputBox.height+2),t+=4,t}_tryUpdateHeight(){const t=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===t?!1:(this._cachedHeight=t,this._domNode.style.height=`${t}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const t=this._codeEditor.getSelections();t.map(n=>{n.endColumn===1&&n.endLineNumber>n.startLineNumber&&(n=n.setEndPosition(n.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(n.endLineNumber-1)));const r=this._state.currentMatch;return n.startLineNumber!==n.endLineNumber&&!De.equalsRange(n,r)?n:null}).filter(n=>!!n),t.length&&this._state.change({searchScope:t},!0)}}_onFindInputMouseDown(t){t.middleButton&&t.stopPropagation()}_onFindInputKeyDown(t){if(t.equals(pCt|3))if(this._keybindingService.dispatchEvent(t,t.target)){t.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` `),t.preventDefault();return}if(t.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),t.preventDefault();return}if(t.equals(2066)){this._codeEditor.focus(),t.preventDefault();return}if(t.equals(16))return bCt(t,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(t.equals(18))return OCt(t,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(t){if(t.equals(pCt|3))if(this._keybindingService.dispatchEvent(t,t.target)){t.preventDefault();return}else{this._replaceInput.inputBox.insertAtCursor(` `),t.preventDefault();return}if(t.equals(2)){this._findInput.focusOnCaseSensitive(),t.preventDefault();return}if(t.equals(1026)){this._findInput.focus(),t.preventDefault();return}if(t.equals(2066)){this._codeEditor.focus(),t.preventDefault();return}if(t.equals(16))return bCt(t,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(t.equals(18))return OCt(t,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(t){return 0}_keybindingLabelFor(t){const n=this._keybindingService.lookupKeybinding(t);return n?` (${n.getLabel()})`:""}_buildDomNode(){const r=this._codeEditor.getOption(50).history,o=this._codeEditor.getOption(50).replaceHistory;this._findInput=this._register(new THe(null,this._contextViewProvider,{width:TCo,label:fCo,placeholder:gCo,appendCaseSensitiveLabel:this._keybindingLabelFor(va.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(va.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(va.ToggleRegexCommand),validation:f=>{if(f.length===0||!this._findInput.getRegex())return null;try{return new RegExp(f,"gu"),null}catch(g){return{content:g.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>gCt(this._keybindingService),inputBoxStyles:n1e,toggleStyles:t1e,history:r==="workspace"?this._findWidgetSearchHistory:new Set([])},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(f=>{f.equals(3)&&!this._codeEditor.getOption(50).findOnType&&this._state.change({searchString:this._findInput.getValue()},!0),this._onFindInputKeyDown(f)})),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||!this._codeEditor.getOption(50).findOnType||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(f=>{f.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),f.preventDefault())})),this._register(this._findInput.onRegexKeyDown(f=>{f.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),f.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(f=>{this._tryUpdateHeight()&&this._showViewZone()})),ym&&this._register(this._findInput.onMouseDown(f=>this._onFindInputMouseDown(f))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const s={groupId:"find-widget"};this._prevBtn=this._register(new dD({label:mCo+this._keybindingLabelFor(va.PreviousMatchFindAction),icon:uCo,hoverLifecycleOptions:s,onTrigger:()=>{p5(this._codeEditor.getAction(va.PreviousMatchFindAction)).run().then(void 0,Yi)}},this._hoverService)),this._nextBtn=this._register(new dD({label:kCo+this._keybindingLabelFor(va.NextMatchFindAction),icon:hCo,hoverLifecycleOptions:s,onTrigger:()=>{p5(this._codeEditor.getAction(va.NextMatchFindAction)).run().then(void 0,Yi)}},this._hoverService));const a=document.createElement("div");a.className="find-part",a.appendChild(this._findInput.domNode);const l=document.createElement("div");l.className="find-actions",a.appendChild(l),l.appendChild(this._matchesCount),l.appendChild(this._prevBtn.domNode),l.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new F6({icon:lCo,title:vCo+this._keybindingLabelFor(va.ToggleSearchScopeCommand),isChecked:!1,hoverLifecycleOptions:s,inputActiveOptionBackground:sn(kZ),inputActiveOptionBorder:sn(Jie),inputActiveOptionForeground:sn(_ie)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let f=this._codeEditor.getSelections();f=f.map(g=>(g.endColumn===1&&g.endLineNumber>g.startLineNumber&&(g=g.setEndPosition(g.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(g.endLineNumber-1))),g.isEmpty()?null:g)).filter(g=>!!g),f.length&&this._state.change({searchScope:f},!0)}}else this._state.change({searchScope:null},!0)})),l.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new dD({label:pCo+this._keybindingLabelFor(va.CloseFindWidgetCommand),icon:hFn,hoverLifecycleOptions:s,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:f=>{f.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),f.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new EHe(null,void 0,{label:bCo,placeholder:OCo,appendPreserveCaseLabel:this._keybindingLabelFor(va.TogglePreserveCaseCommand),history:o==="workspace"?this._replaceWidgetHistory:new Set([]),flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>gCt(this._keybindingService),inputBoxStyles:n1e,toggleStyles:t1e,hoverLifecycleOptions:s},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(f=>this._onReplaceInputKeyDown(f))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(f=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(f=>{f.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),f.preventDefault())})),this._replaceBtn=this._register(new dD({label:wCo+this._keybindingLabelFor(va.ReplaceOneAction),icon:cCo,hoverLifecycleOptions:s,onTrigger:()=>{this._controller.replace()},onKeyDown:f=>{f.equals(1026)&&(this._closeBtn.focus(),f.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new dD({label:yCo+this._keybindingLabelFor(va.ReplaceAllAction),icon:dCo,hoverLifecycleOptions:s,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const d=document.createElement("div");d.className="replace-part",d.appendChild(this._replaceInput.domNode);const u=document.createElement("div");u.className="replace-actions",d.appendChild(u),u.appendChild(this._replaceBtn.domNode),u.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new dD({label:CCo,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=h1(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=ACo,this._domNode.role="dialog",this._domNode.style.width=`${S3}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(a),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(d),this._resizeSash=this._register(new OA(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let h=S3;this._register(this._resizeSash.onDidStart(()=>{h=h1(this._domNode)})),this._register(this._resizeSash.onDidChange(f=>{this._resized=!0;const g=h+f.startX-f.currentX;if(gk||(this._domNode.style.width=`${g}px`,this._isReplaceVisible&&(this._replaceInput.width=h1(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const f=h1(this._domNode);if(fthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:t,scrollTop:this._codeEditor.getScrollTop()}}setViewState(t){t&&t.widgetViewZoneVisible&&this._layoutViewZone(t.scrollTop)}};v2e.ID="editor.contrib.findWidget";let DHe=v2e;class dD extends $1{constructor(t,n){super(),this._opts=t;let r="button";this._opts.className&&(r=r+" "+this._opts.className),this._opts.icon&&(r=r+" "+mi.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=r,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(n.setupDelayedHover(this._domNode,{content:this._opts.label,style:1},t.hoverLifecycleOptions)),this.onclick(this._domNode,o=>{this._opts.onTrigger(),o.preventDefault()}),this.onkeydown(this._domNode,o=>{var s,a;if(o.equals(10)||o.equals(3)){this._opts.onTrigger(),o.preventDefault();return}(a=(s=this._opts).onKeyDown)==null||a.call(s,o)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(t){this._domNode.classList.toggle("disabled",!t),this._domNode.setAttribute("aria-disabled",String(!t)),this._domNode.tabIndex=t?0:-1}setExpanded(t){this._domNode.setAttribute("aria-expanded",String(!!t)),t?(this._domNode.classList.remove(...mi.asClassNameArray(mCt)),this._domNode.classList.add(...mi.asClassNameArray(kCt))):(this._domNode.classList.remove(...mi.asClassNameArray(kCt)),this._domNode.classList.add(...mi.asClassNameArray(mCt)))}}x2((e,t)=>{const n=e.getColor(y5);n&&t.addRule(`.monaco-editor .findMatch { border: 1px ${AO(e.type)?"dotted":"solid"} ${n}; box-sizing: border-box; }`);const r=e.getColor(fAo);r&&t.addRule(`.monaco-editor .findScope { border: 1px ${AO(e.type)?"dashed":"solid"} ${r}; }`);const o=e.getColor(uo);o&&t.addRule(`.monaco-editor .find-widget { border: 1px solid ${o}; }`);const s=e.getColor(hAo);s&&t.addRule(`.monaco-editor .findMatchInline { color: ${s}; }`);const a=e.getColor(AAo);a&&t.addRule(`.monaco-editor .currentFindMatchInline { color: ${a}; }`)});var DCo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},wCt=function(e,t){return function(n,r){t(n,r,e)}};let QHe=class extends ct{constructor(t,n,r,o){super(),this._container=t,this._getContent=n,this._clipboardService=r,this._hoverService=o,this._container.classList.add("hover-row-with-copy"),this._button=this._register(new dD({label:j(1128,"Copy"),icon:Jt.copy,onTrigger:()=>this._copyContent(),className:"hover-copy-button"},this._hoverService)),this._container.appendChild(this._button.domNode)}async _copyContent(){const t=this._getContent();t&&(await this._clipboardService.writeText(t),yO(j(1129,"Copied to clipboard")))}};QHe=DCo([wCt(2,z1),wCt(3,Lg)],QHe);class QCo{constructor(t,n,r){this.provider=t,this.hover=n,this.ordinal=r}}async function BCo(e,t,n,r,o){const s=await Promise.resolve(e.provideHover(n,r,o)).catch(Xc);if(!(!s||!FCo(s)))return new QCo(e,s,t)}function Rnt(e,t,n,r,o=!1){const a=e.ordered(t,o).map((l,d)=>BCo(l,d,t,n,r));return $v.fromPromisesResolveOrder(a).coalesce()}async function VPn(e,t,n,r,o=!1){const s=[];for await(const a of Rnt(e,t,n,r,o))s.push(a.hover);return s}Qm("_executeHoverProvider",(e,t,n)=>{const r=e.get(Zn);return VPn(r.hoverProvider,t,n,Fr.None)});Qm("_executeHoverProvider_recursive",(e,t,n)=>{const r=e.get(Zn);return VPn(r.hoverProvider,t,n,Fr.None,!0)});function FCo(e){const t=typeof e.range<"u",n=typeof e.contents<"u"&&e.contents&&e.contents.length>0;return t&&n}var PCo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},HI=function(e,t){return function(n,r){t(n,r,e)}};const BQ=ln,MCo=Ra("hover-increase-verbosity",Jt.add,j(1130,"Icon for increaseing hover verbosity.")),RCo=Ra("hover-decrease-verbosity",Jt.remove,j(1131,"Icon for decreasing hover verbosity."));class Np{constructor(t,n,r,o,s,a=void 0){this.owner=t,this.range=n,this.contents=r,this.isBeforeContent=o,this.ordinal=s,this.source=a}isValidForHoverAnchor(t){return t.type===1&&this.range.startColumn<=t.range.startColumn&&this.range.endColumn>=t.range.endColumn}}class zPn{constructor(t,n,r){this.hover=t,this.hoverProvider=n,this.hoverPosition=r}supportsVerbosityAction(t){switch(t){case m1.Increase:return this.hover.canIncreaseVerbosity??!1;case m1.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let lee=class{constructor(t,n,r,o,s,a,l){this._editor=t,this._markdownRendererService=n,this._configurationService=r,this._languageFeaturesService=o,this._keybindingService=s,this._hoverService=a,this._commandService=l,this.hoverOrdinal=3}createLoadingMessage(t){return new Np(this,t.range,[new xA().appendText(j(1132,"Loading..."))],!1,2e3)}computeSync(t,n){if(!this._editor.hasModel()||t.type!==1)return[];const r=this._editor.getModel(),o=t.range.startLineNumber,s=r.getLineMaxColumn(o),a=[];let l=1e3;const d=r.getLineLength(o),u=r.getLanguageIdAtPosition(t.range.startLineNumber,t.range.startColumn),h=this._editor.getOption(133),f=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:u});let g=!1;h>=0&&d>h&&t.range.startColumn>=h&&(g=!0,a.push(new Np(this,t.range,[{value:j(1133,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,l++))),!g&&typeof f=="number"&&d>=f&&a.push(new Np(this,t.range,[{value:j(1134,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,l++));let k=!1;for(const A of n){const m=A.range.startLineNumber===o?A.range.startColumn:1,v=A.range.endLineNumber===o?A.range.endColumn:s,p=A.options.hoverMessage;if(!p||DV(p))continue;A.options.beforeContentClassName&&(k=!0);const b=new De(t.range.startLineNumber,m,t.range.startLineNumber,v);a.push(new Np(this,b,Let(p),k,l++))}return a}computeAsync(t,n,r,o){if(!this._editor.hasModel()||t.type!==1)return $v.EMPTY;const s=this._editor.getModel(),a=this._languageFeaturesService.hoverProvider;return a.has(s)?this._getMarkdownHovers(a,s,t,o):$v.EMPTY}async*_getMarkdownHovers(t,n,r,o){const s=r.range.getStartPosition(),a=Rnt(t,n,s,o);for await(const l of a)if(!DV(l.hover.contents)){const d=l.hover.range?De.lift(l.hover.range):r.range,u=new zPn(l.hover,l.provider,s);yield new Np(this,d,l.hover.contents,!1,l.ordinal,u)}}renderHoverParts(t,n){return this._renderedHoverParts=new ICo(n,t.fragment,this,this._editor,this._commandService,this._keybindingService,this._hoverService,this._configurationService,this._markdownRendererService,t.onContentsChanged),this._renderedHoverParts}handleScroll(t){var n;(n=this._renderedHoverParts)==null||n.handleScroll(t)}getAccessibleContent(t){var n;return((n=this._renderedHoverParts)==null?void 0:n.getAccessibleContent(t))??""}updateMarkdownHoverVerbosityLevel(t,n){var r;return Promise.resolve((r=this._renderedHoverParts)==null?void 0:r.updateMarkdownHoverPartVerbosityLevel(t,n))}};lee=PCo([HI(1,D4),HI(2,cr),HI(3,Zn),HI(4,Fo),HI(5,Lg),HI(6,Ca)],lee);class gce{constructor(t,n,r,o){this.hoverPart=t,this.hoverElement=n,this.disposables=r,this.actionsContainer=o}dispose(){this.disposables.dispose()}}class ICo{constructor(t,n,r,o,s,a,l,d,u,h){this._hoverParticipant=r,this._editor=o,this._commandService=s,this._keybindingService=a,this._hoverService=l,this._configurationService=d,this._markdownRendererService=u,this._onFinishedRendering=h,this._ongoingHoverOperations=new Map,this._disposables=new Pt,this.renderedHoverParts=this._renderHoverParts(t,n,this._onFinishedRendering),this._disposables.add(Gn(()=>{this.renderedHoverParts.forEach(f=>{f.dispose()}),this._ongoingHoverOperations.forEach(f=>{f.tokenSource.dispose(!0)})}))}_renderHoverParts(t,n,r){return t.sort(nA(o=>o.ordinal,P1)),t.map(o=>{const s=this._renderHoverPart(o,r);return n.appendChild(s.hoverElement),s})}_renderHoverPart(t,n){const r=this._renderMarkdownHover(t,n),o=r.hoverElement,s=t.source,a=new Pt;if(a.add(r),!s)return new gce(t,o,a);const l=s.supportsVerbosityAction(m1.Increase),d=s.supportsVerbosityAction(m1.Decrease);if(!l&&!d)return new gce(t,o,a);const u=BQ("div.verbosity-actions");o.prepend(u);const h=BQ("div.verbosity-actions-inner");return u.append(h),a.add(this._renderHoverExpansionAction(h,m1.Increase,l)),a.add(this._renderHoverExpansionAction(h,m1.Decrease,d)),new gce(t,o,a,h)}_renderMarkdownHover(t,n){return ZPn(this._editor,t,this._markdownRendererService,n)}_renderHoverExpansionAction(t,n,r){const o=new Pt,s=n===m1.Increase,a=tn(t,BQ(mi.asCSSSelector(s?MCo:RCo)));a.tabIndex=0;const l=new BV("mouse",void 0,{target:t,position:{hoverPosition:0}},this._configurationService,this._hoverService);if(o.add(this._hoverService.setupManagedHover(l,a,UCo(this._keybindingService,n))),!r)return a.classList.add("disabled"),o;a.classList.add("enabled");const d=()=>this._commandService.executeCommand(n===m1.Increase?IOe:NOe,{focus:!0});return o.add(new xPn(a,d)),o.add(new LPn(a,d,[3,10])),o}handleScroll(t){this.renderedHoverParts.forEach(n=>{const r=n.actionsContainer;if(!r)return;const o=n.hoverElement,a=t.scrollTop+t.height,l=o.offsetTop,d=o.clientHeight,u=l+d,h=22;let f;u<=a||l>=a?f=d-h:f=a-l-h,r.style.top=`${f}px`})}async updateMarkdownHoverPartVerbosityLevel(t,n){const r=this._editor.getModel();if(!r)return;const o=this._getRenderedHoverPartAtIndex(n),s=o==null?void 0:o.hoverPart.source;if(!o||!(s!=null&&s.supportsVerbosityAction(t)))return;const a=await this._fetchHover(s,r,t);if(!a)return;const l=new zPn(a,s.hoverProvider,s.hoverPosition),d=o.hoverPart,u=new Np(this._hoverParticipant,d.range,a.contents,d.isBeforeContent,d.ordinal,l),h=this._updateRenderedHoverPart(n,u);if(h)return{hoverPart:u,hoverElement:h.hoverElement}}getAccessibleContent(t){const n=this.renderedHoverParts.findIndex(a=>a.hoverPart===t);if(n===-1)return;const r=this._getRenderedHoverPartAtIndex(n);return r?r.hoverElement.innerText.replace(/[^\S\n\r]+/gu," "):void 0}async _fetchHover(t,n,r){let o=r===m1.Increase?1:-1;const s=t.hoverProvider,a=this._ongoingHoverOperations.get(s);a&&(a.tokenSource.cancel(),o+=a.verbosityDelta);const l=new Ya;this._ongoingHoverOperations.set(s,{verbosityDelta:o,tokenSource:l});const d={verbosityRequest:{verbosityDelta:o,previousHover:t.hover}};let u;try{u=await Promise.resolve(s.provideHover(n,t.hoverPosition,l.token,d))}catch(h){Xc(h)}return l.dispose(),this._ongoingHoverOperations.delete(s),u}_updateRenderedHoverPart(t,n){if(t>=this.renderedHoverParts.length||t<0)return;const r=this._renderHoverPart(n,this._onFinishedRendering),o=this.renderedHoverParts[t],s=o.hoverElement,a=r.hoverElement,l=Array.from(a.children);s.replaceChildren(...l);const d=new gce(n,s,r.disposables,r.actionsContainer);return o.dispose(),this.renderedHoverParts[t]=d,d}_getRenderedHoverPartAtIndex(t){return this.renderedHoverParts[t]}dispose(){this._disposables.dispose()}}function NCo(e,t,n,r){t.sort(nA(s=>s.ordinal,P1));const o=[];for(const s of t){const a=ZPn(n,s,r,e.onContentsChanged);e.fragment.appendChild(a.hoverElement),o.push(a)}return new jP(o)}function ZPn(e,t,n,r){const o=new Pt,s=BQ("div.hover-row"),a=BQ("div.hover-row-contents");s.appendChild(a);const l=t.contents;for(const u of l){if(DV(u))continue;const h=BQ("div.markdown-hover"),f=tn(h,BQ("div.hover-contents")),g=o.add(n.render(u,{context:e,asyncRenderCallback:()=>{f.className="hover-contents code-hover-contents",r()}}));f.appendChild(g.element),a.appendChild(h)}return{hoverPart:t,hoverElement:s,dispose(){o.dispose()}}}function UCo(e,t){switch(t){case m1.Increase:{const n=e.lookupKeybinding(IOe);return n?j(1135,"Increase Hover Verbosity ({0})",n.getLabel()):j(1136,"Increase Hover Verbosity")}case m1.Decrease:{const n=e.lookupKeybinding(NOe);return n?j(1137,"Decrease Hover Verbosity ({0})",n.getLabel()):j(1138,"Decrease Hover Verbosity")}}}const yCt=ln;class jCo extends ct{constructor(t,n,r){super(),this.model=n,this.pixelRatio=r,this._onDidChange=new it,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new it,this.onColorFlushed=this._onColorFlushed.event,this._domNode=yCt(".saturation-wrap"),tn(t,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",tn(this._domNode,this._canvas),this.selection=yCt(".saturation-selection"),tn(this._domNode,this.selection),this.layout(),this._register(pt(this._domNode,cn.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(t){if(!t.target||!(t.target instanceof Element))return;this.monitor=this._register(new gZ);const n=ic(this._domNode);t.target!==this.selection&&this.onDidChangePosition(t.offsetX,t.offsetY),this.monitor.startMonitoring(t.target,t.pointerId,t.buttons,o=>this.onDidChangePosition(o.pageX-n.left,o.pageY-n.top),()=>null);const r=pt(t.target.ownerDocument,cn.POINTER_UP,()=>{this._onColorFlushed.fire(),r.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(t,n){const r=Math.max(0,Math.min(1,t/this.width)),o=Math.max(0,Math.min(1,1-n/this.height));this.paintSelection(r,o),this._onDidChange.fire({s:r,v:o})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const t=this.model.color.hsva;this.paintSelection(t.s,t.v)}paint(){const t=this.model.color.hsva,n=new Ut(new ny(t.h,1,1,1)),r=this._canvas.getContext("2d"),o=r.createLinearGradient(0,0,this._canvas.width,0);o.addColorStop(0,"rgba(255, 255, 255, 1)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),o.addColorStop(1,"rgba(255, 255, 255, 0)");const s=r.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),r.rect(0,0,this._canvas.width,this._canvas.height),r.fillStyle=Ut.Format.CSS.format(n),r.fill(),r.fillStyle=o,r.fill(),r.fillStyle=s,r.fill()}paintSelection(t,n){this.selection.style.left=`${t*this.width}px`,this.selection.style.top=`${this.height-n*this.height}px`}onDidChangeColor(t){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const n=t.hsva;this.paintSelection(n.s,n.v)}}class WCo extends ct{constructor(t){super(),this._onClicked=this._register(new it),this.onClicked=this._onClicked.event,this._button=tn(t,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(pt(this._button,cn.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}const ZX=ln;class YPn extends ct{constructor(t,n,r){super(),this.model=n,this._onDidChange=new it,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new it,this.onColorFlushed=this._onColorFlushed.event,r==="standalone"?(this.domNode=tn(t,ZX(".standalone-strip")),this.overlay=tn(this.domNode,ZX(".standalone-overlay"))):(this.domNode=tn(t,ZX(".strip")),this.overlay=tn(this.domNode,ZX(".overlay"))),this.slider=tn(this.domNode,ZX(".slider")),this.slider.style.top="0px",this._register(pt(this.domNode,cn.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(n.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const t=this.getValue(this.model.color);this.updateSliderPosition(t)}onDidChangeColor(t){const n=this.getValue(t);this.updateSliderPosition(n)}onPointerDown(t){if(!t.target||!(t.target instanceof Element))return;const n=this._register(new gZ),r=ic(this.domNode);this.domNode.classList.add("grabbing"),t.target!==this.slider&&this.onDidChangeTop(t.offsetY),n.startMonitoring(t.target,t.pointerId,t.buttons,s=>this.onDidChangeTop(s.pageY-r.top),()=>null);const o=pt(t.target.ownerDocument,cn.POINTER_UP,()=>{this._onColorFlushed.fire(),o.dispose(),n.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(t){const n=Math.max(0,Math.min(1,1-t/this.height));this.updateSliderPosition(n),this._onDidChange.fire(n)}updateSliderPosition(t){this.slider.style.top=`${(1-t)*this.height}px`}}class HCo extends YPn{constructor(t,n,r){super(t,n,r),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(t){super.onDidChangeColor(t);const{r:n,g:r,b:o}=t.rgba,s=new Ut(new Vt(n,r,o,1)),a=new Ut(new Vt(n,r,o,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${a} 100%)`}getValue(t){return t.hsva.a}}class VCo extends YPn{constructor(t,n,r){super(t,n,r),this.domNode.classList.add("hue-strip")}getValue(t){return 1-t.hsva.h/360}}const zCo=ln;class ZCo extends ct{constructor(t,n,r,o){super(),this.model=n,this.pixelRatio=r,this._insertButton=null,this._domNode=zCo(".colorpicker-body"),tn(t,this._domNode),this._saturationBox=new jCo(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new HCo(this._domNode,this.model,o),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new VCo(this._domNode,this.model,o),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),o==="standalone"&&(this._insertButton=this._register(new WCo(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:t,v:n}){const r=this.model.color.hsva;this.model.color=new Ut(new ny(r.h,t,n,r.a))}onDidOpacityChange(t){const n=this.model.color.hsva;this.model.color=new Ut(new ny(n.h,n.s,n.v,t))}onDidHueChange(t){const n=this.model.color.hsva,r=(1-t)*360;this.model.color=new Ut(new ny(r===360?0:r,n.s,n.v,n.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}const YCo=ln;class XCo extends ct{constructor(t){super(),this._onClicked=this._register(new it),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),tn(t,this._button);const n=document.createElement("div");n.classList.add("close-button-inner-div"),tn(this._button,n),tn(n,YCo(".button"+mi.asCSSSelector(Ra("color-picker-close",Jt.close,j(885,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(pt(this._button,cn.CLICK,()=>{this._onClicked.fire()}))}}const mce=ln;class qCo extends ct{constructor(t,n,r,o){super(),this.model=n,this.type=o,this._closeButton=null,this._domNode=mce(".colorpicker-header"),tn(t,this._domNode),this._pickedColorNode=tn(this._domNode,mce(".picked-color")),tn(this._pickedColorNode,mce("span.codicon.codicon-color-mode")),this._pickedColorPresentation=tn(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const s=j(886,"Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",s),this._originalColorNode=tn(this._domNode,mce(".original-color")),this._originalColorNode.style.backgroundColor=Ut.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=r.getColorTheme().getColor(gme)||Ut.white,this._register(r.onDidColorThemeChange(a=>{this.backgroundColor=a.getColor(gme)||Ut.white})),this._register(pt(this._pickedColorNode,cn.CLICK,()=>this.model.selectNextColorPresentation())),this._register(pt(this._originalColorNode,cn.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(n.onDidChangeColor(this.onDidChangeColor,this)),this._register(n.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=Ut.Format.CSS.format(n.color)||"",this._pickedColorNode.classList.toggle("light",n.color.rgba.a<.5?this.backgroundColor.isLighter():n.color.isLighter()),this.onDidChangeColor(this.model.color),this.type==="standalone"&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new XCo(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(t){this._pickedColorNode.style.backgroundColor=Ut.Format.CSS.format(t)||"",this._pickedColorNode.classList.toggle("light",t.rgba.a<.5?this.backgroundColor.isLighter():t.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}const GCo=ln;class XPn extends $1{constructor(t,n,r,o,s){super(),this.model=n,this.pixelRatio=r,this._register(v$.getInstance(oi(t)).onDidChange(()=>this.layout())),this._domNode=GCo(".colorpicker-widget"),t.appendChild(this._domNode),this.header=this._register(new qCo(this._domNode,this.model,o,s)),this.body=this._register(new ZCo(this._domNode,this.model,this.pixelRatio,s))}layout(){this.body.layout()}get domNode(){return this._domNode}}class KCo{get color(){return this._color}set color(t){this._color.equals(t)||(this._color=t,this._onDidChangeColor.fire(t))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(t){this._colorPresentations=t,this.presentationIndex>t.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(t,n,r){this.presentationIndex=r,this._onColorFlushed=new it,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new it,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new it,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=t,this._color=t,this._colorPresentations=n}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(t,n){let r=-1;for(let o=0;o=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},_Co=function(e,t){return function(n,r){t(n,r,e)}};class O1e{constructor(t,n,r,o){this.owner=t,this.range=n,this.model=r,this.provider=o,this.forceShowAtRange=!0}isValidForHoverAnchor(t){return t.type===1&&this.range.startColumn<=t.range.startColumn&&this.range.endColumn>=t.range.endColumn}static fromBaseColor(t,n){return new O1e(t,n.range,n.model,n.provider)}}let w1e=class{constructor(t,n){this._editor=t,this._themeService=n,this.hoverOrdinal=2}computeSync(t,n,r){return[]}computeAsync(t,n,r,o){return $v.fromPromise(this._computeAsync(t,n,r))}async _computeAsync(t,n,r){if(!this._editor.hasModel())return[];if(!this._isValidRequest(r))return[];const o=PV.get(this._editor);if(!o)return[];for(const s of n){if(!o.isColorDecoration(s))continue;const a=o.getColorData(s.range.getStartPosition());if(a)return[O1e.fromBaseColor(this,await qPn(this._editor.getModel(),a.colorInfo,a.provider))]}return[]}_isValidRequest(t){const n=this._editor.getOption(168);switch(t){case 0:return n==="hover"||n==="clickAndHover";case 1:return n==="click"||n==="clickAndHover";case 2:return!0}}renderHoverParts(t,n){const r=this._editor;if(n.length===0||!r.hasModel())return new jP([]);const o=r.getOption(75)+8;t.setMinimumDimensions(new ds(302,o));const s=new Pt,a=n[0],l=r.getModel(),d=a.model;this._colorPicker=s.add(new XPn(t.fragment,d,r.getOption(163),this._themeService,"hover"));let u=!1,h=new De(a.range.startLineNumber,a.range.startColumn,a.range.endLineNumber,a.range.endColumn);s.add(d.onColorFlushed(async g=>{await cee(l,d,g,h,a),u=!0,h=GPn(r,h,d)})),s.add(d.onDidChangeColor(g=>{cee(l,d,g,h,a)})),s.add(r.onDidChangeModelContent(g=>{u?u=!1:(t.hide(),r.focus())}));const f={hoverPart:O1e.fromBaseColor(this,a),hoverElement:this._colorPicker.domNode,dispose(){s.dispose()}};return new jP([f])}getAccessibleContent(t){return j(887,"There is a color picker here.")}handleResize(){var t;(t=this._colorPicker)==null||t.layout()}handleContentsChanged(){var t;(t=this._colorPicker)==null||t.layout()}handleHide(){var t;(t=this._colorPicker)==null||t.dispose(),this._colorPicker=void 0}isColorPickerVisible(){return!!this._colorPicker}};w1e=JCo([_Co(1,Il)],w1e);class Jl{static insert(t,n){return{range:new De(t.lineNumber,t.column,t.lineNumber,t.column),text:n,forceMoveMarkers:!0}}static delete(t){return{range:t,text:null}}static replace(t,n){return{range:t,text:n}}static replaceMove(t,n){return{range:t,text:n,forceMoveMarkers:!0}}}function BHe(e,t){return!!e[t]}class N9e{constructor(t,n){this.target=t.target,this.isLeftClick=t.event.leftButton,this.isMiddleClick=t.event.middleButton,this.isRightClick=t.event.rightButton,this.mouseMiddleClickAction=n.mouseMiddleClickAction,this.hasTriggerModifier=BHe(t.event,n.triggerModifier),this.isMiddleClick&&n.mouseMiddleClickAction==="ctrlLeftClick"&&(this.isMiddleClick=!1,this.isLeftClick=!0,this.hasTriggerModifier=!0),this.hasSideBySideModifier=BHe(t.event,n.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=t.event.detail<=1}}class CCt{constructor(t,n){this.keyCodeIsTriggerKey=t.keyCode===n.triggerKey,this.keyCodeIsSideBySideKey=t.keyCode===n.triggerSideBySideKey,this.hasTriggerModifier=BHe(t,n.triggerModifier)}}class kce{constructor(t,n,r,o,s){this.mouseMiddleClickAction=s,this.triggerKey=t,this.triggerModifier=n,this.triggerSideBySideKey=r,this.triggerSideBySideModifier=o}equals(t){return this.triggerKey===t.triggerKey&&this.triggerModifier===t.triggerModifier&&this.triggerSideBySideKey===t.triggerSideBySideKey&&this.triggerSideBySideModifier===t.triggerSideBySideModifier&&this.mouseMiddleClickAction===t.mouseMiddleClickAction}}function xCt(e,t){return e==="altKey"?Pr?new kce(57,"metaKey",6,"altKey",t):new kce(5,"ctrlKey",6,"altKey",t):Pr?new kce(6,"altKey",57,"metaKey",t):new kce(6,"altKey",5,"ctrlKey",t)}class HOe extends ct{constructor(t,n){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new it),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new it),this.onExecute=this._onExecute.event,this._onCancel=this._register(new it),this.onCancel=this._onCancel.event,this._editor=t,this._extractLineNumberFromMouseEvent=(n==null?void 0:n.extractLineNumberFromMouseEvent)??(r=>r.target.position?r.target.position.lineNumber:0),this._opts=xCt(this._editor.getOption(86),this._editor.getOption(87)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(r=>{if(r.hasChanged(86)||r.hasChanged(87)){const o=xCt(this._editor.getOption(86),this._editor.getOption(87));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(r=>this._onEditorMouseMove(new N9e(r,this._opts)))),this._register(this._editor.onMouseDown(r=>this._onEditorMouseDown(new N9e(r,this._opts)))),this._register(this._editor.onMouseUp(r=>this._onEditorMouseUp(new N9e(r,this._opts)))),this._register(this._editor.onKeyDown(r=>this._onEditorKeyDown(new CCt(r,this._opts)))),this._register(this._editor.onKeyUp(r=>this._onEditorKeyUp(new CCt(r,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(r=>this._onDidChangeCursorSelection(r))),this._register(this._editor.onDidChangeModel(r=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(r=>{(r.scrollTopChanged||r.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(t){t.selection&&t.selection.startColumn!==t.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(t){this._lastMouseMoveEvent=t,this._onMouseMoveOrRelevantKeyDown.fire([t,null])}_onEditorMouseDown(t){this._hasTriggerKeyOnMouseDown=t.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(t)}_onEditorMouseUp(t){const n=this._extractLineNumberFromMouseEvent(t);!!this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===n&&(this._hasTriggerKeyOnMouseDown||t.isMiddleClick&&t.mouseMiddleClickAction==="openLink")&&this._onExecute.fire(t)}_onEditorKeyDown(t){this._lastMouseMoveEvent&&(t.keyCodeIsTriggerKey||t.keyCodeIsSideBySideKey&&t.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,t]):t.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(t){t.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}class KPn{constructor(t,n){this.range=t,this.direction=n}}class Int{constructor(t,n,r){this.hint=t,this.anchor=n,this.provider=r,this._isResolved=!1}with(t){const n=new Int(this.hint,t.anchor,this.provider);return n._isResolved=this._isResolved,n._currentResolve=this._currentResolve,n}async resolve(t){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return await this._currentResolve,t.isCancellationRequested?void 0:this.resolve(t);this._isResolved||(this._currentResolve=this._doResolve(t).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(t){try{const n=await Promise.resolve(this.provider.resolveInlayHint(this.hint,t));this.hint.tooltip=(n==null?void 0:n.tooltip)??this.hint.tooltip,this.hint.label=(n==null?void 0:n.label)??this.hint.label,this.hint.textEdits=(n==null?void 0:n.textEdits)??this.hint.textEdits,this._isResolved=!0}catch(n){Xc(n),this._isResolved=!1}}}const vj=class vj{static async create(t,n,r,o){const s=[],a=t.ordered(n).reverse().map(l=>r.map(async d=>{try{const u=await l.provideInlayHints(n,d,o);(u!=null&&u.hints.length||l.onDidChangeInlayHints)&&s.push([u??vj._emptyInlayHintList,l])}catch(u){Xc(u)}}));if(await Promise.all(a.flat()),o.isCancellationRequested||n.isDisposed())throw new u2;return new vj(r,s,n)}constructor(t,n,r){this._disposables=new Pt,this.ranges=t,this.provider=new Set;const o=[];for(const[s,a]of n){this._disposables.add(s),this.provider.add(a);for(const l of s.hints){const d=r.validatePosition(l.position);let u="before";const h=vj._getRangeAtPosition(r,d);let f;h.getStartPosition().isBefore(d)?(f=De.fromPositions(h.getStartPosition(),d),u="after"):(f=De.fromPositions(d,h.getEndPosition()),u="before"),o.push(new Int(l,new KPn(f,u),a))}}this.items=o.sort((s,a)=>tt.compare(s.hint.position,a.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(t,n){const r=n.lineNumber,o=t.getWordAtPosition(n);if(o)return new De(r,o.startColumn,r,o.endColumn);t.tokenization.tokenizeIfCheap(r);const s=t.tokenization.getLineTokens(r),a=n.column-1,l=s.findTokenIndexAtOffset(a);let d=s.getStartOffset(l),u=s.getEndOffset(l);return u-d===1&&(d===a&&l>1?(d=s.getStartOffset(l-1),u=s.getEndOffset(l-1)):u===a&&l=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},ox=function(e,t){return function(n,r){t(n,r,e)}};let r6=class extends TP{constructor(t,n,r,o,s,a,l,d,u,h,f,g,k){super(t,{...o.getRawOptions(),overflowWidgetsDomNode:o.getOverflowWidgetsDomNode()},r,s,a,l,d,u,h,f,g,k),this._parentEditor=o,this._overwriteOptions=n,super.updateOptions(this._overwriteOptions),this._register(o.onDidChangeConfiguration(A=>this._onParentConfigurationChanged(A)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(t){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(t){nOe(this._overwriteOptions,t,!0),super.updateOptions(this._overwriteOptions)}};r6=txo([ox(4,$n),ox(5,Co),ox(6,Ca),ox(7,Fi),ox(8,Il),ox(9,cc),ox(10,xh),ox(11,bl),ox(12,Zn)],r6);function _Pn(e){const t=e.get(Co).getFocusedCodeEditor();return t instanceof r6?t.getParentEditor():t}const LCt=new Ut(new Vt(0,122,204)),nxo={showArrow:!0,showFrame:!0,className:"",frameColor:LCt,arrowColor:LCt,keepEditorSelection:!1},ixo="vs.editor.contrib.zoneWidget";class rxo{constructor(t,n,r,o,s,a,l,d){this.id="",this.domNode=t,this.afterLineNumber=n,this.afterColumn=r,this.heightInLines=o,this.showInHiddenAreas=l,this.ordinal=d,this._onDomNodeTop=s,this._onComputedHeight=a}onDomNodeTop(t){this._onDomNodeTop(t)}onComputedHeight(t){this._onComputedHeight(t)}}class oxo{constructor(t,n){this._id=t,this._domNode=n}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const p2e=class p2e{constructor(t){this._editor=t,this._ruleName=p2e._IdGenerator.nextId(),this._color=null,this._height=-1,this._decorations=this._editor.createDecorationsCollection()}dispose(){this.hide(),cje(this._ruleName)}set color(t){this._color!==t&&(this._color=t,this._updateStyle())}set height(t){this._height!==t&&(this._height=t,this._updateStyle())}_updateStyle(){cje(this._ruleName),Ame(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(t){t.column===1&&(t={lineNumber:t.lineNumber,column:2}),this._decorations.set([{range:De.fromPositions(t),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}};p2e._IdGenerator=new _tt(".arrow-decoration-");let FHe=p2e;class sxo{constructor(t,n={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._isSashResizeHeight=!1,this._viewZone=null,this._disposables=new Pt,this.container=null,this._isShowing=!1,this.editor=t,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=bw(n),nOe(this.options,nxo,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(r=>{const o=this._getWidth(r);this.domNode.style.width=o+"px",this.domNode.style.left=this._getLeft(r)+"px",this._onWidth(o)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new FHe(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(t){t.frameColor&&(this.options.frameColor=t.frameColor),t.arrowColor&&(this.options.arrowColor=t.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const t=this.options.frameColor.toString();this.container.style.borderTopColor=t,this.container.style.borderBottomColor=t}if(this._arrow&&this.options.arrowColor){const t=this.options.arrowColor.toString();this._arrow.color=t}}_getWidth(t){return t.width-t.minimap.minimapWidth-t.verticalScrollbarWidth}_getLeft(t){return t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?t.minimap.minimapWidth:0}_onViewZoneTop(t){this.domNode.style.top=t+"px"}_onViewZoneHeight(t){var n;if(this.domNode.style.height=`${t}px`,this.container){const r=t-this._decoratingElementsHeight();this.container.style.height=`${r}px`;const o=this.editor.getLayoutInfo();this._doLayout(r,this._getWidth(o))}(n=this._resizeSash)==null||n.layout()}get position(){const t=this._positionMarkerId.getRange(0);if(t)return t.getStartPosition()}show(t,n){const r=De.isIRange(t)?De.lift(t):De.fromPositions(t);this._isShowing=!0,this._showImpl(r,n),this._isShowing=!1,this._positionMarkerId.set([{range:r,options:Ki.EMPTY}])}hide(){var t;this._viewZone&&(this.editor.changeViewZones(n=>{this._viewZone&&n.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(t=this._arrow)==null||t.hide(),this._positionMarkerId.clear(),this._isSashResizeHeight=!1}_decoratingElementsHeight(){const t=this.editor.getOption(75);let n=0;if(this.options.showArrow){const r=Math.round(t/3);n+=2*r}if(this.options.showFrame){const r=this.options.frameWidth??Math.round(t/9);n+=2*r}return n}_getMaximumHeightInLines(){return Math.max(12,this.editor.getLayoutInfo().height/this.editor.getOption(75)*.8)}_showImpl(t,n){const r=t.getStartPosition(),o=this.editor.getLayoutInfo(),s=this._getWidth(o);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(o)+"px";const a=document.createElement("div");a.style.overflow="hidden";const l=this.editor.getOption(75),d=this._getMaximumHeightInLines();d!==void 0&&(n=Math.min(n,d));let u=0,h=0;if(this._arrow&&this.options.showArrow&&(u=Math.round(l/3),this._arrow.height=u,this._arrow.show(r)),this.options.showFrame&&(h=Math.round(l/9)),this.editor.changeViewZones(k=>{this._viewZone&&k.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new rxo(a,r.lineNumber,r.column,n,A=>this._onViewZoneTop(A),A=>this._onViewZoneHeight(A),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=k.addZone(this._viewZone),this._overlayWidget=new oxo(ixo+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this._updateSashEnablement(),this.container&&this.options.showFrame){const k=this.options.frameWidth?this.options.frameWidth:h;this.container.style.borderTopWidth=k+"px",this.container.style.borderBottomWidth=k+"px"}const f=n*l-this._decoratingElementsHeight();this.container&&(this.container.style.top=u+"px",this.container.style.height=f+"px",this.container.style.overflow="hidden"),this._doLayout(f,s),this.options.keepEditorSelection||this.editor.setSelection(t);const g=this.editor.getModel();if(g){const k=g.validateRange(new De(t.startLineNumber,1,t.endLineNumber+1,1));this.revealRange(k,k.startLineNumber===g.getLineCount())}}revealRange(t,n){n?this.editor.revealLineNearTop(t.endLineNumber,0):this.editor.revealRange(t,0)}setCssClass(t,n){this.container&&(n&&this.container.classList.remove(n),this.container.classList.add(t))}_onWidth(t){}_doLayout(t,n){}_relayout(t,n){const r=this._getMaximumHeightInLines(),o=n&&r!==void 0?Math.min(r,t):t;this._viewZone&&this._viewZone.heightInLines!==o&&(this.editor.changeViewZones(s=>{this._viewZone&&(this._viewZone.heightInLines=o,s.layoutZone(this._viewZone.id))}),this._updateSashEnablement())}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new OA(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let t;this._disposables.add(this._resizeSash.onDidStart(n=>{this._viewZone&&(t={startY:n.startY,heightInLines:this._viewZone.heightInLines,...this._getResizeBounds()})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{t=void 0})),this._disposables.add(this._resizeSash.onDidChange(n=>{if(t){const r=(n.currentY-t.startY)/this.editor.getOption(75),o=r<0?Math.ceil(r):Math.floor(r),s=t.heightInLines+o;s>t.minLines&&s=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},eMn=function(e,t){return function(n,r){t(n,r,e)}};const tMn=Lr("IPeekViewService");qr(tMn,class{constructor(){this._widgets=new Map}addExclusiveWidget(e,t){const n=this._widgets.get(e);n&&(n.listener.dispose(),n.widget.dispose());const r=()=>{const o=this._widgets.get(e);o&&o.widget===t&&(o.listener.dispose(),this._widgets.delete(e))};this._widgets.set(e,{widget:t,listener:t.onDidClose(r)})}},1);var Lm;(function(e){e.inPeekEditor=new Ln("inReferenceSearchEditor",!0,j(1316,"Whether the current code editor is embedded inside peek")),e.notInPeekEditor=e.inPeekEditor.toNegated()})(Lm||(Lm={}));var lH;let C1e=(lH=class{constructor(t,n){t instanceof r6&&Lm.inPeekEditor.bindTo(n)}dispose(){}},lH.ID="editor.contrib.referenceController",lH);C1e=$Pn([eMn(1,Fi)],C1e);mo(C1e.ID,C1e,0);const axo={headerBackgroundColor:Ut.white,primaryHeadingColor:Ut.fromHex("#333333"),secondaryHeadingColor:Ut.fromHex("#6c6c6cb3")};let x1e=class extends sxo{constructor(t,n,r){super(t,n),this.instantiationService=r,this._onDidClose=new it,this.onDidClose=this._onDidClose.event,nOe(this.options,axo,!1);const o=ml(this.editor);o.openedPeekWidgets.set(o.openedPeekWidgets.get()+1,void 0)}dispose(){if(!this.disposed){this.disposed=!0,super.dispose(),this._onDidClose.fire(this);const t=ml(this.editor);t.openedPeekWidgets.set(t.openedPeekWidgets.get()-1,void 0)}}style(t){const n=this.options;t.headerBackgroundColor&&(n.headerBackgroundColor=t.headerBackgroundColor),t.primaryHeadingColor&&(n.primaryHeadingColor=t.primaryHeadingColor),t.secondaryHeadingColor&&(n.secondaryHeadingColor=t.secondaryHeadingColor),super.style(t)}_applyStyles(){super._applyStyles();const t=this.options;this._headElement&&t.headerBackgroundColor&&(this._headElement.style.backgroundColor=t.headerBackgroundColor.toString()),this._primaryHeading&&t.primaryHeadingColor&&(this._primaryHeading.style.color=t.primaryHeadingColor.toString()),this._secondaryHeading&&t.secondaryHeadingColor&&(this._secondaryHeading.style.color=t.secondaryHeadingColor.toString()),this._bodyElement&&t.frameColor&&(this._bodyElement.style.borderColor=t.frameColor.toString())}_fillContainer(t){this.setCssClass("peekview-widget"),this._headElement=ln(".head"),this._bodyElement=ln(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),t.appendChild(this._headElement),t.appendChild(this._bodyElement)}_fillHead(t,n){this._titleElement=ln(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Sc(this._titleElement,"click",s=>this._onTitleClick(s))),tn(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=ln("span.filename"),this._secondaryHeading=ln("span.dirname"),this._metaHeading=ln("span.meta"),tn(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const r=ln(".peekview-actions");tn(this._headElement,r);const o=this._getActionBarOptions();this._actionbarWidget=new bm(r,o),this._disposables.add(this._actionbarWidget),n||this._actionbarWidget.push(this._disposables.add(new ak("peekview.close",j(1317,"Close"),mi.asClassName(Jt.close),!0,()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(t){}_getActionBarOptions(){return{actionViewItemProvider:knt.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(t){}setTitle(t,n){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=t,this._primaryHeading.setAttribute("title",t),n?this._secondaryHeading.innerText=n:kh(this._secondaryHeading))}setMetaTitle(t){this._metaHeading&&(t?(this._metaHeading.innerText=t,O1(this._metaHeading)):ag(this._metaHeading))}_doLayout(t,n){if(!this._isShowing&&t<0){this.dispose();return}const r=Math.ceil(this.editor.getOption(75)*1.2),o=Math.round(t-(r+1));this._doLayoutHead(r,n),this._doLayoutBody(o,n)}_doLayoutHead(t,n){this._headElement&&(this._headElement.style.height=`${t}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(t,n){this._bodyElement&&(this._bodyElement.style.height=`${t}px`)}};x1e=$Pn([eMn(2,$n)],x1e);const lxo=He("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Ut.black,hcLight:Ut.white},j(1318,"Background color of the peek view title area.")),nMn=He("peekViewTitleLabel.foreground",{dark:Ut.white,light:Ut.black,hcDark:Ut.white,hcLight:lC},j(1319,"Color of the peek view title.")),iMn=He("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},j(1320,"Color of the peek view title info.")),cxo=He("peekView.border",{dark:Iy,light:Iy,hcDark:uo,hcLight:uo},j(1321,"Color of the peek view borders and arrow.")),dxo=He("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Ut.black,hcLight:Ut.white},j(1322,"Background color of the peek view result list."));He("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Ut.white,hcLight:lC},j(1323,"Foreground color for line nodes in the peek view result list."));He("peekViewResult.fileForeground",{dark:Ut.white,light:"#1E1E1E",hcDark:Ut.white,hcLight:lC},j(1324,"Foreground color for file nodes in the peek view result list."));He("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},j(1325,"Background color of the selected entry in the peek view result list."));He("peekViewResult.selectionForeground",{dark:Ut.white,light:"#6C6C6C",hcDark:Ut.white,hcLight:lC},j(1326,"Foreground color of the selected entry in the peek view result list."));const Unt=He("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Ut.black,hcLight:Ut.white},j(1327,"Background color of the peek view editor."));He("peekViewEditorGutter.background",Unt,j(1328,"Background color of the gutter in the peek view editor."));He("peekViewEditorStickyScroll.background",Unt,j(1329,"Background color of sticky scroll in the peek view editor."));He("peekViewEditorStickyScrollGutter.background",Unt,j(1330,"Background color of the gutter part of sticky scroll in the peek view editor."));He("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},j(1331,"Match highlight color in the peek view result list."));He("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},j(1332,"Match highlight color in the peek view editor."));He("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:qa,hcLight:qa},j(1333,"Match highlight border in the peek view editor."));class uxo{get templateId(){return this.renderer.templateId}constructor(t,n){this.renderer=t,this.modelProvider=n}renderTemplate(t){return{data:this.renderer.renderTemplate(t),disposable:ct.None}}renderElement(t,n,r,o){var d;if((d=r.disposable)==null||d.dispose(),!r.data)return;const s=this.modelProvider();if(s.isResolved(t))return this.renderer.renderElement(s.get(t),t,r.data,o);const a=new Ya,l=s.resolve(t,a.token);r.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(t,r.data),l.then(u=>this.renderer.renderElement(u,t,r.data,o))}disposeTemplate(t){t.disposable&&(t.disposable.dispose(),t.disposable=void 0),t.data&&(this.renderer.disposeTemplate(t.data),t.data=void 0)}}class hxo{constructor(t,n){this.modelProvider=t,this.accessibilityProvider=n}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(t){const n=this.modelProvider();return n.isResolved(t)?this.accessibilityProvider.getAriaLabel(n.get(t)):null}}function Axo(e,t){return{...t,accessibilityProvider:t.accessibilityProvider&&new hxo(e,t.accessibilityProvider)}}class fxo{constructor(t,n,r,o,s={}){this.modelDisposables=new Pt;const a=()=>this.model,l=o.map(d=>new uxo(d,a));this.list=new Tk(t,n,r,l,Axo(a,s))}updateOptions(t){this.list.updateOptions(t)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return un.map(this.list.onMouseDblClick,({element:t,index:n,browserEvent:r})=>({element:t===void 0?void 0:this._model.get(t),index:n,browserEvent:r}))}get onPointer(){return un.map(this.list.onPointer,({element:t,index:n,browserEvent:r})=>({element:t===void 0?void 0:this._model.get(t),index:n,browserEvent:r}))}get onDidChangeSelection(){return un.map(this.list.onDidChangeSelection,({elements:t,indexes:n,browserEvent:r})=>({elements:t.map(o=>this._model.get(o)),indexes:n,browserEvent:r}))}get model(){return this._model}set model(t){this.modelDisposables.clear(),this._model=t,this.list.splice(0,this.list.length,eg(t.length)),this.modelDisposables.add(t.onDidIncrementLength(n=>this.list.splice(this.list.length,0,eg(this.list.length,n))))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(t=>this.model.get(t))}style(t){this.list.style(t)}dispose(){this.list.dispose(),this.modelDisposables.dispose()}}const gxo={separatorBorder:Ut.transparent};class rMn{set size(t){this._size=t}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(t,n){var r,o;if(t!==this.visible){t?(this.size=ng(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof n=="number"?n:this.size,this.size=0),this.container.classList.toggle("visible",t);try{(o=(r=this.view).setVisible)==null||o.call(r,t)}catch(s){console.error("Splitview: Failed to set visible view"),console.error(s)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(t){this.container.style.pointerEvents=t?"":"none"}constructor(t,n,r,o){this.container=t,this.view=n,this.disposable=o,this._cachedVisibleSize=void 0,typeof r=="number"?(this._size=r,this._cachedVisibleSize=void 0,t.classList.add("visible")):(this._size=0,this._cachedVisibleSize=r.cachedVisibleSize)}layout(t,n){this.layoutContainer(t);try{this.view.layout(this.size,t,n)}catch(r){console.error("Splitview: Failed to layout view"),console.error(r)}}dispose(){this.disposable.dispose()}}class mxo extends rMn{layoutContainer(t){this.container.style.top=`${t}px`,this.container.style.height=`${this.size}px`}}class kxo extends rMn{layoutContainer(t){this.container.style.left=`${t}px`,this.container.style.width=`${this.size}px`}}var Jx;(function(e){e[e.Idle=0]="Idle",e[e.Busy=1]="Busy"})(Jx||(Jx={}));var L1e;(function(e){e.Distribute={type:"distribute"};function t(o){return{type:"split",index:o}}e.Split=t;function n(o){return{type:"auto",index:o}}e.Auto=n;function r(o){return{type:"invisible",cachedVisibleSize:o}}e.Invisible=r})(L1e||(L1e={}));class oMn extends ct{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(t){for(const n of this.sashItems)n.sash.orthogonalStartSash=t;this._orthogonalStartSash=t}set orthogonalEndSash(t){for(const n of this.sashItems)n.sash.orthogonalEndSash=t;this._orthogonalEndSash=t}set startSnappingEnabled(t){this._startSnappingEnabled!==t&&(this._startSnappingEnabled=t,this.updateSashEnablement())}set endSnappingEnabled(t){this._endSnappingEnabled!==t&&(this._endSnappingEnabled=t,this.updateSashEnablement())}constructor(t,n={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Jx.Idle,this._onDidSashChange=this._register(new it),this._onDidSashReset=this._register(new it),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=n.orientation??0,this.inverseAltBehavior=n.inverseAltBehavior??!1,this.proportionalLayout=n.proportionalLayout??!0,this.getSashOrthogonalSize=n.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),t.appendChild(this.el),this.sashContainer=tn(this.el,ln(".sash-container")),this.viewContainer=ln(".split-view-container"),this.scrollable=this._register(new pZ({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:o=>Cm(oi(this.el),o)})),this.scrollableElement=this._register(new vOe(this.viewContainer,{vertical:this.orientation===0?n.scrollbarVisibility??1:2,horizontal:this.orientation===1?n.scrollbarVisibility??1:2},this.scrollable));const r=this._register(new ms(this.viewContainer,"scroll")).event;this._register(r(o=>{const s=this.scrollableElement.getScrollPosition(),a=Math.abs(this.viewContainer.scrollLeft-s.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,l=Math.abs(this.viewContainer.scrollTop-s.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(a!==void 0||l!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:a,scrollTop:l})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(o=>{o.scrollTopChanged&&(this.viewContainer.scrollTop=o.scrollTop),o.scrollLeftChanged&&(this.viewContainer.scrollLeft=o.scrollLeft)})),tn(this.el,this.scrollableElement.getDomNode()),this.style(n.styles||gxo),n.descriptor&&(this.size=n.descriptor.size,n.descriptor.views.forEach((o,s)=>{const a=QA(o.visible)||o.visible?o.size:{type:"invisible",cachedVisibleSize:o.size},l=o.view;this.doAddView(l,a,s,!0)}),this._contentSize=this.viewItems.reduce((o,s)=>o+s.size,0),this.saveProportions())}style(t){t.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",t.separatorBorder.toString()))}addView(t,n,r=this.viewItems.length,o){this.doAddView(t,n,r,o)}layout(t,n){const r=Math.max(this.size,this._contentSize);if(this.size=t,this.layoutContext=n,this.proportions){let o=0;for(let s=0;s0&&(a.size=ng(Math.round(l*t/o),a.minimumSize,a.maximumSize))}}else{const o=eg(this.viewItems.length),s=o.filter(l=>this.viewItems[l].priority===1),a=o.filter(l=>this.viewItems[l].priority===2);this.resize(this.viewItems.length-1,t-r,void 0,s,a)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(t=>t.proportionalLayout&&t.visible?t.size/this._contentSize:void 0))}onSashStart({sash:t,start:n,alt:r}){for(const l of this.viewItems)l.enabled=!1;const o=this.sashItems.findIndex(l=>l.sash===t),s=Jp(pt(this.el.ownerDocument.body,"keydown",l=>a(this.sashDragState.current,l.altKey)),pt(this.el.ownerDocument.body,"keyup",()=>a(this.sashDragState.current,!1))),a=(l,d)=>{const u=this.viewItems.map(A=>A.size);let h=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(d=!d),d)if(o===this.sashItems.length-1){const m=this.viewItems[o];h=(m.minimumSize-m.size)/2,f=(m.maximumSize-m.size)/2}else{const m=this.viewItems[o+1];h=(m.size-m.maximumSize)/2,f=(m.size-m.minimumSize)/2}let g,k;if(!d){const A=eg(o,-1),m=eg(o+1,this.viewItems.length),v=A.reduce((L,S)=>L+(this.viewItems[S].minimumSize-u[S]),0),p=A.reduce((L,S)=>L+(this.viewItems[S].viewMaximumSize-u[S]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((L,S)=>L+(u[S]-this.viewItems[S].minimumSize),0),O=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((L,S)=>L+(u[S]-this.viewItems[S].viewMaximumSize),0),w=Math.max(v,O),y=Math.min(b,p),C=this.findFirstSnapIndex(A),x=this.findFirstSnapIndex(m);if(typeof C=="number"){const L=this.viewItems[C],S=Math.floor(L.viewMinimumSize/2);g={index:C,limitDelta:L.visible?w-S:w+S,size:L.size}}if(typeof x=="number"){const L=this.viewItems[x],S=Math.floor(L.viewMinimumSize/2);k={index:x,limitDelta:L.visible?y+S:y-S,size:L.size}}}this.sashDragState={start:l,current:l,index:o,sizes:u,minDelta:h,maxDelta:f,alt:d,snapBefore:g,snapAfter:k,disposable:s}};a(n,r)}onSashChange({current:t}){const{index:n,start:r,sizes:o,alt:s,minDelta:a,maxDelta:l,snapBefore:d,snapAfter:u}=this.sashDragState;this.sashDragState.current=t;const h=t-r,f=this.resize(n,h,o,void 0,void 0,a,l,d,u);if(s){const g=n===this.sashItems.length-1,k=this.viewItems.map(O=>O.size),A=g?n:n+1,m=this.viewItems[A],v=m.size-m.maximumSize,p=m.size-m.minimumSize,b=g?n-1:n+1;this.resize(b,-f,k,void 0,void 0,v,p)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(t){this._onDidSashChange.fire(t),this.sashDragState.disposable.dispose(),this.saveProportions();for(const n of this.viewItems)n.enabled=!0}onViewChange(t,n){const r=this.viewItems.indexOf(t);r<0||r>=this.viewItems.length||(n=typeof n=="number"?n:t.size,n=ng(n,t.minimumSize,t.maximumSize),this.inverseAltBehavior&&r>0?(this.resize(r-1,Math.floor((t.size-n)/2)),this.distributeEmptySpace(),this.layoutViews()):(t.size=n,this.relayout([r],void 0)))}resizeView(t,n){if(!(t<0||t>=this.viewItems.length)){if(this.state!==Jx.Idle)throw new Error("Cant modify splitview");this.state=Jx.Busy;try{const r=eg(this.viewItems.length).filter(l=>l!==t),o=[...r.filter(l=>this.viewItems[l].priority===1),t],s=r.filter(l=>this.viewItems[l].priority===2),a=this.viewItems[t];n=Math.round(n),n=ng(n,a.minimumSize,Math.min(a.maximumSize,this.size)),a.size=n,this.relayout(o,s)}finally{this.state=Jx.Idle}}}distributeViewSizes(){const t=[];let n=0;for(const l of this.viewItems)l.maximumSize-l.minimumSize>0&&(t.push(l),n+=l.size);const r=Math.floor(n/t.length);for(const l of t)l.size=ng(r,l.minimumSize,l.maximumSize);const o=eg(this.viewItems.length),s=o.filter(l=>this.viewItems[l].priority===1),a=o.filter(l=>this.viewItems[l].priority===2);this.relayout(s,a)}getViewSize(t){return t<0||t>=this.viewItems.length?-1:this.viewItems[t].size}doAddView(t,n,r=this.viewItems.length,o){if(this.state!==Jx.Idle)throw new Error("Cant modify splitview");this.state=Jx.Busy;try{const s=ln(".split-view-view");r===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(r));const a=t.onDidChange(g=>this.onViewChange(h,g)),l=Gn(()=>s.remove()),d=Jp(a,l);let u;typeof n=="number"?u=n:(n.type==="auto"&&(this.areViewsDistributed()?n={type:"distribute"}:n={type:"split",index:n.index}),n.type==="split"?u=this.getViewSize(n.index)/2:n.type==="invisible"?u={cachedVisibleSize:n.cachedVisibleSize}:u=t.minimumSize);const h=this.orientation===0?new mxo(s,t,u,d):new kxo(s,t,u,d);if(this.viewItems.splice(r,0,h),this.viewItems.length>1){const g={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},k=this.orientation===0?new OA(this.sashContainer,{getHorizontalSashTop:L=>this.getSashPosition(L),getHorizontalSashWidth:this.getSashOrthogonalSize},{...g,orientation:1}):new OA(this.sashContainer,{getVerticalSashLeft:L=>this.getSashPosition(L),getVerticalSashHeight:this.getSashOrthogonalSize},{...g,orientation:0}),A=this.orientation===0?L=>({sash:k,start:L.startY,current:L.currentY,alt:L.altKey}):L=>({sash:k,start:L.startX,current:L.currentX,alt:L.altKey}),v=un.map(k.onDidStart,A)(this.onSashStart,this),b=un.map(k.onDidChange,A)(this.onSashChange,this),w=un.map(k.onDidEnd,()=>this.sashItems.findIndex(L=>L.sash===k))(this.onSashEnd,this),y=k.onDidReset(()=>{const L=this.sashItems.findIndex(M=>M.sash===k),S=eg(L,-1),E=eg(L+1,this.viewItems.length),Q=this.findFirstSnapIndex(S),T=this.findFirstSnapIndex(E);typeof Q=="number"&&!this.viewItems[Q].visible||typeof T=="number"&&!this.viewItems[T].visible||this._onDidSashReset.fire(L)}),C=Jp(v,b,w,y,k),x={sash:k,disposable:C};this.sashItems.splice(r-1,0,x)}s.appendChild(t.element);let f;typeof n!="number"&&n.type==="split"&&(f=[n.index]),o||this.relayout([r],f),!o&&typeof n!="number"&&n.type==="distribute"&&this.distributeViewSizes()}finally{this.state=Jx.Idle}}relayout(t,n){const r=this.viewItems.reduce((o,s)=>o+s.size,0);this.resize(this.viewItems.length-1,this.size-r,void 0,t,n),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(t,n,r=this.viewItems.map(h=>h.size),o,s,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,d,u){if(t<0||t>=this.viewItems.length)return 0;const h=eg(t,-1),f=eg(t+1,this.viewItems.length);if(s)for(const x of s)b6e(h,x),b6e(f,x);if(o)for(const x of o)Tle(h,x),Tle(f,x);const g=h.map(x=>this.viewItems[x]),k=h.map(x=>r[x]),A=f.map(x=>this.viewItems[x]),m=f.map(x=>r[x]),v=h.reduce((x,L)=>x+(this.viewItems[L].minimumSize-r[L]),0),p=h.reduce((x,L)=>x+(this.viewItems[L].maximumSize-r[L]),0),b=f.length===0?Number.POSITIVE_INFINITY:f.reduce((x,L)=>x+(r[L]-this.viewItems[L].minimumSize),0),O=f.length===0?Number.NEGATIVE_INFINITY:f.reduce((x,L)=>x+(r[L]-this.viewItems[L].maximumSize),0),w=Math.max(v,O,a),y=Math.min(b,p,l);let C=!1;if(d){const x=this.viewItems[d.index],L=n>=d.limitDelta;C=L!==x.visible,x.setVisible(L,d.size)}if(!C&&u){const x=this.viewItems[u.index],L=nl+d.size,0);let r=this.size-n;const o=eg(this.viewItems.length-1,-1),s=o.filter(l=>this.viewItems[l].priority===1),a=o.filter(l=>this.viewItems[l].priority===2);for(const l of a)b6e(o,l);for(const l of s)Tle(o,l);typeof t=="number"&&Tle(o,t);for(let l=0;r!==0&&ln+r.size,0);let t=0;for(const n of this.viewItems)n.layout(t,this.layoutContext),t+=n.size;this.sashItems.forEach(n=>n.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let t=!1;const n=this.viewItems.map(d=>t=d.size-d.minimumSize>0||t);t=!1;const r=this.viewItems.map(d=>t=d.maximumSize-d.size>0||t),o=[...this.viewItems].reverse();t=!1;const s=o.map(d=>t=d.size-d.minimumSize>0||t).reverse();t=!1;const a=o.map(d=>t=d.maximumSize-d.size>0||t).reverse();let l=0;for(let d=0;d0||this.startSnappingEnabled)?u.state=1:b&&n[d]&&(l0)return;if(!r.visible&&r.snap)return n}}areViewsDistributed(){let t,n;for(const r of this.viewItems)if(t=t===void 0?r.size:Math.min(t,r.size),n=n===void 0?r.size:Math.max(n,r.size),n-t>2)return!1;return!0}dispose(){var t;(t=this.sashDragState)==null||t.disposable.dispose(),hs(this.viewItems),this.viewItems=[],this.sashItems.forEach(n=>n.disposable.dispose()),this.sashItems=[],super.dispose()}}const b2e=class b2e{constructor(t,n,r){this.columns=t,this.getColumnSize=r,this.templateId=b2e.TemplateId,this.renderedTemplates=new Set;const o=new Map(n.map(s=>[s.templateId,s]));this.renderers=[];for(const s of t){const a=o.get(s.templateId);if(!a)throw new Error(`Table cell renderer for template id ${s.templateId} not found.`);this.renderers.push(a)}}renderTemplate(t){const n=tn(t,ln(".monaco-table-tr")),r=[],o=[];for(let a=0;athis.disposables.add(new pxo(h,f))),d={size:l.reduce((h,f)=>h+f.column.weight,0),views:l.map(h=>({size:h.column.weight,view:h}))};this.splitview=this.disposables.add(new oMn(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:d})),this.splitview.el.style.height=`${r.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${r.headerRowHeight}px`;const u=new S1e(o,s,h=>this.splitview.getViewSize(h));this.list=this.disposables.add(new Tk(t,this.domNode,vxo(r),[u],a)),un.any(...l.map(h=>h.onDidLayout))(([h,f])=>u.layoutColumn(h,f),null,this.disposables),this.splitview.onDidSashReset(h=>{const f=o.reduce((k,A)=>k+A.weight,0),g=o[h].weight/f*this.cachedWidth;this.splitview.resizeView(h,g)},null,this.disposables),this.styleElement=v2(this.domNode),this.style(Lbo)}updateOptions(t){this.list.updateOptions(t)}splice(t,n,r=[]){this.list.splice(t,n,r)}getHTMLElement(){return this.domNode}style(t){const n=[];n.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=n.join(` `),this.list.style(t)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}},eF.InstanceCount=0,eF);var U0;(function(e){e[e.Expanded=0]="Expanded",e[e.Collapsed=1]="Collapsed",e[e.PreserveOrExpanded=2]="PreserveOrExpanded",e[e.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(U0||(U0={}));var FQ;(function(e){e[e.Unknown=0]="Unknown",e[e.Twistie=1]="Twistie",e[e.Element=2]="Element",e[e.Filter=3]="Filter"})(FQ||(FQ={}));class X0 extends Error{constructor(t,n){super(`TreeError [${t}] ${n}`)}}class jnt{constructor(t){this.fn=t,this._map=new WeakMap}map(t){let n=this._map.get(t);return n||(n=this.fn(t),this._map.set(t,n)),n}}class $9{constructor(t,n,r,o){this.originalStart=t,this.originalLength=n,this.modifiedStart=r,this.modifiedLength=o}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class SCt{constructor(t){this.source=t}getElements(){const t=this.source,n=new Int32Array(t.length);for(let r=0,o=t.length;r0||this.m_modifiedCount>0)&&this.m_changes.push(new $9(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(t,n){this.m_originalStart=Math.min(this.m_originalStart,t),this.m_modifiedStart=Math.min(this.m_modifiedStart,n),this.m_originalCount++}AddModifiedElement(t,n){this.m_originalStart=Math.min(this.m_originalStart,t),this.m_modifiedStart=Math.min(this.m_modifiedStart,n),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class Mw{constructor(t,n,r=null){this.ContinueProcessingPredicate=r,this._originalSequence=t,this._modifiedSequence=n;const[o,s,a]=Mw._getElements(t),[l,d,u]=Mw._getElements(n);this._hasStrings=a&&u,this._originalStringElements=o,this._originalElementsOrHash=s,this._modifiedStringElements=l,this._modifiedElementsOrHash=d,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(t){return t.length>0&&typeof t[0]=="string"}static _getElements(t){const n=t.getElements();if(Mw._isStringArray(n)){const r=new Int32Array(n.length);for(let o=0,s=n.length;o=t&&o>=r&&this.ElementsAreEqual(n,o);)n--,o--;if(t>n||r>o){let f;return r<=o?(VI.Assert(t===n+1,"originalStart should only be one more than originalEnd"),f=[new $9(t,0,r,o-r+1)]):t<=n?(VI.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),f=[new $9(t,n-t+1,r,0)]):(VI.Assert(t===n+1,"originalStart should only be one more than originalEnd"),VI.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),f=[]),f}const a=[0],l=[0],d=this.ComputeRecursionPoint(t,n,r,o,a,l,s),u=a[0],h=l[0];if(d!==null)return d;if(!s[0]){const f=this.ComputeDiffRecursive(t,u,r,h,s);let g=[];return s[0]?g=[new $9(u+1,n-(u+1)+1,h+1,o-(h+1)+1)]:g=this.ComputeDiffRecursive(u+1,n,h+1,o,s),this.ConcatenateChanges(f,g)}return[new $9(t,n-t+1,r,o-r+1)]}WALKTRACE(t,n,r,o,s,a,l,d,u,h,f,g,k,A,m,v,p,b){let O=null,w=null,y=new TCt,C=n,x=r,L=k[0]-v[0]-o,S=-1073741824,E=this.m_forwardHistory.length-1;do{const Q=L+t;Q===C||Q=0&&(u=this.m_forwardHistory[E],t=u[0],C=1,x=u.length-1)}while(--E>=-1);if(O=y.getReverseChanges(),b[0]){let Q=k[0]+1,T=v[0]+1;if(O!==null&&O.length>0){const M=O[O.length-1];Q=Math.max(Q,M.getOriginalEnd()),T=Math.max(T,M.getModifiedEnd())}w=[new $9(Q,g-Q+1,T,m-T+1)]}else{y=new TCt,C=a,x=l,L=k[0]-v[0]-d,S=1073741824,E=p?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const Q=L+s;Q===C||Q=h[Q+1]?(f=h[Q+1]-1,A=f-L-d,f>S&&y.MarkNextChange(),S=f+1,y.AddOriginalElement(f+1,A+1),L=Q+1-s):(f=h[Q-1],A=f-L-d,f>S&&y.MarkNextChange(),S=f,y.AddModifiedElement(f+1,A+1),L=Q-1-s),E>=0&&(h=this.m_reverseHistory[E],s=h[0],C=1,x=h.length-1)}while(--E>=-1);w=y.getChanges()}return this.ConcatenateChanges(O,w)}ComputeRecursionPoint(t,n,r,o,s,a,l){let d=0,u=0,h=0,f=0,g=0,k=0;t--,r--,s[0]=0,a[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const A=n-t+(o-r),m=A+1,v=new Int32Array(m),p=new Int32Array(m),b=o-r,O=n-t,w=t-r,y=n-o,x=(O-b)%2===0;v[b]=t,p[O]=n,l[0]=!1;for(let L=1;L<=A/2+1;L++){let S=0,E=0;h=this.ClipDiagonalBound(b-L,L,b,m),f=this.ClipDiagonalBound(b+L,L,b,m);for(let T=h;T<=f;T+=2){T===h||TS+E&&(S=d,E=u),!x&&Math.abs(T-O)<=L-1&&d>=p[T])return s[0]=d,a[0]=u,M<=p[T]&&L<=1448?this.WALKTRACE(b,h,f,w,O,g,k,y,v,p,d,n,s,u,o,a,x,l):null}const Q=(S-t+(E-r)-L)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(S,Q))return l[0]=!0,s[0]=S,a[0]=E,Q>0&&L<=1448?this.WALKTRACE(b,h,f,w,O,g,k,y,v,p,d,n,s,u,o,a,x,l):(t++,r++,[new $9(t,n-t+1,r,o-r+1)]);g=this.ClipDiagonalBound(O-L,L,O,m),k=this.ClipDiagonalBound(O+L,L,O,m);for(let T=g;T<=k;T+=2){T===g||T=p[T+1]?d=p[T+1]-1:d=p[T-1],u=d-(T-O)-y;const M=d;for(;d>t&&u>r&&this.ElementsAreEqual(d,u);)d--,u--;if(p[T]=d,x&&Math.abs(T-b)<=L&&d<=v[T])return s[0]=d,a[0]=u,M>=v[T]&&L<=1448?this.WALKTRACE(b,h,f,w,O,g,k,y,v,p,d,n,s,u,o,a,x,l):null}if(L<=1447){let T=new Int32Array(f-h+2);T[0]=b-h+1,zI.Copy2(v,h,T,1,f-h+1),this.m_forwardHistory.push(T),T=new Int32Array(k-g+2),T[0]=O-g+1,zI.Copy2(p,g,T,1,k-g+1),this.m_reverseHistory.push(T)}}return this.WALKTRACE(b,h,f,w,O,g,k,y,v,p,d,n,s,u,o,a,x,l)}PrettifyChanges(t){for(let n=0;n0,l=r.modifiedLength>0;for(;r.originalStart+r.originalLength=0;n--){const r=t[n];let o=0,s=0;if(n>0){const f=t[n-1];o=f.originalStart+f.originalLength,s=f.modifiedStart+f.modifiedLength}const a=r.originalLength>0,l=r.modifiedLength>0;let d=0,u=this._boundaryScore(r.originalStart,r.originalLength,r.modifiedStart,r.modifiedLength);for(let f=1;;f++){const g=r.originalStart-f,k=r.modifiedStart-f;if(gu&&(u=m,d=f)}r.originalStart-=d,r.modifiedStart-=d;const h=[null];if(n>0&&this.ChangesOverlap(t[n-1],t[n],h)){t[n-1]=h[0],t.splice(n,1),n++;continue}}if(this._hasStrings)for(let n=1,r=t.length;n0&&k>d&&(d=k,u=f,h=g)}return d>0?[u,h]:null}_contiguousSequenceScore(t,n,r){let o=0;for(let s=0;s=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[t])}_OriginalRegionIsBoundary(t,n){if(this._OriginalIsBoundary(t)||this._OriginalIsBoundary(t-1))return!0;if(n>0){const r=t+n;if(this._OriginalIsBoundary(r-1)||this._OriginalIsBoundary(r))return!0}return!1}_ModifiedIsBoundary(t){return t<=0||t>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[t])}_ModifiedRegionIsBoundary(t,n){if(this._ModifiedIsBoundary(t)||this._ModifiedIsBoundary(t-1))return!0;if(n>0){const r=t+n;if(this._ModifiedIsBoundary(r-1)||this._ModifiedIsBoundary(r))return!0}return!1}_boundaryScore(t,n,r,o){const s=this._OriginalRegionIsBoundary(t,n)?1:0,a=this._ModifiedRegionIsBoundary(r,o)?1:0;return s+a}ConcatenateChanges(t,n){const r=[];if(t.length===0||n.length===0)return n.length>0?n:t;if(this.ChangesOverlap(t[t.length-1],n[0],r)){const o=new Array(t.length+n.length-1);return zI.Copy(t,0,o,0,t.length-1),o[t.length-1]=r[0],zI.Copy(n,1,o,t.length,n.length-1),o}else{const o=new Array(t.length+n.length);return zI.Copy(t,0,o,0,t.length),zI.Copy(n,0,o,t.length,n.length),o}}ChangesOverlap(t,n,r){if(VI.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),VI.Assert(t.modifiedStart<=n.modifiedStart,"Left change is not less than or equal to right change"),t.originalStart+t.originalLength>=n.originalStart||t.modifiedStart+t.modifiedLength>=n.modifiedStart){const o=t.originalStart;let s=t.originalLength;const a=t.modifiedStart;let l=t.modifiedLength;return t.originalStart+t.originalLength>=n.originalStart&&(s=n.originalStart+n.originalLength-t.originalStart),t.modifiedStart+t.modifiedLength>=n.modifiedStart&&(l=n.modifiedStart+n.modifiedLength-t.modifiedStart),r[0]=new $9(o,s,a,l),!0}else return r[0]=null,!1}ClipDiagonalBound(t,n,r,o){if(t>=0&&t"u"?!1:r.collapseByDefault,this.allowNonCollapsibleParents=r.allowNonCollapsibleParents??!1,this.filter=r.filter,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.root={parent:void 0,element:n,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(t,n,r=lo.empty(),o={}){if(t.length===0)throw new X0(this.user,"Invalid tree location");o.diffIdentityProvider?this.spliceSmart(o.diffIdentityProvider,t,n,r,o):this.spliceSimple(t,n,r,o)}spliceSmart(t,n,r,o=lo.empty(),s,a=s.diffDepth??0){const{parentNode:l}=this.getParentNodeWithListIndex(n);if(!l.lastDiffIds)return this.spliceSimple(n,r,o,s);const d=[...o],u=n[n.length-1],h=new Mw({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,u),...d,...l.children.slice(u+r)].map(m=>t.getId(m.element).toString())}).ComputeDiff(!1);if(h.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(n,r,d,s);const f=n.slice(0,-1),g=(m,v,p)=>{if(a>0)for(let b=0;bp.originalStart-v.originalStart))g(k,A,k-(m.originalStart+m.originalLength)),k=m.originalStart,A=m.modifiedStart-u,this.spliceSimple([...f,k],m.originalLength,lo.slice(d,A,A+m.modifiedLength),s);g(k,A,k)}spliceSimple(t,n,r=lo.empty(),{onDidCreateNode:o,onDidDeleteNode:s,diffIdentityProvider:a}){const{parentNode:l,listIndex:d,revealed:u,visible:h}=this.getParentNodeWithListIndex(t),f=[],g=lo.map(r,y=>this.createTreeNode(y,l,l.visible?1:0,u,f,o)),k=t[t.length-1];let A=0;for(let y=k;y>=0&&ya.getId(y.element).toString())):l.lastDiffIds=l.children.map(y=>a.getId(y.element).toString()):l.lastDiffIds=void 0;let O=0;for(const y of b)y.visible&&O++;if(O!==0)for(let y=k+m.length;y0&&s){const y=C=>{s(C),C.children.forEach(y)};b.forEach(y)}if(u&&h){const y=b.reduce((C,x)=>C+(x.visible?x.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(l,p-y),this._onDidSpliceRenderedNodes.fire({start:d,deleteCount:y,elements:f})}this._onDidSpliceModel.fire({insertedNodes:m,deletedNodes:b});let w=l;for(;w;){if(w.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}w=w.parent}}rerender(t){if(t.length===0)throw new X0(this.user,"Invalid tree location");const{node:n,listIndex:r,revealed:o}=this.getTreeNodeWithListIndex(t);n.visible&&o&&this._onDidSpliceRenderedNodes.fire({start:r,deleteCount:1,elements:[n]})}has(t){return this.hasTreeNode(t)}getListIndex(t){const{listIndex:n,visible:r,revealed:o}=this.getTreeNodeWithListIndex(t);return r&&o?n:-1}getListRenderCount(t){return this.getTreeNode(t).renderNodeCount}isCollapsible(t){return this.getTreeNode(t).collapsible}setCollapsible(t,n){const r=this.getTreeNode(t);typeof n>"u"&&(n=!r.collapsible);const o={collapsible:n};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(t,o))}isCollapsed(t){return this.getTreeNode(t).collapsed}setCollapsed(t,n,r){const o=this.getTreeNode(t);typeof n>"u"&&(n=!o.collapsed);const s={collapsed:n,recursive:r||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(t,s))}_setCollapseState(t,n){const{node:r,listIndex:o,revealed:s}=this.getTreeNodeWithListIndex(t),a=this._setListNodeCollapseState(r,o,s,n);if(r!==this.root&&this.autoExpandSingleChildren&&a&&!U9e(n)&&r.collapsible&&!r.collapsed&&!n.recursive){let l=-1;for(let d=0;d-1){l=-1;break}else l=d;l>-1&&this._setCollapseState([...t,l],n)}return a}_setListNodeCollapseState(t,n,r,o){const s=this._setNodeCollapseState(t,o,!1);if(!r||!t.visible||!s)return s;const a=t.renderNodeCount,l=this.updateNodeAfterCollapseChange(t),d=a-(n===-1?0:1);return this._onDidSpliceRenderedNodes.fire({start:n+1,deleteCount:d,elements:l.slice(1)}),s}_setNodeCollapseState(t,n,r){let o;if(t===this.root?o=!1:(U9e(n)?(o=t.collapsible!==n.collapsible,t.collapsible=n.collapsible):t.collapsible?(o=t.collapsed!==n.collapsed,t.collapsed=n.collapsed):o=!1,o&&this._onDidChangeCollapseState.fire({node:t,deep:r})),!U9e(n)&&n.recursive)for(const s of t.children)o=this._setNodeCollapseState(s,n,!0)||o;return o}expandTo(t){this.eventBufferer.bufferEvents(()=>{let n=this.getTreeNode(t);for(;n.parent;)n=n.parent,t=t.slice(0,t.length-1),n.collapsed&&this._setCollapseState(t,{collapsed:!1,recursive:!1})})}refilter(){const t=this.root.renderNodeCount,n=this.updateNodeAfterFilterChange(this.root);this._onDidSpliceRenderedNodes.fire({start:0,deleteCount:t,elements:n}),this.refilterDelayer.cancel()}createTreeNode(t,n,r,o,s,a){const l={parent:n,element:t.element,children:[],depth:n.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof t.collapsible=="boolean"?t.collapsible:typeof t.collapsed<"u",collapsed:typeof t.collapsed>"u"?this.collapseByDefault:t.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},d=this._filterNode(l,r);l.visibility=d,o&&s.push(l);const u=t.children||lo.empty(),h=o&&d!==0&&!l.collapsed;let f=0,g=1;for(const k of u){const A=this.createTreeNode(k,l,d,h,s,a);l.children.push(A),g+=A.renderNodeCount,A.visible&&(A.visibleChildIndex=f++)}return this.allowNonCollapsibleParents||(l.collapsible=l.collapsible||l.children.length>0),l.visibleChildrenCount=f,l.visible=d===2?f>0:d===1,l.visible?l.collapsed||(l.renderNodeCount=g):(l.renderNodeCount=0,o&&s.pop()),a==null||a(l),l}updateNodeAfterCollapseChange(t){const n=t.renderNodeCount,r=[];return this._updateNodeAfterCollapseChange(t,r),this._updateAncestorsRenderNodeCount(t.parent,r.length-n),r}_updateNodeAfterCollapseChange(t,n){if(t.visible===!1)return 0;if(n.push(t),t.renderNodeCount=1,!t.collapsed)for(const r of t.children)t.renderNodeCount+=this._updateNodeAfterCollapseChange(r,n);return this._onDidChangeRenderNodeCount.fire(t),t.renderNodeCount}updateNodeAfterFilterChange(t){const n=t.renderNodeCount,r=[];return this._updateNodeAfterFilterChange(t,t.visible?1:0,r),this._updateAncestorsRenderNodeCount(t.parent,r.length-n),r}_updateNodeAfterFilterChange(t,n,r,o=!0){let s;if(t!==this.root){if(s=this._filterNode(t,n),s===0)return t.visible=!1,t.renderNodeCount=0,!1;o&&r.push(t)}const a=r.length;t.renderNodeCount=t===this.root?0:1;let l=!1;if(!t.collapsed||s!==0){let d=0;for(const u of t.children)l=this._updateNodeAfterFilterChange(u,s,r,o&&!t.collapsed)||l,u.visible&&(u.visibleChildIndex=d++);t.visibleChildrenCount=d}else t.visibleChildrenCount=0;return t!==this.root&&(t.visible=s===2?l:s===1,t.visibility=s),t.visible?t.collapsed||(t.renderNodeCount+=r.length-a):(t.renderNodeCount=0,o&&r.pop()),this._onDidChangeRenderNodeCount.fire(t),t.visible}_updateAncestorsRenderNodeCount(t,n){if(n!==0)for(;t;)t.renderNodeCount+=n,this._onDidChangeRenderNodeCount.fire(t),t=t.parent}_filterNode(t,n){const r=this.filter?this.filter.filter(t.element,n):1;return typeof r=="boolean"?(t.filterData=void 0,r?1:0):vre(r)?(t.filterData=r.data,WP(r.visibility)):(t.filterData=void 0,WP(r))}hasTreeNode(t,n=this.root){if(!t||t.length===0)return!0;const[r,...o]=t;return r<0||r>n.children.length?!1:this.hasTreeNode(o,n.children[r])}getTreeNode(t,n=this.root){if(!t||t.length===0)return n;const[r,...o]=t;if(r<0||r>n.children.length)throw new X0(this.user,"Invalid tree location");return this.getTreeNode(o,n.children[r])}getTreeNodeWithListIndex(t){if(t.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:n,listIndex:r,revealed:o,visible:s}=this.getParentNodeWithListIndex(t),a=t[t.length-1];if(a<0||a>n.children.length)throw new X0(this.user,"Invalid tree location");const l=n.children[a];return{node:l,listIndex:r,revealed:o,visible:s&&l.visible}}getParentNodeWithListIndex(t,n=this.root,r=0,o=!0,s=!0){const[a,...l]=t;if(a<0||a>n.children.length)throw new X0(this.user,"Invalid tree location");for(let d=0;dn.element)),this.data=t}}function j9e(e){return e instanceof cre?new yxo(e):e}class Cxo{constructor(t,n){this.modelProvider=t,this.dnd=n,this.autoExpandDisposable=ct.None,this.disposables=new Pt}getDragURI(t){return this.dnd.getDragURI(t.element)}getDragLabel(t,n){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(t.map(r=>r.element),n)}onDragStart(t,n){var r,o;(o=(r=this.dnd).onDragStart)==null||o.call(r,j9e(t),n)}onDragOver(t,n,r,o,s,a=!0){const l=this.dnd.onDragOver(j9e(t),n&&n.element,r,o,s),d=this.autoExpandNode!==n;if(d&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=n),typeof n>"u")return l;if(d&&typeof l!="boolean"&&l.autoExpand&&(this.autoExpandDisposable=z8(()=>{const k=this.modelProvider(),A=k.getNodeLocation(n);k.isCollapsed(A)&&k.setCollapsed(A,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof l=="boolean"||!l.accept||typeof l.bubble>"u"||l.feedback){if(!a){const k=typeof l=="boolean"?l:l.accept,A=typeof l=="boolean"?void 0:l.effect;return{accept:k,effect:A,feedback:[r]}}return l}if(l.bubble===1){const k=this.modelProvider(),A=k.getNodeLocation(n),m=k.getParentNodeLocation(A),v=k.getNode(m),p=m&&k.getListIndex(m);return this.onDragOver(t,v,p,o,s,!1)}const u=this.modelProvider(),h=u.getNodeLocation(n),f=u.getListIndex(h),g=u.getListRenderCount(h);return{...l,feedback:eg(f,f+g)}}drop(t,n,r,o,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(j9e(t),n&&n.element,r,o,s)}onDragEnd(t){var n,r;(r=(n=this.dnd).onDragEnd)==null||r.call(n,t)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function xxo(e,t,n){return n&&{...n,identityProvider:n.identityProvider&&{getId(r){return n.identityProvider.getId(r.element)}},dnd:n.dnd&&t.add(new Cxo(e,n.dnd)),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(r){return n.multipleSelectionController.isSelectionSingleChangeEvent({...r,element:r.element})},isSelectionRangeChangeEvent(r){return n.multipleSelectionController.isSelectionRangeChangeEvent({...r,element:r.element})}},accessibilityProvider:n.accessibilityProvider&&{...n.accessibilityProvider,getSetSize(r){const o=e(),s=o.getNodeLocation(r),a=o.getParentNodeLocation(s);return o.getNode(a).visibleChildrenCount},getPosInSet(r){return r.visibleChildIndex+1},isChecked:n.accessibilityProvider&&n.accessibilityProvider.isChecked?r=>n.accessibilityProvider.isChecked(r.element):void 0,getRole:n.accessibilityProvider&&n.accessibilityProvider.getRole?r=>n.accessibilityProvider.getRole(r.element):()=>"treeitem",getAriaLabel(r){return n.accessibilityProvider.getAriaLabel(r.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider&&n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider&&n.accessibilityProvider.getAriaLevel?r=>n.accessibilityProvider.getAriaLevel(r.element):r=>r.depth,getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(r=>n.accessibilityProvider.getActiveDescendantId(r.element))},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&{...n.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(r){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(r.element)}}}}class Wnt{constructor(t){this.delegate=t}getHeight(t){return this.delegate.getHeight(t.element)}getTemplateId(t){return this.delegate.getTemplateId(t.element)}hasDynamicHeight(t){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(t.element)}setDynamicHeight(t,n){var r,o;(o=(r=this.delegate).setDynamicHeight)==null||o.call(r,t.element,n)}}var HP;(function(e){e.None="none",e.OnHover="onHover",e.Always="always"})(HP||(HP={}));class Lxo{get elements(){return this._elements}constructor(t,n=[]){this._elements=n,this.disposables=new Pt,this.onDidChange=un.forEach(t,r=>this._elements=r,this.disposables)}dispose(){this.disposables.dispose()}}const pj=class pj{constructor(t,n,r,o,s,a={}){var l;this.renderer=t,this.model=n,this.activeNodes=o,this.renderedIndentGuides=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=pj.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=ct.None,this.disposables=new Pt,this.templateId=t.templateId,this.updateOptions(a),un.map(r,d=>d.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(l=t.onDidChangeTwistieState)==null||l.call(t,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(t={}){if(typeof t.indent<"u"){const n=ng(t.indent,0,40);if(n!==this.indent){this.indent=n;for(const[r,o]of this.renderedNodes)o.indentSize=pj.DefaultIndent+(r.depth-1)*this.indent,this.renderTreeElement(r,o)}}if(typeof t.renderIndentGuides<"u"){const n=t.renderIndentGuides!==HP.None;if(n!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=n;for(const[r,o]of this.renderedNodes)this._renderIndentGuides(r,o);if(this.indentGuidesDisposable.dispose(),n){const r=new Pt;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,r),this.indentGuidesDisposable=r,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof t.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=t.hideTwistiesOfChildlessElements)}renderTemplate(t){const n=tn(t,ln(".monaco-tl-row")),r=tn(n,ln(".monaco-tl-indent")),o=tn(n,ln(".monaco-tl-twistie")),s=tn(n,ln(".monaco-tl-contents")),a=this.renderer.renderTemplate(s);return{container:t,indent:r,twistie:o,indentGuidesDisposable:ct.None,indentSize:0,templateData:a}}renderElement(t,n,r,o){r.indentSize=pj.DefaultIndent+(t.depth-1)*this.indent,this.renderedNodes.set(t,r),this.renderedElements.set(t.element,t),this.renderTreeElement(t,r),this.renderer.renderElement(t,n,r.templateData,{...o,indent:r.indentSize})}disposeElement(t,n,r,o){var s,a;r.indentGuidesDisposable.dispose(),(a=(s=this.renderer).disposeElement)==null||a.call(s,t,n,r.templateData,{...o,indent:r.indentSize}),typeof(o==null?void 0:o.height)=="number"&&(this.renderedNodes.delete(t),this.renderedElements.delete(t.element))}disposeTemplate(t){this.renderer.disposeTemplate(t.templateData)}onDidChangeTwistieState(t){const n=this.renderedElements.get(t);n&&this.onDidChangeNodeTwistieState(n)}onDidChangeNodeTwistieState(t){const n=this.renderedNodes.get(t);n&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(t,n))}renderTreeElement(t,n){n.twistie.style.paddingLeft=`${n.indentSize}px`,n.indent.style.width=`${n.indentSize+this.indent-16}px`,t.collapsible?n.container.setAttribute("aria-expanded",String(!t.collapsed)):n.container.removeAttribute("aria-expanded"),n.twistie.classList.remove(...mi.asClassNameArray(Jt.treeItemExpanded));let r=!1;this.renderer.renderTwistie&&(r=this.renderer.renderTwistie(t.element,n.twistie)),t.collapsible&&(!this.hideTwistiesOfChildlessElements||t.visibleChildrenCount>0)?(r||n.twistie.classList.add(...mi.asClassNameArray(Jt.treeItemExpanded)),n.twistie.classList.add("collapsible"),n.twistie.classList.toggle("collapsed",t.collapsed)):n.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(t,n)}_renderIndentGuides(t,n){if(kh(n.indent),n.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const r=new Pt;for(;;){const o=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(o);if(!s)break;const a=this.model.getNode(s),l=ln(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),n.indent.childElementCount===0?n.indent.appendChild(l):n.indent.insertBefore(l,n.indent.firstElementChild),this.renderedIndentGuides.add(a,l),r.add(Gn(()=>this.renderedIndentGuides.delete(a,l))),t=a}n.indentGuidesDisposable=r}_onDidChangeActiveNodes(t){if(!this.shouldRenderIndentGuides)return;const n=new Set;t.forEach(r=>{const o=this.model.getNodeLocation(r);try{const s=this.model.getParentNodeLocation(o);r.collapsible&&r.children.length>0&&!r.collapsed?n.add(r):s&&n.add(this.model.getNode(s))}catch{}}),this.activeIndentNodes.forEach(r=>{n.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.remove("active"))}),n.forEach(r=>{this.activeIndentNodes.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.add("active"))}),this.activeIndentNodes=n}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),hs(this.disposables)}};pj.DefaultIndent=8;let PHe=pj;function Sxo(e,t){const n=t.toLowerCase().indexOf(e);let r;if(n>-1){r=[Number.MAX_SAFE_INTEGER,0];for(let o=e.length;o>0;o--)r.push(n+o-1)}return r}class sMn{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set findMatchType(t){this._findMatchType=t}get findMatchType(){return this._findMatchType}set findMode(t){this._findMode=t}get findMode(){return this._findMode}constructor(t,n,r){this._keyboardNavigationLabelProvider=t,this._filter=n,this._defaultFindVisibility=r,this._totalCount=0,this._matchCount=0,this._findMatchType=Kb.Fuzzy,this._findMode=q0.Highlight,this._pattern="",this._lowercasePattern="",this.disposables=new Pt}filter(t,n){let r=1;if(this._filter){const a=this._filter.filter(t,n);if(typeof a=="boolean"?r=a?1:0:vre(a)?r=WP(a.visibility):r=a,r===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:e4.Default,visibility:r};const o=this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t),s=Array.isArray(o)?o:[o];for(const a of s){const l=a&&a.toString();if(typeof l>"u")return{data:e4.Default,visibility:r};let d;if(this._findMatchType===Kb.Contiguous?d=Sxo(this._lowercasePattern,l.toLowerCase()):d=DP(this._pattern,this._lowercasePattern,0,l,l.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0}),d)return this._matchCount++,s.length===1?{data:d,visibility:r}:{data:{label:l,score:d},visibility:r}}return this._findMode===q0.Filter?typeof this._defaultFindVisibility=="number"?this._defaultFindVisibility:this._defaultFindVisibility?this._defaultFindVisibility(t):2:{data:e4.Default,visibility:r}}reset(){this._totalCount=0,this._matchCount=0}dispose(){hs(this.disposables)}}class Txo{constructor(t){this.stateMap=new Map(t.map(n=>[n.id,{...n}]))}get(t){const n=this.stateMap.get(t);if(n===void 0)throw new Error(`No state found for toggle id ${t}`);return n.isChecked}set(t,n){const r=this.stateMap.get(t);if(r===void 0)throw new Error(`No state found for toggle id ${t}`);return r.isChecked===n?!1:(r.isChecked=n,!0)}}var q0;(function(e){e[e.Highlight=0]="Highlight",e[e.Filter=1]="Filter"})(q0||(q0={}));var Kb;(function(e){e[e.Fuzzy=0]="Fuzzy",e[e.Contiguous=1]="Contiguous"})(Kb||(Kb={}));var pS;(function(e){e.Mode="mode",e.MatchType="matchType"})(pS||(pS={}));class Exo{get pattern(){return this._pattern}get placeholder(){return this._placeholder}set placeholder(t){var n;this._placeholder=t,(n=this.widget)==null||n.setPlaceHolder(t)}constructor(t,n,r,o={}){this.tree=t,this.filter=n,this.contextViewProvider=r,this.options=o,this._pattern="",this._onDidChangePattern=new it,this._onDidChangeOpenState=new it,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new Pt,this.disposables=new Pt,this.toggles=new Txo(o.toggles??[]),this._placeholder=o.placeholder??j(20,"Type to search")}isOpened(){return!!this.widget}updateToggleState(t,n){var r;this.toggles.set(t,n),(r=this.widget)==null||r.setToggleState(t,n)}renderMessage(t,n){var r,o,s;t?this.tree.options.showNotFoundMessage??!0?(r=this.widget)==null||r.showMessage({type:2,content:n??j(21,"No results found.")}):(o=this.widget)==null||o.showMessage({type:2}):(s=this.widget)==null||s.clearMessage()}alertResults(t){kg(t?j(23,"{0} results",t):j(22,"No results"))}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}let aMn=class extends Exo{get mode(){return this.toggles.get(pS.Mode)?q0.Filter:q0.Highlight}set mode(t){if(t===this.mode)return;const n=t===q0.Filter;this.updateToggleState(pS.Mode,n),this.placeholder=n?j(24,"Type to filter"):j(25,"Type to search"),this.filter.findMode=t,this.tree.refilter(),this.render(),this._onDidChangeMode.fire(t)}get matchType(){return this.toggles.get(pS.MatchType)?Kb.Fuzzy:Kb.Contiguous}set matchType(t){t!==this.matchType&&(this.updateToggleState(pS.MatchType,t===Kb.Fuzzy),this.filter.findMatchType=t,this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(t))}constructor(t,n,r,o={}){const s=o.defaultFindMode??q0.Highlight,a=o.defaultFindMatchType??Kb.Fuzzy,l=[{id:pS.Mode,icon:Jt.listFilter,title:j(26,"Filter"),isChecked:s===q0.Filter},{id:pS.MatchType,icon:Jt.searchFuzzy,title:j(27,"Fuzzy Match"),isChecked:a===Kb.Fuzzy}];n.findMatchType=a,n.findMode=s,super(t,n,r,{...o,toggles:l}),this.filter=n,this._onDidChangeMode=new it,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new it,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this.disposables.add(this.tree.onDidChangeModel(()=>{this.isOpened()&&(this.pattern.length!==0&&this.tree.refilter(),this.render())})),this.disposables.add(this.tree.onWillRefilter(()=>this.filter.reset()))}updateOptions(t={}){t.defaultFindMode!==void 0&&(this.mode=t.defaultFindMode),t.defaultFindMatchType!==void 0&&(this.matchType=t.defaultFindMatchType)}shouldAllowFocus(t){return!this.isOpened()||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!e4.isDefault(t.filterData)}render(){const n=this.filter.matchCount===0&&this.filter.totalCount>0&&this.pattern.length>0;this.renderMessage(n),this.pattern.length&&this.alertResults(this.filter.matchCount)}};function Dxo(e,t){return e.position===t.position&&lMn(e,t)}function lMn(e,t){return e.node.element===t.node.element&&e.startIndex===t.startIndex&&e.height===t.height&&e.endIndex===t.endIndex}class Qxo{constructor(t=[]){this.stickyNodes=t}get count(){return this.stickyNodes.length}equal(t){return za(this.stickyNodes,t.stickyNodes,Dxo)}contains(t){return this.stickyNodes.some(n=>n.node.element===t.element)}lastNodePartiallyVisible(){if(this.count===0)return!1;const t=this.stickyNodes[this.count-1];if(this.count===1)return t.position!==0;const n=this.stickyNodes[this.count-2];return n.position+n.height!==t.position}animationStateChanged(t){if(!za(this.stickyNodes,t.stickyNodes,lMn)||this.count===0)return!1;const n=this.stickyNodes[this.count-1],r=t.stickyNodes[t.count-1];return n.position!==r.position}}class Bxo{constrainStickyScrollNodes(t,n,r){for(let o=0;or||o>=n)return t.slice(0,o)}return t}}let ECt=class extends ct{constructor(t,n,r,o,s,a={}){super(),this.tree=t,this.model=n,this.view=r,this.treeDelegate=s,this.maxWidgetViewRatio=.4;const l=this.validateStickySettings(a);this.stickyScrollMaxItemCount=l.stickyScrollMaxItemCount,this.stickyScrollDelegate=a.stickyScrollDelegate??new Bxo,this.paddingTop=a.paddingTop??0,this._widget=this._register(new Fxo(r.getScrollableElement(),r,t,o,s,a.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(r.onDidScroll(()=>this.update())),this._register(r.onDidChangeContentHeight(()=>this.update())),this._register(t.onDidChangeCollapseState(()=>this.update())),this._register(n.onDidSpliceRenderedNodes(d=>{const u=this._widget.state;if(!u)return;if(d.deleteCount>0&&u.stickyNodes.some(g=>!this.model.has(this.model.getNodeLocation(g.node)))){this.update();return}u.stickyNodes.some(g=>{const k=this.model.getListIndex(this.model.getNodeLocation(g.node));return k>=d.start&&k=this.view.length))return this.view.element(n)}update(){const t=this.getNodeAtHeight(this.paddingTop);if(!t||this.tree.scrollTop<=this.paddingTop){this._widget.setState(void 0);return}const n=this.findStickyState(t);this._widget.setState(n)}findStickyState(t){const n=[];let r=t,o=0,s=this.getNextStickyNode(r,void 0,o);for(;s&&(n.push(s),o+=s.height,!(n.length<=this.stickyScrollMaxItemCount&&(r=this.getNextVisibleNode(s),!r)));)s=this.getNextStickyNode(r,s.node,o);const a=this.constrainStickyNodes(n);return a.length?new Qxo(a):void 0}getNextVisibleNode(t){return this.getNodeAtHeight(t.position+t.height)}getNextStickyNode(t,n,r){const o=this.getAncestorUnderPrevious(t,n);if(o&&!(o===t&&(!this.nodeIsUncollapsedParent(t)||this.nodeTopAlignsWithStickyNodesBottom(t,r))))return this.createStickyScrollNode(o,r)}nodeTopAlignsWithStickyNodesBottom(t,n){const r=this.getNodeIndex(t),o=this.view.getElementTop(r),s=n;return this.view.scrollTop===o-s}createStickyScrollNode(t,n){const r=this.treeDelegate.getHeight(t),{startIndex:o,endIndex:s}=this.getNodeRange(t),a=this.calculateStickyNodePosition(s,n,r);return{node:t,position:a,height:r,startIndex:o,endIndex:s}}getAncestorUnderPrevious(t,n=void 0){let r=t,o=this.getParentNode(r);for(;o;){if(o===n)return r;r=o,o=this.getParentNode(r)}if(n===void 0)return r}calculateStickyNodePosition(t,n,r){let o=this.view.getRelativeTop(t);if(o===null&&this.view.firstVisibleIndex===t&&t+1d&&n<=d?d-r:n}constrainStickyNodes(t){if(t.length===0)return[];const n=this.view.renderHeight*this.maxWidgetViewRatio,r=t[t.length-1];if(t.length<=this.stickyScrollMaxItemCount&&r.position+r.height<=n)return t;const o=this.stickyScrollDelegate.constrainStickyScrollNodes(t,this.stickyScrollMaxItemCount,n);if(!o.length)return[];const s=o[o.length-1];if(o.length>this.stickyScrollMaxItemCount||s.position+s.height>n)throw new Error("stickyScrollDelegate violates constraints");return o}getParentNode(t){const n=this.model.getNodeLocation(t),r=this.model.getParentNodeLocation(n);return r?this.model.getNode(r):void 0}nodeIsUncollapsedParent(t){const n=this.model.getNodeLocation(t);return this.model.getListRenderCount(n)>1}getNodeIndex(t){const n=this.model.getNodeLocation(t);return this.model.getListIndex(n)}getNodeRange(t){const n=this.model.getNodeLocation(t),r=this.model.getListIndex(n);if(r<0)throw new Error("Node not found in tree");const o=this.model.getListRenderCount(n),s=r+o-1;return{startIndex:r,endIndex:s}}nodePositionTopBelowWidget(t){const n=[];let r=this.getParentNode(t);for(;r;)n.push(r),r=this.getParentNode(r);let o=0;for(let s=0;s0,r=!!t&&t.count>0;if(!n&&!r||n&&r&&this._previousState.equal(t))return;if(n!==r&&this.setVisible(r),!r){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const o=t.stickyNodes[t.count-1];this._previousState&&t.animationStateChanged(this._previousState)?this._previousElements[this._previousState.count-1].style.top=`${o.position}px`:this.renderState(t),this._previousState=t,this._rootDomNode.style.height=`${o.position+o.height}px`}renderState(t){this._previousStateDisposables.clear();const n=Array(t.count);for(let r=t.count-1;r>=0;r--){const o=t.stickyNodes[r],{element:s,disposable:a}=this.createElement(o,r,t.count);n[r]=s,this._rootDomNode.appendChild(s),this._previousStateDisposables.add(a)}this.stickyScrollFocus.updateElements(n,t),this._previousElements=n}rerender(){this._previousState&&this.renderState(this._previousState)}createElement(t,n,r){const o=t.startIndex,s=document.createElement("div");s.style.top=`${t.position}px`,this.tree.options.setRowHeight!==!1&&(s.style.height=`${t.height}px`),this.tree.options.setRowLineHeight!==!1&&(s.style.lineHeight=`${t.height}px`),s.classList.add("monaco-tree-sticky-row"),s.classList.add("monaco-list-row"),s.setAttribute("data-index",`${o}`),s.setAttribute("data-parity",o%2===0?"even":"odd"),s.setAttribute("id",this.view.getElementID(o));const a=this.setAccessibilityAttributes(s,t.node.element,n,r),l=this.treeDelegate.getTemplateId(t.node),d=this.treeRenderers.find(g=>g.templateId===l);if(!d)throw new Error(`No renderer found for template id ${l}`);let u=t.node;u===this.tree.getNode(this.tree.getNodeLocation(t.node))&&(u=new Proxy(t.node,{}));const h=d.renderTemplate(s);d.renderElement(u,t.startIndex,h,{height:t.height});const f=Gn(()=>{a.dispose(),d.disposeElement(u,t.startIndex,h,{height:t.height}),d.disposeTemplate(h),s.remove()});return{element:s,disposable:f}}setAccessibilityAttributes(t,n,r,o){if(!this.accessibilityProvider)return ct.None;this.accessibilityProvider.getSetSize&&t.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(n,r,o))),this.accessibilityProvider.getPosInSet&&t.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(n,r))),this.accessibilityProvider.getRole&&t.setAttribute("role",this.accessibilityProvider.getRole(n)??"treeitem");const s=this.accessibilityProvider.getAriaLabel(n),a=s&&typeof s!="string"?s:ha(s),l=xi(u=>{const h=u.readObservable(a);h?t.setAttribute("aria-label",h):t.removeAttribute("aria-label")});typeof s=="string"||s&&t.setAttribute("aria-label",s.get());const d=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(n);return typeof d=="number"&&t.setAttribute("aria-level",`${d}`),t.setAttribute("aria-selected",String(!1)),l}setVisible(t){this._rootDomNode.classList.toggle("empty",!t),t||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class Pxo extends ct{get domHasFocus(){return this._domHasFocus}set domHasFocus(t){t!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(t),this._domHasFocus=t)}constructor(t,n){super(),this.container=t,this.view=n,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new it,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new it,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this._register(pt(this.container,"focus",()=>this.onFocus())),this._register(pt(this.container,"blur",()=>this.onBlur())),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(r=>this.onKeyDown(r))),this._register(this.view.onMouseDown(r=>this.onMouseDown(r))),this._register(this.view.onContextMenu(r=>this.handleContextMenu(r)))}handleContextMenu(t){const n=t.browserEvent.target;if(!q$(n)&&!YK(n)){this.focusedLast()&&this.view.domFocus();return}if(!dL(t.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const a=this.state.stickyNodes.findIndex(l=>{var d;return l.node.element===((d=t.element)==null?void 0:d.element)});if(a===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(a);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const o=this.state.stickyNodes[this.focusedIndex].node.element,s=this.elements[this.focusedIndex];this._onContextMenu.fire({element:o,anchor:s,browserEvent:t.browserEvent,isStickyScroll:!0})}onKeyDown(t){if(this.domHasFocus&&this.state){if(t.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),t.preventDefault(),t.stopPropagation();else if(t.key==="ArrowDown"||t.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const n=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([n]),this.scrollNodeUnderWidget(n,this.state)}else this.setFocusedElement(this.focusedIndex+1);t.preventDefault(),t.stopPropagation()}}}onMouseDown(t){const n=t.browserEvent.target;!q$(n)&&!YK(n)||(t.browserEvent.preventDefault(),t.browserEvent.stopPropagation())}updateElements(t,n){if(n&&n.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(n&&n.count!==t.length)throw new Error("Sticky scroll focus received illigel state");const r=this.focusedIndex;if(this.removeFocus(),this.elements=t,this.state=n,n){const o=ng(r,0,n.count-1);this.setFocus(o)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=n?0:-1}setFocusedElement(t){const n=this.state;if(!n)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(t),!(t1?n.stickyNodes[n.count-2]:void 0,s=this.view.getElementTop(t),a=o?o.position+o.height+r.height:r.height;this.view.scrollTop=s-a}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(t){if(0>t)throw new Error("addFocus() can not remove focus");if(!this.state&&t>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&t>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const n=this.focusedIndex;n>=0&&this.toggleElementFocus(this.elements[n],!1),t>=0&&this.toggleElementFocus(this.elements[t],!0),this.focusedIndex=t}toggleElementFocus(t,n){this.toggleElementActiveFocus(t,n&&this.domHasFocus),this.toggleElementPassiveFocus(t,n)}toggleCurrentElementActiveFocus(t){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],t)}toggleElementActiveFocus(t,n){t.classList.toggle("focused",n)}toggleElementPassiveFocus(t,n){t.classList.toggle("passive-focused",n)}toggleStickyScrollFocused(t){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",t)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function vce(e){let t=FQ.Unknown;return C6e(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=FQ.Twistie:C6e(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?t=FQ.Element:C6e(e.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(t=FQ.Filter),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function Mxo(e){const t=q$(e.browserEvent.target);return{element:e.element?e.element.element:null,browserEvent:e.browserEvent,anchor:e.anchor,isStickyScroll:t}}function Mhe(e,t){t(e),e.children.forEach(n=>Mhe(n,t))}class W9e{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(t,n){this.getFirstViewElementWithTrait=t,this.identityProvider=n,this.nodes=[],this._onDidChange=new it,this.onDidChange=this._onDidChange.event}set(t,n){const r=n;!(r!=null&&r.__forceEvent)&&za(this.nodes,t)||this._set(t,!1,n)}_set(t,n,r){if(this.nodes=[...t],this.elements=void 0,this._nodeSet=void 0,!n){const o=this;this._onDidChange.fire({get elements(){return o.get()},browserEvent:r})}}get(){return this.elements||(this.elements=this.nodes.map(t=>t.element)),[...this.elements]}getNodes(){return this.nodes}has(t){return this.nodeSet.has(t)}onDidModelSplice({insertedNodes:t,deletedNodes:n}){if(!this.identityProvider){const d=this.createNodeSet(),u=h=>d.delete(h);n.forEach(h=>Mhe(h,u)),this.set([...d.values()]);return}const r=new Set,o=d=>r.add(this.identityProvider.getId(d.element).toString());n.forEach(d=>Mhe(d,o));const s=new Map,a=d=>s.set(this.identityProvider.getId(d.element).toString(),d);t.forEach(d=>Mhe(d,a));const l=[];for(const d of this.nodes){const u=this.identityProvider.getId(d.element).toString();if(!r.has(u))l.push(d);else{const f=s.get(u);f&&f.visible&&l.push(f)}}if(this.nodes.length>0&&l.length===0){const d=this.getFirstViewElementWithTrait();d&&l.push(d)}this._set(l,!0)}createNodeSet(){const t=new Set;for(const n of this.nodes)t.add(n);return t}}class Rxo extends sFn{constructor(t,n,r){super(t),this.tree=n,this.stickyScrollProvider=r}onViewPointer(t){if(nFn(t.browserEvent.target)||uO(t.browserEvent.target)||iG(t.browserEvent.target)||t.browserEvent.isHandledByList)return;const n=t.element;if(!n)return super.onViewPointer(t);if(this.isSelectionRangeChangeEvent(t)||this.isSelectionSingleChangeEvent(t))return super.onViewPointer(t);const r=t.browserEvent.target,o=r.classList.contains("monaco-tl-twistie")||r.classList.contains("monaco-icon-label")&&r.classList.contains("folder-icon")&&t.browserEvent.offsetX<16,s=YK(t.browserEvent.target);let a=!1;if(s?a=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?a=this.tree.expandOnlyOnTwistieClick(n.element):a=!!this.tree.expandOnlyOnTwistieClick,s)this.handleStickyScrollMouseEvent(t,n);else{if(a&&!o&&t.browserEvent.detail!==2)return super.onViewPointer(t);if(!this.tree.expandOnDoubleClick&&t.browserEvent.detail===2)return super.onViewPointer(t)}if(n.collapsible&&(!s||o)){const l=this.tree.getNodeLocation(n),d=t.browserEvent.altKey;if(this.tree.setFocus([l]),this.tree.toggleCollapsed(l,d),o){t.browserEvent.isHandledByList=!0;return}}s||super.onViewPointer(t)}handleStickyScrollMouseEvent(t,n){if(pbo(t.browserEvent.target)||bbo(t.browserEvent.target))return;const r=this.stickyScrollProvider();if(!r)throw new Error("Sticky scroll controller not found");const o=this.list.indexOf(n),s=this.list.getElementTop(o),a=r.nodePositionTopBelowWidget(n);this.tree.scrollTop=s-a,this.list.domFocus(),this.list.setFocus([o]),this.list.setSelection([o])}onDoubleClick(t){t.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||t.browserEvent.isHandledByList||super.onDoubleClick(t)}onMouseDown(t){const n=t.browserEvent.target;if(!q$(n)&&!YK(n)){super.onMouseDown(t);return}}onContextMenu(t){const n=t.browserEvent.target;if(!q$(n)&&!YK(n)){super.onContextMenu(t);return}}}class Ixo extends Tk{constructor(t,n,r,o,s,a,l,d){super(t,n,r,o,d),this.focusTrait=s,this.selectionTrait=a,this.anchorTrait=l}createMouseController(t){return new Rxo(this,t.tree,t.stickyScrollProvider)}splice(t,n,r=[]){if(super.splice(t,n,r),r.length===0)return;const o=[],s=[];let a;r.forEach((l,d)=>{this.focusTrait.has(l)&&o.push(t+d),this.selectionTrait.has(l)&&s.push(t+d),this.anchorTrait.has(l)&&(a=t+d)}),o.length>0&&super.setFocus(X8([...super.getFocus(),...o])),s.length>0&&super.setSelection(X8([...super.getSelection(),...s])),typeof a=="number"&&super.setAnchor(a)}setFocus(t,n,r=!1){super.setFocus(t,n),r||this.focusTrait.set(t.map(o=>this.element(o)),n)}setSelection(t,n,r=!1){super.setSelection(t,n),r||this.selectionTrait.set(t.map(o=>this.element(o)),n)}setAnchor(t,n=!1){super.setAnchor(t),n||(typeof t>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(t)]))}}class cMn{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return un.filter(un.map(this.view.onMouseDblClick,vce),t=>t.target!==FQ.Filter)}get onMouseOver(){return un.map(this.view.onMouseOver,vce)}get onMouseOut(){return un.map(this.view.onMouseOut,vce)}get onContextMenu(){var t;return un.any(un.filter(un.map(this.view.onContextMenu,Mxo),n=>!n.isStickyScroll),((t=this.stickyScrollController)==null?void 0:t.onContextMenu)??un.None)}get onPointer(){return un.map(this.view.onPointer,vce)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return un.any(this.onDidChangeModelRelay.event,this.onDidSwapModel.event)}get onDidChangeCollapseState(){return this.onDidChangeCollapseStateRelay.event}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(t,n,r,o,s={}){this._user=t,this._options=s,this.eventBufferer=new Vie,this.onDidChangeFindOpenState=un.None,this.onDidChangeStickyScrollFocused=un.None,this.disposables=new Pt,this.onDidSwapModel=this.disposables.add(new it),this.onDidChangeModelRelay=this.disposables.add(new yX),this.onDidSpliceModelRelay=this.disposables.add(new yX),this.onDidChangeCollapseStateRelay=this.disposables.add(new yX),this.onDidChangeRenderNodeCountRelay=this.disposables.add(new yX),this.onDidChangeActiveNodesRelay=this.disposables.add(new yX),this._onWillRefilter=new it,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new it,this.modelDisposables=new Pt,s.keyboardNavigationLabelProvider&&(s.findWidgetEnabled??!0)&&(this.findFilter=new sMn(s.keyboardNavigationLabelProvider,s.filter,s.defaultFindVisibility),s={...s,filter:this.findFilter},this.disposables.add(this.findFilter)),this.model=this.createModel(t,s),this.treeDelegate=new Wnt(r);const a=this.disposables.add(new Lxo(this.onDidChangeActiveNodesRelay.event)),l=new U7n;this.renderers=o.map(d=>new PHe(d,this.model,this.onDidChangeCollapseStateRelay.event,a,l,s));for(const d of this.renderers)this.disposables.add(d);if(this.focus=new W9e(()=>this.view.getFocusedElements()[0],s.identityProvider),this.selection=new W9e(()=>this.view.getSelectedElements()[0],s.identityProvider),this.anchor=new W9e(()=>this.view.getAnchorElement(),s.identityProvider),this.view=new Ixo(t,n,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...xxo(()=>this.model,this.disposables,s),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.setupModel(this.model),s.keyboardSupport!==!1){const d=un.chain(this.view.onKeyDown,u=>u.filter(h=>!uO(h.target)).map(h=>new Hs(h)));un.chain(d,u=>u.filter(h=>h.keyCode===15))(this.onLeftArrow,this,this.disposables),un.chain(d,u=>u.filter(h=>h.keyCode===17))(this.onRightArrow,this,this.disposables),un.chain(d,u=>u.filter(h=>h.keyCode===10))(this.onSpace,this,this.disposables)}if((s.findWidgetEnabled??!0)&&s.keyboardNavigationLabelProvider&&s.contextViewProvider){const d={styles:s.findWidgetStyles,defaultFindMode:s.defaultFindMode,defaultFindMatchType:s.defaultFindMatchType,showNotFoundMessage:s.showNotFoundMessage};this.findController=this.disposables.add(new aMn(this,this.findFilter,s.contextViewProvider,d)),this.focusNavigationFilter=u=>this.findController.shouldAllowFocus(u),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=un.None,this.onDidChangeFindMatchType=un.None;s.enableStickyScroll&&(this.stickyScrollController=new ECt(this,this.model,this.view,this.renderers,this.treeDelegate,s),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=v2(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===HP.Always)}updateOptions(t={}){var n;this._options={...this._options,...t};for(const r of this.renderers)r.updateOptions(t);this.view.updateOptions(this._options),(n=this.findController)==null||n.updateOptions(t),this.updateStickyScroll(t),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===HP.Always)}get options(){return this._options}updateStickyScroll(t){var n;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new ECt(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=un.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(n=this.stickyScrollController)==null||n.updateOptions(t)}getHTMLElement(){return this.view.getHTMLElement()}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.scrollTop}set scrollTop(t){this.view.scrollTop=t}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(t){this.view.ariaLabel=t}domFocus(){var t;(t=this.stickyScrollController)!=null&&t.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(t,n){this.view.layout(t,n)}style(t){const n=`.${this.view.domId}`,r=[];t.treeIndentGuidesStroke&&(r.push(`.monaco-list${n}:hover .monaco-tl-indent > .indent-guide, .monaco-list${n}.always .monaco-tl-indent > .indent-guide { opacity: 1; border-color: ${t.treeInactiveIndentGuidesStroke}; }`),r.push(`.monaco-list${n} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${t.treeIndentGuidesStroke}; }`));const o=t.treeStickyScrollBackground??t.listBackground;o&&(r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${o}; }`),r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${o}; }`)),t.treeStickyScrollBorder&&r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${t.treeStickyScrollBorder}; }`),t.treeStickyScrollShadow&&r.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${t.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),t.listFocusForeground&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${t.listFocusForeground}; }`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const s=h8(t.listFocusAndSelectionOutline,h8(t.listSelectionOutline,t.listFocusOutline??""));s&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),t.listFocusOutline&&(r.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${t.listFocusOutline}; outline-offset: -1px; }`),r.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),r.push(`.context-menu-visible .monaco-list${n}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${t.listFocusOutline}; outline-offset: -1px; }`),r.push(`.context-menu-visible .monaco-list${n}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),r.push(`.context-menu-visible .monaco-list${n}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=r.join(` `),this.view.style(t)}getParentElement(t){const n=this.model.getParentNodeLocation(t);return this.model.getNode(n).element}getFirstElementChild(t){return this.model.getFirstElementChild(t)}getNode(t){return this.model.getNode(t)}getNodeLocation(t){return this.model.getNodeLocation(t)}collapse(t,n=!1){return this.model.setCollapsed(t,!0,n)}expand(t,n=!1){return this.model.setCollapsed(t,!1,n)}toggleCollapsed(t,n=!1){return this.model.setCollapsed(t,void 0,n)}isCollapsible(t){return this.model.isCollapsible(t)}setCollapsible(t,n){return this.model.setCollapsible(t,n)}isCollapsed(t){return this.model.isCollapsed(t)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(t,n){this.eventBufferer.bufferEvents(()=>{const r=t.map(s=>this.model.getNode(s));this.selection.set(r,n);const o=t.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setSelection(o,n,!0)})}getSelection(){return this.selection.get()}setFocus(t,n){this.eventBufferer.bufferEvents(()=>{const r=t.map(s=>this.model.getNode(s));this.focus.set(r,n);const o=t.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setFocus(o,n,!0)})}focusNext(t=1,n=!1,r,o=dL(r)&&r.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(t,n,r,o)}focusPrevious(t=1,n=!1,r,o=dL(r)&&r.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(t,n,r,o)}focusNextPage(t,n=dL(t)&&t.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(t,n)}focusPreviousPage(t,n=dL(t)&&t.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(t,n,()=>{var r;return((r=this.stickyScrollController)==null?void 0:r.height)??0})}focusLast(t,n=dL(t)&&t.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(t,n)}focusFirst(t,n=dL(t)&&t.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(t,n)}getFocus(){return this.focus.get()}reveal(t,n){this.model.expandTo(t);const r=this.model.getListIndex(t);if(r!==-1)if(!this.stickyScrollController)this.view.reveal(r,n);else{const o=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(t));this.view.reveal(r,n,o)}}onLeftArrow(t){t.preventDefault(),t.stopPropagation();const n=this.view.getFocusedElements();if(n.length===0)return;const r=n[0],o=this.model.getNodeLocation(r);if(!this.model.setCollapsed(o,!0)){const a=this.model.getParentNodeLocation(o);if(!a)return;const l=this.model.getListIndex(a);this.view.reveal(l),this.view.setFocus([l])}}onRightArrow(t){t.preventDefault(),t.stopPropagation();const n=this.view.getFocusedElements();if(n.length===0)return;const r=n[0],o=this.model.getNodeLocation(r);if(!this.model.setCollapsed(o,!1)){if(!r.children.some(d=>d.visible))return;const[a]=this.view.getFocus(),l=a+1;this.view.reveal(l),this.view.setFocus([l])}}onSpace(t){t.preventDefault(),t.stopPropagation();const n=this.view.getFocusedElements();if(n.length===0)return;const r=n[0],o=this.model.getNodeLocation(r),s=t.browserEvent.altKey;this.model.setCollapsed(o,void 0,s)}setupModel(t){this.modelDisposables.clear(),this.modelDisposables.add(t.onDidSpliceRenderedNodes(({start:s,deleteCount:a,elements:l})=>this.view.splice(s,a,l)));const n=un.forEach(t.onDidSpliceModel,s=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(s),this.selection.onDidModelSplice(s)})},this.modelDisposables);n(()=>null,null,this.modelDisposables);const r=this.modelDisposables.add(new it),o=this.modelDisposables.add(new A2(0));this.modelDisposables.add(un.any(n,this.focus.onDidChange,this.selection.onDidChange)(()=>{o.trigger(()=>{const s=new Set;for(const a of this.focus.getNodes())s.add(a);for(const a of this.selection.getNodes())s.add(a);r.fire([...s.values()])})})),this.onDidChangeActiveNodesRelay.input=r.event,this.onDidChangeModelRelay.input=un.signal(t.onDidSpliceModel),this.onDidChangeCollapseStateRelay.input=t.onDidChangeCollapseState,this.onDidChangeRenderNodeCountRelay.input=t.onDidChangeRenderNodeCount,this.onDidSpliceModelRelay.input=t.onDidSpliceModel}dispose(){var t;hs(this.disposables),(t=this.stickyScrollController)==null||t.dispose(),this.view.dispose(),this.modelDisposables.dispose()}}class Hnt{constructor(t,n={}){this.user=t,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new wxo(t,null,n),this.onDidSpliceModel=this.model.onDidSpliceModel,this.onDidSpliceRenderedNodes=this.model.onDidSpliceRenderedNodes,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,n.sorter&&(this.sorter={compare(r,o){return n.sorter.compare(r.element,o.element)}}),this.identityProvider=n.identityProvider}setChildren(t,n=lo.empty(),r={}){const o=this.getElementLocation(t);this._setChildren(o,this.preserveCollapseState(n),r)}_setChildren(t,n=lo.empty(),r){const o=new Set,s=new Set,a=d=>{var h;if(d.element===null)return;const u=d;if(o.add(u.element),this.nodes.set(u.element,u),this.identityProvider){const f=this.identityProvider.getId(u.element).toString();s.add(f),this.nodesByIdentity.set(f,u)}(h=r.onDidCreateNode)==null||h.call(r,u)},l=d=>{var h;if(d.element===null)return;const u=d;if(o.has(u.element)||this.nodes.delete(u.element),this.identityProvider){const f=this.identityProvider.getId(u.element).toString();s.has(f)||this.nodesByIdentity.delete(f)}(h=r.onDidDeleteNode)==null||h.call(r,u)};this.model.splice([...t,0],Number.MAX_VALUE,n,{...r,onDidCreateNode:a,onDidDeleteNode:l})}preserveCollapseState(t=lo.empty()){return this.sorter&&(t=[...t].sort(this.sorter.compare.bind(this.sorter))),lo.map(t,n=>{let r=this.nodes.get(n.element);if(!r&&this.identityProvider){const a=this.identityProvider.getId(n.element).toString();r=this.nodesByIdentity.get(a)}if(!r){let a;return typeof n.collapsed>"u"?a=void 0:n.collapsed===U0.Collapsed||n.collapsed===U0.PreserveOrCollapsed?a=!0:n.collapsed===U0.Expanded||n.collapsed===U0.PreserveOrExpanded?a=!1:a=!!n.collapsed,{...n,children:this.preserveCollapseState(n.children),collapsed:a}}const o=typeof n.collapsible=="boolean"?n.collapsible:r.collapsible;let s;return typeof n.collapsed>"u"||n.collapsed===U0.PreserveOrCollapsed||n.collapsed===U0.PreserveOrExpanded?s=r.collapsed:n.collapsed===U0.Collapsed?s=!0:n.collapsed===U0.Expanded?s=!1:s=!!n.collapsed,{...n,collapsible:o,collapsed:s,children:this.preserveCollapseState(n.children)}})}rerender(t){const n=this.getElementLocation(t);this.model.rerender(n)}resort(t=null,n=!0){if(!this.sorter)return;const r=this.getElementLocation(t),o=this.model.getNode(r);this._setChildren(r,this.resortChildren(o,n),{})}resortChildren(t,n,r=!0){let o=[...t.children];return(n||r)&&(o=o.sort(this.sorter.compare.bind(this.sorter))),lo.map(o,s=>({element:s.element,collapsible:s.collapsible,collapsed:s.collapsed,children:this.resortChildren(s,n,!1)}))}getFirstElementChild(t=null){const n=this.getElementLocation(t);return this.model.getFirstElementChild(n)}has(t){return this.nodes.has(t)}getListIndex(t){const n=this.getElementLocation(t);return this.model.getListIndex(n)}getListRenderCount(t){const n=this.getElementLocation(t);return this.model.getListRenderCount(n)}isCollapsible(t){const n=this.getElementLocation(t);return this.model.isCollapsible(n)}setCollapsible(t,n){const r=this.getElementLocation(t);return this.model.setCollapsible(r,n)}isCollapsed(t){const n=this.getElementLocation(t);return this.model.isCollapsed(n)}setCollapsed(t,n,r){const o=this.getElementLocation(t);return this.model.setCollapsed(o,n,r)}expandTo(t){const n=this.getElementLocation(t);this.model.expandTo(n)}refilter(){this.model.refilter()}getNode(t=null){if(t===null)return this.model.getNode(this.model.rootRef);const n=this.nodes.get(t);if(!n)throw new X0(this.user,`Tree element not found: ${t}`);return n}getNodeLocation(t){return t.element}getParentNodeLocation(t){if(t===null)throw new X0(this.user,"Invalid getParentNodeLocation call");const n=this.nodes.get(t);if(!n)throw new X0(this.user,`Tree element not found: ${t}`);const r=this.model.getNodeLocation(n),o=this.model.getParentNodeLocation(r);return this.model.getNode(o).element}getElementLocation(t){if(t===null)return[];const n=this.nodes.get(t);if(!n)throw new X0(this.user,`Tree element not found: ${t}`);return this.model.getNodeLocation(n)}}function Rhe(e){const t=[e.element],n=e.incompressible||!1;return{element:{elements:t,incompressible:n},children:lo.map(lo.from(e.children),Rhe),collapsible:e.collapsible,collapsed:e.collapsed}}function Ihe(e){const t=[e.element],n=e.incompressible||!1;let r,o;for(;[o,r]=lo.consume(lo.from(e.children),2),!(o.length!==1||o[0].incompressible);)e=o[0],t.push(e.element);return{element:{elements:t,incompressible:n},children:lo.map(lo.concat(o,r),Ihe),collapsible:e.collapsible,collapsed:e.collapsed}}function MHe(e,t=0){let n;return tMHe(r,0)),t===0&&e.element.incompressible?{element:e.element.elements[t],children:n,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:n,collapsible:e.collapsible,collapsed:e.collapsed}}function DCt(e){return MHe(e,0)}function dMn(e,t,n){return e.element===t?{...e,children:n}:{...e,children:lo.map(lo.from(e.children),r=>dMn(r,t,n))}}const Nxo=e=>({getId(t){return t.elements.map(n=>e.getId(n).toString()).join("\0")}});class Uxo{get onDidSpliceRenderedNodes(){return this.model.onDidSpliceRenderedNodes}get onDidSpliceModel(){return this.model.onDidSpliceModel}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(t,n={}){this.user=t,this.rootRef=null,this.nodes=new Map,this.model=new Hnt(t,n),this.enabled=typeof n.compressionEnabled>"u"?!0:n.compressionEnabled,this.identityProvider=n.identityProvider}setChildren(t,n=lo.empty(),r){const o=r.diffIdentityProvider&&Nxo(r.diffIdentityProvider);if(t===null){const A=lo.map(n,this.enabled?Ihe:Rhe);this._setChildren(null,A,{diffIdentityProvider:o,diffDepth:1/0});return}const s=this.nodes.get(t);if(!s)throw new X0(this.user,"Unknown compressed tree node");const a=this.model.getNode(s),l=this.model.getParentNodeLocation(s),d=this.model.getNode(l),u=DCt(a),h=dMn(u,t,n),f=(this.enabled?Ihe:Rhe)(h),g=r.diffIdentityProvider?(A,m)=>r.diffIdentityProvider.getId(A)===r.diffIdentityProvider.getId(m):void 0;if(za(f.element.elements,a.element.elements,g)){this._setChildren(s,f.children||lo.empty(),{diffIdentityProvider:o,diffDepth:1});return}const k=d.children.map(A=>A===a?f:A);this._setChildren(d.element,k,{diffIdentityProvider:o,diffDepth:a.depth-d.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(t){if(t===this.enabled)return;this.enabled=t;const r=this.model.getNode().children,o=lo.map(r,DCt),s=lo.map(o,t?Ihe:Rhe);this._setChildren(null,s,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(t,n,r){const o=new Set,s=l=>{for(const d of l.element.elements)o.add(d),this.nodes.set(d,l.element)},a=l=>{for(const d of l.element.elements)o.has(d)||this.nodes.delete(d)};this.model.setChildren(t,n,{...r,onDidCreateNode:s,onDidDeleteNode:a})}has(t){return this.nodes.has(t)}getListIndex(t){const n=this.getCompressedNode(t);return this.model.getListIndex(n)}getListRenderCount(t){const n=this.getCompressedNode(t);return this.model.getListRenderCount(n)}getNode(t){if(typeof t>"u")return this.model.getNode();const n=this.getCompressedNode(t);return this.model.getNode(n)}getNodeLocation(t){const n=this.model.getNodeLocation(t);return n===null?null:n.elements[n.elements.length-1]}getParentNodeLocation(t){const n=this.getCompressedNode(t),r=this.model.getParentNodeLocation(n);return r===null?null:r.elements[r.elements.length-1]}getFirstElementChild(t){const n=this.getCompressedNode(t);return this.model.getFirstElementChild(n)}isCollapsible(t){const n=this.getCompressedNode(t);return this.model.isCollapsible(n)}setCollapsible(t,n){const r=this.getCompressedNode(t);return this.model.setCollapsible(r,n)}isCollapsed(t){const n=this.getCompressedNode(t);return this.model.isCollapsed(n)}setCollapsed(t,n,r){const o=this.getCompressedNode(t);return this.model.setCollapsed(o,n,r)}expandTo(t){const n=this.getCompressedNode(t);this.model.expandTo(n)}rerender(t){const n=this.getCompressedNode(t);this.model.rerender(n)}refilter(){this.model.refilter()}resort(t=null,n=!0){const r=this.getCompressedNode(t);this.model.resort(r,n)}getCompressedNode(t){if(t===null)return null;const n=this.nodes.get(t);if(!n)throw new X0(this.user,`Tree element not found: ${t}`);return n}}const jxo=e=>e[e.length-1];class Vnt{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(t=>new Vnt(this.unwrapper,t))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(t,n){this.unwrapper=t,this.node=n}}function Wxo(e,t){return{...t,identityProvider:t.identityProvider&&{getId(n){return t.identityProvider.getId(e(n))}},sorter:t.sorter&&{compare(n,r){return t.sorter.compare(n.elements[0],r.elements[0])}},filter:t.filter&&{filter(n,r){const o=n.elements;for(let s=0;s({insertedNodes:t.map(r=>this.nodeMapper.map(r)),deletedNodes:n.map(r=>this.nodeMapper.map(r))}))}get onDidSpliceRenderedNodes(){return un.map(this.model.onDidSpliceRenderedNodes,({start:t,deleteCount:n,elements:r})=>({start:t,deleteCount:n,elements:r.map(o=>this.nodeMapper.map(o))}))}get onDidChangeCollapseState(){return un.map(this.model.onDidChangeCollapseState,({node:t,deep:n})=>({node:this.nodeMapper.map(t),deep:n}))}get onDidChangeRenderNodeCount(){return un.map(this.model.onDidChangeRenderNodeCount,t=>this.nodeMapper.map(t))}constructor(t,n={}){this.rootRef=null,this.elementMapper=n.elementMapper||jxo;const r=o=>this.elementMapper(o.elements);this.nodeMapper=new jnt(o=>new Vnt(r,o)),this.model=new Uxo(t,Wxo(r,n))}setChildren(t,n=lo.empty(),r={}){this.model.setChildren(t,n,r)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(t){this.model.setCompressionEnabled(t)}has(t){return this.model.has(t)}getListIndex(t){return this.model.getListIndex(t)}getListRenderCount(t){return this.model.getListRenderCount(t)}getNode(t){return this.nodeMapper.map(this.model.getNode(t))}getNodeLocation(t){return t.element}getParentNodeLocation(t){return this.model.getParentNodeLocation(t)}getFirstElementChild(t){const n=this.model.getFirstElementChild(t);return n===null||typeof n>"u"?n:this.elementMapper(n.elements)}isCollapsible(t){return this.model.isCollapsible(t)}setCollapsible(t,n){return this.model.setCollapsible(t,n)}isCollapsed(t){return this.model.isCollapsed(t)}setCollapsed(t,n,r){return this.model.setCollapsed(t,n,r)}expandTo(t){return this.model.expandTo(t)}rerender(t){return this.model.rerender(t)}refilter(){return this.model.refilter()}resort(t=null,n=!0){return this.model.resort(t,n)}getCompressedTreeNode(t=null){return this.model.getNode(t)}}var Vxo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};class znt extends cMn{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(t,n,r,o,s={}){super(t,n,r,o,s),this.user=t}setChildren(t,n=lo.empty(),r){this.model.setChildren(t,n,r)}rerender(t){if(t===void 0){this.view.rerender();return}this.model.rerender(t)}resort(t,n=!0){this.model.resort(t,n)}hasElement(t){return this.model.has(t)}createModel(t,n){return new Hnt(t,n)}}class uMn{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(t,n,r){this._compressedTreeNodeProvider=t,this.stickyScrollDelegate=n,this.renderer=r,this.templateId=r.templateId,r.onDidChangeTwistieState&&(this.onDidChangeTwistieState=r.onDidChangeTwistieState)}renderTemplate(t){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(t)}}renderElement(t,n,r,o){let s=this.stickyScrollDelegate.getCompressedNode(t);s||(s=this.compressedTreeNodeProvider.getCompressedTreeNode(t.element)),s.element.elements.length===1?(r.compressedTreeNode=void 0,this.renderer.renderElement(t,n,r.data,o)):(r.compressedTreeNode=s,this.renderer.renderCompressedElements(s,n,r.data,o))}disposeElement(t,n,r,o){var s,a,l,d;r.compressedTreeNode?(a=(s=this.renderer).disposeCompressedElements)==null||a.call(s,r.compressedTreeNode,n,r.data,o):(d=(l=this.renderer).disposeElement)==null||d.call(l,t,n,r.data,o)}disposeTemplate(t){this.renderer.disposeTemplate(t.data)}renderTwistie(t,n){var r,o;return((o=(r=this.renderer).renderTwistie)==null?void 0:o.call(r,t,n))??!1}}Vxo([bc],uMn.prototype,"compressedTreeNodeProvider",null);class zxo{constructor(t){this.modelProvider=t,this.compressedStickyNodes=new Map}getCompressedNode(t){return this.compressedStickyNodes.get(t)}constrainStickyScrollNodes(t,n,r){if(this.compressedStickyNodes.clear(),t.length===0)return[];for(let o=0;or||o>=n-1&&nthis,l=new zxo(()=>this.model),d=o.map(u=>new uMn(a,l,u));super(t,n,r,d,{...Zxo(a,s),stickyScrollDelegate:l})}setChildren(t,n=lo.empty(),r){this.model.setChildren(t,n,r)}createModel(t,n){return new Hxo(t,n)}updateOptions(t={}){super.updateOptions(t),typeof t.compressionEnabled<"u"&&this.model.setCompressionEnabled(t.compressionEnabled)}getCompressedTreeNode(t=null){return this.model.getCompressedTreeNode(t)}}function H9e(e){return{...e,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function RHe(e,t){return t.parent?t.parent===e?!0:RHe(e,t.parent):!1}function Yxo(e,t){return e===t||RHe(e,t)||RHe(t,e)}class Znt{get element(){return this.node.element.element}get children(){return this.node.children.map(t=>new Znt(t))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(t){this.node=t}}class Xxo{constructor(t,n,r){this.renderer=t,this.nodeMapper=n,this.onDidChangeTwistieState=r,this.renderedNodes=new Map,this.templateId=t.templateId}renderTemplate(t){return{templateData:this.renderer.renderTemplate(t)}}renderElement(t,n,r,o){this.renderer.renderElement(this.nodeMapper.map(t),n,r.templateData,o)}renderTwistie(t,n){return t.slow?(n.classList.add(...mi.asClassNameArray(Jt.treeItemLoading)),!0):(n.classList.remove(...mi.asClassNameArray(Jt.treeItemLoading)),!1)}disposeElement(t,n,r,o){var s,a;(a=(s=this.renderer).disposeElement)==null||a.call(s,this.nodeMapper.map(t),n,r.templateData,o)}disposeTemplate(t){this.renderer.disposeTemplate(t.templateData)}dispose(){this.renderedNodes.clear()}}function QCt(e){return{browserEvent:e.browserEvent,elements:e.elements.map(t=>t.element)}}function BCt(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class qxo extends cre{constructor(t){super(t.elements.map(n=>n.element)),this.data=t}}function V9e(e){return e instanceof cre?new qxo(e):e}class Gxo{constructor(t){this.dnd=t}getDragURI(t){return this.dnd.getDragURI(t.element)}getDragLabel(t,n){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(t.map(r=>r.element),n)}onDragStart(t,n){var r,o;(o=(r=this.dnd).onDragStart)==null||o.call(r,V9e(t),n)}onDragOver(t,n,r,o,s,a=!0){return this.dnd.onDragOver(V9e(t),n&&n.element,r,o,s)}drop(t,n,r,o,s){this.dnd.drop(V9e(t),n&&n.element,r,o,s)}onDragEnd(t){var n,r;(r=(n=this.dnd).onDragEnd)==null||r.call(n,t)}dispose(){this.dnd.dispose()}}class Kxo extends sMn{constructor(t,n,r){super(n,r),this.findProvider=t,this.isFindSessionActive=!1}filter(t,n){const r=super.filter(t,n);if(!this.isFindSessionActive||this.findMode===q0.Highlight||!this.findProvider.isVisible)return r;const o=vre(r)?r.visibility:r;return WP(o)===0?0:this.findProvider.isVisible(t)?r:0}}class Jxo extends aMn{constructor(t,n,r,o,s){super(t,r,o,s),this.findProvider=n,this.filter=r,this.activeSession=!1,this.asyncWorkInProgress=!1,this.disposables.add(Gn(async()=>{var a,l;this.activeSession&&await((l=(a=this.findProvider).endSession)==null?void 0:l.call(a))}))}render(){if(this.asyncWorkInProgress||!this.activeFindMetadata)return;const t=this.activeFindMetadata.matchCount===0&&this.pattern.length>0;this.renderMessage(t),this.pattern.length&&this.alertResults(this.activeFindMetadata.matchCount)}shouldAllowFocus(t){return this.shouldFocusWhenNavigating(t)}shouldFocusWhenNavigating(t){var r;if(!this.activeSession||!this.activeFindMetadata)return!0;const n=(r=t.element)==null?void 0:r.element;return n&&this.activeFindMetadata.isMatch(n)?!0:!e4.isDefault(t.filterData)}}function AMn(e){return e&&{...e,collapseByDefault:!0,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Gxo(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var n;return!!((n=e.accessibilityProvider)!=null&&n.isChecked(t.element))}:void 0,getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},filter:e.filter&&{filter(t,n){return e.filter.filter(t.element,n)}},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof e.expandOnlyOnTwistieClick>"u"?void 0:typeof e.expandOnlyOnTwistieClick!="function"?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),defaultFindVisibility:t=>t.hasChildren&&t.stale?1:typeof e.defaultFindVisibility=="number"?e.defaultFindVisibility:typeof e.defaultFindVisibility>"u"?2:e.defaultFindVisibility(t.element),stickyScrollDelegate:e.stickyScrollDelegate}}function IHe(e,t){t(e),e.children.forEach(n=>IHe(n,t))}class fMn{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return un.map(this.tree.onDidChangeFocus,QCt)}get onDidChangeSelection(){return un.map(this.tree.onDidChangeSelection,QCt)}get onMouseDblClick(){return un.map(this.tree.onMouseDblClick,BCt)}get onPointer(){return un.map(this.tree.onPointer,BCt)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(t,n,r,o,s,a={}){this.user=t,this.dataSource=s,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new it,this._onDidChangeNodeSlowState=new it,this.nodeMapper=new jnt(u=>new Znt(u)),this.disposables=new Pt,this.identityProvider=a.identityProvider,this.autoExpandSingleChildren=typeof a.autoExpandSingleChildren>"u"?!1:a.autoExpandSingleChildren,this.sorter=a.sorter,this.getDefaultCollapseState=u=>a.collapseByDefault?a.collapseByDefault(u)?U0.PreserveOrCollapsed:U0.PreserveOrExpanded:void 0;let l=!1,d;if(a.findProvider&&(a.findWidgetEnabled??!0)&&a.keyboardNavigationLabelProvider&&a.contextViewProvider&&(l=!0,d=new Kxo(a.findProvider,a.keyboardNavigationLabelProvider,a.filter)),this.tree=this.createTree(t,n,r,o,{...a,findWidgetEnabled:!l,filter:d??a.filter}),this.root=H9e({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables),l){const u={styles:a.findWidgetStyles,showNotFoundMessage:a.showNotFoundMessage,defaultFindMatchType:a.defaultFindMatchType,defaultFindMode:a.defaultFindMode};this.findController=this.disposables.add(new Jxo(this.tree,a.findProvider,d,this.tree.options.contextViewProvider,u)),this.focusNavigationFilter=h=>this.findController.shouldFocusWhenNavigating(h),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindOpenState=this.tree.onDidChangeFindOpenState,this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType}createTree(t,n,r,o,s){const a=new Wnt(r),l=o.map(u=>new Xxo(u,this.nodeMapper,this._onDidChangeNodeSlowState.event)),d=AMn(s)||{};return new znt(t,n,a,l,d)}updateOptions(t={}){this.findController&&(t.defaultFindMode!==void 0&&(this.findController.mode=t.defaultFindMode),t.defaultFindMatchType!==void 0&&(this.findController.matchType=t.defaultFindMatchType)),this.tree.updateOptions(t)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(t){this.tree.scrollTop=t}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(t,n){this.tree.layout(t,n)}style(t){this.tree.style(t)}getInput(){return this.root.element}async setInput(t,n){this.cancelAllRefreshPromises(),this.root.element=t;const r=n&&{viewState:n,focus:[],selection:[]};await this._updateChildren(t,!0,!1,r),r&&(this.tree.setFocus(r.focus),this.tree.setSelection(r.selection)),n&&typeof n.scrollTop=="number"&&(this.scrollTop=n.scrollTop)}cancelAllRefreshPromises(t=!1){this.refreshPromises.forEach(n=>n.cancel()),this.refreshPromises.clear(),t&&(this.subTreeRefreshPromises.forEach(n=>n.cancel()),this.subTreeRefreshPromises.clear())}async _updateChildren(t=this.root.element,n=!0,r=!1,o,s){if(typeof this.root.element>"u")throw new X0(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await un.toPromise(this._onDidRender.event));const a=this.getDataNode(t);if(await this.refreshAndRenderNode(a,n,o,s),r)try{this.tree.rerender(a)}catch{}}rerender(t){if(t===void 0||t===this.root.element){this.tree.rerender();return}const n=this.getDataNode(t);this.tree.rerender(n)}getNode(t=this.root.element){const n=this.getDataNode(t),r=this.tree.getNode(n===this.root?null:n);return this.nodeMapper.map(r)}collapse(t,n=!1){const r=this.getDataNode(t);return this.tree.collapse(r===this.root?null:r,n)}async expand(t,n=!1){if(typeof this.root.element>"u")throw new X0(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await un.toPromise(this._onDidRender.event));const r=this.getDataNode(t);if(this.tree.hasElement(r)&&!this.tree.isCollapsible(r)||(r.refreshPromise&&(await r.refreshPromise,await un.toPromise(this._onDidRender.event)),r!==this.root&&!r.refreshPromise&&!this.tree.isCollapsed(r)))return!1;const o=this.tree.expand(r===this.root?null:r,n);return r.refreshPromise&&(await r.refreshPromise,await un.toPromise(this._onDidRender.event)),o}setSelection(t,n){const r=t.map(o=>this.getDataNode(o));this.tree.setSelection(r,n)}getSelection(){return this.tree.getSelection().map(n=>n.element)}setFocus(t,n){const r=t.map(o=>this.getDataNode(o));this.tree.setFocus(r,n)}getFocus(){return this.tree.getFocus().map(n=>n.element)}reveal(t,n){this.tree.reveal(this.getDataNode(t),n)}getParentElement(t){const n=this.tree.getParentElement(this.getDataNode(t));return n&&n.element}getFirstElementChild(t=this.root.element){const n=this.getDataNode(t),r=this.tree.getFirstElementChild(n===this.root?null:n);return r&&r.element}getDataNode(t){var r;const n=this.nodes.get(t===this.root.element?null:t);if(!n){const o=(r=this.identityProvider)==null?void 0:r.getId(t).toString();throw new X0(this.user,`Data tree node not found${o?`: ${o}`:""}`)}return n}async refreshAndRenderNode(t,n,r,o){this.disposables.isDisposed||(await this.refreshNode(t,n,r),!this.disposables.isDisposed&&this.render(t,r,o))}async refreshNode(t,n,r){let o;if(this.subTreeRefreshPromises.forEach((s,a)=>{!o&&Yxo(a,t)&&(o=s.then(()=>this.refreshNode(t,n,r)))}),o)return o;if(t!==this.root&&this.tree.getNode(t).collapsed){t.hasChildren=!!this.dataSource.hasChildren(t.element),t.stale=!0,this.setChildren(t,[],n,r);return}return this.doRefreshSubTree(t,n,r)}async doRefreshSubTree(t,n,r){const o=zd(async()=>{const s=await this.doRefreshNode(t,n,r);t.stale=!1,await r$.settled(s.map(a=>this.doRefreshSubTree(a,n,r)))});return t.refreshPromise=o,this.subTreeRefreshPromises.set(t,o),o.finally(()=>{t.refreshPromise=void 0,this.subTreeRefreshPromises.delete(t)}),o}async doRefreshNode(t,n,r){t.hasChildren=!!this.dataSource.hasChildren(t.element);let o;if(!t.hasChildren)o=Promise.resolve(lo.empty());else{const s=this.doGetChildren(t);if(vUe(s))o=Promise.resolve(s);else{const a=My(800);a.then(()=>{t.slow=!0,this._onDidChangeNodeSlowState.fire(t)},l=>null),o=s.finally(()=>a.cancel())}}try{const s=await o;return this.setChildren(t,s,n,r)}catch(s){if(t!==this.root&&this.tree.hasElement(t)&&this.tree.collapse(t),Sk(s))return[];throw s}finally{t.slow&&(t.slow=!1,this._onDidChangeNodeSlowState.fire(t))}}doGetChildren(t){let n=this.refreshPromises.get(t);if(n)return n;const r=this.dataSource.getChildren(t.element);return vUe(r)?this.processChildren(r):(n=zd(async()=>this.processChildren(await r)),this.refreshPromises.set(t,n),n.finally(()=>{this.refreshPromises.delete(t)}))}_onDidChangeCollapseState({node:t,deep:n}){t.element!==null&&!t.collapsed&&t.element.stale&&(n?this.collapse(t.element.element):this.refreshAndRenderNode(t.element,!1).catch(Yi))}setChildren(t,n,r,o){const s=[...n];if(t.children.length===0&&s.length===0)return[];const a=new Map,l=new Map;for(const h of t.children)a.set(h.element,h),this.identityProvider&&l.set(h.id,{node:h,collapsed:this.tree.hasElement(h)&&this.tree.isCollapsed(h)});const d=[],u=s.map(h=>{const f=!!this.dataSource.hasChildren(h);if(!this.identityProvider){const m=H9e({element:h,parent:t,hasChildren:f,defaultCollapseState:this.getDefaultCollapseState(h)});return f&&m.defaultCollapseState===U0.PreserveOrExpanded&&d.push(m),m}const g=this.identityProvider.getId(h).toString(),k=l.get(g);if(k){const m=k.node;return a.delete(m.element),this.nodes.delete(m.element),this.nodes.set(h,m),m.element=h,m.hasChildren=f,r?k.collapsed?(m.children.forEach(v=>IHe(v,p=>this.nodes.delete(p.element))),m.children.splice(0,m.children.length),m.stale=!0):d.push(m):f&&!k.collapsed&&d.push(m),m}const A=H9e({element:h,parent:t,id:g,hasChildren:f,defaultCollapseState:this.getDefaultCollapseState(h)});return o&&o.viewState.focus&&o.viewState.focus.indexOf(g)>-1&&o.focus.push(A),o&&o.viewState.selection&&o.viewState.selection.indexOf(g)>-1&&o.selection.push(A),(o&&o.viewState.expanded&&o.viewState.expanded.indexOf(g)>-1||f&&A.defaultCollapseState===U0.PreserveOrExpanded)&&d.push(A),A});for(const h of a.values())IHe(h,f=>this.nodes.delete(f.element));for(const h of u)this.nodes.set(h.element,h);return Yge(t.children,0,t.children.length,u),t!==this.root&&this.autoExpandSingleChildren&&u.length===1&&d.length===0&&(u[0].forceExpanded=!0,d.push(u[0])),d}render(t,n,r){const o=t.children.map(a=>this.asTreeElement(a,n)),s=r&&{...r,diffIdentityProvider:r.diffIdentityProvider&&{getId(a){return r.diffIdentityProvider.getId(a.element)}}};this.tree.setChildren(t===this.root?null:t,o,s),t!==this.root&&this.tree.setCollapsible(t,t.hasChildren),this._onDidRender.fire()}asTreeElement(t,n){if(t.stale)return{element:t,collapsible:t.hasChildren,collapsed:!0};let r;return n&&n.viewState.expanded&&t.id&&n.viewState.expanded.indexOf(t.id)>-1?r=!1:t.forceExpanded?(r=!1,t.forceExpanded=!1):r=t.defaultCollapseState,{element:t,children:t.hasChildren?lo.map(t.children,o=>this.asTreeElement(o,n)):[],collapsible:t.hasChildren,collapsed:r}}processChildren(t){return this.sorter&&(t=[...t].sort(this.sorter.compare.bind(this.sorter))),t}dispose(){this.disposables.dispose(),this.tree.dispose()}}class Ynt{get element(){return{elements:this.node.element.elements.map(t=>t.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(t=>new Ynt(t))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(t){this.node=t}}class _xo{constructor(t,n,r,o){this.renderer=t,this.nodeMapper=n,this.compressibleNodeMapperProvider=r,this.onDidChangeTwistieState=o,this.renderedNodes=new Map,this.disposables=[],this.templateId=t.templateId}renderTemplate(t){return{templateData:this.renderer.renderTemplate(t)}}renderElement(t,n,r,o){this.renderer.renderElement(this.nodeMapper.map(t),n,r.templateData,o)}renderCompressedElements(t,n,r,o){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(t),n,r.templateData,o)}renderTwistie(t,n){return t.slow?(n.classList.add(...mi.asClassNameArray(Jt.treeItemLoading)),!0):(n.classList.remove(...mi.asClassNameArray(Jt.treeItemLoading)),!1)}disposeElement(t,n,r,o){var s,a;(a=(s=this.renderer).disposeElement)==null||a.call(s,this.nodeMapper.map(t),n,r.templateData,o)}disposeCompressedElements(t,n,r,o){var s,a;(a=(s=this.renderer).disposeCompressedElements)==null||a.call(s,this.compressibleNodeMapperProvider().map(t),n,r.templateData,o)}disposeTemplate(t){this.renderer.disposeTemplate(t.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=hs(this.disposables)}}function $xo(e){const t=e&&AMn(e);return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(n){return e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.map(r=>r.element))}},stickyScrollDelegate:t.stickyScrollDelegate}}class eLo extends fMn{constructor(t,n,r,o,s,a,l={}){super(t,n,r,s,a,l),this.compressionDelegate=o,this.compressibleNodeMapper=new jnt(d=>new Ynt(d)),this.filter=l.filter}createTree(t,n,r,o,s){const a=new Wnt(r),l=o.map(u=>new _xo(u,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),d=$xo(s)||{};return new hMn(t,n,a,l,d)}asTreeElement(t,n){return{incompressible:this.compressionDelegate.isIncompressible(t.element),...super.asTreeElement(t,n)}}render(t,n,r){if(!this.identityProvider)return super.render(t,n);const o=k=>this.identityProvider.getId(k).toString(),s=k=>{const A=new Set;for(const m of k){const v=this.tree.getCompressedTreeNode(m===this.root?null:m);if(v.element)for(const p of v.element.elements)A.add(o(p.element))}return A},a=s(this.tree.getSelection()),l=s(this.tree.getFocus());super.render(t,n,r);const d=this.getSelection();let u=!1;const h=this.getFocus();let f=!1;const g=k=>{const A=k.element;if(A)for(let m=0;m{const r=this.filter.filter(n,1),o=tLo(r);if(o===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return o===1})),super.processChildren(t)}}function tLo(e){return typeof e=="boolean"?e?1:0:vre(e)?WP(e.visibility):WP(e)}class nLo extends cMn{constructor(t,n,r,o,s,a={}){super(t,n,r,o,a),this.user=t,this.dataSource=s,this.identityProvider=a.identityProvider}createModel(t,n){return new Hnt(t,n)}}new Ln("isMac",Pr,j(1684,"Whether the operating system is macOS"));new Ln("isLinux",ym,j(1685,"Whether the operating system is Linux"));const VOe=new Ln("isWindows",wh,j(1686,"Whether the operating system is Windows")),gMn=new Ln("isWeb",aC,j(1687,"Whether the platform is a web browser"));new Ln("isMacNative",Pr&&!aC,j(1688,"Whether the operating system is macOS on a non-browser platform"));new Ln("isIOS",h2,j(1689,"Whether the operating system is iOS"));new Ln("isMobile",IEn,j(1690,"Whether the platform is a mobile web browser"));new Ln("isDevelopment",!1,!0);new Ln("productQualityType","",j(1691,"Quality type of VS Code"));const mMn="inputFocus",Xnt=new Ln(mMn,!1,j(1692,"Whether keyboard focus is inside an input box"));var M6=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Pa=function(e,t){return function(n,r){t(n,r,e)}};const S2=Lr("listService");class iLo{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new Pt,this.lists=[],this._lastFocusedWidget=void 0}setLastFocusedList(t){var n,r;t!==this._lastFocusedWidget&&((n=this._lastFocusedWidget)==null||n.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=t,(r=this._lastFocusedWidget)==null||r.getHTMLElement().classList.add("last-focused"))}register(t,n){if(this.lists.some(o=>o.widget===t))throw new Error("Cannot register the same widget multiple times");const r={widget:t,extraContextKeys:n};return this.lists.push(r),jbe(t.getHTMLElement())&&this.setLastFocusedList(t),Jp(t.onDidFocus(()=>this.setLastFocusedList(t)),Gn(()=>this.lists.splice(this.lists.indexOf(r),1)),t.onDidDispose(()=>{this.lists=this.lists.filter(o=>o!==r),this._lastFocusedWidget===t&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const dee=new Ln("listScrollAtBoundary","none");zt.or(dee.isEqualTo("top"),dee.isEqualTo("both"));zt.or(dee.isEqualTo("bottom"),dee.isEqualTo("both"));const kMn=new Ln("listFocus",!0),vMn=new Ln("treestickyScrollFocused",!1),zOe=new Ln("listSupportsMultiselect",!0),pMn=zt.and(kMn,zt.not(mMn),vMn.negate()),qnt=new Ln("listHasSelectionOrFocus",!1),Gnt=new Ln("listDoubleSelection",!1),Knt=new Ln("listMultiSelection",!1),ZOe=new Ln("listSelectionNavigation",!1),rLo=new Ln("listSupportsFind",!0),Jnt=new Ln("treeElementCanCollapse",!1),oLo=new Ln("treeElementHasParent",!1),_nt=new Ln("treeElementCanExpand",!1),sLo=new Ln("treeElementHasChild",!1),aLo=new Ln("treeFindOpen",!1),bMn="listTypeNavigationMode",OMn="listAutomaticKeyboardNavigation";function YOe(e,t){const n=e.createScoped(t.getHTMLElement());return kMn.bindTo(n),n}function XOe(e,t){const n=dee.bindTo(e),r=()=>{const o=t.scrollTop===0,s=t.scrollHeight-t.renderHeight-t.scrollTop<1;o&&s?n.set("both"):o?n.set("top"):s?n.set("bottom"):n.set("none")};return r(),t.onDidScroll(r)}const qM="workbench.list.multiSelectModifier",Nhe="workbench.list.openMode",t2="workbench.list.horizontalScrolling",$nt="workbench.list.defaultFindMode",eit="workbench.list.typeNavigationMode",T1e="workbench.list.keyboardNavigation",DO="workbench.list.scrollByPage",tit="workbench.list.defaultFindMatchType",uee="workbench.tree.indent",E1e="workbench.tree.renderIndentGuides",QO="workbench.list.smoothScrolling",Wy="workbench.list.mouseWheelScrollSensitivity",Hy="workbench.list.fastScrollSensitivity",D1e="workbench.tree.expandMode",Q1e="workbench.tree.enableStickyScroll",B1e="workbench.tree.stickyScrollMaxItemCount";function Vy(e){return e.getValue(qM)==="alt"}class lLo extends ct{constructor(t){super(),this.configurationService=t,this.useAltAsMultipleSelectionModifier=Vy(t),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration(qM)&&(this.useAltAsMultipleSelectionModifier=Vy(this.configurationService))}))}isSelectionSingleChangeEvent(t){return this.useAltAsMultipleSelectionModifier?t.browserEvent.altKey:rFn(t)}isSelectionRangeChangeEvent(t){return oFn(t)}}function qOe(e,t){const n=e.get(cr),r=e.get(Fo),o=new Pt;return[{...t,keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return r.mightProducePrintableCharacter(a)}},smoothScrolling:!!n.getValue(QO),mouseWheelScrollSensitivity:n.getValue(Wy),fastScrollSensitivity:n.getValue(Hy),multipleSelectionController:t.multipleSelectionController??o.add(new lLo(n)),keyboardNavigationEventFilter:uLo(r),scrollByPage:!!n.getValue(DO)},o]}let FCt=class extends Tk{constructor(t,n,r,o,s,a,l,d,u){const h=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!d.getValue(t2),[f,g]=u.invokeFunction(qOe,s);super(t,n,r,o,{keyboardSupport:!1,...f,horizontalScrolling:h}),this.disposables.add(g),this.contextKeyService=YOe(a,this),this.disposables.add(XOe(this.contextKeyService,this)),this.listSupportsMultiSelect=zOe.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),ZOe.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=qnt.bindTo(this.contextKeyService),this.listDoubleSelection=Gnt.bindTo(this.contextKeyService),this.listMultiSelection=Knt.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Vy(d),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const A=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(A.length>0||m.length>0),this.listMultiSelection.set(A.length>1),this.listDoubleSelection.set(A.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const A=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(A.length>0||m.length>0)})),this.disposables.add(d.onDidChangeConfiguration(A=>{A.affectsConfiguration(qM)&&(this._useAltAsMultipleSelectionModifier=Vy(d));let m={};if(A.affectsConfiguration(t2)&&this.horizontalScrolling===void 0){const v=!!d.getValue(t2);m={...m,horizontalScrolling:v}}if(A.affectsConfiguration(DO)){const v=!!d.getValue(DO);m={...m,scrollByPage:v}}if(A.affectsConfiguration(QO)){const v=!!d.getValue(QO);m={...m,smoothScrolling:v}}if(A.affectsConfiguration(Wy)){const v=d.getValue(Wy);m={...m,mouseWheelScrollSensitivity:v}}if(A.affectsConfiguration(Hy)){const v=d.getValue(Hy);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new wMn(this,{configurationService:d,...s}),this.disposables.add(this.navigator)}updateOptions(t){super.updateOptions(t),t.overrideStyles!==void 0&&this.updateStyles(t.overrideStyles),t.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!t.multipleSelectionSupport)}updateStyles(t){this.style(t?zM(t):yZ)}};FCt=M6([Pa(5,Fi),Pa(6,S2),Pa(7,cr),Pa(8,$n)],FCt);let PCt=class extends fxo{constructor(t,n,r,o,s,a,l,d,u){const h=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!d.getValue(t2),[f,g]=u.invokeFunction(qOe,s);super(t,n,r,o,{keyboardSupport:!1,...f,horizontalScrolling:h}),this.disposables=new Pt,this.disposables.add(g),this.contextKeyService=YOe(a,this),this.disposables.add(XOe(this.contextKeyService,this.widget)),this.horizontalScrolling=s.horizontalScrolling,this.listSupportsMultiSelect=zOe.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),ZOe.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this._useAltAsMultipleSelectionModifier=Vy(d),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(d.onDidChangeConfiguration(A=>{A.affectsConfiguration(qM)&&(this._useAltAsMultipleSelectionModifier=Vy(d));let m={};if(A.affectsConfiguration(t2)&&this.horizontalScrolling===void 0){const v=!!d.getValue(t2);m={...m,horizontalScrolling:v}}if(A.affectsConfiguration(DO)){const v=!!d.getValue(DO);m={...m,scrollByPage:v}}if(A.affectsConfiguration(QO)){const v=!!d.getValue(QO);m={...m,smoothScrolling:v}}if(A.affectsConfiguration(Wy)){const v=d.getValue(Wy);m={...m,mouseWheelScrollSensitivity:v}}if(A.affectsConfiguration(Hy)){const v=d.getValue(Hy);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new wMn(this,{configurationService:d,...s}),this.disposables.add(this.navigator)}updateOptions(t){super.updateOptions(t),t.overrideStyles!==void 0&&this.updateStyles(t.overrideStyles),t.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!t.multipleSelectionSupport)}updateStyles(t){this.style(t?zM(t):yZ)}dispose(){this.disposables.dispose(),super.dispose()}};PCt=M6([Pa(5,Fi),Pa(6,S2),Pa(7,cr),Pa(8,$n)],PCt);let MCt=class extends bxo{constructor(t,n,r,o,s,a,l,d,u,h){const f=typeof a.horizontalScrolling<"u"?a.horizontalScrolling:!!u.getValue(t2),[g,k]=h.invokeFunction(qOe,a);super(t,n,r,o,s,{keyboardSupport:!1,...g,horizontalScrolling:f}),this.disposables.add(k),this.contextKeyService=YOe(l,this),this.disposables.add(XOe(this.contextKeyService,this)),this.listSupportsMultiSelect=zOe.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(a.multipleSelectionSupport!==!1),ZOe.bindTo(this.contextKeyService).set(!!a.selectionNavigation),this.listHasSelectionOrFocus=qnt.bindTo(this.contextKeyService),this.listDoubleSelection=Gnt.bindTo(this.contextKeyService),this.listMultiSelection=Knt.bindTo(this.contextKeyService),this.horizontalScrolling=a.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Vy(u),this.disposables.add(this.contextKeyService),this.disposables.add(d.register(this)),this.updateStyles(a.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||v.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||v.length>0)})),this.disposables.add(u.onDidChangeConfiguration(m=>{m.affectsConfiguration(qM)&&(this._useAltAsMultipleSelectionModifier=Vy(u));let v={};if(m.affectsConfiguration(t2)&&this.horizontalScrolling===void 0){const p=!!u.getValue(t2);v={...v,horizontalScrolling:p}}if(m.affectsConfiguration(DO)){const p=!!u.getValue(DO);v={...v,scrollByPage:p}}if(m.affectsConfiguration(QO)){const p=!!u.getValue(QO);v={...v,smoothScrolling:p}}if(m.affectsConfiguration(Wy)){const p=u.getValue(Wy);v={...v,mouseWheelScrollSensitivity:p}}if(m.affectsConfiguration(Hy)){const p=u.getValue(Hy);v={...v,fastScrollSensitivity:p}}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new cLo(this,{configurationService:u,...a}),this.disposables.add(this.navigator)}updateOptions(t){super.updateOptions(t),t.overrideStyles!==void 0&&this.updateStyles(t.overrideStyles),t.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!t.multipleSelectionSupport)}updateStyles(t){this.style(t?zM(t):yZ)}dispose(){this.disposables.dispose(),super.dispose()}};MCt=M6([Pa(6,Fi),Pa(7,S2),Pa(8,cr),Pa(9,$n)],MCt);class nit extends ct{constructor(t,n){super(),this.widget=t,this._onDidOpen=this._register(new it),this.onDidOpen=this._onDidOpen.event,this._register(un.filter(this.widget.onDidChangeSelection,r=>dL(r.browserEvent))(r=>this.onSelectionFromKeyboard(r))),this._register(this.widget.onPointer(r=>this.onPointer(r.element,r.browserEvent))),this._register(this.widget.onMouseDblClick(r=>this.onMouseDblClick(r.element,r.browserEvent))),typeof(n==null?void 0:n.openOnSingleClick)!="boolean"&&(n!=null&&n.configurationService)?(this.openOnSingleClick=(n==null?void 0:n.configurationService.getValue(Nhe))!=="doubleClick",this._register(n==null?void 0:n.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration(Nhe)&&(this.openOnSingleClick=(n==null?void 0:n.configurationService.getValue(Nhe))!=="doubleClick")}))):this.openOnSingleClick=(n==null?void 0:n.openOnSingleClick)??!0}onSelectionFromKeyboard(t){if(t.elements.length!==1)return;const n=t.browserEvent,r=typeof n.preserveFocus=="boolean"?n.preserveFocus:!0,o=typeof n.pinned=="boolean"?n.pinned:!r;this._open(this.getSelectedElement(),r,o,!1,t.browserEvent)}onPointer(t,n){if(!this.openOnSingleClick||n.detail===2)return;const o=n.button===1,s=!0,a=o,l=n.ctrlKey||n.metaKey||n.altKey;this._open(t,s,a,l,n)}onMouseDblClick(t,n){if(!n)return;const r=n.target;if(r.classList.contains("monaco-tl-twistie")||r.classList.contains("monaco-icon-label")&&r.classList.contains("folder-icon")&&n.offsetX<16)return;const s=!1,a=!0,l=n.ctrlKey||n.metaKey||n.altKey;this._open(t,s,a,l,n)}_open(t,n,r,o,s){t&&this._onDidOpen.fire({editorOptions:{preserveFocus:n,pinned:r,revealIfVisible:!0},sideBySide:o,element:t,browserEvent:s})}}class wMn extends nit{constructor(t,n){super(t,n),this.widget=t}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class cLo extends nit{constructor(t,n){super(t,n)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class dLo extends nit{constructor(t,n){super(t,n)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function uLo(e){let t=!1;return n=>{if(n.toKeyCodeChord().isModifierKey())return!1;if(t)return t=!1,!1;const r=e.softDispatch(n,n.target);return r.kind===1?(t=!0,!1):(t=!1,r.kind===0)}}let F1e=class extends znt{get onDidOpen(){return this.internals.onDidOpen}constructor(t,n,r,o,s,a,l,d,u){const{options:h,getTypeNavigationMode:f,disposable:g}=a.invokeFunction(pre,s);super(t,n,r,o,h),this.disposables.add(g),this.internals=new VP(this,s,f,s.overrideStyles,l,d,u),this.disposables.add(this.internals)}updateOptions(t){super.updateOptions(t),this.internals.updateOptions(t)}};F1e=M6([Pa(5,$n),Pa(6,Fi),Pa(7,S2),Pa(8,cr)],F1e);let RCt=class extends hMn{constructor(t,n,r,o,s,a,l,d,u){const{options:h,getTypeNavigationMode:f,disposable:g}=a.invokeFunction(pre,s);super(t,n,r,o,h),this.disposables.add(g),this.internals=new VP(this,s,f,s.overrideStyles,l,d,u),this.disposables.add(this.internals)}updateOptions(t={}){super.updateOptions(t),t.overrideStyles&&this.internals.updateStyleOverrides(t.overrideStyles),this.internals.updateOptions(t)}};RCt=M6([Pa(5,$n),Pa(6,Fi),Pa(7,S2),Pa(8,cr)],RCt);let ICt=class extends nLo{constructor(t,n,r,o,s,a,l,d,u,h){const{options:f,getTypeNavigationMode:g,disposable:k}=l.invokeFunction(pre,a);super(t,n,r,o,s,f),this.disposables.add(k),this.internals=new VP(this,a,g,a.overrideStyles,d,u,h),this.disposables.add(this.internals)}updateOptions(t={}){super.updateOptions(t),t.overrideStyles!==void 0&&this.internals.updateStyleOverrides(t.overrideStyles),this.internals.updateOptions(t)}};ICt=M6([Pa(6,$n),Pa(7,Fi),Pa(8,S2),Pa(9,cr)],ICt);let NHe=class extends fMn{get onDidOpen(){return this.internals.onDidOpen}constructor(t,n,r,o,s,a,l,d,u,h){const{options:f,getTypeNavigationMode:g,disposable:k}=l.invokeFunction(pre,a);super(t,n,r,o,s,f),this.disposables.add(k),this.internals=new VP(this,a,g,a.overrideStyles,d,u,h),this.disposables.add(this.internals)}updateOptions(t={}){super.updateOptions(t),t.overrideStyles&&this.internals.updateStyleOverrides(t.overrideStyles),this.internals.updateOptions(t)}};NHe=M6([Pa(6,$n),Pa(7,Fi),Pa(8,S2),Pa(9,cr)],NHe);let NCt=class extends eLo{constructor(t,n,r,o,s,a,l,d,u,h,f){const{options:g,getTypeNavigationMode:k,disposable:A}=d.invokeFunction(pre,l);super(t,n,r,o,s,a,g),this.disposables.add(A),this.internals=new VP(this,l,k,l.overrideStyles,u,h,f),this.disposables.add(this.internals)}updateOptions(t){super.updateOptions(t),this.internals.updateOptions(t)}};NCt=M6([Pa(7,$n),Pa(8,Fi),Pa(9,S2),Pa(10,cr)],NCt);function yMn(e){const t=e.getValue($nt);if(t==="highlight")return q0.Highlight;if(t==="filter")return q0.Filter;const n=e.getValue(T1e);if(n==="simple"||n==="highlight")return q0.Highlight;if(n==="filter")return q0.Filter}function CMn(e){const t=e.getValue(tit);if(t==="fuzzy")return Kb.Fuzzy;if(t==="contiguous")return Kb.Contiguous}function pre(e,t){const n=e.get(cr),r=e.get(Q6),o=e.get(Fi),s=e.get($n),a=()=>{const g=o.getContextKeyValue(bMn);if(g==="automatic")return Fw.Automatic;if(g==="trigger"||o.getContextKeyValue(OMn)===!1)return Fw.Trigger;const A=n.getValue(eit);if(A==="automatic")return Fw.Automatic;if(A==="trigger")return Fw.Trigger},l=t.horizontalScrolling!==void 0?t.horizontalScrolling:!!n.getValue(t2),[d,u]=s.invokeFunction(qOe,t),h=t.paddingBottom,f=t.renderIndentGuides!==void 0?t.renderIndentGuides:n.getValue(E1e);return{getTypeNavigationMode:a,disposable:u,options:{keyboardSupport:!1,...d,indent:typeof n.getValue(uee)=="number"?n.getValue(uee):void 0,renderIndentGuides:f,smoothScrolling:!!n.getValue(QO),defaultFindMode:t.defaultFindMode??yMn(n),defaultFindMatchType:t.defaultFindMatchType??CMn(n),horizontalScrolling:l,scrollByPage:!!n.getValue(DO),paddingBottom:h,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:t.expandOnlyOnTwistieClick??n.getValue(D1e)==="doubleClick",contextViewProvider:r,findWidgetStyles:JOo,enableStickyScroll:!!n.getValue(Q1e),stickyScrollMaxItemCount:Number(n.getValue(B1e))}}}let VP=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(t,n,r,o,s,a,l){this.tree=t,this.disposables=[],this.contextKeyService=YOe(s,t),this.disposables.push(XOe(this.contextKeyService,t)),this.listSupportsMultiSelect=zOe.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(n.multipleSelectionSupport!==!1),ZOe.bindTo(this.contextKeyService).set(!!n.selectionNavigation),this.listSupportFindWidget=rLo.bindTo(this.contextKeyService),this.listSupportFindWidget.set(n.findWidgetEnabled??!0),this.hasSelectionOrFocus=qnt.bindTo(this.contextKeyService),this.hasDoubleSelection=Gnt.bindTo(this.contextKeyService),this.hasMultiSelection=Knt.bindTo(this.contextKeyService),this.treeElementCanCollapse=Jnt.bindTo(this.contextKeyService),this.treeElementHasParent=oLo.bindTo(this.contextKeyService),this.treeElementCanExpand=_nt.bindTo(this.contextKeyService),this.treeElementHasChild=sLo.bindTo(this.contextKeyService),this.treeFindOpen=aLo.bindTo(this.contextKeyService),this.treeStickyScrollFocused=vMn.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Vy(l),this.updateStyleOverrides(o);const u=()=>{const f=t.getFocus()[0];if(!f)return;const g=t.getNode(f);this.treeElementCanCollapse.set(g.collapsible&&!g.collapsed),this.treeElementHasParent.set(!!t.getParentElement(f)),this.treeElementCanExpand.set(g.collapsible&&g.collapsed),this.treeElementHasChild.set(!!t.getFirstElementChild(f))},h=new Set;h.add(bMn),h.add(OMn),this.disposables.push(this.contextKeyService,a.register(t),t.onDidChangeSelection(()=>{const f=t.getSelection(),g=t.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(f.length>0||g.length>0),this.hasMultiSelection.set(f.length>1),this.hasDoubleSelection.set(f.length===2)})}),t.onDidChangeFocus(()=>{const f=t.getSelection(),g=t.getFocus();this.hasSelectionOrFocus.set(f.length>0||g.length>0),u()}),t.onDidChangeCollapseState(u),t.onDidChangeModel(u),t.onDidChangeFindOpenState(f=>this.treeFindOpen.set(f)),t.onDidChangeStickyScrollFocused(f=>this.treeStickyScrollFocused.set(f)),l.onDidChangeConfiguration(f=>{let g={};if(f.affectsConfiguration(qM)&&(this._useAltAsMultipleSelectionModifier=Vy(l)),f.affectsConfiguration(uee)){const k=l.getValue(uee);g={...g,indent:k}}if(f.affectsConfiguration(E1e)&&n.renderIndentGuides===void 0){const k=l.getValue(E1e);g={...g,renderIndentGuides:k}}if(f.affectsConfiguration(QO)){const k=!!l.getValue(QO);g={...g,smoothScrolling:k}}if(f.affectsConfiguration($nt)||f.affectsConfiguration(T1e)){const k=yMn(l);g={...g,defaultFindMode:k}}if(f.affectsConfiguration(eit)||f.affectsConfiguration(T1e)){const k=r();g={...g,typeNavigationMode:k}}if(f.affectsConfiguration(tit)){const k=CMn(l);g={...g,defaultFindMatchType:k}}if(f.affectsConfiguration(t2)&&n.horizontalScrolling===void 0){const k=!!l.getValue(t2);g={...g,horizontalScrolling:k}}if(f.affectsConfiguration(DO)){const k=!!l.getValue(DO);g={...g,scrollByPage:k}}if(f.affectsConfiguration(D1e)&&n.expandOnlyOnTwistieClick===void 0&&(g={...g,expandOnlyOnTwistieClick:l.getValue(D1e)==="doubleClick"}),f.affectsConfiguration(Q1e)){const k=l.getValue(Q1e);g={...g,enableStickyScroll:k}}if(f.affectsConfiguration(B1e)){const k=Math.max(1,l.getValue(B1e));g={...g,stickyScrollMaxItemCount:k}}if(f.affectsConfiguration(Wy)){const k=l.getValue(Wy);g={...g,mouseWheelScrollSensitivity:k}}if(f.affectsConfiguration(Hy)){const k=l.getValue(Hy);g={...g,fastScrollSensitivity:k}}Object.keys(g).length>0&&t.updateOptions(g)}),this.contextKeyService.onDidChangeContext(f=>{f.affectsSome(h)&&t.updateOptions({typeNavigationMode:r()})})),this.navigator=new dLo(t,{configurationService:l,...n}),this.disposables.push(this.navigator)}updateOptions(t){t.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!t.multipleSelectionSupport)}updateStyleOverrides(t){this.tree.style(t?zM(t):yZ)}dispose(){this.disposables=hs(this.disposables)}};VP=M6([Pa(4,Fi),Pa(5,S2),Pa(6,cr)],VP);const hLo=Rl.as(XO.Configuration);hLo.registerConfiguration({id:"workbench",order:7,title:j(1705,"Workbench"),type:"object",properties:{[qM]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[j(1706,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),j(1707,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:j(1708,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[Nhe]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:j(1709,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[t2]:{type:"boolean",default:!1,description:j(1710,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[DO]:{type:"boolean",default:!1,description:j(1711,"Controls whether clicks in the scrollbar scroll page by page.")},[uee]:{type:"number",default:8,minimum:4,maximum:40,description:j(1712,"Controls tree indentation in pixels.")},[E1e]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:j(1713,"Controls whether the tree should render indent guides.")},[QO]:{type:"boolean",default:!1,description:j(1714,"Controls whether lists and trees have smooth scrolling.")},[Wy]:{type:"number",default:1,markdownDescription:j(1715,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Hy]:{type:"number",default:5,markdownDescription:j(1716,"Scrolling speed multiplier when pressing `Alt`.")},[$nt]:{type:"string",enum:["highlight","filter"],enumDescriptions:[j(1717,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),j(1718,"Filter elements when searching.")],default:"highlight",description:j(1719,"Controls the default find mode for lists and trees in the workbench.")},[T1e]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[j(1720,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),j(1721,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),j(1722,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:j(1723,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:j(1724,"Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[tit]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[j(1725,"Use fuzzy matching when searching."),j(1726,"Use contiguous matching when searching.")],default:"fuzzy",description:j(1727,"Controls the type of matching used when searching lists and trees in the workbench.")},[D1e]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:j(1728,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Q1e]:{type:"boolean",default:!0,description:j(1729,"Controls whether sticky scrolling is enabled in trees.")},[B1e]:{type:"number",minimum:1,default:7,markdownDescription:j(1730,"Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[eit]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:j(1731,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});class o6{constructor(t,n,r,o){this.isProviderFirst=t,this.parent=n,this.link=r,this._rangeCallback=o,this.id=fWe.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(t){this._range=t,this._rangeCallback(this)}get ariaMessage(){var n;const t=(n=this.parent.getPreview(this))==null?void 0:n.preview(this.range);return t?j(1088,"{0} in {1} on line {2} at column {3}",t.value,g2(this.uri),this.range.startLineNumber,this.range.startColumn):j(1087,"in {0} on line {1} at column {2}",g2(this.uri),this.range.startLineNumber,this.range.startColumn)}}class ALo{constructor(t){this._modelReference=t}dispose(){this._modelReference.dispose()}preview(t,n=8){const r=this._modelReference.object.textEditorModel;if(!r)return;const{startLineNumber:o,startColumn:s,endLineNumber:a,endColumn:l}=t,d=r.getWordUntilPosition({lineNumber:o,column:s-n}),u=new De(o,d.startColumn,o,s),h=new De(a,l,a,1073741824),f=r.getValueInRange(u).replace(/^\s+/,""),g=r.getValueInRange(t),k=r.getValueInRange(h).replace(/\s+$/,"");return{value:f+g+k,highlight:{start:f.length,end:f.length+g.length}}}}class IV{constructor(t,n){this.parent=t,this.uri=n,this.children=[],this._previews=new Qc}dispose(){hs(this._previews.values()),this._previews.clear()}getPreview(t){return this._previews.get(t.uri)}get ariaMessage(){const t=this.children.length;return t===1?j(1089,"1 symbol in {0}, full path {1}",g2(this.uri),this.uri.fsPath):j(1090,"{0} symbols in {1}, full path {2}",t,g2(this.uri),this.uri.fsPath)}async resolve(t){if(this._previews.size!==0)return this;for(const n of this.children)if(!this._previews.has(n.uri))try{const r=await t.createModelReference(n.uri);this._previews.set(n.uri,new ALo(r))}catch(r){Yi(r)}return this}}class I1{constructor(t,n){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new it,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=t,this._title=n;const[r]=t;t.sort(I1._compareReferences);let o;for(const s of t)if((!o||!Xa.isEqual(o.uri,s.uri,!0))&&(o=new IV(this,s.uri),this.groups.push(o)),o.children.length===0||I1._compareReferences(s,o.children[o.children.length-1])!==0){const a=new o6(r===s,o,s,l=>this._onDidChangeReferenceRange.fire(l));this.references.push(a),o.children.push(a)}}dispose(){hs(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new I1(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?j(1091,"No results found"):this.references.length===1?j(1092,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?j(1093,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):j(1094,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(t,n){const{parent:r}=t;let o=r.children.indexOf(t);const s=r.children.length,a=r.parent.groups.length;return a===1||n&&o+10?(n?o=(o+1)%s:o=(o+s-1)%s,r.children[o]):(o=r.parent.groups.indexOf(r),n?(o=(o+1)%a,r.parent.groups[o].children[0]):(o=(o+a-1)%a,r.parent.groups[o].children[r.parent.groups[o].children.length-1]))}nearestReference(t,n){const r=this.references.map((o,s)=>({idx:s,prefixLen:f4(o.uri.toString(),t.toString()),offsetDist:Math.abs(o.range.startLineNumber-n.lineNumber)*100+Math.abs(o.range.startColumn-n.column)})).sort((o,s)=>o.prefixLen>s.prefixLen?-1:o.prefixLens.offsetDist?1:0)[0];if(r)return this.references[r.idx]}referenceAt(t,n){for(const r of this.references)if(r.uri.toString()===t.toString()&&De.containsPosition(r.range,n))return r}firstReference(){for(const t of this.references)if(t.isProviderFirst)return t;return this.references[0]}static _compareReferences(t,n){return Xa.compare(t.uri,n.uri)||De.compareRangesUsingStarts(t.range,n.range)}}class UHe extends ct{constructor(t,n,r){super(),this.options=n,this.styles=r,this.count=0,this.hover=this._register(new is),this.element=tn(t,ln(".monaco-count-badge")),this._register(Gn(()=>t.removeChild(this.element))),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0),this.updateHover()}setCount(t){this.count=t,this.render()}setTitleFormat(t){this.titleFormat=t,this.updateHover(),this.render()}updateHover(){this.titleFormat!==""&&!this.hover.value?this.hover.value=E4().setupDelayedHoverAtMouse(this.element,()=>({content:pP(this.titleFormat,this.count),appearance:{compact:!0}})):this.titleFormat===""&&this.hover.value&&(this.hover.value=void 0)}render(){this.element.textContent=pP(this.countFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}class $5 extends ct{constructor(t,n){super(),this.options=n,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.domNode=tn(t,ln("span.monaco-highlighted-label"))}get element(){return this.domNode}set(t,n=[],r="",o,s){t||(t=""),o&&(t=$5.escapeNewLines(t,n)),!(this.didEverRender&&this.text===t&&this.title===r&&M1(this.highlights,n))&&(this.text=t,this.title=r,this.highlights=n,this.render(s))}render(t){var o;const n=[];let r=0;for(const s of this.highlights){if(s.end===s.start)continue;if(r{o=s===`\r `?-1:0,a+=r;for(const l of n)l.end<=a||(l.start>=a&&(l.start+=o),l.end>=a&&(l.end+=o));return r+=o,"⏎"})}}class YX{constructor(t){this._element=t}get element(){return this._element}set textContent(t){this.disposed||t===this._textContent||(this._textContent=t,this._element.textContent=t)}set classNames(t){this.disposed||M1(t,this._classNames)||(this._classNames=t,this._element.classList.value="",this._element.classList.add(...t))}set empty(t){this.disposed||t===this._empty||(this._empty=t,this._element.style.marginLeft=t?"0":"")}dispose(){this.disposed=!0}}class hee extends ct{constructor(t,n){super(),this.customHovers=new Map,this.creationOptions=n,this.domNode=this._register(new YX(tn(t,ln(".monaco-icon-label")))),this.labelContainer=tn(this.domNode.element,ln(".monaco-icon-label-container")),this.nameContainer=tn(this.labelContainer,ln("span.monaco-icon-name-container")),n!=null&&n.supportHighlights||n!=null&&n.supportIcons?this.nameNode=this._register(new mLo(this.nameContainer,!!n.supportIcons)):this.nameNode=new fLo(this.nameContainer),this.hoverDelegate=(n==null?void 0:n.hoverDelegate)??dC("mouse")}get element(){return this.domNode.element}setLabel(t,n,r){var d;const o=["monaco-icon-label"],s=["monaco-icon-label-container"];let a="";r&&(r.extraClasses&&o.push(...r.extraClasses),r.bold&&o.push("bold"),r.italic&&o.push("italic"),r.strikethrough&&o.push("strikethrough"),r.disabledCommand&&s.push("disabled"),r.title&&(typeof r.title=="string"?a+=r.title:a+=t));const l=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(r!=null&&r.iconPath){let u;if(!l||!oc(l)?(u=ln(".monaco-icon-label-iconpath"),this.domNode.element.prepend(u)):u=l,mi.isThemeIcon(r.iconPath)){const h=mi.asClassName(r.iconPath);u.className=`monaco-icon-label-iconpath ${h}`,u.style.backgroundImage=""}else u.style.backgroundImage=Uy(r==null?void 0:r.iconPath);u.style.backgroundRepeat="no-repeat",u.style.backgroundPosition="center",u.style.backgroundSize="contain"}else l&&l.remove();if(this.domNode.classNames=o,this.domNode.element.setAttribute("aria-label",a),this.labelContainer.classList.value="",this.labelContainer.classList.add(...s),this.setupHover(r!=null&&r.descriptionTitle?this.labelContainer:this.element,r==null?void 0:r.title),this.nameNode.setLabel(t,r),n||this.descriptionNode){const u=this.getOrCreateDescriptionNode();if(u instanceof $5){const h=(r==null?void 0:r.supportIcons)??((d=this.creationOptions)==null?void 0:d.supportIcons);u.set(n||"",r?r.descriptionMatches:void 0,void 0,r==null?void 0:r.labelEscapeNewLines,h),this.setupHover(u.element,r==null?void 0:r.descriptionTitle)}else u.textContent=n&&(r!=null&&r.labelEscapeNewLines)?$5.escapeNewLines(n,[]):n||"",this.setupHover(u.element,(r==null?void 0:r.descriptionTitle)||""),u.empty=!n}if(r!=null&&r.suffix||this.suffixNode){const u=this.getOrCreateSuffixNode();u.textContent=(r==null?void 0:r.suffix)??""}}setupHover(t,n){var a;const r=this.customHovers.get(t);if(r&&(r.dispose(),this.customHovers.delete(t)),!n){t.removeAttribute("title");return}let o=t;if((a=this.creationOptions)!=null&&a.hoverTargetOverride){if(!bu(t,this.creationOptions.hoverTargetOverride))throw new Error("hoverTargetOverrride must be an ancestor of the htmlElement");o=this.creationOptions.hoverTargetOverride}const s=E4().setupManagedHover(this.hoverDelegate,o,n);s&&this.customHovers.set(t,s)}dispose(){super.dispose();for(const t of this.customHovers.values())t.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const t=this._register(new YX(gco(this.nameContainer,ln("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new YX(tn(t.element,ln("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var t;if(!this.descriptionNode){const n=this._register(new YX(tn(this.labelContainer,ln("span.monaco-icon-description-container"))));(t=this.creationOptions)!=null&&t.supportDescriptionHighlights?this.descriptionNode=this._register(new $5(tn(n.element,ln("span.label-description")))):this.descriptionNode=this._register(new YX(tn(n.element,ln("span.label-description"))))}return this.descriptionNode}}class fLo{constructor(t){this.container=t,this.label=void 0,this.singleLabel=void 0}setLabel(t,n){if(!(this.label===t&&M1(this.options,n)))if(this.label=t,this.options=n,typeof t=="string")this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=tn(this.container,ln("a.label-name",{id:n==null?void 0:n.domId}))),this.singleLabel.textContent=t;else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let r=0;r{const s={start:r,end:r+o.length},a=n.map(l=>bA.intersect(s,l)).filter(l=>!bA.isEmpty(l)).map(({start:l,end:d})=>({start:l-r,end:d-r}));return r=s.end+t.length,a})}class mLo extends ct{constructor(t,n){super(),this.container=t,this.supportIcons=n,this.label=void 0,this.singleLabel=void 0}setLabel(t,n){if(this.label===t&&M1(this.options,n))return;this.label=t,this.options=n;const r=(n==null?void 0:n.supportIcons)??this.supportIcons;if(typeof t=="string")this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new $5(tn(this.container,ln("a.label-name",{id:n==null?void 0:n.domId}))))),this.singleLabel.set(t,n==null?void 0:n.matches,void 0,n==null?void 0:n.labelEscapeNewLines,r);else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;const o=(n==null?void 0:n.separator)||"/",s=gLo(t,o,n==null?void 0:n.matches);for(let a=0;a=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},KOe=function(e,t){return function(n,r){t(n,r,e)}},jHe;let WHe=class{constructor(t){this._resolverService=t}hasChildren(t){return t instanceof I1||t instanceof IV}getChildren(t){if(t instanceof I1)return t.groups;if(t instanceof IV)return t.resolve(this._resolverService).then(n=>n.children);throw new Error("bad tree")}};WHe=GOe([KOe(0,Uf)],WHe);class kLo{getHeight(){return 23}getTemplateId(t){return t instanceof IV?P1e.id:M1e.id}}let HHe=class{constructor(t){this._keybindingService=t}getKeyboardNavigationLabel(t){var n;if(t instanceof o6){const r=(n=t.parent.getPreview(t))==null?void 0:n.preview(t.range);if(r)return r.value}return g2(t.uri)}};HHe=GOe([KOe(0,Fo)],HHe);class vLo{getId(t){return t instanceof o6?t.id:t.uri}}let VHe=class extends ct{constructor(t,n){super(),this._labelService=n;const r=document.createElement("div");r.classList.add("reference-file"),this.file=this._register(new hee(r,{supportHighlights:!0})),this.badge=this._register(new UHe(tn(r,ln(".count")),{},bFn)),t.appendChild(r)}set(t,n){const r=Jbe(t.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(t.uri),this._labelService.getUriLabel(r,{relative:!0}),{title:this._labelService.getUriLabel(t.uri),matches:n});const o=t.children.length;this.badge.setCount(o),o>1?this.badge.setTitleFormat(j(1081,"{0} references",o)):this.badge.setTitleFormat(j(1082,"{0} reference",o))}};VHe=GOe([KOe(1,zP)],VHe);var tF;let P1e=(tF=class{constructor(t){this._instantiationService=t,this.templateId=jHe.id}renderTemplate(t){return this._instantiationService.createInstance(VHe,t)}renderElement(t,n,r){r.set(t.element,ore(t.filterData))}disposeTemplate(t){t.dispose()}},jHe=tF,tF.id="FileReferencesRenderer",tF);P1e=jHe=GOe([KOe(0,$n)],P1e);class pLo extends ct{constructor(t){super(),this.label=this._register(new $5(t))}set(t,n){var o;const r=(o=t.parent.getPreview(t))==null?void 0:o.preview(t.range);if(!r||!r.value)this.label.set(`${g2(t.uri)}:${t.range.startLineNumber+1}:${t.range.startColumn+1}`);else{const{value:s,highlight:a}=r;n&&!e4.isDefault(n)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,ore(n))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[a]))}}}const O2e=class O2e{constructor(){this.templateId=O2e.id}renderTemplate(t){return new pLo(t)}renderElement(t,n,r){r.set(t.element,t.filterData)}disposeTemplate(t){t.dispose()}};O2e.id="OneReferenceRenderer";let M1e=O2e;class bLo{getWidgetAriaLabel(){return j(1083,"References")}getAriaLabel(t){return t.ariaMessage}}var xMn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},uD=function(e,t){return function(n,r){t(n,r,e)}};const w2e=class w2e{constructor(t,n){this._editor=t,this._model=n,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Pt,this._callOnModelChange=new Pt,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const t=this._editor.getModel();if(t){for(const n of this._model.references)if(n.uri.toString()===t.uri.toString()){this._addDecorations(n.parent);return}}}_addDecorations(t){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const n=[],r=[];for(let o=0,s=t.children.length;o{const s=o.deltaDecorations([],n);for(let a=0;athis.labelService.getUriBasenameLabel(r.uri)).join(", ")}onDragStart(t,n){if(!n.dataTransfer)return;const o=t.elements.map(s=>this.getDragURI(s)).filter(Boolean);o.length&&(n.dataTransfer.setData(EP.RESOURCES,JSON.stringify(o)),n.dataTransfer.setData(EP.TEXT,o.join(` `)))}onDragOver(){return!1}drop(){}dispose(){this.disposables.dispose()}};ZHe=xMn([uD(0,zP)],ZHe);let YHe=class extends x1e{constructor(t,n,r,o,s,a,l,d,u){super(t,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},a),this._defaultTreeKeyboardSupport=n,this.layoutData=r,this._textModelResolverService=s,this._instantiationService=a,this._peekViewService=l,this._uriLabel=d,this._keybindingService=u,this._disposeOnNewModel=new Pt,this._callOnDispose=new Pt,this._onDidSelectReference=new it,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new ds(0,0),this._isClosing=!1,this._applyTheme(o.getColorTheme()),this._callOnDispose.add(o.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(t,this),this.create()}get isClosing(){return this._isClosing}dispose(){this._isClosing=!0,this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),hs(this._preview),hs(this._previewNotAvailableMessage),hs(this._tree),hs(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(t){const n=t.getColor(cxo)||Ut.transparent;this.style({arrowColor:n,frameColor:n,headerBackgroundColor:t.getColor(lxo)||Ut.transparent,primaryHeadingColor:t.getColor(nMn),secondaryHeadingColor:t.getColor(iMn)})}show(t){super.show(t,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(t){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"title"})}_fillBody(t){this.setCssClass("reference-zone-widget"),this._messageContainer=tn(t,ln("div.messages")),ag(this._messageContainer),this._splitView=new oMn(t,{orientation:1}),this._previewContainer=tn(t,ln("div.preview.inline"));const n={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(r6,this._previewContainer,n,{},this.editor),ag(this._previewContainer),this._previewNotAvailableMessage=this._instantiationService.createInstance(SP,j(1084,"no preview available"),dk,SP.DEFAULT_CREATION_OPTIONS,null),this._treeContainer=tn(t,ln("div.ref-tree.inline"));const r={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new bLo,keyboardNavigationLabelProvider:this._instantiationService.createInstance(HHe),identityProvider:new vLo,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:dxo},dnd:this._instantiationService.createInstance(ZHe)};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(Sc(this._treeContainer,"keydown",s=>{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(wLo,"ReferencesWidget",this._treeContainer,new kLo,[this._instantiationService.createInstance(P1e),this._instantiationService.createInstance(M1e)],this._instantiationService.createInstance(WHe),r),this._splitView.addView({onDidChange:un.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},L1e.Distribute),this._splitView.addView({onDidChange:un.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:s=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${s}px`,this._tree.layout(this._dim.height,s)}},L1e.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const o=(s,a)=>{s instanceof o6&&(a==="show"&&this._revealReference(s,!1),this._onDidSelectReference.fire({element:s,kind:a,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(s=>{s.sideBySide?o(s.element,"side"):s.editorOptions.pinned?o(s.element,"goto"):o(s.element,"show")})),ag(this._treeContainer)}_onWidth(t){this._dim&&this._doLayoutBody(this._dim.height,t)}_doLayoutBody(t,n){super._doLayoutBody(t,n),this._dim=new ds(n,t),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(n),this._splitView.resizeView(0,n*this.layoutData.ratio)}setSelection(t){return this._revealReference(t,!0).then(()=>{this._model&&(this._tree.setSelection([t]),this._tree.setFocus([t]))})}setModel(t){return this._disposeOnNewModel.clear(),this._model=t,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=j(1085,"No results"),O1(this._messageContainer),Promise.resolve(void 0)):(ag(this._messageContainer),this._decorationsManager=new zHe(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(t=>this._tree.rerender(t))),this._disposeOnNewModel.add(this._preview.onMouseDown(t=>{const{event:n,target:r}=t;if(n.detail!==2)return;const o=this._getFocusedReference();o&&this._onDidSelectReference.fire({element:{uri:o.uri,range:r.range},kind:n.ctrlKey||n.metaKey||n.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),O1(this._treeContainer),O1(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[t]=this._tree.getFocus();if(t instanceof o6)return t;if(t instanceof IV&&t.children.length>0)return t.children[0]}async revealReference(t){await this._revealReference(t,!1),this._onDidSelectReference.fire({element:t,kind:"goto",source:"tree"})}async _revealReference(t,n){if(this._revealedReference===t)return;this._revealedReference=t,t.uri.scheme!==Li.inMemory?this.setTitle(edo(t.uri),this._uriLabel.getUriLabel(Jbe(t.uri))):this.setTitle(j(1086,"References"));const r=this._textModelResolverService.createModelReference(t.uri);this._tree.getInput()===t.parent?this._tree.reveal(t):(n&&this._tree.reveal(t.parent),await this._tree.expand(t.parent),this._tree.reveal(t));const o=await r;if(!this._model){o.dispose();return}hs(this._previewModelReference);const s=o.object;if(s){const a=this._preview.getModel()===s.textEditorModel?0:1,l=De.lift(t.range).collapseToStart();this._previewModelReference=o,this._preview.setModel(s.textEditorModel),this._preview.setSelection(l),this._preview.revealRangeInCenter(l,a)}else this._preview.setModel(this._previewNotAvailableMessage),o.dispose()}};YHe=xMn([uD(3,Il),uD(4,Uf),uD(5,$n),uD(6,tMn),uD(7,zP),uD(8,Fo)],YHe);var yLo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},ZI=function(e,t){return function(n,r){t(n,r,e)}},Uhe;const GM=new Ln("referenceSearchVisible",!1,j(1078,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var nF;let ZP=(nF=class{static get(t){return t.getContribution(Uhe.ID)}constructor(t,n,r,o,s,a,l,d){this._defaultTreeKeyboardSupport=t,this._editor=n,this._editorService=o,this._notificationService=s,this._instantiationService=a,this._storageService=l,this._configurationService=d,this._disposables=new Pt,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=GM.bindTo(r)}dispose(){var t,n;this._referenceSearchVisible.reset(),this._disposables.dispose(),(t=this._widget)==null||t.dispose(),(n=this._model)==null||n.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(t,n,r){let o;if(this._widget&&(o=this._widget.position),this.closeWidget(),o&&t.containsPosition(o))return;this._peekMode=r,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const s="peekViewLayout",a=OLo.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(YHe,this._editor,this._defaultTreeKeyboardSupport,a),this._widget.setTitle(j(1079,"Loading...")),this._widget.show(t),this._disposables.add(this._widget.onDidClose(()=>{n.cancel(),this._widget?(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget.isClosing||this.closeWidget(),this._widget=void 0):this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(d=>{const{element:u,kind:h}=d;if(u)switch(h){case"open":(d.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(u,!1,!1);break;case"side":this.openReference(u,!0,!1);break;case"goto":r?this._gotoReference(u,!0):this.openReference(u,!1,!0);break}}));const l=++this._requestIdPool;n.then(d=>{var u;if(l!==this._requestIdPool||!this._widget){d.dispose();return}return(u=this._model)==null||u.dispose(),this._model=d,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(j(1080,"{0} ({1})",this._model.title,this._model.references.length));const h=this._editor.getModel().uri,f=new tt(t.startLineNumber,t.startColumn),g=this._model.nearestReference(h,f);if(g)return this._widget.setSelection(g).then(()=>{this._widget&&this._editor.getOption(99)==="editor"&&this._widget.focusOnPreviewEditor()})}})},d=>{this._notificationService.error(d)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(t){if(!this._editor.hasModel()||!this._model||!this._widget)return;const n=this._widget.position;if(!n)return;const r=this._model.nearestReference(this._editor.getModel().uri,n);if(!r)return;const o=this._model.nextOrPreviousReference(r,t),s=this._editor.hasTextFocus(),a=this._widget.isPreviewEditorFocused();await this._widget.setSelection(o),await this._gotoReference(o,!1),s?this._editor.focus():this._widget&&a&&this._widget.focusOnPreviewEditor()}async revealReference(t){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(t)}closeWidget(t=!0){var n,r;(n=this._widget)==null||n.dispose(),(r=this._model)==null||r.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,t&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(t,n){var o;(o=this._widget)==null||o.hide(),this._ignoreModelChangeEvent=!0;const r=De.lift(t.range).collapseToStart();return this._editorService.openCodeEditor({resource:t.uri,options:{selection:r,selectionSource:"code.jump",pinned:n}},this._editor).then(s=>{if(this._ignoreModelChangeEvent=!1,!s||!this._widget){this.closeWidget();return}if(this._editor===s)this._widget.show(r),this._widget.focusOnReferenceTree();else{const a=Uhe.get(s),l=this._model.clone();this.closeWidget(),s.focus(),a==null||a.toggleWidget(r,zd(d=>Promise.resolve(l)),this._peekMode??!1)}},s=>{this._ignoreModelChangeEvent=!1,Yi(s)})}openReference(t,n,r){n||this.closeWidget();const{uri:o,range:s}=t;this._editorService.openCodeEditor({resource:o,options:{selection:s,selectionSource:"code.jump",pinned:r}},this._editor,n)}},Uhe=nF,nF.ID="editor.contrib.referencesController",nF);ZP=Uhe=yLo([ZI(2,Fi),ZI(3,Co),ZI(4,cc),ZI(5,$n),ZI(6,jf),ZI(7,cr)],ZP);function KM(e,t){const n=_Pn(e);if(!n)return;const r=ZP.get(n);r&&t(r)}Zu.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:qc(2089,60),when:zt.or(GM,Lm.inPeekEditor),handler(e){KM(e,t=>{t.changeFocusBetweenPreviewAndReferences()})}});Zu.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:zt.or(GM,Lm.inPeekEditor),handler(e){KM(e,t=>{t.goToNextOrPreviousReference(!0)})}});Zu.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:zt.or(GM,Lm.inPeekEditor),handler(e){KM(e,t=>{t.goToNextOrPreviousReference(!1)})}});ho.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");ho.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");ho.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");ho.registerCommand("closeReferenceSearch",e=>KM(e,t=>t.closeWidget()));Zu.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:zt.and(Lm.inPeekEditor,zt.not("config.editor.stablePeek"))});Zu.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:zt.and(GM,zt.not("config.editor.stablePeek"),zt.or(Ze.editorTextFocus,Xnt.negate()))});Zu.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:zt.and(GM,pMn,Jnt.negate(),_nt.negate()),handler(e){var r;const n=(r=e.get(S2).lastFocusedList)==null?void 0:r.getFocus();Array.isArray(n)&&n[0]instanceof o6&&KM(e,o=>o.revealReference(n[0]))}});Zu.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:zt.and(GM,pMn,Jnt.negate(),_nt.negate()),handler(e){var r;const n=(r=e.get(S2).lastFocusedList)==null?void 0:r.getFocus();Array.isArray(n)&&n[0]instanceof o6&&KM(e,o=>o.openReference(n[0],!0,!0))}});ho.registerCommand("openReference",e=>{var r;const n=(r=e.get(S2).lastFocusedList)==null?void 0:r.getFocus();Array.isArray(n)&&n[0]instanceof o6&&KM(e,o=>o.openReference(n[0],!1,!0))});var LMn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},sG=function(e,t){return function(n,r){t(n,r,e)}};const iit=new Ln("hasSymbols",!1,j(1095,"Whether there are symbol locations that can be navigated via keyboard-only.")),JOe=Lr("ISymbolNavigationService");let XHe=class{constructor(t,n,r,o){this._editorService=n,this._notificationService=r,this._keybindingService=o,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=iit.bindTo(t)}reset(){var t,n;this._ctxHasSymbols.reset(),(t=this._currentState)==null||t.dispose(),(n=this._currentMessage)==null||n.close(),this._currentModel=void 0,this._currentIdx=-1}put(t){const n=t.parent.parent;if(n.references.length<=1){this.reset();return}this._currentModel=n,this._currentIdx=n.references.indexOf(t),this._ctxHasSymbols.set(!0),this._showMessage();const r=new qHe(this._editorService),o=r.onDidChange(s=>{if(this._ignoreEditorChange)return;const a=this._editorService.getActiveCodeEditor();if(!a)return;const l=a.getModel(),d=a.getPosition();if(!l||!d)return;let u=!1,h=!1;for(const f of n.references)if(IT(f.uri,l.uri))u=!0,h=h||De.containsPosition(f.range,d);else if(u)break;(!u||!h)&&this.reset()});this._currentState=Jp(r,o)}revealNext(t){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const n=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:n.uri,options:{selection:De.collapseToStart(n.range),selectionRevealType:3}},t).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var r;(r=this._currentMessage)==null||r.close();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),n=t?j(1096,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):j(1097,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(n)}};XHe=LMn([sG(0,Fi),sG(1,Co),sG(2,cc),sG(3,Fo)],XHe);qr(JOe,XHe,1);xn(new class extends $d{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:iit,kbOpts:{weight:100,primary:70}})}runEditorCommand(e,t){return e.get(JOe).revealNext(t)}});Zu.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:iit,primary:9,handler(e){e.get(JOe).reset()}});let qHe=class{constructor(t){this._listener=new Map,this._disposables=new Pt,this._onDidChange=new it,this.onDidChange=this._onDidChange.event,this._disposables.add(t.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(t.onCodeEditorAdd(this._onDidAddEditor,this)),t.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),hs(this._listener.values())}_onDidAddEditor(t){this._listener.set(t,Jp(t.onDidChangeCursorPosition(n=>this._onDidChange.fire({editor:t})),t.onDidChangeModelContent(n=>this._onDidChange.fire({editor:t}))))}_onDidRemoveEditor(t){var n;(n=this._listener.get(t))==null||n.dispose(),this._listener.delete(t)}};qHe=LMn([sG(0,Co)],qHe);function GHe(e,t){return t.uri.scheme===e.uri.scheme?!0:!QUe(t.uri,Li.walkThroughSnippet,Li.vscodeChatCodeBlock,Li.vscodeChatCodeCompareBlock)}async function bre(e,t,n,r,o){const a=n.ordered(e,r).map(d=>Promise.resolve(o(d,e,t)).then(void 0,u=>{Xc(u)})),l=await Promise.all(a);return YO(l.flat()).filter(d=>GHe(e,d))}function Ore(e,t,n,r,o){return bre(t,n,e,r,(s,a,l)=>s.provideDefinition(a,l,o))}function rit(e,t,n,r,o){return bre(t,n,e,r,(s,a,l)=>s.provideDeclaration(a,l,o))}function oit(e,t,n,r,o){return bre(t,n,e,r,(s,a,l)=>s.provideImplementation(a,l,o))}function sit(e,t,n,r,o){return bre(t,n,e,r,(s,a,l)=>s.provideTypeDefinition(a,l,o))}function wre(e,t,n,r,o,s){return bre(t,n,e,o,async(a,l,d)=>{var f,g;const u=(f=await a.provideReferences(l,d,{includeDeclaration:!0},s))==null?void 0:f.filter(k=>GHe(l,k));if(!r||!u||u.length!==2)return u;const h=(g=await a.provideReferences(l,d,{includeDeclaration:!1},s))==null?void 0:g.filter(k=>GHe(l,k));return h&&h.length===1?h:u})}async function AC(e){const t=await e(),n=new I1(t,""),r=n.references.map(o=>o.link);return n.dispose(),r}Qm("_executeDefinitionProvider",(e,t,n)=>{const r=e.get(Zn),o=Ore(r.definitionProvider,t,n,!1,Fr.None);return AC(()=>o)});Qm("_executeDefinitionProvider_recursive",(e,t,n)=>{const r=e.get(Zn),o=Ore(r.definitionProvider,t,n,!0,Fr.None);return AC(()=>o)});Qm("_executeTypeDefinitionProvider",(e,t,n)=>{const r=e.get(Zn),o=sit(r.typeDefinitionProvider,t,n,!1,Fr.None);return AC(()=>o)});Qm("_executeTypeDefinitionProvider_recursive",(e,t,n)=>{const r=e.get(Zn),o=sit(r.typeDefinitionProvider,t,n,!0,Fr.None);return AC(()=>o)});Qm("_executeDeclarationProvider",(e,t,n)=>{const r=e.get(Zn),o=rit(r.declarationProvider,t,n,!1,Fr.None);return AC(()=>o)});Qm("_executeDeclarationProvider_recursive",(e,t,n)=>{const r=e.get(Zn),o=rit(r.declarationProvider,t,n,!0,Fr.None);return AC(()=>o)});Qm("_executeReferenceProvider",(e,t,n)=>{const r=e.get(Zn),o=wre(r.referenceProvider,t,n,!1,!1,Fr.None);return AC(()=>o)});Qm("_executeReferenceProvider_recursive",(e,t,n)=>{const r=e.get(Zn),o=wre(r.referenceProvider,t,n,!1,!0,Fr.None);return AC(()=>o)});Qm("_executeImplementationProvider",(e,t,n)=>{const r=e.get(Zn),o=oit(r.implementationProvider,t,n,!1,Fr.None);return AC(()=>o)});Qm("_executeImplementationProvider_recursive",(e,t,n)=>{const r=e.get(Zn),o=oit(r.implementationProvider,t,n,!0,Fr.None);return AC(()=>o)});ju.appendMenuItem(Yn.EditorContext,{submenu:Yn.EditorContextPeek,title:j(1038,"Peek"),group:"navigation",order:100});class NV{static is(t){return!t||typeof t!="object"?!1:!!(t instanceof NV||tt.isIPosition(t.position)&&t.model)}constructor(t,n){this.model=t,this.position=n}}const up=class up extends T4{static all(){return up._allSymbolNavigationCommands.values()}static _patchConfig(t){const n={...t,f1:!0};if(n.menu)for(const r of lo.wrap(n.menu))(r.id===Yn.EditorContext||r.id===Yn.EditorContextPeek)&&(r.when=zt.and(t.precondition,r.when));return n}constructor(t,n){super(up._patchConfig(n)),this.configuration=t,up._allSymbolNavigationCommands.set(n.id,this)}runEditorCommand(t,n,r,o){if(!n.hasModel())return Promise.resolve(void 0);const s=t.get(cc),a=t.get(Co),l=t.get(e6),d=t.get(JOe),u=t.get(Zn),h=t.get($n),f=n.getModel(),g=n.getPosition(),k=NV.is(r)?r:new NV(f,g),A=new t6(n,5),m=hV(this._getLocationModel(u,k.model,k.position,A.token),A.token).then(async v=>{var O;if(!v||A.token.isCancellationRequested)return;kg(v.ariaMessage);let p;if(v.referenceAt(f.uri,g)){const w=this._getAlternativeCommand(n);w!==void 0&&!up._activeAlternativeCommands.has(w)&&up._allSymbolNavigationCommands.has(w)&&(p=up._allSymbolNavigationCommands.get(w))}const b=v.references.length;if(b===0){if(!this.configuration.muteMessage){const w=f.getWordAtPosition(g);(O=R1.get(n))==null||O.showMessage(this._getNoResultFoundMessage(w),g)}}else if(b===1&&p)up._activeAlternativeCommands.add(this.desc.id),h.invokeFunction(w=>p.runEditorCommand(w,n,r,o).finally(()=>{up._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(a,d,n,v,o)},v=>{s.error(v)}).finally(()=>{A.dispose()});return l.showWhile(m,250),m}async _onResult(t,n,r,o,s){const a=this._getGoToPreference(r);if(!(r instanceof r6)&&(this.configuration.openInPeek||a==="peek"&&o.references.length>1))this._openInPeek(r,o,s);else{const l=o.firstReference(),d=o.references.length>1&&a==="gotoAndPeek",u=await this._openReference(r,t,l,this.configuration.openToSide,!d);d&&u?this._openInPeek(u,o,s):o.dispose(),a==="goto"&&n.put(l)}}async _openReference(t,n,r,o,s){let a;if(e1o(r)&&(a=r.targetSelectionRange),a||(a=r.range),!a)return;const l=await n.openCodeEditor({resource:r.uri,options:{selection:De.collapseToStart(a),selectionRevealType:3,selectionSource:"code.jump"}},t,o);if(l){if(s){const d=l.getModel(),u=l.createDecorationsCollection([{range:a,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{l.getModel()===d&&u.clear()},350)}return l}}_openInPeek(t,n,r){const o=ZP.get(t);o&&t.hasModel()?o.toggleWidget(r??t.getSelection(),zd(s=>Promise.resolve(n)),this.configuration.openInPeek):n.dispose()}};up._allSymbolNavigationCommands=new Map,up._activeAlternativeCommands=new Set;let s6=up;class yre extends s6{async _getLocationModel(t,n,r,o){return new I1(await Ore(t.definitionProvider,n,r,!1,o),j(1039,"Definitions"))}_getNoResultFoundMessage(t){return t&&t.word?j(1040,"No definition found for '{0}'",t.word):j(1041,"No definition found")}_getAlternativeCommand(t){return t.getOption(67).alternativeDefinitionCommand}_getGoToPreference(t){return t.getOption(67).multipleDefinitions}}var uT;ws((uT=class extends yre{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:uT.id,title:{...Et(1065,"Go to Definition"),mnemonicTitle:j(1042,"Go to &&Definition")},precondition:Ze.hasDefinitionProvider,keybinding:[{when:Ze.editorTextFocus,primary:70,weight:100},{when:zt.and(Ze.editorTextFocus,gMn),primary:2118,weight:100}],menu:[{id:Yn.EditorContext,group:"navigation",order:1.1},{id:Yn.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),ho.registerCommandAlias("editor.action.goToDeclaration",uT.id)}},uT.id="editor.action.revealDefinition",uT));var hT;ws((hT=class extends yre{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:hT.id,title:Et(1066,"Open Definition to the Side"),precondition:zt.and(Ze.hasDefinitionProvider,Ze.isInEmbeddedEditor.toNegated()),keybinding:[{when:Ze.editorTextFocus,primary:qc(2089,70),weight:100},{when:zt.and(Ze.editorTextFocus,gMn),primary:qc(2089,2118),weight:100}]}),ho.registerCommandAlias("editor.action.openDeclarationToTheSide",hT.id)}},hT.id="editor.action.revealDefinitionAside",hT));var AT;ws((AT=class extends yre{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:AT.id,title:Et(1067,"Peek Definition"),precondition:zt.and(Ze.hasDefinitionProvider,Lm.notInPeekEditor,Ze.isInEmbeddedEditor.toNegated()),keybinding:{when:Ze.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:Yn.EditorContextPeek,group:"peek",order:2}}),ho.registerCommandAlias("editor.action.previewDeclaration",AT.id)}},AT.id="editor.action.peekDefinition",AT));class SMn extends s6{async _getLocationModel(t,n,r,o){return new I1(await rit(t.declarationProvider,n,r,!1,o),j(1043,"Declarations"))}_getNoResultFoundMessage(t){return t&&t.word?j(1044,"No declaration found for '{0}'",t.word):j(1045,"No declaration found")}_getAlternativeCommand(t){return t.getOption(67).alternativeDeclarationCommand}_getGoToPreference(t){return t.getOption(67).multipleDeclarations}}var iF;ws((iF=class extends SMn{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:iF.id,title:{...Et(1068,"Go to Declaration"),mnemonicTitle:j(1046,"Go to &&Declaration")},precondition:zt.and(Ze.hasDeclarationProvider,Ze.isInEmbeddedEditor.toNegated()),menu:[{id:Yn.EditorContext,group:"navigation",order:1.3},{id:Yn.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(t){return t&&t.word?j(1047,"No declaration found for '{0}'",t.word):j(1048,"No declaration found")}},iF.id="editor.action.revealDeclaration",iF));ws(class extends SMn{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Et(1069,"Peek Declaration"),precondition:zt.and(Ze.hasDeclarationProvider,Lm.notInPeekEditor,Ze.isInEmbeddedEditor.toNegated()),menu:{id:Yn.EditorContextPeek,group:"peek",order:3}})}});class TMn extends s6{async _getLocationModel(t,n,r,o){return new I1(await sit(t.typeDefinitionProvider,n,r,!1,o),j(1049,"Type Definitions"))}_getNoResultFoundMessage(t){return t&&t.word?j(1050,"No type definition found for '{0}'",t.word):j(1051,"No type definition found")}_getAlternativeCommand(t){return t.getOption(67).alternativeTypeDefinitionCommand}_getGoToPreference(t){return t.getOption(67).multipleTypeDefinitions}}var rF;ws((rF=class extends TMn{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:rF.ID,title:{...Et(1070,"Go to Type Definition"),mnemonicTitle:j(1052,"Go to &&Type Definition")},precondition:Ze.hasTypeDefinitionProvider,keybinding:{when:Ze.editorTextFocus,primary:0,weight:100},menu:[{id:Yn.EditorContext,group:"navigation",order:1.4},{id:Yn.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},rF.ID="editor.action.goToTypeDefinition",rF));var oF;ws((oF=class extends TMn{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:oF.ID,title:Et(1071,"Peek Type Definition"),precondition:zt.and(Ze.hasTypeDefinitionProvider,Lm.notInPeekEditor,Ze.isInEmbeddedEditor.toNegated()),menu:{id:Yn.EditorContextPeek,group:"peek",order:4}})}},oF.ID="editor.action.peekTypeDefinition",oF));class EMn extends s6{async _getLocationModel(t,n,r,o){return new I1(await oit(t.implementationProvider,n,r,!1,o),j(1053,"Implementations"))}_getNoResultFoundMessage(t){return t&&t.word?j(1054,"No implementation found for '{0}'",t.word):j(1055,"No implementation found")}_getAlternativeCommand(t){return t.getOption(67).alternativeImplementationCommand}_getGoToPreference(t){return t.getOption(67).multipleImplementations}}var sF;ws((sF=class extends EMn{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:sF.ID,title:{...Et(1072,"Go to Implementations"),mnemonicTitle:j(1056,"Go to &&Implementations")},precondition:Ze.hasImplementationProvider,keybinding:{when:Ze.editorTextFocus,primary:2118,weight:100},menu:[{id:Yn.EditorContext,group:"navigation",order:1.45},{id:Yn.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},sF.ID="editor.action.goToImplementation",sF));var aF;ws((aF=class extends EMn{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:aF.ID,title:Et(1073,"Peek Implementations"),precondition:zt.and(Ze.hasImplementationProvider,Lm.notInPeekEditor,Ze.isInEmbeddedEditor.toNegated()),keybinding:{when:Ze.editorTextFocus,primary:3142,weight:100},menu:{id:Yn.EditorContextPeek,group:"peek",order:5}})}},aF.ID="editor.action.peekImplementation",aF));class DMn extends s6{_getNoResultFoundMessage(t){return t?j(1057,"No references found for '{0}'",t.word):j(1058,"No references found")}_getAlternativeCommand(t){return t.getOption(67).alternativeReferenceCommand}_getGoToPreference(t){return t.getOption(67).multipleReferences}}ws(class extends DMn{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...Et(1074,"Go to References"),mnemonicTitle:j(1059,"Go to &&References")},precondition:zt.and(Ze.hasReferenceProvider,Lm.notInPeekEditor,Ze.isInEmbeddedEditor.toNegated()),keybinding:{when:Ze.editorTextFocus,primary:1094,weight:100},menu:[{id:Yn.EditorContext,group:"navigation",order:1.45},{id:Yn.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(t,n,r,o){return new I1(await wre(t.referenceProvider,n,r,!0,!1,o),j(1060,"References"))}});ws(class extends DMn{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Et(1075,"Peek References"),precondition:zt.and(Ze.hasReferenceProvider,Lm.notInPeekEditor,Ze.isInEmbeddedEditor.toNegated()),menu:{id:Yn.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(t,n,r,o){return new I1(await wre(t.referenceProvider,n,r,!1,!1,o),j(1061,"References"))}});class CLo extends s6{constructor(t,n,r){super(t,{id:"editor.action.goToLocation",title:Et(1076,"Go to Any Symbol"),precondition:zt.and(Lm.notInPeekEditor,Ze.isInEmbeddedEditor.toNegated())}),this._references=n,this._gotoMultipleBehaviour=r}async _getLocationModel(t,n,r,o){return new I1(this._references,j(1062,"Locations"))}_getNoResultFoundMessage(t){return t&&j(1063,"No results for '{0}'",t.word)||""}_getGoToPreference(t){return this._gotoMultipleBehaviour??t.getOption(67).multipleReferences}_getAlternativeCommand(){}}ho.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:pi},{name:"position",description:"The position at which to start",constraint:tt.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(e,t,n,r,o,s,a)=>{yo(pi.isUri(t)),yo(tt.isIPosition(n)),yo(Array.isArray(r)),yo(typeof o>"u"||typeof o=="string"),yo(typeof a>"u"||typeof a=="boolean");const l=e.get(Co),d=await l.openCodeEditor({resource:t},l.getFocusedCodeEditor());if(EO(d))return d.setPosition(n),d.revealPositionInCenterIfOutsideViewport(n,0),d.invokeWithinContext(u=>{const h=new class extends CLo{_getNoResultFoundMessage(f){return s||super._getNoResultFoundMessage(f)}}({muteMessage:!s,openInPeek:!!a,openToSide:!1},r,o);u.get($n).invokeFunction(h.run.bind(h),d)})}});ho.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:pi},{name:"position",description:"The position at which to start",constraint:tt.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(e,t,n,r,o)=>{e.get(Ca).executeCommand("editor.action.goToLocations",t,n,r,o,void 0,!0)}});ho.registerCommand({id:"editor.action.findReferences",handler:(e,t,n)=>{yo(pi.isUri(t)),yo(tt.isIPosition(n));const r=e.get(Zn),o=e.get(Co);return o.openCodeEditor({resource:t},o.getFocusedCodeEditor()).then(s=>{if(!EO(s)||!s.hasModel())return;const a=ZP.get(s);if(!a)return;const l=zd(u=>wre(r.referenceProvider,s.getModel(),tt.lift(n),!1,!1,u).then(h=>new I1(h,j(1064,"References")))),d=new De(n.lineNumber,n.column,n.lineNumber,n.column);return Promise.resolve(a.toggleWidget(d,l,!1))})}});ho.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function xLo(e,t,n,r){const o=e.get(Uf),s=e.get(Ek),a=e.get(Ca),l=e.get($n),d=e.get(cc);if(await r.item.resolve(Fr.None),!r.part.location)return;const u=r.part.location,h=[],f=new Set(ju.getMenuItems(Yn.EditorContext).map(k=>Zj(k)?k.command.id:jM()));for(const k of s6.all())f.has(k.desc.id)&&h.push(new ak(k.desc.id,lk.label(k.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const A=await o.createModelReference(u.uri);try{const m=new NV(A.object.textEditorModel,De.getStartPosition(u.range)),v=r.item.anchor.range;await l.invokeFunction(k.runEditorCommand.bind(k),t,m,v)}finally{A.dispose()}}));if(r.part.command){const{command:k}=r.part;h.push(new Ld),h.push(new ak(k.id,k.title,void 0,!0,async()=>{try{await a.executeCommand(k.id,...k.arguments??[])}catch(A){d.notify({severity:bZ.Error,source:r.item.provider.displayName,message:A})}}))}const g=t.getOption(144);s.showContextMenu({domForShadowRoot:g?t.getDomNode()??void 0:void 0,getAnchor:()=>{const k=ic(n);return{x:k.left,y:k.top+k.height+8}},getActions:()=>h,onHide:()=>{t.focus()},autoSelectFirstItem:!0})}async function QMn(e,t,n,r){const s=await e.get(Uf).createModelReference(r.uri);await n.invokeWithinContext(async a=>{const l=t.hasSideBySideModifier,d=a.get(Fi),u=Lm.inPeekEditor.getValue(d),h=!l&&n.getOption(101)&&!u;return new yre({openToSide:l,openInPeek:h,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(a,new NV(s.object.textEditorModel,De.getStartPosition(r.range)),De.lift(r.range))}),s.dispose()}var LLo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},YI=function(e,t){return function(n,r){t(n,r,e)}},qN;class R1e{constructor(){this._entries=new S4(50)}get(t){const n=R1e._key(t);return this._entries.get(n)}set(t,n){const r=R1e._key(t);this._entries.set(r,n)}static _key(t){return`${t.uri.toString()}/${t.getVersionId()}`}}const BMn=Lr("IInlayHintsCache");qr(BMn,R1e,1);class KHe{constructor(t,n){this.item=t,this.index=n}get part(){const t=this.item.hint.label;return typeof t=="string"?{label:t}:t[this.index]}}class SLo{constructor(t,n){this.part=t,this.hasTriggerModifier=n}}class TLo{constructor(){this._store=new is,this._tokenSource=new Ya}dispose(){this._store.dispose(),this._tokenSource.dispose(!0)}reset(){return this._tokenSource.dispose(!0),this._tokenSource=new Ya,this._store.value=new Pt,{store:this._store.value,token:this._tokenSource.token}}}var e8;let Aee=(e8=class{static get(t){return t.getContribution(qN.ID)??void 0}constructor(t,n,r,o,s,a,l){this._editor=t,this._languageFeaturesService=n,this._inlayHintsCache=o,this._commandService=s,this._notificationService=a,this._instaService=l,this._disposables=new Pt,this._sessionDisposables=new Pt,this._decorationsMetadata=new Map,this._activeRenderMode=0,this._ruleFactory=this._disposables.add(new kme(this._editor)),this._debounceInfo=r.for(n.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(n.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(t.onDidChangeModel(()=>this._update())),this._disposables.add(t.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(t.onDidChangeConfiguration(d=>{d.hasChanged(159)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const t=this._editor.getOption(159);if(t.enabled==="off")return;const n=this._editor.getModel();if(!n||!this._languageFeaturesService.inlayHintsProvider.has(n))return;if(t.enabled==="on")this._activeRenderMode=0;else{let u,h;t.enabled==="onUnlessPressed"?(u=0,h=1):(u=1,h=0),this._activeRenderMode=u,this._sessionDisposables.add(jL.getInstance().event(f=>{if(!this._editor.hasModel())return;const g=f.altKey&&f.ctrlKey&&!(f.shiftKey||f.metaKey)?h:u;if(g!==this._activeRenderMode){this._activeRenderMode=g;const k=this._editor.getModel(),A=this._copyInlayHintsWithCurrentAnchor(k);this._updateHintsDecorators([k.getFullModelRange()],A),l.schedule(0)}}))}const r=this._inlayHintsCache.get(n);r&&this._updateHintsDecorators([n.getFullModelRange()],r),this._sessionDisposables.add(Gn(()=>{n.isDisposed()||this._cacheHintsForFastRestore(n)}));let o;const s=new Set;this._sessionDisposables.add(n.onWillDispose(()=>o==null?void 0:o.cancel()));const a=this._sessionDisposables.add(new TLo),l=new Ss(async()=>{const u=Date.now(),{store:h,token:f}=a.reset();try{const g=await y1e.create(this._languageFeaturesService.inlayHintsProvider,n,this._getHintsRanges(),f);if(l.delay=this._debounceInfo.update(n,Date.now()-u),f.isCancellationRequested){g.dispose();return}for(const k of g.provider)typeof k.onDidChangeInlayHints=="function"&&!s.has(k)&&(s.add(k),h.add(k.onDidChangeInlayHints(()=>{l.isScheduled()||l.schedule()})));h.add(g),this._updateHintsDecorators(g.ranges,g.items),this._cacheHintsForFastRestore(n)}catch(g){Yi(g)}},this._debounceInfo.get(n));this._sessionDisposables.add(l),l.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(u=>{(u.scrollTopChanged||!l.isScheduled())&&l.schedule()}));const d=this._sessionDisposables.add(new is);this._sessionDisposables.add(this._editor.onDidChangeModelContent(u=>{const h=Math.max(l.delay,800);this._cursorInfo={position:this._editor.getPosition(),notEarlierThan:Date.now()+h},d.value=z8(()=>l.schedule(0),h),l.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeConfiguration(u=>{u.hasChanged(159)&&l.schedule()})),this._sessionDisposables.add(this._installDblClickGesture(()=>l.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const t=new Pt,n=t.add(new HOe(this._editor)),r=new Pt;return t.add(r),t.add(n.onMouseMoveOrRelevantKeyDown(o=>{const[s]=o,a=this._getInlayHintLabelPart(s),l=this._editor.getModel();if(!a||!l){r.clear();return}const d=new Ya;r.add(Gn(()=>d.dispose(!0))),a.item.resolve(d.token),this._activeInlayHintPart=a.part.command||a.part.location?new SLo(a,s.hasTriggerModifier):void 0;const u=l.validatePosition(a.item.hint.position).lineNumber,h=new De(u,1,u,l.getLineMaxColumn(u)),f=this._getInlineHintsForRange(h);this._updateHintsDecorators([h],f),r.add(Gn(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([h],f)}))})),t.add(n.onCancel(()=>r.clear())),t.add(n.onExecute(async o=>{const s=this._getInlayHintLabelPart(o);if(s){const a=s.part;a.location?this._instaService.invokeFunction(QMn,o,this._editor,a.location):Tje.is(a.command)&&await this._invokeCommand(a.command,s.item)}})),t}_getInlineHintsForRange(t){const n=new Set;for(const r of this._decorationsMetadata.values())t.containsRange(r.item.anchor.range)&&n.add(r.item);return Array.from(n)}_installDblClickGesture(t){return this._editor.onMouseUp(async n=>{if(n.event.detail!==2)return;const r=this._getInlayHintLabelPart(n);if(r&&(n.event.preventDefault(),await r.item.resolve(Fr.None),Qf(r.item.hint.textEdits))){const o=r.item.hint.textEdits.map(s=>Jl.replace(De.lift(s.range),s.text));this._editor.executeEdits("inlayHint.default",o),t()}})}_installContextMenu(){return this._editor.onContextMenu(async t=>{if(!oc(t.event.target))return;const n=this._getInlayHintLabelPart(t);n&&await this._instaService.invokeFunction(xLo,this._editor,t.event.target,n)})}_getInlayHintLabelPart(t){var r;if(t.target.type!==6)return;const n=(r=t.target.detail.injectedText)==null?void 0:r.options;if(n instanceof VT&&(n==null?void 0:n.attachedData)instanceof KHe)return n.attachedData}async _invokeCommand(t,n){try{await this._commandService.executeCommand(t.id,...t.arguments??[])}catch(r){this._notificationService.notify({severity:bZ.Error,source:n.provider.displayName,message:r})}}_cacheHintsForFastRestore(t){const n=this._copyInlayHintsWithCurrentAnchor(t);this._inlayHintsCache.set(t,n)}_copyInlayHintsWithCurrentAnchor(t){const n=new Map;for(const[r,o]of this._decorationsMetadata){if(n.has(o.item))continue;const s=t.getDecorationRange(r);if(s){const a=new KPn(s,o.item.anchor.direction),l=o.item.with({anchor:a});n.set(o.item,l)}}return Array.from(n.values())}_getHintsRanges(){const n=this._editor.getModel(),r=this._editor.getVisibleRangesPlusViewportAboveBelow(),o=[];for(const s of r.sort(De.compareRangesUsingStarts)){const a=n.validateRange(new De(s.startLineNumber-30,s.startColumn,s.endLineNumber+30,s.endColumn));o.length===0||!De.areIntersectingOrTouching(o[o.length-1],a)?o.push(a):o[o.length-1]=De.plusRange(o[o.length-1],a)}return o}_updateHintsDecorators(t,n){var v,p;const r=new Map;if(this._cursorInfo&&this._cursorInfo.notEarlierThan>Date.now()&&t.some(b=>b.containsPosition(this._cursorInfo.position))){const{position:b}=this._cursorInfo;this._cursorInfo=void 0;const O=new Map;for(const x of this._editor.getLineDecorations(b.lineNumber)??[]){const L=this._decorationsMetadata.get(x.id);if(x.range.startColumn>b.column)continue;const S=L==null?void 0:L.decoration.options[L.item.anchor.direction];if(S&&S.attachedData!==qN._whitespaceData){const E=O.get(L.item)??0;O.set(L.item,E+S.content.length)}}const w=n.filter(x=>x.anchor.range.startLineNumber===b.lineNumber&&x.anchor.range.endColumn<=b.column),y=Array.from(O.values());let C;for(;;){const x=w.shift(),L=y.shift();if(!L&&!x)break;if(x)r.set(x,L??0),C=x;else if(C&&L){let S=r.get(C);S+=L,S+=y.reduce((E,Q)=>E+Q,0),y.length=0;break}}}const o=[],s=(b,O,w,y,C)=>{const x={content:w,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:O.className,cursorStops:y,attachedData:C};o.push({item:b,classNameRef:O,decoration:{range:b.anchor.range,options:{description:"InlayHint",showIfCollapsed:b.anchor.range.isEmpty(),collapseOnReplaceEdit:!b.anchor.range.isEmpty(),stickiness:0,[b.anchor.direction]:this._activeRenderMode===0?x:void 0}}})},a=(b,O)=>{const w=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(b,w," ",O?Rv.Right:Rv.None,qN._whitespaceData)},{fontSize:l,fontFamily:d,padding:u,isUniform:h}=this._getLayoutInfo(),f=this._editor.getOption(159).maximumLength,g="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(g,d);let k={line:0,totalLen:0};for(let b=0;bf)continue;O.hint.paddingLeft&&a(O,!1);const w=typeof O.hint.label=="string"?[{label:O.hint.label}]:O.hint.label,y=r.get(O);let C=0;for(let x=0;x0&&(T=T.slice(0,-B)+"…",M=!0),C+=T.length,y!==void 0){const P=C-y;P>=0&&(C-=P,T=T.slice(0,-(1+P))+"…",M=!0)}if(u&&(S&&(E||M)?(Q.padding=`1px ${Math.max(1,l/4)|0}px`,Q.borderRadius=`${l/4|0}px`):S?(Q.padding=`1px 0 1px ${Math.max(1,l/4)|0}px`,Q.borderRadius=`${l/4|0}px 0 0 ${l/4|0}px`):E||M?(Q.padding=`1px ${Math.max(1,l/4)|0}px 1px 0`,Q.borderRadius=`0 ${l/4|0}px ${l/4|0}px 0`):Q.padding="1px 0 1px 0"),s(O,this._ruleFactory.createClassNameRef(Q),ELo(T),E&&!O.hint.paddingRight?Rv.Right:Rv.None,new KHe(O,x)),M)break}if(y!==void 0&&CqN._MAX_DECORATORS)break}const A=[];for(const[b,O]of this._decorationsMetadata){const w=(p=this._editor.getModel())==null?void 0:p.getDecorationRange(b);w&&t.some(y=>y.containsRange(w))&&(A.push(b),O.classNameRef.dispose(),this._decorationsMetadata.delete(b))}const m=SO.capture(this._editor);this._editor.changeDecorations(b=>{const O=b.deltaDecorations(A,o.map(w=>w.decoration));for(let w=0;wr)&&(s=r);const a=t.fontFamily||o;return{fontSize:s,fontFamily:a,padding:n,isUniform:!n&&a===o&&s===r}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const t of this._decorationsMetadata.values())t.classNameRef.dispose();this._decorationsMetadata.clear()}},qN=e8,e8.ID="editor.contrib.InlayHints",e8._MAX_DECORATORS=1500,e8._whitespaceData={},e8);Aee=qN=LLo([YI(1,Zn),YI(2,L2),YI(3,BMn),YI(4,Ca),YI(5,cc),YI(6,$n)],Aee);function ELo(e){return e.replace(/[ \t]/g," ")}ho.registerCommand("_executeInlayHintProvider",async(e,...t)=>{const[n,r]=t;yo(pi.isUri(n)),yo(De.isIRange(r));const{inlayHintsProvider:o}=e.get(Zn),s=await e.get(Uf).createModelReference(n);try{const a=await y1e.create(o,s.object.textEditorModel,[De.lift(r)],Fr.None),l=a.items.map(d=>d.hint);return setTimeout(()=>a.dispose(),0),l}finally{s.dispose()}});var DLo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},P7=function(e,t){return function(n,r){t(n,r,e)}};class UCt extends oG{constructor(t,n,r,o){super(10,n,t.item.anchor.range,r,o,!0),this.part=t}}let I1e=class extends lee{constructor(t,n,r,o,s,a,l,d){super(t,n,s,l,r,o,d),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(t){var o;if(!Aee.get(this._editor)||t.target.type!==6)return null;const r=(o=t.target.detail.injectedText)==null?void 0:o.options;return r instanceof VT&&r.attachedData instanceof KHe?new UCt(r.attachedData,this,t.event.posx,t.event.posy):null}computeSync(){return[]}computeAsync(t,n,r,o){return t instanceof UCt?new $v(async s=>{const{part:a}=t;if(await a.item.resolve(o),o.isCancellationRequested)return;let l;typeof a.item.hint.tooltip=="string"?l=new xA().appendText(a.item.hint.tooltip):a.item.hint.tooltip&&(l=a.item.hint.tooltip),l&&s.emitOne(new Np(this,t.range,[l],!1,0)),Qf(a.item.hint.textEdits)&&s.emitOne(new Np(this,t.range,[new xA().appendText(j(1164,"Double-click to insert"))],!1,10001));let d;if(typeof a.part.tooltip=="string"?d=new xA().appendText(a.part.tooltip):a.part.tooltip&&(d=a.part.tooltip),d&&s.emitOne(new Np(this,t.range,[d],!1,1)),a.part.location||a.part.command){let h;const g=this._editor.getOption(86)==="altKey"?Pr?j(1165,"cmd + click"):j(1166,"ctrl + click"):Pr?j(1167,"option + click"):j(1168,"alt + click");a.part.location&&a.part.command?h=new xA().appendText(j(1169,"Go to Definition ({0}), right click for more",g)):a.part.location?h=new xA().appendText(j(1170,"Go to Definition ({0})",g)):a.part.command&&(h=new xA(`[${j(1171,"Execute Command")}](${$Co(a.part.command)} "${a.part.command.title}") (${g})`,{isTrusted:!0})),h&&s.emitOne(new Np(this,t.range,[h],!1,1e4))}const u=this._resolveInlayHintLabelPartHover(a,o);for await(const h of u)s.emitOne(h)}):$v.EMPTY}async*_resolveInlayHintLabelPartHover(t,n){if(!t.part.location)return;const{uri:r,range:o}=t.part.location,s=await this._resolverService.createModelReference(r);try{const a=s.object.textEditorModel;if(!this._languageFeaturesService.hoverProvider.has(a))return;for await(const l of Rnt(this._languageFeaturesService.hoverProvider,a,new tt(o.startLineNumber,o.startColumn),n))DV(l.hover.contents)||(yield new Np(this,t.item.anchor.range,l.hover.contents,!1,2+l.ordinal))}finally{s.dispose()}}};I1e=DLo([P7(1,D4),P7(2,Fo),P7(3,Lg),P7(4,cr),P7(5,Uf),P7(6,Zn),P7(7,Ca)],I1e);var FMn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},N1e=function(e,t){return function(n,r){t(n,r,e)}};class jCt{constructor(t,n,r){this.marker=t,this.index=n,this.total=r}}let JHe=class{constructor(t,n,r){this._markerService=n,this._configService=r,this._onDidChange=new it,this.onDidChange=this._onDidChange.event,this._dispoables=new Pt,this._markers=[],this._nextIdx=-1,pi.isUri(t)?this._resourceFilter=l=>l.toString()===t.toString():t&&(this._resourceFilter=t);const o=this._configService.getValue("problems.sortOrder"),s=(l,d)=>{let u=o$(l.resource.toString(),d.resource.toString());return u===0&&(o==="position"?u=De.compareRangesUsingStarts(l,d)||Bl.compare(l.severity,d.severity):u=Bl.compare(l.severity,d.severity)||De.compareRangesUsingStarts(l,d)),u},a=()=>{let l=this._markerService.read({resource:pi.isUri(t)?t:void 0,severities:Bl.Error|Bl.Warning|Bl.Info});return typeof t=="function"&&(l=l.filter(d=>this._resourceFilter(d.resource))),l.sort(s),za(l,this._markers,(d,u)=>d.resource.toString()===u.resource.toString()&&d.startLineNumber===u.startLineNumber&&d.startColumn===u.startColumn&&d.endLineNumber===u.endLineNumber&&d.endColumn===u.endColumn&&d.severity===u.severity&&d.message===u.message)?!1:(this._markers=l,!0)};a(),this._dispoables.add(n.onMarkerChanged(l=>{(!this._resourceFilter||l.some(d=>this._resourceFilter(d)))&&a()&&(this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(t){return!this._resourceFilter&&!t?!0:!this._resourceFilter||!t?!1:this._resourceFilter(t)}get selected(){const t=this._markers[this._nextIdx];return t&&new jCt(t,this._nextIdx+1,this._markers.length)}_initIdx(t,n,r){let o=this._markers.findIndex(s=>IT(s.resource,t.uri));if(o<0)o=Cet(this._markers.length,s=>o$(this._markers[s].resource.toString(),t.uri.toString())),o<0&&(o=~o),r?this._nextIdx=o:this._nextIdx=(this._markers.length+o-1)%this._markers.length;else{let s=!1,a=!1;for(let l=o;lo.resource.toString()===t.toString());if(!(r<0)){for(;r=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},XI=function(e,t){return function(n,r){t(n,r,e)}},eVe;class BLo{constructor(t,n,r,o,s){this._openerService=o,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Pt,this._editor=n;const a=document.createElement("div");a.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),a.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),a.appendChild(this._relatedBlock),this._disposables.add(Sc(this._relatedBlock,"click",l=>{l.preventDefault();const d=this._relatedDiagnostics.get(l.target);d&&r(d)})),this._scrollable=new _Dn(a,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),t.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(l=>{a.style.left=`-${l.scrollLeft}px`,a.style.top=`-${l.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){hs(this._disposables)}update(t){const{source:n,message:r,relatedInformation:o,code:s}=t;let a=((n==null?void 0:n.length)||0)+2;s&&(typeof s=="string"?a+=s.length:a+=s.value.length);const l=W1(r);this._lines=l.length,this._longestLineLength=0;for(const g of l)this._longestLineLength=Math.max(g.length+a,this._longestLineLength);kh(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(t)),this._editor.applyFontInfo(this._messageBlock);let d=this._messageBlock;for(const g of l)d=document.createElement("div"),d.innerText=g,g===""&&(d.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(d);if(n||s){const g=document.createElement("span");if(g.classList.add("details"),d.appendChild(g),n){const k=document.createElement("span");k.innerText=n,k.classList.add("source"),g.appendChild(k)}if(s)if(typeof s=="string"){const k=document.createElement("span");k.innerText=`(${s})`,k.classList.add("code"),g.appendChild(k)}else{this._codeLink=ln("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=A=>{this._openerService.open(s.target,{allowCommands:!0}),A.preventDefault(),A.stopPropagation()};const k=tn(this._codeLink,ln("span"));k.innerText=s.value,g.appendChild(this._codeLink)}}if(kh(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Qf(o)){const g=this._relatedBlock.appendChild(document.createElement("div"));g.style.paddingTop=`${Math.floor(this._editor.getOption(75)*.66)}px`,this._lines+=1;for(const k of o){const A=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(k.resource)}(${k.startLineNumber}, ${k.startColumn}): `,m.title=this._labelService.getUriLabel(k.resource),this._relatedDiagnostics.set(m,k);const v=document.createElement("span");v.innerText=k.message,A.appendChild(m),A.appendChild(v),this._lines+=1,g.appendChild(A)}}const u=this._editor.getOption(59),h=Math.ceil(u.typicalFullwidthCharacterWidth*this._longestLineLength*.75),f=u.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:h,scrollHeight:f})}layout(t,n){this._scrollable.getDomNode().style.height=`${t}px`,this._scrollable.getDomNode().style.width=`${n}px`,this._scrollable.setScrollDimensions({width:n,height:t})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(t){let n="";switch(t.severity){case Bl.Error:n=j(1024,"Error");break;case Bl.Warning:n=j(1025,"Warning");break;case Bl.Info:n=j(1026,"Info");break;case Bl.Hint:n=j(1027,"Hint");break}let r=j(1028,"{0} at {1}. ",n,t.startLineNumber+":"+t.startColumn);const o=this._editor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1&&(r=`${o.getLineContent(t.startLineNumber)}, ${r}`),r}}var lF;let fee=(lF=class extends x1e{constructor(t,n,r,o,s,a,l){super(t,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=n,this._openerService=r,this._menuService=o,this._contextKeyService=a,this._labelService=l,this._callOnDispose=new Pt,this._onDidSelectRelatedInformation=new it,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Bl.Warning,this._backgroundColor=Ut.white,this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(t){this._backgroundColor=t.getColor(RLo);let n=tVe,r=FLo;this._severity===Bl.Warning?(n=jhe,r=PLo):this._severity===Bl.Info&&(n=nVe,r=MLo);const o=t.getColor(n),s=t.getColor(r);this.style({arrowColor:o,frameColor:o,headerBackgroundColor:s,primaryHeadingColor:t.getColor(nMn),secondaryHeadingColor:t.getColor(iMn)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(t){super._fillHead(t),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(o=>this.editor.focus()));const n=this._menuService.getMenuActions(eVe.TitleMenu,this._contextKeyService),r=o3o(n);this._actionbarWidget.push(r,{label:!1,icon:!0,index:0})}_fillTitleIcon(t){this._icon=tn(t,ln(""))}_fillBody(t){this._parentContainer=t,t.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),t.appendChild(this._container),this._message=new BLo(this._container,this.editor,n=>this._onDidSelectRelatedInformation.fire(n),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(t,n,r){this._container.classList.remove("stale"),this._message.update(t),this._severity=t.severity,this._applyTheme(this._themeService.getColorTheme());const o=De.lift(t),s=this.editor.getPosition(),a=s&&o.containsPosition(s)?s:o.getStartPosition();super.show(a,this.computeRequiredHeight());const l=this.editor.getModel();if(l){const d=r>1?j(1029,"{0} of {1} problems",n,r):j(1030,"{0} of {1} problem",n,r);this.setTitle(g2(l.uri),d)}this._icon.className=`codicon ${$He.className(Bl.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(a,0),this.editor.focus()}updateMarker(t){this._container.classList.remove("stale"),this._message.update(t)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(t,n){super._doLayoutBody(t,n),this._heightInPixel=t,this._message.layout(t,n),this._container.style.height=`${t}px`}_onWidth(t){this._message.layout(this._heightInPixel,t)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}},eVe=lF,lF.TitleMenu=new Yn("gotoErrorTitleMenu"),lF);fee=eVe=QLo([XI(1,Il),XI(2,B6),XI(3,y2),XI(4,$n),XI(5,Fi),XI(6,zP)],fee);const WCt=b$(uOe,aAo),HCt=b$(K8,O$),VCt=b$(Iy,w$),tVe=He("editorMarkerNavigationError.background",{dark:WCt,light:WCt,hcDark:uo,hcLight:uo},j(1031,"Editor marker navigation widget error color.")),FLo=He("editorMarkerNavigationError.headerBackground",{dark:Ji(tVe,.1),light:Ji(tVe,.1),hcDark:null,hcLight:null},j(1032,"Editor marker navigation widget error heading background.")),jhe=He("editorMarkerNavigationWarning.background",{dark:HCt,light:HCt,hcDark:uo,hcLight:uo},j(1033,"Editor marker navigation widget warning color.")),PLo=He("editorMarkerNavigationWarning.headerBackground",{dark:Ji(jhe,.1),light:Ji(jhe,.1),hcDark:"#0C141F",hcLight:Ji(jhe,.2)},j(1034,"Editor marker navigation widget warning heading background.")),nVe=He("editorMarkerNavigationInfo.background",{dark:VCt,light:VCt,hcDark:uo,hcLight:uo},j(1035,"Editor marker navigation widget info color.")),MLo=He("editorMarkerNavigationInfo.headerBackground",{dark:Ji(nVe,.1),light:Ji(nVe,.1),hcDark:null,hcLight:null},j(1036,"Editor marker navigation widget info heading background.")),RLo=He("editorMarkerNavigation.background",Tc,j(1037,"Editor marker navigation widget background."));var ILo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},pce=function(e,t){return function(n,r){t(n,r,e)}},aG,cF;let YP=(cF=class{static get(t){return t.getContribution(aG.ID)}constructor(t,n,r,o,s){this._markerNavigationService=n,this._contextKeyService=r,this._editorService=o,this._instantiationService=s,this._sessionDispoables=new Pt,this._editor=t,this._widgetVisible=MMn.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(t){if(this._model&&this._model.matches(t))return this._model;let n=!1;return this._model&&(n=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(t),n&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(fee,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(r=>{var o,s,a;(!((o=this._model)!=null&&o.selected)||!De.containsPosition((s=this._model)==null?void 0:s.selected.marker,r.position))&&((a=this._model)==null||a.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const r=this._model.find(this._editor.getModel().uri,this._widget.position);r?this._widget.updateMarker(r.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(r=>{this._editorService.openCodeEditor({resource:r.resource,options:{pinned:!0,revealIfOpened:!0,selection:De.lift(r).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(t=!0){this._cleanUp(),t&&this._editor.focus()}showAtMarker(t){if(!this._editor.hasModel())return;const n=this._editor.getModel(),r=this._getOrCreateModel(n.uri);r.resetIndex(),r.move(!0,n,new tt(t.startLineNumber,t.startColumn)),r.selected&&this._widget.showAtMarker(r.selected.marker,r.selected.index,r.selected.total)}async navigate(t,n){var s,a;if(!this._editor.hasModel())return;const r=this._editor.getModel(),o=this._getOrCreateModel(n?void 0:r.uri);if(o.move(t,r,this._editor.getPosition()),!!o.selected)if(o.selected.marker.resource.toString()!==r.uri.toString()){this._cleanUp();const l=await this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);l&&((s=aG.get(l))==null||s.close(),(a=aG.get(l))==null||a.navigate(t,n))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}},aG=cF,cF.ID="editor.contrib.markerController",cF);YP=aG=ILo([pce(1,PMn),pce(2,Fi),pce(3,Co),pce(4,$n)],YP);class _Oe extends Nn{constructor(t,n,r){super(r),this._next=t,this._multiFile=n}async run(t,n){var r;n.hasModel()&&await((r=YP.get(n))==null?void 0:r.navigate(this._next,this._multiFile))}}const sQ=class sQ extends _Oe{constructor(){super(!0,!1,{id:sQ.ID,label:sQ.LABEL,precondition:void 0,kbOpts:{kbExpr:Ze.focus,primary:578,weight:100},menuOpts:{menuId:fee.TitleMenu,title:sQ.LABEL.value,icon:Ra("marker-navigation-next",Jt.arrowDown,j(1016,"Icon for goto next marker.")),group:"navigation",order:1}})}};sQ.ID="editor.action.marker.next",sQ.LABEL=Et(1020,"Go to Next Problem (Error, Warning, Info)");let U1e=sQ;const aQ=class aQ extends _Oe{constructor(){super(!1,!1,{id:aQ.ID,label:aQ.LABEL,precondition:void 0,kbOpts:{kbExpr:Ze.focus,primary:1602,weight:100},menuOpts:{menuId:fee.TitleMenu,title:aQ.LABEL.value,icon:Ra("marker-navigation-previous",Jt.arrowUp,j(1017,"Icon for goto previous marker.")),group:"navigation",order:2}})}};aQ.ID="editor.action.marker.prev",aQ.LABEL=Et(1021,"Go to Previous Problem (Error, Warning, Info)");let iVe=aQ;class NLo extends _Oe{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:Et(1022,"Go to Next Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:Ze.focus,primary:66,weight:100},menuOpts:{menuId:Yn.MenubarGoMenu,title:j(1018,"Next &&Problem"),group:"6_problem_nav",order:1}})}}class ULo extends _Oe{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:Et(1023,"Go to Previous Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:Ze.focus,primary:1090,weight:100},menuOpts:{menuId:Yn.MenubarGoMenu,title:j(1019,"Previous &&Problem"),group:"6_problem_nav",order:2}})}}mo(YP.ID,YP,4);gn(U1e);gn(iVe);gn(NLo);gn(ULo);const MMn=new Ln("markersNavigationVisible",!1),jLo=$d.bindToContribution(YP.get);xn(new jLo({id:"closeMarkersNavigation",precondition:MMn,handler:e=>e.close(),kbOpts:{weight:150,kbExpr:Ze.focus,primary:9,secondary:[1033]}}));var WLo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},z9e=function(e,t){return function(n,r){t(n,r,e)}};const G2=ln;class RMn{constructor(t,n,r){this.owner=t,this.range=n,this.marker=r}isValidForHoverAnchor(t){return t.type===1&&this.range.startColumn<=t.range.startColumn&&this.range.endColumn>=t.range.endColumn}}const zCt={type:1,filter:{include:ja.QuickFix},triggerAction:Z1.QuickFixHover};let rVe=class{constructor(t,n,r,o){this._editor=t,this._markerDecorationsService=n,this._openerService=r,this._languageFeaturesService=o,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(t,n){if(!this._editor.hasModel()||t.type!==1&&!t.supportsMarkerHover)return[];const r=this._editor.getModel(),o=t.range;if(!r.isValidRange(t.range))return[];const s=o.startLineNumber,a=r.getLineMaxColumn(s),l=[];for(const d of n){const u=d.range.startLineNumber===s?d.range.startColumn:1,h=d.range.endLineNumber===s?d.range.endColumn:a,f=this._markerDecorationsService.getMarker(r.uri,d);if(!f)continue;const g=new De(t.range.startLineNumber,u,t.range.startLineNumber,h);l.push(new RMn(this,g,f))}return l}renderHoverParts(t,n){if(!n.length)return new jP([]);const r=[];n.forEach(a=>{const l=this._renderMarkerHover(a);t.fragment.appendChild(l.hoverElement),r.push(l)});const o=n.length===1?n[0]:n.sort((a,l)=>Bl.compare(a.marker.severity,l.marker.severity))[0],s=this._renderMarkerStatusbar(t,o);return new jP(r,s)}getAccessibleContent(t){return t.marker.message}_renderMarkerHover(t){const n=new Pt,r=G2("div.hover-row"),o=tn(r,G2("div.marker.hover-contents")),{source:s,message:a,code:l,relatedInformation:d}=t.marker;this._editor.applyFontInfo(o);const u=tn(o,G2("span"));if(u.style.whiteSpace="pre-wrap",u.innerText=a,s||l)if(l&&typeof l!="string"){const f=G2("span");if(s){const m=tn(f,G2("span"));m.innerText=s}const g=tn(f,G2("a.code-link"));g.setAttribute("href",l.target.toString(!0)),n.add(pt(g,"click",m=>{this._openerService.open(l.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()}));const k=tn(g,G2("span"));k.innerText=l.value;const A=tn(o,f);A.style.opacity="0.6",A.style.paddingLeft="6px"}else{const f=tn(o,G2("span"));f.style.opacity="0.6",f.style.paddingLeft="6px",f.innerText=s&&l?`${s}(${l})`:s||`(${l})`}if(Qf(d))for(const{message:f,resource:g,startLineNumber:k,startColumn:A}of d){const m=tn(o,G2("div"));m.style.marginTop="8px";const v=tn(m,G2("a"));v.innerText=`${g2(g)}(${k}, ${A}): `,v.style.cursor="pointer",n.add(pt(v,"click",b=>{if(b.stopPropagation(),b.preventDefault(),this._openerService){const O={selection:{startLineNumber:k,startColumn:A}};this._openerService.open(g,{fromUserGesture:!0,editorOptions:O}).catch(Yi)}}));const p=tn(m,G2("span"));p.innerText=f,this._editor.applyFontInfo(p)}return{hoverPart:t,hoverElement:r,dispose:()=>n.dispose()}}_renderMarkerStatusbar(t,n){const r=new Pt;if(n.marker.severity===Bl.Error||n.marker.severity===Bl.Warning||n.marker.severity===Bl.Info){const o=YP.get(this._editor);o&&t.statusBar.addAction({label:j(1139,"View Problem"),commandId:U1e.ID,run:()=>{t.hide(),o.showAtMarker(n.marker),this._editor.focus()}})}if(!this._editor.getOption(104)){const o=t.statusBar.append(G2("div"));this.recentMarkerCodeActionsInfo&&(k1e.makeKey(this.recentMarkerCodeActionsInfo.marker)===k1e.makeKey(n.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(o.textContent=j(1140,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?ct.None:z8(()=>o.textContent=j(1141,"Checking for quick fixes..."),200,r);o.textContent||(o.textContent=" ");const a=this.getCodeActions(n.marker);r.add(Gn(()=>a.cancel())),a.then(l=>{var h;if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:n.marker,hasCodeActions:l.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){l.dispose(),o.textContent=j(1142,"No quick fixes available");return}o.style.display="none";let d=!1;r.add(Gn(()=>{d||l.dispose()})),t.statusBar.addAction({label:j(1143,"Quick Fix..."),commandId:Lnt,run:f=>{d=!0;const g=UP.get(this._editor),k=ic(f);t.hide(),g==null||g.showCodeActions(zCt,l,{x:k.left,y:k.top,width:k.width,height:k.height})}});const u=l.validActions.find(f=>f.action.isAI);u&&t.statusBar.addAction({label:u.action.title,commandId:((h=u.action.command)==null?void 0:h.id)??"",iconClass:mi.asClassName(Jt.sparkle),run:()=>{const f=UP.get(this._editor);f==null||f.applyCodeAction(u,!1,!1,Q5.FromProblemsHover)}}),t.onContentsChanged()},Yi)}return r}getCodeActions(t){return zd(n=>NU(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new De(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn),zCt,nO.None,n))}};rVe=WLo([z9e(1,$et),z9e(2,B6),z9e(3,Zn)],rVe);var IMn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},dW=function(e,t){return function(n,r){t(n,r,e)}},oVe,sVe;let aVe=oVe=class extends ct{constructor(t,n,r,o,s,a,l){super();const d=n.hoverParts;this._renderedHoverParts=this._register(new lVe(t,r,d,o,s,a,l));const u=n.options,h=u.anchor,{showAtPosition:f,showAtSecondaryPosition:g}=oVe.computeHoverPositions(t,h.range,d);this.shouldAppearBeforeContent=d.some(k=>k.isBeforeContent),this.showAtPosition=f,this.showAtSecondaryPosition=g,this.initialMousePosX=h.initialMousePosX,this.initialMousePosY=h.initialMousePosY,this.shouldFocus=u.shouldFocus,this.source=u.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}get hoverPartsCount(){return this._renderedHoverParts.hoverPartsCount}focusHoverPartWithIndex(t){this._renderedHoverParts.focusHoverPartWithIndex(t)}async updateHoverVerbosityLevel(t,n,r){this._renderedHoverParts.updateHoverVerbosityLevel(t,n,r)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(t,n,r){let o=1;if(t.hasModel()){const h=t._getViewModel(),f=h.coordinatesConverter,g=f.convertModelRangeToViewRange(n),k=h.getLineMinColumn(g.startLineNumber),A=new tt(g.startLineNumber,k);o=f.convertViewPositionToModelPosition(A).column}const s=n.startLineNumber;let a=n.startColumn,l;for(const h of r){const f=h.range,g=f.startLineNumber===s,k=f.endLineNumber===s;if(g&&k){const m=f.startColumn,v=Math.min(a,m);a=Math.max(v,o)}h.forceShowAtRange&&(l=f)}let d,u;if(l){const h=l.getStartPosition();d=h,u=h}else d=n.getStartPosition(),u=new tt(s,a);return{showAtPosition:d,showAtSecondaryPosition:u}}};aVe=oVe=IMn([dW(4,Fo),dW(5,Lg),dW(6,z1)],aVe);class HLo{constructor(t,n){this._statusBar=n,t.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}}var dF;let lVe=(dF=class extends ct{constructor(t,n,r,o,s,a,l){super(),this._hoverService=a,this._clipboardService=l,this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=o,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(n,r,o,s,this._hoverService)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(t,r)),this._updateMarkdownAndColorParticipantInfo(n)}_createEditorDecorations(t,n){if(n.length===0)return ct.None;let r=n[0].range;for(const s of n){const a=s.range;r=De.plusRange(r,a)}const o=t.createDecorationsCollection();return o.set([{range:r,options:sVe._DECORATION_OPTIONS}]),Gn(()=>{o.clear()})}_renderParts(t,n,r,o,s){const a=new b1e(o,s),l={fragment:this._fragment,statusBar:a,...r},d=new Pt;d.add(a);for(const h of t){const f=this._renderHoverPartsForParticipant(n,h,l);d.add(f);for(const g of f.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:h,hoverPart:g.hoverPart,hoverElement:g.hoverElement})}const u=this._renderStatusBar(this._fragment,a);return u&&(d.add(u),this._renderedParts.push({type:"statusBar",hoverElement:u.hoverElement,actions:u.actions})),d}_renderHoverPartsForParticipant(t,n,r){const o=t.filter(a=>a.owner===n);return o.length>0?n.renderHoverParts(r,o):new jP([])}_renderStatusBar(t,n){if(n.hasContent)return new HLo(t,n)}_registerListenersOnRenderedParts(){const t=new Pt;return this._renderedParts.forEach((n,r)=>{const o=n.hoverElement;o.tabIndex=0,t.add(pt(o,cn.FOCUS_IN,s=>{s.stopPropagation(),this._focusedHoverPartIndex=r})),t.add(pt(o,cn.FOCUS_OUT,s=>{s.stopPropagation(),this._focusedHoverPartIndex=-1})),n.type==="hoverPart"&&n.hoverPart instanceof RMn&&t.add(new QHe(o,()=>n.participant.getAccessibleContent(n.hoverPart),this._clipboardService,this._hoverService))}),t}_updateMarkdownAndColorParticipantInfo(t){const n=t.find(r=>r instanceof lee&&!(r instanceof I1e));n&&(this._markdownHoverParticipant=n),this._colorHoverParticipant=t.find(r=>r instanceof w1e)}focusHoverPartWithIndex(t){t<0||t>=this._renderedParts.length||this._renderedParts[t].hoverElement.focus()}async updateHoverVerbosityLevel(t,n,r){if(!this._markdownHoverParticipant)return;let o;n>=0?o={start:n,endExclusive:n+1}:o=this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);for(let s=o.start;s=0?this.focusHoverPartWithIndex(n):this._context.focus()),this._context.onContentsChanged()}isColorPickerVisible(){var t;return((t=this._colorHoverParticipant)==null?void 0:t.isColorPickerVisible())??!1}_normalizedIndexToMarkdownHoverIndexRange(t,n){const r=this._renderedParts[n];if(!r||r.type!=="hoverPart"||!(r.participant===t))return;const s=this._renderedParts.findIndex(a=>a.type==="hoverPart"&&a.participant===t);if(s===-1)throw new Ai;return n-s}_findRangeOfMarkdownHoverParts(t){const n=this._renderedParts.slice(),r=n.findIndex(a=>a.type==="hoverPart"&&a.participant===t),o=n.reverse().findIndex(a=>a.type==="hoverPart"&&a.participant===t),s=o>=0?n.length-o:o;return{start:r,endExclusive:s+1}}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}get hoverPartsCount(){return this._renderedParts.length}},sVe=dF,dF._DECORATION_OPTIONS=Ki.register({description:"content-hover-highlight",className:"hoverHighlight"}),dF);lVe=sVe=IMn([dW(4,Fo),dW(5,Lg),dW(6,z1)],lVe);var VLo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},bce=function(e,t){return function(n,r){t(n,r,e)}};let cVe=class extends ct{constructor(t,n,r,o,s){super(),this._editor=t,this._instantiationService=n,this._keybindingService=r,this._hoverService=o,this._clipboardService=s,this._currentResult=null,this._renderedContentHover=this._register(new is),this._onContentsChanged=this._register(new it),this.onContentsChanged=this._onContentsChanged.event,this._contentHoverWidget=this._register(this._instantiationService.createInstance(xHe,this._editor)),this._participants=this._initializeHoverParticipants(),this._hoverOperation=this._register(new yPn(this._editor,new p1e(this._editor,this._participants))),this._registerListeners()}_initializeHoverParticipants(){const t=[];for(const n of XM.getAll()){const r=this._instantiationService.createInstance(n,this._editor);t.push(r)}return t.sort((n,r)=>n.hoverOrdinal-r.hoverOrdinal),this._register(this._contentHoverWidget.onDidResize(()=>{this._participants.forEach(n=>{var r;return(r=n.handleResize)==null?void 0:r.call(n)})})),this._register(this._contentHoverWidget.onDidScroll(n=>{this._participants.forEach(r=>{var o;return(o=r.handleScroll)==null?void 0:o.call(r,n)})})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._participants.forEach(n=>{var r;return(r=n.handleContentsChanged)==null?void 0:r.call(n)})})),t}_registerListeners(){this._register(this._hoverOperation.onResult(n=>{const r=n.hasLoadingMessage?this._addLoadingMessage(n):n.value;this._withResult(new SPn(r,n.isComplete,n.options))}));const t=this._contentHoverWidget.getDomNode();this._register(Sc(t,"keydown",n=>{n.equals(9)&&this.hide()})),this._register(Sc(t,"mouseleave",n=>{this._onMouseLeave(n)})),this._register(Kl.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._onContentsChanged.fire()}))}_startShowingOrUpdateHover(t,n,r,o,s){if(!(this._contentHoverWidget.position&&this._currentResult))return t?(this._startHoverOperationIfNecessary(t,n,r,o,!1),!0):!1;const l=this._editor.getOption(69).sticky,d=s&&this._contentHoverWidget.isMouseGettingCloser(s.event.posx,s.event.posy);return l&&d?(t&&this._startHoverOperationIfNecessary(t,n,r,o,!0),!0):t?this._currentResult&&this._currentResult.options.anchor.equals(t)?!0:this._currentResult&&t.canAdoptVisibleHover(this._currentResult.options.anchor,this._contentHoverWidget.position)?(this._currentResult&&this._setCurrentResult(this._currentResult.filter(t)),this._startHoverOperationIfNecessary(t,n,r,o,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(t,n,r,o,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(t,n,r,o,s){if(this._hoverOperation.options&&this._hoverOperation.options.anchor.equals(t))return;this._hoverOperation.cancel();const l={anchor:t,source:r,shouldFocus:o,insistOnKeepingHoverVisible:s};this._hoverOperation.start(n,l)}_setCurrentResult(t){let n=t;if(this._currentResult===n)return;n&&n.hoverParts.length===0&&(n=null),this._currentResult=n,this._currentResult?this._showHover(this._currentResult):this._hideHover()}_addLoadingMessage(t){for(const n of this._participants){if(!n.createLoadingMessage)continue;const r=n.createLoadingMessage(t.options.anchor);if(r)return t.value.slice(0).concat([r])}return t.value}_withResult(t){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(t),!t.isComplete)return;const o=t.hoverParts.length===0,s=t.options.insistOnKeepingHoverVisible;o&&s||this._setCurrentResult(t)}_showHover(t){const n=this._getHoverContext();this._renderedContentHover.value=new aVe(this._editor,t,this._participants,n,this._keybindingService,this._hoverService,this._clipboardService),this._renderedContentHover.value.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover.value):this._renderedContentHover.clear()}_hideHover(){this._contentHoverWidget.hide(),this._participants.forEach(t=>{var n;return(n=t.handleHide)==null?void 0:n.call(t)})}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._contentHoverWidget.handleContentsChanged()},setMinimumDimensions:s=>{this._contentHoverWidget.setMinimumDimensions(s)},focus:()=>this.focus()}}showsOrWillShow(t){if(this._contentHoverWidget.isResizing)return!0;const r=this._findHoverAnchorCandidates(t);if(!(r.length>0))return this._startShowingOrUpdateHover(null,0,0,!1,t);const s=r[0];return this._startShowingOrUpdateHover(s,0,0,!1,t)}_findHoverAnchorCandidates(t){const n=[];for(const o of this._participants){if(!o.suggestHoverAnchor)continue;const s=o.suggestHoverAnchor(t);s&&n.push(s)}const r=t.target;switch(r.type){case 6:{n.push(new P9e(0,r.range,t.event.posx,t.event.posy));break}case 7:{const o=this._editor.getOption(59).typicalHalfwidthCharacterWidth/2;if(!(!r.detail.isAfterLines&&typeof r.detail.horizontalDistanceToText=="number"&&r.detail.horizontalDistanceToTexts.priority-o.priority),n}_onMouseLeave(t){const n=this._editor.getDomNode();(!n||!UOe(n,t.x,t.y))&&this.hide()}startShowingAtRange(t,n,r,o){this._startShowingOrUpdateHover(new P9e(0,t,void 0,void 0),n,r,o,null)}async updateHoverVerbosityLevel(t,n,r){var o;(o=this._renderedContentHover.value)==null||o.updateHoverVerbosityLevel(t,n,r)}focusedHoverPartIndex(){var t;return((t=this._renderedContentHover.value)==null?void 0:t.focusedHoverPartIndex)??-1}containsNode(t){return t?this._contentHoverWidget.getDomNode().contains(t):!1}focus(){var n;if(((n=this._renderedContentHover.value)==null?void 0:n.hoverPartsCount)===1){this.focusHoverPartWithIndex(0);return}this._contentHoverWidget.focus()}focusHoverPartWithIndex(t){var n;(n=this._renderedContentHover.value)==null||n.focusHoverPartWithIndex(t)}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._hoverOperation.cancel(),this._setCurrentResult(null)}getDomNode(){return this._contentHoverWidget.getDomNode()}get isColorPickerVisible(){var t;return((t=this._renderedContentHover.value)==null?void 0:t.isColorPickerVisible())??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}};cVe=VLo([bce(1,$n),bce(2,Fo),bce(3,Lg),bce(4,z1)],cVe);function NMn(e){var n;const t=e.target;return!!t&&t.type===6&&((n=t.detail.injectedText)==null?void 0:n.options.attachedData)===vPn}var zLo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Z9e=function(e,t){return function(n,r){t(n,r,e)}},dVe,uF;let jA=(uF=class extends ct{constructor(t,n,r,o){super(),this._editor=t,this._instantiationService=r,this._keybindingService=o,this._onHoverContentsChanged=this._register(new it),this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new Pt,this._isMouseDown=!1,this._ignoreMouseEvents=!1,this._reactToEditorMouseMoveRunner=this._register(new Ss(()=>{this._mouseMoveEvent&&this._reactToEditorMouseMove(this._mouseMoveEvent)},0)),this._register(n.onDidShowContextMenu(()=>{this.hideContentHover(),this._ignoreMouseEvents=!0})),this._register(n.onDidHideContextMenu(()=>{this._ignoreMouseEvents=!1})),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}static get(t){return t.getContribution(dVe.ID)}_hookListeners(){const t=this._editor.getOption(69);this._hoverSettings={enabled:t.enabled,sticky:t.sticky,hidingDelay:t.hidingDelay},t.enabled||this._cancelSchedulerAndHide(),this._listenersStore.add(this._editor.onMouseDown(n=>this._onEditorMouseDown(n))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(n=>this._onEditorMouseMove(n))),this._listenersStore.add(this._editor.onKeyDown(n=>this._onKeyDown(n))),this._listenersStore.add(this._editor.onMouseLeave(n=>this._onEditorMouseLeave(n))),this._listenersStore.add(this._editor.onDidChangeModel(()=>this._cancelSchedulerAndHide())),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(n=>this._onEditorScrollChanged(n)))}_unhookListeners(){this._listenersStore.clear()}_cancelSchedulerAndHide(){this._cancelScheduler(),this.hideContentHover()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(t){this._ignoreMouseEvents||(t.scrollTopChanged||t.scrollLeftChanged)&&this.hideContentHover()}_onEditorMouseDown(t){this._ignoreMouseEvents||(this._isMouseDown=!0,this._shouldKeepHoverWidgetVisible(t))||this.hideContentHover()}_shouldKeepHoverWidgetVisible(t){return this._isMouseOnContentHoverWidget(t)||this._isContentWidgetResizing()||NMn(t)}_isMouseOnContentHoverWidget(t){return this._contentWidget?UOe(this._contentWidget.getDomNode(),t.event.posx,t.event.posy):!1}_onEditorMouseUp(){this._ignoreMouseEvents||(this._isMouseDown=!1)}_onEditorMouseLeave(t){this._ignoreMouseEvents||this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldKeepHoverWidgetVisible(t))||this.hideContentHover()}_shouldKeepCurrentHover(t){const n=this._contentWidget;if(!n)return!1;const r=this._hoverSettings.sticky,o=(h,f)=>{const g=this._isMouseOnContentHoverWidget(h);return f&&g},s=h=>{const f=n.isColorPickerVisible,g=this._isMouseOnContentHoverWidget(h),k=f&&g,A=f&&this._isMouseDown;return k||A},a=(h,f)=>{var k;const g=h.event.browserEvent.view;return g?f&&n.containsNode(g.document.activeElement)&&!((k=g.getSelection())!=null&&k.isCollapsed):!1},l=n.isFocused,d=n.isResizing,u=this._hoverSettings.sticky&&n.isVisibleFromKeyboard;return this.shouldKeepOpenOnEditorMouseMoveOrLeave||l||d||u||o(t,r)||s(t)||a(t,r)}_onEditorMouseMove(t){if(this._ignoreMouseEvents)return;if(this._mouseMoveEvent=t,this._shouldKeepCurrentHover(t)){this._reactToEditorMouseMoveRunner.cancel();return}if(this._shouldRescheduleHoverComputation()){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay);return}this._reactToEditorMouseMove(t)}_shouldRescheduleHoverComputation(){var r;const t=this._hoverSettings.hidingDelay;return(((r=this._contentWidget)==null?void 0:r.isVisible)??!1)&&this._hoverSettings.sticky&&t>0}_reactToEditorMouseMove(t){this._hoverSettings.enabled&&this._getOrCreateContentWidget().showsOrWillShow(t)||this.hideContentHover()}_onKeyDown(t){if(this._ignoreMouseEvents||!this._contentWidget)return;const n=this._isPotentialKeyboardShortcut(t),r=this._isModifierKeyPressed(t);n||r||this._contentWidget.isFocused&&t.keyCode===2||this.hideContentHover()}_isPotentialKeyboardShortcut(t){if(!this._editor.hasModel()||!this._contentWidget)return!1;const n=this._keybindingService.softDispatch(t,this._editor.getDomNode()),r=n.kind===1,o=n.kind===2&&(n.commandId===pPn||n.commandId===IOe||n.commandId===NOe)&&this._contentWidget.isVisible;return r||o}_isModifierKeyPressed(t){return t.keyCode===5||t.keyCode===6||t.keyCode===57||t.keyCode===4}hideContentHover(){var t;MV.dropDownVisible||(t=this._contentWidget)==null||t.hide()}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(cVe,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}showContentHover(t,n,r,o){this._getOrCreateContentWidget().startShowingAtRange(t,n,r,o)}_isContentWidgetResizing(){var t;return((t=this._contentWidget)==null?void 0:t.widget.isResizing)||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}updateHoverVerbosityLevel(t,n,r){this._getOrCreateContentWidget().updateHoverVerbosityLevel(t,n,r)}focus(){var t;(t=this._contentWidget)==null||t.focus()}scrollUp(){var t;(t=this._contentWidget)==null||t.scrollUp()}scrollDown(){var t;(t=this._contentWidget)==null||t.scrollDown()}scrollLeft(){var t;(t=this._contentWidget)==null||t.scrollLeft()}scrollRight(){var t;(t=this._contentWidget)==null||t.scrollRight()}pageUp(){var t;(t=this._contentWidget)==null||t.pageUp()}pageDown(){var t;(t=this._contentWidget)==null||t.pageDown()}goToTop(){var t;(t=this._contentWidget)==null||t.goToTop()}goToBottom(){var t;(t=this._contentWidget)==null||t.goToBottom()}get isColorPickerVisible(){var t;return(t=this._contentWidget)==null?void 0:t.isColorPickerVisible}get isHoverVisible(){var t;return(t=this._contentWidget)==null?void 0:t.isVisible}dispose(){var t;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(t=this._contentWidget)==null||t.dispose()}},dVe=uF,uF.ID="editor.contrib.contentHover",uF);jA=dVe=zLo([Z9e(1,Ek),Z9e(2,$n),Z9e(3,Fo)],jA);const $at=class $at extends ct{constructor(t){super(),this._editor=t,this._register(t.onMouseDown(n=>this.onMouseDown(n)))}dispose(){super.dispose()}onMouseDown(t){const n=this._editor.getOption(168);if(n!=="click"&&n!=="clickAndHover"||!NMn(t))return;const r=this._editor.getContribution(jA.ID);if(!r||r.isColorPickerVisible)return;const o=t.target.range;if(!o)return;const s=new De(o.startLineNumber,o.startColumn+1,o.endLineNumber,o.endColumn+1);r.showContentHover(s,1,1,!1)}};$at.ID="editor.contrib.colorContribution";let j1e=$at;var ZLo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},YLo=function(e,t){return function(n,r){t(n,r,e)}};class ait{constructor(t,n,r,o){this.owner=t,this.range=n,this.model=r,this.provider=o}static fromBaseColor(t,n){return new ait(t,n.range,n.model,n.provider)}}class XLo extends ct{constructor(t,n,r,o){super();const s=t.getModel(),a=r.model;this.color=r.model.color,this.colorPicker=this._register(new XPn(n.fragment,a,t.getOption(163),o,"standalone")),this._register(a.onColorFlushed(l=>{this.color=l})),this._register(a.onDidChangeColor(l=>{cee(s,a,l,r.range,r)})),this._register(t.onDidChangeModelContent(l=>{n.hide(),t.focus()})),cee(s,a,this.color,r.range,r)}}let uVe=class{constructor(t,n){this._editor=t,this._themeService=n}async createColorHover(t,n,r){if(!this._editor.hasModel()||!PV.get(this._editor))return null;const s=await gPn(r,this._editor.getModel(),Fr.None);let a=null,l=null;for(const g of s){const k=g.colorInfo;De.containsRange(k.range,t.range)&&(a=k,l=g.provider)}const d=a??t,u=l??n,h=!!a;return{colorHover:ait.fromBaseColor(this,await qPn(this._editor.getModel(),d,u)),foundInEditor:h}}async updateEditorModel(t){if(!this._editor.hasModel())return;const n=t.model;let r=new De(t.range.startLineNumber,t.range.startColumn,t.range.endLineNumber,t.range.endColumn);this._color&&(await cee(this._editor.getModel(),n,this._color,r,t),r=GPn(this._editor,r,n))}renderHoverParts(t,n){if(!(n.length===0||!this._editor.hasModel()))return this._setMinimumDimensions(t),this._renderedParts=new XLo(this._editor,t,n[0],this._themeService),this._renderedParts}_setMinimumDimensions(t){const n=this._editor.getOption(75)+8;t.setMinimumDimensions(new ds(302,n))}get _color(){var t;return(t=this._renderedParts)==null?void 0:t.color}};uVe=ZLo([YLo(1,Il)],uVe);var qLo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},XX=function(e,t){return function(n,r){t(n,r,e)}},hVe;class GLo{constructor(t,n){this.value=t,this.foundInEditor=n}}const ZCt=8,KLo=22;var hF;let AVe=(hF=class extends ct{constructor(t,n,r,o,s,a,l,d){var g;super(),this._editor=t,this._standaloneColorPickerVisible=n,this._standaloneColorPickerFocused=r,this._keybindingService=s,this._languageFeaturesService=a,this._editorWorkerService=l,this._hoverService=d,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new it),this.onResult=this._onResult.event,this._renderedHoverParts=this._register(new is),this._renderedStatusBar=this._register(new is),this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=o.createInstance(uVe,this._editor),this._position=(g=this._editor._getViewModel())==null?void 0:g.getPrimaryCursorState().modelState.position;const u=this._editor.getSelection(),h=u?{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},f=this._register(f2(this._body));this._register(f.onDidBlur(k=>{this.hide()})),this._register(f.onDidFocus(k=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(k=>{var m;const A=(m=k.target.element)==null?void 0:m.classList;A&&A.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(k=>{this._render(k.value,k.foundInEditor)})),this._start(h),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return hVe.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const t=this._editor.getOption(69).above;return{position:this._position,secondaryPosition:this._position,preference:t?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(t){const n=await this._computeAsync(t);n&&this._onResult.fire(new GLo(n.result,n.foundInEditor))}async _computeAsync(t){if(!this._editor.hasModel())return null;const n={range:t,color:{red:0,green:0,blue:0,alpha:1}},r=await this._standaloneColorPickerParticipant.createColorHover(n,new oee(this._editorWorkerService),this._languageFeaturesService.colorProvider);return r?{result:r.colorHover,foundInEditor:r.foundInEditor}:null}_render(t,n){const r=document.createDocumentFragment();this._renderedStatusBar.value=this._register(new b1e(this._keybindingService,this._hoverService));const o={fragment:r,statusBar:this._renderedStatusBar.value,onContentsChanged:()=>{},setMinimumDimensions:()=>{},hide:()=>this.hide(),focus:()=>this.focus()};if(this._colorHover=t,this._renderedHoverParts.value=this._standaloneColorPickerParticipant.renderHoverParts(o,[t]),!this._renderedHoverParts.value){this._renderedStatusBar.clear(),this._renderedHoverParts.clear();return}const s=this._renderedHoverParts.value.colorPicker;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(r),s.layout();const a=s.body,l=a.saturationBox.domNode.clientWidth,d=a.domNode.clientWidth-l-KLo-ZCt,u=s.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const h=s.header,f=h.pickedColorNode;f.style.width=l+ZCt+"px";const g=h.originalColorNode;g.style.width=d+"px";const k=s.header.closeButton;k==null||k.onClicked(()=>{this.hide()}),n&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(t.range)),this._editor.layoutContentWidget(this)}},hVe=hF,hF.ID="editor.contrib.standaloneColorPickerWidget",hF);AVe=hVe=qLo([XX(3,$n),XX(4,Fo),XX(5,Zn),XX(6,Bm),XX(7,Lg)],AVe);var JLo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},YCt=function(e,t){return function(n,r){t(n,r,e)}},fVe,AF;let XP=(AF=class extends ct{constructor(t,n,r){super(),this._editor=t,this._instantiationService=r,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=Ze.standaloneColorPickerVisible.bindTo(n),this._standaloneColorPickerFocused=Ze.standaloneColorPickerFocused.bindTo(n)}showOrFocus(){var t;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(t=this._standaloneColorPickerWidget)==null||t.focus():this._standaloneColorPickerWidget=this._instantiationService.createInstance(AVe,this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused))}hide(){var t;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(t=this._standaloneColorPickerWidget)==null||t.hide(),this._editor.focus()}insertColor(){var t;(t=this._standaloneColorPickerWidget)==null||t.updateEditor(),this.hide()}static get(t){return t.getContribution(fVe.ID)}},fVe=AF,AF.ID="editor.contrib.standaloneColorPickerController",AF);XP=fVe=JLo([YCt(1,Fi),YCt(2,$n)],XP);class _Lo extends T4{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...Et(889,"Show or Focus Standalone Color Picker"),mnemonicTitle:j(888,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:Yn.CommandPalette}],metadata:{description:Et(890,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(t,n){var r;(r=XP.get(n))==null||r.showOrFocus()}}class $Lo extends Nn{constructor(){super({id:"editor.action.hideColorPicker",label:Et(891,"Hide the Color Picker"),precondition:Ze.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100},metadata:{description:Et(892,"Hide the standalone color picker.")}})}run(t,n){var r;(r=XP.get(n))==null||r.hide()}}class e8o extends Nn{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:Et(893,"Insert Color with Standalone Color Picker"),precondition:Ze.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100},metadata:{description:Et(894,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(t,n){var r;(r=XP.get(n))==null||r.insertColor()}}gn($Lo);gn(e8o);ws(_Lo);mo(j1e.ID,j1e,2);mo(XP.ID,XP,1);mo(PV.ID,PV,1);SZ(bHe);XM.register(w1e);ho.registerCommand("_executeDocumentColorProvider",function(e,...t){const[n]=t;if(!(n instanceof pi))throw _v();const{model:r,colorProviderRegistry:o,defaultColorDecoratorsEnablement:s}=kPn(e,n);return Ent(new Ayo,o,r,Fr.None,s)});ho.registerCommand("_executeColorPresentationProvider",function(e,...t){const[n,r]=t;if(!r)return;const{uri:o,range:s}=r;if(!(o instanceof pi)||!Array.isArray(n)||n.length!==4||!De.isIRange(s))throw _v();const{model:a,colorProviderRegistry:l,defaultColorDecoratorsEnablement:d}=kPn(e,o),[u,h,f,g]=n;return Ent(new fyo({range:s,color:{red:u,green:h,blue:f,alpha:g}}),l,a,Fr.None,d)});class F5{constructor(t,n,r){this.languageConfigurationService=r,this._selection=t,this._insertSpace=n,this._usedEndToken=null}static _haystackHasNeedleAtOffset(t,n,r){if(r<0)return!1;const o=n.length,s=t.length;if(r+o>s)return!1;for(let a=0;a=65&&l<=90&&l+32===d)&&!(d>=65&&d<=90&&d+32===l))return!1}return!0}_createOperationsForBlockComment(t,n,r,o,s,a){const l=t.startLineNumber,d=t.startColumn,u=t.endLineNumber,h=t.endColumn,f=s.getLineContent(l),g=s.getLineContent(u);let k=f.lastIndexOf(n,d-1+n.length),A=g.indexOf(r,h-1-r.length);if(k!==-1&&A!==-1)if(l===u)f.substring(k+n.length,A).indexOf(r)>=0&&(k=-1,A=-1);else{const v=f.substring(k+n.length),p=g.substring(0,A);(v.indexOf(r)>=0||p.indexOf(r)>=0)&&(k=-1,A=-1)}let m;k!==-1&&A!==-1?(o&&k+n.length0&&g.charCodeAt(A-1)===32&&(r=" "+r,A-=1),m=F5._createRemoveBlockCommentOperations(new De(l,k+n.length+1,u,A+1),n,r)):(m=F5._createAddBlockCommentOperations(t,n,r,this._insertSpace),this._usedEndToken=m.length===1?r:null);for(const v of m)a.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(t,n,r){const o=[];return De.isEmpty(t)?o.push(Jl.delete(new De(t.startLineNumber,t.startColumn-n.length,t.endLineNumber,t.endColumn+r.length))):(o.push(Jl.delete(new De(t.startLineNumber,t.startColumn-n.length,t.startLineNumber,t.startColumn))),o.push(Jl.delete(new De(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn+r.length)))),o}static _createAddBlockCommentOperations(t,n,r,o){const s=[];return De.isEmpty(t)?s.push(Jl.replace(new De(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn),n+" "+r)):(s.push(Jl.insert(new tt(t.startLineNumber,t.startColumn),n+(o?" ":""))),s.push(Jl.insert(new tt(t.endLineNumber,t.endColumn),(o?" ":"")+r))),s}getEditOperations(t,n){const r=this._selection.startLineNumber,o=this._selection.startColumn;t.tokenization.tokenizeIfCheap(r);const s=t.getLanguageIdAtPosition(r,o),a=this.languageConfigurationService.getLanguageConfiguration(s).comments;!a||!a.blockCommentStartToken||!a.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,a.blockCommentStartToken,a.blockCommentEndToken,this._insertSpace,t,n)}computeCursorState(t,n){const r=n.getInverseEditOperations();if(r.length===2){const o=r[0],s=r[1];return new Rn(o.range.endLineNumber,o.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const o=r[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new Rn(o.endLineNumber,o.endColumn+s,o.endLineNumber,o.endColumn+s)}}}class _x{constructor(t,n,r,o,s,a,l){this.languageConfigurationService=t,this._selection=n,this._indentSize=r,this._type=o,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=a,this._ignoreFirstLine=l||!1}static _gatherPreflightCommentStrings(t,n,r,o){t.tokenization.tokenizeIfCheap(n);const s=t.getLanguageIdAtPosition(n,1),a=o.getLanguageConfiguration(s).comments,l=a?a.lineCommentToken:null;if(!l)return null;const d=[];for(let u=0,h=r-n+1;us?n[d].commentStrOffset=a-1:n[d].commentStrOffset=a}}}class lit extends Nn{constructor(t,n){super(n),this._type=t}run(t,n){const r=t.get(bl);if(!n.hasModel())return;const o=n.getModel(),s=[],a=o.getOptions(),l=n.getOption(29),d=n.getSelections().map((h,f)=>({selection:h,index:f,ignoreFirstLine:!1}));d.sort((h,f)=>De.compareRangesUsingStarts(h.selection,f.selection));let u=d[0];for(let h=1;h=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},M7=function(e,t){return function(n,r){t(n,r,e)}},gVe,fF;let gee=(fF=class{static get(t){return t.getContribution(gVe.ID)}constructor(t,n,r,o,s,a,l,d){this._contextMenuService=n,this._contextViewService=r,this._contextKeyService=o,this._keybindingService=s,this._menuService=a,this._configurationService=l,this._workspaceContextService=d,this._toDispose=new Pt,this._contextMenuIsBeingShownCount=0,this._editor=t,this._toDispose.add(this._editor.onContextMenu(u=>this._onContextMenu(u))),this._toDispose.add(this._editor.onMouseWheel(u=>{if(this._contextMenuIsBeingShownCount>0){const h=this._contextViewService.getContextViewElement(),f=u.srcElement;f.shadowRoot&&RT(h)===f.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(u=>{this._editor.getOption(30)&&u.keyCode===58&&(u.preventDefault(),u.stopPropagation(),this.showContextMenu())}))}_onContextMenu(t){if(!this._editor.hasModel())return;if(!this._editor.getOption(30)){this._editor.focus(),t.target.position&&!this._editor.getSelection().containsPosition(t.target.position)&&this._editor.setPosition(t.target.position);return}if(t.target.type===12||t.target.type===6&&t.target.detail.injectedText)return;if(t.event.preventDefault(),t.event.stopPropagation(),t.target.type===11)return this._showScrollbarContextMenu(t.event);if(t.target.type!==6&&t.target.type!==7&&t.target.type!==1)return;if(this._editor.focus(),t.target.position){let r=!1;for(const o of this._editor.getSelections())if(o.containsPosition(t.target.position)){r=!0;break}r||this._editor.setPosition(t.target.position)}let n=null;t.target.type!==1&&(n=t.event),this.showContextMenu(n)}showContextMenu(t){if(!this._editor.getOption(30)||!this._editor.hasModel())return;const n=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);n.length>0&&this._doShowContextMenu(n,t)}_getMenuActions(t,n){const r=[],o=this._menuService.getMenuActions(n,this._contextKeyService,{arg:t.uri});for(const s of o){const[,a]=s;let l=0;for(const d of a)if(d instanceof xB){const u=this._getMenuActions(t,d.item.submenu);u.length>0&&(r.push(new mV(d.id,d.label,u)),l++)}else r.push(d),l++;l&&r.push(new Ld)}return r.length&&r.pop(),r}_doShowContextMenu(t,n=null){if(!this._editor.hasModel())return;let r=n;if(!r){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=ic(this._editor.getDomNode()),l=a.left+s.left,d=a.top+s.top+s.height;r={x:l,y:d}}const o=this._editor.getOption(144)&&!h2;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>r,getActions:()=>t,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new QV(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new QV(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--}})}_showScrollbarContextMenu(t){if(!this._editor.hasModel()||uwo(this._workspaceContextService.getWorkspace()))return;const n=this._editor.getOption(81);let r=0;const o=u=>({id:`menu-action-${++r}`,label:u.label,tooltip:"",class:void 0,enabled:typeof u.enabled>"u"?!0:u.enabled,checked:u.checked,run:u.run}),s=(u,h)=>new mV(`menu-action-${++r}`,u,h,void 0),a=(u,h,f,g,k)=>{if(!h)return o({label:u,enabled:h,run:()=>{}});const A=v=>()=>{this._configurationService.updateValue(f,v)},m=[];for(const v of k)m.push(o({label:v.label,checked:g===v.value,run:A(v.value)}));return s(u,m)},l=[];l.push(o({label:j(901,"Minimap"),checked:n.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!n.enabled)}})),l.push(new Ld),l.push(o({label:j(902,"Render Characters"),enabled:n.enabled,checked:n.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!n.renderCharacters)}})),l.push(a(j(903,"Vertical size"),n.enabled,"editor.minimap.size",n.size,[{label:j(904,"Proportional"),value:"proportional"},{label:j(905,"Fill"),value:"fill"},{label:j(906,"Fit"),value:"fit"}])),l.push(a(j(907,"Slider"),n.enabled,"editor.minimap.showSlider",n.showSlider,[{label:j(908,"Mouse Over"),value:"mouseover"},{label:j(909,"Always"),value:"always"}]));const d=this._editor.getOption(144)&&!h2;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:d?this._editor.getDomNode():void 0,getAnchor:()=>t,getActions:()=>l,onHide:u=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(t){return this._keybindingService.lookupKeybinding(t.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}},gVe=fF,fF.ID="editor.contrib.contextmenu",fF);gee=gVe=o8o([M7(1,Ek),M7(2,Q6),M7(3,Fi),M7(4,Fo),M7(5,y2),M7(6,cr),M7(7,n6)],gee);class s8o extends Nn{constructor(){super({id:"editor.action.showContextMenu",label:Et(910,"Show Editor Context Menu"),precondition:void 0,kbOpts:{kbExpr:Ze.textInputFocus,primary:1092,weight:100}})}run(t,n){var r;(r=gee.get(n))==null||r.showContextMenu()}}mo(gee.ID,gee,2);gn(s8o);class Y9e{constructor(t){this.selections=t}equals(t){const n=this.selections.length,r=t.selections.length;if(n!==r)return!1;for(let o=0;o{this._undoStack=[],this._redoStack=[]})),this._register(t.onDidChangeModelContent(n=>{this._undoStack=[],this._redoStack=[]})),this._register(t.onDidChangeCursorSelection(n=>{if(this._isCursorUndoRedo||!n.oldSelections||n.oldModelVersionId!==n.modelVersionId)return;const r=new Y9e(n.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(r)||(this._undoStack.push(new X9e(r,t.getScrollTop(),t.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new X9e(new Y9e(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new X9e(new Y9e(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(t){this._isCursorUndoRedo=!0,this._editor.setSelections(t.cursorState.selections),this._editor.setScrollPosition({scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),this._isCursorUndoRedo=!1}};y2e.ID="editor.contrib.cursorUndoRedoController";let UV=y2e;class a8o extends Nn{constructor(){super({id:"cursorUndo",label:Et(911,"Cursor Undo"),precondition:void 0,kbOpts:{kbExpr:Ze.textInputFocus,primary:2099,weight:100}})}run(t,n,r){var o;(o=UV.get(n))==null||o.cursorUndo()}}class l8o extends Nn{constructor(){super({id:"cursorRedo",label:Et(912,"Cursor Redo"),precondition:void 0})}run(t,n,r){var o;(o=UV.get(n))==null||o.cursorRedo()}}mo(UV.ID,UV,0);gn(a8o);gn(l8o);class c8o{constructor(t,n,r){this.selection=t,this.targetPosition=n,this.copy=r,this.targetSelection=null}getEditOperations(t,n){const r=t.getValueInRange(this.selection);if(this.copy||n.addEditOperation(this.selection,null),n.addEditOperation(new De(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),r),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new Rn(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new Rn(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(n))),this._register(this._editor.onMouseUp(n=>this._onEditorMouseUp(n))),this._register(this._editor.onMouseDrag(n=>this._onEditorMouseDrag(n))),this._register(this._editor.onMouseDrop(n=>this._onEditorMouseDrop(n))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(n=>this.onEditorKeyDown(n))),this._register(this._editor.onKeyUp(n=>this.onEditorKeyUp(n))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(t){!this._editor.getOption(42)||this._editor.getOption(28)||(qI(t)&&(this._modifierPressed=!0),this._mouseDown&&qI(t)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(t){!this._editor.getOption(42)||this._editor.getOption(28)||(qI(t)&&(this._modifierPressed=!1),this._mouseDown&&t.keyCode===BS.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(t){this._mouseDown=!0}_onEditorMouseUp(t){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(t){const n=t.target;if(this._dragSelection===null){const o=(this._editor.getSelections()||[]).filter(s=>n.position&&s.containsPosition(n.position));if(o.length===1)this._dragSelection=o[0];else return}qI(t.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),n.position&&(this._dragSelection.containsPosition(n.position)?this._removeDecoration():this.showAt(n.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(t){if(t.target&&(this._hitContent(t.target)||this._hitMargin(t.target))&&t.target.position){const n=new tt(t.target.position.lineNumber,t.target.position.column);if(this._dragSelection===null){let r=null;if(t.event.shiftKey){const o=this._editor.getSelection();if(o){const{selectionStartLineNumber:s,selectionStartColumn:a}=o;r=[new Rn(s,a,n.lineNumber,n.column)]}}else r=(this._editor.getSelections()||[]).map(o=>o.containsPosition(n)?new Rn(n.lineNumber,n.column,n.lineNumber,n.column):o);this._editor.setSelections(r||[],"mouse",3)}else(!this._dragSelection.containsPosition(n)||(qI(t.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(n)||this._dragSelection.getStartPosition().equals(n)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(BS.ID,new c8o(this._dragSelection,n,qI(t.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(t){this._dndDecorationIds.set([{range:new De(t.lineNumber,t.column,t.lineNumber,t.column),options:BS._DECORATION_OPTIONS}]),this._editor.revealPosition(t,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(t){return t.type===6||t.type===7}_hitMargin(t){return t.type===2||t.type===3||t.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}};BS.ID="editor.contrib.dragAndDrop",BS.TRIGGER_KEY_VALUE=Pr?6:5,BS._DECORATION_OPTIONS=Ki.register({description:"dnd-target",className:"dnd-target"});let W1e=BS;mo(W1e.ID,W1e,2);const d8o="editor.action.pasteAs";mo(i6.ID,i6,0);SZ(oHe);xn(new class extends $d{constructor(){super({id:ePn,precondition:Cnt,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t){var n;return(n=i6.get(t))==null?void 0:n.changePasteType()}});xn(new class extends $d{constructor(){super({id:"editor.hidePasteWidget",precondition:Cnt,kbOpts:{weight:100,primary:9}})}runEditorCommand(e,t){var n;(n=i6.get(t))==null||n.clearWidgets()}});var gF;gn((gF=class extends Nn{constructor(){super({id:d8o,label:Et(915,"Paste As..."),precondition:Ze.writable,metadata:{description:"Paste as",args:[{name:"args",schema:gF.argsSchema}]},canTriggerInlineEdits:!0})}run(t,n,r){var s;let o;return r&&("kind"in r?o={only:new Fl(r.kind)}:"preferences"in r&&(o={preferences:r.preferences.map(a=>new Fl(a))})),(s=i6.get(n))==null?void 0:s.pasteAs(o)}},gF.argsSchema={oneOf:[{type:"object",required:["kind"],properties:{kind:{type:"string",description:j(913,`The kind of the paste edit to try pasting with. If there are multiple edits for this kind, the editor will show a picker. If there are no edits of this kind, the editor will show an error message.`)}}},{type:"object",required:["preferences"],properties:{preferences:{type:"array",description:j(914,`List of preferred paste edit kind to try applying. The first edit matching the preferences will be applied.`),items:{type:"string"}}}}]},gF));gn(class extends Nn{constructor(){super({id:"editor.action.pasteAsText",label:Et(916,"Paste as Text"),precondition:Ze.writable,canTriggerInlineEdits:!0})}run(e,t){var n;return(n=i6.get(t))==null?void 0:n.pasteAs({providerId:PP.id})}});class u8o{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(t){if(t&&this._dragOperations.has(t)){const n=this._dragOperations.get(t);return this._dragOperations.delete(t),n}}}class XCt{constructor(t){this.identifier=t}}const UMn=Lr("treeViewsDndService");qr(UMn,u8o,1);var h8o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Oce=function(e,t){return function(n,r){t(n,r,e)}},Dx;const A8o="editor.dropIntoEditor.preferences",jMn="editor.changeDropType",cit=new Ln("dropWidgetVisible",!1,j(934,"Whether the drop widget is showing"));var mF;let jV=(mF=class extends ct{static get(t){return t.getContribution(Dx.ID)}constructor(t,n,r,o,s){super(),this._configService=r,this._languageFeaturesService=o,this._treeViewsDragAndDropService=s,this.treeItemsTransfer=_We.getInstance(),this._dropProgressManager=this._register(n.createInstance(d1e,"dropIntoEditor",t)),this._postDropWidgetManager=this._register(n.createInstance(g1e,"dropIntoEditor",t,cit,{id:jMn,label:j(935,"Show drop options...")},()=>Dx._configureDefaultAction?[Dx._configureDefaultAction]:[])),this._register(t.onDropIntoEditor(a=>this.onDropIntoEditor(t,a.position,a.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(t,n,r){var s;if(!r.dataTransfer||!t.hasModel())return;(s=Dx._currentDropOperation)==null||s.cancel(),t.focus(),t.setPosition(n);const o=zd(async a=>{const l=new Pt,d=l.add(new t6(t,1,void 0,a));try{const u=await this.extractDataTransferData(r);if(u.size===0||d.token.isCancellationRequested)return;const h=t.getModel();if(!h)return;const f=this._languageFeaturesService.documentDropEditProvider.ordered(h).filter(k=>k.dropMimeTypes?k.dropMimeTypes.some(A=>u.matches(A)):!0),g=l.add(await this.getDropEdits(f,h,n,u,d.token));if(d.token.isCancellationRequested)return;if(g.edits.length){const k=this.getInitialActiveEditIndex(h,g.edits),A=t.getOption(43).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([De.fromPositions(n)],{activeEditIndex:k,allEdits:g.edits},A,async m=>m,a)}}finally{l.dispose(),Dx._currentDropOperation===o&&(Dx._currentDropOperation=void 0)}});this._dropProgressManager.showWhile(n,j(936,"Running drop handlers. Click to cancel"),o,{cancel:()=>o.cancel()}),Dx._currentDropOperation=o}async getDropEdits(t,n,r,o,s){const a=new Pt,l=await hV(Promise.all(t.map(async u=>{try{const h=await u.provideDocumentDropEdits(n,r,o,s);return h&&a.add(h),h==null?void 0:h.edits.map(f=>({...f,providerId:u.id}))}catch(h){Sk(h)||console.error(h),console.error(h)}})),s),d=YO(l??[]).flat();return{edits:GFn(d),dispose:()=>a.dispose()}}getInitialActiveEditIndex(t,n){const r=this._configService.getValue(A8o,{resource:t.uri});for(const o of Array.isArray(r)?r:[]){const s=new Fl(o),a=n.findIndex(l=>l.kind&&s.contains(l.kind));if(a>=0)return a}return 0}async extractDataTransferData(t){if(!t.dataTransfer)return new PFn;const n=NFn(t.dataTransfer);if(this.treeItemsTransfer.hasData(XCt.prototype)){const r=this.treeItemsTransfer.getData(XCt.prototype);if(Array.isArray(r))for(const o of r){const s=await this._treeViewsDragAndDropService.removeDragOperationTransfer(o.identifier);if(s)for(const[a,l]of s)n.replace(a,l)}}return n}},Dx=mF,mF.ID="editor.contrib.dropIntoEditorController",mF);jV=Dx=h8o([Oce(1,$n),Oce(2,cr),Oce(3,Zn),Oce(4,UMn)],jV);mo(jV.ID,jV,2);SZ(rHe);xn(new class extends $d{constructor(){super({id:jMn,precondition:cit,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t,n){var r;(r=jV.get(t))==null||r.changeDropType()}});xn(new class extends $d{constructor(){super({id:"editor.hideDropWidget",precondition:cit,kbOpts:{weight:100,primary:9}})}runEditorCommand(e,t,n){var r;(r=jV.get(t))==null||r.clearWidgets()}});const C2e=class C2e extends $1{constructor(t,n,r){super(),this._hideSoon=this._register(new Ss(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=t,this._state=n,this._keybindingService=r,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const o={inputActiveOptionBorder:sn(Jie),inputActiveOptionForeground:sn(_ie),inputActiveOptionBackground:sn(kZ)},s={groupId:"find-options-widget"};this.caseSensitive=this._register(new BPn({appendTitle:this._keybindingLabelFor(va.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverLifecycleOptions:s,...o})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new FPn({appendTitle:this._keybindingLabelFor(va.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverLifecycleOptions:s,...o})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new PPn({appendTitle:this._keybindingLabelFor(va.ToggleRegexCommand),isChecked:this._state.isRegex,hoverLifecycleOptions:s,...o})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(a=>{let l=!1;a.isRegex&&(this.regex.checked=this._state.isRegex,l=!0),a.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,l=!0),a.matchCase&&(this.caseSensitive.checked=this._state.matchCase,l=!0),!this._state.isRevealed&&l&&this._revealTemporarily()})),this._register(pt(this._domNode,cn.MOUSE_LEAVE,a=>this._onMouseLeave())),this._register(pt(this._domNode,"mouseover",a=>this._onMouseOver()))}_keybindingLabelFor(t){const n=this._keybindingService.lookupKeybinding(t);return n?` (${n.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return C2e.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}};C2e.ID="editor.contrib.findOptionsWidget";let mVe=C2e;function wce(e,t){return e===1?!0:e===2?!1:t}class f8o extends ct{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return wce(this._isRegexOverride,this._isRegex)}get wholeWord(){return wce(this._wholeWordOverride,this._wholeWord)}get matchCase(){return wce(this._matchCaseOverride,this._matchCase)}get preserveCase(){return wce(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new it),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(t,n,r){const o={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;n===0&&(t=0),t>n&&(t=n),this._matchesPosition!==t&&(this._matchesPosition=t,o.matchesPosition=!0,s=!0),this._matchesCount!==n&&(this._matchesCount=n,o.matchesCount=!0,s=!0),typeof r<"u"&&(De.equalsRange(this._currentMatch,r)||(this._currentMatch=r,o.currentMatch=!0,s=!0)),s&&this._onFindReplaceStateChange.fire(o)}change(t,n,r=!0){var h;const o={moveCursor:n,updateHistory:r,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let s=!1;const a=this.isRegex,l=this.wholeWord,d=this.matchCase,u=this.preserveCase;typeof t.searchString<"u"&&this._searchString!==t.searchString&&(this._searchString=t.searchString,o.searchString=!0,s=!0),typeof t.replaceString<"u"&&this._replaceString!==t.replaceString&&(this._replaceString=t.replaceString,o.replaceString=!0,s=!0),typeof t.isRevealed<"u"&&this._isRevealed!==t.isRevealed&&(this._isRevealed=t.isRevealed,o.isRevealed=!0,s=!0),typeof t.isReplaceRevealed<"u"&&this._isReplaceRevealed!==t.isReplaceRevealed&&(this._isReplaceRevealed=t.isReplaceRevealed,o.isReplaceRevealed=!0,s=!0),typeof t.isRegex<"u"&&(this._isRegex=t.isRegex),typeof t.wholeWord<"u"&&(this._wholeWord=t.wholeWord),typeof t.matchCase<"u"&&(this._matchCase=t.matchCase),typeof t.preserveCase<"u"&&(this._preserveCase=t.preserveCase),typeof t.searchScope<"u"&&((h=t.searchScope)!=null&&h.every(f=>{var g;return(g=this._searchScope)==null?void 0:g.some(k=>!De.equalsRange(k,f))})||(this._searchScope=t.searchScope,o.searchScope=!0,s=!0)),typeof t.loop<"u"&&this._loop!==t.loop&&(this._loop=t.loop,o.loop=!0,s=!0),typeof t.isSearching<"u"&&this._isSearching!==t.isSearching&&(this._isSearching=t.isSearching,o.isSearching=!0,s=!0),typeof t.filters<"u"&&(this._filters?this._filters.update(t.filters):this._filters=t.filters,o.filters=!0,s=!0),this._isRegexOverride=typeof t.isRegexOverride<"u"?t.isRegexOverride:0,this._wholeWordOverride=typeof t.wholeWordOverride<"u"?t.wholeWordOverride:0,this._matchCaseOverride=typeof t.matchCaseOverride<"u"?t.matchCaseOverride:0,this._preserveCaseOverride=typeof t.preserveCaseOverride<"u"?t.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,o.isRegex=!0),l!==this.wholeWord&&(s=!0,o.wholeWord=!0),d!==this.matchCase&&(s=!0,o.matchCase=!0),u!==this.preserveCase&&(s=!0,o.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=B5}}var g8o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},m8o=function(e,t){return function(n,r){t(n,r,e)}},eS,fT;let kVe=(fT=class{static getOrCreate(t){return eS._instance||(eS._instance=new eS(t)),eS._instance}constructor(t){this.storageService=t,this.inMemoryValues=new Set,this._onDidChangeEmitter=new it,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(t){const n=this.inMemoryValues.delete(t);return this.save(),n}add(t){return this.inMemoryValues.add(t),this.save(),this}has(t){return this.inMemoryValues.has(t)}forEach(t,n){return this.load(),this.inMemoryValues.forEach(t)}replace(t){this.inMemoryValues=new Set(t),this.save()}load(){let t;const n=this.storageService.get(eS.FIND_HISTORY_KEY,1);if(n)try{t=JSON.parse(n)}catch{}this.inMemoryValues=new Set(t||[])}save(){const t=[];return this.inMemoryValues.forEach(n=>t.push(n)),new Promise(n=>{this.storageService.store(eS.FIND_HISTORY_KEY,JSON.stringify(t),1,0),this._onDidChangeEmitter.fire(t),n()})}},eS=fT,fT.FIND_HISTORY_KEY="workbench.find.history",fT._instance=null,fT);kVe=eS=g8o([m8o(0,jf)],kVe);var k8o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},v8o=function(e,t){return function(n,r){t(n,r,e)}},tS,gT;let vVe=(gT=class{static getOrCreate(t){return tS._instance||(tS._instance=new tS(t)),tS._instance}constructor(t){this.storageService=t,this.inMemoryValues=new Set,this._onDidChangeEmitter=new it,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(t){const n=this.inMemoryValues.delete(t);return this.save(),n}add(t){return this.inMemoryValues.add(t),this.save(),this}has(t){return this.inMemoryValues.has(t)}forEach(t,n){return this.load(),this.inMemoryValues.forEach(t)}replace(t){this.inMemoryValues=new Set(t),this.save()}load(){let t;const n=this.storageService.get(tS.FIND_HISTORY_KEY,1);if(n)try{t=JSON.parse(n)}catch{}this.inMemoryValues=new Set(t||[])}save(){const t=[];return this.inMemoryValues.forEach(n=>t.push(n)),new Promise(n=>{this.storageService.store(tS.FIND_HISTORY_KEY,JSON.stringify(t),1,0),this._onDidChangeEmitter.fire(t),n()})}},tS=gT,gT.FIND_HISTORY_KEY="workbench.replace.history",gT._instance=null,gT);vVe=tS=k8o([v8o(0,jf)],vVe);var WMn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Lp=function(e,t){return function(n,r){t(n,r,e)}},pVe;const p8o=524288;function bVe(e,t="single",n=!1){if(!e.hasModel())return null;const r=e.getSelection();if(t==="single"&&r.startLineNumber===r.endLineNumber||t==="multiple"){if(r.isEmpty()){const o=e.getConfiguredWordAtPosition(r.getStartPosition());if(o&&n===!1)return o.word}else if(e.getModel().getValueLengthInRange(r)this._onStateChanged(l))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const l=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),l&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(50).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(t){this.saveQueryState(t),t.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),t.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(t){t.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),t.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),t.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),t.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!WOe.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let t=this._editor.getSelections();t=t.map(n=>(n.endColumn===1&&n.endLineNumber>n.startLineNumber&&(n=n.setEndPosition(n.endLineNumber-1,this._editor.getModel().getLineMaxColumn(n.endLineNumber-1))),n.isEmpty()?null:n)).filter(n=>!!n),t.length&&this._state.change({searchScope:t},!0)}}setSearchString(t){this._state.isRegex&&(t=j1(t)),this._state.change({searchString:t},!1)}highlightFindOptions(t=!1){}async _start(t,n){if(this.disposeModel(),!this._editor.hasModel())return;const r={...n,isRevealed:!0};if(t.seedSearchStringFromSelection==="single"){const o=bVe(this._editor,t.seedSearchStringFromSelection,t.seedSearchStringFromNonEmptySelection);o&&(this._state.isRegex?r.searchString=j1(o):r.searchString=o)}else if(t.seedSearchStringFromSelection==="multiple"&&!t.updateSearchScope){const o=bVe(this._editor,t.seedSearchStringFromSelection);o&&(r.searchString=o)}if(!r.searchString&&t.seedSearchStringFromGlobalClipboard){const o=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;o&&(r.searchString=o)}if(t.forceRevealReplace||r.isReplaceRevealed?r.isReplaceRevealed=!0:this._findWidgetVisible.get()||(r.isReplaceRevealed=!1),t.updateSearchScope){const o=this._editor.getSelections();o.some(s=>!s.isEmpty())&&(r.searchScope=o)}r.loop=t.loop,this._state.change(r,!1),this._model||(this._model=new GK(this._editor,this._state))}start(t,n){return this._start(t,n)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(t){return this._model?(this._model.moveToMatch(t),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var t;return this._model?(t=this._editor.getModel())!=null&&t.isTooLargeForHeapOperation()?(this._notificationService.warn(j(940,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(t){this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(t)}},pVe=kF,kF.ID="editor.contrib.findController",kF);Sm=pVe=WMn([Lp(1,Fi),Lp(2,jf),Lp(3,z1),Lp(4,cc),Lp(5,Lg)],Sm);let OVe=class extends Sm{constructor(t,n,r,o,s,a,l,d){super(t,r,a,l,s,d),this._contextViewService=n,this._keybindingService=o,this._widget=null,this._findOptionsWidget=null,this._findWidgetSearchHistory=kVe.getOrCreate(a),this._replaceWidgetHistory=vVe.getOrCreate(a)}async _start(t,n){this._widget||this._createFindWidget();const r=this._editor.getSelection();let o=!1;switch(this._editor.getOption(50).autoFindInSelection){case"always":o=!0;break;case"never":o=!1;break;case"multiline":{o=!!r&&r.startLineNumber!==r.endLineNumber;break}}t.updateSearchScope=t.updateSearchScope||o,await super._start(t,n),this._widget&&(t.shouldFocus===2?this._widget.focusReplaceInput():t.shouldFocus===1&&this._widget.focusFindInput())}highlightFindOptions(t=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!t?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new DHe(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._hoverService,this._findWidgetSearchHistory,this._replaceWidgetHistory)),this._findOptionsWidget=this._register(new mVe(this._editor,this._state,this._keybindingService))}saveViewState(){var t;return(t=this._widget)==null?void 0:t.getViewState()}restoreViewState(t){var n;(n=this._widget)==null||n.setViewState(t)}};OVe=WMn([Lp(1,Q6),Lp(2,Fi),Lp(3,Fo),Lp(4,cc),Lp(5,jf),Lp(6,z1),Lp(7,Lg)],OVe);const b8o=eOe(new $be({id:va.StartFindAction,label:Et(947,"Find"),precondition:zt.or(Ze.focus,zt.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:Yn.MenubarEditMenu,group:"3_find",title:j(941,"&&Find"),order:1}}));b8o.addImplementation(0,(e,t,n)=>{const r=Sm.get(t);return r?r.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:t.getOption(50).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}):!1});const O8o={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class w8o extends Nn{constructor(){super({id:va.StartFindWithArgs,label:Et(948,"Find with Arguments"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:O8o})}async run(t,n,r){const o=Sm.get(n);if(o){const s=r?{searchString:r.searchString,replaceString:r.replaceString,isReplaceRevealed:r.replaceString!==void 0,isRegex:r.isRegex,wholeWord:r.matchWholeWord,matchCase:r.isCaseSensitive,preserveCase:r.preserveCase}:{};await o.start({forceRevealReplace:!1,seedSearchStringFromSelection:o.getState().searchString.length===0&&n.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:n.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(r==null?void 0:r.findInSelection)||!1,loop:n.getOption(50).loop},s),o.setGlobalBufferTerm(o.getState().searchString)}}}class y8o extends Nn{constructor(){super({id:va.StartFindWithSelection,label:Et(949,"Find with Selection"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(t,n){const r=Sm.get(n);r&&(await r.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:n.getOption(50).loop}),r.setGlobalBufferTerm(r.getState().searchString))}}async function HMn(e,t){const n=Sm.get(e);if(!n)return;const r=()=>(t?n.moveToNextMatch():n.moveToPrevMatch())?(n.editor.pushUndoStop(),!0):!1;r()||(await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&e.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(50).loop}),r())}const C8o=eOe(new $be({id:va.NextMatchFindAction,label:Et(950,"Find Next"),precondition:void 0,kbOpts:[{kbExpr:Ze.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:zt.and(Ze.focus,WOe),primary:3,weight:100}]}));C8o.addImplementation(0,async(e,t,n)=>HMn(t,!0));const x8o=eOe(new $be({id:va.PreviousMatchFindAction,label:Et(951,"Find Previous"),precondition:void 0,kbOpts:[{kbExpr:Ze.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:zt.and(Ze.focus,WOe),primary:1027,weight:100}]}));x8o.addImplementation(0,async(e,t,n)=>HMn(t,!1));class L8o extends Nn{constructor(){super({id:va.GoToMatchFindAction,label:Et(952,"Go to Match..."),precondition:P6}),this._highlightDecorations=[]}run(t,n,r){const o=Sm.get(n);if(!o)return;const s=o.getState().matchesCount;if(s<1){t.get(cc).notify({severity:bZ.Warning,message:j(942,"No matches. Try searching for something else.")});return}const a=t.get(UA),l=new Pt,d=l.add(a.createInputBox());d.placeholder=j(943,"Type a number to go to a specific match (between 1 and {0})",s);const u=f=>{const g=parseInt(f);if(isNaN(g))return;const k=o.getState().matchesCount;if(g>0&&g<=k)return g-1;if(g<0&&g>=-k)return k+g},h=f=>{const g=u(f);if(typeof g=="number"){d.validationMessage=void 0,o.goToMatch(g);const k=o.getState().currentMatch;k&&this.addDecorations(n,k)}else d.validationMessage=j(944,"Please type a number between 1 and {0}",o.getState().matchesCount),this.clearDecorations(n)};l.add(d.onDidChangeValue(f=>{h(f)})),l.add(d.onDidAccept(()=>{const f=u(d.value);typeof f=="number"?(o.goToMatch(f),d.hide()):d.validationMessage=j(945,"Please type a number between 1 and {0}",o.getState().matchesCount)})),l.add(d.onDidHide(()=>{this.clearDecorations(n),l.dispose()})),d.show()}clearDecorations(t){t.changeDecorations(n=>{this._highlightDecorations=n.deltaDecorations(this._highlightDecorations,[])})}addDecorations(t,n){t.changeDecorations(r=>{this._highlightDecorations=r.deltaDecorations(this._highlightDecorations,[{range:n,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:n,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:Gl(uQn),position:ck.Full}}}])})}}class VMn extends Nn{async run(t,n){const r=Sm.get(n);if(!r)return;const o=bVe(n,"single",!1);o&&r.setSearchString(o),this._run(r)||(await r.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:n.getOption(50).loop}),this._run(r))}}class S8o extends VMn{constructor(){super({id:va.NextSelectionMatchFindAction,label:Et(953,"Find Next Selection"),precondition:void 0,kbOpts:{kbExpr:Ze.focus,primary:2109,weight:100}})}_run(t){return t.moveToNextMatch()}}class T8o extends VMn{constructor(){super({id:va.PreviousSelectionMatchFindAction,label:Et(954,"Find Previous Selection"),precondition:void 0,kbOpts:{kbExpr:Ze.focus,primary:3133,weight:100}})}_run(t){return t.moveToPrevMatch()}}const E8o=eOe(new $be({id:va.StartFindReplaceAction,label:Et(955,"Replace"),precondition:zt.or(Ze.focus,zt.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:Yn.MenubarEditMenu,group:"3_find",title:j(946,"&&Replace"),order:2}}));E8o.addImplementation(0,(e,t,n)=>{if(!t.hasModel()||t.getOption(104))return!1;const r=Sm.get(t);if(!r)return!1;const o=t.getSelection(),s=r.isFindInputFocused(),a=!o.isEmpty()&&o.startLineNumber===o.endLineNumber&&t.getOption(50).seedSearchStringFromSelection!=="never"&&!s,l=s||a?2:1;return r.start({forceRevealReplace:!0,seedSearchStringFromSelection:a?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:t.getOption(50).seedSearchStringFromSelection!=="never",shouldFocus:l,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop})});mo(Sm.ID,OVe,0);gn(w8o);gn(y8o);gn(L8o);gn(S8o);gn(T8o);const qO=$d.bindToContribution(Sm.get);xn(new qO({id:va.CloseFindWidgetCommand,precondition:P6,handler:e=>e.closeFindWidget(),kbOpts:{weight:105,kbExpr:zt.and(Ze.focus,zt.not("isComposing")),primary:9,secondary:[1033]}}));xn(new qO({id:va.ToggleCaseSensitiveCommand,precondition:void 0,handler:e=>e.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:Ze.focus,primary:cce.primary,mac:cce.mac,win:cce.win,linux:cce.linux}}));xn(new qO({id:va.ToggleWholeWordCommand,precondition:void 0,handler:e=>e.toggleWholeWords(),kbOpts:{weight:105,kbExpr:Ze.focus,primary:dce.primary,mac:dce.mac,win:dce.win,linux:dce.linux}}));xn(new qO({id:va.ToggleRegexCommand,precondition:void 0,handler:e=>e.toggleRegex(),kbOpts:{weight:105,kbExpr:Ze.focus,primary:uce.primary,mac:uce.mac,win:uce.win,linux:uce.linux}}));xn(new qO({id:va.ToggleSearchScopeCommand,precondition:void 0,handler:e=>e.toggleSearchScope(),kbOpts:{weight:105,kbExpr:Ze.focus,primary:hce.primary,mac:hce.mac,win:hce.win,linux:hce.linux}}));xn(new qO({id:va.TogglePreserveCaseCommand,precondition:void 0,handler:e=>e.togglePreserveCase(),kbOpts:{weight:105,kbExpr:Ze.focus,primary:Ace.primary,mac:Ace.mac,win:Ace.win,linux:Ace.linux}}));xn(new qO({id:va.ReplaceOneAction,precondition:P6,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:Ze.focus,primary:3094}}));xn(new qO({id:va.ReplaceOneAction,precondition:P6,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:zt.and(Ze.focus,Fnt),primary:3}}));xn(new qO({id:va.ReplaceAllAction,precondition:P6,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:Ze.focus,primary:2563}}));xn(new qO({id:va.ReplaceAllAction,precondition:P6,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:zt.and(Ze.focus,Fnt),primary:void 0,mac:{primary:2051}}}));xn(new qO({id:va.SelectAllMatchesAction,precondition:P6,handler:e=>e.selectAllMatches(),kbOpts:{weight:105,kbExpr:Ze.focus,primary:515}}));const D8o={0:" ",1:"u",2:"r"},qCt=65535,Nb=16777215,GCt=4278190080;class q9e{constructor(t){const n=Math.ceil(t/32);this._states=new Uint32Array(n)}get(t){const n=t/32|0,r=t%32;return(this._states[n]&1<qCt)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=t,this._endIndexes=n,this._collapseStates=new q9e(t.length),this._userDefinedStates=new q9e(t.length),this._recoveredStates=new q9e(t.length),this._types=r,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const t=[],n=(r,o)=>{const s=t[t.length-1];return this.getStartLineNumber(s)<=r&&this.getEndLineNumber(s)>=o};for(let r=0,o=this._startIndexes.length;rNb||a>Nb)throw new Error("startLineNumber or endLineNumber must not exceed "+Nb);for(;t.length>0&&!n(s,a);)t.pop();const l=t.length>0?t[t.length-1]:-1;t.push(r),this._startIndexes[r]=s+((l&255)<<24),this._endIndexes[r]=a+((l&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(t){return this._startIndexes[t]&Nb}getEndLineNumber(t){return this._endIndexes[t]&Nb}getType(t){return this._types?this._types[t]:void 0}hasTypes(){return!!this._types}isCollapsed(t){return this._collapseStates.get(t)}setCollapsed(t,n){this._collapseStates.set(t,n)}isUserDefined(t){return this._userDefinedStates.get(t)}setUserDefined(t,n){return this._userDefinedStates.set(t,n)}isRecovered(t){return this._recoveredStates.get(t)}setRecovered(t,n){return this._recoveredStates.set(t,n)}getSource(t){return this.isUserDefined(t)?1:this.isRecovered(t)?2:0}setSource(t,n){n===1?(this.setUserDefined(t,!0),this.setRecovered(t,!1)):n===2?(this.setUserDefined(t,!1),this.setRecovered(t,!0)):(this.setUserDefined(t,!1),this.setRecovered(t,!1))}setCollapsedAllOfType(t,n){let r=!1;if(this._types)for(let o=0;o>>24)+((this._endIndexes[t]&GCt)>>>16);return n===qCt?-1:n}contains(t,n){return this.getStartLineNumber(t)<=n&&this.getEndLineNumber(t)>=n}findIndex(t){let n=0,r=this._startIndexes.length;if(r===0)return-1;for(;n=0){if(this.getEndLineNumber(n)>=t)return n;for(n=this.getParentIndex(n);n!==-1;){if(this.contains(n,t))return n;n=this.getParentIndex(n)}}return-1}toString(){const t=[];for(let n=0;nArray.isArray(v)?b=>bb=f.startLineNumber))h&&h.startLineNumber===f.startLineNumber?(f.source===1?v=f:(v=h,v.isCollapsed=f.isCollapsed&&(h.endLineNumber===f.endLineNumber||!(o!=null&&o.startsInside(h.startLineNumber+1,h.endLineNumber+1))),v.source=0),h=a(++d)):(v=f,f.isCollapsed&&f.source===0&&(v.source=2)),f=l(++u);else{let p=u,b=f;for(;;){if(!b||b.startLineNumber>h.endLineNumber){v=h;break}if(b.source===1&&b.endLineNumber>h.endLineNumber)break;b=l(++p)}h=a(++d)}if(v){for(;k&&k.endLineNumberv.startLineNumber&&v.startLineNumber>A&&v.endLineNumber<=r&&(!k||k.endLineNumber>=v.endLineNumber)&&(m.push(v),A=v.startLineNumber,k&&g.push(k),k=v)}}return m}}class Q8o{constructor(t,n){this.ranges=t,this.index=n}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(t){return t.startLineNumber<=this.startLineNumber&&t.endLineNumber>=this.endLineNumber}containsLine(t){return this.startLineNumber<=t&&t<=this.endLineNumber}}class B8o{get regions(){return this._regions}get textModel(){return this._textModel}constructor(t,n){this._updateEventEmitter=new it,this.onDidChange=this._updateEventEmitter.event,this._textModel=t,this._decorationProvider=n,this._regions=new V0(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(t){if(!t.length)return;t=t.sort((r,o)=>r.regionIndex-o.regionIndex);const n={};this._decorationProvider.changeDecorations(r=>{let o=0,s=-1,a=-1;const l=d=>{for(;oa&&(a=u),o++}};for(const d of t){const u=d.regionIndex,h=this._editorDecorationIds[u];if(h&&!n[h]){n[h]=!0,l(u);const f=!this._regions.isCollapsed(u);this._regions.setCollapsed(u,f),s=Math.max(s,this._regions.getEndLineNumber(u))}}l(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:t})}removeManualRanges(t){const n=new Array,r=o=>{for(const s of t)if(!(s.startLineNumber>o.endLineNumber||o.startLineNumber>s.endLineNumber))return!0;return!1};for(let o=0;or&&(r=l)}this._decorationProvider.changeDecorations(o=>this._editorDecorationIds=o.deltaDecorations(this._editorDecorationIds,n)),this._regions=t,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(t){const n=[];for(let r=0,o=this._regions.length;r=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>r)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);n.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,isCollapsed:a.isCollapsed,source:a.source,checksum:l})}return n.length>0?n:void 0}applyMemento(t){if(!Array.isArray(t))return;const n=[],r=this._textModel.getLineCount();for(const s of t){if(s.startLineNumber>=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>r)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);(!s.checksum||a===s.checksum)&&n.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,type:void 0,isCollapsed:s.isCollapsed??!0,source:s.source??0})}const o=V0.sanitizeAndMerge(this._regions,n,r);this.updatePost(V0.fromFoldRanges(o))}_getLinesChecksum(t,n){return Yie(this._textModel.getLineContent(t)+this._textModel.getLineContent(n))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(t,n){const r=[];if(this._regions){let o=this._regions.findRange(t),s=1;for(;o>=0;){const a=this._regions.toRegion(o);(!n||n(a,s))&&r.push(a),s++,o=a.parentIndex}}return r}getRegionAtLine(t){if(this._regions){const n=this._regions.findRange(t);if(n>=0)return this._regions.toRegion(n)}return null}getRegionsInside(t,n){const r=[],o=t?t.regionIndex+1:0,s=t?t.endLineNumber:Number.MAX_VALUE;if(n&&n.length===2){const a=[];for(let l=o,d=this._regions.length;l0&&!u.containedBy(a[a.length-1]);)a.pop();a.push(u),n(u,a.length)&&r.push(u)}else break}}else for(let a=o,l=this._regions.length;a1){const l=e.getRegionsInside(s,(d,u)=>d.isCollapsed!==a&&u0)for(const s of r){const a=e.getRegionAtLine(s);if(a&&(a.isCollapsed!==t&&o.push(a),n>1)){const l=e.getRegionsInside(a,(d,u)=>d.isCollapsed!==t&&ua.isCollapsed!==t&&ll.isCollapsed!==t&&d<=n);o.push(...a)}e.toggleCollapseState(o)}function F8o(e,t,n){const r=[];for(const o of n){const s=e.getAllRegionsAtLine(o,a=>a.isCollapsed!==t);s.length>0&&r.push(s[0])}e.toggleCollapseState(r)}function P8o(e,t,n,r){const o=(a,l)=>l===t&&a.isCollapsed!==n&&!r.some(d=>a.containsLine(d)),s=e.getRegionsInside(null,o);e.toggleCollapseState(s)}function ZMn(e,t,n){const r=[];for(const a of n){const l=e.getAllRegionsAtLine(a,void 0);l.length>0&&r.push(l[0])}const o=a=>r.every(l=>!l.containedBy(a)&&!a.containedBy(l))&&a.isCollapsed!==t,s=e.getRegionsInside(null,o);e.toggleCollapseState(s)}function uit(e,t,n){const r=e.textModel,o=e.regions,s=[];for(let a=o.length-1;a>=0;a--)if(n!==o.isCollapsed(a)){const l=o.getStartLineNumber(a);t.test(r.getLineContent(l))&&s.push(o.toRegion(a))}e.toggleCollapseState(s)}function hit(e,t,n){const r=e.regions,o=[];for(let s=r.length-1;s>=0;s--)n!==r.isCollapsed(s)&&t===r.getType(s)&&o.push(r.toRegion(s));e.toggleCollapseState(o)}function M8o(e,t){let n=null;const r=t.getRegionAtLine(e);if(r!==null&&(n=r.startLineNumber,e===n)){const o=r.parentIndex;o!==-1?n=t.regions.getStartLineNumber(o):n=null}return n}function R8o(e,t){let n=t.getRegionAtLine(e);if(n!==null&&n.startLineNumber===e){if(e!==n.startLineNumber)return n.startLineNumber;{const r=n.parentIndex;let o=0;for(r!==-1&&(o=t.regions.getStartLineNumber(n.parentIndex));n!==null;)if(n.regionIndex>0){if(n=t.regions.toRegion(n.regionIndex-1),n.startLineNumber<=o)return null;if(n.parentIndex===r)return n.startLineNumber}else return null}}else if(t.regions.length>0)for(n=t.regions.toRegion(t.regions.length-1);n!==null;){if(n.startLineNumber0?n=t.regions.toRegion(n.regionIndex-1):n=null}return null}function I8o(e,t){let n=t.getRegionAtLine(e);if(n!==null&&n.startLineNumber===e){const r=n.parentIndex;let o=0;if(r!==-1)o=t.regions.getEndLineNumber(n.parentIndex);else{if(t.regions.length===0)return null;o=t.regions.getEndLineNumber(t.regions.length-1)}for(;n!==null;)if(n.regionIndex=o)return null;if(n.parentIndex===r)return n.startLineNumber}else return null}else if(t.regions.length>0)for(n=t.regions.toRegion(0);n!==null;){if(n.startLineNumber>e)return n.startLineNumber;n.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],t.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(t){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=t.changes.some(n=>n.range.endLineNumber!==n.range.startLineNumber||WT(n.text)[0]!==0))}updateHiddenRanges(){let t=!1;const n=[];let r=0,o=0,s=Number.MAX_VALUE,a=-1;const l=this._foldingModel.regions;for(;r0}isHidden(t){return KCt(this._hiddenRanges,t)!==null}adjustSelections(t){let n=!1;const r=this._foldingModel.textModel;let o=null;const s=a=>((!o||!U8o(a,o))&&(o=KCt(this._hiddenRanges,a)),o?o.startLineNumber-1:null);for(let a=0,l=t.length;a0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function U8o(e,t){return e>=t.startLineNumber&&e<=t.endLineNumber}function KCt(e,t){const n=T$(e,r=>t=0&&e[n].endLineNumber>=t?e[n]:null}const j8o=5e3,W8o="indent";class Ait{constructor(t,n,r){this.editorModel=t,this.languageConfigurationService=n,this.foldingRangesLimit=r,this.id=W8o}dispose(){}compute(t){const n=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,r=n&&!!n.offSide,o=n&&n.markers;return Promise.resolve(z8o(this.editorModel,r,o,this.foldingRangesLimit))}}let H8o=class{constructor(t){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=t}insertFirst(t,n,r){if(t>Nb||n>Nb)return;const o=this._length;this._startIndexes[o]=t,this._endIndexes[o]=n,this._length++,r<1e3&&(this._indentOccurrences[r]=(this._indentOccurrences[r]||0)+1)}toIndentRanges(t){const n=this._foldingRangesLimit.limit;if(this._length<=n){this._foldingRangesLimit.update(this._length,!1);const r=new Uint32Array(this._length),o=new Uint32Array(this._length);for(let s=this._length-1,a=0;s>=0;s--,a++)r[a]=this._startIndexes[s],o[a]=this._endIndexes[s];return new V0(r,o)}else{this._foldingRangesLimit.update(this._length,n);let r=0,o=this._indentOccurrences.length;for(let d=0;dn){o=d;break}r+=u}}const s=t.getOptions().tabSize,a=new Uint32Array(n),l=new Uint32Array(n);for(let d=this._length-1,u=0;d>=0;d--){const h=this._startIndexes[d],f=t.getLineContent(h),g=OOe(f,s);(g{}};function z8o(e,t,n,r=V8o){const o=e.getOptions().tabSize,s=new H8o(r);let a;n&&(a=new RegExp(`(${n.start.source})|(?:${n.end.source})`));const l=[],d=e.getLineCount()+1;l.push({indent:-1,endAbove:d,line:d});for(let u=e.getLineCount();u>0;u--){const h=e.getLineContent(u),f=OOe(h,o);let g=l[l.length-1];if(f===-1){t&&(g.endAbove=u);continue}let k;if(a&&(k=h.match(a)))if(k[1]){let A=l.length-1;for(;A>0&&l[A].indent!==-2;)A--;if(A>0){l.length=A+1,g=l[A],s.insertFirst(u,g.line,f),g.line=u,g.indent=f,g.endAbove=u;continue}}else{l.push({indent:-2,endAbove:u,line:u});continue}if(g.indent>f){do l.pop(),g=l[l.length-1];while(g.indent>f);const A=g.endAbove-1;A-u>=1&&s.insertFirst(u,A,f)}g.indent===f?g.endAbove=u:l.push({indent:f,endAbove:u,line:u})}return s.toIndentRanges(e)}const Z8o=He("editor.foldBackground",{light:Ji(w5,.3),dark:Ji(w5,.3),hcDark:null,hcLight:null},j(1002,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);He("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},j(1003,"Color of the collapsed text after the first line of a folded range."));He("editorGutter.foldingControlForeground",fme,j(1004,"Color of the folding control in the editor gutter."));const H1e=Ra("folding-expanded",Jt.chevronDown,j(1005,"Icon for expanded ranges in the editor glyph margin.")),V1e=Ra("folding-collapsed",Jt.chevronRight,j(1006,"Icon for collapsed ranges in the editor glyph margin.")),JCt=Ra("folding-manual-collapsed",V1e,j(1007,"Icon for manually collapsed ranges in the editor glyph margin.")),_Ct=Ra("folding-manual-expanded",H1e,j(1008,"Icon for manually expanded ranges in the editor glyph margin.")),G9e={color:Gl(Z8o),position:1},GI=j(1009,"Click to expand the range."),yce=j(1010,"Click to collapse the range."),td=class td{constructor(t){this.editor=t,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(t,n,r){return n?td.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?t?this.showFoldingHighlights?td.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:td.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:td.NO_CONTROLS_EXPANDED_RANGE_DECORATION:t?r?this.showFoldingHighlights?td.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:td.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?td.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:td.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?r?td.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:td.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:r?td.MANUALLY_EXPANDED_VISUAL_DECORATION:td.EXPANDED_VISUAL_DECORATION}changeDecorations(t){return this.editor.changeDecorations(t)}removeDecorations(t){this.editor.removeDecorations(t)}};td.COLLAPSED_VISUAL_DECORATION=Ki.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:GI,firstLineDecorationClassName:mi.asClassName(V1e)}),td.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ki.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:G9e,isWholeLine:!0,linesDecorationsTooltip:GI,firstLineDecorationClassName:mi.asClassName(V1e)}),td.MANUALLY_COLLAPSED_VISUAL_DECORATION=Ki.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:GI,firstLineDecorationClassName:mi.asClassName(JCt)}),td.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ki.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:G9e,isWholeLine:!0,linesDecorationsTooltip:GI,firstLineDecorationClassName:mi.asClassName(JCt)}),td.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Ki.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:GI}),td.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Ki.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:G9e,isWholeLine:!0,linesDecorationsTooltip:GI}),td.EXPANDED_VISUAL_DECORATION=Ki.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+mi.asClassName(H1e),linesDecorationsTooltip:yce}),td.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ki.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:mi.asClassName(H1e),linesDecorationsTooltip:yce}),td.MANUALLY_EXPANDED_VISUAL_DECORATION=Ki.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+mi.asClassName(_Ct),linesDecorationsTooltip:yce}),td.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ki.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:mi.asClassName(_Ct),linesDecorationsTooltip:yce}),td.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Ki.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0}),td.HIDDEN_RANGE_DECORATION=Ki.register({description:"folding-hidden-range-decoration",stickiness:1});let wVe=td;const Y8o={},X8o="syntax";class fit{constructor(t,n,r,o,s){this.editorModel=t,this.providers=n,this.handleFoldingRangesChange=r,this.foldingRangesLimit=o,this.fallbackRangeProvider=s,this.id=X8o,this.disposables=new Pt,s&&this.disposables.add(s);for(const a of n)typeof a.onDidChange=="function"&&this.disposables.add(a.onDidChange(r))}compute(t){return q8o(this.providers,this.editorModel,t).then(n=>{var r;return this.editorModel.isDisposed()?null:n?K8o(n,this.foldingRangesLimit):((r=this.fallbackRangeProvider)==null?void 0:r.compute(t))??null})}dispose(){this.disposables.dispose()}}function q8o(e,t,n){let r=null;const o=e.map((s,a)=>Promise.resolve(s.provideFoldingRanges(t,Y8o,n)).then(l=>{if(!n.isCancellationRequested&&Array.isArray(l)){Array.isArray(r)||(r=[]);const d=t.getLineCount();for(const u of l)u.start>0&&u.end>u.start&&u.end<=d&&r.push({start:u.start,end:u.end,rank:a,kind:u.kind})}},Xc));return Promise.all(o).then(s=>r)}class G8o{constructor(t){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=t}add(t,n,r,o){if(t>Nb||n>Nb)return;const s=this._length;this._startIndexes[s]=t,this._endIndexes[s]=n,this._nestingLevels[s]=o,this._types[s]=r,this._length++,o<30&&(this._nestingLevelCounts[o]=(this._nestingLevelCounts[o]||0)+1)}toIndentRanges(){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const n=new Uint32Array(this._length),r=new Uint32Array(this._length);for(let o=0;ot){r=l;break}n+=d}}const o=new Uint32Array(t),s=new Uint32Array(t),a=[];for(let l=0,d=0;l{let d=a.start-l.start;return d===0&&(d=a.rank-l.rank),d}),r=new G8o(t);let o;const s=[];for(const a of n)if(!o)o=a,r.add(a.start,a.end,a.kind&&a.kind.value,s.length);else if(a.start>o.start)if(a.end<=o.end)s.push(o),o=a,r.add(a.start,a.end,a.kind&&a.kind.value,s.length);else{if(a.start>o.end){do o=s.pop();while(o&&a.start>o.end);o&&s.push(o),o=a}r.add(a.start,a.end,a.kind&&a.kind.value,s.length)}return r.toIndentRanges()}var J8o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},qX=function(e,t){return function(n,r){t(n,r,e)}},hD;const Lh=new Ln("foldingEnabled",!1);var vF;let XT=(vF=class extends ct{static get(t){return t.getContribution(hD.ID)}static getFoldingRangeProviders(t,n){var o;const r=t.foldingRangeProvider.ordered(n);return((o=hD._foldingRangeSelector)==null?void 0:o.call(hD,r,n))??r}constructor(t,n,r,o,s,a){super(),this.contextKeyService=n,this.languageConfigurationService=r,this.languageFeaturesService=a,this.localToDispose=this._register(new Pt),this.editor=t,this._foldingLimitReporter=this._register(new YMn(t));const l=this.editor.getOptions();this._isEnabled=l.get(52),this._useFoldingProviders=l.get(53)!=="indentation",this._unfoldOnClickAfterEndOfLine=l.get(57),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=l.get(55),this.updateDebounceInfo=s.for(a.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new wVe(t),this.foldingDecorationProvider.showFoldingControls=l.get(126),this.foldingDecorationProvider.showFoldingHighlights=l.get(54),this.foldingEnabled=Lh.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(d=>{if(d.hasChanged(52)&&(this._isEnabled=this.editor.getOptions().get(52),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),d.hasChanged(56)&&this.onModelChanged(),d.hasChanged(126)||d.hasChanged(54)){const u=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=u.get(126),this.foldingDecorationProvider.showFoldingHighlights=u.get(54),this.triggerFoldingModelChanged()}d.hasChanged(53)&&(this._useFoldingProviders=this.editor.getOptions().get(53)!=="indentation",this.onFoldingStrategyChanged()),d.hasChanged(57)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(57)),d.hasChanged(55)&&(this._foldingImportsByDefault=this.editor.getOptions().get(55))})),this.onModelChanged()}saveViewState(){const t=this.editor.getModel();if(!t||!this._isEnabled||t.isTooLargeForTokenization())return{};if(this.foldingModel){const n=this.foldingModel.getMemento(),r=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:n,lineCount:t.getLineCount(),provider:r,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(t){const n=this.editor.getModel();if(!(!n||!this._isEnabled||n.isTooLargeForTokenization()||!this.hiddenRangeModel)&&t&&(this._currentModelHasFoldedImports=!!t.foldedImports,t.collapsedRegions&&t.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(t.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const t=this.editor.getModel();!this._isEnabled||!t||t.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new B8o(t,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new N8o(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(n=>this.onHiddenRangesChanges(n))),this.updateScheduler=new A2(this.updateDebounceInfo.get(t)),this.localToDispose.add(this.updateScheduler),this.cursorChangedScheduler=new Ss(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(n=>this.onDidChangeModelContent(n))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(n=>this.onEditorMouseDown(n))),this.localToDispose.add(this.editor.onMouseUp(n=>this.onEditorMouseUp(n))),this.localToDispose.add({dispose:()=>{var n,r;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(n=this.updateScheduler)==null||n.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(r=this.rangeProvider)==null||r.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var t;(t=this.rangeProvider)==null||t.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(t){if(this.rangeProvider)return this.rangeProvider;const n=new Ait(t,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=n,this._useFoldingProviders&&this.foldingModel){const r=hD.getFoldingRangeProviders(this.languageFeaturesService,t);r.length>0&&(this.rangeProvider=new fit(t,r,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,n))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(t){var n;(n=this.hiddenRangeModel)==null||n.notifyChangeModelContent(t),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const t=this.foldingModel;if(!t)return null;const n=new wu,r=this.getRangeProvider(t.textModel),o=this.foldingRegionPromise=zd(s=>r.compute(s));return o.then(s=>{if(s&&o===this.foldingRegionPromise){let a;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const u=s.setCollapsedAllOfType(WM.Imports.value,!0);u&&(a=SO.capture(this.editor),this._currentModelHasFoldedImports=u)}const l=this.editor.getSelections();t.update(s,_8o(l)),a==null||a.restore(this.editor);const d=this.updateDebounceInfo.update(t.textModel,n.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=d)}return t})}).then(void 0,t=>(Yi(t),null)))}onHiddenRangesChanges(t){if(this.hiddenRangeModel&&t.length&&!this._restoringViewState){const n=this.editor.getSelections();n&&this.hiddenRangeModel.adjustSelections(n)&&this.editor.setSelections(n)}this.editor.setHiddenAreas(t,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const t=this.getFoldingModel();t&&t.then(n=>{if(n){const r=this.editor.getSelections();if(r&&r.length>0){const o=[];for(const s of r){const a=s.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(a)&&o.push(...n.getAllRegionsAtLine(a,l=>l.isCollapsed&&a>l.startLineNumber))}o.length&&(n.toggleCollapseState(o),this.reveal(r[0].getPosition()))}}}).then(void 0,Yi)}onEditorMouseDown(t){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!t.target||!t.target.range||!t.event.leftButton&&!t.event.middleButton)return;const n=t.target.range;let r=!1;switch(t.target.type){case 4:{const o=t.target.detail,s=t.target.element.offsetLeft;if(o.offsetX-s<4)return;r=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!t.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const o=this.editor.getModel();if(o&&n.startColumn===o.getLineMaxColumn(n.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:n.startLineNumber,iconClicked:r}}onEditorMouseUp(t){const n=this.foldingModel;if(!n||!this.mouseDownInfo||!t.target)return;const r=this.mouseDownInfo.lineNumber,o=this.mouseDownInfo.iconClicked,s=t.target.range;if(!s||s.startLineNumber!==r)return;if(o){if(t.target.type!==4)return}else{const l=this.editor.getModel();if(!l||s.startColumn!==l.getLineMaxColumn(r))return}const a=n.getRegionAtLine(r);if(a&&a.startLineNumber===r){const l=a.isCollapsed;if(o||l){const d=t.event.altKey;let u=[];if(d){const h=g=>!g.containedBy(a)&&!a.containedBy(g),f=n.getRegionsInside(null,h);for(const g of f)g.isCollapsed&&u.push(g);u.length===0&&(u=f)}else{const h=t.event.middleButton||t.event.shiftKey;if(h)for(const f of n.getRegionsInside(a))f.isCollapsed===l&&u.push(f);(l||!h||u.length===0)&&u.push(a)}n.toggleCollapseState(u),this.reveal({lineNumber:r,column:1})}}}reveal(t){this.editor.revealPositionInCenterIfOutsideViewport(t,0)}},hD=vF,vF.ID="editor.contrib.folding",vF);XT=hD=J8o([qX(1,Fi),qX(2,bl),qX(3,cc),qX(4,L2),qX(5,Zn)],XT);class YMn extends ct{constructor(t){super(),this.editor=t,this._onDidChange=this._register(new it),this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(56)}update(t,n){(t!==this._computed||n!==this._limited)&&(this._computed=t,this._limited=n,this._onDidChange.fire())}}class uA extends Nn{runEditorCommand(t,n,r){const o=t.get(bl),s=XT.get(n);if(!s)return;const a=s.getFoldingModel();if(a)return this.reportTelemetry(t,n),a.then(l=>{if(l){this.invoke(s,l,n,r,o);const d=n.getSelection();d&&s.reveal(d.getStartPosition())}})}getSelectedLines(t){const n=t.getSelections();return n?n.map(r=>r.startLineNumber):[]}getLineNumbers(t,n){return t&&t.selectionLines?t.selectionLines.map(r=>r+1):this.getSelectedLines(n)}run(t,n){}}function _8o(e){return!e||e.length===0?{startsInside:()=>!1}:{startsInside(t,n){for(const r of e){const o=r.startLineNumber;if(o>=t&&o<=n)return!0}return!1}}}function XMn(e){if(!QA(e)){if(!Vd(e))return!1;const t=e;if(!QA(t.levels)&&!H8(t.levels)||!QA(t.direction)&&!pu(t.direction)||!QA(t.selectionLines)&&(!Array.isArray(t.selectionLines)||!t.selectionLines.every(H8)))return!1}return!0}class $8o extends uA{constructor(){super({id:"editor.unfold",label:Et(982,"Unfold"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. `,constraint:XMn,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(t,n,r,o){const s=o&&o.levels||1,a=this.getLineNumbers(o,r);o&&o.direction==="up"?zMn(n,!1,s,a):TZ(n,!1,s,a)}}class e6o extends uA{constructor(){super({id:"editor.unfoldRecursively",label:Et(983,"Unfold Recursively"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2142),weight:100}})}invoke(t,n,r,o){TZ(n,!1,Number.MAX_VALUE,this.getSelectedLines(r))}}class t6o extends uA{constructor(){super({id:"editor.fold",label:Et(984,"Fold"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to fold. * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. `,constraint:XMn,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(t,n,r,o){const s=this.getLineNumbers(o,r),a=o&&o.levels,l=o&&o.direction;typeof a!="number"&&typeof l!="string"?F8o(n,!0,s):l==="up"?zMn(n,!0,a||1,s):TZ(n,!0,a||1,s)}}class n6o extends uA{constructor(){super({id:"editor.toggleFold",label:Et(985,"Toggle Fold"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2090),weight:100}})}invoke(t,n,r){const o=this.getSelectedLines(r);dit(n,1,o)}}class i6o extends uA{constructor(){super({id:"editor.foldRecursively",label:Et(986,"Fold Recursively"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2140),weight:100}})}invoke(t,n,r){const o=this.getSelectedLines(r);TZ(n,!0,Number.MAX_VALUE,o)}}class r6o extends uA{constructor(){super({id:"editor.toggleFoldRecursively",label:Et(987,"Toggle Fold Recursively"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,3114),weight:100}})}invoke(t,n,r){const o=this.getSelectedLines(r);dit(n,Number.MAX_VALUE,o)}}class o6o extends uA{constructor(){super({id:"editor.foldAllBlockComments",label:Et(988,"Fold All Block Comments"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2138),weight:100}})}invoke(t,n,r,o,s){if(n.regions.hasTypes())hit(n,WM.Comment.value,!0);else{const a=r.getModel();if(!a)return;const l=s.getLanguageConfiguration(a.getLanguageId()).comments;if(l&&l.blockCommentStartToken){const d=new RegExp("^\\s*"+j1(l.blockCommentStartToken));uit(n,d,!0)}}}}class s6o extends uA{constructor(){super({id:"editor.foldAllMarkerRegions",label:Et(989,"Fold All Regions"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2077),weight:100}})}invoke(t,n,r,o,s){if(n.regions.hasTypes())hit(n,WM.Region.value,!0);else{const a=r.getModel();if(!a)return;const l=s.getLanguageConfiguration(a.getLanguageId()).foldingRules;if(l&&l.markers&&l.markers.start){const d=new RegExp(l.markers.start);uit(n,d,!0)}}}}class a6o extends uA{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:Et(990,"Unfold All Regions"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2078),weight:100}})}invoke(t,n,r,o,s){if(n.regions.hasTypes())hit(n,WM.Region.value,!1);else{const a=r.getModel();if(!a)return;const l=s.getLanguageConfiguration(a.getLanguageId()).foldingRules;if(l&&l.markers&&l.markers.start){const d=new RegExp(l.markers.start);uit(n,d,!1)}}}}class l6o extends uA{constructor(){super({id:"editor.foldAllExcept",label:Et(991,"Fold All Except Selected"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2136),weight:100}})}invoke(t,n,r){const o=this.getSelectedLines(r);ZMn(n,!0,o)}}class c6o extends uA{constructor(){super({id:"editor.unfoldAllExcept",label:Et(992,"Unfold All Except Selected"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2134),weight:100}})}invoke(t,n,r){const o=this.getSelectedLines(r);ZMn(n,!1,o)}}class d6o extends uA{constructor(){super({id:"editor.foldAll",label:Et(993,"Fold All"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2069),weight:100}})}invoke(t,n,r){TZ(n,!0)}}class u6o extends uA{constructor(){super({id:"editor.unfoldAll",label:Et(994,"Unfold All"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2088),weight:100}})}invoke(t,n,r){TZ(n,!1)}}const bj=class bj extends uA{getFoldingLevel(){return parseInt(this.id.substr(bj.ID_PREFIX.length))}invoke(t,n,r){P8o(n,this.getFoldingLevel(),!0,this.getSelectedLines(r))}};bj.ID_PREFIX="editor.foldLevel",bj.ID=t=>bj.ID_PREFIX+t;let z1e=bj;class h6o extends uA{constructor(){super({id:"editor.gotoParentFold",label:Et(995,"Go to Parent Fold"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,weight:100}})}invoke(t,n,r){const o=this.getSelectedLines(r);if(o.length>0){const s=M8o(o[0],n);s!==null&&r.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class A6o extends uA{constructor(){super({id:"editor.gotoPreviousFold",label:Et(996,"Go to Previous Folding Range"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,weight:100}})}invoke(t,n,r){const o=this.getSelectedLines(r);if(o.length>0){const s=R8o(o[0],n);s!==null&&r.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class f6o extends uA{constructor(){super({id:"editor.gotoNextFold",label:Et(997,"Go to Next Folding Range"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,weight:100}})}invoke(t,n,r){const o=this.getSelectedLines(r);if(o.length>0){const s=I8o(o[0],n);s!==null&&r.setSelection({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:1})}}}class g6o extends uA{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:Et(998,"Create Folding Range from Selection"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2135),weight:100}})}invoke(t,n,r){var a;const o=[],s=r.getSelections();if(s){for(const l of s){let d=l.endLineNumber;l.endColumn===1&&--d,d>l.startLineNumber&&(o.push({startLineNumber:l.startLineNumber,endLineNumber:d,type:void 0,isCollapsed:!0,source:1}),r.setSelection({startLineNumber:l.startLineNumber,startColumn:1,endLineNumber:l.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((d,u)=>d.startLineNumber-u.startLineNumber);const l=V0.sanitizeAndMerge(n.regions,o,(a=r.getModel())==null?void 0:a.getLineCount());n.updatePost(V0.fromFoldRanges(l))}}}}class m6o extends uA{constructor(){super({id:"editor.removeManualFoldingRanges",label:Et(999,"Remove Manual Folding Ranges"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2137),weight:100}})}invoke(t,n,r){const o=r.getSelections();if(o){const s=[];for(const a of o){const{startLineNumber:l,endLineNumber:d}=a;s.push(d>=l?{startLineNumber:l,endLineNumber:d}:{endLineNumber:d,startLineNumber:l})}n.removeManualRanges(s),t.triggerFoldingModelChanged()}}}class k6o extends uA{constructor(){super({id:"editor.toggleImportFold",label:Et(1e3,"Toggle Import Fold"),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,weight:100}})}async invoke(t,n){const r=[],o=n.regions;for(let s=o.length-1;s>=0;s--)o.getType(s)===WM.Imports.value&&r.push(o.toRegion(s));n.toggleCollapseState(r),t.triggerFoldingModelChanged()}}mo(XT.ID,XT,0);gn($8o);gn(e6o);gn(t6o);gn(i6o);gn(r6o);gn(d6o);gn(u6o);gn(o6o);gn(s6o);gn(a6o);gn(l6o);gn(c6o);gn(n6o);gn(h6o);gn(A6o);gn(f6o);gn(g6o);gn(m6o);gn(k6o);for(let e=1;e<=7;e++)ddo(new z1e({id:z1e.ID(e),label:Et(1001,"Fold Level {0}",e),precondition:Lh,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2048|21+e),weight:100}}));ho.registerCommand("_executeFoldingRangeProvider",async function(e,...t){const[n]=t;if(!(n instanceof pi))throw _v();const r=e.get(Zn),o=e.get(pl).getModel(n);if(!o)throw _v();const s=e.get(cr);if(!s.getValue("editor.folding",{resource:n}))return[];const a=e.get(bl),l=s.getValue("editor.foldingStrategy",{resource:n}),d={get limit(){return s.getValue("editor.foldingMaximumRegions",{resource:n})},update:(k,A)=>{}},u=new Ait(o,a,d);let h=u;if(l!=="indentation"){const k=XT.getFoldingRangeProviders(r,o);k.length&&(h=new fit(o,k,()=>{},d,u))}const f=await h.compute(Fr.None),g=[];try{if(f)for(let k=0;kJl.replace(De.lift(a.range),a.text))):t.executeEdits("formatEditsCommand",s.map(a=>Jl.replaceMove(De.lift(a.range),a.text))),r&&t.pushUndoStop(),o.restoreRelativeVerticalPositionOfCursor(t)}}class $Ct{constructor(t){this.value=t,this._lower=t.toLowerCase()}static toKey(t){return typeof t=="string"?t.toLowerCase():t._lower}}class O6o{constructor(t){if(this._set=new Set,t)for(const n of t)this.add(n)}add(t){this._set.add($Ct.toKey(t))}has(t){return this._set.has($Ct.toKey(t))}}function qMn(e,t,n){const r=[],o=new O6o,s=e.ordered(n);for(const l of s)r.push(l),l.extensionId&&o.add(l.extensionId);const a=t.ordered(n);for(const l of a){if(l.extensionId){if(o.has(l.extensionId))continue;o.add(l.extensionId)}r.push({displayName:l.displayName,extensionId:l.extensionId,provideDocumentFormattingEdits(d,u,h){return l.provideDocumentRangeFormattingEdits(d,d.getFullModelRange(),u,h)}})}return r}const ZJ=class ZJ{static setFormatterSelector(t){return{dispose:ZJ._selectors.unshift(t)}}static async select(t,n,r,o){if(t.length===0)return;const s=lo.first(ZJ._selectors);if(s)return await s(t,n,r,o)}};ZJ._selectors=new Tf;let mee=ZJ;async function GMn(e,t,n,r,o,s,a){const l=e.get($n),{documentRangeFormattingEditProvider:d}=e.get(Zn),u=EO(t)?t.getModel():t,h=d.ordered(u),f=await mee.select(h,u,r,2);f&&(o.report(f),await l.invokeFunction(w6o,f,t,n,s,a))}async function w6o(e,t,n,r,o,s){var p,b;const a=e.get(Bm),l=e.get(Oa),d=e.get(E6);let u,h;EO(n)?(u=n.getModel(),h=new t6(n,5,void 0,o)):(u=n,h=new Ont(n,o));const f=[];let g=0;for(const O of Let(r).sort(De.compareRangesUsingStarts))g>0&&De.areIntersectingOrTouching(f[g-1],O)?f[g-1]=De.fromPositions(f[g-1].getStartPosition(),O.getEndPosition()):g=f.push(O);const k=async O=>{var y,C;l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(y=t.extensionId)==null?void 0:y.value,O);const w=await t.provideDocumentRangeFormattingEdits(u,O,u.getFormattingOptions(),h.token)||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(C=t.extensionId)==null?void 0:C.value,w),w},A=(O,w)=>{if(!O.length||!w.length)return!1;const y=O.reduce((C,x)=>De.plusRange(C,x.range),O[0].range);if(!w.some(C=>De.intersectRanges(y,C.range)))return!1;for(const C of O)for(const x of w)if(De.intersectRanges(C.range,x.range))return!0;return!1},m=[],v=[];try{if(typeof t.provideDocumentRangesFormattingEdits=="function"){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(p=t.extensionId)==null?void 0:p.value,f);const O=await t.provideDocumentRangesFormattingEdits(u,f,u.getFormattingOptions(),h.token)||[];l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(b=t.extensionId)==null?void 0:b.value,O),v.push(O)}else{for(const O of f){if(h.token.isCancellationRequested)return!0;v.push(await k(O))}for(let O=0;O({text:y.text,range:De.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:C}of y)if(De.areIntersectingOrTouching(C,w))return[new Rn(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn)];return null})}return d.playSignal(lg.format,{userGesture:s}),!0}async function y6o(e,t,n,r,o,s){const a=e.get($n),l=e.get(Zn),d=EO(t)?t.getModel():t,u=qMn(l.documentFormattingEditProvider,l.documentRangeFormattingEditProvider,d),h=await mee.select(u,d,n,1);h&&(r.report(h),await a.invokeFunction(C6o,h,t,n,o,s))}async function C6o(e,t,n,r,o,s){const a=e.get(Bm),l=e.get(E6);let d,u;EO(n)?(d=n.getModel(),u=new t6(n,5,void 0,o)):(d=n,u=new Ont(n,o));let h;try{const f=await t.provideDocumentFormattingEdits(d,d.getFormattingOptions(),u.token);if(h=await a.computeMoreMinimalEdits(d.uri,f),u.token.isCancellationRequested)return!0}finally{u.dispose()}if(!h||h.length===0)return!1;if(EO(n))WV.execute(n,h,r!==2),r!==2&&n.revealPositionInCenterIfOutsideViewport(n.getPosition(),1);else{const[{range:f}]=h,g=new Rn(f.startLineNumber,f.startColumn,f.endLineNumber,f.endColumn);d.pushEditOperations([g],h.map(k=>({text:k.text,range:De.lift(k.range),forceMoveMarkers:!0})),k=>{for(const{range:A}of k)if(De.areIntersectingOrTouching(A,g))return[new Rn(A.startLineNumber,A.startColumn,A.endLineNumber,A.endColumn)];return null})}return l.playSignal(lg.format,{userGesture:s}),!0}async function x6o(e,t,n,r,o,s){const a=t.documentRangeFormattingEditProvider.ordered(n);for(const l of a){const d=await Promise.resolve(l.provideDocumentRangeFormattingEdits(n,r,o,s)).catch(Xc);if(Qf(d))return await e.computeMoreMinimalEdits(n.uri,d)}}async function L6o(e,t,n,r,o){const s=qMn(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,n);for(const a of s){const l=await Promise.resolve(a.provideDocumentFormattingEdits(n,r,o)).catch(Xc);if(Qf(l))return await e.computeMoreMinimalEdits(n.uri,l)}}function KMn(e,t,n,r,o,s,a){const l=t.onTypeFormattingEditProvider.ordered(n);return l.length===0||l[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(l[0].provideOnTypeFormattingEdits(n,r,o,s,a)).catch(Xc).then(d=>e.computeMoreMinimalEdits(n.uri,d))}ho.registerCommand("_executeFormatRangeProvider",async function(e,...t){const[n,r,o]=t;yo(pi.isUri(n)),yo(De.isIRange(r));const s=e.get(Uf),a=e.get(Bm),l=e.get(Zn),d=await s.createModelReference(n);try{return x6o(a,l,d.object.textEditorModel,De.lift(r),o,Fr.None)}finally{d.dispose()}});ho.registerCommand("_executeFormatDocumentProvider",async function(e,...t){const[n,r]=t;yo(pi.isUri(n));const o=e.get(Uf),s=e.get(Bm),a=e.get(Zn),l=await o.createModelReference(n);try{return L6o(s,a,l.object.textEditorModel,r,Fr.None)}finally{l.dispose()}});ho.registerCommand("_executeFormatOnTypeProvider",async function(e,...t){const[n,r,o,s]=t;yo(pi.isUri(n)),yo(tt.isIPosition(r)),yo(typeof o=="string");const a=e.get(Uf),l=e.get(Bm),d=e.get(Zn),u=await a.createModelReference(n);try{return KMn(l,d,u.object.textEditorModel,tt.lift(r),o,s,Fr.None)}finally{u.dispose()}});var JMn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},KK=function(e,t){return function(n,r){t(n,r,e)}},cH;let Z1e=(cH=class{constructor(t,n,r,o){this._editor=t,this._languageFeaturesService=n,this._workerService=r,this._accessibilitySignalService=o,this._disposables=new Pt,this._sessionDisposables=new Pt,this._disposables.add(n.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(t.onDidChangeModel(()=>this._update())),this._disposables.add(t.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(t.onDidChangeConfiguration(s=>{s.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(65)||!this._editor.hasModel())return;const t=this._editor.getModel(),[n]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(t);if(!n||!n.autoFormatTriggerCharacters)return;const r=new tme;for(const o of n.autoFormatTriggerCharacters)r.add(o.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(o=>{const s=o.charCodeAt(o.length-1);r.has(s)&&this._trigger(String.fromCharCode(s))}))}_trigger(t){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const n=this._editor.getModel(),r=this._editor.getPosition(),o=new Ya,s=this._editor.onDidChangeModelContent(a=>{if(a.isFlush){o.cancel(),s.dispose();return}for(let l=0,d=a.changes.length;l{o.token.isCancellationRequested||Qf(a)&&(this._accessibilitySignalService.playSignal(lg.format,{userGesture:!1}),WV.execute(this._editor,a,!0))}).finally(()=>{s.dispose()})}},cH.ID="editor.contrib.autoFormat",cH);Z1e=JMn([KK(1,Zn),KK(2,Bm),KK(3,E6)],Z1e);var dH;let Y1e=(dH=class{constructor(t,n,r){this.editor=t,this._languageFeaturesService=n,this._instantiationService=r,this._callOnDispose=new Pt,this._callOnModel=new Pt,this._callOnDispose.add(t.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(t.onDidChangeModel(()=>this._update())),this._callOnDispose.add(t.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(n.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(64)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:t})=>this._trigger(t)))}_trigger(t){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(GMn,this.editor,t,2,nO.None,Fr.None,!1).catch(Yi))}},dH.ID="editor.contrib.formatOnPaste",dH);Y1e=JMn([KK(1,Zn),KK(2,$n)],Y1e);class S6o extends Nn{constructor(){super({id:"editor.action.formatDocument",label:Et(1014,"Format Document"),precondition:zt.and(Ze.notInCompositeEditor,Ze.writable,Ze.hasDocumentFormattingProvider),kbOpts:{kbExpr:Ze.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(t,n){if(n.hasModel()){const r=t.get($n);await t.get(e6).showWhile(r.invokeFunction(y6o,n,1,nO.None,Fr.None,!0),250)}}}class T6o extends Nn{constructor(){super({id:"editor.action.formatSelection",label:Et(1015,"Format Selection"),precondition:zt.and(Ze.writable,Ze.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2084),weight:100},contextMenuOpts:{when:Ze.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(t,n){if(!n.hasModel())return;const r=t.get($n),o=n.getModel(),s=n.getSelections().map(l=>l.isEmpty()?new De(l.startLineNumber,1,l.startLineNumber,o.getLineMaxColumn(l.startLineNumber)):l);await t.get(e6).showWhile(r.invokeFunction(GMn,n,s,1,nO.None,Fr.None,!0),250)}}mo(Z1e.ID,Z1e,2);mo(Y1e.ID,Y1e,2);gn(S6o);gn(T6o);ho.registerCommand("editor.action.format",async e=>{const t=e.get(Co).getFocusedCodeEditor();if(!t||!t.hasModel())return;const n=e.get(Ca);t.getSelection().isEmpty()?await n.executeCommand("editor.action.formatDocument"):await n.executeCommand("editor.action.formatSelection")});var E6o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},K9e=function(e,t){return function(n,r){t(n,r,e)}};class UU{remove(){var t;(t=this.parent)==null||t.children.delete(this.id)}static findId(t,n){let r;typeof t=="string"?r=`${n.id}/${t}`:(r=`${n.id}/${t.name}`,n.children.get(r)!==void 0&&(r=`${n.id}/${t.name}_${t.range.startLineNumber}_${t.range.startColumn}`));let o=r;for(let s=0;n.children.get(o)!==void 0;s++)o=`${r}_${s}`;return o}static empty(t){return t.children.size===0}}class yVe extends UU{constructor(t,n,r){super(),this.id=t,this.parent=n,this.symbol=r,this.children=new Map}}class _Mn extends UU{constructor(t,n,r,o){super(),this.id=t,this.parent=n,this.label=r,this.order=o,this.children=new Map}}class fL extends UU{static create(t,n,r){const o=new Ya(r),s=new fL(n.uri),a=t.ordered(n),l=a.map((u,h)=>{const f=UU.findId(`provider_${h}`,s),g=new _Mn(f,s,u.displayName??"Unknown Outline Provider",h);return Promise.resolve(u.provideDocumentSymbols(n,o.token)).then(k=>{for(const A of k||[])fL._makeOutlineElement(A,g);return g},k=>(Xc(k),g)).then(k=>{UU.empty(k)?k.remove():s._groups.set(f,k)})}),d=t.onDidChange(()=>{const u=t.ordered(n);za(u,a)||o.cancel()});return Promise.all(l).then(()=>o.token.isCancellationRequested&&!r.isCancellationRequested?fL.create(t,n,r):s._compact()).finally(()=>{o.dispose(),d.dispose(),o.dispose()})}static _makeOutlineElement(t,n){const r=UU.findId(t,n),o=new yVe(r,n,t);if(t.children)for(const s of t.children)fL._makeOutlineElement(s,o);n.children.set(o.id,o)}constructor(t){super(),this.uri=t,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let t=0;for(const[n,r]of this._groups)r.children.size===0?this._groups.delete(n):t+=1;if(t!==1)this.children=this._groups;else{const n=lo.first(this._groups.values());for(const[,r]of n.children)r.parent=this,this.children.set(r.id,r)}return this}getTopLevelSymbols(){const t=[];for(const n of this.children.values())n instanceof yVe?t.push(n.symbol):t.push(...lo.map(n.children.values(),r=>r.symbol));return t.sort((n,r)=>De.compareRangesUsingStarts(n.range,r.range))}asListOfDocumentSymbols(){const t=this.getTopLevelSymbols(),n=[];return fL._flattenDocumentSymbols(n,t,""),n.sort((r,o)=>tt.compare(De.getStartPosition(r.range),De.getStartPosition(o.range))||tt.compare(De.getEndPosition(o.range),De.getEndPosition(r.range)))}static _flattenDocumentSymbols(t,n,r){for(const o of n)t.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||r,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&fL._flattenDocumentSymbols(t,o.children,o.name)}}const Cre=Lr("IOutlineModelService");let CVe=class{constructor(t,n,r){this._languageFeaturesService=t,this._disposables=new Pt,this._cache=new S4(15,.7),this._debounceInformation=n.for(t.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(r.onModelRemoved(o=>{this._cache.delete(o.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(t,n){const r=this._languageFeaturesService.documentSymbolProvider,o=r.ordered(t);let s=this._cache.get(t.id);if(!s||s.versionId!==t.getVersionId()||!za(s.provider,o)){const l=new Ya;s={versionId:t.getVersionId(),provider:o,promiseCnt:0,source:l,promise:fL.create(r,t,l.token),model:void 0},this._cache.set(t.id,s);const d=Date.now();s.promise.then(u=>{s.model=u,this._debounceInformation.update(t,Date.now()-d)}).catch(u=>{this._cache.delete(t.id)})}if(s.model)return s.model;s.promiseCnt+=1;const a=n.onCancellationRequested(()=>{--s.promiseCnt===0&&(s.source.cancel(),this._cache.delete(t.id))});try{return await s.promise}finally{a.dispose()}}};CVe=E6o([K9e(0,Zn),K9e(1,L2),K9e(2,pl)],CVe);qr(Cre,CVe,1);ho.registerCommand("_executeDocumentSymbolProvider",async function(e,...t){const[n]=t;yo(pi.isUri(n));const r=e.get(Cre),s=await e.get(Uf).createModelReference(n);try{return(await r.getOrCreate(s.object.textEditorModel,Fr.None)).getTopLevelSymbols()}finally{s.dispose()}});const $Oe=new class{constructor(){this._implementations=[]}register(t){return this._implementations.push(t),{dispose:()=>{const n=this._implementations.indexOf(t);n!==-1&&this._implementations.splice(n,1)}}}getImplementations(){return this._implementations}};var D6o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Q6o=function(e,t){return function(n,r){t(n,r,e)}};function B6o(e){return e instanceof $Mn?e._instance:e}let $Mn=class{constructor(t){this.instantiationService=t}init(...t){}};function F6o(e){return e.get()}let ext=class extends $Mn{constructor(t,n){super(n),this.init(t)}};ext=D6o([Q6o(1,$n)],ext);class xre{validateOrThrow(t){const n=this.validate(t);if(n.error)throw new Error(n.error.message);return n.content}}class e3e extends xre{constructor(t){super(),this.type=t}validate(t){return typeof t!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof t}`}}:{content:t,error:void 0}}getJSONSchema(){return{type:this.type}}}const P6o=new e3e("string");function M6o(){return P6o}new e3e("number");const R6o=new e3e("boolean");function txt(){return R6o}new e3e("object");class eRn extends xre{validate(t){return t!==void 0?{content:void 0,error:{message:`Expected undefined, but got ${typeof t}`}}:{content:void 0,error:void 0}}getJSONSchema(){return{}}}function I6o(){return new eRn}class xVe{constructor(t){this.validator=t}}function J9e(e){return new xVe(e)}class N6o extends xre{constructor(t){super(),this.properties=t}validate(t){if(typeof t!="object"||t===null)return{content:void 0,error:{message:"Expected object"}};const n={};for(const r in this.properties){const o=this.properties[r],s=t[r],a=o instanceof xVe,l=a?o.validator:o;if(a&&s===void 0)continue;const{content:d,error:u}=l.validate(s);if(u)return{content:void 0,error:{message:`Error in property '${r}': ${u.message}`}};n[r]=d}return{content:n,error:void 0}}getJSONSchema(){const t=[],n={};for(const[o,s]of Object.entries(this.properties)){const a=s instanceof xVe,l=a?s.validator:s;n[o]=l.getJSONSchema(),a||t.push(o)}return{type:"object",properties:n,...t.length>0?{required:t}:{}}}}function U6o(e){return new N6o(e)}class j6o extends xre{constructor(t){super(),this.validators=t}validate(t){let n;for(const r of this.validators){const{content:o,error:s}=r.validate(t);if(!s)return{content:o,error:void 0};n=s}return{content:void 0,error:n}}getJSONSchema(){return{oneOf:Elo(this.validators,t=>{if(!(t instanceof eRn))return t.getJSONSchema()})}}}function W6o(...e){return new j6o(e)}class H6o extends xre{constructor(t,n){super(),this._ref=t,this._validator=n}validate(t){return this._validator.validate(t)}getJSONSchema(){return{$ref:this._ref}}}function V6o(e,t){return new H6o(e,t)}const Tr={Visible:Pnt,HasFocusedSuggestion:new Ln("suggestWidgetHasFocusedSuggestion",!1,j(1455,"Whether any suggestion is focused")),DetailsVisible:new Ln("suggestWidgetDetailsVisible",!1,j(1456,"Whether suggestion details are visible")),MultipleSuggestions:new Ln("suggestWidgetMultipleSuggestions",!1,j(1457,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Ln("suggestionMakesTextEdit",!0,j(1458,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Ln("acceptSuggestionOnEnter",!0,j(1459,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Ln("suggestionHasInsertAndReplaceRange",!1,j(1460,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Ln("suggestionInsertMode",void 0,{type:"string",description:j(1461,"Whether the default behaviour is to insert or replace")}),CanResolve:new Ln("suggestionCanResolve",!1,j(1462,"Whether the current suggestion supports to resolve further details"))},eT=new Yn("suggestWidgetStatusBar");let z6o=class{constructor(t,n,r,o){var s;this.position=t,this.completion=n,this.container=r,this.provider=o,this.isInvalid=!1,this.score=e4.Default,this.distance=0,this.textLabel=typeof n.label=="string"?n.label:(s=n.label)==null?void 0:s.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=n.sortText&&n.sortText.toLowerCase(),this.filterTextLow=n.filterText&&n.filterText.toLowerCase(),this.extensionId=n.extensionId,De.isIRange(n.range)?(this.editStart=new tt(n.range.startLineNumber,n.range.startColumn),this.editInsertEnd=new tt(n.range.endLineNumber,n.range.endColumn),this.editReplaceEnd=new tt(n.range.endLineNumber,n.range.endColumn),this.isInvalid=this.isInvalid||De.spansMultipleLines(n.range)||n.range.startLineNumber!==t.lineNumber):(this.editStart=new tt(n.range.insert.startLineNumber,n.range.insert.startColumn),this.editInsertEnd=new tt(n.range.insert.endLineNumber,n.range.insert.endColumn),this.editReplaceEnd=new tt(n.range.replace.endLineNumber,n.range.replace.endColumn),this.isInvalid=this.isInvalid||De.spansMultipleLines(n.range.insert)||De.spansMultipleLines(n.range.replace)||n.range.insert.startLineNumber!==t.lineNumber||n.range.replace.startLineNumber!==t.lineNumber||n.range.insert.startColumn!==n.range.replace.startColumn),typeof o.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(t){if(!this._resolveCache){const n=t.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),r=new wu(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,t)).then(o=>{Object.assign(this.completion,o),this._resolveDuration=r.elapsed()},o=>{Sk(o)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{n.dispose()})}return this._resolveCache}};const x2e=class x2e{constructor(t=2,n=new Set,r=new Set,o=new Map,s=!0){this.snippetSortOrder=t,this.kindFilter=n,this.providerFilter=r,this.providerItemsToReuse=o,this.showDeprecated=s}};x2e.default=new x2e;let kee=x2e;class Z6o{constructor(t,n,r,o){this.items=t,this.needsClipboard=n,this.durations=r,this.disposable=o}}async function git(e,t,n,r=kee.default,o={triggerKind:0},s=Fr.None){const a=new wu;n=n.clone();const l=t.getWordAtPosition(n),d=l?new De(n.lineNumber,l.startColumn,n.lineNumber,l.endColumn):De.fromPositions(n),u={replace:d,insert:d.setEndPosition(n.lineNumber,n.column)},h=[],f=new Pt,g=[];let k=!1;const A=(v,p,b)=>{var w;let O=!1;if(!p)return O;for(const y of p.suggestions)if(!r.kindFilter.has(y.kind)){if(!r.showDeprecated&&((w=y==null?void 0:y.tags)!=null&&w.includes(1)))continue;y.range||(y.range=u),y.sortText||(y.sortText=typeof y.label=="string"?y.label:y.label.label),!k&&y.insertTextRules&&y.insertTextRules&4&&(k=MP.guessNeedsClipboard(y.insertText)),h.push(new z6o(n,y,p,v)),O=!0}return BM(p)&&f.add(p),g.push({providerName:v._debugDisplayName??"unknown_provider",elapsedProvider:p.duration??-1,elapsedOverall:b.elapsed()}),O},m=(async()=>{})();for(const v of e.orderedGroups(t)){let p=!1;if(await Promise.all(v.map(async b=>{if(r.providerItemsToReuse.has(b)){const O=r.providerItemsToReuse.get(b);O.forEach(w=>h.push(w)),p=p||O.length>0;return}if(!(r.providerFilter.size>0&&!r.providerFilter.has(b)))try{const O=new wu,w=await b.provideCompletionItems(t,n,o,s);p=A(b,w,O)||p}catch(O){Xc(O)}})),p||s.isCancellationRequested)break}return await m,s.isCancellationRequested?(f.dispose(),Promise.reject(new u2)):new Z6o(h.sort(q6o(r.snippetSortOrder)),k,{entries:g,elapsed:a.elapsed()},f)}function mit(e,t){if(e.sortTextLow&&t.sortTextLow){if(e.sortTextLowt.sortTextLow)return 1}return e.textLabelt.textLabel?1:e.completion.kind-t.completion.kind}function Y6o(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===28)return-1;if(t.completion.kind===28)return 1}return mit(e,t)}function X6o(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===28)return 1;if(t.completion.kind===28)return-1}return mit(e,t)}const t3e=new Map;t3e.set(0,Y6o);t3e.set(2,X6o);t3e.set(1,mit);function q6o(e){return t3e.get(e)}ho.registerCommand("_executeCompletionItemProvider",async(e,...t)=>{const[n,r,o,s]=t;yo(pi.isUri(n)),yo(tt.isIPosition(r)),yo(typeof o=="string"||!o),yo(typeof s=="number"||!s);const{completionProvider:a}=e.get(Zn),l=await e.get(Uf).createModelReference(n);try{const d={incomplete:!1,suggestions:[]},u=[],h=l.object.textEditorModel.validatePosition(r),f=await git(a,l.object.textEditorModel,h,void 0,{triggerCharacter:o??void 0,triggerKind:o?1:0});for(const g of f.items)u.length<(s??0)&&u.push(g.resolve(Fr.None)),d.incomplete=d.incomplete||g.container.incomplete,d.suggestions.push(g.completion);try{return await Promise.all(u),d}finally{setTimeout(()=>f.disposable.dispose(),100)}}finally{l.dispose()}});function G6o(e,t){var n;(n=e.getContribution("editor.contrib.suggestController"))==null||n.triggerSuggest(new Set().add(t),void 0,!0)}class jU{static isAllOff(t){return t.other==="off"&&t.comments==="off"&&t.strings==="off"}static isAllOn(t){return t.other==="on"&&t.comments==="on"&&t.strings==="on"}static valueFor(t,n){switch(n){case 1:return t.comments;case 2:return t.strings;default:return t.other}}}const D0=class D0{};D0.inlineSuggestionVisible=new Ln("inlineSuggestionVisible",!1,j(1192,"Whether an inline suggestion is visible")),D0.inlineSuggestionHasIndentation=new Ln("inlineSuggestionHasIndentation",!1,j(1193,"Whether the inline suggestion starts with whitespace")),D0.inlineSuggestionHasIndentationLessThanTabSize=new Ln("inlineSuggestionHasIndentationLessThanTabSize",!0,j(1194,"Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")),D0.suppressSuggestions=new Ln("inlineSuggestionSuppressSuggestions",void 0,j(1195,"Whether suggestions should be suppressed for the current suggestion")),D0.cursorBeforeGhostText=new Ln("cursorBeforeGhostText",!1,j(1196,"Whether the cursor is at ghost text")),D0.cursorInIndentation=new Ln("cursorInIndentation",!1,j(1197,"Whether the cursor is in indentation")),D0.hasSelection=new Ln("editor.hasSelection",!1,j(1198,"Whether the editor has a selection")),D0.cursorAtInlineEdit=new Ln("cursorAtInlineEdit",!1,j(1199,"Whether the cursor is at an inline edit")),D0.inlineEditVisible=new Ln("inlineEditIsVisible",!1,j(1200,"Whether an inline edit is visible")),D0.tabShouldJumpToInlineEdit=new Ln("tabShouldJumpToInlineEdit",!1,j(1201,"Whether tab should jump to an inline edit.")),D0.tabShouldAcceptInlineEdit=new Ln("tabShouldAcceptInlineEdit",!1,j(1202,"Whether tab should accept the inline edit.")),D0.inInlineEditsPreviewEditor=new Ln("inInlineEditsPreviewEditor",!0,j(1203,"Whether the current code editor is showing an inline edits preview"));let Ws=D0;class K6o{constructor(t,n,r){this._selection=t,this._cursors=n,this._selectionId=null,this._trimInRegexesAndStrings=r}getEditOperations(t,n){const r=J6o(t,this._cursors,this._trimInRegexesAndStrings);for(let o=0,s=r.length;ol.lineNumber===d.lineNumber?l.column-d.column:l.lineNumber-d.lineNumber);for(let l=t.length-2;l>=0;l--)t[l].lineNumber===t[l+1].lineNumber&&t.splice(l,1);const r=[];let o=0,s=0;const a=t.length;for(let l=1,d=e.getLineCount();l<=d;l++){const u=e.getLineContent(l),h=u.length+1;let f=0;if(s=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},$6o=function(e,t){return function(n,r){t(n,r,e)}};let LVe=class{constructor(t,n,r,o){this._languageConfigurationService=o,this._selection=t,this._isMovingDown=n,this._autoIndent=r,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(t,n){const r=()=>t.getLanguageId(),o=(f,g)=>t.getLanguageIdAtPosition(f,g),s=t.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===s){this._selectionId=n.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=n.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let a=this._selection;a.startLineNumberb===a.startLineNumber?t.tokenization.getLineTokens(f):t.tokenization.getLineTokens(b),getLanguageId:r,getLanguageIdAtPosition:o},getLineContent:b=>b===a.startLineNumber?t.getLineContent(f):t.getLineContent(b)},p=TK(this._autoIndent,v,t.getLanguageIdAtPosition(f,1),a.startLineNumber,h,this._languageConfigurationService);if(p!==null){const b=_s(t.getLineContent(f)),O=d1(p,l),w=d1(b,l);O!==w&&(k=JK(O,l,u)+this.trimStart(g))}}n.addEditOperation(new De(a.startLineNumber,1,a.startLineNumber,1),k+` `);const m=this.matchEnterRuleMovingDown(t,h,l,a.startLineNumber,f,k);if(m!==null)m!==0&&this.getIndentEditsOfMovingBlock(t,n,a,l,u,m);else{const v={tokenization:{getLineTokens:b=>b===a.startLineNumber?t.tokenization.getLineTokens(f):b>=a.startLineNumber+1&&b<=a.endLineNumber+1?t.tokenization.getLineTokens(b-1):t.tokenization.getLineTokens(b),getLanguageId:r,getLanguageIdAtPosition:o},getLineContent:b=>b===a.startLineNumber?k:b>=a.startLineNumber+1&&b<=a.endLineNumber+1?t.getLineContent(b-1):t.getLineContent(b)},p=TK(this._autoIndent,v,t.getLanguageIdAtPosition(f,1),a.startLineNumber+1,h,this._languageConfigurationService);if(p!==null){const b=_s(t.getLineContent(a.startLineNumber)),O=d1(p,l),w=d1(b,l);if(O!==w){const y=O-w;this.getIndentEditsOfMovingBlock(t,n,a,l,u,y)}}}}else n.addEditOperation(new De(a.startLineNumber,1,a.startLineNumber,1),k+` `)}else if(f=a.startLineNumber-1,g=t.getLineContent(f),n.addEditOperation(new De(f,1,f+1,1),null),n.addEditOperation(new De(a.endLineNumber,t.getLineMaxColumn(a.endLineNumber),a.endLineNumber,t.getLineMaxColumn(a.endLineNumber)),` `+g),this.shouldAutoIndent(t,a)){const k={tokenization:{getLineTokens:m=>m===f?t.tokenization.getLineTokens(a.startLineNumber):t.tokenization.getLineTokens(m),getLanguageId:r,getLanguageIdAtPosition:o},getLineContent:m=>m===f?t.getLineContent(a.startLineNumber):t.getLineContent(m)},A=this.matchEnterRule(t,h,l,a.startLineNumber,a.startLineNumber-2);if(A!==null)A!==0&&this.getIndentEditsOfMovingBlock(t,n,a,l,u,A);else{const m=TK(this._autoIndent,k,t.getLanguageIdAtPosition(a.startLineNumber,1),f,h,this._languageConfigurationService);if(m!==null){const v=_s(t.getLineContent(a.startLineNumber)),p=d1(m,l),b=d1(v,l);if(p!==b){const O=p-b;this.getIndentEditsOfMovingBlock(t,n,a,l,u,O)}}}}}this._selectionId=n.trackSelection(a)}buildIndentConverter(t,n,r){return{shiftIndent:o=>k2.shiftIndent(o,o.length+1,t,n,r),unshiftIndent:o=>k2.unshiftIndent(o,o.length+1,t,n,r)}}parseEnterResult(t,n,r,o,s){if(s){let a=s.indentation;s.indentAction===ad.None||s.indentAction===ad.Indent?a=s.indentation+s.appendText:s.indentAction===ad.IndentOutdent?a=s.indentation:s.indentAction===ad.Outdent&&(a=n.unshiftIndent(s.indentation)+s.appendText);const l=t.getLineContent(o);if(this.trimStart(l).indexOf(this.trimStart(a))>=0){const d=_s(t.getLineContent(o));let u=_s(a);const h=fDn(t,o,this._languageConfigurationService);h!==null&&h&2&&(u=n.unshiftIndent(u));const f=d1(u,r),g=d1(d,r);return f-g}}return null}matchEnterRuleMovingDown(t,n,r,o,s,a){if($p(a)>=0){const l=t.getLineMaxColumn(s),d=qj(this._autoIndent,t,new De(s,l,s,l),this._languageConfigurationService);return this.parseEnterResult(t,n,r,o,d)}else{let l=o-1;for(;l>=1;){const h=t.getLineContent(l);if($p(h)>=0)break;l--}if(l<1||o>t.getLineCount())return null;const d=t.getLineMaxColumn(l),u=qj(this._autoIndent,t,new De(l,d,l,d),this._languageConfigurationService);return this.parseEnterResult(t,n,r,o,u)}}matchEnterRule(t,n,r,o,s,a){let l=s;for(;l>=1;){let h;if(l===s&&a!==void 0?h=a:h=t.getLineContent(l),$p(h)>=0)break;l--}if(l<1||o>t.getLineCount())return null;const d=t.getLineMaxColumn(l),u=qj(this._autoIndent,t,new De(l,d,l,d),this._languageConfigurationService);return this.parseEnterResult(t,n,r,o,u)}trimStart(t){return t.replace(/^\s+/,"")}shouldAutoIndent(t,n){if(this._autoIndent<4||!t.tokenization.isCheapToTokenize(n.startLineNumber))return!1;const r=t.getLanguageIdAtPosition(n.startLineNumber,1),o=t.getLanguageIdAtPosition(n.endLineNumber,1);return!(r!==o||this._languageConfigurationService.getLanguageConfiguration(r).indentRulesSupport===null)}getIndentEditsOfMovingBlock(t,n,r,o,s,a){for(let l=r.startLineNumber;l<=r.endLineNumber;l++){const d=t.getLineContent(l),u=_s(d),f=d1(u,o)+a,g=JK(f,o,s);g!==u&&(n.addEditOperation(new De(l,1,l,u.length+1),g),l===r.endLineNumber&&r.endColumn<=u.length+1&&g===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(t,n){let r=n.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(r=r.setEndPosition(r.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&r.startLineNumber=o)return null;const s=[];for(let l=r;l<=o;l++)s.push(e.getLineContent(l));let a=s.slice(0);return a.sort(vee._COLLATOR.value.compare),n===!0&&(a=a.reverse()),{startLineNumber:r,endLineNumber:o,before:s,after:a}}function e9o(e,t,n){const r=nRn(e,t,n);return r?Jl.replace(new De(r.startLineNumber,1,r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),r.after.join(` `)):null}class iRn extends Nn{constructor(t,n){super(n),this.down=t}run(t,n){if(!n.hasModel())return;const r=n.getSelections().map((a,l)=>({selection:a,index:l,ignore:!1}));r.sort((a,l)=>De.compareRangesUsingStarts(a.selection,l.selection));let o=r[0];for(let a=1;a=g.startLineNumber;p--)k.push(r.getLineContent(p));const A=Jl.replace(g,k.join(` `));a.push(A);const m=function(p){return p<=g.endLineNumber?g.endLineNumber-p+g.startLineNumber:p},v=function(p){if(p.isEmpty())return new Rn(m(p.positionLineNumber),p.positionColumn,m(p.positionLineNumber),p.positionColumn);{const b=m(p.selectionStartLineNumber),O=m(p.positionLineNumber),w=p.selectionStartColumn,y=p.positionColumn;return new Rn(b,w,O,y)}};l.push(v(h))}n.pushUndoStop(),n.executeEdits(this.id,a,l),n.pushUndoStop()}}const L2e=class L2e extends Nn{constructor(){super({id:L2e.ID,label:Et(1258,"Trim Trailing Whitespace"),precondition:Ze.writable,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2102),weight:100}})}run(t,n,r){let o=[];r.reason==="auto-save"&&(o=(n.getSelections()||[]).map(h=>new tt(h.positionLineNumber,h.positionColumn)));const s=n.getSelection();if(s===null)return;const a=t.get(cr),l=n.getModel(),d=a.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:l==null?void 0:l.getLanguageId(),resource:l==null?void 0:l.uri}),u=new K6o(s,o,d);n.pushUndoStop(),n.executeCommands(this.id,[u]),n.pushUndoStop()}};L2e.ID="editor.action.trimTrailingWhitespace";let SVe=L2e;class d9o extends Nn{constructor(){super({id:"editor.action.deleteLines",label:Et(1259,"Delete Line"),precondition:Ze.writable,kbOpts:{kbExpr:Ze.textInputFocus,primary:3113,weight:100},canTriggerInlineEdits:!0})}run(t,n){if(!n.hasModel())return;const r=this._getLinesToRemove(n),o=n.getModel();if(o.getLineCount()===1&&o.getLineMaxColumn(1)===1)return;let s=0;const a=[],l=[];for(let d=0,u=r.length;d1&&(f-=1,k=o.getLineMaxColumn(f)),a.push(Jl.replace(new Rn(f,k,g,A),"")),l.push(new Rn(f-s,h.positionColumn,f-s,h.positionColumn)),s+=h.endLineNumber-h.startLineNumber+1}n.pushUndoStop(),n.executeEdits(this.id,a,l),n.pushUndoStop()}_getLinesToRemove(t){const n=t.getSelections().map(s=>{let a=s.endLineNumber;return s.startLineNumbers.startLineNumber===a.startLineNumber?s.endLineNumber-a.endLineNumber:s.startLineNumber-a.startLineNumber);const r=[];let o=n[0];for(let s=1;s=n[s].startLineNumber?o.endLineNumber=n[s].endLineNumber:(r.push(o),o=n[s]);return r.push(o),r}}class u9o extends Nn{constructor(){super({id:"editor.action.indentLines",label:Et(1260,"Indent Line"),precondition:Ze.writable,kbOpts:{kbExpr:Ze.editorTextFocus,primary:2142,weight:100},canTriggerInlineEdits:!0})}run(t,n){const r=n._getViewModel();r&&(n.pushUndoStop(),n.executeCommands(this.id,jS.indent(r.cursorConfig,n.getModel(),n.getSelections())),n.pushUndoStop())}}class h9o extends Nn{constructor(){super({id:"editor.action.outdentLines",label:Et(1261,"Outdent Line"),precondition:Ze.writable,kbOpts:{kbExpr:Ze.editorTextFocus,primary:2140,weight:100},canTriggerInlineEdits:!0})}run(t,n){Gj.Outdent.runEditorCommand(t,n,null)}}const S2e=class S2e extends Nn{constructor(){super({id:S2e.ID,label:Et(1262,"Insert Line Above"),precondition:Ze.writable,kbOpts:{kbExpr:Ze.editorTextFocus,primary:3075,weight:100},canTriggerInlineEdits:!0})}run(t,n){const r=n._getViewModel();r&&(n.pushUndoStop(),n.executeCommands(this.id,oOe.lineInsertBefore(r.cursorConfig,n.getModel(),n.getSelections())))}};S2e.ID="editor.action.insertLineBefore";let X1e=S2e;const T2e=class T2e extends Nn{constructor(){super({id:T2e.ID,label:Et(1263,"Insert Line Below"),precondition:Ze.writable,kbOpts:{kbExpr:Ze.editorTextFocus,primary:2051,weight:100},canTriggerInlineEdits:!0})}run(t,n){const r=n._getViewModel();r&&(n.pushUndoStop(),n.executeCommands(this.id,oOe.lineInsertAfter(r.cursorConfig,n.getModel(),n.getSelections())))}};T2e.ID="editor.action.insertLineAfter";let q1e=T2e;class sRn extends Nn{run(t,n){if(!n.hasModel())return;const r=n.getSelection(),o=this._getRangesToDelete(n),s=[];for(let d=0,u=o.length-1;dJl.replace(d,""));n.pushUndoStop(),n.executeEdits(this.id,l,a),n.pushUndoStop()}}class A9o extends sRn{constructor(){super({id:"deleteAllLeft",label:Et(1264,"Delete All Left"),precondition:Ze.writable,kbOpts:{kbExpr:Ze.textInputFocus,primary:0,mac:{primary:2049},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(t,n){let r=null;const o=[];let s=0;return n.forEach(a=>{let l;if(a.endColumn===1&&s>0){const d=a.startLineNumber-s;l=new Rn(d,a.startColumn,d,a.startColumn)}else l=new Rn(a.startLineNumber,a.startColumn,a.startLineNumber,a.startColumn);s+=a.endLineNumber-a.startLineNumber,a.intersectRanges(t)?r=l:o.push(l)}),r&&o.unshift(r),o}_getRangesToDelete(t){const n=t.getSelections();if(n===null)return[];let r=n;const o=t.getModel();return o===null?[]:(r.sort(De.compareRangesUsingStarts),r=r.map(s=>{if(s.isEmpty())if(s.startColumn===1){const a=Math.max(1,s.startLineNumber-1),l=s.startLineNumber===1?1:o.getLineLength(a)+1;return new De(a,l,s.startLineNumber,1)}else return new De(s.startLineNumber,1,s.startLineNumber,s.startColumn);else return new De(s.startLineNumber,1,s.endLineNumber,s.endColumn)}),r)}}class f9o extends sRn{constructor(){super({id:"deleteAllRight",label:Et(1265,"Delete All Right"),precondition:Ze.writable,kbOpts:{kbExpr:Ze.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(t,n){let r=null;const o=[];for(let s=0,a=n.length,l=0;s{if(s.isEmpty()){const a=n.getLineMaxColumn(s.startLineNumber);return s.startColumn===a?new De(s.startLineNumber,s.startColumn,s.startLineNumber+1,1):new De(s.startLineNumber,s.startColumn,s.startLineNumber,a)}return s});return o.sort(De.compareRangesUsingStarts),o}}class g9o extends Nn{constructor(){super({id:"editor.action.joinLines",label:Et(1266,"Join Lines"),precondition:Ze.writable,kbOpts:{kbExpr:Ze.editorTextFocus,primary:0,mac:{primary:296},weight:100},canTriggerInlineEdits:!0})}run(t,n){const r=n.getSelections();if(r===null)return;let o=n.getSelection();if(o===null)return;r.sort(De.compareRangesUsingStarts);const s=[],a=r.reduce((g,k)=>g.isEmpty()?g.endLineNumber===k.startLineNumber?(o.equalsSelection(g)&&(o=k),k):k.startLineNumber>g.endLineNumber+1?(s.push(g),k):new Rn(g.startLineNumber,g.startColumn,k.endLineNumber,k.endColumn):k.startLineNumber>g.endLineNumber?(s.push(g),k):new Rn(g.startLineNumber,g.startColumn,k.endLineNumber,k.endColumn));s.push(a);const l=n.getModel();if(l===null)return;const d=[],u=[];let h=o,f=0;for(let g=0,k=s.length;g=1){let E=!0;y===""&&(E=!1),E&&(y.charAt(y.length-1)===" "||y.charAt(y.length-1)===" ")&&(E=!1,y=y.replace(/[\s\uFEFF\xA0]+$/g," "));const Q=L.substr(S-1);y+=(E?" ":"")+Q,E?p=Q.length+1:p=Q.length}else p=0}const C=new De(m,v,b,O);if(!C.isEmpty()){let x;A.isEmpty()?(d.push(Jl.replace(C,y)),x=new Rn(C.startLineNumber-f,y.length-p+1,m-f,y.length-p+1)):A.startLineNumber===A.endLineNumber?(d.push(Jl.replace(C,y)),x=new Rn(A.startLineNumber-f,A.startColumn,A.endLineNumber-f,A.endColumn)):(d.push(Jl.replace(C,y)),x=new Rn(A.startLineNumber-f,A.startColumn,A.startLineNumber-f,y.length-w)),De.intersectRanges(C,o)!==null?h=x:u.push(x)}f+=C.endLineNumber-C.startLineNumber}u.unshift(h),n.pushUndoStop(),n.executeEdits(this.id,d,u),n.pushUndoStop()}}class m9o extends Nn{constructor(){super({id:"editor.action.transpose",label:Et(1267,"Transpose Characters around the Cursor"),precondition:Ze.writable,canTriggerInlineEdits:!0})}run(t,n){const r=n.getSelections();if(r===null)return;const o=n.getModel();if(o===null)return;const s=[];for(let a=0,l=r.length;a=h){if(u.lineNumber===o.getLineCount())continue;const f=new De(u.lineNumber,Math.max(1,u.column-1),u.lineNumber+1,1),g=o.getValueInRange(f).split("").reverse().join("");s.push(new Jh(new Rn(u.lineNumber,Math.max(1,u.column-1),u.lineNumber+1,1),g))}else{const f=new De(u.lineNumber,Math.max(1,u.column-1),u.lineNumber,u.column+1),g=o.getValueInRange(f).split("").reverse().join("");s.push(new Wet(f,g,new Rn(u.lineNumber,u.column+1,u.lineNumber,u.column+1)))}}n.pushUndoStop(),n.executeCommands(this.id,s),n.pushUndoStop()}}class JM extends Nn{run(t,n){const r=n.getSelections();if(r===null)return;const o=n.getModel();if(o===null)return;const s=n.getOption(148),a=[];for(const l of r)if(l.isEmpty()){const d=l.getStartPosition(),u=n.getConfiguredWordAtPosition(d);if(!u)continue;const h=new De(d.lineNumber,u.startColumn,d.lineNumber,u.endColumn),f=o.getValueInRange(h);a.push(Jl.replace(h,this._modifyText(f,s)))}else{const d=o.getValueInRange(l);a.push(Jl.replace(l,this._modifyText(d,s)))}n.pushUndoStop(),n.executeEdits(this.id,a),n.pushUndoStop()}}class k9o extends JM{constructor(){super({id:"editor.action.transformToUppercase",label:Et(1268,"Transform to Uppercase"),precondition:Ze.writable,canTriggerInlineEdits:!0})}_modifyText(t,n){return t.toLocaleUpperCase()}}class v9o extends JM{constructor(){super({id:"editor.action.transformToLowercase",label:Et(1269,"Transform to Lowercase"),precondition:Ze.writable,canTriggerInlineEdits:!0})}_modifyText(t,n){return t.toLocaleLowerCase()}}class t4{constructor(t,n){this._pattern=t,this._flags=n,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}const E2e=class E2e extends JM{constructor(){super({id:"editor.action.transformToTitlecase",label:Et(1270,"Transform to Title Case"),precondition:Ze.writable,canTriggerInlineEdits:!0})}_modifyText(t,n){const r=E2e.titleBoundary.get();return r?t.toLocaleLowerCase().replace(r,o=>o.toLocaleUpperCase()):t}};E2e.titleBoundary=new t4("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let G1e=E2e;const Oj=class Oj extends JM{constructor(){super({id:"editor.action.transformToSnakecase",label:Et(1271,"Transform to Snake Case"),precondition:Ze.writable,canTriggerInlineEdits:!0})}_modifyText(t,n){const r=Oj.caseBoundary.get(),o=Oj.singleLetters.get();return!r||!o?t:t.replace(r,"$1_$2").replace(o,"$1_$2$3").toLocaleLowerCase()}};Oj.caseBoundary=new t4("(\\p{Ll})(\\p{Lu})","gmu"),Oj.singleLetters=new t4("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let _K=Oj;const FS=class FS extends JM{constructor(){super({id:"editor.action.transformToCamelcase",label:Et(1272,"Transform to Camel Case"),precondition:Ze.writable,canTriggerInlineEdits:!0})}_modifyText(t,n){var l;const r=/\r\n|\r|\n/.test(t)?FS.multiLineWordBoundary.get():FS.singleLineWordBoundary.get(),o=FS.validWordStart.get();if(!r||!o)return t;const s=t.split(r);return((l=s.shift())==null?void 0:l.replace(o,d=>d.toLocaleLowerCase()))+s.map(d=>d.substring(0,1).toLocaleUpperCase()+d.substring(1)).join("")}};FS.singleLineWordBoundary=new t4("[_\\s-]+","gm"),FS.multiLineWordBoundary=new t4("[_-]+","gm"),FS.validWordStart=new t4("^(\\p{Lu}[^\\p{Lu}])","gmu");let $K=FS;const PS=class PS extends JM{constructor(){super({id:"editor.action.transformToPascalcase",label:Et(1273,"Transform to Pascal Case"),precondition:Ze.writable,canTriggerInlineEdits:!0})}_modifyText(t,n){const r=PS.wordBoundary.get(),o=PS.wordBoundaryToMaintain.get(),s=PS.upperCaseWordMatcher.get();return!r||!o||!s?t:t.split(o).map(d=>d.split(r)).flat().map(d=>{const u=d.charAt(0).toLocaleUpperCase()+d.slice(1);return u.length>1&&s.test(u)?u.charAt(0)+u.slice(1).toLocaleLowerCase():u}).join("")}};PS.wordBoundary=new t4("[_ \\t-]","gm"),PS.wordBoundaryToMaintain=new t4("(?<=\\.)","gm"),PS.upperCaseWordMatcher=new t4("^\\p{Lu}+$","mu");let K1e=PS;const MS=class MS extends JM{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(n=>n.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:Et(1274,"Transform to Kebab Case"),precondition:Ze.writable,canTriggerInlineEdits:!0})}_modifyText(t,n){const r=MS.caseBoundary.get(),o=MS.singleLetters.get(),s=MS.underscoreBoundary.get();return!r||!o||!s?t:t.replace(s,"$1-$3").replace(r,"$1-$2").replace(o,"$1-$2").toLocaleLowerCase()}};MS.caseBoundary=new t4("(\\p{Ll})(\\p{Lu})","gmu"),MS.singleLetters=new t4("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),MS.underscoreBoundary=new t4("(\\S)(_)(\\S)","gm");let J1e=MS;gn(t9o);gn(n9o);gn(i9o);gn(r9o);gn(o9o);gn(s9o);gn(a9o);gn(l9o);gn(SVe);gn(d9o);gn(u9o);gn(h9o);gn(X1e);gn(q1e);gn(A9o);gn(f9o);gn(g9o);gn(m9o);gn(k9o);gn(v9o);gn(c9o);_K.caseBoundary.isSupported()&&_K.singleLetters.isSupported()&&gn(_K);$K.singleLineWordBoundary.isSupported()&&$K.multiLineWordBoundary.isSupported()&&gn($K);K1e.wordBoundary.isSupported()&&gn(K1e);G1e.titleBoundary.isSupported()&&gn(G1e);J1e.isSupported()&&gn(J1e);const kit=Lr("dataChannelService");class p9o{getDataChannel(t){return{sendData:()=>{}}}}var b9o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},nxt=function(e,t){return function(n,r){t(n,r,e)}};function O9o(e){var t;return e.sourceId+" @@ "+JSON.stringify({...e,modelUri:(t=e.modelUri)==null?void 0:t.toString(),sourceId:void 0})}let _1e=class extends ct{static cast(){return this}constructor(t,n,r){super(),this._key=t,this._contextKeyService=n,this._dataChannelService=r,this._isEnabledContextKeyValue=w9o("structuredLogger.enabled:"+this._key,this._contextKeyService).recomputeInitiallyAndOnChange(this._store),this.isEnabled=this._isEnabledContextKeyValue.map(o=>o!==void 0)}log(t){return this._isEnabledContextKeyValue.get()?(this._dataChannelService.getDataChannel("structuredLogger:"+this._key).sendData(t),!0):!1}};_1e=b9o([nxt(1,Fi),nxt(2,kit)],_1e);function w9o(e,t){return es(t.onDidChangeContext,()=>t.getContextKeyValue(e))}var y9o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},ixt=function(e,t){return function(n,r){t(n,r,e)}};let TVe=class extends ct{constructor(t,n,r){var a;super(),this._editor=t,this._instantiationService=n,this._loggerService=r,this._structuredLogger=this._register(this._instantiationService.createInstance(_1e.cast(),"editor.inlineSuggest.logChangeReason.commandId"));const o=(a=this._loggerService)==null?void 0:a.createLogger("textModelChanges",{hidden:!1,name:"Text Model Changes Reason"}),s=es(this,o.onDidChangeLogLevel,()=>o.getLevel());this._register(xi(l=>{Z7n(s.read(l),fu.Trace)&&l.store.add(this._editor.onDidChangeModelContent(d=>{var u;((u=this._editor.getModel())==null?void 0:u.uri.scheme)!=="output"&&o.trace("onDidChangeModelContent: "+d.detailedReasons.map(h=>h.toKey(Number.MAX_VALUE)).join(", "))}))})),this._register(xi(l=>{this._editor instanceof TP&&this._structuredLogger.isEnabled.read(l)&&l.store.add(this._editor.onDidChangeModelContent(d=>{const u=this._editor.getModel();if(!u)return;const h=d.detailedReasons[0],f={...h.metadata,sourceId:"TextModel.setChangeReason",source:h.metadata.source,time:Date.now(),modelUri:u.uri,modelVersion:u.getVersionId()};setTimeout(()=>{this._structuredLogger.log(f)},0)}))}))}};TVe=y9o([ixt(1,$n),ixt(2,V7n)],TVe);function rxt(e,t=wh){return _co(e,t)?e.charAt(0).toUpperCase()+e.slice(1):e}var C9o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},x9o=function(e,t){return function(n,r){t(n,r,e)}};class oxt{constructor(t){this._delegates=t}resolve(t){for(const n of this._delegates){const r=n.resolve(t);if(r!==void 0)return r}}}class sxt{constructor(t,n,r,o){this._model=t,this._selection=n,this._selectionIdx=r,this._overtypingCapturer=o}resolve(t){const{name:n}=t;if(n==="SELECTION"||n==="TM_SELECTED_TEXT"){let r=this._model.getValueInRange(this._selection)||void 0,o=this._selection.startLineNumber!==this._selection.endLineNumber;if(!r&&this._overtypingCapturer){const s=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);s&&(r=s.value,o=s.multiline)}if(r&&o&&t.snippet){const s=this._model.getLineContent(this._selection.startLineNumber),a=_s(s,0,this._selection.startColumn-1);let l=a;t.snippet.walk(u=>u===t?!1:(u instanceof p1&&(l=_s(W1(u.value).pop())),!0));const d=f4(l,a);r=r.replace(/(\r\n|\r|\n)(.*)/g,(u,h,f)=>`${h}${l.substr(d)}${f}`)}return r}else{if(n==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(n==="TM_CURRENT_WORD"){const r=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return r&&r.word||void 0}else{if(n==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(n==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(n==="CURSOR_INDEX")return String(this._selectionIdx);if(n==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class axt{constructor(t,n){this._labelService=t,this._model=n}resolve(t){const{name:n}=t;if(n==="TM_FILENAME")return c8(this._model.uri.fsPath);if(n==="TM_FILENAME_BASE"){const r=c8(this._model.uri.fsPath),o=r.lastIndexOf(".");return o<=0?r:r.slice(0,o)}else{if(n==="TM_DIRECTORY")return hhe(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(Jbe(this._model.uri));if(n==="TM_DIRECTORY_BASE")return hhe(this._model.uri.fsPath)==="."?"":c8(hhe(this._model.uri.fsPath));if(n==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(n==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class lxt{constructor(t,n,r,o){this._readClipboardText=t,this._selectionIdx=n,this._selectionCount=r,this._spread=o}resolve(t){if(t.name!=="CLIPBOARD")return;const n=this._readClipboardText();if(n){if(this._spread){const r=n.split(/\r\n|\n|\r/).filter(o=>!qEn(o));if(r.length===this._selectionCount)return r[this._selectionIdx]}return n}}}let $1e=class{constructor(t,n,r){this._model=t,this._selection=n,this._languageConfigurationService=r}resolve(t){const{name:n}=t,r=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),o=this._languageConfigurationService.getLanguageConfiguration(r).comments;if(o){if(n==="LINE_COMMENT")return o.lineCommentToken||void 0;if(n==="BLOCK_COMMENT_START")return o.blockCommentStartToken||void 0;if(n==="BLOCK_COMMENT_END")return o.blockCommentEndToken||void 0}}};$1e=C9o([x9o(2,bl)],$1e);const nw=class nw{constructor(){this._date=new Date}resolve(t){const{name:n}=t;if(n==="CURRENT_YEAR")return String(this._date.getFullYear());if(n==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(n==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(n==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(n==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(n==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(n==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(n==="CURRENT_DAY_NAME")return nw.dayNames[this._date.getDay()];if(n==="CURRENT_DAY_NAME_SHORT")return nw.dayNamesShort[this._date.getDay()];if(n==="CURRENT_MONTH_NAME")return nw.monthNames[this._date.getMonth()];if(n==="CURRENT_MONTH_NAME_SHORT")return nw.monthNamesShort[this._date.getMonth()];if(n==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(n==="CURRENT_TIMEZONE_OFFSET"){const r=this._date.getTimezoneOffset(),o=r>0?"-":"+",s=Math.trunc(Math.abs(r/60)),a=s<10?"0"+s:s,l=Math.abs(r)-s*60,d=l<10?"0"+l:l;return o+a+":"+d}}};nw.dayNames=[j(1406,"Sunday"),j(1407,"Monday"),j(1408,"Tuesday"),j(1409,"Wednesday"),j(1410,"Thursday"),j(1411,"Friday"),j(1412,"Saturday")],nw.dayNamesShort=[j(1413,"Sun"),j(1414,"Mon"),j(1415,"Tue"),j(1416,"Wed"),j(1417,"Thu"),j(1418,"Fri"),j(1419,"Sat")],nw.monthNames=[j(1420,"January"),j(1421,"February"),j(1422,"March"),j(1423,"April"),j(1424,"May"),j(1425,"June"),j(1426,"July"),j(1427,"August"),j(1428,"September"),j(1429,"October"),j(1430,"November"),j(1431,"December")],nw.monthNamesShort=[j(1432,"Jan"),j(1433,"Feb"),j(1434,"Mar"),j(1435,"Apr"),j(1436,"May"),j(1437,"Jun"),j(1438,"Jul"),j(1439,"Aug"),j(1440,"Sep"),j(1441,"Oct"),j(1442,"Nov"),j(1443,"Dec")];let e0e=nw;class cxt{constructor(t){this._workspaceService=t}resolve(t){if(!this._workspaceService)return;const n=lwo(this._workspaceService.getWorkspace());if(!swo(n)){if(t.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(n);if(t.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(n)}}_resolveWorkspaceName(t){if(nHe(t))return c8(t.uri.path);let n=c8(t.configPath.path);return n.endsWith(iHe)&&(n=n.substr(0,n.length-iHe.length-1)),n}_resoveWorkspacePath(t){if(nHe(t))return rxt(t.uri.fsPath);const n=c8(t.configPath.path);let r=t.configPath.fsPath;return r.endsWith(n)&&(r=r.substr(0,r.length-n.length-1)),r?rxt(r):"/"}}class dxt{resolve(t){const{name:n}=t;if(n==="RANDOM")return Math.random().toString().slice(-6);if(n==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(n==="UUID")return jM()}}var L9o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},S9o=function(e,t){return function(n,r){t(n,r,e)}},ab;const hp=class hp{constructor(t,n,r){this._editor=t,this._snippet=n,this._snippetLineLeadingWhitespace=r,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=bOt(n.placeholders,Ev.compareByIndex),this._placeholderGroupsIdx=-1}initialize(t){this._offset=t.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const t=this._editor.getModel();this._editor.changeDecorations(n=>{for(const r of this._snippet.placeholders){const o=this._snippet.offset(r),s=this._snippet.fullLen(r),a=De.fromPositions(t.getPositionAt(this._offset+o),t.getPositionAt(this._offset+o+s)),l=r.isFinalTabstop?hp._decor.inactiveFinal:hp._decor.inactive,d=n.addDecoration(a,l);this._placeholderDecorations.set(r,d)}})}move(t){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const o=[];for(const s of this._placeholderGroups[this._placeholderGroupsIdx])if(s.transform){const a=this._placeholderDecorations.get(s),l=this._editor.getModel().getDecorationRange(a),d=this._editor.getModel().getValueInRange(l),u=s.transform.resolve(d).split(/\r\n|\r|\n/);for(let h=1;h0&&this._editor.executeEdits("snippet.placeholderTransform",o)}let n=!1;t===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,n=!0);const r=this._editor.getModel().changeDecorations(o=>{const s=new Set,a=[];for(const l of this._placeholderGroups[this._placeholderGroupsIdx]){const d=this._placeholderDecorations.get(l),u=this._editor.getModel().getDecorationRange(d);a.push(new Rn(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn)),n=n&&this._hasPlaceholderBeenCollapsed(l),o.changeDecorationOptions(d,l.isFinalTabstop?hp._decor.activeFinal:hp._decor.active),s.add(l);for(const h of this._snippet.enclosingPlaceholders(l)){const f=this._placeholderDecorations.get(h);o.changeDecorationOptions(f,h.isFinalTabstop?hp._decor.activeFinal:hp._decor.active),s.add(h)}}for(const[l,d]of this._placeholderDecorations)s.has(l)||o.changeDecorationOptions(d,l.isFinalTabstop?hp._decor.inactiveFinal:hp._decor.inactive);return a});return n?this.move(t):r??[]}_hasPlaceholderBeenCollapsed(t){let n=t;for(;n;){if(n instanceof Ev){const r=this._placeholderDecorations.get(n);if(this._editor.getModel().getDecorationRange(r).isEmpty()&&n.toString().length>0)return!0}n=n.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[t]=this._snippet.placeholders;if(t.isFinalTabstop&&this._snippet.rightMostDescendant===t)return!0}return!1}computePossibleSelections(){const t=new Map;for(const n of this._placeholderGroups){let r;for(const o of n){if(o.isFinalTabstop)break;r||(r=[],t.set(o.index,r));const s=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(s);if(!a){t.delete(o.index);break}r.push(a)}}return t}get activeChoice(){if(!this._placeholderDecorations)return;const t=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(t!=null&&t.choice))return;const n=this._placeholderDecorations.get(t);if(!n)return;const r=this._editor.getModel().getDecorationRange(n);if(r)return{range:r,choice:t.choice}}get hasChoice(){let t=!1;return this._snippet.walk(n=>(t=n instanceof xZ,!t)),t}merge(t){const n=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(r=>{for(const o of this._placeholderGroups[this._placeholderGroupsIdx]){const s=t.shift();console.assert(s._offset!==-1),console.assert(!s._placeholderDecorations);const a=s._snippet.placeholderInfo.last.index;for(const d of s._snippet.placeholderInfo.all)d.isFinalTabstop?d.index=o.index+(a+1)/this._nestingLevel:d.index=o.index+d.index/this._nestingLevel;this._snippet.replace(o,s._snippet.children);const l=this._placeholderDecorations.get(o);r.removeDecoration(l),this._placeholderDecorations.delete(o);for(const d of s._snippet.placeholders){const u=s._snippet.offset(d),h=s._snippet.fullLen(d),f=De.fromPositions(n.getPositionAt(s._offset+u),n.getPositionAt(s._offset+u+h)),g=r.addDecoration(f,hp._decor.inactive);this._placeholderDecorations.set(d,g)}}this._placeholderGroups=bOt(this._snippet.placeholders,Ev.compareByIndex)})}};hp._decor={active:Ki.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Ki.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Ki.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Ki.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};let t0e=hp;const uxt={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let n0e=ab=class{static adjustWhitespace(t,n,r,o,s){const a=t.getLineContent(n.lineNumber),l=_s(a,0,n.column-1);let d;return o.walk(u=>{if(!(u instanceof p1)||u.parent instanceof xZ||s&&!s.has(u))return!0;const h=u.value.split(/\r\n|\r|\n/);if(r){const g=o.offset(u);if(g===0)h[0]=t.normalizeIndentation(h[0]);else{d=d??o.toString();const k=d.charCodeAt(g-1);(k===10||k===13)&&(h[0]=t.normalizeIndentation(l+h[0]))}for(let k=1;kw.get(n6)),A=t.invokeWithinContext(w=>new axt(w.get(zP),g)),m=()=>l,v=g.getValueInRange(ab.adjustSelection(g,t.getSelection(),r,0)),p=g.getValueInRange(ab.adjustSelection(g,t.getSelection(),0,o)),b=g.getLineFirstNonWhitespaceColumn(t.getSelection().positionLineNumber),O=t.getSelections().map((w,y)=>({selection:w,idx:y})).sort((w,y)=>De.compareRangesUsingStarts(w.selection,y.selection));for(const{selection:w,idx:y}of O){let C=ab.adjustSelection(g,w,r,0),x=ab.adjustSelection(g,w,0,o);v!==g.getValueInRange(C)&&(C=w),p!==g.getValueInRange(x)&&(x=w);const L=w.setStartPosition(C.startLineNumber,C.startColumn).setEndPosition(x.endLineNumber,x.endColumn),S=new MP().parse(n,!0,s),E=L.getStartPosition(),Q=ab.adjustWhitespace(g,E,a||y>0&&b!==g.getLineFirstNonWhitespaceColumn(w.positionLineNumber),S);S.resolveVariables(new oxt([A,new lxt(m,y,O.length,t.getOption(88)==="spread"),new sxt(g,w,y,d),new $1e(g,w,u),new e0e,new cxt(k),new dxt])),h[y]=Jl.replace(L,S.toString()),h[y].identifier={major:y,minor:0},h[y]._isTracked=!0,f[y]=new t0e(t,S,Q)}return{edits:h,snippets:f}}static createEditsAndSnippetsFromEdits(t,n,r,o,s,a,l){if(!t.hasModel()||n.length===0)return{edits:[],snippets:[]};const d=[],u=t.getModel(),h=new MP,f=new gre,g=new oxt([t.invokeWithinContext(A=>new axt(A.get(zP),u)),new lxt(()=>s,0,t.getSelections().length,t.getOption(88)==="spread"),new sxt(u,t.getSelection(),0,a),new $1e(u,t.getSelection(),l),new e0e,new cxt(t.invokeWithinContext(A=>A.get(n6))),new dxt]);n=n.sort((A,m)=>De.compareRangesUsingStarts(A.range,m.range));let k=0;for(let A=0;A0){const C=n[A-1].range,x=De.fromPositions(C.getEndPosition(),m.getStartPosition()),L=new p1(u.getValueInRange(x));f.appendChild(L),k+=L.value.length}const b=h.parseFragment(v,f);ab.adjustWhitespace(u,m.getStartPosition(),p!==void 0?!p:o,f,new Set(b)),f.resolveVariables(g);const O=f.toString(),w=O.slice(k);k=O.length;const y=Jl.replace(m,w);y.identifier={major:A,minor:0},y._isTracked=!0,d.push(y)}return h.ensureFinalTabstop(f,r,!0),{edits:d,snippets:[new t0e(t,f,"")]}}constructor(t,n,r=uxt,o){this._editor=t,this._template=n,this._options=r,this._languageConfigurationService=o,this._templateMerges=[],this._snippets=[]}dispose(){hs(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(t){if(!this._editor.hasModel())return;const{edits:n,snippets:r}=typeof this._template=="string"?ab.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):ab.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=r,this._editor.executeEdits(t??yA.snippet(),n,o=>{const s=o.filter(a=>!!a.identifier);for(let a=0;aRn.fromPositions(a.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(t,n=uxt){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,t]);const{edits:r,snippets:o}=ab.createEditsAndSnippetsFromSelections(this._editor,t,n.overwriteBefore,n.overwriteAfter,!0,n.adjustWhitespace,n.clipboardText,n.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",r,s=>{const a=s.filter(d=>!!d.identifier);for(let d=0;dRn.fromPositions(d.range.getEndPosition()))})}next(){const t=this._move(!0);this._editor.setSelections(t),this._editor.revealPositionInCenterIfOutsideViewport(t[0].getPosition())}prev(){const t=this._move(!1);this._editor.setSelections(t),this._editor.revealPositionInCenterIfOutsideViewport(t[0].getPosition())}_move(t){const n=[];for(const r of this._snippets){const o=r.move(t);n.push(...o)}return n}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const t=this._editor.getSelections();if(t.length{s.push(...o.get(a))})}t.sort(De.compareRangesUsingStarts);for(const[r,o]of n){if(o.length!==t.length){n.delete(r);continue}o.sort(De.compareRangesUsingStarts);for(let s=0;s0}};n0e=ab=L9o([S9o(3,bl)],n0e);var T9o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Cce=function(e,t){return function(n,r){t(n,r,e)}},GN;const hxt={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var Zw;let Mf=(Zw=class{static get(t){return t.getContribution(GN.ID)}constructor(t,n,r,o,s){this._editor=t,this._logService=n,this._languageFeaturesService=r,this._languageConfigurationService=s,this._inSnippetObservable=Bi(this,!1),this._snippetListener=new Pt,this._modelVersionId=-1,this._inSnippet=GN.InSnippetMode.bindTo(o),this._hasNextTabstop=GN.HasNextTabstop.bindTo(o),this._hasPrevTabstop=GN.HasPrevTabstop.bindTo(o)}dispose(){var t;this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(t=this._session)==null||t.dispose(),this._snippetListener.dispose()}insert(t,n){try{this._doInsert(t,typeof n>"u"?hxt:{...hxt,...n})}catch(r){this.cancel(),this._logService.error(r),this._logService.error("snippet_error"),this._logService.error("insert_template=",t),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(t,n){var r;if(this._editor.hasModel()){if(this._snippetListener.clear(),n.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof t!="string"&&this.cancel(),this._session?(yo(typeof t=="string"),this._session.merge(t,n)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new n0e(this._editor,t,n,this._languageConfigurationService),this._session.insert(n.reason)),n.undoStopAfter&&this._editor.getModel().pushStackElement(),(r=this._session)!=null&&r.hasChoice){const o={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(h,f)=>{if(!this._session||h!==this._editor.getModel()||!tt.equals(this._editor.getPosition(),f))return;const{activeChoice:g}=this._session;if(!g||g.choice.options.length===0)return;const k=h.getValueInRange(g.range),A=!!g.choice.options.find(v=>v.value===k),m=[];for(let v=0;v{a==null||a.dispose(),l=!1},u=()=>{l||(a=this._languageFeaturesService.completionProvider.register({language:s.getLanguageId(),pattern:s.uri.fsPath,scheme:s.uri.scheme,exclusive:!0},o),this._snippetListener.add(a),l=!0)};this._choiceCompletions={provider:o,enable:u,disable:d}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(o=>o.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._inSnippetObservable.set(!0,void 0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var n;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(n=this._choiceCompletions)==null||n.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{G6o(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(t=!1){var n;this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(n=this._session)==null||n.dispose(),this._session=void 0,this._modelVersionId=-1,t&&this._editor.setSelections([this._editor.getSelection()])}prev(){var t;(t=this._session)==null||t.prev(),this._updateState()}next(){var t;(t=this._session)==null||t.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}get isInSnippetObservable(){return this._inSnippetObservable}},GN=Zw,Zw.ID="snippetController2",Zw.InSnippetMode=new Ln("inSnippetMode",!1,j(1402,"Whether the editor in current in snippet mode")),Zw.HasNextTabstop=new Ln("hasNextTabstop",!1,j(1403,"Whether there is a next tab stop when in snippet mode")),Zw.HasPrevTabstop=new Ln("hasPrevTabstop",!1,j(1404,"Whether there is a previous tab stop when in snippet mode")),Zw);Mf=GN=T9o([Cce(1,Oa),Cce(2,Zn),Cce(3,Fi),Cce(4,bl)],Mf);mo(Mf.ID,Mf,4);const n3e=$d.bindToContribution(Mf.get);xn(new n3e({id:"jumpToNextSnippetPlaceholder",precondition:zt.and(Mf.InSnippetMode,Mf.HasNextTabstop),handler:e=>e.next(),kbOpts:{weight:130,kbExpr:Ze.textInputFocus,primary:2}}));xn(new n3e({id:"jumpToPrevSnippetPlaceholder",precondition:zt.and(Mf.InSnippetMode,Mf.HasPrevTabstop),handler:e=>e.prev(),kbOpts:{weight:130,kbExpr:Ze.textInputFocus,primary:1026}}));xn(new n3e({id:"leaveSnippet",precondition:Mf.InSnippetMode,handler:e=>e.cancel(!0),kbOpts:{weight:130,kbExpr:Ze.textInputFocus,primary:9,secondary:[1033]}}));xn(new n3e({id:"acceptSnippet",precondition:Mf.InSnippetMode,handler:e=>e.finish()}));function pee(e){return new E9o(e)}class E9o extends MQn{constructor(t){super(),this._textModel=t}getOffset(t){return this._textModel.getOffsetAt(t)}getPosition(t){return this._textModel.getPositionAt(t)}}const D9o=[];function Q9o(){return D9o}function Axt(e){return B9o(e).map(n=>n.getEndPosition())}function B9o(e){const t=Xge.createSortPermutation(e,nA(o=>o.range,De.compareRangesUsingStarts)),r=new Yp(t.apply(e)).getNewRanges();return t.inverse().apply(r)}function F9o(e,t){const n=pee(t),r=t.getValue();return e.map(a=>n.getStringReplacement(a)).map(a=>a.removeCommonSuffixPrefix(r)).map(a=>n.getTextReplacement(a))}function P9o(e,t){const n=Bi("result",[]),r=[];return t.add(xi(o=>{const s=e.read(o);ua(a=>{if(s.length!==r.length){r.length=s.length;for(let l=0;ll.set(s[d],a))})})),n}class M9o{constructor(t){this._contextKeyService=t}bind(t,n){return W3(t,this._contextKeyService,n instanceof Function?n:r=>n.read(r))}}function fxt(e,t){return new Promise(n=>{let r;const o=setTimeout(()=>{r&&r.dispose(),n()},e);t&&(r=t.onCancellationRequested(()=>{clearTimeout(o),r&&r.dispose(),n()}))})}class R9o{constructor(t,n,r,o=I9o){this.startValue=t,this.endValue=n,this.durationMs=r,this._interpolationFunction=o,this.startTimeMs=Date.now(),t===n&&(this.durationMs=0)}isFinished(){return Date.now()>=this.startTimeMs+this.durationMs}getValue(){const t=Date.now()-this.startTimeMs;return t>=this.durationMs?this.endValue:this._interpolationFunction(t,this.startValue,this.endValue-this.startValue,this.durationMs)}}function I9o(e,t,n,r){return e===r?t+n:n*(-Math.pow(2,-10*e/r)+1)+t}function N9o(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}class U9o{constructor(t){this._value=Bi(this,t)}getValue(t){const n=this._value.read(t);return n.isFinished()||i0e.instance.invalidateOnNextAnimationFrame(t),n.getValue()}}const D2e=class D2e{constructor(){this._counter=Uv(this),this._isScheduled=!1}invalidateOnNextAnimationFrame(t){this._counter.read(t),this._isScheduled||(this._isScheduled=!0,ks().requestAnimationFrame(()=>{this._isScheduled=!1,this._update()}))}_update(){this._counter.trigger(void 0)}};D2e.instance=new D2e;let i0e=D2e;class bee{constructor(t,n){this.lineNumber=t,this.parts=n,FT(()=>jie(n,(r,o)=>r.column<=o.column))}equals(t){return this.lineNumber===t.lineNumber&&this.parts.length===t.parts.length&&this.parts.every((n,r)=>n.equals(t.parts[r]))}renderForScreenReader(t){if(this.parts.length===0)return"";const n=this.parts[this.parts.length-1],r=t.substr(0,n.column-1);return new Yp([...this.parts.map(s=>new Zc(De.fromPositions(new tt(1,s.column)),s.lines.map(a=>a.line).join(` `)))]).applyToString(r).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(t=>t.lines.length===0)}get lineCount(){return 1+this.parts.reduce((t,n)=>t+n.lines.length-1,0)}}class r0e{constructor(t,n,r,o=[]){this.column=t,this.text=n,this.preview=r,this._inlineDecorations=o,this.lines=W1(this.text).map((s,a)=>({line:s,lineDecorations:Ef.filter(this._inlineDecorations,a+1,1,s.length+1)}))}equals(t){return this.column===t.column&&this.lines.length===t.lines.length&&this.lines.every((n,r)=>n.line===t.lines[r].line&&Ef.equalsArr(n.lineDecorations,t.lines[r].lineDecorations))}}class EVe{constructor(t,n,r,o=0){this.lineNumber=t,this.columnRange=n,this.text=r,this.additionalReservedLineCount=o,this.parts=[new r0e(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=W1(this.text)}renderForScreenReader(t){return this.newLines.join(` `)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(t=>t.lines.length===0)}equals(t){return this.lineNumber===t.lineNumber&&this.columnRange.equals(t.columnRange)&&this.newLines.length===t.newLines.length&&this.newLines.every((n,r)=>n===t.newLines[r])&&this.additionalReservedLineCount===t.additionalReservedLineCount}}function gxt(e,t){return za(e,t,aRn)}function aRn(e,t){return e===t?!0:!e||!t?!1:e instanceof bee&&t instanceof bee||e instanceof EVe&&t instanceof EVe?e.equals(t):!1}function ZL(e,t,n){const r=n?e.range.intersectRanges(n):e.range;if(!r)return e;const o=e.text.replaceAll(`\r `,` `),s=t.getValueInRange(r,1),a=f4(s,o),l=Yd.ofText(s.substring(0,a)).addToPosition(e.range.getStartPosition()),d=o.substring(a),u=De.fromPositions(l,e.range.getEndPosition());return new Zc(u,d)}function lRn(e,t){return e.text.startsWith(t.text)&&j9o(e.range,t.range)}function j9o(e,t){return t.getStartPosition().equals(e.getStartPosition())&&t.getEndPosition().isBeforeOrEqual(e.getEndPosition())}function mxt(e,t,n,r,o=0){let s=ZL(e,t);if(s.range.endLineNumber!==s.range.startLineNumber)return;const a=t.getLineContent(s.range.startLineNumber),l=_s(a).length;if(s.range.startColumn-1<=l){const A=_s(s.text).length,m=a.substring(s.range.startColumn-1,l),[v,p]=[s.range.getStartPosition(),s.range.getEndPosition()],b=v.column+m.length<=p.column?v.delta(0,m.length):p,O=De.fromPositions(b,p),w=s.text.startsWith(m)?s.text.substring(m.length):s.text.substring(A);s=new Zc(O,w)}const u=t.getValueInRange(s.range),h=W9o(u,s.text);if(!h)return;const f=s.range.startLineNumber,g=new Array;if(n==="prefix"){const A=h.filter(m=>m.originalLength===0);if(A.length>1||A.length===1&&A[0].originalStart!==u.length)return}const k=s.text.length-o;for(const A of h){const m=s.range.startColumn+A.originalStart+A.originalLength;if(n==="subwordSmart"&&r&&r.lineNumber===s.range.startLineNumber&&m0)return;if(A.modifiedLength===0)continue;const v=A.modifiedStart+A.modifiedLength,p=Math.max(A.modifiedStart,Math.min(v,k)),b=s.text.substring(A.modifiedStart,p),O=s.text.substring(p,Math.max(A.modifiedStart,v));b.length>0&&g.push(new r0e(m,b,!1)),O.length>0&&g.push(new r0e(m,O,!0))}return new bee(f,g)}let T3;function W9o(e,t){if((T3==null?void 0:T3.originalValue)===e&&(T3==null?void 0:T3.newValue)===t)return T3==null?void 0:T3.changes;{let n=vxt(e,t,!0);if(n){const r=kxt(n);if(r>0){const o=vxt(e,t,!1);o&&kxt(o)5e3||t.length>5e3)return;function r(u){let h=0;for(let f=0,g=u.length;fh&&(h=k)}return h}const o=Math.max(r(e),r(t));function s(u){if(u<0)throw new Error("unexpected");return o+u+1}function a(u){let h=0,f=0;const g=new Int32Array(u.length);for(let k=0,A=u.length;kl},{getElements:()=>d}).ComputeDiff(!1).changes}function H9o(e,t){let n,r=!1;const o=new p7n(new sA(e,void 0,t.update),(s,a)=>{r||(n=t.initial instanceof Function?t.initial():t.initial,r=!0);const l=t.update(s,n,a);return n=l,l},t.changeTracker,()=>{var s;r&&((s=t.disposeFinal)==null||s.call(t,n),r=!1)},t.equalityComparer??vk,(s,a,l)=>{if(!r)throw new Ai("Can only set when there is a listener! This is to prevent leaks.");fV(a,d=>{n=s,o.setValue(s,d,l)})},_d.ofCaller());return o}var V9o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},pxt=function(e,t){return function(n,r){t(n,r,e)}};class z9o{constructor(t,n){this._baseService=t,this._intercept=n}publicLog2(t,n){this._intercept(t,n),this._baseService.publicLog2(t,n)}}let DVe=class extends z9o{constructor(t,n){super(t,(r,o)=>{let s=!0;o&&QVe in o&&(s=!!o[QVe]),s&&n.getDataChannel("editTelemetry").sendData({eventName:r,data:o??{}})})}};DVe=V9o([pxt(0,zA),pxt(1,kit)],DVe);const QVe=Symbol("shouldForwardToChannel");function Z9o(e){return{[QVe]:e}}function bxt(e){if(!e)return!1;const t=e.toLowerCase();return t==="github.copilot"||t==="github.copilot-chat"}function Y9o(e){const t=e.map(r=>new fh(Jn.ofStartAndLength(r.rangeOffset,r.rangeLength),r.text));return t.reverse(),new $8(t)}function X9o(e,t){e.publicLog2("inlineCompletion.endOfLife",t)}class Whe{constructor(t,n,r){this.changes=t,this.moves=n,this.hitTimeout=r}}class cRn{constructor(t,n){this.lineRangeMapping=t,this.changes=n}}const q9o=3;class G9o{computeDiff(t,n,r){var d;const s=new _9o(t,n,{maxComputationTime:r.maxComputationTimeMs,shouldIgnoreTrimWhitespace:r.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const u of s.changes){let h;u.originalEndLineNumber===0?h=new Qi(u.originalStartLineNumber+1,u.originalStartLineNumber+1):h=new Qi(u.originalStartLineNumber,u.originalEndLineNumber+1);let f;u.modifiedEndLineNumber===0?f=new Qi(u.modifiedStartLineNumber+1,u.modifiedStartLineNumber+1):f=new Qi(u.modifiedStartLineNumber,u.modifiedEndLineNumber+1);let g=new uk(h,f,(d=u.charChanges)==null?void 0:d.map(k=>new cg(new De(k.originalStartLineNumber,k.originalStartColumn,k.originalEndLineNumber,k.originalEndColumn),new De(k.modifiedStartLineNumber,k.modifiedStartColumn,k.modifiedEndLineNumber,k.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===g.modified.startLineNumber||l.original.endLineNumberExclusive===g.original.startLineNumber)&&(g=new uk(l.original.join(g.original),l.modified.join(g.modified),l.innerChanges&&g.innerChanges?l.innerChanges.concat(g.innerChanges):void 0),a.pop()),a.push(g),l=g}return FT(()=>jie(a,(u,h)=>h.original.startLineNumber-u.original.endLineNumberExclusive===h.modified.startLineNumber-u.modified.endLineNumberExclusive&&u.original.endLineNumberExclusive(t===10?"\\n":String.fromCharCode(t))+`-(${this._lineNumbers[n]},${this._columns[n]})`).join(", ")+"]"}_assertIndex(t,n){if(t<0||t>=n.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(t){return t>0&&t===this._lineNumbers.length?this.getEndLineNumber(t-1):(this._assertIndex(t,this._lineNumbers),this._lineNumbers[t])}getEndLineNumber(t){return t===-1?this.getStartLineNumber(t+1):(this._assertIndex(t,this._lineNumbers),this._charCodes[t]===10?this._lineNumbers[t]+1:this._lineNumbers[t])}getStartColumn(t){return t>0&&t===this._columns.length?this.getEndColumn(t-1):(this._assertIndex(t,this._columns),this._columns[t])}getEndColumn(t){return t===-1?this.getStartColumn(t+1):(this._assertIndex(t,this._columns),this._charCodes[t]===10?1:this._columns[t]+1)}}class uW{constructor(t,n,r,o,s,a,l,d){this.originalStartLineNumber=t,this.originalStartColumn=n,this.originalEndLineNumber=r,this.originalEndColumn=o,this.modifiedStartLineNumber=s,this.modifiedStartColumn=a,this.modifiedEndLineNumber=l,this.modifiedEndColumn=d}static createFromDiffChange(t,n,r){const o=n.getStartLineNumber(t.originalStart),s=n.getStartColumn(t.originalStart),a=n.getEndLineNumber(t.originalStart+t.originalLength-1),l=n.getEndColumn(t.originalStart+t.originalLength-1),d=r.getStartLineNumber(t.modifiedStart),u=r.getStartColumn(t.modifiedStart),h=r.getEndLineNumber(t.modifiedStart+t.modifiedLength-1),f=r.getEndColumn(t.modifiedStart+t.modifiedLength-1);return new uW(o,s,a,l,d,u,h,f)}}function J9o(e){if(e.length<=1)return e;const t=[e[0]];let n=t[0];for(let r=1,o=e.length;r0&&n.originalLength<20&&n.modifiedLength>0&&n.modifiedLength<20&&s()){const k=r.createCharSequence(t,n.originalStart,n.originalStart+n.originalLength-1),A=o.createCharSequence(t,n.modifiedStart,n.modifiedStart+n.modifiedLength-1);if(k.getElements().length>0&&A.getElements().length>0){let m=dRn(k,A,s,!0).changes;l&&(m=J9o(m)),g=[];for(let v=0,p=m.length;v1&&m>1;){const v=g.charCodeAt(A-2),p=k.charCodeAt(m-2);if(v!==p)break;A--,m--}(A>1||m>1)&&this._pushTrimWhitespaceCharChange(o,s+1,1,A,a+1,1,m)}{let A=FVe(g,1),m=FVe(k,1);const v=g.length+1,p=k.length+1;for(;A!0;const t=Date.now();return()=>Date.now()-t0&&m>0&&a.get(A-1,m-1)===3&&(b+=l.get(A-1,m-1)),b+=o?o(A,m):1):b=-1;const O=Math.max(v,p,b);if(O===b){const w=A>0&&m>0?l.get(A-1,m-1):0;l.set(A,m,w+1),a.set(A,m,3)}else O===v?(l.set(A,m,0),a.set(A,m,1)):O===p&&(l.set(A,m,0),a.set(A,m,2));s.set(A,m,O)}const d=[];let u=t.length,h=n.length;function f(A,m){(A+1!==u||m+1!==h)&&d.push(new hu(new Jn(A+1,u),new Jn(m+1,h))),u=A,h=m}let g=t.length-1,k=n.length-1;for(;g>=0&&k>=0;)a.get(g,k)===3?(f(g,k),g--,k--):a.get(g,k)===1?g--:k--;return f(-1,-1),d.reverse(),new f8(d,!1)}}class uRn{compute(t,n,r=G$.instance){if(t.length===0||n.length===0)return f8.trivial(t,n);const o=t,s=n;function a(m,v){for(;mo.length||w>s.length)continue;const y=a(O,w);d.set(h,y);const C=O===p?u.get(h+1):u.get(h-1);if(u.set(h,y!==O?new yxt(C,O,w,y-O):C),d.get(h)===o.length&&d.get(h)-h===s.length)break e}}let f=u.get(h);const g=[];let k=o.length,A=s.length;for(;;){const m=f?f.x+f.length:0,v=f?f.y+f.length:0;if((m!==k||v!==A)&&g.push(new hu(new Jn(m,k),new Jn(v,A))),!f)break;k=f.x,A=f.y,f=f.prev}return g.reverse(),new f8(g,!1)}}class yxt{constructor(t,n,r,o){this.prev=t,this.x=n,this.y=r,this.length=o}}class eSo{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(t){return t<0?(t=-t-1,this.negativeArr[t]):this.positiveArr[t]}set(t,n){if(t<0){if(t=-t-1,t>=this.negativeArr.length){const r=this.negativeArr;this.negativeArr=new Int32Array(r.length*2),this.negativeArr.set(r)}this.negativeArr[t]=n}else{if(t>=this.positiveArr.length){const r=this.positiveArr;this.positiveArr=new Int32Array(r.length*2),this.positiveArr.set(r)}this.positiveArr[t]=n}}}class tSo{constructor(){this.positiveArr=[],this.negativeArr=[]}get(t){return t<0?(t=-t-1,this.negativeArr[t]):this.positiveArr[t]}set(t,n){t<0?(t=-t-1,this.negativeArr[t]=n):this.positiveArr[t]=n}}class o0e{constructor(t,n,r){this.lines=t,this.range=n,this.considerWhitespaceChanges=r,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let o=this.range.startLineNumber;o<=this.range.endLineNumber;o++){let s=t[o-1],a=0;o===this.range.startLineNumber&&this.range.startColumn>1&&(a=this.range.startColumn-1,s=s.substring(a)),this.lineStartOffsets.push(a);let l=0;if(!r){const u=s.trimStart();l=s.length-u.length,s=u.trimEnd()}this.trimmedWsLengthsByLineIdx.push(l);const d=o===this.range.endLineNumber?Math.min(this.range.endColumn-1-a-l,s.length):s.length;for(let u=0;uString.fromCharCode(n)).join("")}getElement(t){return this.elements[t]}get length(){return this.elements.length}getBoundaryScore(t){const n=Lxt(t>0?this.elements[t-1]:-1),r=Lxt(ts<=t),o=t-this.firstElementOffsetByLineIdx[r];return new tt(this.range.startLineNumber+r,1+this.lineStartOffsets[r]+o+(o===0&&n==="left"?0:this.trimmedWsLengthsByLineIdx[r]))}translateRange(t){const n=this.translateOffset(t.start,"right"),r=this.translateOffset(t.endExclusive,"left");return r.isBefore(n)?De.fromPositions(r,r):De.fromPositions(n,r)}findWordContaining(t){if(t<0||t>=this.elements.length||!KI(this.elements[t]))return;let n=t;for(;n>0&&KI(this.elements[n-1]);)n--;let r=t;for(;r=this.elements.length||!KI(this.elements[t]))return;let n=t;for(;n>0&&KI(this.elements[n-1])&&!Cxt(this.elements[n]);)n--;let r=t;for(;ro<=t.start)??0,r=Hmo(this.firstElementOffsetByLineIdx,o=>t.endExclusive<=o)??this.elements.length;return new Jn(n,r)}}function KI(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}function Cxt(e){return e>=65&&e<=90}const nSo={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function xxt(e){return nSo[e]}function Lxt(e){return e===10?8:e===13?7:FWe(e)?6:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:e===-1?3:e===44||e===59?5:4}function iSo(e,t,n,r,o,s){let{moves:a,excludedChanges:l}=oSo(e,t,n,s);if(!s.isValid())return[];const d=e.filter(h=>!l.has(h)),u=sSo(d,r,o,t,n,s);return RUe(a,u),a=aSo(a),a=a.filter(h=>{const f=h.original.toOffsetRange().slice(t).map(k=>k.trim());return f.join(` `).length>=15&&rSo(f,k=>k.length>=2)>=2}),a=lSo(e,a),a}function rSo(e,t){let n=0;for(const r of e)t(r)&&n++;return n}function oSo(e,t,n,r){const o=[],s=e.filter(d=>d.modified.isEmpty&&d.original.length>=3).map(d=>new Kme(d.original,t,d)),a=new Set(e.filter(d=>d.original.isEmpty&&d.modified.length>=3).map(d=>new Kme(d.modified,n,d))),l=new Set;for(const d of s){let u=-1,h;for(const f of a){const g=d.computeSimilarity(f);g>u&&(u=g,h=f)}if(u>.9&&h&&(a.delete(h),o.push(new Lf(d.range,h.range)),l.add(d.source),l.add(h.source)),!r.isValid())return{moves:o,excludedChanges:l}}return{moves:o,excludedChanges:l}}function sSo(e,t,n,r,o,s){const a=[],l=new U7n;for(const g of e)for(let k=g.original.startLineNumber;kg.modified.startLineNumber,P1));for(const g of e){let k=[];for(let A=g.modified.startLineNumber;A{for(const w of k)if(w.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){w.originalLineRange=new Qi(w.originalLineRange.startLineNumber,b.endLineNumberExclusive),w.modifiedLineRange=new Qi(w.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),p.push(w);return}const O={modifiedLineRange:v,originalLineRange:b};d.push(O),p.push(O)}),k=p}if(!s.isValid())return[]}d.sort(g7n(nA(g=>g.modifiedLineRange.length,P1)));const u=new Nv,h=new Nv;for(const g of d){const k=g.modifiedLineRange.startLineNumber-g.originalLineRange.startLineNumber,A=u.subtractFrom(g.modifiedLineRange),m=h.subtractFrom(g.originalLineRange).getWithDelta(k),v=A.getIntersection(m);for(const p of v.ranges){if(p.length<3)continue;const b=p,O=p.delta(-k);a.push(new Lf(O,b)),u.addRange(b),h.addRange(O)}}a.sort(nA(g=>g.original.startLineNumber,P1));const f=new yme(e);for(let g=0;gC.original.startLineNumber<=k.original.startLineNumber),m=xV(e,C=>C.modified.startLineNumber<=k.modified.startLineNumber),v=Math.max(k.original.startLineNumber-A.original.startLineNumber,k.modified.startLineNumber-m.modified.startLineNumber),p=f.findLastMonotonous(C=>C.original.startLineNumberC.modified.startLineNumberr.length||x>o.length||u.contains(x)||h.contains(C)||!Sxt(r[C-1],o[x-1],s))break}w>0&&(h.addRange(new Qi(k.original.startLineNumber-w,k.original.startLineNumber)),u.addRange(new Qi(k.modified.startLineNumber-w,k.modified.startLineNumber)));let y;for(y=0;yr.length||x>o.length||u.contains(x)||h.contains(C)||!Sxt(r[C-1],o[x-1],s))break}y>0&&(h.addRange(new Qi(k.original.endLineNumberExclusive,k.original.endLineNumberExclusive+y)),u.addRange(new Qi(k.modified.endLineNumberExclusive,k.modified.endLineNumberExclusive+y))),(w>0||y>0)&&(a[g]=new Lf(new Qi(k.original.startLineNumber-w,k.original.endLineNumberExclusive+y),new Qi(k.modified.startLineNumber-w,k.modified.endLineNumberExclusive+y)))}return a}function Sxt(e,t,n){if(e.trim()===t.trim())return!0;if(e.length>300&&t.length>300)return!1;const o=new uRn().compute(new o0e([e],new De(1,1,1,e.length),!1),new o0e([t],new De(1,1,1,t.length),!1),n);let s=0;const a=hu.invert(o.diffs,e.length);for(const h of a)h.seq1Range.forEach(f=>{FWe(e.charCodeAt(f))||s++});function l(h){let f=0;for(let g=0;gt.length?e:t);return s/d>.6&&d>10}function aSo(e){if(e.length===0)return e;e.sort(nA(n=>n.original.startLineNumber,P1));const t=[e[0]];for(let n=1;n=0&&a>=0&&s+a<=2){t[t.length-1]=r.join(o);continue}t.push(o)}return t}function lSo(e,t){const n=new yme(e);return t=t.filter(r=>{const o=n.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber0&&(l=l.delta(u))}o.push(l)}return r.length>0&&o.push(r[r.length-1]),o}function cSo(e,t,n){if(!e.getBoundaryScore||!t.getBoundaryScore)return n;for(let r=0;r0?n[r-1]:void 0,s=n[r],a=r+1=r.start&&e.seq2Range.start-a>=o.start&&n.isStronglyEqual(e.seq2Range.start-a,e.seq2Range.endExclusive-a)&&a<100;)a++;a--;let l=0;for(;e.seq1Range.start+lu&&(u=A,d=h)}return e.delta(d)}function dSo(e,t,n){const r=[];for(const o of n){const s=r[r.length-1];if(!s){r.push(o);continue}o.seq1Range.start-s.seq1Range.endExclusive<=2||o.seq2Range.start-s.seq2Range.endExclusive<=2?r[r.length-1]=new hu(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):r.push(o)}return r}function Qxt(e,t,n,r,o=!1){const s=hu.invert(n,e.length),a=[];let l=new zL(0,0);function d(h,f){if(h.offset10;){const b=s[0];if(!(b.seq1Range.intersects(A.seq1Range)||b.seq2Range.intersects(A.seq2Range)))break;const w=r(e,b.seq1Range.start),y=r(t,b.seq2Range.start),C=new hu(w,y),x=C.intersect(b);if(v+=x.seq1Range.length,p+=x.seq2Range.length,A=A.join(C),A.seq1Range.endExclusive>=b.seq1Range.endExclusive)s.shift();else break}(o&&v+p0;){const h=s.shift();h.seq1Range.isEmpty||(d(h.getStarts(),h),d(h.getEndExclusives().delta(-1),h))}return uSo(n,a)}function uSo(e,t){const n=[];for(;e.length>0||t.length>0;){const r=e[0],o=t[0];let s;r&&(!o||r.seq1Range.start0&&n[n.length-1].seq1Range.endExclusive>=s.seq1Range.start?n[n.length-1]=n[n.length-1].join(s):n.push(s)}return n}function hSo(e,t,n){let r=n;if(r.length===0)return r;let o=0,s;do{s=!1;const a=[r[0]];for(let l=1;l5||k.seq1Range.length+k.seq2Range.length>5)};const d=r[l],u=a[a.length-1];h(u,d)?(s=!0,a[a.length-1]=a[a.length-1].join(d)):a.push(d)}r=a}while(o++<10&&s);return r}function ASo(e,t,n){let r=n;if(r.length===0)return r;let o=0,s;do{s=!1;const l=[r[0]];for(let d=1;d5||m.length>500)return!1;const p=e.getText(m).trim();if(p.length>20||p.split(/\r\n|\r|\n/).length>1)return!1;const b=e.countLinesIn(k.seq1Range),O=k.seq1Range.length,w=t.countLinesIn(k.seq2Range),y=k.seq2Range.length,C=e.countLinesIn(A.seq1Range),x=A.seq1Range.length,L=t.countLinesIn(A.seq2Range),S=A.seq2Range.length,E=2*40+50;function Q(T){return Math.min(T,E)}return Math.pow(Math.pow(Q(b*40+O),1.5)+Math.pow(Q(w*40+y),1.5),1.5)+Math.pow(Math.pow(Q(C*40+x),1.5)+Math.pow(Q(L*40+S),1.5),1.5)>(E**1.5)**1.5*1.3};const u=r[d],h=l[l.length-1];f(h,u)?(s=!0,l[l.length-1]=l[l.length-1].join(u)):l.push(u)}r=l}while(o++<10&&s);const a=[];return Tlo(r,(l,d,u)=>{let h=d;function f(p){return p.length>0&&p.trim().length<=3&&d.seq1Range.length+d.seq2Range.length>100}const g=e.extendToFullLines(d.seq1Range),k=e.getText(new Jn(g.start,d.seq1Range.start));f(k)&&(h=h.deltaStart(-k.length));const A=e.getText(new Jn(d.seq1Range.endExclusive,g.endExclusive));f(A)&&(h=h.deltaEnd(A.length));const m=hu.fromOffsetPairs(l?l.getEndExclusives():zL.zero,u?u.getStarts():zL.max),v=h.intersect(m);a.length>0&&v.getStarts().equals(a[a.length-1].getEndExclusives())?a[a.length-1]=a[a.length-1].join(v):a.push(v)}),a}class Bxt{constructor(t,n){this.trimmedHash=t,this.lines=n}getElement(t){return this.trimmedHash[t]}get length(){return this.trimmedHash.length}getBoundaryScore(t){const n=t===0?0:Fxt(this.lines[t-1]),r=t===this.lines.length?0:Fxt(this.lines[t]);return 1e3-(n+r)}getText(t){return this.lines.slice(t.start,t.endExclusive).join(` `)}isStronglyEqual(t,n){return this.lines[t]===this.lines[n]}}function Fxt(e){let t=0;for(;tx===L))return new Whe([],[],!1);if(t.length===1&&t[0].length===0||n.length===1&&n[0].length===0)return new Whe([new uk(new Qi(1,t.length+1),new Qi(1,n.length+1),[new cg(new De(1,1,t.length,t[t.length-1].length+1),new De(1,1,n.length,n[n.length-1].length+1))])],[],!1);const o=r.maxComputationTimeMs===0?G$.instance:new uOo(r.maxComputationTimeMs),s=!r.ignoreTrimWhitespace,a=new Map;function l(x){let L=a.get(x);return L===void 0&&(L=a.size,a.set(x,L)),L}const d=t.map(x=>l(x.trim())),u=n.map(x=>l(x.trim())),h=new Bxt(d,t),f=new Bxt(u,n),g=h.length+f.length<1700?this.dynamicProgrammingDiffing.compute(h,f,o,(x,L)=>t[x]===n[L]?n[L].length===0?.1:1+Math.log(1+n[L].length):.99):this.myersDiffingAlgorithm.compute(h,f,o);let k=g.diffs,A=g.hitTimeout;k=Txt(h,f,k),k=hSo(h,f,k);const m=[],v=x=>{if(s)for(let L=0;Lx.seq1Range.start-p===x.seq2Range.start-b);const L=x.seq1Range.start-p;v(L),p=x.seq1Range.endExclusive,b=x.seq2Range.endExclusive;const S=this.refineDiff(t,n,x,o,s,r);S.hitTimeout&&(A=!0);for(const E of S.mappings)m.push(E)}v(t.length-p);const O=new Rle(t),w=new Rle(n),y=Gme(m,O,w);let C=[];return r.computeMoves&&(C=this.computeMoves(y,t,n,d,u,o,s,r)),FT(()=>{function x(S,E){if(S.lineNumber<1||S.lineNumber>E.length)return!1;const Q=E[S.lineNumber-1];return!(S.column<1||S.column>Q.length+1)}function L(S,E){return!(S.startLineNumber<1||S.startLineNumber>E.length+1||S.endLineNumberExclusive<1||S.endLineNumberExclusive>E.length+1)}for(const S of y){if(!S.innerChanges)return!1;for(const E of S.innerChanges)if(!(x(E.modifiedRange.getStartPosition(),n)&&x(E.modifiedRange.getEndPosition(),n)&&x(E.originalRange.getStartPosition(),t)&&x(E.originalRange.getEndPosition(),t)))return!1;if(!L(S.modified,n)||!L(S.original,t))return!1}return!0}),new Whe(y,C,A)}computeMoves(t,n,r,o,s,a,l,d){return iSo(t,n,r,o,s,a).map(f=>{const g=this.refineDiff(n,r,new hu(f.original.toOffsetRange(),f.modified.toOffsetRange()),a,l,d),k=Gme(g.mappings,new Rle(n),new Rle(r),!0);return new cRn(f,k)})}refineDiff(t,n,r,o,s,a){const d=gSo(r).toRangeMapping2(t,n),u=new o0e(t,d.originalRange,s),h=new o0e(n,d.modifiedRange,s),f=u.length+h.length<500?this.dynamicProgrammingDiffing.compute(u,h,o):this.myersDiffingAlgorithm.compute(u,h,o);let g=f.diffs;return g=Txt(u,h,g),g=Qxt(u,h,g,(A,m)=>A.findWordContaining(m)),a.extendToSubwords&&(g=Qxt(u,h,g,(A,m)=>A.findSubWordContaining(m),!0)),g=dSo(u,h,g),g=ASo(u,h,g),{mappings:g.map(A=>new cg(u.translateRange(A.seq1Range),h.translateRange(A.seq2Range))),hitTimeout:f.hitTimeout}}}function gSo(e){return new Lf(new Qi(e.seq1Range.start+1,e.seq1Range.endExclusive+1),new Qi(e.seq2Range.start+1,e.seq2Range.endExclusive+1))}const PVe={getLegacy:()=>new G9o,getDefault:()=>new fSo};var MVe;(function(e){function t(n,r){return!n.isInlineEdit&&!n.uri?mSo.create(n,r):hW.create(n,r)}e.create=t})(MVe||(MVe={}));class hRn{constructor(t,n,r){this._data=t,this.identity=n,this.hint=r}get source(){return this._data.source}get isFromExplicitRequest(){return this._data.context.triggerKind===im.Explicit}get forwardStable(){return this.source.inlineSuggestions.enableForwardStability??!1}get editRange(){return this.getSingleTextEdit().range}get targetRange(){var t,n;return(t=this.hint)!=null&&t.range&&!this.hint.jumpToEdit?(n=this.hint)==null?void 0:n.range:this.editRange}get insertText(){return this.getSingleTextEdit().text}get semanticId(){return this.hash}get action(){return this._sourceInlineCompletion.gutterMenuLinkAction}get command(){return this._sourceInlineCompletion.command}get warning(){return this._sourceInlineCompletion.warning}get showInlineEditMenu(){return!!this._sourceInlineCompletion.showInlineEditMenu}get hash(){return JSON.stringify([this.getSingleTextEdit().text,this.getSingleTextEdit().range.getStartPosition().toString()])}get requestUuid(){return this._data.context.requestUuid}get partialAccepts(){return this._data.partialAccepts}get _sourceInlineCompletion(){return this._data.sourceInlineCompletion}addRef(){this.identity.addRef(),this.source.addRef()}removeRef(){this.identity.removeRef(),this.source.removeRef()}reportInlineEditShown(t,n,r){this._data.reportInlineEditShown(t,this.insertText,n,r)}reportPartialAccept(t,n,r){this._data.reportPartialAccept(t,n,r)}reportEndOfLife(t){this._data.reportEndOfLife(t)}setEndOfLifeReason(t){this._data.setEndOfLifeReason(t)}setIsPreceeded(t){this._data.setIsPreceeded(t.partialAccepts)}setNotShownReasonIfNotSet(t){this._data.setNotShownReason(t)}getSourceCompletion(){return this._sourceInlineCompletion}}const Q2e=class Q2e{constructor(){this._onDispose=Uv(this),this._jumpedTo=Bi(this,!1),this._refCount=1,this.id="InlineCompletionIdentity"+Q2e.idCounter++}get jumpedTo(){return this._jumpedTo}addRef(){this._refCount++}removeRef(){this._refCount--,this._refCount===0&&this._onDispose.trigger(void 0)}setJumpTo(t){this._jumpedTo.set(!0,t)}};Q2e.idCounter=0;let s0e=Q2e;class Oee{static create(t){return new Oee(De.lift(t.range),t.content,t.style,t.jumpToEdit)}constructor(t,n,r,o){this.range=t,this.content=n,this.style=r,this.jumpToEdit=o}withEdit(t,n){const r=new Jn(n.getOffset(this.range.getStartPosition()),n.getOffset(this.range.getEndPosition())),o=PQn([r],t)[0];if(!o)return;const s=n.getRange(o);return new Oee(s,this.content,this.style,this.jumpToEdit)}}let mSo=class Hhe extends hRn{static create(t,n){const r=new s0e,o=pee(n),s=t.insertText.replace(/\r\n|\r|\n/g,n.getEOL()),a=vSo(new fh(o.getOffsetRange(t.range),s),n),l=a.removeCommonSuffixAndPrefix(n.getValue()),d=o.getTextReplacement(a),u=t.hint?Oee.create(t.hint):void 0;return new Hhe(a,l,d,d.range,t.snippetInfo,t.additionalTextEdits,t,r,u)}constructor(t,n,r,o,s,a,l,d,u){super(l,d,u),this._edit=t,this._trimmedEdit=n,this._textEdit=r,this._originalRange=o,this.snippetInfo=s,this.additionalTextEdits=a,this.isInlineEdit=!1}get hash(){return JSON.stringify(this._trimmedEdit.toJson())}getSingleTextEdit(){return this._textEdit}withIdentity(t){return new Hhe(this._edit,this._trimmedEdit,this._textEdit,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,t,this.hint)}withEdit(t,n){const r=PQn([this._edit.replaceRange],t);if(r.length===0)return;const o=new fh(r[0],this._textEdit.text),s=pee(n),a=s.getTextReplacement(o);let l=this.hint;if(l&&(l=l.withEdit(t,s),!l))return;const d=o.removeCommonSuffixAndPrefix(n.getValue());return new Hhe(o,d,a,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,this.identity,l)}canBeReused(t,n){const r=this._textEdit.range;return!!r&&r.containsPosition(n)&&this.isVisible(t,n)&&Yd.ofRange(r).isGreaterThanOrEqualTo(Yd.ofRange(this._originalRange))}isVisible(t,n){const r=this.getSingleTextEdit();return ARn(r,this._originalRange,t,n)}};function ARn(e,t,n,r){const o=ZL(e,n),s=e.range;if(!s||t&&!t.getStartPosition().equals(s.getStartPosition())||r.lineNumber!==o.range.startLineNumber||o.isEmpty)return!1;const a=n.getValueInRange(o.range,1),l=o.text,d=Math.max(0,r.column-o.range.startColumn);let u=l.substring(0,d),h=l.substring(d),f=a.substring(0,d),g=a.substring(d);const k=n.getLineIndentColumn(o.range.startLineNumber);return o.range.startColumn<=k&&(f=f.trimStart(),f.length===0&&(g=g.trimStart()),u=u.trimStart(),u.length===0&&(h=h.trimStart())),u.startsWith(f)&&!!pBn(g,h)}class hW extends hRn{static create(t,n){const r=kSo(n,t.range,t.insertText),o=new BP(n),s=Yp.fromStringEdit(r,o),a=r.isEmpty()?new Zc(new De(1,1,1,1),""):s.toReplacement(o),l=new s0e,d=r.replacements.map(h=>{const f=De.fromPositions(n.getPositionAt(h.replaceRange.start),n.getPositionAt(h.replaceRange.endExclusive)),g=n.getValueInRange(f);return a0e.create(h,g)}),u=t.hint?Oee.create(t.hint):void 0;return new hW(r,a,t.uri,t,l,d,u,!1,n.getVersionId())}constructor(t,n,r,o,s,a,l,d=!1,u){super(o,s,l),this._edit=t,this._textEdit=n,this.uri=r,this._edits=a,this._lastChangePartOfInlineEdit=d,this._inlineEditModelVersion=u,this.snippetInfo=void 0,this.additionalTextEdits=[],this.isInlineEdit=!0}get updatedEditModelVersion(){return this._inlineEditModelVersion}get updatedEdit(){return this._edit}getSingleTextEdit(){return this._textEdit}withIdentity(t){return new hW(this._edit,this._textEdit,this.uri,this._data,t,this._edits,this.hint,this._lastChangePartOfInlineEdit,this._inlineEditModelVersion)}canBeReused(t,n){return this._lastChangePartOfInlineEdit&&this.updatedEditModelVersion===t.getVersionId()}withEdit(t,n){return this._applyTextModelChanges(t,this._edits,n)}_applyTextModelChanges(t,n,r){if(n=n.map(f=>f.applyTextModelChanges(t)),n.some(f=>f.edit===void 0))return;const o=r.getVersionId();let s=this._inlineEditModelVersion;const a=n.some(f=>f.lastChangeUpdatedEdit);if(a&&(s=o??-1),o===null||s+20!f.edit.isEmpty),n.length===0))return;const l=new $8(n.map(f=>f.edit)),d=pee(r),u=d.getTextEdit(l).toReplacement(new BP(r));let h=this.hint;if(!(h&&(h=h.withEdit(t,d),!h)))return new hW(l,u,this.uri,this._data,this.identity,n,h,a,s)}}function kSo(e,t,n){const r=e.getEOL(),o=e.getValueInRange(t),s=n.replace(/\r\n|\r|\n/g,r),d=PVe.getDefault().computeDiff(W1(o),W1(s),{ignoreTrimWhitespace:!1,computeMoves:!1,extendToSubwords:!0,maxComputationTimeMs:500}).changes.flatMap(g=>g.innerChanges??[]);function u(g,k){const A=Yd.fromPosition(k.getStartPosition());return Yd.ofRange(k).createRange(A.addToPosition(g))}const h=new L5(s);return new $8(d.map(g=>{const k=u(t.getStartPosition(),g.originalRange),A=pee(e).getOffsetRange(k),m=h.getValueOfRange(g.modifiedRange),v=new fh(A,m),p=e.getValueInRange(k);return pSo(v,p,d.length,e)}))}class a0e{static create(t,n){const r=f4(t.newText,n),o=Z8(t.newText,n),s=t.newText.substring(r,t.newText.length-o);return new a0e(t,s,r,o)}get edit(){return this._edit}get lastChangeUpdatedEdit(){return this._lastChangeUpdatedEdit}constructor(t,n,r,o,s=!1){this._edit=t,this._trimmedNewText=n,this._prefixLength=r,this._suffixLength=o,this._lastChangeUpdatedEdit=s}applyTextModelChanges(t){const n=this._clone();return n._applyTextModelChanges(t),n}_clone(){return new a0e(this._edit,this._trimmedNewText,this._prefixLength,this._suffixLength,this._lastChangeUpdatedEdit)}_applyTextModelChanges(t){if(this._lastChangeUpdatedEdit=!1,!this._edit)throw new Ai("UpdatedInnerEdits: No edit to apply changes to");const n=this._applyChanges(this._edit,t);if(!n){this._edit=void 0;return}this._edit=n.edit,this._lastChangeUpdatedEdit=n.editHasChanged}_applyChanges(t,n){let r=t.replaceRange.start,o=t.replaceRange.endExclusive,s=t.newText,a=!1;const l=this._prefixLength>0||this._suffixLength>0;for(let d=n.replacements.length-1;d>=0;d--){const u=n.replacements[d],h=u.newText.length>0&&u.replaceRange.isEmpty;if(h&&!l&&u.replaceRange.start===r&&s.startsWith(u.newText)){r+=u.newText.length,s=s.substring(u.newText.length),o=Math.max(r,o),a=!0;continue}if(h&&l&&u.replaceRange.start===r+this._prefixLength&&this._trimmedNewText.startsWith(u.newText)){o+=u.newText.length,a=!0,this._prefixLength+=u.newText.length,this._trimmedNewText=this._trimmedNewText.substring(u.newText.length);continue}if(u.newText.length===0&&u.replaceRange.length>0&&u.replaceRange.start>=r+this._prefixLength&&u.replaceRange.endExclusive<=o-this._suffixLength){o-=u.replaceRange.length,a=!0;continue}if(u.equals(t)){a=!0,r=u.replaceRange.endExclusive,s="";continue}if(!(u.replaceRange.start>o)){if(u.replaceRange.endExclusive1&&e.newText.endsWith(n)&&!e.newText.startsWith(n)?new fh(e.replaceRange.delta(-1),n+e.newText.slice(0,-n.length)):e}function bSo(e,t){const n=new WQn,r=new VQn(n,u=>t.getLanguageConfiguration(u)),o=new HQn(new OSo([e]),r),s=Yje(o,[],void 0,!0);let a="";const l=e.getLineContent();function d(u,h){if(u.kind===2)if(d(u.openingBracket,h),h=ec(h,u.openingBracket.length),u.child&&(d(u.child,h),h=ec(h,u.child.length)),u.closingBracket)d(u.closingBracket,h),h=ec(h,u.closingBracket.length);else{const g=r.getSingleLanguageBracketTokens(u.openingBracket.languageId).findClosingTokenText(u.openingBracket.bracketIds);a+=g}else if(u.kind!==3){if(u.kind===0||u.kind===1)a+=l.substring(h,ec(h,u.length));else if(u.kind===4)for(const f of u.children)d(f,h),h=ec(h,f.length)}}return d(s,mg),a}class OSo{constructor(t){this.lines=t,this.tokenization={getLineTokens:n=>this.lines[n-1]}}getLineCount(){return this.lines.length}getLineLength(t){return this.lines[t-1].getLineContent().length}}class vit{constructor(){this._nodes=new Set,this._outgoingEdges=new Map}static from(t,n){const r=new vit;for(const o of t)r._nodes.add(o);for(const o of t){const s=n(o);if(s.length>0){const a=new Set;for(const l of s)a.add(l);r._outgoingEdges.set(o,a)}}return r}removeCycles(){const t=[],n=new Set,r=new Set,o=[],s=a=>{n.add(a),r.add(a);const l=this._outgoingEdges.get(a);if(l)for(const d of l)n.has(d)?r.has(d)&&(t.push(d),o.push({from:a,to:d})):s(d);r.delete(a)};for(const a of this._nodes)n.has(a)||s(a);for(const{from:a,to:l}of o){const d=this._outgoingEdges.get(a);d&&d.delete(l)}return{foundCycles:t}}getOutgoing(t){const n=this._outgoingEdges.get(t);return n?Array.from(n):[]}}var LA;(function(e){e.Jump="jump",e.Accept="accept",e.Inactive="inactive"})(LA||(LA={}));var Jo;(function(e){e.GhostText="ghostText",e.Custom="custom",e.SideBySide="sideBySide",e.Deletion="deletion",e.InsertionInline="insertionInline",e.InsertionMultiLine="insertionMultiLine",e.WordReplacements="wordReplacements",e.LineReplacement="lineReplacement",e.Collapsed="collapsed"})(Jo||(Jo={}));function wSo(e,t,n,r,o,s){const a=nQn("icr"),l=new Ya;let d;const u={...r,requestUuid:a},h=LSo(t,n),f=mvo(e,p=>p.groupId),g=vit.from(e,p=>{var b;return((b=p.yieldsToGroupIds)==null?void 0:b.flatMap(O=>f.get(O)??[]))??[]}),{foundCycles:k}=g.removeCycles();k.length>0&&Xc(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${k.map(p=>p.toString?p.toString():""+p).join(" -> ")}`));let A=0;const m=new SUe(async p=>{try{if(A++,l.token.isCancellationRequested)return;const b=g.getOutgoing(p);for(const L of b){const S=await m.get(L);if(S)for(const E of S.inlineSuggestions.items){if(E.isInlineEdit||typeof E.insertText!="string"&&E.insertText!==void 0)return;if(E.insertText!==void 0){const Q=new Zc(De.lift(E.range)??h,E.insertText);if(ARn(Q,void 0,n,t))return}}}let O;const w=Date.now();try{O=await p.provideInlineCompletions(n,t,u,l.token)}catch(L){Xc(L);return}const y=Date.now();if(!O)return;const C=[],x=new xSo(O,C,p);if(x.addRef(),gRn(l.token,()=>x.removeRef(d)),l.token.isCancellationRequested)return;for(const L of O.items)C.push(ySo(L,x,h,n,s,u,o,{startTime:w,endTime:y}));return x}finally{A--}}),v=$v.fromPromisesResolveOrder(e.map(p=>m.get(p))).filter(Uu);return{contextWithUuid:u,get didAllProvidersReturn(){return A===0},lists:v,cancelAndDispose:p=>{d===void 0&&(d=p,l.dispose(!0))}}}function gRn(e,t){if(e.isCancellationRequested)return t(),ct.None;{const n=e.onCancellationRequested(()=>{n.dispose(),t()});return{dispose:()=>n.dispose()}}}function ySo(e,t,n,r,o,s,a,l){let d,u,h=e.range?De.lift(e.range):n;if(typeof e.insertText=="string"){if(d=e.insertText,o&&e.completeBracketPairs){d=Pxt(d,h.getStartPosition(),r,o);const f=d.length-e.insertText.length;f!==0&&(h=new De(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn+f))}u=void 0}else if(e.insertText===void 0)d="",u=void 0,h=new De(1,1,1,1);else if("snippet"in e.insertText){const f=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=Pxt(e.insertText.snippet,h.getStartPosition(),r,o);const k=e.insertText.snippet.length-f;k!==0&&(h=new De(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn+k))}const g=new MP().parse(e.insertText.snippet);g.children.length===1&&g.children[0]instanceof p1?(d=g.children[0].value,u=void 0):(d=g.toString(),u={snippet:e.insertText.snippet,range:h})}else Uie(e.insertText);return new CSo(h,d,u,pi.revive(e.uri),e.hint,e.additionalTextEdits||Q9o(),e,t,s,e.isInlineEdit??!1,a,l,e.correlationId)}class CSo{constructor(t,n,r,o,s,a,l,d,u,h,f,g,k){this.range=t,this.insertText=n,this.snippetInfo=r,this.uri=o,this.hint=s,this.additionalTextEdits=a,this.sourceInlineCompletion=l,this.source=d,this.context=u,this.isInlineEdit=h,this._requestInfo=f,this._providerRequestInfo=g,this._correlationId=k,this._didShow=!1,this._timeUntilShown=void 0,this._showStartTime=void 0,this._shownDuration=0,this._showUncollapsedStartTime=void 0,this._showUncollapsedDuration=0,this._notShownReason=void 0,this._didReportEndOfLife=!1,this._lastSetEndOfLifeReason=void 0,this._isPreceeded=!1,this._partiallyAcceptedCount=0,this._partiallyAcceptedSinceOriginal={characters:0,ratio:0,count:0},this._viewData={editorType:f.editorType}}get showInlineEditMenu(){return this.sourceInlineCompletion.showInlineEditMenu??!1}get partialAccepts(){return this._partiallyAcceptedSinceOriginal}async reportInlineEditShown(t,n,r,o){var a,l;if(this.updateShownDuration(r),this._didShow)return;this._didShow=!0,this._viewData.viewKind=r,this._viewData.renderData=o,this._timeUntilShown=Date.now()-this._requestInfo.startTime;const s=new W$(o.lineCountModified,o.lineCountOriginal,o.characterCountModified,o.characterCountOriginal);(l=(a=this.source.provider).handleItemDidShow)==null||l.call(a,this.source.inlineSuggestions,this.sourceInlineCompletion,n,s),this.sourceInlineCompletion.shownCommand&&await t.executeCommand(this.sourceInlineCompletion.shownCommand.id,...this.sourceInlineCompletion.shownCommand.arguments||[])}reportPartialAccept(t,n,r){var o,s;this._partiallyAcceptedCount++,this._partiallyAcceptedSinceOriginal.characters+=r.characters,this._partiallyAcceptedSinceOriginal.ratio=Math.min(this._partiallyAcceptedSinceOriginal.ratio+(1-this._partiallyAcceptedSinceOriginal.ratio)*r.ratio,1),this._partiallyAcceptedSinceOriginal.count+=r.count,(s=(o=this.source.provider).handlePartialAccept)==null||s.call(o,this.source.inlineSuggestions,this.sourceInlineCompletion,t,n)}reportEndOfLife(t){if(!this._didReportEndOfLife&&(this._didReportEndOfLife=!0,this.reportInlineEditHidden(),t||(t=this._lastSetEndOfLifeReason??{kind:CP.Ignored,userTypingDisagreed:!1,supersededBy:void 0}),t.kind===CP.Rejected&&this.source.provider.handleRejection&&this.source.provider.handleRejection(this.source.inlineSuggestions,this.sourceInlineCompletion),this.source.provider.handleEndOfLifetime)){const n={requestUuid:this.context.requestUuid,correlationId:this._correlationId,selectedSuggestionInfo:!!this.context.selectedSuggestionInfo,partiallyAccepted:this._partiallyAcceptedCount,partiallyAcceptedCountSinceOriginal:this._partiallyAcceptedSinceOriginal.count,partiallyAcceptedRatioSinceOriginal:this._partiallyAcceptedSinceOriginal.ratio,partiallyAcceptedCharactersSinceOriginal:this._partiallyAcceptedSinceOriginal.characters,shown:this._didShow,shownDuration:this._shownDuration,shownDurationUncollapsed:this._showUncollapsedDuration,preceeded:this._isPreceeded,timeUntilShown:this._timeUntilShown,timeUntilProviderRequest:this._providerRequestInfo.startTime-this._requestInfo.startTime,timeUntilProviderResponse:this._providerRequestInfo.endTime-this._requestInfo.startTime,editorType:this._viewData.editorType,languageId:this._requestInfo.languageId,requestReason:this._requestInfo.reason,viewKind:this._viewData.viewKind,notShownReason:this._notShownReason,typingInterval:this._requestInfo.typingInterval,typingIntervalCharacterCount:this._requestInfo.typingIntervalCharacterCount,availableProviders:this._requestInfo.availableProviders.map(r=>r.toString()).join(","),...this._viewData.renderData};this.source.provider.handleEndOfLifetime(this.source.inlineSuggestions,this.sourceInlineCompletion,t,n)}}setIsPreceeded(t){this._isPreceeded=!0,(this._partiallyAcceptedSinceOriginal.characters!==0||this._partiallyAcceptedSinceOriginal.ratio!==0||this._partiallyAcceptedSinceOriginal.count!==0)&&console.warn("Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded."),this._partiallyAcceptedSinceOriginal=t}setNotShownReason(t){this._notShownReason??(this._notShownReason=t)}setEndOfLifeReason(t){this.reportInlineEditHidden(),this._lastSetEndOfLifeReason=t}updateShownDuration(t){const n=Date.now();this._showStartTime||(this._showStartTime=n);const r=t===Jo.Collapsed;!r&&this._showUncollapsedStartTime===void 0&&(this._showUncollapsedStartTime=n),r&&this._showUncollapsedStartTime!==void 0&&(this._showUncollapsedDuration+=n-this._showUncollapsedStartTime)}reportInlineEditHidden(){if(this._showStartTime===void 0)return;const t=Date.now();this._shownDuration+=t-this._showStartTime,this._showStartTime=void 0,this._showUncollapsedStartTime!==void 0&&(this._showUncollapsedDuration+=t-this._showUncollapsedStartTime,this._showUncollapsedStartTime=void 0)}}var tJ;(function(e){e.TextEditor="textEditor",e.DiffEditor="diffEditor",e.Notebook="notebook"})(tJ||(tJ={}));class xSo{constructor(t,n,r){this.inlineSuggestions=t,this.inlineSuggestionsData=n,this.provider=r,this.refCount=0}addRef(){this.refCount++}removeRef(t={kind:"other"}){if(this.refCount--,this.refCount===0){for(const n of this.inlineSuggestionsData)n.reportEndOfLife();this.provider.disposeInlineCompletions(this.inlineSuggestions,t)}}}function LSo(e,t){const n=t.getWordAtPosition(e),r=t.getLineMaxColumn(e.lineNumber);return n?new De(e.lineNumber,n.startColumn,e.lineNumber,r):De.fromPositions(e,e.with(void 0,r))}function Pxt(e,t,n,r){const o=n.getLineContent(t.lineNumber),s=fh.replace(new Jn(t.column-1,o.length),e),a=n.tokenization.tokenizeLinesAt(t.lineNumber,[s.replace(o)]),l=a==null?void 0:a[0].sliceZeroCopy(s.getRangeAfterReplace());return l?bSo(l,r):e}var SSo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},GX=function(e,t){return function(n,r){t(n,r,e)}},RVe,pF;let IVe=(pF=class extends ct{constructor(t,n,r,o,s,a,l,d,u){var f;super(),this._textModel=t,this._versionId=n,this._debounceValue=r,this._cursorPosition=o,this._languageConfigurationService=s,this._logService=a,this._configurationService=l,this._instantiationService=d,this._contextKeyService=u,this._updateOperation=this._register(new is),this._state=H9o(this,{initial:()=>({inlineCompletions:Sp.createEmpty(),suggestWidgetInlineCompletions:Sp.createEmpty()}),disposeFinal:g=>{g.inlineCompletions.dispose(),g.suggestWidgetInlineCompletions.dispose()},changeTracker:avo(()=>({versionId:this._versionId})),update:(g,k,A)=>{const m=$8.compose(A.changes.map(v=>v.change?Y9o(v.change.changes):$8.empty).filter(Uu));if(m.isEmpty())return k;try{return{inlineCompletions:k.inlineCompletions.createStateWithAppliedEdit(m,this._textModel),suggestWidgetInlineCompletions:k.suggestWidgetInlineCompletions.createStateWithAppliedEdit(m,this._textModel)}}finally{k.inlineCompletions.dispose(),k.suggestWidgetInlineCompletions.dispose()}}}),this.inlineCompletions=this._state.map(this,g=>g.inlineCompletions),this.suggestWidgetInlineCompletions=this._state.map(this,g=>g.suggestWidgetInlineCompletions),this._completionsEnabled=void 0,this.clearOperationOnTextModelChange=Wt(this,g=>{this._versionId.read(g),this._updateOperation.clear()}),this._loadingCount=Bi(this,0),this._loggingEnabled=zwt("editor.inlineSuggest.logFetch",!1,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._sendRequestData=zwt("editor.inlineSuggest.emptyResponseInformation",!0,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._structuredFetchLogger=this._register(this._instantiationService.createInstance(_1e.cast(),"editor.inlineSuggest.logFetch.commandId")),this.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);const h=((f=phe.defaultChatAgent)==null?void 0:f.completionsEnablementSetting)??void 0;h&&(this._updateCompletionsEnablement(h),this._register(this._configurationService.onDidChangeConfiguration(g=>{g.affectsConfiguration(h)&&this._updateCompletionsEnablement(h)}))),this._state.recomputeInitiallyAndOnChange(this._store)}_updateCompletionsEnablement(t){const n=this._configurationService.getValue(t);Vd(n)?this._completionsEnabled=n:this._completionsEnabled=void 0}_log(t){this._loggingEnabled.get()&&this._logService.info(O9o(t)),this._structuredFetchLogger.log(t)}fetch(t,n,r,o,s,a,l){var m,v;const d=this._cursorPosition.get(),u=new TSo(d,r,this._textModel.getVersionId(),new Set(t)),h=r.selectedSuggestionInfo?this.suggestWidgetInlineCompletions.get():this.inlineCompletions.get();if((m=this._updateOperation.value)!=null&&m.request.satisfies(u))return this._updateOperation.value.promise;if((v=h==null?void 0:h.request)!=null&&v.satisfies(u))return Promise.resolve(!0);const f=!!this._updateOperation.value;this._updateOperation.clear();const g=new Ya,k=(async()=>{const p=new Pt;this._loadingCount.set(this._loadingCount.get()+1,void 0);let b=!1;const O=()=>{b||(b=!0,this._loadingCount.set(this._loadingCount.get()-1,void 0))};p.add(new Ss(()=>O(),10*1e3)).schedule();const y=t.filter(x=>x.providerId),C=new ESo(r,l,y);try{const x=this._debounceValue.get(this._textModel),L=bQn(t.map(I=>I.debounceDelayMs),Blo(P1))??x;if((f||s&&r.triggerKind===im.Automatic)&&await fxt(L,g.token),g.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==u.versionId)return C.setNoSuggestionReasonIfNotSet("canceled:beforeFetch"),!1;const E=RVe._requestId++;(this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get())&&this._log({sourceId:"InlineCompletions.fetch",kind:"start",requestId:E,modelUri:this._textModel.uri,modelVersion:this._textModel.getVersionId(),context:{triggerKind:r.triggerKind,suggestInfo:r.selectedSuggestionInfo?!0:void 0},time:Date.now(),provider:n});const Q=new Date,T=wSo(t,this._cursorPosition.get(),this._textModel,r,l,this._languageConfigurationService);gRn(g.token,()=>T.cancelAndDispose({kind:"tokenCancellation"}));let M=!1,B=!1;const P=[];for await(const I of T.lists)if(I){I.addRef(),p.add(Gn(()=>I.removeRef(I.inlineSuggestionsData.length===0?{kind:"empty"}:{kind:"notTaken"})));for(const W of I.inlineSuggestionsData){if(B=!0,!r.includeInlineEdits&&(W.isInlineEdit||W.showInlineEditMenu)){W.setNotShownReason("notInlineEditRequested");continue}if(!r.includeInlineCompletions&&!(W.isInlineEdit||W.showInlineEditMenu)){W.setNotShownReason("notInlineCompletionRequested");continue}const H=MVe.create(W,this._textModel);P.push(H),!H.isInlineEdit&&!H.showInlineEditMenu&&r.triggerKind===im.Automatic&&H.isVisible(this._textModel,this._cursorPosition.get())&&(M=!0)}if(M)break}if(T.cancelAndDispose({kind:"lostRace"}),this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get()){const I=T.didAllProvidersReturn;let W;(g.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==u.versionId)&&(W="canceled");const H=P.map(V=>{var Z;return{range:V.editRange.toString(),text:V.insertText,hint:V.hint,isInlineEdit:V.isInlineEdit,showInlineEditMenu:V.showInlineEditMenu,providerId:(Z=V.source.provider.providerId)==null?void 0:Z.toString()}});this._log({sourceId:"InlineCompletions.fetch",kind:"end",requestId:E,durationMs:Date.now()-Q.getTime(),error:W,result:H,time:Date.now(),didAllProvidersReturn:I})}if(C.setRequestUuid(T.contextWithUuid.requestUuid),B)C.setHasProducedSuggestion(),P.length>0&&g.token.isCancellationRequested&&P.forEach(I=>I.setNotShownReasonIfNotSet("canceled:whileAwaitingOtherProviders"));else if(g.token.isCancellationRequested)C.setNoSuggestionReasonIfNotSet("canceled:whileFetching");else{const I=this._contextKeyService.getContextKeyValue("completionsQuotaExceeded");C.setNoSuggestionReasonIfNotSet(I?"completionsQuotaExceeded":"noSuggestion")}const F=r.earliestShownDateTime-Date.now();if(F>0&&await fxt(F,g.token),g.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==u.versionId||a.get()){const I=g.token.isCancellationRequested?"canceled:afterMinShowDelay":this._store.isDisposed?"canceled:disposed":this._textModel.getVersionId()!==u.versionId?"canceled:documentChanged":a.get()?"canceled:userJumped":"unknown";return P.forEach(W=>W.setNotShownReasonIfNotSet(I)),!1}const R=new Date;this._debounceValue.update(this._textModel,R.getTime()-Q.getTime());const N=this._cursorPosition.get();this._updateOperation.clear(),ua(I=>{const W=this._state.get();r.selectedSuggestionInfo?this._state.set({inlineCompletions:Sp.createEmpty(),suggestWidgetInlineCompletions:W.suggestWidgetInlineCompletions.createStateWithAppliedResults(P,u,this._textModel,N,o)},I):this._state.set({inlineCompletions:W.inlineCompletions.createStateWithAppliedResults(P,u,this._textModel,N,o),suggestWidgetInlineCompletions:Sp.createEmpty()},I),W.inlineCompletions.dispose(),W.suggestWidgetInlineCompletions.dispose()})}finally{p.dispose(),O(),this.sendInlineCompletionsRequestTelemetry(C)}return!0})(),A=new BSo(u,g,k);return this._updateOperation.value=A,k}clear(t){this._updateOperation.clear();const n=this._state.get();this._state.set({inlineCompletions:Sp.createEmpty(),suggestWidgetInlineCompletions:Sp.createEmpty()},t),n.inlineCompletions.dispose(),n.suggestWidgetInlineCompletions.dispose()}seedInlineCompletionsWithSuggestWidget(){const t=this.inlineCompletions.get(),n=this.suggestWidgetInlineCompletions.get();n&&ua(r=>{var o,s;if(!t||(((o=n.request)==null?void 0:o.versionId)??-1)>(((s=t.request)==null?void 0:s.versionId)??-1)){t==null||t.dispose();const a=this._state.get();this._state.set({inlineCompletions:n.clone(),suggestWidgetInlineCompletions:Sp.createEmpty()},r),a.inlineCompletions.dispose(),a.suggestWidgetInlineCompletions.dispose()}this.clearSuggestWidgetInlineCompletions(r)})}sendInlineCompletionsRequestTelemetry(t){if(!this._sendRequestData.get()&&!this._contextKeyService.getContextKeyValue("isRunningUnificationExperiment")||t.requestUuid===void 0||t.hasProducedSuggestion||!QSo(this._completionsEnabled,this._textModel.getLanguageId())||!t.providers.some(o=>{var s;return bxt((s=o.providerId)==null?void 0:s.extensionId)}))return;const n={opportunityId:t.requestUuid,noSuggestionReason:t.noSuggestionReason??"unknown",extensionId:"vscode-core",extensionVersion:"0.0.0",groupId:"empty",shown:!1,editorType:t.requestInfo.editorType,requestReason:t.requestInfo.reason,typingInterval:t.requestInfo.typingInterval,typingIntervalCharacterCount:t.requestInfo.typingIntervalCharacterCount,languageId:t.requestInfo.languageId,selectedSuggestionInfo:!!t.context.selectedSuggestionInfo,availableProviders:t.providers.map(o=>{var s;return(s=o.providerId)==null?void 0:s.toString()}).filter(Uu).join(","),...Z9o(t.providers.some(o=>{var s;return bxt((s=o.providerId)==null?void 0:s.extensionId)})),timeUntilProviderRequest:void 0,timeUntilProviderResponse:void 0,viewKind:void 0,preceeded:void 0,superseded:void 0,reason:void 0,correlationId:void 0,shownDuration:void 0,shownDurationUncollapsed:void 0,timeUntilShown:void 0,partiallyAccepted:void 0,partiallyAcceptedCountSinceOriginal:void 0,partiallyAcceptedRatioSinceOriginal:void 0,partiallyAcceptedCharactersSinceOriginal:void 0,cursorColumnDistance:void 0,cursorLineDistance:void 0,lineCountOriginal:void 0,lineCountModified:void 0,characterCountOriginal:void 0,characterCountModified:void 0,disjointReplacements:void 0,sameShapeReplacements:void 0,notShownReason:void 0},r=this._instantiationService.createInstance(DVe);X9o(r,n)}clearSuggestWidgetInlineCompletions(t){var n;(n=this._updateOperation.value)!=null&&n.request.context.selectedSuggestionInfo&&this._updateOperation.clear()}cancelUpdate(){this._updateOperation.clear()}},RVe=pF,pF._requestId=0,pF);IVe=RVe=SSo([GX(4,bl),GX(5,Oa),GX(6,cr),GX(7,$n),GX(8,Fi)],IVe);class TSo{constructor(t,n,r,o){this.position=t,this.context=n,this.versionId=r,this.providers=o}satisfies(t){return this.position.equals(t.position)&&pQ(this.context.selectedSuggestionInfo,t.context.selectedSuggestionInfo,Eet())&&(t.context.triggerKind===im.Automatic||this.context.triggerKind===im.Explicit)&&this.versionId===t.versionId&&DSo(t.providers,this.providers)}}class ESo{constructor(t,n,r){this.context=t,this.requestInfo=n,this.providers=r,this.hasProducedSuggestion=!1}setRequestUuid(t){this.requestUuid=t}setNoSuggestionReasonIfNotSet(t){this.noSuggestionReason??(this.noSuggestionReason=t)}setHasProducedSuggestion(){this.hasProducedSuggestion=!0}}function DSo(e,t){return[...e].every(n=>t.has(n))}function QSo(e,t="*"){return e===void 0?!1:typeof e[t]<"u"?!!e[t]:!!e["*"]}class BSo{constructor(t,n,r){this.request=t,this.cancellationTokenSource=n,this.promise=r}dispose(){this.cancellationTokenSource.cancel()}}class Sp extends ct{static createEmpty(){return new Sp([],void 0)}constructor(t,n){for(const r of t)r.addRef();super(),this.inlineCompletions=t,this.request=n,this._register({dispose:()=>{for(const r of this.inlineCompletions)r.removeRef()}})}_findById(t){return this.inlineCompletions.find(n=>n.identity===t)}_findByHash(t){return this.inlineCompletions.find(n=>n.hash===t)}createStateWithAppliedEdit(t,n){const r=this.inlineCompletions.map(o=>o.withEdit(t,n)).filter(Uu);return new Sp(r,this.request)}createStateWithAppliedResults(t,n,r,o,s){let a;if(s){const u=this._findById(s);if(u&&u.canBeReused(r,n.position)){a=u;const h=t.find(f=>f.hash===u.hash);h?t=PSo(h,t):t=[u,...t]}}const l=a?!a.isInlineEdit:t.some(u=>!u.isInlineEdit&&u.isVisible(r,o));let d=[];for(const u of t){const h=this._findByHash(u.hash);let f;h&&h!==u?(f=u.withIdentity(h.identity),u.setIsPreceeded(h),h.setEndOfLifeReason({kind:CP.Ignored,userTypingDisagreed:!1,supersededBy:u.getSourceCompletion()})):f=u,l!==f.isInlineEdit&&d.push(f)}return d.sort(nA(u=>u.showInlineEditMenu,f7n)),d=FSo(d,u=>u.semanticId),new Sp(d,n)}clone(){return new Sp(this.inlineCompletions,this.request)}}function FSo(e,t){const n=new Set;return e.filter(r=>{const o=t(r);return n.has(o)?!1:(n.add(o),!0)})}function PSo(e,t){const n=t.indexOf(e);return n>-1?[e,...t.slice(0,n),...t.slice(n+1)]:t}class MSo{constructor(t,n,r){this.edit=t,this.commands=n,this.inlineCompletion=r}equals(t){return this.edit.equals(t.edit)&&this.inlineCompletion===t.inlineCompletion}}var RSo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Mxt=function(e,t){return function(n,r){t(n,r,e)}};const i3e=Lr("IInlineCompletionsService"),mRn=new Ln("inlineCompletions.snoozed",!1,j(79,"Whether inline completions are currently snoozed"));let NVe=class extends ct{get snoozeTimeLeft(){return this._snoozeTimeEnd===void 0?0:Math.max(0,this._snoozeTimeEnd-Date.now())}constructor(t,n){super(),this._contextKeyService=t,this._telemetryService=n,this._onDidChangeIsSnoozing=this._register(new it),this.onDidChangeIsSnoozing=this._onDidChangeIsSnoozing.event,this._snoozeTimeEnd=void 0,this._recentCompletionIds=[],this._timer=this._register(new U1);const r=mRn.bindTo(this._contextKeyService);this._register(this.onDidChangeIsSnoozing(()=>r.set(this.isSnoozing())))}setSnoozeDuration(t){if(t<0)throw new Ai(`Invalid snooze duration: ${t}. Duration must be non-negative.`);if(t===0){this.cancelSnooze();return}const n=this.isSnoozing(),r=this.snoozeTimeLeft;this._snoozeTimeEnd=Date.now()+t,n||this._onDidChangeIsSnoozing.fire(!0),this._timer.cancelAndSet(()=>{if(!this.isSnoozing())this._onDidChangeIsSnoozing.fire(!1);else throw new Ai("Snooze timer did not fire as expected")},this.snoozeTimeLeft+1),this._reportSnooze(t-r,t)}isSnoozing(){return this.snoozeTimeLeft>0}cancelSnooze(){this.isSnoozing()&&(this._reportSnooze(-this.snoozeTimeLeft,0),this._snoozeTimeEnd=void 0,this._timer.cancel(),this._onDidChangeIsSnoozing.fire(!1))}reportNewCompletion(t){this._lastCompletionId=t,this._recentCompletionIds.unshift(t),this._recentCompletionIds.length>5&&this._recentCompletionIds.pop()}_reportSnooze(t,n){const r=Math.round(t/1e3),o=Math.round(n/1e3);this._telemetryService.publicLog2("inlineCompletions.snooze",{deltaSeconds:r,totalSeconds:o,lastCompletionId:this._lastCompletionId,recentCompletionIds:this._recentCompletionIds})}};NVe=RSo([Mxt(0,Fi),Mxt(1,zA)],NVe);qr(i3e,NVe,1);const ISo="editor.action.inlineSuggest.snooze",NSo="editor.action.inlineSuggest.cancelSnooze",Rxt="inlineCompletions.lastSnoozeDuration",B2e=class B2e extends Gu{constructor(){super({id:B2e.ID,title:Et(81,"Snooze Inline Suggestions"),precondition:zt.true(),f1:!0})}async run(t,...n){const r=t.get(UA),o=t.get(i3e),s=t.get(jf);let a;n.length>0&&typeof n[0]=="number"&&(a=n[0]*6e4),a||(a=await this.getDurationFromUser(r,s)),a&&o.setSnoozeDuration(a)}async getDurationFromUser(t,n){const r=n.getNumber(Rxt,0,3e5),o=[{label:"1 minute",id:"1",value:6e4},{label:"5 minutes",id:"5",value:3e5},{label:"10 minutes",id:"10",value:6e5},{label:"15 minutes",id:"15",value:9e5},{label:"30 minutes",id:"30",value:18e5},{label:"60 minutes",id:"60",value:36e5}],s=await t.pick(o,{placeHolder:j(80,"Select snooze duration for Inline Suggestions"),activeItem:o.find(a=>a.value===r)});if(s)return n.store(Rxt,s.value,0,0),s.value}};B2e.ID=ISo;let UVe=B2e;const F2e=class F2e extends Gu{constructor(){super({id:F2e.ID,title:Et(82,"Cancel Snooze Inline Suggestions"),precondition:mRn,f1:!0})}async run(t){t.get(i3e).cancelSnooze()}};F2e.ID=NSo;let jVe=F2e;const lv=class lv extends ct{getTypingInterval(){return(this._cacheInvalidated||this._cachedTypingIntervalResult===null)&&(this._cachedTypingIntervalResult=this._calculateTypingInterval(),this._cacheInvalidated=!1),this._cachedTypingIntervalResult}constructor(t){super(),this._textModel=t,this._typingSessions=[],this._currentSession=null,this._lastChangeTime=0,this._cachedTypingIntervalResult=null,this._cacheInvalidated=!0,this._register(this._textModel.onDidChangeContent(n=>this._updateTypingSpeed(n)))}_updateTypingSpeed(t){const n=Date.now();if(!this._isUserTyping(t)){this._finalizeCurrentSession();return}this._currentSession&&n-this._lastChangeTime>lv.MAX_SESSION_GAP_MS&&this._finalizeCurrentSession(),this._currentSession||(this._currentSession={startTime:n,endTime:n,characterCount:0}),this._currentSession.endTime=n,this._currentSession.characterCount+=this._getActualCharacterCount(t),this._lastChangeTime=n,this._cacheInvalidated=!0}_getActualCharacterCount(t){let n=0;for(const r of t.changes)n+=Math.max(r.text.length,r.rangeLength);return n}_isUserTyping(t){if(!t.detailedReasons||t.detailedReasons.length===0)return!1;for(const n of t.detailedReasons)if(this._isUserTypingReason(n))return!0;return!1}_isUserTypingReason(t){if(t.metadata.isUndoing||t.metadata.isRedoing)return!1;switch(t.metadata.source){case"cursor":{const n=t.metadata.kind;return n==="type"||n==="compositionType"||n==="compositionEnd"}default:return!1}}_finalizeCurrentSession(){if(!this._currentSession)return;this._currentSession.endTime-this._currentSession.startTime>=lv.MIN_SESSION_DURATION_MS&&this._currentSession.characterCount>0&&(this._typingSessions.push(this._currentSession),this._typingSessions.length>lv.SESSION_HISTORY_LIMIT&&this._typingSessions.shift()),this._currentSession=null}_calculateTypingInterval(){if(this._currentSession){const t={...this._currentSession};if(t.endTime-t.startTime>=lv.MIN_SESSION_DURATION_MS&&t.characterCount>0){const r=[...this._typingSessions,t];return this._calculateSpeedFromSessions(r)}}return this._calculateSpeedFromSessions(this._typingSessions)}_calculateSpeedFromSessions(t){if(t.length===0)return{averageInterval:0,characterCount:0};const n=[...t].sort((h,f)=>f.endTime-h.endTime),r=Date.now()-lv.TYPING_SPEED_WINDOW_MS,o=n.filter(h=>h.endTime>r),s=n.splice(o.length);let a=qge(o.map(h=>h.characterCount));for(let h=0;hh.endTime-h.startTime));if(l===0||a<=1)return{averageInterval:0,characterCount:a};const d=Math.max(1,a-1),u=l/d;return{averageInterval:Math.round(u),characterCount:a}}dispose(){this._finalizeCurrentSession(),super.dispose()}};lv.MAX_SESSION_GAP_MS=3e3,lv.MIN_SESSION_DURATION_MS=1e3,lv.SESSION_HISTORY_LIMIT=50,lv.TYPING_SPEED_WINDOW_MS=3e5,lv.MIN_CHARS_FOR_RELIABLE_SPEED=20;let WVe=lv;var USo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},R7=function(e,t){return function(n,r){t(n,r,e)}};let HVe=class extends ct{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(t,n,r,o,s,a,l,d,u,h,f,g,k,A){super(),this.textModel=t,this._selectedSuggestItem=n,this._textModelVersionId=r,this._positions=o,this._debounceValue=s,this._enabled=a,this._editor=l,this._instantiationService=d,this._commandService=u,this._languageConfigurationService=h,this._accessibilityService=f,this._languageFeaturesService=g,this._codeEditorService=k,this._inlineCompletionsService=A,this._isActive=Bi(this,!1),this._onlyRequestInlineEditsSignal=Uv(this),this._forceUpdateExplicitlySignal=Uv(this),this._noDelaySignal=Uv(this),this._fetchSpecificProviderSignal=Uv(this),this._selectedInlineCompletionId=Bi(this,void 0),this.primaryPosition=Wt(this,w=>this._positions.read(w)[0]??new tt(1,1)),this.allPositions=Wt(this,w=>this._positions.read(w)),this._isAcceptingPartially=!1,this._appearedInsideViewport=Wt(this,w=>{const y=this.state.read(w);return!y||!y.inlineCompletion?!1:WSo(this._editor,y.inlineCompletion)}),this._onDidAccept=new it,this.onDidAccept=this._onDidAccept.event,this._lastShownInlineCompletionInfo=void 0,this._lastAcceptedInlineCompletionInfo=void 0,this._didUndoInlineEdits=LOt({owner:this,changeTracker:{createChangeSummary:()=>({didUndo:!1}),handleChange:(w,y)=>{var C;return y.didUndo=w.didChange(this._textModelVersionId)&&!!((C=w.change)!=null&&C.isUndoing),!0}}},(w,y)=>{const C=this._textModelVersionId.read(w);return C!==null&&this._lastAcceptedInlineCompletionInfo&&this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter===C-1&&this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit&&y.didUndo?(this._lastAcceptedInlineCompletionInfo=void 0,!0):!1}),this._preserveCurrentCompletionReasons=new Set([$x.Redo,$x.Undo,$x.AcceptWord]),this.dontRefetchSignal=Uv(this),this._fetchInlineCompletionsPromise=LOt({owner:this,changeTracker:{createChangeSummary:()=>({dontRefetch:!1,preserveCurrentCompletion:!1,inlineCompletionTriggerKind:im.Automatic,onlyRequestInlineEdits:!1,shouldDebounce:!0,provider:void 0,textChange:!1,changeReason:""}),handleChange:(w,y)=>{var C;if(w.didChange(this._textModelVersionId)){this._preserveCurrentCompletionReasons.has(this._getReason(w.change))&&(y.preserveCurrentCompletion=!0);const x=((C=w.change)==null?void 0:C.detailedReasons)??[];y.changeReason=x.length>0?x[0].getType():"",y.textChange=!0}else w.didChange(this._forceUpdateExplicitlySignal)?(y.preserveCurrentCompletion=!0,y.inlineCompletionTriggerKind=im.Explicit):w.didChange(this.dontRefetchSignal)?y.dontRefetch=!0:w.didChange(this._onlyRequestInlineEditsSignal)?y.onlyRequestInlineEdits=!0:w.didChange(this._fetchSpecificProviderSignal)&&(y.provider=w.change);return!0}}},(w,y)=>{var N,I,W;if(this._source.clearOperationOnTextModelChange.read(w),this._noDelaySignal.read(w),this.dontRefetchSignal.read(w),this._onlyRequestInlineEditsSignal.read(w),this._forceUpdateExplicitlySignal.read(w),this._fetchSpecificProviderSignal.read(w),!((this._enabled.read(w)&&this._selectedSuggestItem.read(w)||this._isActive.read(w))&&(!this._inlineCompletionsService.isSnoozing()||y.inlineCompletionTriggerKind===im.Explicit))){this._source.cancelUpdate();return}this._textModelVersionId.read(w);const x=this._source.suggestWidgetInlineCompletions.read(void 0);let L=this._selectedSuggestItem.read(w);if(this._shouldShowOnSuggestConflict.read(void 0)&&(L=void 0),x&&!L&&this._source.seedInlineCompletionsWithSuggestWidget(),y.dontRefetch)return Promise.resolve(!0);if(this._didUndoInlineEdits.read(w)&&y.inlineCompletionTriggerKind!==im.Explicit){ua(H=>{this._source.clear(H)});return}let S="";y.provider?S+="providerOnDidChange":y.inlineCompletionTriggerKind===im.Explicit&&(S+="explicit"),y.changeReason&&(S+=S.length>0?`:${y.changeReason}`:y.changeReason);const E=this._typing.getTypingInterval(),Q={editorType:this.editorType,startTime:Date.now(),languageId:this.textModel.getLanguageId(),reason:S,typingInterval:E.averageInterval,typingIntervalCharacterCount:E.characterCount,availableProviders:[]};let T={triggerKind:y.inlineCompletionTriggerKind,selectedSuggestionInfo:L==null?void 0:L.toSelectedSuggestionInfo(),includeInlineCompletions:!y.onlyRequestInlineEdits,includeInlineEdits:this._inlineEditsEnabled.read(w),requestIssuedDateTime:Q.startTime,earliestShownDateTime:Q.startTime+(y.inlineCompletionTriggerKind===im.Explicit||this.inAcceptFlow.read(void 0)?0:this._minShowDelay.read(void 0))};T.triggerKind===im.Automatic&&y.textChange&&this.textModel.getAlternativeVersionId()===((N=this._lastShownInlineCompletionInfo)==null?void 0:N.alternateTextModelVersionId)&&(T={...T,includeInlineCompletions:!this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,includeInlineEdits:this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit});const M=this.selectedInlineCompletion.read(void 0)??((I=this._inlineCompletionItems.read(void 0))==null?void 0:I.inlineEdit),B=y.preserveCurrentCompletion||M!=null&&M.forwardStable?M:void 0,P=this._jumpedToId.map(H=>{var V,Z;return!!H&&H===((Z=(V=this._inlineCompletionItems.read(void 0))==null?void 0:V.inlineEdit)==null?void 0:Z.semanticId)}),F=y.provider?{providers:[y.provider],label:"single:"+((W=y.provider.providerId)==null?void 0:W.toString())}:{providers:this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel),label:void 0},R=this.getAvailableProviders(F.providers);return Q.availableProviders=R.map(H=>H.providerId).filter(Uu),this._source.fetch(R,F.label,T,B==null?void 0:B.identity,y.shouldDebounce,P,Q)}),this._inlineCompletionItems=Gh({owner:this},w=>{const y=this._source.inlineCompletions.read(w);if(!y)return;const C=this.primaryPosition.read(w);let x;const L=[];for(const S of y.inlineCompletions)S.isInlineEdit?x=S:S.isVisible(this.textModel,C)&&L.push(S);return L.length!==0&&(x=void 0),{inlineCompletions:L,inlineEdit:x}}),this._filteredInlineCompletionItems=Gh({owner:this,equalsFn:a$()},w=>{const y=this._inlineCompletionItems.read(w);return(y==null?void 0:y.inlineCompletions)??[]}),this.selectedInlineCompletionIndex=Wt(this,w=>{const y=this._selectedInlineCompletionId.read(w),C=this._filteredInlineCompletionItems.read(w),x=this._selectedInlineCompletionId===void 0?-1:C.findIndex(L=>L.semanticId===y);return x===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):x}),this.selectedInlineCompletion=Wt(this,w=>{const y=this._filteredInlineCompletionItems.read(w),C=this.selectedInlineCompletionIndex.read(w);return y[C]}),this.activeCommands=Gh({owner:this,equalsFn:a$()},w=>{var y;return((y=this.selectedInlineCompletion.read(w))==null?void 0:y.source.inlineSuggestions.commands)??[]}),this.inlineCompletionsCount=Wt(this,w=>{if(this.lastTriggerKind.read(w)===im.Explicit)return this._filteredInlineCompletionItems.read(w).length}),this._hasVisiblePeekWidgets=Wt(this,w=>this._editorObs.openedPeekWidgets.read(w)>0),this._shouldShowOnSuggestConflict=Wt(this,w=>{const y=this._showOnSuggestConflict.read(w);if(y!=="never"&&!!this.selectedInlineCompletion.read(w)){const x=this._selectedSuggestItem.read(w);return x?y==="whenSuggestListIsIncomplete"?x.listIncomplete:!0:!1}return!1}),this.state=Gh({owner:this,equalsFn:(w,y)=>!w||!y?w===y:w.kind==="ghostText"&&y.kind==="ghostText"?gxt(w.ghostTexts,y.ghostTexts)&&w.inlineCompletion===y.inlineCompletion&&w.suggestItem===y.suggestItem:w.kind==="inlineEdit"&&y.kind==="inlineEdit"?w.inlineEdit.equals(y.inlineEdit):!1},w=>{var S,E,Q,T,M,B,P;const y=this.textModel;if(this._suppressInSnippetMode.read(w)&&this._isInSnippetMode.read(w))return;const C=this._inlineCompletionItems.read(w),x=C==null?void 0:C.inlineEdit;if(x){if(this._hasVisiblePeekWidgets.read(w))return;let F=x.getSingleTextEdit();F=ZL(F,y);const R=this.primaryPosition.map(Z=>Qi.fromRangeInclusive(x.targetRange).addMargin(1,1).contains(Z.lineNumber)),N=x.source.inlineSuggestions.commands,I=new MSo(F,N??[],x),W=x.updatedEdit,H=W?Yp.fromStringEdit(W,new BP(this.textModel)).replacements:[F],V=(((E=(S=C.inlineEdit)==null?void 0:S.command)==null?void 0:E.id)==="vscode.open"||((T=(Q=C.inlineEdit)==null?void 0:Q.command)==null?void 0:T.id)==="_workbench.open")&&((B=(M=C.inlineEdit)==null?void 0:M.command.arguments)!=null&&B.length)?pi.from((P=C.inlineEdit)==null?void 0:P.command.arguments[0]):void 0;return{kind:"inlineEdit",inlineEdit:I,inlineCompletion:x,edits:H,cursorAtInlineEdit:R,nextEditUri:V}}const L=this._selectedSuggestItem.read(w);if(!this._shouldShowOnSuggestConflict.read(w)&&L){const F=ZL(L.getSingleTextEdit(),y),R=this._computeAugmentation(F,w);if(!this._suggestPreviewEnabled.read(w)&&!R)return;const I=(R==null?void 0:R.edit)??F,W=R?R.edit.text.length-F.text.length:0,H=this._suggestPreviewMode.read(w),V=this._positions.read(w),K=[I,..._9e(this.textModel,V,I)].map(($,oe)=>({edit:$,ghostText:$?mxt($,y,H,V[oe],W):void 0})).filter(({edit:$,ghostText:oe})=>$!==void 0&&oe!==void 0),X=K.map(({edit:$})=>$),ee=K.map(({ghostText:$})=>$),q=ee[0]??new bee(I.range.endLineNumber,[]);return{kind:"ghostText",edits:X,primaryGhostText:q,ghostTexts:ee,inlineCompletion:R==null?void 0:R.completion,suggestItem:L}}else{if(!this._isActive.read(w))return;const F=this.selectedInlineCompletion.read(w);if(!F)return;const R=F.getSingleTextEdit(),N=this._inlineSuggestMode.read(w),I=this._positions.read(w),H=[R,..._9e(this.textModel,I,R)].map((K,X)=>({edit:K,ghostText:K?mxt(K,y,N,I[X],0):void 0})).filter(({edit:K,ghostText:X})=>K!==void 0&&X!==void 0),V=H.map(({edit:K})=>K),Z=H.map(({ghostText:K})=>K);return Z[0]?{kind:"ghostText",edits:V,primaryGhostText:Z[0],ghostTexts:Z,inlineCompletion:F,suggestItem:void 0}:void 0}}),this.inlineCompletionState=Wt(this,w=>{const y=this.state.read(w);if(!(!y||y.kind!=="ghostText")&&!this._editorObs.inComposition.read(w))return y}),this.inlineEditState=Wt(this,w=>{const y=this.state.read(w);if(!(!y||y.kind!=="inlineEdit"))return y}),this.inlineEditAvailable=Wt(this,w=>!!this.inlineEditState.read(w)),this.warning=Wt(this,w=>{var y,C;return(C=(y=this.inlineCompletionState.read(w))==null?void 0:y.inlineCompletion)==null?void 0:C.warning}),this.ghostTexts=Gh({owner:this,equalsFn:gxt},w=>{const y=this.inlineCompletionState.read(w);if(y)return y.ghostTexts}),this.primaryGhostText=Gh({owner:this,equalsFn:aRn},w=>{const y=this.inlineCompletionState.read(w);if(y)return y==null?void 0:y.primaryGhostText}),this.showCollapsed=Wt(this,w=>{const y=this.state.read(w);if(!y||y.kind!=="inlineEdit"||y.inlineCompletion.hint)return!1;const C=y.inlineCompletion.updatedEditModelVersion===this._textModelVersionId.read(w);return(this._inlineEditsShowCollapsedEnabled.read(w)||!C)&&this._jumpedToId.read(w)!==y.inlineCompletion.semanticId&&!this._inAcceptFlow.read(w)}),this._tabShouldIndent=Wt(this,w=>{if(this._inAcceptFlow.read(w))return!1;function y(L){return L.startLineNumber!==L.endLineNumber}function C(L,S){const E=L.getLineIndentColumn(S),Q=L.getLineLastNonWhitespaceColumn(S),T=Math.max(Q,E);return new De(S,E,S,T)}const x=this._editorObs.selections.read(w);return x==null?void 0:x.some(L=>L.isEmpty()?this.textModel.getLineLength(L.startLineNumber)===0:y(L)||L.containsRange(C(this.textModel,L.startLineNumber)))}),this.tabShouldJumpToInlineEdit=Wt(this,w=>{var C;if(this._tabShouldIndent.read(w))return!1;const y=this.inlineEditState.read(w);return y?this.showCollapsed.read(w)?!0:this._inAcceptFlow.read(w)&&this._appearedInsideViewport.read(w)&&!((C=y.inlineCompletion.hint)!=null&&C.jumpToEdit)?!1:!y.cursorAtInlineEdit.read(w):!1}),this.tabShouldAcceptInlineEdit=Wt(this,w=>{var C;const y=this.inlineEditState.read(w);return!y||this.showCollapsed.read(w)||this._tabShouldIndent.read(w)?!1:this._inAcceptFlow.read(w)&&this._appearedInsideViewport.read(w)&&!((C=y.inlineCompletion.hint)!=null&&C.jumpToEdit)||y.inlineCompletion.targetRange.startLineNumber===this._editorObs.cursorLineNumber.read(w)||this._jumpedToId.read(w)===y.inlineCompletion.semanticId?!0:y.cursorAtInlineEdit.read(w)}),this._jumpedToId=Bi(this,void 0),this._inAcceptFlow=Bi(this,!1),this.inAcceptFlow=this._inAcceptFlow,this._source=this._register(this._instantiationService.createInstance(IVe,this.textModel,this._textModelVersionId,this._debounceValue,this.primaryPosition)),this.lastTriggerKind=this._source.inlineCompletions.map(this,w=>{var y;return(y=w==null?void 0:w.request)==null?void 0:y.context.triggerKind}),this._editorObs=ml(this._editor);const m=this._editorObs.getOption(134);this._suggestPreviewEnabled=m.map(w=>w.preview),this._suggestPreviewMode=m.map(w=>w.previewMode);const v=this._editorObs.getOption(71);this._inlineSuggestMode=v.map(w=>w.mode),this._suppressedInlineCompletionGroupIds=v.map(w=>new Set(w.experimental.suppressInlineSuggestions.split(","))),this._inlineEditsEnabled=v.map(w=>!!w.edits.enabled),this._inlineEditsShowCollapsedEnabled=v.map(w=>w.edits.showCollapsed),this._triggerCommandOnProviderChange=v.map(w=>w.triggerCommandOnProviderChange),this._minShowDelay=v.map(w=>w.minShowDelay),this._showOnSuggestConflict=v.map(w=>w.experimental.showOnSuggestConflict),this._suppressInSnippetMode=v.map(w=>w.suppressInSnippetMode);const p=Mf.get(this._editor);this._isInSnippetMode=(p==null?void 0:p.isInSnippetObservable)??ha(!1),this._typing=this._register(new WVe(this.textModel)),this._register(this._inlineCompletionsService.onDidChangeIsSnoozing(w=>{w&&this.stop()}));{const w=this.textModel.uri.scheme==="vscode-notebook-cell",[y]=this._codeEditorService.listDiffEditors().filter(C=>C.getOriginalEditor().getId()===this._editor.getId()||C.getModifiedEditor().getId()===this._editor.getId());this.isInDiffEditor=!!y,this.editorType=w?tJ.Notebook:this.isInDiffEditor?tJ.DiffEditor:tJ.TextEditor}this._register(gV(this.state,w=>{w&&w.inlineCompletion&&this._inlineCompletionsService.reportNewCompletion(w.inlineCompletion.requestUuid)})),this._register(gV(this._fetchInlineCompletionsPromise)),this._register(xi(w=>{this._editorObs.versionId.read(w),this._inAcceptFlow.set(!1,void 0)})),this._register(xi(w=>{this.state.map((C,x)=>!C||C.kind==="inlineEdit"&&!C.cursorAtInlineEdit.read(x)).read(w)&&this._jumpedToId.set(void 0,void 0)}));const b=this.inlineEditState.map(w=>w==null?void 0:w.inlineCompletion.semanticId);this._register(xi(w=>{b.read(w)&&(this._editor.pushUndoStop(),this._lastShownInlineCompletionInfo={alternateTextModelVersionId:this.textModel.getAlternativeVersionId(),inlineCompletion:this.state.get().inlineCompletion})}));const O=es(this._languageFeaturesService.inlineCompletionsProvider.onDidChange,()=>this._languageFeaturesService.inlineCompletionsProvider.all(t));Bet(this,O,(w,y)=>{w.onDidChangeInlineCompletions&&y.add(w.onDidChangeInlineCompletions(()=>{var L;if(!this._enabled.get()||(this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor())!==this._editor)return;if(this._triggerCommandOnProviderChange.get()){this.trigger(void 0,{onlyFetchInlineEdits:!0});return}const x=this.state.get();x&&(x.inlineCompletion||x.edits)&&((L=x.inlineCompletion)==null?void 0:L.source.provider)!==w||ua(S=>{this._fetchSpecificProviderSignal.trigger(S,w),this.trigger(S)})}))}).recomputeInitiallyAndOnChange(this._store),this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store)}getIndentationInfo(t){let n=!1,r=!0;const o=this==null?void 0:this.primaryGhostText.read(t);if(this!=null&&this._selectedSuggestItem&&o&&o.parts.length>0){const{column:s,lines:a}=o.parts[0],l=a[0].line,d=this.textModel.getLineIndentColumn(o.lineNumber);if(s<=d){let h=Df(l);h===-1&&(h=l.length-1),n=h>0;const f=this.textModel.getOptions().tabSize;r=Ql.visibleColumnFromColumn(l,h+1,f)!(l.groupId&&n.has(l.groupId))),o=new Set;for(const l of r)(a=l.excludesGroupIds)==null||a.forEach(d=>o.add(d));const s=[];for(const l of r)l.groupId&&o.has(l.groupId)||s.push(l);return s}async trigger(t,n={}){fV(t,r=>{n.onlyFetchInlineEdits&&this._onlyRequestInlineEditsSignal.trigger(r),n.noDelay&&this._noDelaySignal.trigger(r),this._isActive.set(!0,r),n.explicit&&(this._inAcceptFlow.set(!0,r),this._forceUpdateExplicitlySignal.trigger(r)),n.provider&&this._fetchSpecificProviderSignal.trigger(r,n.provider)}),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(t,n=!1){return this.trigger(t,{onlyFetchInlineEdits:n,explicit:!0})}stop(t="automatic",n){fV(n,r=>{var o;if(t==="explicitCancel"){const s=(o=this.state.get())==null?void 0:o.inlineCompletion;s&&s.reportEndOfLife({kind:CP.Rejected})}this._isActive.set(!1,r),this._source.clear(r)})}_computeAugmentation(t,n){const r=this.textModel,o=this._source.suggestWidgetInlineCompletions.read(n),s=o?o.inlineCompletions.filter(l=>!l.isInlineEdit):[this.selectedInlineCompletion.read(n)].filter(Uu);return zmo(s,l=>{let d=l.getSingleTextEdit();return d=ZL(d,r,De.fromPositions(d.range.getStartPosition(),t.range.getEndPosition())),lRn(d,t)?{completion:l,edit:d}:void 0})}async _deltaSelectedInlineCompletionIndex(t){await this.triggerExplicitly();const n=this._filteredInlineCompletionItems.get()||[];if(n.length>0){const r=(this.selectedInlineCompletionIndex.get()+t+n.length)%n.length;this._selectedInlineCompletionId.set(n[r].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}_getMetadata(t,n,r=void 0){return r?yA.inlineCompletionPartialAccept({nes:t.isInlineEdit,requestUuid:t.requestUuid,providerId:t.source.provider.providerId,languageId:n,type:r}):yA.inlineCompletionAccept({nes:t.isInlineEdit,requestUuid:t.requestUuid,providerId:t.source.provider.providerId,languageId:n})}async accept(t=this._editor){var s;if(t.getModel()!==this.textModel)throw new Ai;let n,r=!1;const o=this.state.get();if((o==null?void 0:o.kind)==="ghostText"){if(!o||o.primaryGhostText.isEmpty()||!o.inlineCompletion)return;n=o.inlineCompletion}else if((o==null?void 0:o.kind)==="inlineEdit")n=o.inlineCompletion,r=!!o.nextEditUri;else return;n.addRef();try{if(t.pushUndoStop(),!r)if(n.snippetInfo){const a=Zc.delete(n.editRange),l=n.additionalTextEdits.map(u=>new Zc(De.lift(u.range),u.text??"")),d=Yp.fromParallelReplacementsUnsorted([a,...l]);t.edit(d,this._getMetadata(n,this.textModel.getLanguageId())),t.setPosition(n.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(s=Mf.get(t))==null||s.insert(n.snippetInfo.snippet,{undoStopBefore:!1})}else{const a=o.edits;let l=a;o.kind==="ghostText"&&(l=F9o(a,this.textModel));const d=Axt(l).map(f=>Rn.fromPositions(f)),u=n.additionalTextEdits.map(f=>new Zc(De.lift(f.range),f.text??"")),h=Yp.fromParallelReplacementsUnsorted([...a,...u]);if(t.edit(h,this._getMetadata(n,this.textModel.getLanguageId())),n.hint===void 0&&t.setSelections(o.kind==="inlineEdit"?d.slice(-1):d,"inlineCompletionAccept"),o.kind==="inlineEdit"&&!this._accessibilityService.isMotionReduced()){const f=h.getNewRanges(),g=this._store.add(new jSo(t,f,()=>{this._store.delete(g)}))}}this._onDidAccept.fire(),this.stop(),n.command&&await this._commandService.executeCommand(n.command.id,...n.command.arguments||[]).then(void 0,Xc),n.reportEndOfLife({kind:CP.Accepted})}finally{n.removeRef(),this._inAcceptFlow.set(!0,void 0),this._lastAcceptedInlineCompletionInfo={textModelVersionIdAfter:this.textModel.getVersionId(),inlineCompletion:n}}}async acceptNextWord(){await this._acceptNext(this._editor,"word",(t,n)=>{const r=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(r),s=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=n.match(s);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=n.length;const u=/\s+/g.exec(n);return u&&u.index!==void 0&&u.index+u[0].length{const r=n.match(/\n/);return r&&r.index!==void 0?r.index+1:n.length},1)}async _acceptNext(t,n,r,o){if(t.getModel()!==this.textModel)throw new Ai;const s=this.inlineCompletionState.get();if(!s||s.primaryGhostText.isEmpty()||!s.inlineCompletion)return;const a=s.primaryGhostText,l=s.inlineCompletion;if(l.snippetInfo){await this.accept(t);return}const d=a.parts[0],u=new tt(a.lineNumber,d.column),h=d.text,f=r(u,h);if(f===h.length&&a.parts.length===1){this.accept(t);return}const g=h.substring(0,f),k=this._positions.get(),A=k[0];l.addRef();try{this._isAcceptingPartially=!0;try{t.pushUndoStop();const b=De.fromPositions(A,u),O=t.getModel().getValueInRange(b)+g,w=new Zc(b,O),y=[w,..._9e(this.textModel,k,w)].filter(Uu),C=Axt(y).map(x=>Rn.fromPositions(x));t.edit(Yp.fromParallelReplacementsUnsorted(y),this._getMetadata(l,n)),t.setSelections(C,"inlineCompletionPartialAccept"),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1)}finally{this._isAcceptingPartially=!1}const m=De.fromPositions(l.editRange.getStartPosition(),Yd.ofText(g).addToPosition(u)),p=t.getModel().getValueInRange(m,1).length;l.reportPartialAccept(p,{kind:o,acceptedLength:p},{characters:f,ratio:f/h.length,count:1})}finally{l.removeRef()}}handleSuggestAccepted(t){const n=ZL(t.getSingleTextEdit(),this.textModel),r=this._computeAugmentation(n,void 0);if(!r)return;const s=this.textModel.getValueInRange(r.completion.editRange,1).length+n.text.length;r.completion.reportPartialAccept(n.text.length,{kind:2,acceptedLength:s},{characters:n.text.length,count:1,ratio:1})}extractReproSample(){var r;const t=this.textModel.getValue(),n=(r=this.state.get())==null?void 0:r.inlineCompletion;return{documentValue:t,inlineCompletion:n==null?void 0:n.getSourceCompletion()}}jump(){const t=this.inlineEditState.get();t&&ua(n=>{this._jumpedToId.set(t.inlineCompletion.semanticId,n),this.dontRefetchSignal.trigger(n);const r=t.inlineCompletion.targetRange,o=r.getStartPosition();if(this._editor.setPosition(o,"inlineCompletions.jump"),r.isSingleLine()&&(t.inlineCompletion.hint||!t.inlineCompletion.insertText.includes(` `)))this._editor.revealPosition(o);else{const a=new De(r.startLineNumber-1,1,r.endLineNumber+1,1);this._editor.revealRange(a,1)}t.inlineCompletion.identity.setJumpTo(n),this._editor.focus()})}async handleInlineSuggestionShown(t,n,r){await t.reportInlineEditShown(this._commandService,n,r)}};HVe=USo([R7(7,$n),R7(8,Ca),R7(9,bl),R7(10,xh),R7(11,Zn),R7(12,Co),R7(13,i3e)],HVe);var $x;(function(e){e[e.Undo=0]="Undo",e[e.Redo=1]="Redo",e[e.AcceptWord=2]="AcceptWord",e[e.Other=3]="Other"})($x||($x={}));function _9e(e,t,n){if(t.length===1)return[];const r=new BP(e),o=r.getTransformer(),s=o.getOffset(t[0]),a=t.slice(1).map(g=>o.getOffset(g));n=n.removeCommonPrefixAndSuffix(r);const l=o.getStringReplacement(n),d=l.replaceRange.start-s,u=l.replaceRange.join(Jn.emptyAt(s)),h=r.getValueOfOffsetRange(u);return a.map(g=>{const k=g+d,A=k+l.replaceRange.length,m=new Jn(k,A),v=m.join(Jn.emptyAt(g));if(r.getValueOfOffsetRange(v)!==h)return;const b=new fh(m,l.newText);return o.getTextReplacement(b)}).filter(Uu)}class jSo extends ct{constructor(t,n,r){super(),r&&this._register({dispose:()=>r()}),this._register(ml(t).setDecorations(ha(n.map(a=>({range:a,options:{description:"animation",className:"edits-fadeout-decoration",zIndex:1}})))));const o=new R9o(1,0,1e3,N9o),s=new U9o(o);this._register(xi(a=>{const l=s.getValue(a);t.getContainerDomNode().style.setProperty("--animation-opacity",l.toString()),o.isFinished()&&this.dispose()}))}}function WSo(e,t){const n=t.targetRange,r=e.getVisibleRanges();return r.length<1?!1:new De(r[0].startLineNumber,r[0].startColumn,r[r.length-1].endLineNumber,r[r.length-1].endColumn).containsRange(n)}var HSo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Ixt=function(e,t){return function(n,r){t(n,r,e)}},lG;class pit{constructor(t){this.name=t}select(t,n,r){if(r.length===0)return 0;const o=r[0].score[0];for(let s=0;sd&&f.type===r[u].completion.kind&&f.insertText===r[u].completion.insertText&&(d=f.touch,l=u),r[u].completion.preselect&&a===-1)return a=u}return l!==-1?l:a!==-1?a:0}toJSON(){return this._cache.toJSON()}fromJSON(t){this._cache.clear();const n=0;for(const[r,o]of t)o.touch=n,o.type=typeof o.type=="number"?o.type:SV.fromString(o.type),this._cache.set(r,o);this._seq=this._cache.size}}class zSo extends pit{constructor(){super("recentlyUsedByPrefix"),this._trie=lW.forStrings(),this._seq=0}memorize(t,n,r){const{word:o}=t.getWordUntilPosition(n),s=`${t.getLanguageId()}/${o}`;this._trie.set(s,{type:r.completion.kind,insertText:r.completion.insertText,touch:this._seq++})}select(t,n,r){const{word:o}=t.getWordUntilPosition(n);if(!o)return super.select(t,n,r);const s=`${t.getLanguageId()}/${o}`;let a=this._trie.get(s);if(a||(a=this._trie.findSubstr(s)),a)for(let l=0;lt.push([r,n])),t.sort((n,r)=>-(n[1].touch-r[1].touch)).forEach((n,r)=>n[1].touch=r),t.slice(0,200)}fromJSON(t){if(this._trie.clear(),t.length>0){this._seq=t[0][1].touch+1;for(const[n,r]of t)r.type=typeof r.type=="number"?r.type:SV.fromString(r.type),this._trie.set(n,r)}}}var mT;let VVe=(mT=class{constructor(t,n){this._storageService=t,this._configService=n,this._disposables=new Pt,this._persistSoon=new Ss(()=>this._saveState(),500),this._disposables.add(t.onWillSaveState(r=>{r.reason===J5.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(t,n,r){this._withStrategy(t,n).memorize(t,n,r),this._persistSoon.schedule()}select(t,n,r){return this._withStrategy(t,n).select(t,n,r)}_withStrategy(t,n){var o;const r=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:t.getLanguageIdAtPosition(n.lineNumber,n.column),resource:t.uri});if(((o=this._strategy)==null?void 0:o.name)!==r){this._saveState();const s=lG._strategyCtors.get(r)||Nxt;this._strategy=new s;try{const l=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,d=this._storageService.get(`${lG._storagePrefix}/${r}`,l);d&&this._strategy.fromJSON(JSON.parse(d))}catch{}}return this._strategy}_saveState(){if(this._strategy){const n=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,r=JSON.stringify(this._strategy);this._storageService.store(`${lG._storagePrefix}/${this._strategy.name}`,r,n,1)}}},lG=mT,mT._strategyCtors=new Map([["recentlyUsedByPrefix",zSo],["recentlyUsed",VSo],["first",Nxt]]),mT._storagePrefix="suggest/memories",mT);VVe=lG=HSo([Ixt(0,jf),Ixt(1,cr)],VVe);const r3e=Lr("ISuggestMemories");qr(r3e,VVe,1);var ZSo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},YSo=function(e,t){return function(n,r){t(n,r,e)}},zVe,bF;let l0e=(bF=class{constructor(t,n){this._editor=t,this._enabled=!1,this._ckAtEnd=zVe.AtEnd.bindTo(n),this._configListener=this._editor.onDidChangeConfiguration(r=>r.hasChanged(139)&&this._update()),this._update()}dispose(){var t;this._configListener.dispose(),(t=this._selectionListener)==null||t.dispose(),this._ckAtEnd.reset()}_update(){const t=this._editor.getOption(139)==="on";if(this._enabled!==t)if(this._enabled=t,this._enabled){const n=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const r=this._editor.getModel(),o=this._editor.getSelection(),s=r.getWordAtPosition(o.getStartPosition());if(!s){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(s.endColumn===o.getStartPosition().column&&o.getStartPosition().lineNumber===o.getEndPosition().lineNumber)};this._selectionListener=this._editor.onDidChangeCursorSelection(n),n()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},zVe=bF,bF.AtEnd=new Ln("atEndOfWord",!1,{type:"boolean",description:j(1494,"A context key that is true when at the end of a word. Note that this is only defined when tab-completions are enabled")}),bF);l0e=zVe=ZSo([YSo(1,Fi)],l0e);var XSo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},qSo=function(e,t){return function(n,r){t(n,r,e)}},cG,OF;let HV=(OF=class{constructor(t,n){this._editor=t,this._index=0,this._ckOtherSuggestions=cG.OtherSuggestions.bindTo(n)}dispose(){this.reset()}reset(){var t;this._ckOtherSuggestions.reset(),(t=this._listener)==null||t.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:t,index:n},r){if(t.items.length===0){this.reset();return}if(cG._moveIndex(!0,t,n)===n){this.reset();return}this._acceptNext=r,this._model=t,this._index=n,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(t,n,r){let o=r;for(let s=n.items.length;s>0&&(o=(o+n.items.length+(t?1:-1))%n.items.length,!(o===r||!n.items[o].completion.additionalTextEdits));s--);return o}next(){this._move(!0)}prev(){this._move(!1)}_move(t){if(this._model)try{this._ignore=!0,this._index=cG._moveIndex(t,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},cG=OF,OF.OtherSuggestions=new Ln("hasOtherSuggestions",!1),OF);HV=cG=XSo([qSo(1,Fi)],HV);class GSo{constructor(t,n,r,o){this._disposables=new Pt,this._disposables.add(r.onDidSuggest(s=>{s.completionModel.items.length===0&&this.reset()})),this._disposables.add(r.onDidCancel(s=>{this.reset()})),this._disposables.add(n.onDidShow(()=>this._onItem(n.getFocusedItem()))),this._disposables.add(n.onDidFocus(this._onItem,this)),this._disposables.add(n.onDidHide(this.reset,this)),this._disposables.add(t.onWillType(s=>{if(this._active&&!n.isFrozen()&&r.state!==0){const a=s.charCodeAt(s.length-1);this._active.acceptCharacters.has(a)&&t.getOption(0)&&o(this._active.item)}}))}_onItem(t){if(!t||!Qf(t.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===t.item)return;const n=new tme;for(const r of t.item.completion.commitCharacters)r.length>0&&n.add(r.charCodeAt(0));this._active={acceptCharacters:n,item:t}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}const cv=class cv{async provideSelectionRanges(t,n){const r=[];for(const o of n){const s=[];r.push(s);const a=new Map;await new Promise(l=>cv._bracketsRightYield(l,0,t,o,a)),await new Promise(l=>cv._bracketsLeftYield(l,0,t,o,a,s))}return r}static _bracketsRightYield(t,n,r,o,s){const a=new Map,l=Date.now();for(;;){if(n>=cv._maxRounds){t();break}if(!o){t();break}const d=r.bracketPairs.findNextBracket(o);if(!d){t();break}if(Date.now()-l>cv._maxDuration){setTimeout(()=>cv._bracketsRightYield(t,n+1,r,o,s));break}if(d.bracketInfo.isOpeningBracket){const h=d.bracketInfo.bracketText,f=a.has(h)?a.get(h):0;a.set(h,f+1)}else{const h=d.bracketInfo.getOpeningBrackets()[0].bracketText;let f=a.has(h)?a.get(h):0;if(f-=1,a.set(h,Math.max(0,f)),f<0){let g=s.get(h);g||(g=new Tf,s.set(h,g)),g.push(d.range)}}o=d.range.getEndPosition()}}static _bracketsLeftYield(t,n,r,o,s,a){const l=new Map,d=Date.now();for(;;){if(n>=cv._maxRounds&&s.size===0){t();break}if(!o){t();break}const u=r.bracketPairs.findPrevBracket(o);if(!u){t();break}if(Date.now()-d>cv._maxDuration){setTimeout(()=>cv._bracketsLeftYield(t,n+1,r,o,s,a));break}if(u.bracketInfo.isOpeningBracket){const f=u.bracketInfo.bracketText;let g=l.has(f)?l.get(f):0;if(g-=1,l.set(f,Math.max(0,g)),g<0){const k=s.get(f);if(k){const A=k.shift();k.size===0&&s.delete(f);const m=De.fromPositions(u.range.getEndPosition(),A.getStartPosition()),v=De.fromPositions(u.range.getStartPosition(),A.getEndPosition());a.push({range:m}),a.push({range:v}),cv._addBracketLeading(r,v,a)}}}else{const f=u.bracketInfo.getOpeningBrackets()[0].bracketText,g=l.has(f)?l.get(f):0;l.set(f,g+1)}o=u.range.getStartPosition()}}static _addBracketLeading(t,n,r){if(n.startLineNumber===n.endLineNumber)return;const o=n.startLineNumber,s=t.getLineFirstNonWhitespaceColumn(o);s!==0&&s!==n.startColumn&&(r.push({range:De.fromPositions(new tt(o,s),n.getEndPosition())}),r.push({range:De.fromPositions(new tt(o,1),n.getEndPosition())}));const a=o-1;if(a>0){const l=t.getLineFirstNonWhitespaceColumn(a);l===n.startColumn&&l!==t.getLineLastNonWhitespaceColumn(a)&&(r.push({range:De.fromPositions(new tt(a,l),n.getEndPosition())}),r.push({range:De.fromPositions(new tt(a,1),n.getEndPosition())}))}}};cv._maxDuration=30,cv._maxRounds=2;let c0e=cv;const iw=class iw{static async create(t,n){if(!n.getOption(134).localityBonus||!n.hasModel())return iw.None;const r=n.getModel(),o=n.getPosition();if(!t.canComputeWordRanges(r.uri))return iw.None;const[s]=await new c0e().provideSelectionRanges(r,[o]);if(s.length===0)return iw.None;const a=await t.computeWordRanges(r.uri,s[0].range);if(!a)return iw.None;const l=r.getWordUntilPosition(o);return delete a[l.word],new class extends iw{distance(d,u){if(!o.equals(n.getPosition()))return 0;if(u.kind===17)return 2<<20;const h=typeof u.label=="string"?u.label:u.label.label,f=a[h];if(h7n(f))return 2<<20;const g=Zge(f,De.fromPositions(d),De.compareRangesUsingStarts),k=g>=0?f[g]:f[Math.max(0,~g-1)];let A=s.length;for(const m of s){if(!De.containsRange(m.range,k))break;A-=1}return A}}}};iw.None=new class extends iw{distance(){return 0}};let d0e=iw,Uxt=class{constructor(t,n){this.leadingLineContent=t,this.characterCountDelta=n}};class zS{constructor(t,n,r,o,s,a,l=z$.default,d=void 0){this.clipboardText=d,this._snippetCompareFn=zS._compareCompletionItems,this._items=t,this._column=n,this._wordDistance=o,this._options=s,this._refilterKind=1,this._lineContext=r,this._fuzzyScoreOptions=l,a==="top"?this._snippetCompareFn=zS._compareCompletionItemsSnippetsUp:a==="bottom"&&(this._snippetCompareFn=zS._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(t){(this._lineContext.leadingLineContent!==t.leadingLineContent||this._lineContext.characterCountDelta!==t.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&r[0].container.incomplete&&t.add(n);return t}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const t=[],{leadingLineContent:n,characterCountDelta:r}=this._lineContext;let o="",s="";const a=this._refilterKind===1?this._items:this._filteredItems,l=[],d=!this._options.filterGraceful||a.length>2e3?DP:upo;for(let u=0;u=k)h.score=e4.Default;else if(typeof h.completion.filterText=="string"){const m=d(o,s,A,h.completion.filterText,h.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;TUe(h.completion.filterText,h.textLabel)===0?h.score=m:(h.score=apo(o,s,A,h.textLabel,h.labelLow,0),h.score[0]=m[0])}else{const m=d(o,s,A,h.textLabel,h.labelLow,0,this._fuzzyScoreOptions);if(!m)continue;h.score=m}}h.idx=u,h.distance=this._wordDistance.distance(h.position,h.completion),l.push(h),t.push(h.textLabel.length)}this._filteredItems=l.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:t.length?MUe(t.length-.85,t,(u,h)=>u-h):0}}static _compareCompletionItems(t,n){return t.score[0]>n.score[0]?-1:t.score[0]n.distance?1:t.idxn.idx?1:0}static _compareCompletionItemsSnippetsDown(t,n){if(t.completion.kind!==n.completion.kind){if(t.completion.kind===28)return 1;if(n.completion.kind===28)return-1}return zS._compareCompletionItems(t,n)}static _compareCompletionItemsSnippetsUp(t,n){if(t.completion.kind!==n.completion.kind){if(t.completion.kind===28)return-1;if(n.completion.kind===28)return 1}return zS._compareCompletionItems(t,n)}}var KSo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},L9=function(e,t){return function(n,r){t(n,r,e)}},ZVe;class I7{static shouldAutoTrigger(t){if(!t.hasModel())return!1;const n=t.getModel(),r=t.getPosition();n.tokenization.tokenizeIfCheap(r.lineNumber);const o=n.getWordAtPosition(r);return!(!o||o.endColumn!==r.column&&o.startColumn+1!==r.column||!isNaN(Number(o.word)))}constructor(t,n,r){this.leadingLineContent=t.getLineContent(n.lineNumber).substr(0,n.column-1),this.leadingWord=t.getWordUntilPosition(n),this.lineNumber=n.lineNumber,this.column=n.column,this.triggerOptions=r}}function JSo(e,t,n){if(!t.getContextKeyValue(Ws.inlineSuggestionVisible.key))return!0;const r=t.getContextKeyValue(Ws.suppressSuggestions.key);return r!==void 0?!r:!e.getOption(71).suppressSuggestions}function _So(e,t,n){if(!t.getContextKeyValue("inlineSuggestionVisible"))return!0;const r=t.getContextKeyValue(Ws.suppressSuggestions.key);return r!==void 0?!r:!e.getOption(71).suppressSuggestions}let u0e=ZVe=class{constructor(t,n,r,o,s,a,l,d,u){this._editor=t,this._editorWorkerService=n,this._clipboardService=r,this._telemetryService=o,this._logService=s,this._contextKeyService=a,this._configurationService=l,this._languageFeaturesService=d,this._envService=u,this._toDispose=new Pt,this._triggerCharacterListener=new Pt,this._triggerQuickSuggest=new U1,this._triggerState=void 0,this._completionDisposables=new Pt,this._onDidCancel=new it,this._onDidTrigger=new it,this._onDidSuggest=new it,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._currentSelection=this._editor.getSelection()||new Rn(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let h=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{h=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{h=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(f=>{h||this._onCursorChange(f)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!h&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){hs(this._triggerCharacterListener),hs([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(104)||!this._editor.hasModel()||!this._editor.getOption(137))return;const t=new Map;for(const r of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const o of r.triggerCharacters||[]){let s=t.get(o);s||(s=new Set,t.set(o,s)),s.add(r)}const n=r=>{var a;if(!_So(this._editor,this._contextKeyService,this._configurationService)||I7.shouldAutoTrigger(this._editor))return;if(!r){const l=this._editor.getPosition();r=this._editor.getModel().getLineContent(l.lineNumber).substr(0,l.column-1)}let o="";PT(r.charCodeAt(r.length-1))?Wd(r.charCodeAt(r.length-2))&&(o=r.substr(r.length-2)):o=r.charAt(r.length-1);const s=t.get(o);if(s){const l=new Map;if(this._completionModel)for(const[d,u]of this._completionModel.getItemsByProvider())s.has(d)||l.set(d,u);this.trigger({auto:!0,triggerKind:1,triggerCharacter:o,retrigger:!!this._completionModel,clipboardText:(a=this._completionModel)==null?void 0:a.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:l}})}};this._triggerCharacterListener.add(this._editor.onDidType(n)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>n()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(t=!1){var n;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(n=this._requestToken)==null||n.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:t}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(t){if(!this._editor.hasModel())return;const n=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!t.selection.isEmpty()||t.reason!==0&&t.reason!==3||t.source!=="keyboard"&&t.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&t.reason===0?(n.containsRange(this._currentSelection)||n.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&t.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var t;jU.isAllOff(this._editor.getOption(102))||this._editor.getOption(134).snippetsPreventQuickSuggestions&&((t=Mf.get(this._editor))!=null&&t.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!I7.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const n=this._editor.getModel(),r=this._editor.getPosition(),o=this._editor.getOption(102);if(!jU.isAllOff(o)){if(!jU.isAllOn(o)){n.tokenization.tokenizeIfCheap(r.lineNumber);const s=n.tokenization.getLineTokens(r.lineNumber),a=s.getStandardTokenType(s.findTokenIndexAtOffset(Math.max(r.column-1-1,0)));if(jU.valueFor(o,a)!=="on")return}JSo(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(n)&&this.trigger({auto:!0})}},this._editor.getOption(103)))}_refilterCompletionItems(){yo(this._editor.hasModel()),yo(this._triggerState!==void 0);const t=this._editor.getModel(),n=this._editor.getPosition(),r=new I7(t,n,{...this._triggerState,refilter:!0});this._onNewContext(r)}trigger(t){var g,k,A;if(!this._editor.hasModel())return;const n=this._editor.getModel(),r=new I7(n,this._editor.getPosition(),t);this.cancel(t.retrigger),this._triggerState=t,this._onDidTrigger.fire({auto:t.auto,shy:t.shy??!1,position:this._editor.getPosition()}),this._context=r;let o={triggerKind:t.triggerKind??0};t.triggerCharacter&&(o={triggerKind:1,triggerCharacter:t.triggerCharacter}),this._requestToken=new Ya;const s=this._editor.getOption(128);let a=1;switch(s){case"top":a=0;break;case"bottom":a=2;break}const{itemKind:l,showDeprecated:d}=ZVe.createSuggestFilter(this._editor),u=new kee(a,((g=t.completionOptions)==null?void 0:g.kindFilter)??l,(k=t.completionOptions)==null?void 0:k.providerFilter,(A=t.completionOptions)==null?void 0:A.providerItemsToReuse,d),h=d0e.create(this._editorWorkerService,this._editor),f=git(this._languageFeaturesService.completionProvider,n,this._editor.getPosition(),u,o,this._requestToken.token);Promise.all([f,h]).then(async([m,v])=>{var y;if((y=this._requestToken)==null||y.dispose(),!this._editor.hasModel()){m.disposable.dispose();return}let p=t==null?void 0:t.clipboardText;if(!p&&m.needsClipboard&&(p=await this._clipboardService.readText()),this._triggerState===void 0){m.disposable.dispose();return}const b=this._editor.getModel(),O=new I7(b,this._editor.getPosition(),t),w={...z$.default,firstMatchCanBeWeak:!this._editor.getOption(134).matchOnWordStartOnly};if(this._completionModel=new zS(m.items,this._context.column,{leadingLineContent:O.leadingLineContent,characterCountDelta:O.column-this._context.column},v,this._editor.getOption(134),this._editor.getOption(128),w,p),this._completionDisposables.add(m.disposable),this._onNewContext(O),this._reportDurationsTelemetry(m.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const C of m.items)C.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${C.provider._debugDisplayName}`,C.completion)}).catch(Yi)}_reportDurationsTelemetry(t){Math.random()>1e-4||setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(t)}),this._logService.debug("suggest.durations.json",t)})}static createSuggestFilter(t){const n=new Set;t.getOption(128)==="none"&&n.add(28);const o=t.getOption(134);return o.showMethods||n.add(0),o.showFunctions||n.add(1),o.showConstructors||n.add(2),o.showFields||n.add(3),o.showVariables||n.add(4),o.showClasses||n.add(5),o.showStructs||n.add(6),o.showInterfaces||n.add(7),o.showModules||n.add(8),o.showProperties||n.add(9),o.showEvents||n.add(10),o.showOperators||n.add(11),o.showUnits||n.add(12),o.showValues||n.add(13),o.showConstants||n.add(14),o.showEnums||n.add(15),o.showEnumMembers||n.add(16),o.showKeywords||n.add(17),o.showWords||n.add(18),o.showColors||n.add(19),o.showFiles||n.add(20),o.showReferences||n.add(21),o.showColors||n.add(22),o.showFolders||n.add(23),o.showTypeParameters||n.add(24),o.showSnippets||n.add(28),o.showUsers||n.add(25),o.showIssues||n.add(26),{itemKind:n,showDeprecated:o.showDeprecated}}_onNewContext(t){if(this._context){if(t.lineNumber!==this._context.lineNumber){this.cancel();return}if(_s(t.leadingLineContent)!==_s(this._context.leadingLineContent)){this.cancel();return}if(t.columnthis._context.leadingWord.startColumn){if(I7.shouldAutoTrigger(this._editor)&&this._context){const r=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:r}})}return}if(t.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&t.leadingWord.word.length!==0){const n=new Map,r=new Set;for(const[o,s]of this._completionModel.getItemsByProvider())s.length>0&&s[0].container.incomplete?r.add(o):n.set(o,s);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:r,providerItemsToReuse:n}})}else{const n=this._completionModel.lineContext;let r=!1;if(this._completionModel.lineContext={leadingLineContent:t.leadingLineContent,characterCountDelta:t.column-this._context.column},this._completionModel.items.length===0){const o=I7.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(o&&this._context.leadingWord.endColumn0,r&&t.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:t.triggerOptions,isFrozen:r})}}}}};u0e=ZVe=KSo([L9(1,Bm),L9(2,z1),L9(3,zA),L9(4,Oa),L9(5,Fi),L9(6,cr),L9(7,Zn),L9(8,Tnt)],u0e);const P2e=class P2e{constructor(t,n){this._disposables=new Pt,this._lastOvertyped=[],this._locked=!1,this._disposables.add(t.onWillType(()=>{if(this._locked||!t.hasModel())return;const r=t.getSelections(),o=r.length;let s=!1;for(let l=0;lP2e._maxSelectionLength)return;this._lastOvertyped[l]={value:a.getValueInRange(d),multiline:d.startLineNumber!==d.endLineNumber}}})),this._disposables.add(n.onDidTrigger(r=>{this._locked=!0})),this._disposables.add(n.onDidCancel(r=>{this._locked=!1}))}getLastOvertypedInfo(t){if(t>=0&&t=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},$9e=function(e,t){return function(n,r){t(n,r,e)}};let XVe=class{constructor(t,n,r,o,s){this._menuId=n,this._menuService=o,this._contextKeyService=s,this._menuDisposables=new Pt,this.element=tn(t,ln(".suggest-status-bar"));const a=l=>l instanceof lk?r.createInstance(mnt,l,{useComma:!1}):void 0;this._leftActions=new bm(this.element,{actionViewItemProvider:a}),this._rightActions=new bm(this.element,{actionViewItemProvider:a}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const t=this._menuService.createMenu(this._menuId,this._contextKeyService),n=()=>{const r=[],o=[];for(const[s,a]of t.getActions())s==="left"?r.push(...a):o.push(...a);this._leftActions.clear(),this._leftActions.push(r),this._rightActions.clear(),this._rightActions.push(o)};this._menuDisposables.add(t.onDidChange(()=>n())),this._menuDisposables.add(t)}hide(){this._menuDisposables.clear()}};XVe=$So([$9e(2,$n),$9e(3,y2),$9e(4,Fi)],XVe);var e5o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},jxt=function(e,t){return function(n,r){t(n,r,e)}};function bit(e){return!!e&&!!(e.completion.documentation||e.completion.detail&&e.completion.detail!==e.completion.label)}let qVe=class{constructor(t,n,r){this._editor=t,this._themeService=n,this._markdownRendererService=r,this._onDidClose=new it,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new it,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new Pt,this._renderDisposeable=new Pt,this._size=new ds(330,0),this.domNode=ln(".suggest-details"),this.domNode.classList.add("no-docs"),this._body=ln(".body"),this._scrollbar=new tre(this._body,{alwaysConsumeMouseWheel:!0}),tn(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=tn(this._body,ln(".header")),this._close=tn(this._header,ln("span"+mi.asCSSSelector(Jt.close))),this._close.title=j(1490,"Close"),this._close.role="button",this._close.tabIndex=-1,this._type=tn(this._header,ln("p.type")),this._docs=tn(this._body,ln("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(59)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const t=this._editor.getOptions(),n=t.get(59),r=n.getMassagedFontFamily(),o=t.get(135)||n.fontSize,s=t.get(136)||n.lineHeight,a=n.fontWeight,l=`${o}px`,d=`${s}px`;this.domNode.style.fontSize=l,this.domNode.style.lineHeight=`${s/o}`,this.domNode.style.fontWeight=a,this.domNode.style.fontFeatureSettings=n.fontFeatureSettings,this._type.style.fontFamily=r,this._close.style.height=d,this._close.style.width=d}getLayoutInfo(){const t=this._editor.getOption(136)||this._editor.getOption(59).lineHeight,n=AO(this._themeService.getColorTheme().type)?2:1,r=n*2;return{lineHeight:t,borderWidth:n,borderHeight:r,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=j(1491,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(t,n){var s;this._renderDisposeable.clear();let{detail:r,documentation:o}=t.completion;if(n){let a="";a+=`score: ${t.score[0]} `,a+=`prefix: ${t.word??"(no prefix)"} `,a+=`word: ${t.completion.filterText?t.completion.filterText+" (filterText)":t.textLabel} `,a+=`distance: ${t.distance} (localityBonus-setting) `,a+=`index: ${t.idx}, based on ${t.completion.sortText&&`sortText: "${t.completion.sortText}"`||"label"} `,a+=`commit_chars: ${(s=t.completion.commitCharacters)==null?void 0:s.join("")} `,o=new xA().appendCodeblock("empty",a),r=`Provider: ${t.provider._debugDisplayName}`}if(!n&&!bit(t)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),r){const a=r.length>1e5?`${r.substr(0,1e5)}…`:r;this._type.textContent=a,this._type.title=a,O1(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else kh(this._type),this._type.title="",ag(this._type),this.domNode.classList.add("no-type");if(kh(this._docs),typeof o=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=o;else if(o){this._docs.classList.add("markdown-docs"),kh(this._docs);const a=this._markdownRendererService.render(o,{context:this._editor,asyncRenderCallback:()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}});this._docs.appendChild(a.element),this._renderDisposeable.add(a)}this.domNode.classList.toggle("detail-and-doc",!!r&&!!o),this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(t,n){const r=new ds(t,n);ds.equals(r,this._size)||(this._size=r,aco(this.domNode,t,n)),this._scrollbar.scanDomNode()}scrollDown(t=8){this._body.scrollTop+=t}scrollUp(t=8){this._body.scrollTop-=t}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}focus(){this.domNode.focus()}};qVe=e5o([jxt(1,Il),jxt(2,D4)],qVe);class t5o{constructor(t,n){this.widget=t,this._editor=n,this.allowEditorOverflow=!0,this._disposables=new Pt,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new Qnt,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(t.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let r,o,s=0,a=0;this._disposables.add(this._resizable.onDidWillResize(()=>{r=this._topLeft,o=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(l=>{if(r&&o){this.widget.layout(l.dimension.width,l.dimension.height);let d=!1;l.west&&(a=o.width-l.dimension.width,d=!0),l.north&&(s=o.height-l.dimension.height,d=!0),d&&this._applyTopLeft({top:r.top+s,left:r.left+a})}l.done&&(r=void 0,o=void 0,s=0,a=0,this._userSize=l.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(t=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),t&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(t,n){const r=t.getBoundingClientRect();this._anchorBox=r,this._preferAlignAtTop=n,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,n)}_placeAtAnchor(t,n,r){const o=MT(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new ds(220,2*s.lineHeight),l=t.top,d=function(){const y=o.width-(t.left+t.width+s.borderWidth+s.horizontalPadding),C=-s.borderWidth+t.left+t.width,x=new ds(y,o.height-t.top-s.borderHeight-s.verticalPadding),L=x.with(void 0,t.top+t.height-s.borderHeight-s.verticalPadding);return{top:l,left:C,fit:y-n.width,maxSizeTop:x,maxSizeBottom:L,minSize:a.with(Math.min(y,a.width))}}(),u=function(){const y=t.left-s.borderWidth-s.horizontalPadding,C=Math.max(s.horizontalPadding,t.left-n.width-s.borderWidth),x=new ds(y,o.height-t.top-s.borderHeight-s.verticalPadding),L=x.with(void 0,t.top+t.height-s.borderHeight-s.verticalPadding);return{top:l,left:C,fit:y-n.width,maxSizeTop:x,maxSizeBottom:L,minSize:a.with(Math.min(y,a.width))}}(),h=function(){const y=t.left,C=-s.borderWidth+t.top+t.height,x=new ds(t.width-s.borderHeight,o.height-t.top-t.height-s.verticalPadding);return{top:C,left:y,fit:x.height-n.height,maxSizeBottom:x,maxSizeTop:x,minSize:a.with(x.width)}}(),f=[d,u,h],g=f.find(y=>y.fit>=0)??f.sort((y,C)=>C.fit-y.fit)[0],k=t.top+t.height-s.borderHeight;let A,m=n.height;const v=Math.max(g.maxSizeTop.height,g.maxSizeBottom.height);m>v&&(m=v);let p;r?m<=g.maxSizeTop.height?(A=!0,p=g.maxSizeTop):(A=!1,p=g.maxSizeBottom):m<=g.maxSizeBottom.height?(A=!1,p=g.maxSizeBottom):(A=!0,p=g.maxSizeTop);let{top:b,left:O}=g;!A&&m>t.height&&(b=k-m);const w=this._editor.getDomNode();if(w){const y=w.getBoundingClientRect();b-=y.top,O-=y.left}this._applyTopLeft({left:O,top:b}),this._resizable.enableSashes(!A,g===d,A,g!==d),this._resizable.minSize=g.minSize,this._resizable.maxSize=p,this._resizable.layout(m,Math.min(p.width,n.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(t){this._topLeft=t,this._editor.layoutOverlayWidget(this)}}const Wxt=Lr("fileService");var iy;(function(e){e[e.FILE=0]="FILE",e[e.FOLDER=1]="FOLDER",e[e.ROOT_FOLDER=2]="ROOT_FOLDER"})(iy||(iy={}));const n5o=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function xce(e,t,n,r,o){if(mi.isThemeIcon(o))return[`codicon-${o.id}`,"predefined-file-icon"];if(pi.isUri(o))return[];const s=r===iy.ROOT_FOLDER?["rootfolder-icon"]:r===iy.FOLDER?["folder-icon"]:["file-icon"];if(n){let a;if(n.scheme===Li.data)a=NT.parseMetaData(n).get(NT.META_DATA_LABEL);else{const l=n.path.match(n5o);l?(a=Lce(l[2].toLowerCase()),l[1]&&s.push(`${Lce(l[1].toLowerCase())}-name-dir-icon`)):a=Lce(n.authority.toLowerCase())}if(r===iy.ROOT_FOLDER)s.push(`${a}-root-name-folder-icon`);else if(r===iy.FOLDER)s.push(`${a}-name-folder-icon`);else{if(a){if(s.push(`${a}-name-file-icon`),s.push("name-file-icon"),a.length<=255){const d=a.split(".");for(let u=1;u=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},eSe=function(e,t){return function(n,r){t(n,r,e)}};const o5o=Ra("suggest-more-info",Jt.chevronRight,j(1492,"Icon for more information in the suggest widget."));var Yb;const s5o=new(Yb=class{extract(t,n){if(t.textLabel.match(Yb._regexStrict))return n[0]=t.textLabel,!0;if(t.completion.detail&&t.completion.detail.match(Yb._regexStrict))return n[0]=t.completion.detail,!0;if(t.completion.documentation){const r=typeof t.completion.documentation=="string"?t.completion.documentation:t.completion.documentation.value,o=Yb._regexRelaxed.exec(r);if(o&&(o.index===0||o.index+o[0].length===r.length))return n[0]=o[0],!0}return!1}},Yb._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,Yb._regexStrict=new RegExp(`^${Yb._regexRelaxed.source}$`,"i"),Yb);let GVe=class{constructor(t,n,r,o){this._editor=t,this._modelService=n,this._languageService=r,this._themeService=o,this._onDidToggleDetails=new it,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(t){const n=new Pt,r=t;r.classList.add("show-file-icons");const o=tn(t,ln(".icon")),s=tn(o,ln("span.colorspan")),a=tn(t,ln(".contents")),l=tn(a,ln(".main")),d=tn(l,ln(".icon-label.codicon")),u=tn(l,ln("span.left")),h=tn(l,ln("span.right")),f=new hee(u,{supportHighlights:!0,supportIcons:!0});n.add(f);const g=tn(u,ln("span.signature-label")),k=tn(u,ln("span.qualifier-label")),A=tn(h,ln("span.details-label")),m=tn(h,ln("span.readMore"+mi.asCSSSelector(o5o)));return m.title=j(1493,"Read More"),{root:r,left:u,right:h,icon:o,colorspan:s,iconLabel:f,iconContainer:d,parametersLabel:g,qualifierLabel:k,detailsLabel:A,readMore:m,disposables:n,configureFont:()=>{const p=this._editor.getOptions(),b=p.get(59),O=b.getMassagedFontFamily(),w=b.fontFeatureSettings,y=b.fontVariationSettings,C=p.get(135)||b.fontSize,x=p.get(136)||b.lineHeight,L=b.fontWeight,S=b.letterSpacing,E=`${C}px`,Q=`${x}px`,T=`${S}px`;r.style.fontSize=E,r.style.fontWeight=L,r.style.letterSpacing=T,l.style.fontFamily=O,l.style.fontFeatureSettings=w,l.style.fontVariationSettings=y,l.style.lineHeight=Q,o.style.height=Q,o.style.width=Q,m.style.height=Q,m.style.width=Q}}}renderElement(t,n,r){r.configureFont();const{completion:o}=t;r.colorspan.style.backgroundColor="";const s={labelEscapeNewLines:!0,matches:ore(t.score)},a=[];if(o.kind===19&&s5o.extract(t,a))r.icon.className="icon customcolor",r.iconContainer.className="icon hide",r.colorspan.style.backgroundColor=a[0];else if(o.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){r.icon.className="icon hide",r.iconContainer.className="icon hide";const l=xce(this._modelService,this._languageService,pi.from({scheme:"fake",path:t.textLabel}),iy.FILE),d=xce(this._modelService,this._languageService,pi.from({scheme:"fake",path:o.detail}),iy.FILE);s.extraClasses=l.length>d.length?l:d}else o.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(r.icon.className="icon hide",r.iconContainer.className="icon hide",s.extraClasses=[xce(this._modelService,this._languageService,pi.from({scheme:"fake",path:t.textLabel}),iy.FOLDER),xce(this._modelService,this._languageService,pi.from({scheme:"fake",path:o.detail}),iy.FOLDER)].flat()):(r.icon.className="icon hide",r.iconContainer.className="",r.iconContainer.classList.add("suggest-icon",...mi.asClassNameArray(SV.toIcon(o.kind))));o.tags&&o.tags.indexOf(1)>=0&&(s.extraClasses=(s.extraClasses||[]).concat(["deprecated"]),s.matches=[]),r.iconLabel.setLabel(t.textLabel,void 0,s),typeof o.label=="string"?(r.parametersLabel.textContent="",r.detailsLabel.textContent=tSe(o.detail||""),r.root.classList.add("string-label")):(r.parametersLabel.textContent=tSe(o.label.detail||""),r.detailsLabel.textContent=tSe(o.label.description||""),r.root.classList.remove("string-label")),this._editor.getOption(134).showInlineDetails?O1(r.detailsLabel):ag(r.detailsLabel),bit(t)?(r.right.classList.add("can-expand-details"),O1(r.readMore),r.readMore.onmousedown=l=>{l.stopPropagation(),l.preventDefault()},r.readMore.onclick=l=>{l.stopPropagation(),l.preventDefault(),this._onDidToggleDetails.fire()}):(r.right.classList.remove("can-expand-details"),ag(r.readMore),r.readMore.onmousedown=null,r.readMore.onclick=null)}disposeTemplate(t){t.disposables.dispose()}};GVe=r5o([eSe(1,pl),eSe(2,lc),eSe(3,Il)],GVe);function tSe(e){return e.replace(/\r\n|\r|\n/g,"")}var a5o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Sce=function(e,t){return function(n,r){t(n,r,e)}},KN;He("editorSuggestWidget.background",_0,j(1473,"Background color of the suggest widget."));He("editorSuggestWidget.border",ntt,j(1474,"Border color of the suggest widget."));const l5o=He("editorSuggestWidget.foreground",lC,j(1475,"Foreground color of the suggest widget."));He("editorSuggestWidget.selectedForeground",C$,j(1476,"Foreground color of the selected entry in the suggest widget."));He("editorSuggestWidget.selectedIconForeground",Att,j(1477,"Icon foreground color of the selected entry in the suggest widget."));const c5o=He("editorSuggestWidget.selectedBackground",x$,j(1478,"Background color of the selected entry in the suggest widget."));He("editorSuggestWidget.highlightForeground",DU,j(1479,"Color of the match highlights in the suggest widget."));He("editorSuggestWidget.focusHighlightForeground",vfo,j(1480,"Color of the match highlights in the suggest widget when an item is focused."));He("editorSuggestWidgetStatus.foreground",Ji(l5o,.5),j(1481,"Foreground color of the suggest widget status."));class d5o{constructor(t,n){this._service=t,this._key=`suggestWidget.size/${n.getEditorType()}/${n instanceof r6}`}restore(){const t=this._service.get(this._key,0)??"";try{const n=JSON.parse(t);if(ds.is(n))return ds.lift(n)}catch{}}store(t){this._service.store(this._key,JSON.stringify(t),0,1)}reset(){this._service.remove(this._key,0)}}var kT;let KVe=(kT=class{constructor(t,n,r,o,s){this.editor=t,this._storageService=n,this._state=0,this._isAuto=!1,this._pendingLayout=new is,this._pendingShowDetails=new is,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new U1,this._disposables=new Pt,this._onDidSelect=new vP,this._onDidFocus=new vP,this._onDidHide=new it,this._onDidShow=new it,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new it,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new Qnt,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new u5o(this,t),this._persistedSize=new d5o(n,t);class a{constructor(k,A,m=!1,v=!1){this.persistedSize=k,this.currentSize=A,this.persistHeight=m,this.persistWidth=v}}let l;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),l=new a(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(g=>{var k,A;if(this._resize(g.dimension.width,g.dimension.height),l&&(l.persistHeight=l.persistHeight||!!g.north||!!g.south,l.persistWidth=l.persistWidth||!!g.east||!!g.west),!!g.done){if(l){const{itemHeight:m,defaultSize:v}=this.getLayoutInfo(),p=Math.round(m/2);let{width:b,height:O}=this.element.size;(!l.persistHeight||Math.abs(l.currentSize.height-O)<=p)&&(O=((k=l.persistedSize)==null?void 0:k.height)??v.height),(!l.persistWidth||Math.abs(l.currentSize.width-b)<=p)&&(b=((A=l.persistedSize)==null?void 0:A.width)??v.width),this._persistedSize.store(new ds(b,O))}this._contentWidget.unlockPreference(),l=void 0}})),this._messageElement=tn(this.element.domNode,ln(".message")),this._listElement=tn(this.element.domNode,ln(".tree"));const d=this._disposables.add(s.createInstance(qVe,this.editor));d.onDidClose(()=>this.toggleDetails(),this,this._disposables),this._details=new t5o(d,this.editor);const u=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(134).showIcons);u();const h=s.createInstance(GVe,this.editor);this._disposables.add(h),this._disposables.add(h.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Tk("SuggestWidget",this._listElement,{getHeight:g=>this.getLayoutInfo().itemHeight,getTemplateId:g=>"suggestion"},[h],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>wh?"listitem":"option",getWidgetAriaLabel:()=>j(1484,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:g=>{let k=g.textLabel;const A=SV.toLabel(g.completion.kind);if(typeof g.completion.label!="string"){const{detail:b,description:O}=g.completion.label;b&&O?k=j(1485,"{0} {1}, {2}, {3}",k,b,O,A):b?k=j(1486,"{0} {1}, {2}",k,b,A):O&&(k=j(1487,"{0}, {1}, {2}",k,O,A))}else k=j(1488,"{0}, {1}",k,A);if(!g.isResolved||!this._isDetailsVisible())return k;const{documentation:m,detail:v}=g.completion,p=pP("{0}{1}",v||"",m?typeof m=="string"?m:m.value:"");return j(1489,"{0}, docs: {1}",k,p)}}}),this._list.style(zM({listInactiveFocusBackground:c5o,listInactiveFocusOutline:qa})),this._status=s.createInstance(XVe,this.element.domNode,eT);const f=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(134).showStatusBar);f(),this._disposables.add(this._list.onMouseDown(g=>this._onListMouseDownOrTap(g))),this._disposables.add(this._list.onTap(g=>this._onListMouseDownOrTap(g))),this._disposables.add(this._list.onDidChangeSelection(g=>this._onListSelection(g))),this._disposables.add(this._list.onDidChangeFocus(g=>this._onListFocus(g))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(g=>{g.hasChanged(134)&&(f(),u()),this._completionModel&&(g.hasChanged(59)||g.hasChanged(135)||g.hasChanged(136))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=Tr.Visible.bindTo(r),this._ctxSuggestWidgetDetailsVisible=Tr.DetailsVisible.bindTo(r),this._ctxSuggestWidgetMultipleSuggestions=Tr.MultipleSuggestions.bindTo(r),this._ctxSuggestWidgetHasFocusedSuggestion=Tr.HasFocusedSuggestion.bindTo(r),this._disposables.add(Sc(this._details.widget.domNode,"keydown",g=>{this._onDetailsKeydown.fire(g)})),this._disposables.add(this.editor.onMouseDown(g=>this._onEditorMouseDown(g)))}dispose(){var t;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(t=this._loadingTimeout)==null||t.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(t){this._details.widget.domNode.contains(t.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(t.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(t){typeof t.element>"u"||typeof t.index>"u"||(t.browserEvent.preventDefault(),t.browserEvent.stopPropagation(),this._select(t.element,t.index))}_onListSelection(t){t.elements.length&&this._select(t.elements[0],t.indexes[0])}_select(t,n){const r=this._completionModel;r&&(this._onDidSelect.fire({item:t,index:n,model:r}),this.editor.focus())}_onListFocus(t){var o;if(this._ignoreFocusEvents)return;if(this._state===5&&this._setState(3),!t.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const n=t.elements[0],r=t.indexes[0];n!==this._focusedItem&&((o=this._currentSuggestionDetails)==null||o.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=n,this._list.reveal(r),this._currentSuggestionDetails=zd(async s=>{const a=z8(()=>{this._isDetailsVisible()&&this._showDetails(!0,!1)},250),l=s.onCancellationRequested(()=>a.dispose());try{return await n.resolve(s)}finally{a.dispose(),l.dispose()}}),this._currentSuggestionDetails.then(()=>{r>=this._list.length||n!==this._list.element(r)||(this._ignoreFocusEvents=!0,this._list.splice(r,1,[n]),this._list.setFocus([r]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this._showDetails(!1,!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:this._list.getElementID(r)}))}).catch(Yi)),this._onDidFocus.fire({item:n,index:r,model:this._completionModel})}_setState(t){if(this._state!==t)switch(this._state=t,this.element.domNode.classList.toggle("frozen",t===4),this.element.domNode.classList.remove("message"),t){case 0:ag(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=KN.LOADING_MESSAGE,ag(this._listElement,this._status.element),O1(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,yO(KN.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=KN.NO_SUGGESTIONS_MESSAGE,ag(this._listElement,this._status.element),O1(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,yO(KN.NO_SUGGESTIONS_MESSAGE);break;case 3:ag(this._messageElement),O1(this._listElement,this._status.element),this._show();break;case 4:ag(this._messageElement),O1(this._listElement,this._status.element),this._show();break;case 5:ag(this._messageElement),O1(this._listElement,this._status.element),this._details.show(),this._show(),this._details.widget.focus();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(t,n){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!t,this._isAuto||(this._loadingTimeout=z8(()=>this._setState(1),n)))}showSuggestions(t,n,r,o,s){var d,u;if(this._contentWidget.setPosition(this.editor.getPosition()),(d=this._loadingTimeout)==null||d.dispose(),(u=this._currentSuggestionDetails)==null||u.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==t&&(this._completionModel=t),r&&this._state!==2&&this._state!==0){this._setState(4);return}const a=this._completionModel.items.length,l=a===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(a>1),l){this._setState(o?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(r?4:3),this._list.reveal(n,0,n===0?0:this.getLayoutInfo().itemHeight*.33),this._list.setFocus(s?[]:[n])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=Gge(oi(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._list.setFocus(this._list.getFocus()),this._setState(3)):this._state===3&&(this._setState(5),this._isDetailsVisible()?this._details.widget.focus():this.toggleDetails(!0))}toggleDetails(t=!1){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(bit(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this._showDetails(!1,t))}_showDetails(t,n){this._pendingShowDetails.value=Gge(oi(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show();let r=!1;t?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details"),n&&(this._details.widget.focus(),r=!0)),r||this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this._showDetails(!1,!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var r;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(r=this._loadingTimeout)==null||r.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),n=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.heightd&&(s=d);const u=this._completionModel?this._completionModel.stats.pLabelLen*r.typicalHalfwidthCharacterWidth:s,h=r.statusBarHeight+this._list.contentHeight+r.borderHeight,f=r.itemHeight+r.statusBarHeight,g=ic(this.editor.getDomNode()),k=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),A=g.top+k.top+k.height,m=Math.min(n.height-A-r.verticalPadding,h),v=g.top+k.top-r.verticalPadding,p=Math.min(v,h);let b=Math.min(Math.max(p,m)+r.borderHeight,h);o===((a=this._cappedHeight)==null?void 0:a.capped)&&(o=this._cappedHeight.wanted),ob&&(o=b),o>m&&p>m||this._forceRenderingAbove&&v>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),b=p):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),b=m),this.element.preferredSize=new ds(u,r.defaultSize.height),this.element.maxSize=new ds(d,b),this.element.minSize=new ds(220,f),this._cappedHeight=o===h?{wanted:((l=this._cappedHeight)==null?void 0:l.wanted)??t.height,capped:o}:void 0}this._resize(s,o)}_resize(t,n){const{width:r,height:o}=this.element.maxSize;t=Math.min(r,t),n=Math.min(o,n);const{statusBarHeight:s}=this.getLayoutInfo();this._list.layout(n-s,t),this._listElement.style.height=`${n-s}px`,this.element.layout(n,t),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var t;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((t=this._contentWidget.getPosition())==null?void 0:t.preference[0])===2)}getLayoutInfo(){const t=this.editor.getOption(59),n=ng(this.editor.getOption(136)||t.lineHeight,8,1e3),r=!this.editor.getOption(134).showStatusBar||this._state===2||this._state===1?0:n,o=this._details.widget.getLayoutInfo().borderWidth,s=2*o;return{itemHeight:n,statusBarHeight:r,borderWidth:o,borderHeight:s,typicalHalfwidthCharacterWidth:t.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new ds(430,r+12*n)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(t){this._storageService.store("expandSuggestionDocs",t,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},KN=kT,kT.LOADING_MESSAGE=j(1482,"Loading..."),kT.NO_SUGGESTIONS_MESSAGE=j(1483,"No suggestions."),kT);KVe=KN=a5o([Sce(1,jf),Sce(2,Fi),Sce(3,Il),Sce(4,$n)],KVe);class u5o{constructor(t,n){this._widget=t,this._editor=n,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:t,width:n}=this._widget.element.size,{borderWidth:r,horizontalPadding:o}=this._widget.getLayoutInfo();return new ds(n+2*r+o,t+2*r)}afterRender(t){this._widget._afterRender(t)}setPreference(t){this._preferenceLocked||(this._preference=t)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(t){this._position=t}}var h5o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},JI=function(e,t){return function(n,r){t(n,r,e)}},JVe;class A5o{constructor(t,n){if(this._model=t,this._position=n,this._decorationOptions=Ki.register({description:"suggest-line-suffix",stickiness:1}),t.getLineMaxColumn(n.lineNumber)!==n.column){const o=t.getOffsetAt(n),s=t.getPositionAt(o+1);t.changeDecorations(a=>{this._marker&&a.removeDecoration(this._marker),this._marker=a.addDecoration(De.fromPositions(n,s),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(t=>{t.removeDecoration(this._marker),this._marker=void 0})}delta(t){if(this._model.isDisposed()||this._position.lineNumber!==t.lineNumber)return 0;if(this._marker){const n=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(n.getStartPosition())-this._model.getOffsetAt(t)}else return this._model.getLineMaxColumn(t.lineNumber)-t.column}}var wF;let iO=(wF=class{static get(t){return t.getContribution(JVe.ID)}get onWillInsertSuggestItem(){return this._onWillInsertSuggestItem.event}constructor(t,n,r,o,s,a,l){this._memoryService=n,this._commandService=r,this._contextKeyService=o,this._instantiationService=s,this._logService=a,this._telemetryService=l,this._lineSuffix=new is,this._toDispose=new Pt,this._selectors=new f5o(f=>f.priority),this._onWillInsertSuggestItem=new it,this._wantsForceRenderingAbove=!1,this.editor=t,this.model=s.createInstance(u0e,this.editor),this._selectors.register({priority:0,select:(f,g,k)=>this._memoryService.select(f,g,k)});const d=Tr.InsertMode.bindTo(o);d.set(t.getOption(134).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>d.set(t.getOption(134).insertMode))),this.widget=this._toDispose.add(new O6e(oi(t.getDomNode()),()=>{const f=this._instantiationService.createInstance(KVe,this.editor);this._toDispose.add(f),this._toDispose.add(f.onDidSelect(v=>this._insertSuggestion(v,0),this));const g=new GSo(this.editor,f,this.model,v=>this._insertSuggestion(v,2));this._toDispose.add(g);const k=Tr.MakesTextEdit.bindTo(this._contextKeyService),A=Tr.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=Tr.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Gn(()=>{k.reset(),A.reset(),m.reset()})),this._toDispose.add(f.onDidFocus(({item:v})=>{const p=this.editor.getPosition(),b=v.editStart.column,O=p.column;let w=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&4)&&O-b===v.completion.insertText.length&&(w=this.editor.getModel().getValueInRange({startLineNumber:p.lineNumber,startColumn:b,endLineNumber:p.lineNumber,endColumn:O})!==v.completion.insertText),k.set(w),A.set(!tt.equals(v.editInsertEnd,v.editReplaceEnd)),m.set(!!v.provider.resolveCompletionItem||!!v.completion.documentation||v.completion.detail!==v.completion.label)})),this._toDispose.add(f.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new V8(!0,!1,!1,!1,33))||Pr&&v.toKeyCodeChord().equals(new V8(!1,!1,!1,!0,33))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),this._wantsForceRenderingAbove&&f.forceRenderingAbove(),f})),this._overtypingCapturer=this._toDispose.add(new O6e(oi(t.getDomNode()),()=>this._toDispose.add(new YVe(this.editor,this.model)))),this._alternatives=this._toDispose.add(new O6e(oi(t.getDomNode()),()=>this._toDispose.add(new HV(this.editor,this._contextKeyService)))),this._toDispose.add(s.createInstance(l0e,t)),this._toDispose.add(this.model.onDidTrigger(f=>{this.widget.value.showTriggered(f.auto,f.shy?250:50),this._lineSuffix.value=new A5o(this.editor.getModel(),f.position)})),this._toDispose.add(this.model.onDidSuggest(f=>{if(f.triggerOptions.shy)return;let g=-1;for(const A of this._selectors.itemsOrderedByPriorityDesc)if(g=A.select(this.editor.getModel(),this.editor.getPosition(),f.completionModel.items),g!==-1)break;if(g===-1&&(g=0),this.model.state===0)return;let k=!1;if(f.triggerOptions.auto){const A=this.editor.getOption(134);A.selectionMode==="never"||A.selectionMode==="always"?k=A.selectionMode==="never":A.selectionMode==="whenTriggerCharacter"?k=f.triggerOptions.triggerKind!==1:A.selectionMode==="whenQuickSuggestion"&&(k=f.triggerOptions.triggerKind===1&&!f.triggerOptions.refilter)}this.widget.value.showSuggestions(f.completionModel,g,f.isFrozen,f.triggerOptions.auto,k)})),this._toDispose.add(this.model.onDidCancel(f=>{f.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const u=Tr.AcceptSuggestionsOnEnter.bindTo(o),h=()=>{const f=this.editor.getOption(1);u.set(f==="on"||f==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>h())),h()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(t,n){var A;if(!t||!t.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const r=Mf.get(this.editor);if(!r)return;this._onWillInsertSuggestItem.fire({item:t.item});const o=this.editor.getModel(),s=o.getAlternativeVersionId(),{item:a}=t,l=[],d=new Ya;n&1||this.editor.pushUndoStop();const u=this.getOverwriteInfo(a,!!(n&8));this._memoryService.memorize(o,this.editor.getPosition(),a);const h=a.isResolved;let f=-1,g=-1;if(Array.isArray(a.completion.additionalTextEdits)){this.model.cancel();const m=SO.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",a.completion.additionalTextEdits.map(v=>{let p=De.lift(v.range);if(p.startLineNumber===a.position.lineNumber&&p.startColumn>a.position.column){const b=this.editor.getPosition().column-a.position.column,O=b,w=De.spansMultipleLines(p)?0:b;p=new De(p.startLineNumber,p.startColumn+O,p.endLineNumber,p.endColumn+w)}return Jl.replaceMove(p,v.text)})),m.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!h){const m=new wu;let v;const p=o.onDidChangeContent(y=>{if(y.isFlush){d.cancel(),p.dispose();return}for(const C of y.changes){const x=De.getEndPosition(C.range);(!v||tt.isBefore(x,v))&&(v=x)}}),b=n;n|=2;let O=!1;const w=this.editor.onWillType(()=>{w.dispose(),O=!0,b&2||this.editor.pushUndoStop()});l.push(a.resolve(d.token).then(()=>{if(!a.completion.additionalTextEdits||d.token.isCancellationRequested)return;if(v&&a.completion.additionalTextEdits.some(C=>tt.isBefore(v,De.getStartPosition(C.range))))return!1;O&&this.editor.pushUndoStop();const y=SO.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",a.completion.additionalTextEdits.map(C=>Jl.replaceMove(De.lift(C.range),C.text))),y.restoreRelativeVerticalPositionOfCursor(this.editor),(O||!(b&2))&&this.editor.pushUndoStop(),!0}).then(y=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",m.elapsed(),y),g=y===!0?1:y===!1?0:-2}).finally(()=>{p.dispose(),w.dispose()}))}let{insertText:k}=a.completion;if(a.completion.insertTextRules&4||(k=MP.escape(k)),this.model.cancel(),r.insert(k,{overwriteBefore:u.overwriteBefore,overwriteAfter:u.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(a.completion.insertTextRules&1),clipboardText:t.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value,reason:yA.suggest({providerId:yOe.fromExtensionId((A=a.extensionId)==null?void 0:A.value)})}),n&2||this.editor.pushUndoStop(),a.completion.command)if(a.completion.command.id===h0e.id)this.model.trigger({auto:!0,retrigger:!0});else{const m=new wu;l.push(this._commandService.executeCommand(a.completion.command.id,...a.completion.command.arguments?[...a.completion.command.arguments]:[]).catch(v=>{a.completion.extensionId?Xc(v):Yi(v)}).finally(()=>{f=m.elapsed()}))}n&4&&this._alternatives.value.set(t,m=>{for(d.cancel();o.canUndo();){s!==o.getAlternativeVersionId()&&o.undo(),this._insertSuggestion(m,3|(n&8?8:0));break}}),this._alertCompletionItem(a),Promise.all(l).finally(()=>{this._reportSuggestionAcceptedTelemetry(a,o,h,f,g,t.index,t.model.items),this.model.clear(),d.dispose()})}_reportSuggestionAcceptedTelemetry(t,n,r,o,s,a,l){var g;if(Math.random()>1e-4)return;const d=new Map;for(let k=0;k1?u[0]:-1;this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:((g=t.extensionId)==null?void 0:g.value)??"unknown",providerId:t.provider._debugDisplayName??"unknown",kind:t.completion.kind,basenameHash:Yie(g2(n.uri)).toString(16),languageId:n.getLanguageId(),fileExtension:tdo(n.uri),resolveInfo:t.provider.resolveCompletionItem?r?1:0:-1,resolveDuration:t.resolveDuration,commandDuration:o,additionalEditsAsync:s,index:a,firstIndex:f})}getOverwriteInfo(t,n){yo(this.editor.hasModel());let r=this.editor.getOption(134).insertMode==="replace";n&&(r=!r);const o=t.position.column-t.editStart.column,s=(r?t.editReplaceEnd.column:t.editInsertEnd.column)-t.position.column,a=this.editor.getPosition().column-t.position.column,l=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:o+a,overwriteAfter:s+l}}_alertCompletionItem(t){if(Qf(t.completion.additionalTextEdits)){const n=j(1463,"Accepting '{0}' made {1} additional edits",t.textLabel,t.completion.additionalTextEdits.length);kg(n)}}triggerSuggest(t,n,r){this.editor.hasModel()&&(this.model.trigger({auto:n??!1,completionOptions:{providerFilter:t,kindFilter:r?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(t){if(!this.editor.hasModel())return;const n=this.editor.getPosition(),r=()=>{n.equals(this.editor.getPosition())&&this._commandService.executeCommand(t.fallback)},o=s=>{if(s.completion.insertTextRules&4||s.completion.additionalTextEdits)return!0;const a=this.editor.getPosition(),l=s.editStart.column,d=a.column;return d-l!==s.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:a.lineNumber,startColumn:l,endLineNumber:a.lineNumber,endColumn:d})!==s.completion.insertText};un.once(this.model.onDidTrigger)(s=>{const a=[];un.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{hs(a),r()},void 0,a),this.model.onDidSuggest(({completionModel:l})=>{if(hs(a),l.items.length===0){r();return}const d=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),l.items),u=l.items[d];if(!o(u)){r();return}this.editor.pushUndoStop(),this._insertSuggestion({index:d,item:u,model:l},7)},void 0,a)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(n,0),this.editor.focus()}acceptSelectedSuggestion(t,n){const r=this.widget.value.getFocusedItem();let o=0;t&&(o|=4),n&&(o|=8),this._insertSuggestion(r,o)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.isInitialized?this.widget.value.forceRenderingAbove():this._wantsForceRenderingAbove=!0}stopForceRenderingAbove(){this.widget.isInitialized?this.widget.value.stopForceRenderingAbove():this._wantsForceRenderingAbove=!1}registerSelector(t){return this._selectors.register(t)}},JVe=wF,wF.ID="editor.contrib.suggestController",wF);iO=JVe=h5o([JI(1,r3e),JI(2,Ca),JI(3,Fi),JI(4,$n),JI(5,Oa),JI(6,zA)],iO);class f5o{constructor(t){this.prioritySelector=t,this._items=new Array}register(t){if(this._items.indexOf(t)!==-1)throw new Error("Value is already registered");return this._items.push(t),this._items.sort((n,r)=>this.prioritySelector(r)-this.prioritySelector(n)),{dispose:()=>{const n=this._items.indexOf(t);n>=0&&this._items.splice(n,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}const M2e=class M2e extends Nn{constructor(){super({id:M2e.id,label:Et(1471,"Trigger Suggest"),precondition:zt.and(Ze.writable,Ze.hasCompletionItemProvider,Tr.Visible.toNegated()),kbOpts:{kbExpr:Ze.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(t,n,r){const o=iO.get(n);if(!o)return;let s;r&&typeof r=="object"&&r.auto===!0&&(s=!0),o.triggerSuggest(void 0,s,void 0)}};M2e.id="editor.action.triggerSuggest";let h0e=M2e;mo(iO.ID,iO,2);gn(h0e);const bk=190,Sg=$d.bindToContribution(iO.get);xn(new Sg({id:"acceptSelectedSuggestion",precondition:zt.and(Tr.Visible,Tr.HasFocusedSuggestion),handler(e){e.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:zt.and(Tr.Visible,Ze.textInputFocus),weight:bk},{primary:3,kbExpr:zt.and(Tr.Visible,Ze.textInputFocus,Tr.AcceptSuggestionsOnEnter,Tr.MakesTextEdit),weight:bk}],menuOpts:[{menuId:eT,title:j(1464,"Insert"),group:"left",order:1,when:Tr.HasInsertAndReplaceRange.toNegated()},{menuId:eT,title:j(1465,"Insert"),group:"left",order:1,when:zt.and(Tr.HasInsertAndReplaceRange,Tr.InsertMode.isEqualTo("insert"))},{menuId:eT,title:j(1466,"Replace"),group:"left",order:1,when:zt.and(Tr.HasInsertAndReplaceRange,Tr.InsertMode.isEqualTo("replace"))}]}));xn(new Sg({id:"acceptAlternativeSelectedSuggestion",precondition:zt.and(Tr.Visible,Ze.textInputFocus,Tr.HasFocusedSuggestion),kbOpts:{weight:bk,kbExpr:Ze.textInputFocus,primary:1027,secondary:[1026]},handler(e){e.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:eT,group:"left",order:2,when:zt.and(Tr.HasInsertAndReplaceRange,Tr.InsertMode.isEqualTo("insert")),title:j(1467,"Replace")},{menuId:eT,group:"left",order:2,when:zt.and(Tr.HasInsertAndReplaceRange,Tr.InsertMode.isEqualTo("replace")),title:j(1468,"Insert")}]}));ho.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");xn(new Sg({id:"hideSuggestWidget",precondition:Tr.Visible,handler:e=>e.cancelSuggestWidget(),kbOpts:{weight:bk,kbExpr:Ze.textInputFocus,primary:9,secondary:[1033]}}));xn(new Sg({id:"selectNextSuggestion",precondition:zt.and(Tr.Visible,zt.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:e=>e.selectNextSuggestion(),kbOpts:{weight:bk,kbExpr:Ze.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));xn(new Sg({id:"selectNextPageSuggestion",precondition:zt.and(Tr.Visible,zt.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:e=>e.selectNextPageSuggestion(),kbOpts:{weight:bk,kbExpr:Ze.textInputFocus,primary:12,secondary:[2060]}}));xn(new Sg({id:"selectLastSuggestion",precondition:zt.and(Tr.Visible,zt.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:e=>e.selectLastSuggestion()}));xn(new Sg({id:"selectPrevSuggestion",precondition:zt.and(Tr.Visible,zt.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevSuggestion(),kbOpts:{weight:bk,kbExpr:Ze.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));xn(new Sg({id:"selectPrevPageSuggestion",precondition:zt.and(Tr.Visible,zt.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevPageSuggestion(),kbOpts:{weight:bk,kbExpr:Ze.textInputFocus,primary:11,secondary:[2059]}}));xn(new Sg({id:"selectFirstSuggestion",precondition:zt.and(Tr.Visible,zt.or(Tr.MultipleSuggestions,Tr.HasFocusedSuggestion.negate())),handler:e=>e.selectFirstSuggestion()}));xn(new Sg({id:"focusSuggestion",precondition:zt.and(Tr.Visible,Tr.HasFocusedSuggestion.negate()),handler:e=>e.focusSuggestion(),kbOpts:{weight:bk,kbExpr:Ze.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));xn(new Sg({id:"focusAndAcceptSuggestion",precondition:zt.and(Tr.Visible,Tr.HasFocusedSuggestion.negate()),handler:e=>{e.focusSuggestion(),e.acceptSelectedSuggestion(!0,!1)}}));xn(new Sg({id:"toggleSuggestionDetails",precondition:zt.and(Tr.Visible,Tr.HasFocusedSuggestion),handler:e=>e.toggleSuggestionDetails(),kbOpts:{weight:bk,kbExpr:Ze.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:eT,group:"right",order:1,when:zt.and(Tr.DetailsVisible,Tr.CanResolve),title:j(1469,"Show Less")},{menuId:eT,group:"right",order:1,when:zt.and(Tr.DetailsVisible.toNegated(),Tr.CanResolve),title:j(1470,"Show More")}]}));xn(new Sg({id:"toggleExplainMode",precondition:Tr.Visible,handler:e=>e.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));xn(new Sg({id:"toggleSuggestionFocus",precondition:Tr.Visible,handler:e=>e.toggleSuggestionFocus(),kbOpts:{weight:bk,kbExpr:Ze.textInputFocus,primary:2570,mac:{primary:778}}}));xn(new Sg({id:"insertBestCompletion",precondition:zt.and(Ze.textInputFocus,zt.equals("config.editor.tabCompletion","on"),l0e.AtEnd,Tr.Visible.toNegated(),HV.OtherSuggestions.toNegated(),Mf.InSnippetMode.toNegated()),handler:(e,t)=>{e.triggerSuggestAndAcceptBest(Vd(t)?{fallback:"tab",...t}:{fallback:"tab"})},kbOpts:{weight:bk,primary:2}}));xn(new Sg({id:"insertNextSuggestion",precondition:zt.and(Ze.textInputFocus,zt.equals("config.editor.tabCompletion","on"),HV.OtherSuggestions,Tr.Visible.toNegated(),Mf.InSnippetMode.toNegated()),handler:e=>e.acceptNextSuggestion(),kbOpts:{weight:bk,kbExpr:Ze.textInputFocus,primary:2}}));xn(new Sg({id:"insertPrevSuggestion",precondition:zt.and(Ze.textInputFocus,zt.equals("config.editor.tabCompletion","on"),HV.OtherSuggestions,Tr.Visible.toNegated(),Mf.InSnippetMode.toNegated()),handler:e=>e.acceptPrevSuggestion(),kbOpts:{weight:bk,kbExpr:Ze.textInputFocus,primary:1026}}));gn(class extends Nn{constructor(){super({id:"editor.action.resetSuggestSize",label:Et(1472,"Reset Suggest Widget Size"),precondition:void 0})}run(e,t){var n;(n=iO.get(t))==null||n.resetWidgetSize()}});class g5o extends ct{get selectedItem(){return this._currentSuggestItemInfo}constructor(t,n,r){super(),this.editor=t,this.suggestControllerPreselector=n,this.onWillAccept=r,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new it),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(t.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(t.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=iO.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(l,d,u)=>{const h=this.editor.getModel();if(!h)return-1;const f=this.suggestControllerPreselector(),g=f?ZL(f,h):void 0;if(!g)return-1;const k=tt.lift(d),A=u.map((v,p)=>{const b=nJ.fromSuggestion(o,h,k,v,this.isShiftKeyPressed),O=ZL(b.getSingleTextEdit(),h),w=lRn(g,O);return{index:p,valid:w,prefixLength:O.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),m=vtt(A,nA(v=>v.prefixLength,P1));return m?m.index:-1}}));let s=!1;const a=()=>{s||(s=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(un.once(o.model.onDidTrigger)(l=>{a()})),this._register(o.onWillInsertSuggestItem(l=>{const d=this.editor.getPosition(),u=this.editor.getModel();if(!d||!u)return;const h=nJ.fromSuggestion(o,u,d,l.item,this.isShiftKeyPressed);this.onWillAccept(h)}))}this.update(this._isActive)}update(t){const n=this.getSuggestItemInfo();(this._isActive!==t||!m5o(this._currentSuggestItemInfo,n))&&(this._isActive=t,this._currentSuggestItemInfo=n,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const t=iO.get(this.editor);if(!t||!this.isSuggestWidgetVisible)return;const n=t.widget.value.getFocusedItem(),r=this.editor.getPosition(),o=this.editor.getModel();if(!(!n||!r||!o))return nJ.fromSuggestion(t,o,r,n.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const t=iO.get(this.editor);t==null||t.stopForceRenderingAbove()}forceRenderingAbove(){const t=iO.get(this.editor);t==null||t.forceRenderingAbove()}}class nJ{static fromSuggestion(t,n,r,o,s){let{insertText:a}=o.completion,l=!1;if(o.completion.insertTextRules&4){const u=new MP().parse(a);u.children.length<100&&n0e.adjustWhitespace(n,r,!0,u),a=u.toString(),l=!0}const d=t.getOverwriteInfo(o,s);return new nJ(De.fromPositions(r.delta(0,-d.overwriteBefore),r.delta(0,Math.max(d.overwriteAfter,0))),a,o.completion.kind,l,o.container.incomplete??!1)}constructor(t,n,r,o,s){this.range=t,this.insertText=n,this.completionItemKind=r,this.isSnippetText=o,this.listIncomplete=s}equals(t){return this.range.equalsRange(t.range)&&this.insertText===t.insertText&&this.completionItemKind===t.completionItemKind&&this.isSnippetText===t.isSnippetText}toSelectedSuggestionInfo(){return new CQn(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}getSingleTextEdit(){return new Zc(this.range,this.insertText)}}function m5o(e,t){return e===t?!0:!e||!t?!1:e.equals(t)}class k5o extends ct{constructor(t,n,r){super(),this._editorObs=t,this._handleSuggestAccepted=n,this._suggestControllerPreselector=r,this._suggestWidgetAdaptor=this._register(new g5o(this._editorObs.editor,()=>(this._editorObs.forceUpdate(),this._suggestControllerPreselector()),o=>this._editorObs.forceUpdate(s=>{this._handleSuggestAccepted(o)}))),this.selectedItem=es(this,o=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(s=>o(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem)}stopForceRenderingAbove(){this._suggestWidgetAdaptor.stopForceRenderingAbove()}forceRenderingAbove(){this._suggestWidgetAdaptor.forceRenderingAbove()}}class v5o{constructor(t,n){this.lineNumber=t,this.columnRange=n}}class Hxt{constructor(t,n){if(this.startColumn=t,this.endColumnExclusive=n,t>n)throw new Ai(`startColumn ${t} cannot be after endColumnExclusive ${n}`)}toRange(t){return new De(t,this.startColumn,t,this.endColumnExclusive)}equals(t){return this.startColumn===t.startColumn&&this.endColumnExclusive===t.endColumnExclusive}toZeroBasedOffsetRange(){return new Jn(this.startColumn-1,this.endColumnExclusive-1)}}class PQ{static fromLineTokens(t){const n=[];for(let r=0;r({text:r.text,metadata:r.metadata})),t)}map(t){const n=[];let r=0;for(const o of this._tokenInfo){const s=new Jn(r,r+o.text.length);n.push(t(s,o)),r+=o.text.length}return n}slice(t){const n=[];let r=0;for(const o of this._tokenInfo){const s=r,a=s+o.text.length;if(a>t.start){if(s>=t.endExclusive)break;const l=Math.max(0,t.start-s),d=Math.max(0,a-t.endExclusive);n.push(new Vxt(o.text.slice(l,o.text.length-d),o.metadata))}r+=o.text.length}return PQ.create(n)}append(t){const n=this._tokenInfo.concat(t._tokenInfo);return PQ.create(n)}}class Vxt{constructor(t,n){this.text=t,this.metadata=n}}var p5o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},b5o=function(e,t){return function(n,r){t(n,r,e)}};const kRn="ghost-text";var yF;let wee=(yF=class extends ct{constructor(t,n,r,o,s,a){super(),this._editor=t,this._model=n,this._options=r,this._shouldKeepCursorStable=o,this._isClickable=s,this._languageService=a,this._isDisposed=Bi(this,!1),this._editorObs=ml(this._editor),this._warningState=Wt(l=>{const d=this._model.ghostText.read(l);if(!d)return;const u=this._model.warning.read(l);if(u)return{lineNumber:d.lineNumber,position:new tt(d.lineNumber,d.parts[0].column),icon:u.icon}}),this._onDidClick=this._register(new it),this.onDidClick=this._onDidClick.event,this._useSyntaxHighlighting=this._options.map(l=>l.syntaxHighlightingEnabled),this._extraClassNames=Wt(this,l=>{const d=[...this._options.read(l).extraClasses??[]];return this._useSyntaxHighlighting.read(l)&&d.push("syntax-highlighted"),this._warningState.read(l)&&d.push("warning"),d.map(h=>` ${h}`).join("")}),this.uiState=Wt(this,l=>{var Q,T;if(this._isDisposed.read(l))return;const d=this._editorObs.model.read(l);if(d!==this._model.targetTextModel.read(l))return;const u=this._model.ghostText.read(l);if(!u)return;const h=u instanceof EVe?u.columnRange:void 0,f=this._useSyntaxHighlighting.read(l),g=this._extraClassNames.read(l),{inlineTexts:k,additionalLines:A,hiddenRange:m,additionalLinesOriginalSuffix:v}=O5o(u,d,kRn+g),p=d.getLineContent(u.lineNumber),b=new $8(k.map(M=>fh.insert(M.column-1,M.text))),O=f?d.tokenization.tokenizeLinesAt(u.lineNumber,[b.apply(p),...A.map(M=>M.content)]):void 0,w=b.getNewRanges(),y=k.map((M,B)=>{var P;return{...M,tokens:(P=O==null?void 0:O[0])==null?void 0:P.getTokensInRange(w[B])}}),C=A.map((M,B)=>{let P=(O==null?void 0:O[B+1])??kc.createEmpty(M.content,this._languageService.languageIdCodec);if(B===A.length-1&&v){const R=PQ.fromLineTokens(d.tokenization.getLineTokens(v.lineNumber)).slice(v.columnRange.toZeroBasedOffsetRange());P=PQ.fromLineTokens(P).append(R).toLineTokens(P.languageIdCodec)}return{content:P,decorations:M.decorations}}),x=(Q=this._editor.getSelection())==null?void 0:Q.getStartPosition().column,L=y.filter(M=>M.text!==""),S=L.length!==0,E={cursorColumnDistance:(S?L[0].column:1)-x,cursorLineDistance:S?0:A.findIndex(M=>M.content!=="")+1,lineCountOriginal:S?1:0,lineCountModified:A.length+(S?1:0),characterCountOriginal:0,characterCountModified:qge(L.map(M=>M.text.length))+qge(C.map(M=>M.content.getTextLength())),disjointReplacements:L.length+(A.length>0?1:0),sameShapeReplacements:L.length>1&&C.length===0?L.every(M=>M.text===L[0].text):void 0};return(T=this._model.handleInlineCompletionShown.read(l))==null||T(E),{replacedRange:h,inlineTexts:y,additionalLines:C,hiddenRange:m,lineNumber:u.lineNumber,additionalReservedLineCount:this._model.minReservedLineCount.read(l),targetTextModel:d,syntaxHighlightingEnabled:f}}),this.decorations=Wt(this,l=>{const d=this.uiState.read(l);if(!d)return[];const u=[],h=this._extraClassNames.read(l);d.replacedRange&&u.push({range:d.replacedRange.toRange(d.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace"+h,description:"GhostTextReplacement"}}),d.hiddenRange&&u.push({range:d.hiddenRange.toRange(d.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const f of d.inlineTexts)u.push({range:De.fromPositions(new tt(d.lineNumber,f.column)),options:{description:"ghost-text-decoration",after:{content:f.text,tokens:f.tokens,inlineClassName:(f.preview?"ghost-text-decoration-preview":"ghost-text-decoration")+(this._isClickable?" clickable":"")+h+f.lineDecorations.map(g=>" "+g.className).join(" "),cursorStops:Rv.Left,attachedData:new nSe(this)},showIfCollapsed:!0}});return u}),this._additionalLinesWidget=this._register(new w5o(this._editor,Wt(l=>{const d=this.uiState.read(l);return d?{lineNumber:d.lineNumber,additionalLines:d.additionalLines,minReservedLineCount:d.additionalReservedLineCount,targetTextModel:d.targetTextModel}:void 0}),this._shouldKeepCursorStable,this._isClickable)),this._isInlineTextHovered=this._editorObs.isTargetHovered(l=>{var d;return l.target.type===6&&((d=l.target.detail.injectedText)==null?void 0:d.options.attachedData)instanceof nSe&&l.target.detail.injectedText.options.attachedData.owner===this},this._store),this.isHovered=Wt(this,l=>this._isDisposed.read(l)?!1:this._isInlineTextHovered.read(l)||this._additionalLinesWidget.isHovered.read(l)),this.height=Wt(this,l=>this._editorObs.getOption(75).read(l)+(this._additionalLinesWidget.viewZoneHeight.read(l)??0)),this._register(Gn(()=>{this._isDisposed.set(!0,void 0)})),this._register(this._editorObs.setDecorations(this.decorations)),this._isClickable&&(this._register(this._additionalLinesWidget.onDidClick(l=>this._onDidClick.fire(l))),this._register(this._editor.onMouseUp(l=>{var u;if(l.target.type!==6)return;const d=(u=l.target.detail.injectedText)==null?void 0:u.options.attachedData;d instanceof nSe&&d.owner===this&&this._onDidClick.fire(l.event)}))),this._register(PA((l,d)=>{}))}static getWarningWidgetContext(t){const n=t.ghostTextViewWarningWidgetData;if(n)return n;if(t.parentElement)return this.getWarningWidgetContext(t.parentElement)}ownsViewZone(t){return this._additionalLinesWidget.viewZoneId===t}},yF.hot=SOe(yF),yF);wee=p5o([b5o(5,lc)],wee);class nSe{constructor(t){this.owner=t}}function O5o(e,t,n){const r=[],o=[];function s(f,g){if(o.length>0){const k=o[o.length-1];g&&k.decorations.push(new Ef(k.content.length+1,k.content.length+1+f[0].line.length,g,0)),k.content+=f[0].line,f=f.slice(1)}for(const k of f)o.push({content:k.line,decorations:g?[new Ef(1,k.line.length+1,g,0),...k.lineDecorations]:[...k.lineDecorations]})}const a=t.getLineContent(e.lineNumber);let l,d=0;for(const f of e.parts){let g=f.lines;l===void 0?(r.push({column:f.column,text:g[0].line,preview:f.preview,lineDecorations:g[0].lineDecorations}),g=g.slice(1)):s([{line:a.substring(d,f.column-1),lineDecorations:[]}],void 0),g.length>0&&(s(g,n),l===void 0&&f.column<=a.length&&(l=f.column)),d=f.column-1}let u;l!==void 0&&(u=new v5o(e.lineNumber,new Hxt(d+1,a.length+1)));const h=l!==void 0?new Hxt(l,a.length+1):void 0;return{inlineTexts:r,additionalLines:o,hiddenRange:h,additionalLinesOriginalSuffix:u}}class w5o extends ct{get viewZoneId(){var t;return(t=this._viewZoneInfo)==null?void 0:t.viewZoneId}get viewZoneHeight(){return this._viewZoneHeight}constructor(t,n,r,o){super(),this._editor=t,this._lines=n,this._shouldKeepCursorStable=r,this._isClickable=o,this._viewZoneHeight=Bi("viewZoneHeight",void 0),this.editorOptionsChanged=y1("editorOptionChanged",un.filter(this._editor.onDidChangeConfiguration,s=>s.hasChanged(40)||s.hasChanged(133)||s.hasChanged(113)||s.hasChanged(108)||s.hasChanged(60)||s.hasChanged(59)||s.hasChanged(75))),this._onDidClick=this._register(new it),this.onDidClick=this._onDidClick.event,this._viewZoneListener=this._register(new is),this.isHovered=ml(this._editor).isTargetHovered(s=>zxt(s.target.element),this._store),this.hasBeenAccepted=!1,this._editor instanceof TP&&this._shouldKeepCursorStable&&this._register(this._editor.onBeforeExecuteEdit(s=>this.hasBeenAccepted=s.source==="inlineSuggestion.accept")),this._register(xi(s=>{const a=this._lines.read(s);this.editorOptionsChanged.read(s),a?(this.hasBeenAccepted=!1,this.updateLines(a.lineNumber,a.additionalLines,a.minReservedLineCount)):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this._viewZoneListener.clear(),this._editor.changeViewZones(t=>{this.removeActiveViewZone(t)})}updateLines(t,n,r){const o=this._editor.getModel();if(!o)return;const{tabSize:s}=o.getOptions();this._editor.changeViewZones(a=>{const l=new Pt;this.removeActiveViewZone(a);const d=Math.max(n.length,r);if(d>0){const u=document.createElement("div");y5o(u,s,n,this._editor.getOptions(),this._isClickable),this._isClickable&&(l.add(pt(u,"mousedown",h=>{h.preventDefault()})),l.add(pt(u,"click",h=>{zxt(h.target)&&this._onDidClick.fire(new $h(oi(h),h))}))),this.addViewZone(a,t,d,u)}this._viewZoneListener.value=l})}addViewZone(t,n,r,o){const s=t.addZone({afterLineNumber:n,heightInLines:r,domNode:o,afterColumnAffinity:1,onComputedHeight:a=>{this._viewZoneHeight.set(a,void 0)}});this.keepCursorStable(n,r),this._viewZoneInfo={viewZoneId:s,heightInLines:r,lineNumber:n}}removeActiveViewZone(t){this._viewZoneInfo&&(t.removeZone(this._viewZoneInfo.viewZoneId),this.hasBeenAccepted||this.keepCursorStable(this._viewZoneInfo.lineNumber,-this._viewZoneInfo.heightInLines),this._viewZoneInfo=void 0,this._viewZoneHeight.set(void 0,void 0))}keepCursorStable(t,n){var o,s;if(!this._shouldKeepCursorStable)return;const r=(s=(o=this._editor.getSelection())==null?void 0:o.getStartPosition())==null?void 0:s.lineNumber;r!==void 0&&t`);for(let v=0,p=n.length;v');const w=O.getLineContent(),y=Zie(w),C=AV(w);vZ(new T6(h.isMonospace&&!s,h.canUseHalfwidthRightwardsArrow,w,!1,y,C,0,O,b.decorations,t,0,h.spaceWidth,h.middotWidth,h.wsmiddotWidth,a,l,d,u!==G8.OFF,null,null,0),k),k.appendString("")}k.appendString(""),zu(e,h);const A=k.build(),m=Zxt?Zxt.createHTML(A):A;e.innerHTML=m}const Zxt=cC("editorGhostText",{createHTML:e=>e}),R2e=class R2e{constructor(t){this.replacements=t,t$(jie(t,(n,r)=>n.lineRange.endLineNumberExclusive<=r.lineRange.startLineNumber))}toString(){return this.replacements.map(t=>t.toString()).join(",")}getNewLineRanges(){const t=[];let n=0;for(const r of this.replacements)t.push(Qi.ofLength(r.lineRange.startLineNumber+n,r.newLines.length)),n+=r.newLines.length-r.lineRange.length;return t}};R2e.empty=new R2e([]);let _Ve=R2e;class A0e{static fromSingleTextEdit(t,n){const r=W1(t.text);let o=t.range.startLineNumber;const s=n.getValueOfRange(De.fromPositions(new tt(t.range.startLineNumber,1),t.range.getStartPosition()));r[0]=s+r[0];let a=t.range.endLineNumber+1;const l=n.getTransformer().getLineLength(t.range.endLineNumber)+1,d=n.getValueOfRange(De.fromPositions(t.range.getEndPosition(),new tt(t.range.endLineNumber,l)));r[r.length-1]=r[r.length-1]+d;const u=t.range.startColumn===n.getTransformer().getLineLength(t.range.startLineNumber)+1,h=t.range.endColumn===1;return u&&r[0].length===s.length&&(o++,r.shift()),r.length>0&&o${JSON.stringify(this.newLines)}`}toLineEdit(){return new _Ve([this])}}class vRn{get lineEdit(){return this.edit.replacements.length===0?new A0e(new Qi(1,1),[]):A0e.fromSingleTextEdit(this.edit.toReplacement(this.originalText),this.originalText)}get originalLineRange(){return this.lineEdit.lineRange}get modifiedLineRange(){return this.lineEdit.toLineEdit().getNewLineRanges()[0]}get displayRange(){return this.originalText.lineRange.intersect(this.originalLineRange.join(Qi.ofLength(this.originalLineRange.startLineNumber,this.lineEdit.newLines.length)))}constructor(t,n,r,o,s,a){this.originalText=t,this.edit=n,this.cursorPosition=r,this.multiCursorPositions=o,this.commands=s,this.inlineCompletion=a}}class pRn{constructor(t,n,r){this._model=t,this.inlineEdit=n,this.tabAction=r,this.action=this.inlineEdit.inlineCompletion.action,this.displayName=this.inlineEdit.inlineCompletion.source.provider.displayName??j(1219,"Inline Edit"),this.extensionCommands=this.inlineEdit.inlineCompletion.source.inlineSuggestions.commands??[],this.isInDiffEditor=this._model.isInDiffEditor,this.displayLocation=this.inlineEdit.inlineCompletion.hint,this.showCollapsed=this._model.showCollapsed}accept(){this._model.accept()}jump(){this._model.jump()}handleInlineEditShown(t,n){this._model.handleInlineSuggestionShown(this.inlineEdit.inlineCompletion,t,n)}}class C5o{constructor(t){this._model=t,this.onDidAccept=this._model.onDidAccept,this.inAcceptFlow=this._model.inAcceptFlow}}class x5o{constructor(t,n,r,o){this.lineRange=r;const s=ml(t),a=Wt(this,l=>s.isFocused.read(l)&&o.showInlineEditMenu?LA.Accept:LA.Inactive);this.model=new pRn(n,new vRn(new L5(""),new Yp([o.getSingleTextEdit()]),n.primaryPosition.get(),n.allPositions.get(),o.source.inlineSuggestions.commands??[],o),a)}}class Zs{static fromPoints(t,n){return new Zs(t.x,t.y,n.x,n.y)}static fromPointSize(t,n){return new Zs(t.x,t.y,t.x+n.x,t.y+n.y)}static fromLeftTopRightBottom(t,n,r,o){return new Zs(t,n,r,o)}static fromLeftTopWidthHeight(t,n,r,o){return new Zs(t,n,t+r,n+o)}static fromRanges(t,n){return new Zs(t.start,n.start,t.endExclusive,n.endExclusive)}static hull(t){let n=Number.MAX_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(const a of t)n=Math.min(n,a.left),r=Math.min(r,a.top),o=Math.max(o,a.right),s=Math.max(s,a.bottom);return new Zs(n,r,o,s)}get width(){return this.right-this.left}get height(){return this.bottom-this.top}constructor(t,n,r,o){if(this.left=t,this.top=n,this.right=r,this.bottom=o,t>r)throw new Ai("Invalid arguments: Horizontally offset by "+(t-r));if(n>o)throw new Ai("Invalid arguments: Vertically offset by "+(n-o))}withMargin(t,n,r,o){let s,a,l,d;return n===void 0&&r===void 0&&o===void 0?s=a=l=d=t:r===void 0&&o===void 0?(s=a=n,l=d=t):(s=o,a=n,l=t,d=r),new Zs(this.left-s,this.top-l,this.right+a,this.bottom+d)}intersectVertical(t){const n=Math.max(this.top,t.start),r=Math.min(this.bottom,t.endExclusive);return new Zs(this.left,n,this.right,Math.max(n,r))}intersectHorizontal(t){const n=Math.max(this.left,t.start),r=Math.min(this.right,t.endExclusive);return new Zs(n,this.top,Math.max(n,r),this.bottom)}toString(){return`Rect{(${this.left},${this.top}), (${this.right},${this.bottom})}`}intersect(t){const n=Math.max(this.left,t.left),r=Math.min(this.right,t.right),o=Math.max(this.top,t.top),s=Math.min(this.bottom,t.bottom);if(!(n>r||o>s))return new Zs(n,o,r,s)}containsRect(t){return this.left<=t.left&&this.top<=t.top&&this.right>=t.right&&this.bottom>=t.bottom}containsPoint(t){return this.left<=t.x&&this.top<=t.y&&this.right>=t.x&&this.bottom>=t.y}moveToBeContainedIn(t){const n=this.width,r=this.height;let o=this.left,s=this.top;return ot.right&&(o=t.right-n),st.bottom&&(s=t.bottom-r),new Zs(o,s,o+n,s+r)}withWidth(t){return new Zs(this.left,this.top,this.left+t,this.bottom)}withHeight(t){return new Zs(this.left,this.top,this.right,this.top+t)}withTop(t){return new Zs(this.left,t,this.right,this.bottom)}withLeft(t){return new Zs(t,this.top,this.right,this.bottom)}translateX(t){return new Zs(this.left+t,this.top,this.right+t,this.bottom)}translateY(t){return new Zs(this.left,this.top+t,this.right,this.bottom+t)}getLeftBottom(){return new mu(this.left,this.bottom)}getRightBottom(){return new mu(this.right,this.bottom)}getRightTop(){return new mu(this.right,this.top)}toStyles(){return{position:"absolute",left:`${this.left}px`,top:`${this.top}px`,width:`${this.width}px`,height:`${this.height}px`}}}class iJ{constructor(t,n,r,o=null){this.startLineNumbers=t,this.endLineNumbers=n,this.lastLineRelativePosition=r,this.showEndForLine=o}equals(t){return!!t&&this.lastLineRelativePosition===t.lastLineRelativePosition&&this.showEndForLine===t.showEndForLine&&za(this.startLineNumbers,t.startLineNumbers)&&za(this.endLineNumbers,t.endLineNumbers)}static get Empty(){return new iJ([],[],0)}}const Yxt=cC("stickyScrollViewLayer",{createHTML:e=>e}),iSe="data-sticky-line-index",Xxt="data-sticky-is-line",L5o="data-sticky-is-line-number",qxt="data-sticky-is-folding-icon";class S5o extends ct{get height(){return this._height}constructor(t){super(),this._foldingIconStore=this._register(new Pt),this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._height=-1,this._onDidChangeStickyScrollHeight=this._register(new it),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._editor=t,this._lineHeight=t.getOption(75),this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",t instanceof r6),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable),this._setHeight(0);const n=()=>{this._linesDomNode.style.left=this._editor.getOption(131).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(131)&&n(),r.hasChanged(75)&&(this._lineHeight=this._editor.getOption(75))})),this._register(this._editor.onDidScrollChange(r=>{r.scrollLeftChanged&&n(),r.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{n(),this._updateWidgetWidth()})),n(),this._register(this._editor.onDidLayoutChange(r=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(t){return this._renderedStickyLines.find(n=>n.lineNumber===t)}getCurrentLines(){return this._lineNumbers}setState(t,n,r){const o=!this._state&&!t,s=this._state&&this._state.equals(t);if(r===void 0&&(o||s))return;const a=this._findRenderingData(t),l=this._lineNumbers;this._lineNumbers=a.lineNumbers,this._lastLineRelativePosition=a.lastLineRelativePosition;const d=this._findIndexToRebuildFrom(l,this._lineNumbers,r);this._renderRootNode(this._lineNumbers,this._lastLineRelativePosition,n,d),this._state=t}_findRenderingData(t){if(!t)return{lineNumbers:[],lastLineRelativePosition:0};const n=[...t.startLineNumbers];t.showEndForLine!==null&&(n[t.showEndForLine]=t.endLineNumbers[t.showEndForLine]);let r=0;for(let o=0;o!t.includes(s));return o===-1?0:o}_updateWidgetWidth(){const t=this._editor.getLayoutInfo(),n=t.contentLeft;this._lineNumbersDomNode.style.width=`${n}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-t.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${t.width-t.verticalScrollbarWidth}px`}_useFoldingOpacityTransition(t){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${t?.5:0}s`)}_setFoldingIconsVisibility(t){for(const n of this._renderedStickyLines){const r=n.foldingIcon;r&&r.setVisible(t?!0:r.isCollapsed)}}async _renderRootNode(t,n,r,o){const s=this._editor._getViewModel();if(!s){this._clearWidget();return}if(t.length===0){this._clearWidget();return}const a=[],l=t[t.length-1];let d=0;for(let h=0;hh.scrollWidth))+u.verticalScrollbarWidth,this._renderedStickyLines=a,this._setHeight(d+n),this._editor.layoutOverlayWidget(this)}_clearWidget(){for(let t=0;t{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(pt(this._lineNumbersDomNode,cn.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(t,n,r,o,s,a,l){const d=t.coordinatesConverter.convertModelPositionToViewPosition(new tt(r,1)).lineNumber,u=t.getViewLineRenderingData(d),h=this._editor.getOption(76),f=this._editor.getOption(117).verticalScrollbarSize;let g;try{g=Ef.filter(u.inlineDecorations,d,u.minColumn,u.maxColumn)}catch{g=[]}const k=this._editor.getLineHeightForPosition(new tt(r,1)),A=t.getTextDirection(r),m=new T6(!0,!0,u.content,u.continuesWithWrappedLine,u.isBasicASCII,u.containsRTL,0,u.tokens,g,u.tabSize,u.startVisibleColumn,1,1,1,500,"none",!0,!0,null,A,f),v=new pE(2e3),p=vZ(m,v);let b;Yxt?b=Yxt.createHTML(v.build()):b=v.build();const O=document.createElement("span");O.setAttribute(iSe,String(n)),O.setAttribute(Xxt,""),O.setAttribute("role","listitem"),O.tabIndex=0,O.className="sticky-line-content",O.classList.add(`stickyLine${r}`),O.style.lineHeight=`${k}px`,O.innerHTML=b;const w=document.createElement("span");w.setAttribute(iSe,String(n)),w.setAttribute(L5o,""),w.className="sticky-line-number",w.style.lineHeight=`${k}px`;const y=l.contentLeft;w.style.width=`${y}px`;const C=document.createElement("span");h.renderType===1||h.renderType===3&&r%10===0?C.innerText=r.toString():h.renderType===2&&(C.innerText=Math.abs(r-this._editor.getPosition().lineNumber).toString()),C.className="sticky-line-number-inner",C.style.width=`${l.lineNumbersWidth}px`,C.style.paddingLeft=`${l.lineNumbersLeft}px`,w.appendChild(C);const x=this._renderFoldingIconForLine(a,r);x&&(w.appendChild(x.domNode),x.domNode.style.left=`${l.lineNumbersWidth+l.lineNumbersLeft}px`,x.domNode.style.lineHeight=`${k}px`),this._editor.applyFontInfo(O),this._editor.applyFontInfo(w),w.style.lineHeight=`${k}px`,O.style.lineHeight=`${k}px`,w.style.height=`${k}px`,O.style.height=`${k}px`;const L=new T5o(n,r,O,w,x,p.characterMapping,O.scrollWidth,k);return this._updatePosition(L,o,s)}_updatePosition(t,n,r){var a;const o=t.lineDomNode,s=t.lineNumberDomNode;if(r){const l="0";o.style.zIndex=l,s.style.zIndex=l;const d=`${n+this._lastLineRelativePosition+((a=t.foldingIcon)!=null&&a.isCollapsed?1:0)}px`;o.style.top=d,s.style.top=d}else{const l="1";o.style.zIndex=l,s.style.zIndex=l,o.style.top=`${n}px`,s.style.top=`${n}px`}return t}_renderFoldingIconForLine(t,n){const r=this._editor.getOption(126);if(!t||r==="never")return;const o=t.regions,s=o.findRange(n),a=o.getStartLineNumber(s);if(!(n===a))return;const d=o.isCollapsed(s),u=new E5o(d,a,o.getEndLineNumber(s),this._lineHeight);return u.setVisible(this._isOnGlyphMargin?!0:d||r==="always"),u.domNode.setAttribute(qxt,""),u}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(t){0<=t&&t0)return null;const n=this._getRenderedStickyLineFromChildDomNode(t);if(!n)return null;const r=OV(n.characterMapping,t,0);return new tt(n.lineNumber,r)}getLineNumberFromChildDomNode(t){var n;return((n=this._getRenderedStickyLineFromChildDomNode(t))==null?void 0:n.lineNumber)??null}_getRenderedStickyLineFromChildDomNode(t){const n=this.getLineIndexFromChildDomNode(t);return n===null||n<0||n>=this._renderedStickyLines.length?null:this._renderedStickyLines[n]}getLineIndexFromChildDomNode(t){const n=this._getAttributeValue(t,iSe);return n?parseInt(n,10):null}isInStickyLine(t){return this._getAttributeValue(t,Xxt)!==void 0}isInFoldingIconDomNode(t){return this._getAttributeValue(t,qxt)!==void 0}_getAttributeValue(t,n){for(;t&&t!==this._rootDomNode;){const r=t.getAttribute(n);if(r!==null)return r;t=t.parentElement}}}class T5o{constructor(t,n,r,o,s,a,l,d){this.index=t,this.lineNumber=n,this.lineDomNode=r,this.lineNumberDomNode=o,this.foldingIcon=s,this.characterMapping=a,this.scrollWidth=l,this.height=d}}class E5o{constructor(t,n,r,o){this.isCollapsed=t,this.foldingStartLine=n,this.foldingEndLine=r,this.dimension=o,this.domNode=document.createElement("div"),this.domNode.style.width="26px",this.domNode.style.height=`${o}px`,this.domNode.style.lineHeight=`${o}px`,this.domNode.className=mi.asClassName(t?V1e:H1e)}setVisible(t){this.domNode.style.cursor=t?"pointer":"default",this.domNode.style.opacity=t?"1":"0"}}class rJ{constructor(t,n){this.startLineNumber=t,this.endLineNumber=n}}class f0e{constructor(t,n,r){this.range=t,this.children=n,this.parent=r}}class bRn{constructor(t,n,r,o){this.uri=t,this.version=n,this.element=r,this.outlineProviderId=o}}var o3e=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},yee=function(e,t){return function(n,r){t(n,r,e)}},oJ;(function(e){e.OUTLINE_MODEL="outlineModel",e.FOLDING_PROVIDER_MODEL="foldingProviderModel",e.INDENTATION_MODEL="indentationModel"})(oJ||(oJ={}));var P5;(function(e){e[e.VALID=0]="VALID",e[e.INVALID=1]="INVALID",e[e.CANCELED=2]="CANCELED"})(P5||(P5={}));let $Ve=class extends ct{constructor(t,n,r,o){switch(super(),this._editor=t,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new A2(300)),this._updateOperation=this._register(new Pt),this._editor.getOption(131).defaultModel){case oJ.OUTLINE_MODEL:this._modelProviders.push(new eze(this._editor,o));case oJ.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new nze(this._editor,n,o));case oJ.INDENTATION_MODEL:this._modelProviders.push(new tze(this._editor,r));break}}dispose(){this._modelProviders.forEach(t=>t.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(t){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const n of this._modelProviders){const{statusPromise:r,modelPromise:o}=n.computeStickyModel(t);this._modelPromise=o;const s=await r;if(this._modelPromise!==o)return null;switch(s){case P5.CANCELED:return this._updateOperation.clear(),null;case P5.VALID:return n.stickyModel}}return null}).catch(n=>(Yi(n),null))}};$Ve=o3e([yee(2,$n),yee(3,Zn)],$Ve);class ORn extends ct{constructor(t){super(),this._editor=t,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,P5.INVALID}computeStickyModel(t){if(t.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const n=zd(r=>this.createModelFromProvider(r));return{statusPromise:n.then(r=>this.isModelValid(r)?t.isCancellationRequested?P5.CANCELED:(this._stickyModel=this.createStickyModel(t,r),P5.VALID):this._invalid()).then(void 0,r=>(Yi(r),P5.CANCELED)),modelPromise:n}}isModelValid(t){return!0}isProviderValid(){return!0}}let eze=class extends ORn{constructor(t,n){super(t),this._languageFeaturesService=n}createModelFromProvider(t){return fL.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),t)}createStickyModel(t,n){var a;const{stickyOutlineElement:r,providerID:o}=this._stickyModelFromOutlineModel(n,(a=this._stickyModel)==null?void 0:a.outlineProviderId),s=this._editor.getModel();return new bRn(s.uri,s.getVersionId(),r,o)}isModelValid(t){return t&&t.children.size>0}_stickyModelFromOutlineModel(t,n){let r;if(lo.first(t.children.values())instanceof _Mn){const l=lo.find(t.children.values(),d=>d.id===n);if(l)r=l.children;else{let d="",u=-1,h;for(const[f,g]of t.children.entries()){const k=this._findSumOfRangesOfGroup(g);k>u&&(h=g,u=k,d=g.id)}n=d,r=h.children}}else r=t.children;const o=[],s=Array.from(r.values()).sort((l,d)=>{const u=new rJ(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber),h=new rJ(d.symbol.range.startLineNumber,d.symbol.range.endLineNumber);return this._comparator(u,h)});for(const l of s)o.push(this._stickyModelFromOutlineElement(l,l.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new f0e(void 0,o,void 0),providerID:n}}_stickyModelFromOutlineElement(t,n){const r=[];for(const s of t.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==n)r.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const a of s.children.values())r.push(this._stickyModelFromOutlineElement(a,s.symbol.selectionRange.startLineNumber));r.sort((s,a)=>this._comparator(s.range,a.range));const o=new rJ(t.symbol.selectionRange.startLineNumber,t.symbol.range.endLineNumber);return new f0e(o,r,void 0)}_comparator(t,n){return t.startLineNumber!==n.startLineNumber?t.startLineNumber-n.startLineNumber:n.endLineNumber-t.endLineNumber}_findSumOfRangesOfGroup(t){let n=0;for(const r of t.children.values())n+=this._findSumOfRangesOfGroup(r);return t instanceof yVe?n+t.symbol.range.endLineNumber-t.symbol.selectionRange.startLineNumber:n}};eze=o3e([yee(1,Zn)],eze);class wRn extends ORn{constructor(t){super(t),this._foldingLimitReporter=this._register(new YMn(t))}createStickyModel(t,n){const r=this._fromFoldingRegions(n),o=this._editor.getModel();return new bRn(o.uri,o.getVersionId(),r,void 0)}isModelValid(t){return t!==null}_fromFoldingRegions(t){const n=t.length,r=[],o=new f0e(void 0,[],void 0);for(let s=0;s{this._updateProvider(t,n)})),this._updateProvider(t,n)}_updateProvider(t,n){const r=XT.getFoldingRangeProviders(this._languageFeaturesService,t.getModel());r.length!==0&&(this.provider.value=new fit(t.getModel(),r,n,this._foldingLimitReporter,void 0))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(t){var n;return((n=this.provider.value)==null?void 0:n.compute(t))??null}};nze=o3e([yee(2,Zn)],nze);var D5o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Gxt=function(e,t){return function(n,r){t(n,r,e)}};class Q5o{constructor(t,n,r,o){this.startLineNumber=t,this.endLineNumber=n,this.top=r,this.height=o}}let ize=class extends ct{constructor(t,n,r){super(),this._languageFeaturesService=n,this._languageConfigurationService=r,this._onDidChangeStickyScroll=this._register(new it),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=t,this._sessionStore=this._register(new Pt),this._updateSoon=this._register(new Ss(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(131)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(131).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Gn(()=>{var n;(n=this._stickyModelProvider)==null||n.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var t;return(t=this._model)==null?void 0:t.version}updateStickyModelProvider(){var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null,this._editor.hasModel()&&(this._stickyModelProvider=new $Ve(this._editor,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var t;(t=this._cts)==null||t.dispose(!0),this._cts=new Ya,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(t){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const n=await this._stickyModelProvider.update(t);t.isCancellationRequested||(this._model=n)}getCandidateStickyLinesIntersecting(t){var r;if(!((r=this._model)!=null&&r.element))return[];const n=[];return this.getCandidateStickyLinesIntersectingFromStickyModel(t,this._model.element,n,0,0,-1),this.filterHiddenRanges(n)}getCandidateStickyLinesIntersectingFromStickyModel(t,n,r,o,s,a){const l=this._editor.getModel();if(!l||n.children.length===0)return;let d=a;const u=[];for(let g=0;gg-k)),f=this.updateIndex(Zge(u,t.endLineNumber,(g,k)=>g-k));for(let g=h;g<=f;g++){const k=n.children[g];if(!k||!k.range)continue;const{startLineNumber:A,endLineNumber:m}=k.range;if(m>A+1&&t.startLineNumber<=m+1&&A-1<=t.endLineNumber&&A!==d&&l.isValidRange(new De(A,1,m,1))){d=A;const v=this._editor.getLineHeightForPosition(new tt(A,1));r.push(new Q5o(A,m-1,s,v)),this.getCandidateStickyLinesIntersectingFromStickyModel(t,k,r,o+1,s+v,A)}}}filterHiddenRanges(t){var r;const n=(r=this._editor._getViewModel())==null?void 0:r.getHiddenAreas();return n?t.filter(o=>!n.some(s=>o.startLineNumber>=s.startLineNumber&&o.endLineNumber<=s.endLineNumber+1)):t}updateIndex(t){return t===-1?0:t<0?-t-2:t}};ize=D5o([Gxt(1,Zn),Gxt(2,bl)],ize);var B5o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},_I=function(e,t){return function(n,r){t(n,r,e)}},rze,CF;let k4=(CF=class extends ct{constructor(t,n,r,o,s,a,l){super(),this._editor=t,this._contextMenuService=n,this._languageFeaturesService=r,this._instaService=o,this._contextKeyService=l,this._sessionStore=new Pt,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._mouseTarget=null,this._onDidChangeStickyScrollHeight=this._register(new it),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._stickyScrollWidget=new S5o(this._editor),this._stickyLineCandidateProvider=new ize(this._editor,r,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=iJ.Empty;const d=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeLineHeight(h=>{h.changes.forEach(f=>{const g=f.lineNumber;this._widgetState.startLineNumbers.includes(g)&&this._renderStickyScroll(g)})})),this._register(this._editor.onDidChangeFont(h=>{h.changes.forEach(f=>{const g=f.lineNumber;this._widgetState.startLineNumbers.includes(g)&&this._renderStickyScroll(g)})})),this._register(this._editor.onDidChangeConfiguration(h=>{this._readConfigurationChange(h)})),this._register(pt(d,cn.CONTEXT_MENU,async h=>{this._onContextMenu(oi(d),h)})),this._stickyScrollFocusedContextKey=Ze.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=Ze.stickyScrollVisible.bindTo(this._contextKeyService);const u=this._register(f2(d));this._register(u.onDidBlur(h=>{this._positionRevealed===!1&&d.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(u.onDidFocus(h=>{this.focus()})),this._registerMouseListeners(),this._register(pt(d,cn.MOUSE_DOWN,h=>{this._onMouseDown=!0})),this._register(this._stickyScrollWidget.onDidChangeStickyScrollHeight(h=>{this._onDidChangeStickyScrollHeight.fire(h)})),this._onDidResize(),this._readConfiguration()}get stickyScrollWidgetHeight(){return this._stickyScrollWidget.height}static get(t){return t.getContribution(rze.ID)}_disposeFocusStickyScrollStore(){var t;this._stickyScrollFocusedContextKey.set(!1),(t=this._focusDisposableStore)==null||t.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}isFocused(){return this._focused}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Pt,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(t){this._focusedStickyElementIndex=t?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const t=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:t[this._focusedStickyElementIndex],column:1})}_revealPosition(t){this._reveaInEditor(t,()=>this._editor.revealPosition(t))}_revealLineInCenterIfOutsideViewport(t){this._reveaInEditor(t,()=>this._editor.revealLineInCenterIfOutsideViewport(t.lineNumber,0))}_reveaInEditor(t,n){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,n(),this._editor.setSelection(De.fromPositions(t)),this._editor.focus()}_registerMouseListeners(){const t=this._register(new Pt),n=this._register(new HOe(this._editor,{extractLineNumberFromMouseEvent:s=>{const a=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);return a?a.lineNumber:0}})),r=s=>{if(!this._editor.hasModel()||s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return null;const a=s.target.element;if(!a||a.innerText!==a.innerHTML)return null;const l=this._stickyScrollWidget.getEditorPositionFromNode(a);return l?{range:new De(l.lineNumber,l.column,l.lineNumber,l.column+a.innerText.length),textElement:a}:null},o=this._stickyScrollWidget.getDomNode();this._register(Sc(o,cn.CLICK,s=>{if(s.ctrlKey||s.altKey||s.metaKey||!s.leftButton)return;if(s.shiftKey){const u=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(u===null)return;const h=new tt(this._endLineNumbers[u],1);this._revealLineInCenterIfOutsideViewport(h);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(s.target)){const u=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);this._toggleFoldingRegionForLine(u);return}if(!this._stickyScrollWidget.isInStickyLine(s.target))return;let d=this._stickyScrollWidget.getEditorPositionFromNode(s.target);if(!d){const u=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);if(u===null)return;d=new tt(u,1)}this._revealPosition(d)})),this._register(pt(Ls,cn.MOUSE_MOVE,s=>{this._mouseTarget=s.target,this._onMouseMoveOrKeyDown(s)})),this._register(pt(Ls,cn.KEY_DOWN,s=>{this._onMouseMoveOrKeyDown(s)})),this._register(pt(Ls,cn.KEY_UP,()=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(n.onMouseMoveOrRelevantKeyDown(([s,a])=>{const l=r(s);if(!l||!s.hasTriggerModifier||!this._editor.hasModel()){t.clear();return}const{range:d,textElement:u}=l;if(!d.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=d,t.clear();else if(u.style.textDecoration==="underline")return;const h=new Ya;t.add(Gn(()=>h.dispose(!0)));let f;Ore(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new tt(d.startLineNumber,d.startColumn+1),!1,h.token).then(g=>{if(!h.token.isCancellationRequested)if(g.length!==0){this._candidateDefinitionsLength=g.length;const k=u;f!==k?(t.clear(),f=k,f.style.textDecoration="underline",t.add(Gn(()=>{f.style.textDecoration="none"}))):f||(f=k,f.style.textDecoration="underline",t.add(Gn(()=>{f.style.textDecoration="none"})))}else t.clear()})})),this._register(n.onCancel(()=>{t.clear()})),this._register(n.onExecute(async s=>{if(s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return;const a=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);a&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:a.lineNumber,column:1})),this._instaService.invokeFunction(QMn,s,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(t,n){const r=new $h(t,n);this._contextMenuService.showContextMenu({menuId:Yn.StickyScrollContext,getAnchor:()=>r})}_onMouseMoveOrKeyDown(t){if(!t.shiftKey||!this._mouseTarget||!oc(this._mouseTarget))return;const n=this._stickyScrollWidget.getLineIndexFromChildDomNode(this._mouseTarget);n===null||this._showEndForLine===n||(this._showEndForLine=n,this._renderStickyScroll())}_toggleFoldingRegionForLine(t){if(!this._foldingModel||t===null)return;const n=this._stickyScrollWidget.getRenderedStickyLine(t),r=n==null?void 0:n.foldingIcon;if(!r)return;dit(this._foldingModel,1,[t]),r.isCollapsed=!r.isCollapsed;const o=(r.isCollapsed?this._editor.getTopForLineNumber(r.foldingEndLine):this._editor.getTopForLineNumber(r.foldingStartLine))-this._editor.getOption(75)*n.index+1;this._editor.setScrollTop(o),this._renderStickyScroll(t)}_readConfiguration(){const t=this._editor.getOption(131);if(t.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._resetState(),this._sessionStore.clear(),this._enabled=!1;return}else t.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(r=>{r.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(r=>this._onTokensChange(r))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(76).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(t){(t.hasChanged(131)||t.hasChanged(81)||t.hasChanged(75)||t.hasChanged(126)||t.hasChanged(76))&&this._readConfiguration(),(t.hasChanged(76)||t.hasChanged(52)||t.hasChanged(126))&&this._renderStickyScroll(0)}_needsUpdate(t){const n=this._stickyScrollWidget.getCurrentLines();for(const r of n)for(const o of t.ranges)if(r>=o.fromLineNumber&&r<=o.toLineNumber)return!0;return!1}_onTokensChange(t){this._needsUpdate(t)&&this._renderStickyScroll(0)}_onDidResize(){const n=this._editor.getLayoutInfo().height/this._editor.getOption(75);this._maxStickyLines=Math.round(n*.25),this._renderStickyScroll(0)}async _renderStickyScroll(t){const n=this._editor.getModel();if(!n||n.isTooLargeForTokenization()){this._resetState();return}const r=this._updateAndGetMinRebuildFromLine(t),o=this._stickyLineCandidateProvider.getVersionId();if(o===void 0||o===n.getVersionId())if(!this._focused)await this._updateState(r);else if(this._focusedStickyElementIndex===-1)await this._updateState(r),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const a=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(r),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(a)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(t){if(t!==void 0){const n=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(t,n)}return this._minRebuildFromLine}async _updateState(t){var r;this._minRebuildFromLine=void 0,this._foldingModel=await((r=XT.get(this._editor))==null?void 0:r.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const n=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(n),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,t)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=iJ.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const t=Math.min(this._maxStickyLines,this._editor.getOption(131).maxLineCount),n=this._editor.getScrollTop();let r=0;const o=[],s=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new rJ(a[0].startLineNumber,a[a.length-1].endLineNumber),d=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of d){const h=u.startLineNumber,f=u.endLineNumber,g=u.top,k=g+u.height,A=this._editor.getTopForLineNumber(h)-n,m=this._editor.getBottomForLineNumber(f)-n;if(g>A&&g<=m&&(o.push(h),s.push(f+1),k>m&&(r=m-k)),o.length===t)break}}return this._endLineNumbers=s,new iJ(o,s,r,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},rze=CF,CF.ID="store.contrib.stickyScrollController",CF);k4=rze=B5o([_I(1,Ek),_I(2,Zn),_I(3,$n),_I(4,bl),_I(5,L2),_I(6,Fi)],k4);const sJ=He("inlineEdit.originalBackground",Ji(C5,.2),j(1220,"Background color for the original text in inline edits."),!0),yRn=He("inlineEdit.modifiedBackground",Ji(yQ,.3),j(1221,"Background color for the modified text in inline edits."),!0);He("inlineEdit.originalChangedLineBackground",Ji(C5,.8),j(1222,"Background color for the changed lines in the original text of inline edits."),!0);const F5o=He("inlineEdit.originalChangedTextBackground",Ji(C5,.8),j(1223,"Overlay color for the changed text in the original text of inline edits."),!0),P5o=He("inlineEdit.modifiedChangedLineBackground",{light:Ji(Fle,.7),dark:Ji(Fle,.7),hcDark:Fle,hcLight:Fle},j(1224,"Background color for the changed lines in the modified text of inline edits."),!0),M5o=He("inlineEdit.modifiedChangedTextBackground",Ji(yQ,.7),j(1225,"Overlay color for the changed text in the modified text of inline edits."),!0),R5o=He("inlineEdit.gutterIndicator.primaryForeground",fOe,j(1226,"Foreground color for the primary inline edit gutter indicator.")),WU=He("inlineEdit.gutterIndicator.primaryBorder",CQ,j(1227,"Border color for the primary inline edit gutter indicator.")),CRn=He("inlineEdit.gutterIndicator.primaryBackground",{light:Ji(WU,.5),dark:Ji(WU,.4),hcDark:Ji(WU,.4),hcLight:Ji(WU,.5)},j(1228,"Background color for the primary inline edit gutter indicator.")),I5o=He("inlineEdit.gutterIndicator.secondaryForeground",IDn,j(1229,"Foreground color for the secondary inline edit gutter indicator.")),xRn=He("inlineEdit.gutterIndicator.secondaryBorder",mme,j(1230,"Border color for the secondary inline edit gutter indicator.")),LRn=He("inlineEdit.gutterIndicator.secondaryBackground",xRn,j(1231,"Background color for the secondary inline edit gutter indicator.")),N5o=He("inlineEdit.gutterIndicator.successfulForeground",fOe,j(1232,"Foreground color for the successful inline edit gutter indicator.")),SRn=He("inlineEdit.gutterIndicator.successfulBorder",CQ,j(1233,"Border color for the successful inline edit gutter indicator.")),TRn=He("inlineEdit.gutterIndicator.successfulBackground",SRn,j(1234,"Background color for the successful inline edit gutter indicator.")),U5o=He("inlineEdit.gutterIndicator.background",{hcDark:Ji("tab.inactiveBackground",.5),hcLight:Ji("tab.inactiveBackground",.5),dark:Ji("tab.inactiveBackground",.5),light:"#5f5f5f18"},j(1235,"Background color for the inline edit gutter indicator.")),dG=He("inlineEdit.originalBorder",{light:C5,dark:C5,hcDark:C5,hcLight:C5},j(1236,"Border color for the original text in inline edits.")),uG=He("inlineEdit.modifiedBorder",{light:gm(yQ,.6),dark:yQ,hcDark:yQ,hcLight:yQ},j(1237,"Border color for the modified text in inline edits.")),j5o=He("inlineEdit.tabWillAcceptModifiedBorder",{light:gm(uG,0),dark:gm(uG,0),hcDark:gm(uG,0),hcLight:gm(uG,0)},j(1238,"Modified border color for the inline edits widget when tab will accept it.")),W5o=He("inlineEdit.tabWillAcceptOriginalBorder",{light:gm(dG,0),dark:gm(dG,0),hcDark:gm(dG,0),hcLight:gm(dG,0)},j(1239,"Original border color for the inline edits widget over the original text when tab will accept it."));function Cee(e){return e.map(t=>t===LA.Accept?j5o:uG)}function s3e(e){return e.map(t=>t===LA.Accept?W5o:dG)}function kv(e,t){let n;typeof e=="string"?n=rSe(e,t):n=e.map((o,s)=>rSe(o,t).read(s));const r=rSe(Tc,t);return n.map((o,s)=>o.makeOpaque(r.read(s)))}function rSe(e,t){return b7n({owner:{observeColor:e},equalsFn:(n,r)=>n.equals(r),debugName:()=>`observeColor(${e})`},t.onDidColorThemeChange,()=>{const n=t.getColorTheme().getColor(e);if(!n)throw new Ai(`Missing color: ${e}`);return n})}function M5(e,t,n){e.layoutInfo.read(n),e.value.read(n);const r=e.model.read(n);if(!r)return 0;let o=0;e.scrollTop.read(n);for(let a=t.startLineNumber;ar.getLineContent(a));return o<5&&s.some(a=>a.length>0)&&r.uri.scheme!=="file"&&console.error("unexpected width"),o}function H5o(e,t,n){return e.layoutInfo.read(n),e.value.read(n),e.model.read(n)?(e.scrollTop.read(n),e.editor.getOffsetForColumn(t.lineNumber,t.column)):0}function Oit(e,t,n,r,o=void 0){const s=r.getModel();if(!s)return{prefixTrim:0,prefixLeftOffset:0};const a=e.map(g=>g.isSingleLine()?g.startColumn-1:0),l=t.mapToLineArray(g=>rWe(s.getLineContent(g))),d=n.filter(g=>g!=="").map(g=>rWe(g)),u=Math.min(...a,...l,...d);let h;if(s.getLineIndentColumn(t.startLineNumber)>=u+1)ml(r).scrollTop.read(o),h=r.getOffsetForColumn(t.startLineNumber,u+1);else if(n.length>0)h=wit(n[0].slice(0,u),r,s);else return{prefixTrim:0,prefixLeftOffset:0};return{prefixTrim:u,prefixLeftOffset:h}}function wit(e,t,n){const r=t.getOption(59).typicalHalfwidthCharacterWidth,o=n.getOptions().tabSize*r,s=e.split(" ").length-1;return(e.length-s)*r+s*o}function yit(e){const t=e.layoutInfoContentLeft,n=Wt({name:"editor.validOverlay.width"},o=>{const s=e.layoutInfoMinimap.read(o).minimapLeft!==0,a=e.layoutInfoWidth.read(o)-t.read(o);if(s){const l=e.layoutInfoMinimap.read(o).minimapWidth+e.layoutInfoVerticalScrollbarWidth.read(o);return a-l}return a}),r=Wt({name:"editor.validOverlay.height"},o=>e.layoutInfoHeight.read(o)+e.contentHeight.read(o));return Wt({name:"editor.validOverlay"},o=>Zs.fromLeftTopWidthHeight(t.read(o),0,n.read(o),r.read(o)))}function V5o(e,t){const n=[];for(const r of e){const o=t.mapRange(r.modifiedRange);n.push(new cg(r.originalRange,o))}return n}function oSe(...e){return e.filter(t=>typeof t=="string").join(" ")}function z5o(e,t){return new De(t.lineNumber,t.column+e.start,t.lineNumber,t.column+e.endExclusive)}function Z5o(e,t){let n=0;e:for(let r=0,o=e.length;rZ5o(r[a-1],n)),P1);return t.forEach(a=>{const l=Y5o(r[a-1],s,n);o.push(new Zc(z5o(new Jn(0,l),new tt(a,1)),""))}),new Yp(o)}class oze{constructor(){this._data=""}moveTo(t){return this._data+=`M ${t.x} ${t.y} `,this}lineTo(t){return this._data+=`L ${t.x} ${t.y} `,this}build(){return this._data}}function zy(e){const t=S6(void 0,(n,r)=>e.read(n)||r);return Gh({debugName:()=>`${e.debugName}.mapOutFalsy`},n=>{if(t.read(n),!!e.read(n))return t})}function jv(e,t=_d.ofCaller()){return{left:Wt({name:"editor.validOverlay.left"},n=>e(n).left,t),top:Wt({name:"editor.validOverlay.top"},n=>e(n).top,t),width:Wt({name:"editor.validOverlay.width"},n=>e(n).right-e(n).left,t),height:Wt({name:"editor.validOverlay.height"},n=>e(n).bottom-e(n).top,t)}}var q5o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},sSe=function(e,t){return function(n,r){t(n,r,e)}};let sze=class{constructor(t,n,r,o,s,a){this._model=t,this._close=n,this._editorObs=r,this._contextKeyService=o,this._keybindingService=s,this._commandService=a,this._inlineEditsShowCollapsed=this._editorObs.getOption(71).map(l=>l.edits.showCollapsed)}toDisposableLiveElement(){return this._createHoverContent().toDisposableLiveElement()}_createHoverContent(){const t=Bi("active",void 0),n=g=>({title:g.title,icon:g.icon,keybinding:typeof g.commandId=="string"?this._getKeybinding(g.commandArgs?void 0:g.commandId):Wt(this,k=>typeof g.commandId=="string"?void 0:this._getKeybinding(g.commandArgs?void 0:g.commandId.read(k)).read(k)),isActive:t.map(k=>k===g.id),onHoverChange:k=>t.set(k?g.id:void 0,void 0),onAction:()=>(this._close(!0),this._commandService.executeCommand(typeof g.commandId=="string"?g.commandId:g.commandId.get(),...g.commandArgs??[]))}),r=K5o(this._model.displayName),o=N7(n({id:"gotoAndAccept",title:`${j(1212,"Go To")} / ${j(1213,"Accept")}`,icon:Jt.check,commandId:see})),s=N7(n({id:"reject",title:j(1214,"Reject"),icon:Jt.close,commandId:wPn})),a=this._model.extensionCommands.map((g,k)=>N7(n({id:g.command.id+"_"+k,title:g.command.title,icon:g.icon??Jt.symbolEvent,commandId:g.command.id,commandArgs:g.command.arguments}))),l=this._inlineEditsShowCollapsed.map(g=>N7(n(g?{id:"showExpanded",title:j(1215,"Show Expanded"),icon:Jt.expandAll,commandId:wHe}:{id:"showCollapsed",title:j(1216,"Show Collapsed"),icon:Jt.collapseAll,commandId:wHe}))),d=N7(n({id:"snooze",title:j(1217,"Snooze"),icon:Jt.bellSlash,commandId:"editor.action.inlineSuggest.snooze"})),u=N7(n({id:"settings",title:j(1218,"Settings"),icon:Jt.gear,commandId:"workbench.action.openSettings",commandArgs:["@tag:nextEditSuggestions"]})),h=this._model.action?[this._model.action]:[],f=h.length>0?J5o(h.map(g=>({id:g.id,label:g.title+"...",enabled:!0,run:()=>this._commandService.executeCommand(g.id,...g.arguments??[]),class:void 0,tooltip:g.tooltip??g.title})),{hoverDelegate:c3o}):void 0;return G5o([r,o,s,l,a.length?Kxt():void 0,d,u,...a,f?Kxt():void 0,f])}_getKeybinding(t){return t?es(this._contextKeyService.onDidChangeContext,()=>this._keybindingService.lookupKeybinding(t)):ha(void 0)}};sze=q5o([sSe(3,Fi),sSe(4,Fo),sSe(5,Ca)],sze);function G5o(e){return ur.div({class:"content",style:{margin:4,minWidth:180}},e)}function K5o(e){return ur.div({class:"header",style:{color:sn(TDn),fontSize:"13px",fontWeight:"600",padding:"0 4px",lineHeight:28}},[e])}function N7(e){return Wt({name:"inlineEdits.option"},t=>{var n;return ur.div({class:["monaco-menu-option",(n=e.isActive)==null?void 0:n.map(r=>r&&"active")],onmouseenter:()=>{var r;return(r=e.onHoverChange)==null?void 0:r.call(e,!0)},onmouseleave:()=>{var r;return(r=e.onHoverChange)==null?void 0:r.call(e,!1)},onclick:e.onAction,onkeydown:r=>{var o;r.key==="Enter"&&((o=e.onAction)==null||o.call(e))},tabIndex:0,style:{borderRadius:3}},[ur.elem("span",{style:{fontSize:16,display:"flex"}},[mi.isThemeIcon(e.icon)?TO(e.icon):e.icon.map(r=>TO(r))]),ur.elem("span",{},[e.title]),ur.div({style:{marginLeft:"auto"},ref:r=>{const o=t.store.add(new LZ(r,x1,{disableTitle:!0,...pFn,keybindingLabelShadow:void 0,keybindingLabelForeground:sn(TDn),keybindingLabelBackground:"transparent",keybindingLabelBorder:"transparent",keybindingLabelBottomBorder:void 0}));t.store.add(xi(s=>{o.set(e.keybinding.read(s))}))}})])})}function J5o(e,t){return Wt({name:"inlineEdits.actionBar"},n=>ur.div({class:["action-widget-action-bar"],style:{padding:"3px 24px"}},[ur.div({ref:r=>{n.store.add(new bm(r,t)).push(e,{icon:!1,label:!0})}})]))}function Kxt(){return ur.div({id:"inline-edit-gutter-indicator-menu-separator",class:"menu-separator",style:{color:sn(Lfo),padding:"2px 0"}},ur.div({style:{borderBottom:`1px solid ${sn(rtt)}`}}))}var _5o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Tce=function(e,t){return function(n,r){t(n,r,e)}};let aze=class extends ct{get model(){const t=this._model.get();if(!t)throw new Ai("Inline Edit Model not available");return t}constructor(t,n,r,o,s,a,l,d,u,h){super(),this._editorObs=t,this._originalRange=n,this._verticalOffset=r,this._model=o,this._isHoveringOverInlineEdit=s,this._focusIsInMenu=a,this._hoverService=l,this._instantiationService=d,this._accessibilityService=u,this._tabAction=Wt(this,f=>{const g=this._model.read(f);return g?g.tabAction.read(f):LA.Inactive}),this._hoverVisible=Bi(this,!1),this.isHoverVisible=this._hoverVisible,this._isHoveredOverIcon=Bi(this,!1),this._isHoveredOverIconDebounced=TOt(this._isHoveredOverIcon,100),this.isHoveredOverIcon=this._isHoveredOverIconDebounced,this._isHoveredOverInlineEditDebounced=TOt(this._isHoveringOverInlineEdit,100),this._gutterIndicatorStyles=this._tabAction.map(this,(f,g)=>{switch(f){case LA.Inactive:return{background:kv(LRn,h).read(g).toString(),foreground:kv(I5o,h).read(g).toString(),border:kv(xRn,h).read(g).toString()};case LA.Jump:return{background:kv(CRn,h).read(g).toString(),foreground:kv(R5o,h).read(g).toString(),border:kv(WU,h).read(g).toString()};case LA.Accept:return{background:kv(TRn,h).read(g).toString(),foreground:kv(N5o,h).read(g).toString(),border:kv(SRn,h).read(g).toString()};default:Uie()}}),this._originalRangeObs=zy(this._originalRange),this._state=Wt(this,f=>{const g=this._originalRangeObs.read(f);if(g)return{range:g,lineOffsetRange:this._editorObs.observeLineOffsetRange(g,f.store)}}),this._stickyScrollController=k4.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?es(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):ha(0),this._lineNumberToRender=Wt(this,f=>{var A;if(this._verticalOffset.read(f)!==0)return"";const g=(A=this._originalRange.read(f))==null?void 0:A.startLineNumber,k=this._editorObs.getOption(76).read(f);if(g===void 0||k.renderType===0)return"";if(k.renderType===3){const m=this._editorObs.cursorPosition.read(f);return g%10===0||m&&m.lineNumber===g?g.toString():""}if(k.renderType===2){const m=this._editorObs.cursorPosition.read(f);if(!m)return"";const v=Math.abs(g-m.lineNumber);return v===0?g.toString():v.toString()}return k.renderType===4?k.renderFn?k.renderFn(g):"":g.toString()}),this._availableWidthForIcon=Wt(this,f=>{const g=this._editorObs.editor.getModel(),k=this._editorObs.editor,A=this._editorObs.layoutInfo.read(f),m=A.decorationsLeft+A.decorationsWidth-A.glyphMarginLeft;if(!g||m<=0)return()=>0;if(A.lineNumbersLeft===0)return()=>m;const v=this._editorObs.getOption(76).read(f);if(v.renderType===2||v.renderType===0)return()=>m;const p=k.getOption(59).typicalHalfwidthCharacterWidth,b=A.lineNumbersLeft+A.lineNumbersWidth,w=(g.getLineCount()+1).toString().length,y=[];for(let C=1;C<=w;C++){const x=10**(C-1),L=k.getTopForLineNumber(x),S=C*p,E=Math.min(m,Math.max(0,b-S-A.glyphMarginLeft));y.push({firstLineNumberWithDigitCount:x,topOfLineNumber:L,usableWidthLeftOfLineNumber:E})}return C=>{for(let x=y.length-1;x>=0;x--)if(C>=y[x].topOfLineNumber)return y[x].usableWidthLeftOfLineNumber;throw new Ai("Could not find avilable width for icon")}}),this._layout=Wt(this,f=>{const g=this._state.read(f);if(!g)return;const k=this._editorObs.layoutInfo.read(f),A=this._editorObs.observeLineHeightForLine(g.range.map(V=>V.startLineNumber)).read(f),m=2,v=k.decorationsLeft+k.decorationsWidth-k.glyphMarginLeft-2*m,p=k.height-2*m,b=Zs.fromLeftTopWidthHeight(m,m,v,p),O=b.withTop(this._stickyScrollHeight.read(f)),w=b.withTop(O.top+m),y=g.lineOffsetRange.read(f),C=Zs.fromRanges(Jn.fromTo(w.left,w.right),y),x=A,L=this._verticalOffset.read(f),S=C.withHeight(x).translateY(L),E=O.containsRect(S),Q=this._tabAction.map(V=>V===LA.Accept?Jt.keyboardTab:Jt.arrowRight),T=Wt(this,V=>{if(this._isHoveredOverIconDebounced.read(V)||this._isHoveredOverInlineEditDebounced.read(V))return Jt.check;if(this._tabAction.read(V)===LA.Accept)return Jt.keyboardTab;const Z=this._editorObs.cursorLineNumber.read(V)??0,K=g.range.read(V).startLineNumber;return Z<=K?Jt.keyboardTabAbove:Jt.keyboardTabBelow}),M=22,B=16,P=V=>{const Z=this._availableWidthForIcon.read(void 0)(V.bottom+this._editorObs.editor.getScrollTop())-m;return Math.max(Math.min(Z,M),B)};if(E){const V=S;let Z;k.lineNumbersWidth===0?Z=Math.min(Math.max(k.lineNumbersLeft-b.left,0),V.width-M):Z=Math.max(k.lineNumbersLeft+k.lineNumbersWidth-b.left,0);const K=V.withWidth(Z),X=Math.max(Math.min(k.decorationsWidth,M),B),ee=V.withWidth(X).translateX(Z);return{gutterEditArea:C,icon:T,iconDirection:"right",iconRect:ee,pillRect:V,lineNumberRect:K}}const F=b.intersect(C);if(F&&F.height>=x){const V=S.moveToBeContainedIn(w).moveToBeContainedIn(F),Z=V.withWidth(P(V));return{gutterEditArea:C,icon:T,iconDirection:"right",iconRect:Z,pillRect:Z}}const N=S.moveToBeContainedIn(b),I=N.withWidth(P(N)),W=I,H=I.top!!f),this._indicator=ur.div({class:"inline-edits-view-gutter-indicator",onclick:()=>{const f=this._layout.get(),g=(f==null?void 0:f.icon.get())===Jt.check;this._editorObs.editor.focus(),g?this.model.accept():this.model.jump()},tabIndex:0,style:{position:"absolute",overflow:"visible"}},zy(this._layout).map(f=>f?[ur.div({style:{position:"absolute",background:sn(U5o),borderRadius:"4px",...jv(g=>f.read(g).gutterEditArea)}}),ur.div({class:"icon",ref:this._iconRef,onmouseenter:()=>{this._showHover()},style:{cursor:"pointer",zIndex:"20",position:"absolute",backgroundColor:this._gutterIndicatorStyles.map(g=>g.background),"--vscodeIconForeground":this._gutterIndicatorStyles.map(g=>g.foreground),border:this._gutterIndicatorStyles.map(g=>`1px solid ${g.border}`),boxSizing:"border-box",borderRadius:"4px",display:"flex",justifyContent:"flex-end",transition:"background-color 0.2s ease-in-out, width 0.2s ease-in-out",...jv(g=>f.read(g).pillRect)}},[ur.div({className:"line-number",style:{lineHeight:f.map(g=>g.lineNumberRect?g.lineNumberRect.height:0),display:f.map(g=>g.lineNumberRect?"flex":"none"),alignItems:"center",justifyContent:"flex-end",width:f.map(g=>g.lineNumberRect?g.lineNumberRect.width:0),height:"100%",color:this._gutterIndicatorStyles.map(g=>g.foreground)}},this._lineNumberToRender),ur.div({style:{rotate:f.map(g=>`${$5o(g.iconDirection)}deg`),transition:"rotate 0.2s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",marginRight:f.map(g=>{var k;return g.pillRect.width-g.iconRect.width-(((k=g.lineNumberRect)==null?void 0:k.width)??0)}),width:f.map(g=>g.iconRect.width)}},[f.map((g,k)=>TO(g.icon.read(k)))])])]:[])).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._indicator.element,position:ha(null),allowEditorOverflow:!1,minContentWidthInPx:ha(0)})),this._register(this._editorObs.editor.onMouseMove(f=>{if(this._state.get()===void 0)return;const A=this._iconRef.element.getBoundingClientRect(),m=Zs.fromLeftTopWidthHeight(A.left,A.top,A.width,A.height),v=new mu(f.event.posx,f.event.posy);this._isHoveredOverIcon.set(m.containsPoint(v),void 0)})),this._register(this._editorObs.editor.onDidScrollChange(()=>{this._isHoveredOverIcon.set(!1,void 0)})),this._register(fO(this._isHoveredOverInlineEditDebounced,f=>{f&&this.triggerAnimation()})),this._register(xi(f=>{this._indicator.readEffect(f),this._indicator.element&&this._editorObs.editor.applyFontInfo(this._indicator.element)}))}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{outline:`2px solid ${this._gutterIndicatorStyles.map(n=>n.border).get()}`,outlineOffset:"-1px",offset:0},{outline:"2px solid transparent",outlineOffset:"10px",offset:1}],{duration:500}).finished}_showHover(){if(this._hoverVisible.get())return;const t=new Pt,n=t.add(this._instantiationService.createInstance(sze,this.model,s=>{s&&this._editorObs.editor.focus(),o==null||o.dispose()},this._editorObs).toDisposableLiveElement()),r=t.add(f2(n.element));t.add(r.onDidBlur(()=>this._focusIsInMenu.set(!1,void 0))),t.add(r.onDidFocus(()=>this._focusIsInMenu.set(!0,void 0))),t.add(Gn(()=>this._focusIsInMenu.set(!1,void 0)));const o=this._hoverService.showInstantHover({target:this._iconRef.element,content:n.element});o?(this._hoverVisible.set(!0,void 0),t.add(this._editorObs.editor.onDidScrollChange(()=>o.dispose())),t.add(o.onDispose(()=>{this._hoverVisible.set(!1,void 0),t.dispose()}))):t.dispose()}};aze=_5o([Tce(6,Lg),Tce(7,$n),Tce(8,xh),Tce(9,Il)],aze);function $5o(e){switch(e){case"top":return 90;case"bottom":return-90;case"right":return 0}}var eTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Jxt=function(e,t){return function(n,r){t(n,r,e)}},T0;(function(e){e.FirstTime="firstTime",e.SecondTime="secondTime",e.Active="active"})(T0||(T0={}));let lze=class extends ct{constructor(t,n,r,o,s,a){super(),this._host=t,this._model=n,this._indicator=r,this._collapsedView=o,this._storageService=s,this._configurationService=a,this._disposables=this._register(new is),this._setupDone=Bi({name:"setupDone"},!1),this._activeCompletionId=Wt(l=>{const d=this._model.read(l);if(!d||!this._setupDone.read(l))return;const u=this._indicator.read(l);if(!(!u||!u.isVisible.read(l)))return d.inlineEdit.inlineCompletion.identity.id}),this._register(this._initializeDebugSetting()),this._disposables.value=this.setupNewUserExperience(),this._setupDone.set(!0,void 0)}setupNewUserExperience(){if(this.getNewUserType()===T0.Active)return;const t=new Pt;let n=!1,r=!1,o=0,s=0;return t.add(q1o(this._activeCompletionId,async(a,l,d,u)=>{var f,g;if(a===void 0)return;let h=this.getNewUserType();switch(h){case T0.FirstTime:{(o++>=5||n)&&(h=T0.SecondTime,this.setNewUserType(h));break}case T0.SecondTime:{s++>=3&&r&&(h=T0.Active,this.setNewUserType(h));break}}switch(h){case T0.FirstTime:{for(let k=0;k<3&&!u.isCancellationRequested;k++)await((f=this._indicator.get())==null?void 0:f.triggerAnimation()),await My(500);break}case T0.SecondTime:{(g=this._indicator.get())==null||g.triggerAnimation();break}}})),t.add(xi(a=>{this._collapsedView.isVisible.read(a)&&this.getNewUserType()!==T0.Active&&this._collapsedView.triggerAnimation()})),t.add(PA((a,l)=>{const d=this._indicator.read(a);d&&l.add(fO(d.isHoveredOverIcon,async u=>{u&&(n=!0)}))})),t.add(PA((a,l)=>{const d=this._host.read(a);d&&l.add(d.onDidAccept(()=>{r=!0}))})),t}getNewUserType(){return this._storageService.get("inlineEditsGutterIndicatorUserKind",-1,T0.FirstTime)}setNewUserType(t){switch(t){case T0.FirstTime:throw new Ai("UserKind should not be set to first time");case T0.SecondTime:break;case T0.Active:this._disposables.clear();break}this._storageService.store("inlineEditsGutterIndicatorUserKind",t,-1,0)}_initializeDebugSetting(){const t="editor.inlineSuggest.edits.resetNewUserExperience";return this._configurationService.getValue(t)&&this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration(t)&&this._configurationService.getValue(t)&&(this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._disposables.value=this.setupNewUserExperience())})}};lze=eTo([Jxt(4,jf),Jxt(5,cr)],lze);var tTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},nTo=function(e,t){return function(n,r){t(n,r,e)}};let cze=class extends ct{constructor(t,n,r){super(),this._editor=t,this._edit=n,this._accessibilityService=r,this._onDidClick=this._register(new it),this.onDidClick=this._onDidClick.event,this._iconRef=ur.ref(),this.isHovered=ha(!1),this._editorObs=ml(this._editor);const s=this._edit.map(u=>(u==null?void 0:u.edit.replacements[0])??null).map(u=>u?ZL(u,this._editor.getModel()).range.getStartPosition():null),a=this._editorObs.observePosition(s,this._store),l=Wt(u=>{const h=a.read(u);if(!h)return null;const f=this._editorObs.layoutInfoContentLeft.read(u),g=this._editorObs.scrollLeft.read(u);return new mu(f+h.x-g,h.y)}),d=ur.div({class:"inline-edits-collapsed-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[[this.getCollapsedIndicator(l)]]).keepUpdated(this._store).element;this._register(this._editorObs.createOverlayWidget({domNode:d,position:ha(null),allowEditorOverflow:!1,minContentWidthInPx:ha(0)})),this.isVisible=this._edit.map((u,h)=>!!u&&l.read(h)!==null)}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{offset:0,transform:"translateY(-3px)"},{offset:.2,transform:"translateY(1px)"},{offset:.36,transform:"translateY(-1px)"},{offset:.52,transform:"translateY(1px)"},{offset:.68,transform:"translateY(-1px)"},{offset:.84,transform:"translateY(1px)"},{offset:1,transform:"translateY(0px)"}],{duration:2e3}).finished}getCollapsedIndicator(t){const n=this._editorObs.layoutInfoContentLeft,r=t.map((s,a)=>s?s.deltaX(-n.read(a)):null),o=this.createIconPath(r);return ur.svg({class:"collapsedView",ref:this._iconRef,style:{position:"absolute",...jv(s=>yit(this._editorObs).read(s)),overflow:"hidden",pointerEvents:"none"}},[ur.svgElem("path",{class:"collapsedViewPath",d:o,fill:sn(WU)})])}createIconPath(t){return t.map(s=>{if(!s)return new oze().build();const a=s.deltaX(-6/2).deltaY(-1),l=a.deltaX(6),d=a.deltaY(1),u=l.deltaY(1),h=d.deltaX(6/2).deltaY(3);return new oze().moveTo(a).lineTo(l).lineTo(u).lineTo(h).lineTo(d).lineTo(a).build()})}};cze=tTo([nTo(2,xh)],cze);var iTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},_xt=function(e,t){return function(n,r){t(n,r,e)}};const Ece=14,aSe=0,sx=4,Dce=4,$xt=2;let dze=class extends ct{constructor(t,n,r,o,s){super(),this._editor=t,this._languageService=s,this._onDidClick=this._register(new it),this.onDidClick=this._onDidClick.event,this._isHovered=Bi(this,!1),this.isHovered=this._isHovered,this._viewRef=ur.ref(),this._editorObs=ml(this._editor);const a=r.map((h,f)=>{let g;switch(h){case LA.Inactive:g=LRn;break;case LA.Jump:g=CRn;break;case LA.Accept:g=TRn;break}return{border:kv(g,o).read(f).toString(),background:sn(Tc)}}),l=n.map(h=>h?this.getState(h):void 0),d=l.map(h=>h?this.getRendering(h,a):void 0);this.minEditorScrollHeight=Wt(this,h=>{const f=l.read(h);return f?f.rect.read(h).bottom+this._editor.getScrollTop():0});const u=ur.div({class:"inline-edits-custom-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[d]).keepUpdated(this._store);this._register(this._editorObs.createOverlayWidget({domNode:u.element,position:ha(null),allowEditorOverflow:!1,minContentWidthInPx:S6(this,(h,f)=>{const g=l.read(h);if(!g)return f??0;const k=g.rect.map(A=>A.right).read(h)+this._editorObs.layoutInfoVerticalScrollbarWidth.read(h)+sx-this._editorObs.layoutInfoContentLeft.read(h);return Math.max(f??0,k)}).recomputeInitiallyAndOnChange(this._store)})),this._register(xi(h=>{if(!d.read(h)){this._isHovered.set(!1,void 0);return}this._isHovered.set(u.isHovered.read(h),void 0)}))}fitsInsideViewport(t,n,r){const o=this._editorObs.layoutInfoWidth.read(r),s=this._editorObs.layoutInfoContentLeft.read(r),a=this._editor.getLayoutInfo().verticalScrollbarWidth,l=this._editorObs.layoutInfoMinimap.read(r).minimapLeft!==0?this._editorObs.layoutInfoMinimap.read(r).minimapWidth:0,d=M5(this._editorObs,t,void 0),u=wit(n,this._editor,this._editor.getModel()),h=sx+Ece;return d+u+h{var b;const d=t.range.startLineNumber,u=t.range.endLineNumber,h=t.range.startColumn,f=t.range.endColumn,g=((b=this._editor.getModel())==null?void 0:b.getLineCount())??0,k=M5(this._editorObs,new Qi(d,d+1),l),A=d+1<=g?M5(this._editorObs,new Qi(d+1,d+2),l):void 0,m=d-1>=1?M5(this._editorObs,new Qi(d-1,d),l):void 0,v=this._editor.getOffsetForColumn(d,h),p=this._editor.getOffsetForColumn(u,f);return{lineWidth:k,lineWidthBelow:A,lineWidthAbove:m,startContentLeftOffset:v,endContentLeftOffset:p}}),r=t.range.startLineNumber,o=t.range.endLineNumber,s=this.fitsInsideViewport(new Qi(r,o+1),t.content,void 0);return{rect:Wt(this,l=>{const d=this._editorObs.getOption(59).read(l).typicalHalfwidthCharacterWidth,{lineWidth:u,lineWidthBelow:h,lineWidthAbove:f,startContentLeftOffset:g,endContentLeftOffset:k}=n.read(l),A=this._editorObs.layoutInfoContentLeft.read(l),m=this._editorObs.observeLineHeightForLine(r).recomputeInitiallyAndOnChange(l.store).read(l),v=this._editorObs.scrollTop.read(l),p=this._editorObs.scrollLeft.read(l);let b;r===o&&k+5*d>=u&&s?b="end":h!==void 0&&h+Ece-Dce-sxu.withMargin(0,sx));return ur.div({class:"collapsedView",ref:this._viewRef,style:{position:"absolute",...jv(u=>l.read(u)),overflow:"hidden",boxSizing:"border-box",cursor:"pointer",border:n.map(u=>`1px solid ${u.border}`),borderRadius:"4px",backgroundColor:n.map(u=>u.background),display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap"},onmousedown:u=>{u.preventDefault()},onclick:u=>{this._onDidClick.fire(new $h(oi(u),u))}},[r])}};dze=iTo([_xt(3,Il),_xt(4,lc)],dze);const rTo=0,oTo=0,lSe=1,sTo=1,aTo=3,cSe=4;class lTo extends ct{constructor(t,n,r,o){super(),this._editor=t,this._edit=n,this._uiState=r,this._tabAction=o,this._onDidClick=this._register(new it),this.onDidClick=this._onDidClick.event,this._display=Wt(this,l=>this._uiState.read(l)?"block":"none"),this._editorMaxContentWidthInRange=Wt(this,l=>{const d=this._originalDisplayRange.read(l);return d?(this._editorObs.versionId.read(l),S6(this,(u,h)=>{const f=M5(this._editorObs,d,u);return Math.max(f,h??0)})):ha(0)}).map((l,d)=>l.read(d)),this._maxPrefixTrim=Wt(this,l=>{const d=this._uiState.read(l);return d?Oit(d.deletions,d.originalRange,[],this._editor):{prefixTrim:0,prefixLeftOffset:0}}),this._editorLayoutInfo=Wt(this,l=>{const d=this._edit.read(l);if(!d||!this._uiState.read(l))return null;const h=this._editorObs.layoutInfo.read(l),f=this._editorObs.scrollLeft.read(l),g=this._editorObs.getOption(59).map(O=>O.typicalHalfwidthCharacterWidth).read(l),k=h.contentLeft+Math.max(this._editorMaxContentWidthInRange.read(l),g)-f,A=d.originalLineRange,m=this._originalVerticalStartPosition.read(l)??this._editor.getTopForLineNumber(A.startLineNumber)-this._editorObs.scrollTop.read(l),v=this._originalVerticalEndPosition.read(l)??this._editor.getTopForLineNumber(A.endLineNumberExclusive)-this._editorObs.scrollTop.read(l),p=h.contentLeft+this._maxPrefixTrim.read(l).prefixLeftOffset-f;return k<=p?null:{codeRect:Zs.fromLeftTopRightBottom(p,m,k,v).withMargin(oTo,rTo),contentLeft:h.contentLeft}}).recomputeInitiallyAndOnChange(this._store),this._originalOverlay=ur.div({style:{pointerEvents:"none"}},Wt(this,l=>{const d=zy(this._editorLayoutInfo).read(l);if(!d)return;const u=d.map(k=>Zs.fromLeftTopRightBottom(k.contentLeft-cSe-lSe,k.codeRect.top,k.contentLeft,k.codeRect.bottom)),h=Wt(this,k=>{const A=d.read(k).codeRect,m=u.read(k);return A.intersectHorizontal(new Jn(m.left,Number.MAX_SAFE_INTEGER))}),f=this._uiState.map(k=>k!=null&&k.inDiffEditor?aTo:sTo).read(l),g=h.map(k=>k.withMargin(f,f));return[ur.div({class:"originalSeparatorDeletion",style:{...g.read(l).toStyles(),borderRadius:`${cSe}px`,border:`${lSe+f}px solid ${sn(Tc)}`,boxSizing:"border-box"}}),ur.div({class:"originalOverlayDeletion",style:{...h.read(l).toStyles(),borderRadius:`${cSe}px`,border:s3e(this._tabAction).map(k=>`${lSe}px solid ${sn(k)}`),boxSizing:"border-box",backgroundColor:sn(sJ)}}),ur.div({class:"originalOverlayHiderDeletion",style:{...u.read(l).toStyles(),backgroundColor:sn(Tc)}})]})).keepUpdated(this._store),this._nonOverflowView=ur.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._originalOverlay]]).keepUpdated(this._store),this.isHovered=ha(!1),this._editorObs=ml(this._editor);const s=Wt(this,l=>{const d=this._edit.read(l);return d?new tt(d.originalLineRange.startLineNumber,1):null}),a=Wt(this,l=>{const d=this._edit.read(l);return d?new tt(d.originalLineRange.endLineNumberExclusive,1):null});this._originalDisplayRange=this._uiState.map(l=>l==null?void 0:l.originalRange),this._originalVerticalStartPosition=this._editorObs.observePosition(s,this._store).map(l=>l==null?void 0:l.y),this._originalVerticalEndPosition=this._editorObs.observePosition(a,this._store).map(l=>l==null?void 0:l.y),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:ha(null),allowEditorOverflow:!1,minContentWidthInPx:Wt(this,l=>{const d=this._editorLayoutInfo.read(l);return d===null?0:d.codeRect.width})}))}}var cTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},eLt=function(e,t){return function(n,r){t(n,r,e)}};const KX=1,dTo=1,uTo=3,dSe=4;let uze=class extends ct{constructor(t,n,r,o,s){super(),this._editor=t,this._input=n,this._tabAction=r,this._languageService=s,this._onDidClick=this._register(new it),this.onDidClick=this._onDidClick.event,this._state=Wt(this,a=>{const l=this._input.read(a);if(!l)return;const d=this._editor.getModel(),u=d.getEOL();if(l.startColumn===1&&l.lineNumber>1&&d.getLineLength(l.lineNumber)!==0&&l.text.endsWith(u)&&!l.text.startsWith(u)){const h=d.getLineLength(l.lineNumber-1)+1;return{lineNumber:l.lineNumber-1,column:h,text:u+l.text.slice(0,-u.length)}}return{lineNumber:l.lineNumber,column:l.startColumn,text:l.text}}),this._trimVertically=Wt(this,a=>{const l=this._state.read(a),d=l==null?void 0:l.text;if(!d||d.trim()==="")return{topOffset:0,bottomOffset:0,linesTop:0,linesBottom:0};const u=this._editor.getLineHeightForPosition(new tt(l.lineNumber,1)),h=this._editor.getModel().getEOL();let f=0,g=0,k=0;for(;kk&&d.endsWith(h,A);A-=h.length)g+=1;return{topOffset:f*u,bottomOffset:g*u,linesTop:f,linesBottom:g}}),this._maxPrefixTrim=Wt(this,a=>{const l=this._state.read(a);if(!l)return{prefixLeftOffset:0,prefixTrim:0};const d=this._editor.getModel(),u=d.getEOL(),h=this._trimVertically.read(a),f=l.text.split(u),g=f.slice(h.linesTop,f.length-h.linesBottom);h.linesTop===0&&(g[0]=d.getLineContent(l.lineNumber)+g[0]);const k=new Qi(l.lineNumber,l.lineNumber+(h.linesTop>0?0:1));return Oit([],k,g,this._editor)}),this._ghostText=Wt(a=>{const l=this._state.read(a),d=this._maxPrefixTrim.read(a);if(!l)return;const h=this._editor.getModel().getEOL(),g=l.text.split(h).map((k,A)=>new BB(new De(A+1,A===0?1:d.prefixTrim+1,A+1,k.length+1),"modified-background",0));return new bee(l.lineNumber,[new r0e(l.column,l.text,!1,g)])}),this._display=Wt(this,a=>this._state.read(a)?"block":"none"),this._editorMaxContentWidthInRange=Wt(this,a=>{const l=this._state.read(a);if(!l)return 0;this._editorObs.versionId.read(a);const d=this._editor.getModel(),u=d.getEOL(),h=l.text.startsWith(u)?"":d.getValueInRange(new De(l.lineNumber,1,l.lineNumber,l.column)),f=d.getValueInRange(new De(l.lineNumber,l.column,l.lineNumber,d.getLineLength(l.lineNumber)+1)),k=(h+l.text+f).split(u),A=g8.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0),m=k.map(v=>{var O;const p=(O=d.tokenization.tokenizeLinesAt(l.lineNumber,[v]))==null?void 0:O[0];let b;return p?b=d8.fromLineTokens(p).toLineTokens(v,this._languageService.languageIdCodec):b=kc.createEmpty(v,this._languageService.languageIdCodec),ure(new hre([b]),A,[],ln("div"),!0).minWidthInPx});return Math.max(...m)}),this.startLineOffset=this._trimVertically.map(a=>a.topOffset),this.originalLines=this._state.map(a=>a?new Qi(a.lineNumber,Math.min(a.lineNumber+2,this._editor.getModel().getLineCount()+1)):void 0),this._overlayLayout=Wt(this,a=>{this._ghostText.read(a);const l=this._state.read(a);if(!l)return null;this._editorObs.observePosition(Bi(this,new tt(l.lineNumber,l.column)),a.store).read(a);const d=this._editorObs.layoutInfo.read(a),u=this._editorObs.scrollLeft.read(a),h=this._editorObs.layoutInfoVerticalScrollbarWidth.read(a),f=d.contentLeft+this._editorMaxContentWidthInRange.read(a)-u,g=this._maxPrefixTrim.read(a).prefixLeftOffset??0,k=d.contentLeft+g-u;if(f<=k)return null;const{topOffset:A,bottomOffset:m}=this._trimVertically.read(a),v=this._editorObs.scrollTop.read(a),p=this._ghostTextView.height.read(a)-A-m,b=this._editor.getTopForLineNumber(l.lineNumber)-v+A,O=b+p,w=new Zs(k,b,f,O);return{overlay:w,startsAtContentLeft:g===0,contentLeft:d.contentLeft,minContentWidthRequired:g+w.width+h}}).recomputeInitiallyAndOnChange(this._store),this._modifiedOverlay=ur.div({style:{pointerEvents:"none"}},Wt(this,a=>{const l=zy(this._overlayLayout).read(a);if(!l)return;const d=l.map(g=>Zs.fromLeftTopRightBottom(g.contentLeft-dSe-KX,g.overlay.top,g.contentLeft,g.overlay.bottom)).read(a),u=this._input.map(g=>g!=null&&g.inDiffEditor?uTo:dTo).read(a),h=l.map(g=>g.overlay.withMargin(0,KX,0,g.startsAtContentLeft?0:KX).intersectHorizontal(new Jn(d.left,Number.MAX_SAFE_INTEGER))),f=h.map(g=>g.withMargin(u,u));return[ur.div({class:"originalUnderlayInsertion",style:{...f.read(a).toStyles(),borderRadius:dSe,border:`${KX+u}px solid ${sn(Tc)}`,boxSizing:"border-box"}}),ur.div({class:"originalOverlayInsertion",style:{...h.read(a).toStyles(),borderRadius:dSe,border:Cee(this._tabAction).map(g=>`${KX}px solid ${sn(g)}`),boxSizing:"border-box",backgroundColor:sn(yRn)}}),ur.div({class:"originalOverlayHiderInsertion",style:{...d.toStyles(),backgroundColor:sn(Tc)}})]})).keepUpdated(this._store),this._view=ur.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._modifiedOverlay]]).keepUpdated(this._store),this._editorObs=ml(this._editor),this._ghostTextView=this._register(o.createInstance(wee,this._editor,{ghostText:this._ghostText,minReservedLineCount:ha(0),targetTextModel:this._editorObs.model.map(a=>a??void 0),warning:ha(void 0),handleInlineCompletionShown:ha(()=>{})},Bi(this,{syntaxHighlightingEnabled:!0,extraClasses:["inline-edit"]}),!0,!0)),this.isHovered=this._ghostTextView.isHovered,this._register(this._ghostTextView.onDidClick(a=>{this._onDidClick.fire(a)})),this._register(this._editorObs.createOverlayWidget({domNode:this._view.element,position:ha(null),allowEditorOverflow:!1,minContentWidthInPx:Wt(this,a=>{const l=this._overlayLayout.read(a);return l===null?0:l.minContentWidthRequired})}))}};uze=cTo([eLt(3,$n),eLt(4,lc)],uze);var hTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},tLt=function(e,t){return function(n,r){t(n,r,e)}};let hze=class extends ct{constructor(t,n,r,o,s,a){super(),this._editor=t,this._edit=n,this._isInDiffEditor=r,this._tabAction=o,this._languageService=s,this._themeService=a,this._onDidClick=this._register(new it),this.onDidClick=this._onDidClick.event,this._maxPrefixTrim=this._edit.map((l,d)=>l?Oit(l.replacements.flatMap(u=>[u.originalRange,u.modifiedRange]),l.originalRange,l.modifiedLines,this._editor.editor,d):void 0),this._modifiedLineElements=Wt(this,l=>{var v;const d=[];let u=0;const h=this._maxPrefixTrim.read(l),f=this._edit.read(l);if(!f||!h)return;const g=h.prefixTrim,k=ATo(f.replacements.map(p=>p.modifiedRange)).map(p=>new De(p.startLineNumber,p.startColumn-g,p.endLineNumber,p.endColumn-g)),A=this._editor.model.get(),m=f.modifiedRange.startLineNumber;for(let p=0;pE.startLineNumber===O)){const E=Math.min(S.endColumn,w.length+1);x.push(new BB(new De(1,S.startColumn,1,E),"inlineCompletions-modified-bubble",0))}const L=ure(new hre([C]),g8.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),x,b,!0);this._editor.getOption(59).read(l),u=Math.max(u,L.minWidthInPx),d.push(b)}return{lines:d,requiredWidth:u}}),this._layout=Wt(this,l=>{const d=this._modifiedLineElements.read(l),u=this._maxPrefixTrim.read(l),h=this._edit.read(l);if(!d||!u||!h)return;const{prefixLeftOffset:f}=u,{requiredWidth:g}=d,k=this._editor.observeLineHeightsForLineRange(h.originalRange).read(l),A=(()=>{const F=k.slice(0,h.modifiedRange.length);for(;F.lengththis._editor.editor.getOffsetForColumn(F,w.getLineMaxColumn(F))-f),C=Math.max(...y,g),x=h.originalRange.startLineNumber,L=h.originalRange.endLineNumberExclusive-1,S=this._editor.editor.getTopForLineNumber(x)-b,E=this._editor.editor.getBottomForLineNumber(L)-b,Q=Zs.fromLeftTopWidthHeight(O+f,S,C,E-S),T=Zs.fromLeftTopWidthHeight(Q.left,Q.bottom,Q.width,A.reduce((F,R)=>F+R,0)),M=Zs.hull([Q,T]),B=M.intersectVertical(new Jn(Q.bottom,Number.MAX_SAFE_INTEGER)),P=new Zs(B.left,B.top,B.right,B.bottom);return{originalLinesOverlay:Q,modifiedLinesOverlay:T,background:M,lowerBackground:B,lowerText:P,modifiedLineHeights:A,minContentWidthRequired:f+C+v}}),this._viewZoneInfo=Wt(l=>{if(!this._editor.getOption(71).map(k=>k.edits.allowCodeShifting==="always").read(l))return;const u=this._layout.read(l),h=this._edit.read(l);if(!u||!h)return;const f=u.lowerBackground.height,g=h.originalRange.endLineNumberExclusive;return{height:f,lineNumber:g}}),this.minEditorScrollHeight=Wt(this,l=>{const d=zy(this._layout).read(l);return!d||this._viewZoneInfo.read(l)!==void 0?0:d.read(l).lowerText.bottom+this._editor.editor.getScrollTop()}),this._div=ur.div({class:"line-replacement"},[Wt(this,l=>{const d=zy(this._layout).read(l),u=this._modifiedLineElements.read(l);if(!d||!u)return[];const h=d.read(l),f=this._editor.layoutInfoContentLeft.read(l),g=this._isInDiffEditor.read(l)?3:1;u.lines.forEach((m,v)=>{m.style.width=`${h.lowerText.width}px`,m.style.height=`${h.modifiedLineHeights[v]}px`,m.style.position="relative"});const k=Cee(this._tabAction).read(l),A=s3e(this._tabAction).read(l);return[ur.div({style:{position:"absolute",...jv(m=>yit(this._editor).read(m)),overflow:"hidden",pointerEvents:"none"}},[ur.div({class:"borderAroundLineReplacement",style:{position:"absolute",...jv(m=>d.read(m).background.translateX(-f).withMargin(g)),borderRadius:"4px",border:`${g+1}px solid ${sn(Tc)}`,boxSizing:"border-box",pointerEvents:"none"}}),ur.div({class:"originalOverlayLineReplacement",style:{position:"absolute",...jv(m=>d.read(m).background.translateX(-f)),borderRadius:"4px",border:kv(A,this._themeService).map(m=>`1px solid ${m.toString()}`),pointerEvents:"none",boxSizing:"border-box",background:sn(sJ)}}),ur.div({class:"modifiedOverlayLineReplacement",style:{position:"absolute",...jv(m=>d.read(m).lowerBackground.translateX(-f)),borderRadius:"0 0 4px 4px",background:sn(Tc),boxShadow:`${sn(cOe)} 0 6px 6px -6px`,border:`1px solid ${sn(k)}`,boxSizing:"border-box",overflow:"hidden",cursor:"pointer",pointerEvents:"auto"},onmousedown:m=>{m.preventDefault()},onclick:m=>this._onDidClick.fire(new $h(oi(m),m))},[ur.div({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:sn(P5o)}})]),ur.div({class:"modifiedLinesLineReplacement",style:{position:"absolute",boxSizing:"border-box",...jv(m=>d.read(m).lowerText.translateX(-f)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",whiteSpace:"nowrap",borderRadius:"0 0 4px 4px",overflow:"hidden"}},[...u.lines])])]})]).keepUpdated(this._store),this.isHovered=this._editor.isTargetHovered(l=>this._isMouseOverWidget(l),this._store),this._previousViewZoneInfo=void 0,this._register(Gn(()=>this._editor.editor.changeViewZones(l=>this.removePreviousViewZone(l)))),this._register(zlo(this._viewZoneInfo,({lastValue:l,newValue:d})=>{l===d||(l==null?void 0:l.height)===(d==null?void 0:d.height)&&(l==null?void 0:l.lineNumber)===(d==null?void 0:d.lineNumber)||this._editor.editor.changeViewZones(u=>{this.removePreviousViewZone(u),d&&this.addViewZone(d,u)})})),this._register(this._editor.createOverlayWidget({domNode:this._div.element,minContentWidthInPx:Wt(this,l=>{var d;return((d=this._layout.read(l))==null?void 0:d.minContentWidthRequired)??0}),position:ha({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}_isMouseOverWidget(t){const n=this._layout.get();return!n||!(t.event instanceof J8)?!1:n.lowerBackground.containsPoint(new mu(t.event.relativePos.x,t.event.relativePos.y))}removePreviousViewZone(t){if(!this._previousViewZoneInfo)return;t.removeZone(this._previousViewZoneInfo.id);const n=this._editor.cursorLineNumber.get();n!==null&&n>=this._previousViewZoneInfo.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()-this._previousViewZoneInfo.height),this._previousViewZoneInfo=void 0}addViewZone(t,n){const r=n.addZone({afterLineNumber:t.lineNumber-1,heightInPx:t.height,domNode:ln("div")});this._previousViewZoneInfo={height:t.height,lineNumber:t.lineNumber,id:r};const o=this._editor.cursorLineNumber.get();o!==null&&o>=t.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()+t.height)}};hze=hTo([tLt(4,lc),tLt(5,Il)],hze);function ATo(e){const t=[];for(;e.length;){let n=e.shift();n.startLineNumber!==n.endLineNumber&&(e.push(new De(n.startLineNumber+1,1,n.endLineNumber,n.endColumn)),n=new De(n.startLineNumber,n.startColumn,n.startLineNumber,Number.MAX_SAFE_INTEGER)),t.push(n)}return t}var fTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},nLt=function(e,t){return function(n,r){t(n,r,e)}};const $I=0,JX=0,$4=1,gTo=1,mTo=3,ax=4,uSe=20,iLt=12;let g0e=class extends ct{static fitsInsideViewport(t,n,r,o){const s=ml(t),a=s.layoutInfoWidth.read(o),l=s.layoutInfoContentLeft.read(o),d=t.getLayoutInfo().verticalScrollbarWidth,u=s.layoutInfoMinimap.read(o).minimapLeft!==0?s.layoutInfoMinimap.read(o).minimapWidth:0,h=M5(s,r.displayRange,void 0),f=r.lineEdit.newLines.reduce((A,m)=>Math.max(A,wit(m,t,n)),0),g=uSe,k=iLt+2*$4;return h+f+g+kthis._uiState.read(u)?"block":"none"),this.previewRef=ur.ref();const d=this._uiState.map(u=>u!=null&&u.isInDiffEditor?mTo:gTo);this._editorContainer=ur.div({class:["editorContainer"],style:{position:"absolute",overflow:"hidden",cursor:"pointer"},onmousedown:u=>{u.preventDefault()},onclick:u=>{this._onDidClick.fire(new $h(oi(u),u))}},[ur.div({class:"preview",style:{pointerEvents:"none"},ref:this.previewRef})]).keepUpdated(this._store),this.isHovered=this._editorContainer.didMouseMoveDuringHover,this.previewEditor=this._register(this._instantiationService.createInstance(r6,this.previewRef.element,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},rulers:[],padding:{top:0,bottom:0},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,revealHorizontalRightPadding:0,bracketPairColorization:{enabled:!0,independentColorPoolPerBracketType:!1},scrollBeyondLastLine:!1,scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off"},{contextKeyValues:{[Ws.inInlineEditsPreviewEditor.key]:!0},contributions:[]},this._editor)),this._previewEditorObs=ml(this.previewEditor),this._activeViewZones=[],this._updatePreviewEditor=Wt(this,u=>{this._editorContainer.readEffect(u),this._previewEditorObs.model.read(u),this._display.read(u),this._nonOverflowView&&(this._nonOverflowView.element.style.display=this._display.read(u));const h=this._uiState.read(u),f=this._edit.read(u);if(!h||!f)return;const g=f.originalLineRange,k=[];g.startLineNumber>1&&k.push(new De(1,1,g.startLineNumber-1,1)),g.startLineNumber+h.newTextLineCount{A.forEach(p=>v.removeZone(p)),m>0&&this._activeViewZones.push(v.addZone({afterLineNumber:g.startLineNumber+h.newTextLineCount-1,heightInLines:m,showInHiddenAreas:!0,domNode:ln("div.diagonal-fill.inline-edits-view-zone")}))})}),this._previewEditorWidth=Wt(this,u=>{const h=this._edit.read(u);return h?(this._updatePreviewEditor.read(u),M5(this._previewEditorObs,h.modifiedLineRange,u)):0}),this._cursorPosIfTouchesEdit=Wt(this,u=>{const h=this._editorObs.cursorPosition.read(u),f=this._edit.read(u);if(!(!f||!h))return f.modifiedLineRange.contains(h.lineNumber)?h:void 0}),this._originalStartPosition=Wt(this,u=>{const h=this._edit.read(u);return h?new tt(h.originalLineRange.startLineNumber,1):null}),this._originalEndPosition=Wt(this,u=>{const h=this._edit.read(u);return h?new tt(h.originalLineRange.endLineNumberExclusive,1):null}),this._originalVerticalStartPosition=this._editorObs.observePosition(this._originalStartPosition,this._store).map(u=>u==null?void 0:u.y),this._originalVerticalEndPosition=this._editorObs.observePosition(this._originalEndPosition,this._store).map(u=>u==null?void 0:u.y),this._originalDisplayRange=this._edit.map(u=>u==null?void 0:u.displayRange),this._editorMaxContentWidthInRange=Wt(this,u=>{const h=this._originalDisplayRange.read(u);return h?(this._editorObs.versionId.read(u),S6(this,(f,g)=>{const k=M5(this._editorObs,h,f);return Math.max(k,g??0)})):ha(0)}).map((u,h)=>u.read(h)),this._previewEditorLayoutInfo=Wt(this,u=>{const h=this._edit.read(u);if(!h||!this._uiState.read(u))return null;const g=h.originalLineRange,k=this._editorObs.scrollLeft.read(u),A=this._editorMaxContentWidthInRange.read(u),m=this._editorObs.layoutInfo.read(u),v=this._previewEditorWidth.read(u),p=m.contentWidth-m.verticalScrollbarWidth,b=this._editor.getContainerDomNode().getBoundingClientRect(),O=m.contentLeft+m.contentWidth+b.left,w=oi(this._editor.getContainerDomNode()).innerWidth-O,y=oi(this._editor.getContainerDomNode()).innerWidth-b.right,C=Math.min(m.contentWidth*.3,v,100),x=0,L=x+w,S=this._cursorPosIfTouchesEdit.read(u),E=Math.max(p+k-x-Math.max(0,C-L),Math.min(S?H5o(this._editorObs,S,u)+50:0,p+k)),Q=Math.min(A+uSe,E),T=A+uSe+v+70,M=E-Q;let B,P;Q>k?(B=0,P=m.contentLeft+Q-k):(B=k-Q,P=m.contentLeft);const F=this._originalVerticalStartPosition.read(u)??this._editor.getTopForLineNumber(g.startLineNumber)-this._editorObs.scrollTop.read(u),R=this._originalVerticalEndPosition.read(u)??this._editor.getBottomForLineNumber(g.endLineNumberExclusive-1)-this._editorObs.scrollTop.read(u),N=m.contentLeft-k;let I=Zs.fromLeftTopRightBottom(N,F,P,R);const W=I.height===0;W||(I=I.withMargin(JX,$I));const V=this._previewEditorObs.observeLineHeightsForLineRange(h.modifiedLineRange).read(u).reduce((oe,de)=>oe+de,0),Z=R-F,K=Math.max(Z,V),X=M===0,ee=0,q=Math.min(v+iLt,y+m.width-m.contentLeft-ee);let $=Zs.fromLeftTopWidthHeight(I.right+ee,F,q,K);return W?$=$.withMargin(JX,$I).translateY(JX):$=$.withMargin(JX,$I).translateX($I+$4),{codeRect:I,editRect:$,codeScrollLeft:k,contentLeft:m.contentLeft,isInsertion:W,maxContentWidth:T,shouldShowShadow:X,desiredPreviewEditorScrollLeft:B,previewEditorWidth:q}}),this._stickyScrollController=k4.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?es(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):ha(0),this._shouldOverflow=Wt(this,u=>!1),this._originalBackgroundColor=es(this,this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme().getColor(sJ)??Ut.transparent),this._backgroundSvg=ur.svg({transform:"translate(-0.5 -0.5)",style:{overflow:"visible",pointerEvents:"none",position:"absolute"}},[ur.svgElem("path",{class:"rightOfModifiedBackgroundCoverUp",d:Wt(this,u=>{const h=this._previewEditorLayoutInfo.read(u);if(!(!h||this._originalBackgroundColor.read(u).isTransparent()))return new oze().moveTo(h.codeRect.getRightTop()).lineTo(h.codeRect.getRightTop().deltaX(1e3)).lineTo(h.codeRect.getRightBottom().deltaX(1e3)).lineTo(h.codeRect.getRightBottom()).build()}),style:{fill:CDn(Tc,"transparent")}})]).keepUpdated(this._store),this._originalOverlay=ur.div({style:{pointerEvents:"none",display:this._previewEditorLayoutInfo.map(u=>u!=null&&u.isInsertion?"none":"block")}},Wt(this,u=>{const h=zy(this._previewEditorLayoutInfo).read(u);if(!h)return;const f=d.read(u),g=s3e(this._tabAction).map(C=>`${$4}px solid ${sn(C)}`),k=`${$4+f}px solid ${sn(Tc)}`,A=h.read(u).codeScrollLeft!==0,m=h.map(C=>C.codeRect.bottomZs.fromLeftTopRightBottom(C.contentLeft-ax-$4,C.codeRect.top,C.contentLeft,C.codeRect.bottom+v)).read(u),b=new Jn(p.left,Number.MAX_SAFE_INTEGER),O=h.map(C=>C.codeRect.intersectHorizontal(b)),w=O.map(C=>C.withMargin(f,0,f,f).intersectHorizontal(b)),y=O.map(C=>Zs.fromLeftTopWidthHeight(C.right-v+$4,C.bottom-$4,v,v).intersectHorizontal(b));return[ur.div({class:"originalSeparatorSideBySide",style:{...w.read(u).toStyles(),boxSizing:"border-box",borderRadius:`${ax}px 0 0 ${ax}px`,borderTop:k,borderBottom:k,borderLeft:A?"none":k}}),ur.div({class:"originalOverlaySideBySide",style:{...O.read(u).toStyles(),boxSizing:"border-box",borderRadius:`${ax}px 0 0 ${ax}px`,borderTop:g,borderBottom:g,borderLeft:A?"none":g,backgroundColor:sn(sJ)}}),ur.div({class:"originalCornerCutoutSideBySide",style:{pointerEvents:"none",display:m.map(C=>C?"block":"none"),...y.read(u).toStyles()}},[ur.div({class:"originalCornerCutoutBackground",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",backgroundColor:kv(sJ,this._themeService).map(C=>C.toString())}}),ur.div({class:"originalCornerCutoutBorder",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box",borderTop:g,borderRight:g,borderRadius:"0 100% 0 0",backgroundColor:sn(Tc)}})]),ur.div({class:"originalOverlaySideBySideHider",style:{...p.toStyles(),backgroundColor:sn(Tc)}})]})).keepUpdated(this._store),this._modifiedOverlay=ur.div({style:{pointerEvents:"none"}},Wt(this,u=>{const h=zy(this._previewEditorLayoutInfo).read(u);if(!h)return;const f=h.map(O=>O.codeRect.bottom`0 ${ax}px ${ax}px ${O?ax:0}px`),A=kv(Cee(this._tabAction),this._themeService).map(O=>`1px solid ${O.toString()}`),m=`${$4+g}px solid ${sn(Tc)}`,v=h.map(O=>O.editRect.withMargin(0,$4)),p=v.map(O=>O.withMargin(g,g,g,0)),b=Wt(this,O=>{const w=v.read(O),y=h.read(O);return!y.isInsertion||y.contentLeft>=w.left?Zs.fromLeftTopWidthHeight(w.left,w.top,0,0):new Zs(y.contentLeft,w.top,w.left,w.top+$4*2)});return[ur.div({class:"modifiedInsertionSideBySide",style:{...b.read(u).toStyles(),backgroundColor:Cee(this._tabAction).map(O=>sn(O))}}),ur.div({class:"modifiedSeparatorSideBySide",style:{...p.read(u).toStyles(),borderRadius:k,borderTop:m,borderBottom:m,borderRight:m,boxSizing:"border-box"}}),ur.div({class:"modifiedOverlaySideBySide",style:{...v.read(u).toStyles(),borderRadius:k,border:A,boxSizing:"border-box",backgroundColor:sn(yRn)}})]})).keepUpdated(this._store),this._nonOverflowView=ur.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[this._backgroundSvg,Wt(this,u=>this._shouldOverflow.read(u)?[]:[this._editorContainer,this._originalOverlay,this._modifiedOverlay])]).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:ha(null),allowEditorOverflow:!1,minContentWidthInPx:Wt(this,u=>{var f;const h=(f=this._previewEditorLayoutInfo.read(u))==null?void 0:f.maxContentWidth;return h===void 0?0:h})})),this.previewEditor.setModel(this._previewTextModel),this._register(xi(u=>{const h=this._previewEditorLayoutInfo.read(u);if(!h)return;const f=h.editRect.withMargin(-JX,-$I);this.previewEditor.layout({height:f.height,width:h.previewEditorWidth+15}),this._editorContainer.element.style.top=`${f.top}px`,this._editorContainer.element.style.left=`${f.left}px`,this._editorContainer.element.style.width=`${h.previewEditorWidth+$I}px`})),this._register(xi(u=>{const h=this._previewEditorLayoutInfo.read(u);h&&this._previewEditorObs.editor.setScrollLeft(h.desiredPreviewEditorScrollLeft)})),this._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store)}};g0e=fTo([nLt(5,$n),nLt(6,Il)],g0e);var kTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},vTo=function(e,t){return function(n,r){t(n,r,e)}};const lx=1;var uH;let HU=(uH=class extends ct{constructor(t,n,r,o){super(),this._editor=t,this._edit=n,this._tabAction=r,this._languageService=o,this._onDidClick=this._register(new it),this.onDidClick=this._onDidClick.event,this._start=this._editor.observePosition(ha(this._edit.range.getStartPosition()),this._store),this._end=this._editor.observePosition(ha(this._edit.range.getEndPosition()),this._store),this._line=document.createElement("div"),this._hoverableElement=Bi(this,null),this.isHovered=this._hoverableElement.map((a,l)=>(a==null?void 0:a.didMouseMoveDuringHover.read(l))??!1),this._renderTextEffect=Wt(this,a=>{var A;const l=this._editor.model.get(),d=l.getLineContent(this._edit.range.startLineNumber),u=fh.replace(new Jn(this._edit.range.startColumn-1,this._edit.range.endColumn-1),this._edit.text),h=u.replace(d),f=(A=l.tokenization.tokenizeLinesAt(this._edit.range.startLineNumber,[h]))==null?void 0:A[0];let g;f?g=d8.fromLineTokens(f).slice(u.getRangeAfterReplace()).toLineTokens(this._edit.text,this._languageService.languageIdCodec):g=kc.createEmpty(this._edit.text,this._languageService.languageIdCodec);const k=ure(new hre([g]),g8.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),[],this._line,!0);this._line.style.width=`${k.minWidthInPx}px`});const s=this._editor.observeLineHeightForPosition(this._edit.range.getStartPosition());this._layout=Wt(this,a=>{this._renderTextEffect.read(a);const l=this._start.read(a),d=this._end.read(a);if(!l||!d||l.x>d.x||l.y>d.y)return;const u=s.read(a),h=this._editor.scrollLeft.read(a),f=this._editor.getOption(59).read(a).typicalHalfwidthCharacterWidth,g=3*f,k=4,A=new mu(g,k),m=Zs.fromPoints(l,d).withHeight(u).translateX(-h),v=Zs.fromPointSize(m.getLeftBottom().add(A),new mu(this._edit.text.length*f,m.height)),p=v.withLeft(m.left);return{originalLine:m,modifiedLine:v,lowerBackground:p,lineHeight:u}}),this.minEditorScrollHeight=Wt(this,a=>{const l=zy(this._layout).read(a);return l?l.read(a).modifiedLine.bottom+lx+this._editor.editor.getScrollTop():0}),this._root=ur.div({class:"word-replacement"},[Wt(this,a=>{const l=zy(this._layout).read(a);if(!l)return[];const d=s3e(this._tabAction).map(h=>sn(h)).read(a),u=Cee(this._tabAction).map(h=>sn(h)).read(a);return[ur.div({style:{position:"absolute",...jv(h=>yit(this._editor).read(h)),overflow:"hidden",pointerEvents:"none"}},[ur.div({style:{position:"absolute",...jv(h=>l.read(h).lowerBackground.withMargin(lx,2*lx,lx,0)),background:sn(Tc),cursor:"pointer",pointerEvents:"auto"},onmousedown:h=>{h.preventDefault()},onmouseup:h=>this._onDidClick.fire(new $h(oi(h),h)),obsRef:h=>{this._hoverableElement.set(h,void 0)}}),ur.div({style:{position:"absolute",...jv(h=>l.read(h).modifiedLine.withMargin(lx,2*lx)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",boxSizing:"border-box",borderRadius:"4px",border:`${lx}px solid ${u}`,background:sn(M5o),display:"flex",justifyContent:"center",alignItems:"center",outline:`2px solid ${sn(Tc)}`}},[this._line]),ur.div({style:{position:"absolute",...jv(h=>l.read(h).originalLine.withMargin(lx)),boxSizing:"border-box",borderRadius:"4px",border:`${lx}px solid ${d}`,background:sn(F5o),pointerEvents:"none"}},[]),ur.svg({width:11,height:14,viewBox:"0 0 11 14",fill:"none",style:{position:"absolute",left:l.map(h=>h.modifiedLine.left-16),top:l.map(h=>h.modifiedLine.top+Math.round((h.lineHeight-14-5)/2))}},[ur.svgElem("path",{d:"M1 0C1 2.98966 1 5.92087 1 8.49952C1 9.60409 1.89543 10.5 3 10.5H10.5",stroke:sn(m3t)}),ur.svgElem("path",{d:"M6 7.5L9.99999 10.49998L6 13.5",stroke:sn(m3t)})])])]})]).keepUpdated(this._store),this._register(this._editor.createOverlayWidget({domNode:this._root.element,minContentWidthInPx:ha(0),position:ha({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}},uH.MAX_LENGTH=100,uH);HU=kTo([vTo(3,lc)],HU);class pTo extends ct{constructor(t,n,r){super(),this._originalEditor=t,this._state=n,this._modifiedTextModel=r,this._onDidClick=this._register(new it),this.onDidClick=this._onDidClick.event,this.isHovered=ml(this._originalEditor).isTargetHovered(s=>{var a;return s.target.type===6&&((a=s.target.detail.injectedText)==null?void 0:a.options.attachedData)instanceof hSe&&s.target.detail.injectedText.options.attachedData.owner===this},this._store),this._tokenizationFinished=wTo(this._modifiedTextModel),this._decorations=Wt(this,s=>{var C,x;const a=this._state.read(s);if(!a)return;const l=a.modifiedText,d=a.mode==="insertionInline",u=a.diff.length===1&&((C=a.diff[0].innerChanges)==null?void 0:C.length)===1,h=!0,f=[],g=[],k=Ki.register({className:"inlineCompletions-line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),A=Ki.register({className:"inlineCompletions-line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),m=Ki.register({className:"inlineCompletions-char-delete",description:"char-delete",isWholeLine:!1,zIndex:1}),v=Ki.register({className:"inlineCompletions-char-insert",description:"char-insert",isWholeLine:!0}),p=Ki.register({className:"inlineCompletions-char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),b=Ki.register({className:"inlineCompletions-char-insert diff-range-empty",description:"char-insert diff-range-empty"}),O=Ki.register({className:"inlineCompletions-original-lines",description:"inlineCompletions-original-lines",isWholeLine:!1,shouldFillLineOnLineBreak:!0}),w=a.mode!=="sideBySide"&&a.mode!=="deletion"&&a.mode!=="insertionInline"&&a.mode!=="lineReplacement",y=a.mode==="lineReplacement";for(const L of a.diff)if(w&&(L.original.isEmpty||f.push({range:L.original.toInclusiveRange(),options:A}),L.modified.isEmpty||g.push({range:L.modified.toInclusiveRange(),options:k})),L.modified.isEmpty||L.original.isEmpty)L.original.isEmpty||f.push({range:L.original.toInclusiveRange(),options:m}),L.modified.isEmpty||g.push({range:L.modified.toInclusiveRange(),options:v});else{const S=d&&bTo(L);for(const E of L.innerChanges||[]){if(L.original.contains(E.originalRange.startLineNumber)&&!(y&&E.originalRange.isEmpty())){const Q=(x=this._originalEditor.getModel())==null?void 0:x.getValueInRange(E.originalRange,1);f.push({range:E.originalRange,options:{description:"char-delete",shouldFillLineOnLineBreak:!1,className:oSe("inlineCompletions-char-delete",E.originalRange.isSingleLine()&&a.mode==="insertionInline"&&"single-line-inline",E.originalRange.isEmpty()&&"empty",(E.originalRange.isEmpty()&&u||a.mode==="deletion"&&Q===` `)&&h&&!S&&"diff-range-empty"),inlineClassName:S?oSe("strike-through","inlineCompletions"):null,zIndex:1}})}if(L.modified.contains(E.modifiedRange.startLineNumber)&&g.push({range:E.modifiedRange,options:E.modifiedRange.isEmpty()&&h&&!S&&u?b:p}),S){const Q=l.getValueOfRange(E.modifiedRange),T=Q.length>3?[{text:Q.slice(0,1),extraClasses:["start"],offsetRange:new Jn(E.modifiedRange.startColumn-1,E.modifiedRange.startColumn)},{text:Q.slice(1,-1),extraClasses:[],offsetRange:new Jn(E.modifiedRange.startColumn,E.modifiedRange.endColumn-2)},{text:Q.slice(-1),extraClasses:["end"],offsetRange:new Jn(E.modifiedRange.endColumn-2,E.modifiedRange.endColumn-1)}]:[{text:Q,extraClasses:["start","end"],offsetRange:new Jn(E.modifiedRange.startColumn-1,E.modifiedRange.endColumn)}];this._tokenizationFinished.read(s);const M=this._modifiedTextModel.tokenization.getLineTokens(E.modifiedRange.startLineNumber);for(const{text:B,extraClasses:P,offsetRange:F}of T)f.push({range:De.fromPositions(E.originalRange.getEndPosition()),options:{description:"inserted-text",before:{tokens:M.getTokensInRange(F),content:B,inlineClassName:oSe("inlineCompletions-char-insert",E.modifiedRange.isSingleLine()&&a.mode==="insertionInline"&&"single-line-inline",...P),cursorStops:Rv.None,attachedData:new hSe(this)},zIndex:2,showIfCollapsed:!0}})}}}if(a.isInDiffEditor)for(const L of a.diff)L.original.isEmpty||f.push({range:L.original.toExclusiveRange(),options:O});return{originalDecorations:f,modifiedDecorations:g}}),this._register(ml(this._originalEditor).setDecorations(this._decorations.map(s=>(s==null?void 0:s.originalDecorations)??[])));const o=this._state.map(s=>s==null?void 0:s.modifiedCodeEditor);this._register(PA((s,a)=>{const l=o.read(s);l&&a.add(ml(l).setDecorations(this._decorations.map(d=>(d==null?void 0:d.modifiedDecorations)??[])))})),this._register(this._originalEditor.onMouseUp(s=>{var l;if(s.target.type!==6)return;const a=(l=s.target.detail.injectedText)==null?void 0:l.options.attachedData;a instanceof hSe&&a.owner===this&&this._onDidClick.fire(s.event)}))}}class hSe{constructor(t){this.owner=t}}function bTo(e){return e.innerChanges?e.innerChanges.every(t=>Jme(t.modifiedRange)&&Jme(t.originalRange)):!1}let OTo=0;function wTo(e){return es(e.onDidChangeTokens,()=>OTo++)}var yTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},CTo=function(e,t){return function(n,r){t(n,r,e)}};let Aze=class extends ct{constructor(t,n,r,o,s,a){super(),this._editor=t,this._host=n,this._model=r,this._ghostTextIndicator=o,this._focusIsInMenu=s,this._instantiationService=a,this._editorObs=ml(this._editor),this._tabAction=Wt(h=>{var f;return((f=this._model.read(h))==null?void 0:f.tabAction.read(h))??LA.Inactive}),this._constructorDone=Bi(this,!1),this._uiState=Wt(this,h=>{var b,O;const f=this._model.read(h);if(!f||!this._constructorDone.read(h))return;const g=f.inlineEdit;let k=cg.fromEdit(g.edit),A=g.edit.apply(g.originalText),m=Gme(k,g.originalText,new L5(A)),v=this.determineRenderState(f,h,m,new L5(A));if(!v){Yi(new Error(`unable to determine view: tried to render ${(b=this._previousView)==null?void 0:b.view}`));return}if(v.kind===Jo.SideBySide){const w=X5o(A,g.modifiedLineRange,d.getOptions().tabSize);A=w.applyToString(A),k=V5o(k,w),m=Gme(k,g.originalText,new L5(A))}return this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId()),this._previewTextModel.getValue()!==A&&this._previewTextModel.setValue(A),f.showCollapsed.read(h)&&!((O=this._indicator.read(h))!=null&&O.isHoverVisible.read(h))&&(v={kind:Jo.Collapsed,viewData:v.viewData}),f.handleInlineEditShown(v.kind,v.viewData),{state:v,diff:m,edit:g,newText:A,newTextLineCount:g.modifiedLineRange.length,isInDiffEditor:f.isInDiffEditor}}),this._previewTextModel=this._register(this._instantiationService.createInstance(SP,"",this._editor.getModel().getLanguageId(),{...SP.DEFAULT_CREATION_OPTIONS,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},null)),this._indicatorCyclicDependencyCircuitBreaker=Bi(this,!1),this._indicator=Wt(this,h=>{if(!this._indicatorCyclicDependencyCircuitBreaker.read(h))return;const f=Gh({owner:this,equalsFn:pQ(Eet())},k=>{var v,p,b;const A=this._ghostTextIndicator.read(k);if(A)return A.lineRange;const m=this._uiState.read(k);if(m){if(((v=m.state)==null?void 0:v.kind)==="custom"){const O=(p=m.state.displayLocation)==null?void 0:p.range;if(!O)throw new Ai("custom view should have a range");return new Qi(O.startLineNumber,O.endLineNumber)}return((b=m.state)==null?void 0:b.kind)==="insertionMultiLine"?this._insertion.originalLines.read(k):m.edit.displayRange}}),g=Wt(this,k=>{const A=this._model.read(k);if(A)return A;const m=this._ghostTextIndicator.read(k);return m?m.model:A});return h.store.add(this._instantiationService.createInstance(aze,this._editorObs,f,this._gutterIndicatorOffset,g,this._inlineEditsIsHovered,this._focusIsInMenu))}),this._inlineEditsIsHovered=Wt(this,h=>this._sideBySide.isHovered.read(h)||this._wordReplacementViews.read(h).some(f=>f.isHovered.read(h))||this._deletion.isHovered.read(h)||this._inlineDiffView.isHovered.read(h)||this._lineReplacementView.isHovered.read(h)||this._insertion.isHovered.read(h)||this._customView.isHovered.read(h)),this._gutterIndicatorOffset=Wt(this,h=>{var g,k;if(((k=(g=this._uiState.read(h))==null?void 0:g.state)==null?void 0:k.kind)==="insertionMultiLine")return this._insertion.startLineOffset.read(h);const f=this._ghostTextIndicator.read(h);return f?STo(f,this._editor):0}),this._sideBySide=this._register(this._instantiationService.createInstance(g0e,this._editor,this._model.map(h=>h==null?void 0:h.inlineEdit),this._previewTextModel,this._uiState.map(h=>{var f;return h&&((f=h.state)==null?void 0:f.kind)===Jo.SideBySide?{newTextLineCount:h.newTextLineCount,isInDiffEditor:h.isInDiffEditor}:void 0}),this._tabAction)),this._deletion=this._register(this._instantiationService.createInstance(lTo,this._editor,this._model.map(h=>h==null?void 0:h.inlineEdit),this._uiState.map(h=>{var f;return h&&((f=h.state)==null?void 0:f.kind)===Jo.Deletion?{originalRange:h.state.originalRange,deletions:h.state.deletions,inDiffEditor:h.isInDiffEditor}:void 0}),this._tabAction)),this._insertion=this._register(this._instantiationService.createInstance(uze,this._editor,this._uiState.map(h=>{var f;return h&&((f=h.state)==null?void 0:f.kind)===Jo.InsertionMultiLine?{lineNumber:h.state.lineNumber,startColumn:h.state.column,text:h.state.text,inDiffEditor:h.isInDiffEditor}:void 0}),this._tabAction)),this._inlineDiffViewState=Wt(this,h=>{const f=this._uiState.read(h);if(!(!f||!f.state)&&!(f.state.kind==="wordReplacements"||f.state.kind==="insertionMultiLine"||f.state.kind==="collapsed"||f.state.kind==="custom"))return{modifiedText:new L5(f.newText),diff:f.diff,mode:f.state.kind,modifiedCodeEditor:this._sideBySide.previewEditor,isInDiffEditor:f.isInDiffEditor}}),this._inlineCollapsedView=this._register(this._instantiationService.createInstance(cze,this._editor,this._model.map((h,f)=>{var g,k;return((k=(g=this._uiState.read(f))==null?void 0:g.state)==null?void 0:k.kind)==="collapsed"?h==null?void 0:h.inlineEdit:void 0}))),this._customView=this._register(this._instantiationService.createInstance(dze,this._editor,this._model.map((h,f)=>{var g,k;return((k=(g=this._uiState.read(f))==null?void 0:g.state)==null?void 0:k.kind)==="custom"?h==null?void 0:h.displayLocation:void 0}),this._tabAction)),this._inlineDiffView=this._register(new pTo(this._editor,this._inlineDiffViewState,this._previewTextModel)),this._wordReplacementViews=Bet(this,this._uiState.map(h=>{var f;return((f=h==null?void 0:h.state)==null?void 0:f.kind)==="wordReplacements"?h.state.replacements:[]}),(h,f)=>f.add(this._instantiationService.createInstance(HU,this._editorObs,h,this._tabAction))),this._lineReplacementView=this._register(this._instantiationService.createInstance(hze,this._editorObs,this._uiState.map(h=>{var f;return((f=h==null?void 0:h.state)==null?void 0:f.kind)===Jo.LineReplacement?{originalRange:h.state.originalRange,modifiedRange:h.state.modifiedRange,modifiedLines:h.state.modifiedLines,replacements:h.state.replacements}:void 0}),this._uiState.map(h=>(h==null?void 0:h.isInDiffEditor)??!1),this._tabAction)),this._useCodeShifting=this._editorObs.getOption(71).map(h=>h.edits.allowCodeShifting),this._renderSideBySide=this._editorObs.getOption(71).map(h=>h.edits.renderSideBySide),this._register(PA((h,f)=>{const g=this._model.read(h);g&&f.add(un.any(this._sideBySide.onDidClick,this._deletion.onDidClick,this._lineReplacementView.onDidClick,this._insertion.onDidClick,...this._wordReplacementViews.read(h).map(k=>k.onDidClick),this._inlineDiffView.onDidClick,this._customView.onDidClick)(k=>{this._viewHasBeenShownLongerThan(350)&&(k.preventDefault(),g.accept())}))})),this._indicator.recomputeInitiallyAndOnChange(this._store),this._wordReplacementViews.recomputeInitiallyAndOnChange(this._store),this._indicatorCyclicDependencyCircuitBreaker.set(!0,void 0),this._register(this._instantiationService.createInstance(lze,this._host,this._model,this._indicator,this._inlineCollapsedView));const l=Wt(this,h=>Math.max(...this._wordReplacementViews.read(h).map(f=>f.minEditorScrollHeight.read(h)),this._lineReplacementView.minEditorScrollHeight.read(h),this._customView.minEditorScrollHeight.read(h))).recomputeInitiallyAndOnChange(this._store),d=this._editor.getModel();let u;this._register(xi(h=>{const f=l.read(h);this._editor.changeViewZones(g=>{const k=this._editor.getScrollHeight(),A=f-k+1;A!==0&&u&&(g.removeZone(u),u=void 0),!(A<=0)&&(u=g.addZone({afterLineNumber:d.getLineCount(),heightInPx:A,domNode:ln("div.minScrollHeightViewZone")}))})})),this._constructorDone.set(!0,void 0)}getCacheId(t){return t.inlineEdit.inlineCompletion.identity.id}determineView(t,n,r,o){var g,k,A,m,v;const s=t.inlineEdit,a=((g=this._previousView)==null?void 0:g.id)===this.getCacheId(t)&&!((k=t.displayLocation)!=null&&k.jumpToEdit),l=((A=this._previousView)==null?void 0:A.editorWidth)!==this._editorObs.layoutInfoWidth.read(n)&&(((m=this._previousView)==null?void 0:m.view)===Jo.SideBySide||((v=this._previousView)==null?void 0:v.view)===Jo.LineReplacement);if(a&&!l)return this._previousView.view;if(t.inlineEdit.inlineCompletion instanceof hW&&t.inlineEdit.inlineCompletion.uri||t.displayLocation&&!t.inlineEdit.inlineCompletion.identity.jumpedTo.read(n))return Jo.Custom;const d=s.originalLineRange.length,u=s.modifiedLineRange.length,h=r.flatMap(p=>p.innerChanges??[]),f=h.length===1;if(!t.isInDiffEditor){if(f&&this._useCodeShifting.read(n)!=="never"&&ERn(r))return xTo(r,s.cursorPosition)?Jo.InsertionInline:Jo.LineReplacement;if(oLt(h,s,o))return Jo.Deletion;if(rLt(r)&&this._useCodeShifting.read(n)==="always")return Jo.InsertionMultiLine;if(h.every(b=>Yd.ofRange(b.originalRange).columnCounto.getValueOfRange(w.modifiedRange)),O=h.map(w=>t.inlineEdit.originalText.getValueOfRange(w.originalRange));if(!b.some(w=>w.includes(" "))&&!O.some(w=>w.includes(" "))&&(!h.some(w=>w.originalRange.isEmpty())||!sLt(h.map(w=>new Zc(w.originalRange,"")),s.originalText).some(w=>w.range.isEmpty()&&Yd.ofRange(w.range).columnCount0&&u>0)return d===1&&u===1&&!t.isInDiffEditor?Jo.LineReplacement:this._renderSideBySide.read(n)!=="never"&&g0e.fitsInsideViewport(this._editor,this._previewTextModel,s,n)?Jo.SideBySide:Jo.LineReplacement;if(t.isInDiffEditor){if(oLt(h,s,o))return Jo.Deletion;if(rLt(r)&&this._useCodeShifting.read(n)==="always")return Jo.InsertionMultiLine}return Jo.SideBySide}determineRenderState(t,n,r,o){const s=t.inlineEdit;let a=this.determineView(t,n,r,o);if(this._willRenderAboveCursor(n,s,a))switch(a){case Jo.LineReplacement:case Jo.WordReplacements:a=Jo.SideBySide;break}this._previousView={id:this.getCacheId(t),view:a,editorWidth:this._editor.getLayoutInfo().width,timestamp:Date.now()};const l=r.flatMap(A=>A.innerChanges??[]),d=this._editor.getModel(),u=l.map(A=>({originalRange:A.originalRange,modifiedRange:A.modifiedRange,original:d.getValueInRange(A.originalRange),modified:o.getValueOfRange(A.modifiedRange)})),h=s.cursorPosition,f=u.length===0?!1:u[0].modified.startsWith(d.getEOL()),g={cursorColumnDistance:s.edit.replacements.length===0?0:s.edit.replacements[0].range.getStartPosition().column-h.column,cursorLineDistance:s.lineEdit.lineRange.startLineNumber-h.lineNumber+(f&&s.lineEdit.lineRange.startLineNumber>=h.lineNumber?1:0),lineCountOriginal:s.lineEdit.lineRange.length,lineCountModified:s.lineEdit.newLines.length,characterCountOriginal:u.reduce((A,m)=>A+m.original.length,0),characterCountModified:u.reduce((A,m)=>A+m.modified.length,0),disjointReplacements:u.length,sameShapeReplacements:u.every(A=>A.original===u[0].original&&A.modified===u[0].modified)};switch(a){case Jo.InsertionInline:return{kind:Jo.InsertionInline,viewData:g};case Jo.SideBySide:return{kind:Jo.SideBySide,viewData:g};case Jo.Collapsed:return{kind:Jo.Collapsed,viewData:g};case Jo.Custom:return{kind:Jo.Custom,displayLocation:t.displayLocation,viewData:g}}if(a===Jo.Deletion)return{kind:Jo.Deletion,originalRange:s.originalLineRange,deletions:l.map(A=>A.originalRange),viewData:g};if(a===Jo.InsertionMultiLine){const A=l[0];return{kind:Jo.InsertionMultiLine,lineNumber:A.originalRange.startLineNumber,column:A.originalRange.startColumn,text:o.getValueOfRange(A.modifiedRange),viewData:g}}const k=u.map(A=>new Zc(A.originalRange,A.modified));if(k.length!==0){if(a===Jo.WordReplacements){let A=LTo(k,s.originalText);return A.some(m=>m.range.isEmpty())&&(A=sLt(k,s.originalText)),{kind:Jo.WordReplacements,replacements:A,viewData:g}}if(a===Jo.LineReplacement)return{kind:Jo.LineReplacement,originalRange:s.originalLineRange,modifiedRange:s.modifiedLineRange,modifiedLines:s.modifiedLineRange.mapToLineArray(A=>o.getLineAt(A)),replacements:l.map(A=>({originalRange:A.originalRange,modifiedRange:A.modifiedRange})),viewData:g}}}_willRenderAboveCursor(t,n,r){if(this._useCodeShifting.read(t)==="always")return!1;for(const s of n.multiCursorPositions)if(r===Jo.WordReplacements&&s.lineNumber===n.originalLineRange.startLineNumber+1||r===Jo.LineReplacement&&s.lineNumber>=n.originalLineRange.endLineNumberExclusive&&s.lineNumber=t}};Aze=yTo([CTo(5,$n)],Aze);function ERn(e){return e.every(n=>n.innerChanges.every(r=>t(r)));function t(n){return!(!n.originalRange.isEmpty()||!(n.modifiedRange.startLineNumber===n.modifiedRange.endLineNumber))}}function xTo(e,t){if(!t||!ERn(e))return!1;const n=t;return e.every(o=>o.innerChanges.every(s=>r(s)));function r(o){const s=o.originalRange.getStartPosition();return!!(n.isBeforeOrEqual(s)||s.lineNumberr.innerChanges??[]);if(t.length!==1)return!1;const n=t[0];return!(!n.originalRange.isEmpty()||n.modifiedRange.startLineNumber===n.modifiedRange.endLineNumber)}function oLt(e,t,n){return e.map(o=>({original:t.originalText.getValueOfRange(o.originalRange),modified:n.getValueOfRange(o.modifiedRange)})).every(({original:o,modified:s})=>s.trim()===""&&o.length>0&&(o.length>s.length||o.trim()!==""))}function LTo(e,t){return DRn(e,t,n=>/^[a-zA-Z]$/.test(n))}function sLt(e,t){return DRn(e,t,n=>!/^\s$/.test(n))}function DRn(e,t,n){const r=[];e.sort((s,a)=>De.compareRangesUsingStarts(s.range,a.range));for(const s of e){let a=s.range.startColumn-1,l=s.range.endColumn-2,d="",u="";const h=t.getLineAt(s.range.startLineNumber),f=t.getLineAt(s.range.endLineNumber);if(o(h[a]))for(;o(h[a-1]);)d=h[a-1]+d,a--;if(o(f[l])||l0&&De.areIntersectingOrTouching(r[r.length-1].range,g.range)&&(g=Zc.joinReplacements([r.pop(),g],t)),r.push(g)}function o(s){return s===void 0?!1:n(s)}return r}function STo(e,t){const n=e.model.inlineEdit.edit.replacements;if(n.length!==1)return 0;const r=t.getModel();if(!r)return 0;const o=r.getEOL(),s=n[0];if(s.range.isEmpty()&&s.text.startsWith(o)){const a=t.getLineHeightForPosition(s.range.getStartPosition());return TTo(s.text,o)*a}return 0}function TTo(e,t){if(!t.length)return 0;let n=0,r=0;for(;e.startsWith(t,r);)n++,r+=t.length;return n}var ETo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},DTo=function(e,t){return function(n,r){t(n,r,e)}},xF;let fze=(xF=class extends ct{constructor(t,n,r,o,s){super(),this._editor=t,this._edit=n,this._model=r,this._focusIsInMenu=o,this._inlineEdit=Wt(this,a=>{var A;const l=this._model.read(a);if(!l)return;const d=this._edit.read(a);if(!d)return;const u=this._editor.getModel();if(!u)return;const h=(A=l.inlineEditState.read(void 0))==null?void 0:A.inlineCompletion.updatedEdit;if(!h)return;const f=h.replacements.map(m=>{const v=De.fromPositions(u.getPositionAt(m.replaceRange.start),u.getPositionAt(m.replaceRange.endExclusive));return new Zc(v,m.newText)}),g=new Yp(f),k=new BP(u);return new vRn(k,g,l.primaryPosition.read(void 0),l.allPositions.read(void 0),d.commands,d.inlineCompletion)}),this._inlineEditModel=Wt(this,a=>{const l=this._model.read(a);if(!l)return;const d=this._inlineEdit.read(a);if(!d)return;const u=Wt(this,h=>{if(this._editorObs.isFocused.read(h)){if(l.tabShouldJumpToInlineEdit.read(h))return LA.Jump;if(l.tabShouldAcceptInlineEdit.read(h))return LA.Accept}return LA.Inactive});return new pRn(l,d,u)}),this._inlineEditHost=Wt(this,a=>{const l=this._model.read(a);if(l)return new C5o(l)}),this._ghostTextIndicator=Wt(this,a=>{const l=this._model.read(a);if(!l)return;const d=l.inlineCompletionState.read(a);if(!d)return;const u=d.inlineCompletion;if(!u||!u.showInlineEditMenu)return;const h=Qi.ofLength(d.primaryGhostText.lineNumber,1);return new x5o(this._editor,l,h,u)}),this._editorObs=ml(this._editor),this._register(s.createInstance(Aze,this._editor,this._inlineEditHost,this._inlineEditModel,this._ghostTextIndicator,this._focusIsInMenu))}},xF.hot=SOe(xF),xF);fze=ETo([DTo(4,$n)],fze);var QTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},BTo=function(e,t){return function(n,r){t(n,r,e)}};let gze=class extends ct{constructor(t,n,r,o){super(),this._editor=t,this._model=n,this._focusIsInMenu=r,this._instantiationService=o,this._ghostTexts=Wt(this,s=>{const a=this._model.read(s);return(a==null?void 0:a.ghostTexts.read(s))??[]}),this._stablizedGhostTexts=P9o(this._ghostTexts,this._store),this._editorObs=ml(this._editor),this._ghostTextWidgets=Bet(this,this._stablizedGhostTexts,(s,a)=>bv(l=>this._instantiationService.createInstance(wee.hot.read(l),this._editor,{ghostText:s,warning:this._model.map((d,u)=>{var f;const h=(f=d==null?void 0:d.warning)==null?void 0:f.read(u);return h?{icon:h.icon}:void 0}),minReservedLineCount:ha(0),targetTextModel:this._model.map(d=>d==null?void 0:d.textModel),handleInlineCompletionShown:this._model.map((d,u)=>{var f;const h=(f=d==null?void 0:d.inlineCompletionState.read(u))==null?void 0:f.inlineCompletion;return h?g=>d.handleInlineSuggestionShown(h,Jo.GhostText,g):()=>{}})},this._editorObs.getOption(71).map(d=>({syntaxHighlightingEnabled:d.syntaxHighlightingEnabled})),!1,!1)).recomputeInitiallyAndOnChange(a)).recomputeInitiallyAndOnChange(this._store),this._inlineEdit=Wt(this,s=>{var a,l;return(l=(a=this._model.read(s))==null?void 0:a.inlineEditState.read(s))==null?void 0:l.inlineEdit}),this._everHadInlineEdit=S6(this,(s,a)=>{var l,d,u;return a||!!this._inlineEdit.read(s)||!!((u=(d=(l=this._model.read(s))==null?void 0:l.inlineCompletionState.read(s))==null?void 0:d.inlineCompletion)!=null&&u.showInlineEditMenu)}),this._inlineEditWidget=bv(s=>{if(this._everHadInlineEdit.read(s))return this._instantiationService.createInstance(fze.hot.read(s),this._editor,this._inlineEdit,this._model,this._focusIsInMenu)}).recomputeInitiallyAndOnChange(this._store),this._fontFamily=this._editorObs.getOption(71).map(s=>s.fontFamily),this._register(_ho(Wt(s=>` .monaco-editor .ghost-text-decoration, .monaco-editor .ghost-text-decoration-preview, .monaco-editor .ghost-text { font-family: ${this._fontFamily.read(s)}; }`))),this._register(new yHe(this._editor,this._model,this._instantiationService))}shouldShowHoverAtViewZone(t){var n;return((n=this._ghostTextWidgets.get()[0])==null?void 0:n.get().ownsViewZone(t))??!1}};gze=QTo([BTo(3,$n)],gze);var FTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},cx=function(e,t){return function(n,r){t(n,r,e)}},H3,Yw;let Y1=(Yw=class extends ct{static getInFocusedEditorOrParent(t){const n=_Pn(t);return n?H3.get(n):null}static get(t){return B6o(t.getContribution(H3.ID))}constructor(t,n,r,o,s,a,l,d,u,h){super(),this.editor=t,this._instantiationService=n,this._contextKeyService=r,this._configurationService=o,this._commandService=s,this._debounceService=a,this._languageFeaturesService=l,this._accessibilitySignalService=d,this._keybindingService=u,this._accessibilityService=h,this._editorObs=ml(this.editor),this._positions=Wt(this,m=>{var v;return((v=this._editorObs.selections.read(m))==null?void 0:v.map(p=>p.getEndPosition()))??[new tt(1,1)]}),this._suggestWidgetAdapter=this._register(new k5o(this._editorObs,m=>{var v;return(v=this.model.get())==null?void 0:v.handleSuggestAccepted(m)},()=>{var m,v;return(v=(m=this.model.get())==null?void 0:m.selectedInlineCompletion.get())==null?void 0:v.getSingleTextEdit()})),this._enabledInConfig=es(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).enabled),this._isScreenReaderEnabled=es(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=es(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=Wt(this,m=>this._enabledInConfig.read(m)&&(!this._isScreenReaderEnabled.read(m)||!this._editorDictationInProgress.read(m))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._focusIsInMenu=Bi(this,!1),this._focusIsInEditorOrMenu=Wt(this,m=>{const v=this._editorObs.isFocused.read(m),p=this._focusIsInMenu.read(m);return v||p}),this._cursorIsInIndentation=Wt(this,m=>{const v=this._editorObs.cursorPosition.read(m);if(v===null)return!1;const p=this._editorObs.model.read(m);if(!p)return!1;this._editorObs.versionId.read(m);const b=p.getLineIndentColumn(v.lineNumber);return v.column<=b}),this.model=bv(this,m=>{if(this._editorObs.isReadonly.read(m))return;const v=this._editorObs.model.read(m);return v?this._instantiationService.createInstance(HVe,v,this._suggestWidgetAdapter.selectedItem,this._editorObs.versionId,this._positions,this._debounceValue,this._enabled,this.editor):void 0}).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=Uv(this),this._hideInlineEditOnSelectionChange=this._editorObs.getOption(71).map(m=>!0),this._view=this._register(this._instantiationService.createInstance(gze,this.editor,this.model,this._focusIsInMenu)),H3._instances.add(this),this._register(Gn(()=>H3._instances.delete(this))),this._register(xi(m=>{var O,w;const v=this.model.read(m);if(!v)return;const p=v.state.read(m);if(!p||!this._focusIsInEditorOrMenu.read(void 0))return;const b=p.kind==="inlineEdit"?p.nextEditUri:void 0;for(const y of H3._instances)y!==this&&(b&&IT(b,(O=y.editor.getModel())==null?void 0:O.uri)?(w=y.model.read(void 0))==null||w.trigger():y.reject())})),this._register(xi(m=>{var b;const v=this.model.read(m),p=(b=this.editor.getModel())==null?void 0:b.uri;!v||!p||m.store.add(v.onDidAccept(()=>{var O,w;for(const y of H3._instances){if(y===this)continue;const C=(O=y.model.read(void 0))==null?void 0:O.state.read(void 0);(C==null?void 0:C.kind)==="inlineEdit"&&IT(C.nextEditUri,p)&&((w=y.model.read(void 0))==null||w.stop("automatic"))}}))})),this._register(fO(this._editorObs.onDidType,(m,v)=>{var p;this._enabled.get()&&((p=this.model.get())==null||p.trigger())})),this._register(fO(this._editorObs.onDidPaste,(m,v)=>{var p;this._enabled.get()&&((p=this.model.get())==null||p.trigger())}));const f=new Set([Gj.Tab.id,Gj.DeleteLeft.id,Gj.DeleteRight.id,see,"acceptSelectedSuggestion",q1e.ID,X1e.ID,va.NextMatchFindAction,..._ge.getRegisteredCommands()]);this._register(this._commandService.onDidExecuteCommand(m=>{if(f.has(m.commandId)&&t.hasTextFocus()&&this._enabled.get()){let v=!1;m.commandId===see&&(v=!0),this._editorObs.forceUpdate(p=>{var b;(b=this.model.get())==null||b.trigger(p,{noDelay:v})})}})),this._register(fO(this._editorObs.selections,(m,v,p)=>{var b,O,w,y;if(p.some(C=>C.reason===3||C.source==="api")){if(!this._hideInlineEditOnSelectionChange.get()&&((O=(b=this.model.get())==null?void 0:b.state.get())==null?void 0:O.kind)==="inlineEdit")return;const C=this.model.get();if(!C)return;((w=C.state.get())==null?void 0:w.kind)==="ghostText"&&((y=this.model.get())==null||y.stop())}})),this._register(xi(m=>{var b,O;const v=this._focusIsInEditorOrMenu.read(m),p=this.model.read(void 0);if(v){const w=p==null?void 0:p.state.read(void 0);(!w||w.kind!=="inlineEdit"||!w.nextEditUri)&&ua(y=>{var C;for(const x of H3._instances)x!==this&&((C=x.model.read(void 0))==null||C.stop("automatic",y))});return}this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||t.getOption(71).keepOnBlur||MV.dropDownVisible||p&&((O=(b=p.state.read(void 0))==null?void 0:b.inlineCompletion)!=null&&O.isFromExplicitRequest&&p.inlineEditAvailable.read(void 0)||ua(w=>{p.stop("automatic",w)}))})),this._register(xi(m=>{var p;const v=(p=this.model.read(m))==null?void 0:p.inlineCompletionState.read(m);v!=null&&v.suggestItem?v.primaryGhostText.lineCount>=2&&this._suggestWidgetAdapter.forceRenderingAbove():this._suggestWidgetAdapter.stopForceRenderingAbove()})),this._register(Gn(()=>{this._suggestWidgetAdapter.stopForceRenderingAbove()}));const g=S6(this,(m,v)=>{var O;const p=this.model.read(m),b=p==null?void 0:p.state.read(m);return this._suggestWidgetAdapter.selectedItem.get()?v:(O=b==null?void 0:b.inlineCompletion)==null?void 0:O.semanticId});this._register(EQn(Wt(m=>(this._playAccessibilitySignal.read(m),g.read(m),{})),async(m,v,p,b)=>{let O=this.model.get(),w=O==null?void 0:O.state.get();if(!w||!O||(await My(50,xUe(b)),await mFn(this._suggestWidgetAdapter.selectedItem,QA,()=>!1,xUe(b)),O=this.model.get(),w=O==null?void 0:O.state.get(),!w||!O))return;const y=w.kind==="ghostText"?O.textModel.getLineContent(w.primaryGhostText.lineNumber):"";this._accessibilitySignalService.playSignal(w.kind==="ghostText"?lg.inlineSuggestion:lg.nextEditSuggestion),this.editor.getOption(12)&&(w.kind==="ghostText"?this._provideScreenReaderUpdate(w.primaryGhostText.renderForScreenReader(y)):this._provideScreenReaderUpdate(""))})),this._register(this._configurationService.onDidChangeConfiguration(m=>{m.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")});const k=new M9o(this._contextKeyService);this._register(k.bind(Ws.cursorInIndentation,this._cursorIsInIndentation)),this._register(k.bind(Ws.hasSelection,m=>{var v;return!((v=this._editorObs.cursorSelection.read(m))!=null&&v.isEmpty())})),this._register(k.bind(Ws.cursorAtInlineEdit,this.model.map((m,v)=>{var p,b;return(b=(p=m==null?void 0:m.inlineEditState)==null?void 0:p.read(v))==null?void 0:b.cursorAtInlineEdit.read(v)}))),this._register(k.bind(Ws.tabShouldAcceptInlineEdit,this.model.map((m,v)=>!!(m!=null&&m.tabShouldAcceptInlineEdit.read(v))))),this._register(k.bind(Ws.tabShouldJumpToInlineEdit,this.model.map((m,v)=>!!(m!=null&&m.tabShouldJumpToInlineEdit.read(v))))),this._register(k.bind(Ws.inlineEditVisible,m=>{var v;return((v=this.model.read(m))==null?void 0:v.inlineEditState.read(m))!==void 0})),this._register(k.bind(Ws.inlineSuggestionHasIndentation,m=>{var v,p;return(p=(v=this.model.read(m))==null?void 0:v.getIndentationInfo(m))==null?void 0:p.startsWithIndentation})),this._register(k.bind(Ws.inlineSuggestionHasIndentationLessThanTabSize,m=>{var v,p;return(p=(v=this.model.read(m))==null?void 0:v.getIndentationInfo(m))==null?void 0:p.startsWithIndentationLessThanTabSize})),this._register(k.bind(Ws.suppressSuggestions,m=>{const v=this.model.read(m),p=v==null?void 0:v.inlineCompletionState.read(m);return p!=null&&p.primaryGhostText&&(p!=null&&p.inlineCompletion)?p.inlineCompletion.source.inlineSuggestions.suppressSuggestions:void 0})),this._register(k.bind(Ws.inlineSuggestionVisible,m=>{const v=this.model.read(m),p=v==null?void 0:v.inlineCompletionState.read(m);return!!(p!=null&&p.inlineCompletion)&&(p==null?void 0:p.primaryGhostText)!==void 0&&!(p!=null&&p.primaryGhostText.isEmpty())}));const A=Wt(this,m=>{const v=this.model.read(m),p=v==null?void 0:v.inlineCompletionState.read(m),b=p==null?void 0:p.primaryGhostText;return!b||b.isEmpty()?void 0:new tt(b.lineNumber,b.parts[0].column)});this._register(k.bind(Ws.cursorBeforeGhostText,m=>{const v=A.read(m);if(!v)return!1;const p=this._editorObs.cursorPosition.read(m);return p?v.equals(p):!1})),this._register(this._instantiationService.createInstance(TVe,this.editor))}playAccessibilitySignal(t){this._playAccessibilitySignal.trigger(t)}_provideScreenReaderUpdate(t){const n=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),r=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let o;!n&&r&&this.editor.getOption(169)&&(o=j(1204,"Inspect this in the accessible view ({0})",r.getAriaLabel())),kg(o?t+", "+o:t)}shouldShowHoverAt(t){var r;const n=(r=this.model.get())==null?void 0:r.primaryGhostText.get();return n?n.parts.some(o=>t.containsPosition(new tt(n.lineNumber,o.column))):!1}shouldShowHoverAtViewZone(t){return this._view.shouldShowHoverAtViewZone(t)}reject(){ua(t=>{var r;const n=this.model.get();if(n&&(n.stop("explicitCancel",t),this._focusIsInEditorOrMenu.get()))for(const o of H3._instances)o!==this&&((r=o.model.get())==null||r.stop("automatic",t))})}jump(){const t=this.model.get();t&&t.jump()}},H3=Yw,Yw._instances=new Set,Yw.hot=SOe(Yw),Yw.ID="editor.contrib.inlineCompletionsController",Yw);Y1=H3=FTo([cx(1,$n),cx(2,Fi),cx(3,cr),cx(4,Ca),cx(5,L2),cx(6,Zn),cx(7,E6),cx(8,Fo),cx(9,xh)],Y1);const I2e=class I2e extends Nn{constructor(){super({id:I2e.ID,label:Et(1183,"Show Next Inline Suggestion"),precondition:zt.and(Ze.writable,Ws.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(t,n){var o;const r=Y1.get(n);(o=r==null?void 0:r.model.get())==null||o.next()}};I2e.ID=OPn;let mze=I2e;const N2e=class N2e extends Nn{constructor(){super({id:N2e.ID,label:Et(1184,"Show Previous Inline Suggestion"),precondition:zt.and(Ze.writable,Ws.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(t,n){var o;const r=Y1.get(n);(o=r==null?void 0:r.model.get())==null||o.previous()}};N2e.ID=bPn;let kze=N2e;const PTo="vscode://schemas/inlineCompletionProviderIdArgs";function MTo(e){const t=[];return e.providerId&&(t.push(e.providerId.toStringWithoutVersion()),t.push(e.providerId.extensionId+":*")),t}const aLt=W6o(U6o({showNoResultNotification:J9e(txt()),providerId:J9e(V6o(PTo,M6o())),explicit:J9e(txt())}),I6o());class RTo extends Nn{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:Et(1185,"Trigger Inline Suggestion"),precondition:Ze.writable,metadata:{description:j(1172,"Triggers an inline suggestion in the editor."),args:[{name:"args",description:j(1173,"Options for triggering inline suggestions."),isOptional:!0,schema:aLt.getJSONSchema()}]}})}async run(t,n,r){var u;const o=t.get(cc),s=t.get(Zn),a=Y1.get(n),l=aLt.validateOrThrow(r),d=l!=null&&l.providerId?s.inlineCompletionsProvider.all(n.getModel()).find(h=>MTo(h).some(f=>f===l.providerId)):void 0;await Zlo(async h=>{var f;await((f=a==null?void 0:a.model.get())==null?void 0:f.trigger(h,{provider:d,explicit:(l==null?void 0:l.explicit)??!0})),a==null||a.playAccessibilitySignal(h)}),l!=null&&l.showNoResultNotification&&((u=a==null?void 0:a.model.get())!=null&&u.state.get()||o.notify({severity:bZ.Info,message:j(1174,"No inline suggestion is available.")}))}}class ITo extends Nn{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:Et(1186,"Accept Next Word Of Inline Suggestion"),precondition:zt.and(Ze.writable,Ws.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:zt.and(Ze.writable,Ws.inlineSuggestionVisible,Ws.cursorBeforeGhostText,fZ.negate())},menuOpts:[{menuId:Yn.InlineSuggestionToolbar,title:j(1175,"Accept Word"),group:"primary",order:2}]})}async run(t,n){var o;const r=Y1.get(n);await((o=r==null?void 0:r.model.get())==null?void 0:o.acceptNextWord())}}class NTo extends Nn{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:Et(1187,"Accept Next Line Of Inline Suggestion"),precondition:zt.and(Ze.writable,Ws.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:Yn.InlineSuggestionToolbar,title:j(1176,"Accept Line"),group:"secondary",order:2}]})}async run(t,n){var o;const r=Y1.get(n);await((o=r==null?void 0:r.model.get())==null?void 0:o.acceptNextLine())}}class UTo extends Nn{constructor(){super({id:see,label:Et(1188,"Accept Inline Suggestion"),precondition:zt.or(Ws.inlineSuggestionVisible,Ws.inlineEditVisible),menuOpts:[{menuId:Yn.InlineSuggestionToolbar,title:j(1177,"Accept"),group:"primary",order:2},{menuId:Yn.InlineEditsActions,title:j(1178,"Accept"),group:"primary",order:2}],kbOpts:[{primary:2,weight:200,kbExpr:zt.or(zt.and(Ws.inlineSuggestionVisible,Ze.tabMovesFocus.toNegated(),Tr.Visible.toNegated(),Ze.hoverFocused.toNegated(),Ws.hasSelection.toNegated(),Ws.inlineSuggestionHasIndentationLessThanTabSize),zt.and(Ws.inlineEditVisible,Ze.tabMovesFocus.toNegated(),Tr.Visible.toNegated(),Ze.hoverFocused.toNegated(),Ws.tabShouldAcceptInlineEdit))}]})}async run(t,n){var o;const r=Y1.getInFocusedEditorOrParent(t);r&&((o=r.model.get())==null||o.accept(r.editor),r.editor.focus())}}Zu.registerKeybindingRule({id:see,weight:202,primary:2,when:zt.and(Ws.inInlineEditsPreviewEditor)});class jTo extends Nn{constructor(){super({id:Eyo,label:Et(1189,"Jump to next inline edit"),precondition:Ws.inlineEditVisible,menuOpts:[{menuId:Yn.InlineEditsActions,title:j(1179,"Jump"),group:"primary",order:1,when:Ws.cursorAtInlineEdit.toNegated()}],kbOpts:{primary:2,weight:201,kbExpr:zt.and(Ws.inlineEditVisible,Ze.tabMovesFocus.toNegated(),Tr.Visible.toNegated(),Ze.hoverFocused.toNegated(),Ws.tabShouldJumpToInlineEdit)}})}async run(t,n){const r=Y1.get(n);r&&r.jump()}}const U2e=class U2e extends Nn{constructor(){super({id:U2e.ID,label:Et(1190,"Hide Inline Suggestion"),precondition:zt.or(Ws.inlineSuggestionVisible,Ws.inlineEditVisible),kbOpts:{weight:190,primary:9},menuOpts:[{menuId:Yn.InlineEditsActions,title:j(1180,"Reject"),group:"primary",order:3}]})}async run(t,n){const r=Y1.getInFocusedEditorOrParent(t);ua(o=>{var s;(s=r==null?void 0:r.model.get())==null||s.stop("explicitCancel",o)}),r==null||r.editor.focus()}};U2e.ID=wPn;let m0e=U2e;const j2e=class j2e extends Nn{constructor(){super({id:j2e.ID,label:Et(1191,"Toggle Inline Suggestions Show Collapsed"),precondition:zt.true()})}async run(t,n){const r=t.get(cr),o=r.getValue("editor.inlineSuggest.edits.showCollapsed");r.updateValue("editor.inlineSuggest.edits.showCollapsed",!o)}};j2e.ID=wHe;let vze=j2e;Zu.registerKeybindingRule({id:m0e.ID,weight:-1,primary:9,secondary:[1033],when:zt.and(Ws.inInlineEditsPreviewEditor)});const W2e=class W2e extends Gu{constructor(){super({id:W2e.ID,title:j(1181,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:Yn.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:zt.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(t){const n=t.get(cr),o=n.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";n.updateValue("editor.inlineSuggest.showToolbar",o)}};W2e.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let pze=W2e;class WTo extends Nn{constructor(){super({id:"editor.action.inlineSuggest.dev.extractRepro",label:j(1182,"Developer: Extract Inline Suggest State"),alias:"Developer: Inline Suggest Extract Repro",precondition:zt.or(Ws.inlineEditVisible,Ws.inlineSuggestionVisible)})}async run(t,n){const r=t.get(z1),o=Y1.get(n),s=o==null?void 0:o.model.get();if(!s)return;const a=s.extractReproSample(),d=W1(JSON.stringify({inlineCompletion:a.inlineCompletion},null,4)).map(h=>"// "+h).join(` `),u=`${a.documentValue} // ${d} // `;return await r.writeText(u),{reproCase:u}}}var HTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Qce=function(e,t){return function(n,r){t(n,r,e)}};class VTo{constructor(t,n,r){this.owner=t,this.range=n,this.controller=r}isValidForHoverAnchor(t){return t.type===1&&this.range.startColumn<=t.range.startColumn&&this.range.endColumn>=t.range.endColumn}}let bze=class{constructor(t,n,r,o,s){this._editor=t,this.accessibilityService=n,this._instantiationService=r,this._telemetryService=o,this._markdownRendererService=s,this.hoverOrdinal=4}suggestHoverAnchor(t){const n=Y1.get(this._editor);if(!n)return null;const r=t.target;if(r.type===8){const o=r.detail;if(n.shouldShowHoverAtViewZone(o.viewZoneId))return new oG(1e3,this,De.fromPositions(this._editor.getModel().validatePosition(o.positionBefore||o.position)),t.event.posx,t.event.posy,!1)}if(r.type===7&&n.shouldShowHoverAt(r.range))return new oG(1e3,this,r.range,t.event.posx,t.event.posy,!1);if(r.type===6&&r.detail.mightBeForeignElement&&n.shouldShowHoverAt(r.range))return new oG(1e3,this,r.range,t.event.posx,t.event.posy,!1);if(r.type===9&&r.element){const o=wee.getWarningWidgetContext(r.element);if(o&&n.shouldShowHoverAt(o.range))return new oG(1e3,this,o.range,t.event.posx,t.event.posy,!1)}return null}computeSync(t,n){if(this._editor.getOption(71).showToolbar!=="onHover")return[];const r=Y1.get(this._editor);return r&&r.shouldShowHoverAt(t.range)?[new VTo(this,t.range,r)]:[]}renderHoverParts(t,n){const r=new Pt,o=n[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(12)&&r.add(this.renderScreenReaderText(t,o));const s=o.controller.model.get(),a=document.createElement("div");t.fragment.appendChild(a),r.add(PA((d,u)=>{const h=u.add(this._instantiationService.createInstance(MV.hot.read(d),this._editor,!1,ha(null),s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.activeCommands,s.warning,()=>{t.onContentsChanged()}));a.replaceChildren(h.getDomNode())})),s.triggerExplicitly();const l={hoverPart:o,hoverElement:a,dispose(){r.dispose()}};return new jP([l])}getAccessibleContent(t){return j(1205,"There are inline completions here")}renderScreenReaderText(t,n){const r=new Pt,o=ln,s=o("div.hover-row.markdown-hover"),a=tn(s,o("div.hover-contents",{"aria-live":"assertive"})),l=d=>{const u=j(1206,"Suggestion:"),h=r.add(this._markdownRendererService.render(new xA().appendText(u).appendCodeblock("text",d),{context:this._editor,asyncRenderCallback:()=>{a.className="hover-contents code-hover-contents",t.onContentsChanged()}}));a.replaceChildren(h.element)};return r.add(xi(d=>{var h;const u=(h=n.controller.model.read(d))==null?void 0:h.primaryGhostText.read(d);if(u){const f=this._editor.getModel().getLineContent(u.lineNumber);l(u.renderForScreenReader(f))}else Ou(a)})),t.fragment.appendChild(s),r}};bze=HTo([Qce(1,xh),Qce(2,$n),Qce(3,zA),Qce(4,D4)],bze);class zTo{}mo(Y1.ID,F6o(Y1.hot),3);gn(RTo);gn(mze);gn(kze);gn(ITo);gn(NTo);gn(UTo);gn(vze);gn(m0e);gn(jTo);ws(pze);gn(WTo);ws(UVe);ws(jVe);XM.register(bze);$Oe.register(new zTo);var ZTo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},ASe=function(e,t){return function(n,r){t(n,r,e)}},hG,vT;let xee=(vT=class{constructor(t,n,r,o){this.textModelResolverService=n,this.languageService=r,this.languageFeaturesService=o,this.toUnhook=new Pt,this.toUnhookForKeyboard=new Pt,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=t,this.linkDecorations=this.editor.createDecorationsCollection();const s=new HOe(t);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this.startFindDefinitionFromMouse(a,l??void 0)})),this.toUnhook.add(s.onExecute(a=>{this.isEnabled(a)&&this.gotoDefinition(a.target.position,a.hasSideBySideModifier).catch(l=>{Yi(l)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(t){return t.getContribution(hG.ID)}async startFindDefinitionFromCursor(t){await this.startFindDefinition(t),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(n=>{n&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(t,n){if(t.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(t,n)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const r=t.target.position;this.startFindDefinition(r)}async startFindDefinition(t){var a;this.toUnhookForKeyboard.clear();const n=t?(a=this.editor.getModel())==null?void 0:a.getWordAtPosition(t):null;if(!n){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===n.startColumn&&this.currentWordAtPosition.endColumn===n.endColumn&&this.currentWordAtPosition.word===n.word)return;this.currentWordAtPosition=n;const r=new jFn(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=zd(l=>this.findDefinition(t,l));let o;try{o=await this.previousPromise}catch(l){Yi(l);return}if(!o||!o.length||!r.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?De.lift(o[0].originSelectionRange):new De(t.lineNumber,n.startColumn,t.lineNumber,n.endColumn);if(o.length>1){let l=s;for(const{originSelectionRange:d}of o)d&&(l=De.plusRange(l,d));this.addDecoration(l,new xA().appendText(j(1077,"Click to show {0} definitions.",o.length)))}else{const l=o[0];return l.uri?this.textModelResolverService.createModelReference(l.uri).then(d=>{if(!d.object||!d.object.textEditorModel){d.dispose();return}const{object:{textEditorModel:u}}=d,{startLineNumber:h}=l.range;if(h<1||h>u.getLineCount()){d.dispose();return}const f=this.getPreviewValue(u,h,l),g=this.languageService.guessLanguageIdByFilepathOrFirstLine(u.uri);this.addDecoration(s,f?new xA().appendCodeblock(g||"",f):void 0),d.dispose()}):void 0}}getPreviewValue(t,n,r){let o=r.range;return o.endLineNumber-o.startLineNumber>=hG.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(t,n)),o=t.validateRange(o),this.stripIndentationFromPreviewRange(t,n,o)}stripIndentationFromPreviewRange(t,n,r){let s=t.getLineFirstNonWhitespaceColumn(n);for(let l=n+1;l{const o=!n&&this.editor.getOption(101)&&!this.isInPeekEditor(r);return new yre({openToSide:n,openInPeek:o,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r)})}isInPeekEditor(t){const n=t.get(Fi);return Lm.inPeekEditor.getValue(n)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},hG=vT,vT.ID="editor.contrib.gotodefinitionatposition",vT.MAX_SOURCE_PREVIEW_LINES=8,vT);xee=hG=ZTo([ASe(1,Uf),ASe(2,lc),ASe(3,Zn)],xee);mo(xee.ID,xee,2);class YTo extends Nn{constructor(){super({id:"editor.action.debugEditorGpuRenderer",label:Et(1101,"Developer: Debug Editor GPU Renderer"),precondition:zt.true()})}async run(t,n){const r=t.get($n),s=await t.get(UA).pick([{label:j(1098,"Log Texture Atlas Stats"),id:"logTextureAtlasStats"},{label:j(1099,"Save Texture Atlas"),id:"saveTextureAtlas"},{label:j(1100,"Draw Glyph"),id:"drawGlyph"}],{canPickMany:!1});if(s)switch(s.id){case"logTextureAtlasStats":r.invokeFunction(a=>{const l=a.get(Oa),d=yf.atlas;if(!yf.atlas){l.error("No texture atlas found");return}const u=d.getStats();l.info(["Texture atlas stats",...u].join(` `))});break;case"saveTextureAtlas":r.invokeFunction(async a=>{const l=a.get(n6),d=a.get(Wxt),u=l.getWorkspace().folders;if(u.length>0){const h=yf.atlas,f=[];for(const[g,k]of h.pages.entries())f.push(d.writeFile(pi.joinPath(u[0].uri,`textureAtlasPage${g}_actual.png`),Y5.wrap(new Uint8Array(await(await k.source.convertToBlob()).arrayBuffer()))),d.writeFile(pi.joinPath(u[0].uri,`textureAtlasPage${g}_usage.png`),Y5.wrap(new Uint8Array(await(await k.getUsagePreview()).arrayBuffer()))));await Promise.all(f)}});break;case"drawGlyph":r.invokeFunction(async a=>{var E,Q,T;const l=a.get(cr),d=a.get(Wxt),u=a.get(UA),f=a.get(n6).getWorkspace().folders;if(f.length===0)return;const g=yf.atlas,k=l.getValue("editor.fontFamily"),A=l.getValue("editor.fontSize"),m=new M$(A,k,ks().devicePixelRatio,yf.decorationStyleCache);let v=await u.input({prompt:"Enter a character to draw (prefix with 0x for code point))"});if(!v)return;const p=(Q=(E=v.match(/0x(?[0-9a-f]+)/i))==null?void 0:E.groups)==null?void 0:Q.codePoint;p!==void 0&&(v=String.fromCodePoint(parseInt(p,16)));const b=0,w=g.getGlyph(m,v,b,0,0);if(!w)return;const y=(T=g.pages[w.pageIndex].source.getContext("2d"))==null?void 0:T.getImageData(w.x,w.y,w.w,w.h);if(!y)return;const C=new OffscreenCanvas(y.width,y.height);xP(C.getContext("2d")).putImageData(y,0,0);const L=await C.convertToBlob({type:"image/png"}),S=pi.joinPath(f[0].uri,`glyph_${v}_${b}_${A}px_${k.replaceAll(/[,\\\/\.'\s]/g,"_")}.png`);await d.writeFile(S,Y5.wrap(new Uint8Array(await L.arrayBuffer())))});break}}}gn(YTo);var mb;(function(e){e.NoAutoFocus="noAutoFocus",e.FocusIfVisible="focusIfVisible",e.AutoFocusImmediately="autoFocusImmediately"})(mb||(mb={}));class XTo extends Nn{constructor(){super({id:pPn,label:Et(1107,"Show or Focus Hover"),metadata:{description:Et(1108,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[mb.NoAutoFocus,mb.FocusIfVisible,mb.AutoFocusImmediately],enumDescriptions:[j(1104,"The hover will not automatically take focus."),j(1105,"The hover will take focus only if it is already visible."),j(1106,"The hover will automatically take focus when it appears.")],default:mb.FocusIfVisible}}}}]},precondition:void 0,kbOpts:{kbExpr:Ze.editorTextFocus,primary:qc(2089,2087),weight:100}})}run(t,n,r){if(!n.hasModel())return;const o=jA.get(n);if(!o)return;const s=r==null?void 0:r.focus;let a=mb.FocusIfVisible;Object.values(mb).includes(s)?a=s:typeof s=="boolean"&&s&&(a=mb.AutoFocusImmediately);const l=u=>{const h=n.getPosition(),f=new De(h.lineNumber,h.column,h.lineNumber,h.column);o.showContentHover(f,1,2,u)},d=n.getOption(2)===2;o.isHoverVisible?a!==mb.NoAutoFocus?o.focus():l(d):l(d||a===mb.AutoFocusImmediately)}}class qTo extends Nn{constructor(){super({id:kyo,label:Et(1109,"Show Definition Preview Hover"),precondition:void 0,metadata:{description:Et(1110,"Show the definition preview hover in the editor.")}})}run(t,n){const r=jA.get(n);if(!r)return;const o=n.getPosition();if(!o)return;const s=new De(o.lineNumber,o.column,o.lineNumber,o.column),a=xee.get(n);if(!a)return;a.startFindDefinitionFromCursor(o).then(()=>{r.showContentHover(s,1,2,!0)})}}class GTo extends Nn{constructor(){super({id:vyo,label:Et(1111,"Hide Hover"),alias:"Hide Content Hover",precondition:void 0})}run(t,n){var r;(r=jA.get(n))==null||r.hideContentHover()}}class KTo extends Nn{constructor(){super({id:pyo,label:Et(1112,"Scroll Up Hover"),precondition:Ze.hoverFocused,kbOpts:{kbExpr:Ze.hoverFocused,primary:16,weight:100},metadata:{description:Et(1113,"Scroll up the editor hover.")}})}run(t,n){const r=jA.get(n);r&&r.scrollUp()}}class JTo extends Nn{constructor(){super({id:byo,label:Et(1114,"Scroll Down Hover"),precondition:Ze.hoverFocused,kbOpts:{kbExpr:Ze.hoverFocused,primary:18,weight:100},metadata:{description:Et(1115,"Scroll down the editor hover.")}})}run(t,n){const r=jA.get(n);r&&r.scrollDown()}}class _To extends Nn{constructor(){super({id:Oyo,label:Et(1116,"Scroll Left Hover"),precondition:Ze.hoverFocused,kbOpts:{kbExpr:Ze.hoverFocused,primary:15,weight:100},metadata:{description:Et(1117,"Scroll left the editor hover.")}})}run(t,n){const r=jA.get(n);r&&r.scrollLeft()}}class $To extends Nn{constructor(){super({id:wyo,label:Et(1118,"Scroll Right Hover"),precondition:Ze.hoverFocused,kbOpts:{kbExpr:Ze.hoverFocused,primary:17,weight:100},metadata:{description:Et(1119,"Scroll right the editor hover.")}})}run(t,n){const r=jA.get(n);r&&r.scrollRight()}}class eEo extends Nn{constructor(){super({id:yyo,label:Et(1120,"Page Up Hover"),precondition:Ze.hoverFocused,kbOpts:{kbExpr:Ze.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:Et(1121,"Page up the editor hover.")}})}run(t,n){const r=jA.get(n);r&&r.pageUp()}}class tEo extends Nn{constructor(){super({id:Cyo,label:Et(1122,"Page Down Hover"),precondition:Ze.hoverFocused,kbOpts:{kbExpr:Ze.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:Et(1123,"Page down the editor hover.")}})}run(t,n){const r=jA.get(n);r&&r.pageDown()}}class nEo extends Nn{constructor(){super({id:xyo,label:Et(1124,"Go To Top Hover"),precondition:Ze.hoverFocused,kbOpts:{kbExpr:Ze.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:Et(1125,"Go to the top of the editor hover.")}})}run(t,n){const r=jA.get(n);r&&r.goToTop()}}class iEo extends Nn{constructor(){super({id:Lyo,label:Et(1126,"Go To Bottom Hover"),precondition:Ze.hoverFocused,kbOpts:{kbExpr:Ze.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:Et(1127,"Go to the bottom of the editor hover.")}})}run(t,n){const r=jA.get(n);r&&r.goToBottom()}}class rEo extends Nn{constructor(){super({id:IOe,label:Syo,alias:"Increase Hover Verbosity Level",precondition:Ze.hoverVisible})}run(t,n,r){const o=jA.get(n);if(!o)return;const s=(r==null?void 0:r.index)!==void 0?r.index:o.focusedHoverPartIndex();o.updateHoverVerbosityLevel(m1.Increase,s,r==null?void 0:r.focus)}}class oEo extends Nn{constructor(){super({id:NOe,label:Tyo,alias:"Decrease Hover Verbosity Level",precondition:Ze.hoverVisible})}run(t,n,r){var a;const o=jA.get(n);if(!o)return;const s=(r==null?void 0:r.index)!==void 0?r.index:o.focusedHoverPartIndex();(a=jA.get(n))==null||a.updateHoverVerbosityLevel(m1.Decrease,s,r==null?void 0:r.focus)}}class sEo{constructor(t){this._editor=t}computeSync(t){var a;const n=l=>({value:l}),r=this._editor.getLineDecorations(t.lineNumber),o=[],s=t.laneOrLine==="lineNo";if(!r)return o;for(const l of r){const d=((a=l.options.glyphMargin)==null?void 0:a.position)??CO.Center;if(!s&&d!==t.laneOrLine)continue;const u=s?l.options.lineNumberHoverMessage:l.options.glyphMarginHoverMessage;!u||DV(u)||o.push(...Let(u).map(n))}return o}}var aEo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},lEo=function(e,t){return function(n,r){t(n,r,e)}},Oze;const lLt=ln;var LF;let wze=(LF=class extends ct{constructor(t,n){super(),this._markdownRendererService=n,this.allowEditorOverflow=!0,this._renderDisposeables=this._register(new Pt),this._editor=t,this._isVisible=!1,this._messages=[],this._hover=this._register(new Bnt(!0)),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._hoverOperation=this._register(new yPn(this._editor,new sEo(this._editor))),this._register(this._hoverOperation.onResult(r=>this._withResult(r))),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(59)&&this._updateFont()})),this._register(Sc(this._hover.containerDomNode,"mouseleave",r=>{this._onMouseLeave(r)})),this._editor.addOverlayWidget(this)}dispose(){this._hoverComputerOptions=void 0,this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Oze.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(n=>this._editor.applyFontInfo(n))}_onModelDecorationsChanged(){this._isVisible&&this._hoverComputerOptions&&(this._hoverOperation.cancel(),this._hoverOperation.start(0,this._hoverComputerOptions))}showsOrWillShow(t){const n=t.target;return n.type===2&&n.detail.glyphMarginLane?(this._startShowingAt(n.position.lineNumber,n.detail.glyphMarginLane),!0):n.type===3?(this._startShowingAt(n.position.lineNumber,"lineNo"),!0):!1}_startShowingAt(t,n){this._hoverComputerOptions&&this._hoverComputerOptions.lineNumber===t&&this._hoverComputerOptions.laneOrLine===n||(this._hoverOperation.cancel(),this.hide(),this._hoverComputerOptions={lineNumber:t,laneOrLine:n},this._hoverOperation.start(0,this._hoverComputerOptions))}hide(){this._hoverComputerOptions=void 0,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(t){this._messages=t.value,this._messages.length>0?this._renderMessages(t.options.lineNumber,t.options.laneOrLine,this._messages):this.hide()}_renderMessages(t,n,r){this._renderDisposeables.clear();const o=document.createDocumentFragment();for(const s of r){const a=lLt("div.hover-row.markdown-hover"),l=tn(a,lLt("div.hover-contents")),d=this._renderDisposeables.add(this._markdownRendererService.render(s.value,{context:this._editor}));l.appendChild(d.element),o.appendChild(a)}this._updateContents(o),this._showAt(t,n)}_updateContents(t){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(t),this._updateFont()}_showAt(t,n){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const r=this._editor.getLayoutInfo(),o=this._editor.getTopForLineNumber(t),s=this._editor.getScrollTop(),a=this._editor.getOption(75),l=this._hover.containerDomNode.clientHeight,d=o-s-(l-a)/2,u=r.glyphMarginLeft+r.glyphMarginWidth+(n==="lineNo"?r.lineNumbersWidth:0),f=r.height-l,g=Math.max(0,Math.min(Math.round(d),f));if(this._editor.getOption(51)){const A=this._editor.getDomNode();if(A){const m=ic(A);this._hover.containerDomNode.style.position="fixed",this._hover.containerDomNode.style.left=`${m.left+u}px`,this._hover.containerDomNode.style.top=`${m.top+g}px`}}else this._hover.containerDomNode.style.position="absolute",this._hover.containerDomNode.style.left=`${u}px`,this._hover.containerDomNode.style.top=`${g}px`;this._hover.containerDomNode.style.zIndex="11"}_onMouseLeave(t){const n=this._editor.getDomNode();(!n||!UOe(n,t.x,t.y))&&this.hide()}},Oze=LF,LF.ID="editor.contrib.modesGlyphHoverWidget",LF);wze=Oze=aEo([lEo(1,D4)],wze);var cEo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},dEo=function(e,t){return function(n,r){t(n,r,e)}},hH;let k0e=(hH=class extends ct{constructor(t,n){super(),this._editor=t,this._instantiationService=n,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new Pt,this._hoverState={mouseDown:!1},this._reactToEditorMouseMoveRunner=this._register(new Ss(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}_hookListeners(){const t=this._editor.getOption(69);this._hoverSettings={enabled:t.enabled,sticky:t.sticky,hidingDelay:t.hidingDelay},t.enabled?(this._listenersStore.add(this._editor.onMouseDown(n=>this._onEditorMouseDown(n))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(n=>this._onEditorMouseMove(n))),this._listenersStore.add(this._editor.onKeyDown(n=>this._onKeyDown(n)))):(this._listenersStore.add(this._editor.onMouseMove(n=>this._onEditorMouseMove(n))),this._listenersStore.add(this._editor.onKeyDown(n=>this._onKeyDown(n)))),this._listenersStore.add(this._editor.onMouseLeave(n=>this._onEditorMouseLeave(n))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this.hideGlyphHover()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(n=>this._onEditorScrollChanged(n)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(t){(t.scrollTopChanged||t.scrollLeftChanged)&&this.hideGlyphHover()}_onEditorMouseDown(t){this._hoverState.mouseDown=!0,!this._isMouseOnGlyphHoverWidget(t)&&this.hideGlyphHover()}_isMouseOnGlyphHoverWidget(t){var r;const n=(r=this._glyphWidget)==null?void 0:r.getDomNode();return n?UOe(n,t.event.posx,t.event.posy):!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(t){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._isMouseOnGlyphHoverWidget(t))||this.hideGlyphHover()}_shouldNotRecomputeCurrentHoverWidget(t){const n=this._hoverSettings.sticky,r=this._isMouseOnGlyphHoverWidget(t);return n&&r}_onEditorMouseMove(t){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave)return;if(this._mouseMoveEvent=t,this._shouldNotRecomputeCurrentHoverWidget(t)){this._reactToEditorMouseMoveRunner.cancel();return}this._reactToEditorMouseMove(t)}_reactToEditorMouseMove(t){!t||this._tryShowHoverWidget(t)||this.hideGlyphHover()}_tryShowHoverWidget(t){return this._getOrCreateGlyphWidget().showsOrWillShow(t)}_onKeyDown(t){this._editor.hasModel()&&(t.keyCode===5||t.keyCode===6||t.keyCode===57||t.keyCode===4||this.hideGlyphHover())}hideGlyphHover(){var t;(t=this._glyphWidget)==null||t.hide()}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(wze,this._editor)),this._glyphWidget}dispose(){var t;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(t=this._glyphWidget)==null||t.dispose()}},hH.ID="editor.contrib.marginHover",hH);k0e=cEo([dEo(1,$n)],k0e);class uEo{}class hEo{}class AEo{}mo(jA.ID,jA,2);mo(k0e.ID,k0e,2);gn(XTo);gn(qTo);gn(GTo);gn(KTo);gn(JTo);gn(_To);gn($To);gn(eEo);gn(tEo);gn(nEo);gn(iEo);gn(rEo);gn(oEo);XM.register(lee);XM.register(rVe);x2((e,t)=>{const n=e.getColor(rtt);n&&(t.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${n.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${n.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${n.transparent(.5)}; }`))});$Oe.register(new uEo);$Oe.register(new hEo);$Oe.register(new AEo);function QRn(e,t,n,r){if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return[];const o=t.getLanguageConfiguration(e.getLanguageId()).indentRulesSupport;if(!o)return[];const s=new Xet(e,o,t);for(r=Math.min(r,e.getLineCount());n<=r&&s.shouldIgnore(n);)n++;if(n>r-1)return[];const{tabSize:a,indentSize:l,insertSpaces:d}=e.getOptions(),u=(m,v)=>(v=v||1,k2.shiftIndent(m,m.length+v,a,l,d)),h=(m,v)=>(v=v||1,k2.unshiftIndent(m,m.length+v,a,l,d)),f=[],g=e.getLineContent(n);let k=_s(g),A=k;s.shouldIncrease(n)?(A=u(A),k=u(k)):s.shouldIndentNextLine(n)&&(A=u(A)),n++;for(let m=n;m<=r;m++){if(fEo(e,m))continue;const v=e.getLineContent(m),p=_s(v),b=A;s.shouldDecrease(m,b)&&(A=h(A),k=h(k)),p!==A&&f.push(Jl.replaceMove(new Rn(m,1,m,p.length+1),jet(A,l,d))),!s.shouldIgnore(m)&&(s.shouldIncrease(m,b)?(k=u(k),A=k):s.shouldIndentNextLine(m,b)?A=u(A):A=k)}return f}function fEo(e,t){return e.tokenization.isCheapToTokenize(t)?e.tokenization.getLineTokens(t).getStandardTokenType(0)===2:!1}var gEo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},mEo=function(e,t){return function(n,r){t(n,r,e)}};const H2e=class H2e extends Nn{constructor(){super({id:H2e.ID,label:Et(1148,"Convert Indentation to Spaces"),precondition:Ze.writable,metadata:{description:Et(1149,"Convert the tab indentation to spaces.")}})}run(t,n){const r=n.getModel();if(!r)return;const o=r.getOptions(),s=n.getSelection();if(!s)return;const a=new OEo(s,o.tabSize);n.pushUndoStop(),n.executeCommands(this.id,[a]),n.pushUndoStop(),r.updateOptions({insertSpaces:!0})}};H2e.ID="editor.action.indentationToSpaces";let yze=H2e;const V2e=class V2e extends Nn{constructor(){super({id:V2e.ID,label:Et(1150,"Convert Indentation to Tabs"),precondition:Ze.writable,metadata:{description:Et(1151,"Convert the spaces indentation to tabs.")}})}run(t,n){const r=n.getModel();if(!r)return;const o=r.getOptions(),s=n.getSelection();if(!s)return;const a=new wEo(s,o.tabSize);n.pushUndoStop(),n.executeCommands(this.id,[a]),n.pushUndoStop(),r.updateOptions({insertSpaces:!1})}};V2e.ID="editor.action.indentationToTabs";let Cze=V2e;class Cit extends Nn{constructor(t,n,r){super(r),this.insertSpaces=t,this.displaySizeOnly=n}run(t,n){const r=t.get(UA),o=t.get(pl),s=n.getModel();if(!s)return;const a=o.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget),l=s.getOptions(),d=[1,2,3,4,5,6,7,8].map(h=>({id:h.toString(),label:h.toString(),description:h===a.tabSize&&h===l.tabSize?j(1144,"Configured Tab Size"):h===a.tabSize?j(1145,"Default Tab Size"):h===l.tabSize?j(1146,"Current Tab Size"):void 0})),u=Math.min(s.getOptions().tabSize-1,7);setTimeout(()=>{r.pick(d,{placeHolder:j(1147,"Select Tab Size for Current File"),activeItem:d[u]}).then(h=>{if(h&&s&&!s.isDisposed()){const f=parseInt(h.label,10);this.displaySizeOnly?s.updateOptions({tabSize:f}):s.updateOptions({tabSize:f,indentSize:f,insertSpaces:this.insertSpaces})}})},50)}}const z2e=class z2e extends Cit{constructor(){super(!1,!1,{id:z2e.ID,label:Et(1152,"Indent Using Tabs"),precondition:void 0,metadata:{description:Et(1153,"Use indentation with tabs.")}})}};z2e.ID="editor.action.indentUsingTabs";let xze=z2e;const Z2e=class Z2e extends Cit{constructor(){super(!0,!1,{id:Z2e.ID,label:Et(1154,"Indent Using Spaces"),precondition:void 0,metadata:{description:Et(1155,"Use indentation with spaces.")}})}};Z2e.ID="editor.action.indentUsingSpaces";let Lze=Z2e;const Y2e=class Y2e extends Cit{constructor(){super(!0,!0,{id:Y2e.ID,label:Et(1156,"Change Tab Display Size"),precondition:void 0,metadata:{description:Et(1157,"Change the space size equivalent of the tab.")}})}};Y2e.ID="editor.action.changeTabDisplaySize";let Sze=Y2e;const X2e=class X2e extends Nn{constructor(){super({id:X2e.ID,label:Et(1158,"Detect Indentation from Content"),precondition:void 0,metadata:{description:Et(1159,"Detect the indentation from content.")}})}run(t,n){const r=t.get(pl),o=n.getModel();if(!o)return;const s=r.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget);o.detectIndentation(s.insertSpaces,s.tabSize)}};X2e.ID="editor.action.detectIndentation";let Tze=X2e;class kEo extends Nn{constructor(){super({id:"editor.action.reindentlines",label:Et(1160,"Reindent Lines"),precondition:Ze.writable,metadata:{description:Et(1161,"Reindent the lines of the editor.")},canTriggerInlineEdits:!0})}run(t,n){const r=t.get(bl),o=n.getModel();if(!o)return;const s=QRn(o,r,1,o.getLineCount());s.length>0&&(n.pushUndoStop(),n.executeEdits(this.id,s),n.pushUndoStop())}}class vEo extends Nn{constructor(){super({id:"editor.action.reindentselectedlines",label:Et(1162,"Reindent Selected Lines"),precondition:Ze.writable,metadata:{description:Et(1163,"Reindent the selected lines of the editor.")},canTriggerInlineEdits:!0})}run(t,n){const r=t.get(bl),o=n.getModel();if(!o)return;const s=n.getSelections();if(s===null)return;const a=[];for(const l of s){let d=l.startLineNumber,u=l.endLineNumber;if(d!==u&&l.endColumn===1&&u--,d===1){if(d===u)continue}else d--;const h=QRn(o,r,d,u);a.push(...h)}a.length>0&&(n.pushUndoStop(),n.executeEdits(this.id,a),n.pushUndoStop())}}class pEo{constructor(t,n){this._initialSelection=n,this._edits=[],this._selectionId=null;for(const r of t)r.range&&typeof r.text=="string"&&this._edits.push(r)}getEditOperations(t,n){for(const o of this._edits)n.addEditOperation(De.lift(o.range),o.text);let r=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(r=!0,this._selectionId=n.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(r=!0,this._selectionId=n.trackSelection(this._initialSelection,!1))),r||(this._selectionId=n.trackSelection(this._initialSelection))}computeCursorState(t,n){return n.getTrackedSelection(this._selectionId)}}var AH;let v0e=(AH=class{constructor(t,n){this.editor=t,this._languageConfigurationService=n,this.callOnDispose=new Pt,this.callOnModel=new Pt,this.callOnDispose.add(t.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(t.onDidChangeModel(()=>this.update())),this.callOnDispose.add(t.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(!this.editor.getOption(17)||this.editor.getOption(16)<4)&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:t})=>{this.trigger(t)}))}trigger(t){const n=this.editor.getSelections();if(n===null||n.length>1)return;const r=this.editor.getModel();if(!r||this.rangeContainsOnlyWhitespaceCharacters(r,t)||!this.editor.getOption(18)&&bEo(r,t)||!r.tokenization.isCheapToTokenize(t.getStartPosition().lineNumber))return;const s=this.editor.getOption(16),{tabSize:a,indentSize:l,insertSpaces:d}=r.getOptions(),u=[],h={shiftIndent:A=>k2.shiftIndent(A,A.length+1,a,l,d),unshiftIndent:A=>k2.unshiftIndent(A,A.length+1,a,l,d)};let f=t.startLineNumber,g=r.getLineContent(f);if(!/\S/.test(g.substring(0,t.startColumn-1))){const A=TK(s,r,r.getLanguageId(),f,h,this._languageConfigurationService);if(A!==null){const m=_s(g),v=d1(A,a),p=d1(m,a);if(v!==p){const b=JK(v,a,d);u.push({range:new De(f,1,f,m.length+1),text:b}),g=b+g.substring(m.length)}else{const b=fDn(r,f,this._languageConfigurationService);if(b===0||b===8)return}}}const k=f;for(;fr.tokenization.getLineTokens(v),getLanguageId:()=>r.getLanguageId(),getLanguageIdAtPosition:(v,p)=>r.getLanguageIdAtPosition(v,p)},getLineContent:v=>v===k?g:r.getLineContent(v)},r.getLanguageId(),f+1,h,this._languageConfigurationService);if(m!==null){const v=d1(m,a),p=d1(_s(r.getLineContent(f+1)),a);if(v!==p){const b=v-p;for(let O=f+1;O<=t.endLineNumber;O++){const w=r.getLineContent(O),y=_s(w),x=d1(y,a)+b,L=JK(x,a,d);L!==y&&u.push({range:new De(O,1,O,y.length+1),text:L})}}}}if(u.length>0){this.editor.pushUndoStop();const A=new pEo(u,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",A),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(t,n){const r=s=>s.trim().length===0;let o=!0;if(n.startLineNumber===n.endLineNumber){const a=t.getLineContent(n.startLineNumber).substring(n.startColumn-1,n.endColumn-1);o=r(a)}else for(let s=n.startLineNumber;s<=n.endLineNumber;s++){const a=t.getLineContent(s);if(s===n.startLineNumber){const l=a.substring(n.startColumn-1);o=r(l)}else if(s===n.endLineNumber){const l=a.substring(0,n.endColumn-1);o=r(l)}else o=t.getLineFirstNonWhitespaceColumn(s)===0;if(!o)break}return o}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},AH.ID="editor.contrib.autoIndentOnPaste",AH);v0e=gEo([mEo(1,bl)],v0e);function bEo(e,t){const n=r=>duo(e,r)===2;return n(t.getStartPosition())||n(t.getEndPosition())}function BRn(e,t,n,r){if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return;let o="";for(let a=0;a=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},xEo=function(e,t){return function(n,r){t(n,r,e)}},Vhe,pT;let VV=(pT=class{static get(t){return t.getContribution(Vhe.ID)}constructor(t,n){this.editor=t,this.editorWorkerService=n,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(t,n){var d;(d=this.currentRequest)==null||d.cancel();const r=this.editor.getSelection(),o=this.editor.getModel();if(!o||!r)return;let s=r;if(s.startLineNumber!==s.endLineNumber)return;const a=new jFn(this.editor,5),l=o.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=zd(u=>this.editorWorkerService.navigateValueSet(l,s,n)),this.currentRequest.then(u=>{var A;if(!u||!u.range||!u.value||!a.validate(this.editor))return;const h=De.lift(u.range);let f=u.range;const g=u.value.length-(s.endColumn-s.startColumn);f={startLineNumber:f.startLineNumber,startColumn:f.startColumn,endLineNumber:f.endLineNumber,endColumn:f.startColumn+u.value.length},g>1&&(s=new Rn(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+g-1));const k=new yEo(h,s,u.value);this.editor.pushUndoStop(),this.editor.executeCommand(t,k),this.editor.pushUndoStop(),this.decorations.set([{range:f,options:Vhe.DECORATION}]),(A=this.decorationRemover)==null||A.cancel(),this.decorationRemover=My(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Yi)}).catch(Yi)):Promise.resolve(void 0)}},Vhe=pT,pT.ID="editor.contrib.inPlaceReplaceController",pT.DECORATION=Ki.register({description:"in-place-replace",className:"valueSetReplacement"}),pT);VV=Vhe=CEo([xEo(1,Bm)],VV);class LEo extends Nn{constructor(){super({id:"editor.action.inPlaceReplace.up",label:Et(1240,"Replace with Previous Value"),precondition:Ze.writable,kbOpts:{kbExpr:Ze.editorTextFocus,primary:3159,weight:100}})}run(t,n){const r=VV.get(n);return r?r.run(this.id,!1):Promise.resolve(void 0)}}class SEo extends Nn{constructor(){super({id:"editor.action.inPlaceReplace.down",label:Et(1241,"Replace with Next Value"),precondition:Ze.writable,kbOpts:{kbExpr:Ze.editorTextFocus,primary:3161,weight:100}})}run(t,n){const r=VV.get(n);return r?r.run(this.id,!0):Promise.resolve(void 0)}}mo(VV.ID,VV,4);gn(LEo);gn(SEo);class TEo{constructor(t){this._selection=t,this._selectionId=null}getEditOperations(t,n){const r=EEo(t);r&&n.addEditOperation(r.range,r.text),this._selectionId=n.trackSelection(this._selection)}computeCursorState(t,n){return n.getTrackedSelection(this._selectionId)}}function EEo(e){const t=e.getLineCount(),n=e.getLineContent(t),r=$p(n)===-1;if(!(!t||r))return Jl.insert(new tt(t,e.getLineMaxColumn(t)),e.getEOL())}const q2e=class q2e extends Nn{constructor(){super({id:q2e.ID,label:Et(1242,"Insert Final New Line"),precondition:Ze.writable})}run(t,n,r){const o=n.getSelection();if(o===null)return;const s=new TEo(o);n.pushUndoStop(),n.executeCommands(this.id,[s]),n.pushUndoStop()}};q2e.ID="editor.action.insertFinalNewLine";let Eze=q2e;gn(Eze);class DEo extends Nn{constructor(){super({id:"expandLineSelection",label:Et(1243,"Expand Line Selection"),precondition:void 0,kbOpts:{weight:0,kbExpr:Ze.textInputFocus,primary:2090}})}run(t,n,r){if(r=r||{},!n.hasModel())return;const o=n._getViewModel();o.model.pushStackElement(),o.setCursorStates(r.source,3,sh.expandLineSelection(o,o.getCursorStates())),o.revealAllCursors(r.source,!0)}}gn(DEo);var QEo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Bce=function(e,t){return function(n,r){t(n,r,e)}},zhe;const FRn=new Ln("LinkedEditingInputVisible",!1),BEo="linked-editing-decoration";var bT;let zV=(bT=class extends ct{static get(t){return t.getContribution(zhe.ID)}constructor(t,n,r,o,s){super(),this.languageConfigurationService=o,this._syncRangesToken=0,this._localToDispose=this._register(new Pt),this._editor=t,this._providers=r.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=FRn.bindTo(n),this._debounceInformation=s.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new Pt),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(78)||a.hasChanged(106))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(t){const n=this._editor.getModel(),r=n!==null&&(this._editor.getOption(78)||this._editor.getOption(106))&&this._providers.has(n);if(r===this._enabled&&!t||(this._enabled=r,this.clearRanges(),this._localToDispose.clear(),!r||n===null))return;this._localToDispose.add(un.runAndSubscribe(n.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition()}));const o=new A2(this._debounceInformation.get(n)),s=()=>{this._rangeUpdateTriggerPromise=o.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(n))},a=new A2(0),l=d=>{this._rangeSyncTriggerPromise=a.trigger(()=>this._syncRanges(d))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{s()})),this._localToDispose.add(this._editor.onDidChangeModelContent(d=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const u=this._currentDecorations.getRange(0);if(u&&d.changes.every(h=>u.intersectRanges(h.range))){l(this._syncRangesToken);return}}s()})),this._localToDispose.add({dispose:()=>{o.dispose(),a.dispose()}}),this.updateRanges()}_syncRanges(t){if(!this._editor.hasModel()||t!==this._syncRangesToken||this._currentDecorations.length===0)return;const n=this._editor.getModel(),r=this._currentDecorations.getRange(0);if(!r||r.startLineNumber!==r.endLineNumber)return this.clearRanges();const o=n.getValueInRange(r);if(this._currentWordPattern){const a=o.match(this._currentWordPattern);if((a?a[0].length:0)!==o.length)return this.clearRanges()}const s=[];for(let a=1,l=this._currentDecorations.length;a1){this.clearRanges();return}const r=this._editor.getModel(),o=r.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===o){if(n.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const l=this._currentDecorations.getRange(0);if(l&&l.containsPosition(n))return}}if(!((a=this._currentRequestPosition)!=null&&a.equals(n))){const l=this._currentDecorations.getRange(0);l!=null&&l.containsPosition(n)||this.clearRanges()}this._currentRequestPosition=n,this._currentRequestModelVersion=o;const s=this._currentRequestCts=new Ya;try{const l=new wu(!1),d=await PRn(this._providers,r,n,s.token);if(this._debounceInformation.update(r,l.elapsed()),s!==this._currentRequestCts||(this._currentRequestCts=null,o!==r.getVersionId()))return;let u=[];d!=null&&d.ranges&&(u=d.ranges),this._currentWordPattern=(d==null?void 0:d.wordPattern)||this._languageWordPattern;let h=!1;for(let g=0,k=u.length;g({range:g,options:zhe.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(f),this._syncRangesToken++}catch(l){Sk(l)||Yi(l),(this._currentRequestCts===s||!this._currentRequestCts)&&this.clearRanges()}}},zhe=bT,bT.ID="editor.contrib.linkedEditing",bT.DECORATION=Ki.register({description:"linked-editing",stickiness:0,className:BEo}),bT);zV=zhe=QEo([Bce(1,Fi),Bce(2,Zn),Bce(3,bl),Bce(4,L2)],zV);class FEo extends Nn{constructor(){super({id:"editor.action.linkedEditing",label:Et(1276,"Start Linked Editing"),precondition:zt.and(Ze.writable,Ze.hasRenameProvider),kbOpts:{kbExpr:Ze.editorTextFocus,primary:3132,weight:100}})}runCommand(t,n){const r=t.get(Co),[o,s]=Array.isArray(n)&&n||[void 0,void 0];return pi.isUri(o)&&tt.isIPosition(s)?r.openCodeEditor({resource:o},r.getActiveCodeEditor()).then(a=>{a&&(a.setPosition(s),a.invokeWithinContext(l=>(this.reportTelemetry(l,a),this.run(l,a))))},Yi):super.runCommand(t,n)}run(t,n){const r=zV.get(n);return r?Promise.resolve(r.updateRanges(!0)):Promise.resolve()}}const PEo=$d.bindToContribution(zV.get);xn(new PEo({id:"cancelLinkedEditingInput",precondition:FRn,handler:e=>e.clearRanges(),kbOpts:{kbExpr:Ze.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function PRn(e,t,n,r){const o=e.ordered(t);return Aet(o.map(s=>async()=>{try{return await s.provideLinkedEditingRanges(t,n,r)}catch(a){Xc(a);return}}),s=>!!s&&Qf(s==null?void 0:s.ranges))}He("editor.linkedEditingBackground",{dark:Ut.fromHex("#f00").transparent(.3),light:Ut.fromHex("#f00").transparent(.3),hcDark:Ut.fromHex("#f00").transparent(.3),hcLight:Ut.white},j(1275,"Background color when the editor auto renames on type."));Qm("_executeLinkedEditingProvider",(e,t,n)=>{const{linkedEditingRangeProvider:r}=e.get(Zn);return PRn(r,t,n,Fr.None)});mo(zV.ID,zV,1);gn(FEo);let MEo=class{constructor(t,n){this._link=t,this._provider=n}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(t){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,t)).then(n=>(this._link=n||this._link,this._link.url?this.resolve(t):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};const YJ=class YJ{constructor(t){this._disposables=new Pt;let n=[];for(const[r,o]of t){const s=r.links.map(a=>new MEo(a,o));n=YJ._union(n,s),BM(r)&&(this._disposables??(this._disposables=new Pt),this._disposables.add(r))}this.links=n}dispose(){var t;(t=this._disposables)==null||t.dispose(),this.links.length=0}static _union(t,n){const r=[];let o,s,a,l;for(o=0,a=0,s=t.length,l=n.length;o{try{const d=await a.provideLinks(t,n);d&&(r[l]=[d,a])}catch(d){Xc(d)}});await Promise.all(o);let s=new p0e(YO(r));return n.isCancellationRequested&&(s.dispose(),s=p0e.Empty),s}ho.registerCommand("_executeLinkProvider",async(e,...t)=>{let[n,r]=t;yo(n instanceof pi),typeof r!="number"&&(r=0);const{linkProvider:o}=e.get(Zn),s=e.get(pl).getModel(n);if(!s)return[];const a=await MRn(o,s,Fr.None);if(!a)return[];for(let d=0;d=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Fce=function(e,t){return function(n,r){t(n,r,e)}},Dze,SF;let Lee=(SF=class extends ct{static get(t){return t.getContribution(Dze.ID)}constructor(t,n,r,o,s){super(),this.editor=t,this.openerService=n,this.notificationService=r,this.languageFeaturesService=o,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=s.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new Ss(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const a=this._register(new HOe(t));this._register(a.onMouseMoveOrRelevantKeyDown(([l,d])=>{this._onEditorMouseMove(l,d)})),this._register(a.onExecute(l=>{this.onEditorMouseUp(l)})),this._register(a.onCancel(l=>{this.cleanUpActiveLinkDecoration()})),this._register(t.onDidChangeConfiguration(l=>{l.hasChanged(79)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(t.onDidChangeModelContent(l=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(t.onDidChangeModel(l=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(t.onDidChangeModelLanguage(l=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(l=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(79))return;const t=this.editor.getModel();if(!t.isTooLargeForSyncing()&&this.providers.has(t)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=zd(n=>MRn(this.providers,t,n));try{const n=new wu(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(t,n.elapsed()),t.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(n){Yi(n)}finally{this.computePromise=null}}}updateDecorations(t){const n=this.editor.getOption(86)==="altKey",r=[],o=Object.keys(this.currentOccurrences);for(const a of o){const l=this.currentOccurrences[a];r.push(l.decorationId)}const s=[];if(t)for(const a of t)s.push(AW.decoration(a,n));this.editor.changeDecorations(a=>{const l=a.deltaDecorations(r,s);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let d=0,u=l.length;d{o.activate(s,r),this.activeLinkDecorationId=o.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const t=this.editor.getOption(86)==="altKey";if(this.activeLinkDecorationId){const n=this.currentOccurrences[this.activeLinkDecorationId];n&&this.editor.changeDecorations(r=>{n.deactivate(r,t)}),this.activeLinkDecorationId=null}}onEditorMouseUp(t){if(!this.isEnabled(t))return;const n=this.getLinkOccurrence(t.target.position);n&&this.openLinkOccurrence(n,t.hasSideBySideModifier,!0)}openLinkOccurrence(t,n,r=!1){if(!this.openerService)return;const{link:o}=t;o.resolve(Fr.None).then(s=>{if(typeof s=="string"&&this.editor.hasModel()){const a=this.editor.getModel().uri;if(a.scheme===Li.file&&s.startsWith(`${Li.file}:`)){const l=pi.parse(s);if(l.scheme===Li.file){const d=N3(l);let u=null;d.startsWith("/./")||d.startsWith("\\.\\")?u=`.${d.substr(1)}`:(d.startsWith("//./")||d.startsWith("\\\\.\\"))&&(u=`.${d.substr(2)}`),u&&(s=H7n(a,u))}}}return this.openerService.open(s,{openToSide:n,fromUserGesture:r,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},s=>{const a=s instanceof Error?s.message:s;a==="invalid"?this.notificationService.warn(j(1277,"Failed to open this link because it is not well-formed: {0}",o.url.toString())):a==="missing"?this.notificationService.warn(j(1278,"Failed to open this link because its target is missing.")):Yi(s)})}getLinkOccurrence(t){if(!this.editor.hasModel()||!t)return null;const n=this.editor.getModel().getDecorationsInRange({startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:t.lineNumber,endColumn:t.column},0,!0);for(const r of n){const o=this.currentOccurrences[r.id];if(o)return o}return null}isEnabled(t,n){return!!(t.target.type===6&&(t.hasTriggerModifier||n&&n.keyCodeIsTriggerKey||t.isMiddleClick&&t.mouseMiddleClickAction==="openLink"))}stop(){var t;this.computeLinks.cancel(),this.activeLinksList&&((t=this.activeLinksList)==null||t.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}},Dze=SF,SF.ID="editor.linkDetector",SF);Lee=Dze=REo([Fce(1,B6),Fce(2,cc),Fce(3,Zn),Fce(4,L2)],Lee);const cLt={general:Ki.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Ki.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class AW{static decoration(t,n){return{range:t.range,options:AW._getOptions(t,n,!1)}}static _getOptions(t,n,r){const o={...r?cLt.active:cLt.general};return o.hoverMessage=IEo(t,n),o}constructor(t,n){this.link=t,this.decorationId=n}activate(t,n){t.changeDecorationOptions(this.decorationId,AW._getOptions(this.link,n,!0))}deactivate(t,n){t.changeDecorationOptions(this.decorationId,AW._getOptions(this.link,n,!1))}}function IEo(e,t){const n=e.url&&/^command:/i.test(e.url.toString()),r=e.tooltip?e.tooltip:n?j(1279,"Execute command"):j(1280,"Follow link"),o=t?Pr?j(1281,"cmd + click"):j(1282,"ctrl + click"):Pr?j(1283,"option + click"):j(1284,"alt + click");if(e.url){let s="";if(/^command:/i.test(e.url.toString())){const l=e.url.toString().match(/^command:([^?#]+)/);if(l){const d=l[1];s=j(1285,"Execute command {0}",d)}}return new xA("",!0).appendLink(e.url.toString(!0).replace(/ /g,"%20"),r,s).appendMarkdown(` (${o})`)}else return new xA().appendText(`${r} (${o})`)}class NEo extends Nn{constructor(){super({id:"editor.action.openLink",label:Et(1286,"Open Link"),precondition:void 0})}run(t,n){const r=Lee.get(n);if(!r||!n.hasModel())return;const o=n.getSelections();for(const s of o){const a=r.getLinkOccurrence(s.getEndPosition());a&&r.openLinkOccurrence(a,!1)}}}mo(Lee.ID,Lee,1);gn(NEo);const tlt=class tlt extends ct{constructor(t){super(),this._editor=t,this._register(this._editor.onMouseDown(n=>{const r=this._editor.getOption(133);r>=0&&n.target.type===6&&n.target.position.column>=r&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}};tlt.ID="editor.contrib.longLinesHelper";let b0e=tlt;mo(b0e.ID,b0e,2);const nlt=class nlt extends ct{constructor(t){super(),this._editor=t;const n=ml(this._editor),r=n.getOption(171);this._register(xi(o=>{if(!r.read(o))return;const s=n.domNode.read(o);if(!s)return;const a=o.store.add(Pet("scrollingSession",void 0));o.store.add(this._editor.onMouseDown(d=>{if(a.read(void 0)){a.set(void 0,void 0);return}if(!d.event.middleButton)return;d.event.stopPropagation(),d.event.preventDefault();const h=new Pt,f=new mu(d.event.posx,d.event.posy),k=UEo(oi(s),f,h).map(v=>v.subtract(f).withThreshold(5)),A=s.getBoundingClientRect(),m=new mu(f.x-A.left,f.y-A.top);a.set({mouseDeltaAfterThreshold:k,initialMousePosInEditor:m,didScroll:!1,dispose:()=>h.dispose()},void 0),h.add(this._editor.onMouseUp(v=>{const p=a.read(void 0);p&&p.didScroll&&a.set(void 0,void 0)})),h.add(this._editor.onKeyDown(v=>{a.set(void 0,void 0)}))})),o.store.add(xi(d=>{const u=a.read(d);if(!u)return;let h=Date.now();d.store.add(xi(g=>{i0e.instance.invalidateOnNextAnimationFrame(g);const k=Date.now(),A=k-h;h=k;const m=u.mouseDeltaAfterThreshold.read(void 0),v=A/32,p=m.scale(v),b=new mu(this._editor.getScrollLeft(),this._editor.getScrollTop());this._editor.setScrollPosition(jEo(b.add(p))),p.isZero()||(u.didScroll=!0)}));const f=Wt(g=>{const k=u.mouseDeltaAfterThreshold.read(g);let A="";return A+=k.y<0?"n":k.y>0?"s":"",A+=k.x<0?"w":k.x>0?"e":"",A});d.store.add(xi(g=>{s.setAttribute("data-scroll-direction",f.read(g))}))}));const l=o.store.add(ur.div({class:["scroll-editor-on-middle-click-dot",a.map(d=>d?"":"hidden")],style:{left:a.map(d=>d?d.initialMousePosInEditor.x:0),top:a.map(d=>d?d.initialMousePosInEditor.y:0)}}).toDisposableLiveElement());o.store.add(RU(s,l.element)),o.store.add(xi(d=>{const u=a.read(d);s.classList.toggle("scroll-editor-on-middle-click-editor",!!u)}))}))}};nlt.ID="editor.contrib.middleScroll";let O0e=nlt;function UEo(e,t,n){const r=Bi("pos",t);return n.add(pt(e,"mousemove",o=>{r.set(new mu(o.pageX,o.pageY),void 0)})),r}function jEo(e){return{scrollLeft:e.x,scrollTop:e.y}}mo(O0e.ID,O0e,2);const WEo=He("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},j(1563,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);He("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},j(1564,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);He("editor.wordHighlightTextBackground",WEo,j(1565,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const HEo=He("editor.wordHighlightBorder",{light:null,dark:null,hcDark:qa,hcLight:qa},j(1566,"Border color of a symbol during read-access, like reading a variable."));He("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:qa,hcLight:qa},j(1567,"Border color of a symbol during write-access, like writing to a variable."));He("editor.wordHighlightTextBorder",HEo,j(1568,"Border color of a textual occurrence for a symbol."));const VEo=He("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",j(1569,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),zEo=He("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",j(1570,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),ZEo=He("editorOverviewRuler.wordHighlightTextForeground",PDn,j(1571,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),YEo=Ki.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:Gl(zEo),position:ck.Center},minimap:{color:Gl(hOe),position:1}}),XEo=Ki.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:Gl(ZEo),position:ck.Center},minimap:{color:Gl(hOe),position:1}}),qEo=Ki.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:Gl(PDn),position:ck.Center},minimap:{color:Gl(hOe),position:1}}),GEo=Ki.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),KEo=Ki.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:Gl(VEo),position:ck.Center},minimap:{color:Gl(hOe),position:1}});function JEo(e){return e===TV.Write?YEo:e===TV.Text?XEo:KEo}function _Eo(e){return e?GEo:qEo}x2((e,t)=>{const n=e.getColor(itt);n&&t.addRule(`.monaco-editor .selectionHighlight { background-color: ${n.transparent(.5)}; }`)});var $Eo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},e7o=function(e,t){return function(n,r){t(n,r,e)}},Qze;function xE(e,t){const n=t.filter(r=>!e.find(o=>o.equals(r)));if(n.length>=1){const r=n.map(s=>`line ${s.viewState.position.lineNumber} column ${s.viewState.position.column}`).join(", "),o=n.length===1?j(1288,"Cursor added: {0}",r):j(1289,"Cursors added: {0}",r);yO(o)}}class t7o extends Nn{constructor(){super({id:"editor.action.insertCursorAbove",label:Et(1298,"Add Cursor Above"),precondition:void 0,kbOpts:{kbExpr:Ze.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:Yn.MenubarSelectionMenu,group:"3_multi",title:j(1290,"&&Add Cursor Above"),order:2}})}run(t,n,r){if(!n.hasModel())return;let o=!0;r&&r.logicalLine===!1&&(o=!1);const s=n._getViewModel();if(s.cursorConfig.readOnly)return;s.model.pushStackElement();const a=s.getCursorStates();s.setCursorStates(r.source,3,sh.addCursorUp(s,a,o)),s.revealTopMostCursor(r.source),xE(a,s.getCursorStates())}}class n7o extends Nn{constructor(){super({id:"editor.action.insertCursorBelow",label:Et(1299,"Add Cursor Below"),precondition:void 0,kbOpts:{kbExpr:Ze.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:Yn.MenubarSelectionMenu,group:"3_multi",title:j(1291,"A&&dd Cursor Below"),order:3}})}run(t,n,r){if(!n.hasModel())return;let o=!0;r&&r.logicalLine===!1&&(o=!1);const s=n._getViewModel();if(s.cursorConfig.readOnly)return;s.model.pushStackElement();const a=s.getCursorStates();s.setCursorStates(r.source,3,sh.addCursorDown(s,a,o)),s.revealBottomMostCursor(r.source),xE(a,s.getCursorStates())}}class i7o extends Nn{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:Et(1300,"Add Cursors to Line Ends"),precondition:void 0,kbOpts:{kbExpr:Ze.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:Yn.MenubarSelectionMenu,group:"3_multi",title:j(1292,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(t,n,r){if(!t.isEmpty()){for(let o=t.startLineNumber;o1&&r.push(new Rn(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn))}}run(t,n){if(!n.hasModel())return;const r=n.getModel(),o=n.getSelections(),s=n._getViewModel(),a=s.getCursorStates(),l=[];o.forEach(d=>this.getCursorsForSelection(d,r,l)),l.length>0&&n.setSelections(l),xE(a,s.getCursorStates())}}class r7o extends Nn{constructor(){super({id:"editor.action.addCursorsToBottom",label:Et(1301,"Add Cursors to Bottom"),precondition:void 0})}run(t,n){if(!n.hasModel())return;const r=n.getSelections(),o=n.getModel().getLineCount(),s=[];for(let d=r[0].startLineNumber;d<=o;d++)s.push(new Rn(d,r[0].startColumn,d,r[0].endColumn));const a=n._getViewModel(),l=a.getCursorStates();s.length>0&&n.setSelections(s),xE(l,a.getCursorStates())}}class o7o extends Nn{constructor(){super({id:"editor.action.addCursorsToTop",label:Et(1302,"Add Cursors to Top"),precondition:void 0})}run(t,n){if(!n.hasModel())return;const r=n.getSelections(),o=[];for(let l=r[0].startLineNumber;l>=1;l--)o.push(new Rn(l,r[0].startColumn,l,r[0].endColumn));const s=n._getViewModel(),a=s.getCursorStates();o.length>0&&n.setSelections(o),xE(a,s.getCursorStates())}}class Pce{constructor(t,n,r){this.selections=t,this.revealRange=n,this.revealScrollType=r}}class See{static create(t,n){if(!t.hasModel())return null;const r=n.getState();if(!t.hasTextFocus()&&r.isRevealed&&r.searchString.length>0)return new See(t,n,!1,r.searchString,r.wholeWord,r.matchCase,null);let o=!1,s,a;const l=t.getSelections();l.length===1&&l[0].isEmpty()?(o=!0,s=!0,a=!0):(s=r.wholeWord,a=r.matchCase);const d=t.getSelection();let u,h=null;if(d.isEmpty()){const f=t.getConfiguredWordAtPosition(d.getStartPosition());if(!f)return null;u=f.word,h=new Rn(d.startLineNumber,f.startColumn,d.startLineNumber,f.endColumn)}else u=t.getModel().getValueInRange(d).replace(/\r\n/g,` `);return new See(t,n,o,u,s,a,h)}constructor(t,n,r,o,s,a,l){this._editor=t,this.findController=n,this.isDisconnectedFromFindController=r,this.searchText=o,this.wholeWord=s,this.matchCase=a,this.currentMatch=l}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const t=this._getNextMatch();if(!t)return null;const n=this._editor.getSelections();return new Pce(n.concat(t),t,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const t=this._getNextMatch();if(!t)return null;const n=this._editor.getSelections();return new Pce(n.slice(0,n.length-1).concat(t),t,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const o=this.currentMatch;return this.currentMatch=null,o}this.findController.highlightFindOptions();const t=this._editor.getSelections(),n=t[t.length-1],r=this._editor.getModel().findNextMatch(this.searchText,n.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return r?new Rn(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const t=this._getPreviousMatch();if(!t)return null;const n=this._editor.getSelections();return new Pce(n.concat(t),t,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const t=this._getPreviousMatch();if(!t)return null;const n=this._editor.getSelections();return new Pce(n.slice(0,n.length-1).concat(t),t,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const o=this.currentMatch;return this.currentMatch=null,o}this.findController.highlightFindOptions();const t=this._editor.getSelections(),n=t[t.length-1],r=this._editor.getModel().findPreviousMatch(this.searchText,n.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return r?new Rn(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn):null}selectAll(t){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const n=this._editor.getModel();return t?n.findMatches(this.searchText,t,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824):n.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824)}}const G2e=class G2e extends ct{static get(t){return t.getContribution(G2e.ID)}constructor(t){super(),this._sessionDispose=this._register(new Pt),this._editor=t,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(t){if(!this._session){const n=See.create(this._editor,t);if(!n)return;this._session=n;const r={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(r.wholeWordOverride=1,r.matchCaseOverride=1,r.isRegexOverride=2),t.getState().change(r,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(o=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(t.getState().onFindReplaceStateChange(o=>{(o.matchCase||o.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const t={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(t,!1)}this._session=null}_setSelections(t){this._ignoreSelectionChange=!0,this._editor.setSelections(t),this._ignoreSelectionChange=!1}_expandEmptyToWord(t,n){if(!n.isEmpty())return n;const r=this._editor.getConfiguredWordAtPosition(n.getStartPosition());return r?new Rn(n.startLineNumber,r.startColumn,n.startLineNumber,r.endColumn):n}_applySessionResult(t){t&&(this._setSelections(t.selections),t.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(t.revealRange,t.revealScrollType))}getSession(t){return this._session}addSelectionToNextFindMatch(t){if(this._editor.hasModel()){if(!this._session){const n=this._editor.getSelections();if(n.length>1){const o=t.getState().matchCase;if(!RRn(this._editor.getModel(),n,o)){const a=this._editor.getModel(),l=[];for(let d=0,u=n.length;d0&&r.isRegex){const o=this._editor.getModel();r.searchScope?n=o.findMatches(r.searchString,r.searchScope,r.isRegex,r.matchCase,r.wholeWord?this._editor.getOption(148):null,!1,1073741824):n=o.findMatches(r.searchString,!0,r.isRegex,r.matchCase,r.wholeWord?this._editor.getOption(148):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(t),!this._session)return;n=this._session.selectAll(r.searchScope)}if(n.length>0){const o=this._editor.getSelection();for(let s=0,a=n.length;snew Rn(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn)))}}};G2e.ID="editor.contrib.multiCursorController";let ZV=G2e;class EZ extends Nn{run(t,n){const r=ZV.get(n);if(!r)return;const o=n._getViewModel();if(o){const s=o.getCursorStates(),a=Sm.get(n);if(a)this._run(r,a);else{const l=t.get($n).createInstance(Sm,n);this._run(r,l),l.dispose()}xE(s,o.getCursorStates())}}}class s7o extends EZ{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:Et(1303,"Add Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:Ze.focus,primary:2082,weight:100},menuOpts:{menuId:Yn.MenubarSelectionMenu,group:"3_multi",title:j(1293,"Add &&Next Occurrence"),order:5}})}_run(t,n){t.addSelectionToNextFindMatch(n)}}class a7o extends EZ{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:Et(1304,"Add Selection to Previous Find Match"),precondition:void 0,menuOpts:{menuId:Yn.MenubarSelectionMenu,group:"3_multi",title:j(1294,"Add P&&revious Occurrence"),order:6}})}_run(t,n){t.addSelectionToPreviousFindMatch(n)}}class l7o extends EZ{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:Et(1305,"Move Last Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:Ze.focus,primary:qc(2089,2082),weight:100}})}_run(t,n){t.moveSelectionToNextFindMatch(n)}}class c7o extends EZ{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:Et(1306,"Move Last Selection to Previous Find Match"),precondition:void 0})}_run(t,n){t.moveSelectionToPreviousFindMatch(n)}}class d7o extends EZ{constructor(){super({id:"editor.action.selectHighlights",label:Et(1307,"Select All Occurrences of Find Match"),precondition:void 0,kbOpts:{kbExpr:Ze.focus,primary:3114,weight:100},menuOpts:{menuId:Yn.MenubarSelectionMenu,group:"3_multi",title:j(1295,"Select All &&Occurrences"),order:7}})}_run(t,n){t.selectAll(n)}}class u7o extends EZ{constructor(){super({id:"editor.action.changeAll",label:Et(1308,"Change All Occurrences"),precondition:zt.and(Ze.writable,Ze.editorTextFocus),kbOpts:{kbExpr:Ze.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(t,n){t.selectAll(n)}}class h7o{constructor(t,n,r,o,s){this._model=t,this._searchText=n,this._matchCase=r,this._wordSeparators=o,this._cachedFindMatches=null,this._modelVersionId=this._model.getVersionId(),s&&this._model===s._model&&this._searchText===s._searchText&&this._matchCase===s._matchCase&&this._wordSeparators===s._wordSeparators&&this._modelVersionId===s._modelVersionId&&(this._cachedFindMatches=s._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(t=>t.range),this._cachedFindMatches.sort(De.compareRangesUsingStarts)),this._cachedFindMatches}}var TF;let w0e=(TF=class extends ct{constructor(t,n){super(),this._languageFeaturesService=n,this.editor=t,this._isEnabled=t.getOption(122),this._isEnabledMultiline=t.getOption(124),this._maxLength=t.getOption(123),this._decorations=t.createDecorationsCollection(),this.updateSoon=this._register(new Ss(()=>this._update(),300)),this.state=null,this._register(t.onDidChangeConfiguration(o=>{this._isEnabled=t.getOption(122),this._isEnabledMultiline=t.getOption(124),this._maxLength=t.getOption(123)})),this._register(t.onDidChangeCursorSelection(o=>{this._isEnabled&&(o.selection.isEmpty()?o.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(t.onDidChangeModel(o=>{this._setState(null)})),this._register(t.onDidChangeModelContent(o=>{this._isEnabled&&this.updateSoon.schedule()}));const r=Sm.get(t);r&&this._register(r.getState().onFindReplaceStateChange(o=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(Qze._createState(this.state,this._isEnabled,this._isEnabledMultiline,this._maxLength,this.editor))}static _createState(t,n,r,o,s){if(!n||!s.hasModel())return null;if(!r){const f=s.getSelection();if(f.startLineNumber!==f.endLineNumber)return null}const a=ZV.get(s);if(!a)return null;const l=Sm.get(s);if(!l)return null;let d=a.getSession(l);if(!d){const f=s.getSelections();if(f.length>1){const k=l.getState().matchCase;if(!RRn(s.getModel(),f,k))return null}d=See.create(s,l)}if(!d||d.currentMatch||/^[ \t]+$/.test(d.searchText)||o>0&&d.searchText.length>o)return null;const u=l.getState(),h=u.matchCase;if(u.isRevealed){let f=u.searchString;h||(f=f.toLowerCase());let g=d.searchText;if(h||(g=g.toLowerCase()),f===g&&d.matchCase===u.matchCase&&d.wholeWord===u.wholeWord&&!u.isRegex)return null}return new h7o(s.getModel(),d.searchText,d.matchCase,d.wholeWord?s.getOption(148):null,t)}_setState(t){if(this.state=t,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const n=this.editor.getModel();if(n.isTooLargeForTokenization())return;const r=this.state.findMatches(),o=this.editor.getSelections();o.sort(De.compareRangesUsingStarts);const s=[];for(let u=0,h=0,f=r.length,g=o.length;u=g)s.push(k),u++;else{const A=De.compareRangesUsingStarts(k,o[h]);A<0?((o[h].isEmpty()||!De.areIntersecting(k,o[h]))&&s.push(k),u++):(A>0||u++,h++)}}const a=this.editor.getOption(90)!=="off",l=this._languageFeaturesService.documentHighlightProvider.has(n)&&a,d=s.map(u=>({range:u,options:_Eo(l)}));this._decorations.set(d)}dispose(){this._setState(null),super.dispose()}},Qze=TF,TF.ID="editor.contrib.selectionHighlighter",TF);w0e=Qze=$Eo([e7o(1,Zn)],w0e);function RRn(e,t,n){const r=dLt(e,t[0],!n);for(let o=1,s=t.length;o{const[n,r,o]=t;yo(pi.isUri(n)),yo(tt.isIPosition(r)),yo(typeof o=="string"||!o);const s=e.get(Zn),a=await e.get(Uf).createModelReference(n);try{const l=await IRn(s.signatureHelpProvider,a.object.textEditorModel,tt.lift(r),{triggerKind:py.Invoke,isRetrigger:!1,triggerCharacter:o},Fr.None);return l?(setTimeout(()=>l.dispose(),0),l.value):void 0}finally{a.dispose()}});var bS;(function(e){e.Default={type:0};class t{constructor(o,s){this.request=o,this.previouslyActiveHints=s,this.type=2}}e.Pending=t;class n{constructor(o){this.hints=o,this.type=1}}e.Active=n})(bS||(bS={}));const K2e=class K2e extends ct{constructor(t,n,r=K2e.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new it),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=bS.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new is),this.triggerChars=new tme,this.retriggerChars=new tme,this.triggerId=0,this.editor=t,this.providers=n,this.throttledDelayer=new A2(r),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(o=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(o=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(o=>this.onCursorChange(o))),this._register(this.editor.onDidChangeModelContent(o=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(o=>this.onDidType(o))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(t){this._state.type===2&&this._state.request.cancel(),this._state=t}cancel(t=!1){this.state=bS.Default,this.throttledDelayer.cancel(),t||this._onChangedHints.fire(void 0)}trigger(t,n){const r=this.editor.getModel();if(!r||!this.providers.has(r))return;const o=++this.triggerId;this._pendingTriggers.push(t),this.throttledDelayer.trigger(()=>this.doTrigger(o),n).catch(Yi)}next(){if(this.state.type!==1)return;const t=this.state.hints.signatures.length,n=this.state.hints.activeSignature,r=n%t===t-1,o=this.editor.getOption(98).cycle;if((t<2||r)&&!o){this.cancel();return}this.updateActiveSignature(r&&o?0:n+1)}previous(){if(this.state.type!==1)return;const t=this.state.hints.signatures.length,n=this.state.hints.activeSignature,r=n===0,o=this.editor.getOption(98).cycle;if((t<2||r)&&!o){this.cancel();return}this.updateActiveSignature(r&&o?t-1:n-1)}updateActiveSignature(t){this.state.type===1&&(this.state=new bS.Active({...this.state.hints,activeSignature:t}),this._onChangedHints.fire(this.state.hints))}async doTrigger(t){const n=this.state.type===1||this.state.type===2,r=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const o=this._pendingTriggers.reduce(g7o);this._pendingTriggers=[];const s={triggerKind:o.triggerKind,triggerCharacter:o.triggerCharacter,isRetrigger:n,activeSignatureHelp:r};if(!this.editor.hasModel())return!1;const a=this.editor.getModel(),l=this.editor.getPosition();this.state=new bS.Pending(zd(d=>IRn(this.providers,a,l,s,d)),r);try{const d=await this.state.request;return t!==this.triggerId?(d==null||d.dispose(),!1):!d||!d.value.signatures||d.value.signatures.length===0?(d==null||d.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new bS.Active(d.value),this._lastSignatureHelpResult.value=d,this._onChangedHints.fire(this.state.hints),!0)}catch(d){return t===this.triggerId&&(this.state=bS.Default),Yi(d),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const t=this.editor.getModel();if(t)for(const n of this.providers.ordered(t)){for(const r of n.signatureHelpTriggerCharacters||[])if(r.length){const o=r.charCodeAt(0);this.triggerChars.add(o),this.retriggerChars.add(o)}for(const r of n.signatureHelpRetriggerCharacters||[])r.length&&this.retriggerChars.add(r.charCodeAt(0))}}onDidType(t){if(!this.triggerOnType)return;const n=t.length-1,r=t.charCodeAt(n);(this.triggerChars.has(r)||this.isTriggered&&this.retriggerChars.has(r))&&this.trigger({triggerKind:py.TriggerCharacter,triggerCharacter:t.charAt(n)})}onCursorChange(t){t.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:py.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:py.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(98).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};K2e.DEFAULT_DELAY=120;let Bze=K2e;function g7o(e,t){switch(t.triggerKind){case py.Invoke:return t;case py.ContentChange:return e;case py.TriggerCharacter:default:return t}}var m7o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},uLt=function(e,t){return function(n,r){t(n,r,e)}},Fze;const k0=ln,k7o=Ra("parameter-hints-next",Jt.chevronDown,j(1312,"Icon for show next parameter hint.")),v7o=Ra("parameter-hints-previous",Jt.chevronUp,j(1313,"Icon for show previous parameter hint."));var EF;let Pze=(EF=class extends ct{constructor(t,n,r,o){super(),this.editor=t,this.model=n,this.markdownRendererService=o,this.renderDisposeables=this._register(new Pt),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.keyVisible=qP.Visible.bindTo(r),this.keyMultipleSignatures=qP.MultipleSignatures.bindTo(r)}createParameterHintDOMNodes(){const t=k0(".editor-widget.parameter-hints-widget"),n=tn(t,k0(".phwrapper"));n.tabIndex=-1;const r=tn(n,k0(".controls")),o=tn(r,k0(".button"+mi.asCSSSelector(v7o))),s=tn(r,k0(".overloads")),a=tn(r,k0(".button"+mi.asCSSSelector(k7o)));this._register(pt(o,"click",g=>{Bo.stop(g),this.previous()})),this._register(pt(a,"click",g=>{Bo.stop(g),this.next()}));const l=k0(".body"),d=new tre(l,{alwaysConsumeMouseWheel:!0});this._register(d),n.appendChild(d.getDomNode());const u=tn(l,k0(".signature")),h=tn(l,k0(".docs"));t.style.userSelect="text",this.domNodes={element:t,signature:u,overloads:s,docs:h,scrollbar:d},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(g=>{this.visible&&this.editor.layoutContentWidget(this)}));const f=()=>{if(!this.domNodes)return;const g=this.editor.getOption(59),k=this.domNodes.element;k.style.fontSize=`${g.fontSize}px`,k.style.lineHeight=`${g.lineHeight/g.fontSize}`,k.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",g.fontFamily),k.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",pm.fontFamily)};f(),this._register(un.chain(this.editor.onDidChangeConfiguration.bind(this.editor),g=>g.filter(k=>k.hasChanged(59)))(f)),this._register(this.editor.onDidLayoutChange(g=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var t;(t=this.domNodes)==null||t.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var t;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(t=this.domNodes)==null||t.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(t){if(this.renderDisposeables.clear(),!this.domNodes)return;const n=t.signatures.length>1;this.domNodes.element.classList.toggle("multiple",n),this.keyMultipleSignatures.set(n),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const r=t.signatures[t.activeSignature];if(!r)return;const o=tn(this.domNodes.signature,k0(".code")),s=r.parameters.length>0,a=r.activeParameter??t.activeParameter;if(s)this.renderParameters(o,r,a);else{const u=tn(o,k0("span"));u.textContent=r.label}const l=r.parameters[a];if(l!=null&&l.documentation){const u=k0("span.documentation");if(typeof l.documentation=="string")u.textContent=l.documentation;else{const h=this.renderMarkdownDocs(l.documentation);u.appendChild(h.element)}tn(this.domNodes.docs,k0("p",{},u))}if(r.documentation!==void 0)if(typeof r.documentation=="string")tn(this.domNodes.docs,k0("p",{},r.documentation));else{const u=this.renderMarkdownDocs(r.documentation);tn(this.domNodes.docs,u.element)}const d=this.hasDocs(r,l);if(this.domNodes.signature.classList.toggle("has-docs",d),this.domNodes.docs.classList.toggle("empty",!d),this.domNodes.overloads.textContent=String(t.activeSignature+1).padStart(t.signatures.length.toString().length,"0")+"/"+t.signatures.length,l){let u="";const h=r.parameters[a];Array.isArray(h.label)?u=r.label.substring(h.label[0],h.label[1]):u=h.label,h.documentation&&(u+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),r.documentation&&(u+=typeof r.documentation=="string"?`, ${r.documentation}`:`, ${r.documentation.value}`),this.announcedLabel!==u&&(kg(j(1314,"{0}, hint",u)),this.announcedLabel=u)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(t){const n=this.renderDisposeables.add(this.markdownRendererService.render(t,{context:this.editor,asyncRenderCallback:()=>{var r;(r=this.domNodes)==null||r.scrollbar.scanDomNode()}}));return n.element.classList.add("markdown-docs"),n}hasDocs(t,n){return!!(n&&typeof n.documentation=="string"&&p5(n.documentation).length>0||n&&typeof n.documentation=="object"&&p5(n.documentation).value.length>0||t.documentation&&typeof t.documentation=="string"&&p5(t.documentation).length>0||t.documentation&&typeof t.documentation=="object"&&p5(t.documentation.value).length>0)}renderParameters(t,n,r){const[o,s]=this.getParameterLabelOffsets(n,r),a=document.createElement("span");a.textContent=n.label.substring(0,o);const l=document.createElement("span");l.textContent=n.label.substring(o,s),l.className="parameter active";const d=document.createElement("span");d.textContent=n.label.substring(s),tn(t,a,l,d)}getParameterLabelOffsets(t,n){const r=t.parameters[n];if(r){if(Array.isArray(r.label))return r.label;if(r.label.length){const o=new RegExp(`(\\W|^)${j1(r.label)}(?=\\W|$)`,"g");o.test(t.label);const s=o.lastIndex-r.label.length;return s>=0?[s,o.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return Fze.ID}updateMaxHeight(){if(!this.domNodes)return;const n=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=n;const r=this.domNodes.element.getElementsByClassName("phwrapper");r.length&&(r[0].style.maxHeight=n)}},Fze=EF,EF.ID="editor.widget.parameterHintsWidget",EF);Pze=Fze=m7o([uLt(2,Fi),uLt(3,D4)],Pze);He("editorHoverWidget.highlightForeground",DU,j(1315,"Foreground color of the active item in the parameter hint."));var p7o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},hLt=function(e,t){return function(n,r){t(n,r,e)}},Mze,DF;let YV=(DF=class extends ct{static get(t){return t.getContribution(Mze.ID)}constructor(t,n,r){super(),this.editor=t,this.model=this._register(new Bze(t,r.signatureHelpProvider)),this._register(this.model.onChangedHints(o=>{var s;o?(this.widget.value.show(),this.widget.value.render(o)):(s=this.widget.rawValue)==null||s.hide()})),this.widget=new Kh(()=>this._register(n.createInstance(Pze,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var t;(t=this.widget.rawValue)==null||t.previous()}next(){var t;(t=this.widget.rawValue)==null||t.next()}trigger(t){this.model.trigger(t,0)}},Mze=DF,DF.ID="editor.controller.parameterHints",DF);YV=Mze=p7o([hLt(1,$n),hLt(2,Zn)],YV);class b7o extends Nn{constructor(){super({id:"editor.action.triggerParameterHints",label:Et(1311,"Trigger Parameter Hints"),precondition:Ze.hasSignatureHelpProvider,kbOpts:{kbExpr:Ze.editorTextFocus,primary:3082,weight:100}})}run(t,n){const r=YV.get(n);r==null||r.trigger({triggerKind:py.Invoke})}}mo(YV.ID,YV,2);gn(b7o);const xit=175,Lit=$d.bindToContribution(YV.get);xn(new Lit({id:"closeParameterHints",precondition:qP.Visible,handler:e=>e.cancel(),kbOpts:{weight:xit,kbExpr:Ze.focus,primary:9,secondary:[1033]}}));xn(new Lit({id:"showPrevParameterHint",precondition:zt.and(qP.Visible,qP.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:xit,kbExpr:Ze.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));xn(new Lit({id:"showNextParameterHint",precondition:zt.and(qP.Visible,qP.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:xit,kbExpr:Ze.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));const ilt=class ilt extends ct{constructor(t){super(),this._editor=t,this._editorObs=ml(this._editor),this._placeholderText=this._editorObs.getOption(100),this._state=Gh({owner:this,equalsFn:IUe},n=>{const r=this._placeholderText.read(n);if(r&&this._editorObs.valueIsEmpty.read(n))return{placeholder:r}}),this._shouldViewBeAlive=O7o(this,n=>{var r;return((r=this._state.read(n))==null?void 0:r.placeholder)!==void 0}),this._view=Wt(n=>{if(!this._shouldViewBeAlive.read(n))return;const r=wo("div.editorPlaceholder");n.store.add(xi(o=>{const s=this._state.read(o),a=(s==null?void 0:s.placeholder)!==void 0;r.root.style.display=a?"block":"none",r.root.innerText=(s==null?void 0:s.placeholder)??""})),n.store.add(xi(o=>{const s=this._editorObs.layoutInfo.read(o);r.root.style.left=`${s.contentLeft}px`,r.root.style.width=s.contentWidth-s.verticalScrollbarWidth+"px",r.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),n.store.add(xi(o=>{r.root.style.fontFamily=this._editorObs.getOption(58).read(o),r.root.style.fontSize=this._editorObs.getOption(61).read(o)+"px",r.root.style.lineHeight=this._editorObs.getOption(75).read(o)+"px"})),n.store.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:ha(0),position:ha(null),domNode:r.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};ilt.ID="editor.contrib.placeholderText";let y0e=ilt;function O7o(e,t){return S6(e,(n,r)=>r===!0?!0:t(n))}var w7o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},y7o=function(e,t){return function(n,r){t(n,r,e)}};class C7o{constructor(t){this.instantiationService=t}init(...t){}}function x7o(e){return e()}let ALt=class extends C7o{constructor(t,n){super(n),this.init(t)}};ALt=w7o([y7o(1,$n)],ALt);mo(y0e.ID,x7o(()=>y0e),0);He("editor.placeholder.foreground",Amo,j(1334,"Foreground color of the placeholder text in the editor."));const a3e=Lr("textResourceConfigurationService"),NRn=Lr("textResourcePropertiesService");var L7o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Mce=function(e,t){return function(n,r){t(n,r,e)}};const DZ=new Ln("renameInputVisible",!1,j(1391,"Whether the rename input widget is visible"));new Ln("renameInputFocused",!1,j(1392,"Whether the rename input widget is focused"));let Rze=class{constructor(t,n,r,o,s,a){this._editor=t,this._acceptKeybindings=n,this._themeService=r,this._keybindingService=o,this._logService=a,this.allowEditorOverflow=!0,this._disposables=new Pt,this._visibleContextKey=DZ.bindTo(s),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new wu,this._inputWithButton=new S7o,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(l=>{l.hasChanged(59)&&this._updateFont()})),this._disposables.add(r.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new Sit(this._domNode,{fontInfo:this._editor.getOption(59),onFocusChange:t=>{this._inputWithButton.input.value=t,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{var t,n,r;((t=this._renameCandidateListView)==null?void 0:t.focusedCandidate)!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??(this._timeBeforeFirstInputFieldEdit=this._beforeFirstInputFieldEditSW.elapsed()),((n=this._renameCandidateProvidersCts)==null?void 0:n.token.isCancellationRequested)===!1&&this._renameCandidateProvidersCts.cancel(),(r=this._renameCandidateListView)==null||r.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(t){if(!this._domNode)return;const n=t.getColor(mZ),r=t.getColor(att);this._domNode.style.backgroundColor=String(t.getColor(_0)??""),this._domNode.style.boxShadow=n?` 0 0 8px 2px ${n}`:"",this._domNode.style.border=r?`1px solid ${r}`:"",this._domNode.style.color=String(t.getColor(MDn)??"");const o=t.getColor(RDn);this._inputWithButton.domNode.style.backgroundColor=String(t.getColor(mje)??""),this._inputWithButton.input.style.backgroundColor=String(t.getColor(mje)??""),this._inputWithButton.domNode.style.borderWidth=o?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=o?"solid":"none",this._inputWithButton.domNode.style.borderColor=(o==null?void 0:o.toString())??"none"}_updateFont(){if(this._domNode===void 0)return;yo(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const t=this._editor.getOption(59);this._label.style.fontSize=`${this._computeLabelFontSize(t.fontSize)}px`}_computeLabelFontSize(t){return t*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const t=MT(this.getDomNode().ownerDocument.body),n=ic(this._editor.getDomNode()),r=this._getTopForPosition();this._nPxAvailableAbove=r+n.top,this._nPxAvailableBelow=t.height-this._nPxAvailableAbove;const o=this._editor.getOption(75),{totalHeight:s}=Tee.getLayoutInfo({lineHeight:o}),a=this._nPxAvailableBelow>s*6?[2,1]:[1,2];return{position:this._position,preference:a}}beforeRender(){var r,o;const[t,n]=this._acceptKeybindings;return this._label.innerText=j(1393,"{0} to Rename, {1} to Preview",(r=this._keybindingService.lookupKeybinding(t))==null?void 0:r.getLabel(),(o=this._keybindingService.lookupKeybinding(n))==null?void 0:o.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(t){if(t===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;yo(this._renameCandidateListView),yo(this._nPxAvailableAbove!==void 0),yo(this._nPxAvailableBelow!==void 0);const n=UL(this._inputWithButton.domNode),r=UL(this._label);let o;t===2?o=this._nPxAvailableBelow:o=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:o-r-n,width:h1(this._inputWithButton.domNode)})}acceptInput(t){var n;this._trace("invoking acceptInput"),(n=this._currentAcceptInput)==null||n.call(this,t)}cancelInput(t,n){var r;(r=this._currentCancelInput)==null||r.call(this,t)}focusNextRenameSuggestion(){var t;(t=this._renameCandidateListView)!=null&&t.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){var t;(t=this._renameCandidateListView)!=null&&t.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(t,n,r,o,s){const{start:a,end:l}=this._getSelection(t,n);this._renameCts=s;const d=new Pt;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,o===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=o,this._requestRenameCandidates(n,!1),d.add(pt(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(n,!0))),d.add(pt(this._inputWithButton.button,cn.KEY_DOWN,h=>{const f=new Hs(h);(f.equals(3)||f.equals(10))&&(f.stopPropagation(),f.preventDefault(),this._requestRenameCandidates(n,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",r),this._position=new tt(t.startLineNumber,t.startColumn),this._currentName=n,this._inputWithButton.input.value=n,this._inputWithButton.input.setAttribute("selectionStart",a.toString()),this._inputWithButton.input.setAttribute("selectionEnd",l.toString()),this._inputWithButton.input.size=Math.max((t.endColumn-t.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),d.add(Gn(()=>{this._renameCts=void 0,s.dispose(!0)})),d.add(Gn(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),d.add(Gn(()=>this._candidates.clear()));const u=new FM;return u.p.finally(()=>{d.dispose(),this._hide()}),this._currentCancelInput=h=>{var f;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(f=this._renameCandidateListView)==null||f.clearCandidates(),u.complete(h),!0},this._currentAcceptInput=h=>{this._trace("invoking _currentAcceptInput"),yo(this._renameCandidateListView!==void 0);const f=this._renameCandidateListView.nCandidates;let g,k;const A=this._renameCandidateListView.focusedCandidate;if(A!==void 0?(this._trace("using new name from renameSuggestion"),g=A,k={k:"renameSuggestion"}):(this._trace("using new name from inputField"),g=this._inputWithButton.input.value,k=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),g===n||g.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),u.complete({newName:g,wantsPreview:r&&h,stats:{source:k,nRenameSuggestions:f,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},d.add(s.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),d.add(this._editor.onDidBlurEditorWidget(()=>{var h;return this.cancelInput(!((h=this._domNode)!=null&&h.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show(),u.p}_requestRenameCandidates(t,n){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),yo(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new Ya;const r=n?Q$.Invoke:Q$.Automatic,o=this._requestRenameCandidatesOnce(r,this._renameCandidateProvidersCts.token);if(o.length===0){this._inputWithButton.setSparkleButton();return}n||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(o,t,this._renameCts.token)}}_getSelection(t,n){yo(this._editor.hasModel());const r=this._editor.getSelection();let o=0,s=n.length;return!De.isEmpty(r)&&!De.spansMultipleLines(r)&&De.containsRange(t,r)&&(o=Math.max(0,r.startColumn-t.startColumn),s=Math.min(t.endColumn,r.endColumn)-t.startColumn),{start:o,end:s}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(t,n,r){const o=(...u)=>this._trace("_updateRenameCandidates",...u);o("start");const s=await hV(Promise.allSettled(t),r);if(this._inputWithButton.setSparkleButton(),s===void 0){o("returning early - received updateRenameCandidates results - undefined");return}const a=s.flatMap(u=>u.status==="fulfilled"&&Uu(u.value)?u.value:[]);o(`received updateRenameCandidates results - total (unfiltered) ${a.length} candidates.`);const l=X8(a,u=>u.newSymbolName);o(`distinct candidates - ${l.length} candidates.`);const d=l.filter(({newSymbolName:u})=>u.trim().length>0&&u!==this._inputWithButton.input.value&&u!==n&&!this._candidates.has(u));if(o(`valid distinct candidates - ${a.length} candidates.`),d.forEach(u=>this._candidates.add(u.newSymbolName)),d.length<1){o("returning early - no valid distinct candidates");return}o("setting candidates"),this._renameCandidateListView.setCandidates(d),o("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const t=this._editor.getVisibleRanges();let n;return t.length>0?n=t[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),n=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(n)}_trace(...t){this._logService.trace("RenameWidget",...t)}};Rze=L7o([Mce(2,Il),Mce(3,Fo),Mce(4,Fi),Mce(5,Oa)],Rze);class Sit{constructor(t,n){this._disposables=new Pt,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=n.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=n.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",t.appendChild(this._listContainer),this._listWidget=Sit._createListWidget(this._listContainer,this._candidateViewHeight,n.fontInfo),this._disposables.add(this._listWidget.onDidChangeFocus(r=>{r.elements.length===1&&n.onFocusChange(r.elements[0].newSymbolName)},this._disposables)),this._disposables.add(this._listWidget.onDidChangeSelection(r=>{r.elements.length===1&&n.onSelectionChange()},this._disposables)),this._disposables.add(this._listWidget.onDidBlur(r=>{this._listWidget.setFocus([])})),this._listWidget.style(zM({listInactiveFocusForeground:C$,listInactiveFocusBackground:x$}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:t,width:n}){this._availableHeight=t,this._minimumWidth=n}setCandidates(t){this._listWidget.splice(0,0,t);const n=this._pickListHeight(this._listWidget.length),r=this._pickListWidth(t);this._listWidget.layout(n,r),this._listContainer.style.height=`${n}px`,this._listContainer.style.width=`${r}px`,yO(j(1394,"Received {0} rename suggestions",t.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const t=this._listWidget.getSelectedElements()[0];if(t!==void 0)return t.newSymbolName;const n=this._listWidget.getFocusedElements()[0];if(n!==void 0)return n.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const t=this._listWidget.getFocus();if(t.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(t[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const n=this._listWidget.getFocus()[0];return this._listWidget.reveal(n),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const t=this._listWidget.getFocus();if(t.length===0){this._listWidget.focusLast();const n=this._listWidget.getFocus()[0];return this._listWidget.reveal(n),!0}else{if(t[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const n=this._listWidget.getFocus()[0];return this._listWidget.reveal(n),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:t}=Tee.getLayoutInfo({lineHeight:this._lineHeight});return t}_pickListHeight(t){const n=this._candidateViewHeight*t;return Math.min(n,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(t){const n=Math.ceil(Math.max(...t.map(o=>o.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+n+10)}static _createListWidget(t,n,r){const o=new class{getTemplateId(a){return"candidate"}getHeight(a){return n}},s=new class{constructor(){this.templateId="candidate"}renderTemplate(a){return new Tee(a,r)}renderElement(a,l,d){d.populate(a)}disposeTemplate(a){a.dispose()}};return new Tk("NewSymbolNameCandidates",t,o,[s],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class S7o{constructor(){this._buttonHoverContent="",this._onDidInputChange=new it,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new Pt}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",j(1395,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=j(1396,"Generate New Name Suggestions"),this._buttonCancelHoverText=j(1397,"Cancel"),this._buttonHoverContent=this._buttonGenHoverText,this._disposables.add(E4().setupDelayedHover(this._buttonNode,()=>({content:this._buttonHoverContent,style:1}))),this._domNode.appendChild(this._buttonNode),this._disposables.add(pt(this.input,cn.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(pt(this.input,cn.KEY_DOWN,t=>{const n=new Hs(t);(n.keyCode===15||n.keyCode===17)&&this._onDidInputChange.fire()})),this._disposables.add(pt(this.input,cn.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(pt(this.input,cn.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(pt(this.input,cn.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return yo(this._inputNode),this._inputNode}get button(){return yo(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??(this._sparkleIcon=TO(Jt.sparkle)),kh(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),this._buttonHoverContent=this._buttonGenHoverText,this.input.focus()}setStopButton(){this._buttonState="stop",this._stopIcon??(this._stopIcon=TO(Jt.stopCircle)),kh(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),this._buttonHoverContent=this._buttonCancelHoverText,this.input.focus()}dispose(){this._disposables.dispose()}}const XJ=class XJ{constructor(t,n){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${n.lineHeight}px`,this._domNode.style.padding=`${XJ._PADDING}px`;const r=document.createElement("div");r.style.display="flex",r.style.alignItems="center",r.style.width=r.style.height=`${n.lineHeight*.8}px`,this._domNode.appendChild(r),this._icon=TO(Jt.sparkle),this._icon.style.display="none",r.appendChild(this._icon),this._label=document.createElement("div"),zu(this._label,n),this._domNode.appendChild(this._label),t.appendChild(this._domNode)}populate(t){this._updateIcon(t),this._updateLabel(t)}_updateIcon(t){var r;const n=!!((r=t.tags)!=null&&r.includes(Sje.AIGenerated));this._icon.style.display=n?"inherit":"none"}_updateLabel(t){this._label.innerText=t.newSymbolName}static getLayoutInfo({lineHeight:t}){return{totalHeight:t+XJ._PADDING*2}}dispose(){}};XJ._PADDING=2;let Tee=XJ;var T7o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},U7=function(e,t){return function(n,r){t(n,r,e)}},Ize;class Tit{constructor(t,n,r){this.model=t,this.position=n,this._providerRenameIdx=0,this._providers=r.ordered(t)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(t){const n=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?n.join(` `):void 0}:{range:De.fromPositions(this.position),text:"",rejectReason:n.length>0?n.join(` `):void 0}}async provideRenameEdits(t,n){return this._provideRenameEdits(t,this._providerRenameIdx,[],n)}async _provideRenameEdits(t,n,r,o){const s=this._providers[n];if(!s)return{edits:[],rejectReason:r.join(` `)};const a=await s.provideRenameEdits(this.model,this.position,t,o);if(a){if(a.rejectReason)return this._provideRenameEdits(t,n+1,r.concat(a.rejectReason),o)}else return this._provideRenameEdits(t,n+1,r.concat(j(1380,"No result.")),o);return a}}async function E7o(e,t,n,r){const o=new Tit(t,n,e),s=await o.resolveRenameLocation(Fr.None);return s!=null&&s.rejectReason?{edits:[],rejectReason:s.rejectReason}:o.provideRenameEdits(r,Fr.None)}var QF;let qT=(QF=class{static get(t){return t.getContribution(Ize.ID)}constructor(t,n,r,o,s,a,l,d){this.editor=t,this._instaService=n,this._notificationService=r,this._bulkEditService=o,this._progressService=s,this._logService=a,this._configService=l,this._languageFeaturesService=d,this._disposableStore=new Pt,this._cts=new Ya,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(Rze,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var A,m;const t=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new Ya,!this.editor.hasModel()){t("editor has no model");return}const n=this.editor.getPosition(),r=new Tit(this.editor.getModel(),n,this._languageFeaturesService.renameProvider);if(!r.hasProvider()){t("skeleton has no provider");return}const o=new t6(this.editor,5,void 0,this._cts.token);let s;try{t("resolving rename location");const v=r.resolveRenameLocation(o.token);this._progressService.showWhile(v,250),s=await v,t("resolved rename location")}catch(v){v instanceof u2?t("resolve rename location cancelled",JSON.stringify(v,null," ")):(t("resolve rename location failed",v instanceof Error?v:JSON.stringify(v,null," ")),(typeof v=="string"||A8(v))&&((A=R1.get(this.editor))==null||A.showMessage(v||j(1381,"An unknown error occurred while resolving rename location"),n)));return}finally{o.dispose()}if(!s){t("returning early - no loc");return}if(s.rejectReason){t(`returning early - rejected with reason: ${s.rejectReason}`,s.rejectReason),(m=R1.get(this.editor))==null||m.showMessage(s.rejectReason,n);return}if(o.token.isCancellationRequested){t("returning early - cts1 cancelled");return}const a=new t6(this.editor,5,s.range,this._cts.token),l=this.editor.getModel(),d=this._languageFeaturesService.newSymbolNamesProvider.all(l),u=await Promise.all(d.map(async v=>[v,await v.supportsAutomaticNewSymbolNamesTriggerKind??!1])),h=(v,p)=>{let b=u.slice();return v===Q$.Automatic&&(b=b.filter(([O,w])=>w)),b.map(([O])=>O.provideNewSymbolNames(l,s.range,v,p))};t("creating rename input field and awaiting its result");const f=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),g=await this._renameWidget.getInput(s.range,s.text,f,d.length>0?h:void 0,a);if(t("received response from rename input field"),typeof g=="boolean"){t(`returning early - rename input field response - ${g}`),g&&this.editor.focus(),a.dispose();return}this.editor.focus(),t("requesting rename edits");const k=hV(r.provideRenameEdits(g.newName,a.token),a.token).then(async v=>{if(!v){t("returning early - no rename edits result");return}if(!this.editor.hasModel()){t("returning early - no model after rename edits are provided");return}if(v.rejectReason){t(`returning early - rejected with reason: ${v.rejectReason}`),this._notificationService.info(v.rejectReason);return}this.editor.setSelection(De.fromPositions(this.editor.getSelection().getPosition())),t("applying edits"),this._bulkEditService.apply(v,{editor:this.editor,showPreview:g.wantsPreview,label:j(1382,"Renaming '{0}' to '{1}'",s==null?void 0:s.text,g.newName),code:"undoredo.rename",quotableLabel:j(1383,"Renaming {0} to {1}",s==null?void 0:s.text,g.newName),respectAutoSaveConfig:!0,reason:yA.rename()}).then(p=>{t("edits applied"),p.ariaSummary&&kg(j(1384,"Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,g.newName,p.ariaSummary))}).catch(p=>{t(`error when applying edits ${JSON.stringify(p,null," ")}`),this._notificationService.error(j(1385,"Rename failed to apply edits")),this._logService.error(p)})},v=>{t("error when providing rename edits",JSON.stringify(v,null," ")),this._notificationService.error(j(1386,"Rename failed to compute edits")),this._logService.error(v)}).finally(()=>{a.dispose()});return t("returning rename operation"),this._progressService.showWhile(k,250),k}acceptRenameInput(t){this._renameWidget.acceptInput(t)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}},Ize=QF,QF.ID="editor.contrib.renameController",QF);qT=Ize=T7o([U7(1,$n),U7(2,cc),U7(3,fre),U7(4,e6),U7(5,Oa),U7(6,a3e),U7(7,Zn)],qT);class D7o extends Nn{constructor(){super({id:"editor.action.rename",label:Et(1388,"Rename Symbol"),precondition:zt.and(Ze.writable,Ze.hasRenameProvider),kbOpts:{kbExpr:Ze.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1},canTriggerInlineEdits:!0})}runCommand(t,n){const r=t.get(Co),[o,s]=Array.isArray(n)&&n||[void 0,void 0];return pi.isUri(o)&&tt.isIPosition(s)?r.openCodeEditor({resource:o},r.getActiveCodeEditor()).then(a=>{a&&(a.setPosition(s),a.invokeWithinContext(l=>(this.reportTelemetry(l,a),this.run(l,a))))},Yi):super.runCommand(t,n)}run(t,n){const r=t.get(Oa),o=qT.get(n);return o?(r.trace("[RenameAction] got controller, running..."),o.run()):(r.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}mo(qT.ID,qT,4);gn(D7o);const Eit=$d.bindToContribution(qT.get);xn(new Eit({id:"acceptRenameInput",precondition:DZ,handler:e=>e.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:zt.and(Ze.focus,zt.not("isComposing")),primary:3}}));xn(new Eit({id:"acceptRenameInputWithPreview",precondition:zt.and(DZ,zt.has("config.editor.rename.enablePreview")),handler:e=>e.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:zt.and(Ze.focus,zt.not("isComposing")),primary:2051}}));xn(new Eit({id:"cancelRenameInput",precondition:DZ,handler:e=>e.cancelRenameInput(),kbOpts:{weight:199,kbExpr:Ze.focus,primary:9,secondary:[1033]}}));ws(class extends Gu{constructor(){super({id:"focusNextRenameSuggestion",title:{...Et(1389,"Focus Next Rename Suggestion")},precondition:DZ,keybinding:[{primary:18,weight:199}]})}run(t){const n=t.get(Co).getFocusedCodeEditor();if(!n)return;const r=qT.get(n);r&&r.focusNextRenameSuggestion()}});ws(class extends Gu{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Et(1390,"Focus Previous Rename Suggestion")},precondition:DZ,keybinding:[{primary:16,weight:199}]})}run(t){const n=t.get(Co).getFocusedCodeEditor();if(!n)return;const r=qT.get(n);r&&r.focusPreviousRenameSuggestion()}});Qm("_executeDocumentRenameProvider",function(e,t,n,...r){const[o]=r;yo(typeof o=="string");const{renameProvider:s}=e.get(Zn);return E7o(s,t,n,o)});Qm("_executePrepareRename",async function(e,t,n){const{renameProvider:r}=e.get(Zn),s=await new Tit(t,n,r).resolveRenameLocation(Fr.None);if(s!=null&&s.rejectReason)throw new Error(s.rejectReason);return s});Rl.as(XO.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:6,description:j(1387,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var Q7o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},fLt=function(e,t){return function(n,r){t(n,r,e)}},fH;let C0e=(fH=class extends ct{constructor(t,n,r){super(),this.editor=t,this.languageConfigurationService=n,this.editorWorkerService=r,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(t.getOption(81)),this.computePromise=null,this.currentOccurrences={},this._register(t.onDidChangeModel(o=>{this.currentOccurrences={},this.options=this.createOptions(t.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChangeModelLanguage(o=>{this.currentOccurrences={},this.options=this.createOptions(t.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(n.onDidChange(o=>{var a;const s=(a=this.editor.getModel())==null?void 0:a.getLanguageId();s&&o.affects(s)&&(this.currentOccurrences={},this.options=this.createOptions(t.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(t.onDidChangeConfiguration(o=>{this.options&&!o.hasChanged(81)||(this.options=this.createOptions(t.getOption(81)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(o=>{this.computeSectionHeaders.schedule()})),this._register(t.onDidChangeModelTokens(o=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new Ss(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(t){if(!t||!this.editor.hasModel())return;const n=this.editor.getModel().getLanguageId();if(!n)return;const r=this.languageConfigurationService.getLanguageConfiguration(n).comments,o=this.languageConfigurationService.getLanguageConfiguration(n).foldingRules;if(!(!r&&!(o!=null&&o.markers)))return{foldingRules:o,markSectionHeaderRegex:t.markSectionHeaderRegex,findMarkSectionHeaders:t.showMarkSectionHeaders,findRegionSectionHeaders:t.showRegionSectionHeaders}}findSectionHeaders(){var r,o;if(!this.editor.hasModel()||!((r=this.options)!=null&&r.findMarkSectionHeaders)&&!((o=this.options)!=null&&o.findRegionSectionHeaders))return;const t=this.editor.getModel();if(t.isDisposed()||t.isTooLargeForSyncing())return;const n=t.getVersionId();this.editorWorkerService.findSectionHeaders(t.uri,this.options).then(s=>{t.isDisposed()||t.getVersionId()!==n||this.updateDecorations(s)})}updateDecorations(t){const n=this.editor.getModel();n&&(t=t.filter(s=>{if(!s.shouldBeInComments)return!0;const a=n.validateRange(s.range),l=n.tokenization.getLineTokens(a.startLineNumber),d=l.findTokenIndexAtOffset(a.startColumn-1),u=l.getStandardTokenType(d);return l.getLanguageId(d)===n.getLanguageId()&&u===1}));const r=Object.values(this.currentOccurrences).map(s=>s.decorationId),o=t.map(s=>B7o(s));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(r,o);this.currentOccurrences={};for(let l=0,d=a.length;l=this._minimumTimeBetweenRuns&&(this._lastRun=n,t())}}class aJ{static create(t,n){return new aJ(t,new Nze(n))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(t,n){this._startLineNumber=t,this._tokens=n,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(t){return this._startLineNumber<=t&&t<=this._endLineNumber?this._tokens.getLineTokens(t-this._startLineNumber):null}getRange(){const t=this._tokens.getRange();return t&&new De(this._startLineNumber+t.startLineNumber,t.startColumn,this._startLineNumber+t.endLineNumber,t.endColumn)}removeTokens(t){const n=t.startLineNumber-this._startLineNumber,r=t.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(n,t.startColumn-1,r,t.endColumn-1),this._updateEndLineNumber()}split(t){const n=t.startLineNumber-this._startLineNumber,r=t.endLineNumber-this._startLineNumber,[o,s,a]=this._tokens.split(n,t.startColumn-1,r,t.endColumn-1);return[new aJ(this._startLineNumber,o),new aJ(this._startLineNumber+a,s)]}applyEdit(t,n){const[r,o,s]=WT(n);this.acceptEdit(t,r,o,s,n.length>0?n.charCodeAt(0):0)}acceptEdit(t,n,r,o,s){this._acceptDeleteRange(t),this._acceptInsertText(new tt(t.startLineNumber,t.startColumn),n,r,o,s),this._updateEndLineNumber()}_acceptDeleteRange(t){if(t.startLineNumber===t.endLineNumber&&t.startColumn===t.endColumn)return;const n=t.startLineNumber-this._startLineNumber,r=t.endLineNumber-this._startLineNumber;if(r<0){const s=r-n;this._startLineNumber-=s;return}const o=this._tokens.getMaxDeltaLine();if(!(n>=o+1)){if(n<0&&r>=o+1){this._startLineNumber=0,this._tokens.clear();return}if(n<0){const s=-n;this._startLineNumber-=s,this._tokens.acceptDeleteRange(t.startColumn-1,0,0,r,t.endColumn-1)}else this._tokens.acceptDeleteRange(0,n,t.startColumn-1,r,t.endColumn-1)}}_acceptInsertText(t,n,r,o,s){if(n===0&&r===0)return;const a=t.lineNumber-this._startLineNumber;if(a<0){this._startLineNumber+=n;return}const l=this._tokens.getMaxDeltaLine();a>=l+1||this._tokens.acceptInsertText(a,t.column-1,n,r,o,s)}reportIfInvalid(t){this._tokens.reportIfInvalid(t,this._startLineNumber)}}const RS=class RS{constructor(t){this._tokens=t,this._tokenCount=t.length/4}toString(t){const n=[];for(let r=0;rt)r=o-1;else{let a=o;for(;a>n&&this._getDeltaLine(a-1)===t;)a--;let l=o;for(;lt||g===t&&A>=n)&&(gt||A===t&&v>=n){if(As?m-=s-r:m=r;else if(k===n&&A===r)if(k===o&&m>s)m-=s-r;else{h=!0;continue}else if(ks)k=n,A=r,m=A+(m-s);else{h=!0;continue}else if(k>o){if(d===0&&!h){u=l;break}k-=d}else if(k===o&&A>=s)t&&k===0&&(A+=t,m+=t),k-=d,A-=s-r,m-=s-r;else throw new Error("Not possible!");const p=4*u;a[p]=k,a[p+1]=A,a[p+2]=m,a[p+3]=v,u++}this._tokenCount=u}acceptInsertText(t,n,r,o,s,a){const l=r===0&&o===1&&(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122),d=this._tokens,u=this._tokenCount;for(let h=0;h{console.error("Invalid Semantic Tokens Data From Extension: lineNumber < 1")}):o>t.getLineCount()?RS._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()")}):this._getEndCharacter(r)>t.getLineLength(o)&&RS._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)")})}}};RS._rateLimiter=new F7o(10/60);let Nze=RS;class gLt{constructor(t){this._tokens=t}getCount(){return this._tokens.length/4}getStartCharacter(t){return this._tokens[4*t+1]}getEndCharacter(t){return this._tokens[4*t+2]}getMetadata(t){return this._tokens[4*t+3]}}var P7o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},fSe=function(e,t){return function(n,r){t(n,r,e)}};let Uze=class{constructor(t,n,r,o){this._legend=t,this._themeService=n,this._languageService=r,this._logService=o,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new jze}getMetadata(t,n,r){const o=this._languageService.languageIdCodec.encodeLanguageId(r),s=this._hashTable.get(t,n,o);let a;if(s)a=s.metadata;else{let l=this._legend.tokenTypes[t];const d=[];if(l){let u=n;for(let f=0;u>0&&f>1;const h=this._themeService.getColorTheme().getTokenStyleMetadata(l,d,r);if(typeof h>"u")a=2147483647;else{if(a=0,typeof h.italic<"u"){const f=(h.italic?1:0)<<11;a|=f|1}if(typeof h.bold<"u"){const f=(h.bold?2:0)<<11;a|=f|2}if(typeof h.underline<"u"){const f=(h.underline?4:0)<<11;a|=f|4}if(typeof h.strikethrough<"u"){const f=(h.strikethrough?8:0)<<11;a|=f|8}if(h.foreground){const f=h.foreground<<15;a|=f|16}a===0&&(a=2147483647)}}else a=2147483647,l="not-in-legend";this._hashTable.add(t,n,o,a)}return a}warnOverlappingSemanticTokens(t,n){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${t}, column ${n}`))}warnInvalidLengthSemanticTokens(t,n){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${t}, column ${n}`))}warnInvalidEditStart(t,n,r,o,s){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${t}, resultId: ${n}) at edit #${r}: The provided start offset ${o} is outside the previous data (length ${s}).`))}};Uze=P7o([fSe(1,Il),fSe(2,lc),fSe(3,Oa)],Uze);function URn(e,t,n){const r=e.data,o=e.data.length/5|0,s=Math.max(Math.ceil(o/1024),400),a=[];let l=0,d=1,u=0;for(;lh&&r[5*b]===0;)b--;if(b-1===h){let O=f;for(;O+1C)t.warnOverlappingSemanticTokens(y,C+1);else{const Q=t.getMetadata(S,E,n);Q!==2147483647&&(A===0&&(A=y),g[k]=y-A,g[k+1]=C,g[k+2]=L,g[k+3]=Q,k+=4,m=y,v=L)}d=y,u=C,l++}k!==g.length&&(g=g.subarray(0,k));const p=aJ.create(A,g);a.push(p)}return a}class M7o{constructor(t,n,r,o){this.tokenTypeIndex=t,this.tokenModifierSet=n,this.languageId=r,this.metadata=o,this.next=null}}const oL=class oL{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=oL._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const s=this._elements;this._currentLengthIndex++,this._currentLength=oL._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+10?n[0]:[]}async function VRn(e,t,n,r,o){const s=j7o(e,t),a=await Promise.all(s.map(async l=>{let d,u=null;try{d=await l.provideDocumentSemanticTokens(t,l===n?r:null,o)}catch(h){u=h,d=null}return(!d||!c3e(d)&&!WRn(d))&&(d=null),new U7o(l,d,u)}));for(const l of a){if(l.error)throw l.error;if(l.tokens)return l}return a.length>0?a[0]:null}function W7o(e,t){const n=e.orderedGroups(t);return n.length>0?n[0]:null}class H7o{constructor(t,n){this.provider=t,this.tokens=n}}function V7o(e,t){return e.has(t)}function zRn(e,t){const n=e.orderedGroups(t);return n.length>0?n[0]:[]}async function Dit(e,t,n,r){const o=zRn(e,t),s=await Promise.all(o.map(async a=>{let l;try{l=await a.provideDocumentRangeSemanticTokens(t,n,r)}catch(d){Xc(d),l=null}return(!l||!c3e(l))&&(l=null),new H7o(a,l)}));for(const a of s)if(a.tokens)return a;return s.length>0?s[0]:null}ho.registerCommand("_provideDocumentSemanticTokensLegend",async(e,...t)=>{const[n]=t;yo(n instanceof pi);const r=e.get(pl).getModel(n);if(!r)return;const{documentSemanticTokensProvider:o}=e.get(Zn),s=W7o(o,r);return s?s[0].getLegend():e.get(Ca).executeCommand("_provideDocumentRangeSemanticTokensLegend",n)});ho.registerCommand("_provideDocumentSemanticTokens",async(e,...t)=>{const[n]=t;yo(n instanceof pi);const r=e.get(pl).getModel(n);if(!r)return;const{documentSemanticTokensProvider:o}=e.get(Zn);if(!HRn(o,r))return e.get(Ca).executeCommand("_provideDocumentRangeSemanticTokens",n,r.getFullModelRange());const s=await VRn(o,r,null,null,Fr.None);if(!s)return;const{provider:a,tokens:l}=s;if(!l||!c3e(l))return;const d=jRn({id:0,type:"full",data:l.data});return l.resultId&&a.releaseDocumentSemanticTokens(l.resultId),d});ho.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(e,...t)=>{const[n,r]=t;yo(n instanceof pi);const o=e.get(pl).getModel(n);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(Zn),a=zRn(s,o);if(a.length===0)return;if(a.length===1)return a[0].getLegend();if(!r||!De.isIRange(r))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),a[0].getLegend();const l=await Dit(s,o,De.lift(r),Fr.None);if(l)return l.provider.getLegend()});ho.registerCommand("_provideDocumentRangeSemanticTokens",async(e,...t)=>{const[n,r]=t;yo(n instanceof pi),yo(De.isIRange(r));const o=e.get(pl).getModel(n);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(Zn),a=await Dit(s,o,De.lift(r),Fr.None);if(!(!a||!a.tokens))return jRn({id:0,type:"full",data:a.tokens.data})});const Qit="editor.semanticHighlighting";function Zhe(e,t,n){var o;const r=(o=n.getValue(Qit,{overrideIdentifier:e.getLanguageId(),resource:e.uri}))==null?void 0:o.enabled;return typeof r=="boolean"?r:t.getColorTheme().semanticHighlighting}var ZRn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},yw=function(e,t){return function(n,r){t(n,r,e)}},nS;let Wze=class extends ct{constructor(t,n,r,o,s,a){super(),this._watchers=new Qc;const l=h=>{var f;(f=this._watchers.get(h.uri))==null||f.dispose(),this._watchers.set(h.uri,new Hze(h,t,r,s,a))},d=(h,f)=>{f.dispose(),this._watchers.delete(h.uri)},u=()=>{for(const h of n.getModels()){const f=this._watchers.get(h.uri);Zhe(h,r,o)?f||l(h):f&&d(h,f)}};n.getModels().forEach(h=>{Zhe(h,r,o)&&l(h)}),this._register(n.onModelAdded(h=>{Zhe(h,r,o)&&l(h)})),this._register(n.onModelRemoved(h=>{const f=this._watchers.get(h.uri);f&&d(h,f)})),this._register(o.onDidChangeConfiguration(h=>{h.affectsConfiguration(Qit)&&u()})),this._register(r.onDidColorThemeChange(u))}dispose(){hs(this._watchers.values()),this._watchers.clear(),super.dispose()}};Wze=ZRn([yw(0,l3e),yw(1,pl),yw(2,Il),yw(3,cr),yw(4,L2),yw(5,Zn)],Wze);var OT;let Hze=(OT=class extends ct{constructor(t,n,r,o,s){super(),this._semanticTokensStylingService=n,this._isDisposed=!1,this._model=t,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentSemanticTokens",{min:nS.REQUEST_MIN_DELAY,max:nS.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Ss(()=>this._fetchDocumentSemanticTokensNow(),nS.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const a=()=>{hs(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const l of this._provider.all(t))typeof l.onDidChange=="function"&&this._documentProvidersChangeListeners.push(l.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};a(),this._register(this._provider.onDidChange(()=>{a(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(r.onDidColorThemeChange(l=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),hs(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!HRn(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const t=new Ya,n=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,r=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,o=VRn(this._provider,this._model,n,r,t.token);this._currentDocumentRequestCancellationTokenSource=t,this._providersChangedDuringRequest=!1;const s=[],a=this._model.onDidChangeContent(d=>{s.push(d)}),l=new wu(!1);o.then(d=>{if(this._debounceInformation.update(this._model,l.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,a.dispose(),!d)this._setDocumentSemanticTokens(null,null,null,s);else{const{provider:u,tokens:h}=d,f=this._semanticTokensStylingService.getStyling(u);this._setDocumentSemanticTokens(u,h||null,f,s)}},d=>{d&&(Sk(d)||typeof d.message=="string"&&d.message.indexOf("busy")!==-1)||Yi(d),this._currentDocumentRequestCancellationTokenSource=null,a.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(t,n,r,o,s){s=Math.min(s,r.length-o,t.length-n);for(let a=0;a{(o.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){t&&n&&t.releaseDocumentSemanticTokens(n.resultId);return}if(!t||!r){this._model.tokenization.setSemanticTokens(null,!1);return}if(!n){this._model.tokenization.setSemanticTokens(null,!0),a();return}if(WRn(n)){if(!s){this._model.tokenization.setSemanticTokens(null,!0);return}if(n.edits.length===0)n={resultId:n.resultId,data:s.data};else{let l=0;for(const g of n.edits)l+=(g.data?g.data.length:0)-g.deleteCount;const d=s.data,u=new Uint32Array(d.length+l);let h=d.length,f=u.length;for(let g=n.edits.length-1;g>=0;g--){const k=n.edits[g];if(k.start>d.length){r.warnInvalidEditStart(s.resultId,n.resultId,g,k.start,d.length),this._model.tokenization.setSemanticTokens(null,!0);return}const A=h-(k.start+k.deleteCount);A>0&&(nS._copy(d,h-A,u,f-A,A),f-=A),k.data&&(nS._copy(k.data,0,u,f-k.data.length,k.data.length),f-=k.data.length),h=k.start}h>0&&nS._copy(d,0,u,0,h),n={resultId:n.resultId,data:u}}}if(c3e(n)){this._currentDocumentResponse=new z7o(t,n.resultId,n.data);const l=URn(n,r,this._model.getLanguageId());if(o.length>0)for(const d of o)for(const u of l)for(const h of d.changes)u.applyEdit(h.range,h.text);this._model.tokenization.setSemanticTokens(l,!0)}else this._model.tokenization.setSemanticTokens(null,!0);a()}},nS=OT,OT.REQUEST_MIN_DELAY=300,OT.REQUEST_MAX_DELAY=2e3,OT);Hze=nS=ZRn([yw(1,l3e),yw(2,Il),yw(3,L2),yw(4,Zn)],Hze);class z7o{constructor(t,n,r){this.provider=t,this.resultId=n,this.data=r}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}SZ(Wze);var Z7o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},_X=function(e,t){return function(n,r){t(n,r,e)}},gH;let x0e=(gH=class extends ct{constructor(t,n,r,o,s,a){super(),this._semanticTokensStylingService=n,this._themeService=r,this._configurationService=o,this._editor=t,this._provider=a.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Ss(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[],this._rangeProvidersChangeListeners=[];const l=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))},d=()=>{var u;if(this._cleanupProviderListeners(),this._editor.hasModel()){const h=this._editor.getModel();for(const f of this._provider.all(h)){const g=(u=f.onDidChange)==null?void 0:u.call(f,()=>{this._cancelAll(),l()});g&&this._rangeProvidersChangeListeners.push(g)}}};this._register(this._editor.onDidScrollChange(()=>{l()})),this._register(this._editor.onDidChangeModel(()=>{d(),this._cancelAll(),l()})),this._register(this._editor.onDidChangeModelLanguage(()=>{d(),this._cancelAll(),l()})),this._register(this._editor.onDidChangeModelContent(u=>{this._cancelAll(),l()})),d(),this._register(this._provider.onDidChange(()=>{d(),this._cancelAll(),l()})),this._register(this._configurationService.onDidChangeConfiguration(u=>{u.affectsConfiguration(Qit)&&(this._cancelAll(),l())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),l()})),l()}dispose(){this._cleanupProviderListeners(),super.dispose()}_cleanupProviderListeners(){hs(this._rangeProvidersChangeListeners),this._rangeProvidersChangeListeners=[]}_cancelAll(){for(const t of this._outstandingRequests)t.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(t){for(let n=0,r=this._outstandingRequests.length;nthis._requestRange(t,r)))}_requestRange(t,n){const r=t.getVersionId(),o=zd(a=>Promise.resolve(Dit(this._provider,t,n,a))),s=new wu(!1);return o.then(a=>{if(this._debounceInformation.update(t,s.elapsed()),!a||!a.tokens||t.isDisposed()||t.getVersionId()!==r)return;const{provider:l,tokens:d}=a,u=this._semanticTokensStylingService.getStyling(l);t.tokenization.setPartialSemanticTokens(n,URn(d,u,t.getLanguageId()))}).then(()=>this._removeOutstandingRequest(o),()=>this._removeOutstandingRequest(o)),o}},gH.ID="editor.contrib.viewportSemanticTokens",gH);x0e=Z7o([_X(1,l3e),_X(2,Il),_X(3,cr),_X(4,L2),_X(5,Zn)],x0e);mo(x0e.ID,x0e,1);class Y7o{constructor(t=!0){this.selectSubwords=t}provideSelectionRanges(t,n){const r=[];for(const o of n){const s=[];r.push(s),this.selectSubwords&&this._addInWordRanges(s,t,o),this._addWordRanges(s,t,o),this._addWhitespaceLine(s,t,o),s.push({range:t.getFullModelRange()})}return r}_addInWordRanges(t,n,r){const o=n.getWordAtPosition(r);if(!o)return;const{word:s,startColumn:a}=o,l=r.column-a;let d=l,u=l,h=0;for(;d>=0;d--){const f=s.charCodeAt(d);if(d!==l&&(f===95||f===45))break;if(b5(f)&&pw(h))break;h=f}for(d+=1;u0&&n.getLineFirstNonWhitespaceColumn(r.lineNumber)===0&&n.getLineLastNonWhitespaceColumn(r.lineNumber)===0&&t.push({range:new De(r.lineNumber,1,r.lineNumber,n.getLineMaxColumn(r.lineNumber))})}}var X7o=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},q7o=function(e,t){return function(n,r){t(n,r,e)}},Vze;class Bit{constructor(t,n){this.index=t,this.ranges=n}mov(t){const n=this.index+(t?1:-1);if(n<0||n>=this.ranges.length)return this;const r=new Bit(n,this.ranges);return r.ranges[n].equalsRange(this.ranges[this.index])?r.mov(t):r}}var BF;let Eee=(BF=class{static get(t){return t.getContribution(Vze.ID)}constructor(t,n){this._editor=t,this._languageFeaturesService=n,this._ignoreSelection=!1}dispose(){var t;(t=this._selectionListener)==null||t.dispose()}async run(t){if(!this._editor.hasModel())return;const n=this._editor.getSelections(),r=this._editor.getModel();if(this._state||await XRn(this._languageFeaturesService.selectionRangeProvider,r,n.map(s=>s.getPosition()),this._editor.getOption(129),Fr.None).then(s=>{var a;if(!(!Qf(s)||s.length!==n.length)&&!(!this._editor.hasModel()||!za(this._editor.getSelections(),n,(l,d)=>l.equalsSelection(d)))){for(let l=0;ld.containsPosition(n[l].getStartPosition())&&d.containsPosition(n[l].getEndPosition())),s[l].unshift(n[l]);this._state=s.map(l=>new Bit(0,l)),(a=this._selectionListener)==null||a.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var l;this._ignoreSelection||((l=this._selectionListener)==null||l.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(s=>s.mov(t));const o=this._state.map(s=>Rn.fromPositions(s.ranges[s.index].getStartPosition(),s.ranges[s.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(o)}finally{this._ignoreSelection=!1}}},Vze=BF,BF.ID="editor.contrib.smartSelectController",BF);Eee=Vze=X7o([q7o(1,Zn)],Eee);class YRn extends Nn{constructor(t,n){super(n),this._forward=t}async run(t,n){const r=Eee.get(n);r&&await r.run(this._forward)}}class G7o extends YRn{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:Et(1400,"Expand Selection"),precondition:void 0,kbOpts:{kbExpr:Ze.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:Yn.MenubarSelectionMenu,group:"1_basic",title:j(1398,"&&Expand Selection"),order:2}})}}ho.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class K7o extends YRn{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:Et(1401,"Shrink Selection"),precondition:void 0,kbOpts:{kbExpr:Ze.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:Yn.MenubarSelectionMenu,group:"1_basic",title:j(1399,"&&Shrink Selection"),order:3}})}}mo(Eee.ID,Eee,4);gn(G7o);gn(K7o);async function XRn(e,t,n,r,o){const s=e.all(t).concat(new Y7o(r.selectSubwords));s.length===1&&s.unshift(new c0e);const a=[],l=[];for(const d of s)a.push(Promise.resolve(d.provideSelectionRanges(t,n,o)).then(u=>{if(Qf(u)&&u.length===n.length)for(let h=0;h{if(d.length===0)return[];d.sort((g,k)=>tt.isBefore(g.getStartPosition(),k.getStartPosition())?1:tt.isBefore(k.getStartPosition(),g.getStartPosition())||tt.isBefore(g.getEndPosition(),k.getEndPosition())?-1:tt.isBefore(k.getEndPosition(),g.getEndPosition())?1:0);const u=[];let h;for(const g of d)(!h||De.containsRange(g,h)&&!De.equalsRange(g,h))&&(u.push(g),h=g);if(!r.selectLeadingAndTrailingWhitespace)return u;const f=[u[0]];for(let g=1;gtt.isIPosition(a)));const o=e.get(Zn).selectionRangeProvider,s=await e.get(Uf).createModelReference(n);try{return XRn(o,s.object.textEditorModel,r.map(tt.lift),{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},Fr.None)}finally{s.dispose()}});const zze=Object.freeze({View:Et(1638,"View"),Help:Et(1639,"Help"),Test:Et(1640,"Test"),File:Et(1641,"File"),Preferences:Et(1642,"Preferences"),Developer:Et(1643,"Developer")});class J7o extends T4{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Et(1448,"Toggle Editor Sticky Scroll"),mnemonicTitle:j(1444,"&&Toggle Editor Sticky Scroll")},metadata:{description:Et(1449,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:zze.View,toggled:{condition:zt.equals("config.editor.stickyScroll.enabled",!0),title:j(1445,"Sticky Scroll"),mnemonicTitle:j(1446,"&&Sticky Scroll")},menu:[{id:Yn.CommandPalette},{id:Yn.MenubarAppearanceMenu,group:"4_editor",order:3},{id:Yn.StickyScrollContext}]})}async runEditorCommand(t,n){var a;const r=t.get(cr),o=!r.getValue("editor.stickyScroll.enabled"),s=(a=k4.get(n))==null?void 0:a.isFocused();r.updateValue("editor.stickyScroll.enabled",o),s&&n.focus()}}const d3e=100;class _7o extends T4{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Et(1450,"Focus Editor Sticky Scroll"),mnemonicTitle:j(1447,"&&Focus Editor Sticky Scroll")},precondition:zt.and(zt.has("config.editor.stickyScroll.enabled"),Ze.stickyScrollVisible),menu:[{id:Yn.CommandPalette}]})}runEditorCommand(t,n){var r;(r=k4.get(n))==null||r.focus()}}class $7o extends T4{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Et(1451,"Select the next editor sticky scroll line"),precondition:Ze.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:d3e,primary:18}})}runEditorCommand(t,n){var r;(r=k4.get(n))==null||r.focusNext()}}class eDo extends T4{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Et(1452,"Select the previous sticky scroll line"),precondition:Ze.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:d3e,primary:16}})}runEditorCommand(t,n){var r;(r=k4.get(n))==null||r.focusPrevious()}}class tDo extends T4{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Et(1453,"Go to the focused sticky scroll line"),precondition:Ze.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:d3e,primary:3}})}runEditorCommand(t,n){var r;(r=k4.get(n))==null||r.goToFocused()}}class nDo extends T4{constructor(){super({id:"editor.action.selectEditor",title:Et(1454,"Select Editor"),precondition:Ze.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:d3e,primary:9}})}runEditorCommand(t,n){var r;(r=k4.get(n))==null||r.selectEditor()}}mo(k4.ID,k4,1);ws(J7o);ws(_7o);ws(eDo);ws($7o);ws(tDo);ws(nDo);var qRn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},AG=function(e,t){return function(n,r){t(n,r,e)}};class iDo{constructor(t,n,r,o,s,a,l){this.range=t,this.insertText=n,this.filterText=r,this.additionalTextEdits=o,this.command=s,this.gutterMenuLinkAction=a,this.completion=l}}let Zze=class extends mao{constructor(t,n,r,o,s,a){super(s.disposable),this.model=t,this.line=n,this.word=r,this.completionModel=o,this._suggestMemoryService=a}canBeReused(t,n,r){return this.model===t&&this.line===n&&this.word.word.length>0&&this.word.startColumn===r.startColumn&&this.word.endColumn=0&&l.resolve(Fr.None)}return t}};Zze=qRn([AG(5,r3e)],Zze);let Yze=class extends ct{constructor(t,n,r,o){super(),this._languageFeatureService=t,this._clipboardService=n,this._suggestMemoryService=r,this._editorService=o,this._store.add(t.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(t,n,r,o){var k;if(r.selectedSuggestionInfo)return;let s;for(const A of this._editorService.listCodeEditors())if(A.getModel()===t){s=A;break}if(!s)return;const a=s.getOption(102);if(jU.isAllOff(a))return;t.tokenization.tokenizeIfCheap(n.lineNumber);const l=t.tokenization.getLineTokens(n.lineNumber),d=l.getStandardTokenType(l.findTokenIndexAtOffset(Math.max(n.column-1-1,0)));if(jU.valueFor(a,d)!=="inline")return;let u=t.getWordAtPosition(n),h;if(u!=null&&u.word||(h=this._getTriggerCharacterInfo(t,n)),!(u!=null&&u.word)&&!h||(u||(u=t.getWordUntilPosition(n)),u.endColumn!==n.column))return;let f;const g=t.getValueInRange(new De(n.lineNumber,1,n.lineNumber,n.column));if(!h&&((k=this._lastResult)!=null&&k.canBeReused(t,n.lineNumber,u))){const A=new Uxt(g,n.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=A,this._lastResult.acquire(),f=this._lastResult}else{const A=await git(this._languageFeatureService.completionProvider,t,n,new kee(void 0,u0e.createSuggestFilter(s).itemKind,h==null?void 0:h.providers),h&&{triggerKind:1,triggerCharacter:h.ch},o);let m;A.needsClipboard&&(m=await this._clipboardService.readText());const v=new zS(A.items,n.column,new Uxt(g,0),d0e.None,s.getOption(134),s.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},m);f=new Zze(t,n.lineNumber,u,v,A,this._suggestMemoryService)}return this._lastResult=f,f}handleItemDidShow(t,n){n.completion.resolve(Fr.None)}disposeInlineCompletions(t){t.release()}_getTriggerCharacterInfo(t,n){var s;const r=t.getValueInRange(De.fromPositions({lineNumber:n.lineNumber,column:n.column-1},n)),o=new Set;for(const a of this._languageFeatureService.completionProvider.all(t))(s=a.triggerCharacters)!=null&&s.includes(r)&&o.add(a);if(o.size!==0)return{providers:o,ch:r}}};Yze=qRn([AG(0,Zn),AG(1,z1),AG(2,r3e),AG(3,Co)],Yze);SZ(Yze);class rDo extends Nn{constructor(){super({id:"editor.action.forceRetokenize",label:Et(1532,"Developer: Force Retokenize"),precondition:void 0})}run(t,n){if(!n.hasModel())return;const r=n.getModel();r.tokenization.resetTokenization();const o=new wu;r.tokenization.forceTokenization(r.getLineCount()),o.stop(),console.log(`tokenization took ${o.elapsed()}`)}}gn(rDo);const J2e=class J2e extends Gu{constructor(){super({id:J2e.ID,title:Et(1530,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:Et(1531,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const n=!vV.getTabFocusMode();vV.setTabFocusMode(n),kg(n?j(1528,"Pressing Tab will now move focus to the next focusable element"):j(1529,"Pressing Tab will now insert the tab character"))}};J2e.ID="editor.action.toggleTabFocusMode";let Xze=J2e;ws(Xze);class Fit{static computeUnicodeHighlights(t,n,r){const o=r?r.startLineNumber:1,s=r?r.endLineNumber:t.getLineCount(),a=new mLt(n),l=a.getCandidateCodePoints();let d;l==="allNonBasicAscii"?d=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):d=new RegExp(`${oDo(Array.from(l))}`,"g");const u=new PU(null,d),h=[];let f=!1,g,k=0,A=0,m=0;e:for(let v=o,p=s;v<=p;v++){const b=t.getLineContent(v),O=b.length;u.reset(0);do if(g=u.next(b),g){let w=g.index,y=g.index+g[0].length;if(w>0){const S=b.charCodeAt(w-1);Wd(S)&&w--}if(y+1=1e3){f=!0;break e}h.push(new De(v,w+1,v,y+1))}}while(g)}return{ranges:h,hasMore:f,ambiguousCharacterCount:k,invisibleCharacterCount:A,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(t,n){const r=new mLt(n);switch(r.shouldHighlightNonBasicASCII(t,null)){case 0:return null;case 2:return{kind:1};case 3:{const s=t.codePointAt(0),a=r.ambiguousCharacters.getPrimaryConfusable(s),l=s$.getLocales().filter(d=>!s$.getInstance(new Set([...n.allowedLocales,d])).isAmbiguous(s));return{kind:0,confusableWith:String.fromCodePoint(a),notAmbiguousInLocales:l}}case 1:return{kind:2}}}}function oDo(e,t){return`[${j1(e.map(r=>String.fromCodePoint(r)).join(""))}]`}class mLt{constructor(t){this.options=t,this.allowedCodePoints=new Set(t.allowedCodePoints),this.ambiguousCharacters=s$.getInstance(new Set(t.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const t=new Set;if(this.options.invisibleCharacters)for(const n of OB.codePoints)kLt(String.fromCodePoint(n))||t.add(n);if(this.options.ambiguousCharacters)for(const n of this.ambiguousCharacters.getConfusableCodePoints())t.add(n);for(const n of this.allowedCodePoints)t.delete(n);return t}shouldHighlightNonBasicASCII(t,n){const r=t.codePointAt(0);if(this.allowedCodePoints.has(r))return 0;if(this.options.nonBasicASCII)return 1;let o=!1,s=!1;if(n)for(const a of n){const l=a.codePointAt(0),d=Zie(a);o=o||d,!d&&!this.ambiguousCharacters.isAmbiguous(l)&&!OB.isInvisibleCharacter(l)&&(s=!0)}return!o&&s?0:this.options.invisibleCharacters&&!kLt(t)&&OB.isInvisibleCharacter(r)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(r)?3:0}}function kLt(e){return e===" "||e===` `||e===" "}var sDo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},vLt=function(e,t){return function(n,r){t(n,r,e)}};let qze=class extends ct{get enabled(){return this._enabled}set enabled(t){t?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=t}constructor(t,n,r={},o,s){super(),this._link=n,this._hoverService=o,this._enabled=!0,this.el=tn(t,ln("a.monaco-link",{tabIndex:n.tabIndex??0,href:n.href},n.label)),this.hoverDelegate=r.hoverDelegate??dC("mouse"),this.setTooltip(n.title),this.el.setAttribute("role","button");const a=this._register(new ms(this.el,"click")),l=this._register(new ms(this.el,"keypress")),d=un.chain(l.event,f=>f.map(g=>new Hs(g)).filter(g=>g.keyCode===3)),u=this._register(new ms(this.el,pa.Tap)).event;this._register(NA.addTarget(this.el));const h=un.any(a.event,d,u);this._register(h(f=>{this.enabled&&(Bo.stop(f,!0),r!=null&&r.opener?r.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(t){!this.hover&&t?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,t)):this.hover&&this.hover.update(t)}};qze=sDo([vLt(3,Lg),vLt(4,B6)],qze);var GRn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Gze=function(e,t){return function(n,r){t(n,r,e)}};const aDo=26;let Kze=class extends ct{constructor(t,n){super(),this._editor=t,this.instantiationService=n,this.banner=this._register(this.instantiationService.createInstance(Jze))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(t){this.banner.show({...t,onClose:()=>{var n;this.hide(),(n=t.onClose)==null||n.call(t)}}),this._editor.setBanner(this.banner.element,aDo)}};Kze=GRn([Gze(1,$n)],Kze);let Jze=class extends ct{constructor(t,n){super(),this.instantiationService=t,this.markdownRendererService=n,this.element=ln("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(t){if(t.ariaLabel)return t.ariaLabel;if(typeof t.message=="string")return t.message}getBannerMessage(t){if(typeof t=="string"){const n=ln("span");return n.innerText=t,n}return this.markdownRendererService.render(t).element}clear(){kh(this.element)}show(t){kh(this.element);const n=this.getAriaLabel(t);n&&this.element.setAttribute("aria-label",n);const r=tn(this.element,ln("div.icon-container"));r.setAttribute("aria-hidden","true"),t.icon&&r.appendChild(ln(`div${mi.asCSSSelector(t.icon)}`));const o=tn(this.element,ln("div.message-container"));if(o.setAttribute("aria-hidden","true"),o.appendChild(this.getBannerMessage(t.message)),this.messageActionsContainer=tn(this.element,ln("div.message-actions-container")),t.actions)for(const a of t.actions)this._register(this.instantiationService.createInstance(qze,this.messageActionsContainer,{...a,tabIndex:-1},{}));const s=tn(this.element,ln("div.action-container"));this.actionBar=this._register(new bm(s)),this.actionBar.push(this._register(new ak("banner.close",j(1533,"Close Banner"),mi.asClassName(hFn),!0,()=>{typeof t.onClose=="function"&&t.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};Jze=GRn([Gze(0,$n),Gze(1,D4)],Jze);const KRn=Lr("workspaceTrustManagementService");var Pit=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},lJ=function(e,t){return function(n,r){t(n,r,e)}};const lDo=Ra("extensions-warning-message",Jt.warning,j(1534,"Icon shown with a warning message in the extensions editor."));var mH;let Dee=(mH=class extends ct{constructor(t,n,r,o){super(),this._editor=t,this._editorWorkerService=n,this._workspaceTrustService=r,this._highlighter=null,this._bannerClosed=!1,this._updateState=s=>{if(s&&s.hasMore){if(this._bannerClosed)return;const a=Math.max(s.ambiguousCharacterCount,s.nonBasicAsciiCharacterCount,s.invisibleCharacterCount);let l;if(s.nonBasicAsciiCharacterCount>=a)l={message:j(1535,"This document contains many non-basic ASCII unicode characters"),command:new Bee};else if(s.ambiguousCharacterCount>=a)l={message:j(1536,"This document contains many ambiguous unicode characters"),command:new GP};else if(s.invisibleCharacterCount>=a)l={message:j(1537,"This document contains many invisible unicode characters"),command:new Qee};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:l.message,icon:lDo,actions:[{label:l.command.shortLabel,href:`command:${l.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(o.createInstance(Kze,t)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=t.getOption(142),this._register(r.onDidChangeTrust(s=>{this._updateHighlighter()})),this._register(t.onDidChangeConfiguration(s=>{s.hasChanged(142)&&(this._options=t.getOption(142),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const t=cDo(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([t.nonBasicASCII,t.ambiguousCharacters,t.invisibleCharacters].every(r=>r===!1))return;const n={nonBasicASCII:t.nonBasicASCII,ambiguousCharacters:t.ambiguousCharacters,invisibleCharacters:t.invisibleCharacters,includeComments:t.includeComments,includeStrings:t.includeStrings,allowedCodePoints:Object.keys(t.allowedCharacters).map(r=>r.codePointAt(0)),allowedLocales:Object.keys(t.allowedLocales).map(r=>r==="_os"?IM.NumberFormat().value.resolvedOptions().locale:r==="_vscode"?$so:r)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new _ze(this._editor,n,this._updateState,this._editorWorkerService):this._highlighter=new dDo(this._editor,n,this._updateState)}getDecorationInfo(t){return this._highlighter?this._highlighter.getDecorationInfo(t):null}},mH.ID="editor.contrib.unicodeHighlighter",mH);Dee=Pit([lJ(1,Bm),lJ(2,KRn),lJ(3,$n)],Dee);function cDo(e,t){return{nonBasicASCII:t.nonBasicASCII===F0?!e:t.nonBasicASCII,ambiguousCharacters:t.ambiguousCharacters,invisibleCharacters:t.invisibleCharacters,includeComments:t.includeComments===F0?!e:t.includeComments,includeStrings:t.includeStrings===F0?!e:t.includeStrings,allowedCharacters:t.allowedCharacters,allowedLocales:t.allowedLocales}}let _ze=class extends ct{constructor(t,n,r,o){super(),this._editor=t,this._options=n,this._updateState=r,this._editorWorkerService=o,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Ss(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const t=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(n=>{if(this._model.isDisposed()||this._model.getVersionId()!==t)return;this._updateState(n);const r=[];if(!n.hasMore)for(const o of n.ranges)r.push({range:o,options:L0e.instance.getDecorationFromOptions(this._options)});this._decorations.set(r)})}getDecorationInfo(t){if(!this._decorations.has(t))return null;const n=this._editor.getModel();if(!btt(n,t))return null;const r=n.getValueInRange(t.range);return{reason:_Rn(r,this._options),inComment:Ott(n,t),inString:wtt(n,t)}}};_ze=Pit([lJ(3,Bm)],_ze);class dDo extends ct{constructor(t,n,r){super(),this._editor=t,this._options=n,this._updateState=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Ss(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const t=this._editor.getVisibleRanges(),n=[],r={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const o of t){const s=Fit.computeUnicodeHighlights(this._model,this._options,o);for(const a of s.ranges)r.ranges.push(a);r.ambiguousCharacterCount+=r.ambiguousCharacterCount,r.invisibleCharacterCount+=r.invisibleCharacterCount,r.nonBasicAsciiCharacterCount+=r.nonBasicAsciiCharacterCount,r.hasMore=r.hasMore||s.hasMore}if(!r.hasMore)for(const o of r.ranges)n.push({range:o,options:L0e.instance.getDecorationFromOptions(this._options)});this._updateState(r),this._decorations.set(n)}getDecorationInfo(t){if(!this._decorations.has(t))return null;const n=this._editor.getModel(),r=n.getValueInRange(t.range);return btt(n,t)?{reason:_Rn(r,this._options),inComment:Ott(n,t),inString:wtt(n,t)}:null}}const JRn=j(1538,"Configure Unicode Highlight Options");let $ze=class{constructor(t,n){this._editor=t,this._markdownRendererService=n,this.hoverOrdinal=5}computeSync(t,n){if(!this._editor.hasModel()||t.type!==1)return[];const r=this._editor.getModel(),o=this._editor.getContribution(Dee.ID);if(!o)return[];const s=[],a=new Set;let l=300;for(const d of n){const u=o.getDecorationInfo(d);if(!u)continue;const f=r.getValueInRange(d.range).codePointAt(0),g=gSe(f);let k;switch(u.reason.kind){case 0:{Zie(u.reason.confusableWith)?k=j(1539,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",g,gSe(u.reason.confusableWith.codePointAt(0))):k=j(1540,"The character {0} could be confused with the character {1}, which is more common in source code.",g,gSe(u.reason.confusableWith.codePointAt(0)));break}case 1:k=j(1541,"The character {0} is invisible.",g);break;case 2:k=j(1542,"The character {0} is not a basic ASCII character.",g);break}if(a.has(k))continue;a.add(k);const A={codePoint:f,reason:u.reason,inComment:u.inComment,inString:u.inString},m=j(1543,"Adjust settings"),v=EBn(S0e.ID,A),p=new xA("",!0).appendMarkdown(k).appendText(" ").appendLink(v,m,JRn);s.push(new Np(this,d.range,[p],!1,l++))}return s}renderHoverParts(t,n){return NCo(t,n,this._editor,this._markdownRendererService)}getAccessibleContent(t){return t.contents.map(n=>n.value).join(` `)}};$ze=Pit([lJ(1,D4)],$ze);function eZe(e){return`U+${e.toString(16).padStart(4,"0")}`}function gSe(e){let t=`\`${eZe(e)}\``;return OB.isInvisibleCharacter(e)||(t+=` "${`${uDo(e)}`}"`),t}function uDo(e){return e===96?"`` ` ``":"`"+String.fromCodePoint(e)+"`"}function _Rn(e,t){return Fit.computeUnicodeHighlightReason(e,t)}const _2e=class _2e{constructor(){this.map=new Map}getDecorationFromOptions(t){return this.getDecoration(!t.includeComments,!t.includeStrings)}getDecoration(t,n){const r=`${t}${n}`;let o=this.map.get(r);return o||(o=Ki.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:t,hideInStringTokens:n}),this.map.set(r,o)),o}};_2e.instance=new _2e;let L0e=_2e;class hDo extends Nn{constructor(){super({id:GP.ID,label:Et(1552,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=j(1544,"Disable Highlight In Comments")}async run(t,n,r){const o=t.get(cr);o&&this.runAction(o)}async runAction(t){await t.updateValue(sm.includeComments,!1,2)}}class ADo extends Nn{constructor(){super({id:GP.ID,label:Et(1553,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=j(1545,"Disable Highlight In Strings")}async run(t,n,r){const o=t.get(cr);o&&this.runAction(o)}async runAction(t){await t.updateValue(sm.includeStrings,!1,2)}}const $2e=class $2e extends Gu{constructor(){super({id:$2e.ID,title:Et(1554,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=j(1546,"Disable Ambiguous Highlight")}async run(t,n,r){const o=t.get(cr);o&&this.runAction(o)}async runAction(t){await t.updateValue(sm.ambiguousCharacters,!1,2)}};$2e.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let GP=$2e;const epe=class epe extends Gu{constructor(){super({id:epe.ID,title:Et(1555,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=j(1547,"Disable Invisible Highlight")}async run(t,n,r){const o=t.get(cr);o&&this.runAction(o)}async runAction(t){await t.updateValue(sm.invisibleCharacters,!1,2)}};epe.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let Qee=epe;const tpe=class tpe extends Gu{constructor(){super({id:tpe.ID,title:Et(1556,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=j(1548,"Disable Non ASCII Highlight")}async run(t,n,r){const o=t.get(cr);o&&this.runAction(o)}async runAction(t){await t.updateValue(sm.nonBasicASCII,!1,2)}};tpe.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let Bee=tpe;const npe=class npe extends Gu{constructor(){super({id:npe.ID,title:Et(1557,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(t,n){const{codePoint:r,reason:o,inString:s,inComment:a}=n,l=String.fromCodePoint(r),d=t.get(UA),u=t.get(cr);function h(A){return OB.isInvisibleCharacter(A)?j(1549,"Exclude {0} (invisible character) from being highlighted",eZe(A)):j(1550,"Exclude {0} from being highlighted",`${eZe(A)} "${l}"`)}const f=[];if(o.kind===0)for(const A of o.notAmbiguousInLocales)f.push({label:j(1551,'Allow unicode characters that are more common in the language "{0}".',A),run:async()=>{gDo(u,[A])}});if(f.push({label:h(r),run:()=>fDo(u,[r])}),a){const A=new hDo;f.push({label:A.label,run:async()=>A.runAction(u)})}else if(s){const A=new ADo;f.push({label:A.label,run:async()=>A.runAction(u)})}function g(A){return typeof A.desc.title=="string"?A.desc.title:A.desc.title.value}if(o.kind===0){const A=new GP;f.push({label:g(A),run:async()=>A.runAction(u)})}else if(o.kind===1){const A=new Qee;f.push({label:g(A),run:async()=>A.runAction(u)})}else if(o.kind===2){const A=new Bee;f.push({label:g(A),run:async()=>A.runAction(u)})}else mDo(o);const k=await d.pick(f,{title:JRn});k&&await k.run()}};npe.ID="editor.action.unicodeHighlight.showExcludeOptions";let S0e=npe;async function fDo(e,t){const n=e.getValue(sm.allowedCharacters);let r;typeof n=="object"&&n?r=n:r={};for(const o of t)r[String.fromCodePoint(o)]=!0;await e.updateValue(sm.allowedCharacters,r,2)}async function gDo(e,t){var o;const n=(o=e.inspect(sm.allowedLocales).user)==null?void 0:o.value;let r;typeof n=="object"&&n?r=Object.assign({},n):r={};for(const s of t)r[s]=!0;await e.updateValue(sm.allowedLocales,r,2)}function mDo(e){throw new Error(`Unexpected value: ${e}`)}ws(GP);ws(Qee);ws(Bee);ws(S0e);mo(Dee.ID,Dee,1);XM.register($ze);const Lre=Lr("dialogService");var kDo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},pLt=function(e,t){return function(n,r){t(n,r,e)}};const $Rn="ignoreUnusualLineTerminators";function vDo(e,t,n){e.setModelProperty(t.uri,$Rn,n)}function pDo(e,t){return e.getModelProperty(t.uri,$Rn)}var kH;let T0e=(kH=class extends ct{constructor(t,n,r){super(),this._editor=t,this._dialogService=n,this._codeEditorService=r,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(o=>{o.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const t=this._editor.getModel();if(!t.mightContainUnusualLineTerminators()||pDo(this._codeEditorService,t)===!0||this._editor.getOption(104))return;if(this._config==="auto"){t.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let r;try{this._isPresentingDialog=!0,r=await this._dialogService.confirm({title:j(1558,"Unusual Line Terminators"),message:j(1559,"Detected unusual line terminators"),detail:j(1560,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",g2(t.uri)),primaryButton:j(1561,"&&Remove Unusual Line Terminators"),cancelButton:j(1562,"Ignore")})}finally{this._isPresentingDialog=!1}if(!r.confirmed){vDo(this._codeEditorService,t,!0);return}t.removeUnusualLineTerminators(this._editor.getSelections())}},kH.ID="editor.contrib.unusualLineTerminatorsDetector",kH);T0e=kDo([pLt(1,Lre),pLt(2,Co)],T0e);mo(T0e.ID,T0e,1);const Rce="**",bLt="/",Yhe="[/\\\\]",Xhe="[^/\\\\]",bDo=/\//g;function OLt(e,t){switch(e){case 0:return"";case 1:return`${Xhe}*?`;default:return`(?:${Yhe}|${Xhe}+${Yhe}${t?`|${Yhe}${Xhe}+`:""})*?`}}function wLt(e,t){if(!e)return[];const n=[];let r=!1,o=!1,s="";for(const a of e){switch(a){case t:if(!r&&!o){n.push(s),s="";continue}break;case"{":r=!0;break;case"}":r=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=a}return s&&n.push(s),n}function eIn(e){if(!e)return"";let t="";const n=wLt(e,bLt);if(n.every(r=>r===Rce))t=".*";else{let r=!1;n.forEach((o,s)=>{if(o===Rce){if(r)return;t+=OLt(2,s===n.length-1)}else{let a=!1,l="",d=!1,u="";for(const h of o){if(h!=="}"&&a){l+=h;continue}if(d&&(h!=="]"||!u)){let f;h==="-"?f=h:(h==="^"||h==="!")&&!u?f="^":h===bLt?f="":f=j1(h),u+=f;continue}switch(h){case"{":a=!0;continue;case"[":d=!0;continue;case"}":{const g=`(?:${wLt(l,",").map(k=>eIn(k)).join("|")})`;t+=g,a=!1,l="";break}case"]":{t+="["+u+"]",d=!1,u="";break}case"?":t+=Xhe;continue;case"*":t+=OLt(1);continue;default:t+=j1(h)}}sd===u,endsWith:r?jao:(d,u)=>d.endsWith(u),isEqualOrParent:(d,u)=>qUe(d,u,!ym||r)},s=`${r?n.toLowerCase():n}_${!!t.trimForExclusions}_${r}`;let a=yLt.get(s);if(a)return xLt(a,e,o);let l;return ODo.test(n)?a=SDo(n.substring(4),n,o):(l=wDo.exec(mSe(n,o)))?a=TDo(l[1],n,o):(t.trimForExclusions?CDo:yDo).test(n)?a=EDo(n,o):(l=xDo.exec(mSe(n,o)))?a=LLt(l[1].substring(1),n,!0,o):(l=LDo.exec(mSe(n,o)))?a=LLt(l[1],n,!1,o):a=DDo(n,o),yLt.set(s,a),xLt(a,e,o)}function xLt(e,t,n){if(typeof t=="string")return e;const r=function(o,s){return n.isEqualOrParent(o,t.base)?e(zie(o.substring(t.base.length),dO),s):null};return r.allBasenames=e.allBasenames,r.allPaths=e.allPaths,r.basenames=e.basenames,r.patterns=e.patterns,r}function mSe(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substring(0,e.length-2):e}function SDo(e,t,n){return function(r,o){return typeof r=="string"&&n.endsWith(r,e)?t:null}}function TDo(e,t,n){const r=`/${e}`,o=`\\${e}`,s=function(l,d){return typeof l!="string"?null:d?n.equals(d,e)?t:null:n.equals(l,e)||n.endsWith(l,r)||n.endsWith(l,o)?t:null},a=[e];return s.basenames=a,s.patterns=[t],s.allBasenames=a,s}function EDo(e,t){const n=nIn(e.slice(1,-1).split(",").map(l=>Mit(l,t)).filter(l=>l!==wy),e),r=n.length;if(!r)return wy;if(r===1)return n[0];const o=function(l,d){for(let u=0,h=n.length;u!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);const a=n.reduce((l,d)=>d.allPaths?l.concat(d.allPaths):l,[]);return a.length&&(o.allPaths=a),o}function LLt(e,t,n,r){const o=dO===sd.sep,s=o?e:e.replace(bDo,dO),a=dO+s,l=sd.sep+e;let d;return n?d=function(u,h){return typeof u=="string"&&(r.equals(u,s)||r.endsWith(u,a)||!o&&(r.equals(u,e)||r.endsWith(u,l)))?t:null}:d=function(u,h){return typeof u=="string"&&(r.equals(u,s)||!o&&r.equals(u,e))?t:null},d.allPaths=[(n?"*/":"./")+e],d}function DDo(e,t){try{const n=new RegExp(`^${eIn(e)}$`,t.ignoreCase?"i":void 0);return function(r){return n.lastIndex=0,typeof r=="string"&&n.test(r)?e:null}}catch{return wy}}function QDo(e,t,n){return!e||typeof t!="string"?!1:tIn(e,n)(t)}function tIn(e,t={}){if(!e)return CLt;if(typeof e=="string"||BDo(e)){const n=Mit(e,t);if(n===wy)return CLt;const r=function(o,s){return!!n(o,s)};return n.allBasenames&&(r.allBasenames=n.allBasenames),n.allPaths&&(r.allPaths=n.allPaths),r}return FDo(e,t)}function BDo(e){const t=e;return t?typeof t.base=="string"&&typeof t.pattern=="string":!1}function FDo(e,t){const n=nIn(Object.getOwnPropertyNames(e).map(l=>PDo(l,e[l],t)).filter(l=>l!==wy)),r=n.length;if(!r)return wy;if(!n.some(l=>!!l.requiresSiblings)){if(r===1)return n[0];const l=function(h,f){let g;for(let k=0,A=n.length;k{for(const k of g){const A=await k;if(typeof A=="string")return A}return null})():null},d=n.find(h=>!!h.allBasenames);d&&(l.allBasenames=d.allBasenames);const u=n.reduce((h,f)=>f.allPaths?h.concat(f.allPaths):h,[]);return u.length&&(l.allPaths=u),l}const o=function(l,d,u){let h,f;for(let g=0,k=n.length;g{for(const g of f){const k=await g;if(typeof k=="string")return k}return null})():null},s=n.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);const a=n.reduce((l,d)=>d.allPaths?l.concat(d.allPaths):l,[]);return a.length&&(o.allPaths=a),o}function PDo(e,t,n){if(t===!1)return wy;const r=Mit(e,n);if(r===wy)return wy;if(typeof t=="boolean")return r;if(t){const o=t.when;if(typeof o=="string"){const s=(a,l,d,u)=>{if(!u||!r(a,l))return null;const h=o.replace("$(basename)",()=>d),f=u(h);return LUe(f)?f.then(g=>g?e:null):f?e:null};return s.requiresSiblings=!0,s}}return r}function nIn(e,t){const n=e.filter(l=>!!l.basenames);if(n.length<2)return e;const r=n.reduce((l,d)=>{const u=d.basenames;return u?l.concat(u):l},[]);let o;if(t){o=[];for(let l=0,d=r.length;l{const u=d.patterns;return u?l.concat(u):l},[]);const s=function(l,d){if(typeof l!="string")return null;if(!d){let h;for(h=l.length;h>0;h--){const f=l.charCodeAt(h-1);if(f===47||f===92)break}d=l.substring(h)}const u=r.indexOf(d);return u!==-1?o[u]:null};s.basenames=r,s.patterns=o,s.allBasenames=r;const a=e.filter(l=>!l.basenames);return a.push(s),a}function Rit(e,t,n,r,o,s){if(Array.isArray(e)){let a=0;for(const l of e){const d=Rit(l,t,n,r,o,s);if(d===10)return d;d>a&&(a=d)}return a}else{if(typeof e=="string")return r?e==="*"?5:e===n?10:0:0;if(e){const{language:a,pattern:l,scheme:d,hasAccessToAllModels:u,notebookType:h}=e;if(!r&&!u)return 0;h&&o&&(t=o);let f=0;if(d)if(d===t.scheme)f=10;else if(d==="*")f=5;else return 0;if(a)if(a===n)f=10;else if(a==="*")f=Math.max(f,5);else return 0;if(h)if(h===s)f=10;else if(h==="*"&&s!==void 0)f=Math.max(f,5);else return 0;if(l){let g;if(typeof l=="string"?g=l:g={...l,base:o7n(l.base)},g===t.fsPath||QDo(g,t.fsPath))f=10;else return 0}return f}else return 0}}var MDo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},RDo=function(e,t){return function(n,r){t(n,r,e)}};class SLt{constructor(){this.selector={language:"*"}}provideDocumentHighlights(t,n,r){const o=[],s=t.getWordAtPosition({lineNumber:n.lineNumber,column:n.column});return s?t.isDisposed()?void 0:t.findMatches(s.word,!0,!1,!0,ime,!1).map(l=>({range:l.range,kind:TV.Text})):Promise.resolve(o)}provideMultiDocumentHighlights(t,n,r,o){const s=new Qc,a=t.getWordAtPosition({lineNumber:n.lineNumber,column:n.column});if(!a)return Promise.resolve(s);for(const l of[t,...r]){if(l.isDisposed())continue;const u=l.findMatches(a.word,!0,!1,!0,ime,!1).map(h=>({range:h.range,kind:TV.Text}));u&&s.set(l.uri,u)}return s}}let tZe=class extends ct{constructor(t){super(),this._register(t.documentHighlightProvider.register("*",new SLt)),this._register(t.multiDocumentHighlightProvider.register("*",new SLt))}};tZe=MDo([RDo(0,Zn)],tZe);var iIn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Cw=function(e,t){return function(n,r){t(n,r,e)}},Hl,nZe;const Iit=new Ln("hasWordHighlights",!1);function rIn(e,t,n,r){const o=e.ordered(t);return Aet(o.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(t,n,r)).then(void 0,Xc)),s=>s!=null).then(s=>{if(s){const a=new Qc;return a.set(t.uri,s),a}return new Qc})}function IDo(e,t,n,r,o){const s=e.ordered(t);return Aet(s.map(a=>()=>{const l=o.filter(d=>eDn(d)).filter(d=>Rit(a.selector,d.uri,d.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(t,n,l,r)).then(void 0,Xc)}),a=>a!=null)}class oIn{constructor(t,n,r){this._model=t,this._selection=n,this._wordSeparators=r,this._wordRange=this._getCurrentWordRange(t,n),this._result=null}get result(){return this._result||(this._result=zd(t=>this._compute(this._model,this._selection,this._wordSeparators,t))),this._result}_getCurrentWordRange(t,n){const r=t.getWordAtPosition(n.getPosition());return r?new De(n.startLineNumber,r.startColumn,n.startLineNumber,r.endColumn):null}cancel(){this.result.cancel()}}class NDo extends oIn{constructor(t,n,r,o){super(t,n,r),this._providers=o}_compute(t,n,r,o){return rIn(this._providers,t,n.getPosition(),o).then(s=>s||new Qc)}}class UDo extends oIn{constructor(t,n,r,o,s){super(t,n,r),this._providers=o,this._otherModels=s}_compute(t,n,r,o){return IDo(this._providers,t,n.getPosition(),o,this._otherModels).then(s=>s||new Qc)}}function jDo(e,t,n,r){return new NDo(t,n,r,e)}function WDo(e,t,n,r,o){return new UDo(t,n,r,e,o)}Qm("_executeDocumentHighlights",async(e,t,n)=>{const r=e.get(Zn),o=await rIn(r.documentHighlightProvider,t,n,Fr.None);return o==null?void 0:o.get(t.uri)});var wT;let iZe=(wT=class{constructor(t,n,r,o,s,a,l,d){this.toUnhook=new Pt,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Qc,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new A2(50)),this.editor=t,this.providers=n,this.multiDocumentProviders=r,this.codeEditorService=a,this.textModelService=s,this.configurationService=l,this.logService=d,this._hasWordHighlights=Iit.bindTo(o),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(t.onDidChangeCursorPosition(u=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(u)})})),this.toUnhook.add(t.onDidFocusEditorText(u=>{this.occurrencesHighlightEnablement!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(t.onDidChangeModelContent(u=>{Mbe(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(t.onDidChangeModel(u=>{!u.newModelUrl&&u.oldModelUrl?this._stopSingular():Hl.query&&this._run()})),this.toUnhook.add(t.onDidChangeConfiguration(u=>{var f,g;const h=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==h)switch(this.occurrencesHighlightEnablement=h,h){case"off":this._stopAll();break;case"singleFile":this._stopAll((g=(f=Hl.query)==null?void 0:f.modelInfo)==null?void 0:g.modelURI);break;case"multiFile":Hl.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",h);break}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(u=>{if(u.affectsConfiguration("editor.occurrencesHighlightDelay")){const h=l.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==h&&(this.occurrencesHighlightDelay=h)}})),this.toUnhook.add(t.onDidBlurEditorWidget(()=>{var h,f;const u=this.codeEditorService.getFocusedCodeEditor();u?((h=u.getModel())==null?void 0:h.uri.scheme)===Li.vscodeNotebookCell&&((f=this.editor.getModel())==null?void 0:f.uri.scheme)!==Li.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,Hl.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(t){this.occurrencesHighlightEnablement!=="off"&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,t)}))}stop(){this.occurrencesHighlightEnablement!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(De.compareRangesUsingStarts)}moveNext(){const t=this._getSortedHighlights(),r=(t.findIndex(s=>s.containsPosition(this.editor.getPosition()))+1)%t.length,o=t[r];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);const s=this._getWord();if(s){const a=this.editor.getModel().getLineContent(o.startLineNumber);kg(`${a}, ${r+1} of ${t.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const t=this._getSortedHighlights(),r=(t.findIndex(s=>s.containsPosition(this.editor.getPosition()))-1+t.length)%t.length,o=t[r];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);const s=this._getWord();if(s){const a=this.editor.getModel().getLineContent(o.startLineNumber);kg(`${a}, ${r+1} of ${t.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const t=Hl.storedDecorationIDs.get(this.editor.getModel().uri);t&&(this.editor.removeDecorations(t),Hl.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(t){const n=this.codeEditorService.listCodeEditors(),r=[];for(const o of n){if(!o.hasModel()||IT(o.getModel().uri,t))continue;const s=Hl.storedDecorationIDs.get(o.getModel().uri);if(!s)continue;o.removeDecorations(s),r.push(o.getModel().uri);const a=GT.get(o);a!=null&&a.wordHighlighter&&a.wordHighlighter.decorations.length>0&&(a.wordHighlighter.decorations.clear(),a.wordHighlighter.workerRequest=null,a.wordHighlighter._hasWordHighlights.set(!1))}for(const o of r)Hl.storedDecorationIDs.delete(o)}_stopSingular(){var t,n,r,o;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((t=this.editor.getModel())==null?void 0:t.uri.scheme)!==Li.vscodeNotebookCell&&((r=(n=Hl.query)==null?void 0:n.modelInfo)==null?void 0:r.modelURI.scheme)!==Li.vscodeNotebookCell?(Hl.query=null,this._run()):(o=Hl.query)!=null&&o.modelInfo&&(Hl.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(t){this._removeAllDecorations(t),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(t){if(this.occurrencesHighlightEnablement==="off"){this._stopAll();return}if(t.source!=="api"&&t.reason!==3){this._stopAll();return}this._run()}_getWord(){const t=this.editor.getSelection(),n=t.startLineNumber,r=t.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:n,column:r})}getOtherModelsToHighlight(t){if(!t)return[];if(t.uri.scheme===Li.vscodeNotebookCell){const s=[],a=this.codeEditorService.listCodeEditors();for(const l of a){const d=l.getModel();d&&d!==t&&d.uri.scheme===Li.vscodeNotebookCell&&s.push(d)}return s}const r=[],o=this.codeEditorService.listCodeEditors();for(const s of o){if(!Nnt(s))continue;const a=s.getModel();a&&t===a.modified&&r.push(a.modified)}if(r.length)return r;if(this.occurrencesHighlightEnablement==="singleFile")return[];for(const s of o){const a=s.getModel();a&&a!==t&&r.push(a)}return r}async _run(t,n){var o,s,a;if(this.editor.hasTextFocus()){const l=this.editor.getSelection();if(!l||l.startLineNumber!==l.endLineNumber){Hl.query=null,this._stopAll();return}const d=l.startColumn,u=l.endColumn,h=this._getWord();if(!h||h.startColumn>d||h.endColumn{l===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=h||[],this._beginRenderDecorations(n??this.occurrencesHighlightDelay))},Yi)}catch(h){this.logService.error("Unexpected error during occurrence request. Log: ",h)}finally{u.dispose()}}else if(this.model.uri.scheme===Li.vscodeNotebookCell){const l=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!Hl.query||!Hl.query.modelInfo)return;const d=await this.textModelService.createModelReference(Hl.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(d.object.textEditorModel,Hl.query.modelInfo.selection,[this.model]),(a=this.workerRequest)==null||a.result.then(u=>{l===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=u||[],this._beginRenderDecorations(n??this.occurrencesHighlightDelay))},Yi)}catch(u){this.logService.error("Unexpected error during occurrence request. Log: ",u)}finally{d.dispose()}}}computeWithModel(t,n,r){return r.length?WDo(this.multiDocumentProviders,t,n,this.editor.getOption(148),r):jDo(this.providers,t,n,this.editor.getOption(148))}_beginRenderDecorations(t){const n=new Date().getTime(),r=this.lastCursorPositionChangeTime+t;n>=r?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},r-n)}renderDecorations(){var n,r,o;this.renderDecorationsTimer=void 0;const t=this.codeEditorService.listCodeEditors();for(const s of t){const a=GT.get(s);if(!a)continue;const l=[],d=(n=s.getModel())==null?void 0:n.uri;if(d&&this.workerRequestValue.has(d)){const u=Hl.storedDecorationIDs.get(d),h=this.workerRequestValue.get(d);if(h)for(const g of h)g.range&&l.push({range:g.range,options:JEo(g.kind)});let f=[];s.changeDecorations(g=>{f=g.deltaDecorations(u??[],l)}),Hl.storedDecorationIDs=Hl.storedDecorationIDs.set(d,f),l.length>0&&((r=a.wordHighlighter)==null||r.decorations.set(l),(o=a.wordHighlighter)==null||o._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}},Hl=wT,wT.storedDecorationIDs=new Qc,wT.query=null,wT);iZe=Hl=iIn([Cw(4,Uf),Cw(5,Co),Cw(6,cr),Cw(7,Oa)],iZe);var FF;let GT=(FF=class extends ct{static get(t){return t.getContribution(nZe.ID)}constructor(t,n,r,o,s,a,l){super(),this._wordHighlighter=null;const d=()=>{t.hasModel()&&!t.getModel().isTooLargeForTokenization()&&t.getModel().uri.scheme!==Li.accessibleView&&(this._wordHighlighter=new iZe(t,r.documentHighlightProvider,r.multiDocumentHighlightProvider,n,s,o,a,l))};this._register(t.onDidChangeModel(u=>{var h,f;this._wordHighlighter&&(!u.newModelUrl&&((h=u.oldModelUrl)==null?void 0:h.scheme)!==Li.vscodeNotebookCell&&((f=this.wordHighlighter)==null||f.stop()),this._wordHighlighter.dispose(),this._wordHighlighter=null),d()})),d()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var t;(t=this._wordHighlighter)==null||t.moveNext()}moveBack(){var t;(t=this._wordHighlighter)==null||t.moveBack()}restoreViewState(t){this._wordHighlighter&&t&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},nZe=FF,FF.ID="editor.contrib.wordHighlighter",FF);GT=nZe=iIn([Cw(1,Fi),Cw(2,Zn),Cw(3,Co),Cw(4,Uf),Cw(5,cr),Cw(6,Oa)],GT);class sIn extends Nn{constructor(t,n){super(n),this._isNext=t}run(t,n){const r=GT.get(n);r&&(this._isNext?r.moveNext():r.moveBack())}}class HDo extends sIn{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:Et(1572,"Go to Next Symbol Highlight"),precondition:Iit,kbOpts:{kbExpr:Ze.editorTextFocus,primary:65,weight:100}})}}class VDo extends sIn{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:Et(1573,"Go to Previous Symbol Highlight"),precondition:Iit,kbOpts:{kbExpr:Ze.editorTextFocus,primary:1089,weight:100}})}}class zDo extends Nn{constructor(){super({id:"editor.action.wordHighlight.trigger",label:Et(1574,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:Ze.editorTextFocus,primary:0,weight:100}})}run(t,n,r){const o=GT.get(n);o&&o.restoreViewState(!0)}}mo(GT.ID,GT,0);gn(HDo);gn(VDo);gn(zDo);SZ(tZe);class u3e extends $d{constructor(t){super(t),this._inSelectionMode=t.inSelectionMode,this._wordNavigationType=t.wordNavigationType}runEditorCommand(t,n,r){if(!n.hasModel())return;const o=m2(n.getOption(148),n.getOption(147)),s=n.getModel(),a=n.getSelections(),l=a.length>1,d=a.map(u=>{const h=new tt(u.positionLineNumber,u.positionColumn),f=this._move(o,s,h,this._wordNavigationType,l);return this._moveTo(u,f,this._inSelectionMode)});if(s.pushStackElement(),n._getViewModel().setCursorStates("moveWordCommand",3,d.map(u=>So.fromModelSelection(u))),d.length===1){const u=new tt(d[0].positionLineNumber,d[0].positionColumn);n.revealPosition(u,0)}}_moveTo(t,n,r){return r?new Rn(t.selectionStartLineNumber,t.selectionStartColumn,n.lineNumber,n.column):new Rn(n.lineNumber,n.column,n.lineNumber,n.column)}}class LE extends u3e{_move(t,n,r,o,s){return ls.moveWordLeft(t,n,r,o,s)}}class SE extends u3e{_move(t,n,r,o,s){return ls.moveWordRight(t,n,r,o)}}class ZDo extends LE{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class YDo extends LE{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class XDo extends LE{constructor(){var t;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:zt.and(Ze.textInputFocus,(t=zt.and(fZ,VOe))==null?void 0:t.negate()),primary:2063,mac:{primary:527},weight:100}})}}class qDo extends LE{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class GDo extends LE{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class KDo extends LE{constructor(){var t;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:zt.and(Ze.textInputFocus,(t=zt.and(fZ,VOe))==null?void 0:t.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class JDo extends LE{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(t,n,r,o,s){return super._move(m2(bf.wordSeparators.defaultValue,t.intlSegmenterLocales),n,r,o,s)}}class _Do extends LE{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(t,n,r,o,s){return super._move(m2(bf.wordSeparators.defaultValue,t.intlSegmenterLocales),n,r,o,s)}}class $Do extends SE{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class eQo extends SE{constructor(){var t;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:zt.and(Ze.textInputFocus,(t=zt.and(fZ,VOe))==null?void 0:t.negate()),primary:2065,mac:{primary:529},weight:100}})}}class tQo extends SE{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class nQo extends SE{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class iQo extends SE{constructor(){var t;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:zt.and(Ze.textInputFocus,(t=zt.and(fZ,VOe))==null?void 0:t.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class rQo extends SE{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class oQo extends SE{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(t,n,r,o,s){return super._move(m2(bf.wordSeparators.defaultValue,t.intlSegmenterLocales),n,r,o,s)}}class sQo extends SE{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(t,n,r,o,s){return super._move(m2(bf.wordSeparators.defaultValue,t.intlSegmenterLocales),n,r,o,s)}}class h3e extends $d{constructor(t){super({canTriggerInlineEdits:!0,...t}),this._whitespaceHeuristics=t.whitespaceHeuristics,this._wordNavigationType=t.wordNavigationType}runEditorCommand(t,n,r){const o=t==null?void 0:t.get(bl);if(!n.hasModel()||!o)return;const s=m2(n.getOption(148),n.getOption(147)),a=n.getModel(),l=n.getSelections(),d=n.getOption(10),u=n.getOption(15),h=o.getLanguageConfiguration(a.getLanguageId()).getAutoClosingPairs(),f=n._getViewModel(),g=l.map(k=>{const A=this._delete({wordSeparators:s,model:a,selection:k,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:n.getOption(13),autoClosingBrackets:d,autoClosingQuotes:u,autoClosingPairs:h,autoClosedCharacters:f.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Jh(A,"")});n.pushUndoStop(),n.executeCommands(this.id,g),n.pushUndoStop()}}class Nit extends h3e{_delete(t,n){const r=ls.deleteWordLeft(t,n);return r||new De(1,1,1,1)}}class Uit extends h3e{_delete(t,n){const r=ls.deleteWordRight(t,n);if(r)return r;const o=t.model.getLineCount(),s=t.model.getLineMaxColumn(o);return new De(o,s,o,s)}}class aQo extends Nit{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:Ze.writable})}}class lQo extends Nit{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:Ze.writable})}}class cQo extends Nit{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:Ze.writable,kbOpts:{kbExpr:Ze.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class dQo extends Uit{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:Ze.writable})}}class uQo extends Uit{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:Ze.writable})}}class hQo extends Uit{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:Ze.writable,kbOpts:{kbExpr:Ze.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class AQo extends Nn{constructor(){super({id:"deleteInsideWord",precondition:Ze.writable,label:Et(1575,"Delete Word")})}run(t,n,r){if(!n.hasModel())return;const o=m2(n.getOption(148),n.getOption(147)),s=n.getModel(),l=n.getSelections().map(d=>{const u=ls.deleteInsideWord(o,s,d);return new Jh(u,"")});n.pushUndoStop(),n.executeCommands(this.id,l),n.pushUndoStop()}}xn(new ZDo);xn(new YDo);xn(new XDo);xn(new qDo);xn(new GDo);xn(new KDo);xn(new $Do);xn(new eQo);xn(new tQo);xn(new nQo);xn(new iQo);xn(new rQo);xn(new JDo);xn(new _Do);xn(new oQo);xn(new sQo);xn(new aQo);xn(new lQo);xn(new cQo);xn(new dQo);xn(new uQo);xn(new hQo);gn(AQo);class fQo extends h3e{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:Ze.writable,kbOpts:{kbExpr:Ze.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(t,n){const r=tOe.deleteWordPartLeft(t);return r||new De(1,1,1,1)}}class gQo extends h3e{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:Ze.writable,kbOpts:{kbExpr:Ze.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(t,n){const r=tOe.deleteWordPartRight(t);if(r)return r;const o=t.model.getLineCount(),s=t.model.getLineMaxColumn(o);return new De(o,s,o,s)}}class aIn extends u3e{_move(t,n,r,o,s){return tOe.moveWordPartLeft(t,n,r,s)}}class mQo extends aIn{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:Ze.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}ho.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class kQo extends aIn{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:Ze.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}ho.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class lIn extends u3e{_move(t,n,r,o,s){return tOe.moveWordPartRight(t,n,r)}}class vQo extends lIn{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:Ze.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class pQo extends lIn{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:Ze.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}xn(new fQo);xn(new gQo);xn(new mQo);xn(new kQo);xn(new vQo);xn(new pQo);const rlt=class rlt extends ct{constructor(t){super(),this.editor=t,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const t=R1.get(this.editor);if(t&&this.editor.hasModel()){let n=this.editor.getOptions().get(105);n||(this.editor.isSimpleWidget?n=new xA(j(1378,"Cannot edit in read-only input")):n=new xA(j(1379,"Cannot edit in read-only editor"))),t.showMessage(n,this.editor.getPosition())}}};rlt.ID="editor.contrib.readOnlyMessageController";let E0e=rlt;mo(E0e.ID,E0e,2);var bQo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},TLt=function(e,t){return function(n,r){t(n,r,e)}};let rZe=class extends ct{constructor(t,n,r){super(),this._textModel=t,this._languageFeaturesService=n,this._outlineModelService=r,this._currentModel=Bi(this,void 0);const o=y1("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=y1("_textModel.onDidChangeContent",un.debounce(a=>this._textModel.onDidChangeContent(a),()=>{},100));this._register(PA(async(a,l)=>{o.read(a),s.read(a);const d=l.add(new jbo),u=await this._outlineModelService.getOrCreate(this._textModel,d.token);l.isDisposed||this._currentModel.set(u,void 0)}))}getBreadcrumbItems(t,n){const r=this._currentModel.read(n);if(!r)return[];const o=r.asListOfDocumentSymbols().filter(s=>t.contains(s.range.startLineNumber)&&!t.contains(s.range.endLineNumber));return o.sort(g7n(nA(s=>s.range.endLineNumber-s.range.startLineNumber,P1))),o.map(s=>({name:s.name,kind:s.kind,startLineNumber:s.range.startLineNumber}))}};rZe=bQo([TLt(1,Zn),TLt(2,Cre)],rZe);o1e.setBreadcrumbsSourceFactory((e,t)=>t.createInstance(rZe,e));var OQo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},kSe=function(e,t){return function(n,r){t(n,r,e)}},vH;let D0e=(vH=class extends ct{constructor(t,n,r,o){super();const s=this._register(ml(t)),a=this._register(o.createMenu(Yn.EditorContent,t.contextKeyService)),l=es(this,a.onDidChange,()=>a.getActions().length===0);this._register(xi(d=>{if(l.read(d))return;const h=wo("div.floating-menu-overlay-widget");h.root.style.height="28px";const f=n.createInstance(_$,h.root,Yn.EditorContent,{actionViewItemProvider:(g,k)=>{if(!(g instanceof lk))return;const A=r.lookupKeybinding(g.id);if(A)return n.createInstance(class extends ZT{updateLabel(){this.options.label&&this.label&&(this.label.textContent=`${this._commandAction.label} (${A.getLabel()})`)}},g,{...k,keybindingNotRenderedWithLabel:!0})},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});d.store.add(f),d.store.add(xi(g=>{const k=s.model.read(g);f.context=k==null?void 0:k.uri})),d.store.add(s.createOverlayWidget({allowEditorOverflow:!1,domNode:h.root,minContentWidthInPx:ha(0),position:ha({preference:1})}))}))}},vH.ID="editor.contrib.floatingToolbar",vH);D0e=OQo([kSe(1,$n),kSe(2,Fo),kSe(3,y2)],D0e);mo(D0e.ID,D0e,1);var oZe;(function(e){e.inspectTokensAction=j(786,"Developer: Inspect Tokens")})(oZe||(oZe={}));var Q0e;(function(e){e.gotoLineActionLabel=j(787,"Go to Line/Column...")})(Q0e||(Q0e={}));var sZe;(function(e){e.helpQuickAccessActionLabel=j(788,"Show all Quick Access Providers")})(sZe||(sZe={}));var B0e;(function(e){e.quickCommandActionLabel=j(789,"Command Palette"),e.quickCommandHelp=j(790,"Show And Run Commands")})(B0e||(B0e={}));var Fee;(function(e){e.quickOutlineActionLabel=j(791,"Go to Symbol..."),e.quickOutlineByCategoryActionLabel=j(792,"Go to Symbol by Category...")})(Fee||(Fee={}));var aZe;(function(e){e.editorViewAccessibleLabel=j(793,"Editor content")})(aZe||(aZe={}));var lZe;(function(e){e.toggleHighContrast=j(794,"Toggle High Contrast Theme")})(lZe||(lZe={}));var cZe;(function(e){e.bulkEditServiceSummary=j(795,"Made {0} edits in {1} files")})(cZe||(cZe={}));const olt=class olt extends ct{constructor(t){super(),this.editor=t,this.widget=null,h2&&(this._register(t.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const t=!this.editor.getOption(104);!this.widget&&t?this.widget=new dZe(this.editor):this.widget&&!t&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};olt.ID="editor.contrib.iPadShowKeyboard";let F0e=olt;const ipe=class ipe extends ct{constructor(t){super(),this.editor=t,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(pt(this._domNode,"touchstart",n=>{this.editor.focus()})),this._register(pt(this._domNode,"focus",n=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return ipe.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};ipe.ID="editor.contrib.ShowKeyboardWidget";let dZe=ipe;mo(F0e.ID,F0e,3);const Dk=Lr("themeService");var wQo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},ELt=function(e,t){return function(n,r){t(n,r,e)}},uZe,PF;let Pee=(PF=class extends ct{static get(t){return t.getContribution(uZe.ID)}constructor(t,n,r){super(),this._editor=t,this._languageService=r,this._widget=null,this._register(this._editor.onDidChangeModel(o=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(o=>this.stop())),this._register(Kl.onDidChange(o=>this.stop())),this._register(this._editor.onKeyUp(o=>o.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new hZe(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},uZe=PF,PF.ID="editor.contrib.inspectTokens",PF);Pee=uZe=wQo([ELt(1,Dk),ELt(2,lc)],Pee);class yQo extends Nn{constructor(){super({id:"editor.action.inspectTokens",label:oZe.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(t,n){const r=Pee.get(n);r==null||r.launch()}}function CQo(e){let t="";for(let n=0,r=e.length;nEV,tokenize:(o,s,a)=>Itt(t,a),tokenizeEncoded:(o,s,a)=>xOe(r,a)}}const rpe=class rpe extends ct{constructor(t,n){super(),this.allowEditorOverflow=!0,this._editor=t,this._languageService=n,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=xQo(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(r=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return rpe._ID}_compute(t){const n=this._getTokensAtLine(t.lineNumber);let r=0;for(let d=n.tokens1.length-1;d>=0;d--){const u=n.tokens1[d];if(t.column-1>=u.offset){r=d;break}}let o=0;for(let d=n.tokens2.length>>>1;d>=0;d--)if(t.column-1>=n.tokens2[d<<1]){o=d;break}const s=this._model.getLineContent(t.lineNumber);let a="";if(rr.prefix.length-n.prefix.length),Gn(()=>{this.providers.splice(this.providers.indexOf(t),1),this.defaultProvider===t&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return YO([this.defaultProvider,...this.providers])}getQuickAccessProvider(t){return t&&this.providers.find(r=>t.startsWith(r.prefix))||void 0||this.defaultProvider}}Rl.add(_M.Quickaccess,new LQo);var SQo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},DLt=function(e,t){return function(n,r){t(n,r,e)}},fG,MF;let fZe=(MF=class{constructor(t,n){this.quickInputService=t,this.keybindingService=n,this.registry=Rl.as(_M.Quickaccess)}provide(t){const n=new Pt;return n.add(t.onDidAccept(()=>{const[r]=t.selectedItems;r&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),n.add(t.onDidChangeValue(r=>{const o=this.registry.getQuickAccessProvider(r.substr(fG.PREFIX.length));o&&o.prefix&&o.prefix!==fG.PREFIX&&this.quickInputService.quickAccess.show(o.prefix,{preserveValue:!0})})),t.items=this.getQuickAccessProviders().filter(r=>r.prefix!==fG.PREFIX),n}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((n,r)=>n.prefix.localeCompare(r.prefix)).flatMap(n=>this.createPicks(n))}createPicks(t){return t.helpEntries.map(n=>{const r=n.prefix||t.prefix,o=r||"…";return{prefix:r,label:o,keybinding:n.commandId?this.keybindingService.lookupKeybinding(n.commandId):void 0,ariaLabel:j(1747,"{0}, {1}",o,n.description),description:n.description}})}},fG=MF,MF.PREFIX="?",MF);fZe=fG=SQo([DLt(0,UA),DLt(1,Fo)],fZe);Rl.as(_M.Quickaccess).registerQuickAccessProvider({ctor:fZe,prefix:"",helpEntries:[{description:sZe.helpQuickAccessActionLabel}]});class cIn{constructor(t){this.options=t,this.rangeHighlightDecorationId=void 0}provide(t,n,r){var a;const o=new Pt;t.canAcceptInBackground=!!((a=this.options)!=null&&a.canAcceptInBackground),t.matchOnLabel=t.matchOnDescription=t.matchOnDetail=t.sortByLabel=!1;const s=o.add(new is);return s.value=this.doProvide(t,n,r),o.add(this.onDidActiveTextEditorControlChange(()=>{s.value=void 0,s.value=this.doProvide(t,n)})),o}doProvide(t,n,r){const o=new Pt,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const a={editor:s},l=JPn(s);if(l){let d=s.saveViewState()??void 0;o.add(l.onDidChangeCursorPosition(()=>{d=s.saveViewState()??void 0})),a.restoreViewState=()=>{d&&s===this.activeTextEditorControl&&s.restoreViewState(d)},o.add(kP(n.onCancellationRequested)(()=>{var u;return(u=a.restoreViewState)==null?void 0:u.call(a)}))}o.add(Gn(()=>this.clearDecorations(s))),o.add(this.provideWithTextEditor(a,t,n,r))}else o.add(this.provideWithoutTextEditor(t,n));return o}canProvideWithTextEditor(t){return!0}gotoLocation({editor:t},n){t.setSelection(n.range,"code.jump"),t.revealRangeInCenter(n.range,0),n.preserveFocus||t.focus();const r=t.getModel();r&&"getLineContent"in r&&yO(`${r.getLineContent(n.range.startLineNumber)}`)}getModel(t){var n;return Nnt(t)?(n=t.getModel())==null?void 0:n.modified:t.getModel()}addDecorations(t,n){t.changeDecorations(r=>{const o=[];this.rangeHighlightDecorationId&&(o.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),o.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const s=[{range:n,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:n,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Gl(uQn),position:ck.Full}}}],[a,l]=r.deltaDecorations(o,s);this.rangeHighlightDecorationId={rangeHighlightId:a,overviewRulerDecorationId:l}})}clearDecorations(t){const n=this.rangeHighlightDecorationId;n&&(t.changeDecorations(r=>{r.deltaDecorations([n.overviewRulerDecorationId,n.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const lQ=class lQ extends cIn{constructor(){super({canAcceptInBackground:!0})}get useZeroBasedOffset(){return this.storageService.getBoolean(lQ.ZERO_BASED_OFFSET_STORAGE_KEY,-1,!1)}set useZeroBasedOffset(t){this.storageService.store(lQ.ZERO_BASED_OFFSET_STORAGE_KEY,t,-1,0)}provideWithoutTextEditor(t){const n=j(1335,"Open a text editor first to go to a line.");return t.items=[{label:n}],t.ariaLabel=n,ct.None}provideWithTextEditor(t,n,r){const o=t.editor,s=new Pt;s.add(n.onDidAccept(u=>{const[h]=n.selectedItems;if(h){if(!h.lineNumber)return;this.gotoLocation(t,{range:this.toRange(h.lineNumber,h.column),keyMods:n.keyMods,preserveFocus:u.inBackground}),u.inBackground||n.hide()}}));const a=()=>{const u=n.value.trim().substring(lQ.PREFIX.length),{inOffsetMode:h,lineNumber:f,column:g,label:k}=this.parsePosition(o,u);if(l.visible=!!h,n.items=[{lineNumber:f,column:g,label:k}],n.ariaLabel=k,!f){this.clearDecorations(o);return}const A=this.toRange(f,g);o.revealRangeInCenter(A,0),this.addDecorations(o,A)},l=new F6({title:j(1336,"Use Zero-Based Offset"),icon:Jt.indexZero,isChecked:this.useZeroBasedOffset,inputActiveOptionBorder:sn(Jie),inputActiveOptionForeground:sn(_ie),inputActiveOptionBackground:sn(kZ)});s.add(l.onChange(()=>{this.useZeroBasedOffset=!this.useZeroBasedOffset,a()})),n.toggles=[l],a(),s.add(n.onDidChangeValue(()=>a()));const d=JPn(o);return d&&d.getOptions().get(76).renderType===2&&(d.updateOptions({lineNumbers:"on"}),s.add(Gn(()=>d.updateOptions({lineNumbers:"relative"})))),s}toRange(t=1,n=1){return{startLineNumber:t,startColumn:n,endLineNumber:t,endColumn:n}}parsePosition(t,n){var o,s;const r=this.getModel(t);if(!r)return{label:j(1337,"Open a text editor first to go to a line.")};if(n.startsWith(":")){let a=parseInt(n.substring(1),10);const l=r.getValueLength();if(isNaN(a))return{inOffsetMode:!0,label:this.useZeroBasedOffset?j(1338,"Type a character position to go to (from 0 to {0}).",l-1):j(1339,"Type a character position to go to (from 1 to {0}).",l)};{const d=a<0;this.useZeroBasedOffset||(a-=Math.sign(a)),d&&(a+=l);const u=r.getPositionAt(a);return{...u,inOffsetMode:!0,label:j(1340,"Press 'Enter' to go to line {0} at column {1}.",u.lineNumber,u.column)}}}else{const a=n.split(/,|:|#/),l=r.getLineCount();let d=parseInt((o=a[0])==null?void 0:o.trim(),10);if(a.length<1||isNaN(d))return{label:j(1341,"Type a line number to go to (from 1 to {0}).",l)};d=d>=0?d:l+1+d,d=Math.min(Math.max(1,d),l);const u=r.getLineMaxColumn(d);let h=parseInt((s=a[1])==null?void 0:s.trim(),10);return a.length<2||isNaN(h)?{lineNumber:d,column:1,label:a.length<2?j(1342,"Press 'Enter' to go to line {0} or enter : to add a column number.",d):j(1343,"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",d,u)}:(h=h>=0?h:u+h,h=Math.min(Math.max(1,h),u),{lineNumber:d,column:h,label:j(1344,"Press 'Enter' to go to line {0} at column {1}.",d,h)})}}};lQ.PREFIX=":",lQ.ZERO_BASED_OFFSET_STORAGE_KEY="gotoLine.useZeroBasedOffset";let gZe=lQ;var TQo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},QLt=function(e,t){return function(n,r){t(n,r,e)}};let Mee=class extends gZe{constructor(t,n){super(),this.editorService=t,this.storageService=n,this.onDidActiveTextEditorControlChange=un.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};Mee=TQo([QLt(0,Co),QLt(1,jf)],Mee);var RF;let dIn=(RF=class extends Nn{constructor(){super({id:RF.ID,label:Q0e.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:Ze.focus,primary:2085,mac:{primary:293},weight:100}})}run(t){t.get(UA).quickAccess.show(Mee.PREFIX)}},RF.ID="editor.action.gotoLine",RF);gn(dIn);Rl.as(_M.Quickaccess).registerQuickAccessProvider({ctor:Mee,prefix:Mee.PREFIX,helpEntries:[{description:Q0e.gotoLineActionLabel,commandId:dIn.ID}]});const uIn=[void 0,[]];function vSe(e,t,n=0,r=0){const o=t;return o.values&&o.values.length>1?EQo(e,o.values,n,r):hIn(e,t,n,r)}function EQo(e,t,n,r){let o=0;const s=[];for(const a of t){const[l,d]=hIn(e,a,n,r);if(typeof l!="number")return uIn;o+=l,s.push(...d)}return[o,DQo(s)]}function hIn(e,t,n,r){const o=DP(t.original,t.originalLowercase,n,e,e.toLowerCase(),r,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return o?[o[0],ore(o)]:uIn}function DQo(e){const t=e.sort((o,s)=>o.start-s.start),n=[];let r;for(const o of t)!r||!QQo(r,o)?(r=o,n.push(o)):(r.start=Math.min(r.start,o.start),r.end=Math.max(r.end,o.end));return n}function QQo(e,t){return!(e.end=0,a=BLt(e);let l;const d=e.split(AIn);if(d.length>1)for(const u of d){const h=BLt(u),{pathNormalized:f,normalized:g,normalizedLowercase:k}=FLt(u);g&&(l||(l=[]),l.push({original:u,originalLowercase:u.toLowerCase(),pathNormalized:f,normalized:g,normalizedLowercase:k,expectContiguousMatch:h}))}return{original:e,originalLowercase:t,pathNormalized:n,normalized:r,normalizedLowercase:o,values:l,containsPathSeparator:s,expectContiguousMatch:a}}function FLt(e){let t;wh?t=e.replace(/\//g,dO):t=e.replace(/\\/g,dO);const n=t.replace(/[\*\u2026\s"]/g,"");return{pathNormalized:t,normalized:n,normalizedLowercase:n.toLowerCase()}}function PLt(e){return Array.isArray(e)?mZe(e.map(t=>t.original).join(AIn)):mZe(e.original)}var BQo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},MLt=function(e,t){return function(n,r){t(n,r,e)}},qhe,Xb;let PB=(Xb=class extends cIn{constructor(t,n,r=Object.create(null)){super(r),this._languageFeaturesService=t,this._outlineModelService=n,this.options=r,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(t){return this.provideLabelPick(t,j(1345,"To go to a symbol, first open a text editor with symbol information.")),ct.None}provideWithTextEditor(t,n,r,o){const s=t.editor,a=this.getModel(s);return a?this._languageFeaturesService.documentSymbolProvider.has(a)?this.doProvideWithEditorSymbols(t,a,n,r,o):this.doProvideWithoutEditorSymbols(t,a,n,r):ct.None}doProvideWithoutEditorSymbols(t,n,r,o){const s=new Pt;return this.provideLabelPick(r,j(1346,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(n,s)||o.isCancellationRequested||s.add(this.doProvideWithEditorSymbols(t,n,r,o)))(),s}provideLabelPick(t,n){t.items=[{label:n,index:0,kind:14}],t.ariaLabel=n}async waitForLanguageSymbolRegistry(t,n){if(this._languageFeaturesService.documentSymbolProvider.has(t))return!0;const r=new FM,o=n.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(t)&&(o.dispose(),r.complete(!0))}));return n.add(Gn(()=>r.complete(!1))),r.p}doProvideWithEditorSymbols(t,n,r,o,s){var f;const a=t.editor,l=new Pt;l.add(r.onDidAccept(g=>{var A;const[k]=r.selectedItems;k&&k.range&&(this.gotoLocation(t,{range:k.range.selection,keyMods:r.keyMods,preserveFocus:g.inBackground}),(A=s==null?void 0:s.handleAccept)==null||A.call(s,k,g.inBackground),g.inBackground||r.hide())})),l.add(r.onDidTriggerItemButton(({item:g})=>{g&&g.range&&(this.gotoLocation(t,{range:g.range.selection,keyMods:r.keyMods,forceSideBySide:!0}),r.hide())}));const d=this.getDocumentSymbols(n,o),u=l.add(new is),h=async g=>{var k;(k=u==null?void 0:u.value)==null||k.cancel(),r.busy=!1,u.value=new Ya,r.busy=!0;try{const A=mZe(r.value.substr(qhe.PREFIX.length).trim()),m=await this.doGetSymbolPicks(d,A,void 0,u.value.token,n);if(o.isCancellationRequested)return;if(m.length>0){if(r.items=m,g&&A.original.length===0){const v=S$(m,p=>!!(p.type!=="separator"&&p.range&&De.containsPosition(p.range.decoration,g)));v&&(r.activeItems=[v])}}else A.original.length>0?this.provideLabelPick(r,j(1347,"No matching editor symbols")):this.provideLabelPick(r,j(1348,"No editor symbols"))}finally{o.isCancellationRequested||(r.busy=!1)}};return l.add(r.onDidChangeValue(()=>h(void 0))),h((f=a.getSelection())==null?void 0:f.getPosition()),l.add(r.onDidChangeActive(()=>{const[g]=r.activeItems;g&&g.range&&(a.revealRangeInCenter(g.range.selection,0),this.addDecorations(a,g.range.decoration))})),l}async doGetSymbolPicks(t,n,r,o,s){var v,p;const a=await t;if(o.isCancellationRequested)return[];const l=n.original.indexOf(qhe.SCOPE_PREFIX)===0,d=l?1:0;let u,h;n.values&&n.values.length>1?(u=PLt(n.values[0]),h=PLt(n.values.slice(1))):u=n;let f;const g=(p=(v=this.options)==null?void 0:v.openSideBySideDirection)==null?void 0:p.call(v);g&&(f=[{iconClass:g==="right"?mi.asClassName(Jt.splitHorizontal):mi.asClassName(Jt.splitVertical),tooltip:g==="right"?j(1349,"Open to the Side"):j(1350,"Open to the Bottom")}]);const k=[];for(let b=0;bd){let M=!1;if(u!==n&&([L,S]=vSe(y,{...n,values:void 0},d,C),typeof L=="number"&&(M=!0)),typeof L!="number"&&([L,S]=vSe(y,u,d,C),typeof L!="number"))continue;if(!M&&h){if(x&&h.original.length>0&&([E,Q]=vSe(x,h)),typeof E!="number")continue;typeof L=="number"&&(L+=E)}}const T=O.tags&&O.tags.indexOf(1)>=0;k.push({index:b,kind:O.kind,score:L,label:y,ariaLabel:n1o(O.name,O.kind),description:x,highlights:T?void 0:{label:S,description:Q},range:{selection:De.collapseToStart(O.selectionRange),decoration:O.range},uri:s.uri,symbolName:w,strikethrough:T,buttons:f})}const A=k.sort((b,O)=>l?this.compareByKindAndScore(b,O):this.compareByScore(b,O));let m=[];if(l){let y=function(){O&&typeof b=="number"&&w>0&&(O.label=pP(bSe[b]||pSe,w))},b,O,w=0;for(const C of A)b!==C.kind?(y(),b=C.kind,w=1,O={type:"separator"},m.push(O)):w++,m.push(C);y()}else A.length>0&&(m=[{label:j(1351,"symbols ({0})",k.length),type:"separator"},...A]);return m}compareByScore(t,n){if(typeof t.score!="number"&&typeof n.score=="number")return 1;if(typeof t.score=="number"&&typeof n.score!="number")return-1;if(typeof t.score=="number"&&typeof n.score=="number"){if(t.score>n.score)return-1;if(t.scoren.index?1:0}compareByKindAndScore(t,n){const r=bSe[t.kind]||pSe,o=bSe[n.kind]||pSe,s=r.localeCompare(o);return s===0?this.compareByScore(t,n):s}async getDocumentSymbols(t,n){const r=await this._outlineModelService.getOrCreate(t,n);return n.isCancellationRequested?[]:r.asListOfDocumentSymbols()}},qhe=Xb,Xb.PREFIX="@",Xb.SCOPE_PREFIX=":",Xb.PREFIX_BY_CATEGORY=`${Xb.PREFIX}${Xb.SCOPE_PREFIX}`,Xb);PB=qhe=BQo([MLt(0,Zn),MLt(1,Cre)],PB);const pSe=j(1352,"properties ({0})"),bSe={5:j(1353,"methods ({0})"),11:j(1354,"functions ({0})"),8:j(1355,"constructors ({0})"),12:j(1356,"variables ({0})"),4:j(1357,"classes ({0})"),22:j(1358,"structs ({0})"),23:j(1359,"events ({0})"),24:j(1360,"operators ({0})"),10:j(1361,"interfaces ({0})"),2:j(1362,"namespaces ({0})"),3:j(1363,"packages ({0})"),25:j(1364,"type parameters ({0})"),1:j(1365,"modules ({0})"),6:j(1366,"properties ({0})"),9:j(1367,"enumerations ({0})"),21:j(1368,"enumeration members ({0})"),14:j(1369,"strings ({0})"),0:j(1370,"files ({0})"),17:j(1371,"arrays ({0})"),15:j(1372,"numbers ({0})"),16:j(1373,"booleans ({0})"),18:j(1374,"objects ({0})"),19:j(1375,"keys ({0})"),7:j(1376,"fields ({0})"),13:j(1377,"constants ({0})")};var FQo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},OSe=function(e,t){return function(n,r){t(n,r,e)}};let kZe=class extends PB{constructor(t,n,r){super(n,r),this.editorService=t,this.onDidActiveTextEditorControlChange=un.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};kZe=FQo([OSe(0,Co),OSe(1,Zn),OSe(2,Cre)],kZe);const ope=class ope extends Nn{constructor(){super({id:ope.ID,label:Fee.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:Ze.hasDocumentSymbolProvider,kbOpts:{kbExpr:Ze.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(t){t.get(UA).quickAccess.show(PB.PREFIX,{itemActivation:Rb.NONE})}};ope.ID="editor.action.quickOutline";let P0e=ope;gn(P0e);Rl.as(_M.Quickaccess).registerQuickAccessProvider({ctor:kZe,prefix:PB.PREFIX,helpEntries:[{description:Fee.quickOutlineActionLabel,prefix:PB.PREFIX,commandId:P0e.ID},{description:Fee.quickOutlineByCategoryActionLabel,prefix:PB.PREFIX_BY_CATEGORY}]});function PQo(e){const t=new Map;for(const n of e)t.set(n,(t.get(n)??0)+1);return t}class cJ{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(t,n){const r=this.computeEmbedding(t),o=new Map,s=[];for(const[a,l]of this.documents){if(n.isCancellationRequested)return[];for(const d of l.chunks){const u=this.computeSimilarityScore(d,r,o);u>0&&s.push({key:a,score:u})}}return s}static termFrequencies(t){return PQo(cJ.splitTerms(t))}static*splitTerms(t){const n=r=>r.toLowerCase();for(const[r]of t.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield n(r);const o=r.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(o.length>1)for(const s of o)s.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(s)&&(yield n(s))}}updateDocuments(t){for(const{key:n}of t)this.deleteDocument(n);for(const n of t){const r=[];for(const o of n.textChunks){const s=cJ.termFrequencies(o);for(const a of s.keys())this.chunkOccurrences.set(a,(this.chunkOccurrences.get(a)??0)+1);r.push({text:o,tf:s})}this.chunkCount+=r.length,this.documents.set(n.key,{chunks:r})}return this}deleteDocument(t){const n=this.documents.get(t);if(n){this.documents.delete(t),this.chunkCount-=n.chunks.length;for(const r of n.chunks)for(const o of r.tf.keys()){const s=this.chunkOccurrences.get(o);if(typeof s=="number"){const a=s-1;a<=0?this.chunkOccurrences.delete(o):this.chunkOccurrences.set(o,a)}}}}computeSimilarityScore(t,n,r){let o=0;for(const[s,a]of Object.entries(n)){const l=t.tf.get(s);if(!l)continue;let d=r.get(s);typeof d!="number"&&(d=this.computeIdf(s),r.set(s,d));const u=l*d;o+=u*a}return o}computeEmbedding(t){const n=cJ.termFrequencies(t);return this.computeTfidf(n)}computeIdf(t){const n=this.chunkOccurrences.get(t)??0;return n>0?Math.log((this.chunkCount+1)/n):0}computeTfidf(t){const n=Object.create(null);for(const[r,o]of t){const s=this.computeIdf(r);s>0&&(n[r]=o*s)}return n}}function MQo(e){var r;const t=e.slice(0);t.sort((o,s)=>s.score-o.score);const n=((r=t[0])==null?void 0:r.score)??0;if(n>0)for(const o of t)o.score/=n;return t}var VU;(function(e){e[e.NO_ACTION=0]="NO_ACTION",e[e.CLOSE_PICKER=1]="CLOSE_PICKER",e[e.REFRESH_PICKER=2]="REFRESH_PICKER",e[e.REMOVE_ITEM=3]="REMOVE_ITEM"})(VU||(VU={}));function wSe(e){const t=e;return Array.isArray(t.items)}function RLt(e){const t=e;return!!t.picks&&t.additionalPicks instanceof Promise}class RQo extends ct{constructor(t,n){super(),this.prefix=t,this.options=n}provide(t,n,r){var u;const o=new Pt;t.canAcceptInBackground=!!((u=this.options)!=null&&u.canAcceptInBackground),t.matchOnLabel=t.matchOnDescription=t.matchOnDetail=t.sortByLabel=!1;let s;const a=o.add(new is),l=async()=>{var v;s==null||s.dispose(!0),t.busy=!1;const h=a.value=new Pt;s=h.add(new Ya(n));const f=s.token;let g=t.value.substring(this.prefix.length);(v=this.options)!=null&&v.shouldSkipTrimPickFilter||(g=g.trim());const k=this._getPicks(g,h,f,r),A=(p,b)=>{var y;let O,w;if(wSe(p)?(O=p.items,w=p.active):O=p,O.length===0){if(b)return!1;(g.length>0||t.hideInput)&&((y=this.options)!=null&&y.noResultsPick)&&(gP(this.options.noResultsPick)?O=[this.options.noResultsPick(g)]:O=[this.options.noResultsPick])}return t.items=O,w&&(t.activeItems=[w]),!0},m=async p=>{let b=!1,O=!1;await Promise.all([(async()=>{typeof p.mergeDelay=="number"&&(await My(p.mergeDelay),f.isCancellationRequested)||O||(b=A(p.picks,!0))})(),(async()=>{t.busy=!0;try{const w=await p.additionalPicks;if(f.isCancellationRequested)return;let y,C;wSe(p.picks)?(y=p.picks.items,C=p.picks.active):y=p.picks;let x,L;if(wSe(w)?(x=w.items,L=w.active):x=w,x.length>0||!b){let S;if(!C&&!L){const E=t.activeItems[0];E&&y.indexOf(E)!==-1&&(S=E)}A({items:[...y,...x],active:C||L||S})}}finally{f.isCancellationRequested||(t.busy=!1),O=!0}})()])};if(k!==null)if(RLt(k))await m(k);else if(!(k instanceof Promise))A(k);else{t.busy=!0;try{const p=await k;if(f.isCancellationRequested)return;RLt(p)?await m(p):A(p)}finally{f.isCancellationRequested||(t.busy=!1)}}};o.add(t.onDidChangeValue(()=>l())),l(),o.add(t.onDidAccept(h=>{var g;if(r!=null&&r.handleAccept){h.inBackground||t.hide(),(g=r.handleAccept)==null||g.call(r,t.activeItems[0],h.inBackground);return}const[f]=t.selectedItems;typeof(f==null?void 0:f.accept)=="function"&&(h.inBackground||t.hide(),f.accept(t.keyMods,h))}));const d=async(h,f)=>{var k;if(typeof f.trigger!="function")return;const g=((k=f.buttons)==null?void 0:k.indexOf(h))??-1;if(g>=0){const A=f.trigger(g,t.keyMods),m=typeof A=="number"?A:await A;if(n.isCancellationRequested)return;switch(m){case VU.NO_ACTION:break;case VU.CLOSE_PICKER:t.hide();break;case VU.REFRESH_PICKER:l();break;case VU.REMOVE_ITEM:{const v=t.items.indexOf(f);if(v!==-1){const p=t.items.slice(),b=p.splice(v,1),O=t.activeItems.filter(y=>y!==b[0]),w=t.keepScrollPosition;t.keepScrollPosition=!0,t.items=p,O&&(t.activeItems=O),t.keepScrollPosition=w}break}}}};return o.add(t.onDidTriggerItemButton(({button:h,item:f})=>d(h,f))),o.add(t.onDidTriggerSeparatorButton(({button:h,separator:f})=>d(h,f))),o}}new S4(1e4);const IQo=new S4(1e4);function NQo(e){return jQo(e,"NFD",IQo)}const UQo=/[^\u0000-\u0080]/;function jQo(e,t,n){if(!e)return e;const r=n.get(e);if(r)return r;let o;return UQo.test(e)?o=e.normalize(t):o=e,n.set(e,o),o}const WQo=function(){const e=/[\u0300-\u036f]/g;return function(t){return NQo(t).replace(e,"")}}();var fIn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},ZS=function(e,t){return function(n,r){t(n,r,e)}},AD,pd,Xw;let vZe=(Xw=class extends RQo{constructor(t,n,r,o,s,a){super(AD.PREFIX,t),this.keybindingService=r,this.commandService=o,this.telemetryService=s,this.dialogService=a,this.commandsHistory=this._register(n.createInstance(pZe)),this.options=t}async _getPicks(t,n,r,o){var A,m;const s=await this.getCommandPicks(r);if(r.isCancellationRequested)return[];const a=kP(()=>{const v=new cJ;v.updateDocuments(s.map(b=>({key:b.commandId,textChunks:[this.getTfIdfChunk(b)]})));const p=v.calculateScores(t,r);return MQo(p).filter(b=>b.score>AD.TFIDF_THRESHOLD).slice(0,AD.TFIDF_MAX_RESULTS)}),l=this.normalizeForFiltering(t),d=[];for(const v of s){v.labelNoAccents??(v.labelNoAccents=this.normalizeForFiltering(v.label));const p=AD.WORD_FILTER(l,v.labelNoAccents)??void 0;let b;if(v.commandAlias&&(v.aliasNoAccents??(v.aliasNoAccents=this.normalizeForFiltering(v.commandAlias)),b=AD.WORD_FILTER(l,v.aliasNoAccents)??void 0),p||b)v.highlights={label:p,detail:this.options.showAlias?b:void 0},d.push(v);else if(t===v.commandId)d.push(v);else if(t.length>=3){const O=a();if(r.isCancellationRequested)return[];const w=O.find(y=>y.key===v.commandId);w&&(v.tfIdfScore=w.score,d.push(v))}}const u=new Map;for(const v of d){const p=u.get(v.label);p?(v.description=v.commandId,p.description=p.commandId):u.set(v.label,v)}d.sort((v,p)=>{if(v.tfIdfScore&&p.tfIdfScore)return v.tfIdfScore===p.tfIdfScore?v.label.localeCompare(p.label):p.tfIdfScore-v.tfIdfScore;if(v.tfIdfScore)return 1;if(p.tfIdfScore)return-1;const b=this.commandsHistory.peek(v.commandId),O=this.commandsHistory.peek(p.commandId);if(b&&O)return b>O?-1:1;if(b)return-1;if(O)return 1;if(this.options.suggestedCommandIds){const C=this.options.suggestedCommandIds.has(v.commandId),x=this.options.suggestedCommandIds.has(p.commandId);if(C&&x)return 0;if(C)return-1;if(x)return 1}const w=v.commandCategory===zze.Developer.value,y=p.commandCategory===zze.Developer.value;return w&&!y?1:!w&&y?-1:v.label.localeCompare(p.label)});const h=[];let f=!1,g=!0,k=!!this.options.suggestedCommandIds;for(let v=0;v{var b;const v=await this.getAdditionalCommandPicks(s,d,t,r);if(r.isCancellationRequested)return[];const p=v.map(O=>this.toCommandPick(O,o));return g&&((b=p[0])==null?void 0:b.type)!=="separator"&&p.unshift({type:"separator",label:j(1744,"similar commands")}),p})()}:h}toCommandPick(t,n){if(t.type==="separator")return t;const r=this.keybindingService.lookupKeybinding(t.commandId),o=r?j(1745,"{0}, {1}",t.label,r.getAriaLabel()):t.label;return{...t,ariaLabel:o,detail:this.options.showAlias&&t.commandAlias!==t.label?t.commandAlias:void 0,keybinding:r,accept:async()=>{var s;this.commandsHistory.push(t.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:t.commandId,from:(n==null?void 0:n.from)??"quick open"});try{(s=t.args)!=null&&s.length?await this.commandService.executeCommand(t.commandId,...t.args):await this.commandService.executeCommand(t.commandId)}catch(a){Sk(a)||this.dialogService.error(j(1746,"Command '{0}' resulted in an error",t.label),A1e(a))}}}}getTfIdfChunk({label:t,commandAlias:n,commandDescription:r}){let o=t;return n&&n!==t&&(o+=` - ${n}`),r&&r.value!==t&&(o+=` - ${r.value===r.original?r.value:`${r.value} (${r.original})`}`),o}normalizeForFiltering(t){const n=WQo(t);return n.length!==t.length?(this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch",{originalLength:t.length,normalizedLength:n.length}),t):n}},AD=Xw,Xw.PREFIX=">",Xw.TFIDF_THRESHOLD=.5,Xw.TFIDF_MAX_RESULTS=5,Xw.WORD_FILTER=Ztt(V$,ipo,vBn),Xw);vZe=AD=fIn([ZS(1,$n),ZS(2,Fo),ZS(3,Ca),ZS(4,zA),ZS(5,Lre)],vZe);var qb;let pZe=(qb=class extends ct{constructor(t,n,r){super(),this.storageService=t,this.configurationService=n,this.logService=r,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(t=>this.updateConfiguration(t))),this._register(this.storageService.onWillSaveState(t=>{t.reason===J5.SHUTDOWN&&this.saveState()}))}updateConfiguration(t){t&&!t.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=pd.getConfiguredCommandHistoryLength(this.configurationService),pd.cache&&pd.cache.limit!==this.configuredCommandsHistoryLength&&(pd.cache.limit=this.configuredCommandsHistoryLength,pd.hasChanges=!0))}load(){const t=this.storageService.get(pd.PREF_KEY_CACHE,0);let n;if(t)try{n=JSON.parse(t)}catch(o){this.logService.error(`[CommandsHistory] invalid data: ${o}`)}const r=pd.cache=new S4(this.configuredCommandsHistoryLength,1);if(n){let o;n.usesLRU?o=n.entries:o=n.entries.sort((s,a)=>s.value-a.value),o.forEach(s=>r.set(s.key,s.value))}pd.counter=this.storageService.getNumber(pd.PREF_KEY_COUNTER,0,pd.counter)}push(t){pd.cache&&(pd.cache.set(t,pd.counter++),pd.hasChanges=!0)}peek(t){var n;return(n=pd.cache)==null?void 0:n.peek(t)}saveState(){if(!pd.cache||!pd.hasChanges)return;const t={usesLRU:!0,entries:[]};pd.cache.forEach((n,r)=>t.entries.push({key:r,value:n})),this.storageService.store(pd.PREF_KEY_CACHE,JSON.stringify(t),0,0),this.storageService.store(pd.PREF_KEY_COUNTER,pd.counter,0,0),pd.hasChanges=!1}static getConfiguredCommandHistoryLength(t){var o,s;const r=(s=(o=t.getValue().workbench)==null?void 0:o.commandPalette)==null?void 0:s.history;return typeof r=="number"?r:pd.DEFAULT_COMMANDS_HISTORY_LENGTH}},pd=qb,qb.DEFAULT_COMMANDS_HISTORY_LENGTH=50,qb.PREF_KEY_CACHE="commandPalette.mru.cache",qb.PREF_KEY_COUNTER="commandPalette.mru.counter",qb.counter=1,qb.hasChanges=!1,qb);pZe=pd=fIn([ZS(0,jf),ZS(1,cr),ZS(2,Oa)],pZe);class HQo extends vZe{constructor(t,n,r,o,s,a){super(t,n,r,o,s,a)}getCodeEditorCommandPicks(){var r;const t=this.activeTextEditorControl;if(!t)return[];const n=[];for(const o of t.getSupportedActions()){let s;(r=o.metadata)!=null&&r.description&&(zOo(o.metadata.description)?s=o.metadata.description:s={original:o.metadata.description,value:o.metadata.description}),n.push({commandId:o.id,commandAlias:o.alias,commandDescription:s,label:Jtt(o.label)||o.id})}return n}}var VQo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},eN=function(e,t){return function(n,r){t(n,r,e)}};let Ree=class extends HQo{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(t,n,r,o,s,a){super({showAlias:!1},t,r,o,s,a),this.codeEditorService=n}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};Ree=VQo([eN(0,$n),eN(1,Co),eN(2,Fo),eN(3,Ca),eN(4,zA),eN(5,Lre)],Ree);const spe=class spe extends Nn{constructor(){super({id:spe.ID,label:B0e.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:Ze.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(t){t.get(UA).quickAccess.show(Ree.PREFIX)}};spe.ID="editor.action.quickCommand";let M0e=spe;gn(M0e);Rl.as(_M.Quickaccess).registerQuickAccessProvider({ctor:Ree,prefix:Ree.PREFIX,helpEntries:[{description:B0e.quickCommandHelp,commandId:M0e.ID}]});var zQo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},tN=function(e,t){return function(n,r){t(n,r,e)}};let bZe=class extends ZP{constructor(t,n,r,o,s,a,l){super(!0,t,n,r,o,s,a,l)}};bZe=zQo([tN(1,Fi),tN(2,Co),tN(3,cc),tN(4,$n),tN(5,jf),tN(6,cr)],bZe);mo(ZP.ID,bZe,4);class ZQo{constructor(t,n,r,o,s){this._parsedThemeRuleBrand=void 0,this.token=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=s}}function YQo(e){if(!e||!Array.isArray(e))return[];const t=[];let n=0;for(let r=0,o=e.length;r{const g=_Qo(h.token,f.token);return g!==0?g:h.index-f.index});let n=0,r="000000",o="ffffff";for(;e.length>=1&&e[0].token==="";){const h=e.shift();h.fontStyle!==-1&&(n=h.fontStyle),h.foreground!==null&&(r=h.foreground),h.background!==null&&(o=h.background)}const s=new GQo;for(const h of t)s.getId(h);const a=s.getId(r),l=s.getId(o),d=new jit(n,a,l),u=new Wit(d);for(let h=0,f=e.length;h"u"){const o=this._match(n),s=JQo(n);r=(o.metadata|s<<8)>>>0,this._cache.set(n,r)}return(r|t<<0)>>>0}}const KQo=/\b(comment|string|regex|regexp)\b/;function JQo(e){const t=e.match(KQo);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function _Qo(e,t){return et?1:0}class jit{constructor(t,n,r){this._themeTrieElementRuleBrand=void 0,this._fontStyle=t,this._foreground=n,this._background=r,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new jit(this._fontStyle,this._foreground,this._background)}acceptOverwrite(t,n,r){t!==-1&&(this._fontStyle=t),n!==0&&(this._foreground=n),r!==0&&(this._background=r),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class Wit{constructor(t){this._themeTrieElementBrand=void 0,this._mainRule=t,this._children=new Map}match(t){if(t==="")return this._mainRule;const n=t.indexOf(".");let r,o;n===-1?(r=t,o=""):(r=t.substring(0,n),o=t.substring(n+1));const s=this._children.get(r);return typeof s<"u"?s.match(o):this._mainRule}insert(t,n,r,o){if(t===""){this._mainRule.acceptOverwrite(n,r,o);return}const s=t.indexOf(".");let a,l;s===-1?(a=t,l=""):(a=t.substring(0,s),l=t.substring(s+1));let d=this._children.get(a);typeof d>"u"&&(d=new Wit(this._mainRule.clone()),this._children.set(a,d)),d.insert(l,n,r,o)}}function $Qo(e){const t=[];for(let n=1,r=e.length;nn.fire())),e&&t.add(e.onDidProductIconThemeChange(()=>n.fire())),{dispose:()=>t.dispose(),onDidChange:n.event,getCSS(){const o=e?e.getProductIconTheme():new mIn,s={},a=new s9e,l=new s9e;for(const d of r.getIcons()){const u=o.getIcon(d);if(!u)continue;const h=u.font,f=_m`--vscode-icon-${Kle(d.id)}-font-family`,g=_m`--vscode-icon-${Kle(d.id)}-content`;h?(s[h.id]=h.definition,l.push(_m`${f}: ${x9(h.id)};`,_m`${g}: ${x9(u.fontCharacter)};`),a.push(_m`.codicon-${Kle(d.id)}:before { content: ${x9(u.fontCharacter)}; font-family: ${x9(h.id)}; }`)):(l.push(_m`${g}: ${x9(u.fontCharacter)}; ${f}: 'codicon';`),a.push(_m`.codicon-${Kle(d.id)}:before { content: ${x9(u.fontCharacter)}; }`))}for(const d in s){const u=s[d],h=u.weight?_m`font-weight: ${Zwt(u.weight)};`:_m``,f=u.style?_m`font-style: ${Zwt(u.style)};`:_m``,g=new s9e;for(const k of u.src)g.push(_m`${Uy(k.location)} format(${x9(k.format)})`);a.push(_m`@font-face { src: ${g.join(", ")}; font-family: ${x9(d)};${h}${f} font-display: block; }`)}return a.push(_m`:root { ${l.join(" ")} }`),a.join(` `)}}}class mIn{getIcon(t){const n=cFn();let r=t.defaults;for(;mi.isThemeIcon(r);){const o=n.getIcon(r.id);if(!o)return;r=o.defaults}return r}}const DL="vs",fW="vs-dark",MB="hc-black",RB="hc-light",kIn=Rl.as(xDn.ColorContribution),oBo=Rl.as(sQn.ThemingContribution);class vIn{constructor(t,n){this.semanticHighlighting=!1,this.themeData=n;const r=n.base;t.length>0?(Ghe(t)?this.id=t:this.id=r+" "+t,this.themeName=t):(this.id=r,this.themeName=r),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const t=new Map;for(const n in this.themeData.colors)t.set(n,Ut.fromHex(this.themeData.colors[n]));if(this.themeData.inherit){const n=OZe(this.themeData.base);for(const r in n.colors)t.has(r)||t.set(r,Ut.fromHex(n.colors[r]))}this.colors=t}return this.colors}getColor(t,n){const r=this.getColors().get(t);if(r)return r;if(n!==!1)return this.getDefault(t)}getDefault(t){let n=this.defaultColors[t];return n||(n=kIn.resolveDefaultColor(t,this),this.defaultColors[t]=n,n)}defines(t){return this.getColors().has(t)}get type(){switch(this.base){case DL:return Xv.LIGHT;case MB:return Xv.HIGH_CONTRAST_DARK;case RB:return Xv.HIGH_CONTRAST_LIGHT;default:return Xv.DARK}}get tokenTheme(){if(!this._tokenTheme){let t=[],n=[];if(this.themeData.inherit){const s=OZe(this.themeData.base);t=s.rules,s.encodedTokensColors&&(n=s.encodedTokensColors)}const r=this.themeData.colors["editor.foreground"],o=this.themeData.colors["editor.background"];if(r||o){const s={token:""};r&&(s.foreground=r),o&&(s.background=o),t.push(s)}t=t.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(n=this.themeData.encodedTokensColors),this._tokenTheme=gIn.createFromRawTokenTheme(t,n)}return this._tokenTheme}getTokenStyleMetadata(t,n,r){const s=this.tokenTheme._match([t].concat(n).join(".")).metadata,a=CA.getForeground(s),l=CA.getFontStyle(s);return{foreground:a,italic:!!(l&1),bold:!!(l&2),underline:!!(l&4),strikethrough:!!(l&8)}}get tokenColorMap(){return[]}}function Ghe(e){return e===DL||e===fW||e===MB||e===RB}function OZe(e){switch(e){case DL:return eBo;case fW:return tBo;case MB:return nBo;case RB:return iBo}}function Ice(e){const t=OZe(e);return new vIn(e,t)}class sBo extends ct{constructor(){super(),this._onColorThemeChange=this._register(new it),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new it),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new mIn,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(DL,Ice(DL)),this._knownThemes.set(fW,Ice(fW)),this._knownThemes.set(MB,Ice(MB)),this._knownThemes.set(RB,Ice(RB));const t=this._register(rBo(this));this._codiconCSS=t.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} ${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(DL),this._onOSSchemeChanged(),this._register(t.onDidChange(()=>{this._codiconCSS=t.getCSS(),this._updateCSS()})),FEn(Ls,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(t){return Kge(t)?this._registerShadowDomContainer(t):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=v2(void 0,t=>{t.className="monaco-colors",t.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),ct.None}_registerShadowDomContainer(t){const n=v2(t,r=>{r.className="monaco-colors",r.textContent=this._allCSS});return this._styleElements.push(n),{dispose:()=>{for(let r=0;r{r.base===t&&r.notifyBaseUpdated()}),this._theme.themeName===t&&this.setTheme(t)}getColorTheme(){return this._theme}setColorMapOverride(t){this._colorMapOverride=t,this._updateThemeOrColorMap()}setTheme(t){let n;this._knownThemes.has(t)?n=this._knownThemes.get(t):n=this._knownThemes.get(DL),this._updateActualTheme(n)}_updateActualTheme(t){!t||this._theme===t||(this._theme=t,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const t=Ls.matchMedia("(forced-colors: active)").matches;if(t!==AO(this._theme.type)){let n;_8(this._theme.type)?n=t?MB:fW:n=t?RB:DL,this._updateActualTheme(this._knownThemes.get(n))}}}setAutoDetectHighContrast(t){this._autoDetectHighContrast=t,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const t=[],n={},r={addRule:a=>{n[a]||(t.push(a),n[a]=!0)}};oBo.getThemingParticipants().forEach(a=>a(this._theme,r,this._environment));const o=[];for(const a of kIn.getColors()){const l=this._theme.getColor(a.id,!0);l&&o.push(`${ttt(a.id)}: ${l.toString()};`)}r.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${o.join(` `)} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();r.addRule($Qo(s)),r.addRule(".monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }"),this._themeCSS=t.join(` `),this._updateCSS(),Kl.setColorMap(s),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} ${this._themeCSS}`,this._styleElements.forEach(t=>t.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}class aBo extends Nn{constructor(){super({id:"editor.action.toggleHighContrast",label:lZe.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(t,n){const r=t.get(Dk),o=r.getColorTheme();AO(o.type)?(r.setTheme(this._originalThemeName||(_8(o.type)?fW:DL)),this._originalThemeName=null):(r.setTheme(_8(o.type)?MB:RB),this._originalThemeName=o.themeName)}}gn(aBo);var wZe;(function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"})(wZe||(wZe={}));var yZe;(function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"})(yZe||(yZe={}));var CZe;(function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"})(CZe||(CZe={}));var xZe;(function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Tool=27]="Tool",e[e.Snippet=28]="Snippet"})(xZe||(xZe={}));var LZe;(function(e){e[e.Deprecated=1]="Deprecated"})(LZe||(LZe={}));var SZe;(function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(SZe||(SZe={}));var TZe;(function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"})(TZe||(TZe={}));var EZe;(function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"})(EZe||(EZe={}));var DZe;(function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"})(DZe||(DZe={}));var QZe;(function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"})(QZe||(QZe={}));var BZe;(function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"})(BZe||(BZe={}));var FZe;(function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.allowOverflow=4]="allowOverflow",e[e.allowVariableLineHeights=5]="allowVariableLineHeights",e[e.allowVariableFonts=6]="allowVariableFonts",e[e.allowVariableFontsInAccessibilityMode=7]="allowVariableFontsInAccessibilityMode",e[e.ariaLabel=8]="ariaLabel",e[e.ariaRequired=9]="ariaRequired",e[e.autoClosingBrackets=10]="autoClosingBrackets",e[e.autoClosingComments=11]="autoClosingComments",e[e.screenReaderAnnounceInlineSuggestion=12]="screenReaderAnnounceInlineSuggestion",e[e.autoClosingDelete=13]="autoClosingDelete",e[e.autoClosingOvertype=14]="autoClosingOvertype",e[e.autoClosingQuotes=15]="autoClosingQuotes",e[e.autoIndent=16]="autoIndent",e[e.autoIndentOnPaste=17]="autoIndentOnPaste",e[e.autoIndentOnPasteWithinString=18]="autoIndentOnPasteWithinString",e[e.automaticLayout=19]="automaticLayout",e[e.autoSurround=20]="autoSurround",e[e.bracketPairColorization=21]="bracketPairColorization",e[e.guides=22]="guides",e[e.codeLens=23]="codeLens",e[e.codeLensFontFamily=24]="codeLensFontFamily",e[e.codeLensFontSize=25]="codeLensFontSize",e[e.colorDecorators=26]="colorDecorators",e[e.colorDecoratorsLimit=27]="colorDecoratorsLimit",e[e.columnSelection=28]="columnSelection",e[e.comments=29]="comments",e[e.contextmenu=30]="contextmenu",e[e.copyWithSyntaxHighlighting=31]="copyWithSyntaxHighlighting",e[e.cursorBlinking=32]="cursorBlinking",e[e.cursorSmoothCaretAnimation=33]="cursorSmoothCaretAnimation",e[e.cursorStyle=34]="cursorStyle",e[e.cursorSurroundingLines=35]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=36]="cursorSurroundingLinesStyle",e[e.cursorWidth=37]="cursorWidth",e[e.cursorHeight=38]="cursorHeight",e[e.disableLayerHinting=39]="disableLayerHinting",e[e.disableMonospaceOptimizations=40]="disableMonospaceOptimizations",e[e.domReadOnly=41]="domReadOnly",e[e.dragAndDrop=42]="dragAndDrop",e[e.dropIntoEditor=43]="dropIntoEditor",e[e.editContext=44]="editContext",e[e.emptySelectionClipboard=45]="emptySelectionClipboard",e[e.experimentalGpuAcceleration=46]="experimentalGpuAcceleration",e[e.experimentalWhitespaceRendering=47]="experimentalWhitespaceRendering",e[e.extraEditorClassName=48]="extraEditorClassName",e[e.fastScrollSensitivity=49]="fastScrollSensitivity",e[e.find=50]="find",e[e.fixedOverflowWidgets=51]="fixedOverflowWidgets",e[e.folding=52]="folding",e[e.foldingStrategy=53]="foldingStrategy",e[e.foldingHighlight=54]="foldingHighlight",e[e.foldingImportsByDefault=55]="foldingImportsByDefault",e[e.foldingMaximumRegions=56]="foldingMaximumRegions",e[e.unfoldOnClickAfterEndOfLine=57]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=58]="fontFamily",e[e.fontInfo=59]="fontInfo",e[e.fontLigatures=60]="fontLigatures",e[e.fontSize=61]="fontSize",e[e.fontWeight=62]="fontWeight",e[e.fontVariations=63]="fontVariations",e[e.formatOnPaste=64]="formatOnPaste",e[e.formatOnType=65]="formatOnType",e[e.glyphMargin=66]="glyphMargin",e[e.gotoLocation=67]="gotoLocation",e[e.hideCursorInOverviewRuler=68]="hideCursorInOverviewRuler",e[e.hover=69]="hover",e[e.inDiffEditor=70]="inDiffEditor",e[e.inlineSuggest=71]="inlineSuggest",e[e.letterSpacing=72]="letterSpacing",e[e.lightbulb=73]="lightbulb",e[e.lineDecorationsWidth=74]="lineDecorationsWidth",e[e.lineHeight=75]="lineHeight",e[e.lineNumbers=76]="lineNumbers",e[e.lineNumbersMinChars=77]="lineNumbersMinChars",e[e.linkedEditing=78]="linkedEditing",e[e.links=79]="links",e[e.matchBrackets=80]="matchBrackets",e[e.minimap=81]="minimap",e[e.mouseStyle=82]="mouseStyle",e[e.mouseWheelScrollSensitivity=83]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=84]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=85]="multiCursorMergeOverlapping",e[e.multiCursorModifier=86]="multiCursorModifier",e[e.mouseMiddleClickAction=87]="mouseMiddleClickAction",e[e.multiCursorPaste=88]="multiCursorPaste",e[e.multiCursorLimit=89]="multiCursorLimit",e[e.occurrencesHighlight=90]="occurrencesHighlight",e[e.occurrencesHighlightDelay=91]="occurrencesHighlightDelay",e[e.overtypeCursorStyle=92]="overtypeCursorStyle",e[e.overtypeOnPaste=93]="overtypeOnPaste",e[e.overviewRulerBorder=94]="overviewRulerBorder",e[e.overviewRulerLanes=95]="overviewRulerLanes",e[e.padding=96]="padding",e[e.pasteAs=97]="pasteAs",e[e.parameterHints=98]="parameterHints",e[e.peekWidgetDefaultFocus=99]="peekWidgetDefaultFocus",e[e.placeholder=100]="placeholder",e[e.definitionLinkOpensInPeek=101]="definitionLinkOpensInPeek",e[e.quickSuggestions=102]="quickSuggestions",e[e.quickSuggestionsDelay=103]="quickSuggestionsDelay",e[e.readOnly=104]="readOnly",e[e.readOnlyMessage=105]="readOnlyMessage",e[e.renameOnType=106]="renameOnType",e[e.renderRichScreenReaderContent=107]="renderRichScreenReaderContent",e[e.renderControlCharacters=108]="renderControlCharacters",e[e.renderFinalNewline=109]="renderFinalNewline",e[e.renderLineHighlight=110]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=111]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=112]="renderValidationDecorations",e[e.renderWhitespace=113]="renderWhitespace",e[e.revealHorizontalRightPadding=114]="revealHorizontalRightPadding",e[e.roundedSelection=115]="roundedSelection",e[e.rulers=116]="rulers",e[e.scrollbar=117]="scrollbar",e[e.scrollBeyondLastColumn=118]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=119]="scrollBeyondLastLine",e[e.scrollPredominantAxis=120]="scrollPredominantAxis",e[e.selectionClipboard=121]="selectionClipboard",e[e.selectionHighlight=122]="selectionHighlight",e[e.selectionHighlightMaxLength=123]="selectionHighlightMaxLength",e[e.selectionHighlightMultiline=124]="selectionHighlightMultiline",e[e.selectOnLineNumbers=125]="selectOnLineNumbers",e[e.showFoldingControls=126]="showFoldingControls",e[e.showUnused=127]="showUnused",e[e.snippetSuggestions=128]="snippetSuggestions",e[e.smartSelect=129]="smartSelect",e[e.smoothScrolling=130]="smoothScrolling",e[e.stickyScroll=131]="stickyScroll",e[e.stickyTabStops=132]="stickyTabStops",e[e.stopRenderingLineAfter=133]="stopRenderingLineAfter",e[e.suggest=134]="suggest",e[e.suggestFontSize=135]="suggestFontSize",e[e.suggestLineHeight=136]="suggestLineHeight",e[e.suggestOnTriggerCharacters=137]="suggestOnTriggerCharacters",e[e.suggestSelection=138]="suggestSelection",e[e.tabCompletion=139]="tabCompletion",e[e.tabIndex=140]="tabIndex",e[e.trimWhitespaceOnDelete=141]="trimWhitespaceOnDelete",e[e.unicodeHighlighting=142]="unicodeHighlighting",e[e.unusualLineTerminators=143]="unusualLineTerminators",e[e.useShadowDOM=144]="useShadowDOM",e[e.useTabStops=145]="useTabStops",e[e.wordBreak=146]="wordBreak",e[e.wordSegmenterLocales=147]="wordSegmenterLocales",e[e.wordSeparators=148]="wordSeparators",e[e.wordWrap=149]="wordWrap",e[e.wordWrapBreakAfterCharacters=150]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=151]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=152]="wordWrapColumn",e[e.wordWrapOverride1=153]="wordWrapOverride1",e[e.wordWrapOverride2=154]="wordWrapOverride2",e[e.wrappingIndent=155]="wrappingIndent",e[e.wrappingStrategy=156]="wrappingStrategy",e[e.showDeprecated=157]="showDeprecated",e[e.inertialScroll=158]="inertialScroll",e[e.inlayHints=159]="inlayHints",e[e.wrapOnEscapedLineFeeds=160]="wrapOnEscapedLineFeeds",e[e.effectiveCursorStyle=161]="effectiveCursorStyle",e[e.editorClassName=162]="editorClassName",e[e.pixelRatio=163]="pixelRatio",e[e.tabFocusMode=164]="tabFocusMode",e[e.layoutInfo=165]="layoutInfo",e[e.wrappingInfo=166]="wrappingInfo",e[e.defaultColorDecorators=167]="defaultColorDecorators",e[e.colorDecoratorsActivatedOn=168]="colorDecoratorsActivatedOn",e[e.inlineCompletionsAccessibilityVerbose=169]="inlineCompletionsAccessibilityVerbose",e[e.effectiveEditContext=170]="effectiveEditContext",e[e.scrollOnMiddleClick=171]="scrollOnMiddleClick",e[e.effectiveAllowVariableFonts=172]="effectiveAllowVariableFonts"})(FZe||(FZe={}));var PZe;(function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"})(PZe||(PZe={}));var MZe;(function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"})(MZe||(MZe={}));var RZe;(function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=3]="Right"})(RZe||(RZe={}));var IZe;(function(e){e[e.Increase=0]="Increase",e[e.Decrease=1]="Decrease"})(IZe||(IZe={}));var NZe;(function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"})(NZe||(NZe={}));var UZe;(function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"})(UZe||(UZe={}));var jZe;(function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"})(jZe||(jZe={}));var WZe;(function(e){e[e.Accepted=0]="Accepted",e[e.Rejected=1]="Rejected",e[e.Ignored=2]="Ignored"})(WZe||(WZe={}));var HZe;(function(e){e[e.Code=1]="Code",e[e.Label=2]="Label"})(HZe||(HZe={}));var VZe;(function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"})(VZe||(VZe={}));var zZe;(function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"})(zZe||(zZe={}));var ZZe;(function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"})(ZZe||(ZZe={}));var YZe;(function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"})(YZe||(YZe={}));var XZe;(function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"})(XZe||(XZe={}));var qZe;(function(e){e[e.Normal=1]="Normal",e[e.Underlined=2]="Underlined"})(qZe||(qZe={}));var GZe;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(GZe||(GZe={}));var KZe;(function(e){e[e.AIGenerated=1]="AIGenerated"})(KZe||(KZe={}));var JZe;(function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"})(JZe||(JZe={}));var _Ze;(function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"})(_Ze||(_Ze={}));var $Ze;(function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"})($Ze||($Ze={}));var eYe;(function(e){e[e.Word=0]="Word",e[e.Line=1]="Line",e[e.Suggest=2]="Suggest"})(eYe||(eYe={}));var tYe;(function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"})(tYe||(tYe={}));var nYe;(function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"})(nYe||(nYe={}));var iYe;(function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"})(iYe||(iYe={}));var rYe;(function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"})(rYe||(rYe={}));var oYe;(function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"})(oYe||(oYe={}));var sYe;(function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"})(sYe||(sYe={}));var aYe;(function(e){e.Off="off",e.OnCode="onCode",e.On="on"})(aYe||(aYe={}));var lYe;(function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"})(lYe||(lYe={}));var cYe;(function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"})(cYe||(cYe={}));var dYe;(function(e){e[e.Deprecated=1]="Deprecated"})(dYe||(dYe={}));var uYe;(function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"})(uYe||(uYe={}));var hYe;(function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"})(hYe||(hYe={}));var AYe;(function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"})(AYe||(AYe={}));var fYe;(function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(fYe||(fYe={}));var gYe;(function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"})(gYe||(gYe={}));var t8;let lBo=(t8=class{static chord(t,n){return qc(t,n)}},t8.CtrlCmd=2048,t8.Shift=1024,t8.Alt=512,t8.WinCtrl=256,t8);function pIn(){return{editor:void 0,languages:void 0,CancellationTokenSource:Ya,Emitter:it,KeyCode:zZe,KeyMod:lBo,Position:tt,Range:De,Selection:Rn,SelectionDirection:sYe,MarkerSeverity:ZZe,MarkerTag:YZe,Uri:pi,Token:E$}}const ILt="default",cBo="$initialize";let NLt=!1;function mYe(e){aC&&(NLt||(NLt=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(e.message))}class dBo{constructor(t,n,r,o,s){this.vsWorker=t,this.req=n,this.channel=r,this.method=o,this.args=s,this.type=0}}class ULt{constructor(t,n,r,o){this.vsWorker=t,this.seq=n,this.res=r,this.err=o,this.type=1}}class uBo{constructor(t,n,r,o,s){this.vsWorker=t,this.req=n,this.channel=r,this.eventName=o,this.arg=s,this.type=2}}class hBo{constructor(t,n,r){this.vsWorker=t,this.req=n,this.event=r,this.type=3}}class ABo{constructor(t,n){this.vsWorker=t,this.req=n,this.type=4}}class fBo{constructor(t){this._workerId=-1,this._handler=t,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(t){this._workerId=t}async sendMessage(t,n,r){const o=String(++this._lastSentReq);return new Promise((s,a)=>{this._pendingReplies[o]={resolve:s,reject:a},this._send(new dBo(this._workerId,o,t,n,r))})}listen(t,n,r){let o=null;const s=new it({onWillAddFirstListener:()=>{o=String(++this._lastSentReq),this._pendingEmitters.set(o,s),this._send(new uBo(this._workerId,o,t,n,r))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(o),this._send(new ABo(this._workerId,o)),o=null}});return s.event}handleMessage(t){!t||!t.vsWorker||this._workerId!==-1&&t.vsWorker!==this._workerId||this._handleMessage(t)}createProxyToRemoteChannel(t,n){const r={get:(o,s)=>(typeof s=="string"&&!o[s]&&(OIn(s)?o[s]=a=>this.listen(t,s,a):bIn(s)?o[s]=this.listen(t,s,void 0):s.charCodeAt(0)===36&&(o[s]=async(...a)=>(await(n==null?void 0:n()),this.sendMessage(t,s,a)))),o[s])};return new Proxy(Object.create(null),r)}_handleMessage(t){switch(t.type){case 1:return this._handleReplyMessage(t);case 0:return this._handleRequestMessage(t);case 2:return this._handleSubscribeEventMessage(t);case 3:return this._handleEventMessage(t);case 4:return this._handleUnsubscribeEventMessage(t)}}_handleReplyMessage(t){if(!this._pendingReplies[t.seq]){console.warn("Got reply to unknown seq");return}const n=this._pendingReplies[t.seq];if(delete this._pendingReplies[t.seq],t.err){let r=t.err;if(t.err.$isError){const o=new Error;o.name=t.err.name,o.message=t.err.message,o.stack=t.err.stack,r=o}n.reject(r);return}n.resolve(t.res)}_handleRequestMessage(t){const n=t.req;this._handler.handleMessage(t.channel,t.method,t.args).then(o=>{this._send(new ULt(this._workerId,n,o,void 0))},o=>{o.detail instanceof Error&&(o.detail=kUe(o.detail)),this._send(new ULt(this._workerId,n,void 0,kUe(o)))})}_handleSubscribeEventMessage(t){const n=t.req,r=this._handler.handleEvent(t.channel,t.eventName,t.arg)(o=>{this._send(new hBo(this._workerId,n,o))});this._pendingEvents.set(n,r)}_handleEventMessage(t){if(!this._pendingEmitters.has(t.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(t.req).fire(t.event)}_handleUnsubscribeEventMessage(t){if(!this._pendingEvents.has(t.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(t.req).dispose(),this._pendingEvents.delete(t.req)}_send(t){const n=[];if(t.type===0)for(let r=0;r{this._protocol.handleMessage(n)})),this._register(this._worker.onError(n=>{mYe(n),Yi(n)})),this._protocol=new fBo({sendMessage:(n,r)=>{this._worker.postMessage(n,r)},handleMessage:(n,r,o)=>this._handleMessage(n,r,o),handleEvent:(n,r,o)=>this._handleEvent(n,r,o)}),this._protocol.setWorkerId(this._worker.getId()),this._onModuleLoaded=this._protocol.sendMessage(ILt,cBo,[this._worker.getId()]).then(()=>{}),this.proxy=this._protocol.createProxyToRemoteChannel(ILt,async()=>{await this._onModuleLoaded}),this._onModuleLoaded.catch(n=>{this._onError("Worker failed to load ",n)})}_handleMessage(t,n,r){const o=this._localChannels.get(t);if(!o)return Promise.reject(new Error(`Missing channel ${t} on main thread`));const s=o[n];if(typeof s!="function")return Promise.reject(new Error(`Missing method ${n} on main thread channel ${t}`));try{return Promise.resolve(s.apply(o,r))}catch(a){return Promise.reject(a)}}_handleEvent(t,n,r){const o=this._localChannels.get(t);if(!o)throw new Error(`Missing channel ${t} on main thread`);if(OIn(n)){const s=o[n];if(typeof s!="function")throw new Error(`Missing dynamic event ${n} on main thread channel ${t}.`);const a=s.call(o,r);if(typeof a!="function")throw new Error(`Missing dynamic event ${n} on main thread channel ${t}.`);return a}if(bIn(n)){const s=o[n];if(typeof s!="function")throw new Error(`Missing event ${n} on main thread channel ${t}.`);return s}throw new Error(`Malformed event name ${n}`)}setChannel(t,n){this._localChannels.set(t,n)}_onError(t,n){console.error(t),console.info(n)}}function bIn(e){return e[0]==="o"&&e[1]==="n"&&pw(e.charCodeAt(2))}function OIn(e){return/^onDynamic/.test(e)&&pw(e.charCodeAt(9))}let zU;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?zU=globalThis.workerttPolicy:zU=cC("defaultWorkerFactory",{createScriptURL:e=>e});function mBo(e,t){const n=e.label||"anonymous"+t,r=iet();if(r){if(typeof r.getWorker=="function")return r.getWorker("workerMain.js",n);if(typeof r.getWorkerUrl=="function"){const s=r.getWorkerUrl("workerMain.js",n);return new Worker(zU?zU.createScriptURL(s):s,{name:n,type:"module"})}}const o=e.esmModuleLocation;if(o){const s=kBo(n,o.toString(!0)),a=new Worker(zU?zU.createScriptURL(s):s,{name:n,type:"module"});return vBo(a)}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function kBo(e,t){if(!(/^((http:)|(https:)|(file:))/.test(t)&&t.substring(0,globalThis.origin.length)!==globalThis.origin)){const r=t.lastIndexOf("?"),o=t.lastIndexOf("#",r),s=r>0?new URLSearchParams(t.substring(r+1,~o?o:void 0)):new URLSearchParams;FUe.addSearchParam(s,!0,!0),s.toString()?t=`${t}?${s.toString()}#${e}`:t=`${t}#${e}`}const n=new Blob([YO([`/*${e}*/`,`globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(QEn())};`,`globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(net())};`,`globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(globalThis._VSCODE_FILE_ROOT)};`,"const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });","globalThis.workerttPolicy = ttPolicy;",`await import(ttPolicy?.createScriptURL(${JSON.stringify(t)}) ?? ${JSON.stringify(t)});`,"globalThis.postMessage({ type: 'vscode-worker-ready' });",`/*${e}*/`]).join("")],{type:"application/javascript"});return URL.createObjectURL(n)}function vBo(e){return new Promise((t,n)=>{e.onmessage=function(r){r.data.type==="vscode-worker-ready"&&(e.onmessage=null,t(e))},e.onerror=n})}function pBo(e){return!!e&&typeof e.then=="function"}const ape=class ape extends ct{constructor(t){super(),this._onMessage=this._register(new it),this.onMessage=this._onMessage.event,this._onError=this._register(new it),this.onError=this._onError.event,this.id=++ape.LAST_WORKER_ID;const n=t instanceof Worker||"then"in t?t:mBo(t,this.id);pBo(n)?this.worker=n:this.worker=Promise.resolve(n),this.postMessage("-please-ignore-",[]);const r=o=>{this._onError.fire(o)};this.worker.then(o=>{o.onmessage=s=>{this._onMessage.fire(s.data)},o.onmessageerror=s=>{this._onError.fire(s)},typeof o.addEventListener=="function"&&o.addEventListener("error",r)}),this._register(Gn(()=>{var o;(o=this.worker)==null||o.then(s=>{s.onmessage=null,s.onmessageerror=null,s.removeEventListener("error",r),s.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(t,n){var r;(r=this.worker)==null||r.then(o=>{try{o.postMessage(t,n)}catch(s){Yi(s),Yi(new Error("FAILED to post message to worker",{cause:s}))}})}};ape.LAST_WORKER_ID=0;let kYe=ape;class bBo{constructor(t,n){this.esmModuleLocation=t,this.label=n}}function OBo(e,t){const n=pi.isUri(e)?new bBo(e,t):e;return new gBo(new kYe(n))}class wBo{constructor(t,n,r){const o=new Uint8Array(t*n);for(let s=0,a=t*n;sn&&(n=d),l>r&&(r=l),u>r&&(r=u)}n++,r++;const o=new wBo(r,n,0);for(let s=0,a=t.length;s=this._maxCharCode?0:this._states.get(t,n)}}let ySe=null;function CBo(){return ySe===null&&(ySe=new yBo([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),ySe}let $X=null;function xBo(){if($X===null){$X=new uZ(0);const e=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…|`;for(let n=0;no);if(o>0){const l=n.charCodeAt(o-1),d=n.charCodeAt(a);(l===40&&d===41||l===91&&d===93||l===123&&d===125)&&a--}return{range:{startLineNumber:r,startColumn:o+1,endLineNumber:r,endColumn:a+2},url:n.substring(o,a+1)}}static computeLinks(t,n=CBo()){const r=xBo(),o=[];for(let s=1,a=t.getLineCount();s<=a;s++){const l=t.getLineContent(s),d=l.length;let u=0,h=0,f=0,g=1,k=!1,A=!1,m=!1,v=!1;for(;u=0?(o+=r?1:-1,o<0?o=t.length-1:o%=t.length,t[o]):null}};lpe.INSTANCE=new lpe;let vYe=lpe;function wIn(e){const t=[];for(const n of e){const r=Number(n);(r||r===0&&n.replace(/\s/g,"")!=="")&&t.push(r)}return t}function Hit(e,t,n,r){return{red:e/255,blue:n/255,green:t/255,alpha:r}}function eq(e,t){const n=t.index,r=t[0].length;if(n===void 0)return;const o=e.positionAt(n);return{startLineNumber:o.lineNumber,startColumn:o.column,endLineNumber:o.lineNumber,endColumn:o.column+r}}function SBo(e,t){if(!e)return;const n=Ut.Format.CSS.parseHex(t);if(n)return{range:e,color:Hit(n.rgba.r,n.rgba.g,n.rgba.b,n.rgba.a)}}function jLt(e,t,n){if(!e||t.length!==1)return;const o=t[0].values(),s=wIn(o);return{range:e,color:Hit(s[0],s[1],s[2],n?s[3]:1)}}function WLt(e,t,n){if(!e||t.length!==1)return;const o=t[0].values(),s=wIn(o),a=new Ut(new Dp(s[0],s[1]/100,s[2]/100,n?s[3]:1));return{range:e,color:Hit(a.rgba.r,a.rgba.g,a.rgba.b,a.rgba.a)}}function tq(e,t){return typeof e=="string"?[...e.matchAll(t)]:e.findMatches(t)}function TBo(e){const t=[],n=new RegExp(`\\b(rgb|rgba|hsl|hsla)(\\([0-9\\s,.\\%]*\\))|^(#)([A-Fa-f0-9]{3})\\b|^(#)([A-Fa-f0-9]{4})\\b|^(#)([A-Fa-f0-9]{6})\\b|^(#)([A-Fa-f0-9]{8})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{3})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{4})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{6})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{8})\\b`,"gm"),r=tq(e,n);if(r.length>0)for(const o of r){const s=o.filter(u=>u!==void 0),a=s[1],l=s[2];if(!l)continue;let d;if(a==="rgb"){const u=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;d=jLt(eq(e,o),tq(l,u),!1)}else if(a==="rgba"){const u=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;d=jLt(eq(e,o),tq(l,u),!0)}else if(a==="hsl"){const u=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;d=WLt(eq(e,o),tq(l,u),!1)}else if(a==="hsla"){const u=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm;d=WLt(eq(e,o),tq(l,u),!0)}else a==="#"&&(d=SBo(eq(e,o),a+l));d&&t.push(d)}return t}function EBo(e){return!e||typeof e.getValue!="function"||typeof e.positionAt!="function"?[]:TBo(e)}const DBo=/^-+|-+$/g,HLt=100,QBo=5;function BBo(e,t){var r;let n=[];if(t.findRegionSectionHeaders&&((r=t.foldingRules)!=null&&r.markers)){const o=FBo(e,t);n=n.concat(o)}if(t.findMarkSectionHeaders){const o=PBo(e,t);n=n.concat(o)}return n}function FBo(e,t){const n=[],r=e.getLineCount();for(let o=1;o<=r;o++){const s=e.getLineContent(o),a=s.match(t.foldingRules.markers.start);if(a){const l={startLineNumber:o,startColumn:a[0].length+1,endLineNumber:o,endColumn:s.length+1};if(l.endColumn>l.startColumn){const d={range:l,...MBo(s.substring(a[0].length)),shouldBeInComments:!1};(d.text||d.hasSeparatorLine)&&n.push(d)}}}return n}function PBo(e,t){const n=[],r=e.getLineCount();if(!t.markSectionHeaderRegex||t.markSectionHeaderRegex.trim()==="")return n;const o=nBn(t.markSectionHeaderRegex),s=new RegExp(t.markSectionHeaderRegex,`gdm${o?"s":""}`);if(JEn(s))return n;for(let a=1;a<=r;a+=HLt-QBo){const l=Math.min(a+HLt-1,r),d=[];for(let f=a;f<=l;f++)d.push(e.getLineContent(f));const u=d.join(` `);s.lastIndex=0;let h;for(;(h=s.exec(u))!==null;){const f=u.substring(0,h.index),g=(f.match(/\n/g)||[]).length,k=a+g,A=h[0].split(` `),m=A.length,v=k+m-1,p=f.lastIndexOf(` `)+1,b=h.index-p+1,O=A[A.length-1],w=m===1?b+h[0].length:O.length+1,y={startLineNumber:k,startColumn:b,endLineNumber:v,endColumn:w},C=(h.groups??{}).label??"",x=((h.groups??{}).separator??"")!=="",L={range:y,text:C,hasSeparatorLine:x,shouldBeInComments:!0};(L.text||L.hasSeparatorLine)&&(n.length===0||n[n.length-1].range.endLineNumberthis._checkStopModelSync(),Math.round(VLt/2)),this._register(o)}}dispose(){for(const t in this._syncedModels)hs(this._syncedModels[t]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(t,n=!1){for(const r of t){const o=r.toString();this._syncedModels[o]||this._beginModelSync(r,n),this._syncedModels[o]&&(this._syncedModelsLastUsedTime[o]=new Date().getTime())}}_checkStopModelSync(){const t=new Date().getTime(),n=[];for(const r in this._syncedModelsLastUsedTime)t-this._syncedModelsLastUsedTime[r]>VLt&&n.push(r);for(const r of n)this._stopModelSync(r)}_beginModelSync(t,n){const r=this._modelService.getModel(t);if(!r||!n&&r.isTooLargeForSyncing())return;const o=t.toString();this._proxy.$acceptNewModel({url:r.uri.toString(),lines:r.getLinesContent(),EOL:r.getEOL(),versionId:r.getVersionId()});const s=new Pt;s.add(r.onDidChangeContent(a=>{this._proxy.$acceptModelChanged(o.toString(),a)})),s.add(r.onWillDispose(()=>{this._stopModelSync(o)})),s.add(Gn(()=>{this._proxy.$acceptRemovedModel(o)})),this._syncedModels[o]=s}_stopModelSync(t){const n=this._syncedModels[t];delete this._syncedModels[t],delete this._syncedModelsLastUsedTime[t],hs(n)}}class NBo{constructor(){this._models=Object.create(null)}getModel(t){return this._models[t]}getModels(){const t=[];return Object.keys(this._models).forEach(n=>t.push(this._models[n])),t}$acceptNewModel(t){this._models[t.url]=new UBo(pi.parse(t.url),t.lines,t.EOL,t.versionId)}$acceptModelChanged(t,n){if(!this._models[t])return;this._models[t].onEvents(n)}$acceptRemovedModel(t){this._models[t]&&delete this._models[t]}}class UBo extends RBo{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(t){const n=[];for(let r=0;rthis._lines.length)n=this._lines.length,r=this._lines[n-1].length+1,o=!0;else{const s=this._lines[n-1].length+1;r<1?(r=1,o=!0):r>s&&(r=s,o=!0)}return o?{lineNumber:n,column:r}:t}}const cQ=class cQ{constructor(t=null){this._foreignModule=t,this._requestHandlerBrand=void 0,this._workerTextModelSyncServer=new NBo}dispose(){}async $ping(){return"pong"}_getModel(t){return this._workerTextModelSyncServer.getModel(t)}getModels(){return this._workerTextModelSyncServer.getModels()}$acceptNewModel(t){this._workerTextModelSyncServer.$acceptNewModel(t)}$acceptModelChanged(t,n){this._workerTextModelSyncServer.$acceptModelChanged(t,n)}$acceptRemovedModel(t){this._workerTextModelSyncServer.$acceptRemovedModel(t)}async $computeUnicodeHighlights(t,n,r){const o=this._getModel(t);return o?Fit.computeUnicodeHighlights(o,n,r):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async $findSectionHeaders(t,n){const r=this._getModel(t);return r?BBo(r,n):[]}async $computeDiff(t,n,r,o){const s=this._getModel(t),a=this._getModel(n);return!s||!a?null:cQ.computeDiff(s,a,r,o)}static computeDiff(t,n,r,o){const s=o==="advanced"?PVe.getDefault():PVe.getLegacy(),a=t.getLinesContent(),l=n.getLinesContent(),d=s.computeDiff(a,l,r),u=d.changes.length>0?!1:this._modelsAreIdentical(t,n);function h(f){return f.map(g=>{var k;return[g.original.startLineNumber,g.original.endLineNumberExclusive,g.modified.startLineNumber,g.modified.endLineNumberExclusive,(k=g.innerChanges)==null?void 0:k.map(A=>[A.originalRange.startLineNumber,A.originalRange.startColumn,A.originalRange.endLineNumber,A.originalRange.endColumn,A.modifiedRange.startLineNumber,A.modifiedRange.startColumn,A.modifiedRange.endLineNumber,A.modifiedRange.endColumn])]})}return{identical:u,quitEarly:d.hitTimeout,changes:h(d.changes),moves:d.moves.map(f=>[f.lineRangeMapping.original.startLineNumber,f.lineRangeMapping.original.endLineNumberExclusive,f.lineRangeMapping.modified.startLineNumber,f.lineRangeMapping.modified.endLineNumberExclusive,h(f.changes)])}}static _modelsAreIdentical(t,n){const r=t.getLineCount(),o=n.getLineCount();if(r!==o)return!1;for(let s=1;s<=r;s++){const a=t.getLineContent(s),l=n.getLineContent(s);if(a!==l)return!1}return!0}async $computeMoreMinimalEdits(t,n,r){const o=this._getModel(t);if(!o)return n;const s=[];let a;n=n.slice(0).sort((d,u)=>{if(d.range&&u.range)return De.compareRangesUsingStarts(d.range,u.range);const h=d.range?0:1,f=u.range?0:1;return h-f});let l=0;for(let d=1;dcQ._diffLimit){s.push({range:d,text:u});continue}const g=Oxo(f,u,r),k=o.offsetAt(De.lift(d).getStartPosition());for(const A of g){const m=o.positionAt(k+A.originalStart),v=o.positionAt(k+A.originalStart+A.originalLength),p={text:u.substr(A.modifiedStart,A.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:v.lineNumber,endColumn:v.column}};o.getValueInRange(p.range)!==p.text&&s.push(p)}}return typeof a=="number"&&s.push({eol:a,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s}async $computeLinks(t){const n=this._getModel(t);return n?LBo(n):null}async $computeDefaultDocumentColors(t){const n=this._getModel(t);return n?EBo(n):null}async $textualSuggest(t,n,r,o){const s=new wu,a=new RegExp(r,o),l=new Set;e:for(const d of t){const u=this._getModel(d);if(u){for(const h of u.words(a))if(!(h===n||!isNaN(Number(h)))&&(l.add(h),l.size>cQ._suggestionsLimit))break e}}return{words:Array.from(l),duration:s.elapsed()}}async $computeWordRanges(t,n,r,o){const s=this._getModel(t);if(!s)return Object.create(null);const a=new RegExp(r,o),l=Object.create(null);for(let d=n.startLineNumber;d=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},zD=function(e,t){return function(n,r){t(n,r,e)}};const zLt=5*60*1e3;function ZD(e,t){const n=e.getModel(t);return!(!n||n.isTooLargeForSyncing())}let OYe=class extends ct{constructor(t,n,r,o,s,a){super(),this._languageConfigurationService=s,this._modelService=n,this._workerManager=this._register(new wYe(t,this._modelService)),this._logService=o,this._register(a.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:async(l,d)=>{if(!ZD(this._modelService,l.uri))return Promise.resolve({links:[]});const h=await(await this._workerWithResources([l.uri])).$computeLinks(l.uri.toString());return h&&{links:h}}})),this._register(a.completionProvider.register("*",new jBo(this._workerManager,r,this._modelService,this._languageConfigurationService,this._logService)))}dispose(){super.dispose()}canComputeUnicodeHighlights(t){return ZD(this._modelService,t)}async computedUnicodeHighlights(t,n,r){return(await this._workerWithResources([t])).$computeUnicodeHighlights(t.toString(),n,r)}async computeDiff(t,n,r,o){const a=await(await this._workerWithResources([t,n],!0)).$computeDiff(t.toString(),n.toString(),r,o);if(!a)return null;return{identical:a.identical,quitEarly:a.quitEarly,changes:d(a.changes),moves:a.moves.map(u=>new cRn(new Lf(new Qi(u[0],u[1]),new Qi(u[2],u[3])),d(u[4])))};function d(u){return u.map(h=>{var f;return new uk(new Qi(h[0],h[1]),new Qi(h[2],h[3]),(f=h[4])==null?void 0:f.map(g=>new cg(new De(g[0],g[1],g[2],g[3]),new De(g[4],g[5],g[6],g[7]))))})}}async computeMoreMinimalEdits(t,n,r=!1){if(Qf(n)){if(!ZD(this._modelService,t))return Promise.resolve(n);const o=wu.create(),s=this._workerWithResources([t]).then(a=>a.$computeMoreMinimalEdits(t.toString(),n,r));return s.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",t.toString(!0),o.elapsed())),Promise.race([s,My(1e3).then(()=>n)])}else return Promise.resolve(void 0)}canNavigateValueSet(t){return ZD(this._modelService,t)}async navigateValueSet(t,n,r){const o=this._modelService.getModel(t);if(!o)return null;const s=this._languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=s.source,l=s.flags;return(await this._workerWithResources([t])).$navigateValueSet(t.toString(),n,r,a,l)}canComputeWordRanges(t){return ZD(this._modelService,t)}async computeWordRanges(t,n){const r=this._modelService.getModel(t);if(!r)return Promise.resolve(null);const o=this._languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),s=o.source,a=o.flags;return(await this._workerWithResources([t])).$computeWordRanges(t.toString(),n,s,a)}async findSectionHeaders(t,n){return(await this._workerWithResources([t])).$findSectionHeaders(t.toString(),n)}async computeDefaultDocumentColors(t){return(await this._workerWithResources([t])).$computeDefaultDocumentColors(t.toString())}async _workerWithResources(t,n=!1){return await(await this._workerManager.withWorker()).workerWithSyncedResources(t,n)}};OYe=Vit([zD(1,pl),zD(2,a3e),zD(3,Oa),zD(4,bl),zD(5,Zn)],OYe);class jBo{constructor(t,n,r,o,s){this.languageConfigurationService=o,this.logService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=t,this._configurationService=n,this._modelService=r}async provideCompletionItems(t,n){const r=this._configurationService.getValue(t.uri,n,"editor");if(r.wordBasedSuggestions==="off")return;const o=[];if(r.wordBasedSuggestions==="currentDocument")ZD(this._modelService,t.uri)&&o.push(t.uri);else for(const f of this._modelService.getModels())ZD(this._modelService,f.uri)&&(f===t?o.unshift(f.uri):(r.wordBasedSuggestions==="allDocuments"||f.getLanguageId()===t.getLanguageId())&&o.push(f.uri));if(o.length===0)return;const s=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition(),a=t.getWordAtPosition(n),l=a?new De(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn):De.fromPositions(n),d=l.setEndPosition(n.lineNumber,n.column);this.logService.trace("[WordBasedCompletionItemProvider]",`word: "${(a==null?void 0:a.word)||""}", wordDef: "${s}", replace: [${l.toString()}], insert: [${d.toString()}]`);const h=await(await this._workerManager.withWorker()).textualSuggest(o,a==null?void 0:a.word,s);if(h)return{duration:h.duration,suggestions:h.words.map(f=>({kind:18,label:f,insertText:f,range:{insert:d,replace:l}}))}}}let wYe=class extends ct{constructor(t,n){super(),this._workerDescriptor=t,this._modelService=n,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new Met).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(zLt/2),Ls),this._register(this._modelService.onModelRemoved(o=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>zLt&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new I0e(this._workerDescriptor,!1,this._modelService)),Promise.resolve(this._editorWorkerClient)}};wYe=Vit([zD(1,pl)],wYe);class WBo{constructor(t){this._instance=t,this.proxy=this._instance}dispose(){this._instance.dispose()}setChannel(t,n){throw new Error("Not supported")}}let I0e=class extends ct{constructor(t,n,r){super(),this._workerDescriptorOrWorker=t,this._disposed=!1,this._modelService=r,this._keepIdleModels=n,this._worker=null,this._modelManager=null}fhr(t,n){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(OBo(this._workerDescriptorOrWorker)),bYe.setChannel(this._worker,this._createEditorWorkerHost())}catch(t){mYe(t),this._worker=this._createFallbackLocalWorker()}return this._worker}async _getProxy(){try{const t=this._getOrCreateWorker().proxy;return await t.$ping(),t}catch(t){return mYe(t),this._worker=this._createFallbackLocalWorker(),this._worker.proxy}}_createFallbackLocalWorker(){return new WBo(new pYe(null))}_createEditorWorkerHost(){return{$fhr:(t,n)=>this.fhr(t,n)}}_getOrCreateModelManager(t){return this._modelManager||(this._modelManager=this._register(new IBo(t,this._modelService,this._keepIdleModels))),this._modelManager}async workerWithSyncedResources(t,n=!1){if(this._disposed)return Promise.reject(Hso());const r=await this._getProxy();return this._getOrCreateModelManager(r).ensureSyncedResources(t,n),r}async textualSuggest(t,n,r){const o=await this.workerWithSyncedResources(t),s=r.source,a=r.flags;return o.$textualSuggest(t.map(l=>l.toString()),n,s,a)}dispose(){super.dispose(),this._disposed=!0}};I0e=Vit([zD(2,pl)],I0e);function HBo(e,t){return new VBo(e,t)}class VBo extends I0e{constructor(t,n){super(n.worker,n.keepIdleModels||!1,t),this._foreignModuleHost=n.host||null,this._foreignProxy=this._getProxy().then(r=>new Proxy({},{get(o,s,a){if(s!=="then"){if(typeof s!="string")throw new Error("Not supported");return(...l)=>r.$fmr(s,l)}}}))}fhr(t,n){if(!this._foreignModuleHost||typeof this._foreignModuleHost[t]!="function")return Promise.reject(new Error("Missing method "+t+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[t].apply(this._foreignModuleHost,n))}catch(r){return Promise.reject(r)}}getProxy(){return this._foreignProxy}withSyncedResources(t){return this.workerWithSyncedResources(t).then(n=>this.getProxy())}}function zBo(e){return Array.isArray(e)}function ZBo(e){return!zBo(e)}function yIn(e){return typeof e=="string"}function ZLt(e){return!yIn(e)}function YD(e){return!e}function k8(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function YLt(e){return e.replace(/[&<>'"_]/g,"-")}function YBo(e,t){console.log(`${e.languageId}: ${t}`)}function Na(e,t){return new Error(`${e.languageId}: ${t}`)}function YS(e,t,n,r,o){const s=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let a=null;return t.replace(s,function(l,d,u,h,f,g,k,A,m){return YD(u)?YD(h)?!YD(f)&&f0;){const r=e.tokenizer[n];if(r)return r;const o=n.lastIndexOf(".");o<0?n=null:n=n.substr(0,o)}return null}function qBo(e,t){let n=t;for(;n&&n.length>0;){if(e.stateNames[n])return!0;const o=n.lastIndexOf(".");o<0?n=null:n=n.substr(0,o)}return!1}var GBo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},KBo=function(e,t){return function(n,r){t(n,r,e)}},yYe;const CIn=5,cpe=class cpe{static create(t,n){return this._INSTANCE.create(t,n)}constructor(t){this._maxCacheDepth=t,this._entries=Object.create(null)}create(t,n){if(t!==null&&t.depth>=this._maxCacheDepth)return new gW(t,n);let r=gW.getStackElementId(t);r.length>0&&(r+="|"),r+=n;let o=this._entries[r];return o||(o=new gW(t,n),this._entries[r]=o,o)}};cpe._INSTANCE=new cpe(CIn);let Iee=cpe;class gW{constructor(t,n){this.parent=t,this.state=n,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(t){let n="";for(;t!==null;)n.length>0&&(n+="|"),n+=t.state,t=t.parent;return n}static _equals(t,n){for(;t!==null&&n!==null;){if(t===n)return!0;if(t.state!==n.state)return!1;t=t.parent,n=n.parent}return t===null&&n===null}equals(t){return gW._equals(this,t)}push(t){return Iee.create(this,t)}pop(){return this.parent}popall(){let t=this;for(;t.parent;)t=t.parent;return t}switchTo(t){return Iee.create(this.parent,t)}}class ZU{constructor(t,n){this.languageId=t,this.state=n}equals(t){return this.languageId===t.languageId&&this.state.equals(t.state)}clone(){return this.state.clone()===this.state?this:new ZU(this.languageId,this.state)}}const dpe=class dpe{static create(t,n){return this._INSTANCE.create(t,n)}constructor(t){this._maxCacheDepth=t,this._entries=Object.create(null)}create(t,n){if(n!==null)return new dJ(t,n);if(t!==null&&t.depth>=this._maxCacheDepth)return new dJ(t,n);const r=gW.getStackElementId(t);let o=this._entries[r];return o||(o=new dJ(t,null),this._entries[r]=o,o)}};dpe._INSTANCE=new dpe(CIn);let XS=dpe;class dJ{constructor(t,n){this.stack=t,this.embeddedLanguageData=n}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:XS.create(this.stack,this.embeddedLanguageData)}equals(t){return!(t instanceof dJ)||!this.stack.equals(t.stack)?!1:this.embeddedLanguageData===null&&t.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||t.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(t.embeddedLanguageData)}}class JBo{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(t){this._languageId=t}emit(t,n){this._lastTokenType===n&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=n,this._lastTokenLanguage=this._languageId,this._tokens.push(new E$(t,n,this._languageId)))}nestedLanguageTokenize(t,n,r,o){const s=r.languageId,a=r.state,l=Kl.get(s);if(!l)return this.enterLanguage(s),this.emit(o,""),a;const d=l.tokenize(t,n,a);if(o!==0)for(const u of d.tokens)this._tokens.push(new E$(u.offset+o,u.type,u.language));else this._tokens=this._tokens.concat(d.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,d.endState}finalize(t){return new ptt(this._tokens,t)}}class N0e{constructor(t,n){this._languageService=t,this._theme=n,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(t){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(t)}emit(t,n){const r=this._theme.match(this._currentLanguageId,n)|1024;this._lastTokenMetadata!==r&&(this._lastTokenMetadata=r,this._tokens.push(t),this._tokens.push(r))}static _merge(t,n,r){const o=t!==null?t.length:0,s=n.length,a=r!==null?r.length:0;if(o===0&&s===0&&a===0)return new Uint32Array(0);if(o===0&&s===0)return r;if(s===0&&a===0)return t;const l=new Uint32Array(o+s+a);t!==null&&l.set(t);for(let d=0;d{if(a)return;let d=!1;for(let u=0,h=l.changedLanguages.length;u{l.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const t=[];for(const n in this._embeddedLanguages){const r=Kl.get(n);if(r){if(r instanceof yYe){const o=r.getLoadStatus();o.loaded===!1&&t.push(o.promise)}continue}Kl.isResolved(n)||t.push(Kl.getOrCreate(n))}return t.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(t).then(n=>{})}}getInitialState(){const t=Iee.create(null,this._lexer.start);return XS.create(t,null)}tokenize(t,n,r){if(t.length>=this._maxTokenizationLineLength)return Itt(this._languageId,r);const o=new JBo,s=this._tokenize(t,n,r,o);return o.finalize(s)}tokenizeEncoded(t,n,r){if(t.length>=this._maxTokenizationLineLength)return xOe(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),r);const o=new N0e(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),s=this._tokenize(t,n,r,o);return o.finalize(s)}_tokenize(t,n,r,o){return r.embeddedLanguageData?this._nestedTokenize(t,n,r,0,o):this._myTokenize(t,n,r,0,o)}_findLeavingNestedLanguageOffset(t,n){let r=this._lexer.tokenizer[n.stack.state];if(!r&&(r=Nce(this._lexer,n.stack.state),!r))throw Na(this._lexer,"tokenizer state is not defined: "+n.stack.state);let o=-1,s=!1;for(const a of r){if(!ZLt(a.action)||!(a.action.nextEmbedded==="@pop"||a.action.hasEmbeddedEndInCases))continue;s=!0;let l=a.resolveRegex(n.stack.state);const d=l.source;if(d.substr(0,4)==="^(?:"&&d.substr(d.length-1,1)===")"){const h=(l.ignoreCase?"i":"")+(l.unicode?"u":"");l=new RegExp(d.substr(4,d.length-5),h)}const u=t.search(l);u===-1||u!==0&&a.matchOnlyAtLineStart||(o===-1||u0&&s.nestedLanguageTokenize(l,!1,r.embeddedLanguageData,o);const d=t.substring(a);return this._myTokenize(d,n,r,o+a,s)}_safeRuleName(t){return t?t.name:"(unknown)"}_myTokenize(t,n,r,o,s){s.enterLanguage(this._languageId);const a=t.length,l=n&&this._lexer.includeLF?t+` `:t,d=l.length;let u=r.embeddedLanguageData,h=r.stack,f=0,g=null,k=!0;for(;k||f=d)break;k=!1;let S=this._lexer.tokenizer[p];if(!S&&(S=Nce(this._lexer,p),!S))throw Na(this._lexer,"tokenizer state is not defined: "+p);const E=l.substr(f);for(const Q of S)if((f===0||!Q.matchOnlyAtLineStart)&&(b=E.match(Q.resolveRegex(p)),b)){O=b[0],w=Q.action;break}}if(b||(b=[""],O=""),w||(f=this._lexer.maxStack)throw Na(this._lexer,"maximum tokenizer stack size reached: ["+h.state+","+h.parent.state+",...]");h=h.push(p)}else if(w.next==="@pop"){if(h.depth<=1)throw Na(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(y));h=h.pop()}else if(w.next==="@popall")h=h.popall();else{let S=YS(this._lexer,w.next,O,b,p);if(S[0]==="@"&&(S=S.substr(1)),Nce(this._lexer,S))h=h.push(S);else throw Na(this._lexer,"trying to set a next state '"+S+"' that is undefined in rule: "+this._safeRuleName(y))}}w.log&&typeof w.log=="string"&&YBo(this._lexer,this._lexer.languageId+": "+YS(this._lexer,w.log,O,b,p))}if(x===null)throw Na(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(y));const L=S=>{const E=this._languageService.getLanguageIdByLanguageName(S)||this._languageService.getLanguageIdByMimeType(S)||S,Q=this._getNestedEmbeddedLanguageData(E);if(f0)throw Na(this._lexer,"groups cannot be nested: "+this._safeRuleName(y));if(b.length!==x.length+1)throw Na(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(y));let S=0;for(let E=1;Ee});class zit{static colorizeElement(t,n,r,o){o=o||{};const s=o.theme||"vs",a=o.mimeType||r.getAttribute("lang")||r.getAttribute("data-lang");if(!a)return console.error("Mode not detected"),Promise.resolve();const l=n.getLanguageIdByMimeType(a)||a;t.setTheme(s);const d=r.firstChild?r.firstChild.nodeValue:"";r.className+=" "+s;const u=h=>{const f=(CSe==null?void 0:CSe.createHTML(h))??h;r.innerHTML=f};return this.colorize(n,d||"",l,o).then(u,h=>console.error(h))}static async colorize(t,n,r,o){const s=t.languageIdCodec;let a=4;o&&typeof o.tabSize=="number"&&(a=o.tabSize),wet(n)&&(n=n.substr(1));const l=W1(n);if(!t.isRegisteredLanguageId(r))return XLt(l,a,s);const d=await Kl.getOrCreate(r);return d?$Bo(l,a,d,s):XLt(l,a,s)}static colorizeLine(t,n,r,o,s=4){const a=pk.isBasicASCII(t,n),l=pk.containsRTL(t,a,r);return kOe(new T6(!1,!0,t,!1,a,l,0,o,[],s,0,0,0,0,-1,"none",!1,!1,null,null,0)).html}static colorizeModelLine(t,n,r=4){const o=t.getLineContent(n);t.tokenization.forceTokenization(n);const a=t.tokenization.getLineTokens(n).inflate();return this.colorizeLine(o,t.mightContainNonBasicASCII(),t.mightContainRTL(),a,r)}}function $Bo(e,t,n,r){return new Promise((o,s)=>{const a=()=>{const l=eFo(e,t,n,r);if(n instanceof Nee){const d=n.getLoadStatus();if(d.loaded===!1){d.promise.then(a,s);return}}o(l)};a()})}function XLt(e,t,n){let r=[];const s=new Uint32Array(2);s[0]=0,s[1]=33587200;for(let a=0,l=e.length;a")}return r.join("")}function eFo(e,t,n,r){let o=[],s=n.getInitialState();for(let a=0,l=e.length;a"),s=u.endState}return o.join("")}var tFo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},nFo=function(e,t){return function(n,r){t(n,r,e)}};let CYe=class extends ct{constructor(t){super(),this._themeService=t,this._onWillCreateCodeEditor=this._register(new it),this._onCodeEditorAdd=this._register(new it),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new it),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new it),this._onDiffEditorAdd=this._register(new it),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new it),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Tf,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(t){this._codeEditors[t.getId()]=t,this._onCodeEditorAdd.fire(t)}removeCodeEditor(t){delete this._codeEditors[t.getId()]&&this._onCodeEditorRemove.fire(t)}listCodeEditors(){return Object.keys(this._codeEditors).map(t=>this._codeEditors[t])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(t){this._diffEditors[t.getId()]=t,this._onDiffEditorAdd.fire(t)}removeDiffEditor(t){delete this._diffEditors[t.getId()]&&this._onDiffEditorRemove.fire(t)}listDiffEditors(){return Object.keys(this._diffEditors).map(t=>this._diffEditors[t])}getFocusedCodeEditor(){let t=null;const n=this.listCodeEditors();for(const r of n){if(r.hasTextFocus())return r;r.hasWidgetFocus()&&(t=r)}return t}removeDecorationType(t){const n=this._decorationOptionProviders.get(t);n&&(n.refCount--,n.refCount<=0&&(this._decorationOptionProviders.delete(t),n.dispose(),this.listCodeEditors().forEach(r=>r.removeDecorationsByType(t))))}setModelProperty(t,n,r){const o=t.toString();let s;this._modelProperties.has(o)?s=this._modelProperties.get(o):(s=new Map,this._modelProperties.set(o,s)),s.set(n,r)}getModelProperty(t,n){const r=t.toString();if(this._modelProperties.has(r))return this._modelProperties.get(r).get(n)}async openCodeEditor(t,n,r){for(const o of this._codeEditorOpenHandlers){const s=await o(t,n,r);if(s!==null)return s}return null}registerCodeEditorOpenHandler(t){const n=this._codeEditorOpenHandlers.unshift(t);return Gn(n)}};CYe=tFo([nFo(0,Il)],CYe);var iFo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},qLt=function(e,t){return function(n,r){t(n,r,e)}};let U0e=class extends CYe{constructor(t,n){super(n),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=t.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(r,o,s)=>o?this.doOpenEditor(o,r):null))}_checkContextKey(){let t=!1;for(const n of this.listCodeEditors())if(!n.isSimpleWidget){t=!0;break}this._editorIsOpen.set(t)}setActiveCodeEditor(t){this._activeCodeEditor=t}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(t,n){if(!this.findModel(t,n.resource)){if(n.resource){const s=n.resource.scheme;if(s===Li.http||s===Li.https)return B7n(n.resource.toString()),t}return null}const o=n.options?n.options.selection:null;if(o)if(typeof o.endLineNumber=="number"&&typeof o.endColumn=="number")t.setSelection(o),t.revealRangeInCenter(o,1);else{const s={lineNumber:o.startLineNumber,column:o.startColumn};t.setPosition(s),t.revealPositionInCenter(s,1)}return t}findModel(t,n){const r=t.getModel();return r&&r.uri.toString()!==n.toString()?null:r}};U0e=iFo([qLt(0,Fi),qLt(1,Il)],U0e);qr(Co,U0e,0);var xIn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},LIn=function(e,t){return function(n,r){t(n,r,e)}};let j0e=class{get mainContainer(){var t;return((t=this._codeEditorService.listCodeEditors().at(0))==null?void 0:t.getContainerDomNode())??Ls.document.body}get activeContainer(){const t=this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor();return(t==null?void 0:t.getContainerDomNode())??this.mainContainer}get mainContainerDimension(){return MT(this.mainContainer)}get activeContainerDimension(){return MT(this.activeContainer)}get containers(){return YO(this._codeEditorService.listCodeEditors().map(t=>t.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){var t;(t=this._codeEditorService.getFocusedCodeEditor())==null||t.focus()}constructor(t){this._codeEditorService=t,this.onDidLayoutMainContainer=un.None,this.onDidLayoutActiveContainer=un.None,this.onDidLayoutContainer=un.None,this.onDidChangeActiveContainer=un.None,this.onDidAddContainer=un.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};j0e=xIn([LIn(0,Co)],j0e);let xYe=class extends j0e{get mainContainer(){return this._container}constructor(t,n){super(n),this._container=t}};xYe=xIn([LIn(1,Co)],xYe);qr(uC,j0e,1);var rFo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},GLt=function(e,t){return function(n,r){t(n,r,e)}};function Uce(e){return e.scheme===Li.file?e.fsPath:e.path}let SIn=0;class jce{constructor(t,n,r,o,s,a,l){this.id=++SIn,this.type=0,this.actual=t,this.label=t.label,this.confirmBeforeUndo=t.confirmBeforeUndo||!1,this.resourceLabel=n,this.strResource=r,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=o,this.groupOrder=s,this.sourceId=a,this.sourceOrder=l,this.isValid=!0}setValid(t){this.isValid=t}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class KLt{constructor(t,n){this.resourceLabel=t,this.reason=n}}class JLt{constructor(){this.elements=new Map}createMessage(){const t=[],n=[];for(const[,o]of this.elements)(o.reason===0?t:n).push(o.resourceLabel);const r=[];return t.length>0&&r.push(j(2030,"The following files have been closed and modified on disk: {0}.",t.join(", "))),n.length>0&&r.push(j(2031,"The following files have been modified in an incompatible way: {0}.",n.join(", "))),r.join(` `)}get size(){return this.elements.size}has(t){return this.elements.has(t)}set(t,n){this.elements.set(t,n)}delete(t){return this.elements.delete(t)}}class oFo{constructor(t,n,r,o,s,a,l){this.id=++SIn,this.type=1,this.actual=t,this.label=t.label,this.confirmBeforeUndo=t.confirmBeforeUndo||!1,this.resourceLabels=n,this.strResources=r,this.groupId=o,this.groupOrder=s,this.sourceId=a,this.sourceOrder=l,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(t,n,r){this.removedResources||(this.removedResources=new JLt),this.removedResources.has(n)||this.removedResources.set(n,new KLt(t,r))}setValid(t,n,r){r?this.invalidatedResources&&(this.invalidatedResources.delete(n),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new JLt),this.invalidatedResources.has(n)||this.invalidatedResources.set(n,new KLt(t,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class TIn{constructor(t,n){this.resourceLabel=t,this.strResource=n,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const t of this._past)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,0);for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const t=[];t.push(`* ${this.strResource}:`);for(let n=0;n=0;n--)t.push(` * [REDO] ${this._future[n]}`);return t.join(` `)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(t,n){t.type===1?t.setValid(this.resourceLabel,this.strResource,n):t.setValid(n)}setElementsValidFlag(t,n){for(const r of this._past)n(r.actual)&&this._setElementValidFlag(r,t);for(const r of this._future)n(r.actual)&&this._setElementValidFlag(r,t)}pushElement(t){for(const n of this._future)n.type===1&&n.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(t),this.versionId++}createSnapshot(t){const n=[];for(let r=0,o=this._past.length;r=0;r--)n.push(this._future[r].id);return new cBn(t,n)}restoreSnapshot(t){const n=t.elements.length;let r=!0,o=0,s=-1;for(let l=0,d=this._past.length;l=n||u.id!==t.elements[o])&&(r=!1,s=0),!r&&u.type===1&&u.removeResource(this.resourceLabel,this.strResource,0)}let a=-1;for(let l=this._future.length-1;l>=0;l--,o++){const d=this._future[l];r&&(o>=n||d.id!==t.elements[o])&&(r=!1,a=l),!r&&d.type===1&&d.removeResource(this.resourceLabel,this.strResource,0)}s!==-1&&(this._past=this._past.slice(0,s)),a!==-1&&(this._future=this._future.slice(a+1)),this.versionId++}getElements(){const t=[],n=[];for(const r of this._past)t.push(r.actual);for(const r of this._future)n.push(r.actual);return{past:t,future:n}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(t,n){for(let r=this._past.length-1;r>=0;r--)if(this._past[r]===t){n.has(this.strResource)?this._past[r]=n.get(this.strResource):this._past.splice(r,1);break}this.versionId++}splitFutureWorkspaceElement(t,n){for(let r=this._future.length-1;r>=0;r--)if(this._future[r]===t){n.has(this.strResource)?this._future[r]=n.get(this.strResource):this._future.splice(r,1);break}this.versionId++}moveBackward(t){this._past.pop(),this._future.push(t),this.versionId++}moveForward(t){this._future.pop(),this._past.push(t),this.versionId++}}class xSe{constructor(t){this.editStacks=t,this._versionIds=[];for(let n=0,r=this.editStacks.length;nn.sourceOrder)&&(n=a,r=o)}return[n,r]}canUndo(t){if(t instanceof WD){const[,r]=this._findClosestUndoElementWithSource(t.id);return!!r}const n=this.getUriComparisonKey(t);return this._editStacks.has(n)?this._editStacks.get(n).hasPastElements():!1}_onError(t,n){Yi(t);for(const r of n.strResources)this.removeElements(r);this._notificationService.error(t)}_acquireLocks(t){for(const n of t.editStacks)if(n.locked)throw new Error("Cannot acquire edit stack lock");for(const n of t.editStacks)n.locked=!0;return()=>{for(const n of t.editStacks)n.locked=!1}}_safeInvokeWithLocks(t,n,r,o,s){const a=this._acquireLocks(r);let l;try{l=n()}catch(d){return a(),o.dispose(),this._onError(d,t)}return l?l.then(()=>(a(),o.dispose(),s()),d=>(a(),o.dispose(),this._onError(d,t))):(a(),o.dispose(),s())}async _invokeWorkspacePrepare(t){if(typeof t.actual.prepareUndoRedo>"u")return ct.None;const n=t.actual.prepareUndoRedo();return typeof n>"u"?ct.None:n}_invokeResourcePrepare(t,n){if(t.actual.type!==1||typeof t.actual.prepareUndoRedo>"u")return n(ct.None);const r=t.actual.prepareUndoRedo();return r?BM(r)?n(r):r.then(o=>n(o)):n(ct.None)}_getAffectedEditStacks(t){const n=[];for(const r of t.strResources)n.push(this._editStacks.get(r)||EIn);return new xSe(n)}_tryToSplitAndUndo(t,n,r,o){if(n.canSplit())return this._splitPastWorkspaceElement(n,r),this._notificationService.warn(o),new Wce(this._undo(t,0,!0));for(const s of n.strResources)this.removeElements(s);return this._notificationService.warn(o),new Wce}_checkWorkspaceUndo(t,n,r,o){if(n.removedResources)return this._tryToSplitAndUndo(t,n,n.removedResources,j(2032,"Could not undo '{0}' across all files. {1}",n.label,n.removedResources.createMessage()));if(o&&n.invalidatedResources)return this._tryToSplitAndUndo(t,n,n.invalidatedResources,j(2033,"Could not undo '{0}' across all files. {1}",n.label,n.invalidatedResources.createMessage()));const s=[];for(const l of r.editStacks)l.getClosestPastElement()!==n&&s.push(l.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(t,n,null,j(2034,"Could not undo '{0}' across all files because changes were made to {1}",n.label,s.join(", ")));const a=[];for(const l of r.editStacks)l.locked&&a.push(l.resourceLabel);return a.length>0?this._tryToSplitAndUndo(t,n,null,j(2035,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",n.label,a.join(", "))):r.isValid()?null:this._tryToSplitAndUndo(t,n,null,j(2036,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",n.label))}_workspaceUndo(t,n,r){const o=this._getAffectedEditStacks(n),s=this._checkWorkspaceUndo(t,n,o,!1);return s?s.returnValue:this._confirmAndExecuteWorkspaceUndo(t,n,o,r)}_isPartOfUndoGroup(t){if(!t.groupId)return!1;for(const[,n]of this._editStacks){const r=n.getClosestPastElement();if(r){if(r===t){const o=n.getSecondClosestPastElement();if(o&&o.groupId===t.groupId)return!0}if(r.groupId===t.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(t,n,r,o){if(n.canSplit()&&!this._isPartOfUndoGroup(n)){let l;(function(h){h[h.All=0]="All",h[h.This=1]="This",h[h.Cancel=2]="Cancel"})(l||(l={}));const{result:d}=await this._dialogService.prompt({type:Dl.Info,message:j(2037,"Would you like to undo '{0}' across all files?",n.label),buttons:[{label:j(2038,"&&Undo in {0} Files",r.editStacks.length),run:()=>l.All},{label:j(2039,"Undo this &&File"),run:()=>l.This}],cancelButton:{run:()=>l.Cancel}});if(d===l.Cancel)return;if(d===l.This)return this._splitPastWorkspaceElement(n,null),this._undo(t,0,!0);const u=this._checkWorkspaceUndo(t,n,r,!1);if(u)return u.returnValue;o=!0}let s;try{s=await this._invokeWorkspacePrepare(n)}catch(l){return this._onError(l,n)}const a=this._checkWorkspaceUndo(t,n,r,!0);if(a)return s.dispose(),a.returnValue;for(const l of r.editStacks)l.moveBackward(n);return this._safeInvokeWithLocks(n,()=>n.actual.undo(),r,s,()=>this._continueUndoInGroup(n.groupId,o))}_resourceUndo(t,n,r){if(!n.isValid){t.flushAllElements();return}if(t.locked){const o=j(2040,"Could not undo '{0}' because there is already an undo or redo operation running.",n.label);this._notificationService.warn(o);return}return this._invokeResourcePrepare(n,o=>(t.moveBackward(n),this._safeInvokeWithLocks(n,()=>n.actual.undo(),new xSe([t]),o,()=>this._continueUndoInGroup(n.groupId,r))))}_findClosestUndoElementInGroup(t){if(!t)return[null,null];let n=null,r=null;for(const[o,s]of this._editStacks){const a=s.getClosestPastElement();a&&a.groupId===t&&(!n||a.groupOrder>n.groupOrder)&&(n=a,r=o)}return[n,r]}_continueUndoInGroup(t,n){if(!t)return;const[,r]=this._findClosestUndoElementInGroup(t);if(r)return this._undo(r,0,n)}undo(t){if(t instanceof WD){const[,n]=this._findClosestUndoElementWithSource(t.id);return n?this._undo(n,t.id,!1):void 0}return typeof t=="string"?this._undo(t,0,!1):this._undo(this.getUriComparisonKey(t),0,!1)}_undo(t,n=0,r){if(!this._editStacks.has(t))return;const o=this._editStacks.get(t),s=o.getClosestPastElement();if(!s)return;if(s.groupId){const[l,d]=this._findClosestUndoElementInGroup(s.groupId);if(s!==l&&d)return this._undo(d,n,r)}if((s.sourceId!==n||s.confirmBeforeUndo)&&!r)return this._confirmAndContinueUndo(t,n,s);try{return s.type===1?this._workspaceUndo(t,s,r):this._resourceUndo(o,s,r)}finally{}}async _confirmAndContinueUndo(t,n,r){if((await this._dialogService.confirm({message:j(2041,"Would you like to undo '{0}'?",r.label),primaryButton:j(2042,"&&Yes"),cancelButton:j(2043,"No")})).confirmed)return this._undo(t,n,!0)}_findClosestRedoElementWithSource(t){if(!t)return[null,null];let n=null,r=null;for(const[o,s]of this._editStacks){const a=s.getClosestFutureElement();a&&a.sourceId===t&&(!n||a.sourceOrder0)return this._tryToSplitAndRedo(t,n,null,j(2046,"Could not redo '{0}' across all files because changes were made to {1}",n.label,s.join(", ")));const a=[];for(const l of r.editStacks)l.locked&&a.push(l.resourceLabel);return a.length>0?this._tryToSplitAndRedo(t,n,null,j(2047,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",n.label,a.join(", "))):r.isValid()?null:this._tryToSplitAndRedo(t,n,null,j(2048,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",n.label))}_workspaceRedo(t,n){const r=this._getAffectedEditStacks(n),o=this._checkWorkspaceRedo(t,n,r,!1);return o?o.returnValue:this._executeWorkspaceRedo(t,n,r)}async _executeWorkspaceRedo(t,n,r){let o;try{o=await this._invokeWorkspacePrepare(n)}catch(a){return this._onError(a,n)}const s=this._checkWorkspaceRedo(t,n,r,!0);if(s)return o.dispose(),s.returnValue;for(const a of r.editStacks)a.moveForward(n);return this._safeInvokeWithLocks(n,()=>n.actual.redo(),r,o,()=>this._continueRedoInGroup(n.groupId))}_resourceRedo(t,n){if(!n.isValid){t.flushAllElements();return}if(t.locked){const r=j(2049,"Could not redo '{0}' because there is already an undo or redo operation running.",n.label);this._notificationService.warn(r);return}return this._invokeResourcePrepare(n,r=>(t.moveForward(n),this._safeInvokeWithLocks(n,()=>n.actual.redo(),new xSe([t]),r,()=>this._continueRedoInGroup(n.groupId))))}_findClosestRedoElementInGroup(t){if(!t)return[null,null];let n=null,r=null;for(const[o,s]of this._editStacks){const a=s.getClosestFutureElement();a&&a.groupId===t&&(!n||a.groupOrder=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},LSe=function(e,t){return function(n,r){t(n,r,e)}};let SYe=class extends ct{constructor(t,n,r){super(),this._themeService=t,this._logService=n,this._languageService=r,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(t){return this._caches.has(t)||this._caches.set(t,new Uze(t.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(t)}};SYe=sFo([LSe(0,Il),LSe(1,Oa),LSe(2,lc)],SYe);qr(l3e,SYe,1);function DIn(e){return typeof e=="string"?!1:Array.isArray(e)?e.every(DIn):!!e.exclusive}class _Lt{constructor(t,n,r,o,s){this.uri=t,this.languageId=n,this.notebookUri=r,this.notebookType=o,this.recursive=s}equals(t){var n,r;return this.notebookType===t.notebookType&&this.languageId===t.languageId&&this.uri.toString()===t.uri.toString()&&((n=this.notebookUri)==null?void 0:n.toString())===((r=t.notebookUri)==null?void 0:r.toString())&&this.recursive===t.recursive}}class Ll{get onDidChange(){return this._onDidChange.event}constructor(t){this._notebookInfoResolver=t,this._clock=0,this._entries=[],this._onDidChange=new it}register(t,n){let r={selector:t,provider:n,_score:-1,_time:this._clock++};return this._entries.push(r),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Gn(()=>{if(r){const o=this._entries.indexOf(r);o>=0&&(this._entries.splice(o,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),r=void 0)}})}has(t){return this.all(t).length>0}all(t){if(!t)return[];this._updateScores(t,!1);const n=[];for(const r of this._entries)r._score>0&&n.push(r.provider);return n}ordered(t,n=!1){const r=[];return this._orderedForEach(t,n,o=>r.push(o.provider)),r}orderedGroups(t){const n=[];let r,o;return this._orderedForEach(t,!1,s=>{r&&o===s._score?r.push(s.provider):(o=s._score,r=[s.provider],n.push(r))}),n}_orderedForEach(t,n,r){this._updateScores(t,n);for(const o of this._entries)o._score>0&&r(o)}_updateScores(t,n){var s,a;const r=(s=this._notebookInfoResolver)==null?void 0:s.call(this,t.uri),o=r?new _Lt(t.uri,t.getLanguageId(),r.uri,r.type,n):new _Lt(t.uri,t.getLanguageId(),void 0,void 0,n);if(!((a=this._lastCandidate)!=null&&a.equals(o))){this._lastCandidate=o;for(const l of this._entries)if(l._score=Rit(l.selector,o.uri,o.languageId,eDn(t),o.notebookUri,o.notebookType),DIn(l.selector)&&l._score>0)if(n)l._score=0;else{for(const d of this._entries)d._score=0;l._score=1e3;break}this._entries.sort(Ll._compareByScoreAndTime)}}static _compareByScoreAndTime(t,n){return t._scoren._score?-1:gG(t.selector)&&!gG(n.selector)?1:!gG(t.selector)&&gG(n.selector)?-1:t._timen._time?-1:0}}function gG(e){return typeof e=="string"?!1:Array.isArray(e)?e.some(gG):!!e.isBuiltin}class aFo{constructor(){this.referenceProvider=new Ll(this._score.bind(this)),this.renameProvider=new Ll(this._score.bind(this)),this.newSymbolNamesProvider=new Ll(this._score.bind(this)),this.codeActionProvider=new Ll(this._score.bind(this)),this.definitionProvider=new Ll(this._score.bind(this)),this.typeDefinitionProvider=new Ll(this._score.bind(this)),this.declarationProvider=new Ll(this._score.bind(this)),this.implementationProvider=new Ll(this._score.bind(this)),this.documentSymbolProvider=new Ll(this._score.bind(this)),this.inlayHintsProvider=new Ll(this._score.bind(this)),this.colorProvider=new Ll(this._score.bind(this)),this.codeLensProvider=new Ll(this._score.bind(this)),this.documentFormattingEditProvider=new Ll(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Ll(this._score.bind(this)),this.onTypeFormattingEditProvider=new Ll(this._score.bind(this)),this.signatureHelpProvider=new Ll(this._score.bind(this)),this.hoverProvider=new Ll(this._score.bind(this)),this.documentHighlightProvider=new Ll(this._score.bind(this)),this.multiDocumentHighlightProvider=new Ll(this._score.bind(this)),this.selectionRangeProvider=new Ll(this._score.bind(this)),this.foldingRangeProvider=new Ll(this._score.bind(this)),this.linkProvider=new Ll(this._score.bind(this)),this.inlineCompletionsProvider=new Ll(this._score.bind(this)),this.completionProvider=new Ll(this._score.bind(this)),this.linkedEditingRangeProvider=new Ll(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Ll(this._score.bind(this)),this.documentSemanticTokensProvider=new Ll(this._score.bind(this)),this.documentDropEditProvider=new Ll(this._score.bind(this)),this.documentPasteEditProvider=new Ll(this._score.bind(this))}_score(t){var n;return(n=this._notebookTypeResolver)==null?void 0:n.call(this,t)}}qr(Zn,aFo,1);var lFo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Hce=function(e,t){return function(n,r){t(n,r,e)}};const E3=ln;let TYe=class extends $1{get _targetWindow(){return oi(this._target.targetElements[0])}get _targetDocumentElement(){return oi(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(t){this._isLocked!==t&&(this._isLocked=t,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(t,n,r,o,s){var g,k,A,m,v,p,b,O,w,y,C;if(super(),this._keybindingService=n,this._configurationService=r,this._markdownRenderer=o,this._accessibilityService=s,this._messageListeners=new Pt,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._maxHeightRatioRelativeToWindow=.5,this._onDispose=this._register(new it),this._onRequestLayout=this._register(new it),this._linkHandler=t.linkHandler,this._target="targetElements"in t.target?t.target:new cFo(t.target),t.style)switch(t.style){case 1:{t.appearance??(t.appearance={}),(g=t.appearance).compact??(g.compact=!0),(k=t.appearance).showPointer??(k.showPointer=!0);break}case 2:{t.appearance??(t.appearance={}),(A=t.appearance).compact??(A.compact=!0);break}}this._hoverPointer=(m=t.appearance)!=null&&m.showPointer?E3("div.workbench-hover-pointer"):void 0,this._hover=this._register(new Bnt(!((v=t.appearance)!=null&&v.skipFadeInAnimation))),this._hover.containerDomNode.classList.add("workbench-hover"),(p=t.appearance)!=null&&p.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),t.additionalClasses&&this._hover.containerDomNode.classList.add(...t.additionalClasses),(b=t.position)!=null&&b.forcePosition&&(this._forcePosition=!0),t.trapFocus&&(this._enableFocusTraps=!0);const a=(O=t.appearance)==null?void 0:O.maxHeightRatio;a!==void 0&&a>0&&a<=1&&(this._maxHeightRatioRelativeToWindow=a),this._hoverPosition=((w=t.position)==null?void 0:w.hoverPosition)===void 0?3:H8(t.position.hoverPosition)?t.position.hoverPosition:2,this.onmousedown(this._hover.containerDomNode,x=>x.stopPropagation()),this.onkeydown(this._hover.containerDomNode,x=>{x.equals(9)&&this.dispose()}),this._register(pt(this._targetWindow,"blur",()=>this.dispose()));const l=E3("div.hover-row.markdown-hover"),d=E3("div.hover-contents");if(typeof t.content=="string")d.textContent=t.content,d.style.whiteSpace="pre-wrap";else if(oc(t.content))d.appendChild(t.content),d.classList.add("html-hover-contents");else{const x=t.content,{element:L}=this._register(this._markdownRenderer.render(x,{actionHandler:this._linkHandler,asyncRenderCallback:()=>{d.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}}));d.appendChild(L)}if(l.appendChild(d),this._hover.contentsDomNode.appendChild(l),t.actions&&t.actions.length>0){const x=E3("div.hover-row.status-bar"),L=E3("div.actions");t.actions.forEach(S=>{const E=this._keybindingService.lookupKeybinding(S.commandId),Q=E?E.getLabel():null;this._register(jOe.render(L,{label:S.label,commandId:S.commandId,run:T=>{S.run(T),this.dispose()},iconClass:S.iconClass},Q))}),x.appendChild(L),this._hover.containerDomNode.appendChild(x)}this._hoverContainer=E3("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let u;if(t.actions&&t.actions.length>0?u=!1:((y=t.persistence)==null?void 0:y.hideOnHover)===void 0?u=typeof t.content=="string"||A8(t.content)&&!t.content.value.includes("](")&&!t.content.value.includes(""):u=t.persistence.hideOnHover,(C=t.appearance)!=null&&C.showHoverHint){const x=E3("div.hover-row.status-bar"),L=E3("div.info");L.textContent=j(1699,"Hold {0} key to mouse over",Pr?"Option":"Alt"),x.appendChild(L),this._hover.containerDomNode.appendChild(x)}const h=[...this._target.targetElements];u||h.push(this._hoverContainer);const f=this._register(new $Lt(h));if(this._register(f.onMouseOut(()=>{this._isLocked||this.dispose()})),u){const x=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new $Lt(x)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=f}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const t=this._hover.containerDomNode,n=this.findLastFocusableChild(this._hover.containerDomNode);if(n){const r=Wbe(this._hoverContainer,E3("div")),o=tn(this._hoverContainer,E3("div"));r.tabIndex=0,o.tabIndex=0,this._register(pt(o,"focus",s=>{t.focus(),s.preventDefault()})),this._register(pt(r,"focus",s=>{n.focus(),s.preventDefault()}))}}findLastFocusableChild(t){if(t.hasChildNodes())for(let n=0;n=0)return s}const o=this.findLastFocusableChild(r);if(o)return o}}render(t){var o;t.appendChild(this._hoverContainer);const r=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&CPn(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))==null?void 0:o.getAriaLabel());r&&yO(r),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const t=h=>{const f=S7n(h),g=h.getBoundingClientRect();return{top:g.top*f,bottom:g.bottom*f,right:g.right*f,left:g.left*f}},n=this._target.targetElements.map(h=>t(h)),{top:r,right:o,bottom:s,left:a}=n[0],l=o-a,d=s-r,u={top:r,right:o,bottom:s,left:a,width:l,height:d,center:{x:a+l/2,y:r+d/2}};if(this.adjustHorizontalHoverPosition(u),this.adjustVerticalHoverPosition(u),this.adjustHoverMaxHeight(u),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:u.left+=3,u.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:u.left-=3,u.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:u.top+=3,u.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:u.top-=3,u.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}u.center.x=u.left+l/2,u.center.y=u.top+d/2}this.computeXCordinate(u),this.computeYCordinate(u),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(u)),this._hover.onContentsChanged()}computeXCordinate(t){const n=this._hover.containerDomNode.clientWidth+2;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===1?this._x=t.right:this._hoverPosition===0?this._x=t.left-n:(this._hoverPointer?this._x=t.center.x-this._hover.containerDomNode.clientWidth/2:this._x=t.left,this._x+n>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-n-2,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=t.bottom)}adjustHorizontalHoverPosition(t){if(this._target.x!==void 0)return;const n=this._hoverPointer?3:0;if(this._forcePosition){const r=n+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-t.right-r}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${t.left-r}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-t.right=this._hover.containerDomNode.clientWidth+n?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(t.left=this._hover.containerDomNode.clientWidth+n?this._hoverPosition=1:this._hoverPosition=2),t.left-this._hover.containerDomNode.clientWidth-n<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(t){if(this._target.y!==void 0||this._forcePosition)return;const n=this._hoverPointer?3:0;this._hoverPosition===3?t.top-this._hover.containerDomNode.clientHeight-n<0&&(this._hoverPosition=2):this._hoverPosition===2&&t.bottom+this._hover.containerDomNode.offsetHeight+n>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(t){let n=this._targetWindow.innerHeight*this._maxHeightRatioRelativeToWindow;if(this._forcePosition){const r=(this._hoverPointer?3:0)+2;this._hoverPosition===3?n=Math.min(n,t.top-r):this._hoverPosition===2&&(n=Math.min(n,this._targetWindow.innerHeight-t.bottom-r))}if(this._hover.containerDomNode.style.maxHeight=`${n}px`,this._hover.contentsDomNode.clientHeightt.height?this._hoverPointer.style.top=`${t.center.y-(this._y-n)-3}px`:this._hoverPointer.style.top=`${Math.round(n/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(this._hoverPosition===3?"bottom":"top");const n=this._hover.containerDomNode.clientWidth;let r=Math.round(n/2)-3;const o=this._x+r;(ot.right)&&(r=t.center.x-this._x-3),this._hoverPointer.style.left=`${r}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){var t,n;this._isDisposed||(this._onDispose.fire(),(n=(t=this._target).dispose)==null||n.call(t),this._hoverContainer.remove(),this._messageListeners.dispose(),super.dispose()),this._isDisposed=!0}};TYe=lFo([Hce(1,Fo),Hce(2,cr),Hce(3,D4),Hce(4,xh)],TYe);class $Lt extends $1{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(t,n=200){super(),this._elements=t,this._eventDebounceDelay=n,this._isMouseIn=!0,this._mouseTimer=this._register(new is),this._onMouseOut=this._register(new it);for(const r of this._elements)this.onmouseover(r,()=>this._onTargetMouseOver()),this.onmouseleave(r,()=>this._onTargetMouseLeave())}_onTargetMouseOver(){this._isMouseIn=!0,this._mouseTimer.clear()}_onTargetMouseLeave(){this._isMouseIn=!1,this._mouseTimer.value=new U1(()=>this._fireIfMouseOutside(),this._eventDebounceDelay)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class cFo{constructor(t){this._element=t,this.targetElements=[this._element]}dispose(){}}function dFo(e){const t=e;return!!t&&typeof t.x=="number"&&typeof t.y=="number"}var R5;(function(e){e[e.AVOID=0]="AVOID",e[e.ALIGN=1]="ALIGN"})(R5||(R5={}));function YU(e,t,n){const r=n.mode===R5.ALIGN?n.offset:n.offset+n.size,o=n.mode===R5.ALIGN?n.offset+n.size:n.offset;return n.position===0?t<=e-r?r:t<=o?o-t:Math.max(e-t,0):t<=o?o-t:t<=e-r?r:0}const wj=class wj extends ct{constructor(t,n){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=ct.None,this.toDisposeOnSetContainer=ct.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=ln(".context-view"),ag(this.view),this.setContainer(t,n),this._register(Gn(()=>this.setContainer(null,1)))}setContainer(t,n){var o;this.useFixedPosition=n!==1;const r=this.useShadowDOM;if(this.useShadowDOM=n===3,!(t===this.container&&r===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,(o=this.shadowRootHostElement)==null||o.remove(),this.shadowRootHostElement=null),this.container=null),t)){if(this.container=t,this.useShadowDOM){this.shadowRootHostElement=ln(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const a=document.createElement("style");a.textContent=uFo,this.shadowRoot.appendChild(a),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(ln("slot"))}else this.container.appendChild(this.view);const s=new Pt;wj.BUBBLE_UP_EVENTS.forEach(a=>{s.add(Sc(this.container,a,l=>{this.onDOMEvent(l,!1)}))}),wj.BUBBLE_DOWN_EVENTS.forEach(a=>{s.add(Sc(this.container,a,l=>{this.onDOMEvent(l,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(t){var n,r;this.isVisible()&&this.hide(),kh(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(t.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",O1(this.view),this.toDisposeOnClean=t.render(this.view)||ct.None,this.delegate=t,this.doLayout(),(r=(n=this.delegate).focus)==null||r.call(n)}getViewElement(){return this.view}layout(){var t,n;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(h2&&Hie.pointerEvents)){this.hide();return}(n=(t=this.delegate)==null?void 0:t.layout)==null||n.call(t),this.doLayout()}}doLayout(){if(!this.isVisible())return;const t=this.delegate.getAnchor();let n;if(oc(t)){const A=ic(t),m=S7n(t);n={top:A.top*m,left:A.left*m,width:A.width*m,height:A.height*m}}else dFo(t)?n={top:t.y,left:t.x,width:t.width||1,height:t.height||2}:n={top:t.posy,left:t.posx,width:2,height:2};const r=h1(this.view),o=UL(this.view),s=this.delegate.anchorPosition??0,a=this.delegate.anchorAlignment??0,l=this.delegate.anchorAxisAlignment??0;let d,u;const h=ks();if(l===0){const A={offset:n.top-h.pageYOffset,size:n.height,position:s===0?0:1},m={offset:n.left,size:n.width,position:a===0?0:1,mode:R5.ALIGN};d=YU(h.innerHeight,o,A)+h.pageYOffset,bA.intersects({start:d,end:d+o},{start:A.offset,end:A.offset+A.size})&&(m.mode=R5.AVOID),u=YU(h.innerWidth,r,m)}else{const A={offset:n.left,size:n.width,position:a===0?0:1},m={offset:n.top,size:n.height,position:s===0?0:1,mode:R5.ALIGN};u=YU(h.innerWidth,r,A),bA.intersects({start:u,end:u+r},{start:A.offset,end:A.offset+A.size})&&(m.mode=R5.AVOID),d=YU(h.innerHeight,o,m)+h.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(s===0?"bottom":"top"),this.view.classList.add(a===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const f=ic(this.container),g=this.container.scrollTop||0,k=this.container.scrollLeft||0;this.view.style.top=`${d-(this.useFixedPosition?ic(this.view).top:f.top)+g}px`,this.view.style.left=`${u-(this.useFixedPosition?ic(this.view).left:f.left)+k}px`,this.view.style.width="initial"}hide(t){const n=this.delegate;this.delegate=null,n!=null&&n.onHide&&n.onHide(t),this.toDisposeOnClean.dispose(),ag(this.view)}isVisible(){return!!this.delegate}onDOMEvent(t,n){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(t,oi(t).document.activeElement):n&&!bu(t.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};wj.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],wj.BUBBLE_DOWN_EVENTS=["click"];let EYe=wj;const uFo=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } .codicon[class*='codicon-'] { font: normal normal normal 16px/1 codicon; display: inline-block; text-decoration: none; text-rendering: auto; text-align: center; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; user-select: none; -webkit-user-select: none; -ms-user-select: none; } :host { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; } :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Nanum Gothic", "AppleGothic", sans-serif; } :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; } :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } `;var hFo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},AFo=function(e,t){return function(n,r){t(n,r,e)}};let W0e=class extends ct{constructor(t){super(),this.layoutService=t,this.contextView=this._register(new EYe(this.layoutService.mainContainer,1)),this.layout(),this._register(t.onDidLayoutContainer(()=>this.layout()))}showContextView(t,n,r){let o;n?n===this.layoutService.getContainer(oi(n))?o=1:r?o=3:o=2:o=1,this.contextView.setContainer(n??this.layoutService.activeContainer,o),this.contextView.show(t);const s={close:()=>{this.openContextView===s&&this.hideContextView()}};return this.openContextView=s,s}layout(){this.contextView.layout()}hideContextView(t){this.contextView.hide(t),this.openContextView=void 0}};W0e=hFo([AFo(0,uC)],W0e);class fFo extends W0e{getContextViewElement(){return this.contextView.getViewElement()}}function QIn(e){const t=e;return typeof t=="object"&&"markdown"in t&&"markdownNotSupportedFallback"in t}class gFo{constructor(t,n,r){this.hoverDelegate=t,this.target=n,this.fadeInAnimation=r}async update(t,n,r){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(pu(t)||oc(t)||t===void 0)o=t;else{this._cancellationTokenSource=new Ya;const s=this._cancellationTokenSource.token;let a;if(QIn(t)?gP(t.markdown)?a=t.markdown(s).then(l=>l??t.markdownNotSupportedFallback):a=t.markdown??t.markdownNotSupportedFallback:a=t.element(s),a instanceof Promise?(this._hoverWidget||this.show(j(1700,"Loading..."),n,r),o=await a):o=a,this.isDisposed||s.isCancellationRequested)return}this.show(o,n,r)}show(t,n,r){var s;const o=this._hoverWidget;if(this.hasContent(t)){const a={content:t,target:this.target,actions:r==null?void 0:r.actions,linkHandler:r==null?void 0:r.linkHandler,trapFocus:r==null?void 0:r.trapFocus,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!o,showHoverHint:(s=r==null?void 0:r.appearance)==null?void 0:s.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(a,n)}o==null||o.dispose()}hasContent(t){return t?A8(t)?!!t.value:!0:!1}get isDisposed(){var t;return(t=this._hoverWidget)==null?void 0:t.isDisposed}dispose(){var t,n;(t=this._hoverWidget)==null||t.dispose(),(n=this._cancellationTokenSource)==null||n.dispose(!0),this._cancellationTokenSource=void 0}}var mFo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},nN=function(e,t){return function(n,r){t(n,r,e)}};let DYe=class extends ct{constructor(t,n,r,o,s,a){super(),this._instantiationService=t,this._configurationService=n,this._keybindingService=o,this._layoutService=s,this._accessibilityService=a,this._currentDelayedHoverWasShown=!1,this._delayedHovers=new Map,this._managedHovers=new Map,this._register(r.onDidShowContextMenu(()=>this.hideHover())),this._contextViewHandler=this._register(new W0e(this._layoutService)),this._register(Zu.registerCommandAndKeybindingRule({id:"workbench.action.showHover",weight:0,primary:qc(2089,2087),handler:()=>{this._showAndFocusHoverForActiveElement()}}))}showInstantHover(t,n,r,o){const s=this._createHover(t,r);if(s)return this._showHover(s,t,n),s}showDelayedHover(t,n){var o;if(t.id===void 0&&(t.id=e8t(t.content)),!this._currentDelayedHover||this._currentDelayedHoverWasShown){if((o=this._currentHover)!=null&&o.isLocked)return;if(S9(this._currentHoverOptions)===S9(t))return this._currentHover;if(this._currentHover&&!this._currentHover.isDisposed&&this._currentDelayedHoverGroupId!==void 0&&this._currentDelayedHoverGroupId===(n==null?void 0:n.groupId))return this.showInstantHover({...t,appearance:{...t.appearance,skipFadeInAnimation:!0}})}else if(this._currentDelayedHover&&S9(this._currentHoverOptions)===S9(t))return this._currentDelayedHover;const r=this._createHover(t,void 0);if(!r){this._currentDelayedHover=void 0,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=void 0;return}return this._currentDelayedHover=r,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=n==null?void 0:n.groupId,My(this._configurationService.getValue("workbench.hover.delay")).then(()=>{r&&!r.isDisposed&&(this._currentDelayedHoverWasShown=!0,this._showHover(r,t))}),r}setupDelayedHover(t,n,r){const o=()=>({...typeof n=="function"?n():n,target:t});return this._setupDelayedHover(t,o,r)}setupDelayedHoverAtMouse(t,n,r){const o=s=>({...typeof n=="function"?n():n,target:{targetElements:[t],x:s!==void 0?s.x+10:void 0}});return this._setupDelayedHover(t,o,r)}_setupDelayedHover(t,n,r){const o=new Pt;return o.add(pt(t,cn.MOUSE_OVER,s=>{this.showDelayedHover(n(s),{groupId:r==null?void 0:r.groupId})})),r!=null&&r.setupKeyboardEvents&&o.add(pt(t,cn.KEY_DOWN,s=>{const a=new Hs(s);(a.equals(10)||a.equals(3))&&this.showInstantHover(n(),!0)})),this._delayedHovers.set(t,{show:s=>{this.showInstantHover(n(),s)}}),o.add(Gn(()=>this._delayedHovers.delete(t))),o}_createHover(t,n){var l,d,u,h;if(this._currentDelayedHover=void 0,t.content===""||(l=this._currentHover)!=null&&l.isLocked||(t.id===void 0&&(t.id=e8t(t.content)),S9(this._currentHoverOptions)===S9(t)))return;this._currentHoverOptions=t,this._lastHoverOptions=t;const r=t.trapFocus||this._accessibilityService.isScreenReaderOptimized(),o=Zd();n||(r&&o?o.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=o):this._lastFocusedElementBeforeOpen=void 0);const s=new Pt,a=this._instantiationService.createInstance(TYe,t);if((d=t.persistence)!=null&&d.sticky&&(a.isLocked=!0),(u=t.position)!=null&&u.hoverPosition&&!H8(t.position.hoverPosition)&&(t.target={targetElements:oc(t.target)?[t.target]:t.target.targetElements,x:t.position.hoverPosition.x+10}),a.onDispose(()=>{var g,k;((g=this._currentHover)==null?void 0:g.domNode)&&E7n(this._currentHover.domNode)&&((k=this._lastFocusedElementBeforeOpen)==null||k.focus()),S9(this._currentHoverOptions)===S9(t)&&this.doHideHover(),s.dispose()},void 0,s),!t.container){const f=oc(t.target)?t.target:t.target.targetElements[0];t.container=this._layoutService.getContainer(oi(f))}if(a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,s),(h=t.persistence)!=null&&h.sticky)s.add(pt(oi(t.container).document,cn.MOUSE_DOWN,f=>{bu(f.target,a.domNode)||this.doHideHover()}));else{if("targetElements"in t.target)for(const g of t.target.targetElements)s.add(pt(g,cn.CLICK,()=>this.hideHover()));else s.add(pt(t.target,cn.CLICK,()=>this.hideHover()));const f=Zd();if(f){const g=oi(f).document;s.add(pt(f,cn.KEY_DOWN,k=>{var A;return this._keyDown(k,a,!!((A=t.persistence)!=null&&A.hideOnKeyDown))})),s.add(pt(g,cn.KEY_DOWN,k=>{var A;return this._keyDown(k,a,!!((A=t.persistence)!=null&&A.hideOnKeyDown))})),s.add(pt(f,cn.KEY_UP,k=>this._keyUp(k,a))),s.add(pt(g,cn.KEY_UP,k=>this._keyUp(k,a)))}}if("IntersectionObserver"in Ls){const f=new IntersectionObserver(k=>this._intersectionChange(k,a),{threshold:0}),g="targetElements"in t.target?t.target.targetElements[0]:t.target;f.observe(g),s.add(Gn(()=>f.disconnect()))}return this._currentHover=a,a}_showHover(t,n,r){this._contextViewHandler.showContextView(new vFo(t,r),n.container)}hideHover(t){var n;!t&&((n=this._currentHover)!=null&&n.isLocked)||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(t,n){t[t.length-1].isIntersecting||n.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showInstantHover(this._lastHoverOptions,!0,!0)}_showAndFocusHoverForActiveElement(){let t=Zd();for(;t;){const n=this._delayedHovers.get(t)??this._managedHovers.get(t);if(n){n.show(!0);return}t=t.parentElement}}_keyDown(t,n,r){var a,l;if(t.key==="Alt"){n.isLocked=!0;return}const o=new Hs(t);this._keybindingService.resolveKeyboardEvent(o).getSingleModifierDispatchChords().some(d=>!!d)||this._keybindingService.softDispatch(o,o.target).kind!==0||r&&(!((a=this._currentHoverOptions)!=null&&a.trapFocus)||t.key!=="Tab")&&(this.hideHover(),(l=this._lastFocusedElementBeforeOpen)==null||l.focus())}_keyUp(t,n){var r;t.key==="Alt"&&(n.isLocked=!1,n.isMouseIn||(this.hideHover(),(r=this._lastFocusedElementBeforeOpen)==null||r.focus()))}setupManagedHover(t,n,r,o){if(t.showNativeHover)return kFo(n,r);n.setAttribute("custom-hover","true"),n.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",n.title),n.title="");let s,a;const l=(k,A)=>{var v;const m=a!==void 0;k&&(a==null||a.dispose(),a=void 0),A&&(s==null||s.dispose(),s=void 0),m&&((v=t.onDidHideHover)==null||v.call(t),a=void 0)},d=(k,A,m,v)=>new U1(async()=>{(!a||a.isDisposed)&&(a=new gFo(t,m||n,k>0),await a.update(typeof r=="function"?r():r,A,{...o,trapFocus:v}))},k),u=new Pt;let h=!1;u.add(pt(n,cn.MOUSE_DOWN,()=>{h=!0,l(!0,!0)},!0)),u.add(pt(n,cn.MOUSE_UP,()=>{h=!1},!0)),u.add(pt(n,cn.MOUSE_LEAVE,k=>{h=!1,l(!1,k.fromElement===n)},!0)),u.add(pt(n,cn.MOUSE_OVER,k=>{if(s)return;const A=new Pt,m={targetElements:[n],dispose:()=>{}};if(t.placement===void 0||t.placement==="mouse"){const v=p=>{m.x=p.x+10,SSe(p,n)||l(!0,!0)};A.add(pt(n,cn.MOUSE_MOVE,v,!0))}s=A,SSe(k,n)&&A.add(d(typeof t.delay=="function"?t.delay(r):t.delay,!1,m))},!0));const f=k=>{if(h||s||!SSe(k,n))return;const A={targetElements:[n],dispose:()=>{}},m=new Pt,v=()=>l(!0,!0);m.add(pt(n,cn.BLUR,v,!0)),m.add(d(typeof t.delay=="function"?t.delay(r):t.delay,!1,A)),s=m};uO(n)||u.add(pt(n,cn.FOCUS,f,!0));const g={show:k=>{l(!1,!0),d(0,k,void 0,k)},hide:()=>{l(!0,!0)},update:async(k,A)=>{r=k,await(a==null?void 0:a.update(r,void 0,A))},dispose:()=>{this._managedHovers.delete(n),u.dispose(),l(!0,!0)}};return this._managedHovers.set(n,g),g}showManagedHover(t){const n=this._managedHovers.get(t);n&&n.show(!0)}dispose(){this._managedHovers.forEach(t=>t.dispose()),super.dispose()}};DYe=mFo([nN(0,$n),nN(1,cr),nN(2,Ek),nN(3,Fo),nN(4,uC),nN(5,xh)],DYe);function S9(e){if(e!==void 0)return(e==null?void 0:e.id)??e}function e8t(e){if(!oc(e))return typeof e=="string"?e.toString():e.value}function t8t(e){const t=typeof e=="function"?e():e;if(pu(t))return Jtt(t);if(QIn(t))return t.markdownNotSupportedFallback}function kFo(e,t){function n(r){r?e.setAttribute("title",r):e.removeAttribute("title")}return n(t8t(t)),{update:r=>n(t8t(r)),show:()=>{},hide:()=>{},dispose:()=>n(void 0)}}class vFo{get anchorPosition(){return this._hover.anchor}constructor(t,n=!1){this._hover=t,this._focus=n,this.layer=1}render(t){return this._hover.render(t),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function SSe(e,t){return oc(e.target)&&pFo(e.target,t)===t}function pFo(e,t){for(t=t??oi(e).document.body;!e.hasAttribute("custom-hover")&&e!==t;)e=e.parentElement;return e}qr(Lg,DYe,1);x2((e,t)=>{const n=e.getColor(rtt);n&&(t.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${n.transparent(.5)}; }`),t.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${n.transparent(.5)}; }`))});function Vce(e){return Object.isFrozen(e)?e:Cdo(e)}class dh{static createEmptyModel(t){return new dh({},[],[],void 0,t)}constructor(t,n,r,o,s){this._contents=t,this._keys=n,this._overrides=r,this.raw=o,this.logService=s,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw){const t=(Array.isArray(this.raw)?this.raw:[this.raw]).map(n=>{if(n instanceof dh)return n;const r=new bFo("",this.logService);return r.parseRaw(n),r.configurationModel});this._rawConfiguration=t.reduce((n,r)=>r===n?r:n.merge(r),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(t){return t?JOt(this.contents,t):this.contents}inspect(t,n){const r=this;return{get value(){return Vce(r.rawConfiguration.getValue(t))},get override(){return n?Vce(r.rawConfiguration.getOverrideValue(t,n)):void 0},get merged(){return Vce(n?r.rawConfiguration.override(n).getValue(t):r.rawConfiguration.getValue(t))},get overrides(){const o=[];for(const{contents:s,identifiers:a,keys:l}of r.rawConfiguration.overrides){const d=new dh(s,l,[],void 0,r.logService).getValue(t);d!==void 0&&o.push({identifiers:a,value:d})}return o.length?Vce(o):void 0}}}getOverrideValue(t,n){const r=this.getContentsForOverrideIdentifer(n);return r?t?JOt(r,t):r:void 0}override(t){let n=this.overrideConfigurations.get(t);return n||(n=this.createOverrideConfigurationModel(t),this.overrideConfigurations.set(t,n)),n}merge(...t){const n=bw(this.contents),r=bw(this.overrides),o=[...this.keys],s=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(const a of t)if(s.push(...a.raw?Array.isArray(a.raw)?a.raw:[a.raw]:[a]),!a.isEmpty()){this.mergeContents(n,a.contents);for(const l of a.overrides){const[d]=r.filter(u=>za(u.identifiers,l.identifiers));d?(this.mergeContents(d.contents,l.contents),d.keys.push(...l.keys),d.keys=X8(d.keys)):r.push(bw(l))}for(const l of a.keys)o.indexOf(l)===-1&&o.push(l)}return new dh(n,o,r,!s.length||s.every(a=>a instanceof dh)?void 0:s,this.logService)}createOverrideConfigurationModel(t){const n=this.getContentsForOverrideIdentifer(t);if(!n||typeof n!="object"||!Object.keys(n).length)return this;const r={};for(const o of X8([...Object.keys(this.contents),...Object.keys(n)])){let s=this.contents[o];const a=n[o];a&&(typeof s=="object"&&typeof a=="object"?(s=bw(s),this.mergeContents(s,a)):s=a),r[o]=s}return new dh(r,this.keys,this.overrides,void 0,this.logService)}mergeContents(t,n){for(const r of Object.keys(n)){if(r in t&&Vd(t[r])&&Vd(n[r])){this.mergeContents(t[r],n[r]);continue}t[r]=bw(n[r])}}getContentsForOverrideIdentifer(t){let n=null,r=null;const o=s=>{s&&(r?this.mergeContents(r,s):r=bw(s))};for(const s of this.overrides)s.identifiers.length===1&&s.identifiers[0]===t?n=s.contents:s.identifiers.includes(t)&&o(s.contents);return o(n),r}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(t,n){this.updateValue(t,n,!1)}removeValue(t){const n=this.keys.indexOf(t);n!==-1&&(this.keys.splice(n,1),Vdo(this.contents,t),jT.test(t)&&this.overrides.splice(this.overrides.findIndex(r=>za(r.identifiers,ome(t))),1))}updateValue(t,n,r){if(sDn(this.contents,t,n,o=>this.logService.error(o)),r=r||this.keys.indexOf(t)===-1,r&&this.keys.push(t),jT.test(t)){const o=ome(t),s={identifiers:o,keys:Object.keys(this.contents[t]),contents:$Ue(this.contents[t],l=>this.logService.error(l))},a=this.overrides.findIndex(l=>za(l.identifiers,o));a!==-1?this.overrides[a]=s:this.overrides.push(s)}}}class bFo{constructor(t,n){this._name=t,this.logService=n,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||dh.createEmptyModel(this.logService)}parseRaw(t,n){this._raw=t;const{contents:r,keys:o,overrides:s,restricted:a,hasExcludedProperties:l}=this.doParseRaw(t,n);this._configurationModel=new dh(r,o,s,l?[t]:void 0,this.logService),this._restrictedConfigurations=a||[]}doParseRaw(t,n){const r=Rl.as(XO.Configuration),o=r.getConfigurationProperties(),s=r.getExcludedConfigurationProperties(),a=this.filter(t,o,s,!0,n);t=a.raw;const l=$Ue(t,h=>this.logService.error(`Conflict in settings file ${this._name}: ${h}`)),d=Object.keys(t),u=this.toOverrides(t,h=>this.logService.error(`Conflict in settings file ${this._name}: ${h}`));return{contents:l,keys:d,overrides:u,restricted:a.restricted,hasExcludedProperties:a.hasExcludedProperties}}filter(t,n,r,o,s){var u;let a=!1;if(!(s!=null&&s.scopes)&&!(s!=null&&s.skipRestricted)&&!(s!=null&&s.skipUnregistered)&&!((u=s==null?void 0:s.exclude)!=null&&u.length))return{raw:t,restricted:[],hasExcludedProperties:a};const l={},d=[];for(const h in t)if(jT.test(h)&&o){const f=this.filter(t[h],n,r,!1,s);l[h]=f.raw,a=a||f.hasExcludedProperties,d.push(...f.restricted)}else{const f=n[h];f!=null&&f.restricted&&d.push(h),this.shouldInclude(h,f,r,s)?l[h]=t[h]:a=!0}return{raw:l,restricted:d,hasExcludedProperties:a}}shouldInclude(t,n,r,o){var l,d;if((l=o.exclude)!=null&&l.includes(t))return!1;if((d=o.include)!=null&&d.includes(t))return!0;if(o.skipRestricted&&(n!=null&&n.restricted)||o.skipUnregistered&&!n)return!1;const s=n??r[t],a=s?typeof s.scope<"u"?s.scope:4:void 0;return a===void 0||o.scopes===void 0?!0:o.scopes.includes(a)}toOverrides(t,n){const r=[];for(const o of Object.keys(t))if(jT.test(o)){const s={};for(const a in t[o])s[a]=t[o][a];r.push({identifiers:ome(o),keys:Object.keys(s),contents:$Ue(s,n)})}return r}}class OFo{constructor(t,n,r,o,s,a,l,d,u,h,f,g,k){this.key=t,this.overrides=n,this._value=r,this.overrideIdentifiers=o,this.defaultConfiguration=s,this.policyConfiguration=a,this.applicationConfiguration=l,this.userConfiguration=d,this.localUserConfiguration=u,this.remoteUserConfiguration=h,this.workspaceConfiguration=f,this.folderConfigurationModel=g,this.memoryConfigurationModel=k}toInspectValue(t){return(t==null?void 0:t.value)!==void 0||(t==null?void 0:t.override)!==void 0||(t==null?void 0:t.overrides)!==void 0?t:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class A3e{constructor(t,n,r,o,s,a,l,d,u,h){this._defaultConfiguration=t,this._policyConfiguration=n,this._applicationConfiguration=r,this._localUserConfiguration=o,this._remoteUserConfiguration=s,this._workspaceConfiguration=a,this._folderConfigurations=l,this._memoryConfiguration=d,this._memoryConfigurationByResource=u,this.logService=h,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Qc,this._userConfiguration=null}getValue(t,n,r){return this.getConsolidatedConfigurationModel(t,n,r).getValue(t)}updateValue(t,n,r={}){let o;r.resource?(o=this._memoryConfigurationByResource.get(r.resource),o||(o=dh.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(r.resource,o))):o=this._memoryConfiguration,n===void 0?o.removeValue(t):o.setValue(t,n),r.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(t,n,r){const o=this.getConsolidatedConfigurationModel(t,n,r),s=this.getFolderConfigurationModelForResource(n.resource,r),a=n.resource?this._memoryConfigurationByResource.get(n.resource)||this._memoryConfiguration:this._memoryConfiguration,l=new Set;for(const d of o.overrides)for(const u of d.identifiers)o.getOverrideValue(t,u)!==void 0&&l.add(u);return new OFo(t,n,o.getValue(t),l.size?[...l]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,r?this._workspaceConfiguration:void 0,s||void 0,a)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{const t=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new dh(t.contents,t.keys,t.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(t,n,r){let o=this.getConsolidatedConfigurationModelForResource(n,r);if(n.overrideIdentifier&&(o=o.override(n.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(t)!==void 0){o=o.merge();for(const s of this._policyConfiguration.keys)o.setValue(s,this._policyConfiguration.getValue(s))}return o}getConsolidatedConfigurationModelForResource({resource:t},n){let r=this.getWorkspaceConsolidatedConfiguration();if(n&&t){const o=n.getFolder(t);o&&(r=this.getFolderConsolidatedConfiguration(o.uri)||r);const s=this._memoryConfigurationByResource.get(t);s&&(r=r.merge(s))}return r}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(t){let n=this._foldersConsolidatedConfigurations.get(t);if(!n){const r=this.getWorkspaceConsolidatedConfiguration(),o=this._folderConfigurations.get(t);o?(n=r.merge(o),this._foldersConsolidatedConfigurations.set(t,n)):n=r}return n}getFolderConfigurationModelForResource(t,n){if(n&&t){const r=n.getFolder(t);if(r)return this._folderConfigurations.get(r.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((t,n)=>{const{contents:r,overrides:o,keys:s}=this._folderConfigurations.get(n);return t.push([n,{contents:r,overrides:o,keys:s}]),t},[])}}static parse(t,n){const r=this.parseConfigurationModel(t.defaults,n),o=this.parseConfigurationModel(t.policy,n),s=this.parseConfigurationModel(t.application,n),a=this.parseConfigurationModel(t.userLocal,n),l=this.parseConfigurationModel(t.userRemote,n),d=this.parseConfigurationModel(t.workspace,n),u=t.folders.reduce((h,f)=>(h.set(pi.revive(f[0]),this.parseConfigurationModel(f[1],n)),h),new Qc);return new A3e(r,o,s,a,l,d,u,dh.createEmptyModel(n),new Qc,n)}static parseConfigurationModel(t,n){return new dh(t.contents,t.keys,t.overrides,t.raw,n)}}class wFo{constructor(t,n,r,o,s){this.change=t,this.previous=n,this.currentConfiguraiton=r,this.currentWorkspace=o,this.logService=s,this._marker=` `,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const a of t.keys)this.affectedKeys.add(a);for(const[,a]of t.overrides)for(const l of a)this.affectedKeys.add(l);this._affectsConfigStr=this._marker;for(const a of this.affectedKeys)this._affectsConfigStr+=a+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=A3e.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(t,n){var l;const r=this._marker+t,o=this._affectsConfigStr.indexOf(r);if(o<0)return!1;const s=o+r.length;if(s>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(s);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(n){const d=this.previousConfiguration?this.previousConfiguration.getValue(t,n,(l=this.previous)==null?void 0:l.workspace):void 0,u=this.currentConfiguraiton.getValue(t,n,this.currentWorkspace);return!M1(d,u)}return!0}}const H0e={kind:0},yFo={kind:1};function CFo(e,t,n){return{kind:2,commandId:e,commandArgs:t,isBubble:n}}class uJ{constructor(t,n,r){var o;this._log=r,this._defaultKeybindings=t,this._defaultBoundCommands=new Map;for(const s of t){const a=s.command;a&&a.charAt(0)!=="-"&&this._defaultBoundCommands.set(a,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=uJ.handleRemovals([].concat(t).concat(n));for(let s=0,a=this._keybindings.length;s"u"){this._map.set(t,[n]),this._addToLookupMap(n);return}for(let o=r.length-1;o>=0;o--){const s=r[o];if(s.command===n.command)continue;let a=!0;for(let l=1;l"u"?(n=[t],this._lookupMap.set(t.command,n)):n.push(t)}_removeFromLookupMap(t){if(!t.command)return;const n=this._lookupMap.get(t.command);if(!(typeof n>"u")){for(let r=0,o=n.length;r"u"||o.length===0)return null;if(o.length===1&&!r)return o[0];for(let s=o.length-1;s>=0;s--){const a=o[s];if(n.contextMatchesRules(a.when))return a}return r?null:o[o.length-1]}resolve(t,n,r){const o=[...n,r];this._log(`| Resolving ${o}`);const s=this._map.get(o[0]);if(s===void 0)return this._log("\\ No keybinding entries."),H0e;let a=null;if(o.length<2)a=s;else{a=[];for(let d=0,u=s.length;dh.chords.length)continue;let f=!0;for(let g=1;g=0;r--){const o=n[r];if(uJ._contextMatchesRules(t,o.when))return o}return null}static _contextMatchesRules(t,n){return n?n.evaluate(t):!0}}function n8t(e){return e?`${e.serialize()}`:"no when condition"}function i8t(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}const xFo=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class LFo extends ct{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:un.None}get inChordMode(){return this._currentChords.length>0}constructor(t,n,r,o,s){super(),this._contextKeyService=t,this._commandService=n,this._telemetryService=r,this._notificationService=o,this._logService=s,this._onDidUpdateKeybindings=this._register(new it),this._currentChords=[],this._currentChordChecker=new fet,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=XU.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new U1,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(t){this._logging&&this._logService.info(`[KeybindingService]: ${t}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(t,n,r=!1){const o=this._getResolver().lookupPrimaryKeybinding(t,n||this._contextKeyService,r);if(o)return o.resolvedKeybinding}dispatchEvent(t,n){return this._dispatch(t,n)}softDispatch(t,n){this._log("/ Soft dispatching keyboard event");const r=this.resolveKeyboardEvent(t);if(r.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),H0e;const[o]=r.getDispatchChords();if(o===null)return this._log("\\ Keyboard event cannot be dispatched"),H0e;const s=this._contextKeyService.getContext(n),a=this._currentChords.map(({keypress:l})=>l);return this._getResolver().resolve(s,a,o)}_scheduleLeaveChordMode(){const t=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-t>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(t,n){switch(this._currentChords.push({keypress:t,label:n}),this._currentChords.length){case 0:throw Ige("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(j(1701,"({0}) was pressed. Waiting for second key of chord...",n));break;default:{const r=this._currentChords.map(({label:o})=>o).join(", ");this._currentChordStatusMessage=this._notificationService.status(j(1702,"({0}) was pressed. Waiting for next key of chord...",r))}}this._scheduleLeaveChordMode(),by.enabled&&by.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.close(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],by.enable()}_dispatch(t,n){return this._doDispatch(this.resolveKeyboardEvent(t),n,!1)}_singleModifierDispatch(t,n){const r=this.resolveKeyboardEvent(t),[o]=r.getSingleModifierDispatchChords();if(o)return this._ignoreSingleModifiers.has(o)?(this._log(`+ Ignoring single modifier ${o} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=XU.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=XU.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${o}.`),this._currentSingleModifier=o,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):o===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${o} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(r,n,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${o}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[s]=r.getChords();return this._ignoreSingleModifiers=new XU(s),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(t,n,r=!1){let o=!1;if(t.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,a=null;if(r){const[h]=t.getSingleModifierDispatchChords();s=h,a=h?[h]:[]}else[s]=t.getDispatchChords(),a=this._currentChords.map(({keypress:h})=>h);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(n),d=t.getLabel(),u=this._getResolver().resolve(l,a,s);switch(u.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",d,"[ No matching keybinding ]"),this.inChordMode){const h=this._currentChords.map(({label:f})=>f).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${h}, ${d}".`),this._notificationService.status(j(1703,"The key combination ({0}, {1}) is not a command.",h,d),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",d,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(s,d),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",d,`[ Will dispatch command ${u.commandId} ]`),u.commandId===null||u.commandId===""){if(this.inChordMode){const h=this._currentChords.map(({label:f})=>f).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${h}, ${d}".`),this._notificationService.status(j(1704,"The key combination ({0}, {1}) is not a command.",h,d),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else{this.inChordMode&&this._leaveChordMode(),u.isBubble||(o=!0),this._log(`+ Invoking command ${u.commandId}.`),this._currentlyDispatchingCommandId=u.commandId;try{typeof u.commandArgs>"u"?this._commandService.executeCommand(u.commandId).then(void 0,h=>this._notificationService.warn(h)):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,h=>this._notificationService.warn(h))}finally{this._currentlyDispatchingCommandId=null}xFo.test(u.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding",detail:t.getUserSettingsLabel()??void 0})}return o}}}mightProducePrintableCharacter(t){return t.ctrlKey||t.metaKey?!1:t.keyCode>=31&&t.keyCode<=56||t.keyCode>=21&&t.keyCode<=30}}const upe=class upe{constructor(t){this._ctrlKey=t?t.ctrlKey:!1,this._shiftKey=t?t.shiftKey:!1,this._altKey=t?t.altKey:!1,this._metaKey=t?t.metaKey:!1}has(t){switch(t){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}};upe.EMPTY=new upe(null);let XU=upe;class r8t{constructor(t,n,r,o,s,a,l){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=t,this.chords=t?QYe(t.getDispatchChords()):[],t&&this.chords.length===0&&(this.chords=QYe(t.getSingleModifierDispatchChords())),this.bubble=n?n.charCodeAt(0)===94:!1,this.command=this.bubble?n.substr(1):n,this.commandArgs=r,this.when=o,this.isDefault=s,this.extensionId=a,this.isBuiltinExtension=l}}function QYe(e){const t=[];for(let n=0,r=e.length;nthis._getLabel(t))}getAriaLabel(){return jOo.toLabel(this._os,this._chords,t=>this._getAriaLabel(t))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:WOo.toLabel(this._os,this._chords,t=>this._getElectronAccelerator(t))}getUserSettingsLabel(){return HOo.toLabel(this._os,this._chords,t=>this._getUserSettingsLabel(t))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(t=>this._getChord(t))}_getChord(t){return new sao(t.ctrlKey,t.shiftKey,t.altKey,t.metaKey,this._getLabel(t),this._getAriaLabel(t))}getDispatchChords(){return this._chords.map(t=>this._getChordDispatch(t))}getSingleModifierDispatchChords(){return this._chords.map(t=>this._getSingleModifierChordDispatch(t))}}class Uee extends SFo{constructor(t,n){super(n,t)}_keyCodeToUILabel(t){if(this._os===2)switch(t){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return LL.toString(t)}_getLabel(t){return t.isDuplicateModifierCase()?"":this._keyCodeToUILabel(t.keyCode)}_getAriaLabel(t){return t.isDuplicateModifierCase()?"":LL.toString(t.keyCode)}_getElectronAccelerator(t){return LL.toElectronAccelerator(t.keyCode)}_getUserSettingsLabel(t){if(t.isDuplicateModifierCase())return"";const n=LL.toUserSettingsUS(t.keyCode);return n&&n.toLowerCase()}_getChordDispatch(t){return Uee.getDispatchStr(t)}static getDispatchStr(t){if(t.isModifierKey())return null;let n="";return t.ctrlKey&&(n+="ctrl+"),t.shiftKey&&(n+="shift+"),t.altKey&&(n+="alt+"),t.metaKey&&(n+="meta+"),n+=LL.toString(t.keyCode),n}_getSingleModifierChordDispatch(t){return t.keyCode===5&&!t.shiftKey&&!t.altKey&&!t.metaKey?"ctrl":t.keyCode===4&&!t.ctrlKey&&!t.altKey&&!t.metaKey?"shift":t.keyCode===6&&!t.ctrlKey&&!t.shiftKey&&!t.metaKey?"alt":t.keyCode===57&&!t.ctrlKey&&!t.shiftKey&&!t.altKey?"meta":null}static _scanCodeToKeyCode(t){const n=uet[t];if(n!==-1)return n;switch(t){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(t){if(!t)return null;if(t instanceof V8)return t;const n=this._scanCodeToKeyCode(t.scanCode);return n===0?null:new V8(t.ctrlKey,t.shiftKey,t.altKey,t.metaKey,n)}static resolveKeybinding(t,n){const r=QYe(t.chords.map(o=>this._toKeyCodeChord(o)));return r.length>0?[new Uee(r,n)]:[]}}let XV=[],Zit=[],BIn=[];function zce(e,t=!1){TFo(e,!1,t)}function TFo(e,t,n){const r=EFo(e,t);XV.push(r),r.userConfigured?BIn.push(r):Zit.push(r),n&&!r.userConfigured&&XV.forEach(o=>{o.mime===r.mime||o.userConfigured||(r.extension&&o.extension===r.extension&&console.warn(`Overwriting extension <<${r.extension}>> to now point to mime <<${r.mime}>>`),r.filename&&o.filename===r.filename&&console.warn(`Overwriting filename <<${r.filename}>> to now point to mime <<${r.mime}>>`),r.filepattern&&o.filepattern===r.filepattern&&console.warn(`Overwriting filepattern <<${r.filepattern}>> to now point to mime <<${r.mime}>>`),r.firstline&&o.firstline===r.firstline&&console.warn(`Overwriting firstline <<${r.firstline}>> to now point to mime <<${r.mime}>>`))})}function EFo(e,t){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:t,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?tIn(e.filepattern.toLowerCase()):void 0,filepatternOnPath:e.filepattern?e.filepattern.indexOf(sd.sep)>=0:!1}}function DFo(){XV=XV.filter(e=>e.userConfigured),Zit=[]}function QFo(e,t){return BFo(e,t).map(n=>n.id)}function BFo(e,t){let n;if(e)switch(e.scheme){case Li.file:n=e.fsPath;break;case Li.data:{n=NT.parseMetaData(e).get(NT.META_DATA_LABEL);break}case Li.vscodeNotebookCell:n=void 0;break;default:n=e.path}if(!n)return[{id:"unknown",mime:Ac.unknown}];n=n.toLowerCase();const r=c8(n),o=o8t(n,r,BIn);if(o)return[o,{id:dk,mime:Ac.text}];const s=o8t(n,r,Zit);if(s)return[s,{id:dk,mime:Ac.text}];if(t){const a=FFo(t);if(a)return[a,{id:dk,mime:Ac.text}]}return[{id:"unknown",mime:Ac.unknown}]}function o8t(e,t,n){var a;let r,o,s;for(let l=n.length-1;l>=0;l--){const d=n[l];if(t===d.filenameLowercase){r=d;break}if(d.filepattern&&(!o||d.filepattern.length>o.filepattern.length)){const u=d.filepatternOnPath?e:t;(a=d.filepatternLowercase)!=null&&a.call(d,u)&&(o=d)}d.extension&&(!s||d.extension.length>s.extension.length)&&t.endsWith(d.extensionLowercase)&&(s=d)}if(r)return r;if(o)return o;if(s)return s}function FFo(e){if(wet(e)&&(e=e.substr(1)),e.length>0)for(let t=XV.length-1;t>=0;t--){const n=XV[t];if(!n.firstline)continue;const r=e.match(n.firstline);if(r&&r.length>0)return n}}const Zce=Object.prototype.hasOwnProperty,s8t="vs.editor.nullLanguage";class PFo{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(s8t,0),this._register(dk,1),this._nextLanguageId=2}_register(t,n){this._languageIdToLanguage[n]=t,this._languageToLanguageId.set(t,n)}register(t){if(this._languageToLanguageId.has(t))return;const n=this._nextLanguageId++;this._register(t,n)}encodeLanguageId(t){return this._languageToLanguageId.get(t)||0}decodeLanguageId(t){return this._languageIdToLanguage[t]||s8t}}const GJ=class GJ extends ct{constructor(t=!0,n=!1){super(),this._onDidChange=this._register(new it),this.onDidChange=this._onDidChange.event,GJ.instanceCount++,this._warnOnOverwrite=n,this.languageIdCodec=new PFo,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},t&&(this._initializeFromRegistry(),this._register(kV.onDidChangeLanguages(r=>{this._initializeFromRegistry()})))}dispose(){GJ.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},DFo();const t=[].concat(kV.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(t)}_registerLanguages(t){for(const n of t)this._registerLanguage(n);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(n=>{const r=this._languages[n];r.name&&(this._nameMap[r.name]=r.identifier),r.aliases.forEach(o=>{this._lowercaseNameMap[o.toLowerCase()]=r.identifier}),r.mimetypes.forEach(o=>{this._mimeTypesMap[o]=r.identifier})}),Rl.as(XO.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(t){const n=t.id;let r;Zce.call(this._languages,n)?r=this._languages[n]:(this.languageIdCodec.register(n),r={identifier:n,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[n]=r),this._mergeLanguage(r,t)}_mergeLanguage(t,n){const r=n.id;let o=null;if(Array.isArray(n.mimetypes)&&n.mimetypes.length>0&&(t.mimetypes.push(...n.mimetypes),o=n.mimetypes[0]),o||(o=`text/x-${r}`,t.mimetypes.push(o)),Array.isArray(n.extensions)){n.configuration?t.extensions=n.extensions.concat(t.extensions):t.extensions=t.extensions.concat(n.extensions);for(const l of n.extensions)zce({id:r,mime:o,extension:l},this._warnOnOverwrite)}if(Array.isArray(n.filenames))for(const l of n.filenames)zce({id:r,mime:o,filename:l},this._warnOnOverwrite),t.filenames.push(l);if(Array.isArray(n.filenamePatterns))for(const l of n.filenamePatterns)zce({id:r,mime:o,filepattern:l},this._warnOnOverwrite);if(typeof n.firstLine=="string"&&n.firstLine.length>0){let l=n.firstLine;l.charAt(0)!=="^"&&(l="^"+l);try{const d=new RegExp(l);JEn(d)||zce({id:r,mime:o,firstline:d},this._warnOnOverwrite)}catch(d){console.warn(`[${n.id}]: Invalid regular expression \`${l}\`: `,d)}}t.aliases.push(r);let s=null;if(typeof n.aliases<"u"&&Array.isArray(n.aliases)&&(n.aliases.length===0?s=[null]:s=n.aliases),s!==null)for(const l of s)!l||l.length===0||t.aliases.push(l);const a=s!==null&&s.length>0;if(!(a&&s[0]===null)){const l=(a?s[0]:null)||r;(a||!t.name)&&(t.name=l)}n.configuration&&t.configurationFiles.push(n.configuration),n.icon&&t.icons.push(n.icon)}isRegisteredLanguageId(t){return t?Zce.call(this._languages,t):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(t){const n=t.toLowerCase();return Zce.call(this._lowercaseNameMap,n)?this._lowercaseNameMap[n]:null}getLanguageIdByMimeType(t){return t&&Zce.call(this._mimeTypesMap,t)?this._mimeTypesMap[t]:null}guessLanguageIdByFilepathOrFirstLine(t,n){return!t&&!n?[]:QFo(t,n)}};GJ.instanceCount=0;let BYe=GJ;const KJ=class KJ extends ct{constructor(t=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new it),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new it),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new it({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,KJ.instanceCount++,this._registry=this._register(new BYe(!0,t)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){KJ.instanceCount--,super.dispose()}isRegisteredLanguageId(t){return this._registry.isRegisteredLanguageId(t)}getLanguageIdByLanguageName(t){return this._registry.getLanguageIdByLanguageName(t)}getLanguageIdByMimeType(t){return this._registry.getLanguageIdByMimeType(t)}guessLanguageIdByFilepathOrFirstLine(t,n){return this._registry.guessLanguageIdByFilepathOrFirstLine(t,n).at(0)??null}createById(t){return new a8t(this.onDidChange,()=>this._createAndGetLanguageIdentifier(t))}createByFilepathOrFirstLine(t,n){return new a8t(this.onDidChange,()=>{const r=this.guessLanguageIdByFilepathOrFirstLine(t,n);return this._createAndGetLanguageIdentifier(r)})}_createAndGetLanguageIdentifier(t){return(!t||!this.isRegisteredLanguageId(t))&&(t=dk),t}requestBasicLanguageFeatures(t){this._requestedBasicLanguages.has(t)||(this._requestedBasicLanguages.add(t),this._onDidRequestBasicLanguageFeatures.fire(t))}requestRichLanguageFeatures(t){this._requestedRichLanguages.has(t)||(this._requestedRichLanguages.add(t),this.requestBasicLanguageFeatures(t),Kl.getOrCreate(t),this._onDidRequestRichLanguageFeatures.fire(t))}};KJ.instanceCount=0;let FYe=KJ;class a8t{constructor(t,n){this._value=es(this,t,()=>n()),this.onDidChange=un.fromObservable(this._value)}get languageId(){return this._value.get()}}const PYe=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,TSe=/(&)?(&)([^\s&])/g;var V0e;(function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"})(V0e||(V0e={}));var MYe;(function(e){e[e.Above=0]="Above",e[e.Below=1]="Below"})(MYe||(MYe={}));class mW extends bm{constructor(t,n,r,o){t.classList.add("monaco-menu-container"),t.setAttribute("role","presentation");const s=document.createElement("div");s.classList.add("monaco-menu"),s.setAttribute("role","presentation"),super(s,{orientation:1,actionViewItemProvider:u=>this.doGetActionViewItem(u,r,a),context:r.context,actionRunner:r.actionRunner,ariaLabel:r.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Pr||ym?[10]:[]],keyDown:!0}}),this.menuStyles=o,this.menuElement=s,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(t,o),this._register(NA.addTarget(s)),this._register(pt(s,cn.KEY_DOWN,u=>{new Hs(u).equals(2)&&u.preventDefault()})),r.enableMnemonics&&this._register(pt(s,cn.KEY_DOWN,u=>{const h=u.key.toLocaleLowerCase();if(this.mnemonics.has(h)){Bo.stop(u,!0);const f=this.mnemonics.get(h);if(f.length===1&&(f[0]instanceof l8t&&f[0].container&&this.focusItemByElement(f[0].container),f[0].onClick(u)),f.length>1){const g=f.shift();g&&g.container&&(this.focusItemByElement(g.container),f.push(g)),this.mnemonics.set(h,f)}}})),ym&&this._register(pt(s,cn.KEY_DOWN,u=>{const h=new Hs(u);h.equals(14)||h.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Bo.stop(u,!0)):(h.equals(13)||h.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Bo.stop(u,!0))})),this._register(pt(this.domNode,cn.MOUSE_OUT,u=>{const h=u.relatedTarget;bu(h,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),u.stopPropagation())})),this._register(pt(this.actionsList,cn.MOUSE_OVER,u=>{let h=u.target;if(!(!h||!bu(h,this.actionsList)||h===this.actionsList)){for(;h.parentElement!==this.actionsList&&h.parentElement!==null;)h=h.parentElement;if(h.classList.contains("action-item")){const f=this.focusedItem;this.setFocusedItem(h),f!==this.focusedItem&&this.updateFocus()}}})),this._register(NA.addTarget(this.actionsList)),this._register(pt(this.actionsList,pa.Tap,u=>{let h=u.initialTarget;if(!(!h||!bu(h,this.actionsList)||h===this.actionsList)){for(;h.parentElement!==this.actionsList&&h.parentElement!==null;)h=h.parentElement;if(h.classList.contains("action-item")){const f=this.focusedItem;this.setFocusedItem(h),f!==this.focusedItem&&this.updateFocus()}}}));const a={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new tre(s,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const l=this.scrollableElement.getDomNode();l.style.position="",this.styleScrollElement(l,o),this._register(pt(s,pa.Change,u=>{Bo.stop(u,!0);const h=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:h-u.translationY})})),this._register(pt(l,cn.MOUSE_UP,u=>{u.preventDefault()}));const d=oi(t);s.style.maxHeight=`${Math.max(10,d.innerHeight-t.getBoundingClientRect().top-35)}px`,n=n.filter((u,h)=>{var f;return(f=r.submenuIds)!=null&&f.has(u.id)?(console.warn(`Found submenu cycle: ${u.id}`),!1):!(u instanceof Ld&&(h===n.length-1||h===0||n[h-1]instanceof Ld))}),this.push(n,{icon:!0,label:!0,isMenu:!0}),t.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(u=>!(u instanceof c8t)).forEach((u,h,f)=>{u.updatePositionInSet(h+1,f.length)})}initializeOrUpdateStyleSheet(t,n){this.styleSheet||(Kge(t)?this.styleSheet=v2(t):(mW.globalStyleSheet||(mW.globalStyleSheet=v2()),this.styleSheet=mW.globalStyleSheet)),this.styleSheet.textContent=RFo(n,Kge(t))}styleScrollElement(t,n){const r=n.foregroundColor??"",o=n.backgroundColor??"",s=n.borderColor?`1px solid ${n.borderColor}`:"",a="5px",l=n.shadowColor?`0 2px 8px ${n.shadowColor}`:"";t.style.outline=s,t.style.borderRadius=a,t.style.color=r,t.style.backgroundColor=o,t.style.boxShadow=l}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(t){const n=this.focusedItem;this.setFocusedItem(t),n!==this.focusedItem&&this.updateFocus()}setFocusedItem(t){for(let n=0;n{this.element&&(this._register(pt(this.element,cn.MOUSE_UP,s=>{if(Bo.stop(s,!0),wm){if(new $h(oi(this.element),s).rightButton)return;this.onClick(s)}else setTimeout(()=>{this.onClick(s)},0)})),this._register(pt(this.element,cn.CONTEXT_MENU,s=>{Bo.stop(s,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(t){super.render(t),this.element&&(this.container=t,this.item=tn(this.element,ln("a.action-menu-item")),this._action.id===Ld.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=tn(this.item,ln("span.menu-item-check"+mi.asCSSSelector(Jt.menuSelection))),this.check.setAttribute("role","none"),this.label=tn(this.item,ln("span.action-label")),this.options.label&&this.options.keybinding&&(tn(this.item,ln("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var t;super.focus(),(t=this.item)==null||t.focus(),this.applyStyle()}updatePositionInSet(t,n){this.item&&(this.item.setAttribute("aria-posinset",`${t}`),this.item.setAttribute("aria-setsize",`${n}`))}updateLabel(){var t;if(this.label&&this.options.label){kh(this.label);let n=Jtt(this.action.label);if(n){const r=MFo(n);this.options.enableMnemonics||(n=r),this.label.setAttribute("aria-label",r.replace(/&&/g,"&"));const o=PYe.exec(n);if(o){n=_p(n),TSe.lastIndex=0;let s=TSe.exec(n);for(;s&&s[1];)s=TSe.exec(n);const a=l=>l.replace(/&&/g,"&");s?this.label.append(zie(a(n.substr(0,s.index))," "),ln("u",{"aria-hidden":"true"},s[3]),GEn(a(n.substr(s.index+s[0].length))," ")):this.label.textContent=a(n).trim(),(t=this.item)==null||t.setAttribute("aria-keyshortcuts",(o[1]?o[1]:o[3]).toLocaleLowerCase())}else this.label.textContent=n.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const t=this.action.checked;this.item.classList.toggle("checked",!!t),t!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",t?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const t=this.element&&this.element.classList.contains("focused"),n=t&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,r=t&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,o=t&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",s=t&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=n??"",this.item.style.backgroundColor=r??"",this.item.style.outline=o,this.item.style.outlineOffset=s),this.check&&(this.check.style.color=n??"")}}class l8t extends FIn{constructor(t,n,r,o,s){super(t,t,o,s),this.submenuActions=n,this.parentData=r,this.submenuOptions=o,this.mysubmenu=null,this.submenuDisposables=this._register(new Pt),this.mouseOver=!1,this.expandDirection=o&&o.expandDirection!==void 0?o.expandDirection:{horizontal:V0e.Right,vertical:MYe.Below},this.showScheduler=new Ss(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Ss(()=>{this.element&&!bu(Zd(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(t){super.render(t),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=tn(this.item,ln("span.submenu-indicator"+mi.asCSSSelector(Jt.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(pt(this.element,cn.KEY_UP,n=>{const r=new Hs(n);(r.equals(17)||r.equals(3))&&(Bo.stop(n,!0),this.createSubmenu(!0))})),this._register(pt(this.element,cn.KEY_DOWN,n=>{const r=new Hs(n);Zd()===this.item&&(r.equals(17)||r.equals(3))&&Bo.stop(n,!0)})),this._register(pt(this.element,cn.MOUSE_OVER,n=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(pt(this.element,cn.MOUSE_LEAVE,n=>{this.mouseOver=!1})),this._register(pt(this.element,cn.FOCUS_OUT,n=>{this.element&&!bu(Zd(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(t){Bo.stop(t,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(t){if(this.parentData.submenu&&(t||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(t,n,r,o){const s={top:0,left:0};return s.left=YU(t.width,n.width,{position:o.horizontal===V0e.Right?0:1,offset:r.left,size:r.width}),s.left>=r.left&&s.left{new Hs(h).equals(15)&&(Bo.stop(h,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(pt(this.submenuContainer,cn.KEY_DOWN,h=>{new Hs(h).equals(15)&&Bo.stop(h,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(t),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(t){var n;this.item&&((n=this.item)==null||n.setAttribute("aria-expanded",t))}applyStyle(){super.applyStyle();const n=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=n??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class c8t extends QV{constructor(t,n,r,o){super(t,n,r),this.menuStyles=o}render(t){super.render(t),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function MFo(e){const t=PYe,n=t.exec(e);if(!n)return e;const r=!n[1];return e.replace(t,r?"$2$3":"").trim()}function d8t(e){const t=R7n()[e.id];return`.codicon-${e.id}:before { content: '\\${t.toString(16)}'; }`}function RFo(e,t){let n=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } ${d8t(Jt.menuSelection)} ${d8t(Jt.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; overflow: hidden; white-space: nowrap; } .monaco-menu .monaco-action-bar .actions-container { display: flex; margin: 0 auto; padding: 0; width: 100%; justify-content: flex-end; } .monaco-menu .monaco-action-bar.vertical .actions-container { display: inline-block; } .monaco-menu .monaco-action-bar.reverse .actions-container { flex-direction: row-reverse; } .monaco-menu .monaco-action-bar .action-item { cursor: pointer; display: inline-block; transition: transform 50ms ease; position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */ } .monaco-menu .monaco-action-bar .action-item.disabled { cursor: default; } .monaco-menu .monaco-action-bar .action-item .icon, .monaco-menu .monaco-action-bar .action-item .codicon { display: inline-block; } .monaco-menu .monaco-action-bar .action-item .codicon { display: flex; align-items: center; } .monaco-menu .monaco-action-bar .action-label { font-size: 11px; margin-right: 4px; } .monaco-menu .monaco-action-bar .action-item.disabled .action-label, .monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover { color: var(--vscode-disabledForeground); } /* Vertical actions */ .monaco-menu .monaco-action-bar.vertical { text-align: left; } .monaco-menu .monaco-action-bar.vertical .action-item { display: block; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { display: block; border-bottom: 1px solid var(--vscode-menu-separatorBackground); padding-top: 1px; padding: 30px; } .monaco-menu .secondary-actions .monaco-action-bar .action-label { margin-left: 6px; } /* Action Items */ .monaco-menu .monaco-action-bar .action-item.select-container { overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */ flex: 1; max-width: 170px; min-width: 60px; display: flex; align-items: center; justify-content: center; margin-right: 10px; } .monaco-menu .monaco-action-bar.vertical { margin-left: 0; overflow: visible; } .monaco-menu .monaco-action-bar.vertical .actions-container { display: block; } .monaco-menu .monaco-action-bar.vertical .action-item { padding: 0; transform: none; display: flex; } .monaco-menu .monaco-action-bar.vertical .action-item.active { transform: none; } .monaco-menu .monaco-action-bar.vertical .action-menu-item { flex: 1 1 auto; display: flex; height: 2em; align-items: center; position: relative; margin: 0 4px; border-radius: 4px; } .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding, .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding { opacity: unset; } .monaco-menu .monaco-action-bar.vertical .action-label { flex: 1 1 auto; text-decoration: none; padding: 0 1em; background: none; font-size: 12px; line-height: 1; } .monaco-menu .monaco-action-bar.vertical .keybinding, .monaco-menu .monaco-action-bar.vertical .submenu-indicator { display: inline-block; flex: 2 1 auto; padding: 0 1em; text-align: right; font-size: 12px; line-height: 1; opacity: 0.7; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon { font-size: 16px !important; display: flex; align-items: center; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before { margin-left: auto; margin-right: -20px; } .monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding, .monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator { opacity: 0.4; } .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) { display: inline-block; box-sizing: border-box; margin: 0; } .monaco-menu .monaco-action-bar.vertical .action-item { position: static; overflow: visible; } .monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu { position: absolute; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { width: 100%; height: 0px !important; opacity: 1; } .monaco-menu .monaco-action-bar.vertical .action-label.separator.text { padding: 0.7em 1em 0.1em 1em; font-weight: bold; opacity: 1; } .monaco-menu .monaco-action-bar.vertical .action-label:hover { color: inherit; } .monaco-menu .monaco-action-bar.vertical .menu-item-check { position: absolute; visibility: hidden; width: 1em; height: 100%; } .monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check { visibility: visible; display: flex; align-items: center; justify-content: center; } /* Context Menu */ .context-view.monaco-menu-container { outline: 0; border: none; animation: fadeIn 0.083s linear; -webkit-app-region: no-drag; } .context-view.monaco-menu-container :focus, .context-view.monaco-menu-container .monaco-action-bar.vertical:focus, .context-view.monaco-menu-container .monaco-action-bar.vertical :focus { outline: 0; } .hc-black .context-view.monaco-menu-container, .hc-light .context-view.monaco-menu-container, :host-context(.hc-black) .context-view.monaco-menu-container, :host-context(.hc-light) .context-view.monaco-menu-container { box-shadow: none; } .hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused, .hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused, :host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused, :host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused { background: none; } /* Vertical Action Bar Styles */ .monaco-menu .monaco-action-bar.vertical { padding: 4px 0; } .monaco-menu .monaco-action-bar.vertical .action-menu-item { height: 2em; } .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator), .monaco-menu .monaco-action-bar.vertical .keybinding { font-size: inherit; padding: 0 2em; max-height: 100%; } .monaco-menu .monaco-action-bar.vertical .menu-item-check { font-size: inherit; width: 2em; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { font-size: inherit; margin: 5px 0 !important; padding: 0; border-radius: 0; } .linux .monaco-menu .monaco-action-bar.vertical .action-label.separator, :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator { margin-left: 0; margin-right: 0; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator { font-size: 60%; padding: 0 1.8em; } .linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator, :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%; mask-size: 10px 10px; -webkit-mask-size: 10px 10px; } .monaco-menu .action-item { cursor: default; }`;if(t){n+=` /* Arrows */ .monaco-scrollable-element > .scrollbar > .scra { cursor: pointer; font-size: 11px !important; } .monaco-scrollable-element > .visible { opacity: 1; /* Background rule added for IE9 - to allow clicks on dom node */ background:rgba(0,0,0,0); transition: opacity 100ms linear; } .monaco-scrollable-element > .invisible { opacity: 0; pointer-events: none; } .monaco-scrollable-element > .invisible.fade { transition: opacity 800ms linear; } /* Scrollable Content Inset Shadow */ .monaco-scrollable-element > .shadow { position: absolute; display: none; } .monaco-scrollable-element > .shadow.top { display: block; top: 0; left: 3px; height: 3px; width: 100%; } .monaco-scrollable-element > .shadow.left { display: block; top: 3px; left: 0; height: 100%; width: 3px; } .monaco-scrollable-element > .shadow.top-left-corner { display: block; top: 0; left: 0; height: 3px; width: 3px; } /* Fix for https://github.com/microsoft/vscode/issues/103170 */ .monaco-menu .action-item .monaco-submenu { z-index: 1; } `;const r=e.scrollbarShadow;r&&(n+=` .monaco-scrollable-element > .shadow.top { box-shadow: ${r} 0 6px 6px -6px inset; } .monaco-scrollable-element > .shadow.left { box-shadow: ${r} 6px 0 6px -6px inset; } .monaco-scrollable-element > .shadow.top.left { box-shadow: ${r} 6px 6px 6px -6px inset; } `);const o=e.scrollbarSliderBackground;o&&(n+=` .monaco-scrollable-element > .scrollbar > .slider { background: ${o}; } `);const s=e.scrollbarSliderHoverBackground;s&&(n+=` .monaco-scrollable-element > .scrollbar > .slider:hover { background: ${s}; } `);const a=e.scrollbarSliderActiveBackground;a&&(n+=` .monaco-scrollable-element > .scrollbar > .slider.active { background: ${a}; } `)}return n}class IFo{constructor(t,n,r,o){this.contextViewService=t,this.telemetryService=n,this.notificationService=r,this.keybindingService=o,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(t){this.options=t}showContextMenu(t){const n=t.getActions();if(!n.length)return;this.focusToReturn=Zd();let r;const o=oc(t.domForShadowRoot)?t.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>t.getAnchor(),canRelayout:!1,anchorAlignment:t.anchorAlignment,anchorAxisAlignment:t.anchorAxisAlignment,layer:t.layer,render:s=>{var h;this.lastContainer=s;const a=t.getMenuClassName?t.getMenuClassName():"";a&&(s.className+=" "+a),this.options.blockMouse&&(this.block=s.appendChild(ln(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(h=this.blockDisposable)==null||h.dispose(),this.blockDisposable=pt(this.block,cn.MOUSE_DOWN,f=>f.stopPropagation()));const l=new Pt,d=t.actionRunner||l.add(new bP);d.onWillRun(f=>this.onActionRun(f,!t.skipTelemetry),this,l),d.onDidRun(this.onDidActionRun,this,l),r=new mW(s,n,{actionViewItemProvider:t.getActionViewItem,context:t.getActionsContext?t.getActionsContext():null,actionRunner:d,getKeyBinding:t.getKeyBinding?t.getKeyBinding:f=>this.keybindingService.lookupKeybinding(f.id)},$Oo),r.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),r.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l);const u=oi(s);return l.add(pt(u,cn.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(pt(u,cn.MOUSE_DOWN,f=>{if(f.defaultPrevented)return;const g=new $h(u,f);let k=g.target;if(!g.rightButton){for(;k;){if(k===s)return;k=k.parentElement}this.contextViewService.hideContextView(!0)}})),Jp(l,r)},focus:()=>{r==null||r.focus(!!t.autoSelectFirstItem)},onHide:s=>{var a,l,d;(a=t.onHide)==null||a.call(t,!!s),this.block&&(this.block.remove(),this.block=null),(l=this.blockDisposable)==null||l.dispose(),this.blockDisposable=null,this.lastContainer&&(Zd()===this.lastContainer||bu(Zd(),this.lastContainer))&&((d=this.focusToReturn)==null||d.focus()),this.lastContainer=null}},o,!!o)}onActionRun(t,n){n&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:t.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(t){t.error&&!Sk(t.error)&&this.notificationService.error(t.error)}}var NFo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},iN=function(e,t){return function(n,r){t(n,r,e)}};let RYe=class extends ct{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new IFo(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(t,n,r,o,s,a){super(),this.telemetryService=t,this.notificationService=n,this.contextViewService=r,this.keybindingService=o,this.menuService=s,this.contextKeyService=a,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new it),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new it),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(t){this.contextMenuHandler.configure(t)}showContextMenu(t){t=IYe.transform(t,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...t,onHide:n=>{var r;(r=t.onHide)==null||r.call(t,n),this._onDidHideContextMenu.fire()}}),jL.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};RYe=NFo([iN(0,zA),iN(1,cc),iN(2,Q6),iN(3,Fo),iN(4,y2),iN(5,Fi)],RYe);var IYe;(function(e){function t(r){return r&&r.menuId instanceof Yn}function n(r,o,s){if(!t(r))return r;const{menuId:a,menuActionOptions:l,contextKeyService:d}=r;return{...r,getActions:()=>{let u=[];if(a){const h=o.getMenuActions(a,d??s,l);u=i3o(h)}return r.getActions?Ld.join(r.getActions(),u):u}}}e.transform=n})(IYe||(IYe={}));var z0e;(function(e){e[e.API=0]="API",e[e.USER=1]="USER"})(z0e||(z0e={}));var Yit=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Z0e=function(e,t){return function(n,r){t(n,r,e)}};let NYe=class{constructor(t){this._commandService=t}async open(t,n){if(!Mbe(t,Li.command))return!1;if(!(n!=null&&n.allowCommands)||(typeof t=="string"&&(t=pi.parse(t)),Array.isArray(n.allowCommands)&&!n.allowCommands.includes(t.path)))return!0;let r=[];try{r=vWe(decodeURIComponent(t.query))}catch{try{r=vWe(t.query)}catch{}}return Array.isArray(r)||(r=[r]),await this._commandService.executeCommand(t.path,...r),!0}};NYe=Yit([Z0e(0,Ca)],NYe);let UYe=class{constructor(t){this._editorService=t}async open(t,n){typeof t=="string"&&(t=pi.parse(t));const{selection:r,uri:o}=K3o(t);return t=o,t.scheme===Li.file&&(t=ndo(t)),await this._editorService.openCodeEditor({resource:t,options:{selection:r,source:n!=null&&n.fromUserGesture?z0e.USER:z0e.API,...n==null?void 0:n.editorOptions}},this._editorService.getFocusedCodeEditor(),n==null?void 0:n.openToSide),!0}};UYe=Yit([Z0e(0,Co)],UYe);let jYe=class{constructor(t,n){this._openers=new Tf,this._validators=new Tf,this._resolvers=new Tf,this._resolvedUriTargets=new Qc(r=>r.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Tf,this._defaultExternalOpener={openExternal:async r=>(QUe(r,Li.http,Li.https)?B7n(r):Ls.location.href=r,!0)},this._openers.push({open:async(r,o)=>o!=null&&o.openExternal||QUe(r,Li.mailto,Li.http,Li.https,Li.vsls)?(await this._doOpenExternal(r,o),!0):!1}),this._openers.push(new NYe(n)),this._openers.push(new UYe(t))}registerOpener(t){return{dispose:this._openers.unshift(t)}}async open(t,n){if(!(n!=null&&n.skipValidation)){const r=typeof t=="string"?pi.parse(t):t,o=this._resolvedUriTargets.get(r)??t;for(const s of this._validators)if(!await s.shouldOpen(o,n))return!1}for(const r of this._openers)if(await r.open(t,n))return!0;return!1}async resolveExternalUri(t,n){for(const r of this._resolvers)try{const o=await r.resolveExternalUri(t,n);if(o)return this._resolvedUriTargets.has(o.resolved)||this._resolvedUriTargets.set(o.resolved,t),o}catch{}throw new Error("Could not resolve external URI: "+t.toString())}async _doOpenExternal(t,n){const r=typeof t=="string"?pi.parse(t):t;let o;try{o=(await this.resolveExternalUri(r,n)).resolved}catch{o=r}let s;if(typeof t=="string"&&r.toString()===o.toString()?s=t:s=encodeURI(o.toString(!0)),n!=null&&n.allowContributedOpeners){const a=typeof(n==null?void 0:n.allowContributedOpeners)=="string"?n==null?void 0:n.allowContributedOpeners:void 0;for(const l of this._externalOpeners)if(await l.openExternal(s,{sourceUri:r,preferredOpenerId:a},Fr.None))return!0}return this._defaultExternalOpener.openExternal(s,{sourceUri:r},Fr.None)}dispose(){this._validators.clear()}};jYe=Yit([Z0e(0,Co),Z0e(1,Ca)],jYe);var UFo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},u8t=function(e,t){return function(n,r){t(n,r,e)}};let WYe=class extends ct{constructor(t,n){super(),this._markerService=n,this._onDidChangeMarker=this._register(new it),this._suppressedRanges=new Qc,this._markerDecorations=new Qc,t.getModels().forEach(r=>this._onModelAdded(r)),this._register(t.onModelAdded(this._onModelAdded,this)),this._register(t.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(t=>t.dispose()),this._markerDecorations.clear()}getMarker(t,n){const r=this._markerDecorations.get(t);return r&&r.getMarker(n)||null}_handleMarkerChange(t){t.forEach(n=>{const r=this._markerDecorations.get(n);r&&this._updateDecorations(r)})}_onModelAdded(t){const n=new jFo(t);this._markerDecorations.set(t.uri,n),this._updateDecorations(n)}_onModelRemoved(t){var r;const n=this._markerDecorations.get(t.uri);n&&(n.dispose(),this._markerDecorations.delete(t.uri)),(t.uri.scheme===Li.inMemory||t.uri.scheme===Li.internal||t.uri.scheme===Li.vscode)&&((r=this._markerService)==null||r.read({resource:t.uri}).map(o=>o.owner).forEach(o=>this._markerService.remove(o,[t.uri])))}_updateDecorations(t){let n=this._markerService.read({resource:t.model.uri,take:500});const r=this._suppressedRanges.get(t.model.uri);r&&(n=n.filter(o=>!lo.some(r,s=>De.areIntersectingOrTouching(s,o)))),t.update(n)&&this._onDidChangeMarker.fire(t.model)}};WYe=UFo([u8t(0,pl),u8t(1,hC)],WYe);class jFo extends ct{constructor(t){super(),this.model=t,this._map=new Kco,this._register(Gn(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(t){const{added:n,removed:r}=kvo(new Set(this._map.keys()),new Set(t));if(n.length===0&&r.length===0)return!1;const o=r.map(l=>this._map.get(l)),s=n.map(l=>({range:this._createDecorationRange(this.model,l),options:this._createDecorationOption(l)})),a=this.model.deltaDecorations(o,s);for(const l of r)this._map.delete(l);for(let l=0;l=o)return r;const s=t.getWordAtPosition(r.getStartPosition());s&&(r=new De(r.startLineNumber,s.startColumn,r.endLineNumber,s.endColumn))}else if(n.endColumn===Number.MAX_VALUE&&n.startColumn===1&&r.startLineNumber===r.endLineNumber){const o=t.getLineFirstNonWhitespaceColumn(n.startLineNumber);o=0:!1}}var WFo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Yce=function(e,t){return function(n,r){t(n,r,e)}},JN;function j7(e){return e.toString()}class HFo{constructor(t,n,r){this.model=t,this._modelEventListeners=new Pt,this.model=t,this._modelEventListeners.add(t.onWillDispose(()=>n(t))),this._modelEventListeners.add(t.onDidChangeLanguage(o=>r(t,o)))}dispose(){this._modelEventListeners.dispose()}}const VFo=ym||Pr?1:2;class zFo{constructor(t,n,r,o,s,a,l,d){this.uri=t,this.initialUndoRedoSnapshot=n,this.time=r,this.sharesUndoRedoStack=o,this.heapSize=s,this.sha1=a,this.versionId=l,this.alternativeVersionId=d}}var IF;let HYe=(IF=class extends ct{constructor(t,n,r,o){super(),this._configurationService=t,this._resourcePropertiesService=n,this._undoRedoService=r,this._instantiationService=o,this._onModelAdded=this._register(new it),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new it),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new it),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(s=>this._updateModelOptions(s))),this._updateModelOptions(void 0)}static _readModelOptions(t,n){var g;let r=qh.tabSize;t.editor&&typeof t.editor.tabSize<"u"&&(r=uL(t.editor.tabSize,qh.tabSize,1,100));let o="tabSize";t.editor&&typeof t.editor.indentSize<"u"&&t.editor.indentSize!=="tabSize"&&(o=uL(t.editor.indentSize,"tabSize",1,100));let s=qh.insertSpaces;t.editor&&typeof t.editor.insertSpaces<"u"&&(s=t.editor.insertSpaces==="false"?!1:!!t.editor.insertSpaces);let a=VFo;const l=t.eol;l===`\r `?a=2:l===` `&&(a=1);let d=qh.trimAutoWhitespace;t.editor&&typeof t.editor.trimAutoWhitespace<"u"&&(d=t.editor.trimAutoWhitespace==="false"?!1:!!t.editor.trimAutoWhitespace);let u=qh.detectIndentation;t.editor&&typeof t.editor.detectIndentation<"u"&&(u=t.editor.detectIndentation==="false"?!1:!!t.editor.detectIndentation);let h=qh.largeFileOptimizations;t.editor&&typeof t.editor.largeFileOptimizations<"u"&&(h=t.editor.largeFileOptimizations==="false"?!1:!!t.editor.largeFileOptimizations);let f=qh.bracketPairColorizationOptions;if((g=t.editor)!=null&&g.bracketPairColorization&&typeof t.editor.bracketPairColorization=="object"){const k=t.editor.bracketPairColorization;f={enabled:!!k.enabled,independentColorPoolPerBracketType:!!k.independentColorPoolPerBracketType}}return{isForSimpleWidget:n,tabSize:r,indentSize:o,insertSpaces:s,detectIndentation:u,defaultEOL:a,trimAutoWhitespace:d,largeFileOptimizations:h,bracketPairColorizationOptions:f}}_getEOL(t,n){if(t)return this._resourcePropertiesService.getEOL(t,n);const r=this._configurationService.getValue("files.eol",{overrideIdentifier:n});return r&&typeof r=="string"&&r!=="auto"?r:x1===3||x1===2?` `:`\r `}_shouldRestoreUndoStack(){const t=this._configurationService.getValue("files.restoreUndoStack");return typeof t=="boolean"?t:!0}getCreationOptions(t,n,r){const o=typeof t=="string"?t:t.languageId;let s=this._modelCreationOptionsByLanguageAndResource[o+n];if(!s){const a=this._configurationService.getValue("editor",{overrideIdentifier:o,resource:n}),l=this._getEOL(n,o);s=JN._readModelOptions({editor:a,eol:l},r),this._modelCreationOptionsByLanguageAndResource[o+n]=s}return s}_updateModelOptions(t){const n=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const r=Object.keys(this._models);for(let o=0,s=r.length;ot){const n=[];for(this._disposedModels.forEach(r=>{r.sharesUndoRedoStack||n.push(r)}),n.sort((r,o)=>r.time-o.time);n.length>0&&this._disposedModelsHeapSize>t;){const r=n.shift();this._removeDisposedModel(r.uri),r.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(r.initialUndoRedoSnapshot)}}}_createModelData(t,n,r,o){const s=this.getCreationOptions(n,r,o),a=this._instantiationService.createInstance(SP,t,n,s,r);if(r&&this._disposedModels.has(j7(r))){const u=this._removeDisposedModel(r),h=this._undoRedoService.getElements(r),f=this._getSHA1Computer(),g=f.canComputeSHA1(a)?f.computeSHA1(a)===u.sha1:!1;if(g||u.sharesUndoRedoStack){for(const k of h.past)AL(k)&&k.matchesResource(r)&&k.setModel(a);for(const k of h.future)AL(k)&&k.matchesResource(r)&&k.setModel(a);this._undoRedoService.setElementsValidFlag(r,!0,k=>AL(k)&&k.matchesResource(r)),g&&(a._overwriteVersionId(u.versionId),a._overwriteAlternativeVersionId(u.alternativeVersionId),a._overwriteInitialUndoRedoSnapshot(u.initialUndoRedoSnapshot))}else u.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(u.initialUndoRedoSnapshot)}const l=j7(a.uri);if(this._models[l])throw new Error("ModelService: Cannot add model because it already exists!");const d=new HFo(a,u=>this._onWillDispose(u),(u,h)=>this._onDidChangeLanguage(u,h));return this._models[l]=d,d}createModel(t,n,r,o=!1){let s;return n?s=this._createModelData(t,n,r,o):s=this._createModelData(t,dk,r,o),this._onModelAdded.fire(s.model),s.model}getModels(){const t=[],n=Object.keys(this._models);for(let r=0,o=n.length;r0||u.future.length>0){for(const h of u.past)AL(h)&&h.matchesResource(t.uri)&&(s=!0,a+=h.heapSize(t.uri),h.setModel(t.uri));for(const h of u.future)AL(h)&&h.matchesResource(t.uri)&&(s=!0,a+=h.heapSize(t.uri),h.setModel(t.uri))}}const l=JN.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,d=this._getSHA1Computer();if(s)if(!o&&(a>l||!d.canComputeSHA1(t))){const u=r.model.getInitialUndoRedoSnapshot();u!==null&&this._undoRedoService.restoreSnapshot(u)}else this._ensureDisposedModelsHeapSize(l-a),this._undoRedoService.setElementsValidFlag(t.uri,!1,u=>AL(u)&&u.matchesResource(t.uri)),this._insertDisposedModel(new zFo(t.uri,r.model.getInitialUndoRedoSnapshot(),Date.now(),o,a,d.computeSHA1(t),t.getVersionId(),t.getAlternativeVersionId()));else if(!o){const u=r.model.getInitialUndoRedoSnapshot();u!==null&&this._undoRedoService.restoreSnapshot(u)}delete this._models[n],r.dispose(),delete this._modelCreationOptionsByLanguageAndResource[t.getLanguageId()+t.uri],this._onModelRemoved.fire(t)}_onDidChangeLanguage(t,n){const r=n.oldLanguage,o=t.getLanguageId(),s=this.getCreationOptions(r,t.uri,t.isForSimpleWidget),a=this.getCreationOptions(o,t.uri,t.isForSimpleWidget);JN._setModelOptionsForModel(t,a,s),this._onModelModeChanged.fire({model:t,oldLanguageId:r})}_getSHA1Computer(){return new VYe}},JN=IF,IF.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,IF);HYe=JN=WFo([Yce(0,cr),Yce(1,NRn),Yce(2,jtt),Yce(3,$n)],HYe);const hpe=class hpe{canComputeSHA1(t){return t.getValueLength()<=hpe.MAX_MODEL_SIZE}computeSHA1(t){const n=new PUe,r=t.createSnapshot();let o;for(;o=r.read();)n.update(o);return n.digest()}};hpe.MAX_MODEL_SIZE=10*1024*1024;let VYe=hpe;var ZFo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},h8t=function(e,t){return function(n,r){t(n,r,e)}};let zYe=class extends ct{constructor(t,n){super(),this.quickInputService=t,this.instantiationService=n,this.registry=Rl.as(_M.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0,this._register(Gn(()=>{var r;for(const o of this.mapProviderToDescriptor.values())BM(o)&&o.dispose();(r=this.visibleQuickAccess)==null||r.picker.dispose()}))}show(t="",n){this.doShowOrPick(t,!1,n)}doShowOrPick(t,n,r){var A,m;const[o,s]=this.getOrInstantiateProvider(t,r==null?void 0:r.enabledProviderPrefixes),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&s&&l===s){t!==s.prefix&&!(r!=null&&r.preserveValue)&&(a.picker.value=t),this.adjustValueSelection(a.picker,s,r);return}if(s&&!(r!=null&&r.preserveValue)){let v;if(a&&l&&l!==s){const p=a.value.substr(l.prefix.length);p&&(v=`${s.prefix}${p}`)}if(!v){const p=o==null?void 0:o.defaultFilterValue;p===AZe.LAST?v=this.lastAcceptedPickerValues.get(s):typeof p=="string"&&(v=`${s.prefix}${p}`)}typeof v=="string"&&(t=v)}const d=(A=a==null?void 0:a.picker)==null?void 0:A.valueSelection,u=(m=a==null?void 0:a.picker)==null?void 0:m.value,h=new Pt,f=h.add(this.quickInputService.createQuickPick({useSeparators:!0}));f.value=t,this.adjustValueSelection(f,s,r),f.placeholder=(r==null?void 0:r.placeholder)??(s==null?void 0:s.placeholder),f.quickNavigate=r==null?void 0:r.quickNavigateConfiguration,f.hideInput=!!f.quickNavigate&&!a,(typeof(r==null?void 0:r.itemActivation)=="number"||r!=null&&r.quickNavigateConfiguration)&&(f.itemActivation=(r==null?void 0:r.itemActivation)??Rb.SECOND),f.contextKey=s==null?void 0:s.contextKey,f.filterValue=v=>v.substring(s?s.prefix.length:0);let g;n&&(g=new FM,h.add(un.once(f.onWillAccept)(v=>{v.veto(),f.hide()}))),h.add(this.registerPickerListeners(f,o,s,t,r));const k=h.add(new Ya);if(o&&h.add(o.provide(f,k.token,r==null?void 0:r.providerOptions)),un.once(f.onDidHide)(()=>{f.selectedItems.length===0&&k.cancel(),h.dispose(),g==null||g.complete(f.selectedItems.slice(0))}),f.show(),d&&u===t&&(f.valueSelection=d),n)return g==null?void 0:g.p}adjustValueSelection(t,n,r){let o;r!=null&&r.preserveValue?o=[t.value.length,t.value.length]:o=[(n==null?void 0:n.prefix.length)??0,t.value.length],t.valueSelection=o}registerPickerListeners(t,n,r,o,s){const a=new Pt,l=this.visibleQuickAccess={picker:t,descriptor:r,value:o};return a.add(Gn(()=>{l===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),a.add(t.onDidChangeValue(d=>{const[u]=this.getOrInstantiateProvider(d,s==null?void 0:s.enabledProviderPrefixes);u!==n?this.show(d,{enabledProviderPrefixes:s==null?void 0:s.enabledProviderPrefixes,preserveValue:!0,providerOptions:s==null?void 0:s.providerOptions}):l.value=d})),r&&a.add(t.onDidAccept(()=>{this.lastAcceptedPickerValues.set(r,t.value)})),a}getOrInstantiateProvider(t,n){const r=this.registry.getQuickAccessProvider(t);if(!r||n&&!(n!=null&&n.includes(r.prefix)))return[void 0,void 0];let o=this.mapProviderToDescriptor.get(r);return o||(o=this.instantiationService.createInstance(r.ctor),this.mapProviderToDescriptor.set(r,o)),[o,r]}};zYe=ZFo([h8t(0,UA),h8t(1,$n)],zYe);var YFo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};class PIn{constructor(t){this.nodes=t}toString(){return this.nodes.map(t=>typeof t=="string"?t:t.label).join("")}}YFo([bc],PIn.prototype,"toString",null);const XFo=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function qFo(e){const t=[];let n=0,r;for(;r=XFo.exec(e);){r.index-n>0&&t.push(e.substring(n,r.index));const[,o,s,,a]=r;a?t.push({label:o,href:s,title:a}):t.push({label:o,href:s}),n=r.index+r[0].length}return n{uco(k)&&Bo.stop(k,!0),n.callback(s.href)},u=n.disposables.add(new ms(l,cn.CLICK)).event,h=n.disposables.add(new ms(l,cn.KEY_DOWN)).event,f=un.chain(h,k=>k.filter(A=>{const m=new Hs(A);return m.equals(10)||m.equals(3)}));n.disposables.add(NA.addTarget(l));const g=n.disposables.add(new ms(l,pa.Tap)).event;un.any(u,g,f)(d,null,n.disposables),t.appendChild(l)}}var _Fo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},A8t=function(e,t){return function(n,r){t(n,r,e)}};const MIn="inQuickInput",$Fo=new Ln(MIn,!1,j(1748,"Whether keyboard focus is inside the quick input control")),f3e=zt.has(MIn),ePo="quickInputAlignment",tPo=new Ln(ePo,"top",j(1749,"The alignment of the quick input")),jee="quickInputType",nPo=new Ln(jee,void 0,j(1750,"The type of the currently visible quick input")),RIn="cursorAtEndOfQuickInputBox",iPo=new Ln(RIn,!1,j(1751,"Whether the cursor in the quick input is at the end of the input box")),rPo=zt.has(RIn),ZYe={iconClass:mi.asClassName(Jt.quickInputBack),tooltip:j(1752,"Back")},Ape=class Ape extends ct{constructor(t){super(),this.ui=t,this._visible=Bi("visible",!1),this._widgetUpdated=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=Ape.noPromptMessage,this._severity=Dl.Ignore,this.onDidTriggerButtonEmitter=this._register(new it),this.onDidHideEmitter=this._register(new it),this.onWillHideEmitter=this._register(new it),this.onDisposeEmitter=this._register(new it),this.visibleDisposables=this._register(new Pt),this.onDidHide=this.onDidHideEmitter.event}get visible(){return this._visible.get()}get title(){return this._title}set title(t){this._title=t,this.update()}get description(){return this._description}set description(t){this._description=t,this.update()}get step(){return this._steps}set step(t){this._steps=t,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(t){this._totalSteps=t,this.update()}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this.update()}get contextKey(){return this._contextKey}set contextKey(t){this._contextKey=t,this.update()}get busy(){return this._busy}set busy(t){this._busy=t,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(t){const n=this._ignoreFocusOut!==t&&!h2;this._ignoreFocusOut=t&&!h2,n&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(t){this._leftButtons=t.filter(n=>n===ZYe),this._rightButtons=t.filter(n=>n!==ZYe&&n.location!==c1e.Inline),this._inlineButtons=t.filter(n=>n.location===c1e.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(t){this._toggles=t??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(t){this._validationMessage=t,this.update()}get severity(){return this._severity}set severity(t){this._severity=t,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(t=>{this.buttons.indexOf(t)!==-1&&this.onDidTriggerButtonEmitter.fire(t)})),this.ui.show(this),this._visible.set(!0,void 0),this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(t=eee.Other){this._visible.set(!1,void 0),this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:t})}willHide(t=eee.Other){this.onWillHideEmitter.fire({reason:t})}update(){var o;if(!this.visible)return;const t=this.getTitle();t&&this.ui.title.textContent!==t?this.ui.title.textContent=t:!t&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const n=this.getDescription();if(this.ui.description1.textContent!==n&&(this.ui.description1.textContent=n),this.ui.description2.textContent!==n&&(this.ui.description2.textContent=n),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?Ou(this.ui.widget,this._widget):Ou(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new U1,this.busyDelay.setIfNotSet(()=>{this.visible&&(this.ui.progressBar.infinite(),this.ui.progressBar.getContainer().removeAttribute("aria-hidden"))},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.ui.progressBar.getContainer().setAttribute("aria-hidden","true"),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const s=this._leftButtons.map((d,u)=>kW(d,`id-${u}`,async()=>this.onDidTriggerButtonEmitter.fire(d)));this.ui.leftActionBar.push(s,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this._rightButtons.map((d,u)=>kW(d,`id-${u}`,async()=>this.onDidTriggerButtonEmitter.fire(d)));this.ui.rightActionBar.push(a,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const l=this._inlineButtons.map((d,u)=>kW(d,`id-${u}`,async()=>this.onDidTriggerButtonEmitter.fire(d)));this.ui.inlineActionBar.push(l,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=((o=this.toggles)==null?void 0:o.filter(l=>l instanceof F6))??[];this.ui.inputBox.toggles=s;const a=s.length*22;this.ui.countContainer.style.right=a>0?`${4+a}px`:"4px",this.ui.visibleCountContainer.style.right=a>0?`${4+a}px`:"4px"}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const r=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==r&&(this._lastValidationMessage=r,Ou(this.ui.message),r&&JFo(r,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?j(1754,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(t){if(this.ui.inputBox.showDecoration(t),t!==Dl.Ignore){const n=this.ui.inputBox.stylesForType(t);this.ui.message.style.color=n.foreground?`${n.foreground}`:"",this.ui.message.style.backgroundColor=n.background?`${n.background}`:"",this.ui.message.style.border=n.border?`1px solid ${n.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}};Ape.noPromptMessage=j(1753,"Press 'Enter' to confirm your input or 'Escape' to cancel");let Wee=Ape;const fpe=class fpe extends Wee{constructor(t){super(t),this._value="",this.onDidChangeValueEmitter=this._register(new it),this.onWillAcceptEmitter=this._register(new it),this.onDidAcceptEmitter=this._register(new it),this.onDidCustomEmitter=this._register(new it),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=Rb.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new it),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new it),this.onDidTriggerItemButtonEmitter=this._register(new it),this.onDidTriggerSeparatorButtonEmitter=this._register(new it),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new Vie,this.type="quickPick",this.filterValue=n=>n,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event,this.noValidationMessage=void 0}get quickNavigate(){return this._quickNavigate}set quickNavigate(t){this._quickNavigate=t,this.update()}get value(){return this._value}set value(t){this.doSetValue(t)}doSetValue(t,n){this._value!==t&&(this._value=t,n||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(t){this._ariaLabel=t,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.update()}get prompt(){return this.noValidationMessage}set prompt(t){this.noValidationMessage=t,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(t){this.ui.list.scrollTop=t}set items(t){this._items=t,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(t){this._canSelectMany=t,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(t){this._canAcceptInBackground=t}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(t){this._matchOnDescription=t,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(t){this._matchOnDetail=t,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(t){this._matchOnLabel=t,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(t){this._matchOnLabelMode=t,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(t){this._sortByLabel=t,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(t){this._keepScrollPosition=t}get itemActivation(){return this._itemActivation}set itemActivation(t){this._itemActivation=t}get activeItems(){return this._activeItems}set activeItems(t){this._activeItems=t,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(t){this._selectedItems=t,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?j3o:this.ui.keyMods}get valueSelection(){const t=this.ui.inputBox.getSelection();if(t)return[t.start,t.end]}set valueSelection(t){this._valueSelection=t,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(t){this._customButton=t,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(t){this._customButtonLabel=t,this.update()}get customHover(){return this._customButtonHover}set customHover(t){this._customButtonHover=t,this.update()}get ok(){return this._ok}set ok(t){this._ok=t,this.update()}get okLabel(){return this._okLabel??j(1756,"OK")}set okLabel(t){this._okLabel=t,this.update()}get hideInput(){return!!this._hideInput}set hideInput(t){this._hideInput=t,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(Da.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(t=>{this.doSetValue(t,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(t,n)=>n)(t=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&za(t,this._activeItems,(n,r)=>n===r)||(this._activeItems=t,this.onDidChangeActiveEmitter.fire(t))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:t,event:n})=>{if(this.canSelectMany&&!t.some(r=>r.pickable===!1)){t.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&za(t,this._selectedItems,(r,o)=>r===o)||(this._selectedItems=t,this.onDidChangeSelectionEmitter.fire(t),t.length&&this.handleAccept(Ret(n)&&n.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(t=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&za(t,this._selectedItems,(n,r)=>n===r)||(this._selectedItems=t,this.onDidChangeSelectionEmitter.fire(t))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(t=>this.onDidTriggerItemButtonEmitter.fire(t))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(t=>this.onDidTriggerSeparatorButtonEmitter.fire(t))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(t){let n=!1;this.onWillAcceptEmitter.fire({veto:()=>n=!0}),n||this.onDidAcceptEmitter.fire({inBackground:t})}registerQuickNavigation(){return pt(this.ui.container,cn.KEY_UP,t=>{if(this.canSelectMany||!this._quickNavigate)return;const n=new Hs(t),r=n.keyCode;this._quickNavigate.keybindings.some(a=>{const l=a.getChords();return l.length>1?!1:l[0].shiftKey&&r===4?!(n.ctrlKey||n.altKey||n.metaKey):!!(l[0].altKey&&r===6||l[0].ctrlKey&&r===5||l[0].metaKey&&r===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const t=this.keepScrollPosition?this.scrollTop:0,n=!!this.description,r={title:!!this.title||!!this.step||!!this.titleButtons.length,description:n,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||n,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage||!!this.prompt,customButton:this.customButton};this.ui.setVisibilities(r),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let o=this.ariaLabel;!o&&r.inputBox&&(o=this.placeholder,this.title&&(o=o?`${o} - ${this.title}`:this.title),o||(o=fpe.DEFAULT_ARIA_LABEL)),this.ui.list.ariaLabel!==o&&(this.ui.list.ariaLabel=o??null),this.ui.inputBox.ariaLabel!==o&&(this.ui.inputBox.ariaLabel=o??"input"),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case Rb.NONE:this._itemActivation=Rb.FIRST;break;case Rb.SECOND:this.ui.list.focus(Da.Second),this._itemActivation=Rb.FIRST;break;case Rb.LAST:this.ui.list.focus(Da.Last),this._itemActivation=Rb.FIRST;break;default:this.trySelectFirst();break}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.ok.label=this.okLabel||"",this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",r.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Da.First)),this.keepScrollPosition&&(this.scrollTop=t)}focus(t){this.ui.list.focus(t),this.canSelectMany&&this.ui.list.domFocus()}accept(t){t&&!this._canAcceptInBackground||(this.activeItems[0]&&!this._canSelectMany&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(t??!1))}};fpe.DEFAULT_ARIA_LABEL=j(1755,"Type to narrow down results.");let hJ=fpe;class oPo extends Wee{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new it),this.onDidAcceptEmitter=this._register(new it),this.type="inputBox",this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(t){this._value=t||"",this.update()}get valueSelection(){const t=this.ui.inputBox.getSelection();if(t)return[t.start,t.end]}set valueSelection(t){this._valueSelection=t,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.update()}get ariaLabel(){return this._ariaLabel}set ariaLabel(t){this._ariaLabel=t,this.update()}get password(){return this._password}set password(t){this._password=t,this.update()}get prompt(){return this._prompt}set prompt(t){this._prompt=t,this.noValidationMessage=t?j(1757,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",t):Wee.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(t=>{t!==this.value&&(this._value=t,this.onDidValueChangeEmitter.fire(t))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}accept(){this.onDidAcceptEmitter.fire()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const t={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(t),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password);let n=this.ariaLabel;!n&&t.inputBox&&(n=this.placeholder?this.title?`${this.placeholder} - ${this.title}`:this.placeholder:this.title?this.title:"input"),this.ui.inputBox.ariaLabel!==n&&(this.ui.inputBox.ariaLabel=n||"input")}}let YYe=class extends BV{constructor(t,n){super("mouse",void 0,r=>this.getOverrideOptions(r),t,n)}getOverrideOptions(t){const n=(oc(t.content)?t.content.textContent??"":typeof t.content=="string"?t.content:t.content.value).includes(` `);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:n,skipFadeInAnimation:!0}}}};YYe=_Fo([A8t(0,cr),A8t(1,Lg)],YYe);const f8t="done",g8t="active",DSe="infinite",QSe="infinite-long-running",m8t="discrete",gpe=class gpe extends ct{constructor(t,n){super(),this.progressSignal=this._register(new is),this.workedVal=0,this.showDelayedScheduler=this._register(new Ss(()=>O1(this.element),0)),this.longRunningScheduler=this._register(new Ss(()=>this.infiniteLongRunning(),gpe.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(t,n)}create(t,n){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),t.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(n==null?void 0:n.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(g8t,DSe,QSe,m8t),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(t){return this.element.classList.add(f8t),this.element.classList.contains(DSe)?(this.bit.style.opacity="0",t?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",t?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(m8t,f8t,QSe),this.element.classList.add(g8t,DSe),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(QSe)}getContainer(){return this.element}};gpe.LONG_RUNNING_INFINITE_THRESHOLD=1e4;let XYe=gpe;const sPo=ln;class aPo extends ct{constructor(t,n,r){super(),this.parent=t,this.onDidChange=s=>this.findInput.onDidChange(s),this.container=tn(this.parent,sPo(".quick-input-box")),this.findInput=this._register(new IPn(this.container,void 0,{label:"",inputBoxStyles:n,toggleStyles:r}));const o=this.findInput.inputBox.inputElement;o.role="textbox",o.ariaHasPopup="menu",o.ariaAutoComplete="list"}get onKeyDown(){return this.findInput.onKeyDown}get value(){return this.findInput.getValue()}set value(t){this.findInput.setValue(t)}select(t=null){this.findInput.inputBox.select(t)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(t){this.findInput.inputBox.setPlaceHolder(t)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(t){this.findInput.inputBox.inputElement.type=t?"password":"text"}set enabled(t){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!t)}set toggles(t){this.findInput.setAdditionalToggles(t)}get ariaLabel(){return this.findInput.inputBox.inputElement.getAttribute("aria-label")||""}set ariaLabel(t){this.findInput.inputBox.inputElement.setAttribute("aria-label",t)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(t,n){this.findInput.inputBox.inputElement.setAttribute(t,n)}removeAttribute(t){this.findInput.inputBox.inputElement.removeAttribute(t)}showDecoration(t){t===Dl.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:t===Dl.Info?1:t===Dl.Warning?2:3,content:""})}stylesForType(t){return this.findInput.inputBox.stylesForType(t===Dl.Info?1:t===Dl.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const k8t=new Kh(()=>{const e=IM.Collator(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}});new Kh(()=>({collator:IM.Collator(void 0,{numeric:!0}).value}));new Kh(()=>({collator:IM.Collator(void 0,{numeric:!0,sensitivity:"accent"}).value}));function lPo(e,t,n=!1){const r=e||"",o=t||"",s=k8t.value.collator.compare(r,o);return k8t.value.collatorIsNumeric&&s===0&&r!==o?ro.length)return 1}return 0}var g3e=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},qYe=function(e,t){return function(n,r){t(n,r,e)}},GYe;const V3=ln;class IIn{constructor(t,n,r){this.index=t,this.hasCheckbox=n,this._hidden=!1,this._init=new Kh(()=>{const o=r.label??"",s=LQ(o).text.trim(),a=r.ariaLabel||[o,this.saneDescription,this.saneDetail].map(l=>TBn(l)).filter(l=>!!l).join(", ");return{saneLabel:o,saneSortLabel:s,saneAriaLabel:a}}),this._saneDescription=r.description,this._saneTooltip=r.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(t){this._element=t}get hidden(){return this._hidden}set hidden(t){this._hidden=t}get saneDescription(){return this._saneDescription}set saneDescription(t){this._saneDescription=t}get saneDetail(){return this._saneDetail}set saneDetail(t){this._saneDetail=t}get saneTooltip(){return this._saneTooltip}set saneTooltip(t){this._saneTooltip=t}get labelHighlights(){return this._labelHighlights}set labelHighlights(t){this._labelHighlights=t}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(t){this._descriptionHighlights=t}get detailHighlights(){return this._detailHighlights}set detailHighlights(t){this._detailHighlights=t}}class Qh extends IIn{constructor(t,n,r,o,s,a,l){var d,u,h;super(t,r,a),this.childIndex=n,this.fireButtonTriggered=o,this._onChecked=s,this.item=a,this._separator=l,this._checked=!1,this.onChecked=r?un.map(un.filter(this._onChecked.event,f=>f.element===this),f=>f.checked):un.None,this._saneDetail=a.detail,this._labelHighlights=(d=a.highlights)==null?void 0:d.label,this._descriptionHighlights=(u=a.highlights)==null?void 0:u.description,this._detailHighlights=(h=a.highlights)==null?void 0:h.detail}get separator(){return this._separator}set separator(t){this._separator=t}get checked(){return this._checked}set checked(t){t!==this._checked&&(this._checked=t,this._onChecked.fire({element:this,checked:t}))}get checkboxDisabled(){return!!this.item.disabled}}var sw;(function(e){e[e.NONE=0]="NONE",e[e.MOUSE_HOVER=1]="MOUSE_HOVER",e[e.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(sw||(sw={}));class fD extends IIn{constructor(t,n,r){super(t,!1,r),this.fireSeparatorButtonTriggered=n,this.separator=r,this.children=new Array,this.focusInsideSeparator=sw.NONE}}class uPo{getHeight(t){return t instanceof fD?30:t.saneDetail?44:22}getTemplateId(t){return t instanceof Qh?Y0e.ID:X0e.ID}}class hPo{getWidgetAriaLabel(){return j(1770,"Quick Input")}getAriaLabel(t){var n;return(n=t.separator)!=null&&n.label?`${t.saneAriaLabel}, ${t.separator.label}`:t.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(t){return t.hasCheckbox?"checkbox":"option"}isChecked(t){if(!(!t.hasCheckbox||!(t instanceof Qh)))return{get value(){return t.checked},onDidChange:n=>t.onChecked(()=>n())}}}class NIn{constructor(t){this.hoverDelegate=t}renderTemplate(t){const n=Object.create(null);n.toDisposeElement=new Pt,n.toDisposeTemplate=new Pt,n.entry=tn(t,V3(".quick-input-list-entry"));const r=tn(n.entry,V3("label.quick-input-list-label"));n.outerLabel=r,n.checkbox=n.toDisposeTemplate.add(new is),n.toDisposeTemplate.add(Sc(r,cn.CLICK,u=>{if(n.checkbox.value&&!u.defaultPrevented&&n.checkbox.value.enabled){const h=!n.checkbox.value.checked;n.checkbox.value.checked=h,n.element.checked=h}}));const o=tn(r,V3(".quick-input-list-rows")),s=tn(o,V3(".quick-input-list-row")),a=tn(o,V3(".quick-input-list-row"));n.label=new hee(s,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),n.toDisposeTemplate.add(n.label),n.icon=Wbe(n.label.element,V3(".quick-input-list-icon"));const l=tn(s,V3(".quick-input-list-entry-keybinding"));n.keybinding=new LZ(l,x1),n.toDisposeTemplate.add(n.keybinding);const d=tn(a,V3(".quick-input-list-label-meta"));return n.detail=new hee(d,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),n.toDisposeTemplate.add(n.detail),n.separator=tn(n.entry,V3(".quick-input-list-separator")),n.actionBar=new bm(n.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),n.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),n.toDisposeTemplate.add(n.actionBar),n}disposeTemplate(t){t.toDisposeElement.dispose(),t.toDisposeTemplate.dispose()}disposeElement(t,n,r){r.toDisposeElement.clear(),r.actionBar.clear()}}var NF;let Y0e=(NF=class extends NIn{constructor(t,n){super(t),this.themeService=n,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return GYe.ID}ensureCheckbox(t,n){var o;if(!t.hasCheckbox){(o=n.checkbox.value)==null||o.domNode.remove(),n.checkbox.clear();return}let r=n.checkbox.value;r?r.setTitle(t.saneLabel):(r=new EPn(t.saneLabel,t.checked,{...gnt,size:15}),n.checkbox.value=r,n.outerLabel.prepend(r.domNode)),t.checkboxDisabled?r.disable():r.enable(),r.checked=t.checked,n.toDisposeElement.add(t.onChecked(s=>r.checked=s)),n.toDisposeElement.add(r.onChange(()=>t.checked=r.checked))}renderElement(t,n,r){var g;const o=t.element;r.element=o,o.element=r.entry??void 0;const s=o.item;o.element.classList.toggle("not-pickable",o.item.pickable===!1),this.ensureCheckbox(o,r);const{labelHighlights:a,descriptionHighlights:l,detailHighlights:d}=o;if(s.iconPath){const k=_8(this.themeService.getColorTheme().type)?s.iconPath.dark:s.iconPath.light??s.iconPath.dark,A=pi.revive(k);r.icon.className="quick-input-list-icon",r.icon.style.backgroundImage=Uy(A)}else r.icon.style.backgroundImage="",r.icon.className=s.iconClass?`quick-input-list-icon ${s.iconClass}`:"";let u;!o.saneTooltip&&o.saneDescription&&(u={markdown:{value:_p(o.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:o.saneDescription});const h={matches:a||[],descriptionTitle:u,descriptionMatches:l||[],labelEscapeNewLines:!0};if(h.extraClasses=s.iconClasses,h.italic=s.italic,h.strikethrough=s.strikethrough,r.entry.classList.remove("quick-input-list-separator-as-item"),r.label.setLabel(o.saneLabel,o.saneDescription,h),r.keybinding.set(s.keybinding),o.saneDetail){let k;o.saneTooltip||(k={markdown:{value:_p(o.saneDetail),supportThemeIcons:!0},markdownNotSupportedFallback:o.saneDetail}),r.detail.element.style.display="",r.detail.setLabel(o.saneDetail,void 0,{matches:d,title:k,labelEscapeNewLines:!0})}else r.detail.element.style.display="none";(g=o.separator)!=null&&g.label?(r.separator.textContent=o.separator.label,r.separator.style.display="",this.addItemWithSeparator(o)):r.separator.style.display="none",r.entry.classList.toggle("quick-input-list-separator-border",!!o.separator&&o.childIndex!==0);const f=s.buttons;f&&f.length?(r.actionBar.push(f.map((k,A)=>kW(k,`id-${A}`,()=>o.fireButtonTriggered({button:k,item:o.item}))),{icon:!0,label:!1}),r.entry.classList.add("has-actions")):r.entry.classList.remove("has-actions")}disposeElement(t,n,r){this.removeItemWithSeparator(t.element),super.disposeElement(t,n,r)}isItemWithSeparatorVisible(t){return this._itemsWithSeparatorsFrequency.has(t)}addItemWithSeparator(t){this._itemsWithSeparatorsFrequency.set(t,(this._itemsWithSeparatorsFrequency.get(t)||0)+1)}removeItemWithSeparator(t){const n=this._itemsWithSeparatorsFrequency.get(t)||0;n>1?this._itemsWithSeparatorsFrequency.set(t,n-1):this._itemsWithSeparatorsFrequency.delete(t)}},GYe=NF,NF.ID="quickpickitem",NF);Y0e=GYe=g3e([qYe(1,Il)],Y0e);const mpe=class mpe extends NIn{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return mpe.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(t){return this._visibleSeparatorsFrequency.has(t)}renderElement(t,n,r){const o=t.element;r.element=o,o.element=r.entry??void 0,o.element.classList.toggle("focus-inside",!!o.focusInsideSeparator);const s=o.separator,{labelHighlights:a,descriptionHighlights:l}=o;r.icon.style.backgroundImage="",r.icon.className="";let d;!o.saneTooltip&&o.saneDescription&&(d={markdown:{value:_p(o.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:o.saneDescription});const u={matches:a||[],descriptionTitle:d,descriptionMatches:l||[],labelEscapeNewLines:!0};r.entry.classList.add("quick-input-list-separator-as-item"),r.label.setLabel(o.saneLabel,o.saneDescription,u),r.separator.style.display="none",r.entry.classList.add("quick-input-list-separator-border");const h=s.buttons;h&&h.length?(r.actionBar.push(h.map((f,g)=>kW(f,`id-${g}`,()=>o.fireSeparatorButtonTriggered({button:f,separator:o.separator}))),{icon:!0,label:!1}),r.entry.classList.add("has-actions")):r.entry.classList.remove("has-actions"),this.addSeparator(o)}disposeElement(t,n,r){var o;this.removeSeparator(t.element),this.isSeparatorVisible(t.element)||(o=t.element.element)==null||o.classList.remove("focus-inside"),super.disposeElement(t,n,r)}addSeparator(t){this._visibleSeparatorsFrequency.set(t,(this._visibleSeparatorsFrequency.get(t)||0)+1)}removeSeparator(t){const n=this._visibleSeparatorsFrequency.get(t)||0;n>1?this._visibleSeparatorsFrequency.set(t,n-1):this._visibleSeparatorsFrequency.delete(t)}};mpe.ID="quickpickseparator";let X0e=mpe,Hee=class extends ct{constructor(t,n,r,o,s,a){super(),this.parent=t,this.hoverDelegate=n,this.linkOpenerDelegate=r,this.accessibilityService=a,this._onKeyDown=new it,this._onLeave=new it,this.onLeave=this._onLeave.event,this._visibleCountObservable=Bi("VisibleCount",0),this.onChangedVisibleCount=un.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=Bi("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=un.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=Bi("CheckedCount",0),this.onChangedCheckedCount=un.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=UK({equalsFn:za},new Array),this.onChangedCheckedElements=un.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new it,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new it,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new it,this._elementCheckedEventBufferer=new Vie,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new Pt),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._shouldLoop=!0,this._container=tn(this.parent,V3(".quick-input-list")),this._separatorRenderer=new X0e(n),this._itemRenderer=s.createInstance(Y0e,n),this._tree=this._register(s.createInstance(F1e,"QuickInput",this._container,new uPo,[this._itemRenderer,this._separatorRenderer],{filter:{filter(l){return l.hidden?0:l instanceof fD?2:1}},sorter:{compare:(l,d)=>{if(!this.sortByLabel||!this._lastQueryString)return 0;const u=this._lastQueryString.toLowerCase();return fPo(l,d,u)}},accessibilityProvider:new hPo,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:HP.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=o,this._registerListeners()}get onDidChangeFocus(){return un.map(this._tree.onDidChangeFocus,t=>t.elements.filter(n=>n instanceof Qh).map(n=>n.item),this._store)}get onDidChangeSelection(){return un.map(this._tree.onDidChangeSelection,t=>({items:t.elements.filter(n=>n instanceof Qh).map(n=>n.item),event:t.browserEvent}),this._store)}get displayed(){return this._container.style.display!=="none"}set displayed(t){this._container.style.display=t?"":"none"}get scrollTop(){return this._tree.scrollTop}set scrollTop(t){this._tree.scrollTop=t}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(t){this._tree.ariaLabel=t??""}set enabled(t){this._tree.getHTMLElement().style.pointerEvents=t?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(t){this._matchOnDescription=t}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(t){this._matchOnDetail=t}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(t){this._matchOnLabel=t}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(t){this._matchOnLabelMode=t}get sortByLabel(){return this._sortByLabel}set sortByLabel(t){this._sortByLabel=t}get shouldLoop(){return this._shouldLoop}set shouldLoop(t){this._shouldLoop=t}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(t=>{const n=new Hs(t);switch(n.keyCode){case 10:this.toggleCheckbox();break}this._onKeyDown.fire(n)}))}_registerOnContainerClick(){this._register(pt(this._container,cn.CLICK,t=>{(t.x||t.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(pt(this._container,cn.AUXCLICK,t=>{t.button===1&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{const t=this._itemElements.filter(n=>!n.hidden).length;this._visibleCountObservable.set(t,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(t,n)=>n)(t=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(t=>{t.element&&(t.browserEvent.preventDefault(),this._tree.setSelection([t.element]))}))}_registerHoverListeners(){const t=this._register(new ZEn(typeof this.hoverDelegate.delay=="function"?this.hoverDelegate.delay():this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async n=>{var r;if(BOt(n.browserEvent.target)){t.cancel();return}if(!(!BOt(n.browserEvent.relatedTarget)&&bu(n.browserEvent.relatedTarget,(r=n.element)==null?void 0:r.element)))try{await t.trigger(async()=>{n.element instanceof Qh&&this.showHover(n.element)})}catch(o){if(!Sk(o))throw o}})),this._register(this._tree.onMouseOut(n=>{var r;bu(n.browserEvent.relatedTarget,(r=n.element)==null?void 0:r.element)||t.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(t=>{const n=t.elements[0]?this._tree.getParentElement(t.elements[0]):null;for(const r of this._separatorRenderer.visibleSeparators){const o=r===n;!!(r.focusInsideSeparator&sw.ACTIVE_ITEM)!==o&&(o?r.focusInsideSeparator|=sw.ACTIVE_ITEM:r.focusInsideSeparator&=~sw.ACTIVE_ITEM,this._tree.rerender(r))}})),this._register(this._tree.onMouseOver(t=>{const n=t.element?this._tree.getParentElement(t.element):null;for(const r of this._separatorRenderer.visibleSeparators){if(r!==n)continue;!!(r.focusInsideSeparator&sw.MOUSE_HOVER)||(r.focusInsideSeparator|=sw.MOUSE_HOVER,this._tree.rerender(r))}})),this._register(this._tree.onMouseOut(t=>{const n=t.element?this._tree.getParentElement(t.element):null;for(const r of this._separatorRenderer.visibleSeparators){if(r!==n)continue;!!(r.focusInsideSeparator&sw.MOUSE_HOVER)&&(r.focusInsideSeparator&=~sw.MOUSE_HOVER,this._tree.rerender(r))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(t=>{const n=t.elements.filter(r=>r instanceof Qh);n.length!==t.elements.length&&(t.elements.length===1&&t.elements[0]instanceof fD&&(this._tree.setFocus([t.elements[0].children[0]]),this._tree.reveal(t.elements[0],0)),this._tree.setSelection(n))}))}setAllVisibleChecked(t){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(n=>{!n.hidden&&!n.checkboxDisabled&&n.item.pickable!==!1&&(n.checked=t)})})}setElements(t){this._elementDisposable.clear(),this._lastQueryString=void 0,this._inputElements=t,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes");let n;this._itemElements=new Array,this._elementTree=t.reduce((r,o,s)=>{let a;if(o.type==="separator"){if(!o.buttons)return r;n=new fD(s,l=>this._onSeparatorButtonTriggered.fire(l),o),a=n}else{const l=s>0?t[s-1]:void 0;let d;l&&l.type==="separator"&&!l.buttons&&(d=l);const u=new Qh(s,n!=null&&n.children?n.children.length:s,this._hasCheckboxes&&o.pickable!==!1,h=>this._onButtonTriggered.fire(h),this._elementChecked,o,d);if(this._itemElements.push(u),n)return n.children.push(u),r;a=u}return r.push(a),r},new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const r=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),o=r==null?void 0:r.parentNode;if(r&&o){const s=r.nextSibling;r.remove(),o.insertBefore(r,s)}},0)}setFocusedElements(t){const n=t.map(r=>this._itemElements.find(o=>o.item===r)).filter(r=>!!r).filter(r=>!r.hidden);if(this._tree.setFocus(n),t.length>0){const r=this._tree.getFocus()[0];r&&this._tree.reveal(r)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(t){const n=t.map(r=>this._itemElements.find(o=>o.item===r)).filter(r=>!!r);this._tree.setSelection(n)}getCheckedElements(){return this._itemElements.filter(t=>t.checked).map(t=>t.item)}setCheckedElements(t){this._elementCheckedEventBufferer.bufferEvents(()=>{const n=new Set;for(const r of t)n.add(r);for(const r of this._itemElements)r.checked=n.has(r.item)})}focus(t){var n;if(this._itemElements.length)switch(t===Da.Second&&this._itemElements.length<2&&(t=Da.First),t){case Da.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,r=>r.element instanceof Qh);break;case Da.Second:{this._tree.scrollTop=0;let r=!1;this._tree.focusFirst(void 0,o=>o.element instanceof Qh?r?!0:(r=!r,!1):!1);break}case Da.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,r=>r.element instanceof Qh);break;case Da.Next:{const r=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,s=>s.element instanceof Qh?(this._tree.reveal(s.element),!0):!1);const o=this._tree.getFocus();r.length&&r[0]===o[0]&&this._onLeave.fire();break}case Da.Previous:{const r=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,s=>{if(!(s.element instanceof Qh))return!1;const a=this._tree.getParentElement(s.element);return a===null||a.children[0]!==s.element?this._tree.reveal(s.element):this._tree.reveal(a),!0});const o=this._tree.getFocus();r.length&&r[0]===o[0]&&this._onLeave.fire();break}case Da.NextPage:this._tree.focusNextPage(void 0,r=>r.element instanceof Qh?(this._tree.reveal(r.element),!0):!1);break;case Da.PreviousPage:this._tree.focusPreviousPage(void 0,r=>{if(!(r.element instanceof Qh))return!1;const o=this._tree.getParentElement(r.element);return o===null||o.children[0]!==r.element?this._tree.reveal(r.element):this._tree.reveal(o),!0});break;case Da.NextSeparator:{let r=!1;const o=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,a=>{if(r)return!0;if(a.element instanceof fD)r=!0,this._separatorRenderer.isSeparatorVisible(a.element)?this._tree.reveal(a.element.children[0]):this._tree.reveal(a.element,0);else if(a.element instanceof Qh){if(a.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(a.element)?this._tree.reveal(a.element):this._tree.reveal(a.element,0),!0;if(a.element===this._elementTree[0])return this._tree.reveal(a.element,0),!0}return!1});const s=this._tree.getFocus()[0];o===s&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,a=>a.element instanceof Qh));break}case Da.PreviousSeparator:{let r,o=!!((n=this._tree.getFocus()[0])!=null&&n.separator);this._tree.focusPrevious(void 0,!0,void 0,s=>{if(s.element instanceof fD)o?r||(this._separatorRenderer.isSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),r=s.element.children[0]):o=!0;else if(s.element instanceof Qh&&!r){if(s.element.separator)this._itemRenderer.isItemWithSeparatorVisible(s.element)?this._tree.reveal(s.element):this._tree.reveal(s.element,0),r=s.element;else if(s.element===this._elementTree[0])return this._tree.reveal(s.element,0),!0}return!1}),r&&this._tree.setFocus([r]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(t){this._tree.getHTMLElement().style.maxHeight=t?`${Math.floor(t/44)*44+6}px`:"",this._tree.layout()}filter(t){if(this._lastQueryString=t,!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const n=t;if(t=t.trim(),!t||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(r=>{r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=!1;const o=r.index&&this._inputElements[r.index-1];r.item&&(r.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let r;this._itemElements.forEach(o=>{let s;this.matchOnLabelMode==="fuzzy"?s=this.matchOnLabel?zK(t,LQ(o.saneLabel))??void 0:void 0:s=this.matchOnLabel?APo(n,LQ(o.saneLabel))??void 0:void 0;const a=this.matchOnDescription?zK(t,LQ(o.saneDescription||""))??void 0:void 0,l=this.matchOnDetail?zK(t,LQ(o.saneDetail||""))??void 0:void 0;if(s||a||l?(o.labelHighlights=s,o.descriptionHighlights=a,o.detailHighlights=l,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const d=o.index&&this._inputElements[o.index-1]||void 0;(d==null?void 0:d.type)==="separator"&&!d.buttons&&(r=d),r&&!o.hidden&&(o.separator=r,r=void 0)}})}return this._setElementsToTree(this._sortByLabel&&t?this._itemElements:this._elementTree),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const t=this._tree.getFocus().filter(r=>r instanceof Qh),n=this._allVisibleChecked(t);for(const r of t)r.checkboxDisabled||(r.checked=!n)})}style(t){this._tree.style(t)}toggleHover(){const t=this._tree.getFocus()[0];if(!(t!=null&&t.saneTooltip)||!(t instanceof Qh))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(t);const n=new Pt;n.add(this._tree.onDidChangeFocus(r=>{r.elements[0]instanceof Qh&&this.showHover(r.elements[0])})),this._lastHover&&n.add(this._lastHover),this._elementDisposable.add(n)}_setElementsToTree(t){const n=new Array;for(const r of t)r instanceof fD?n.push({element:r,collapsible:!1,collapsed:!1,children:r.children.map(o=>({element:o,collapsible:!1,collapsed:!1}))}):n.push({element:r,collapsible:!1,collapsed:!1});this._tree.setChildren(null,n)}_allVisibleChecked(t,n=!0){for(let r=0,o=t.length;r{this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements,!1),t);const n=this._itemElements.filter(r=>r.checked).length;this._checkedCountObservable.set(n,t),this._checkedElementsObservable.set(this.getCheckedElements(),t)})}showHover(t){var n,r,o;this._lastHover&&!this._lastHover.isDisposed&&((r=(n=this.hoverDelegate).onDidHideHover)==null||r.call(n),(o=this._lastHover)==null||o.dispose()),!(!t.element||!t.saneTooltip)&&(this._lastHover=this.hoverDelegate.showHover({content:t.saneTooltip,target:t.element,linkHandler:s=>{this.linkOpenerDelegate(s)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};g3e([bc],Hee.prototype,"onDidChangeFocus",null);g3e([bc],Hee.prototype,"onDidChangeSelection",null);Hee=g3e([qYe(4,$n),qYe(5,xh)],Hee);function APo(e,t){const{text:n,iconOffsets:r}=t;if(!r||r.length===0)return v8t(e,n);const o=zie(n," "),s=n.length-o.length,a=v8t(e,o);if(a)for(const l of a){const d=r[l.start+s]+s;l.start+=d,l.end+=d}return a}function v8t(e,t){const n=t.toLowerCase().indexOf(e.toLowerCase());return n!==-1?[{start:n,end:n+e.length}]:null}function fPo(e,t,n){const r=e.labelHighlights||[],o=t.labelHighlights||[];return r.length&&!o.length?-1:!r.length&&o.length?1:r.length===0&&o.length===0?0:cPo(e.saneSortLabel,t.saneSortLabel,n)}function gPo(e,t={}){Zu.registerCommandAndKeybindingRule({weight:200,when:f3e,metadata:{description:j(1758,"Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...e,secondary:Xit(e.primary,e.secondary??[],t)})}function rm(e,t={}){Zu.registerCommandAndKeybindingRule({weight:200,when:zt.and(zt.or(zt.equals(jee,"quickPick"),zt.equals(jee,"quickTree")),f3e),metadata:{description:j(1759,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...e,secondary:Xit(e.primary,e.secondary??[],t)})}const Vee=Pr?256:2048;function Xit(e,t,n={}){return n.withAltMod&&t.push(512+e),n.withCtrlMod&&(t.push(Vee+e),n.withAltMod&&t.push(512+Vee+e)),n.withCmdMod&&Pr&&(t.push(2048+e),n.withCtrlMod&&t.push(2304+e),n.withAltMod&&(t.push(2560+e),n.withCtrlMod&&t.push(2816+e))),t}function j0(e,t){return n=>{const r=n.get(UA).currentQuickInput;if(r)return t&&r.quickNavigate?r.focus(t):r.focus(e)}}rm({id:"quickInput.pageNext",primary:12,handler:j0(Da.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});rm({id:"quickInput.pagePrevious",primary:11,handler:j0(Da.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});rm({id:"quickInput.first",primary:Vee+14,handler:j0(Da.First)},{withAltMod:!0,withCmdMod:!0});rm({id:"quickInput.last",primary:Vee+13,handler:j0(Da.Last)},{withAltMod:!0,withCmdMod:!0});rm({id:"quickInput.next",primary:18,handler:j0(Da.Next)},{withCtrlMod:!0});rm({id:"quickInput.previous",primary:16,handler:j0(Da.Previous)},{withCtrlMod:!0});const p8t=j(1760,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),b8t=j(1761,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");Pr?(rm({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:2066,handler:j0(Da.NextSeparator,Da.Next),metadata:{description:p8t}}),rm({id:"quickInput.nextSeparator",primary:2578,secondary:[2322],handler:j0(Da.NextSeparator)},{withCtrlMod:!0}),rm({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:2064,handler:j0(Da.PreviousSeparator,Da.Previous),metadata:{description:b8t}}),rm({id:"quickInput.previousSeparator",primary:2576,secondary:[2320],handler:j0(Da.PreviousSeparator)},{withCtrlMod:!0})):(rm({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:530,handler:j0(Da.NextSeparator,Da.Next),metadata:{description:p8t}}),rm({id:"quickInput.nextSeparator",primary:2578,handler:j0(Da.NextSeparator)}),rm({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:528,handler:j0(Da.PreviousSeparator,Da.Previous),metadata:{description:b8t}}),rm({id:"quickInput.previousSeparator",primary:2576,handler:j0(Da.PreviousSeparator)}));Zu.registerCommandAndKeybindingRule({id:"quickInput.accept",primary:3,weight:200,when:zt.and(zt.notEquals(jee,"quickWidget"),f3e,zt.not("isComposing")),metadata:{description:j(1762,"Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},handler:e=>{const t=e.get(UA).currentQuickInput;t==null||t.accept()},secondary:Xit(3,[],{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0})});rm({id:"quickInput.acceptInBackground",when:zt.and(f3e,zt.equals(jee,"quickPick"),zt.or(Xnt.negate(),rPo)),primary:17,weight:250,handler:e=>{const t=e.get(UA).currentQuickInput;t==null||t.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});gPo({id:"quickInput.hide",primary:9,handler:e=>{const t=e.get(UA).currentQuickInput;t==null||t.hide()}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});rm({id:"quickInput.toggleHover",primary:Vee|10,handler:e=>{e.get(UA).toggleHover()}});var mPo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},kPo=function(e,t){return function(n,r){t(n,r,e)}},KYe;const nq=ln;var UF;let q0e=(UF=class extends ct{constructor(t,n,r,o){super(),this._hoverDelegate=t,this._buttonTriggeredEmitter=n,this.onCheckedEvent=r,this._themeService=o,this.templateId=KYe.ID}renderTemplate(t){const n=new Pt,r=tn(t,nq(".quick-input-tree-entry")),o=n.add(new DPn("",!1,{...gnt,size:15}));r.appendChild(o.domNode);const s=tn(r,nq("label.quick-input-tree-label")),a=tn(s,nq(".quick-input-tree-rows")),l=tn(a,nq(".quick-input-tree-row")),d=Wbe(l,nq(".quick-input-tree-icon")),u=n.add(new hee(l,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this._hoverDelegate})),h=n.add(new bm(r,this._hoverDelegate?{hoverDelegate:this._hoverDelegate}:void 0));return h.domNode.classList.add("quick-input-tree-entry-action-bar"),{toDisposeTemplate:n,entry:r,checkbox:o,icon:d,label:u,actionBar:h,toDisposeElement:new Pt}}renderElement(t,n,r,o){const s=r.toDisposeElement,a=t.element;if(a.pickable===!1?r.checkbox.domNode.style.display="none":(r.checkbox.domNode.style.display="",r.checkbox.checked=a.checked??!1,s.add(un.filter(this.onCheckedEvent,f=>f.item===a)(f=>r.checkbox.checked=f.checked)),a.disabled&&r.checkbox.disable()),a.iconPath){const f=_8(this._themeService.getColorTheme().type)?a.iconPath.dark:a.iconPath.light??a.iconPath.dark,g=pi.revive(f);r.icon.className="quick-input-tree-icon",r.icon.style.backgroundImage=Uy(g)}else r.icon.style.backgroundImage="",r.icon.className=a.iconClass?`quick-input-tree-icon ${a.iconClass}`:"";const{labelHighlights:l,descriptionHighlights:d}=t.filterData||{};let u;a.description&&(u={markdown:{value:_p(a.description),supportThemeIcons:!0},markdownNotSupportedFallback:a.description}),r.label.setLabel(a.label,a.description,{matches:l,descriptionMatches:d,extraClasses:a.iconClasses,italic:a.italic,strikethrough:a.strikethrough,labelEscapeNewLines:!0,descriptionTitle:u});const h=a.buttons;h&&h.length?(r.actionBar.push(h.map((f,g)=>kW(f,`tree-${g}`,()=>this._buttonTriggeredEmitter.fire({item:a,button:f}))),{icon:!0,label:!1}),r.entry.classList.add("has-actions")):r.entry.classList.remove("has-actions")}disposeElement(t,n,r,o){r.toDisposeElement.clear(),r.actionBar.clear()}disposeTemplate(t){t.toDisposeElement.dispose(),t.toDisposeTemplate.dispose()}},KYe=UF,UF.ID="quickInputTreeElement",UF);q0e=KYe=mPo([kPo(3,Il)],q0e);class vPo{getHeight(t){return 22}getTemplateId(t){return q0e.ID}}function pPo(e){var s;let t=!1,n=!1,r=!1;for(const a of e){switch((s=a.element)==null?void 0:s.checked){case"mixed":r=!0;break;case!0:t=!0;break;default:n=!0;break}if(t&&n&&r)break}return n?r||t?"mixed":!1:r?"mixed":t}class bPo{constructor(t){this.onCheckedEvent=t}getWidgetAriaLabel(){return j(1772,"Quick Tree")}getAriaLabel(t){return t.ariaLabel||[t.label,t.description].map(n=>TBn(n)).filter(n=>!!n).join(", ")}getWidgetRole(){return"tree"}getRole(t){return"checkbox"}isChecked(t){return{get value(){return t.checked==="mixed"?"mixed":!!t.checked},onDidChange:n=>un.filter(this.onCheckedEvent,r=>r.item===t)(r=>n())}}}class OPo{constructor(){this.filterValue="",this.matchOnLabel=!0,this.matchOnDescription=!1}filter(t,n){if(!this.filterValue||!(this.matchOnLabel||this.matchOnDescription))return t.children?{visibility:2,data:{}}:{visibility:1,data:{}};const r=this.matchOnLabel?zK(this.filterValue,LQ(t.label))??void 0:void 0,o=this.matchOnDescription?zK(this.filterValue,LQ(t.description||""))??void 0:void 0;return{visibility:n===1||r||o?1:t.children?2:0,data:{labelHighlights:r,descriptionHighlights:o}}}}class wPo extends ct{constructor(){super(...arguments),this._sortByLabel=!0}get sortByLabel(){return this._sortByLabel}set sortByLabel(t){this._sortByLabel=t}compare(t,n){if(!this._sortByLabel)return 0;if(t.labeln.label)return 1;if(t.description&&n.description){if(t.descriptionn.description)return 1}else{if(t.description)return-1;if(n.description)return 1}return 0}}var yPo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},CPo=function(e,t){return function(n,r){t(n,r,e)}};const xPo=ln;let JYe=class extends ct{constructor(t,n,r){super(),this.instantiationService=r,this._onDidTriggerButton=this._register(new it),this._onDidChangeCheckboxState=this._register(new it),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidCheckedLeafItemsChange=this._register(new it),this._onLeave=new it,this.onLeave=this._onLeave.event,this._onDidAccept=this._register(new it),this.onDidAccept=this._onDidAccept.event,this._container=tn(t,xPo(".quick-input-tree")),this._renderer=this._register(this.instantiationService.createInstance(q0e,n,this._onDidTriggerButton,this.onDidChangeCheckboxState)),this._filter=this.instantiationService.createInstance(OPo),this._sorter=this._register(new wPo),this._tree=this._register(this.instantiationService.createInstance(F1e,"QuickInputTree",this._container,new vPo,[this._renderer],{accessibilityProvider:new bPo(this.onDidChangeCheckboxState),horizontalScrolling:!1,multipleSelectionSupport:!1,findWidgetEnabled:!1,alwaysConsumeMouseWheel:!0,hideTwistiesOfChildlessElements:!0,renderIndentGuides:HP.None,expandOnDoubleClick:!0,expandOnlyOnTwistieClick:!0,disableExpandOnSpacebar:!0,sorter:this._sorter,filter:this._filter})),this.registerOnOpenListener()}get tree(){return this._tree}get displayed(){return this._container.style.display!=="none"}set displayed(t){this._container.style.display=t?"":"none"}get sortByLabel(){return this._sorter.sortByLabel}set sortByLabel(t){this._sorter.sortByLabel=t,this._tree.resort(null,!0)}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}updateFilterOptions(t){t.matchOnLabel!==void 0&&(this._filter.matchOnLabel=t.matchOnLabel),t.matchOnDescription!==void 0&&(this._filter.matchOnDescription=t.matchOnDescription),this._tree.refilter()}layout(t){this._tree.getHTMLElement().style.maxHeight=t?`${Math.floor(t/44)*44+6}px`:"",this._tree.layout()}registerOnOpenListener(){this._register(this._tree.onDidOpen(t=>{const n=t.element;if(!n||n.disabled)return;if(n.pickable===!1){this._tree.setFocus([n]),this._onDidAccept.fire();return}const r=n.checked!==!0;if((n.checked??!1)===r)return;n.checked=r,this._tree.rerender(n);const o=new Set,s=[...this._tree.getNode(n).children];for(;s.length;){const l=s.shift();l!=null&&l.element&&!o.has(l.element)&&(o.add(l.element),(l.element.checked??!1)!==n.checked&&(l.element.checked=n.checked,this._tree.rerender(l.element)),s.push(...l.children))}let a=this._tree.getParentElement(n);for(;a;){const l=[...this._tree.getNode(a).children],d=pPo(l);(a.checked??!1)!==d&&(a.checked=d,this._tree.rerender(a)),a=this._tree.getParentElement(a)}this._onDidChangeCheckboxState.fire({item:n,checked:n.checked??!1}),this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems())}))}getCheckedLeafItems(){const t=new Set,n=[...this._tree.getNode().children],r=new Array;for(;n.length;){const o=n.shift();!(o!=null&&o.element)||t.has(o.element)||o.element.checked&&(t.add(o.element),n.push(...o.children),o.element.children||r.push(o.element))}return r}};JYe=yPo([CPo(2,$n)],JYe);var UIn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},MQ=function(e,t){return function(n,r){t(n,r,e)}},_Ye;const v0=ln,BSe="workbench.quickInput.viewState";var jF;let $Ye=(jF=class extends ct{get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(t,n,r,o,s){super(),this.options=t,this.layoutService=n,this.instantiationService=r,this.storageService=s,this.enabled=!0,this.onDidAcceptEmitter=this._register(new it),this.onDidCustomEmitter=this._register(new it),this.onDidTriggerButtonEmitter=this._register(new it),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new it),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new it),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=$Fo.bindTo(o),this.quickInputTypeContext=nPo.bindTo(o),this.endOfQuickInputBoxContext=iPo.bindTo(o),this.idPrefix=t.idPrefix,this._container=t.container,this.styles=t.styles,this._register(un.runAndSubscribe(Xie,({window:a,disposables:l})=>this.registerKeyModsListeners(a,l),{window:Ls,disposables:this._store})),this._register(tco(a=>{this.ui&&oi(this.ui.container)===a&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))})),this.viewState=this.loadViewState()}registerKeyModsListeners(t,n){const r=o=>{this.keyMods.ctrlCmd=o.ctrlKey||o.metaKey,this.keyMods.alt=o.altKey};for(const o of[cn.KEY_DOWN,cn.KEY_UP,cn.MOUSE_DOWN])n.add(pt(t,o,r,!0))}getUI(t){if(this.ui)return t&&oi(this._container)!==oi(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const n=tn(this._container,v0(".quick-input-widget.show-file-icons"));n.tabIndex=-1,n.style.display="none";const r=v2(n),o=tn(n,v0(".quick-input-titlebar")),s=this._register(new bm(o,{hoverDelegate:this.options.hoverDelegate}));s.domNode.classList.add("quick-input-left-action-bar");const a=tn(o,v0(".quick-input-title")),l=this._register(new bm(o,{hoverDelegate:this.options.hoverDelegate}));l.domNode.classList.add("quick-input-right-action-bar");const d=tn(n,v0(".quick-input-header")),u=this._register(new DPn(j(1763,"Toggle all checkboxes"),!1,{...gnt,size:15}));tn(d,u.domNode),this._register(u.onChange(()=>{const P=u.checked;T.setAllVisibleChecked(P===!0)})),this._register(pt(u.domNode,cn.CLICK,P=>{(P.x||P.y)&&k.setFocus()}));const h=tn(d,v0(".quick-input-description")),f=tn(d,v0(".quick-input-and-message")),g=tn(f,v0(".quick-input-filter")),k=this._register(new aPo(g,this.styles.inputBox,this.styles.toggle));k.setAttribute("aria-describedby",`${this.idPrefix}message`);const A=tn(g,v0(".quick-input-visible-count"));A.setAttribute("aria-live","polite"),A.setAttribute("aria-atomic","true");const m=this._register(new UHe(A,{countFormat:j(1764,"{0} Results")},this.styles.countBadge)),v=tn(g,v0(".quick-input-count"));v.setAttribute("aria-live","polite");const p=this._register(new UHe(v,{countFormat:j(1765,"{0} Selected")},this.styles.countBadge)),b=this._register(new bm(d,{hoverDelegate:this.options.hoverDelegate}));b.domNode.classList.add("quick-input-inline-action-bar");const O=tn(d,v0(".quick-input-action")),w=this._register(new h1e(O,this.styles.button));w.label=j(1766,"OK"),this._register(w.onDidClick(P=>{this.onDidAcceptEmitter.fire()}));const y=tn(d,v0(".quick-input-action")),C=this._register(new h1e(y,{...this.styles.button,supportIcons:!0}));C.label=j(1767,"Custom"),this._register(C.onDidClick(P=>{this.onDidCustomEmitter.fire()}));const x=tn(f,v0(`#${this.idPrefix}message.quick-input-message`)),L=this._register(new XYe(n,this.styles.progressBar));L.getContainer().classList.add("quick-input-progress");const S=tn(n,v0(".quick-input-html-widget"));S.tabIndex=-1;const E=tn(n,v0(".quick-input-description")),Q=this.idPrefix+"list",T=this._register(this.instantiationService.createInstance(Hee,n,this.options.hoverDelegate,this.options.linkOpenerDelegate,Q));k.setAttribute("aria-controls",Q),this._register(T.onDidChangeFocus(()=>{k.hasFocus()&&k.setAttribute("aria-activedescendant",T.getActiveDescendant()??"")})),this._register(T.onChangedAllVisibleChecked(P=>{u.checked=P})),this._register(T.onChangedVisibleCount(P=>{m.setCount(P)})),this._register(T.onChangedCheckedCount(P=>{Wie(()=>p.setCount(P))})),this._register(T.onLeave(()=>{setTimeout(()=>{this.controller&&(k.setFocus(),this.controller instanceof hJ&&this.controller.canSelectMany&&T.clearFocus())},0)}));const M=this._register(this.instantiationService.createInstance(JYe,n,this.options.hoverDelegate));this._register(M.tree.onDidChangeFocus(()=>{k.hasFocus()&&k.setAttribute("aria-activedescendant",M.getActiveDescendant()??"")})),this._register(M.onLeave(()=>{setTimeout(()=>{this.controller&&(k.setFocus(),M.tree.setFocus([]))},0)})),this._register(M.onDidAccept(()=>{this.onDidAcceptEmitter.fire()})),this._register(M.tree.onDidChangeContentHeight(()=>this.updateLayout()));const B=f2(n);return this._register(B),this._register(pt(n,cn.FOCUS,P=>{const F=this.getUI();if(bu(P.relatedTarget,F.inputContainer)){const R=F.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==R&&this.endOfQuickInputBoxContext.set(R)}bu(P.relatedTarget,F.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=oc(P.relatedTarget)?P.relatedTarget:void 0)},!0)),this._register(B.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(eee.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(k.onKeyDown(P=>{const F=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==F&&this.endOfQuickInputBoxContext.set(F),k.removeAttribute("aria-activedescendant")})),this._register(pt(n,cn.FOCUS,P=>{k.setFocus()})),this.dndController=this._register(this.instantiationService.createInstance(eXe,this._container,n,[{node:o,includeChildren:!0},{node:d,includeChildren:!1}],this.viewState)),this._register(xi(P=>{var R;const F=(R=this.dndController)==null?void 0:R.dndViewState.read(P);F&&(F.top!==void 0&&F.left!==void 0?this.viewState={...this.viewState,top:F.top,left:F.left}:this.viewState=void 0,this.updateLayout(),F.done&&this.saveViewState(this.viewState))})),this.ui={container:n,styleSheet:r,leftActionBar:s,titleBar:o,title:a,description1:E,description2:h,widget:S,rightActionBar:l,inlineActionBar:b,checkAll:u,inputContainer:f,filterContainer:g,inputBox:k,visibleCountContainer:A,visibleCount:m,countContainer:v,count:p,okContainer:O,ok:w,message:x,customButtonContainer:y,customButton:C,list:T,tree:M,progressBar:L,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:P=>this.show(P),hide:()=>this.hide(),setVisibilities:P=>this.setVisibilities(P),setEnabled:P=>this.setEnabled(P),setContextKey:P=>this.options.setContextKey(P),linkOpenerDelegate:P=>this.options.linkOpenerDelegate(P)},this.updateStyles(),this.ui}reparentUI(t){var n;this.ui&&(this._container=t,tn(this._container,this.ui.container),(n=this.dndController)==null||n.reparentUI(this._container))}pick(t,n={},r=Fr.None){return new Promise((o,s)=>{let a=h=>{var f;a=o,(f=n.onKeyMods)==null||f.call(n,l.keyMods),o(h)};if(r.isCancellationRequested){a(void 0);return}const l=this.createQuickPick({useSeparators:!0});let d;const u=[l,l.onDidAccept(()=>{if(l.canSelectMany)a(l.selectedItems.slice()),l.hide();else{const h=l.activeItems[0];h&&(a(h),l.hide())}}),l.onDidChangeActive(h=>{const f=h[0];f&&n.onDidFocus&&n.onDidFocus(f)}),l.onDidChangeSelection(h=>{if(!l.canSelectMany){const f=h[0];f&&(a(f),l.hide())}}),l.onDidTriggerItemButton(h=>n.onDidTriggerItemButton&&n.onDidTriggerItemButton({...h,removeItem:()=>{const f=l.items.indexOf(h.item);if(f!==-1){const g=l.items.slice(),k=g.splice(f,1),A=l.activeItems.filter(v=>v!==k[0]),m=l.keepScrollPosition;l.keepScrollPosition=!0,l.items=g,A&&(l.activeItems=A),l.keepScrollPosition=m}}})),l.onDidTriggerSeparatorButton(h=>{var f;return(f=n.onDidTriggerSeparatorButton)==null?void 0:f.call(n,h)}),l.onDidChangeValue(h=>{d&&!h&&(l.activeItems.length!==1||l.activeItems[0]!==d)&&(l.activeItems=[d])}),r.onCancellationRequested(()=>{l.hide()}),l.onDidHide(()=>{hs(u),a(void 0)})];l.title=n.title,n.value&&(l.value=n.value),l.canSelectMany=!!n.canPickMany,l.placeholder=n.placeHolder,l.prompt=n.prompt,l.ignoreFocusOut=!!n.ignoreFocusLost,l.matchOnDescription=!!n.matchOnDescription,l.matchOnDetail=!!n.matchOnDetail,n.sortByLabel!==void 0&&(l.sortByLabel=n.sortByLabel),l.matchOnLabel=n.matchOnLabel===void 0||n.matchOnLabel,l.quickNavigate=n.quickNavigate,l.hideInput=!!n.hideInput,l.contextKey=n.contextKey,l.busy=!0,Promise.all([t,n.activeItem]).then(([h,f])=>{d=f,l.busy=!1,l.items=h,l.canSelectMany&&(l.selectedItems=h.filter(g=>g.type!=="separator"&&g.picked)),d&&(l.activeItems=[d])}),l.show(),Promise.resolve(t).then(void 0,h=>{s(h),l.hide()})})}setValidationOnInput(t,n){n&&pu(n)?(t.severity=Dl.Error,t.validationMessage=n):n&&!pu(n)?(t.severity=n.severity,t.validationMessage=n.content):(t.severity=Dl.Ignore,t.validationMessage=void 0)}input(t={},n=Fr.None){return new Promise(r=>{if(n.isCancellationRequested){r(void 0);return}const o=this.createInputBox(),s=t.validateInput||(()=>Promise.resolve(void 0)),a=un.debounce(o.onDidChangeValue,(h,f)=>f,100);let l=t.value||"",d=Promise.resolve(s(l));const u=[o,a(h=>{h!==l&&(d=Promise.resolve(s(h)),l=h),d.then(f=>{h===l&&this.setValidationOnInput(o,f)})}),o.onDidAccept(()=>{const h=o.value;h!==l&&(d=Promise.resolve(s(h)),l=h),d.then(f=>{!f||!pu(f)&&f.severity!==Dl.Error?(r(h),o.hide()):h===l&&this.setValidationOnInput(o,f)})}),n.onCancellationRequested(()=>{o.hide()}),o.onDidHide(()=>{hs(u),r(void 0)})];o.title=t.title,o.value=t.value||"",o.valueSelection=t.valueSelection,o.prompt=t.prompt,o.placeholder=t.placeHolder,o.password=!!t.password,o.ignoreFocusOut=!!t.ignoreFocusLost,o.show()})}createQuickPick(t={useSeparators:!1}){const n=this.getUI(!0);return new hJ(n)}createInputBox(){const t=this.getUI(!0);return new oPo(t)}show(t){var s;const n=this.getUI(!0);this.onShowEmitter.fire();const r=this.controller;this.controller=t,r==null||r.didHide(),this.setEnabled(!0),n.leftActionBar.clear(),n.title.textContent="",n.description1.textContent="",n.description2.textContent="",Ou(n.widget),n.rightActionBar.clear(),n.inlineActionBar.clear(),n.checkAll.checked=!1,n.inputBox.placeholder="",n.inputBox.password=!1,n.inputBox.showDecoration(Dl.Ignore),n.visibleCount.setCount(0),n.count.setCount(0),Ou(n.message),n.progressBar.stop(),n.progressBar.getContainer().setAttribute("aria-hidden","true"),n.list.setElements([]),n.list.matchOnDescription=!1,n.list.matchOnDetail=!1,n.list.matchOnLabel=!0,n.list.sortByLabel=!0,n.tree.updateFilterOptions({matchOnDescription:!1,matchOnLabel:!0}),n.tree.sortByLabel=!0,n.ignoreFocusOut=!1,n.inputBox.toggles=void 0;const o=this.options.backKeybindingLabel();ZYe.tooltip=o?j(1768,"Back ({0})",o):j(1769,"Back"),n.container.style.display="",this.updateLayout(),(s=this.dndController)==null||s.layoutContainer(),n.inputBox.setFocus(),this.quickInputTypeContext.set(t.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(t){const n=this.getUI();n.title.style.display=t.title?"":"none",n.description1.style.display=t.description&&(t.inputBox||t.checkAll)?"":"none",n.description2.style.display=t.description&&!(t.inputBox||t.checkAll)?"":"none",n.checkAll.domNode.style.display=t.checkAll?"":"none",n.inputContainer.style.display=t.inputBox?"":"none",n.filterContainer.style.display=t.inputBox?"":"none",n.visibleCountContainer.style.display=t.visibleCount?"":"none",n.countContainer.style.display=t.count?"":"none",n.okContainer.style.display=t.ok?"":"none",n.customButtonContainer.style.display=t.customButton?"":"none",n.message.style.display=t.message?"":"none",n.progressBar.getContainer().style.display=t.progressBar?"":"none",n.list.displayed=!!t.list,n.tree.displayed=!!t.tree,n.container.classList.toggle("show-checkboxes",!!t.checkBox),n.container.classList.toggle("hidden-input",!t.inputBox&&!t.description),this.updateLayout()}setEnabled(t){if(t!==this.enabled){this.enabled=t;const n=this.getUI();for(const r of n.leftActionBar.viewItems)r.action.enabled=t;for(const r of n.rightActionBar.viewItems)r.action.enabled=t;t?n.checkAll.enable():n.checkAll.disable(),n.inputBox.enabled=t,n.ok.enabled=t,n.list.enabled=t}}hide(t){var s;const n=this.controller;if(!n)return;n.willHide(t);const r=(s=this.ui)==null?void 0:s.container,o=r&&!E7n(r);if(this.controller=null,this.onHideEmitter.fire(),r&&(r.style.display="none"),!o){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=a.parentElement??void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}n.didHide(t)}toggleHover(){this.isVisible()&&this.controller instanceof hJ&&this.getUI().list.toggleHover()}layout(t,n){this.dimension=t,this.titleBarOffset=n,this.updateLayout()}updateLayout(){var t,n;if(this.ui&&this.isVisible()){const r=this.ui.container.style,o=Math.min(this.dimension.width*.62,_Ye.MAX_WIDTH);r.width=o+"px",r.top=`${(t=this.viewState)!=null&&t.top?Math.round(this.dimension.height*this.viewState.top):this.titleBarOffset}px`,r.left=`${Math.round(this.dimension.width*(((n=this.viewState)==null?void 0:n.left)??.5)-o/2)}px`,this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4),this.ui.tree.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(t){this.styles=t,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:t,quickInputBackground:n,quickInputForeground:r,widgetBorder:o,widgetShadow:s}=this.styles.widget;this.ui.titleBar.style.backgroundColor=t??"",this.ui.container.style.backgroundColor=n??"",this.ui.container.style.color=r??"",this.ui.container.style.border=o?`1px solid ${o}`:"",this.ui.container.style.boxShadow=s?`0 0 8px 2px ${s}`:"",this.ui.list.style(this.styles.list),this.ui.tree.tree.style(this.styles.list);const a=[];this.styles.pickerGroup.pickerGroupBorder&&a.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&a.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&a.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(a.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&a.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&a.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&a.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&a.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&a.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),a.push("}"));const l=a.join(` `);l!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=l)}}loadViewState(){try{const t=JSON.parse(this.storageService.get(BSe,-1,"{}"));if(t.top!==void 0||t.left!==void 0)return t}catch{}}saveViewState(t){this.layoutService.activeContainer===this.layoutService.mainContainer&&(t!==void 0?this.storageService.store(BSe,JSON.stringify(t),-1,1):this.storageService.remove(BSe,-1))}},_Ye=jF,jF.MAX_WIDTH=600,jF);$Ye=_Ye=UIn([MQ(1,uC),MQ(2,$n),MQ(3,Fi),MQ(4,jf)],$Ye);let eXe=class extends ct{constructor(t,n,r,o,s,a,l){super(),this._container=t,this._quickInputContainer=n,this._quickInputDragAreas=r,this._layoutService=s,this.configurationService=l,this.dndViewState=Bi(this,void 0),this._snapThreshold=20,this._snapLineHorizontalRatio=.25,this._quickInputAlignmentContext=tPo.bindTo(a);const d=n3o(this.configurationService)==="custom";this._controlsOnLeft=d&&A6e===1,this._controlsOnRight=d&&(A6e===3||A6e===2),this._registerLayoutListener(),this.registerMouseListeners(),this.dndViewState.set({...o,done:!0},void 0)}reparentUI(t){this._container=t}layoutContainer(t=this._layoutService.activeContainerDimension){const n=this.dndViewState.get(),r=this._quickInputContainer.getBoundingClientRect();if(n!=null&&n.top&&(n!=null&&n.left)){const o=Math.round(n.left*100)/100,s=t.width,a=r.width,l=o*s-a/2;this._layout(n.top*t.height,l)}}_registerLayoutListener(){this._register(un.filter(this._layoutService.onDidLayoutContainer,t=>t.container===this._container)(t=>this.layoutContainer(t.dimension)))}registerMouseListeners(){const t=this._quickInputContainer;this._register(QOt(t,n=>{const r=new $h(oi(t),n);r.detail===2&&this._quickInputDragAreas.some(({node:o,includeChildren:s})=>s?bu(r.target,o):r.target===o)&&this.dndViewState.set({top:void 0,left:void 0,done:!0},void 0)})),this._register(x7n(t,n=>{const r=oi(this._layoutService.activeContainer),o=new $h(r,n);if(!this._quickInputDragAreas.some(({node:f,includeChildren:g})=>g?bu(o.target,f):o.target===f))return;const s=this._quickInputContainer.getBoundingClientRect(),a=o.browserEvent.clientX-s.left,l=o.browserEvent.clientY-s.top;let d=!1;const u=sco(r,f=>{new $h(r,f).preventDefault(),d||(d=!0),this._layout(f.clientY-l,f.clientX-a)}),h=QOt(r,f=>{if(d){const g=this.dndViewState.get();this.dndViewState.set({top:g==null?void 0:g.top,left:g==null?void 0:g.left,done:!0},void 0)}u.dispose(),h.dispose()})}))}_layout(t,n){const r=this._getTopSnapValue(),o=this._getCenterYSnapValue(),s=this._getCenterXSnapValue();t=Math.max(0,Math.min(t,this._container.clientHeight-this._quickInputContainer.clientHeight)),t=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},iq=function(e,t){return function(n,r){t(n,r,e)}};let tXe=class extends Zgo{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(zYe))),this._quickAccess}constructor(t,n,r,o,s){super(r),this.instantiationService=t,this.contextKeyService=n,this.layoutService=o,this.configurationService=s,this._onShow=this._register(new it),this._onHide=this._register(new it),this.contexts=new Map}createController(t=this.layoutService,n){const r={idPrefix:"quickInput_",container:t.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:s=>this.setContextKey(s),linkOpenerDelegate:s=>{this.instantiationService.invokeFunction(a=>{a.get(B6).open(s,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>t.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(YYe))},o=this._register(this.instantiationService.createInstance($Ye,{...r,...n}));return o.layout(t.activeContainerDimension,t.activeContainerOffset.quickPickTop),this._register(t.onDidLayoutActiveContainer(s=>{oi(t.activeContainer)===oi(o.container)&&o.layout(s,t.activeContainerOffset.quickPickTop)})),this._register(t.onDidChangeActiveContainer(()=>{o.isVisible()||o.layout(t.activeContainerDimension,t.activeContainerOffset.quickPickTop)})),this._register(o.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(o.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),o}setContextKey(t){let n;t&&(n=this.contexts.get(t),n||(n=new Ln(t,!1).bindTo(this.contextKeyService),this.contexts.set(t,n))),!(n&&n.get())&&(this.resetContextKeys(),n==null||n.set(!0))}resetContextKeys(){this.contexts.forEach(t=>{t.get()&&t.reset()})}pick(t,n,r=Fr.None){return this.controller.pick(t,n,r)}input(t={},n=Fr.None){return this.controller.input(t,n)}createQuickPick(t={useSeparators:!1}){return this.controller.createQuickPick(t)}createInputBox(){return this.controller.createInputBox()}toggleHover(){this.hasController&&this.controller.toggleHover()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:sn(N6e),quickInputForeground:sn(Pfo),quickInputTitleBackground:sn(Mfo),widgetBorder:sn(att),widgetShadow:sn(mZ)},inputBox:n1e,toggle:t1e,countBadge:bFn,button:GOo,progressBar:KOo,keybindingLabel:pFn,list:zM({listBackground:N6e,listFocusBackground:x$,listFocusForeground:C$,listInactiveFocusForeground:C$,listInactiveSelectionIconForeground:Att,listInactiveFocusBackground:x$,listFocusOutline:qa,listInactiveFocusOutline:qa,treeStickyScrollBackground:N6e}),pickerGroup:{pickerGroupBorder:sn(Rfo),pickerGroupForeground:sn(HDn)}}}};tXe=LPo([iq(0,$n),iq(1,Fi),iq(2,Il),iq(3,uC),iq(4,cr)],tXe);var jIn=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},XD=function(e,t){return function(n,r){t(n,r,e)}};let nXe=class extends tXe{constructor(t,n,r,o,s,a){super(n,r,o,new xYe(t.getContainerDomNode(),s),a),this.host=void 0;const l=zee.get(t);if(l){const d=l.widget;this.host={_serviceBrand:void 0,get mainContainer(){return d.getDomNode()},getContainer(){return d.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[d.getDomNode()]},get activeContainer(){return d.getDomNode()},get mainContainerDimension(){return t.getLayoutInfo()},get activeContainerDimension(){return t.getLayoutInfo()},get onDidLayoutMainContainer(){return t.onDidLayoutChange},get onDidLayoutActiveContainer(){return t.onDidLayoutChange},get onDidLayoutContainer(){return un.map(t.onDidLayoutChange,u=>({container:d.getDomNode(),dimension:u}))},get onDidChangeActiveContainer(){return un.None},get onDidAddContainer(){return un.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>t.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};nXe=jIn([XD(1,$n),XD(2,Fi),XD(3,Il),XD(4,Co),XD(5,cr)],nXe);let iXe=class{get activeService(){const t=this.codeEditorService.getFocusedCodeEditor();if(!t)throw new Error("Quick input service needs a focused editor to work.");let n=this.mapEditorToService.get(t);if(!n){const r=n=this.instantiationService.createInstance(nXe,t);this.mapEditorToService.set(t,n),kP(t.onDidDispose)(()=>{r.dispose(),this.mapEditorToService.delete(t)})}return n}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(t,n){this.instantiationService=t,this.codeEditorService=n,this.mapEditorToService=new Map}pick(t,n,r=Fr.None){return this.activeService.pick(t,n,r)}input(t,n){return this.activeService.input(t,n)}createQuickPick(t={useSeparators:!1}){return this.activeService.createQuickPick(t)}createInputBox(){return this.activeService.createInputBox()}toggleHover(){return this.activeService.toggleHover()}};iXe=jIn([XD(0,$n),XD(1,Co)],iXe);const kpe=class kpe{static get(t){return t.getContribution(kpe.ID)}constructor(t){this.editor=t,this.widget=new rXe(this.editor)}dispose(){this.widget.dispose()}};kpe.ID="editor.controller.quickInput";let zee=kpe;const vpe=class vpe{constructor(t){this.codeEditor=t,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return vpe.ID}getDomNode(){return this.domNode}getPosition(){return{preference:{top:0,left:0}}}dispose(){this.codeEditor.removeOverlayWidget(this)}};vpe.ID="editor.contrib.quickInputWidget";let rXe=vpe;mo(zee.ID,zee,4);var SPo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},FSe=function(e,t){return function(n,r){t(n,r,e)}};let oXe=class extends ct{constructor(t,n,r){super(),this._contextKeyService=t,this._layoutService=n,this._configurationService=r,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new it,this._onDidChangeReducedMotion=new it,this._onDidChangeLinkUnderline=new it,this._accessibilityModeEnabledContext=fZ.bindTo(this._contextKeyService);const o=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(a=>{a.affectsConfiguration("editor.accessibilitySupport")&&(o(),this._onDidChangeScreenReaderOptimized.fire()),a.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),o(),this._register(this.onDidChangeScreenReaderOptimized(()=>o()));const s=Ls.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(s),this.initLinkUnderlineListeners()}initReducedMotionListeners(t){this._register(pt(t,"change",()=>{this._systemMotionReduced=t.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const n=()=>{const r=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("monaco-reduce-motion",r),this._layoutService.mainContainer.classList.toggle("monaco-enable-motion",!r)};n(),this._register(this.onDidChangeReducedMotion(()=>n()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(n=>{if(n.affectsConfiguration("accessibility.underlineLinks")){const r=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=r,this._onDidChangeLinkUnderline.fire()}}));const t=()=>{const n=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",n)};t(),this._register(this.onDidChangeLinkUnderlines(()=>t()))}onDidChangeLinkUnderlines(t){return this._onDidChangeLinkUnderline.event(t)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const t=this._configurationService.getValue("editor.accessibilitySupport");return t==="on"||t==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const t=this._configMotionReduced;return t==="on"||t==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};oXe=SPo([FSe(0,Fi),FSe(1,uC),FSe(2,cr)],oXe);var TPo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},O8t=function(e,t){return function(n,r){t(n,r,e)}},sXe;const w8t="application/vnd.code.resources";var WF;let aXe=(WF=class extends ct{constructor(t,n){super(),this.layoutService=t,this.logService=n,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(fP||PEn)&&this.installWebKitWriteTextWorkaround(),this._register(un.runAndSubscribe(Xie,({window:r,disposables:o})=>{o.add(pt(r.document,"copy",()=>this.clearResourcesState()))},{window:Ls,disposables:this._store}))}triggerPaste(){this.logService.trace("BrowserClipboardService#triggerPaste")}installWebKitWriteTextWorkaround(){const t=()=>{const n=new FM;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=n,ks().navigator.clipboard.write([new ClipboardItem({"text/plain":n.p})]).catch(async r=>{(!(r instanceof Error)||r.name!=="NotAllowedError"||!n.isRejected)&&this.logService.error(r)})};this._register(un.runAndSubscribe(this.layoutService.onDidAddContainer,({container:n,disposables:r})=>{r.add(pt(n,"click",t)),r.add(pt(n,"keydown",t))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(t,n){if(this.logService.trace("BrowserClipboardService#writeText called with type:",n," text.length:",t.length),this.clearResourcesState(),n){this.mapTextToType.set(n,t),this.logService.trace("BrowserClipboardService#writeText");return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(t);try{return this.logService.trace("before navigator.clipboard.writeText"),await ks().navigator.clipboard.writeText(t)}catch(r){console.error(r)}this.fallbackWriteText(t)}fallbackWriteText(t){this.logService.trace("BrowserClipboardService#fallbackWriteText");const n=qie(),r=n.activeElement,o=n.body.appendChild(ln("textarea",{"aria-hidden":!0}));o.style.height="1px",o.style.width="1px",o.style.position="absolute",o.value=t,o.focus(),o.select(),n.execCommand("copy"),oc(r)&&r.focus(),o.remove()}async readText(t){if(this.logService.trace("BrowserClipboardService#readText called with type:",t),t){const n=this.mapTextToType.get(t)||"";return this.logService.trace("BrowserClipboardService#readText text.length:",n.length),n}try{const n=await ks().navigator.clipboard.readText();return this.logService.trace("BrowserClipboardService#readText text.length:",n.length),n}catch(n){console.error(n)}return""}async readFindText(){return this.findText}async writeFindText(t){this.findText=t}async readResources(){try{const n=await ks().navigator.clipboard.read();for(const r of n)if(r.types.includes(`web ${w8t}`)){const o=await r.getType(`web ${w8t}`);return JSON.parse(await o.text()).map(a=>pi.from(a))}}catch{}const t=await this.computeResourcesStateHash();return this.resourcesStateHash!==t&&this.clearResourcesState(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const t=await this.readText();return Yie(t.substring(0,sXe.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearInternalState(){this.clearResourcesState()}clearResourcesState(){this.resources=[],this.resourcesStateHash=void 0}},sXe=WF,WF.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,WF);aXe=sXe=TPo([O8t(0,uC),O8t(1,Oa)],aXe);var EPo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},DPo=function(e,t){return function(n,r){t(n,r,e)}};const AJ="data-keybinding-context";class qit{constructor(t,n){this._id=t,this._parent=n,this._value=Object.create(null),this._value._contextId=t}get value(){return{...this._value}}setValue(t,n){return this._value[t]!==n?(this._value[t]=n,!0):!1}removeValue(t){return t in this._value?(delete this._value[t],!0):!1}getValue(t){const n=this._value[t];return typeof n>"u"&&this._parent?this._parent.getValue(t):n}}const ppe=class ppe extends qit{constructor(){super(-1,null)}setValue(t,n){return!1}removeValue(t){return!1}getValue(t){}};ppe.INSTANCE=new ppe;let qV=ppe;const JJ=class JJ extends qit{constructor(t,n,r){super(t,null),this._configurationService=n,this._values=lW.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(o=>{if(o.source===7){const s=Array.from(this._values,([a])=>a);this._values.clear(),r.fire(new C8t(s))}else{const s=[];for(const a of o.affectedKeys){const l=`config.${a}`,d=this._values.findSuperstr(l);d!==void 0&&(s.push(...lo.map(d,([u])=>u)),this._values.deleteSuperstr(l)),this._values.has(l)&&(s.push(l),this._values.delete(l))}r.fire(new C8t(s))}})}dispose(){this._listener.dispose()}getValue(t){if(t.indexOf(JJ._keyPrefix)!==0)return super.getValue(t);if(this._values.has(t))return this._values.get(t);const n=t.substr(JJ._keyPrefix.length),r=this._configurationService.getValue(n);let o;switch(typeof r){case"number":case"boolean":case"string":o=r;break;default:Array.isArray(r)?o=JSON.stringify(r):o=r}return this._values.set(t,o),o}setValue(t,n){return super.setValue(t,n)}removeValue(t){return super.removeValue(t)}};JJ._keyPrefix="config.";let lXe=JJ;class QPo{constructor(t,n,r){this._service=t,this._key=n,this._defaultValue=r,this.reset()}set(t){this._service.setContext(this._key,t)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class y8t{constructor(t){this.key=t}affectsSome(t){return t.has(this.key)}allKeysContainedIn(t){return this.affectsSome(t)}}class C8t{constructor(t){this.keys=t}affectsSome(t){for(const n of this.keys)if(t.has(n))return!0;return!1}allKeysContainedIn(t){return this.keys.every(n=>t.has(n))}}class BPo{constructor(t){this.events=t}affectsSome(t){for(const n of this.events)if(n.affectsSome(t))return!0;return!1}allKeysContainedIn(t){return this.events.every(n=>n.allKeysContainedIn(t))}}function FPo(e,t){return e.allKeysContainedIn(new Set(Object.keys(t)))}class WIn extends ct{get onDidChangeContext(){return this._onDidChangeContext.event}constructor(t){super(),this._onDidChangeContext=this._register(new vP({merge:n=>new BPo(n)})),this._isDisposed=!1,this._myContextId=t}createKey(t,n){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new QPo(this,t,n)}bufferChangeEvents(t){this._onDidChangeContext.pause();try{t()}finally{this._onDidChangeContext.resume()}}createScoped(t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new PPo(this,t)}contextMatchesRules(t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const n=this.getContextValuesContainer(this._myContextId);return t?t.evaluate(n):!0}getContextKeyValue(t){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(t)}setContext(t,n){if(this._isDisposed)return;const r=this.getContextValuesContainer(this._myContextId);r&&r.setValue(t,n)&&this._onDidChangeContext.fire(new y8t(t))}removeContext(t){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(t)&&this._onDidChangeContext.fire(new y8t(t))}getContext(t){return this._isDisposed?qV.INSTANCE:this.getContextValuesContainer(MPo(t))}dispose(){super.dispose(),this._isDisposed=!0}}let cXe=class extends WIn{constructor(t){super(0),this._contexts=new Map,this._lastContextId=0,this.inputFocusedContext=Xnt.bindTo(this);const n=this._register(new lXe(this._myContextId,t,this._onDidChangeContext));this._contexts.set(this._myContextId,n),this._register(un.runAndSubscribe(Xie,({window:r,disposables:o})=>{const s=o.add(new is);o.add(pt(r,cn.FOCUS_IN,()=>{s.value=new Pt,this.updateInputContextKeys(r.document,s.value)},!0))},{window:Ls,disposables:this._store}))}updateInputContextKeys(t,n){function r(){return!!t.activeElement&&uO(t.activeElement)}const o=r();if(this.inputFocusedContext.set(o),o){const s=n.add(f2(t.activeElement));un.once(s.onDidBlur)(()=>{ks().document===t&&this.inputFocusedContext.set(r()),s.dispose()},void 0,n)}}getContextValuesContainer(t){return this._isDisposed?qV.INSTANCE:this._contexts.get(t)||qV.INSTANCE}createChildContext(t=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const n=++this._lastContextId;return this._contexts.set(n,new qit(n,this.getContextValuesContainer(t))),n}disposeContext(t){this._isDisposed||this._contexts.delete(t)}};cXe=EPo([DPo(0,cr)],cXe);class PPo extends WIn{constructor(t,n){if(super(t.createChildContext()),this._parentChangeListener=this._register(new is),this._parent=t,this._updateParentChangeListener(),this._domNode=n,this._domNode.hasAttribute(AJ)){let r="";this._domNode.classList&&(r=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${r?": "+r:""}`)}this._domNode.setAttribute(AJ,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(t=>{const r=this._parent.getContextValuesContainer(this._myContextId).value;FPo(t,r)||this._onDidChangeContext.fire(t)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(AJ),super.dispose())}getContextValuesContainer(t){return this._isDisposed?qV.INSTANCE:this._parent.getContextValuesContainer(t)}createChildContext(t=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(t)}disposeContext(t){this._isDisposed||this._parent.disposeContext(t)}}function MPo(e){for(;e;){if(e.hasAttribute(AJ)){const t=e.getAttribute(AJ);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}function RPo(e,t,n){e.get(Fi).createKey(String(t),IPo(n))}function IPo(e){return $7n(e,t=>{if(typeof t=="object"&&t.$mid===1)return pi.revive(t).toString();if(t instanceof pi)return t.toString()})}ho.registerCommand("_setContext",RPo);ho.registerCommand({id:"getContextKeyInfo",handler(){return[...Ln.all()].sort((e,t)=>e.key.localeCompare(t.key))},metadata:{description:j(1674,"A command that returns information about context keys"),args:[]}});ho.registerCommand("_generateContextKeyInfo",function(){const e=[],t=new Set;for(const n of Ln.all())t.has(n.key)||(t.add(n.key),e.push(n));e.sort((n,r)=>n.key.localeCompare(r.key)),console.log(JSON.stringify(e,void 0,2))});let NPo=class{constructor(t,n){this.key=t,this.data=n,this.incoming=new Map,this.outgoing=new Map}};class x8t{constructor(t){this._hashFn=t,this._nodes=new Map}roots(){const t=[];for(const n of this._nodes.values())n.outgoing.size===0&&t.push(n);return t}insertEdge(t,n){const r=this.lookupOrInsertNode(t),o=this.lookupOrInsertNode(n);r.outgoing.set(o.key,o),o.incoming.set(r.key,r)}removeNode(t){const n=this._hashFn(t);this._nodes.delete(n);for(const r of this._nodes.values())r.outgoing.delete(n),r.incoming.delete(n)}lookupOrInsertNode(t){const n=this._hashFn(t);let r=this._nodes.get(n);return r||(r=new NPo(n,t),this._nodes.set(n,r)),r}isEmpty(){return this._nodes.size===0}toString(){const t=[];for(const[n,r]of this._nodes)t.push(`${n} (-> incoming)[${[...r.incoming.keys()].join(", ")}] (outgoing ->)[${[...r.outgoing.keys()].join(",")}] `);return t.join(` `)}findCycleSlow(){for(const[t,n]of this._nodes){const r=new Set([t]),o=this._findCycle(n,r);if(o)return o}}_findCycle(t,n){for(const[r,o]of t.outgoing){if(n.has(r))return[...n,r].join(" -> ");n.add(r);const s=this._findCycle(o,n);if(s)return s;n.delete(r)}}}const UPo=!1;class L8t extends Error{constructor(t){super("cyclic dependency between services"),this.message=t.findCycleSlow()??`UNABLE to detect cycle, dumping graph: ${t.toString()}`}}class G0e{constructor(t=new OZ,n=!1,r,o=UPo){this._services=t,this._strict=n,this._parent=r,this._enableTracing=o,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set($n,this),this._globalGraph=o?(r==null?void 0:r._globalGraph)??new x8t(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,hs(this._children),this._children.clear();for(const t of this._servicesToMaybeDispose)BM(t)&&t.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(t,n){this._throwIfDisposed();const r=this,o=new class extends G0e{dispose(){r._children.delete(o),super.dispose()}}(t,this._strict,this,this._enableTracing);return this._children.add(o),n==null||n.add(o),o}invokeFunction(t,...n){this._throwIfDisposed();const r=fJ.traceInvocation(this._enableTracing,t);let o=!1;try{return t({get:a=>{if(o)throw Ige("service accessor is only valid during the invocation of its target method");const l=this._getOrCreateServiceInstance(a,r);if(!l)throw new Error(`[invokeFunction] unknown service '${a}'`);return l},getIfExists:a=>{if(o)throw Ige("service accessor is only valid during the invocation of its target method");return this._getOrCreateServiceInstance(a,r)}},...n)}finally{o=!0,r.stop()}}createInstance(t,...n){this._throwIfDisposed();let r,o;return t instanceof Ow?(r=fJ.traceCreation(this._enableTracing,t.ctor),o=this._createInstance(t.ctor,t.staticArguments.concat(n),r)):(r=fJ.traceCreation(this._enableTracing,t),o=this._createInstance(t,n,r)),r.stop(),o}_createInstance(t,n=[],r){const o=tO.getServiceDependencies(t).sort((l,d)=>l.index-d.index),s=[];for(const l of o){const d=this._getOrCreateServiceInstance(l.id,r);d||this._throwIfStrict(`[createInstance] ${t.name} depends on UNKNOWN service ${l.id}.`,!1),s.push(d)}const a=o.length>0?o[0].index:n.length;if(n.length!==a){console.trace(`[createInstance] First service dependency of ${t.name} at position ${a+1} conflicts with ${n.length} static arguments`);const l=a-n.length;l>0?n=n.concat(new Array(l)):n=n.slice(0,a)}return Reflect.construct(t,n.concat(s))}_setCreatedServiceInstance(t,n){if(this._services.get(t)instanceof Ow)this._services.set(t,n);else if(this._parent)this._parent._setCreatedServiceInstance(t,n);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(t){const n=this._services.get(t);return!n&&this._parent?this._parent._getServiceInstanceOrDescriptor(t):n}_getOrCreateServiceInstance(t,n){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(t));const r=this._getServiceInstanceOrDescriptor(t);return r instanceof Ow?this._safeCreateAndCacheServiceInstance(t,r,n.branch(t,!0)):(n.branch(t,!1),r)}_safeCreateAndCacheServiceInstance(t,n,r){if(this._activeInstantiations.has(t))throw new Error(`illegal state - RECURSIVELY instantiating service '${t}'`);this._activeInstantiations.add(t);try{return this._createAndCacheServiceInstance(t,n,r)}finally{this._activeInstantiations.delete(t)}}_createAndCacheServiceInstance(t,n,r){var d;const o=new x8t(u=>u.id.toString());let s=0;const a=[{id:t,desc:n,_trace:r}],l=new Set;for(;a.length;){const u=a.pop();if(!l.has(String(u.id))){if(l.add(String(u.id)),o.lookupOrInsertNode(u),s++>1e3)throw new L8t(o);for(const h of tO.getServiceDependencies(u.desc.ctor)){const f=this._getServiceInstanceOrDescriptor(h.id);if(f||this._throwIfStrict(`[createInstance] ${t} depends on ${h.id} which is NOT registered.`,!0),(d=this._globalGraph)==null||d.insertEdge(String(u.id),String(h.id)),f instanceof Ow){const g={id:h.id,desc:f,_trace:u._trace.branch(h.id,!0)};o.insertEdge(u,g),a.push(g)}}}}for(;;){const u=o.roots();if(u.length===0){if(!o.isEmpty())throw new L8t(o);break}for(const{data:h}of u){if(this._getServiceInstanceOrDescriptor(h.id)instanceof Ow){const g=this._createServiceInstanceWithOwner(h.id,h.desc.ctor,h.desc.staticArguments,h.desc.supportsDelayedInstantiation,h._trace);this._setCreatedServiceInstance(h.id,g)}o.removeNode(h)}}return this._getServiceInstanceOrDescriptor(t)}_createServiceInstanceWithOwner(t,n,r=[],o,s){if(this._services.get(t)instanceof Ow)return this._createServiceInstance(t,n,r,o,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(t,n,r,o,s);throw new Error(`illegalState - creating UNKNOWN service instance ${n.name}`)}_createServiceInstance(t,n,r=[],o,s,a){if(o){const l=new G0e(void 0,this._strict,this,this._enableTracing);l._globalGraphImplicitDependency=String(t);const d=new Map,u=new Qao(()=>{const h=l._createInstance(n,r,s);for(const[f,g]of d){const k=h[f];if(typeof k=="function")for(const A of g)A.disposable=k.apply(h,A.listener)}return d.clear(),a.add(h),h});return new Proxy(Object.create(null),{get(h,f){if(!u.isInitialized&&typeof f=="string"&&(f.startsWith("onDid")||f.startsWith("onWill"))){let A=d.get(f);return A||(A=new Tf,d.set(f,A)),(v,p,b)=>{if(u.isInitialized)return u.value[f](v,p,b);{const O={listener:[v,p,b],disposable:void 0},w=A.push(O);return Gn(()=>{var C;w(),(C=O.disposable)==null||C.dispose()})}}}if(f in h)return h[f];const g=u.value;let k=g[f];return typeof k!="function"||(k=k.bind(g),h[f]=k),k},set(h,f,g){return u.value[f]=g,!0},getPrototypeOf(h){return n.prototype}})}else{const l=this._createInstance(n,r,s);return a.add(l),l}}_throwIfStrict(t,n){if(n&&console.warn(t),this._strict)throw new Error(t)}}const Q0=class Q0{static traceInvocation(t,n){return t?new Q0(2,n.name||new Error().stack.split(` `).slice(3,4).join(` `)):Q0._None}static traceCreation(t,n){return t?new Q0(1,n.name):Q0._None}constructor(t,n){this.type=t,this.name=n,this._start=Date.now(),this._dep=[]}branch(t,n){const r=new Q0(3,t.toString());return this._dep.push([t,n,r]),r}stop(){const t=Date.now()-this._start;Q0._totals+=t;let n=!1;function r(s,a){const l=[],d=new Array(s+1).join(" ");for(const[u,h,f]of a._dep)if(h&&f){n=!0,l.push(`${d}CREATES -> ${u}`);const g=r(s+1,f);g&&l.push(g)}else l.push(`${d}uses -> ${u}`);return l.join(` `)}const o=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${r(1,this)}`,`DONE, took ${t.toFixed(2)}ms (grand total ${Q0._totals.toFixed(2)}ms)`];(t>2||n)&&Q0.all.add(o.join(` `))}};Q0.all=new Set,Q0._None=new class extends Q0{constructor(){super(0,null)}stop(){}branch(){return this}},Q0._totals=0;let fJ=Q0;const jPo=new Set([Li.inMemory,Li.vscodeSourceControl,Li.walkThrough,Li.walkThroughSnippet,Li.vscodeChatCodeBlock,Li.vscodeTerminal]);class WPo{constructor(){this._byResource=new Qc,this._byOwner=new Map}set(t,n,r){let o=this._byResource.get(t);o||(o=new Map,this._byResource.set(t,o)),o.set(n,r);let s=this._byOwner.get(n);s||(s=new Qc,this._byOwner.set(n,s)),s.set(t,r)}get(t,n){const r=this._byResource.get(t);return r==null?void 0:r.get(n)}delete(t,n){let r=!1,o=!1;const s=this._byResource.get(t);s&&(r=s.delete(n));const a=this._byOwner.get(n);if(a&&(o=a.delete(t)),r!==o)throw new Error("illegal state");return r&&o}values(t){var n,r;return typeof t=="string"?((n=this._byOwner.get(t))==null?void 0:n.values())??lo.empty():pi.isUri(t)?((r=this._byResource.get(t))==null?void 0:r.values())??lo.empty():lo.map(lo.concat(...this._byOwner.values()),o=>o[1])}}class HPo{constructor(t){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Qc,this._service=t,this._subscription=t.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(t){for(const n of t){const r=this._data.get(n);r&&this._substract(r);const o=this._resourceStats(n);this._add(o),this._data.set(n,o)}}_resourceStats(t){const n={errors:0,warnings:0,infos:0,unknowns:0};if(jPo.has(t.scheme))return n;for(const{severity:r}of this._service.read({resource:t}))r===Bl.Error?n.errors+=1:r===Bl.Warning?n.warnings+=1:r===Bl.Info?n.infos+=1:n.unknowns+=1;return n}_substract(t){this.errors-=t.errors,this.warnings-=t.warnings,this.infos-=t.infos,this.unknowns-=t.unknowns}_add(t){this.errors+=t.errors,this.warnings+=t.warnings,this.infos+=t.infos,this.unknowns+=t.unknowns}}class qD{constructor(){this._onMarkerChanged=new HEn({delay:0,merge:qD._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new WPo,this._stats=new HPo(this),this._filteredResources=new Qc}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(t,n){for(const r of n||[])this.changeOne(t,r,[])}changeOne(t,n,r){if(h7n(r))this._data.delete(n,t)&&this._onMarkerChanged.fire([n]);else{const o=[];for(const s of r){const a=qD._toMarker(t,n,s);a&&o.push(a)}this._data.set(n,t,o),this._onMarkerChanged.fire([n])}}static _toMarker(t,n,r){let{code:o,severity:s,message:a,source:l,startLineNumber:d,startColumn:u,endLineNumber:h,endColumn:f,relatedInformation:g,tags:k,origin:A}=r;if(a)return d=d>0?d:1,u=u>0?u:1,h=h>=d?h:d,f=f>0?f:u,{resource:n,owner:t,code:o,severity:s,message:a,source:l,startLineNumber:d,startColumn:u,endLineNumber:h,endColumn:f,relatedInformation:g,tags:k,origin:A}}changeAll(t,n){const r=[],o=this._data.values(t);if(o)for(const s of o){const a=lo.first(s);a&&(r.push(a.resource),this._data.delete(a.resource,t))}if(Qf(n)){const s=new Qc;for(const{resource:a,marker:l}of n){const d=qD._toMarker(t,a,l);if(!d)continue;const u=s.get(a);u?u.push(d):(s.set(a,[d]),r.push(a))}for(const[a,l]of s)this._data.set(a,t,l)}r.length>0&&this._onMarkerChanged.fire(r)}_createFilteredMarker(t,n){const r=n.length===1?j(1738,'Problems are paused because: "{0}"',n[0]):j(1739,'Problems are paused because: "{0}" and {1} more',n[0],n.length-1);return{owner:"markersFilter",resource:t,severity:Bl.Info,message:r,startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1}}read(t=Object.create(null)){let{owner:n,resource:r,severities:o,take:s}=t;if((!s||s<0)&&(s=-1),n&&r){const a=t.ignoreResourceFilters?void 0:this._filteredResources.get(r);if(a!=null&&a.length)return[this._createFilteredMarker(r,a)];const l=this._data.get(r,n);if(!l)return[];const d=[];for(const u of l){if(s>0&&d.length===s)break;const h=t.ignoreResourceFilters?void 0:this._filteredResources.get(r);h!=null&&h.length?d.push(this._createFilteredMarker(r,h)):qD._accept(u,o)&&d.push(u)}return d}else{const a=!n&&!r?this._data.values():this._data.values(r??n),l=[],d=new Xco;for(const u of a)for(const h of u){if(d.has(h.resource))continue;if(s>0&&l.length===s)break;const f=t.ignoreResourceFilters?void 0:this._filteredResources.get(h.resource);f!=null&&f.length?(l.push(this._createFilteredMarker(h.resource,f)),d.add(h.resource)):qD._accept(h,o)&&l.push(h)}return l}}static _accept(t,n){return n===void 0||(n&t.severity)===t.severity}static _merge(t){const n=new Qc;for(const r of t)for(const o of r)n.set(o,!0);return Array.from(n.keys())}}class VPo extends ct{get configurationModel(){return this._configurationModel}constructor(t){super(),this.logService=t,this._configurationModel=dh.createEmptyModel(t)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=dh.createEmptyModel(this.logService);const t=Rl.as(XO.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(t),t)}updateConfigurationModel(t,n){const r=this.getConfigurationDefaultOverrides();for(const o of t){const s=r[o],a=n[o];s!==void 0?this._configurationModel.setValue(o,s):a?this._configurationModel.setValue(o,bw(a.default)):this._configurationModel.removeValue(o)}}}class zPo extends ct{constructor(t,n=[]){super(),this.logger=new odo([t,...n]),this._register(t.onDidChangeLogLevel(r=>this.setLevel(r)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(t){this.logger.setLevel(t)}getLevel(){return this.logger.getLevel()}trace(t,...n){this.logger.trace(t,...n)}debug(t,...n){this.logger.debug(t,...n)}info(t,...n){this.logger.info(t,...n)}warn(t,...n){this.logger.warn(t,...n)}error(t,...n){this.logger.error(t,...n)}}class ZPo{getParserClass(){throw new Error("not implemented in StandaloneTreeSitterLibraryService")}supportsLanguage(t,n){return!1}getLanguage(t,n,r){}getInjectionQueries(t,n){return null}getHighlightingQueries(t,n){return null}}var fC=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Yc=function(e,t){return function(n,r){t(n,r,e)}};class YPo{constructor(t){this.disposed=!1,this.model=t,this._onWillDispose=new it}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let dXe=class{constructor(t){this.modelService=t}createModelReference(t){const n=this.modelService.getModel(t);return n?Promise.resolve(new kao(new YPo(n))):Promise.reject(new Error("Model not found"))}};dXe=fC([Yc(0,pl)],dXe);const bpe=class bpe{show(){return bpe.NULL_PROGRESS_RUNNER}async showWhile(t,n){await t}};bpe.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};let uXe=bpe;class XPo{withProgress(t,n,r){return n({report:()=>{}})}}class qPo{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class GPo{async confirm(t){return{confirmed:this.doConfirm(t.message,t.detail),checkboxChecked:!1}}doConfirm(t,n){let r=t;return n&&(r=r+` `+n),Ls.confirm(r)}async prompt(t){var o;let n;if(this.doConfirm(t.message,t.detail)){const s=[...t.buttons??[]];t.cancelButton&&typeof t.cancelButton!="string"&&typeof t.cancelButton!="boolean"&&s.push(t.cancelButton),n=await((o=s[0])==null?void 0:o.run({checkboxChecked:!1}))}return{result:n}}async error(t,n){await this.prompt({type:Dl.Error,message:t,detail:n})}}const _J=class _J{info(t){return this.notify({severity:Dl.Info,message:t})}warn(t){return this.notify({severity:Dl.Warning,message:t})}error(t){return this.notify({severity:Dl.Error,message:t})}notify(t){switch(t.severity){case Dl.Error:console.error(t.message);break;case Dl.Warning:console.warn(t.message);break;default:console.log(t.message);break}return _J.NO_OP}prompt(t,n,r,o){return _J.NO_OP}status(t,n){return{close:()=>{}}}};_J.NO_OP=new U1o;let hXe=_J,AXe=class{constructor(t){this._onWillExecuteCommand=new it,this._onDidExecuteCommand=new it,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=t}executeCommand(t,...n){const r=ho.getCommand(t);if(!r)return Promise.reject(new Error(`command '${t}' not found`));try{this._onWillExecuteCommand.fire({commandId:t,args:n});const o=this._instantiationService.invokeFunction.apply(this._instantiationService,[r.handler,...n]);return this._onDidExecuteCommand.fire({commandId:t,args:n}),Promise.resolve(o)}catch(o){return Promise.reject(o)}}};AXe=fC([Yc(0,$n)],AXe);let GV=class extends LFo{constructor(t,n,r,o,s,a){super(t,n,r,o,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const l=k=>{const A=new Pt;A.add(pt(k,cn.KEY_DOWN,m=>{const v=new Hs(m);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),A.add(pt(k,cn.KEY_UP,m=>{const v=new Hs(m);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new KPo(k,A))},d=k=>{for(let A=0;A{k.getOption(70)||l(k.getContainerDomNode())},h=k=>{k.getOption(70)||d(k.getContainerDomNode())};this._register(a.onCodeEditorAdd(u)),this._register(a.onCodeEditorRemove(h)),a.listCodeEditors().forEach(u);const f=k=>{l(k.getContainerDomNode())},g=k=>{d(k.getContainerDomNode())};this._register(a.onDiffEditorAdd(f)),this._register(a.onDiffEditorRemove(g)),a.listDiffEditors().forEach(f)}addDynamicKeybinding(t,n,r,o){return Jp(ho.registerCommand(t,r),this.addDynamicKeybindings([{keybinding:n,command:t,when:o}]))}addDynamicKeybindings(t){const n=t.map(r=>({keybinding:wUe(r.keybinding,x1),command:r.command??null,commandArgs:r.commandArgs,when:r.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(n),this.updateResolver(),Gn(()=>{for(let r=0;rthis._log(r))}return this._cachedResolver}_documentHasFocus(){return Ls.document.hasFocus()}_toNormalizedKeybindingItems(t,n){const r=[];let o=0;for(const s of t){const a=s.when||void 0,l=s.keybinding;if(!l)r[o++]=new r8t(void 0,s.command,s.commandArgs,a,n,null,!1);else{const d=Uee.resolveKeybinding(l,x1);for(const u of d)r[o++]=new r8t(u,s.command,s.commandArgs,a,n,null,!1)}}return r}resolveKeyboardEvent(t){const n=new V8(t.ctrlKey,t.shiftKey,t.altKey,t.metaKey,t.keyCode);return new Uee([n],x1)}};GV=fC([Yc(0,Fi),Yc(1,Ca),Yc(2,zA),Yc(3,cc),Yc(4,Oa),Yc(5,Co)],GV);class KPo extends ct{constructor(t,n){super(),this.domNode=t,this._register(n)}}function S8t(e){return!!e&&typeof e=="object"&&(!e.overrideIdentifier||typeof e.overrideIdentifier=="string")&&(!e.resource||e.resource instanceof pi)}let K0e=class{constructor(t){this.logService=t,this._onDidChangeConfiguration=new it,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const n=new VPo(t);this._configuration=new A3e(n.reload(),dh.createEmptyModel(t),dh.createEmptyModel(t),dh.createEmptyModel(t),dh.createEmptyModel(t),dh.createEmptyModel(t),new Qc,dh.createEmptyModel(t),new Qc,t),n.dispose()}getValue(t,n){const r=typeof t=="string"?t:void 0,o=S8t(t)?t:S8t(n)?n:{};return this._configuration.getValue(r,o,void 0)}updateValues(t){const n={data:this._configuration.toData()},r=[];for(const o of t){const[s,a]=o;this.getValue(s)!==a&&(this._configuration.updateValue(s,a),r.push(s))}if(r.length>0){const o=new wFo({keys:r,overrides:[]},n,this._configuration,void 0,this.logService);o.source=8,this._onDidChangeConfiguration.fire(o)}return Promise.resolve()}updateValue(t,n,r,o){return this.updateValues([[t,n]])}inspect(t,n={}){return this._configuration.inspect(t,n,void 0)}};K0e=fC([Yc(0,Oa)],K0e);let fXe=class{constructor(t,n,r){this.configurationService=t,this.modelService=n,this.languageService=r,this._onDidChangeConfiguration=new it,this.configurationService.onDidChangeConfiguration(o=>{this._onDidChangeConfiguration.fire({affectedKeys:o.affectedKeys,affectsConfiguration:(s,a)=>o.affectsConfiguration(a)})})}getValue(t,n,r){const o=tt.isIPosition(n)?n:null,s=o?typeof r=="string"?r:void 0:typeof n=="string"?n:void 0,a=t?this.getLanguage(t,o):void 0;return typeof s>"u"?this.configurationService.getValue({resource:t,overrideIdentifier:a}):this.configurationService.getValue(s,{resource:t,overrideIdentifier:a})}getLanguage(t,n){const r=this.modelService.getModel(t);return r?n?r.getLanguageIdAtPosition(n.lineNumber,n.column):r.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(t)}};fXe=fC([Yc(0,cr),Yc(1,pl),Yc(2,lc)],fXe);let gXe=class{constructor(t){this.configurationService=t}getEOL(t,n){const r=this.configurationService.getValue("files.eol",{overrideIdentifier:n,resource:t});return r&&typeof r=="string"&&r!=="auto"?r:ym||Pr?` `:`\r `}};gXe=fC([Yc(0,cr)],gXe);class JPo{publicLog2(){}}const $J=class $J{constructor(){const t=pi.from({scheme:$J.SCHEME,authority:"model",path:"/"});this.workspace={id:HFn,folders:[new dwo({uri:t,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(t){return t&&t.scheme===$J.SCHEME?this.workspace.folders[0]:null}};$J.SCHEME="inmemory";let mXe=$J;function J0e(e,t,n){if(!t||!(e instanceof K0e))return;const r=[];Object.keys(t).forEach(o=>{Ewo(o)&&r.push([`editor.${o}`,t[o]]),n&&Dwo(o)&&r.push([`diffEditor.${o}`,t[o]])}),r.length>0&&e.updateValues(r)}let kXe=class{constructor(t){this._modelService=t}hasPreviewHandler(){return!1}async apply(t,n){const r=Array.isArray(t)?t:pnt.convert(t),o=new Map;for(const l of r){if(!(l instanceof _5))throw new Error("bad edit - only text edits are supported");const d=this._modelService.getModel(l.resource);if(!d)throw new Error("bad edit - model not found");if(typeof l.versionId=="number"&&d.getVersionId()!==l.versionId)throw new Error("bad state - model changed in the meantime");let u=o.get(d);u||(u=[],o.set(d,u)),u.push(Jl.replaceMove(De.lift(l.textEdit.range),l.textEdit.text))}let s=0,a=0;for(const[l,d]of o)l.pushStackElement(),l.pushEditOperations([],d,()=>[]),l.pushStackElement(),a+=1,s+=d.length;return{ariaSummary:pP(cZe.bulkEditServiceSummary,s,a),isApplied:s>0}}};kXe=fC([Yc(0,pl)],kXe);class _Po{getUriLabel(t,n){return t.scheme==="file"?t.fsPath:t.path}getUriBasenameLabel(t){return g2(t)}}let vXe=class extends fFo{constructor(t,n){super(t),this._codeEditorService=n}showContextView(t,n,r){if(!n){const o=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();o&&(n=o.getContainerDomNode())}return super.showContextView(t,n,r)}};vXe=fC([Yc(0,uC),Yc(1,Co)],vXe);class $Po{constructor(){this._neverEmitter=new it,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class eMo extends FYe{constructor(){super()}}class tMo extends zPo{constructor(){super(new rdo)}}let pXe=class extends RYe{constructor(t,n,r,o,s,a){super(t,n,r,o,s,a),this.configure({blockMouse:!1})}};pXe=fC([Yc(0,zA),Yc(1,cc),Yc(2,Q6),Yc(3,Fo),Yc(4,y2),Yc(5,Fi)],pXe);const nMo={esmModuleLocation:void 0,label:"editorWorkerService"};let bXe=class extends OYe{constructor(t,n,r,o,s){super(nMo,t,n,r,o,s)}};bXe=fC([Yc(0,pl),Yc(1,a3e),Yc(2,Oa),Yc(3,bl),Yc(4,Zn)],bXe);class iMo{async playSignal(t,n){}}qr(Oa,tMo,0);qr(cr,K0e,0);qr(a3e,fXe,0);qr(NRn,gXe,0);qr(n6,mXe,0);qr(zP,_Po,0);qr(zA,JPo,0);qr(Lre,GPo,0);qr(Tnt,qPo,0);qr(cc,hXe,0);qr(hC,qD,0);qr(lc,eMo,0);qr(Dk,sBo,0);qr(pl,HYe,0);qr($et,WYe,0);qr(Fi,cXe,0);qr(gBn,XPo,0);qr(e6,uXe,0);qr(jf,XOo,0);qr(Bm,bXe,0);qr(fre,kXe,0);qr(KRn,$Po,0);qr(Uf,dXe,0);qr(xh,oXe,0);qr(S2,iLo,0);qr(Ca,AXe,0);qr(Fo,GV,0);qr(UA,iXe,0);qr(Q6,vXe,0);qr(B6,jYe,0);qr(z1,aXe,0);qr(Ek,pXe,0);qr(y2,zWe,0);qr(E6,iMo,0);qr(Ntt,ZPo,0);qr(V7n,ldo,0);qr(kit,p9o,0);var Xi;(function(e){const t=new OZ;for(const[d,u]of _Ot())t.set(d,u);const n=new G0e(t,!0);t.set($n,n);function r(d){o||a({});const u=t.get(d);if(!u)throw new Error("Missing service "+d);return u instanceof Ow?n.invokeFunction(h=>h.get(d)):u}e.get=r;let o=!1;const s=new it;function a(d){if(o)return n;o=!0;for(const[h,f]of _Ot())t.get(h)||t.set(h,f);for(const h in d)if(d.hasOwnProperty(h)){const f=Lr(h);t.get(f)instanceof Ow&&t.set(f,d[h])}const u=uyo();for(const h of u)try{n.createInstance(h)}catch(f){Yi(f)}return s.fire(),n}e.initialize=a;function l(d){if(o)return d();const u=new Pt,h=u.add(s.event(()=>{h.dispose(),u.add(d())}));return u}e.withServices=l})(Xi||(Xi={}));var rMo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},T8t=function(e,t){return function(n,r){t(n,r,e)}},Khe,HF;let OXe=(HF=class{constructor(t,n){this._configurationService=t,this._languageService=n}async renderCodeBlock(t,n,r){var h;const o=EO(r.context)?r.context:void 0;let s;t?s=this._languageService.getLanguageIdByLanguageName(t):o&&(s=(h=o.getModel())==null?void 0:h.getLanguageId()),s||(s=dk);const a=await c2o(this._languageService,n,s),l=Khe._ttpTokenizer?Khe._ttpTokenizer.createHTML(a)??a:a,d=document.createElement("span");d.innerHTML=l;const u=d.querySelector(".monaco-tokenized-source");return oc(u)?(zu(u,this.getFontInfo(o)),d):document.createElement("span")}getFontInfo(t){return t?t.getOption(59):Who({fontFamily:this._configurationService.getValue("editor").fontFamily},1)}},Khe=HF,HF._ttpTokenizer=cC("tokenizeToString",{createHTML(t){return t}}),HF);OXe=Khe=rMo([T8t(0,cr),T8t(1,lc)],OXe);var Git=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},ca=function(e,t){return function(n,r){t(n,r,e)}};let oMo=0,E8t=!1;function sMo(e){if(!e){if(E8t)return;E8t=!0}yco(e||Ls.document.body)}let _0e=class extends TP{constructor(t,n,r,o,s,a,l,d,u,h,f,g,k,A){const m={...n};m.ariaLabel=m.ariaLabel||aZe.editorViewAccessibleLabel,super(t,m,{},r,o,s,a,u,h,f,g,k),d instanceof GV?this._standaloneKeybindingService=d:this._standaloneKeybindingService=null,sMo(m.ariaContainerElement),G2o((v,p)=>r.createInstance(BV,v,{instantHover:p},{})),obo(l),A.setDefaultCodeBlockRenderer(r.createInstance(OXe))}addCommand(t,n,r){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const o="DYNAMIC_"+ ++oMo,s=zt.deserialize(r);return this._standaloneKeybindingService.addDynamicKeybinding(o,t,n,s),o}createContextKey(t,n){return this._contextKeyService.createKey(t,n)}addAction(t){if(typeof t.id!="string"||typeof t.label!="string"||typeof t.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),ct.None;const n=t.id,r=t.label,o=zt.and(zt.equals("editorId",this.getId()),zt.deserialize(t.precondition)),s=t.keybindings,a=zt.and(o,zt.deserialize(t.keybindingContext)),l=t.contextMenuGroupId||null,d=t.contextMenuOrder||0,u=(k,...A)=>Promise.resolve(t.run(this,...A)),h=new Pt,f=this.getId()+":"+n;if(h.add(ho.registerCommand(f,u)),l){const k={command:{id:f,title:r},when:o,group:l,order:d};h.add(ju.appendMenuItem(Yn.EditorContext,k))}if(Array.isArray(s))for(const k of s)h.add(this._standaloneKeybindingService.addDynamicKeybinding(f,k,u,a));const g=new UQn(f,r,r,void 0,o,(...k)=>Promise.resolve(t.run(this,...k)),this._contextKeyService);return this._actions.set(n,g),h.add(Gn(()=>{this._actions.delete(n)})),h}_triggerCommand(t,n){if(this._codeEditorService instanceof U0e)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(t,n)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(t,n)}};_0e=Git([ca(2,$n),ca(3,Co),ca(4,Ca),ca(5,Fi),ca(6,Lg),ca(7,Fo),ca(8,Il),ca(9,cc),ca(10,xh),ca(11,bl),ca(12,Zn),ca(13,D4)],_0e);let wXe=class extends _0e{constructor(t,n,r,o,s,a,l,d,u,h,f,g,k,A,m,v,p){const b={...n};J0e(f,b,!1);const O=u.registerEditorContainer(t);typeof b.theme=="string"&&u.setTheme(b.theme),typeof b.autoDetectHighContrast<"u"&&u.setAutoDetectHighContrast(!!b.autoDetectHighContrast);const w=b.model;delete b.model,super(t,b,r,o,s,a,l,d,u,h,g,m,v,p),this._configurationService=f,this._standaloneThemeService=u,this._register(O);let y;if(typeof w>"u"){const C=A.getLanguageIdByMimeType(b.language)||b.language||dk;y=HIn(k,A,b.value||"",C,void 0),this._ownsModel=!0}else y=w,this._ownsModel=!1;if(this._attachModel(y),y){const C={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(C)}}dispose(){super.dispose()}updateOptions(t){J0e(this._configurationService,t,!1),typeof t.theme=="string"&&this._standaloneThemeService.setTheme(t.theme),typeof t.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!t.autoDetectHighContrast),super.updateOptions(t)}_postDetachModelCleanup(t){super._postDetachModelCleanup(t),t&&this._ownsModel&&(t.dispose(),this._ownsModel=!1)}};wXe=Git([ca(2,$n),ca(3,Co),ca(4,Ca),ca(5,Fi),ca(6,Lg),ca(7,Fo),ca(8,Dk),ca(9,cc),ca(10,cr),ca(11,xh),ca(12,pl),ca(13,lc),ca(14,bl),ca(15,Zn),ca(16,D4)],wXe);let yXe=class extends jy{constructor(t,n,r,o,s,a,l,d,u,h,f,g){const k={...n};J0e(d,k,!0);const A=a.registerEditorContainer(t);typeof k.theme=="string"&&a.setTheme(k.theme),typeof k.autoDetectHighContrast<"u"&&a.setAutoDetectHighContrast(!!k.autoDetectHighContrast),super(t,k,{},o,r,s,g,h),this._configurationService=d,this._standaloneThemeService=a,this._register(A)}dispose(){super.dispose()}updateOptions(t){J0e(this._configurationService,t,!0),typeof t.theme=="string"&&this._standaloneThemeService.setTheme(t.theme),typeof t.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!t.autoDetectHighContrast),super.updateOptions(t)}_createInnerEditor(t,n,r){return t.createInstance(_0e,n,r)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(t,n,r){return this.getModifiedEditor().addCommand(t,n,r)}createContextKey(t,n){return this.getModifiedEditor().createContextKey(t,n)}addAction(t){return this.getModifiedEditor().addAction(t)}};yXe=Git([ca(2,$n),ca(3,Fi),ca(4,Co),ca(5,Dk),ca(6,cc),ca(7,cr),ca(8,Ek),ca(9,e6),ca(10,z1),ca(11,E6)],yXe);function HIn(e,t,n,r,o){if(n=n||"",!r){const s=n.indexOf(` `);let a=n;return s!==-1&&(a=n.substring(0,s)),D8t(e,n,t.createByFilepathOrFirstLine(o||null,a),o)}return D8t(e,n,t.createById(r),o)}function D8t(e,t,n,r){return e.createModel(t,n,r)}He("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},j(142,"The background color of the diff editor's header"));He("multiDiffEditor.background",Tc,j(143,"The background color of the multi file diff editor"));He("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},j(144,"The border color of the multi file diff editor"));var aMo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Q8t=function(e,t){return function(n,r){t(n,r,e)}};class lMo{constructor(t,n){this.viewModel=t,this.deltaScrollVertical=n}getId(){return this.viewModel}}let CXe=class extends ct{constructor(t,n,r,o,s){super(),this._container=t,this._overflowWidgetsDomNode=n,this._workbenchUIElementFactory=r,this._instantiationService=o,this._viewModel=Bi(this,void 0),this._collapsed=Wt(this,d=>{var u;return(u=this._viewModel.read(d))==null?void 0:u.collapsed.read(d)}),this._editorContentHeight=Bi(this,500),this.contentHeight=Wt(this,d=>(this._collapsed.read(d)?0:this._editorContentHeight.read(d))+this._outerEditorHeight),this._modifiedContentWidth=Bi(this,0),this._modifiedWidth=Bi(this,0),this._originalContentWidth=Bi(this,0),this._originalWidth=Bi(this,0),this.maxScroll=Wt(this,d=>{const u=this._modifiedContentWidth.read(d)-this._modifiedWidth.read(d),h=this._originalContentWidth.read(d)-this._originalWidth.read(d);return u>h?{maxScroll:u,width:this._modifiedWidth.read(d)}:{maxScroll:h,width:this._originalWidth.read(d)}}),this._elements=wo("div.multiDiffEntry",[wo("div.header@header",[wo("div.header-content",[wo("div.collapse-button@collapseButton"),wo("div.file-path",[wo("div.title.modified.show-file-icons@primaryPath",[]),wo("div.status.deleted@status",["R"]),wo("div.title.original.show-file-icons@secondaryPath",[])]),wo("div.actions@actions")])]),wo("div.editorParent",[wo("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(jy,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode,fixedOverflowWidgets:!0},{})),this.isModifedFocused=ml(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=ml(this.editor.getOriginalEditor()).isFocused,this.isFocused=Wt(this,d=>this.isModifedFocused.read(d)||this.isOriginalFocused.read(d)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new Pt),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const a=new h1e(this._elements.collapseButton,{});this._register(xi(d=>{a.element.className="",a.icon=this._collapsed.read(d)?Jt.chevronRight:Jt.chevronDown})),this._register(a.onDidClick(()=>{var d;(d=this._viewModel.get())==null||d.collapsed.set(!this._collapsed.get(),void 0)})),this._register(xi(d=>{this._elements.editor.style.display=this._collapsed.read(d)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(d=>{const u=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(u,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(d=>{const u=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(u,void 0)})),this._register(this.editor.onDidContentSizeChange(d=>{Jq(u=>{this._editorContentHeight.set(d.contentHeight,u),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),u),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),u)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(d=>{if(this._isSettingScrollTop||!d.scrollTopChanged||!this._data)return;const u=d.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(u)})),this._register(xi(d=>{var h;const u=(h=this._viewModel.read(d))==null?void 0:h.isActive.read(d);this._elements.root.classList.toggle("active",u)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(s.createScoped(this._elements.actions));const l=this._register(this._instantiationService.createChild(new OZ([Fi,this._contextKeyService])));this._register(l.createInstance(_$,this._elements.actions,Yn.MultiDiffEditorFileToolbar,{actionRunner:this._register(new TFn(()=>{var d,u;return((d=this._viewModel.get())==null?void 0:d.modifiedUri)??((u=this._viewModel.get())==null?void 0:u.originalUri)})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:d=>d.startsWith("navigation")},actionViewItemProvider:(d,u)=>knt(l,d,u)}))}setScrollLeft(t){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(t):this.editor.getOriginalEditor().setScrollLeft(t)}setData(t){this._data=t;function n(o){return{...o,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!t){Jq(o=>{this._viewModel.set(void 0,o),this.editor.setDiffModel(null,o),this._dataStore.clear()});return}const r=t.viewModel.documentDiffItem;if(Jq(o=>{var u,h;(u=this._resourceLabel)==null||u.setUri(t.viewModel.modifiedUri??t.viewModel.originalUri,{strikethrough:t.viewModel.modifiedUri===void 0});let s=!1,a=!1,l=!1,d="";t.viewModel.modifiedUri&&t.viewModel.originalUri&&t.viewModel.modifiedUri.path!==t.viewModel.originalUri.path?(d="R",s=!0):t.viewModel.modifiedUri?t.viewModel.originalUri||(d="A",l=!0):(d="D",a=!0),this._elements.status.classList.toggle("renamed",s),this._elements.status.classList.toggle("deleted",a),this._elements.status.classList.toggle("added",l),this._elements.status.innerText=d,(h=this._resourceLabel2)==null||h.setUri(s?t.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(t.viewModel,o),this.editor.setDiffModel(t.viewModel.diffEditorViewModelRef,o),this.editor.updateOptions(n(r.options??{}))}),r.onOptionsDidChange&&this._dataStore.add(r.onOptionsDidChange(()=>{this.editor.updateOptions(n(r.options??{}))})),t.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,o=>{o||this.setData(void 0)}),t.viewModel.documentDiffItem.contextKeys)for(const[o,s]of Object.entries(t.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(o,s)}render(t,n,r,o){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${t.start}px`,this._elements.root.style.height=`${t.length}px`,this._elements.root.style.width=`${n}px`,this._elements.root.style.position="absolute";const s=t.length-this._headerHeight,a=Math.max(0,Math.min(o.start-t.start,s));this._elements.header.style.transform=`translateY(${a}px)`,Jq(l=>{this.editor.layout({width:n-2*8-2*1,height:t.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=r,this.editor.getOriginalEditor().setScrollTop(r)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",a>0||r>0),this._elements.header.classList.toggle("collapsed",a===s)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};CXe=aMo([Q8t(3,$n),Q8t(4,Fi)],CXe);class cMo{constructor(t){this._create=t,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(t){let n;if(this._unused.size===0)n=this._create(t),this._itemData.set(n,t);else{const r=[...this._unused.values()];n=r.find(o=>this._itemData.get(o).getId()===t.getId())??r[0],this._unused.delete(n),this._itemData.set(n,t),n.setData(t)}return this._used.add(n),{object:n,dispose:()=>{this._used.delete(n),this._unused.size>5?n.dispose():this._unused.add(n)}}}dispose(){for(const t of this._used)t.dispose();for(const t of this._unused)t.dispose();this._used.clear(),this._unused.clear()}}var dMo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},B8t=function(e,t){return function(n,r){t(n,r,e)}};let xXe=class extends ct{constructor(t,n,r,o,s,a){super(),this._element=t,this._dimension=n,this._viewModel=r,this._workbenchUIElementFactory=o,this._parentContextKeyService=s,this._parentInstantiationService=a,this._scrollableElements=wo("div.scrollContent",[wo("div@content",{style:{overflow:"hidden"}}),wo("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new pZ({forceIntegerValues:!1,scheduleAtNextAnimationFrame:u=>Cm(oi(this._element),u),smoothScrollDuration:100})),this._scrollableElement=this._register(new vOe(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=wo("div.monaco-component.multiDiffEditor",{},[wo("div",{},[this._scrollableElement.getDomNode()]),wo("div.placeholder@placeholder",{},[wo("div")])]),this._sizeObserver=this._register(new lFn(this._element,void 0)),this._objectPool=this._register(new cMo(u=>{const h=this._instantiationService.createInstance(CXe,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return h.setData(u),h})),this.scrollTop=es(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=es(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=Wt(this,u=>{const h=this._viewModel.read(u);if(!h)return{items:[],getItem:A=>{throw new Ai}};const f=h.items.read(u),g=new Map;return{items:f.map(A=>{var p;const m=u.store.add(new hMo(A,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),v=(p=this._lastDocStates)==null?void 0:p[m.getKey()];return v&&ua(b=>{m.setViewState(v,b)}),g.set(A,m),m}),getItem:A=>g.get(A)}}),this._viewItems=this._viewItemsInfo.map(this,u=>u.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(u,h)=>u.reduce((f,g)=>f+g.contentHeight.read(h)+this._spaceBetweenPx,0)),this.activeControl=Wt(this,u=>{var g,k;const h=(g=this._viewModel.read(u))==null?void 0:g.activeDiffItem.read(u);return h?(k=this._viewItemsInfo.read(u).getItem(h).template.read(u))==null?void 0:k.editor:void 0}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new OZ([Fi,this._contextKeyService]))),this._contextKeyService.createKey(Ze.inMultiDiffEditor.key,!0),this._lastDocStates={},this._register(PA((u,h)=>{const f=this._viewModel.read(u);if(f&&f.contextKeys)for(const[g,k]of Object.entries(f.contextKeys)){const A=this._contextKeyService.createKey(g,void 0);A.set(k),h.add(Gn(()=>A.reset()))}}));const l=this._parentContextKeyService.createKey(Ze.multiDiffEditorAllCollapsed.key,!1);this._register(xi(u=>{const h=this._viewModel.read(u);if(h){const f=h.items.read(u).every(g=>g.collapsed.read(u));l.set(f)}})),this._register(xi(u=>{const h=this._dimension.read(u);this._sizeObserver.observe(h)}));const d=Wt(u=>{if(this._viewItems.read(u).length>0)return;const f=this._viewModel.read(u);return!f||f.isLoading.read(u)?j(145,"Loading..."):j(146,"No Changed Files")});this._register(xi(u=>{const h=d.read(u);this._elements.placeholder.innerText=h??"",this._elements.placeholder.classList.toggle("visible",!!h)})),this._scrollableElements.content.style.position="relative",this._register(xi(u=>{const h=this._sizeObserver.height.read(u);this._scrollableElements.root.style.height=`${h}px`;const f=this._totalHeight.read(u);this._scrollableElements.content.style.height=`${f}px`;const g=this._sizeObserver.width.read(u);let k=g;const A=this._viewItems.read(u),m=vtt(A,nA(v=>v.maxScroll.read(u).maxScroll,P1));if(m){const v=m.maxScroll.read(u);k=g+v.maxScroll}this._scrollableElement.setScrollDimensions({width:g,height:h,scrollHeight:f,scrollWidth:k})})),t.replaceChildren(this._elements.root),this._register(Gn(()=>{t.replaceChildren()})),this._register(xi(u=>{const h=this._viewModel.read(u);if(h&&!h.isLoading.read(u)){if(h.items.read(u).length===0||h.activeDiffItem.read(u))return;this.goToNextChange()}})),this._register(this._register(xi(u=>{Jq(h=>{this.render(u)})})))}reveal(t,n){var u;const r=this._viewItems.get(),o=r.findIndex(h=>{var f,g,k,A;return((f=h.viewModel.originalUri)==null?void 0:f.toString())===((g=t.original)==null?void 0:g.toString())&&((k=h.viewModel.modifiedUri)==null?void 0:k.toString())===((A=t.modified)==null?void 0:A.toString())});if(o===-1)throw new Ai("Resource not found in diff editor");const s=r[o];this._viewModel.get().activeDiffItem.setCache(s.viewModel,void 0);let a=0;for(let h=0;hk.viewModel===r):-1;if(o===-1){this._goToFile(0,"first");return}const s=n[o];s.viewModel.collapsed.get()&&s.viewModel.collapsed.set(!1,void 0);const a=(u=s.template.get())==null?void 0:u.editor;if((f=(h=a==null?void 0:a.getDiffComputationResult())==null?void 0:h.changes2)!=null&&f.length){const k=((g=a.getModifiedEditor().getPosition())==null?void 0:g.lineNumber)||1,A=a.getDiffComputationResult().changes2;if(t==="next"?A.some(v=>v.modified.startLineNumber>k):A.some(v=>v.modified.endLineNumberExclusive<=k)){a.goToDiff(t);return}}const l=(o+(t==="next"?1:-1)+n.length)%n.length;this._goToFile(l,t==="next"?"first":"last")}_goToFile(t,n){var s,a,l;const r=this._viewItems.get()[t];r.viewModel.collapsed.get()&&r.viewModel.collapsed.set(!1,void 0),this.reveal({original:r.viewModel.originalUri,modified:r.viewModel.modifiedUri});const o=(s=r.template.get())==null?void 0:s.editor;if((l=(a=o==null?void 0:o.getDiffComputationResult())==null?void 0:a.changes2)!=null&&l.length)if(n==="first")o.revealFirstDiff();else{const d=o.getDiffComputationResult().changes2.at(-1),u=o.getModifiedEditor();u.setPosition({lineNumber:d.modified.startLineNumber,column:1}),u.revealLineInCenter(d.modified.startLineNumber)}o==null||o.focus()}render(t){const n=this.scrollTop.read(t);let r=0,o=0,s=0;const a=this._sizeObserver.height.read(t),l=Jn.ofStartAndLength(n,a),d=this._sizeObserver.width.read(t);for(const u of this._viewItems.read(t)){const h=u.contentHeight.read(t),f=Math.min(h,a),g=Jn.ofStartAndLength(o,f),k=Jn.ofStartAndLength(s,h);if(k.isBefore(l))r-=h-f,u.hide();else if(k.isAfter(l))u.hide();else{const A=Math.max(0,Math.min(l.start-k.start,h-f));r-=A;const m=Jn.ofStartAndLength(n+r,a);u.render(g,A,d,m)}o+=f+this._spaceBetweenPx,s+=h+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(n+r)}px)`}};xXe=dMo([B8t(4,Fi),B8t(5,$n)],xXe);function uMo(e,t){const n=e.getModel(),r=e.createDecorationsCollection([{range:t,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{e.getModel()===n&&r.clear()},350)}class hMo extends ct{constructor(t,n,r,o){super(),this.viewModel=t,this._objectPool=n,this._scrollLeft=r,this._deltaScrollVertical=o,this._templateRef=this._register(Pet(this,void 0)),this.contentHeight=Wt(this,s=>{var a,l;return((l=(a=this._templateRef.read(s))==null?void 0:a.object.contentHeight)==null?void 0:l.read(s))??this.viewModel.lastTemplateData.read(s).contentHeight}),this.maxScroll=Wt(this,s=>{var a;return((a=this._templateRef.read(s))==null?void 0:a.object.maxScroll.read(s))??{maxScroll:0,scrollWidth:0}}),this.template=Wt(this,s=>{var a;return(a=this._templateRef.read(s))==null?void 0:a.object}),this._isHidden=Bi(this,!1),this._isFocused=Wt(this,s=>{var a;return((a=this.template.read(s))==null?void 0:a.isFocused.read(s))??!1}),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(xi(s=>{var l;const a=this._scrollLeft.read(s);(l=this._templateRef.read(s))==null||l.object.setScrollLeft(a)})),this._register(xi(s=>{const a=this._templateRef.read(s);!a||!this._isHidden.read(s)||a.object.isFocused.read(s)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var t;return`VirtualViewItem(${(t=this.viewModel.documentDiffItem.modified)==null?void 0:t.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(t,n){var a;this.viewModel.collapsed.set(t.collapsed,n),this._updateTemplateData(n);const r=this.viewModel.lastTemplateData.get(),o=(a=t.selections)==null?void 0:a.map(Rn.liftSelection);this.viewModel.lastTemplateData.set({...r,selections:o},n);const s=this._templateRef.get();s&&o&&s.object.editor.setSelections(o)}_updateTemplateData(t){const n=this._templateRef.get();n&&this.viewModel.lastTemplateData.set({contentHeight:n.object.contentHeight.get(),selections:n.object.editor.getSelections()??void 0},t)}_clear(){const t=this._templateRef.get();t&&ua(n=>{this._updateTemplateData(n),t.object.hide(),this._templateRef.set(void 0,n)})}hide(){this._isHidden.set(!0,void 0)}render(t,n,r,o){this._isHidden.set(!1,void 0);let s=this._templateRef.get();if(!s){s=this._objectPool.getUnusedObj(new lMo(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(s,void 0);const a=this.viewModel.lastTemplateData.get().selections;a&&s.object.editor.setSelections(a)}s.object.render(t,r,n,o)}}var AMo=function(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},fMo=function(e,t){return function(n,r){t(n,r,e)}};let LXe=class extends ct{constructor(t,n,r){super(),this._element=t,this._workbenchUIElementFactory=n,this._instantiationService=r,this._dimension=Bi(this,void 0),this._viewModel=Bi(this,void 0),this._widgetImpl=Wt(this,o=>o.store.add(this._instantiationService.createInstance(Tx(xXe),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory))),this._register(gV(this._widgetImpl))}};LXe=AMo([fMo(2,$n)],LXe);function gMo(e,t,n){return Xi.initialize(n||{}).createInstance(wXe,e,t)}function mMo(e){return Xi.get(Co).onCodeEditorAdd(n=>{e(n)})}function kMo(e){return Xi.get(Co).onDiffEditorAdd(n=>{e(n)})}function vMo(){return Xi.get(Co).listCodeEditors()}function pMo(){return Xi.get(Co).listDiffEditors()}function bMo(e,t,n){return Xi.initialize(n||{}).createInstance(yXe,e,t)}function OMo(e,t){const n=Xi.initialize(t||{});return new LXe(e,{},n)}function wMo(e){if(typeof e.id!="string"||typeof e.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return ho.registerCommand(e.id,e.run)}function yMo(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const t=zt.deserialize(e.precondition),n=(o,...s)=>$d.runEditorCommand(o,s,t,(a,l,d)=>Promise.resolve(e.run(l,...d))),r=new Pt;if(r.add(ho.registerCommand(e.id,n)),e.contextMenuGroupId){const o={command:{id:e.id,title:e.label},when:t,group:e.contextMenuGroupId,order:e.contextMenuOrder||0};r.add(ju.appendMenuItem(Yn.EditorContext,o))}if(Array.isArray(e.keybindings)){const o=Xi.get(Fo);if(!(o instanceof GV))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const s=zt.and(t,zt.deserialize(e.keybindingContext));r.add(o.addDynamicKeybindings(e.keybindings.map(a=>({keybinding:a,command:e.id,when:s}))))}}return r}function CMo(e){return VIn([e])}function VIn(e){const t=Xi.get(Fo);return t instanceof GV?t.addDynamicKeybindings(e.map(n=>({keybinding:n.keybinding,command:n.command,commandArgs:n.commandArgs,when:zt.deserialize(n.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),ct.None)}function xMo(e,t,n){const r=Xi.get(lc),o=r.getLanguageIdByMimeType(t)||t;return HIn(Xi.get(pl),r,e,o,n)}function LMo(e,t){const n=Xi.get(lc),r=n.getLanguageIdByMimeType(t)||t||dk;e.setLanguage(n.createById(r))}function SMo(e,t,n){e&&Xi.get(hC).changeOne(t,e.uri,n)}function TMo(e){Xi.get(hC).changeAll(e,[])}function EMo(e){return Xi.get(hC).read(e)}function DMo(e){return Xi.get(hC).onMarkerChanged(e)}function QMo(e){return Xi.get(pl).getModel(e)}function BMo(){return Xi.get(pl).getModels()}function FMo(e){return Xi.get(pl).onModelAdded(e)}function PMo(e){return Xi.get(pl).onModelRemoved(e)}function MMo(e){return Xi.get(pl).onModelLanguageChanged(n=>{e({model:n.model,oldLanguage:n.oldLanguageId})})}function RMo(e){return HBo(Xi.get(pl),e)}function IMo(e,t){const n=Xi.get(lc),r=Xi.get(Dk);return zit.colorizeElement(r,n,e,t).then(()=>{r.registerEditorContainer(e)})}function NMo(e,t,n){const r=Xi.get(lc);return Xi.get(Dk).registerEditorContainer(Ls.document.body),zit.colorize(r,e,t,n)}function UMo(e,t,n=4){return Xi.get(Dk).registerEditorContainer(Ls.document.body),zit.colorizeModelLine(e,t,n)}function jMo(e){const t=Kl.get(e);return t||{getInitialState:()=>EV,tokenize:(n,r,o)=>Itt(e,o)}}function WMo(e,t){Kl.getOrCreate(t);const n=jMo(t),r=W1(e),o=[];let s=n.getInitialState();for(let a=0,l=r.length;a{var l;if(!r)return null;const s=(l=n.options)==null?void 0:l.selection;let a;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?a=s:s&&(a={lineNumber:s.startLineNumber,column:s.startColumn}),await e.openCodeEditor(r,n.resource,a)?r:null})}function qMo(){return{create:gMo,getEditors:vMo,getDiffEditors:pMo,onDidCreateEditor:mMo,onDidCreateDiffEditor:kMo,createDiffEditor:bMo,addCommand:wMo,addEditorAction:yMo,addKeybindingRule:CMo,addKeybindingRules:VIn,createModel:xMo,setModelLanguage:LMo,setModelMarkers:SMo,getModelMarkers:EMo,removeAllMarkers:TMo,onDidChangeMarkers:DMo,getModels:BMo,getModel:QMo,onDidCreateModel:FMo,onWillDisposeModel:PMo,onDidChangeModelLanguage:MMo,createWebWorker:RMo,colorizeElement:IMo,colorize:NMo,colorizeModelLine:UMo,tokenize:WMo,defineTheme:HMo,setTheme:VMo,remeasureFonts:zMo,registerCommand:ZMo,registerLinkOpener:YMo,registerEditorOpener:XMo,AccessibilitySupport:wZe,ContentWidgetPositionPreference:TZe,CursorChangeReason:EZe,DefaultEndOfLine:DZe,EditorAutoIndentStrategy:BZe,EditorOption:FZe,EndOfLinePreference:PZe,EndOfLineSequence:MZe,MinimapPosition:XZe,MinimapSectionHeaderStyle:qZe,MouseTargetType:GZe,OverlayWidgetPositionPreference:_Ze,OverviewRulerLane:$Ze,GlyphMarginLane:RZe,RenderLineNumbersType:nYe,RenderMinimap:iYe,ScrollbarVisibility:oYe,ScrollType:rYe,TextEditorCursorBlinkingStyle:hYe,TextEditorCursorStyle:AYe,TrackedRangeStickiness:fYe,WrappingIndent:gYe,InjectedTextCursorStops:UZe,PositionAffinity:tYe,ShowLightbulbIconMode:aYe,TextDirection:uYe,ConfigurationChangedEvent:bDn,BareFontInfo:wP,FontInfo:cme,TextModelResolvedOptions:vhe,FindMatch:g$,ApplyUpdateResult:EK,EditorZoom:Iv,createMultiFileDiffEditor:OMo,EditorType:rre,EditorOptions:bf}}function GMo(e,t){if(!t||!Array.isArray(t))return!1;for(const n of t)if(!e(n))return!1;return!0}function Xce(e,t){return typeof e=="boolean"?e:t}function F8t(e,t){return typeof e=="string"?e:t}function KMo(e){const t={};for(const n of e)t[n]=!0;return t}function P8t(e,t=!1){t&&(e=e.map(function(r){return r.toLowerCase()}));const n=KMo(e);return t?function(r){return n[r.toLowerCase()]!==void 0&&n.hasOwnProperty(r.toLowerCase())}:function(r){return n[r]!==void 0&&n.hasOwnProperty(r)}}function SXe(e,t,n){t=t.replace(/@@/g,"");let r=0,o;do o=!1,t=t.replace(/@(\w+)/g,function(a,l){o=!0;let d="";if(typeof e[l]=="string")d=e[l];else if(e[l]&&e[l]instanceof RegExp)d=e[l].source;else throw e[l]===void 0?Na(e,"language definition does not contain attribute '"+l+"', used at: "+t):Na(e,"attribute reference '"+l+"' must be a string, used at: "+t);return YD(d)?"":"(?:"+d+")"}),r++;while(o&&r<5);t=t.replace(/\x01/g,"@");const s=(e.ignoreCase?"i":"")+(e.unicode?"u":"");if(n&&t.match(/\$[sS](\d\d?)/g)){let l=null,d=null;return u=>(d&&l===u||(l=u,d=new RegExp(XBo(e,t,u),s)),d)}return new RegExp(t,s)}function JMo(e,t,n,r){if(r<0)return e;if(r=100){r=r-100;const o=n.split(".");if(o.unshift(n),r=0&&(r.tokenSubst=!0),typeof n.bracket=="string")if(n.bracket==="@open")r.bracket=1;else if(n.bracket==="@close")r.bracket=-1;else throw Na(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);if(n.next){if(typeof n.next!="string")throw Na(e,"the next state must be a string value in rule: "+t);{let o=n.next;if(!/^(@pop|@push|@popall)$/.test(o)&&(o[0]==="@"&&(o=o.substr(1)),o.indexOf("$")<0&&!qBo(e,YS(e,o,"",[],""))))throw Na(e,"the next state '"+n.next+"' is not defined in rule: "+t);r.next=o}}return typeof n.goBack=="number"&&(r.goBack=n.goBack),typeof n.switchTo=="string"&&(r.switchTo=n.switchTo),typeof n.log=="string"&&(r.log=n.log),typeof n.nextEmbedded=="string"&&(r.nextEmbedded=n.nextEmbedded,e.usesEmbedded=!0),r}}else if(Array.isArray(n)){const r=[];for(let o=0,s=n.length;o0&&r[0]==="^",this.name=this.name+": "+r,this.regex=SXe(t,"^(?:"+(this.matchOnlyAtLineStart?r.substr(1):r)+")",!0)}setAction(t,n){this.action=TXe(t,this.name,n)}resolveRegex(t){return this.regex instanceof RegExp?this.regex:this.regex(t)}}function zIn(e,t){if(!t||typeof t!="object")throw new Error("Monarch: expecting a language definition object");const n={languageId:e,includeLF:Xce(t.includeLF,!1),noThrow:!1,maxStack:100,start:typeof t.start=="string"?t.start:null,ignoreCase:Xce(t.ignoreCase,!1),unicode:Xce(t.unicode,!1),tokenPostfix:F8t(t.tokenPostfix,"."+e),defaultToken:F8t(t.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},r=t;r.languageId=e,r.includeLF=n.includeLF,r.ignoreCase=n.ignoreCase,r.unicode=n.unicode,r.noThrow=n.noThrow,r.usesEmbedded=n.usesEmbedded,r.stateNames=t.tokenizer,r.defaultToken=n.defaultToken;function o(a,l,d){for(const u of d){let h=u.include;if(h){if(typeof h!="string")throw Na(n,"an 'include' attribute must be a string at: "+a);if(h[0]==="@"&&(h=h.substr(1)),!t.tokenizer[h])throw Na(n,"include target '"+h+"' is not defined at: "+a);o(a+"."+h,l,t.tokenizer[h])}else{const f=new $Mo(a);if(Array.isArray(u)&&u.length>=1&&u.length<=3)if(f.setRegex(r,u[0]),u.length>=3)if(typeof u[1]=="string")f.setAction(r,{token:u[1],next:u[2]});else if(typeof u[1]=="object"){const g=u[1];g.next=u[2],f.setAction(r,g)}else throw Na(n,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+a);else f.setAction(r,u[1]);else{if(!u.regex)throw Na(n,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+a);u.name&&typeof u.name=="string"&&(f.name=u.name),u.matchOnlyAtStart&&(f.matchOnlyAtLineStart=Xce(u.matchOnlyAtLineStart,!1)),f.setRegex(r,u.regex),f.setAction(r,u.action)}l.push(f)}}}if(!t.tokenizer||typeof t.tokenizer!="object")throw Na(n,"a language definition must define the 'tokenizer' attribute as an object");n.tokenizer=[];for(const a in t.tokenizer)if(t.tokenizer.hasOwnProperty(a)){n.start||(n.start=a);const l=t.tokenizer[a];n.tokenizer[a]=new Array,o("tokenizer."+a,n.tokenizer[a],l)}if(n.usesEmbedded=r.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw Na(n,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const s=[];for(const a of t.brackets){let l=a;if(l&&Array.isArray(l)&&l.length===3&&(l={token:l[2],open:l[0],close:l[1]}),l.open===l.close)throw Na(n,"open and close brackets in a 'brackets' attribute must be different: "+l.open+` hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof l.open=="string"&&typeof l.token=="string"&&typeof l.close=="string")s.push({token:l.token+n.tokenPostfix,open:k8(n,l.open),close:k8(n,l.close)});else throw Na(n,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return n.brackets=s,n.noThrow=!0,n}function eRo(e){kV.registerLanguage(e)}function tRo(){let e=[];return e=e.concat(kV.getLanguages()),e}function nRo(e){return Xi.get(lc).languageIdCodec.encodeLanguageId(e)}function iRo(e,t){return Xi.withServices(()=>{const r=Xi.get(lc).onDidRequestRichLanguageFeatures(o=>{o===e&&(r.dispose(),t())});return r})}function rRo(e,t){return Xi.withServices(()=>{const r=Xi.get(lc).onDidRequestBasicLanguageFeatures(o=>{o===e&&(r.dispose(),t())});return r})}function oRo(e,t){if(!Xi.get(lc).isRegisteredLanguageId(e))throw new Error(`Cannot set configuration for unknown language ${e}`);return Xi.get(bl).register(e,t,100)}class sRo{constructor(t,n){this._languageId=t,this._actual=n}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(t,n,r){if(typeof this._actual.tokenize=="function")return Zee.adaptTokenize(this._languageId,this._actual,t,r);throw new Error("Not supported!")}tokenizeEncoded(t,n,r){const o=this._actual.tokenizeEncoded(t,r);return new wOe(o.tokens,o.endState)}}class Zee{constructor(t,n,r,o){this._languageId=t,this._actual=n,this._languageService=r,this._standaloneThemeService=o}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(t,n){const r=[];let o=0;for(let s=0,a=t.length;s0&&s[a-1]===g)continue;let k=f.startIndex;u===0?k=0:k{const r=await Promise.resolve(t.create());return r?aRo(r)?YIn(e,r):new Nee(Xi.get(lc),Xi.get(Dk),e,zIn(e,r),Xi.get(cr)):null});return Kl.registerFactory(e,n)}function dRo(e,t){if(!Xi.get(lc).isRegisteredLanguageId(e))throw new Error(`Cannot set tokens provider for unknown language ${e}`);return ZIn(t)?Kit(e,{create:()=>t}):Kl.register(e,YIn(e,t))}function uRo(e,t){const n=r=>new Nee(Xi.get(lc),Xi.get(Dk),e,zIn(e,r),Xi.get(cr));return ZIn(t)?Kit(e,{create:()=>t}):Kl.register(e,n(t))}function hRo(e,t){return Xi.get(Zn).referenceProvider.register(e,t)}function ARo(e,t){return Xi.get(Zn).renameProvider.register(e,t)}function fRo(e,t){return Xi.get(Zn).newSymbolNamesProvider.register(e,t)}function gRo(e,t){return Xi.get(Zn).signatureHelpProvider.register(e,t)}function mRo(e,t){return Xi.get(Zn).hoverProvider.register(e,{provideHover:async(r,o,s,a)=>{const l=r.getWordAtPosition(o);return Promise.resolve(t.provideHover(r,o,s,a)).then(d=>{if(d)return!d.range&&l&&(d.range=new De(o.lineNumber,l.startColumn,o.lineNumber,l.endColumn)),d.range||(d.range=new De(o.lineNumber,o.column,o.lineNumber,o.column)),d})}})}function kRo(e,t){return Xi.get(Zn).documentSymbolProvider.register(e,t)}function vRo(e,t){return Xi.get(Zn).documentHighlightProvider.register(e,t)}function pRo(e,t){return Xi.get(Zn).linkedEditingRangeProvider.register(e,t)}function bRo(e,t){return Xi.get(Zn).definitionProvider.register(e,t)}function ORo(e,t){return Xi.get(Zn).implementationProvider.register(e,t)}function wRo(e,t){return Xi.get(Zn).typeDefinitionProvider.register(e,t)}function yRo(e,t){return Xi.get(Zn).codeLensProvider.register(e,t)}function CRo(e,t,n){return Xi.get(Zn).codeActionProvider.register(e,{providedCodeActionKinds:n==null?void 0:n.providedCodeActionKinds,documentation:n==null?void 0:n.documentation,provideCodeActions:(o,s,a,l)=>{const u=Xi.get(hC).read({resource:o.uri}).filter(h=>De.areIntersectingOrTouching(h,s));return t.provideCodeActions(o,s,{markers:u,only:a.only,trigger:a.trigger},l)},resolveCodeAction:t.resolveCodeAction})}function xRo(e,t){return Xi.get(Zn).documentFormattingEditProvider.register(e,t)}function LRo(e,t){return Xi.get(Zn).documentRangeFormattingEditProvider.register(e,t)}function SRo(e,t){return Xi.get(Zn).onTypeFormattingEditProvider.register(e,t)}function TRo(e,t){return Xi.get(Zn).linkProvider.register(e,t)}function ERo(e,t){return Xi.get(Zn).completionProvider.register(e,t)}function DRo(e,t){return Xi.get(Zn).colorProvider.register(e,t)}function QRo(e,t){return Xi.get(Zn).foldingRangeProvider.register(e,t)}function BRo(e,t){return Xi.get(Zn).declarationProvider.register(e,t)}function FRo(e,t){return Xi.get(Zn).selectionRangeProvider.register(e,t)}function PRo(e,t){return Xi.get(Zn).documentSemanticTokensProvider.register(e,t)}function MRo(e,t){return Xi.get(Zn).documentRangeSemanticTokensProvider.register(e,t)}function RRo(e,t){return Xi.get(Zn).inlineCompletionsProvider.register(e,t)}function IRo(e,t){return Xi.get(Zn).inlayHintsProvider.register(e,t)}function NRo(){return{register:eRo,getLanguages:tRo,onLanguage:iRo,onLanguageEncountered:rRo,getEncodedLanguageId:nRo,setLanguageConfiguration:oRo,setColorMap:cRo,registerTokensProviderFactory:Kit,setTokensProvider:dRo,setMonarchTokensProvider:uRo,registerReferenceProvider:hRo,registerRenameProvider:ARo,registerNewSymbolNameProvider:fRo,registerCompletionItemProvider:ERo,registerSignatureHelpProvider:gRo,registerHoverProvider:mRo,registerDocumentSymbolProvider:kRo,registerDocumentHighlightProvider:vRo,registerLinkedEditingRangeProvider:pRo,registerDefinitionProvider:bRo,registerImplementationProvider:ORo,registerTypeDefinitionProvider:wRo,registerCodeLensProvider:yRo,registerCodeActionProvider:CRo,registerDocumentFormattingEditProvider:xRo,registerDocumentRangeFormattingEditProvider:LRo,registerOnTypeFormattingEditProvider:SRo,registerLinkProvider:TRo,registerColorProvider:DRo,registerFoldingRangeProvider:QRo,registerDeclarationProvider:BRo,registerSelectionRangeProvider:FRo,registerDocumentSemanticTokensProvider:PRo,registerDocumentRangeSemanticTokensProvider:MRo,registerInlineCompletionsProvider:RRo,registerInlayHintsProvider:IRo,DocumentHighlightKind:QZe,CompletionItemKind:xZe,CompletionItemTag:LZe,CompletionItemInsertTextRule:CZe,SymbolKind:cYe,SymbolTag:dYe,IndentAction:NZe,CompletionTriggerKind:SZe,SignatureHelpTriggerKind:lYe,InlayHintKind:jZe,InlineCompletionTriggerKind:VZe,CodeActionTriggerType:yZe,NewSymbolNameTag:KZe,NewSymbolNameTriggerKind:JZe,PartialAcceptTriggerKind:eYe,HoverVerbosityAction:IZe,InlineCompletionEndOfLifeReasonKind:WZe,InlineCompletionHintStyle:HZe,FoldingRangeKind:WM,SelectedSuggestionInfo:CQn,EditDeltaInfo:W$}}bf.wrappingIndent.defaultValue=0;bf.glyphMargin.defaultValue=!1;bf.autoIndent.defaultValue=3;bf.overviewRulerLanes.defaultValue=2;mee.setFormatterSelector((e,t,n)=>Promise.resolve(e[0]));const Tg=pIn();Tg.editor=qMo();Tg.languages=NRo();const URo=Tg.CancellationTokenSource,KV=Tg.Emitter,jRo=Tg.KeyCode,WRo=Tg.KeyMod,HRo=Tg.Position,Yee=Tg.Range,VRo=Tg.Selection,zRo=Tg.SelectionDirection,TA=Tg.MarkerSeverity,Xee=Tg.MarkerTag,$M=Tg.Uri,ZRo=Tg.Token,zc=Tg.editor,It=Tg.languages,PSe=iet(),vW=globalThis;(PSe!=null&&PSe.globalAPI||typeof vW.define=="function"&&vW.define.amd)&&(vW.monaco=Tg);typeof vW.require<"u"&&typeof vW.require.config=="function"&&vW.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const YRo=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:URo,Emitter:KV,KeyCode:jRo,KeyMod:WRo,MarkerSeverity:TA,MarkerTag:Xee,Position:HRo,Range:Yee,Selection:VRo,SelectionDirection:zRo,Token:ZRo,Uri:$M,editor:zc,languages:It},Symbol.toStringTag,{value:"Module"}));let Jit=class{constructor(t,n,r){this._onDidChange=new KV,this._languageId=t,this.setOptions(n),this.setModeConfiguration(r)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(t){this._options=t||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(t){this.setOptions(t)}setModeConfiguration(t){this._modeConfiguration=t||Object.create(null),this._onDidChange.fire(this)}};const _it={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},$it={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},XIn=new Jit("css",_it,$it),qIn=new Jit("scss",_it,$it),GIn=new Jit("less",_it,$it);function ert(){return St(()=>Promise.resolve().then(()=>WVs),void 0,import.meta.url)}It.onLanguage("less",()=>{ert().then(e=>e.setupMode(GIn))});It.onLanguage("scss",()=>{ert().then(e=>e.setupMode(qIn))});It.onLanguage("css",()=>{ert().then(e=>e.setupMode(XIn))});const XRo=Object.freeze(Object.defineProperty({__proto__:null,cssDefaults:XIn,lessDefaults:GIn,scssDefaults:qIn},Symbol.toStringTag,{value:"Module"}));let qRo=class{constructor(t,n,r){this._onDidChange=new KV,this._languageId=t,this.setOptions(n),this.setModeConfiguration(r)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(t){this._options=t||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(t){this._modeConfiguration=t||Object.create(null),this._onDidChange.fire(this)}};const GRo={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},m3e={format:GRo,suggest:{},data:{useDefaultDataProvider:!0}};function k3e(e){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:e===gJ,documentFormattingEdits:e===gJ,documentRangeFormattingEdits:e===gJ}}const gJ="html",M8t="handlebars",R8t="razor",KIn=v3e(gJ,m3e,k3e(gJ)),KRo=KIn.defaults,JIn=v3e(M8t,m3e,k3e(M8t)),JRo=JIn.defaults,_In=v3e(R8t,m3e,k3e(R8t)),_Ro=_In.defaults;function $Ro(){return St(()=>Promise.resolve().then(()=>ZVs),void 0,import.meta.url)}function v3e(e,t=m3e,n=k3e(e)){const r=new qRo(e,t,n);let o;const s=It.onLanguage(e,async()=>{o=(await $Ro()).setupMode(r)});return{defaults:r,dispose(){s.dispose(),o==null||o.dispose(),o=void 0}}}const eIo=Object.freeze(Object.defineProperty({__proto__:null,handlebarDefaults:JRo,handlebarLanguageService:JIn,htmlDefaults:KRo,htmlLanguageService:KIn,razorDefaults:_Ro,razorLanguageService:_In,registerHTMLLanguageService:v3e},Symbol.toStringTag,{value:"Module"}));let tIo=class{constructor(t,n,r){this._onDidChange=new KV,this._languageId=t,this.setDiagnosticsOptions(n),this.setModeConfiguration(r)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(t){this._diagnosticsOptions=t||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(t){this._modeConfiguration=t||Object.create(null),this._onDidChange.fire(this)}};const nIo={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},iIo={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},$In=new tIo("json",nIo,iIo),rIo=()=>eNn().then(e=>e.getWorker());function eNn(){return St(()=>Promise.resolve().then(()=>dzs),void 0,import.meta.url)}It.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});It.onLanguage("json",()=>{eNn().then(e=>e.setupMode($In))});const oIo=Object.freeze(Object.defineProperty({__proto__:null,getWorker:rIo,jsonDefaults:$In},Symbol.toStringTag,{value:"Module"})),sIo="5.9.3";var tNn=(e=>(e[e.None=0]="None",e[e.CommonJS=1]="CommonJS",e[e.AMD=2]="AMD",e[e.UMD=3]="UMD",e[e.System=4]="System",e[e.ES2015=5]="ES2015",e[e.ESNext=99]="ESNext",e))(tNn||{}),nNn=(e=>(e[e.None=0]="None",e[e.Preserve=1]="Preserve",e[e.React=2]="React",e[e.ReactNative=3]="ReactNative",e[e.ReactJSX=4]="ReactJSX",e[e.ReactJSXDev=5]="ReactJSXDev",e))(nNn||{}),iNn=(e=>(e[e.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",e[e.LineFeed=1]="LineFeed",e))(iNn||{}),rNn=(e=>(e[e.ES3=0]="ES3",e[e.ES5=1]="ES5",e[e.ES2015=2]="ES2015",e[e.ES2016=3]="ES2016",e[e.ES2017=4]="ES2017",e[e.ES2018=5]="ES2018",e[e.ES2019=6]="ES2019",e[e.ES2020=7]="ES2020",e[e.ESNext=99]="ESNext",e[e.JSON=100]="JSON",e[e.Latest=99]="Latest",e))(rNn||{}),oNn=(e=>(e[e.Classic=1]="Classic",e[e.NodeJs=2]="NodeJs",e))(oNn||{});class sNn{constructor(t,n,r,o,s){this._onDidChange=new KV,this._onDidExtraLibsChange=new KV,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(t),this.setDiagnosticsOptions(n),this.setWorkerOptions(r),this.setInlayHintsOptions(o),this.setModeConfiguration(s),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(t,n){let r;if(typeof n>"u"?r=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:r=n,this._extraLibs[r]&&this._extraLibs[r].content===t)return{dispose:()=>{}};let o=1;return this._removedExtraLibs[r]&&(o=this._removedExtraLibs[r]+1),this._extraLibs[r]&&(o=this._extraLibs[r].version+1),this._extraLibs[r]={content:t,version:o},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[r];s&&s.version===o&&(delete this._extraLibs[r],this._removedExtraLibs[r]=o,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(t){for(const n in this._extraLibs)this._removedExtraLibs[n]=this._extraLibs[n].version;if(this._extraLibs=Object.create(null),t&&t.length>0)for(const n of t){const r=n.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,o=n.content;let s=1;this._removedExtraLibs[r]&&(s=this._removedExtraLibs[r]+1),this._extraLibs[r]={content:o,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(t){this._compilerOptions=t||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(t){this._diagnosticsOptions=t||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(t){this._workerOptions=t||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(t){this._inlayHintsOptions=t||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(t){}setEagerModelSync(t){this._eagerModelSync=t}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(t){this._modeConfiguration=t||Object.create(null),this._onDidChange.fire(void 0)}}const aIo=sIo,aNn={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},trt=new sNn({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},aNn),lNn=new sNn({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},aNn),lIo=()=>p3e().then(e=>e.getTypeScriptWorker()),cIo=()=>p3e().then(e=>e.getJavaScriptWorker());function p3e(){return St(()=>Promise.resolve().then(()=>mzs),void 0,import.meta.url)}It.onLanguage("typescript",()=>p3e().then(e=>e.setupTypeScript(trt)));It.onLanguage("javascript",()=>p3e().then(e=>e.setupJavaScript(lNn)));const dIo=Object.freeze(Object.defineProperty({__proto__:null,JsxEmit:nNn,ModuleKind:tNn,ModuleResolutionKind:oNn,NewLineKind:iNn,ScriptTarget:rNn,getJavaScriptWorker:cIo,getTypeScriptWorker:lIo,javascriptDefaults:lNn,typescriptDefaults:trt,typescriptVersion:aIo},Symbol.toStringTag,{value:"Module"})),cNn={},MSe={};class nrt{static getOrCreate(t){return MSe[t]||(MSe[t]=new nrt(t)),MSe[t]}constructor(t){this._languageId=t,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((n,r)=>{this._lazyLoadPromiseResolve=n,this._lazyLoadPromiseReject=r})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,cNn[this._languageId].loader().then(t=>this._lazyLoadPromiseResolve(t),t=>this._lazyLoadPromiseReject(t))),this._lazyLoadPromise}}function yi(e){const t=e.id;cNn[t]=e,It.register(e);const n=nrt.getOrCreate(t);It.registerTokensProviderFactory(t,{create:async()=>(await n.load()).language}),It.onLanguageEncountered(t,async()=>{const r=await n.load();It.setLanguageConfiguration(t,r.conf)})}yi({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>St(()=>Promise.resolve().then(()=>pzs),void 0,import.meta.url)});yi({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>St(()=>Promise.resolve().then(()=>Czs),void 0,import.meta.url)});yi({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>St(()=>Promise.resolve().then(()=>Szs),void 0,import.meta.url)});yi({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>St(()=>Promise.resolve().then(()=>Dzs),void 0,import.meta.url)});yi({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>St(()=>Promise.resolve().then(()=>Wzs),void 0,import.meta.url)});yi({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>St(()=>Promise.resolve().then(()=>zzs),void 0,import.meta.url)});yi({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>St(()=>Promise.resolve().then(()=>Xzs),void 0,import.meta.url)});yi({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>St(()=>Promise.resolve().then(()=>Kzs),void 0,import.meta.url)});yi({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>St(()=>Promise.resolve().then(()=>T$n),void 0,import.meta.url)});yi({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>St(()=>Promise.resolve().then(()=>T$n),void 0,import.meta.url)});yi({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>St(()=>Promise.resolve().then(()=>tZs),void 0,import.meta.url)});yi({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>St(()=>Promise.resolve().then(()=>rZs),void 0,import.meta.url)});yi({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>St(()=>Promise.resolve().then(()=>aZs),void 0,import.meta.url)});yi({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>St(()=>Promise.resolve().then(()=>dZs),void 0,import.meta.url)});yi({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>St(()=>Promise.resolve().then(()=>AZs),void 0,import.meta.url)});yi({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>St(()=>Promise.resolve().then(()=>mZs),void 0,import.meta.url)});yi({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>St(()=>Promise.resolve().then(()=>pZs),void 0,import.meta.url)});yi({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>St(()=>Promise.resolve().then(()=>wZs),void 0,import.meta.url)});yi({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>St(()=>Promise.resolve().then(()=>xZs),void 0,import.meta.url)});yi({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>St(()=>Promise.resolve().then(()=>TZs),void 0,import.meta.url)});yi({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>St(()=>Promise.resolve().then(()=>SR),void 0,import.meta.url).then(e=>e.TagAutoInterpolationDollar)});yi({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>St(()=>Promise.resolve().then(()=>SR),void 0,import.meta.url).then(e=>e.TagAngleInterpolationDollar)});yi({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>St(()=>Promise.resolve().then(()=>SR),void 0,import.meta.url).then(e=>e.TagBracketInterpolationDollar)});yi({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>St(()=>Promise.resolve().then(()=>SR),void 0,import.meta.url).then(e=>e.TagAngleInterpolationBracket)});yi({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>St(()=>Promise.resolve().then(()=>SR),void 0,import.meta.url).then(e=>e.TagBracketInterpolationBracket)});yi({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>St(()=>Promise.resolve().then(()=>SR),void 0,import.meta.url).then(e=>e.TagAutoInterpolationDollar)});yi({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>St(()=>Promise.resolve().then(()=>SR),void 0,import.meta.url).then(e=>e.TagAutoInterpolationBracket)});yi({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>St(()=>Promise.resolve().then(()=>NZs),void 0,import.meta.url)});yi({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>St(()=>Promise.resolve().then(()=>WZs),void 0,import.meta.url)});yi({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>St(()=>Promise.resolve().then(()=>zZs),void 0,import.meta.url)});yi({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>St(()=>Promise.resolve().then(()=>XZs),void 0,import.meta.url)});yi({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>St(()=>Promise.resolve().then(()=>KZs),void 0,import.meta.url)});yi({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>St(()=>Promise.resolve().then(()=>$Zs),void 0,import.meta.url)});yi({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>St(()=>Promise.resolve().then(()=>nYs),void 0,import.meta.url)});yi({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>St(()=>Promise.resolve().then(()=>sYs),void 0,import.meta.url)});yi({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>St(()=>Promise.resolve().then(()=>cYs),void 0,import.meta.url)});yi({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>St(()=>Promise.resolve().then(()=>hYs),void 0,import.meta.url)});yi({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>St(()=>Promise.resolve().then(()=>gYs),void 0,import.meta.url)});yi({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>St(()=>Promise.resolve().then(()=>vYs),void 0,import.meta.url)});yi({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>St(()=>Promise.resolve().then(()=>OYs),void 0,import.meta.url)});yi({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>St(()=>Promise.resolve().then(()=>CYs),void 0,import.meta.url)});yi({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>St(()=>Promise.resolve().then(()=>SYs),void 0,import.meta.url)});yi({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>St(()=>Promise.resolve().then(()=>DYs),void 0,import.meta.url)});yi({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>St(()=>Promise.resolve().then(()=>FYs),void 0,import.meta.url)});yi({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>St(()=>Promise.resolve().then(()=>RYs),void 0,import.meta.url)});yi({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>St(()=>Promise.resolve().then(()=>UYs),void 0,import.meta.url)});yi({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>St(()=>Promise.resolve().then(()=>HYs),void 0,import.meta.url)});yi({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>St(()=>Promise.resolve().then(()=>ZYs),void 0,import.meta.url)});yi({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>St(()=>Promise.resolve().then(()=>qYs),void 0,import.meta.url)});yi({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>St(()=>Promise.resolve().then(()=>JYs),void 0,import.meta.url)});yi({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>St(()=>Promise.resolve().then(()=>eXs),void 0,import.meta.url)});yi({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>St(()=>Promise.resolve().then(()=>iXs),void 0,import.meta.url)});yi({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>St(()=>Promise.resolve().then(()=>sXs),void 0,import.meta.url)});yi({id:"pla",extensions:[".pla"],loader:()=>St(()=>Promise.resolve().then(()=>cXs),void 0,import.meta.url)});yi({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>St(()=>Promise.resolve().then(()=>hXs),void 0,import.meta.url)});yi({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>St(()=>Promise.resolve().then(()=>gXs),void 0,import.meta.url)});yi({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>St(()=>Promise.resolve().then(()=>vXs),void 0,import.meta.url)});yi({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>St(()=>Promise.resolve().then(()=>wXs),void 0,import.meta.url)});yi({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>St(()=>Promise.resolve().then(()=>xXs),void 0,import.meta.url)});yi({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>St(()=>Promise.resolve().then(()=>TXs),void 0,import.meta.url)});yi({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>St(()=>Promise.resolve().then(()=>QXs),void 0,import.meta.url)});yi({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>St(()=>Promise.resolve().then(()=>PXs),void 0,import.meta.url)});yi({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>St(()=>Promise.resolve().then(()=>IXs),void 0,import.meta.url)});yi({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>St(()=>Promise.resolve().then(()=>jXs),void 0,import.meta.url)});yi({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>St(()=>Promise.resolve().then(()=>VXs),void 0,import.meta.url)});yi({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>St(()=>Promise.resolve().then(()=>YXs),void 0,import.meta.url)});yi({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>St(()=>Promise.resolve().then(()=>GXs),void 0,import.meta.url)});yi({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>St(()=>Promise.resolve().then(()=>_Xs),void 0,import.meta.url)});yi({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>St(()=>Promise.resolve().then(()=>tqs),void 0,import.meta.url)});yi({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>St(()=>Promise.resolve().then(()=>rqs),void 0,import.meta.url)});yi({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>St(()=>Promise.resolve().then(()=>aqs),void 0,import.meta.url)});yi({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>St(()=>Promise.resolve().then(()=>dqs),void 0,import.meta.url)});yi({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>St(()=>Promise.resolve().then(()=>Aqs),void 0,import.meta.url)});yi({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>St(()=>Promise.resolve().then(()=>mqs),void 0,import.meta.url)});yi({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>St(()=>Promise.resolve().then(()=>pqs),void 0,import.meta.url)});yi({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>St(()=>Promise.resolve().then(()=>wqs),void 0,import.meta.url)});yi({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>St(()=>Promise.resolve().then(()=>xqs),void 0,import.meta.url)});yi({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>St(()=>Promise.resolve().then(()=>Tqs),void 0,import.meta.url)});yi({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>St(()=>Promise.resolve().then(()=>Qqs),void 0,import.meta.url)});yi({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>St(()=>Promise.resolve().then(()=>B$n),void 0,import.meta.url)});yi({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>St(()=>Promise.resolve().then(()=>B$n),void 0,import.meta.url)});yi({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>St(()=>Promise.resolve().then(()=>Rqs),void 0,import.meta.url)});yi({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>St(()=>Promise.resolve().then(()=>Uqs),void 0,import.meta.url)});yi({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>St(()=>Promise.resolve().then(()=>iYs),void 0,import.meta.url)});yi({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>St(()=>Promise.resolve().then(()=>Gqs),void 0,import.meta.url)});yi({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>St(()=>Promise.resolve().then(()=>_qs),void 0,import.meta.url)});yi({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>St(()=>Promise.resolve().then(()=>uGs),void 0,import.meta.url)});yi({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\St(()=>Promise.resolve().then(()=>fGs),void 0,import.meta.url)});yi({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>St(()=>Promise.resolve().then(()=>kGs),void 0,import.meta.url)});var uIo=Object.defineProperty,hIo=(e,t,n)=>t in e?uIo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$r=(e,t,n)=>hIo(e,typeof t!="symbol"?t+"":t,n),qce,I8t,Gce,RSe,Kce;function AIo(e){return e.method!==void 0}var N8t;(function(e){function t(n){return n}e.create=t})(N8t||(N8t={}));var Bp;(function(e){e.parseError=-32700,e.invalidRequest=-32600,e.methodNotFound=-32601,e.invalidParams=-32602,e.internalError=-32603;function t(s){return-32099<=s&&s<=-32e3}e.isServerError=t;function n(s){if(!t(s))throw new Error("Invalid range for a server error.");return s}e.serverError=n,e.unexpectedServerError=-32e3;function r(s){return!0}e.isApplicationError=r;function o(s){return s}e.applicationError=o,e.genericApplicationError=-320100})(Bp||(Bp={}));var dNn=class{constructor(){$r(this,"listeners",new Set),$r(this,"event",e=>(this.listeners.add(e),{dispose:()=>{this.listeners.delete(e)}}))}fire(e){this.listeners.forEach(t=>t(e))}},fIo=class{constructor(e){$r(this,"_value"),$r(this,"eventEmitter"),this._value=e,this.eventEmitter=new dNn}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,this.eventEmitter.fire(e))}get onChange(){return this.eventEmitter.event}};function gIo(e,t){const n=setTimeout(t,e);return{dispose:()=>clearTimeout(n)}}function ISe(e,t,n){return e instanceof Set?(e.add(t),{dispose:()=>e.delete(t)}):(e.set(t,n),{dispose:()=>e.delete(t)})}var mIo=class{constructor(){$r(this,"_state","none"),$r(this,"promise"),$r(this,"resolve",()=>{}),$r(this,"reject",()=>{}),this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}get state(){return this._state}};qce=class{constructor(){$r(this,"_unprocessedMessages",[]),$r(this,"_messageListener"),$r(this,"id",qce.id++),$r(this,"_state",new fIo({state:"open"})),$r(this,"state",this._state)}setListener(e){if(this._messageListener=e,!!e)for(;this._unprocessedMessages.length>0&&this._messageListener!==void 0;){const t=this._unprocessedMessages.shift();this._messageListener(t)}}send(e){return this._sendImpl(e)}_dispatchReceivedMessage(e){this._unprocessedMessages.length===0&&this._messageListener?this._messageListener(e):this._unprocessedMessages.push(e)}_onConnectionClosed(){this._state.value={state:"closed",error:void 0}}log(e){return new kIo(this,e??new vIo)}},$r(qce,"id",0);var kIo=class{constructor(e,t){$r(this,"baseStream"),$r(this,"logger"),this.baseStream=e,this.logger=t}get state(){return this.baseStream.state}setListener(e){if(e===void 0){this.baseStream.setListener(void 0);return}this.baseStream.setListener(t=>{this.logger.log(this.baseStream,"incoming",t),e(t)})}send(e){return this.logger.log(this.baseStream,"outgoing",e),this.baseStream.send(e)}toString(){return`StreamLogger/${this.baseStream.toString()}`}},vIo=class{log(e,t,n){console.log(`${t==="incoming"?"<-":"->"} [${e.toString()}] ${JSON.stringify(n)}`)}},pIo=class uNn{constructor(t){$r(this,"connect"),this.connect=t}mapContext(t){return new uNn(n=>this.connect(n?bIo(n,t):void 0))}};function bIo(e,t){return{handleNotification:(n,r)=>e.handleNotification(n,t(r)),handleRequest:(n,r,o)=>e.handleRequest(n,r,t(o))}}var OIo=class hNn{constructor(t,n,r){$r(this,"_stream"),$r(this,"_listener"),$r(this,"_logger"),$r(this,"_unprocessedResponses",new Map),$r(this,"_lastUsedRequestId",0),this._stream=t,this._listener=n,this._logger=r,this._stream.setListener(o=>{AIo(o)?o.id===void 0?this._processNotification(o):this._processRequest(o):this._processResponse(o)})}static createChannel(t,n){let r=!1;return new pIo(o=>{if(r)throw new Error(`A channel to the stream ${t} was already constructed!`);return r=!0,new hNn(t,o,n)})}get state(){return this._stream.state}async _processNotification(t){if(t.id!==void 0)throw new Error;if(!this._listener){this._logger&&this._logger.debug({text:"Notification ignored",message:t});return}try{await this._listener.handleNotification({method:t.method,params:t.params||null})}catch(n){this._logger&&this._logger.warn({text:`Exception was thrown while handling notification: ${n}`,exception:n,message:t})}}async _processRequest(t){if(t.id===void 0)throw new Error;let n;if(this._listener)try{n=await this._listener.handleRequest({method:t.method,params:t.params||null},t.id)}catch(o){this._logger&&this._logger.warn({text:`Exception was thrown while handling request: ${o}`,message:t,exception:o}),n={error:{code:Bp.internalError,message:"An unexpected exception was thrown.",data:void 0}}}else this._logger&&this._logger.debug({text:"Received request even though not listening for requests",message:t}),n={error:{code:Bp.methodNotFound,message:"This endpoint does not listen for requests or notifications.",data:void 0}};let r;"result"in n?r={jsonrpc:"2.0",id:t.id,result:n.result}:r={jsonrpc:"2.0",id:t.id,error:n.error},await this._stream.send(r)}_processResponse(t){const n=""+t.id,r=this._unprocessedResponses.get(n);if(!r){this._logger&&this._logger.debug({text:"Got an unexpected response message",message:t});return}this._unprocessedResponses.delete(n),r(t)}_newRequestId(){return this._lastUsedRequestId++}sendRequest(t,n,r){const o={jsonrpc:"2.0",id:this._newRequestId(),method:t.method,params:t.params||void 0};return r&&r(o.id),new Promise((s,a)=>{const l=""+o.id;this._unprocessedResponses.set(l,d=>{"result"in d?s({result:d.result}):(d.error||a(new Error("Response had neither 'result' nor 'error' field set.")),s({error:d.error}))}),this._stream.send(o).then(void 0,d=>{this._unprocessedResponses.delete(l),a(d)})})}sendNotification(t,n){const r={jsonrpc:"2.0",id:void 0,method:t.method,params:t.params||void 0};return this._stream.send(r)}toString(){return"StreamChannel/"+this._stream.toString()}},pW;(function(e){function t(){return{deserializeFromJson:o=>({hasErrors:!1,value:o}),serializeToJson:o=>o}}e.sAny=t;function n(){return{deserializeFromJson:o=>({hasErrors:!1,value:{}}),serializeToJson:o=>({})}}e.sEmptyObject=n;function r(){return{deserializeFromJson:o=>({hasErrors:!1,value:void 0}),serializeToJson:o=>null}}e.sVoidFromNull=r})(pW||(pW={}));const ANn=Symbol("OptionalMethodNotFound");var fNn=class{contextualize(e){return new wIo(this,e)}},wIo=class extends fNn{constructor(e,t){super(),$r(this,"underylingTypedChannel"),$r(this,"converters"),this.underylingTypedChannel=e,this.converters=t}async request(e,t,n){const r=await this.converters.getSendContext(n);return this.underylingTypedChannel.request(e,t,r)}async notify(e,t,n){const r=await this.converters.getSendContext(n);return this.underylingTypedChannel.notify(e,t,r)}registerNotificationHandler(e,t){return this.underylingTypedChannel.registerNotificationHandler(e,async(n,r)=>await t(n,await this.converters.getNewContext(r)))}registerRequestHandler(e,t){return this.underylingTypedChannel.registerRequestHandler(e,async(n,r,o)=>await t(n,r,await this.converters.getNewContext(o)))}},U8t=class gNn extends fNn{constructor(t,n={}){super(),$r(this,"channelCtor"),$r(this,"_requestSender"),$r(this,"_handler",new Map),$r(this,"_unknownNotificationHandler",new Set),$r(this,"_timeout"),$r(this,"sendExceptionDetails",!1),$r(this,"_logger"),$r(this,"listeningDeferred",new mIo),$r(this,"onListening",this.listeningDeferred.promise),$r(this,"_requestDidErrorEventEmitter",new dNn),$r(this,"onRequestDidError",this._requestDidErrorEventEmitter.event),this.channelCtor=t,this._logger=n.logger,this.sendExceptionDetails=!!n.sendExceptionDetails,this._timeout=gIo(1e3,()=>{this._requestSender||console.warn(`"${this.startListen.name}" has not been called within 1 second after construction of this channel. Did you forget to call it?`,this)})}static fromTransport(t,n={}){return new gNn(OIo.createChannel(t,n.logger),n)}startListen(){if(this._requestSender)throw new Error(`"${this.startListen.name}" can be called only once, but it already has been called.`);this._timeout&&(this._timeout.dispose(),this._timeout=void 0),this._requestSender=this.channelCtor.connect({handleRequest:(t,n,r)=>this.handleRequest(t,n,r),handleNotification:(t,n)=>this.handleNotification(t,n)}),this.listeningDeferred.resolve()}checkChannel(t){if(!t)throw new Error(`"${this.startListen.name}" must be called before any messages can be sent or received.`);return!0}async handleRequest(t,n,r){const o=this._handler.get(t.method);if(!o)return this._logger&&this._logger.debug({text:`No request handler for "${t.method}".`,data:{requestObject:t}}),{error:{code:Bp.methodNotFound,message:`No request handler for "${t.method}".`,data:{method:t.method}}};if(o.kind!="request"){const a=`"${t.method}" is registered as notification, but was sent as request.`;return this._logger&&this._logger.debug({text:a,data:{requestObject:t}}),{error:{code:Bp.invalidRequest,message:a,data:{method:t.method}}}}const s=o.requestType.paramsSerializer.deserializeFromJson(t.params);if(s.hasErrors){const a=`Got invalid params: ${s.errorMessage}`;return this._logger&&this._logger.debug({text:a,data:{requestObject:t,errorMessage:s.errorMessage}}),{error:{code:Bp.invalidParams,message:a,data:{errors:s.errorMessage}}}}else{const a=s.value;let l;try{const d=await o.handler(a,n,r);if("error"in d||"errorMessage"in d){const u=d.error?o.requestType.errorSerializer.serializeToJson(d.error):void 0;l={error:{code:d.errorCode||Bp.genericApplicationError,message:d.errorMessage||"An error was returned",data:u}}}else l={result:o.requestType.resultSerializer.serializeToJson(d.ok)}}catch(d){d instanceof W8t?l={error:{code:d.code,message:d.message}}:(this._logger&&this._logger.warn({text:`An exception was thrown while handling a request: ${d}.`,exception:d,data:{requestObject:t}}),l={error:{code:Bp.unexpectedServerError,message:this.sendExceptionDetails?`An exception was thrown while handling a request: ${d}.`:"Server has thrown an unexpected exception"}})}return l}}async handleNotification(t,n){const r=this._handler.get(t.method);if(!r){for(const a of this._unknownNotificationHandler)a(t);this._unknownNotificationHandler.size===0&&this._logger&&this._logger.debug({text:`Unhandled notification "${t.method}"`,data:{requestObject:t}});return}if(r.kind!="notification"){this._logger&&this._logger.debug({text:`"${t.method}" is registered as request, but was sent as notification.`,data:{requestObject:t}});return}const o=r.notificationType.paramsSerializer.deserializeFromJson(t.params);if(o.hasErrors){this._logger&&this._logger.debug({text:`Got invalid params: ${o}`,data:{requestObject:t,errorMessage:o.errorMessage}});return}const s=o.value;for(const a of r.handlers)try{a(s,n)}catch(l){this._logger&&this._logger.warn({text:`An exception was thrown while handling a notification: ${l}.`,exception:l,data:{requestObject:t}})}}registerUnknownNotificationHandler(t){return ISe(this._unknownNotificationHandler,t)}registerRequestHandler(t,n){if(this._handler.get(t.method))throw new Error(`Handler with method "${t.method}" already registered.`);return ISe(this._handler,t.method,{kind:"request",requestType:t,handler:n})}registerNotificationHandler(t,n){let r=this._handler.get(t.method);if(!r)r={kind:"notification",notificationType:t,handlers:new Set},this._handler.set(t.method,r);else{if(r.kind!=="notification")throw new Error(`Method "${t.method}" was already registered as request handler.`);if(r.notificationType!==t)throw new Error(`Method "${t.method}" was registered for a different type.`)}return ISe(r.handlers,n)}getRegisteredTypes(){const t=[];for(const n of this._handler.values())n.kind==="notification"?t.push(n.notificationType):n.kind==="request"&&t.push(n.requestType);return t}async request(t,n,r){if(!this.checkChannel(this._requestSender))throw new Error("Impossible");const o=t.paramsSerializer.serializeToJson(n);j8t(o);const s=await this._requestSender.sendRequest({method:t.method,params:o},r);if("error"in s){if(t.isOptional&&s.error.code===Bp.methodNotFound)return ANn;let a;if(s.error.data!==void 0){const d=t.errorSerializer.deserializeFromJson(s.error.data);if(d.hasErrors)throw new Error(d.errorMessage);a=d.value}else a=void 0;const l=new W8t(s.error.message,a,s.error.code);throw this._requestDidErrorEventEmitter.fire({error:l}),l}else{const a=t.resultSerializer.deserializeFromJson(s.result);if(a.hasErrors)throw new Error("Could not deserialize response: "+a.errorMessage+` ${JSON.stringify(s,null,2)}`);return a.value}}async notify(t,n,r){if(!this.checkChannel(this._requestSender))throw new Error;const o=t.paramsSerializer.serializeToJson(n);j8t(o),this._requestSender.sendNotification({method:t.method,params:o},r)}};function j8t(e){if(e!==null&&Array.isArray(e)&&typeof e!="object")throw new Error("Invalid value! Only null, array and object is allowed.")}var W8t=class mNn extends Error{constructor(t,n,r=Bp.genericApplicationError){super(t),$r(this,"data"),$r(this,"code"),this.data=n,this.code=r,Object.setPrototypeOf(this,mNn.prototype)}},yIo=class EXe{constructor(t,n,r,o,s=!1){$r(this,"method"),$r(this,"paramsSerializer"),$r(this,"resultSerializer"),$r(this,"errorSerializer"),$r(this,"isOptional"),$r(this,"kind","request"),this.method=t,this.paramsSerializer=n,this.resultSerializer=r,this.errorSerializer=o,this.isOptional=s}withMethod(t){return new EXe(t,this.paramsSerializer,this.resultSerializer,this.errorSerializer)}optional(){return new EXe(this.method,this.paramsSerializer,this.resultSerializer,this.errorSerializer,!0)}},CIo=class kNn{constructor(t,n){$r(this,"method"),$r(this,"paramsSerializer"),$r(this,"kind","notification"),this.method=t,this.paramsSerializer=n}withMethod(t){return new kNn(t,this.paramsSerializer)}};function pr(e){return new yIo((e||{}).method,pW.sAny(),pW.sAny(),pW.sAny())}function wc(e){return new CIo((e||{}).method,pW.sAny())}const xIo=Symbol();var H8t=(I8t=xIo,Gce=class{constructor(e){$r(this,"error"),$r(this,I8t),this.error=e}},$r(Gce,"factory",e=>new Gce(e)),Gce);function LIo(e){const t=V8t(e.server),n=V8t(e.client);return new SIo(e.tags||[],t,n)}function V8t(e){const t={};for(const[n,r]of Object.entries(e)){const o=r.method?r.method:n;t[n]=r.withMethod(o)}return t}var SIo=class vNn{constructor(t=[],n,r){$r(this,"tags"),$r(this,"server"),$r(this,"client"),this.tags=t,this.server=n,this.client=r}_onlyDesignTime(){return new Error("This property is not meant to be accessed at runtime")}get TContractObject(){throw this._onlyDesignTime()}get TClientInterface(){throw this._onlyDesignTime()}get TServerInterface(){throw this._onlyDesignTime()}get TClientHandler(){throw this._onlyDesignTime()}get TServerHandler(){throw this._onlyDesignTime()}get TTags(){throw this._onlyDesignTime()}getInterface(t,n,r,o){const s=this.buildCounterpart(t,r),a=this.registerHandlers(t,n,o,s);return{counterpart:s,dispose:()=>a.dispose()}}buildCounterpart(t,n){const r={};for(const[o,s]of Object.entries(n)){let a;s.kind==="request"?s.isOptional?a=async(l,d)=>{l===void 0&&(l={});try{return await t.request(s,l,d)}catch(u){if(u&&u.code===Bp.methodNotFound)return ANn;throw u}}:a=(l,d)=>(l===void 0&&(l={}),t.request(s,l,d)):a=(l,d)=>(l===void 0&&(l={}),t.notify(s,l,d)),r[o]=a}return r}registerHandlers(t,n,r,o){const s=[];for(const[a,l]of Object.entries(n))if(l.kind==="request"){let d=r[a];if(!d)continue;const u=this.createRequestHandler(o,d);s.push(t.registerRequestHandler(l,u))}else{const d=r[a];d&&s.push(t.registerNotificationHandler(l,(u,h)=>{d(u,{context:h,counterpart:o})}))}return{dispose:()=>s.forEach(a=>a.dispose())}}createRequestHandler(t,n){return async(r,o,s)=>{const a=await n(r,{context:s,counterpart:t,newErr:H8t.factory,requestId:o});return a instanceof H8t?a.error:{ok:a}}}static getServerFromStream(t,n,r,o){const s=U8t.fromTransport(n,r),{server:a}=t.getServer(s,o);return s.startListen(),{channel:s,server:a}}static registerServerToStream(t,n,r,o){const s=U8t.fromTransport(n,r),{client:a}=t.registerServer(s,o);return s.startListen(),{channel:s,client:a}}getServer(t,n){const{counterpart:r,dispose:o}=this.getInterface(t,this.client,this.server,n);return{server:r,dispose:o}}registerServer(t,n){const{counterpart:r,dispose:o}=this.getInterface(t,this.server,this.client,n);return{client:r,dispose:o}}withContext(){return new vNn(this.tags,this.server,this.client)}};let NSe=function(e){return e.Comment="comment",e.Imports="imports",e.Region="region",e}({}),$c=function(e){return e[e.File=1]="File",e[e.Module=2]="Module",e[e.Namespace=3]="Namespace",e[e.Package=4]="Package",e[e.Class=5]="Class",e[e.Method=6]="Method",e[e.Property=7]="Property",e[e.Field=8]="Field",e[e.Constructor=9]="Constructor",e[e.Enum=10]="Enum",e[e.Interface=11]="Interface",e[e.Function=12]="Function",e[e.Variable=13]="Variable",e[e.Constant=14]="Constant",e[e.String=15]="String",e[e.Number=16]="Number",e[e.Boolean=17]="Boolean",e[e.Array=18]="Array",e[e.Object=19]="Object",e[e.Key=20]="Key",e[e.Null=21]="Null",e[e.EnumMember=22]="EnumMember",e[e.Struct=23]="Struct",e[e.Event=24]="Event",e[e.Operator=25]="Operator",e[e.TypeParameter=26]="TypeParameter",e}({}),TIo=function(e){return e[e.Deprecated=1]="Deprecated",e}({}),z8t=function(e){return e[e.Type=1]="Type",e[e.Parameter=2]="Parameter",e}({}),gd=function(e){return e[e.Text=1]="Text",e[e.Method=2]="Method",e[e.Function=3]="Function",e[e.Constructor=4]="Constructor",e[e.Field=5]="Field",e[e.Variable=6]="Variable",e[e.Class=7]="Class",e[e.Interface=8]="Interface",e[e.Module=9]="Module",e[e.Property=10]="Property",e[e.Unit=11]="Unit",e[e.Value=12]="Value",e[e.Enum=13]="Enum",e[e.Keyword=14]="Keyword",e[e.Snippet=15]="Snippet",e[e.Color=16]="Color",e[e.File=17]="File",e[e.Reference=18]="Reference",e[e.Folder=19]="Folder",e[e.EnumMember=20]="EnumMember",e[e.Constant=21]="Constant",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter",e}({}),EIo=function(e){return e[e.Deprecated=1]="Deprecated",e}({}),DIo=function(e){return e[e.PlainText=1]="PlainText",e[e.Snippet=2]="Snippet",e}({}),USe=function(e){return e[e.Text=1]="Text",e[e.Read=2]="Read",e[e.Write=3]="Write",e}({}),I5=function(e){return e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Information=3]="Information",e[e.Hint=4]="Hint",e}({}),Z8t=function(e){return e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated",e}({}),jSe=function(e){return e[e.Invoked=1]="Invoked",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",e}({}),WSe=function(e){return e[e.Invoked=1]="Invoked",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange",e}({}),Y8t=function(e){return e[e.Invoked=1]="Invoked",e[e.Automatic=2]="Automatic",e}({});var Mo=class{constructor(e){this.method=e}};const QIo={textDocumentImplementation:new Mo("textDocument/implementation"),textDocumentTypeDefinition:new Mo("textDocument/typeDefinition"),textDocumentDocumentColor:new Mo("textDocument/documentColor"),textDocumentColorPresentation:new Mo("textDocument/colorPresentation"),textDocumentFoldingRange:new Mo("textDocument/foldingRange"),textDocumentDeclaration:new Mo("textDocument/declaration"),textDocumentSelectionRange:new Mo("textDocument/selectionRange"),textDocumentPrepareCallHierarchy:new Mo("textDocument/prepareCallHierarchy"),textDocumentSemanticTokensFull:new Mo("textDocument/semanticTokens/full"),textDocumentSemanticTokensFullDelta:new Mo("textDocument/semanticTokens/full/delta"),textDocumentLinkedEditingRange:new Mo("textDocument/linkedEditingRange"),workspaceWillCreateFiles:new Mo("workspace/willCreateFiles"),workspaceWillRenameFiles:new Mo("workspace/willRenameFiles"),workspaceWillDeleteFiles:new Mo("workspace/willDeleteFiles"),textDocumentMoniker:new Mo("textDocument/moniker"),textDocumentPrepareTypeHierarchy:new Mo("textDocument/prepareTypeHierarchy"),textDocumentInlineValue:new Mo("textDocument/inlineValue"),textDocumentInlayHint:new Mo("textDocument/inlayHint"),textDocumentDiagnostic:new Mo("textDocument/diagnostic"),textDocumentInlineCompletion:new Mo("textDocument/inlineCompletion"),textDocumentWillSaveWaitUntil:new Mo("textDocument/willSaveWaitUntil"),textDocumentCompletion:new Mo("textDocument/completion"),textDocumentHover:new Mo("textDocument/hover"),textDocumentSignatureHelp:new Mo("textDocument/signatureHelp"),textDocumentDefinition:new Mo("textDocument/definition"),textDocumentReferences:new Mo("textDocument/references"),textDocumentDocumentHighlight:new Mo("textDocument/documentHighlight"),textDocumentDocumentSymbol:new Mo("textDocument/documentSymbol"),textDocumentCodeAction:new Mo("textDocument/codeAction"),workspaceSymbol:new Mo("workspace/symbol"),textDocumentCodeLens:new Mo("textDocument/codeLens"),textDocumentDocumentLink:new Mo("textDocument/documentLink"),textDocumentFormatting:new Mo("textDocument/formatting"),textDocumentRangeFormatting:new Mo("textDocument/rangeFormatting"),textDocumentRangesFormatting:new Mo("textDocument/rangesFormatting"),textDocumentOnTypeFormatting:new Mo("textDocument/onTypeFormatting"),textDocumentRename:new Mo("textDocument/rename"),workspaceExecuteCommand:new Mo("workspace/executeCommand"),workspaceDidCreateFiles:new Mo("workspace/didCreateFiles"),workspaceDidRenameFiles:new Mo("workspace/didRenameFiles"),workspaceDidDeleteFiles:new Mo("workspace/didDeleteFiles"),workspaceDidChangeConfiguration:new Mo("workspace/didChangeConfiguration"),textDocumentDidOpen:new Mo("textDocument/didOpen"),textDocumentDidChange:new Mo("textDocument/didChange"),textDocumentDidClose:new Mo("textDocument/didClose"),textDocumentDidSave:new Mo("textDocument/didSave"),textDocumentWillSave:new Mo("textDocument/willSave"),workspaceDidChangeWatchedFiles:new Mo("workspace/didChangeWatchedFiles")};LIo({server:{textDocumentImplementation:pr({method:"textDocument/implementation"}),textDocumentTypeDefinition:pr({method:"textDocument/typeDefinition"}),textDocumentDocumentColor:pr({method:"textDocument/documentColor"}),textDocumentColorPresentation:pr({method:"textDocument/colorPresentation"}),textDocumentFoldingRange:pr({method:"textDocument/foldingRange"}),textDocumentDeclaration:pr({method:"textDocument/declaration"}),textDocumentSelectionRange:pr({method:"textDocument/selectionRange"}),textDocumentPrepareCallHierarchy:pr({method:"textDocument/prepareCallHierarchy"}),callHierarchyIncomingCalls:pr({method:"callHierarchy/incomingCalls"}),callHierarchyOutgoingCalls:pr({method:"callHierarchy/outgoingCalls"}),textDocumentSemanticTokensFull:pr({method:"textDocument/semanticTokens/full"}),textDocumentSemanticTokensFullDelta:pr({method:"textDocument/semanticTokens/full/delta"}),textDocumentSemanticTokensRange:pr({method:"textDocument/semanticTokens/range"}),textDocumentLinkedEditingRange:pr({method:"textDocument/linkedEditingRange"}),workspaceWillCreateFiles:pr({method:"workspace/willCreateFiles"}),workspaceWillRenameFiles:pr({method:"workspace/willRenameFiles"}),workspaceWillDeleteFiles:pr({method:"workspace/willDeleteFiles"}),textDocumentMoniker:pr({method:"textDocument/moniker"}),textDocumentPrepareTypeHierarchy:pr({method:"textDocument/prepareTypeHierarchy"}),typeHierarchySupertypes:pr({method:"typeHierarchy/supertypes"}),typeHierarchySubtypes:pr({method:"typeHierarchy/subtypes"}),textDocumentInlineValue:pr({method:"textDocument/inlineValue"}),textDocumentInlayHint:pr({method:"textDocument/inlayHint"}),inlayHintResolve:pr({method:"inlayHint/resolve"}),textDocumentDiagnostic:pr({method:"textDocument/diagnostic"}),workspaceDiagnostic:pr({method:"workspace/diagnostic"}),textDocumentInlineCompletion:pr({method:"textDocument/inlineCompletion"}),initialize:pr({method:"initialize"}),shutdown:pr({method:"shutdown"}),textDocumentWillSaveWaitUntil:pr({method:"textDocument/willSaveWaitUntil"}),textDocumentCompletion:pr({method:"textDocument/completion"}),completionItemResolve:pr({method:"completionItem/resolve"}),textDocumentHover:pr({method:"textDocument/hover"}),textDocumentSignatureHelp:pr({method:"textDocument/signatureHelp"}),textDocumentDefinition:pr({method:"textDocument/definition"}),textDocumentReferences:pr({method:"textDocument/references"}),textDocumentDocumentHighlight:pr({method:"textDocument/documentHighlight"}),textDocumentDocumentSymbol:pr({method:"textDocument/documentSymbol"}),textDocumentCodeAction:pr({method:"textDocument/codeAction"}),codeActionResolve:pr({method:"codeAction/resolve"}),workspaceSymbol:pr({method:"workspace/symbol"}),workspaceSymbolResolve:pr({method:"workspaceSymbol/resolve"}),textDocumentCodeLens:pr({method:"textDocument/codeLens"}),codeLensResolve:pr({method:"codeLens/resolve"}),textDocumentDocumentLink:pr({method:"textDocument/documentLink"}),documentLinkResolve:pr({method:"documentLink/resolve"}),textDocumentFormatting:pr({method:"textDocument/formatting"}),textDocumentRangeFormatting:pr({method:"textDocument/rangeFormatting"}),textDocumentRangesFormatting:pr({method:"textDocument/rangesFormatting"}),textDocumentOnTypeFormatting:pr({method:"textDocument/onTypeFormatting"}),textDocumentRename:pr({method:"textDocument/rename"}),textDocumentPrepareRename:pr({method:"textDocument/prepareRename"}),workspaceExecuteCommand:pr({method:"workspace/executeCommand"}),workspaceDidChangeWorkspaceFolders:wc({method:"workspace/didChangeWorkspaceFolders"}),windowWorkDoneProgressCancel:wc({method:"window/workDoneProgress/cancel"}),workspaceDidCreateFiles:wc({method:"workspace/didCreateFiles"}),workspaceDidRenameFiles:wc({method:"workspace/didRenameFiles"}),workspaceDidDeleteFiles:wc({method:"workspace/didDeleteFiles"}),notebookDocumentDidOpen:wc({method:"notebookDocument/didOpen"}),notebookDocumentDidChange:wc({method:"notebookDocument/didChange"}),notebookDocumentDidSave:wc({method:"notebookDocument/didSave"}),notebookDocumentDidClose:wc({method:"notebookDocument/didClose"}),initialized:wc({method:"initialized"}),exit:wc({method:"exit"}),workspaceDidChangeConfiguration:wc({method:"workspace/didChangeConfiguration"}),textDocumentDidOpen:wc({method:"textDocument/didOpen"}),textDocumentDidChange:wc({method:"textDocument/didChange"}),textDocumentDidClose:wc({method:"textDocument/didClose"}),textDocumentDidSave:wc({method:"textDocument/didSave"}),textDocumentWillSave:wc({method:"textDocument/willSave"}),workspaceDidChangeWatchedFiles:wc({method:"workspace/didChangeWatchedFiles"}),setTrace:wc({method:"$/setTrace"}),cancelRequest:wc({method:"$/cancelRequest"}),progress:wc({method:"$/progress"})},client:{workspaceWorkspaceFolders:pr({method:"workspace/workspaceFolders"}).optional(),workspaceConfiguration:pr({method:"workspace/configuration"}).optional(),workspaceFoldingRangeRefresh:pr({method:"workspace/foldingRange/refresh"}).optional(),windowWorkDoneProgressCreate:pr({method:"window/workDoneProgress/create"}).optional(),workspaceSemanticTokensRefresh:pr({method:"workspace/semanticTokens/refresh"}).optional(),windowShowDocument:pr({method:"window/showDocument"}).optional(),workspaceInlineValueRefresh:pr({method:"workspace/inlineValue/refresh"}).optional(),workspaceInlayHintRefresh:pr({method:"workspace/inlayHint/refresh"}).optional(),workspaceDiagnosticRefresh:pr({method:"workspace/diagnostic/refresh"}).optional(),clientRegisterCapability:pr({method:"client/registerCapability"}).optional(),clientUnregisterCapability:pr({method:"client/unregisterCapability"}).optional(),windowShowMessageRequest:pr({method:"window/showMessageRequest"}).optional(),workspaceCodeLensRefresh:pr({method:"workspace/codeLens/refresh"}).optional(),workspaceApplyEdit:pr({method:"workspace/applyEdit"}).optional(),windowShowMessage:wc({method:"window/showMessage"}),windowLogMessage:wc({method:"window/logMessage"}),telemetryEvent:wc({method:"telemetry/event"}),textDocumentPublishDiagnostics:wc({method:"textDocument/publishDiagnostics"}),logTrace:wc({method:"$/logTrace"}),cancelRequest:wc({method:"$/cancelRequest"}),progress:wc({method:"$/progress"})}});RSe=class{constructor(){$r(this,"_store",new BIo)}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}},$r(RSe,"None",Object.freeze({dispose(){}}));var BIo=(Kce=class{constructor(){$r(this,"_toDispose",new Set),$r(this,"_isDisposed",!1)}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}clear(){if(this._toDispose.size!==0)try{for(const e of this._toDispose)e.dispose()}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Kce.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}},$r(Kce,"DISABLE_DISPOSED_WARNING",!1),Kce);It.CodeActionTriggerType.Invoke,Y8t.Invoked,It.CodeActionTriggerType.Auto,Y8t.Automatic;gd.Text,It.CompletionItemKind.Text,gd.Method,It.CompletionItemKind.Method,gd.Function,It.CompletionItemKind.Function,gd.Constructor,It.CompletionItemKind.Constructor,gd.Field,It.CompletionItemKind.Field,gd.Variable,It.CompletionItemKind.Variable,gd.Class,It.CompletionItemKind.Class,gd.Interface,It.CompletionItemKind.Interface,gd.Module,It.CompletionItemKind.Module,gd.Property,It.CompletionItemKind.Property,gd.Unit,It.CompletionItemKind.Unit,gd.Value,It.CompletionItemKind.Value,gd.Enum,It.CompletionItemKind.Enum,gd.Keyword,It.CompletionItemKind.Keyword,gd.Snippet,It.CompletionItemKind.Snippet,gd.Color,It.CompletionItemKind.Color,gd.File,It.CompletionItemKind.File,gd.Reference,It.CompletionItemKind.Reference,gd.Folder,It.CompletionItemKind.Folder,gd.EnumMember,It.CompletionItemKind.EnumMember,gd.Constant,It.CompletionItemKind.Constant,gd.Struct,It.CompletionItemKind.Struct,gd.Event,It.CompletionItemKind.Event,gd.Operator,It.CompletionItemKind.Operator,gd.TypeParameter,It.CompletionItemKind.TypeParameter;EIo.Deprecated,It.CompletionItemTag.Deprecated;It.CompletionTriggerKind.Invoke,jSe.Invoked,It.CompletionTriggerKind.TriggerCharacter,jSe.TriggerCharacter,It.CompletionTriggerKind.TriggerForIncompleteCompletions,jSe.TriggerForIncompleteCompletions;DIo.Snippet,It.CompletionItemInsertTextRule.InsertAsSnippet;$c.File,It.SymbolKind.File,$c.Module,It.SymbolKind.Module,$c.Namespace,It.SymbolKind.Namespace,$c.Package,It.SymbolKind.Package,$c.Class,It.SymbolKind.Class,$c.Method,It.SymbolKind.Method,$c.Property,It.SymbolKind.Property,$c.Field,It.SymbolKind.Field,$c.Constructor,It.SymbolKind.Constructor,$c.Enum,It.SymbolKind.Enum,$c.Interface,It.SymbolKind.Interface,$c.Function,It.SymbolKind.Function,$c.Variable,It.SymbolKind.Variable,$c.Constant,It.SymbolKind.Constant,$c.String,It.SymbolKind.String,$c.Number,It.SymbolKind.Number,$c.Boolean,It.SymbolKind.Boolean,$c.Array,It.SymbolKind.Array,$c.Object,It.SymbolKind.Object,$c.Key,It.SymbolKind.Key,$c.Null,It.SymbolKind.Null,$c.EnumMember,It.SymbolKind.EnumMember,$c.Struct,It.SymbolKind.Struct,$c.Event,It.SymbolKind.Event,$c.Operator,It.SymbolKind.Operator,$c.TypeParameter,It.SymbolKind.TypeParameter;TIo.Deprecated,It.SymbolTag.Deprecated;USe.Text,It.DocumentHighlightKind.Text,USe.Read,It.DocumentHighlightKind.Read,USe.Write,It.DocumentHighlightKind.Write;NSe.Comment,It.FoldingRangeKind.Comment,NSe.Imports,It.FoldingRangeKind.Imports,NSe.Region,It.FoldingRangeKind.Region;TA.Error,I5.Error,TA.Warning,I5.Warning,TA.Info,I5.Information,TA.Hint,I5.Hint;I5.Error,TA.Error,I5.Warning,TA.Warning,I5.Information,TA.Info,I5.Hint,TA.Hint;Z8t.Unnecessary,Xee.Unnecessary,Z8t.Deprecated,Xee.Deprecated;It.SignatureHelpTriggerKind.Invoke,WSe.Invoked,It.SignatureHelpTriggerKind.TriggerCharacter,WSe.TriggerCharacter,It.SignatureHelpTriggerKind.ContentChange,WSe.ContentChange;z8t.Type,It.InlayHintKind.Type,z8t.Parameter,It.InlayHintKind.Parameter;new Map([...Object.values(QIo)].map(e=>[e.method,e]));function FIo(e,t){var r;const n=globalThis.MonacoEnvironment;if(n!=null&&n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(o){console.error(o);return}try{return(r=globalThis.trustedTypes)==null?void 0:r.createPolicy(e,t)}catch(o){console.error(o);return}}let $0e;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?$0e=globalThis.workerttPolicy:$0e=FIo("defaultWorkerFactory",{createScriptURL:e=>e});function PIo(e){const t=e.label,n=globalThis.MonacoEnvironment;if(n){if(typeof n.getWorker=="function")return n.getWorker("workerMain.js",t);if(typeof n.getWorkerUrl=="function"){const r=n.getWorkerUrl("workerMain.js",t);return new Worker($0e?$0e.createScriptURL(r):r,{name:t,type:"module"})}}if(e.createWorker)return e.createWorker();throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function b3e(e){const t=Promise.resolve(PIo({label:e.label??"monaco-editor-worker",moduleId:e.moduleId,createWorker:e.createWorker})).then(n=>(n.postMessage("ignore"),n.postMessage(e.createData),n));return zc.createWebWorker({worker:t,host:e.host,keepIdleModels:e.keepIdleModels})}function pNn(){return YRo}const HSe=globalThis.MonacoEnvironment;HSe!=null&&HSe.globalAPI&&(globalThis.monaco=pNn());const O3e=pNn();O3e.languages.css=XRo;O3e.languages.html=eIo;O3e.languages.typescript=dIo;O3e.languages.json=oIo;const MIo=e=>{console.warn(`[MonacoEditorVue3]: ${e}`)},X8t=e=>typeof e=="number"?`${e}px`:typeof e=="string"?e.includes("%")||e.includes("px")||e.includes("rem")||e.includes("em")?e:`${e}px`:"100%",RIo=()=>{const e=le({isLoading:!1,loadingText:"Loading Monaco Editor...",progress:0}),t=le(null),n=le(!1),r=l=>{e.value={...e.value,...l}};return{loading:e,error:t,isReady:n,setLoading:r,setError:l=>{t.value=l,l&&(MIo(`Editor Error [${l.code}]: ${l.message}`),l.details&&console.error("Error details:",l.details))},clearError:()=>{t.value=null},setReady:l=>{n.value=l,l&&r({isLoading:!1,progress:100})}}},IIo=e=>({executeHook:async(n,...r)=>{var o;const s=e==null?void 0:e[n];if(s)try{await s(...r)}catch(a){(o=e==null?void 0:e.onError)==null||o.call(e,{code:"LIFECYCLE_ERROR",message:`Error in ${n} hook`,details:a instanceof Error?a.message:String(a),recoverable:!0})}}}),NIo=(e,t)=>{let n=null;const r=le(),{loading:o,error:s,isReady:a,setLoading:l,setError:d,clearError:u,setReady:h}=RIo(),{executeHook:f}=IIo(e.lifecycle),g=async()=>{try{if(!r.value)throw new Error("Container element not found");await f("beforeCreate"),l({isLoading:!0,progress:20}),await f("onCreating"),t("editorWillMount"),l({progress:50});const m={value:e.value,language:e.language,theme:e.theme,...e.options};n=zc.create(r.value,m),l({progress:80}),await f("onCreated",n),n.onDidChangeModelContent(v=>{const p=n.getValue();e.value!==p&&(t("change",p,v),t("update:value",p))}),h(!0),await f("onReady",n),t("editorDidMount",n)}catch(m){const v={code:"EDITOR_CREATE_FAILED",message:"Failed to create Monaco editor",details:m instanceof Error?m.message:String(m),recoverable:!0};d(v),await f("onError",v)}},k=async()=>{try{await f("beforeDestroy"),n&&(n.dispose(),n=null),h(!1),u(),await f("onDestroyed")}catch(m){const v={code:"EDITOR_DESTROY_FAILED",message:"Failed to destroy Monaco editor",details:m instanceof Error?m.message:String(m),recoverable:!1};d(v)}};return vn(()=>{_n(()=>{g()})}),Ma(()=>{k()}),ut(()=>e.options,m=>{if(!(!m||!n))try{n.updateOptions(m)}catch(v){const p={code:"OPTIONS_UPDATE_FAILED",message:"Failed to update editor options",details:v instanceof Error?v.message:String(v),recoverable:!0};d(p)}},{deep:!0}),ut(()=>e.value,m=>{if(!n||m===void 0)return;if(n.getValue()!==m)try{n.setValue(m)}catch(p){const b={code:"VALUE_UPDATE_FAILED",message:"Failed to update editor value",details:p instanceof Error?p.message:String(p),recoverable:!0};d(b)}}),{editorInstance:n,container:r,loading:o,error:s,isReady:a,retry:()=>{u(),g()},destroy:k}},UIo=ae("div",null,[ae("div")],-1),jIo={key:0},WIo=qe({__name:"MonacoLoading",props:{loadingText:{default:"Loading Monaco Editor..."},progress:{default:0},showProgress:{type:Boolean,default:!0}},setup(e){return(t,n)=>(we(),Re("div",null,[ae("div",null,[UIo,ae("div",null,Ee(t.loadingText),1),t.showProgress?(we(),Re("div",jIo,[ae("div",null,[ae("div",{style:eo({width:`${t.progress}%`})},null,4)]),ae("div",null,Ee(t.progress)+"%",1)])):Ft("",!0)])]))}}),HIo=ae("div",null,[ae("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[ae("circle",{cx:"12",cy:"12",r:"10",stroke:"#dc3545","stroke-width":"2"}),ae("path",{d:"m15 9-6 6",stroke:"#dc3545","stroke-width":"2"}),ae("path",{d:"m9 9 6 6",stroke:"#dc3545","stroke-width":"2"})])],-1),VIo=ae("div",null,"Monaco Editor Error",-1),zIo={key:0},ZIo=ae("summary",null,"Error Details",-1),YIo={key:1},XIo=qe({__name:"MonacoErrorBoundary",props:{error:{},showDetails:{type:Boolean,default:!0},showRetry:{type:Boolean,default:!0},showReload:{type:Boolean,default:!1},showReport:{type:Boolean,default:!1}},emits:["retry","reload","report"],setup(e,{emit:t}){const n=e,r=t,o=G(()=>n.error.code),s=()=>{r("retry")},a=()=>{typeof window<"u"&&window.location.reload(),r("reload")},l=()=>{r("report",n.error)};return(d,u)=>(we(),Re("div",null,[ae("div",null,[HIo,VIo,ae("div",null,Ee(d.error.message),1),d.error.details&&d.showDetails?(we(),Re("div",zIo,[ae("details",null,[ZIo,ae("pre",null,Ee(d.error.details),1)])])):Ft("",!0),ae("div",null,[d.error.recoverable&&d.showRetry?(we(),Re("button",{key:0,onClick:s},"Retry")):Ft("",!0),d.showReload?(we(),Re("button",{key:1,onClick:a},"Reload Page")):Ft("",!0),d.showReport?(we(),Re("button",{key:2,onClick:l},"Report Issue")):Ft("",!0)]),o.value?(we(),Re("div",YIo,"Error Code: "+Ee(o.value),1)):Ft("",!0)])]))}}),bNn=qe({__name:"CodeEditor",props:{loadingText:{},showProgress:{type:Boolean,default:!0},showErrorBoundary:{type:Boolean,default:!0},retryable:{type:Boolean,default:!0},lifecycle:{},useDefaultLoading:{type:Boolean,default:!0},useDefaultErrorBoundary:{type:Boolean,default:!0},value:{default:""},width:{default:"100%"},height:{default:"100%"},theme:{default:"vs"},language:{default:"javascript"},options:{default:()=>({})}},emits:["editorWillMount","editorDidMount","change","update:value","error","ready","loading"],setup(e,{emit:t}){const n=e,r=t,{container:o,loading:s,error:a,isReady:l,retry:d}=NIo(n,r),{width:u,height:h}=Si(n),f=G(()=>({width:X8t(u.value),height:X8t(h.value),textAlign:"left",position:"relative"})),g=G(()=>({width:"100%",height:"100%",visibility:l.value&&!a.value?"visible":"hidden"})),k=()=>{d(),r("error",null)};return ut(s,A=>{r("loading",A)},{deep:!0}),ut(a,A=>{r("error",A)}),ut(l,A=>{A&&r("ready")}),(A,m)=>(we(),Re("div",{ref:"editorContainer",style:eo(f.value),class:"monaco-code-editor"},[!ge(l)&&!ge(a)?ro(A.$slots,"loading",{key:0,loading:ge(s),loadingText:A.loadingText||ge(s).loadingText,progress:ge(s).progress,showProgress:A.showProgress},()=>[A.useDefaultLoading?(we(),Ot(WIo,{key:0,"loading-text":A.loadingText||ge(s).loadingText,progress:ge(s).progress,"show-progress":A.showProgress},null,8,["loading-text","progress","show-progress"])):Ft("",!0)]):ge(a)&&A.showErrorBoundary?ro(A.$slots,"error",{key:1,error:ge(a),retry:k,retryable:A.retryable},()=>[A.useDefaultErrorBoundary?(we(),Ot(XIo,{key:0,error:ge(a),"show-retry":A.retryable,"show-details":!0,"show-reload":!1,"show-report":!1,onRetry:k},null,8,["error","show-retry"])):Ft("",!0)]):Ft("",!0),ae("div",{ref_key:"container",ref:o,style:eo(g.value)},null,4)],4))}}),VSe=`/**\r * Toonflow AI供应商模板\r * @version 2.0\r */\r \r // ============================================================\r // 类型定义\r // ============================================================\r \r type VideoMode =\r | "singleImage" //单图参考\r | "startEndRequired" //首尾帧(两张都得有)\r | "endFrameOptional" //首尾帧(尾帧可选)\r | "startFrameOptional" //首尾帧(首帧可选)\r | "text" //文本\r | (\`videoReference:\${number}\` | \`imageReference:\${number}\` | \`audioReference:\${number}\`)[]; //多参考(数字代表限制数量)\r \r interface TextModel {\r name: string;\r modelName: string;\r type: "text";\r think: boolean;\r }\r \r interface ImageModel {\r name: string;\r modelName: string;\r type: "image";\r mode: ("text" | "singleImage" | "multiReference")[];\r associationSkills?: string;\r }\r \r interface VideoModel {\r name: string;\r modelName: string;\r type: "video";\r mode: VideoMode[];\r associationSkills?: string;\r audio: "optional" | false | true;\r durationResolutionMap: { duration: number[]; resolution: string[] }[];\r }\r \r interface TTSModel {\r name: string;\r modelName: string;\r type: "tts";\r voices: { title: string; voice: string }[];\r }\r \r interface VendorConfig {\r id: string; //唯一ID,作为文件名存储用户磁盘上,禁止符号\r version: string; //版本号,格式为x.y,需遵守语义化版本控制\r name: string; //供应商名称\r author: string; //作者\r description?: string; //描述,支持Markdown格式\r icon?: string; //图标,仅支持Base64格式,建议尺寸为128x128像素\r inputs: { key: string; label: string; type: "text" | "password" | "url"; required: boolean; placeholder?: string }[];\r inputValues: Record;\r models: (TextModel | ImageModel | VideoModel | TTSModel)[];\r }\r \r type ReferenceList =\r | { type: "image"; sourceType: "base64"; base64: string }\r | { type: "audio"; sourceType: "base64"; base64: string }\r | { type: "video"; sourceType: "base64"; base64: string };\r \r interface ImageConfig {\r prompt: string;\r referenceList?: Extract[];\r size: "1K" | "2K" | "4K";\r aspectRatio: \`\${number}:\${number}\`;\r }\r \r interface VideoConfig {\r duration: number;\r resolution: string;\r aspectRatio: "16:9" | "9:16";\r prompt: string;\r referenceList?: ReferenceList[];\r audio?: boolean;\r mode: VideoMode[];\r }\r \r interface TTSConfig {\r text: string;\r voice: string;\r speechRate: number;\r pitchRate: number;\r volume: number;\r referenceList?: Extract[];\r }\r \r interface PollResult {\r completed: boolean;\r data?: string;\r error?: string;\r }\r \r // ============================================================\r // 全局声明\r // ============================================================\r \r declare const axios: any; // HTTP请求库\r declare const logger: (msg: string) => void; // 日志函数\r declare const jsonwebtoken: any; // JWT处理库\r declare const zipImage: (base64: string, size: number) => Promise; // 图片压缩函数,返回有头base64字符串\r declare const zipImageResolution: (base64: string, w: number, h: number) => Promise; // 图片分辨率调整函数,返回有头base64字符串\r declare const mergeImages: (base64Arr: string[], maxSize?: string) => Promise; // 图片合成函数,返回有头base64字符串\r declare const urlToBase64: (url: string) => Promise; // URL转Base64函数,返回有头base64字符串\r declare const pollTask: (fn: () => Promise, interval?: number, timeout?: number) => Promise; // 轮询函数,fn为异步函数,interval为轮询间隔,timeout为超时时间,返回fn的结果\r declare const createOpenAI: any;\r declare const createDeepSeek: any;\r declare const createZhipu: any;\r declare const createQwen: any;\r declare const createAnthropic: any;\r declare const createOpenAICompatible: any;\r declare const createXai: any;\r declare const createMinimax: any;\r declare const createGoogleGenerativeAI: any;\r declare const exports: {\r vendor: VendorConfig;\r textRequest: (m: TextModel) => any; //文本模型\r imageRequest: (c: ImageConfig, m: ImageModel) => Promise; //图片模型,返回有头base64字符串\r videoRequest: (c: VideoConfig, m: VideoModel) => Promise; //视频模型,返回有头base64字符串\r ttsRequest: (c: TTSConfig, m: TTSModel) => Promise; //(暂未开放)语音模型,返回有头base64字符串\r checkForUpdates?: () => Promise<{ hasUpdate: boolean; latestVersion: string; notice: string }>; //检查更新函数,返回是否有更新和最新版本号和更公告(支持Markdown格式)\r updateVendor?: () => Promise; //更新函数,返回最新的代码文本\r };\r \r // ============================================================\r // 供应商配置\r // ============================================================\r \r const vendor: VendorConfig = {\r id: "bull",\r version: "2.0",\r author: "Toonflow",\r name: "空模板",\r description: "## OpenAI标准格式接口,可修改请求地址并手动添加模型。",\r inputs: [\r { key: "apiKey", label: "API密钥", type: "password", required: true },\r { key: "baseUrl", label: "请求地址", type: "url", required: true, placeholder: "示例:https://api.openai.com/v1" },\r ],\r inputValues: { apiKey: "", baseUrl: "https://api.openai.com/v1" },\r models: [{ name: "GPT-4o", modelName: "gpt-4o", type: "text", think: false }],\r };\r \r // ============================================================\r // 适配器函数\r // ============================================================\r \r const textRequest = (model: TextModel) => {\r if (!vendor.inputValues.apiKey) throw new Error("缺少API Key");\r const apiKey = vendor.inputValues.apiKey.replace(/^Bearer\\s+/i, "");\r return createOpenAI({ baseURL: vendor.inputValues.baseUrl, apiKey }).chat(model.modelName);\r };\r \r const imageRequest = async (config: ImageConfig, model: ImageModel): Promise => {\r return "";\r };\r \r const videoRequest = async (config: VideoConfig, model: VideoModel): Promise => {\r return "";\r };\r \r const ttsRequest = async (config: TTSConfig, model: TTSModel): Promise => {\r return "";\r };\r \r const checkForUpdates = async (): Promise<{ hasUpdate: boolean; latestVersion: string; notice: string }> => {\r return { hasUpdate: false, latestVersion: "2.0", notice: "## 新版本更新公告" };\r };\r \r const updateVendor = async (): Promise => {\r return "";\r };\r \r // ============================================================\r // 导出\r // ============================================================\r \r exports.vendor = vendor;\r exports.textRequest = textRequest;\r exports.imageRequest = imageRequest;\r exports.videoRequest = videoRequest;\r exports.ttsRequest = ttsRequest;\r exports.checkForUpdates = checkForUpdates;\r exports.updateVendor = updateVendor;\r \r // 这行代码用于确保当前文件被识别为模块,避免全局变量冲突\r export {};\r \r /**\r * ============================================================\r * AI 代码生成指南\r * ============================================================\r *\r * 【概述】\r * 本文件是 Toonflow AI 供应商适配模板。AI 在生成新供应商适配代码时,\r * 必须严格遵守以下规则,并要求用户提供目标平台的 curl 调用示例或 API 文档信息作为输入依据。\r *\r * 【前置要求】\r * 在生成代码前,请向用户索要以下信息(至少其一):\r * 1. 目标 API 的 curl 请求示例(包含请求地址、Headers、Body 结构、响应结构)\r * 2. 目标 API 的官方文档链接或文档截图/文本内容\r * 3. 需要适配的模型类型(text / image / video / tts)及其能力说明\r * 没有足够信息时,应主动追问,不要凭空编造 API 结构。\r *\r * 【代码规则】\r *\r * 1. 禁止引入任何外部包\r * 不可使用 import / require,仅能使用本文件「全局声明」区域中已声明的方法和对象,\r * 包括:axios、logger、jsonwebtoken、zipImage、zipImageResolution、mergeImages、\r * urlToBase64、pollTask,以及 createOpenAI、createDeepSeek、createZhipu、createQwen、\r * createAnthropic、createOpenAICompatible、createXai、createMinimax、\r * createGoogleGenerativeAI 等 AI SDK 工厂函数。\r *\r * 2. 禁止在 exports.* 函数外部声明离散的全大写常量\r * 错误示例:const API_URL = "https://..."; const MAX_RETRY = 3;\r * 如果确实需要可配置的常量值,必须将其声明在 vendor.inputValues 中,\r * 通过 vendor.inputValues.xxx 访问,让用户可在界面上配置。\r * 如果是纯逻辑内部使用的临时变量,应内联在对应的 exports.* 函数体内部,使用小驼峰命名。\r *\r * 3. 逻辑尽量聚合在 exports.* 对应的函数内部\r * 每个适配函数(textRequest / imageRequest / videoRequest / ttsRequest)\r * 应自包含,将请求构造、发送、轮询、结果解析等逻辑写在函数体内,避免拆分出大量外部辅助函数。\r * 如果多个函数确实存在公共逻辑(如签名计算、Token 生成、请求头构造),\r * 可提取为文件内的小驼峰命名函数,放在「适配器函数」区块之前的「辅助工具」区块中,\r * 且不可使用全大写命名。\r *\r * 4. 命名规范\r * 所有变量、函数一律使用小驼峰命名(camelCase),禁止使用 UPPER_SNAKE_CASE。\r *\r * 5. 不需要重新声明类型\r * 本文件顶部已完整定义了所有接口和类型(VendorConfig、ImageConfig、VideoConfig、\r * TTSConfig、TextModel、ImageModel、VideoModel、TTSModel、ReferenceList、PollResult 等),\r * AI 生成代码时直接使用即可,不要重复声明。\r *\r * 6. 返回值规范\r * - textRequest(model):返回 AI SDK 的 chat model 实例(通过 createOpenAI 等工厂函数创建)。\r * - imageRequest(config, model):返回有头 base64 字符串(如 "data:image/png;base64,...")。\r * config.referenceList 为 Extract[] 类型,\r * 每个引用条目均为 base64 形式(sourceType 固定为 "base64")。\r * - videoRequest(config, model):返回有头 base64 字符串(如 "data:video/mp4;base64,...")。\r * config.referenceList 为 ReferenceList[] 类型,可包含 image / video / audio 三种引用,\r * 每个引用条目均为 base64 形式(sourceType 固定为 "base64")。\r * config.mode 为当前激活的视频模式数组,需根据 mode 决定如何使用 referenceList。\r * - ttsRequest(config, model):返回有头 base64 字符串(如 "data:audio/mp3;base64,...")。\r * config.referenceList 为 Extract[] 类型(音频参考)。\r * 当 API 返回的是 URL 而非二进制数据时,使用 urlToBase64(url) 转换。\r *\r * 7. ReferenceList 与 VideoMode 说明\r * ReferenceList 是统一的多媒体引用类型,每个条目包含:\r * - type: "image" | "audio" | "video"(媒体类型)\r * - sourceType: "base64"(当前模板固定为 base64)\r * - base64(对应的数据)\r *\r * VideoMode 定义了视频模型支持的输入模式:\r * - "text":纯文本生成视频\r * - "singleImage":单张首帧图片\r * - "startEndRequired":首尾帧(两张都必须提供)\r * - "endFrameOptional":首尾帧(尾帧可选)\r * - "startFrameOptional":首尾帧(首帧可选)\r * - 数组形式如 ["imageReference:9", "videoReference:3", "audioReference:3"]:\r * 多模态参考模式,数字表示该类型的最大数量限制。\r *\r * 在 videoRequest 中,config.mode 表示当前选择的模式,需根据其值决定:\r * - 如何从 config.referenceList 中提取对应类型的引用\r * - 如何构造 API 请求体中的图片/视频/音频参数\r *\r * 8. 异步任务处理\r * 对于视频生成等需要轮询的异步任务,使用全局的 pollTask 函数:\r * const result = await pollTask(async () => {\r * const resp = await axios.get(...);\r * if (resp.data.status === "SUCCESS") return { completed: true, data: resp.data.url };\r * if (resp.data.status === "FAILED") return { completed: true, error: resp.data.message };\r * return { completed: false };\r * }, 5000, 600000); // 每5秒轮询,10分钟超时\r * if (result.error) throw new Error(result.error);\r * return await urlToBase64(result.data!);\r *\r * 9. 错误处理\r * 在每个函数开头校验必需参数(如 API Key),缺失时使用 throw new Error("...") 抛出。\r * API 请求失败时,从响应中提取有意义的错误信息抛出,不要吞掉异常。\r *\r * 10. 日志输出\r * 在关键步骤使用 logger("...") 输出日志(如"开始提交任务"、"任务ID: xxx"、"轮询中..."),\r * 便于调试。\r *\r * 11. vendor 配置填写\r * - id:纯英文小写,作为文件名使用,禁止特殊符号和空格。\r * - version:语义化版本格式 "x.y"。\r * - inputs:根据目标 API 所需的认证信息配置(API Key、Secret、请求地址等)。\r * - models:根据目标平台支持的模型列表填写,注意正确设置 type 和各模型特有字段。\r * - VideoModel 的 mode 对应 API 支持的输入模式(参见规则 7 的 VideoMode 说明)。\r * - VideoModel 的 audio 字段:true(始终生成音频)、false(不生成)、"optional"(用户可选)。\r * - VideoModel 的 durationResolutionMap 对应各时长下可选的分辨率。\r * - VideoModel 的 associationSkills 可选,用于描述模型的特殊能力。\r * - ImageModel 的 mode 对应 API 支持的生图模式("text" 纯文本、"singleImage" 单图参考、"multiReference" 多图参考)。\r * - TTSModel 的 voices 对应可选的音色列表。\r *\r * 12. 图片处理\r * - 需要压缩图片体积时使用 zipImage(base64, maxSizeKB)。\r * - 需要调整图片分辨率时使用 zipImageResolution(base64, width, height)。\r * - 需要将多张图片拼合为一张时使用 mergeImages(base64Arr, maxSize)。\r * - 以上函数均接收和返回有头 base64 字符串。\r *\r * 13. 文件结构\r * 生成的代码必须保持本模板的整体结构:\r * 类型定义区 → 全局声明区 → 供应商配置区 → [辅助工具区(可选)] → 适配器函数区 → 导出区\r * 不要打乱顺序,不要删除已有的结构注释分隔线。\r * 辅助工具区用于放置多个适配器函数共享的小驼峰命名辅助函数(如 getHeaders、getBaseUrl)。\r *\r * 14. 导出规范\r * 必须导出以下字段(通过 exports.xxx = xxx 赋值):\r * - exports.vendor(必须)\r * - exports.textRequest(必须)\r * - exports.imageRequest(必须)\r * - exports.videoRequest(必须)\r * - exports.ttsRequest(必须)\r * - exports.checkForUpdates(可选)\r * - exports.updateVendor(可选)\r * 未实现的适配器函数保留空实现(return ""),不可省略导出。\r * 文件末尾必须包含 export {}; 以确保文件被识别为模块。\r *\r * 【生成流程】\r * 当用户请求生成新的供应商适配时:\r * 1. 确认用户已提供 curl 示例或 API 文档。\r * 2. 分析 API 的认证方式、端点地址、请求/响应结构。\r * 3. 基于本模板结构,填充 vendor 配置和对应的适配器函数。\r * 4. 根据当前模板的 ReferenceList 定义,按 base64 形式构造和消费 referenceList。\r * 5. 仅实现用户需要的模型类型,未用到的函数保留空实现(return "")。\r * 6. 生成完整可用的代码,确保无语法错误、无遗漏导出。\r */\r `,qIo={class:"textTestDialog"},GIo={key:0,class:"emptyHint"},KIo={class:"bubble"},JIo={class:"role"},_Io={key:0,class:"content"},$Io={key:0,class:"thinkContent"},eNo={key:1,class:"cursor"},tNo={key:1,class:"content"},nNo={class:"inputArea"},iNo={class:"inputActions"},rNo={class:"hint"},oNo={class:"btns"},sNo=qe({__name:"TextModelTest",props:Vs({vendorId:{},modelName:{}},{modelVisible:{type:Boolean},modelVisibleModifiers:{}}),emits:["update:modelVisible"],setup(e){const t=e,n=Pl(e,"modelVisible"),r=le([]),o=le(""),s=le(!1),a=le(null);function l(){_n(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})}async function d(){var k,A,m;const f=o.value.trim();if(!f||s.value)return;r.value.push({role:"user",content:f}),o.value="",s.value=!0;const g={role:"assistant",content:"",loading:!0};r.value.push(g),l();try{const v=r.value.slice(0,-1).map(b=>({role:b.role,content:b.content})),{data:p}=await Xt.post("/setting/vendorConfig/modelTest/textTest",{modelName:t.modelName,id:t.vendorId,messages:v});g.content=typeof p=="string"?p:(p==null?void 0:p.content)??JSON.stringify(p),g.thinking=(p==null?void 0:p.thinking)??void 0,g.loading=!1}catch(v){const p=((A=(k=v==null?void 0:v.response)==null?void 0:k.data)==null?void 0:A.message)||((m=v==null?void 0:v.response)==null?void 0:m.data)||(v==null?void 0:v.message)||String(v);g.content=`❌ ${typeof p=="string"?p:JSON.stringify(p)}`,g.loading=!1}finally{s.value=!1,l()}}function u(){r.value=[]}function h(){r.value=[],o.value="",s.value=!1}return(f,g)=>{const k=dn("i-thinking-problem"),A=RA,m=fi,v=dn("i-send"),p=Aa;return we(),Ot(p,{placement:"center",width:"60vw",visible:n.value,"onUpdate:visible":g[1]||(g[1]=b=>n.value=b),header:f.$t("settings.vendor.test.textTitle")+" - "+e.modelName,footer:!1,onClosed:h},{default:me(()=>[ae("div",qIo,[ae("div",{class:"messageList",ref_key:"messageListRef",ref:a},[ge(r).length===0?(we(),Re("div",GIo,Ee(f.$t("settings.vendor.test.textEmptyHint")),1)):Ft("",!0),(we(!0),Re(Yt,null,hi(ge(r),(b,O)=>(we(),Re("div",{key:O,class:no(["messageItem",b.role])},[ae("div",KIo,[ae("div",JIo,Ee(b.role==="user"?f.$t("settings.vendor.test.you"):f.$t("settings.vendor.test.assistant")),1),b.role==="assistant"?(we(),Re("div",_Io,[b.thinking?(we(),Re("span",$Io,[c(k,{theme:"outline",size:"14"}),ft(" "+Ee(b.thinking),1)])):Ft("",!0),ae("span",null,Ee(b.content),1),b.loading?(we(),Re("span",eNo,"▌")):Ft("",!0)])):(we(),Re("div",tNo,Ee(b.content),1))])],2))),128))],512),ae("div",nNo,[c(A,{modelValue:ge(o),"onUpdate:modelValue":g[0]||(g[0]=b=>yn(o)?o.value=b:null),placeholder:f.$t("settings.vendor.test.textInputPlaceholder"),autosize:{minRows:2,maxRows:5},disabled:ge(s),onKeydown:EMe(Mi(d,["ctrl","exact"]),["enter"])},null,8,["modelValue","placeholder","disabled","onKeydown"]),ae("div",iNo,[ae("span",rNo,"Ctrl + Enter "+Ee(f.$t("settings.vendor.test.send")),1),ae("div",oNo,[c(m,{variant:"outline",size:"small",disabled:ge(s)||ge(r).length===0,onClick:u},{default:me(()=>[ft(Ee(f.$t("settings.vendor.test.clearHistory")),1)]),_:1},8,["disabled"]),c(m,{theme:"primary",size:"small",loading:ge(s),disabled:!ge(o).trim(),onClick:d},{icon:me(()=>[c(v,{theme:"outline"})]),default:me(()=>[ft(" "+Ee(f.$t("settings.vendor.test.send")),1)]),_:1},8,["loading","disabled"])])])])])]),_:1},8,["visible","header"])}}}),aNo=fr(sNo,[["__scopeId","data-v-09ade7e9"]]),lNo={class:"imageTestDialog"},cNo={class:"modeBar"},dNo={class:"inputSection"},uNo={key:0,class:"uploadRow"},hNo=["src"],ANo={class:"uploadText"},fNo={class:"uploadHint"},gNo={key:0,class:"resultSection"},mNo={class:"resultLabel"},kNo={class:"resultImg"},vNo=["src"],pNo={key:1,class:"loadingSection"},bNo={class:"dialogFooter"},ONo=qe({__name:"ImageModelTest",props:Vs({vendorId:{},modelName:{},supportedModes:{}},{modelVisible:{type:Boolean},modelVisibleModifiers:{}}),emits:["update:modelVisible"],setup(e){const t=Pl(e,"modelVisible"),n=e,r=[{value:"text",label:$t("settings.vendor.test.textToImage")},{value:"singleImage",label:$t("settings.vendor.test.imageToImage")},{value:"multiReference",label:$t("settings.vendor.test.multiRef")}],o=G(()=>r.filter(O=>n.supportedModes.includes(O.value))),s=le("text");ut(()=>n.supportedModes,O=>{O.length>0&&!O.includes(s.value)&&(s.value=O[0])},{immediate:!0}),ut(s,()=>{l.value=null,d.value="",f.value=""});const a=le(""),l=le(null),d=le(""),u=le(null),h=le(!1),f=le(""),g=G(()=>h.value?!1:s.value==="text"?!!a.value.trim():s.value==="singleImage"||s.value==="multiReference"?!!l.value:!1);function k(){var O;(O=u.value)==null||O.click()}function A(O){var y;const w=(y=O.target.files)==null?void 0:y[0];w&&(l.value=w,d.value=URL.createObjectURL(w),O.target.value="")}function m(O){var y,C;const w=(C=(y=O.dataTransfer)==null?void 0:y.files)==null?void 0:C[0];w&&w.type.startsWith("image/")&&(l.value=w,d.value=URL.createObjectURL(w))}const v=O=>new Promise((w,y)=>{const C=new FileReader;C.onload=()=>w(C.result),C.onerror=y,C.readAsDataURL(O)});async function p(){h.value=!0,f.value="";try{const O={modelName:n.modelName,id:n.vendorId},w=a.value.trim();w&&(O.prompt=w),l.value&&(O.imageBase64=await v(l.value));const{data:y}=await Xt.post("/setting/vendorConfig/modelTest/imageTest",O);f.value=y,window.$message.success($t("settings.vendor.msg.imageGenSuccess"))}catch(O){window.$message.error(O.message??`${$t("settings.vendor.msg.requestFailed")}`)}finally{h.value=!1}}function b(){a.value="",l.value=null,d.value="",f.value="",h.value=!1}return(O,w)=>{const y=OM,C=cE,x=dn("i-picture"),L=RA,S=HA,E=Mc,Q=fi,T=dn("i-lightning"),M=Aa;return we(),Ot(M,{placement:"center",width:"56vw",visible:t.value,"onUpdate:visible":w[4]||(w[4]=B=>t.value=B),header:O.$t("settings.vendor.test.imageTitle")+" - "+e.modelName,footer:!1,onClosed:b},{default:me(()=>[ae("div",lNo,[ae("div",cNo,[c(C,{modelValue:ge(s),"onUpdate:modelValue":w[0]||(w[0]=B=>yn(s)?s.value=B:null),variant:"default-filled"},{default:me(()=>[(we(!0),Re(Yt,null,hi(ge(o),B=>(we(),Ot(y,{key:B.value,value:B.value},{default:me(()=>[ft(Ee(B.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),ae("div",dNo,[ge(s)==="singleImage"?(we(),Re("div",uNo,[ae("div",{class:"uploadBox",onClick:k,onDragover:w[1]||(w[1]=Mi(()=>{},["prevent"])),onDrop:Mi(m,["prevent"])},[ge(d)?(we(),Re("img",{key:0,src:ge(d),class:"previewImg",alt:"preview"},null,8,hNo)):(we(),Re(Yt,{key:1},[c(x,{theme:"outline",size:"32",fill:"var(--td-brand-color)"}),ae("p",ANo,Ee(O.$t("settings.vendor.test.uploadImage")),1),ae("p",fNo,Ee(O.$t("settings.vendor.test.supportFormat")),1)],64))],32),ae("input",{ref_key:"imageInputRef",ref:u,type:"file",accept:"image/*",style:{display:"none"},onChange:A},null,544)])):Ft("",!0),c(S,{label:O.$t("settings.vendor.test.prompt")},{default:me(()=>[c(L,{modelValue:ge(a),"onUpdate:modelValue":w[2]||(w[2]=B=>yn(a)?a.value=B:null),placeholder:O.$t("settings.vendor.test.promptPlaceholder"),autosize:{minRows:2,maxRows:4},disabled:ge(h)},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["label"])]),ge(f)?(we(),Re("div",gNo,[ae("div",mNo,Ee(O.$t("settings.vendor.test.result")),1),ae("div",kNo,[ae("img",{src:ge(f),alt:"generated"},null,8,vNo)])])):ge(h)?(we(),Re("div",pNo,[c(E,{size:"large",text:O.$t("settings.vendor.generating")},null,8,["text"])])):Ft("",!0),ae("div",bNo,[c(Q,{variant:"outline",onClick:w[3]||(w[3]=B=>t.value=!1)},{default:me(()=>[ft(Ee(O.$t("settings.vendor.test.cancel")),1)]),_:1}),c(Q,{theme:"primary",loading:ge(h),disabled:!ge(g),onClick:p},{icon:me(()=>[c(T,{theme:"outline"})]),default:me(()=>[ft(" "+Ee(O.$t("settings.vendor.test.startTest")),1)]),_:1},8,["loading","disabled"])])])]),_:1},8,["visible","header"])}}}),wNo=fr(ONo,[["__scopeId","data-v-3dd5416b"]]),yNo=["src"],CNo={class:"boxText"},xNo={key:0,class:"optionalTag"},LNo=qe({__name:"ImageUploadBox",props:{modelValue:{},optional:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,o=le(null),s=le("");ut(()=>n.modelValue,h=>{h?s.value=URL.createObjectURL(h):s.value=""});function a(){var h;(h=o.value)==null||h.click()}function l(h){var g;const f=((g=h.target.files)==null?void 0:g[0])??null;r("update:modelValue",f),h.target.value=""}function d(h){var g,k;const f=((k=(g=h.dataTransfer)==null?void 0:g.files)==null?void 0:k[0])??null;f!=null&&f.type.startsWith("image/")&&r("update:modelValue",f)}function u(){r("update:modelValue",null)}return(h,f)=>{const g=dn("i-picture"),k=dn("i-close");return we(),Re("div",{class:no(["imageUploadBox",{optional:e.optional,hasFile:!!e.modelValue}]),onClick:a,onDragover:f[0]||(f[0]=Mi(()=>{},["prevent"])),onDrop:Mi(d,["prevent"])},[e.modelValue?(we(),Re("img",{key:0,src:ge(s),class:"preview",alt:"preview"},null,8,yNo)):(we(),Re(Yt,{key:1},[c(g,{theme:"outline",size:"26",fill:"var(--td-brand-color)"}),ae("p",CNo,Ee(e.label||h.$t("settings.vendor.test.uploadImage")),1),e.optional?(we(),Re("p",xNo,Ee(h.$t("settings.vendor.test.optional")),1)):Ft("",!0)],64)),e.modelValue?(we(),Re("button",{key:2,class:"clearBtn",onClick:Mi(u,["stop"])},[c(k,{theme:"outline",size:"12"})])):Ft("",!0),ae("input",{ref_key:"inputRef",ref:o,type:"file",accept:"image/*",style:{display:"none"},onChange:l},null,544)],34)}}}),T9=fr(LNo,[["__scopeId","data-v-f4d54188"]]),SNo=["src"],TNo={class:"boxText"},ENo=qe({__name:"VideoUploadBox",props:{modelValue:{},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,o=le(null),s=le("");ut(()=>n.modelValue,h=>{h?s.value=URL.createObjectURL(h):s.value=""});function a(){var h;(h=o.value)==null||h.click()}function l(h){var g;const f=((g=h.target.files)==null?void 0:g[0])??null;r("update:modelValue",f),h.target.value=""}function d(h){var g,k;const f=((k=(g=h.dataTransfer)==null?void 0:g.files)==null?void 0:k[0])??null;f!=null&&f.type.startsWith("video/")&&r("update:modelValue",f)}function u(){r("update:modelValue",null)}return(h,f)=>{const g=dn("i-video-one"),k=dn("i-close");return we(),Re("div",{class:no(["videoUploadBox",{hasFile:!!e.modelValue}]),onClick:a,onDragover:f[0]||(f[0]=Mi(()=>{},["prevent"])),onDrop:Mi(d,["prevent"])},[e.modelValue&&ge(s)?(we(),Re("video",{key:0,src:ge(s),class:"preview",muted:""},null,8,SNo)):(we(),Re(Yt,{key:1},[c(g,{theme:"outline",size:"26",fill:"var(--td-brand-color)"}),ae("p",TNo,Ee(e.label||h.$t("settings.vendor.test.uploadVideo")),1)],64)),e.modelValue?(we(),Re("button",{key:2,class:"clearBtn",onClick:Mi(u,["stop"])},[c(k,{theme:"outline",size:"12"})])):Ft("",!0),ae("input",{ref_key:"inputRef",ref:o,type:"file",accept:"video/*",style:{display:"none"},onChange:l},null,544)],34)}}}),DNo=fr(ENo,[["__scopeId","data-v-180dc2bb"]]),QNo={class:"boxText fileName"},BNo={class:"boxText"},FNo=qe({__name:"AudioUploadBox",props:{modelValue:{},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=le(null);function o(){var d;(d=r.value)==null||d.click()}function s(d){var h;const u=((h=d.target.files)==null?void 0:h[0])??null;n("update:modelValue",u),d.target.value=""}function a(d){var h,f;const u=((f=(h=d.dataTransfer)==null?void 0:h.files)==null?void 0:f[0])??null;u!=null&&u.type.startsWith("audio/")&&n("update:modelValue",u)}function l(){n("update:modelValue",null)}return(d,u)=>{const h=dn("i-music-one"),f=dn("i-close");return we(),Re("div",{class:no(["audioUploadBox",{hasFile:!!e.modelValue}]),onClick:o,onDragover:u[0]||(u[0]=Mi(()=>{},["prevent"])),onDrop:Mi(a,["prevent"])},[e.modelValue?(we(),Re(Yt,{key:0},[c(h,{theme:"filled",size:"26",fill:"var(--td-success-color)"}),ae("p",QNo,Ee(e.modelValue.name),1)],64)):(we(),Re(Yt,{key:1},[c(h,{theme:"outline",size:"26",fill:"var(--td-brand-color)"}),ae("p",BNo,Ee(e.label||d.$t("settings.vendor.test.uploadAudio")),1)],64)),e.modelValue?(we(),Re("button",{key:2,class:"clearBtn",onClick:Mi(l,["stop"])},[c(f,{theme:"outline",size:"12"})])):Ft("",!0),ae("input",{ref_key:"inputRef",ref:r,type:"file",accept:"audio/*",style:{display:"none"},onChange:s},null,544)],34)}}}),PNo=fr(FNo,[["__scopeId","data-v-20e255aa"]]),MNo={class:"videoTestDialog"},RNo={class:"modeBar"},INo={class:"modeLabel"},NNo={key:0,class:"modeDesc"},UNo={key:1,class:"inputSection"},jNo={class:"uploadRow"},WNo={class:"frameRow"},HNo={class:"frameRow"},VNo={class:"frameRow"},zNo={class:"multiRefSection"},ZNo={class:"multiRefRow"},YNo={key:2,class:"resultSection"},XNo={class:"resultLabel"},qNo=["src"],GNo={key:3,class:"loadingSection"},KNo={class:"dialogFooter"},JNo=qe({__name:"VideoModelTest",props:Vs({vendorId:{},modelName:{},rawModes:{}},{modelVisible:{type:Boolean},modelVisibleModifiers:{}}),emits:["update:modelVisible"],setup(e){const t=e,n=Pl(e,"modelVisible"),r={text:{label:$t("settings.vendor.test.textToVideo"),desc:$t("settings.vendor.test.textToVideoDesc")},singleImage:{label:$t("settings.vendor.test.singleImageMode"),desc:$t("settings.vendor.test.singleImageDesc")},startEndRequired:{label:$t("settings.vendor.startEndRequired"),desc:$t("settings.vendor.test.startEndRequiredDesc")},endFrameOptional:{label:$t("settings.vendor.endFrameOptional"),desc:$t("settings.vendor.test.endFrameOptionalDesc")},startFrameOptional:{label:$t("settings.vendor.startFrameOptional"),desc:$t("settings.vendor.test.startFrameOptionalDesc")}},o=G(()=>{const y=[];for(const C of t.rawModes)if(Array.isArray(C)){const x=[];for(const L of C){const S=String(L).match(/^(videoReference|imageReference|audioReference):(\d+)$/);S&&x.push({type:S[1],count:Number(S[2])})}if(x.length>0){const L=x.map(S=>`${S.type==="imageReference"?$t("settings.vendor.imageRef"):S.type==="videoReference"?$t("settings.vendor.videoRef"):$t("settings.vendor.audioRef")}×${S.count}`).join(" + ");y.push({key:JSON.stringify(C),label:L,desc:`${$t("settings.vendor.test.multiRefDesc")}: ${L}`,refs:x})}}else{const x=r[String(C)];x&&y.push({key:String(C),label:x.label,desc:x.desc})}return y}),s=le("");ut(o,y=>{var C;y.length>0&&!y.find(x=>x.key===s.value)&&(s.value=((C=y[0])==null?void 0:C.key)??"")},{immediate:!0}),ut(s,()=>{A(),k.value=""});const a=G(()=>o.value.find(y=>y.key===s.value)??null),l=G(()=>{var y;return((y=a.value)==null?void 0:y.refs)??[]}),d=le(""),u=le(Array(30).fill(null)),h=le(Array(30).fill(null)),f=le(Array(30).fill(null)),g=le(!1),k=le("");function A(){u.value=Array(30).fill(null),h.value=Array(30).fill(null),f.value=Array(30).fill(null)}function m(y){return y.type==="imageReference"?`${$t("settings.vendor.imageRef")} (×${y.count})`:y.type==="videoReference"?`${$t("settings.vendor.videoRef")} (×${y.count})`:`${$t("settings.vendor.audioRef")} (×${y.count})`}function v(y){return new Promise((C,x)=>{const L=new FileReader;L.onload=()=>C(L.result),L.onerror=x,L.readAsDataURL(y)})}function p(y=""){return y.startsWith("image/")?"image":y.startsWith("video/")?"video":y.startsWith("audio/")?"audio":""}async function b(y){const C=(y||[]).filter(Boolean);return Promise.all(C.map(async x=>({type:p(x.type),base64:await v(x)})))}async function O(){g.value=!0,k.value="";try{const y={modelName:t.modelName,id:t.vendorId,mode:s.value,...d.value.trim()?{prompt:d.value.trim()}:{},images:await b(u.value.filter(Boolean)),videos:await b(h.value.filter(Boolean)),audios:await b(f.value.filter(Boolean))},{data:C}=await Xt.post("/setting/vendorConfig/modelTest/videoTest",y,{timeout:30*60*1e3});k.value=C,window.$message.success($t("settings.vendor.msg.videoGenSuccess"))}catch(y){window.$message.error((y==null?void 0:y.message)??`${$t("settings.vendor.msg.requestFailed")}`)}finally{g.value=!1}}function w(){d.value="",A(),k.value="",g.value=!1}return(y,C)=>{const x=OM,L=cE,S=NO,E=RA,Q=HA,T=Mc,M=fi,B=dn("i-lightning"),P=Aa;return we(),Ot(P,{placement:"center",width:"58vw",visible:n.value,"onUpdate:visible":C[15]||(C[15]=F=>n.value=F),header:y.$t("settings.vendor.test.videoTitle")+" - "+e.modelName,footer:!1,onClosed:w},{default:me(()=>[ae("div",MNo,[ae("div",RNo,[ae("div",INo,Ee(y.$t("settings.vendor.test.selectMode")),1),c(L,{modelValue:ge(s),"onUpdate:modelValue":C[0]||(C[0]=F=>yn(s)?s.value=F:null),variant:"default-filled"},{default:me(()=>[(we(!0),Re(Yt,null,hi(ge(o),F=>(we(),Ot(x,{key:F.key,value:F.key},{default:me(()=>[ft(Ee(F.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),ge(a)?(we(),Re("div",NNo,[c(S,{name:"info-circle-filled",size:"14px"}),ft(" "+Ee(ge(a).desc),1)])):Ft("",!0),ft(" "+Ee(ge(s))+" ",1),ge(s)?(we(),Re("div",UNo,[ge(s)==="text"?(we(),Ot(Q,{key:0,label:y.$t("settings.vendor.test.prompt")},{default:me(()=>[c(E,{modelValue:ge(d),"onUpdate:modelValue":C[1]||(C[1]=F=>yn(d)?d.value=F:null),placeholder:y.$t("settings.vendor.test.videoPromptPlaceholder"),autosize:{minRows:2,maxRows:4},disabled:ge(g)},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["label"])):ge(s)==="singleImage"?(we(),Re(Yt,{key:1},[c(Q,{label:y.$t("settings.vendor.test.referenceImage")},{default:me(()=>[ae("div",jNo,[c(T9,{modelValue:ge(u)[0],"onUpdate:modelValue":C[2]||(C[2]=F=>ge(u)[0]=F)},null,8,["modelValue"])])]),_:1},8,["label"]),c(Q,{label:y.$t("settings.vendor.test.prompt")},{default:me(()=>[c(E,{modelValue:ge(d),"onUpdate:modelValue":C[3]||(C[3]=F=>yn(d)?d.value=F:null),placeholder:y.$t("settings.vendor.test.videoPromptPlaceholder"),autosize:{minRows:2,maxRows:3},disabled:ge(g)},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["label"])],64)):ge(s)==="startEndRequired"?(we(),Re(Yt,{key:2},[ae("div",WNo,[c(Q,{label:y.$t("settings.vendor.test.startFrame")},{default:me(()=>[c(T9,{modelValue:ge(u)[0],"onUpdate:modelValue":C[4]||(C[4]=F=>ge(u)[0]=F)},null,8,["modelValue"])]),_:1},8,["label"]),c(Q,{label:y.$t("settings.vendor.test.endFrame")},{default:me(()=>[c(T9,{modelValue:ge(u)[1],"onUpdate:modelValue":C[5]||(C[5]=F=>ge(u)[1]=F)},null,8,["modelValue"])]),_:1},8,["label"])]),c(Q,{label:y.$t("settings.vendor.test.prompt")},{default:me(()=>[c(E,{modelValue:ge(d),"onUpdate:modelValue":C[6]||(C[6]=F=>yn(d)?d.value=F:null),placeholder:y.$t("settings.vendor.test.videoPromptPlaceholder"),autosize:{minRows:2,maxRows:3},disabled:ge(g)},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["label"])],64)):ge(s)==="endFrameOptional"?(we(),Re(Yt,{key:3},[ae("div",HNo,[c(Q,{label:y.$t("settings.vendor.test.startFrame")},{default:me(()=>[c(T9,{modelValue:ge(u)[0],"onUpdate:modelValue":C[7]||(C[7]=F=>ge(u)[0]=F)},null,8,["modelValue"])]),_:1},8,["label"]),c(Q,{label:y.$t("settings.vendor.test.endFrameOptional")},{default:me(()=>[c(T9,{modelValue:ge(u)[1],"onUpdate:modelValue":C[8]||(C[8]=F=>ge(u)[1]=F),optional:!0},null,8,["modelValue"])]),_:1},8,["label"])]),c(Q,{label:y.$t("settings.vendor.test.prompt")},{default:me(()=>[c(E,{modelValue:ge(d),"onUpdate:modelValue":C[9]||(C[9]=F=>yn(d)?d.value=F:null),placeholder:y.$t("settings.vendor.test.videoPromptPlaceholder"),autosize:{minRows:2,maxRows:3},disabled:ge(g)},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["label"])],64)):ge(s)==="startFrameOptional"?(we(),Re(Yt,{key:4},[ae("div",VNo,[c(Q,{label:y.$t("settings.vendor.test.startFrameOptional")},{default:me(()=>[c(T9,{modelValue:ge(u)[0],"onUpdate:modelValue":C[10]||(C[10]=F=>ge(u)[0]=F),optional:!0},null,8,["modelValue"])]),_:1},8,["label"]),c(Q,{label:y.$t("settings.vendor.test.endFrame")},{default:me(()=>[c(T9,{modelValue:ge(u)[1],"onUpdate:modelValue":C[11]||(C[11]=F=>ge(u)[1]=F)},null,8,["modelValue"])]),_:1},8,["label"])]),c(Q,{label:y.$t("settings.vendor.test.prompt")},{default:me(()=>[c(E,{modelValue:ge(d),"onUpdate:modelValue":C[12]||(C[12]=F=>yn(d)?d.value=F:null),placeholder:y.$t("settings.vendor.test.videoPromptPlaceholder"),autosize:{minRows:2,maxRows:3},disabled:ge(g)},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["label"])],64)):ge(s).startsWith("[")?(we(),Re(Yt,{key:5},[c(Q,{label:y.$t("settings.vendor.test.prompt")},{default:me(()=>[c(E,{modelValue:ge(d),"onUpdate:modelValue":C[13]||(C[13]=F=>yn(d)?d.value=F:null),placeholder:y.$t("settings.vendor.test.videoPromptPlaceholder"),disabled:ge(g)},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["label"]),ae("div",zNo,[(we(!0),Re(Yt,null,hi(ge(l),(F,R)=>(we(),Ot(Q,{key:R,label:m(F)},{default:me(()=>[ae("div",ZNo,[F.type==="imageReference"?(we(!0),Re(Yt,{key:0},hi(F.count,N=>(we(),Ot(T9,{key:N,modelValue:ge(u)[R*10+N-1],"onUpdate:modelValue":I=>ge(u)[R*10+N-1]=I,label:`${y.$t("settings.vendor.test.image")} ${N}`},null,8,["modelValue","onUpdate:modelValue","label"]))),128)):F.type==="videoReference"?(we(!0),Re(Yt,{key:1},hi(F.count,N=>(we(),Ot(DNo,{key:N,modelValue:ge(h)[R*10+N-1],"onUpdate:modelValue":I=>ge(h)[R*10+N-1]=I,label:`${y.$t("settings.vendor.test.video")} ${N}`},null,8,["modelValue","onUpdate:modelValue","label"]))),128)):F.type==="audioReference"?(we(!0),Re(Yt,{key:2},hi(F.count,N=>(we(),Ot(PNo,{key:N,modelValue:ge(f)[R*10+N-1],"onUpdate:modelValue":I=>ge(f)[R*10+N-1]=I,label:`${y.$t("settings.vendor.test.audio")} ${N}`},null,8,["modelValue","onUpdate:modelValue","label"]))),128)):Ft("",!0)])]),_:2},1032,["label"]))),128))])],64)):Ft("",!0)])):Ft("",!0),ge(k)?(we(),Re("div",YNo,[ae("div",XNo,Ee(y.$t("settings.vendor.test.result")),1),ae("video",{src:ge(k),controls:"",autoplay:"",loop:"",class:"resultVideo"},null,8,qNo)])):ge(g)?(we(),Re("div",GNo,[c(T,{size:"large",text:y.$t("settings.vendor.videoGenerating")},null,8,["text"])])):Ft("",!0),ae("div",KNo,[c(M,{variant:"outline",onClick:C[14]||(C[14]=F=>n.value=!1)},{default:me(()=>[ft(Ee(y.$t("settings.vendor.test.cancel")),1)]),_:1}),c(M,{theme:"primary",loading:ge(g),onClick:O},{icon:me(()=>[c(B,{theme:"outline"})]),default:me(()=>[ft(" "+Ee(y.$t("settings.vendor.test.startTest")),1)]),_:1},8,["loading"])])])]),_:1},8,["visible","header"])}}}),_No=fr(JNo,[["__scopeId","data-v-47d0efe5"]]),$No={class:"modelServe"},eUo={class:"modelList"},tUo={class:"listFooter"},nUo={class:"listContent"},iUo={key:0,class:"modelParameter"},rUo={class:"configuration"},oUo={class:"infoBox ac jb"},sUo={class:"idBox"},aUo={class:"author"},lUo={class:"requiredLabel"},cUo={class:"requiredText"},dUo={class:"inputHelp"},uUo={key:1,class:"optionalSection"},hUo={class:"inputHelp"},AUo={class:"jb ac"},fUo={class:"sectionTitle"},gUo={class:"topInfo jb ac"},mUo={class:"modelCardNameWrap"},kUo={class:"modelCardName"},vUo={class:"actionBtns"},pUo={class:"tags"},bUo={class:"updateAction"},OUo={class:"addBox"},wUo={style:{display:"flex","flex-direction":"column","align-items":"flex-start",gap:"0"}},yUo={key:0,style:{border:"1px solid #ddd","border-radius":"6px",padding:"6px 12px","margin-top":"6px"}},CUo={class:"drmEditor"},xUo={class:"drmHeader"},LUo={class:"drmHeaderLabel"},SUo={class:"drmHeaderLabel"},TUo={class:"drmRowIndex"},EUo={class:"data"},DUo={key:0,class:"linkAdd"},QUo={style:{"margin-top":"10px","text-align":"right",width:"100%"}},BUo={key:1,class:"importAdd"},FUo={class:"dragIcon"},PUo={class:"uploadText"},MUo={class:"uploadHint"},RUo={key:2,class:"codeAdd"},IUo={class:"editorToolbar"},NUo={class:"editorInfo"},UUo={class:"editorActions"},jUo={class:"editorWrapper"},WUo=700,HUo=qe({__name:"vendorConfig",setup(e){const{themeSetting:t}=Br(qs()),n={text:"settings.vendor.textModel",image:"settings.vendor.imageModel",video:"settings.vendor.videoModel"},r={singleImage:"settings.vendor.singleImage",multiReference:"settings.vendor.multiReference",startEndRequired:"settings.vendor.startEndRequired",endFrameOptional:"settings.vendor.endFrameOptional",startFrameOptional:"settings.vendor.startFrameOptional",audioReference:"settings.vendor.audioRef",videoReference:"settings.vendor.videoRef",imageReference:"settings.vendor.imageRef"};function o(Ke){return n[Ke]||Ke}function s(Ke,ze){if(Ke==="text")return $t(ze==="image"?"settings.vendor.textToImage":"settings.vendor.textToVideo");const jt=String(Ke).match(/^(videoReference|imageReference|audioReference):(\d+)$/);if(jt){const en=r[jt[1]];return en?`${$t(en)} ×${jt[2]}`:Ke}return r[Ke]?$t(r[Ke]):Ke}const a={fontSize:14,automaticLayout:!0,tabSize:2,scrollBeyondLastLine:!1,formatOnPaste:!0,formatOnType:!0},l=[{value:"text",label:"settings.vendor.textModel"},{value:"image",label:"settings.vendor.imageModel"},{value:"video",label:"settings.vendor.videoModel"}],d=[{label:"settings.vendor.textToImage",value:"text"},{label:"settings.vendor.singleImage",value:"singleImage"},{label:"settings.vendor.multiReference",value:"multiReference"}],u=[{label:"settings.vendor.singleImage",value:"singleImage"},{label:"settings.vendor.startEndRequired",value:"startEndRequired"},{label:"settings.vendor.endFrameOptional",value:"endFrameOptional"},{label:"settings.vendor.startFrameOptional",value:"startFrameOptional"},{label:"settings.vendor.textToVideo",value:"text"},{label:"settings.vendor.multiReferenceMode",value:"multiReference"}],h=[{label:"settings.vendor.videoRef",value:"videoReference"},{label:"settings.vendor.imageRef",value:"imageReference"},{label:"settings.vendor.audioRef",value:"audioReference"}],f=[{label:"settings.vendor.audioOptional",value:"optional"},{label:"settings.vendor.audioOnly",value:!0},{label:"settings.vendor.noAudio",value:!1}],g=le([]),k=le(!1);async function A(){k.value=!0;try{const Ke=await Xt.post("/setting/vendorConfig/getVendorList");g.value=Ke.data.map(ze=>({...ze,enable:ze.enable})),g.value.length&&!g.value.some(ze=>ze.id===m.value)&&(m.value=g.value[0].id)}catch(Ke){window.$message.error(`${$t("settings.vendor.msg.getVendorListFailed")}${Ke.message}`)}finally{k.value=!1,_n(()=>{Q.value=K.value,E.value=!0})}}vn(()=>{A()});const m=le(),v=G(()=>g.value.find(Ke=>Ke.id===m.value)),p=G(()=>{var Ke,ze;return((Ke=v.value)==null?void 0:Ke.models)||((ze=v.value)==null?void 0:ze.model)||[]}),b=G(()=>{var Ke,ze;return((ze=(Ke=v.value)==null?void 0:Ke.inputs)==null?void 0:ze.filter(jt=>jt.required))||[]}),O=G(()=>{var Ke,ze;return((ze=(Ke=v.value)==null?void 0:Ke.inputs)==null?void 0:ze.filter(jt=>!jt.required))||[]}),w=le(!1),y=le(!1),C=le(VSe),x=le(null),L=le(!1),S=le(!1),E=le(!1),Q=le("");let T=null,M=!1;const B=le(null),P=le(!1),F=le(!1),R=le(!1);function N(Ke){return Ke==="password"?"secured":Ke==="url"?"link":"edit-1"}function I(Ke){var ze;return((ze=Ke.placeholder)==null?void 0:ze.trim())||""}function W(Ke){return Ke?/^(?:data:[^;]+;base64,)?[A-Za-z0-9+/]*={0,2}$/.test(Ke)&&Ke.length>0:!1}function H(Ke){if(!Ke.version)return!0;const ze=parseFloat(Ke.version);return isNaN(ze)||ze<2}function V(Ke){if(!Ke)return null;const ze=tet.find(jt=>jt.pattern.test(Ke));return ze?CK[ze.provider]:null}function Z(Ke){return{id:Ke.id,inputValues:Ke.inputValues}}const K=G(()=>v.value?JSON.stringify(Z(v.value)):"");function X(){T&&clearTimeout(T),T=setTimeout(()=>{ee()},WUo)}async function ee(){if(!v.value||!E.value||k.value)return;const Ke=K.value;if(!(!Ke||Ke===Q.value)){if(S.value){M=!0;return}S.value=!0;try{await Xt.post("/setting/vendorConfig/updateVendorInputs",Z(v.value)),Q.value=Ke}catch(ze){window.$message.error(`${$t("settings.vendor.msg.updateFailed")}${ze.message}`)}finally{S.value=!1,M&&(M=!1,X())}}}ut(K,Ke=>{!Ke||!E.value||k.value||Ke!==Q.value&&X()},{flush:"post"}),ut(m,()=>{T&&(clearTimeout(T),T=null),M=!1,_n(()=>{Q.value=K.value})},{flush:"post"});const q=le();function $(){xe.value="importAdd",q.value=void 0,C.value=VSe,w.value=!0,y.value=!1}function oe(){if(q.value){const Ke=Kr.confirm({theme:"danger",header:$t("settings.vendor.msg.highRiskConfirm"),body:$t("settings.vendor.msg.updateVendorRiskBody"),confirmBtn:{content:$t("settings.vendor.msg.iKnowRisk"),theme:"danger"},cancelBtn:$t("settings.vendor.msg.cancel"),onConfirm:()=>{Ke.destroy();const ze=Kr.confirm({theme:"danger",header:$t("settings.vendor.msg.confirmAgain"),body:$t("settings.vendor.msg.updateVendorConfirmBody"),confirmBtn:{content:$t("settings.vendor.msg.confirmAndUpdate"),theme:"danger"},cancelBtn:$t("settings.vendor.msg.goBackCheck"),onConfirm:async()=>{Xt.post("/setting/vendorConfig/updateCode",{id:q.value,tsCode:C.value}).then(jt=>{window.$message.success($t("settings.vendor.msg.updateSuccess")),w.value=!1,y.value=!1,A()}).catch(jt=>{window.$message.error(`${$t("settings.vendor.msg.updateFailed")}${jt.message}`)}).finally(()=>{ze.destroy()})},onClose:()=>ze.hide()})},onClose:()=>Ke.hide()})}else{const Ke=Kr.confirm({theme:"danger",header:$t("settings.vendor.msg.highRiskConfirm"),body:$t("settings.vendor.msg.addVendorRiskBody"),confirmBtn:{content:$t("settings.vendor.msg.iKnowRisk"),theme:"danger"},cancelBtn:$t("settings.vendor.msg.cancel"),onConfirm:()=>{Ke.destroy();const ze=Kr.confirm({theme:"danger",header:$t("settings.vendor.msg.confirmAgain"),body:$t("settings.vendor.msg.addVendorConfirmBody"),confirmBtn:{content:$t("settings.vendor.msg.confirmAndAdd"),theme:"danger"},cancelBtn:$t("settings.vendor.msg.goBackCheck"),onConfirm:async()=>{Xt.post("/setting/vendorConfig/addVendor",{tsCode:C.value}).then(jt=>{window.$message.success($t("settings.vendor.msg.vendorAdded")),w.value=!1,y.value=!1,A()}).catch(jt=>{window.$message.error(jt.message??`${$t("settings.vendor.msg.addFailed")}`)}).finally(()=>{ze.destroy()})},onClose:()=>ze.hide()})},onClose:()=>Ke.hide()})}}const de=le(!1),ke=le(null),ne=le(null),Ae=le({name:"",modelName:"",type:"text",think:!1,mode:[],mixedMode:[],mixedModeCount:{},audio:"optional",durationResolutionMap:[{duration:[],resolution:[]}]});function Y(Ke="text"){Ae.value={name:"",modelName:"",type:Ke,think:!1,mode:[],mixedMode:[],mixedModeCount:{},audio:"optional",durationResolutionMap:[{duration:[],resolution:[]}]}}function re(){return v.value?(Array.isArray(v.value.models)||(v.value.models=Array.isArray(v.value.model)?[...v.value.model]:[]),v.value.model=v.value.models,v.value.models):[]}function ce(){const Ke=Ae.value.name.trim(),ze=Ae.value.modelName.trim();if(!Ke)return window.$message.error($t("settings.vendor.msg.fillDisplayName")),null;if(!ze)return window.$message.error($t("settings.vendor.msg.fillModelId")),null;if(Ae.value.type==="text")return{name:Ke,modelName:ze,type:"text",think:Ae.value.think};if(Ae.value.type==="image"){const bt=Ae.value.mode;return bt.length?{name:Ke,modelName:ze,type:"image",mode:bt}:(window.$message.error($t("settings.vendor.msg.selectImageMode")),null)}const jt=[...Ae.value.mode].filter(bt=>bt!=="multiReference");if(Ae.value.mixedMode.length>0){const bt=Ae.value.mixedMode.map(Dt=>{const Ct=Ae.value.mixedModeCount[Dt]??1;return`${Dt}:${Ct}`});jt.push(bt)}if(!jt.length)return window.$message.error($t("settings.vendor.msg.selectVideoMode")),null;const en=[];for(let bt=0;btNumber.isFinite(Fn)&&Fn>0),On=Dt.resolution.filter(Boolean);if(!Ct.length)return window.$message.error(`${$t("settings.vendor.msg.groupPrefix",{n:bt+1})}${$t("settings.vendor.msg.addDuration")}`),null;if(!On.length)return window.$message.error(`${$t("settings.vendor.msg.groupPrefix",{n:bt+1})}${$t("settings.vendor.msg.addResolution")}`),null;en.push({duration:Ct,resolution:On})}return{name:Ke,modelName:ze,type:"video",mode:jt,audio:Ae.value.audio,durationResolutionMap:en}}function ie(){if(!v.value){window.$message.error($t("settings.vendor.msg.selectVendorFirst"));return}ke.value=null,Y("text"),de.value=!0}async function J(){const Ke=re();if(!Ke.length&&!v.value)return;const ze=ce();if(!ze)return;if(Ke.findIndex((en,bt)=>ke.value!==null&&bt===ke.value?!1:en.modelName===ze.modelName)!==-1){window.$message.error($t("settings.vendor.msg.modelIdExists"));return}if(ke.value===null){try{await Xt.post("/setting/vendorConfig/addVendorModel",{id:v.value.id,model:ze}),window.$message.success($t("settings.vendor.msg.modelAdded")),de.value=!1,A()}catch(en){window.$message.error(en.message??$t("settings.vendor.msg.operationFailed"))}return}if(ke.value!==null)try{await Xt.post("/setting/vendorConfig/upVendorModel",{id:v.value.id,modelName:ne.value,model:ze}),window.$message.success($t("settings.vendor.msg.modelUpdated")),de.value=!1,A()}catch(en){window.$message.error(en.message??$t("settings.vendor.msg.operationFailed"))}}function he(Ke){var jt;const ze=re();if(ke.value=ze.findIndex(en=>en.modelName===Ke.modelName),ne.value=Ke.modelName,Ke.type==="text"&&(Ae.value={name:Ke.name,modelName:Ke.modelName,type:"text",think:Ke.think,mode:[],mixedMode:[],mixedModeCount:{},audio:"optional",durationResolutionMap:[{duration:[],resolution:[]}]}),Ke.type==="image"&&(Ae.value={name:Ke.name,modelName:Ke.modelName,type:"image",think:!1,mode:[...Ke.mode],mixedMode:[],mixedModeCount:{},audio:"optional",durationResolutionMap:[{duration:[],resolution:[]}]}),Ke.type==="video"){const en=((jt=Ke.durationResolutionMap)==null?void 0:jt.length)>0?Ke.durationResolutionMap.map(On=>({duration:On.duration.map(String),resolution:[...On.resolution]})):[{duration:[],resolution:[]}],bt=[];let Dt=[];const Ct={};for(const On of Ke.mode)if(Array.isArray(On))for(const Fn of On){const di=String(Fn).match(/^(videoReference|imageReference|audioReference):(\d+)$/);di&&(Dt.push(di[1]),Ct[di[1]]=Number(di[2]))}else bt.push(On);Ae.value={name:Ke.name,modelName:Ke.modelName,type:"video",think:!1,mode:Dt.length>0?[...bt,"multiReference"]:bt,mixedMode:Dt,mixedModeCount:Ct,audio:Ke.audio,durationResolutionMap:en}}de.value=!0}function pe(Ke){B.value=Ke,Ke.type==="text"?P.value=!0:Ke.type==="image"?F.value=!0:Ke.type==="video"&&(R.value=!0)}function Le(Ke){if(!v.value)return;const ze=Kr.confirm({theme:"danger",header:$t("settings.vendor.msg.deleteModelConfirm"),body:`${$t("settings.vendor.msg.deleteModelBody",{name:Ke})}`,confirmBtn:{content:$t("settings.vendor.msg.confirmDelete"),theme:"danger"},cancelBtn:$t("settings.vendor.msg.cancel"),onConfirm:async()=>{try{await Xt.post("/setting/vendorConfig/delVendorModel",{id:v.value.id,modelName:Ke}),window.$message.success($t("settings.vendor.msg.modelDeleted")),A()}catch(jt){window.$message.error(jt.message??$t("settings.vendor.msg.operationFailed"))}finally{ze.destroy()}}})}function Be(){v.value&&(q.value=v.value.id,C.value=v.value.code,y.value=!0)}function ve(){if(!v.value)return;const Ke=Kr.confirm({theme:"danger",header:$t("settings.vendor.msg.deleteVendorConfirm"),body:`${$t("settings.vendor.msg.deleteVendorBody",{name:v.value.name})}`,confirmBtn:{content:$t("settings.vendor.msg.confirmDelete"),theme:"danger"},cancelBtn:$t("settings.vendor.msg.cancel"),onConfirm:()=>{var ze;Xt.post("/setting/vendorConfig/deleteVendor",{id:(ze=v.value)==null?void 0:ze.id}).then(()=>{var jt;window.$message.success($t("settings.vendor.msg.vendorDeleted")),m.value===((jt=v.value)==null?void 0:jt.id)&&(m.value=void 0),A(),Ke.destroy()}).catch(jt=>{window.$message.error(`${$t("settings.vendor.msg.deleteFailed")}${jt.message}`)})}})}function ue(){var Ke,ze;Xt.post("/setting/vendorConfig/updateVendorInputs",{id:(Ke=v.value)==null?void 0:Ke.id,inputValues:(ze=v.value)==null?void 0:ze.inputValues}).then(()=>{window.$message.success($t("settings.vendor.msg.vendorConfigUpdated")),A()}).catch(jt=>{window.$message.error(`${$t("settings.vendor.msg.updateFailed")}${jt.message}`)})}function be(Ke,ze){const jt=ze===1?0:1;Xt.post("/setting/vendorConfig/enableVendor",{id:Ke.id,enable:ze}).then(()=>{}).catch(en=>{Ke.enable=jt})}const xe=le("importAdd"),Qe=le(""),Fe=le(!1);ut(xe,Ke=>{Ke=="codeAdd"?y.value=!0:y.value=!1});function Ge(){if(Fe.value)return;const Ke=Kr.confirm({theme:"danger",header:$t("settings.vendor.msg.highRiskConfirm"),body:$t("settings.vendor.msg.linkAddVendorRiskBody"),confirmBtn:{content:$t("settings.vendor.msg.iKnowRisk"),theme:"danger"},cancelBtn:$t("settings.vendor.msg.cancel"),onConfirm:()=>{Ke.destroy();const ze=Kr.confirm({theme:"danger",header:$t("settings.vendor.msg.confirmAgain"),body:$t("settings.vendor.msg.addVendorConfirmBody"),confirmBtn:{content:$t("settings.vendor.msg.confirmAndAdd"),theme:"danger"},cancelBtn:$t("settings.vendor.msg.goBackCheck"),onConfirm:async()=>{const jt=Lc({fullscreen:!0,attach:"body",preventScrollThrough:!1}),en=setTimeout(()=>{jt.hide(),clearTimeout(en)},1e3);Fe.value=!0;try{const{data:bt}=await Xt.post("/setting/vendorConfig/getCodeByLink",{link:Qe.value});if(!bt.includes("vendor")){let Dt=null;bt.includes("")?Dt=Kr.alert({theme:"danger",header:"链接返回了一个网页,添加供应商需要返回TS代码,请确认链接是否正确",body:"请勿输入中转站地址,如需使用中转站请修改OpenAI标准接口的baseUrl使用中转站地址",onConfirm:({e:Ct})=>{Dt.hide()}}):Kr.alert({theme:"danger",header:"链接返回的内容不正确,添加供应商需要返回TS代码,请确认链接是否正确",onConfirm:({e:Ct})=>{Dt.hide()}});return}bt?(Xt.post("/setting/vendorConfig/addVendor",{tsCode:bt}),window.$message.success($t("settings.vendor.msg.vendorAdded")),w.value=!1,y.value=!1,A()):(window.$message.error($t("settings.vendor.msg.linkAddFailed")),y.value=!1)}catch(bt){window.$message.error(`${$t("settings.vendor.msg.addFailed")}${bt.message}`)}finally{clearTimeout(en),jt.hide(),Fe.value=!1,ze.destroy()}},onClose:()=>ze.hide()})},onClose:()=>Ke.hide()})}const Xe=le();async function $e(Ke){const ze=Ke.raw;if(!ze)return window.$message.error($t("workbench.novel.import.msg.selectFile")),!1;Lc(!0);try{const jt=Kr.confirm({theme:"danger",header:$t("settings.vendor.msg.highRiskConfirm"),body:$t("settings.vendor.msg.importAdd"),confirmBtn:{content:$t("settings.vendor.msg.iKnowRisk"),theme:"danger"},cancelBtn:$t("settings.vendor.msg.cancel"),onConfirm:()=>{jt.destroy();const en=Kr.confirm({theme:"danger",header:$t("settings.vendor.msg.confirmAgain"),body:$t("settings.vendor.msg.addVendorConfirmBody"),confirmBtn:{content:$t("settings.vendor.msg.confirmAndAdd"),theme:"danger"},cancelBtn:$t("settings.vendor.msg.goBackCheck"),onConfirm:async()=>{const bt=new FileReader;bt.readAsText(ze),bt.onload=()=>{const Dt=bt.result;Xt.post("/setting/vendorConfig/addVendor",{tsCode:Dt}).then(Ct=>{window.$message.success($t("settings.vendor.msg.vendorAdded")),w.value=!1,y.value=!1,A()}).catch(Ct=>{window.$message.error(Ct.message??`${$t("settings.vendor.msg.addFailed")}`)}).finally(()=>{en.destroy()})}},onClose:()=>en.hide()})},onClose:()=>jt.hide()})}catch{window.$message.error($t("workbench.novel.import.msg.parseFailed"))}finally{Lc(!1)}return!1}const vt=le([]);function mt(){var Ke;(Ke=Xe.value)==null||Ke.triggerUpload()}function rt(){return Promise.resolve({response:{},status:"success"})}async function yt(Ke){var jt;const ze=(jt=Ke.dataTransfer)==null?void 0:jt.files;ze&&ze.length>0&&await $e({raw:ze[0]})}function Rt(Ke){var bt;const ze=Ke.target,jt=(bt=ze.files)==null?void 0:bt[0];if(!jt)return;const en=new FileReader;en.onload=Dt=>{var Ct;C.value=((Ct=Dt.target)==null?void 0:Ct.result)||""},en.readAsText(jt),ze.value=""}return(Ke,ze)=>{var Bn,bi,Ue;const jt=NO,en=fi,bt=nJe,Dt=Q3n,Ct=n3n,On=t3n,Fn=nC,di=Yz,Pi=HA,Ci=Rc,Ir=mJe,Gr=gJe,Sr=dn("i-plus"),Po=dn("i-lightning"),Ti=dn("i-pencil"),ri=dn("i-delete"),or=Gd,Rs=yh,Es=yg,dt=UO,lt=Em,Ht=_Ke,Tt=cE,kn=pO,qt=eie,oo=tC,zn=GKe,st=Aa,Ne=OM,Lt=lie,En=dn("i-upload-one"),Cn=Mpe("loading");return we(),Re("div",$No,[ae("div",eUo,[ae("div",tUo,[c(en,{block:"",theme:"primary",onClick:$},{icon:me(()=>[c(jt,{name:"add"})]),default:me(()=>[ft(" "+Ee(Ke.$t("settings.vendor.addVendor")),1)]),_:1})]),gh((we(),Re("div",nUo,[ge(g).length>0?(we(),Ot(On,{key:0,modelValue:ge(m),"onUpdate:modelValue":ze[1]||(ze[1]=We=>yn(m)?m.value=We:null),theme:"light"},{default:me(()=>[(we(!0),Re(Yt,null,hi(ge(g),(We,Bt)=>(we(),Ot(Ct,{key:Bt,value:We.id,onClick:fn=>m.value=We.id,style:{position:"relative"}},Sj({default:me(()=>[ae("span",null,Ee(We.name),1),c(Dt,{modelValue:We.enable,"onUpdate:modelValue":fn=>We.enable=fn,customValue:[1,0],onClick:ze[0]||(ze[0]=Mi(()=>{},["stop"])),onChange:fn=>be(We,fn),style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)","z-index":"10"}},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:2},[W(We.icon)?{name:"icon",fn:me(()=>[c(bt,{size:"24px",shape:"round",image:We.icon},null,8,["image"])]),key:"0"}:void 0]),1032,["value","onClick"]))),128))]),_:1},8,["modelValue"])):(we(),Ot(Fn,{key:1,title:Ke.$t("settings.vendor.noVendor"),style:{"margin-top":"16px"}},null,8,["title"]))])),[[Cn,ge(k)]])]),ge(v)?(we(),Re("div",iUo,[ae("div",rUo,[c(Es,{data:ge(v),labelAlign:"top"},{default:me(()=>[ae("div",oUo,[ae("span",sUo,"#"+Ee(ge(v).id),1),ae("span",aUo,"@"+Ee(ge(v).author),1)]),H(ge(v))?(we(),Ot(di,{key:0,theme:"warning",message:Ke.$t("settings.vendor.msg.vendorNeedsUpdate"),style:{"margin-bottom":"12px"}},null,8,["message"])):Ft("",!0),c(Pi,null,{default:me(()=>[c(ge(lO),{modelValue:ge(v).description,"onUpdate:modelValue":ze[2]||(ze[2]=We=>ge(v).description=We),theme:ge(t).mode},null,8,["modelValue","theme"])]),_:1}),(we(!0),Re(Yt,null,hi(ge(b),We=>(we(),Ot(Pi,{key:We.key,name:We.key},Sj({label:me(()=>[ae("span",lUo,[ft(Ee(We.label)+" ",1),ze[25]||(ze[25]=ae("span",{class:"requiredMark"},"*",-1)),ae("span",cUo,Ee(Ke.$t("settings.vendor.required")),1)])]),default:me(()=>[c(Ci,{modelValue:ge(v).inputValues[We.key],"onUpdate:modelValue":Bt=>ge(v).inputValues[We.key]=Bt,type:We.type,clearable:"",onBlur:ue},{"prefix-icon":me(()=>[c(jt,{name:N(We.type)},null,8,["name"])]),_:2},1032,["modelValue","onUpdate:modelValue","type"])]),_:2},[I(We)?{name:"help",fn:me(()=>[ae("span",dUo,Ee(I(We)),1)]),key:"0"}:void 0]),1032,["name"]))),128)),ge(O).length>0?(we(),Re("div",uUo,[c(Gr,null,{default:me(()=>[c(Ir,{value:"optional-inputs",header:Ke.$t("settings.vendor.optionalSection")},{default:me(()=>[(we(!0),Re(Yt,null,hi(ge(O),We=>(we(),Ot(Pi,{key:We.key,name:We.key,label:We.label},Sj({default:me(()=>[c(Ci,{modelValue:ge(v).inputValues[We.key],"onUpdate:modelValue":Bt=>ge(v).inputValues[We.key]=Bt,type:We.type,clearable:"",onBlur:ue},{"prefix-icon":me(()=>[c(jt,{name:N(We.type)},null,8,["name"])]),_:2},1032,["modelValue","onUpdate:modelValue","type"])]),_:2},[I(We)?{name:"help",fn:me(()=>[ae("span",hUo,Ee(I(We)),1)]),key:"0"}:void 0]),1032,["name","label"]))),128))]),_:1},8,["header"])]),_:1})])):Ft("",!0),ae("div",AUo,[ae("h4",fUo,Ee(Ke.$t("settings.vendor.modelSettings")),1),c(en,{variant:"outline",size:"small",onClick:ie},{icon:me(()=>[c(Sr,{theme:"outline"})]),default:me(()=>[ft(" "+Ee(Ke.$t("settings.vendor.addManually")),1)]),_:1})]),(we(!0),Re(Yt,null,hi(ge(p),(We,Bt)=>(we(),Ot(Rs,{key:Bt,class:"modelCard"},{default:me(()=>[ae("div",gUo,[ae("div",mUo,[V(We.modelName)?(we(),Ot(bt,{key:0,size:"24px",shape:"round",image:V(We.modelName)},null,8,["image"])):Ft("",!0),ae("span",kUo,Ee(We.name),1)]),ae("div",vUo,[c(en,{size:"small",variant:"text",onClick:fn=>pe(We)},{icon:me(()=>[c(Po,{theme:"outline"})]),default:me(()=>[ft(" "+Ee(Ke.$t("settings.vendor.testModel")),1)]),_:1},8,["onClick"]),c(en,{variant:"text",size:"small",onClick:fn=>he(We)},{icon:me(()=>[c(Ti,{theme:"outline"})]),default:me(()=>[ft(" "+Ee(Ke.$t("settings.vendor.edit")),1)]),_:1},8,["onClick"]),c(en,{variant:"text",size:"small",theme:"danger",onClick:fn=>Le(We.modelName)},{icon:me(()=>[c(ri,{theme:"outline"})]),default:me(()=>[ft(" "+Ee(Ke.$t("settings.vendor.delete")),1)]),_:1},8,["onClick"])])]),ae("div",pUo,[c(or,{theme:"primary"},{default:me(()=>[ft(Ee(Ke.$t(o(We.type))),1)]),_:2},1024),We.type==="text"&&We.think?(we(),Ot(or,{key:0,variant:"light"},{default:me(()=>[ft(Ee(Ke.$t("settings.vendor.think")),1)]),_:1})):Ft("",!0),(we(!0),Re(Yt,null,hi(We.mode,(fn,Sn)=>(we(),Re(Yt,{key:Sn},[Array.isArray(fn)?(we(!0),Re(Yt,{key:1},hi(fn,(kr,_r)=>(we(),Ot(or,{variant:"light",key:_r},{default:me(()=>[ft(Ee(s(kr,We.type)),1)]),_:2},1024))),128)):(we(),Ot(or,{key:0,variant:"light"},{default:me(()=>[ft(Ee(s(fn,We.type)),1)]),_:2},1024))],64))),128))])]),_:2},1024))),128))]),_:1},8,["data"]),ae("div",bUo,[c(en,{theme:"danger",loading:ge(L),onClick:ve},{default:me(()=>[ft(Ee(Ke.$t("settings.vendor.deleteVendor")),1)]),_:1},8,["loading"]),c(en,{theme:"default",loading:ge(L),onClick:Be},{default:me(()=>[ft(Ee(Ke.$t("settings.vendor.editCode")),1)]),_:1},8,["loading"])])])])):Ft("",!0),c(st,{placement:"center",width:"40vw",visible:ge(de),"onUpdate:visible":ze[12]||(ze[12]=We=>yn(de)?de.value=We:null),header:ge(ke)===null?Ke.$t("settings.vendor.addModel"):Ke.$t("settings.vendor.editModel"),maskClosable:!1,onConfirm:J},{default:me(()=>[ae("div",OUo,[c(Es,{data:ge(Ae),labelAlign:"top"},{default:me(()=>[c(Pi,{name:"name",label:Ke.$t("settings.vendor.displayName")},{default:me(()=>[c(Ci,{modelValue:ge(Ae).name,"onUpdate:modelValue":ze[3]||(ze[3]=We=>ge(Ae).name=We),placeholder:Ke.$t("settings.vendor.displayNamePlaceholder"),clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c(Pi,{name:"modelName",label:Ke.$t("settings.vendor.modelId")},{default:me(()=>[c(Ci,{modelValue:ge(Ae).modelName,"onUpdate:modelValue":ze[4]||(ze[4]=We=>ge(Ae).modelName=We),placeholder:Ke.$t("settings.vendor.modelIdPlaceholder"),clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c(Pi,{name:"type",label:Ke.$t("settings.vendor.modelType")},{default:me(()=>[c(lt,{modelValue:ge(Ae).type,"onUpdate:modelValue":ze[5]||(ze[5]=We=>ge(Ae).type=We)},{default:me(()=>[(we(),Re(Yt,null,hi(l,We=>c(dt,{key:We.value,value:We.value},{default:me(()=>[ft(Ee(Ke.$t(We.label)),1)]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ge(Ae).type==="text"?(we(),Ot(Pi,{key:0,name:"think",label:Ke.$t("settings.vendor.think")},{default:me(()=>[c(Tt,{modelValue:ge(Ae).think,"onUpdate:modelValue":ze[6]||(ze[6]=We=>ge(Ae).think=We)},{default:me(()=>[c(Ht,{value:!0},{default:me(()=>[ft(Ee(Ke.$t("settings.vendor.supported")),1)]),_:1}),c(Ht,{value:!1},{default:me(()=>[ft(Ee(Ke.$t("settings.vendor.notSupported")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"])):Ft("",!0),ge(Ae).type==="image"?(we(),Ot(Pi,{key:1,name:"mode",label:Ke.$t("settings.vendor.imageMode")},{default:me(()=>[c(qt,{modelValue:ge(Ae).mode,"onUpdate:modelValue":ze[7]||(ze[7]=We=>ge(Ae).mode=We)},{default:me(()=>[(we(),Re(Yt,null,hi(d,We=>c(kn,{key:We.value,value:We.value},{default:me(()=>[ft(Ee(Ke.$t(We.label)),1)]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"])]),_:1},8,["label"])):Ft("",!0),ge(Ae).type==="video"?(we(),Re(Yt,{key:2},[c(Pi,{name:"mode",label:Ke.$t("settings.vendor.videoMode")},{default:me(()=>[ae("div",wUo,[c(qt,{modelValue:ge(Ae).mode,"onUpdate:modelValue":ze[8]||(ze[8]=We=>ge(Ae).mode=We)},{default:me(()=>[(we(),Re(Yt,null,hi(u,We=>c(kn,{key:We.value,value:We.value},{default:me(()=>[ft(Ee(Ke.$t(We.label)),1)]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"]),ge(Ae).mode.includes("multiReference")?(we(),Re("div",yUo,[c(qt,{modelValue:ge(Ae).mixedMode,"onUpdate:modelValue":ze[9]||(ze[9]=We=>ge(Ae).mixedMode=We),style:{display:"flex","flex-direction":"row",gap:"8px","flex-wrap":"wrap","align-items":"center"}},{default:me(()=>[(we(),Re(Yt,null,hi(h,We=>(we(),Re(Yt,{key:We.value},[c(kn,{value:We.value},{default:me(()=>[ft(Ee(Ke.$t(We.label)),1)]),_:2},1032,["value"]),ge(Ae).mixedMode.includes(We.value)?(we(),Ot(oo,{key:0,modelValue:ge(Ae).mixedModeCount[We.value],"onUpdate:modelValue":Bt=>ge(Ae).mixedModeCount[We.value]=Bt,min:1,max:99,size:"small",style:{width:"80px"},placeholder:Ke.$t("settings.vendor.count")},null,8,["modelValue","onUpdate:modelValue","placeholder"])):Ft("",!0)],64))),64))]),_:1},8,["modelValue"])])):Ft("",!0)])]),_:1},8,["label"]),c(Pi,{name:"audio",label:Ke.$t("settings.vendor.audioOutput")},{default:me(()=>[c(Tt,{modelValue:ge(Ae).audio,"onUpdate:modelValue":ze[10]||(ze[10]=We=>ge(Ae).audio=We)},{default:me(()=>[(we(),Re(Yt,null,hi(f,We=>c(Ht,{key:String(We.value),value:We.value},{default:me(()=>[ft(Ee(Ke.$t(We.label)),1)]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),c(Pi,{name:"durationResolutionMap",label:Ke.$t("settings.vendor.durationResolution")},{default:me(()=>[ae("div",CUo,[ae("div",xUo,[ze[26]||(ze[26]=ae("div",{class:"drmHeaderIndex"},null,-1)),ae("div",LUo,Ee(Ke.$t("settings.vendor.durationSec")),1),ze[27]||(ze[27]=ae("div",{class:"drmHeaderArrow"},null,-1)),ae("div",SUo,Ee(Ke.$t("settings.vendor.resolution")),1),ze[28]||(ze[28]=ae("div",{class:"drmHeaderAction"},null,-1))]),(we(!0),Re(Yt,null,hi(ge(Ae).durationResolutionMap,(We,Bt)=>(we(),Re("div",{key:Bt,class:"drmRow"},[ae("div",TUo,Ee(Bt+1),1),c(zn,{modelValue:We.duration,"onUpdate:modelValue":fn=>We.duration=fn,placeholder:Ke.$t("settings.vendor.enterAndPress"),class:"drmInput"},null,8,["modelValue","onUpdate:modelValue","placeholder"]),ze[29]||(ze[29]=ae("div",{class:"drmArrow"},"→",-1)),c(zn,{modelValue:We.resolution,"onUpdate:modelValue":fn=>We.resolution=fn,placeholder:Ke.$t("settings.vendor.enterAndPress"),class:"drmInput"},null,8,["modelValue","onUpdate:modelValue","placeholder"]),c(en,{variant:"text",theme:"danger",size:"small",disabled:ge(Ae).durationResolutionMap.length===1,onClick:fn=>ge(Ae).durationResolutionMap.splice(Bt,1)},{icon:me(()=>[c(ri,{theme:"outline"})]),_:1},8,["disabled","onClick"])]))),128)),c(en,{style:{"margin-top":"16px"},variant:"dashed",block:"",onClick:ze[11]||(ze[11]=We=>ge(Ae).durationResolutionMap.push({duration:[],resolution:[]}))},{icon:me(()=>[c(Sr,{theme:"outline"})]),default:me(()=>[ft(" "+Ee(Ke.$t("settings.vendor.addDurationResolution")),1)]),_:1})])]),_:1},8,["label"])],64)):Ft("",!0)]),_:1},8,["data"])])]),_:1},8,["visible","header"]),((Bn=ge(B))==null?void 0:Bn.type)==="text"&&ge(P)?(we(),Ot(aNo,{key:1,modelVisible:ge(P),"onUpdate:modelVisible":ze[13]||(ze[13]=We=>yn(P)?P.value=We:null),vendorId:ge(v).id,modelName:ge(B).modelName},null,8,["modelVisible","vendorId","modelName"])):Ft("",!0),((bi=ge(B))==null?void 0:bi.type)==="image"&&ge(F)?(we(),Ot(wNo,{key:2,modelVisible:ge(F),"onUpdate:modelVisible":ze[14]||(ze[14]=We=>yn(F)?F.value=We:null),vendorId:ge(v).id,modelName:ge(B).modelName,supportedModes:ge(B).mode||[]},null,8,["modelVisible","vendorId","modelName","supportedModes"])):Ft("",!0),((Ue=ge(B))==null?void 0:Ue.type)==="video"&&ge(R)?(we(),Ot(_No,{key:3,modelVisible:ge(R),"onUpdate:modelVisible":ze[15]||(ze[15]=We=>yn(R)?R.value=We:null),vendorId:ge(v).id,modelName:ge(B).modelName,rawModes:ge(B).mode||[]},null,8,["modelVisible","vendorId","modelName","rawModes"])):Ft("",!0),c(st,{width:"30vw",placement:"center",top:"10vh",footer:!1,visible:ge(w),"onUpdate:visible":ze[20]||(ze[20]=We=>yn(w)?w.value=We:null),header:Ke.$t("settings.vendor.addVendorDialog"),maskClosable:!1},{default:me(()=>[ae("div",EUo,[c(Tt,{variant:"default-filled",modelValue:ge(xe),"onUpdate:modelValue":ze[16]||(ze[16]=We=>yn(xe)?xe.value=We:null)},{default:me(()=>[c(Ne,{value:"importAdd"},{default:me(()=>[...ze[30]||(ze[30]=[ft("通过文件导入",-1)])]),_:1}),c(Ne,{value:"linkAdd"},{default:me(()=>[...ze[31]||(ze[31]=[ft("通过链接添加",-1)])]),_:1}),c(Ne,{value:"codeAdd"},{default:me(()=>[...ze[32]||(ze[32]=[ft("通过代码添加",-1)])]),_:1})]),_:1},8,["modelValue"]),ge(xe)=="linkAdd"?(we(),Re("div",DUo,[c(di,{theme:"warning",style:{"margin-bottom":"20px"}},{default:me(()=>[...ze[33]||(ze[33]=[ft(" 请填写 TypeScript 代码文件的链接(.ts 文件),不要填 API 地址或其他无关链接。 确认后 Toonflow 会自动加载该代码,请确保链接来源可信。 ",-1)])]),_:1}),c(Ci,{modelValue:ge(Qe),"onUpdate:modelValue":ze[17]||(ze[17]=We=>yn(Qe)?Qe.value=We:null),placeholder:Ke.$t("settings.vendor.linkAddPlaceholder")},null,8,["modelValue","placeholder"]),ae("div",QUo,[c(en,{loading:ge(Fe),disabled:!ge(Qe).trim(),onClick:Ge},{default:me(()=>[ft(Ee(Ke.$t("settings.vendor.linkAdd")),1)]),_:1},8,["loading","disabled"])])])):Ft("",!0),ge(xe)=="importAdd"?(we(),Re("div",BUo,[ae("div",{class:"uploadArea",onClick:mt,onDragover:ze[19]||(ze[19]=Mi(()=>{},["prevent"])),onDrop:Mi(yt,["prevent"])},[c(Lt,{ref_key:"uploadRef",ref:Xe,modelValue:ge(vt),"onUpdate:modelValue":ze[18]||(ze[18]=We=>yn(vt)?vt.value=We:null),theme:"file",multiple:!1,max:1,accept:".ts","before-upload":$e,"request-method":rt,style:{display:"none"}},null,8,["modelValue"]),ae("div",FUo,[c(En,{theme:"outline",size:"32",fill:"var(--td-brand-color)"})]),ae("p",PUo,Ee(Ke.$t("workbench.novel.import.importAdd")),1),ae("p",MUo,Ee(Ke.$t("workbench.novel.import.limit")),1)],32)])):Ft("",!0),ge(xe)=="codeAdd"?(we(),Re("div",RUo)):Ft("",!0)])]),_:1},8,["visible","header"]),c(st,{width:"70vw",placement:"center",top:"10vh",visible:ge(y),"onUpdate:visible":ze[24]||(ze[24]=We=>yn(y)?y.value=We:null),header:Ke.$t("settings.vendor.code"),maskClosable:!1,onConfirm:oe},{default:me(()=>[ae("div",IUo,[ae("div",NUo,[c(jt,{name:"info-circle",size:"16px"}),ae("span",null,Ee(Ke.$t("settings.vendor.codeEditorInfo")),1)]),ae("div",UUo,[c(en,{variant:"text",size:"small",onClick:ze[21]||(ze[21]=We=>C.value=ge(VSe))},{icon:me(()=>[c(jt,{name:"rollback"})]),default:me(()=>[ft(" "+Ee(Ke.$t("settings.vendor.reset")),1)]),_:1}),c(en,{variant:"outline",size:"small",onClick:ze[22]||(ze[22]=We=>{var Bt;return(Bt=ge(x))==null?void 0:Bt.click()})},{icon:me(()=>[c(jt,{name:"upload"})]),default:me(()=>[ft(" "+Ee(Ke.$t("settings.vendor.importFile")),1)]),_:1}),ae("input",{ref_key:"fileInputRef",ref:x,type:"file",accept:".ts,.js,.txt,.json",style:{display:"none"},onChange:Rt},null,544)])]),ae("div",jUo,[c(ge(bNn),{value:ge(C),"onUpdate:value":ze[23]||(ze[23]=We=>yn(C)?C.value=We:null),language:"typescript",theme:"vs-dark",height:600,options:a},null,8,["value"])])]),_:1},8,["visible","header"])])}}}),VUo=fr(HUo,[["__scopeId","data-v-e76087d0"]]),zUo={class:"memoryConfig"},ZUo={class:"actionRow f frr"},YUo=qe({__name:"memoryConfig",setup(e){const t=le({messagesPerSummary:3,shortTermLimit:5,summaryMaxLength:500,summaryLimit:10,ragLimit:3,deepRetrieveSummaryLimit:5,modelOnnxFile:["all-MiniLM-L6-v2","onnx","model_fp16.onnx"],modelDtype:"fp16"}),n=["fp16","auto","fp32","q8","int8","uint8","q4","bnb4","q4f16"],r=le(!1),o=le(!1),s=le(!1);async function a(){r.value=!0;try{const{data:h}=await Xt.get("/setting/memoryConfig/getMemory");t.value={messagesPerSummary:h.messagesPerSummary??3,shortTermLimit:h.shortTermLimit??5,summaryMaxLength:h.summaryMaxLength??500,summaryLimit:h.summaryLimit??10,ragLimit:h.ragLimit??3,deepRetrieveSummaryLimit:h.deepRetrieveSummaryLimit??5,modelOnnxFile:h.modelOnnxFile??["all-MiniLM-L6-v2","onnx","model_fp16.onnx"],modelDtype:h.modelDtype??"fp16"}}catch(h){window.$message.warning(h==null?void 0:h.message)}finally{r.value=!1}}async function l(){o.value=!0;try{await Xt.post("/setting/memoryConfig/sureMemory",{...t.value}),window.$message.success($t("settings.memory.msg.saved"))}catch(h){window.$message.warning(h==null?void 0:h.message)}finally{o.value=!1}}async function d(){const h=Kr.confirm({header:$t("settings.memory.msg.clearConfirmTitle"),body:$t("settings.memory.msg.clearConfirmBody"),confirmBtn:$t("settings.memory.msg.confirmClear"),cancelBtn:$t("settings.memory.msg.cancel"),onConfirm:async()=>{s.value=!0;try{await Xt.post("/setting/memoryConfig/delAllMemory"),window.$message.success($t("settings.memory.msg.cleared")),h.hide()}catch(f){window.$message.error((f==null?void 0:f.msg)||$t("settings.memory.msg.clearFailed"))}finally{s.value=!1}}})}function u(){t.value={messagesPerSummary:3,shortTermLimit:5,summaryMaxLength:500,summaryLimit:10,ragLimit:3,deepRetrieveSummaryLimit:5,modelOnnxFile:["all-MiniLM-L6-v2","onnx","model_fp16.onnx"],modelDtype:"fp16"},l()}return vn(()=>{a()}),(h,f)=>{const g=Yz,k=GKe,A=HA,m=UO,v=Em,p=yh,b=tC,O=fi,w=yg;return we(),Re("div",zUo,[c(g,{theme:"warning",class:"topAlert",message:h.$t("settings.memory.warning")},null,8,["message"]),c(w,{data:t.value,labelAlign:"top",labelWidth:"180px",class:"memoryForm",onSubmit:l},{default:me(()=>[c(p,{title:h.$t("settings.memory.vectorModelConfig"),bordered:!0,style:{"margin-top":"16px"}},{default:me(()=>[c(A,{label:h.$t("settings.memory.modelFilePath"),name:"modelOnnxFile"},{help:me(()=>[ft("向量模型文件路径:/data/models/"+Ee(t.value.modelOnnxFile?t.value.modelOnnxFile.join("/"):""),1)]),default:me(()=>[c(k,{modelValue:t.value.modelOnnxFile,"onUpdate:modelValue":f[0]||(f[0]=y=>t.value.modelOnnxFile=y),clearable:""},null,8,["modelValue"])]),_:1},8,["label"]),c(A,{label:h.$t("settings.memory.quantizationType"),name:"modelDtype"},{help:me(()=>[...f[8]||(f[8]=[])]),default:me(()=>[c(v,{modelValue:t.value.modelDtype,"onUpdate:modelValue":f[1]||(f[1]=y=>t.value.modelDtype=y),placeholder:h.$t("settings.memory.quantizationPlaceholder")},{default:me(()=>[(we(),Re(Yt,null,hi(n,y=>c(m,{key:y,value:y,label:y},null,8,["value","label"])),64))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["title"]),c(p,{title:h.$t("settings.memory.memoryParams"),bordered:!0,style:{"margin-top":"16px"}},{default:me(()=>[c(A,{label:h.$t("settings.memory.messagesPerSummary"),name:"messagesPerSummary"},{help:me(()=>[ft(Ee(h.$t("settings.memory.messagesPerSummaryHelp")),1)]),default:me(()=>[c(b,{modelValue:t.value.messagesPerSummary,"onUpdate:modelValue":f[2]||(f[2]=y=>t.value.messagesPerSummary=y),min:1,max:200,allowInputOverLimit:!1},null,8,["modelValue"])]),_:1},8,["label"]),c(A,{label:h.$t("settings.memory.shortTermLimit"),name:"shortTermLimit"},{help:me(()=>[ft(Ee(h.$t("settings.memory.shortTermLimitHelp")),1)]),default:me(()=>[c(b,{modelValue:t.value.shortTermLimit,"onUpdate:modelValue":f[3]||(f[3]=y=>t.value.shortTermLimit=y),min:1,max:100,allowInputOverLimit:!1},null,8,["modelValue"])]),_:1},8,["label"]),c(A,{label:h.$t("settings.memory.summaryMaxLength"),name:"summaryMaxLength"},{help:me(()=>[ft(Ee(h.$t("settings.memory.summaryMaxLengthHelp")),1)]),default:me(()=>[c(b,{modelValue:t.value.summaryMaxLength,"onUpdate:modelValue":f[4]||(f[4]=y=>t.value.summaryMaxLength=y),min:0,max:1e3,step:1,allowInputOverLimit:!1},null,8,["modelValue"])]),_:1},8,["label"]),c(A,{label:h.$t("settings.memory.summaryLimit"),name:"summaryLimit"},{help:me(()=>[ft(Ee(h.$t("settings.memory.summaryLimitHelp")),1)]),default:me(()=>[c(b,{modelValue:t.value.summaryLimit,"onUpdate:modelValue":f[5]||(f[5]=y=>t.value.summaryLimit=y),min:0,max:100,step:1,allowInputOverLimit:!1},null,8,["modelValue"])]),_:1},8,["label"]),c(A,{label:h.$t("settings.memory.ragLimit"),name:"ragLimit"},{help:me(()=>[ft(Ee(h.$t("settings.memory.ragLimitHelp")),1)]),default:me(()=>[c(b,{modelValue:t.value.ragLimit,"onUpdate:modelValue":f[6]||(f[6]=y=>t.value.ragLimit=y),min:0,max:50,step:1,allowInputOverLimit:!1},null,8,["modelValue"])]),_:1},8,["label"]),c(A,{label:h.$t("settings.memory.deepRetrieveSummaryLimit"),name:"deepRetrieveSummaryLimit"},{help:me(()=>[ft(Ee(h.$t("settings.memory.deepRetrieveSummaryLimitHelp")),1)]),default:me(()=>[c(b,{modelValue:t.value.deepRetrieveSummaryLimit,"onUpdate:modelValue":f[7]||(f[7]=y=>t.value.deepRetrieveSummaryLimit=y),min:0,max:100,step:1,allowInputOverLimit:!1},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["title"]),ae("div",ZUo,[c(O,{theme:"primary",type:"submit",loading:o.value},{default:me(()=>[ft(Ee(h.$t("settings.memory.saveConfig")),1)]),_:1},8,["loading"]),c(O,{theme:"danger",variant:"outline",loading:s.value,onClick:d},{default:me(()=>[ft(Ee(h.$t("settings.memory.clearMemory")),1)]),_:1},8,["loading"]),c(O,{theme:"warning",variant:"outline",loading:o.value,onClick:u},{default:me(()=>[ft(Ee(h.$t("settings.memory.restoreDefault")),1)]),_:1},8,["loading"])])]),_:1},8,["data"])])}}}),XUo=fr(YUo,[["__scopeId","data-v-c59a3784"]]),qUo={class:"fileManagement"},GUo={class:"folderList"},KUo={class:"folderInfo"},JUo={class:"folderName"},_Uo={class:"folderDesc"},$Uo=qe({__name:"fileManagement",setup(e){const{isElectron:t}=Br(qs()),n=[{label:"settings.file.folders.data",path:"",desc:"settings.file.folders.dataDesc"},{label:"settings.file.folders.logs",path:"logs",desc:"settings.file.folders.logsDesc"},{label:"settings.file.folders.oss",path:"oss",desc:"settings.file.folders.ossDesc"},{label:"settings.file.folders.skills",path:"skills",desc:"settings.file.folders.skillsDesc"},{label:"settings.file.folders.models",path:"models",desc:"settings.file.folders.modelsDesc"},{label:"settings.file.folders.web",path:"web",desc:"settings.file.folders.webDesc"},{label:"settings.file.folders.serve",path:"serve",desc:"settings.file.folders.serveDesc"},{label:"settings.file.folders.vendor",path:"vendor",desc:"settings.file.folders.vendorDesc"}],r=o=>{Xt.post("/setting/fileManagement/openFolder",{path:o}).catch(s=>{var a;(a=window.$message)==null||a.error(s.message||$t("settings.file.openFailed"))})};return(o,s)=>{const a=fi,l=yh,d=dn("i-reduce-one"),u=nC;return we(),Re("div",qUo,[ge(t)?(we(),Ot(l,{key:0,title:o.$t("settings.file.quickOpen"),bordered:""},{default:me(()=>[ae("div",GUo,[(we(),Re(Yt,null,hi(n,h=>ae("div",{key:h.path,class:"folderItem"},[ae("div",KUo,[ae("div",JUo,Ee(o.$t(h.label)),1),ae("div",_Uo,Ee(o.$t(h.desc)),1)]),c(a,{theme:"primary",variant:"outline",onClick:f=>r(h.path)},{default:me(()=>[ft(Ee(o.$t("settings.file.open")),1)]),_:1},8,["onClick"])])),64))])]),_:1},8,["title"])):(we(),Ot(u,{key:1,description:o.$t("settings.file.dockerDesc"),title:o.$t("settings.file.desktopOnly")},{image:me(()=>[c(d,{theme:"outline",fill:"red"})]),_:1},8,["description","title"]))])}}}),ejo=fr($Uo,[["__scopeId","data-v-adb4ff32"]]),tjo={class:"skillManagement"},njo={class:"sidebarPanel"},ijo={class:"treeWrap"},rjo={class:"viewPanel"},ojo={key:0,class:"viewHeader"},sjo={class:"fileName"},ajo={key:1,class:"previewWrap"},ljo=qe({__name:"skillManagement",setup(e){const{themeSetting:t}=Br(qs()),n=["bold","underline","italic","strikeThrough","-","title","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","table","-","revoke","next","=","preview"],r=le([]),o=le(""),s=le(""),a=le(""),l=le(""),d=le(!1),u=le(!1),h=G(()=>o.value?[o.value]:[]),f=G(()=>{let b=r.value.filter(w=>w.endsWith(".md"));if(!s.value)return b;const O=s.value.toLowerCase();return b.filter(w=>w.toLowerCase().includes(O))}),g=G(()=>{const b=new Map,O=[];for(const y of f.value){const C=y.split("/").filter(Boolean);let x=O,L="";for(let S=0;SQ.value===L)||x.push({label:C[S],value:L,isFile:!0,isRoot:C.length===1});else{let Q=b.get(L);Q||(Q={label:C[S],value:L,isFile:!1,children:[]},b.set(L,Q),x.push(Q)),x=Q.children}}const w=y=>{y.sort((C,x)=>C.isFile!==x.isFile?C.isFile?1:-1:C.label.localeCompare(x.label)),y.forEach(C=>C.children&&w(C.children))};return w(O),O});async function k(){try{const{data:b}=await Xt.post("/setting/skillManagement/getSkillList");r.value=Array.isArray(b)?b:[]}catch(b){console.error(b)}}async function A(b){try{const{data:O}=await Xt.post("/setting/skillManagement/getSkillContent",{path:b});a.value=typeof O=="string"?O:(O==null?void 0:O.content)||""}catch(O){console.error(O),a.value=""}}async function m(b,O){const w=b[b.length-1],y=typeof w=="string"?w:String(w||""),C=O.node.data;!y||!(C!=null&&C.isFile)||y===o.value||(o.value=y,await A(y))}function v(){l.value=a.value,d.value=!0}async function p(){if(o.value){u.value=!0;try{await Xt.post("/setting/skillManagement/saveSkillContent",{path:o.value,content:l.value}),a.value=l.value,d.value=!1}catch(b){console.error(b)}finally{u.value=!1}}}return vn(()=>k()),(b,O)=>{const w=Rc,y=dn("i-folder-open"),C=dn("i-file-text"),x=k4i,L=nC,S=fi,E=Aa;return we(),Re("div",tjo,[ae("aside",njo,[c(w,{modelValue:s.value,"onUpdate:modelValue":O[0]||(O[0]=Q=>s.value=Q),clearable:"",placeholder:b.$t("setting.skillManagement.search")},null,8,["modelValue","placeholder"]),ae("div",ijo,[g.value.length?(we(),Ot(x,{key:0,activable:"",hover:"",line:"","expand-on-click-node":"",data:g.value,actived:h.value,onActive:m},{icon:me(({node:Q})=>[Q.data.isFile?Q.data.isRoot?(we(),Ot(C,{key:1,theme:"outline",size:"16",fill:"red"})):(we(),Ot(C,{key:2,theme:"outline",size:"16"})):(we(),Ot(y,{key:0,theme:"outline",size:"16"}))]),_:1},8,["data","actived"])):(we(),Ot(L,{key:1,description:b.$t("setting.skillManagement.empty")},null,8,["description"]))])]),ae("section",rjo,[o.value?(we(),Re("div",ojo,[ae("span",sjo,Ee(o.value),1),c(S,{size:"small",theme:"primary",variant:"outline",onClick:v},{default:me(()=>[ft(Ee(b.$t("setting.skillManagement.edit")),1)]),_:1})])):Ft("",!0),o.value?(we(),Re("div",ajo,[c(ge(lO),{theme:ge(t).mode,modelValue:a.value,toolbars:[],"preview-only":"","preview-theme":"github","code-theme":"atom"},null,8,["theme","modelValue"])])):(we(),Ot(L,{key:2,description:b.$t("setting.skillManagement.selectOnTheLeft")},null,8,["description"]))]),c(E,{placement:"center",visible:d.value,"onUpdate:visible":O[2]||(O[2]=Q=>d.value=Q),header:b.$t("setting.skillManagement.edit")+` ${o.value}`,width:"80vw","confirm-btn":b.$t("common.save"),"confirm-on-enter":!1,"on-confirm":p,loading:u.value},{default:me(()=>[c(ge(Jv),{theme:ge(t).mode,modelValue:l.value,"onUpdate:modelValue":O[1]||(O[1]=Q=>l.value=Q),toolbars:n,"preview-theme":"github","code-theme":"atom",style:{height:"72vh"}},null,8,["theme","modelValue"])]),_:1},8,["visible","header","confirm-btn","loading"])])}}}),cjo=fr(ljo,[["__scopeId","data-v-3c75510b"]]),djo={class:"otherConfig"},ujo={class:"localStorageHeader"},hjo={class:"localStorageCount"},Ajo={class:"localStorageToolbar"},fjo={class:"localStorageActions"},gjo={class:"tableActionButtons"},mjo={class:"localStorageDialogBody"},kjo={class:"localStorageDialogTopBar"},vjo=qe({__name:"devConfig",setup(e){const{isElectron:t}=Br(qs()),n=le("0"),r=le(""),o=le(""),s=le(!1),a=le([]),l=le({key:"",value:""}),d={fontSize:13,automaticLayout:!0,minimap:{enabled:!1},tabSize:2,scrollBeyondLastLine:!1,wordWrap:"on"},u=[{colKey:"key",title:$t("settings.dev.localStorageKey"),width:320,ellipsis:!0},{colKey:"value",title:$t("settings.dev.localStorageValue"),ellipsis:!0},{colKey:"actions",title:$t("settings.dev.actions"),width:280,cell:"actions"}],h=G(()=>{if(!r.value.trim())return a.value;const T=r.value.trim().toLowerCase();return a.value.filter(M=>M.key.toLowerCase().includes(T)||M.value.toLowerCase().includes(T))});function f(){var T,M;if(t.value)try{fetch("toonflow://openDevTool")}catch{(T=window.$message)==null||T.warning($t("settings.dev.openDevtoolFailed"))}else(M=window.$message)==null||M.warning($t("settings.dev.notInElectron"))}async function g(){const{data:T}=await Xt.get("/setting/dev/getSwitchAiDevTool");n.value=T||"0"}function k(){Xt.post("/setting/dev/updateSwitchAiDevTool",{switchAiDevTool:n.value})}function A(){const T=[];for(let M=0;MM.key.localeCompare(B.key))}function m(){p(),s.value=!0}function v(T){l.value={...T},o.value=T.key,s.value=!0}function p(){l.value={key:"",value:""},o.value=""}function b(){const T=l.value.key.trim();if(!T){window.$message.warning($t("settings.dev.msg.localStorageKeyRequired"));return}const M=!!o.value&&o.value!==T;if(M&&localStorage.getItem(T)!==null){window.$message.warning($t("settings.dev.msg.localStorageKeyExists"));return}M&&localStorage.removeItem(o.value),localStorage.setItem(T,l.value.value??""),A(),o.value=T,s.value=!1,window.$message.success($t("settings.dev.msg.localStorageSaved"))}function O(){const T=l.value.value??"";if(!T.trim()){window.$message.warning($t("settings.dev.msg.localStorageValueEmpty"));return}try{const M=JSON.parse(T);l.value.value=JSON.stringify(M,null,2),window.$message.success($t("settings.dev.msg.localStorageFormatted"))}catch{window.$message.warning($t("settings.dev.msg.localStorageFormatFailed"))}}function w(){b()}function y(){s.value=!1,p()}async function C(T){var B;if((B=navigator.clipboard)!=null&&B.writeText){await navigator.clipboard.writeText(T);return}const M=document.createElement("textarea");M.value=T,M.style.position="fixed",M.style.opacity="0",document.body.appendChild(M),M.select(),document.execCommand("copy"),document.body.removeChild(M)}async function x(T){try{await C(T),window.$message.success($t("settings.dev.msg.localStorageKeyCopied"))}catch{window.$message.warning($t("settings.dev.msg.copyFailed"))}}async function L(T){try{await C(T),window.$message.success($t("settings.dev.msg.localStorageValueCopied"))}catch{window.$message.warning($t("settings.dev.msg.copyFailed"))}}function S(T){localStorage.removeItem(T),o.value===T&&p(),A(),window.$message.success($t("settings.dev.msg.localStorageDeleted"))}function E(T){const M=Kr.confirm({header:$t("settings.dev.msg.deleteConfirmTitle"),body:$t("settings.dev.msg.deleteConfirmBody",{key:T}),confirmBtn:$t("settings.dev.msg.confirmDelete"),cancelBtn:$t("settings.dev.msg.cancel"),onConfirm:()=>{S(T),M.hide()}})}function Q(){const T=Kr.confirm({header:$t("settings.dev.msg.clearConfirmTitle"),body:$t("settings.dev.msg.clearConfirmBody"),confirmBtn:$t("settings.dev.msg.confirmClear"),cancelBtn:$t("settings.dev.msg.cancel"),onConfirm:()=>{localStorage.clear(),p(),A(),window.$message.success($t("settings.dev.msg.localStorageCleared")),T.hide()}})}return vn(()=>{g(),A()}),(T,M)=>{const B=Yz,P=fi,F=HA,R=Q3n,N=Rc,I=y6,W=yh,H=Aa,V=yg;return we(),Re("div",djo,[c(V,{"label-align":"top"},{default:me(()=>[c(B,{theme:"warning"},{default:me(()=>[ft(Ee(T.$t("settings.dev.warning")),1)]),_:1}),c(F,{label:T.$t("settings.dev.devtool"),name:"showTitleBar"},{default:me(()=>[c(P,{theme:"primary",onClick:f},{default:me(()=>[ft(Ee(T.$t("settings.dev.openDevtool")),1)]),_:1})]),_:1},8,["label"]),c(F,{label:T.$t("settings.dev.aiDevtool"),name:"showTitleBar"},{default:me(()=>[c(R,{modelValue:ge(t),"onUpdate:modelValue":M[0]||(M[0]=Z=>yn(t)?t.value=Z:null),onChange:g},null,8,["modelValue"])]),_:1},8,["label"]),c(F,{label:T.$t("settings.dev.switchAiDevTool"),name:"showTitleBar"},{tips:me(()=>[ae("p",null,Ee(T.$t("settings.dev.devtoolsDoc"))+":https://ai-sdk.dev/docs/ai-sdk-core/devtools",1),ae("p",null,Ee(T.$t("settings.dev.devtoolsDesc")),1),ae("p",null,Ee(T.$t("settings.dev.devtoolsDesc2")),1)]),default:me(()=>[c(R,{customValue:["1","0"],modelValue:ge(n),"onUpdate:modelValue":M[1]||(M[1]=Z=>yn(n)?n.value=Z:null),onChange:k},null,8,["modelValue"])]),_:1},8,["label"]),c(F,{label:T.$t("settings.dev.localStorage"),name:"localStorageManager",class:"localStorageFormItem"},{default:me(()=>[c(W,{class:"localStorageCard"},{default:me(()=>[ae("div",ujo,[ae("div",hjo,Ee(T.$t("settings.dev.localStorageCount",{total:ge(a).length,filtered:ge(h).length})),1),ae("div",Ajo,[c(N,{modelValue:ge(r),"onUpdate:modelValue":M[2]||(M[2]=Z=>yn(r)?r.value=Z:null),placeholder:T.$t("settings.dev.localStorageSearchPlaceholder"),clearable:"",class:"localStorageSearch"},null,8,["modelValue","placeholder"]),ae("div",fjo,[c(P,{theme:"primary",variant:"outline",onClick:m},{default:me(()=>[ft(Ee(T.$t("settings.dev.add")),1)]),_:1}),c(P,{variant:"outline",onClick:A},{default:me(()=>[ft(Ee(T.$t("settings.dev.refresh")),1)]),_:1}),c(P,{theme:"danger",variant:"outline",onClick:Q},{default:me(()=>[ft(Ee(T.$t("settings.dev.clearAll")),1)]),_:1})])])]),c(I,{data:ge(h),columns:u,"row-key":"key",size:"small"},{actions:me(({row:Z})=>[ae("div",gjo,[c(P,{variant:"text",size:"small",onClick:K=>x(Z.key)},{default:me(()=>[ft(Ee(T.$t("settings.dev.copyKey")),1)]),_:1},8,["onClick"]),c(P,{variant:"text",size:"small",onClick:K=>L(Z.value)},{default:me(()=>[ft(Ee(T.$t("settings.dev.copyValue")),1)]),_:1},8,["onClick"]),c(P,{variant:"text",size:"small",onClick:K=>v(Z)},{default:me(()=>[ft(Ee(T.$t("settings.dev.edit")),1)]),_:1},8,["onClick"]),c(P,{theme:"danger",variant:"text",size:"small",onClick:K=>E(Z.key)},{default:me(()=>[ft(Ee(T.$t("settings.dev.delete")),1)]),_:1},8,["onClick"])])]),_:1},8,["data"])]),_:1})]),_:1},8,["label"]),c(H,{visible:ge(s),"onUpdate:visible":M[5]||(M[5]=Z=>yn(s)?s.value=Z:null),header:ge(o)?T.$t("settings.dev.editing",{key:ge(o)}):T.$t("settings.dev.creating"),"confirm-btn":{content:ge(o)?T.$t("settings.dev.update"):T.$t("settings.dev.add")},"cancel-btn":T.$t("settings.dev.msg.cancel"),width:"50vw",placement:"center",onConfirm:w,onClose:y},{default:me(()=>[ae("div",mjo,[ae("div",kjo,[c(N,{modelValue:ge(l).key,"onUpdate:modelValue":M[3]||(M[3]=Z=>ge(l).key=Z),placeholder:T.$t("settings.dev.localStorageKeyPlaceholder")},null,8,["modelValue","placeholder"]),c(P,{variant:"outline",onClick:O},{default:me(()=>[ft(Ee(T.$t("settings.dev.format")),1)]),_:1})]),c(ge(bNn),{value:ge(l).value,"onUpdate:value":M[4]||(M[4]=Z=>ge(l).value=Z),language:"json",theme:"vs-dark",height:500,options:d},null,8,["value"])])]),_:1},8,["visible","header","confirm-btn","cancel-btn"])]),_:1})])}}}),pjo=fr(vjo,[["__scopeId","data-v-136d7d15"]]),bjo={class:"promptManage"},Ojo=["onClick"],wjo={class:"data"},yjo={class:"jb"},Cjo={class:"name"},xjo={class:"type"},Ljo={class:"data"},Sjo={class:"show"},Tjo=qe({__name:"promptManage",setup(e){const{themeSetting:t}=Br(qs());vn(()=>{s()});const n=["bold","italic","strikeThrough","-","unorderedList","orderedList","-","revoke","next","=","preview"],r=le(!1),o=le([]);function s(){Xt.post("/setting/promptManage/getPrompt").then(u=>{o.value=u.data.map(h=>({id:h.id,name:h.name,type:h.type,data:h.data}))})}function a(u){l.value={...u},r.value=!0}const l=le({id:0,name:"",type:"",data:""});async function d(){await Xt.post("/setting/promptManage/updatePrompt",{id:l.value.id,data:l.value.data}),window.$message.success($t("workbench.project.dialog.prompt.saveSuccess")),s(),r.value=!1}return(u,h)=>{const f=yh,g=Aa;return we(),Re("div",bjo,[(we(!0),Re(Yt,null,hi(o.value,k=>(we(),Re("div",{key:k.id,style:{cursor:"pointer"},onClick:A=>a(k)},[c(f,{bordered:""},{default:me(()=>[ae("div",wjo,[ae("div",yjo,[ae("div",Cjo,Ee(k.name),1),ae("div",xjo,Ee(k.type),1)]),ae("div",Ljo,Ee(k.data),1)])]),_:2},1024)],8,Ojo))),128)),ae("div",Sjo,[c(g,{visible:r.value,"onUpdate:visible":h[1]||(h[1]=k=>r.value=k),header:u.$t("workbench.project.dialog.prompt.title"),width:"70%","close-on-overlay-click":!1,onConfirm:d,top:"9vh"},{default:me(()=>[c(ge(Jv),{theme:ge(t).mode==="auto"?"light":ge(t).mode,modelValue:l.value.data,"onUpdate:modelValue":h[0]||(h[0]=k=>l.value.data=k),toolbars:n,footers:[],style:{height:"60vh"},placeholder:u.$t("workbench.project.dialog.prompt.placeholder"),onOnUploadImg:()=>{}},null,8,["theme","modelValue","placeholder"])]),_:1},8,["visible","header"])])])}}}),Ejo=fr(Tjo,[["__scopeId","data-v-7b87416c"]]),Djo={class:"modelMap"},Qjo={class:"type"},Bjo={class:"prompt-select"},Fjo={class:"prompt-select-header"},Pjo={class:"prompt-current"},Mjo={class:"label"},Rjo={style:{display:"flex","align-items":"center",gap:"6px"}},Ijo={class:"add-prompt-form"},Njo=qe({__name:"modelMap",setup(e){const{themeSetting:t}=Br(qs()),n=["bold","italic","strikeThrough","-","unorderedList","orderedList","-","revoke","next","=","preview"],r=le([]),o=le([]);vn(()=>{a()});function s(){Xt.get("/setting/modelMap/getPromptList").then(C=>{o.value=C.data})}function a(){Xt.post("/setting/modelMap/getImageAndVideoModel").then(C=>{r.value=C.data})}const l=[{colKey:"name",title:$t("settings.memory.modelMap.name"),width:150,align:"left"},{colKey:"model",title:$t("settings.memory.modelMap.model"),width:150,align:"left"},{colKey:"type",title:$t("settings.memory.modelMap.type"),width:50,align:"left"},{colKey:"operation",title:$t("settings.memory.modelMap.operation"),width:100,align:"center",fixed:"right",cell:"operation"}],d=le(!1),u=le({name:"",type:"",model:"",path:"",fileName:""}),h=le("");function f(C,x){d.value=!0,u.value=x,h.value=C.id,s()}const g=[{colKey:"name",title:$t("settings.memory.modelMap.filenName"),width:150,align:"left",cell:"name"},{colKey:"type",title:$t("settings.memory.modelMap.type"),width:80,align:"left"},{colKey:"data",title:$t("promptManage.prompt"),align:"left",cell:"data",ellipsis:!0},{colKey:"bindOperation",title:$t("settings.memory.modelMap.operation"),width:200,align:"center",fixed:"right",cell:"bindOperation"}];function k(C){u.value.fileName=C.name,u.value.path=C.path}function A(){u.value.fileName="",u.value.path=""}const m=le(!1),v=le({isEdit:!1,name:"",type:"video",data:""});function p(){v.value={isEdit:!1,name:"",type:"video",data:""},m.value=!0}function b(C){v.value={isEdit:!0,...C},m.value=!0}function O(C){Xt.post("/setting/modelMap/deletePrompt",{path:C.path}).then(x=>{})}async function w(){if(!v.value.name.trim()){window.$message.warning($t("settings.memory.modelMap.promptNameRequired"));return}v.value.isEdit?await Xt.post("/setting/modelMap/updatePrompt",{name:v.value.name,type:v.value.type,data:v.value.data}):await Xt.post("/setting/modelMap/savePrompt",{name:v.value.name,type:v.value.type,data:v.value.data}),window.$message.success($t("settings.memory.modelMap.promptSaveSuccess")),m.value=!1,s()}function y(){const C={vendorId:h.value,model:u.value.model,path:u.value.path,fileName:u.value.fileName};Xt.post("/setting/modelMap/bindingPrompt",C).then(x=>{window.$message.success($t("settings.memory.modelMap.bindingSuccessful"))}).catch(x=>{window.$message.error($t("settings.memory.modelMap.bindingFailed",x))}).finally(()=>{d.value=!1,a()})}return(C,x)=>{const L=NO,S=fi,E=Bv,Q=y6,T=mJe,M=gJe,B=Gd,P=Aa,F=Rc,R=HA,N=UO,I=Em,W=yg;return we(),Re("div",Djo,[(we(!0),Re(Yt,null,hi(r.value,(H,V)=>(we(),Ot(M,{key:V,style:{"margin-top":"5px"}},{default:me(()=>[c(T,{header:H.name},{default:me(()=>[c(Q,{"row-key":"key",data:H.promptList,columns:l},{type:me(({row:Z})=>[ae("div",Qjo,[ae("span",null,Ee(Z.type=="text"?"文本":Z.type=="video"?"视频":"图片"),1)])]),operation:me(({row:Z})=>[c(E,{size:0},{default:me(()=>[Z!=null&&Z.path?(we(),Ot(S,{key:0,theme:"danger",variant:"text",onClick:K=>f(H,Z)},{icon:me(()=>[c(L,{name:"edit"})]),default:me(()=>[ft(" "+Ee(C.$t("settings.memory.modelMap.editRefeshWord")),1)]),_:1},8,["onClick"])):(we(),Ot(S,{key:1,theme:"primary",variant:"text",onClick:K=>f(H,Z)},{icon:me(()=>[c(L,{name:"edit"})]),default:me(()=>[ft(" "+Ee(C.$t("settings.memory.modelMap.editWord")),1)]),_:1},8,["onClick"]))]),_:2},1024)]),_:2},1032,["data"])]),_:2},1032,["header"])]),_:2},1024))),128)),c(P,{visible:d.value,"onUpdate:visible":x[0]||(x[0]=H=>d.value=H),header:C.$t("workbench.project.dialog.prompt.title"),width:"70%","close-on-overlay-click":!1,onConfirm:y,placement:"center"},{default:me(()=>[ae("div",Bjo,[ae("div",Fjo,[ae("div",Pjo,[ae("span",Mjo,Ee(C.$t("settings.memory.modelMap.currentBinding"))+":",1),u.value.fileName?(we(),Ot(B,{key:0,theme:"primary",variant:"light"},{default:me(()=>[ft(Ee(u.value.fileName),1)]),_:1})):(we(),Ot(B,{key:1,theme:"warning",variant:"light"},{default:me(()=>[ft(Ee(C.$t("settings.memory.modelMap.noBinding")),1)]),_:1}))]),c(S,{theme:"primary",variant:"outline",size:"small",onClick:p},{icon:me(()=>[c(L,{name:"add"})]),default:me(()=>[ft(" "+Ee(C.$t("settings.memory.modelMap.addPrompt")),1)]),_:1})]),c(Q,{"row-key":"name",data:o.value,columns:g,hover:!0,"max-height":"50vh",style:{"margin-top":"12px"}},{name:me(({row:H})=>[ae("div",Rjo,[ae("span",null,Ee(H.name),1),u.value.path===H.path?(we(),Ot(B,{key:0,size:"small",theme:"success"},{default:me(()=>[ft(Ee(C.$t("settings.memory.modelMap.bound")),1)]),_:1})):Ft("",!0)])]),bindOperation:me(({row:H})=>[c(E,{size:0},{default:me(()=>[u.value.path!==H.path?(we(),Ot(S,{key:0,theme:"primary",variant:"text",onClick:V=>k(H)},{default:me(()=>[ft(Ee(C.$t("settings.memory.modelMap.editWord")),1)]),_:1},8,["onClick"])):(we(),Ot(S,{key:1,theme:"danger",variant:"text",onClick:A},{default:me(()=>[ft(Ee(C.$t("settings.memory.modelMap.unbind")),1)]),_:1})),c(S,{theme:"primary",variant:"text",onClick:V=>b(H)},{default:me(()=>[ft(Ee(C.$t("settings.memory.modelMap.editPrompt")),1)]),_:1},8,["onClick"]),c(S,{theme:"danger",variant:"text",onClick:V=>O(H)},{default:me(()=>[ft(Ee(C.$t("settings.memory.modelMap.delPrompt")),1)]),_:1},8,["onClick"])]),_:2},1024)]),_:1},8,["data"])])]),_:1},8,["visible","header"]),c(P,{visible:m.value,"onUpdate:visible":x[4]||(x[4]=H=>m.value=H),header:v.value.isEdit?C.$t("settings.memory.modelMap.editPromptTitle"):C.$t("settings.memory.modelMap.addPromptTitle"),width:"75%","close-on-overlay-click":!1,onConfirm:w,top:"5vh"},{default:me(()=>[ae("div",Ijo,[c(W,{"label-align":"top"},{default:me(()=>[c(R,{label:C.$t("settings.memory.modelMap.filenName")},{default:me(()=>[c(F,{modelValue:v.value.name,"onUpdate:modelValue":x[1]||(x[1]=H=>v.value.name=H),disabled:v.value.isEdit,placeholder:C.$t("settings.memory.modelMap.promptNamePlaceholder")},null,8,["modelValue","disabled","placeholder"])]),_:1},8,["label"]),c(R,{label:C.$t("settings.memory.modelMap.type")},{default:me(()=>[c(I,{modelValue:v.value.type,"onUpdate:modelValue":x[2]||(x[2]=H=>v.value.type=H),disabled:v.value.isEdit,placeholder:C.$t("settings.memory.modelMap.promptTypePlaceholder")},{default:me(()=>[c(N,{value:"video",label:C.$t("settings.memory.modelMap.typeVideo")},null,8,["label"])]),_:1},8,["modelValue","disabled","placeholder"])]),_:1},8,["label"]),c(R,{label:C.$t("promptManage.prompt")},{default:me(()=>[c(ge(Jv),{theme:ge(t).mode==="auto"?"light":ge(t).mode,modelValue:v.value.data,"onUpdate:modelValue":x[3]||(x[3]=H=>v.value.data=H),toolbars:n,footers:[],style:{height:"55vh",width:"100%"},placeholder:C.$t("workbench.project.dialog.prompt.placeholder"),onOnUploadImg:()=>{}},null,8,["theme","modelValue","placeholder"])]),_:1},8,["label"])]),_:1})])]),_:1},8,["visible","header"])])}}}),Ujo=fr(Njo,[["__scopeId","data-v-c865ff10"]]),jjo={class:"settingPanel"},Wjo={class:"settingRight"},Hjo={class:"sectionTitle"},Vjo={class:"settingContent"},zjo=qe({__name:"index",setup(e){const{showSetting:t,activeMenu:n,needUpdate:r}=Br(qs()),o=[{key:"ui",label:"settings.menu.ui",icon:"i-theme"},{key:"language",label:"settings.menu.language",icon:"i-translate"},{key:"vendorConfig",label:"settings.menu.vendorConfig",icon:"i-computer"},{key:"modelMap",label:"settings.menu.modelMap",icon:"i-computer"},{key:"agentConfog",label:"settings.menu.agentConfig",icon:"i-color-filter"},{key:"promptManage",label:"settings.menu.promptManage",icon:"i-tips"},{key:"skillManagement",label:"settings.menu.skillsSkillsManagement",icon:"i-ring"},{key:"memoryConfig",label:"settings.menu.memoryConfig",icon:"i-memory-card-one"},{key:"loginConfig",label:"settings.menu.loginConfig",icon:"i-lock"},{key:"dbConfig",label:"settings.menu.dbConfig",icon:"i-data"},{key:"fileManagement",label:"settings.menu.fileManagement",icon:"i-hard-disk"},{key:"otherConfig",label:"settings.menu.otherConfig",icon:"i-application-menu"},{key:"requestConfig",label:"settings.menu.requestConfig",icon:"i-api"},{key:"devConfig",label:"settings.menu.devConfig",icon:"i-flask"},{key:"about",label:"settings.menu.about",icon:"i-info"},{key:"logoutConfig",label:"settings.menu.logoutConfig",icon:"i-logout"}],s=G(()=>o.find(a=>a.key===n.value));return(a,l)=>{const d=iJe,u=n3n,h=t3n,f=Aa;return we(),Ot(f,{header:a.$t("settings.title"),footer:!1,placement:"center",width:"1200px",visible:ge(t),"onUpdate:visible":l[1]||(l[1]=g=>yn(t)?t.value=g:null)},{default:me(()=>[ae("div",jjo,[c(h,{class:"settingMenu",value:ge(n),"onUpdate:value":l[0]||(l[0]=g=>yn(n)?n.value=g:null),style:{height:"70vh"}},{default:me(()=>[(we(),Re(Yt,null,hi(o,g=>c(u,{key:g.key,value:g.key},{icon:me(()=>[c(d,{count:ge(r)&&g.key==="about"?1:0,dot:""},{default:me(()=>[(we(),Ot(Ud(g.icon),{class:"icon"}))]),_:2},1032,["count"])]),default:me(()=>[ft(" "+Ee(a.$t(g.label)),1)]),_:2},1032,["value"])),64))]),_:1},8,["value"]),ae("div",Wjo,[ae("div",Hjo,Ee(ge(s)?a.$t(ge(s).label):""),1),ae("div",Vjo,[ge(n)==="ui"?(we(),Ot(d$r,{key:0})):Ft("",!0),ge(n)==="language"?(we(),Ot(p$r,{key:1})):Ft("",!0),ge(n)==="vendorConfig"?(we(),Ot(VUo,{key:2})):Ft("",!0),ge(n)==="requestConfig"?(we(),Ot(O$r,{key:3})):Ft("",!0),ge(n)==="loginConfig"?(we(),Ot(w$r,{key:4})):Ft("",!0),ge(n)==="agentConfog"?(we(),Ot(xoo,{key:5})):Ft("",!0),ge(n)==="promptManage"?(we(),Ot(Ejo,{key:6})):Ft("",!0),ge(n)==="otherConfig"?(we(),Ot(Woo,{key:7})):Ft("",!0),ge(n)==="dbConfig"?(we(),Ot(Noo,{key:8})):Ft("",!0),ge(n)==="about"?(we(),Ot(Mso,{key:9})):Ft("",!0),ge(n)==="logoutConfig"?(we(),Ot(Nso,{key:10})):Ft("",!0),ge(n)==="memoryConfig"?(we(),Ot(XUo,{key:11})):Ft("",!0),ge(n)==="fileManagement"?(we(),Ot(ejo,{key:12})):Ft("",!0),ge(n)==="skillManagement"?(we(),Ot(cjo,{key:13})):Ft("",!0),ge(n)==="devConfig"?(we(),Ot(pjo,{key:14})):Ft("",!0),ge(n)==="modelMap"?(we(),Ot(Ujo,{key:15})):Ft("",!0)])])])]),_:1},8,["header","visible"])}}}),Zjo=fr(zjo,[["__scopeId","data-v-e5ba8d7e"]]);function irt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yjo(e,t){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:0,r=Math.random()*(t-e)+e;return Math.floor(r*Math.pow(10,n))/Math.pow(10,n)}function G8t(e){return e[Fp(0,e.length)]}var Kjo=.00125,Jjo=5e-4,_jo=9e-4,$jo=1e-5,eWo=6,tWo=80,nWo=.9,iWo=1.7,rWo=.2,oWo=.6,sWo=.03,aWo=.07,ONn=15,wNn=82,K8t=150,lWo=100,cWo=250,dWo=40,uWo=["#fcf403","#62fc03","#f4fc03","#03e7fc","#03fca5","#a503fc","#fc03ad","#fc03c2"];function J8t(e){var t=1920;return Math.log(e)/Math.log(t)}var zSe=function(){function e(t){irt(this,e);var n=t.initialPosition,r=t.confettiRadius,o=t.confettiColors,s=t.emojis,a=t.emojiSize,l=t.canvasWidth,d=t.initialFlightAngle,u=t.rotationAngle,h=t.shouldHideConfettiInShiftedPosition,f=h===void 0?!1:h,g=Fp(nWo,iWo,3),k=g*J8t(l);this.confettiSpeed={x:k,y:k},this.finalConfettiSpeedX=Fp(rWo,oWo,3),this.rotationSpeed=s.length?.01:Fp(sWo,aWo,3)*J8t(l),this.dragForceCoefficient=Fp(Jjo,_jo,6),this.radius={x:r,y:r},this.initialRadius=r,this.rotationAngle=u,this.emojiSize=a,this.emojiRotationAngle=Fp(0,2*Math.PI),this.radiusYUpdateDirection="down",this.cos=Math.cos(d),this.sin=Math.sin(d);var A=Fp(-150,0);this.positionOffset={x:A*this.sin,y:A*this.cos},this.distanceTravelled={x:0,y:0};var m={x:n.x+this.positionOffset.x,y:n.y-this.positionOffset.y};this.currentPosition=Object.assign({},m),this.initialPosition=Object.assign({},m),this.color=s.length?null:G8t(o),this.emoji=s.length?G8t(s):null,this.createdAt=new Date().getTime(),this.isVisible=!f}return rrt(e,[{key:"draw",value:function(n){var r=this.currentPosition,o=this.radius,s=this.color,a=this.emoji,l=this.rotationAngle,d=this.emojiRotationAngle,u=this.emojiSize,h=this.isVisible;if(h){var f=window.devicePixelRatio;s?(n.fillStyle=s,n.beginPath(),n.ellipse(r.x*f,r.y*f,o.x*f,o.y*f,l,0,2*Math.PI),n.fill()):a&&(n.font="".concat(u,"px serif"),n.save(),n.translate(f*r.x,f*r.y),n.rotate(d),n.textAlign="center",n.fillText(a,0,0),n.restore())}}},{key:"updatePosition",value:function(n,r){var o=this.confettiSpeed,s=this.dragForceCoefficient,a=this.finalConfettiSpeedX,l=this.radiusYUpdateDirection,d=this.rotationSpeed,u=this.createdAt;o.x>a&&(this.confettiSpeed.x-=s*n);var h=this.currentPosition.y,f=r-u;this.currentPosition.y=this.initialPosition.y-o.y*this.cos*f+Kjo*Math.pow(f,2)/2;var g={x:o.x*this.sin*n,y:this.currentPosition.y-h};if(this.currentPosition.x+=g.x,this.distanceTravelled.x+=Math.abs(g.x),this.distanceTravelled.y+=Math.abs(g.y),this.distanceTravelled.x>=Math.abs(this.positionOffset.x)&&this.distanceTravelled.y>=Math.abs(this.positionOffset.y)&&(this.isVisible=!0),this.rotationSpeed-=this.emoji?1e-4:$jo*n,this.rotationSpeed<0&&(this.rotationSpeed=0),this.emoji){this.emojiRotationAngle+=this.rotationSpeed*n%(2*Math.PI);return}l==="down"?(this.radius.y-=n*d,this.radius.y<=0&&(this.radius.y=0,this.radiusYUpdateDirection="up")):(this.radius.y+=n*d,this.radius.y>=this.initialRadius&&(this.radius.y=this.initialRadius,this.radiusYUpdateDirection="down"))}},{key:"getIsVisibleOnCanvas",value:function(n){return this.currentPosition.y0&&arguments[0]!==void 0?arguments[0]:{};irt(this,e),this.activeConfettiBatches=[],this.canvas=t.canvas||hWo(),this.canvasContext=this.canvas.getContext("2d"),this.requestAnimationFrameRequested=!1,this.lastUpdated=new Date().getTime(),this.iterationIndex=0,this.loop=this.loop.bind(this),requestAnimationFrame(this.loop)}return rrt(e,[{key:"loop",value:function(){this.requestAnimationFrameRequested=!1,Gjo(this.canvas);var n=new Date().getTime(),r=n-this.lastUpdated,o=this.canvas.offsetHeight,s=this.iterationIndex%10===0;this.activeConfettiBatches=this.activeConfettiBatches.filter(function(a){return a.processShapes({timeDelta:r,currentTime:n},o,s),s?!a.complete():!0}),this.iterationIndex++,this.queueAnimationFrameIfNeeded(n)}},{key:"queueAnimationFrameIfNeeded",value:function(n){this.requestAnimationFrameRequested||this.activeConfettiBatches.length<1||(this.requestAnimationFrameRequested=!0,this.lastUpdated=n||new Date().getTime(),requestAnimationFrame(this.loop))}},{key:"addConfettiAtPosition",value:function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=_8t(n),o=r.confettiRadius,s=r.confettiNumber,a=r.confettiColors,l=r.emojis,d=r.emojiSize,u=r.confettiDispatchPosition,h=this.canvas.getBoundingClientRect(),f=h.width,g=new e6t(this.canvasContext),k=0;k0&&arguments[0]!==void 0?arguments[0]:{},r=_8t(n),o=r.confettiRadius,s=r.confettiNumber,a=r.confettiColors,l=r.emojis,d=r.emojiSize,u=this.canvas.getBoundingClientRect(),h=u.width,f=u.height,g=f*5/7,k={x:0,y:g},A={x:h,y:g},m=new e6t(this.canvasContext),v=0;v({content:m.label,value:m.value})),a=m=>{o.value=m.value,UH.value=m.value},l=v4e("helloGuideDone",!1),d=le(!l.value),u=le(0);function h(){n.value="vendorConfig",t.value=!0}function f(){n.value="agentConfog",t.value=!0}function g(){l.value=!0,d.value=!1}function k(){l.value=!0,d.value=!1,new kWo().addConfetti()}async function A(){r.value?await fetch("toonflow://openurlwithbrowser?url=https://github.com/HBAI-Ltd/Toonflow-app"):window.open("https://github.com/HBAI-Ltd/Toonflow-app")}return(m,v)=>{const p=fi,b=dn("i-translate"),O=$ne,w=q2i,y=X2i,C=NO,x=Yz,L=G3i,S=Aa;return we(),Ot(S,{visible:ge(d),"onUpdate:visible":v[3]||(v[3]=E=>yn(d)?d.value=E:null),footer:!1,header:!1,width:"680px","close-on-overlay-click":!1,placement:"center"},{default:me(()=>[ae("div",vWo,[ge(u)===0?(we(),Re("div",pWo,[v[4]||(v[4]=ae("img",{src:EEn,alt:"ToonFlow Logo",class:"welcomeLogo"},null,-1)),ae("h1",bWo,Ee(m.$t("hello.welcomeTitle")),1),ae("p",OWo,Ee(m.$t("hello.welcomeDesc")),1),c(p,{theme:"primary",size:"large",onClick:v[0]||(v[0]=E=>u.value=1)},{default:me(()=>[ft(Ee(m.$t("hello.startConfig")),1)]),_:1}),c(p,{variant:"text",size:"small",style:{"margin-top":"12px"},onClick:g},{default:me(()=>[ft(Ee(m.$t("hello.skip")),1)]),_:1}),ae("div",wWo,[c(O,{options:ge(s),trigger:"click",onClick:a,maxColumnWidth:150},{default:me(()=>[c(p,{shape:"circle",theme:"default",size:"large"},{icon:me(()=>[c(b,{theme:"outline",size:"20"})]),_:1})]),_:1},8,["options"])])])):(we(),Re(Yt,{key:1},[c(y,{current:ge(u)-1,class:"guideSteps"},{default:me(()=>[c(w,{title:m.$t("hello.configModel")},null,8,["title"]),c(w,{title:m.$t("hello.configData")},null,8,["title"]),c(w,{title:m.$t("hello.startUse")},null,8,["title"])]),_:1},8,["current"]),ae("div",yWo,[ge(u)===1?(we(),Re("div",CWo,[ae("div",xWo,[c(C,{name:"server",size:"48px"})]),ae("h2",LWo,Ee(m.$t("hello.configModelTitle")),1),ae("p",SWo,Ee(m.$t("hello.configModelDesc")),1),ae("div",TWo,[c(x,{theme:"info",message:m.$t("hello.configModelTip")},null,8,["message"])]),c(p,{theme:"primary",size:"large",onClick:h},{icon:me(()=>[c(C,{name:"setting"})]),default:me(()=>[ft(" "+Ee(m.$t("hello.configModelBtn")),1)]),_:1})])):Ft("",!0),ge(u)===2?(we(),Re("div",EWo,[ae("div",DWo,[c(C,{name:"relativity",size:"48px"})]),ae("h2",QWo,Ee(m.$t("hello.configAgentTitle")),1),ae("p",BWo,Ee(m.$t("hello.configAgentDesc")),1),ae("div",FWo,[c(x,{theme:"info",message:m.$t("hello.configAgentTip")},null,8,["message"])]),c(p,{theme:"primary",size:"large",onClick:f},{icon:me(()=>[c(C,{name:"setting"})]),default:me(()=>[ft(" "+Ee(m.$t("hello.configAgentBtn")),1)]),_:1})])):Ft("",!0),ge(u)===3?(we(),Re("div",PWo,[ae("div",MWo,[c(C,{name:"check-circle",size:"48px",color:"var(--td-success-color)"})]),ae("h2",RWo,Ee(m.$t("hello.finishTitle")),1),ae("p",IWo,Ee(m.$t("hello.finishDesc")),1),ae("div",NWo,[ae("p",UWo,Ee(m.$t("hello.qrcodeLabel")),1),c(L,{value:"https://work.weixin.qq.com/u/vc36adcc89845edcbe?v=5.0.3.63936&bb=85b8d228e8",level:"Q",type:"svg"})]),ae("div",jWo,[ae("p",WWo,Ee(m.$t("hello.githubLabel")),1),c(p,{theme:"danger",size:"large",onClick:A},{icon:me(()=>[c(C,{name:"logo-github"})]),default:me(()=>[v[5]||(v[5]=ft(" Star on GitHub ",-1))]),_:1})])])):Ft("",!0)]),ae("div",HWo,[ge(u)>1?(we(),Ot(p,{key:0,variant:"outline",onClick:v[1]||(v[1]=E=>u.value--)},{default:me(()=>[ft(Ee(m.$t("hello.prevStep")),1)]),_:1})):Ft("",!0),ae("div",VWo,[ge(u)<3?(we(),Ot(p,{key:0,variant:"text",onClick:g},{default:me(()=>[ft(Ee(m.$t("hello.skip")),1)]),_:1})):Ft("",!0),ge(u)<3?(we(),Ot(p,{key:1,theme:"primary",onClick:v[2]||(v[2]=E=>u.value++)},{default:me(()=>[ft(Ee(m.$t("hello.nextStep")),1)]),_:1})):Ft("",!0),ge(u)===3?(we(),Ot(p,{key:2,theme:"primary",onClick:k},{default:me(()=>[ft(Ee(m.$t("hello.finish")),1)]),_:1})):Ft("",!0)])])],64))])]),_:1},8,["visible"])}}}),ZWo=fr(zWo,[["__scopeId","data-v-da3a500c"]]),Ad=RO("project",()=>({allProject:le([]),project:le(null)}),{persist:!0}),YWo={class:"menu fc jb"},XWo={class:"itemBox fc ac"},qWo=["onClick"],GWo={key:1,class:"divider"},KWo={class:"footItem fc ac"},JWo={class:"view"},_Wo={key:0,class:"topMenu f ac jb"},$Wo={class:"title"},eHo={class:"rightBtnList f ac"},tHo=["onClick"],nHo={key:1,class:"divider"},iHo={class:"viewBox"},rHo=qe({__name:"index",setup(e){const{project:t}=Br(Ad()),{showSetting:n,isElectron:r,needUpdate:o}=Br(qs()),s=le([{type:"btn",path:"/project",labelKey:"workbench.menu.myProject",icon:"i-folder-close"},{type:"btn",path:"/task",labelKey:"workbench.menu.taskCenter",icon:"i-view-list"}]),a=le([{type:"btn",path:"/novel",labelKey:"workbench.menu.novel",icon:"i-notebook",nodelOnly:!0},{type:"btn",path:"/scriptAgent",labelKey:"workbench.menu.scriptAgent",icon:"i-color-filter",nodelOnly:!0},{type:"btn",path:"/script",labelKey:"workbench.menu.scriptManage",icon:"i-document-folder"},{type:"btn",path:"/cornerScape",labelKey:"workbench.menu.cornerScape",icon:"i-peoples-two"},{type:"btn",path:"/production",labelKey:"workbench.menu.production",icon:"i-carousel-video"},{type:"divider"},{type:"btn",path:"/assets",labelKey:"workbench.menu.assetCenter",icon:"i-receive"}]),l=Y4e(),d=Jji(),u=le(d.path);ut(()=>d.path,p=>{u.value=p});function h(p){p.needProject&&!t.value||(l.push(p.path),u.value=p.path)}async function f(){r.value?await fetch("toonflow://openurlwithbrowser?url=https://github.com/HBAI-Ltd/Toonflow-app"):window.open("https://github.com/HBAI-Ltd/Toonflow-app")}async function g(){r.value?await fetch("toonflow://openurlwithbrowser?url=https://docs.qq.com/smartsheet/form/EmvmQBrmlPmr%2Fss_vsqk2v%2FvhiGzE?tab=ss_vsqk2v"):window.open("https://docs.qq.com/smartsheet/form/EmvmQBrmlPmr%2Fss_vsqk2v%2FvhiGzE?tab=ss_vsqk2v")}async function k(){const{data:p}=await Xt.post("/setting/about/checkUpdate",{source:"toonflow"});if(p.needUpdate){o.value=!0;const{activeMenu:b}=Br(qs()),O=eP.success({title:$t("version.newVersion"),content:()=>Qn("div",{style:"text-align: right; padding-top: 4px;"},Qn("span",{style:"color: #ed7b2f; font-size: 12px; cursor: pointer;",onClick:()=>{b.value="about",n.value=!0,eP.close(O)}},$t("skillScan.openSettings"))),closeBtn:!0,placement:"bottom-right"})}else o.value=!1}let A=null;function m(){k(),A=setInterval(()=>{k()},2*60*1e3)}function v(){A&&(clearInterval(A),A=null)}return ut(o,p=>{p&&v()}),vn(()=>{m()}),Ma(()=>{v()}),(p,b)=>{var S,E;const O=Va,w=dn("i-bill"),y=dn("i-setting-one"),C=iJe,x=dn("i-github-one"),L=dn("router-view");return we(),Re(Yt,null,[ae("div",{class:"main",style:eo({height:ge(r)?"calc(100vh - 32px)":"100vh"})},[ae("div",YWo,[b[1]||(b[1]=ae("div",{class:"logoBox c"},[ae("div",{class:"logo"})],-1)),ae("div",XWo,[(we(!0),Re(Yt,null,hi(ge(s),(Q,T)=>(we(),Ot(O,{content:Q.labelKey?p.$t(Q.labelKey):"",placement:"right",destroyOnClose:"",showArrow:!1,key:T},{default:me(()=>[Q.type==="btn"?(we(),Re("div",{key:0,class:no(["item fc c",{active:ge(u)==Q.path}]),onClick:M=>h(Q)},[(we(),Ot(Ud(Q.icon),{class:"icon"}))],10,qWo)):Ft("",!0),Q.type==="divider"?(we(),Re("div",GWo)):Ft("",!0)]),_:2},1032,["content"]))),128))]),ae("div",KWo,[c(O,{content:p.$t("workbench.menu.feedbackQuestions"),placement:"right",destroyOnClose:"",showArrow:!1},{default:me(()=>[ae("div",{class:"item c",onClick:g},[c(w,{class:"icon"})])]),_:1},8,["content"]),c(O,{content:p.$t("workbench.menu.settings"),placement:"right",destroyOnClose:"",showArrow:!1},{default:me(()=>[ae("div",{class:"item c",onClick:b[0]||(b[0]=Q=>n.value=!0)},[c(C,{count:ge(o)?1:0,dot:""},{default:me(()=>[c(y,{class:"icon"})]),_:1},8,["count"])])]),_:1},8,["content"]),c(O,{content:p.$t("workbench.menu.jumpGithub"),placement:"right",destroyOnClose:"",showArrow:!1},{default:me(()=>[ae("div",{class:"item c",onClick:f},[c(x,{class:"icon"})])]),_:1},8,["content"])])]),ae("div",JWo,[(S=ge(t))!=null&&S.id?(we(),Re("div",_Wo,[ae("div",$Wo,[ae("h2",null,Ee(((E=ge(t))==null?void 0:E.name)||p.$t("workbench.selectProject")),1)]),ae("div",eHo,[(we(!0),Re(Yt,null,hi(ge(a),(Q,T)=>(we(),Ot(O,{content:Q.labelKey?p.$t(Q.labelKey):"",placement:"bottom",destroyOnClose:"",showArrow:!1,key:T},{default:me(()=>[Q.type==="btn"&&(ge(t).projectType==="novel"||!Q.nodelOnly)?(we(),Re("div",{key:0,class:no(["item fc c",{active:ge(u)==Q.path}]),onClick:M=>h(Q)},[(we(),Ot(Ud(Q.icon),{class:"icon"}))],10,tHo)):Ft("",!0),Q.type==="divider"?(we(),Re("div",nHo)):Ft("",!0)]),_:2},1032,["content"]))),128))])])):Ft("",!0),ae("div",iHo,[c(L,null,{default:me(({Component:Q})=>[(we(),Ot(Ud(Q),{key:p.$route.fullPath}))]),_:1})])])],4),c(ZWo),c(Zjo)],64)}}}),oHo=fr(rHo,[["__scopeId","data-v-22a9b1ab"]]),sHo=Object.freeze(Object.defineProperty({__proto__:null,default:oHo},Symbol.toStringTag,{value:"Module"})),aHo={class:"addProject"},lHo={class:"formColumns"},cHo={class:"formLeft"},dHo={class:"ac",style:{gap:"5px",width:"100%"}},uHo={class:"ac",style:{gap:"5px",width:"100%"}},hHo={class:"formRight"},AHo={class:"artStylePicker"},fHo={class:"artStyleHeader"},gHo={class:"artStyleContent"},mHo={class:"gridContainer"},kHo=["onClick"],vHo={class:"imageWrapper"},pHo=["src","alt"],bHo={class:"text"},OHo={class:"directorManual"},wHo={class:"directorManualHeader"},yHo={class:"artStyleContent"},CHo={class:"gridContainer"},xHo=["onClick"],LHo={class:"imageWrapper"},SHo=["src","alt"],THo={class:"text"},EHo={class:"nameAndCoverRow"},DHo={class:"nameField"},QHo={class:"fieldLabel"},BHo={class:"mdFileLocation"},FHo={class:"fieldLabel"},PHo={class:"coverField"},MHo={class:"fieldLabel"},RHo={class:"coverUploadArea multiCoverUploadArea"},IHo=["src","onClick"],NHo=["onClick"],UHo={class:"promptEditorWrapper"},jHo={class:"promptEditorHeader"},WHo={class:"aiExtractInline"},HHo={class:"nameAndCoverRow"},VHo={class:"nameField"},zHo={class:"fieldLabel"},ZHo={class:"mdFileLocation"},YHo={class:"fieldLabel"},XHo={class:"coverField"},qHo={class:"fieldLabel"},GHo={class:"coverUploadArea multiCoverUploadArea"},KHo=["src"],JHo=["onClick"],_Ho={class:"promptEditorWrapper"},$Ho={class:"promptEditorHeader"},eVo={class:"aiExtractInline"},tVo=qe({__name:"projectDialog",props:Vs({projectData:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:Vs(["add","edit"],["update:modelValue"]),setup(e,{emit:t}){const{themeSetting:n}=Br(qs()),r=Pl(e,"modelValue"),o=e,s=t,a=le(),l=le(!1);function d(he){l.value=!0,a.value=he}const u=()=>[{label:"README",value:"README",data:""},{label:"前缀",value:"prefix",data:""},{label:"角色",value:"art_character",data:""},{label:"角色衍生",value:"art_character_derivative",data:""},{label:"道具",value:"art_prop",data:""},{label:"道具衍生",value:"art_prop_derivative",data:""},{label:"场景",value:"art_scene",data:""},{label:"场景衍生",value:"art_scene_derivative",data:""},{label:"分镜",value:"director_storyboard",data:""},{label:"分镜视频",value:"art_storyboard_video",data:""},{label:"技法-导演规划",value:"director_planning_style",data:""},{label:"技法-分镜表设计",value:"director_storyboard_table_style",data:""}],h=G(()=>!!o.projectData),f=[{value:"16:9",label:"16:9"},{value:"9:16",label:"9:16"}],g=()=>({id:0,projectType:"novel",name:"",intro:"",type:"",artStyle:"",era:"",videoRatio:"16:9",createTime:0,userId:0,imageModel:"",videoModel:"",imageQuality:"",mode:"",directorManual:""}),k=le(g());function A(){k.value=g()}function m(){r.value=!1,A()}function v(){if(!k.value.name)return window.$message.warning($t("workbench.project.msg.enterProjectName"));if(!k.value.type)return window.$message.warning($t("workbench.project.msg.enterProjectType"));if(!k.value.imageModel)return window.$message.warning($t("workbench.project.msg.enterImageModel"));if(!k.value.videoModel)return window.$message.warning($t("workbench.project.msg.enterVideoModel"));if(!k.value.artStyle)return window.$message.warning($t("workbench.project.msg.enterArtStyle"));if(!k.value.directorManual)return window.$message.warning($t("workbench.project.msg.directorManual"));if(!k.value.videoRatio)return window.$message.warning($t("workbench.project.msg.enterVideoRatio"));if(!k.value.intro)return window.$message.warning($t("workbench.project.msg.enterProjectIntro"));if(!k.value.imageQuality)return window.$message.warning($t("workbench.project.msg.enterProjectQuality"));if(!k.value.mode)return window.$message.warning($t("workbench.project.msg.selectMode"));h.value?s("edit",{id:k.value.id,name:k.value.name,intro:k.value.intro,type:k.value.type,artStyle:k.value.artStyle,videoRatio:k.value.videoRatio,imageModel:k.value.imageModel,videoModel:k.value.videoModel,projectType:k.value.projectType||"novel",directorManual:k.value.directorManual,imageQuality:k.value.imageQuality,mode:k.value.mode}):s("add",{projectType:k.value.projectType||"novel",name:k.value.name,intro:k.value.intro,type:k.value.type,artStyle:k.value.artStyle,videoRatio:k.value.videoRatio||"16:9",imageModel:k.value.imageModel,videoModel:k.value.videoModel,imageQuality:k.value.imageQuality,directorManual:k.value.directorManual,mode:k.value.mode}),A(),r.value=!1}const p=["bold","italic","strikeThrough","-","unorderedList","orderedList","-","revoke","next","=","preview"];ut(r,async he=>{if(he){if(o.projectData){if(k.value={...g(),id:o.projectData.id,name:o.projectData.name||"",intro:o.projectData.intro||"",type:o.projectData.type||"",artStyle:o.projectData.artStyle||"",videoRatio:o.projectData.videoRatio||"16:9",imageModel:o.projectData.imageModel||"",videoModel:o.projectData.videoModel||"",imageQuality:o.projectData.imageQuality||"",projectType:o.projectData.projectType||"novel",mode:o.projectData.mode||"text",directorManual:o.projectData.directorManual||""},o.projectData.videoModel)try{const{data:pe}=await Xt.post("/modelSelect/getModelDetail",{modelId:o.projectData.videoModel});pe!=null&&pe.mode&&(I.value=pe.mode.map(Le=>({label:H(Le),value:V(Le)})))}catch{}}else A();E(),ne()}});const b=le([]),O=le(!1),w=le(!1),y=le(null),C=le({name:"",images:[],stylePath:""}),x=le(),L=le("README"),S=le(u());function E(){O.value=!0,Xt.post("/project/getVisualManual").then(({data:he})=>{b.value=he.map(pe=>({id:pe.id,name:pe.name,stylePath:pe.stylePath,images:pe.images??(Array.isArray(pe.image)?pe.image:pe.image?[pe.image]:[]),data:pe.data}))}).finally(()=>{O.value=!1})}function Q(he){if(y.value=he??null,he){C.value.name=he.name,C.value.stylePath=he.stylePath,C.value.images=he.images?[...he.images]:[];const pe=Array.isArray(he.data)?he.data:[];S.value=u().map(Le=>{const Be=pe.find(ve=>ve.value===Le.value);return Be?{...Le,data:Be.data}:{...Le}})}else C.value={name:"",images:[],stylePath:""},S.value=u();L.value="README",w.value=!0}function T(){w.value=!1,y.value=null,C.value={name:"",images:[],stylePath:""},S.value=u(),L.value="README"}function M(){var he;(he=x.value)==null||he.click()}function B(he){const pe=he.target.files;!pe||pe.length===0||(Array.from(pe).forEach(Le=>{const Be=new FileReader;Be.onload=()=>{C.value.images.push(Be.result)},Be.readAsDataURL(Le)}),he.target.value="")}function P(he){C.value.images.splice(he,1)}const F=le(!1);async function R(){if(!C.value.name.trim()){window.$message.warning($t("workbench.project.msg.enterVisualManualName"));return}if(!C.value.images.length){window.$message.warning($t("workbench.project.msg.enterVisualManualImage"));return}const he=S.value.find(pe=>!pe.data.trim());if(he)return window.$message.warning(`「${he.label}」${$t("workbench.project.msg.enterVisualManualTabData")}`);try{F.value=!0,y.value?await Xt.post("/project/editVisualManual",{name:C.value.name,images:C.value.images,data:S.value,stylePath:C.value.stylePath}):await Xt.post("/project/addVisualManual",{name:C.value.name,images:C.value.images,data:S.value,stylePath:C.value.stylePath}),F.value=!1,y.value?window.$message.success($t("workbench.project.msg.visualManualUpdated")):window.$message.success($t("workbench.project.msg.visualManualAdded")),T(),E()}catch(pe){F.value=!1,window.$message.error(pe.message??$t("workbench.project.msg.operationFailed"))}}function N(he){const pe=Kr.confirm({header:$t("workbench.project.msg.deleteVisualManualHeader"),body:$t("workbench.project.msg.deleteVisualManualBody",{name:he.stylePath}),confirmBtn:$t("workbench.project.msg.deleteVisualManualConfirm"),cancelBtn:$t("workbench.project.msg.deleteVisualManualCancel"),onConfirm:()=>{Xt.post("/project/deleteVisualManual",{name:he.stylePath}).then(()=>{E(),T(),window.$message.success($t("workbench.project.msg.visualManualDeleted"))}).catch(Le=>{window.$message.error(Le.message??$t("workbench.project.msg.operationFailed"))}).finally(()=>{E(),pe.destroy()})}})}const I=le([]),W={singleImage:$t("workbench.production.generate.modeSingleImage"),startEndRequired:$t("workbench.production.generate.modeStartEnd"),endFrameOptional:$t("workbench.production.generate.modeStartEnd"),startFrameOptional:$t("workbench.production.generate.modeStartEnd"),text:$t("workbench.production.generate.modeText"),videoReference:$t("workbench.production.generate.modeVideoRef"),imageReference:$t("workbench.production.generate.modeImageRef"),audioReference:$t("workbench.production.generate.modeAudioRef")};function H(he){return he?Array.isArray(he)?he.map(pe=>W[pe.replace(/:.*$/,"")]??pe).join("、"):W[he]??he:""}function V(he){return Array.isArray(he)?JSON.stringify(he):he}function Z(he,pe){I.value=pe.mode.map(Le=>({label:H(Le),value:V(Le)}))}const K=()=>[{label:"README",value:"README",data:""},{label:"导演规划",value:"director_planning_narrative",data:""},{label:"分镜表",value:"director_storyboard_table_narrative",data:""}],X=le({name:"",images:[],directorManual:""}),ee=le(!1),q=le(null),$=le(!1),oe=le([]),de=le("README"),ke=le(K());function ne(){ee.value=!0,Xt.post("/project/queryDirectorManual").then(({data:he})=>{oe.value=he.map(pe=>({id:pe.id,name:pe.name,directorManual:pe.directorManual,images:pe.images??(Array.isArray(pe.image)?pe.image:pe.image?[pe.image]:[]),data:pe.data}))}).finally(()=>{ee.value=!1})}function Ae(he){if(q.value=he??null,he){X.value.name=he.name,X.value.directorManual=he.directorManual,X.value.images=he.images?[...he.images]:[];const pe=Array.isArray(he.data)?he.data:[];ke.value=K().map(Le=>{const Be=pe.find(ve=>ve.value===Le.value);return Be?{...Le,data:Be.data}:{...Le}})}else X.value={name:"",images:[],directorManual:""},ke.value=K();de.value="README",$.value=!0}function Y(){$.value=!1,q.value=null,X.value={name:"",images:[],directorManual:""},ke.value=K(),de.value="README"}function re(he){const pe=Kr.confirm({header:$t("workbench.project.msg.deleteDirectorManualHeader"),body:$t("workbench.project.msg.deleteDirectorManualBody",{name:he.directorManual}),confirmBtn:$t("workbench.project.msg.deleteVisualManualConfirm"),cancelBtn:$t("workbench.project.msg.deleteVisualManualCancel"),onConfirm:()=>{Xt.post("/project/deleteDirectorManual",{name:he.directorManual}).then(()=>{ne(),Y(),window.$message.success($t("workbench.project.msg.visualManualDeleted"))}).catch(Le=>{window.$message.error(Le.message??$t("workbench.project.msg.operationFailed"))}).finally(()=>{ne(),pe.destroy()})}})}async function ce(){if(!X.value.name.trim()){window.$message.warning($t("workbench.project.msg.enterVisualManualName"));return}if(!X.value.images.length){window.$message.warning($t("workbench.project.msg.enterVisualManualImage"));return}const he=ke.value.find(pe=>!pe.data.trim());if(he)return window.$message.warning(`「${he.label}」${$t("workbench.project.msg.enterVisualManualTabData")}`);try{F.value=!0,q.value?await Xt.post("/project/editDirectorlManual",{name:X.value.name,images:X.value.images,data:ke.value,directorManual:X.value.directorManual}):await Xt.post("/project/addDirectorManual",{name:X.value.name,images:X.value.images,data:ke.value,directorManual:X.value.directorManual}),F.value=!1,q.value?window.$message.success($t("workbench.project.msg.directorManualUpdated")):window.$message.success($t("workbench.project.msg.directorManualAdded")),Y(),ne()}catch(pe){F.value=!1,window.$message.error(pe.message??$t("workbench.project.msg.operationFailed"))}}function ie(){var he;(he=x.value)==null||he.click()}function J(he){const pe=he.target.files;!pe||pe.length===0||(Array.from(pe).forEach(Le=>{const Be=new FileReader;Be.onload=()=>{X.value.images.push(Be.result)},Be.readAsDataURL(Le)}),he.target.value="")}return(he,pe)=>{const Le=UO,Be=Em,ve=HA,ue=Rc,be=RA,xe=yg,Qe=dn("i-plus"),Fe=fi,Ge=dn("i-edit"),Xe=dn("i-delete"),$e=dn("i-preview-open"),vt=Mc,mt=Aa,rt=dn("i-close"),yt=zz,Rt=Vz,Ke=iC;return we(),Re("div",aHo,[c(mt,{placement:"center",visible:r.value,"onUpdate:visible":pe[11]||(pe[11]=ze=>r.value=ze),header:h.value?he.$t("workbench.project.dialog.editTitle"):he.$t("workbench.project.dialog.addTitle"),width:"60%",onConfirm:v,onCloseBtnClick:m,onCancel:m,"confirm-btn":h.value?he.$t("workbench.project.dialog.save"):he.$t("workbench.project.dialog.ok"),"cancel-btn":he.$t("workbench.project.dialog.cancel")},{default:me(()=>[ae("div",lHo,[ae("div",cHo,[c(xe,{data:k.value,"label-align":"top"},{default:me(()=>[c(ve,{label:he.$t("workbench.project.dialog.projectType")},{default:me(()=>[c(Be,{modelValue:k.value.projectType,"onUpdate:modelValue":pe[0]||(pe[0]=ze=>k.value.projectType=ze),placeholder:he.$t("workbench.project.dialog.selectType")},{default:me(()=>[c(Le,{key:"基于小说原文",label:he.$t("workbench.project.dialog.basedOnNovel"),value:"novel"},null,8,["label"]),c(Le,{key:"基于剧本",label:he.$t("workbench.project.dialog.basedOnScript"),value:"script"},null,8,["label"])]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),c(ve,{label:he.$t("workbench.project.dialog.projectName")},{default:me(()=>[c(ue,{modelValue:k.value.name,"onUpdate:modelValue":pe[1]||(pe[1]=ze=>k.value.name=ze),placeholder:he.$t("workbench.project.dialog.projectNamePh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c(ve,{label:he.$t("workbench.project.dialog.novelType")},{default:me(()=>[c(ue,{modelValue:k.value.type,"onUpdate:modelValue":pe[2]||(pe[2]=ze=>k.value.type=ze),placeholder:he.$t("workbench.project.dialog.novelTypePh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c(ve,{label:he.$t("workbench.project.dialog.modelData")},{default:me(()=>[ae("div",dHo,[c(W8,{modelValue:k.value.imageModel,"onUpdate:modelValue":pe[3]||(pe[3]=ze=>k.value.imageModel=ze),type:"image"},null,8,["modelValue"]),c(Be,{modelValue:k.value.imageQuality,"onUpdate:modelValue":pe[4]||(pe[4]=ze=>k.value.imageQuality=ze),class:"paramSelect ml-5",placeholder:he.$t("workbench.production.editImage.quality")},{default:me(()=>[c(Le,{value:"1K",label:"1K"}),c(Le,{value:"2K",label:"2K"}),c(Le,{value:"4K",label:"4K"})]),_:1},8,["modelValue","placeholder"])])]),_:1},8,["label"]),c(ve,{label:he.$t("workbench.project.dialog.videoModelData")},{default:me(()=>[ae("div",uHo,[c(W8,{modelValue:k.value.videoModel,"onUpdate:modelValue":pe[5]||(pe[5]=ze=>k.value.videoModel=ze),type:"video",onChange:Z,changeConfig:!0},null,8,["modelValue"]),c(Be,{modelValue:k.value.mode,"onUpdate:modelValue":pe[6]||(pe[6]=ze=>k.value.mode=ze),class:"paramSelect ml-5",placeholder:he.$t("workbench.production.editImage.mode")},{default:me(()=>[(we(!0),Re(Yt,null,hi(I.value,ze=>(we(),Ot(Le,{key:ze.value,value:ze.value,label:ze.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue","placeholder"])])]),_:1},8,["label"]),c(ve,{label:he.$t("workbench.project.dialog.videoRatio")},{default:me(()=>[c(Be,{modelValue:k.value.videoRatio,"onUpdate:modelValue":pe[7]||(pe[7]=ze=>k.value.videoRatio=ze),options:f},null,8,["modelValue"])]),_:1},8,["label"]),c(ve,{label:he.$t("workbench.project.dialog.novelIntro")},{default:me(()=>[c(be,{modelValue:k.value.intro,"onUpdate:modelValue":pe[8]||(pe[8]=ze=>k.value.intro=ze),autosize:{minRows:3,maxRows:6},placeholder:he.$t("workbench.project.dialog.novelIntroPh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["data"])]),ae("div",hHo,[c(xe,{"label-align":"top"},{default:me(()=>[c(ve,null,{default:me(()=>[ae("div",AHo,[ae("div",fHo,[ae("span",null,Ee(he.$t("workbench.project.dialog.visualManual")),1),c(Fe,{size:"small",variant:"outline",onClick:pe[9]||(pe[9]=ze=>Q())},{icon:me(()=>[c(Qe,{size:"14"})]),default:me(()=>[ft(" "+Ee(he.$t("workbench.project.dialog.newVisualManual")),1)]),_:1})]),ae("div",gHo,[c(vt,{loading:O.value,text:he.$t("workbench.project.dialog.loading")},{default:me(()=>[ae("div",mHo,[(we(!0),Re(Yt,null,hi(b.value,(ze,jt)=>(we(),Re("div",{key:jt,class:no(["gridItem",{active:k.value.artStyle===ze.stylePath}]),onClick:en=>k.value.artStyle=ze.stylePath},[ae("div",vHo,[ae("img",{src:ze.images&&ze.images[0],alt:ze.name,class:"artImage",loading:"lazy"},null,8,pHo),ae("div",bHo,Ee(ze.name),1)]),c(Fe,{class:"editBtn",shape:"square",onClick:Mi(en=>Q(ze),["stop"])},{default:me(()=>[c(Ge,{theme:"outline",size:"14"})]),_:1},8,["onClick"]),c(Fe,{class:"delBtn",shape:"square",onClick:Mi(en=>N(ze),["stop"])},{default:me(()=>[c(Xe,{theme:"outline",size:"14"})]),_:1},8,["onClick"]),c(Fe,{class:"preview",shape:"square",onClick:Mi(en=>d(ze.images&&ze.images[0]),["stop"])},{default:me(()=>[c($e,{theme:"outline",size:"14"})]),_:1},8,["onClick"])],10,kHo))),128))])]),_:1},8,["loading","text"])])])]),_:1}),c(ve,null,{default:me(()=>[ae("div",OHo,[ae("div",wHo,[ae("span",null,Ee(he.$t("workbench.project.dialog.directorManual")),1),c(Fe,{size:"small",variant:"outline",onClick:pe[10]||(pe[10]=ze=>Ae())},{icon:me(()=>[c(Qe,{size:"14"})]),default:me(()=>[ft(" "+Ee(he.$t("workbench.project.dialog.addDirectorManual")),1)]),_:1})]),ae("div",yHo,[c(vt,{loading:ee.value,text:he.$t("workbench.project.dialog.loading")},{default:me(()=>[ae("div",CHo,[(we(!0),Re(Yt,null,hi(oe.value,(ze,jt)=>(we(),Re("div",{key:jt,class:no(["gridItem",{active:k.value.directorManual===ze.directorManual}]),onClick:en=>k.value.directorManual=ze.directorManual},[ae("div",LHo,[ae("img",{src:ze.images&&ze.images[0],alt:ze.name,class:"artImage",loading:"lazy"},null,8,SHo),ae("div",THo,Ee(ze.name),1)]),c(Fe,{class:"editBtn",shape:"square",onClick:Mi(en=>Ae(ze),["stop"])},{default:me(()=>[c(Ge,{theme:"outline",size:"14"})]),_:1},8,["onClick"]),c(Fe,{class:"delBtn",shape:"square",onClick:Mi(en=>re(ze),["stop"])},{default:me(()=>[c(Xe,{theme:"outline",size:"14"})]),_:1},8,["onClick"]),c(Fe,{class:"preview",shape:"square",onClick:Mi(en=>d(ze.images&&ze.images[0]),["stop"])},{default:me(()=>[c($e,{theme:"outline",size:"14"})]),_:1},8,["onClick"])],10,xHo))),128))])]),_:1},8,["loading","text"])])])]),_:1})]),_:1})])])]),_:1},8,["visible","header","confirm-btn","cancel-btn"]),c(mt,{class:"artStyleDialog",visible:w.value,"onUpdate:visible":pe[15]||(pe[15]=ze=>w.value=ze),header:y.value?he.$t("workbench.project.dialog.editVisualManualTitle"):he.$t("workbench.project.dialog.newVisualManualTitle"),width:"90vw",placement:"center",onConfirm:R,onCloseBtnClick:Y,onCancel:Y,"confirm-btn":he.$t("workbench.project.dialog.ok"),"cancel-btn":he.$t("workbench.project.dialog.cancel")},{default:me(()=>[c(vt,{loading:F.value},{default:me(()=>[c(xe,{"label-align":"top"},{default:me(()=>[c(ve,null,{default:me(()=>[ae("div",EHo,[ae("div",DHo,[ae("label",QHo,Ee(he.$t("workbench.project.dialog.visualManualName")),1),c(ue,{modelValue:C.value.name,"onUpdate:modelValue":pe[12]||(pe[12]=ze=>C.value.name=ze),placeholder:he.$t("workbench.project.dialog.visualManualNamePh")},null,8,["modelValue","placeholder"])]),ae("div",BHo,[ae("label",FHo,Ee(he.$t("workbench.project.dialog.mdFile")),1),c(ue,{modelValue:C.value.stylePath,"onUpdate:modelValue":pe[13]||(pe[13]=ze=>C.value.stylePath=ze),disabled:!!y.value},null,8,["modelValue","disabled"])]),ae("div",PHo,[ae("label",MHo,Ee(he.$t("workbench.project.dialog.visualManualCover")),1),ae("div",RHo,[(we(!0),Re(Yt,null,hi(C.value.images,(ze,jt)=>(we(),Re("div",{key:jt,class:"coverPreview"},[ae("img",{src:ze,class:"coverImg",onClick:Mi(en=>d(ze&&ze),["stop"]),style:{cursor:"pointer"}},null,8,IHo),ae("div",{class:"coverImgRemove",onClick:en=>P(jt)},[c(rt,{size:"10"})],8,NHo)]))),128)),ae("div",{class:"coverUploadTrigger",onClick:M},[ae("input",{ref_key:"visualManualCoverInputRef",ref:x,type:"file",accept:"image/*",multiple:"",style:{display:"none"},onChange:B},null,544),c(Qe,{size:"24"}),ae("span",null,Ee(he.$t("workbench.project.dialog.uploadCover")),1)])])])])]),_:1}),c(ve,{label:he.$t("workbench.project.dialog.visualManualPrompt")},{default:me(()=>[ae("div",UHo,[ae("div",jHo,[ae("div",WHo,[c(Rt,{value:L.value,size:"medium",onChange:pe[14]||(pe[14]=ze=>L.value=ze)},{default:me(()=>[(we(!0),Re(Yt,null,hi(S.value,ze=>(we(),Ot(yt,{key:ze.value,value:ze.value,label:ze.label},{default:me(()=>[c(ge(Jv),{modelValue:ze.data,"onUpdate:modelValue":jt=>ze.data=jt,theme:ge(n).mode,toolbars:p,footers:[],placeholder:he.$t("workbench.project.dialog.promptPlaceholder"),style:{height:"30vh","margin-top":"5px"},onOnUploadImg:()=>{}},null,8,["modelValue","onUpdate:modelValue","theme","placeholder"])]),_:2},1032,["value","label"]))),128))]),_:1},8,["value"])])])])]),_:1},8,["label"])]),_:1})]),_:1},8,["loading"])]),_:1},8,["visible","header","confirm-btn","cancel-btn"]),c(mt,{class:"artStyleDialog",visible:$.value,"onUpdate:visible":pe[19]||(pe[19]=ze=>$.value=ze),header:q.value?he.$t("workbench.project.dialog.editingDirectorManual"):he.$t("workbench.project.dialog.newDirecorManualTitle"),width:"90vw",placement:"center",onConfirm:ce,onCloseBtnClick:T,onCancel:T,"confirm-btn":he.$t("workbench.project.dialog.ok"),"cancel-btn":he.$t("workbench.project.dialog.cancel")},{default:me(()=>[c(vt,{loading:F.value},{default:me(()=>[c(xe,{"label-align":"top"},{default:me(()=>[c(ve,null,{default:me(()=>[ae("div",HHo,[ae("div",VHo,[ae("label",zHo,Ee(he.$t("workbench.project.dialog.directorManualName")),1),c(ue,{modelValue:X.value.name,"onUpdate:modelValue":pe[16]||(pe[16]=ze=>X.value.name=ze),placeholder:he.$t("workbench.project.dialog.directorManualNamePh")},null,8,["modelValue","placeholder"])]),ae("div",ZHo,[ae("label",YHo,Ee(he.$t("workbench.project.dialog.directorFile")),1),c(ue,{modelValue:X.value.directorManual,"onUpdate:modelValue":pe[17]||(pe[17]=ze=>X.value.directorManual=ze),disabled:!!q.value},null,8,["modelValue","disabled"])]),ae("div",XHo,[ae("label",qHo,Ee(he.$t("workbench.project.dialog.directorManualCover")),1),ae("div",GHo,[(we(!0),Re(Yt,null,hi(X.value.images,(ze,jt)=>(we(),Re("div",{key:jt,class:"coverPreview"},[ae("img",{src:ze,class:"coverImg"},null,8,KHo),ae("div",{class:"coverImgRemove",onClick:en=>P(jt)},[c(rt,{size:"10"})],8,JHo)]))),128)),ae("div",{class:"coverUploadTrigger",onClick:ie},[ae("input",{ref_key:"visualManualCoverInputRef",ref:x,type:"file",accept:"image/*",multiple:"",style:{display:"none"},onChange:J},null,544),c(Qe,{size:"24"}),ae("span",null,Ee(he.$t("workbench.project.dialog.uploadCover")),1)])])])])]),_:1}),c(ve,{label:he.$t("workbench.project.dialog.directorManualPrompt")},{default:me(()=>[ae("div",_Ho,[ae("div",$Ho,[ae("div",eVo,[c(Rt,{value:de.value,size:"medium",onChange:pe[18]||(pe[18]=ze=>de.value=ze)},{default:me(()=>[(we(!0),Re(Yt,null,hi(ke.value,ze=>(we(),Ot(yt,{key:ze.value,value:ze.value,label:ze.label},{default:me(()=>[c(ge(Jv),{modelValue:ze.data,"onUpdate:modelValue":jt=>ze.data=jt,theme:ge(n).mode,toolbars:p,footers:[],placeholder:he.$t("workbench.project.dialog.promptPlaceholder"),style:{height:"30vh","margin-top":"5px"},onOnUploadImg:()=>{}},null,8,["modelValue","onUpdate:modelValue","theme","placeholder"])]),_:2},1032,["value","label"]))),128))]),_:1},8,["value"])])])])]),_:1},8,["label"])]),_:1})]),_:1},8,["loading"])]),_:1},8,["visible","header","confirm-btn","cancel-btn"]),c(Ke,{modelValue:l.value,"onUpdate:modelValue":pe[20]||(pe[20]=ze=>l.value=ze),images:[a.value],closeOnOverlay:!0},null,8,["modelValue","images"])])}}}),nVo=fr(tVo,[["__scopeId","data-v-4eba8552"]]);function rN(e,t){return`${e??""}:${t??""}`}function iVo(e){if(!e)return"";if(e.startsWith("data:")||e.startsWith("blob:"))return e;try{const t=new URL(e);return t.pathname+t.search+t.hash}catch{return e}}function ZSe(e){return e.map(t=>({...JSON.parse(JSON.stringify(t)),src:iVo(t.src)}))}const w3e=RO("imageListCache",()=>{const e=le({}),t=le({});async function n(p){if(!p.length)return{};const b=p.filter(w=>w.id==null?!1:(rN(w.id,w.sources),!0));if(b.length)try{const{data:w}=await Xt.post("/production/workbench/getFileUrl",{items:b.map(x=>({id:x.id,sources:x.sources}))}),y=w.data,C={};Array.isArray(y)?y.forEach(x=>{if(x.id!=null&&x.url){const L=rN(x.id,x.sources);C[L]=x.url}}):y&&typeof y=="object"&&!Array.isArray(y)&&Object.entries(y).forEach(([x,L])=>{C[x]=L}),t.value={...t.value,...C}}catch(w){console.warn("[imageListCache] resolveUrls 请求失败,降级使用路径",w)}const O={};return p.forEach(w=>{var C;const y=rN(w.id,w.sources);O[y]=t.value[y]||((C=w.id)==null?void 0:C.toString())||""}),O}function r(p,b,O){if(p!=null){const w=rN(p,b);if(t.value[w])return t.value[w]}return O||""}function o(p){return p.map(b=>({...b,src:r(b.id,b.sources,b.src)}))}function s(p,b,O){var y,C;const w=(C=(y=e.value[p])==null?void 0:y[b])==null?void 0:C[O];if(w)return o(w)}async function a(p,b,O){var C,x;const w=(x=(C=e.value[p])==null?void 0:C[b])==null?void 0:x[O];if(!w)return;const y=w.filter(L=>L.id!=null).map(L=>({id:L.id,sources:L.sources}));return await n(y),o(w)}function l(p,b,O){var w,y;return(y=(w=e.value[p])==null?void 0:w[b])==null?void 0:y[O]}function d(p,b,O,w){e.value[p]||(e.value[p]={}),e.value[p][b]||(e.value[p][b]={});let y=!1;w.forEach(C=>{if(!C.src||C.id==null)return;const x=rN(C.id,C.sources);t.value[x]||(t.value[x]=C.src,y=!0)}),y&&(t.value={...t.value}),e.value[p][b][O]=ZSe(w)}function u(p,b,O){var w;(w=e.value[p])!=null&&w[b]&&delete e.value[p][b][O]}function h(p,b,O){var y;const w=(y=e.value[p])==null?void 0:y[b];w&&Object.keys(w).forEach(C=>{w[C]=w[C].filter(x=>x.id!==O)})}function f(p,b){e.value[p]&&delete e.value[p][b]}function g(p){var b;e.value&&((b=e.value)!=null&&b[p])&&delete e.value[p]}function k(p,b,O){O.forEach(w=>{var y,C;w.id!=null&&((C=(y=e.value[p])==null?void 0:y[b])!=null&&C[w.id]||(e.value[p]||(e.value[p]={}),e.value[p][b]||(e.value[p][b]={}),e.value[p][b][w.id]=ZSe(w.medias)))})}function A(p,b,O){e.value[p]&&delete e.value[p][b],e.value[p]||(e.value[p]={}),e.value[p][b]={},O.forEach(w=>{w.id!=null&&(e.value[p][b][w.id]=ZSe(w.medias))})}async function m(p,b){var C;const O=(C=e.value[p])==null?void 0:C[b];if(!O)return;const w=[],y=new Set;Object.values(O).forEach(x=>{x.forEach(L=>{if(L.id==null)return;const S=rN(L.id,L.sources);y.has(S)||(y.add(S),w.push({id:L.id,sources:L.sources}))})}),await n(w)}function v(){t.value={}}return{cacheData:e,urlMap:t,getCache:s,getCacheWithResolve:a,getRawCache:l,setCache:d,removeCache:u,removeImageById:h,clearScriptCache:f,initCacheFromTrackList:k,forceInitCacheFromTrackList:A,resolveUrls:n,resolveUrlSync:r,warmUpUrls:m,clearUrlMap:v,clearProjectCache:g}},{persist:{pick:["cacheData"]}}),rVo={class:"project"},oVo={class:"header"},sVo={class:"fc"},aVo={class:"title"},lVo={class:"sub"},cVo={class:"list"},dVo={class:"jb ac"},uVo={class:"title"},hVo={class:"intro"},AVo={class:"bottomMenu f ac jb"},fVo={class:"time"},gVo={class:"actionBtns f ac"},mVo=["onClick"],kVo=["onClick"],vVo=qe({__name:"index",setup(e){const{clearProjectCache:t}=w3e(),{allProject:n,project:r}=Br(Ad()),o=le(!1),s=le(null);async function a(){Xt.post("/project/getProject").then(({data:k})=>{n.value=k})}vn(()=>{r.value=null,a()});const l=Y4e();async function d(k){const A=n.value.find(m=>m.id===k);if(!A)return window.$message.error($t("workbench.project.msg.notFound"));if(!A.imageModel||!A.videoModel)return window.$message.warning($t("workbench.project.msg.modelProviderDisabled")),u(A);try{A.imageModel&&await Xt.post("/modelSelect/getModelDetail",{modelId:A.imageModel}),A.videoModel&&await Xt.post("/modelSelect/getModelDetail",{modelId:A.videoModel})}catch{return window.$message.warning($t("workbench.project.msg.modelProviderDisabled")),u(A)}r.value=A,A.projectType==="novel"?l.push("/novel"):A.projectType==="script"&&l.push("/script")}function u(k){s.value={...k},o.value=!0}function h(k){Xt.post("/project/editProject",k).then(()=>{window.$message.success($t("workbench.project.msg.editSuccess")),a()}).catch(A=>{window.$message.error(A.message??$t("workbench.project.msg.editFailed"))})}function f(k){Xt.post("/project/addProject",k).then(()=>{window.$message.success($t("workbench.project.msg.addSuccess")),a()}).catch(A=>{window.$message.error(A.message??$t("workbench.project.msg.addFailed"))})}function g(k){const A=Kr.confirm({header:$t("workbench.project.msg.deleteHeader"),body:$t("workbench.project.msg.deleteBody"),confirmBtn:$t("workbench.project.msg.deleteConfirm"),cancelBtn:$t("workbench.project.msg.deleteCancel"),onConfirm:()=>{Xt.post("/project/delProject",{id:k}).then(()=>{t(k),window.$message.success($t("workbench.project.msg.deleteSuccess")),a()}).catch(m=>{window.$message.error(m.message??$t("workbench.project.msg.deleteFailed"))}).finally(()=>{A.destroy()})}})}return(k,A)=>{const m=dn("i-plus"),v=fi,p=Gd,b=dn("i-edit"),O=dn("i-delete"),w=yh;return we(),Re(Yt,null,[ae("div",rVo,[ae("div",oVo,[ae("div",sVo,[ae("span",aVo,Ee(k.$t("workbench.project.title")),1),ae("span",lVo,Ee(k.$t("workbench.project.subtitle")),1)]),c(v,{class:"addBtn",onClick:A[0]||(A[0]=y=>{s.value=null,o.value=!0})},{icon:me(()=>[c(m,{class:"addIcon",size:20})]),default:me(()=>[ft(" "+Ee(k.$t("workbench.project.newProject")),1)]),_:1})]),ae("div",cVo,[(we(!0),Re(Yt,null,hi(ge(n),y=>(we(),Ot(w,{hoverShadow:"",class:"card",key:y.id,onClick:C=>d(y.id)},{default:me(()=>[ae("div",dVo,[ae("div",uVo,Ee(y.name),1),ae("div",null,[c(p,{shape:"round"},{default:me(()=>[ft(Ee(y.projectType=="novel"?k.$t("workbench.project.type.novel"):k.$t("workbench.project.type.script")),1)]),_:2},1024)])]),y.artStyle?(we(),Ot(p,{key:0,shape:"round",style:{"align-self":"flex-start"}},{default:me(()=>[ft(Ee(y.artStyle),1)]),_:2},1024)):Ft("",!0),ae("div",hVo,Ee(y.intro),1),ae("div",AVo,[ae("div",fVo,[ae("span",null,Ee(ge(Z5)(y==null?void 0:y.createTime).format("YYYY-MM-DD HH:mm:ss")),1)]),ae("div",gVo,[ae("div",{class:"editBtn",onClick:Mi(C=>u(y),["stop"])},[c(b,{size:18})],8,mVo),ae("div",{class:"removeBtn",onClick:Mi(C=>g(y.id),["stop"])},[c(O,{size:18})],8,kVo)])])]),_:2},1032,["onClick"]))),128))])]),c(nVo,{modelValue:ge(o),"onUpdate:modelValue":A[1]||(A[1]=y=>yn(o)?o.value=y:null),projectData:ge(s),onAdd:f,onEdit:h},null,8,["modelValue","projectData"])],64)}}}),pVo=fr(vVo,[["__scopeId","data-v-01b7e152"]]),bVo=Object.freeze(Object.defineProperty({__proto__:null,default:pVo},Symbol.toStringTag,{value:"Module"})),OVo={class:"task"},wVo={class:"header"},yVo={class:"headerInfo fc"},CVo={class:"title"},xVo={class:"sub"},LVo={class:"list"},SVo={class:"search f"},TVo={class:"content"},EVo={class:"stateText stateFail"},DVo=qe({__name:"index",setup(e){const{project:t}=Br(Ad()),n=[{colKey:"taskClass",title:$t("workbench.task.col.taskClass"),width:120,ellipsis:!0},{colKey:"relatedObjects",title:$t("workbench.task.col.relatedObjects"),width:120,ellipsis:!0},{colKey:"model",title:$t("workbench.task.col.model"),width:280,ellipsis:!0},{colKey:"describe",title:$t("workbench.task.col.describe"),ellipsis:!0},{colKey:"reason",title:$t("workbench.task.col.reason"),ellipsis:!0},{colKey:"state",title:$t("workbench.task.col.state"),width:100,cell:"state"},{colKey:"startTime",title:$t("workbench.task.col.startTime"),width:200,cell:"startTime"}],r=[{label:$t("workbench.task.stateAll"),value:""},{label:$t("workbench.task.stateRunning"),value:"进行中"},{label:$t("workbench.task.stateCompleted"),value:"已完成"},{label:$t("workbench.task.stateFailed"),value:"生成失败"}],o=le({page:1,limit:10,total:0,loading:!1}),s=le([]),a=le([]),l=le(""),d=le(""),u=le(""),h=le([]);vn(()=>{A(),g(),k()});function f(){o.value.page=1,A()}async function g(){const{data:m}=await Xt.post("/task/getTaskCategories").catch(()=>({data:[]}));s.value=[{label:$t("workbench.task.stateAll"),value:""},...m.map(v=>({label:v.taskClass,value:v.taskClass}))]}async function k(){const{data:m}=await Xt.post("/task/getProject").catch(()=>({data:[]}));a.value=[{label:$t("workbench.task.stateAll"),value:""},...m.map(v=>({label:v.name,value:v.id}))]}async function A(){var m;o.value.loading=!0;try{const{data:v}=await Xt.post("/task/getTaskApi",{page:o.value.page,limit:o.value.limit,taskClass:l.value,state:d.value,projectId:u.value||((m=t.value)==null?void 0:m.id)});h.value=v.data,o.value.total=v.total}catch{window.$message.error($t("workbench.task.fetchFailed"))}finally{o.value.loading=!1}}return(m,v)=>{const p=dn("i-redo"),b=fi,O=Em,w=Va,y=y6,C=k3n;return we(),Re("div",OVo,[ae("div",wVo,[ae("div",yVo,[ae("span",CVo,Ee(m.$t("workbench.task.title")),1),ae("span",xVo,Ee(m.$t("workbench.task.subtitle")),1)]),c(b,{onClick:A},{icon:me(()=>[c(p,{size:20})]),default:me(()=>[ft(" "+Ee(m.$t("workbench.task.refresh")),1)]),_:1})]),ae("div",LVo,[ae("div",SVo,[c(O,{label:m.$t("workbench.task.project"),modelValue:ge(u),"onUpdate:modelValue":v[0]||(v[0]=x=>yn(u)?u.value=x:null),options:ge(a),onChange:f},null,8,["label","modelValue","options"]),c(O,{label:m.$t("workbench.task.categoryLabel"),modelValue:ge(l),"onUpdate:modelValue":v[1]||(v[1]=x=>yn(l)?l.value=x:null),options:ge(s),onChange:f,style:{"margin-left":"20px"}},null,8,["label","modelValue","options"]),c(O,{label:m.$t("workbench.task.stateLabel"),modelValue:ge(d),"onUpdate:modelValue":v[2]||(v[2]=x=>yn(d)?d.value=x:null),options:r,onChange:f,style:{"margin-left":"20px"}},null,8,["label","modelValue"])]),ae("div",TVo,[c(y,{data:ge(h),columns:n,"row-key":"id",loading:ge(o).loading,hover:"",stripe:""},{state:me(({row:x})=>[x.state==="生成失败"?(we(),Ot(w,{key:0,content:x.reason||m.$t("workbench.task.noFailReason"),placement:"top"},{default:me(()=>[ae("span",EVo,Ee(x.state),1)]),_:2},1032,["content"])):(we(),Re("span",{key:1,class:no(["stateText",x.state==="进行中"?"stateRunning":"stateSuccess"])},Ee(x.state),3))]),startTime:me(({row:x})=>[ae("span",null,Ee(ge(Z5)(x.startTime).format("YYYY-MM-DD HH:mm:ss")),1)]),_:1},8,["data","loading"]),c(C,{class:"paginationWrap",current:ge(o).page,"onUpdate:current":v[3]||(v[3]=x=>ge(o).page=x),pageSize:ge(o).limit,"onUpdate:pageSize":v[4]||(v[4]=x=>ge(o).limit=x),"show-sizer":"",total:ge(o).total,onPageSizeChange:A,onCurrentChange:A},null,8,["current","pageSize","total"])])])])}}}),QVo=fr(DVo,[["__scopeId","data-v-7d93af9d"]]),BVo=Object.freeze(Object.defineProperty({__proto__:null,default:QVo},Symbol.toStringTag,{value:"Module"})),Jce=/^(第[\d一二三四五六七八九十百千]+卷)\s*([^\n第]*)/gm,FVo=/第\s*([0-90-9零一二三四五六七八九十百千万]+)\s*[章回节]\s*([^\n\r]*)/g,YSe={零:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9},t6t={十:10,百:100,千:1e3};function XSe(e){if(/^\d+$/.test(e))return parseInt(e,10);if(/^十[一二三四五六七八九]?$/.test(e))return e.length===1?10:10+YSe[e[1]];let t=0,n=0;for(const r of e)YSe[r]!==void 0?n=YSe[r]:t6t[r]!==void 0&&(n===0&&r==="十"&&(n=1),t+=n*t6t[r],n=0);return t+=n,t}function PVo(e){var l;Jce.lastIndex=0;const t=Array.from(e.matchAll(Jce)),n=[];let r;const o=qs().otherSetting.chapterReg;if(o){const d=o.match(/^\/(.*)\/([igmuy]*)$/);d?r=new RegExp(d[1],d[2]):r=new RegExp(o)}else r=FVo;if(t.length===0){const d=[];r.lastIndex=0;const u=Array.from(e.matchAll(r));if(u.length===0&&e.trim()!=="")d.push({index:1,chapter:"",text:e.trim()});else for(let h=0;hh.index-f.index),n.push({index:1,reel:"正文卷",chapters:d}),n}const s=new Map;for(let d=0;dp.index-b.index),s.has(g)||s.set(g,{index:XSe(f.replace(/第|卷/g,"")),reel:g,chapters:[]}),s.get(g).chapters.push(...v)}const a=Array.from(s.values()).sort((d,u)=>d.index-u.index);return a.forEach(d=>d.chapters.sort((u,h)=>u.index-h.index)),a}var T2={},srt="1.13.8",n6t=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},y3e=Array.prototype,art=Object.prototype,i6t=typeof Symbol<"u"?Symbol.prototype:null,MVo=y3e.push,Sre=y3e.slice,qee=art.toString,RVo=art.hasOwnProperty,yNn=typeof ArrayBuffer<"u",IVo=typeof DataView<"u",NVo=Array.isArray,r6t=Object.keys,o6t=Object.create,s6t=yNn&&ArrayBuffer.isView,UVo=isNaN,jVo=isFinite,CNn=!{toString:null}.propertyIsEnumerable("toString"),a6t=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],WVo=Math.pow(2,53)-1;function X1(e,t){return t=t==null?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),o=0;o=0&&n<=WVo}}function MNn(e){return function(t){return t==null?void 0:t[e]}}const eke=MNn("byteLength"),ZVo=PNn(eke);var YVo=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function XVo(e){return s6t?s6t(e)&&!Gee(e):ZVo(e)&&YVo.test(qee.call(e))}const mrt=yNn?XVo:grt(!1),Om=MNn("length");function qVo(e){for(var t={},n=e.length,r=0;r=0))if(r.push(e),o.push(t),n.push(!0),d){if(g=e.length,g!==t.length)return!1;for(;g--;)n.push({a:e[g],b:t[g]})}else{var k=WA(e),A;if(g=k.length,WA(t).length!==g)return!1;for(;g--;){if(A=k[g],!DE(t,A))return!1;n.push({a:e[A],b:t[A]})}}}return!0}function QZ(e){if(!TE(e))return[];var t=[];for(var n in e)t.push(n);return CNn&&RNn(e,t),t}function vrt(e){var t=Om(e);return function(n){if(n==null)return!1;var r=QZ(n);if(Om(r))return!1;for(var o=0;o":">",'"':""","'":"'","`":"`"},rUn=nUn(iUn),_Vo=Ort(iUn),oUn=nUn(_Vo),sUn=rc.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var qSe=/(.)^/,$Vo={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},ezo=/\\|'|\r|\n|\u2028|\u2029/g;function tzo(e){return"\\"+$Vo[e]}var nzo=/^\s*(\w|\$)+\s*$/;function aUn(e,t,n){!t&&n&&(t=n),t=Crt({},t,rc.templateSettings);var r=RegExp([(t.escape||qSe).source,(t.interpolate||qSe).source,(t.evaluate||qSe).source].join("|")+"|$","g"),o=0,s="__p+='";e.replace(r,function(u,h,f,g,k){return s+=e.slice(o,k).replace(ezo,tzo),o=k+u.length,h?s+=`'+ ((__t=(`+h+`))==null?'':_.escape(__t))+ '`:f?s+=`'+ ((__t=(`+f+`))==null?'':__t)+ '`:g&&(s+=`'; `+g+` __p+='`),u}),s+=`'; `;var a=t.variable;if(a){if(!nzo.test(a))throw new Error("variable is not a bare identifier: "+a)}else s=`with(obj||{}){ `+s+`} `,a="obj";s=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');}; `+s+`return __p; `;var l;try{l=new Function(a,"_",s)}catch(u){throw u.source=s,u}var d=function(u){return l.call(this,u,rc)};return d.source="function("+a+`){ `+s+"}",d}function lUn(e,t,n){t=Tre(t);var r=t.length;if(!r)return Tm(n)?n.call(e):n;for(var o=0;o=a){if(!l.length)break;var d=l.pop();s=d.i,e=d.v,a=Om(e);continue}var u=e[s++];l.length>=t?r[o++]=u:E2(u)&&(EE(u)||x3e(u))?(l.push({i:s,v:e}),s=0,e=u,a=Om(e)):n||(r[o++]=u)}return r}const hUn=X1(function(e,t){t=BZ(t,!1,!1);var n=t.length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=Ert(e[r],e)}return e});function AUn(e,t){var n=function(r){var o=n.cache,s=""+(t?t.apply(this,arguments):r);return DE(o,s)||(o[s]=e.apply(this,arguments)),o[s]};return n.cache={},n}const Drt=X1(function(e,t,n){return setTimeout(function(){return e.apply(null,n)},t)}),fUn=tR(Drt,rc,1);function gUn(e,t,n){var r,o,s,a,l=0;n||(n={});var d=function(){l=n.leading===!1?0:_V(),r=null,a=e.apply(o,s),r||(o=s=null)},u=function(){var h=_V();!l&&n.leading===!1&&(l=h);var f=t-(h-l);return o=this,s=arguments,f<=0||f>t?(r&&(clearTimeout(r),r=null),l=h,a=e.apply(o,s),r||(o=s=null)):!r&&n.trailing!==!1&&(r=setTimeout(d,f)),a};return u.cancel=function(){clearTimeout(r),l=0,r=o=s=null},u}function mUn(e,t,n){var r,o,s,a,l,d=function(){var h=_V()-o;t>h?r=setTimeout(d,t-h):(r=null,n||(a=e.apply(l,s)),r||(s=l=null))},u=X1(function(h){return l=this,s=h,o=_V(),r||(r=setTimeout(d,t),n&&(a=e.apply(l,s))),a});return u.cancel=function(){clearTimeout(r),r=s=l=null},u}function kUn(e,t){return tR(t,e)}function E3e(e){return function(){return!e.apply(this,arguments)}}function vUn(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}}function pUn(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function Qrt(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}const bUn=tR(Qrt,2);function Brt(e,t,n){t=Qk(t,n);for(var r=WA(e),o,s=0,a=r.length;s0?0:o-1;s>=0&&s0?a=s>=0?s:Math.max(s+l,a):l=s>=0?Math.min(s+1,l):s+l+1;else if(n&&s&&l)return s=n(r,o),r[s]===o?s:-1;if(o!==o)return s=t(Sre.call(r,a,l),frt),s>=0?s+a:-1;for(s=e>0?a:l-1;s>=0&&s0?0:l-1;for(s||(o=n[a?a[d]:d],d+=e);d>=0&&d=3;return t(n,Ere(r,s,4),o,a)}}const bW=xUn(1),nke=xUn(-1);function KT(e,t,n){var r=[];return t=Qk(t,n),BO(e,function(o,s,a){t(o,s,a)&&r.push(o)}),r}function LUn(e,t,n){return KT(e,E3e(Qk(t)),n)}function ike(e,t,n){t=Qk(t,n);for(var r=!E2(e)&&WA(e),o=(r||e).length,s=0;s=0}const SUn=X1(function(e,t,n){var r,o;return Tm(t)?o=t:(t=Tre(t),r=t.slice(0,-1),t=t[t.length-1]),a6(e,function(s){var a=o;if(!a){if(r&&r.length&&(s=Lrt(s,r)),s==null)return;a=s[t]}return a==null?a:a.apply(s,n)})});function Q3e(e,t){return a6(e,S3e(t))}function TUn(e,t){return KT(e,KP(t))}function Rrt(e,t,n){var r=-1/0,o=-1/0,s,a;if(t==null||typeof t=="number"&&typeof e[0]!="object"&&e!=null){e=E2(e)?e:eR(e);for(var l=0,d=e.length;lr&&(r=s)}else t=Qk(t,n),BO(e,function(u,h,f){a=t(u,h,f),(a>o||a===-1/0&&r===-1/0)&&(r=u,o=a)});return r}function EUn(e,t,n){var r=1/0,o=1/0,s,a;if(t==null||typeof t=="number"&&typeof e[0]!="object"&&e!=null){e=E2(e)?e:eR(e);for(var l=0,d=e.length;ll||a===void 0)return 1;if(a1&&(r=Ere(r,t[1])),t=QZ(e)):(r=ozo,t=BZ(t,!1,!1),e=Object(e));for(var o=0,s=t.length;o1&&(r=t[1])):(t=a6(BZ(t,!1,!1),String),n=function(o,s){return!n4(t,s)}),Urt(e,n,r)});function jrt(e,t,n){return Sre.call(e,0,Math.max(0,e.length-(t==null||n?1:t)))}function OW(e,t,n){return e==null||e.length<1?t==null||n?void 0:[]:t==null||n?e[0]:jrt(e,e.length-t)}function IB(e,t,n){return Sre.call(e,t==null||n?1:t)}function NUn(e,t,n){return e==null||e.length<1?t==null||n?void 0:[]:t==null||n?e[e.length-1]:IB(e,Math.max(0,e.length-t))}function UUn(e){return KT(e,Boolean)}function jUn(e,t){return BZ(e,t,!1)}const Wrt=X1(function(e,t){return t=BZ(t,!0,!0),KT(e,function(n){return!n4(t,n)})}),WUn=X1(function(e,t){return Wrt(e,t)});function _ee(e,t,n,r){crt(t)||(r=n,n=t,t=!1),n!=null&&(n=Qk(n,r));for(var o=[],s=[],a=0,l=Om(e);a"u",r={e:{}},o,s=typeof self<"u"?self:typeof window<"u"?window:typeof Xo<"u"||Xo!==void 0?Xo:null;function a(){try{var Z=o;return o=null,Z.apply(this,arguments)}catch(K){return r.e=K,r}}function l(Z){return o=Z,a}var d=function(Z,K){var X={}.hasOwnProperty;function ee(){this.constructor=Z,this.constructor$=K;for(var q in K.prototype)X.call(K.prototype,q)&&q.charAt(q.length-1)!=="$"&&(this[q+"$"]=K.prototype[q])}return ee.prototype=K.prototype,Z.prototype=new ee,Z.prototype};function u(Z){return Z==null||Z===!0||Z===!1||typeof Z=="string"||typeof Z=="number"}function h(Z){return typeof Z=="function"||typeof Z=="object"&&Z!==null}function f(Z){return u(Z)?new Error(x(Z)):Z}function g(Z,K){var X=Z.length,ee=new Array(X+1),q;for(q=0;q1,ee=K.length>0&&!(K.length===1&&K[0]==="constructor"),q=p.test(Z+"")&&t.names(Z).length>0;if(X||ee||q)return!0}return!1}catch{return!1}}function O(Z){return Z}var w=/^[a-z$_][a-z$_0-9]*$/i;function y(Z){return w.test(Z)}function C(Z,K,X){for(var ee=new Array(Z),q=0;q10||Z[0]>0}(),V.isNode&&V.toFastProperties(process);try{throw new Error}catch(Z){V.lastLineError=Z}return GSe=V,GSe}var $ce={exports:{}},KSe,h6t;function lzo(){if(h6t)return KSe;h6t=1;var e=hd(),t,n=function(){throw new Error(`No async scheduler available See http://goo.gl/MqrFmX `)},r=e.getNativePromise();if(e.isNode&&typeof MutationObserver>"u"){var o=Xo.setImmediate,s=process.nextTick;t=e.isRecentNode?function(l){o.call(Xo,l)}:function(l){s.call(process,l)}}else if(typeof r=="function"&&typeof r.resolve=="function"){var a=r.resolve();t=function(l){a.then(l)}}else typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova))?t=function(){var l=document.createElement("div"),d={attributes:!0},u=!1,h=document.createElement("div"),f=new MutationObserver(function(){l.classList.toggle("foo"),u=!1});f.observe(h,d);var g=function(){u||(u=!0,h.classList.toggle("foo"))};return function(A){var m=new MutationObserver(function(){m.disconnect(),A()});m.observe(l,d),g()}}():typeof setImmediate<"u"?t=function(l){setImmediate(l)}:typeof setTimeout<"u"?t=function(l){setTimeout(l,0)}:t=n;return KSe=t,KSe}var JSe,A6t;function czo(){if(A6t)return JSe;A6t=1;function e(n,r,o,s,a){for(var l=0;l0;){var u=d.shift();if(typeof u!="function"){u._settlePromises();continue}var h=d.shift(),f=d.shift();u.call(h,f)}},o.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},o.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},o.prototype._reset=function(){this._isTickUsed=!1},$ce.exports=o,$ce.exports.firstLineError=e,$ce.exports}var _Se,g6t;function JT(){if(g6t)return _Se;g6t=1;var e=FZ(),t=e.freeze,n=hd(),r=n.inherits,o=n.notEnumerableProp;function s(p,b){function O(w){if(!(this instanceof O))return new O(w);o(this,"message",typeof w=="string"?w:b),o(this,"name",p),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return r(O,Error),O}var a,l,d=s("Warning","warning"),u=s("CancellationError","cancellation error"),h=s("TimeoutError","timeout error"),f=s("AggregateError","aggregate error");try{a=TypeError,l=RangeError}catch{a=s("TypeError","type error"),l=s("RangeError","range error")}for(var g="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),k=0;k=this._length?(this._resolve(this._values),!0):!1},l.prototype._promiseCancelled=function(){return this._cancel(),!0},l.prototype._promiseRejected=function(d){return this._totalResolved++,this._reject(d),!0},l.prototype._resultCancelled=function(){if(!this._isResolved()){var d=this._values;if(this._cancel(),d instanceof e)d.cancel();else for(var u=0;u=0)return n[a]}return r.CapturedTrace=null,r.create=o,r.deactivateLongStackTraces=function(){},r.activateLongStackTraces=function(){var a=e.prototype._pushContext,l=e.prototype._popContext,d=e._peekContext,u=e.prototype._peekContext,h=e.prototype._promiseCreated;r.deactivateLongStackTraces=function(){e.prototype._pushContext=a,e.prototype._popContext=l,e._peekContext=d,e.prototype._peekContext=u,e.prototype._promiseCreated=h,t=!1},t=!0,e.prototype._pushContext=r.prototype._pushContext,e.prototype._popContext=r.prototype._popContext,e._peekContext=e.prototype._peekContext=s,e.prototype._promiseCreated=function(){var f=this._peekContext();f&&f._promiseCreated==null&&(f._promiseCreated=this)}},r}),t5e}var n5e,p6t;function fzo(){return p6t||(p6t=1,n5e=function(e,t){var n=e._getDomain,r=e._async,o=JT().Warning,s=hd(),a=s.canAttachTrace,l,d,u=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,h=/\((?:timers\.js):\d+:\d+\)/,f=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,g=null,k=null,A=!1,m,v=!!(s.env("BLUEBIRD_DEBUG")!=0&&(s.env("BLUEBIRD_DEBUG")||s.env("NODE_ENV")==="development")),p=!!(s.env("BLUEBIRD_WARNINGS")!=0&&(v||s.env("BLUEBIRD_WARNINGS"))),b=!!(s.env("BLUEBIRD_LONG_STACK_TRACES")!=0&&(v||s.env("BLUEBIRD_LONG_STACK_TRACES"))),O=s.env("BLUEBIRD_W_FORGOTTEN_RETURN")!=0&&(p||!!s.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var ve=this._target();ve._bitField=ve._bitField&-1048577|524288},e.prototype._ensurePossibleRejectionHandled=function(){this._bitField&524288||(this._setRejectionIsUnhandled(),r.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){ne("rejectionHandled",l,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=this._bitField|268435456},e.prototype._returnedNonUndefined=function(){return(this._bitField&268435456)!==0},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var ve=this._settledValue();this._setUnhandledRejectionIsNotified(),ne("unhandledRejection",d,ve,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=this._bitField|262144},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},e.prototype._isUnhandledRejectionNotified=function(){return(this._bitField&262144)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=this._bitField|1048576},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(this._bitField&1048576)>0},e.prototype._warn=function(ve,ue,be){return K(ve,ue,be||this)},e.onPossiblyUnhandledRejection=function(ve){var ue=n();d=typeof ve=="function"?ue===null?ve:s.domainBind(ue,ve):void 0},e.onUnhandledRejectionHandled=function(ve){var ue=n();l=typeof ve=="function"?ue===null?ve:s.domainBind(ue,ve):void 0};var w=function(){};e.longStackTraces=function(){if(r.haveItemsQueued()&&!Be.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created See http://goo.gl/MqrFmX `);if(!Be.longStackTraces&&re()){var ve=e.prototype._captureStackTrace,ue=e.prototype._attachExtraTrace;Be.longStackTraces=!0,w=function(){if(r.haveItemsQueued()&&!Be.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created See http://goo.gl/MqrFmX `);e.prototype._captureStackTrace=ve,e.prototype._attachExtraTrace=ue,t.deactivateLongStackTraces(),r.enableTrampoline(),Be.longStackTraces=!1},e.prototype._captureStackTrace=W,e.prototype._attachExtraTrace=H,t.activateLongStackTraces(),r.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return Be.longStackTraces&&re()};var y=function(){try{if(typeof CustomEvent=="function"){var ve=new CustomEvent("CustomEvent");return s.global.dispatchEvent(ve),function(ue,be){var xe=new CustomEvent(ue.toLowerCase(),{detail:be,cancelable:!0});return!s.global.dispatchEvent(xe)}}else if(typeof Event=="function"){var ve=new Event("CustomEvent");return s.global.dispatchEvent(ve),function(be,xe){var Qe=new Event(be.toLowerCase(),{cancelable:!0});return Qe.detail=xe,!s.global.dispatchEvent(Qe)}}else{var ve=document.createEvent("CustomEvent");return ve.initCustomEvent("testingtheevent",!1,!0,{}),s.global.dispatchEvent(ve),function(be,xe){var Qe=document.createEvent("CustomEvent");return Qe.initCustomEvent(be.toLowerCase(),!1,!0,xe),!s.global.dispatchEvent(Qe)}}}catch{}return function(){return!1}}(),C=function(){return s.isNode?function(){return process.emit.apply(process,arguments)}:s.global?function(ve){var ue="on"+ve.toLowerCase(),be=s.global[ue];return be?(be.apply(s.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}();function x(ve,ue){return{promise:ue}}var L={promiseCreated:x,promiseFulfilled:x,promiseRejected:x,promiseResolved:x,promiseCancelled:x,promiseChained:function(ve,ue,be){return{promise:ue,child:be}},warning:function(ve,ue){return{warning:ue}},unhandledRejection:function(ve,ue,be){return{reason:ue,promise:be}},rejectionHandled:x},S=function(ve){var ue=!1;try{ue=C.apply(null,arguments)}catch(xe){r.throwLater(xe),ue=!0}var be=!1;try{be=y(ve,L[ve].apply(null,arguments))}catch(xe){r.throwLater(xe),be=!0}return be||ue};e.config=function(ve){if(ve=Object(ve),"longStackTraces"in ve&&(ve.longStackTraces?e.longStackTraces():!ve.longStackTraces&&e.hasLongStackTraces()&&w()),"warnings"in ve){var ue=ve.warnings;Be.warnings=!!ue,O=Be.warnings,s.isObject(ue)&&"wForgottenReturn"in ue&&(O=!!ue.wForgottenReturn)}if("cancellation"in ve&&ve.cancellation&&!Be.cancellation){if(r.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=P,e.prototype._propagateFrom=F,e.prototype._onCancel=M,e.prototype._setOnCancel=B,e.prototype._attachCancellationCallback=T,e.prototype._execute=Q,N=F,Be.cancellation=!0}return"monitoring"in ve&&(ve.monitoring&&!Be.monitoring?(Be.monitoring=!0,e.prototype._fireEvent=S):!ve.monitoring&&Be.monitoring&&(Be.monitoring=!1,e.prototype._fireEvent=E)),e};function E(){return!1}e.prototype._fireEvent=E,e.prototype._execute=function(ve,ue,be){try{ve(ue,be)}catch(xe){return xe}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(ve){},e.prototype._attachCancellationCallback=function(ve){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(ve,ue){};function Q(ve,ue,be){var xe=this;try{ve(ue,be,function(Qe){if(typeof Qe!="function")throw new TypeError("onCancel must be a function, got: "+s.toString(Qe));xe._attachCancellationCallback(Qe)})}catch(Qe){return Qe}}function T(ve){if(!this._isCancellable())return this;var ue=this._onCancel();ue!==void 0?s.isArray(ue)?ue.push(ve):this._setOnCancel([ue,ve]):this._setOnCancel(ve)}function M(){return this._onCancelField}function B(ve){this._onCancelField=ve}function P(){this._cancellationParent=void 0,this._onCancelField=void 0}function F(ve,ue){if(ue&1){this._cancellationParent=ve;var be=ve._branchesRemainingToCancel;be===void 0&&(be=0),ve._branchesRemainingToCancel=be+1}ue&2&&ve._isBound()&&this._setBoundTo(ve._boundTo)}function R(ve,ue){ue&2&&ve._isBound()&&this._setBoundTo(ve._boundTo)}var N=R;function I(){var ve=this._boundTo;return ve!==void 0&&ve instanceof e?ve.isFulfilled()?ve.value():void 0:ve}function W(){this._trace=new pe(this._peekContext())}function H(ve,ue){if(a(ve)){var be=this._trace;if(be!==void 0&&ue&&(be=be._parent),be!==void 0)be.attachExtraTrace(ve);else if(!ve.__stackCleaned__){var xe=de(ve);s.notEnumerableProp(ve,"stack",xe.message+` `+xe.stack.join(` `)),s.notEnumerableProp(ve,"__stackCleaned__",!0)}}}function V(ve,ue,be,xe,Qe){if(ve===void 0&&ue!==null&&O){if(Qe!==void 0&&Qe._returnedNonUndefined()||!(xe._bitField&65535))return;be&&(be=be+" ");var Fe="",Ge="";if(ue._trace){for(var Xe=ue._trace.stack.split(` `),$e=$(Xe),vt=$e.length-1;vt>=0;--vt){var mt=$e[vt];if(!h.test(mt)){var rt=mt.match(f);rt&&(Fe="at "+rt[1]+":"+rt[2]+":"+rt[3]+" ");break}}if($e.length>0){for(var yt=$e[0],vt=0;vt0&&(Ge=` `+Xe[vt-1]);break}}}var Rt="a promise was created in a "+be+"handler "+Fe+"but was not returned from it, see http://goo.gl/rRqMUw"+Ge;xe._warn(Rt,!0,ue)}}function Z(ve,ue){var be=ve+" is deprecated and will be removed in a future version.";return ue&&(be+=" Use "+ue+" instead."),K(be)}function K(ve,ue,be){if(Be.warnings){var xe=new o(ve),Qe;if(ue)be._attachExtraTrace(xe);else if(Be.longStackTraces&&(Qe=e._peekContext()))Qe.attachExtraTrace(xe);else{var Fe=de(xe);xe.stack=Fe.message+` `+Fe.stack.join(` `)}S("warning",xe)||ke(xe,"",!0)}}function X(ve,ue){for(var be=0;be=0;--Xe)if(xe[Xe]===Fe){Ge=Xe;break}for(var Xe=Ge;Xe>=0;--Xe){var $e=xe[Xe];if(ue[Qe]===$e)ue.pop(),Qe--;else break}ue=xe}}function $(ve){for(var ue=[],be=0;be0&&ve.name!="SyntaxError"&&(ue=ue.slice(be)),ue}function de(ve){var ue=ve.stack,be=ve.toString();return ue=typeof ue=="string"&&ue.length>0?oe(ve):[" (No stack trace)"],{message:be,stack:ve.name=="SyntaxError"?ue:$(ue)}}function ke(ve,ue,be){if(typeof console<"u"){var xe;if(s.isObject(ve)){var Qe=ve.stack;xe=ue+k(Qe,ve)}else xe=ue+String(ve);typeof m=="function"?m(xe,be):(typeof console.log=="function"||typeof console.log=="object")&&console.log(xe)}}function ne(ve,ue,be,xe){var Qe=!1;try{typeof ue=="function"&&(Qe=!0,ve==="rejectionHandled"?ue(xe):ue(be,xe))}catch(Fe){r.throwLater(Fe)}ve==="unhandledRejection"?!S(ve,be,xe)&&!Qe&&ke(be,"Unhandled rejection "):S(ve,xe)}function Ae(ve){var ue;if(typeof ve=="function")ue="[function "+(ve.name||"anonymous")+"]";else{ue=ve&&typeof ve.toString=="function"?ve.toString():s.toString(ve);var be=/\[object [a-zA-Z0-9$_]+\]/;if(be.test(ue))try{var xe=JSON.stringify(ve);ue=xe}catch{}ue.length===0&&(ue="(empty array)")}return"(<"+Y(ue)+">, no stack trace)"}function Y(ve){var ue=41;return ve.length=Fe||(ce=function(mt){if(u.test(mt))return!0;var rt=J(mt);return!!(rt&&rt.fileName===Ge&&Qe<=rt.line&&rt.line<=Fe)})}}function pe(ve){this._parent=ve,this._promisesCreated=0;var ue=this._length=1+(ve===void 0?0:ve._length);Le(this,pe),ue>32&&this.uncycle()}s.inherits(pe,Error),t.CapturedTrace=pe,pe.prototype.uncycle=function(){var ve=this._length;if(!(ve<2)){for(var ue=[],be={},xe=0,Qe=this;Qe!==void 0;++xe)ue.push(Qe),Qe=Qe._parent;ve=this._length=xe;for(var xe=ve-1;xe>=0;--xe){var Fe=ue[xe].stack;be[Fe]===void 0&&(be[Fe]=xe)}for(var xe=0;xe0&&(ue[Xe-1]._parent=void 0,ue[Xe-1]._length=1),ue[xe]._parent=void 0,ue[xe]._length=1;var $e=xe>0?ue[xe-1]:this;Xe=0;--mt)ue[mt]._length=vt,vt++;return}}}},pe.prototype.attachExtraTrace=function(ve){if(!ve.__stackCleaned__){this.uncycle();for(var ue=de(ve),be=ue.message,xe=[ue.stack],Qe=this;Qe!==void 0;)xe.push($(Qe.stack.split(` `))),Qe=Qe._parent;q(xe),ee(xe),s.notEnumerableProp(ve,"stack",X(be,xe)),s.notEnumerableProp(ve,"__stackCleaned__",!0)}};var Le=function(){var ue=/^\s*at\s*/,be=function(Ge,Xe){return typeof Ge=="string"?Ge:Xe.name!==void 0&&Xe.message!==void 0?Xe.toString():Ae(Xe)};if(typeof Error.stackTraceLimit=="number"&&typeof Error.captureStackTrace=="function"){Error.stackTraceLimit+=6,g=ue,k=be;var xe=Error.captureStackTrace;return ce=function(Ge){return u.test(Ge)},function(Ge,Xe){Error.stackTraceLimit+=6,xe(Ge,Xe),Error.stackTraceLimit-=6}}var Qe=new Error;if(typeof Qe.stack=="string"&&Qe.stack.split(` `)[0].indexOf("stackDetection@")>=0)return g=/@/,k=be,A=!0,function(Xe){Xe.stack=new Error().stack};var Fe;try{throw new Error}catch(Ge){Fe="stack"in Ge}return!("stack"in Qe)&&Fe&&typeof Error.stackTraceLimit=="number"?(g=ue,k=be,function(Xe){Error.stackTraceLimit+=6;try{throw new Error}catch($e){Xe.stack=$e.stack}Error.stackTraceLimit-=6}):(k=function(Ge,Xe){return typeof Ge=="string"?Ge:(typeof Xe=="object"||typeof Xe=="function")&&Xe.name!==void 0&&Xe.message!==void 0?Xe.toString():Ae(Xe)},null)}();typeof console<"u"&&typeof console.warn<"u"&&(m=function(ve){console.warn(ve)},s.isNode&&process.stderr.isTTY?m=function(ve,ue){var be=ue?"\x1B[33m":"\x1B[31m";console.warn(be+ve+`\x1B[0m `)}:!s.isNode&&typeof new Error().stack=="string"&&(m=function(ve,ue){console.warn("%c"+ve,ue?"color: darkorange":"color: red")}));var Be={warnings:p,longStackTraces:!1,cancellation:!1,monitoring:!1};return b&&e.longStackTraces(),{longStackTraces:function(){return Be.longStackTraces},warnings:function(){return Be.warnings},cancellation:function(){return Be.cancellation},monitoring:function(){return Be.monitoring},propagateFromFunction:function(){return N},boundValueFunction:function(){return I},checkForgottenReturns:V,setBounds:he,warn:K,deprecated:Z,CapturedTrace:pe,fireDomEvent:y,fireGlobalEvent:C}}),n5e}var i5e,b6t;function gzo(){return b6t||(b6t=1,i5e=function(e,t){var n=hd(),r=e.CancellationError,o=n.errorObj;function s(f,g,k){this.promise=f,this.type=g,this.handler=k,this.called=!1,this.cancelPromise=null}s.prototype.isFinallyHandler=function(){return this.type===0};function a(f){this.finallyHandler=f}a.prototype._resultCancelled=function(){l(this.finallyHandler)};function l(f,g){return f.cancelPromise!=null?(arguments.length>1?f.cancelPromise._reject(g):f.cancelPromise._cancel(),f.cancelPromise=null,!0):!1}function d(){return h.call(this,this.promise._target()._settledValue())}function u(f){if(!l(this,f))return o.e=f,o}function h(f){var g=this.promise,k=this.handler;if(!this.called){this.called=!0;var A=this.isFinallyHandler()?k.call(g._boundValue()):k.call(g._boundValue(),f);if(A!==void 0){g._setReturnedNonUndefined();var m=t(A,g);if(m instanceof e){if(this.cancelPromise!=null)if(m._isCancelled()){var v=new r("late cancellation observer");return g._attachExtraTrace(v),o.e=v,o}else m.isPending()&&m._attachCancellationCallback(new a(this));return m._then(d,u,void 0,this,void 0)}}}return g.isRejected()?(l(this),o.e=f,o):(l(this),f)}return e.prototype._passThrough=function(f,g,k,A){return typeof f!="function"?this.then():this._then(k,A,void 0,new s(this,g,f),void 0)},e.prototype.lastly=e.prototype.finally=function(f){return this._passThrough(f,0,h,h)},e.prototype.tap=function(f){return this._passThrough(f,1,h)},s}),i5e}var r5e,O6t;function mzo(){return O6t||(O6t=1,r5e=function(e){var t=hd(),n=FZ().keys,r=t.tryCatch,o=t.errorObj;function s(a,l,d){return function(u){var h=d._boundValue();e:for(var f=0;f1){o.deprecated("calling Promise.try with more than 1 argument");var h=arguments[1],f=arguments[2];u=s.isArray(h)?a(l).apply(f,h):a(l).call(f,h)}else u=a(l)();var g=d._popContext();return o.checkForgottenReturns(u,g,"Promise.try",d),d._resolveFromSyncValue(u),d},e.prototype._resolveFromSyncValue=function(l){l===s.errorObj?this._rejectCallback(l.e,!1):this._resolveCallback(l,!0)}}),s5e}var a5e,C6t;function vzo(){return C6t||(C6t=1,a5e=function(e,t,n,r){var o=!1,s=function(u,h){this._reject(h)},a=function(u,h){h.promiseRejectionQueued=!0,h.bindingPromise._then(s,s,null,this,u)},l=function(u,h){this._bitField&50397184||this._resolveCallback(h.target)},d=function(u,h){h.promiseRejectionQueued||this._reject(u)};e.prototype.bind=function(u){o||(o=!0,e.prototype._propagateFrom=r.propagateFromFunction(),e.prototype._boundValue=r.boundValueFunction());var h=n(u),f=new e(t);f._propagateFrom(this,1);var g=this._target();if(f._setBoundTo(h),h instanceof e){var k={promiseRejectionQueued:!1,promise:f,target:g,bindingPromise:h};g._then(t,a,void 0,f,k),h._then(l,d,void 0,f,k),f._setOnCancel(h)}else f._resolveCallback(g);return f},e.prototype._setBoundTo=function(u){u!==void 0?(this._bitField=this._bitField|2097152,this._boundTo=u):this._bitField=this._bitField&-2097153},e.prototype._isBound=function(){return(this._bitField&2097152)===2097152},e.bind=function(u,h){return e.resolve(h).bind(u)}}),a5e}var l5e,x6t;function pzo(){return x6t||(x6t=1,l5e=function(e,t,n,r){var o=hd(),s=o.tryCatch,a=o.errorObj,l=e._async;e.prototype.break=e.prototype.cancel=function(){if(!r.cancellation())return this._warn("cancellation is disabled");for(var d=this,u=d;d._isCancellable();){if(!d._cancelBy(u)){u._isFollowing()?u._followee().cancel():u._cancelBranched();break}var h=d._cancellationParent;if(h==null||!h._isCancellable()){d._isFollowing()?d._followee().cancel():d._cancelBranched();break}else d._isFollowing()&&d._followee().cancel(),d._setWillBeCancelled(),u=d,d=h}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return this._branchesRemainingToCancel===void 0||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(d){return d===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),l.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(d,u){if(o.isArray(d))for(var h=0;h0&&typeof arguments[b]=="function"&&(O=arguments[b],b<=8&&l)){var B=new e(r);B._captureStackTrace();for(var w=A[b-1],y=new w(O),C=m,x=0;x=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(b>=1&&this._inFlight>=b)return m[A]=k,this._queue.push(A),!1;p!==null&&(p[A]=k);var O=this._promise,w=this._callback,y=O._boundValue();O._pushContext();var C=d(w).call(y,k,A,v),x=O._popContext();if(s.checkForgottenReturns(C,x,p!==null?"Promise.filter":"Promise.map",O),C===u)return this._reject(C.e),!0;var L=r(C,this._promise);if(L instanceof e){L=L._target();var S=L._bitField;if(S&50397184)if(S&33554432)C=L._value();else return S&16777216?(this._reject(L._reason()),!0):(this._cancel(),!0);else return b>=1&&this._inFlight++,m[A]=L,L._proxy(this,(A+1)*-1),!1}m[A]=C}var E=++this._totalResolved;return E>=v?(p!==null?this._filter(m,p):this._resolve(m),!0):!1},f.prototype._drainQueue=function(){for(var k=this._queue,A=this._limit,m=this._values;k.length>0&&this._inFlight=1?p:0,new f(k,A,p,v).promise()}e.prototype.map=function(k,A){return g(this,k,A,null)},e.map=function(k,A,m,v){return g(k,A,m,v)}}),h5e}var A5e,D6t;function Czo(){if(D6t)return A5e;D6t=1;var e=Object.create;if(e){var t=e(null),n=e(null);t[" size"]=n[" size"]=0}return A5e=function(r){var o=hd(),s=o.canEvaluate,a=o.isIdentifier,l,d;{var u=function(v){return new Function("ensureMethod",` return function(obj) { 'use strict' var len = this.length; ensureMethod(obj, 'methodName'); switch(len) { case 1: return obj.methodName(this[0]); case 2: return obj.methodName(this[0], this[1]); case 3: return obj.methodName(this[0], this[1], this[2]); case 0: return obj.methodName(); default: return obj.methodName.apply(obj, this); } }; `.replace(/methodName/g,v))(g)},h=function(v){return new Function("obj",` 'use strict'; return obj.propertyName; `.replace("propertyName",v))},f=function(v,p,b){var O=b[v];if(typeof O!="function"){if(!a(v))return null;if(O=p(v),b[v]=O,b[" size"]++,b[" size"]>512){for(var w=Object.keys(b),y=0;y<256;++y)delete b[w[y]];b[" size"]=w.length-256}}return O};l=function(v){return f(v,u,t)},d=function(v){return f(v,h,n)}}function g(v,p){var b;if(v!=null&&(b=v[p]),typeof b!="function"){var O="Object "+o.classString(v)+" has no method '"+o.toString(p)+"'";throw new r.TypeError(O)}return b}function k(v){var p=this.pop(),b=g(v,p);return b.apply(v,this)}r.prototype.call=function(v){for(var p=arguments.length,b=new Array(Math.max(p-1,0)),O=1;O=C)return x._fulfill();var S=k(O[y++]);if(S instanceof e&&S._isDisposable()){try{S=n(S._getDisposer().tryDispose(w),O.promise)}catch(E){return g(E)}if(S instanceof e)return S._then(L,g,null,null,null)}L()}return L(),x}function m(O,w,y){this._data=O,this._promise=w,this._context=y}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():f},m.prototype.tryDispose=function(O){var w=this.resource(),y=this._context;y!==void 0&&y._pushContext();var C=w!==f?this.doDispose(w,O):null;return y!==void 0&&y._popContext(),this._promise._unsetDisposable(),this._data=null,C},m.isDisposer=function(O){return O!=null&&typeof O.resource=="function"&&typeof O.tryDispose=="function"};function v(O,w,y){this.constructor$(O,w,y)}d(v,m),v.prototype.doDispose=function(O,w){var y=this.data();return y.call(O,O,w)};function p(O){return m.isDisposer(O)?(this.resources[this.index]._setDisposable(O),O.promise()):O}function b(O){this.length=O,this.promise=null,this[O-1]=null}b.prototype._resultCancelled=function(){for(var O=this.length,w=0;w0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},e.prototype.disposer=function(O){if(typeof O=="function")return new v(O,this,r());throw new l}}),f5e}var g5e,B6t;function Lzo(){return B6t||(B6t=1,g5e=function(e,t,n){var r=hd(),o=e.TimeoutError;function s(f){this.handle=f}s.prototype._resultCancelled=function(){clearTimeout(this.handle)};var a=function(f){return l(+this).thenReturn(f)},l=e.delay=function(f,g){var k,A;return g!==void 0?(k=e.resolve(g)._then(a,null,null,f,void 0),n.cancellation()&&g instanceof e&&k._setOnCancel(g)):(k=new e(t),A=setTimeout(function(){k._fulfill()},+f),n.cancellation()&&k._setOnCancel(new s(A)),k._captureStackTrace()),k._setAsyncGuaranteed(),k};e.prototype.delay=function(f){return l(f,this)};var d=function(f,g,k){var A;typeof g!="string"?g instanceof Error?A=g:A=new o("operation timed out"):A=new o(g),r.markAsOriginatingFromRejection(A),f._attachExtraTrace(A),f._reject(A),k!=null&&k.cancel()};function u(f){return clearTimeout(this.handle),f}function h(f){throw clearTimeout(this.handle),f}e.prototype.timeout=function(f,g){f=+f;var k,A,m=new s(setTimeout(function(){k.isPending()&&d(k,g,A)},f));return n.cancellation()?(A=this.then(),k=A._then(u,h,void 0,m,void 0),k._setOnCancel(m)):k=this._then(u,h,void 0,m,void 0),k}}),g5e}var m5e,F6t;function Szo(){return F6t||(F6t=1,m5e=function(e,t,n,r,o,s){var a=JT(),l=a.TypeError,d=hd(),u=d.errorObj,h=d.tryCatch,f=[];function g(A,m,v){for(var p=0;p=P;--F)B.push(F);for(var F=M+1;F<=3;++F)B.push(F);return B},C=function(M){return r.filledRange(M,"_arg","")},x=function(M){return r.filledRange(Math.max(M,3),"_arg","")},L=function(M){return typeof M.length=="number"?Math.max(Math.min(M.length,1024),0):0};w=function(M,B,P,F,R,N){var I=Math.max(0,L(F)-1),W=y(I),H=typeof M=="string"||B===n;function V(ee){var q=C(ee).join(", "),$=ee>0?", ":"",oe;return H?oe=`ret = callback.call(this, {{args}}, nodeback); break; `:oe=B===void 0?`ret = callback({{args}}, nodeback); break; `:`ret = callback.call(receiver, {{args}}, nodeback); break; `,oe.replace("{{args}}",q).replace(", ",$)}function Z(){for(var ee="",q=0;q=this._length){var m;if(this._isMap)m=u(this._values);else{m={};for(var v=this.length(),p=0,b=this.length();p>1};function f(g){var k,A=n(g);if(s(A))A instanceof e?k=A._then(e.props,void 0,void 0,void 0,void 0):k=new h(A).promise();else return r(`cannot await properties of a non-object See http://goo.gl/MqrFmX `);return A instanceof e&&k._propagateFrom(A,2),k}e.prototype.props=function(){return f(this)},e.props=function(g){return f(g)}}),p5e}var b5e,I6t;function Qzo(){return I6t||(I6t=1,b5e=function(e,t,n,r){var o=hd(),s=function(l){return l.then(function(d){return a(d,l)})};function a(l,d){var u=n(l);if(u instanceof e)return s(u);if(l=o.asArray(l),l===null)return r("expecting an array or an iterable object but got "+o.classString(l));var h=new e(t);d!==void 0&&h._propagateFrom(d,3);for(var f=h._fulfill,g=h._reject,k=0,A=l.length;k=this._length?(this._resolve(this._values),!0):!1},s.prototype._promiseFulfilled=function(a,l){var d=new r;return d._bitField=33554432,d._settledValueField=a,this._promiseResolved(l,d)},s.prototype._promiseRejected=function(a,l){var d=new r;return d._bitField=16777216,d._settledValueField=a,this._promiseResolved(l,d)},e.settle=function(a){return n.deprecated(".settle()",".reflect()"),new s(a).promise()},e.prototype.settle=function(){return e.settle(this)}}),w5e}var y5e,j6t;function Pzo(){return j6t||(j6t=1,y5e=function(e,t,n){var r=hd(),o=JT().RangeError,s=JT().AggregateError,a=r.isArray,l={};function d(h){this.constructor$(h),this._howMany=0,this._unwrap=!1,this._initialized=!1}r.inherits(d,t),d.prototype._init=function(){if(this._initialized){if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var h=a(this._values);!this._isResolved()&&h&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},d.prototype.init=function(){this._initialized=!0,this._init()},d.prototype.setUnwrap=function(){this._unwrap=!0},d.prototype.howMany=function(){return this._howMany},d.prototype.setHowMany=function(h){this._howMany=h},d.prototype._promiseFulfilled=function(h){return this._addFulfilled(h),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),this.howMany()===1&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},d.prototype._promiseRejected=function(h){return this._addRejected(h),this._checkOutcome()},d.prototype._promiseCancelled=function(){return this._values instanceof e||this._values==null?this._cancel():(this._addRejected(l),this._checkOutcome())},d.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var h=new s,f=this.length();f0?this._reject(h):this._cancel(),!0}return!1},d.prototype._fulfilled=function(){return this._totalResolved},d.prototype._rejected=function(){return this._values.length-this.length()},d.prototype._addRejected=function(h){this._values.push(h)},d.prototype._addFulfilled=function(h){this._values[this._totalResolved++]=h},d.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},d.prototype._getRangeError=function(h){var f="Input array must contain at least "+this._howMany+" items but contains only "+h+" items";return new o(f)},d.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))};function u(h,f){if((f|0)!==f||f<0)return n(`expecting a positive integer See http://goo.gl/MqrFmX `);var g=new d(h),k=g.promise();return g.setHowMany(f),g.init(),k}e.some=function(h,f){return u(h,f)},e.prototype.some=function(h){return u(this,h)},e._SomePromiseArray=d}),y5e}var C5e,W6t;function Mzo(){return W6t||(W6t=1,C5e=function(e,t){var n=e.map;e.prototype.filter=function(r,o){return n(this,r,o,t)},e.filter=function(r,o,s){return n(r,o,s,t)}}),C5e}var x5e,H6t;function Rzo(){return H6t||(H6t=1,x5e=function(e,t){var n=e.reduce,r=e.all;function o(){return r(this)}function s(a,l){return n(a,l,t,t)}e.prototype.each=function(a){return n(this,a,t,0)._then(o,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(a){return n(this,a,t,t)},e.each=function(a,l){return n(a,l,t,0)._then(o,void 0,void 0,a,void 0)},e.mapSeries=s}),x5e}var L5e,V6t;function Izo(){return V6t||(V6t=1,L5e=function(e){var t=e._SomePromiseArray;function n(r){var o=new t(r),s=o.promise();return o.setHowMany(1),o.setUnwrap(),o.init(),s}e.any=function(r){return n(r)},e.prototype.any=function(){return n(this)}}),L5e}(function(e){e.exports=function(){var t=function(){return new g(`circular promise resolution chain See http://goo.gl/MqrFmX `)},n=function(){return new T.PromiseInspection(this._target())},r=function(F){return T.reject(new g(F))};function o(){}var s={},a=hd(),l;a.isNode?l=function(){var F=process.domain;return F===void 0&&(F=null),F}:l=function(){return null},a.notEnumerableProp(T,"_getDomain",l);var d=FZ(),u=dzo(),h=new u;d.defineProperty(T,"_async",{value:h});var f=JT(),g=T.TypeError=f.TypeError;T.RangeError=f.RangeError;var k=T.CancellationError=f.CancellationError;T.TimeoutError=f.TimeoutError,T.OperationalError=f.OperationalError,T.RejectionError=f.OperationalError,T.AggregateError=f.AggregateError;var A=function(){},m={},v={},p=uzo()(T,A),b=hzo()(T,A,p,r,o),O=Azo()(T),w=O.create,y=fzo()(T,O);y.CapturedTrace;var C=gzo()(T,p),x=mzo()(v),L=GUn(),S=a.errorObj,E=a.tryCatch;function Q(F,R){if(typeof R!="function")throw new g("expecting a function but got "+a.classString(R));if(F.constructor!==T)throw new g(`the promise constructor cannot be invoked directly See http://goo.gl/MqrFmX `)}function T(F){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,F!==A&&(Q(this,F),this._resolveFromExecutor(F)),this._promiseCreated(),this._fireEvent("promiseCreated",this)}T.prototype.toString=function(){return"[object Promise]"},T.prototype.caught=T.prototype.catch=function(F){var R=arguments.length;if(R>1){var N=new Array(R-1),I=0,W;for(W=0;W0&&typeof F!="function"&&typeof R!="function"){var N=".then() only accepts functions but was passed: "+a.classString(F);arguments.length>1&&(N+=", "+a.classString(R)),this._warn(N)}return this._then(F,R,void 0,void 0,void 0)},T.prototype.done=function(F,R){var N=this._then(F,R,void 0,void 0,void 0);N._setIsFinal()},T.prototype.spread=function(F){return typeof F!="function"?r("expecting a function but got "+a.classString(F)):this.all()._then(F,void 0,void 0,m,void 0)},T.prototype.toJSON=function(){var F={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(F.fulfillmentValue=this.value(),F.isFulfilled=!0):this.isRejected()&&(F.rejectionReason=this.reason(),F.isRejected=!0),F},T.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new b(this).promise()},T.prototype.error=function(F){return this.caught(a.originatesFromRejection,F)},T.getNewLibraryCopy=e.exports,T.is=function(F){return F instanceof T},T.fromNode=T.fromCallback=function(F){var R=new T(A);R._captureStackTrace();var N=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,I=E(F)(L(R,N));return I===S&&R._rejectCallback(I.e,!0),R._isFateSealed()||R._setAsyncGuaranteed(),R},T.all=function(F){return new b(F).promise()},T.cast=function(F){var R=p(F);return R instanceof T||(R=new T(A),R._captureStackTrace(),R._setFulfilled(),R._rejectionHandler0=F),R},T.resolve=T.fulfilled=T.cast,T.reject=T.rejected=function(F){var R=new T(A);return R._captureStackTrace(),R._rejectCallback(F,!0),R},T.setScheduler=function(F){if(typeof F!="function")throw new g("expecting a function but got "+a.classString(F));return h.setScheduler(F)},T.prototype._then=function(F,R,N,I,W){var H=W!==void 0,V=H?W:new T(A),Z=this._target(),K=Z._bitField;H||(V._propagateFrom(this,3),V._captureStackTrace(),I===void 0&&this._bitField&2097152&&(K&50397184?I=this._boundValue():I=Z===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,V));var X=l();if(K&50397184){var ee,q,$=Z._settlePromiseCtx;K&33554432?(q=Z._rejectionHandler0,ee=F):K&16777216?(q=Z._fulfillmentHandler0,ee=R,Z._unsetRejectionIsUnhandled()):($=Z._settlePromiseLateCancellationObserver,q=new k("late cancellation observer"),Z._attachExtraTrace(q),ee=R),h.invoke($,Z,{handler:X===null?ee:typeof ee=="function"&&a.domainBind(X,ee),promise:V,receiver:I,value:q})}else Z._addCallbacks(F,R,V,I,X);return V},T.prototype._length=function(){return this._bitField&65535},T.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},T.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},T.prototype._setLength=function(F){this._bitField=this._bitField&-65536|F&65535},T.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},T.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},T.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},T.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},T.prototype._isFinal=function(){return(this._bitField&4194304)>0},T.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},T.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},T.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},T.prototype._setAsyncGuaranteed=function(){h.hasCustomScheduler()||(this._bitField=this._bitField|134217728)},T.prototype._receiverAt=function(F){var R=F===0?this._receiver0:this[F*4-4+3];if(R!==s)return R===void 0&&this._isBound()?this._boundValue():R},T.prototype._promiseAt=function(F){return this[F*4-4+2]},T.prototype._fulfillmentHandlerAt=function(F){return this[F*4-4+0]},T.prototype._rejectionHandlerAt=function(F){return this[F*4-4+1]},T.prototype._boundValue=function(){},T.prototype._migrateCallback0=function(F){F._bitField;var R=F._fulfillmentHandler0,N=F._rejectionHandler0,I=F._promise0,W=F._receiverAt(0);W===void 0&&(W=s),this._addCallbacks(R,N,I,W,null)},T.prototype._migrateCallbackAt=function(F,R){var N=F._fulfillmentHandlerAt(R),I=F._rejectionHandlerAt(R),W=F._promiseAt(R),H=F._receiverAt(R);H===void 0&&(H=s),this._addCallbacks(N,I,W,H,null)},T.prototype._addCallbacks=function(F,R,N,I,W){var H=this._length();if(H>=65531&&(H=0,this._setLength(0)),H===0)this._promise0=N,this._receiver0=I,typeof F=="function"&&(this._fulfillmentHandler0=W===null?F:a.domainBind(W,F)),typeof R=="function"&&(this._rejectionHandler0=W===null?R:a.domainBind(W,R));else{var V=H*4-4;this[V+2]=N,this[V+3]=I,typeof F=="function"&&(this[V+0]=W===null?F:a.domainBind(W,F)),typeof R=="function"&&(this[V+1]=W===null?R:a.domainBind(W,R))}return this._setLength(H+1),H},T.prototype._proxy=function(F,R){this._addCallbacks(void 0,void 0,R,F,null)},T.prototype._resolveCallback=function(F,R){if(!(this._bitField&117506048)){if(F===this)return this._rejectCallback(t(),!1);var N=p(F,this);if(!(N instanceof T))return this._fulfill(F);R&&this._propagateFrom(N,2);var I=N._target();if(I===this){this._reject(t());return}var W=I._bitField;if(W&50397184)if(W&33554432)this._fulfill(I._value());else if(W&16777216)this._reject(I._reason());else{var Z=new k("late cancellation observer");I._attachExtraTrace(Z),this._reject(Z)}else{var H=this._length();H>0&&I._migrateCallback0(this);for(var V=1;V>>16)){if(F===this){var N=t();return this._attachExtraTrace(N),this._reject(N)}this._setFulfilled(),this._rejectionHandler0=F,(R&65535)>0&&(R&134217728?this._settlePromises():h.settlePromises(this))}},T.prototype._reject=function(F){var R=this._bitField;if(!((R&117506048)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=F,this._isFinal())return h.fatalError(F,a.isNode);(R&65535)>0?h.settlePromises(this):this._ensurePossibleRejectionHandled()}},T.prototype._fulfillPromises=function(F,R){for(var N=1;N0){if(F&16842752){var N=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,N,F),this._rejectPromises(R,N)}else{var I=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,I,F),this._fulfillPromises(R,I)}this._setLength(0)}this._clearCancellationData()},T.prototype._settledValue=function(){var F=this._bitField;if(F&33554432)return this._rejectionHandler0;if(F&16777216)return this._fulfillmentHandler0};function M(F){this.promise._resolveCallback(F)}function B(F){this.promise._rejectCallback(F,!1)}T.defer=T.pending=function(){y.deprecated("Promise.defer","new Promise");var F=new T(A);return{promise:F,resolve:M,reject:B}},a.notEnumerableProp(T,"_makeSelfResolutionError",t),kzo()(T,A,p,r,y),vzo()(T,A,p,y),pzo()(T,b,r,y),bzo()(T),Ozo()(T),wzo()(T,b,p,A,h,l),T.Promise=T,T.version="3.4.7",yzo()(T,b,r,p,A,y),Czo()(T),xzo()(T,r,p,w,A,y),Lzo()(T,A,y),Szo()(T,r,A,p,o,y),Tzo()(T),Ezo()(T,A),Dzo()(T,b,p,r),Qzo()(T,A,p,r),Bzo()(T,b,r,p,A,y),Fzo()(T,b,y),Pzo()(T,b,r),Mzo()(T,A),Rzo()(T,A),Izo()(T),a.toFastProperties(T),a.toFastProperties(T.prototype);function P(F){var R=new T(A);R._fulfillmentHandler0=F,R._rejectionHandler0=F,R._promise0=F,R._receiver0=F}return P({a:1}),P({b:2}),P({c:3}),P(1),P(function(){}),P(void 0),P(!1),P(new T(A)),y.setBounds(u.firstLineError,a.lastLineError),T}})(qUn);var Nzo=qUn.exports,Uzo=Sh,Ok=Nzo();Wf.defer=jzo;Wf.when=Ok.resolve;Wf.resolve=Ok.resolve;Wf.all=Ok.all;Wf.props=Ok.props;Wf.reject=Ok.reject;Wf.promisify=Ok.promisify;Wf.mapSeries=Ok.mapSeries;Wf.attempt=Ok.attempt;Wf.nfcall=function(e){var t=Array.prototype.slice.call(arguments,1),n=Ok.promisify(e);return n.apply(null,t)};Ok.prototype.fail=Ok.prototype.caught;Ok.prototype.also=function(e){return this.then(function(t){var n=Uzo.extend({},t,e(t));return Ok.props(n)})};function jzo(){var e,t,n=new Ok.Promise(function(r,o){e=r,t=o});return{resolve:e,reject:t,promise:n}}var wa={},Wzo=Sh,Eg=wa.types={document:"document",paragraph:"paragraph",run:"run",text:"text",tab:"tab",checkbox:"checkbox",hyperlink:"hyperlink",noteReference:"noteReference",image:"image",note:"note",commentReference:"commentReference",comment:"comment",table:"table",tableRow:"tableRow",tableCell:"tableCell",break:"break",bookmarkStart:"bookmarkStart"};function Hzo(e,t){return t=t||{},{type:Eg.document,children:e,notes:t.notes||new F3e({}),comments:t.comments||[]}}function Vzo(e,t){t=t||{};var n=t.indent||{};return{type:Eg.paragraph,children:e,styleId:t.styleId||null,styleName:t.styleName||null,numbering:t.numbering||null,alignment:t.alignment||null,indent:{start:n.start||null,end:n.end||null,firstLine:n.firstLine||null,hanging:n.hanging||null}}}function zzo(e,t){return t=t||{},{type:Eg.run,children:e,styleId:t.styleId||null,styleName:t.styleName||null,isBold:!!t.isBold,isUnderline:!!t.isUnderline,isItalic:!!t.isItalic,isStrikethrough:!!t.isStrikethrough,isAllCaps:!!t.isAllCaps,isSmallCaps:!!t.isSmallCaps,verticalAlignment:t.verticalAlignment||KUn.baseline,font:t.font||null,fontSize:t.fontSize||null,highlight:t.highlight||null}}var KUn={baseline:"baseline",superscript:"superscript",subscript:"subscript"};function Zzo(e){return{type:Eg.text,value:e}}function Yzo(){return{type:Eg.tab}}function Xzo(e){return{type:Eg.checkbox,checked:e.checked}}function qzo(e,t){return{type:Eg.hyperlink,children:e,href:t.href,anchor:t.anchor,targetFrame:t.targetFrame}}function Gzo(e){return{type:Eg.noteReference,noteType:e.noteType,noteId:e.noteId}}function F3e(e){this._notes=Wzo.indexBy(e,function(t){return JUn(t.noteType,t.noteId)})}F3e.prototype.resolve=function(e){return this.findNoteByKey(JUn(e.noteType,e.noteId))};F3e.prototype.findNoteByKey=function(e){return this._notes[e]||null};function Kzo(e){return{type:Eg.note,noteType:e.noteType,noteId:e.noteId,body:e.body}}function Jzo(e){return{type:Eg.commentReference,commentId:e.commentId}}function _zo(e){return{type:Eg.comment,commentId:e.commentId,body:e.body,authorName:e.authorName,authorInitials:e.authorInitials}}function JUn(e,t){return e+"-"+t}function $zo(e){return{type:Eg.image,read:function(t){return t?e.readImage(t):e.readImage().then(function(n){return Buffer.from(n)})},readAsArrayBuffer:function(){return e.readImage()},readAsBase64String:function(){return e.readImage("base64")},readAsBuffer:function(){return e.readImage().then(function(t){return Buffer.from(t)})},altText:e.altText,contentType:e.contentType}}function eZo(e,t){return t=t||{},{type:Eg.table,children:e,styleId:t.styleId||null,styleName:t.styleName||null}}function tZo(e,t){return t=t||{},{type:Eg.tableRow,children:e,isHeader:t.isHeader||!1}}function nZo(e,t){return t=t||{},{type:Eg.tableCell,children:e,colSpan:t.colSpan==null?1:t.colSpan,rowSpan:t.rowSpan==null?1:t.rowSpan}}function Zrt(e){return{type:Eg.break,breakType:e}}function iZo(e){return{type:Eg.bookmarkStart,name:e.name}}wa.document=wa.Document=Hzo;wa.paragraph=wa.Paragraph=Vzo;wa.run=wa.Run=zzo;wa.text=wa.Text=Zzo;wa.tab=wa.Tab=Yzo;wa.checkbox=wa.Checkbox=Xzo;wa.Hyperlink=qzo;wa.noteReference=wa.NoteReference=Gzo;wa.Notes=F3e;wa.Note=Kzo;wa.commentReference=Jzo;wa.comment=_zo;wa.Image=$zo;wa.Table=eZo;wa.TableRow=tZo;wa.TableCell=nZo;wa.lineBreak=Zrt("line");wa.pageBreak=Zrt("page");wa.columnBreak=Zrt("column");wa.BookmarkStart=iZo;wa.verticalAlignment=KUn;var D2={},ete=Sh;D2.Result=Zy;D2.success=rZo;D2.warning=oZo;D2.error=sZo;function Zy(e,t){this.value=e,this.messages=t||[]}Zy.prototype.map=function(e){return new Zy(e(this.value),this.messages)};Zy.prototype.flatMap=function(e){var t=e(this.value);return new Zy(t.value,Yrt([this,t]))};Zy.prototype.flatMapThen=function(e){var t=this;return e(this.value).then(function(n){return new Zy(n.value,Yrt([t,n]))})};Zy.combine=function(e){var t=ete.flatten(ete.pluck(e,"value")),n=Yrt(e);return new Zy(t,n)};function rZo(e){return new Zy(e,[])}function oZo(e){return{type:"warning",message:e}}function sZo(e){return{type:"error",message:e.message,error:e}}function Yrt(e){var t=[];return ete.flatten(ete.pluck(e,"messages"),!0).forEach(function(n){aZo(t,n)||t.push(n)}),t}function aZo(e,t){return ete.find(e,lZo.bind(null,t))!==void 0}function lZo(e,t){return e.type===t.type&&e.message===t.message}var Dre={},P3e={};P3e.byteLength=uZo;P3e.toByteArray=AZo;P3e.fromByteArray=mZo;var Rw=[],kp=[],cZo=typeof Uint8Array<"u"?Uint8Array:Array,S5e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var oN=0,dZo=S5e.length;oN0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function uZo(e){var t=_Un(e),n=t[0],r=t[1];return(n+r)*3/4-r}function hZo(e,t,n){return(t+n)*3/4-n}function AZo(e){var t,n=_Un(e),r=n[0],o=n[1],s=new cZo(hZo(e,r,o)),a=0,l=o>0?r-4:r,d;for(d=0;d>16&255,s[a++]=t>>8&255,s[a++]=t&255;return o===2&&(t=kp[e.charCodeAt(d)]<<2|kp[e.charCodeAt(d+1)]>>4,s[a++]=t&255),o===1&&(t=kp[e.charCodeAt(d)]<<10|kp[e.charCodeAt(d+1)]<<4|kp[e.charCodeAt(d+2)]>>2,s[a++]=t>>8&255,s[a++]=t&255),s}function fZo(e){return Rw[e>>18&63]+Rw[e>>12&63]+Rw[e>>6&63]+Rw[e&63]}function gZo(e,t,n){for(var r,o=[],s=t;sl?l:a+s));return r===1?(t=e[n-1],o.push(Rw[t>>2]+Rw[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(Rw[t>>10]+Rw[t>>4&63]+Rw[t<<2&63]+"=")),o.join("")}function ede(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var $Un={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,o,s){function a(u,h){if(!o[u]){if(!r[u]){var f=typeof ede=="function"&&ede;if(!h&&f)return f(u,!0);if(l)return l(u,!0);var g=new Error("Cannot find module '"+u+"'");throw g.code="MODULE_NOT_FOUND",g}var k=o[u]={exports:{}};r[u][0].call(k.exports,function(A){var m=r[u][1][A];return a(m||A)},k,k.exports,n,r,o,s)}return o[u].exports}for(var l=typeof ede=="function"&&ede,d=0;d>2,k=(3&u)<<4|h>>4,A=1>6:64,m=2>4,h=(15&g)<<4|(k=l.indexOf(d.charAt(m++)))>>2,f=(3&k)<<6|(A=l.indexOf(d.charAt(m++))),b[v++]=u,k!==64&&(b[v++]=h),A!==64&&(b[v++]=f);return b}},{"./support":30,"./utils":32}],2:[function(n,r,o){var s=n("./external"),a=n("./stream/DataWorker"),l=n("./stream/Crc32Probe"),d=n("./stream/DataLengthProbe");function u(h,f,g,k,A){this.compressedSize=h,this.uncompressedSize=f,this.crc32=g,this.compression=k,this.compressedContent=A}u.prototype={getContentWorker:function(){var h=new a(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new d("data_length")),f=this;return h.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},getCompressedWorker:function(){return new a(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(h,f,g){return h.pipe(new l).pipe(new d("uncompressedSize")).pipe(f.compressWorker(g)).pipe(new d("compressedSize")).withStreamInfo("compression",f)},r.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var s=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var s=n("./utils"),a=function(){for(var l,d=[],u=0;u<256;u++){l=u;for(var h=0;h<8;h++)l=1&l?3988292384^l>>>1:l>>>1;d[u]=l}return d}();r.exports=function(l,d){return l!==void 0&&l.length?s.getTypeOf(l)!=="string"?function(u,h,f,g){var k=a,A=g+f;u^=-1;for(var m=g;m>>8^k[255&(u^h[m])];return-1^u}(0|d,l,l.length,0):function(u,h,f,g){var k=a,A=g+f;u^=-1;for(var m=g;m>>8^k[255&(u^h.charCodeAt(m))];return-1^u}(0|d,l,l.length,0):0}},{"./utils":32}],5:[function(n,r,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,r,o){var s=null;s=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:s}},{lie:37}],7:[function(n,r,o){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",a=n("pako"),l=n("./utils"),d=n("./stream/GenericWorker"),u=s?"uint8array":"array";function h(f,g){d.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=g,this.meta={}}o.magic="\b\0",l.inherits(h,d),h.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(l.transformTo(u,f.data),!1)},h.prototype.flush=function(){d.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(g){f.push({data:g,meta:f.meta})}},o.compressWorker=function(f){return new h("Deflate",f)},o.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function s(k,A){var m,v="";for(m=0;m>>=8;return v}function a(k,A,m,v,p,b){var O,w,y=k.file,C=k.compression,x=b!==u.utf8encode,L=l.transformTo("string",b(y.name)),S=l.transformTo("string",u.utf8encode(y.name)),E=y.comment,Q=l.transformTo("string",b(E)),T=l.transformTo("string",u.utf8encode(E)),M=S.length!==y.name.length,B=T.length!==E.length,P="",F="",R="",N=y.dir,I=y.date,W={crc32:0,compressedSize:0,uncompressedSize:0};A&&!m||(W.crc32=k.crc32,W.compressedSize=k.compressedSize,W.uncompressedSize=k.uncompressedSize);var H=0;A&&(H|=8),x||!M&&!B||(H|=2048);var V=0,Z=0;N&&(V|=16),p==="UNIX"?(Z=798,V|=function(X,ee){var q=X;return X||(q=ee?16893:33204),(65535&q)<<16}(y.unixPermissions,N)):(Z=20,V|=function(X){return 63&(X||0)}(y.dosPermissions)),O=I.getUTCHours(),O<<=6,O|=I.getUTCMinutes(),O<<=5,O|=I.getUTCSeconds()/2,w=I.getUTCFullYear()-1980,w<<=4,w|=I.getUTCMonth()+1,w<<=5,w|=I.getUTCDate(),M&&(F=s(1,1)+s(h(L),4)+S,P+="up"+s(F.length,2)+F),B&&(R=s(1,1)+s(h(Q),4)+T,P+="uc"+s(R.length,2)+R);var K="";return K+=` \0`,K+=s(H,2),K+=C.magic,K+=s(O,2),K+=s(w,2),K+=s(W.crc32,4),K+=s(W.compressedSize,4),K+=s(W.uncompressedSize,4),K+=s(L.length,2),K+=s(P.length,2),{fileRecord:f.LOCAL_FILE_HEADER+K+L+P,dirRecord:f.CENTRAL_FILE_HEADER+s(Z,2)+K+s(Q.length,2)+"\0\0\0\0"+s(V,4)+s(v,4)+L+P+Q}}var l=n("../utils"),d=n("../stream/GenericWorker"),u=n("../utf8"),h=n("../crc32"),f=n("../signature");function g(k,A,m,v){d.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=A,this.zipPlatform=m,this.encodeFileName=v,this.streamFiles=k,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}l.inherits(g,d),g.prototype.push=function(k){var A=k.meta.percent||0,m=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(k):(this.bytesWritten+=k.data.length,d.prototype.push.call(this,{data:k.data,meta:{currentFile:this.currentFile,percent:m?(A+100*(m-v-1))/m:100}}))},g.prototype.openedSource=function(k){this.currentSourceOffset=this.bytesWritten,this.currentFile=k.file.name;var A=this.streamFiles&&!k.file.dir;if(A){var m=a(k,A,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},g.prototype.closedSource=function(k){this.accumulate=!1;var A=this.streamFiles&&!k.file.dir,m=a(k,A,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),A)this.push({data:function(v){return f.DATA_DESCRIPTOR+s(v.crc32,4)+s(v.compressedSize,4)+s(v.uncompressedSize,4)}(k),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},g.prototype.flush=function(){for(var k=this.bytesWritten,A=0;A=this.index;d--)u=(u<<8)+this.byteAt(d);return this.index+=l,u},readString:function(l){return s.transformTo("string",this.readData(l))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC(1980+(l>>25&127),(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(31&l)<<1))}},r.exports=a},{"../utils":32}],19:[function(n,r,o){var s=n("./Uint8ArrayReader");function a(l){s.call(this,l)}n("../utils").inherits(a,s),a.prototype.readData=function(l){this.checkOffset(l);var d=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,d},r.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var s=n("./DataReader");function a(l){s.call(this,l)}n("../utils").inherits(a,s),a.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},a.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},a.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},a.prototype.readData=function(l){this.checkOffset(l);var d=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,d},r.exports=a},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var s=n("./ArrayReader");function a(l){s.call(this,l)}n("../utils").inherits(a,s),a.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var d=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,d},r.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var s=n("../utils"),a=n("../support"),l=n("./ArrayReader"),d=n("./StringReader"),u=n("./NodeBufferReader"),h=n("./Uint8ArrayReader");r.exports=function(f){var g=s.getTypeOf(f);return s.checkSupport(g),g!=="string"||a.uint8array?g==="nodebuffer"?new u(f):a.uint8array?new h(s.transformTo("uint8array",f)):new l(s.transformTo("array",f)):new d(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,o){var s=n("./GenericWorker"),a=n("../utils");function l(d){s.call(this,"ConvertWorker to "+d),this.destType=d}a.inherits(l,s),l.prototype.processChunk=function(d){this.push({data:a.transformTo(this.destType,d.data),meta:d.meta})},r.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var s=n("./GenericWorker"),a=n("../crc32");function l(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(l,s),l.prototype.processChunk=function(d){this.streamInfo.crc32=a(d.data,this.streamInfo.crc32||0),this.push(d)},r.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var s=n("../utils"),a=n("./GenericWorker");function l(d){a.call(this,"DataLengthProbe for "+d),this.propName=d,this.withStreamInfo(d,0)}s.inherits(l,a),l.prototype.processChunk=function(d){if(d){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+d.data.length}a.prototype.processChunk.call(this,d)},r.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var s=n("../utils"),a=n("./GenericWorker");function l(d){a.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,d.then(function(h){u.dataIsReady=!0,u.data=h,u.max=h&&h.length||0,u.type=s.getTypeOf(h),u.isPaused||u._tickAndRepeat()},function(h){u.error(h)})}s.inherits(l,a),l.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var d=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":d=this.data.substring(this.index,u);break;case"uint8array":d=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":d=this.data.slice(this.index,u)}return this.index=u,this.push({data:d,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function s(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,l){return this._listeners[a].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,l){if(this._listeners[a])for(var d=0;d "+a:a}},r.exports=s},{}],29:[function(n,r,o){var s=n("../utils"),a=n("./ConvertWorker"),l=n("./GenericWorker"),d=n("../base64"),u=n("../support"),h=n("../external"),f=null;if(u.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function g(A,m){return new h.Promise(function(v,p){var b=[],O=A._internalType,w=A._outputType,y=A._mimeType;A.on("data",function(C,x){b.push(C),m&&m(x)}).on("error",function(C){b=[],p(C)}).on("end",function(){try{var C=function(x,L,S){switch(x){case"blob":return s.newBlob(s.transformTo("arraybuffer",L),S);case"base64":return d.encode(L);default:return s.transformTo(x,L)}}(w,function(x,L){var S,E=0,Q=null,T=0;for(S=0;S"u")o.blob=!1;else{var s=new ArrayBuffer(0);try{o.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(s),o.blob=a.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var s=n("./utils"),a=n("./support"),l=n("./nodejsUtils"),d=n("./stream/GenericWorker"),u=new Array(256),h=0;h<256;h++)u[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;u[254]=u[254]=1;function f(){d.call(this,"utf-8 decode"),this.leftOver=null}function g(){d.call(this,"utf-8 encode")}o.utf8encode=function(k){return a.nodebuffer?l.newBufferFrom(k,"utf-8"):function(A){var m,v,p,b,O,w=A.length,y=0;for(b=0;b>>6:(v<65536?m[O++]=224|v>>>12:(m[O++]=240|v>>>18,m[O++]=128|v>>>12&63),m[O++]=128|v>>>6&63),m[O++]=128|63&v);return m}(k)},o.utf8decode=function(k){return a.nodebuffer?s.transformTo("nodebuffer",k).toString("utf-8"):function(A){var m,v,p,b,O=A.length,w=new Array(2*O);for(m=v=0;m>10&1023,w[v++]=56320|1023&p)}return w.length!==v&&(w.subarray?w=w.subarray(0,v):w.length=v),s.applyFromCharCode(w)}(k=s.transformTo(a.uint8array?"uint8array":"array",k))},s.inherits(f,d),f.prototype.processChunk=function(k){var A=s.transformTo(a.uint8array?"uint8array":"array",k.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var m=A;(A=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),A.set(m,this.leftOver.length)}else A=this.leftOver.concat(A);this.leftOver=null}var v=function(b,O){var w;for((O=O||b.length)>b.length&&(O=b.length),w=O-1;0<=w&&(192&b[w])==128;)w--;return w<0||w===0?O:w+u[b[w]]>O?w:O}(A),p=A;v!==A.length&&(a.uint8array?(p=A.subarray(0,v),this.leftOver=A.subarray(v,A.length)):(p=A.slice(0,v),this.leftOver=A.slice(v,A.length))),this.push({data:o.utf8decode(p),meta:k.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=f,s.inherits(g,d),g.prototype.processChunk=function(k){this.push({data:o.utf8encode(k.data),meta:k.meta})},o.Utf8EncodeWorker=g},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,o){var s=n("./support"),a=n("./base64"),l=n("./nodejsUtils"),d=n("./external");function u(m){return m}function h(m,v){for(var p=0;p>8;this.dir=!!(16&this.externalFileAttributes),k==0&&(this.dosPermissions=63&this.externalFileAttributes),k==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var k=s(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=k.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=k.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=k.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=k.readInt(4))}},readExtraFields:function(k){var A,m,v,p=k.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});k.index+4>>6:(k<65536?g[v++]=224|k>>>12:(g[v++]=240|k>>>18,g[v++]=128|k>>>12&63),g[v++]=128|k>>>6&63),g[v++]=128|63&k);return g},o.buf2binstring=function(f){return h(f,f.length)},o.binstring2buf=function(f){for(var g=new s.Buf8(f.length),k=0,A=g.length;k>10&1023,b[A++]=56320|1023&m)}return h(b,A)},o.utf8border=function(f,g){var k;for((g=g||f.length)>f.length&&(g=f.length),k=g-1;0<=k&&(192&f[k])==128;)k--;return k<0||k===0?g:k+d[f[k]]>g?k:g}},{"./common":41}],43:[function(n,r,o){r.exports=function(s,a,l,d){for(var u=65535&s|0,h=s>>>16&65535|0,f=0;l!==0;){for(l-=f=2e3>>1:a>>>1;l[d]=a}return l}();r.exports=function(a,l,d,u){var h=s,f=u+d;a^=-1;for(var g=u;g>>8^h[255&(a^l[g])];return-1^a}},{}],46:[function(n,r,o){var s,a=n("../utils/common"),l=n("./trees"),d=n("./adler32"),u=n("./crc32"),h=n("./messages"),f=0,g=4,k=0,A=-2,m=-1,v=4,p=2,b=8,O=9,w=286,y=30,C=19,x=2*w+1,L=15,S=3,E=258,Q=E+S+1,T=42,M=113,B=1,P=2,F=3,R=4;function N(Y,re){return Y.msg=h[re],re}function I(Y){return(Y<<1)-(4Y.avail_out&&(ce=Y.avail_out),ce!==0&&(a.arraySet(Y.output,re.pending_buf,re.pending_out,ce,Y.next_out),Y.next_out+=ce,re.pending_out+=ce,Y.total_out+=ce,Y.avail_out-=ce,re.pending-=ce,re.pending===0&&(re.pending_out=0))}function V(Y,re){l._tr_flush_block(Y,0<=Y.block_start?Y.block_start:-1,Y.strstart-Y.block_start,re),Y.block_start=Y.strstart,H(Y.strm)}function Z(Y,re){Y.pending_buf[Y.pending++]=re}function K(Y,re){Y.pending_buf[Y.pending++]=re>>>8&255,Y.pending_buf[Y.pending++]=255&re}function X(Y,re){var ce,ie,J=Y.max_chain_length,he=Y.strstart,pe=Y.prev_length,Le=Y.nice_match,Be=Y.strstart>Y.w_size-Q?Y.strstart-(Y.w_size-Q):0,ve=Y.window,ue=Y.w_mask,be=Y.prev,xe=Y.strstart+E,Qe=ve[he+pe-1],Fe=ve[he+pe];Y.prev_length>=Y.good_match&&(J>>=2),Le>Y.lookahead&&(Le=Y.lookahead);do if(ve[(ce=re)+pe]===Fe&&ve[ce+pe-1]===Qe&&ve[ce]===ve[he]&&ve[++ce]===ve[he+1]){he+=2,ce++;do;while(ve[++he]===ve[++ce]&&ve[++he]===ve[++ce]&&ve[++he]===ve[++ce]&&ve[++he]===ve[++ce]&&ve[++he]===ve[++ce]&&ve[++he]===ve[++ce]&&ve[++he]===ve[++ce]&&ve[++he]===ve[++ce]&&heBe&&--J!=0);return pe<=Y.lookahead?pe:Y.lookahead}function ee(Y){var re,ce,ie,J,he,pe,Le,Be,ve,ue,be=Y.w_size;do{if(J=Y.window_size-Y.lookahead-Y.strstart,Y.strstart>=be+(be-Q)){for(a.arraySet(Y.window,Y.window,be,be,0),Y.match_start-=be,Y.strstart-=be,Y.block_start-=be,re=ce=Y.hash_size;ie=Y.head[--re],Y.head[re]=be<=ie?ie-be:0,--ce;);for(re=ce=be;ie=Y.prev[--re],Y.prev[re]=be<=ie?ie-be:0,--ce;);J+=be}if(Y.strm.avail_in===0)break;if(pe=Y.strm,Le=Y.window,Be=Y.strstart+Y.lookahead,ve=J,ue=void 0,ue=pe.avail_in,ve=S)for(he=Y.strstart-Y.insert,Y.ins_h=Y.window[he],Y.ins_h=(Y.ins_h<=S&&(Y.ins_h=(Y.ins_h<=S)if(ie=l._tr_tally(Y,Y.strstart-Y.match_start,Y.match_length-S),Y.lookahead-=Y.match_length,Y.match_length<=Y.max_lazy_match&&Y.lookahead>=S){for(Y.match_length--;Y.strstart++,Y.ins_h=(Y.ins_h<=S&&(Y.ins_h=(Y.ins_h<=S&&Y.match_length<=Y.prev_length){for(J=Y.strstart+Y.lookahead-S,ie=l._tr_tally(Y,Y.strstart-1-Y.prev_match,Y.prev_length-S),Y.lookahead-=Y.prev_length-1,Y.prev_length-=2;++Y.strstart<=J&&(Y.ins_h=(Y.ins_h<Y.pending_buf_size-5&&(ce=Y.pending_buf_size-5);;){if(Y.lookahead<=1){if(ee(Y),Y.lookahead===0&&re===f)return B;if(Y.lookahead===0)break}Y.strstart+=Y.lookahead,Y.lookahead=0;var ie=Y.block_start+ce;if((Y.strstart===0||Y.strstart>=ie)&&(Y.lookahead=Y.strstart-ie,Y.strstart=ie,V(Y,!1),Y.strm.avail_out===0)||Y.strstart-Y.block_start>=Y.w_size-Q&&(V(Y,!1),Y.strm.avail_out===0))return B}return Y.insert=0,re===g?(V(Y,!0),Y.strm.avail_out===0?F:R):(Y.strstart>Y.block_start&&(V(Y,!1),Y.strm.avail_out),B)}),new oe(4,4,8,4,q),new oe(4,5,16,8,q),new oe(4,6,32,32,q),new oe(4,4,16,16,$),new oe(8,16,32,32,$),new oe(8,16,128,128,$),new oe(8,32,128,256,$),new oe(32,128,258,1024,$),new oe(32,258,258,4096,$)],o.deflateInit=function(Y,re){return Ae(Y,re,b,15,8,0)},o.deflateInit2=Ae,o.deflateReset=ne,o.deflateResetKeep=ke,o.deflateSetHeader=function(Y,re){return Y&&Y.state?Y.state.wrap!==2?A:(Y.state.gzhead=re,k):A},o.deflate=function(Y,re){var ce,ie,J,he;if(!Y||!Y.state||5>8&255),Z(ie,ie.gzhead.time>>16&255),Z(ie,ie.gzhead.time>>24&255),Z(ie,ie.level===9?2:2<=ie.strategy||ie.level<2?4:0),Z(ie,255&ie.gzhead.os),ie.gzhead.extra&&ie.gzhead.extra.length&&(Z(ie,255&ie.gzhead.extra.length),Z(ie,ie.gzhead.extra.length>>8&255)),ie.gzhead.hcrc&&(Y.adler=u(Y.adler,ie.pending_buf,ie.pending,0)),ie.gzindex=0,ie.status=69):(Z(ie,0),Z(ie,0),Z(ie,0),Z(ie,0),Z(ie,0),Z(ie,ie.level===9?2:2<=ie.strategy||ie.level<2?4:0),Z(ie,3),ie.status=M);else{var pe=b+(ie.w_bits-8<<4)<<8;pe|=(2<=ie.strategy||ie.level<2?0:ie.level<6?1:ie.level===6?2:3)<<6,ie.strstart!==0&&(pe|=32),pe+=31-pe%31,ie.status=M,K(ie,pe),ie.strstart!==0&&(K(ie,Y.adler>>>16),K(ie,65535&Y.adler)),Y.adler=1}if(ie.status===69)if(ie.gzhead.extra){for(J=ie.pending;ie.gzindex<(65535&ie.gzhead.extra.length)&&(ie.pending!==ie.pending_buf_size||(ie.gzhead.hcrc&&ie.pending>J&&(Y.adler=u(Y.adler,ie.pending_buf,ie.pending-J,J)),H(Y),J=ie.pending,ie.pending!==ie.pending_buf_size));)Z(ie,255&ie.gzhead.extra[ie.gzindex]),ie.gzindex++;ie.gzhead.hcrc&&ie.pending>J&&(Y.adler=u(Y.adler,ie.pending_buf,ie.pending-J,J)),ie.gzindex===ie.gzhead.extra.length&&(ie.gzindex=0,ie.status=73)}else ie.status=73;if(ie.status===73)if(ie.gzhead.name){J=ie.pending;do{if(ie.pending===ie.pending_buf_size&&(ie.gzhead.hcrc&&ie.pending>J&&(Y.adler=u(Y.adler,ie.pending_buf,ie.pending-J,J)),H(Y),J=ie.pending,ie.pending===ie.pending_buf_size)){he=1;break}he=ie.gzindexJ&&(Y.adler=u(Y.adler,ie.pending_buf,ie.pending-J,J)),he===0&&(ie.gzindex=0,ie.status=91)}else ie.status=91;if(ie.status===91)if(ie.gzhead.comment){J=ie.pending;do{if(ie.pending===ie.pending_buf_size&&(ie.gzhead.hcrc&&ie.pending>J&&(Y.adler=u(Y.adler,ie.pending_buf,ie.pending-J,J)),H(Y),J=ie.pending,ie.pending===ie.pending_buf_size)){he=1;break}he=ie.gzindexJ&&(Y.adler=u(Y.adler,ie.pending_buf,ie.pending-J,J)),he===0&&(ie.status=103)}else ie.status=103;if(ie.status===103&&(ie.gzhead.hcrc?(ie.pending+2>ie.pending_buf_size&&H(Y),ie.pending+2<=ie.pending_buf_size&&(Z(ie,255&Y.adler),Z(ie,Y.adler>>8&255),Y.adler=0,ie.status=M)):ie.status=M),ie.pending!==0){if(H(Y),Y.avail_out===0)return ie.last_flush=-1,k}else if(Y.avail_in===0&&I(re)<=I(ce)&&re!==g)return N(Y,-5);if(ie.status===666&&Y.avail_in!==0)return N(Y,-5);if(Y.avail_in!==0||ie.lookahead!==0||re!==f&&ie.status!==666){var Le=ie.strategy===2?function(Be,ve){for(var ue;;){if(Be.lookahead===0&&(ee(Be),Be.lookahead===0)){if(ve===f)return B;break}if(Be.match_length=0,ue=l._tr_tally(Be,0,Be.window[Be.strstart]),Be.lookahead--,Be.strstart++,ue&&(V(Be,!1),Be.strm.avail_out===0))return B}return Be.insert=0,ve===g?(V(Be,!0),Be.strm.avail_out===0?F:R):Be.last_lit&&(V(Be,!1),Be.strm.avail_out===0)?B:P}(ie,re):ie.strategy===3?function(Be,ve){for(var ue,be,xe,Qe,Fe=Be.window;;){if(Be.lookahead<=E){if(ee(Be),Be.lookahead<=E&&ve===f)return B;if(Be.lookahead===0)break}if(Be.match_length=0,Be.lookahead>=S&&0Be.lookahead&&(Be.match_length=Be.lookahead)}if(Be.match_length>=S?(ue=l._tr_tally(Be,1,Be.match_length-S),Be.lookahead-=Be.match_length,Be.strstart+=Be.match_length,Be.match_length=0):(ue=l._tr_tally(Be,0,Be.window[Be.strstart]),Be.lookahead--,Be.strstart++),ue&&(V(Be,!1),Be.strm.avail_out===0))return B}return Be.insert=0,ve===g?(V(Be,!0),Be.strm.avail_out===0?F:R):Be.last_lit&&(V(Be,!1),Be.strm.avail_out===0)?B:P}(ie,re):s[ie.level].func(ie,re);if(Le!==F&&Le!==R||(ie.status=666),Le===B||Le===F)return Y.avail_out===0&&(ie.last_flush=-1),k;if(Le===P&&(re===1?l._tr_align(ie):re!==5&&(l._tr_stored_block(ie,0,0,!1),re===3&&(W(ie.head),ie.lookahead===0&&(ie.strstart=0,ie.block_start=0,ie.insert=0))),H(Y),Y.avail_out===0))return ie.last_flush=-1,k}return re!==g?k:ie.wrap<=0?1:(ie.wrap===2?(Z(ie,255&Y.adler),Z(ie,Y.adler>>8&255),Z(ie,Y.adler>>16&255),Z(ie,Y.adler>>24&255),Z(ie,255&Y.total_in),Z(ie,Y.total_in>>8&255),Z(ie,Y.total_in>>16&255),Z(ie,Y.total_in>>24&255)):(K(ie,Y.adler>>>16),K(ie,65535&Y.adler)),H(Y),0=ce.w_size&&(he===0&&(W(ce.head),ce.strstart=0,ce.block_start=0,ce.insert=0),ve=new a.Buf8(ce.w_size),a.arraySet(ve,re,ue-ce.w_size,ce.w_size,0),re=ve,ue=ce.w_size),pe=Y.avail_in,Le=Y.next_in,Be=Y.input,Y.avail_in=ue,Y.next_in=0,Y.input=re,ee(ce);ce.lookahead>=S;){for(ie=ce.strstart,J=ce.lookahead-(S-1);ce.ins_h=(ce.ins_h<>>=S=L>>>24,O-=S,(S=L>>>16&255)===0)P[h++]=65535&L;else{if(!(16&S)){if(!(64&S)){L=w[(65535&L)+(b&(1<>>=S,O-=S),O<15&&(b+=B[d++]<>>=S=L>>>24,O-=S,!(16&(S=L>>>16&255))){if(!(64&S)){L=y[(65535&L)+(b&(1<>>=S,O-=S,(S=h-f)>3,b&=(1<<(O-=E<<3))-1,s.next_in=d,s.next_out=h,s.avail_in=d>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function O(T){var M;return T&&T.state?(M=T.state,T.total_in=T.total_out=M.total=0,T.msg="",M.wrap&&(T.adler=1&M.wrap),M.mode=A,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new s.Buf32(m),M.distcode=M.distdyn=new s.Buf32(v),M.sane=1,M.back=-1,g):k}function w(T){var M;return T&&T.state?((M=T.state).wsize=0,M.whave=0,M.wnext=0,O(T)):k}function y(T,M){var B,P;return T&&T.state?(P=T.state,M<0?(B=0,M=-M):(B=1+(M>>4),M<48&&(M&=15)),M&&(M<8||15=R.wsize?(s.arraySet(R.window,M,B-R.wsize,R.wsize,0),R.wnext=0,R.whave=R.wsize):(P<(F=R.wsize-R.wnext)&&(F=P),s.arraySet(R.window,M,B-P,F,R.wnext),(P-=F)?(s.arraySet(R.window,M,B-P,P,0),R.wnext=P,R.whave=R.wsize):(R.wnext+=F,R.wnext===R.wsize&&(R.wnext=0),R.whave>>8&255,B.check=l(B.check,he,2,0),V=H=0,B.mode=2;break}if(B.flags=0,B.head&&(B.head.done=!1),!(1&B.wrap)||(((255&H)<<8)+(H>>8))%31){T.msg="incorrect header check",B.mode=30;break}if((15&H)!=8){T.msg="unknown compression method",B.mode=30;break}if(V-=4,Y=8+(15&(H>>>=4)),B.wbits===0)B.wbits=Y;else if(Y>B.wbits){T.msg="invalid window size",B.mode=30;break}B.dmax=1<>8&1),512&B.flags&&(he[0]=255&H,he[1]=H>>>8&255,B.check=l(B.check,he,2,0)),V=H=0,B.mode=3;case 3:for(;V<32;){if(I===0)break e;I--,H+=P[R++]<>>8&255,he[2]=H>>>16&255,he[3]=H>>>24&255,B.check=l(B.check,he,4,0)),V=H=0,B.mode=4;case 4:for(;V<16;){if(I===0)break e;I--,H+=P[R++]<>8),512&B.flags&&(he[0]=255&H,he[1]=H>>>8&255,B.check=l(B.check,he,2,0)),V=H=0,B.mode=5;case 5:if(1024&B.flags){for(;V<16;){if(I===0)break e;I--,H+=P[R++]<>>8&255,B.check=l(B.check,he,2,0)),V=H=0}else B.head&&(B.head.extra=null);B.mode=6;case 6:if(1024&B.flags&&(I<(X=B.length)&&(X=I),X&&(B.head&&(Y=B.head.extra_len-B.length,B.head.extra||(B.head.extra=new Array(B.head.extra_len)),s.arraySet(B.head.extra,P,R,X,Y)),512&B.flags&&(B.check=l(B.check,P,X,R)),I-=X,R+=X,B.length-=X),B.length))break e;B.length=0,B.mode=7;case 7:if(2048&B.flags){if(I===0)break e;for(X=0;Y=P[R+X++],B.head&&Y&&B.length<65536&&(B.head.name+=String.fromCharCode(Y)),Y&&X>9&1,B.head.done=!0),T.adler=B.check=0,B.mode=12;break;case 10:for(;V<32;){if(I===0)break e;I--,H+=P[R++]<>>=7&V,V-=7&V,B.mode=27;break}for(;V<3;){if(I===0)break e;I--,H+=P[R++]<>>=1)){case 0:B.mode=14;break;case 1:if(E(B),B.mode=20,M!==6)break;H>>>=2,V-=2;break e;case 2:B.mode=17;break;case 3:T.msg="invalid block type",B.mode=30}H>>>=2,V-=2;break;case 14:for(H>>>=7&V,V-=7&V;V<32;){if(I===0)break e;I--,H+=P[R++]<>>16^65535)){T.msg="invalid stored block lengths",B.mode=30;break}if(B.length=65535&H,V=H=0,B.mode=15,M===6)break e;case 15:B.mode=16;case 16:if(X=B.length){if(I>>=5,V-=5,B.ndist=1+(31&H),H>>>=5,V-=5,B.ncode=4+(15&H),H>>>=4,V-=4,286>>=3,V-=3}for(;B.have<19;)B.lens[pe[B.have++]]=0;if(B.lencode=B.lendyn,B.lenbits=7,ce={bits:B.lenbits},re=u(0,B.lens,0,19,B.lencode,0,B.work,ce),B.lenbits=ce.bits,re){T.msg="invalid code lengths set",B.mode=30;break}B.have=0,B.mode=19;case 19:for(;B.have>>16&255,de=65535&J,!(($=J>>>24)<=V);){if(I===0)break e;I--,H+=P[R++]<>>=$,V-=$,B.lens[B.have++]=de;else{if(de===16){for(ie=$+2;V>>=$,V-=$,B.have===0){T.msg="invalid bit length repeat",B.mode=30;break}Y=B.lens[B.have-1],X=3+(3&H),H>>>=2,V-=2}else if(de===17){for(ie=$+3;V>>=$)),H>>>=3,V-=3}else{for(ie=$+7;V>>=$)),H>>>=7,V-=7}if(B.have+X>B.nlen+B.ndist){T.msg="invalid bit length repeat",B.mode=30;break}for(;X--;)B.lens[B.have++]=Y}}if(B.mode===30)break;if(B.lens[256]===0){T.msg="invalid code -- missing end-of-block",B.mode=30;break}if(B.lenbits=9,ce={bits:B.lenbits},re=u(h,B.lens,0,B.nlen,B.lencode,0,B.work,ce),B.lenbits=ce.bits,re){T.msg="invalid literal/lengths set",B.mode=30;break}if(B.distbits=6,B.distcode=B.distdyn,ce={bits:B.distbits},re=u(f,B.lens,B.nlen,B.ndist,B.distcode,0,B.work,ce),B.distbits=ce.bits,re){T.msg="invalid distances set",B.mode=30;break}if(B.mode=20,M===6)break e;case 20:B.mode=21;case 21:if(6<=I&&258<=W){T.next_out=N,T.avail_out=W,T.next_in=R,T.avail_in=I,B.hold=H,B.bits=V,d(T,K),N=T.next_out,F=T.output,W=T.avail_out,R=T.next_in,P=T.input,I=T.avail_in,H=B.hold,V=B.bits,B.mode===12&&(B.back=-1);break}for(B.back=0;oe=(J=B.lencode[H&(1<>>16&255,de=65535&J,!(($=J>>>24)<=V);){if(I===0)break e;I--,H+=P[R++]<>ke)])>>>16&255,de=65535&J,!(ke+($=J>>>24)<=V);){if(I===0)break e;I--,H+=P[R++]<>>=ke,V-=ke,B.back+=ke}if(H>>>=$,V-=$,B.back+=$,B.length=de,oe===0){B.mode=26;break}if(32&oe){B.back=-1,B.mode=12;break}if(64&oe){T.msg="invalid literal/length code",B.mode=30;break}B.extra=15&oe,B.mode=22;case 22:if(B.extra){for(ie=B.extra;V>>=B.extra,V-=B.extra,B.back+=B.extra}B.was=B.length,B.mode=23;case 23:for(;oe=(J=B.distcode[H&(1<>>16&255,de=65535&J,!(($=J>>>24)<=V);){if(I===0)break e;I--,H+=P[R++]<>ke)])>>>16&255,de=65535&J,!(ke+($=J>>>24)<=V);){if(I===0)break e;I--,H+=P[R++]<>>=ke,V-=ke,B.back+=ke}if(H>>>=$,V-=$,B.back+=$,64&oe){T.msg="invalid distance code",B.mode=30;break}B.offset=de,B.extra=15&oe,B.mode=24;case 24:if(B.extra){for(ie=B.extra;V>>=B.extra,V-=B.extra,B.back+=B.extra}if(B.offset>B.dmax){T.msg="invalid distance too far back",B.mode=30;break}B.mode=25;case 25:if(W===0)break e;if(X=K-W,B.offset>X){if((X=B.offset-X)>B.whave&&B.sane){T.msg="invalid distance too far back",B.mode=30;break}ee=X>B.wnext?(X-=B.wnext,B.wsize-X):B.wnext-X,X>B.length&&(X=B.length),q=B.window}else q=F,ee=N-B.offset,X=B.length;for(Wx?(S=ee[q+v[M]],V[Z+v[M]]):(S=96,0),b=1<>N)+(O-=b)]=L<<24|S<<16|E|0,O!==0;);for(b=1<>=1;if(b!==0?(H&=b-1,H+=b):H=0,M++,--K[T]==0){if(T===P)break;T=f[g+v[M]]}if(F>>7)]}function Z(J,he){J.pending_buf[J.pending++]=255&he,J.pending_buf[J.pending++]=he>>>8&255}function K(J,he,pe){J.bi_valid>p-pe?(J.bi_buf|=he<>p-J.bi_valid,J.bi_valid+=pe-p):(J.bi_buf|=he<>>=1,pe<<=1,0<--he;);return pe>>>1}function q(J,he,pe){var Le,Be,ve=new Array(v+1),ue=0;for(Le=1;Le<=v;Le++)ve[Le]=ue=ue+pe[Le-1]<<1;for(Be=0;Be<=he;Be++){var be=J[2*Be+1];be!==0&&(J[2*Be]=ee(ve[be]++,be))}}function $(J){var he;for(he=0;he>1;1<=pe;pe--)ke(J,ve,pe);for(Be=xe;pe=J.heap[1],J.heap[1]=J.heap[J.heap_len--],ke(J,ve,1),Le=J.heap[1],J.heap[--J.heap_max]=pe,J.heap[--J.heap_max]=Le,ve[2*Be]=ve[2*pe]+ve[2*Le],J.depth[Be]=(J.depth[pe]>=J.depth[Le]?J.depth[pe]:J.depth[Le])+1,ve[2*pe+1]=ve[2*Le+1]=Be,J.heap[1]=Be++,ke(J,ve,1),2<=J.heap_len;);J.heap[--J.heap_max]=J.heap[1],function(Fe,Ge){var Xe,$e,vt,mt,rt,yt,Rt=Ge.dyn_tree,Ke=Ge.max_code,ze=Ge.stat_desc.static_tree,jt=Ge.stat_desc.has_stree,en=Ge.stat_desc.extra_bits,bt=Ge.stat_desc.extra_base,Dt=Ge.stat_desc.max_length,Ct=0;for(mt=0;mt<=v;mt++)Fe.bl_count[mt]=0;for(Rt[2*Fe.heap[Fe.heap_max]+1]=0,Xe=Fe.heap_max+1;Xe>=7;Be>>=1)if(1&Qe&&be.dyn_ltree[2*xe]!==0)return a;if(be.dyn_ltree[18]!==0||be.dyn_ltree[20]!==0||be.dyn_ltree[26]!==0)return l;for(xe=32;xe>>3,(ve=J.static_len+3+7>>>3)<=Be&&(Be=ve)):Be=ve=pe+5,pe+4<=Be&&he!==-1?ie(J,he,pe,Le):J.strategy===4||ve===Be?(K(J,2+(Le?1:0),3),ne(J,Q,T)):(K(J,4+(Le?1:0),3),function(be,xe,Qe,Fe){var Ge;for(K(be,xe-257,5),K(be,Qe-1,5),K(be,Fe-4,4),Ge=0;Ge>>8&255,J.pending_buf[J.d_buf+2*J.last_lit+1]=255&he,J.pending_buf[J.l_buf+J.last_lit]=255&pe,J.last_lit++,he===0?J.dyn_ltree[2*pe]++:(J.matches++,he--,J.dyn_ltree[2*(B[pe]+f+1)]++,J.dyn_dtree[2*V(he)]++),J.last_lit===J.lit_bufsize-1},o._tr_align=function(J){K(J,2,3),X(J,O,Q),function(he){he.bi_valid===16?(Z(he,he.bi_buf),he.bi_buf=0,he.bi_valid=0):8<=he.bi_valid&&(he.pending_buf[he.pending++]=255&he.bi_buf,he.bi_buf>>=8,he.bi_valid-=8)}(J)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(s){(function(a,l){if(!a.setImmediate){var d,u,h,f,g=1,k={},A=!1,m=a.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(a);v=v&&v.setTimeout?v:a,d={}.toString.call(a.process)==="[object process]"?function(w){process.nextTick(function(){b(w)})}:function(){if(a.postMessage&&!a.importScripts){var w=!0,y=a.onmessage;return a.onmessage=function(){w=!1},a.postMessage("","*"),a.onmessage=y,w}}()?(f="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",O,!1):a.attachEvent("onmessage",O),function(w){a.postMessage(f+w,"*")}):a.MessageChannel?((h=new MessageChannel).port1.onmessage=function(w){b(w.data)},function(w){h.port2.postMessage(w)}):m&&"onreadystatechange"in m.createElement("script")?(u=m.documentElement,function(w){var y=m.createElement("script");y.onreadystatechange=function(){b(w),y.onreadystatechange=null,u.removeChild(y),y=null},u.appendChild(y)}):function(w){setTimeout(b,0,w)},v.setImmediate=function(w){typeof w!="function"&&(w=new Function(""+w));for(var y=new Array(arguments.length-1),C=0;C"u"?s===void 0?this:s:self)}).call(this,typeof Xo<"u"?Xo:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})($Un);var ejn=$Un.exports;const tjn=bie(ejn);var kZo=P3e,vZo=ejn;Dre.openArrayBuffer=pZo;Dre.splitPath=bZo;Dre.joinPath=OZo;function pZo(e){return vZo.loadAsync(e).then(function(t){function n(a){return t.file(a)!==null}function r(a,l){return t.file(a).async("uint8array").then(function(d){if(l==="base64")return kZo.fromByteArray(d);if(l){var u=new TextDecoder(l);return u.decode(d)}else return d})}function o(a,l){t.file(a,l)}function s(){return t.generateAsync({type:"arraybuffer"})}return{exists:n,read:r,write:o,toArrayBuffer:s}})}function bZo(e){var t=e.lastIndexOf("/");return t===-1?{dirname:"",basename:e}:{dirname:e.substring(0,t),basename:e.substring(t+1)}}function OZo(){var e=Array.prototype.filter.call(arguments,function(n){return n}),t=[];return e.forEach(function(n){/^\//.test(n)?t=[n]:t.push(n)}),t.join("/")}var Xrt={},R6={},PZ={},M3e=Sh;PZ.Element=MZ;PZ.element=function(e,t,n){return new MZ(e,t,n)};PZ.text=function(e){return{type:"text",value:e}};var njn=PZ.emptyElement={first:function(){return null},firstOrEmpty:function(){return njn},attributes:{},children:[]};function MZ(e,t,n){this.type="element",this.name=e,this.attributes=t||{},this.children=n||[]}MZ.prototype.first=function(e){return M3e.find(this.children,function(t){return t.name===e})};MZ.prototype.firstOrEmpty=function(e){return this.first(e)||njn};MZ.prototype.getElementsByTagName=function(e){var t=M3e.filter(this.children,function(n){return n.name===e});return ijn(t)};MZ.prototype.text=function(){if(this.children.length===0)return"";if(this.children.length!==1||this.children[0].type!=="text")throw new Error("Not implemented");return this.children[0].value};var wZo={getElementsByTagName:function(e){return ijn(M3e.flatten(this.map(function(t){return t.getElementsByTagName(e)},!0)))}};function ijn(e){return M3e.extend(e,wZo)}var rjn={},qrt={},R3e={},gC={},I6={};function yZo(e,t,n){if(n===void 0&&(n=Array.prototype),e&&typeof n.find=="function")return n.find.call(e,t);for(var r=0;r=0&&e=0){for(var o=t.length-1;r0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e)return r}t=t.nodeType==$V?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==$V?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return t==null}};function kjn(e){return e=="<"&&"<"||e==">"&&">"||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}Qre(Fk,gc);Qre(Fk,gc.prototype);function nte(e,t){if(t(e))return!0;if(e=e.firstChild)do if(nte(e,t))return!0;while(e=e.nextSibling)}function Bre(){this.ownerDocument=this}function QZo(e,t,n){e&&e._inc++;var r=n.namespaceURI;r===tte.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function vjn(e,t,n,r){e&&e._inc++;var o=n.namespaceURI;o===tte.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function Jrt(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var o=t.firstChild,s=0;o;)r[s++]=o,o=o.nextSibling;r.length=s,delete r[r.length]}}}function pjn(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,Jrt(e.ownerDocument,e),t}function BZo(e){return e&&(e.nodeType===gc.DOCUMENT_NODE||e.nodeType===gc.DOCUMENT_FRAGMENT_NODE||e.nodeType===gc.ELEMENT_NODE)}function FZo(e){return e&&(Cy(e)||_rt(e)||c6(e)||e.nodeType===gc.DOCUMENT_FRAGMENT_NODE||e.nodeType===gc.COMMENT_NODE||e.nodeType===gc.PROCESSING_INSTRUCTION_NODE)}function c6(e){return e&&e.nodeType===gc.DOCUMENT_TYPE_NODE}function Cy(e){return e&&e.nodeType===gc.ELEMENT_NODE}function _rt(e){return e&&e.nodeType===gc.TEXT_NODE}function q6t(e,t){var n=e.childNodes||[];if(yy(n,Cy)||c6(t))return!1;var r=yy(n,c6);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function G6t(e,t){var n=e.childNodes||[];function r(s){return Cy(s)&&s!==t}if(yy(n,r))return!1;var o=yy(n,c6);return!(t&&o&&n.indexOf(o)>n.indexOf(t))}function PZo(e,t,n){if(!BZo(e))throw new uh(z0,"Unexpected parent node type "+e.nodeType);if(n&&n.parentNode!==e)throw new uh(fjn,"child not in parent");if(!FZo(t)||c6(t)&&e.nodeType!==gc.DOCUMENT_NODE)throw new uh(z0,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function MZo(e,t,n){var r=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===gc.DOCUMENT_FRAGMENT_NODE){var s=o.filter(Cy);if(s.length>1||yy(o,_rt))throw new uh(z0,"More than one element or text in fragment");if(s.length===1&&!q6t(e,n))throw new uh(z0,"Element in fragment can not be inserted before doctype")}if(Cy(t)&&!q6t(e,n))throw new uh(z0,"Only one element can be added and only after doctype");if(c6(t)){if(yy(r,c6))throw new uh(z0,"Only one doctype is allowed");var a=yy(r,Cy);if(n&&r.indexOf(a)1||yy(o,_rt))throw new uh(z0,"More than one element or text in fragment");if(s.length===1&&!G6t(e,n))throw new uh(z0,"Element in fragment can not be inserted before doctype")}if(Cy(t)&&!G6t(e,n))throw new uh(z0,"Only one element can be added and only after doctype");if(c6(t)){if(yy(r,function(d){return c6(d)&&d!==n}))throw new uh(z0,"Only one doctype is allowed");var a=yy(r,Cy);if(n&&r.indexOf(a)0&&nte(n.documentElement,function(o){if(o!==n&&o.nodeType===i4){var s=o.getAttribute("class");if(s){var a=e===s;if(!a){var l=z6t(s);a=t.every(TZo(l))}a&&r.push(o)}}}),r})},createElement:function(e){var t=new JP;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new v8;var n=t.attributes=new ske;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new N3e;return e.ownerDocument=this,e.childNodes=new v8,e},createTextNode:function(e){var t=new $rt;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new eot;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new tot;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new iot;return n.ownerDocument=this,n.tagName=n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new lke;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new not;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new JP,r=t.split(":"),o=n.attributes=new ske;return n.childNodes=new v8,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,o._ownerElement=n,n},createAttributeNS:function(e,t){var n=new lke,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}};Bk(Bre,gc);function JP(){this._nsMap={}}JP.prototype={nodeType:i4,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===l6?this.insertBefore(e,null):RZo(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new ez(this,function(t){var n=[];return nte(t,function(r){r!==t&&r.nodeType==i4&&(e==="*"||r.tagName==e)&&n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new ez(this,function(n){var r=[];return nte(n,function(o){o!==n&&o.nodeType===i4&&(e==="*"||o.namespaceURI===e)&&(t==="*"||o.localName==t)&&r.push(o)}),r})}};Bre.prototype.getElementsByTagName=JP.prototype.getElementsByTagName;Bre.prototype.getElementsByTagNameNS=JP.prototype.getElementsByTagNameNS;Bk(JP,gc);function lke(){}lke.prototype.nodeType=$V;Bk(lke,gc);function Fre(){}Fre.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(Rf[z0])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){var r=this.data.substring(0,e),o=this.data.substring(e+t);n=r+n+o,this.nodeValue=this.data=n,this.length=n.length}};Bk(Fre,gc);function $rt(){}$rt.prototype={nodeName:"#text",nodeType:oke,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}};Bk($rt,Fre);function eot(){}eot.prototype={nodeName:"#comment",nodeType:ujn};Bk(eot,Fre);function tot(){}tot.prototype={nodeName:"#cdata-section",nodeType:ljn};Bk(tot,Fre);function I3e(){}I3e.prototype.nodeType=Ajn;Bk(I3e,gc);function Ojn(){}Ojn.prototype.nodeType=DZo;Bk(Ojn,gc);function wjn(){}wjn.prototype.nodeType=EZo;Bk(wjn,gc);function not(){}not.prototype.nodeType=cjn;Bk(not,gc);function N3e(){}N3e.prototype.nodeName="#document-fragment";N3e.prototype.nodeType=l6;Bk(N3e,gc);function iot(){}iot.prototype.nodeType=djn;Bk(iot,gc);function yjn(){}yjn.prototype.serializeToString=function(e,t,n){return Cjn.call(e,t,n)};gc.prototype.toString=Cjn;function Cjn(e,t){var n=[],r=this.nodeType==9&&this.documentElement||this,o=r.prefix,s=r.namespaceURI;if(s&&o==null){var o=r.lookupPrefix(s);if(o==null)var a=[{namespace:s,prefix:null}]}return qU(this,n,e,t,a),n.join("")}function K6t(e,t,n){var r=e.prefix||"",o=e.namespaceURI;if(!o||r==="xml"&&o===tte.XML||o===tte.XMLNS)return!1;for(var s=n.length;s--;){var a=n[s];if(a.prefix===r)return a.namespace!==o}return!0}function T5e(e,t,n){e.push(" ",t,'="',n.replace(/[<>&"\t\n\r]/g,kjn),'"')}function qU(e,t,n,r,o){if(o||(o=[]),r)if(e=r(e),e){if(typeof e=="string"){t.push(e);return}}else return;switch(e.nodeType){case i4:var s=e.attributes,a=s.length,p=e.firstChild,l=e.tagName;n=tte.isHTML(e.namespaceURI)||n;var d=l;if(!n&&!e.prefix&&e.namespaceURI){for(var u,h=0;h=0;f--){var g=o[f];if(g.prefix===""&&g.namespace===e.namespaceURI){u=g.namespace;break}}if(u!==e.namespaceURI)for(var f=o.length-1;f>=0;f--){var g=o[f];if(g.namespace===e.namespaceURI){g.prefix&&(d=g.prefix+":"+l);break}}}t.push("<",d);for(var k=0;k"),n&&/^script$/i.test(l))for(;p;)p.data?t.push(p.data):qU(p,t,n,r,o.slice()),p=p.nextSibling;else for(;p;)qU(p,t,n,r,o.slice()),p=p.nextSibling;t.push("")}else t.push("/>");return;case hjn:case l6:for(var p=e.firstChild;p;)qU(p,t,n,r,o.slice()),p=p.nextSibling;return;case $V:return T5e(t,e.name,e.value);case oke:return t.push(e.data.replace(/[<&>]/g,kjn));case ljn:return t.push("");case ujn:return t.push("\x3C!--",e.data,"-->");case Ajn:var b=e.publicId,O=e.systemId;if(t.push("");else if(O&&O!=".")t.push(" SYSTEM ",O,">");else{var w=e.internalSubset;w&&t.push(" [",w,"]"),t.push(">")}return;case djn:return t.push("");case cjn:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function xjn(e,t,n){var r;switch(t.nodeType){case i4:r=t.cloneNode(!1),r.ownerDocument=e;case l6:break;case $V:n=!0;break}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var o=t.firstChild;o;)r.appendChild(xjn(e,o,n)),o=o.nextSibling;return r}function BXe(e,t,n){var r=new t.constructor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=t[o];typeof s!="object"&&s!=r[o]&&(r[o]=s)}switch(t.childNodes&&(r.childNodes=new v8),r.ownerDocument=e,r.nodeType){case i4:var a=t.attributes,l=r.attributes=new ske,d=a.length;l._ownerElement=r;for(var u=0;u",lt:"<",quot:'"'}),e.HTML_ENTITIES=t({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),e.entityMap=e.HTML_ENTITIES})(Sjn);var rot={},rte=I6.NAMESPACE,FXe=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,J6t=new RegExp("[\\-\\.0-9"+FXe.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),_6t=new RegExp("^"+FXe.source+J6t.source+"*(?::"+FXe.source+J6t.source+"*)?$"),rq=0,E9=1,sN=2,oq=3,aN=4,lN=5,sq=6,tde=7;function tz(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,tz)}tz.prototype=new Error;tz.prototype.name=tz.name;function Tjn(){}Tjn.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),Ejn(t,t={}),IZo(e,t,n,r,this.errorHandler),r.endDocument()}};function IZo(e,t,n,r,o){function s(F){if(F>65535){F-=65536;var R=55296+(F>>10),N=56320+(F&1023);return String.fromCharCode(R,N)}else return String.fromCharCode(F)}function a(F){var R=F.slice(1,-1);return Object.hasOwnProperty.call(n,R)?n[R]:R.charAt(0)==="#"?s(parseInt(R.substr(1).replace("x","0x"))):(o.error("entity not found:"+F),F)}function l(F){if(F>m){var R=e.substring(m,F).replace(/&#?\w+;/g,a);g&&d(m),r.characters(R,0,F-m),m=F}}function d(F,R){for(;F>=h&&(R=f.exec(e));)u=R.index,h=u+R[0].length,g.lineNumber++;g.columnNumber=F-u+1}for(var u=0,h=0,f=/.*(?:\r\n?|\n)|.*$/g,g=r.locator,k=[{currentNSMap:t}],A={},m=0;;){try{var v=e.indexOf("<",m);if(v<0){if(!e.substr(m).match(/^\s*$/)){var p=r.doc,b=p.createTextNode(e.substr(m));p.appendChild(b),r.currentElement=b}return}switch(v>m&&l(v),e.charAt(v+1)){case"/":var Q=e.indexOf(">",v+3),O=e.substring(v+2,Q).replace(/[ \t\n\r]+$/g,""),w=k.pop();Q<0?(O=e.substring(v+2).replace(/[\s<].*/,""),o.error("end tag name: "+O+" is not complete:"+w.tagName),Q=v+1+O.length):O.match(/\sm?m=Q:l(Math.max(v,m)+1)}}function $6t(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function NZo(e,t,n,r,o,s){function a(g,k,A){n.attributeNames.hasOwnProperty(g)&&s.fatalError("Attribute "+g+" redefined"),n.addValue(g,k.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,o),A)}for(var l,d,u=++t,h=rq;;){var f=e.charAt(u);switch(f){case"=":if(h===E9)l=e.slice(t,u),h=oq;else if(h===sN)h=oq;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(h===oq||h===E9)if(h===E9&&(s.warning('attribute value must after "="'),l=e.slice(t,u)),t=u+1,u=e.indexOf(f,t),u>0)d=e.slice(t,u),a(l,d,t-1),h=lN;else throw new Error("attribute value no end '"+f+"' match");else if(h==aN)d=e.slice(t,u),a(l,d,t),s.warning('attribute "'+l+'" missed start quot('+f+")!!"),t=u+1,h=lN;else throw new Error('attribute value must after "="');break;case"/":switch(h){case rq:n.setTagName(e.slice(t,u));case lN:case sq:case tde:h=tde,n.closed=!0;case aN:case E9:break;case sN:n.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),h==rq&&n.setTagName(e.slice(t,u)),u;case">":switch(h){case rq:n.setTagName(e.slice(t,u));case lN:case sq:case tde:break;case aN:case E9:d=e.slice(t,u),d.slice(-1)==="/"&&(n.closed=!0,d=d.slice(0,-1));case sN:h===sN&&(d=l),h==aN?(s.warning('attribute "'+d+'" missed quot(")!'),a(l,d,t)):((!rte.isHTML(r[""])||!d.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),a(d,d,t));break;case oq:throw new Error("attribute value missed!!")}return u;case"€":f=" ";default:if(f<=" ")switch(h){case rq:n.setTagName(e.slice(t,u)),h=sq;break;case E9:l=e.slice(t,u),h=sN;break;case aN:var d=e.slice(t,u);s.warning('attribute "'+d+'" missed quot(")!!'),a(l,d,t);case lN:h=sq;break}else switch(h){case sN:n.tagName,(!rte.isHTML(r[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),a(l,l,t),t=u,h=E9;break;case lN:s.warning('attribute space is required"'+l+'"!!');case sq:h=E9,t=u;break;case oq:h=aN,t=u;break;case tde:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function e9t(e,t,n){for(var r=e.tagName,o=null,f=e.length;f--;){var s=e[f],a=s.qName,l=s.value,g=a.indexOf(":");if(g>0)var d=s.prefix=a.slice(0,g),u=a.slice(g+1),h=d==="xmlns"&&u;else u=a,d=null,h=a==="xmlns"&&"";s.localName=u,h!==!1&&(o==null&&(o={},Ejn(n,n={})),n[h]=o[h]=l,s.uri=rte.XMLNS,t.startPrefixMapping(h,l))}for(var f=e.length;f--;){s=e[f];var d=s.prefix;d&&(d==="xml"&&(s.uri=rte.XML),d!=="xmlns"&&(s.uri=n[d||""]))}var g=r.indexOf(":");g>0?(d=e.prefix=r.slice(0,g),u=e.localName=r.slice(g+1)):(d=null,u=e.localName=r);var k=e.uri=n[d||""];if(t.startElement(k,u,r,e),e.closed){if(t.endElement(k,u,r),o)for(d in o)Object.prototype.hasOwnProperty.call(o,d)&&t.endPrefixMapping(d)}else return e.currentNSMap=n,e.localNSMap=o,!0}function UZo(e,t,n,r,o){if(/^(?:script|textarea)$/i.test(n)){var s=e.indexOf("",t),a=e.substring(t+1,s);if(/[&<]/.test(a))return/^script$/i.test(n)?(o.characters(a,0,a.length),s):(a=a.replace(/&#?\w+;/g,r),o.characters(a,0,a.length),s)}return t+1}function jZo(e,t,n,r){var o=r[n];return o==null&&(o=e.lastIndexOf(""),o",t+4);return s>t?(n.comment(e,t+4,s-t-4),s+3):(r.error("Unclosed comment"),-1)}else return-1;default:if(e.substr(t+3,6)=="CDATA["){var s=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,s-t-9),n.endCDATA(),s+3}var a=VZo(e,t),l=a.length;if(l>1&&/!doctype/i.test(a[0][0])){var d=a[1][0],u=!1,h=!1;l>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],h=l>4&&a[4][0]):/^system$/i.test(a[2][0])&&(h=a[3][0]));var f=a[l-1];return n.startDTD(d,u,h),n.endDTD(),f.index+f[0].length}}return-1}function HZo(e,t,n){var r=e.indexOf("?>",t);if(r){var o=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return o?(o[0].length,n.processingInstruction(o[1],o[2]),r+2):-1}return-1}function Djn(){this.attributeNames={}}Djn.prototype={setTagName:function(e){if(!_6t.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!_6t.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function VZo(e,t){var n,r=[],o=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(o.lastIndex=t,o.exec(e);n=o.exec(e);)if(r.push(n),n[1])return r}rot.XMLReader=Tjn;rot.ParseError=tz;var zZo=I6,ZZo=gC,t9t=Sjn,Qjn=rot,YZo=ZZo.DOMImplementation,n9t=zZo.NAMESPACE,XZo=Qjn.ParseError,qZo=Qjn.XMLReader;function Bjn(e){return e.replace(/\r[\n\u0085]/g,` `).replace(/[\r\u0085\u2028]/g,` `)}function Fjn(e){this.options=e||{locator:{}}}Fjn.prototype.parseFromString=function(e,t){var n=this.options,r=new qZo,o=n.domBuilder||new Pre,s=n.errorHandler,a=n.locator,l=n.xmlns||{},d=/\/x?html?$/.test(t),u=d?t9t.HTML_ENTITIES:t9t.XML_ENTITIES;a&&o.setDocumentLocator(a),r.errorHandler=GZo(s,o,a),r.domBuilder=n.domBuilder||o,d&&(l[""]=n9t.HTML),l.xml=l.xml||n9t.XML;var h=n.normalizeLineEndings||Bjn;return e&&typeof e=="string"?r.parse(h(e),l,u):r.errorHandler.error("invalid doc source"),o.doc};function GZo(e,t,n){if(!e){if(t instanceof Pre)return t;e=t}var r={},o=e instanceof Function;n=n||{};function s(a){var l=e[a];!l&&o&&(l=e.length==2?function(d){e(a,d)}:e),r[a]=l&&function(d){l("[xmldom "+a+"] "+d+PXe(n))}||function(){}}return s("warning"),s("error"),s("fatalError"),r}function Pre(){this.cdata=!1}function cN(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}Pre.prototype={startDocument:function(){this.doc=new YZo().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var o=this.doc,s=o.createElementNS(e,n||t),a=r.length;nde(this,s),this.currentElement=s,this.locator&&cN(this.locator,s);for(var l=0;l=t+n||t?new java.lang.String(e,t,n)+"":e}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){Pre.prototype[e]=function(){return null}});function nde(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}U3e.__DOMHandler=Pre;U3e.normalizeLineEndings=Bjn;U3e.DOMParser=Fjn;var Pjn=gC;R3e.DOMImplementation=Pjn.DOMImplementation;R3e.XMLSerializer=Pjn.XMLSerializer;R3e.DOMParser=U3e.DOMParser;var KZo=R3e,JZo=gC;function _Zo(e){var t=null,n=new KZo.DOMParser({errorHandler:function(o,s){t={level:o,message:s}}}),r=n.parseFromString(e);if(t===null)return r;throw new Error(t.level+": "+t.message)}qrt.parseFromString=_Zo;qrt.Node=JZo.Node;var E5e=Wf,r9t=Sh,Mjn=qrt,Rjn=PZ,$Zo=Rjn.Element;rjn.readString=eYo;var o9t=Mjn.Node;function eYo(e,t){t=t||{};try{var n=Mjn.parseFromString(e,"text/xml")}catch(a){return E5e.reject(a)}if(n.documentElement.tagName==="parsererror")return E5e.resolve(new Error(n.documentElement.textContent));function r(a){switch(a.nodeType){case o9t.ELEMENT_NODE:return o(a);case o9t.TEXT_NODE:return Rjn.text(a.nodeValue)}}function o(a){var l=s(a),d=[];r9t.forEach(a.childNodes,function(h){var f=r(h);f&&d.push(f)});var u={};return r9t.forEach(a.attributes,function(h){u[s(h)]=h.value}),new $Zo(l,u,d)}function s(a){if(a.namespaceURI){var l=t[a.namespaceURI],d;return l?d=l+":":d="{"+a.namespaceURI+"}",d+a.localName}else return a.localName}return E5e.resolve(r(n.documentElement))}var Ijn={},mG={},dx={},s9t;function QE(){return s9t||(s9t=1,(function(){var e,t,n,r,o,s,a,l=[].slice,d={}.hasOwnProperty;e=function(){var u,h,f,g,k,A;if(A=arguments[0],k=2<=arguments.length?l.call(arguments,1):[],o(Object.assign))Object.assign.apply(null,arguments);else for(u=0,f=k.length;u":"attribute: {"+t+"}, parent: <"+this.parent.name+">"},e}()}).call(Xo)),F5e.exports}var l9t;function j3e(){return l9t||(l9t=1,(function(){var e,t,n,r,o,s,a=function(d,u){for(var h in u)l.call(u,h)&&(d[h]=u[h]);function f(){this.constructor=d}return f.prototype=u.prototype,d.prototype=new f,d.__super__=u.prototype,d},l={}.hasOwnProperty;s=QE(),o=s.isObject,r=s.isFunction,n=s.getValue,t=Pk(),e=Njn(),B5e.exports=function(d){a(u,d);function u(h,f,g){if(u.__super__.constructor.call(this,h),f==null)throw new Error("Missing element name. "+this.debugInfo());this.name=this.stringify.eleName(f),this.attributes={},g!=null&&this.attribute(g),h.isDocument&&(this.isRoot=!0,this.documentObject=h,h.rootObject=this)}return u.prototype.clone=function(){var h,f,g,k;g=Object.create(this),g.isRoot&&(g.documentObject=null),g.attributes={},k=this.attributes;for(f in k)l.call(k,f)&&(h=k[f],g.attributes[f]=h.clone());return g.children=[],this.children.forEach(function(A){var m;return m=A.clone(),m.parent=g,g.children.push(m)}),g},u.prototype.attribute=function(h,f){var g,k;if(h!=null&&(h=n(h)),o(h))for(g in h)l.call(h,g)&&(k=h[g],this.attribute(g,k));else r(f)&&(f=f.apply()),(!this.options.skipNullAttributes||f!=null)&&(this.attributes[h]=new e(this,h,f));return this},u.prototype.removeAttribute=function(h){var f,g,k;if(h==null)throw new Error("Missing attribute name. "+this.debugInfo());if(h=n(h),Array.isArray(h))for(g=0,k=h.length;g0&&this.parent.children[v-1].isDummy;)v=v-1;if(v<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[v-1]},m.prototype.next=function(){var v;for(v=this.parent.children.indexOf(this);v":(b=this.parent)!=null&&b.name?"node: <"+v+">, parent: <"+this.parent.name+">":"node: <"+v+">"},m.prototype.ele=function(v,p,b){return this.element(v,p,b)},m.prototype.nod=function(v,p,b){return this.node(v,p,b)},m.prototype.txt=function(v){return this.text(v)},m.prototype.dat=function(v){return this.cdata(v)},m.prototype.com=function(v){return this.comment(v)},m.prototype.ins=function(v,p){return this.instruction(v,p)},m.prototype.doc=function(){return this.document()},m.prototype.dec=function(v,p,b){return this.declaration(v,p,b)},m.prototype.dtd=function(v,p){return this.doctype(v,p)},m.prototype.e=function(v,p,b){return this.element(v,p,b)},m.prototype.n=function(v,p,b){return this.node(v,p,b)},m.prototype.t=function(v){return this.text(v)},m.prototype.d=function(v){return this.cdata(v)},m.prototype.c=function(v){return this.comment(v)},m.prototype.r=function(v){return this.raw(v)},m.prototype.i=function(v,p){return this.instruction(v,p)},m.prototype.u=function(){return this.up()},m.prototype.importXMLBuilder=function(v){return this.importDocument(v)},m}()}).call(Xo)),Q5e.exports}var Y5e={exports:{}},w9t;function Ujn(){return w9t||(w9t=1,(function(){var e=function(n,r){return function(){return n.apply(r,arguments)}},t={}.hasOwnProperty;Y5e.exports=function(){function n(r){this.assertLegalChar=e(this.assertLegalChar,this);var o,s,a;r||(r={}),this.noDoubleEncoding=r.noDoubleEncoding,s=r.stringify||{};for(o in s)t.call(s,o)&&(a=s[o],this[o]=a)}return n.prototype.eleName=function(r){return r=""+r||"",this.assertLegalChar(r)},n.prototype.eleText=function(r){return r=""+r||"",this.assertLegalChar(this.elEscape(r))},n.prototype.cdata=function(r){return r=""+r||"",r=r.replace("]]>","]]]]>"),this.assertLegalChar(r)},n.prototype.comment=function(r){if(r=""+r||"",r.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+r);return this.assertLegalChar(r)},n.prototype.raw=function(r){return""+r||""},n.prototype.attName=function(r){return r=""+r||""},n.prototype.attValue=function(r){return r=""+r||"",this.attEscape(r)},n.prototype.insTarget=function(r){return""+r||""},n.prototype.insValue=function(r){if(r=""+r||"",r.match(/\?>/))throw new Error("Invalid processing instruction value: "+r);return r},n.prototype.xmlVersion=function(r){if(r=""+r||"",!r.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+r);return r},n.prototype.xmlEncoding=function(r){if(r=""+r||"",!r.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+r);return r},n.prototype.xmlStandalone=function(r){return r?"yes":"no"},n.prototype.dtdPubID=function(r){return""+r||""},n.prototype.dtdSysID=function(r){return""+r||""},n.prototype.dtdElementValue=function(r){return""+r||""},n.prototype.dtdAttType=function(r){return""+r||""},n.prototype.dtdAttDefault=function(r){return r!=null?""+r||"":r},n.prototype.dtdEntityValue=function(r){return""+r||""},n.prototype.dtdNData=function(r){return""+r||""},n.prototype.convertAttKey="@",n.prototype.convertPIKey="?",n.prototype.convertTextKey="#text",n.prototype.convertCDataKey="#cdata",n.prototype.convertCommentKey="#comment",n.prototype.convertRawKey="#raw",n.prototype.assertLegalChar=function(r){var o;if(o=r.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),o)throw new Error("Invalid character in string: "+r+" at index "+o.index);return r},n.prototype.elEscape=function(r){var o;return o=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,r.replace(o,"&").replace(//g,">").replace(/\r/g," ")},n.prototype.attEscape=function(r){var o;return o=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,r.replace(o,"&").replace(/0?new Array(r).join(this.indent):""):""},t}()}).call(Xo)),q5e.exports}var C9t;function sot(){return C9t||(C9t=1,(function(){var e,t,n,r,o,s,a,l,d,u,h,f,g,k,A=function(v,p){for(var b in p)m.call(p,b)&&(v[b]=p[b]);function O(){this.constructor=v}return O.prototype=p.prototype,v.prototype=new O,v.__super__=p.prototype,v},m={}.hasOwnProperty;a=V3e(),l=q3e(),e=W3e(),t=H3e(),u=j3e(),f=G3e(),g=K3e(),h=J3e(),d=oot(),n=z3e(),r=Y3e(),o=Z3e(),s=X3e(),k=jjn(),X5e.exports=function(v){A(p,v);function p(b){p.__super__.constructor.call(this,b)}return p.prototype.document=function(b){var O,w,y,C,x;for(this.textispresent=!1,C="",x=b.children,w=0,y=x.length;w"+this.newline},p.prototype.comment=function(b,O){return this.space(O)+"\x3C!-- "+b.text+" -->"+this.newline},p.prototype.declaration=function(b,O){var w;return w=this.space(O),w+='",w+=this.newline,w},p.prototype.docType=function(b,O){var w,y,C,x,L;if(O||(O=0),x=this.space(O),x+="0){for(x+=" [",x+=this.newline,L=b.children,y=0,C=L.length;y",x+=this.newline,x},p.prototype.element=function(b,O){var w,y,C,x,L,S,E,Q,T,M,B,P,F;O||(O=0),F=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),P=this.space(O),Q="",Q+=P+"<"+b.name,T=b.attributes;for(E in T)m.call(T,E)&&(w=T[E],Q+=this.attribute(w));if(b.children.length===0||b.children.every(function(R){return R.value===""}))this.allowEmpty?Q+=">"+this.newline:Q+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&b.children.length===1&&b.children[0].value!=null)Q+=">",Q+=b.children[0].value,Q+=""+this.newline;else{if(this.dontprettytextnodes){for(M=b.children,C=0,L=M.length;C"+this.newline,B=b.children,x=0,S=B.length;x"+this.newline}return Q},p.prototype.processingInstruction=function(b,O){var w;return w=this.space(O)+""+this.newline,w},p.prototype.raw=function(b,O){return this.space(O)+b.value+this.newline},p.prototype.text=function(b,O){return this.space(O)+b.value+this.newline},p.prototype.dtdAttList=function(b,O){var w;return w=this.space(O)+""+this.newline,w},p.prototype.dtdElement=function(b,O){return this.space(O)+""+this.newline},p.prototype.dtdEntity=function(b,O){var w;return w=this.space(O)+""+this.newline,w},p.prototype.dtdNotation=function(b,O){var w;return w=this.space(O)+""+this.newline,w},p.prototype.openNode=function(b,O){var w,y,C,x;if(O||(O=0),b instanceof u){C=this.space(O)+"<"+b.name,x=b.attributes;for(y in x)m.call(x,y)&&(w=x[y],C+=this.attribute(w));return C+=(b.children?">":"/>")+this.newline,C}else return C=this.space(O)+"")+this.newline,C},p.prototype.closeNode=function(b,O){switch(O||(O=0),!1){case!(b instanceof u):return this.space(O)+""+this.newline;case!(b instanceof l):return this.space(O)+"]>"+this.newline}},p}(k)}).call(Xo)),X5e.exports}var x9t;function tYo(){return x9t||(x9t=1,(function(){var e,t,n,r,o=function(a,l){for(var d in l)s.call(l,d)&&(a[d]=l[d]);function u(){this.constructor=a}return u.prototype=l.prototype,a.prototype=new u,a.__super__=l.prototype,a},s={}.hasOwnProperty;r=QE().isPlainObject,e=Pk(),n=Ujn(),t=sot(),D5e.exports=function(a){o(l,a);function l(d){l.__super__.constructor.call(this,null),this.name="?xml",d||(d={}),d.writer||(d.writer=new t),this.options=d,this.stringify=new n(d),this.isDocument=!0}return l.prototype.end=function(d){var u;return d?r(d)&&(u=d,d=this.options.writer.set(u)):d=this.options.writer,d.document(this)},l.prototype.toString=function(d){return this.options.writer.set(d).document(this)},l}(e)}).call(Xo)),D5e.exports}var G5e={exports:{}},L9t;function nYo(){return L9t||(L9t=1,(function(){var e,t,n,r,o,s,a,l,d,u,h,f,g,k,A,m,v,p,b,O,w={}.hasOwnProperty;O=QE(),p=O.isObject,v=O.isFunction,b=O.isPlainObject,m=O.getValue,u=j3e(),t=W3e(),n=H3e(),f=G3e(),A=K3e(),h=J3e(),l=V3e(),d=q3e(),r=z3e(),s=Z3e(),o=Y3e(),a=X3e(),e=Njn(),k=Ujn(),g=sot(),G5e.exports=function(){function y(C,x,L){var S;this.name="?xml",C||(C={}),C.writer?b(C.writer)&&(S=C.writer,C.writer=new g(S)):C.writer=new g(C),this.options=C,this.writer=C.writer,this.stringify=new k(C),this.onDataCallback=x||function(){},this.onEndCallback=L||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return y.prototype.node=function(C,x,L){var S,E;if(C==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(C));return this.openCurrent(),C=m(C),x===null&&L==null&&(S=[{},null],x=S[0],L=S[1]),x==null&&(x={}),x=m(x),p(x)||(E=[x,L],L=E[0],x=E[1]),this.currentNode=new u(this,C,x),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,L!=null&&this.text(L),this},y.prototype.element=function(C,x,L){return this.currentNode&&this.currentNode instanceof d?this.dtdElement.apply(this,arguments):this.node(C,x,L)},y.prototype.attribute=function(C,x){var L,S;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(C));if(C!=null&&(C=m(C)),p(C))for(L in C)w.call(C,L)&&(S=C[L],this.attribute(L,S));else v(x)&&(x=x.apply()),(!this.options.skipNullAttributes||x!=null)&&(this.currentNode.attributes[C]=new e(this,C,x));return this},y.prototype.text=function(C){var x;return this.openCurrent(),x=new A(this,C),this.onData(this.writer.text(x,this.currentLevel+1),this.currentLevel+1),this},y.prototype.cdata=function(C){var x;return this.openCurrent(),x=new t(this,C),this.onData(this.writer.cdata(x,this.currentLevel+1),this.currentLevel+1),this},y.prototype.comment=function(C){var x;return this.openCurrent(),x=new n(this,C),this.onData(this.writer.comment(x,this.currentLevel+1),this.currentLevel+1),this},y.prototype.raw=function(C){var x;return this.openCurrent(),x=new f(this,C),this.onData(this.writer.raw(x,this.currentLevel+1),this.currentLevel+1),this},y.prototype.instruction=function(C,x){var L,S,E,Q,T;if(this.openCurrent(),C!=null&&(C=m(C)),x!=null&&(x=m(x)),Array.isArray(C))for(L=0,Q=C.length;L=0;)this.up();return this.onEnd()},y.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},y.prototype.openNode=function(C){if(!C.isOpen)return!this.root&&this.currentLevel===0&&C instanceof u&&(this.root=C),this.onData(this.writer.openNode(C,this.currentLevel),this.currentLevel),C.isOpen=!0},y.prototype.closeNode=function(C){if(!C.isClosed)return this.onData(this.writer.closeNode(C,this.currentLevel),this.currentLevel),C.isClosed=!0},y.prototype.onData=function(C,x){return this.documentStarted=!0,this.onDataCallback(C,x+1)},y.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},y.prototype.debugInfo=function(C){return C==null?"":"node: <"+C+">"},y.prototype.ele=function(){return this.element.apply(this,arguments)},y.prototype.nod=function(C,x,L){return this.node(C,x,L)},y.prototype.txt=function(C){return this.text(C)},y.prototype.dat=function(C){return this.cdata(C)},y.prototype.com=function(C){return this.comment(C)},y.prototype.ins=function(C,x){return this.instruction(C,x)},y.prototype.dec=function(C,x,L){return this.declaration(C,x,L)},y.prototype.dtd=function(C,x,L){return this.doctype(C,x,L)},y.prototype.e=function(C,x,L){return this.element(C,x,L)},y.prototype.n=function(C,x,L){return this.node(C,x,L)},y.prototype.t=function(C){return this.text(C)},y.prototype.d=function(C){return this.cdata(C)},y.prototype.c=function(C){return this.comment(C)},y.prototype.r=function(C){return this.raw(C)},y.prototype.i=function(C,x){return this.instruction(C,x)},y.prototype.att=function(){return this.currentNode&&this.currentNode instanceof d?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},y.prototype.a=function(){return this.currentNode&&this.currentNode instanceof d?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},y.prototype.ent=function(C,x){return this.entity(C,x)},y.prototype.pent=function(C,x){return this.pEntity(C,x)},y.prototype.not=function(C,x){return this.notation(C,x)},y}()}).call(Xo)),G5e.exports}var K5e={exports:{}},S9t;function iYo(){return S9t||(S9t=1,(function(){var e,t,n,r,o,s,a,l,d,u,h,f,g,k,A=function(v,p){for(var b in p)m.call(p,b)&&(v[b]=p[b]);function O(){this.constructor=v}return O.prototype=p.prototype,v.prototype=new O,v.__super__=p.prototype,v},m={}.hasOwnProperty;a=V3e(),l=q3e(),e=W3e(),t=H3e(),u=j3e(),f=G3e(),g=K3e(),h=J3e(),d=oot(),n=z3e(),r=Y3e(),o=Z3e(),s=X3e(),k=jjn(),K5e.exports=function(v){A(p,v);function p(b,O){p.__super__.constructor.call(this,O),this.stream=b}return p.prototype.document=function(b){var O,w,y,C,x,L,S,E;for(L=b.children,w=0,C=L.length;w"+this.endline(b))},p.prototype.comment=function(b,O){return this.stream.write(this.space(O)+"\x3C!-- "+b.text+" -->"+this.endline(b))},p.prototype.declaration=function(b,O){return this.stream.write(this.space(O)),this.stream.write('"),this.stream.write(this.endline(b))},p.prototype.docType=function(b,O){var w,y,C,x;if(O||(O=0),this.stream.write(this.space(O)),this.stream.write("0){for(this.stream.write(" ["),this.stream.write(this.endline(b)),x=b.children,y=0,C=x.length;y"),this.stream.write(this.endline(b))},p.prototype.element=function(b,O){var w,y,C,x,L,S,E,Q;O||(O=0),Q=this.space(O),this.stream.write(Q+"<"+b.name),S=b.attributes;for(L in S)m.call(S,L)&&(w=S[L],this.attribute(w));if(b.children.length===0||b.children.every(function(T){return T.value===""}))this.allowEmpty?this.stream.write(">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&b.children.length===1&&b.children[0].value!=null)this.stream.write(">"),this.stream.write(b.children[0].value),this.stream.write("");else{for(this.stream.write(">"+this.newline),E=b.children,C=0,x=E.length;C")}return this.stream.write(this.endline(b))},p.prototype.processingInstruction=function(b,O){return this.stream.write(this.space(O)+""+this.endline(b))},p.prototype.raw=function(b,O){return this.stream.write(this.space(O)+b.value+this.endline(b))},p.prototype.text=function(b,O){return this.stream.write(this.space(O)+b.value+this.endline(b))},p.prototype.dtdAttList=function(b,O){return this.stream.write(this.space(O)+""+this.endline(b))},p.prototype.dtdElement=function(b,O){return this.stream.write(this.space(O)+""+this.endline(b))},p.prototype.dtdEntity=function(b,O){return this.stream.write(this.space(O)+""+this.endline(b))},p.prototype.dtdNotation=function(b,O){return this.stream.write(this.space(O)+""+this.endline(b))},p.prototype.endline=function(b){return b.isLastRootNode?"":this.newline},p}(k)}).call(Xo)),K5e.exports}(function(){var e,t,n,r,o,s,a;a=QE(),o=a.assign,s=a.isFunction,e=tYo(),t=nYo(),r=sot(),n=iYo(),mG.create=function(l,d,u,h){var f,g;if(l==null)throw new Error("Root element needs a name.");return h=o({},d,u,h),f=new e(h),g=f.element(l),h.headless||(f.declaration(h),(h.pubID!=null||h.sysID!=null)&&f.doctype(h)),g},mG.begin=function(l,d,u){var h;return s(l)&&(h=[l,d],d=h[0],u=h[1],l={}),d?new t(l,d,u):new e(l)},mG.stringWriter=function(l){return new r(l)},mG.streamWriter=function(l,d){return new n(l,d)}}).call(Xo);var T9t=Sh,rYo=mG;Ijn.writeString=oYo;function oYo(e,t){var n=T9t.invert(t),r={element:s,text:sYo};function o(d,u){return r[u.type](d,u)}function s(d,u){var h=d.element(a(u.name),u.attributes);u.children.forEach(function(f){o(h,f)})}function a(d){var u=/^\{(.*)\}(.*)$/.exec(d);if(u){var h=n[u[1]];return h+(h===""?"":":")+u[2]}else return d}function l(d){var u=rYo.create(a(d.name),{version:"1.0",encoding:"UTF-8",standalone:!0});return T9t.forEach(t,function(h,f){var g="xmlns"+(f===""?"":":"+f);u.attribute(g,h)}),d.children.forEach(function(h){o(u,h)}),u.end()}return l(e)}function sYo(e,t){e.text(t.value)}var _3e=PZ;R6.Element=_3e.Element;R6.element=_3e.element;R6.emptyElement=_3e.emptyElement;R6.text=_3e.text;R6.readString=rjn.readString;R6.writeString=Ijn.writeString;var aYo=Sh,lYo=Wf,cYo=R6;Xrt.read=Wjn;Xrt.readXmlFromZipFile=uYo;var dYo={"http://schemas.openxmlformats.org/wordprocessingml/2006/main":"w","http://schemas.openxmlformats.org/officeDocument/2006/relationships":"r","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing":"wp","http://schemas.openxmlformats.org/drawingml/2006/main":"a","http://schemas.openxmlformats.org/drawingml/2006/picture":"pic","http://purl.oclc.org/ooxml/wordprocessingml/main":"w","http://purl.oclc.org/ooxml/officeDocument/relationships":"r","http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing":"wp","http://purl.oclc.org/ooxml/drawingml/main":"a","http://purl.oclc.org/ooxml/drawingml/picture":"pic","http://schemas.openxmlformats.org/package/2006/content-types":"content-types","http://schemas.openxmlformats.org/package/2006/relationships":"relationships","http://schemas.openxmlformats.org/markup-compatibility/2006":"mc","urn:schemas-microsoft-com:vml":"v","urn:schemas-microsoft-com:office:word":"office-word","http://schemas.microsoft.com/office/word/2010/wordml":"wordml"};function Wjn(e){return cYo.readString(e,dYo).then(function(t){return Hjn(t)[0]})}function uYo(e,t){return e.exists(t)?e.read(t,"utf-8").then(hYo).then(Wjn):lYo.resolve(null)}function hYo(e){return e.replace(/^\uFEFF/g,"")}function Hjn(e){return e.type==="element"?e.name==="mc:AlternateContent"?e.firstOrEmpty("mc:Fallback").children:(e.children=aYo.flatten(e.children.map(Hjn,!0)),[e]):[e]}var aot={},tT={},lot={};Object.defineProperty(lot,"__esModule",{value:!0});var AYo=[{"Typeface name":"Symbol","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Symbol","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"33","Unicode hex":"21"},{"Typeface name":"Symbol","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"8704","Unicode hex":"2200"},{"Typeface name":"Symbol","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"35","Unicode hex":"23"},{"Typeface name":"Symbol","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"8707","Unicode hex":"2203"},{"Typeface name":"Symbol","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"37","Unicode hex":"25"},{"Typeface name":"Symbol","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"38","Unicode hex":"26"},{"Typeface name":"Symbol","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"8717","Unicode hex":"220D"},{"Typeface name":"Symbol","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"40","Unicode hex":"28"},{"Typeface name":"Symbol","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"41","Unicode hex":"29"},{"Typeface name":"Symbol","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"42","Unicode hex":"2A"},{"Typeface name":"Symbol","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"43","Unicode hex":"2B"},{"Typeface name":"Symbol","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"44","Unicode hex":"2C"},{"Typeface name":"Symbol","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"8722","Unicode hex":"2212"},{"Typeface name":"Symbol","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"46","Unicode hex":"2E"},{"Typeface name":"Symbol","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"47","Unicode hex":"2F"},{"Typeface name":"Symbol","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"48","Unicode hex":"30"},{"Typeface name":"Symbol","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"49","Unicode hex":"31"},{"Typeface name":"Symbol","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"50","Unicode hex":"32"},{"Typeface name":"Symbol","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"51","Unicode hex":"33"},{"Typeface name":"Symbol","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"52","Unicode hex":"34"},{"Typeface name":"Symbol","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"53","Unicode hex":"35"},{"Typeface name":"Symbol","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"54","Unicode hex":"36"},{"Typeface name":"Symbol","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"55","Unicode hex":"37"},{"Typeface name":"Symbol","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"56","Unicode hex":"38"},{"Typeface name":"Symbol","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"57","Unicode hex":"39"},{"Typeface name":"Symbol","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"58","Unicode hex":"3A"},{"Typeface name":"Symbol","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"59","Unicode hex":"3B"},{"Typeface name":"Symbol","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"60","Unicode hex":"3C"},{"Typeface name":"Symbol","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"61","Unicode hex":"3D"},{"Typeface name":"Symbol","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"62","Unicode hex":"3E"},{"Typeface name":"Symbol","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"63","Unicode hex":"3F"},{"Typeface name":"Symbol","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"8773","Unicode hex":"2245"},{"Typeface name":"Symbol","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"913","Unicode hex":"391"},{"Typeface name":"Symbol","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"914","Unicode hex":"392"},{"Typeface name":"Symbol","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"935","Unicode hex":"3A7"},{"Typeface name":"Symbol","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"916","Unicode hex":"394"},{"Typeface name":"Symbol","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"917","Unicode hex":"395"},{"Typeface name":"Symbol","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"934","Unicode hex":"3A6"},{"Typeface name":"Symbol","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"915","Unicode hex":"393"},{"Typeface name":"Symbol","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"919","Unicode hex":"397"},{"Typeface name":"Symbol","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"921","Unicode hex":"399"},{"Typeface name":"Symbol","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"977","Unicode hex":"3D1"},{"Typeface name":"Symbol","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"922","Unicode hex":"39A"},{"Typeface name":"Symbol","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"923","Unicode hex":"39B"},{"Typeface name":"Symbol","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"924","Unicode hex":"39C"},{"Typeface name":"Symbol","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"925","Unicode hex":"39D"},{"Typeface name":"Symbol","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"927","Unicode hex":"39F"},{"Typeface name":"Symbol","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"928","Unicode hex":"3A0"},{"Typeface name":"Symbol","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"920","Unicode hex":"398"},{"Typeface name":"Symbol","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"929","Unicode hex":"3A1"},{"Typeface name":"Symbol","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"931","Unicode hex":"3A3"},{"Typeface name":"Symbol","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"932","Unicode hex":"3A4"},{"Typeface name":"Symbol","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"933","Unicode hex":"3A5"},{"Typeface name":"Symbol","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"962","Unicode hex":"3C2"},{"Typeface name":"Symbol","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"937","Unicode hex":"3A9"},{"Typeface name":"Symbol","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"926","Unicode hex":"39E"},{"Typeface name":"Symbol","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"936","Unicode hex":"3A8"},{"Typeface name":"Symbol","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"918","Unicode hex":"396"},{"Typeface name":"Symbol","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"91","Unicode hex":"5B"},{"Typeface name":"Symbol","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"8756","Unicode hex":"2234"},{"Typeface name":"Symbol","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"93","Unicode hex":"5D"},{"Typeface name":"Symbol","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"8869","Unicode hex":"22A5"},{"Typeface name":"Symbol","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"95","Unicode hex":"5F"},{"Typeface name":"Symbol","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"8254","Unicode hex":"203E"},{"Typeface name":"Symbol","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"945","Unicode hex":"3B1"},{"Typeface name":"Symbol","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"946","Unicode hex":"3B2"},{"Typeface name":"Symbol","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"967","Unicode hex":"3C7"},{"Typeface name":"Symbol","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"948","Unicode hex":"3B4"},{"Typeface name":"Symbol","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"949","Unicode hex":"3B5"},{"Typeface name":"Symbol","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"966","Unicode hex":"3C6"},{"Typeface name":"Symbol","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"947","Unicode hex":"3B3"},{"Typeface name":"Symbol","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"951","Unicode hex":"3B7"},{"Typeface name":"Symbol","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"953","Unicode hex":"3B9"},{"Typeface name":"Symbol","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"981","Unicode hex":"3D5"},{"Typeface name":"Symbol","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"954","Unicode hex":"3BA"},{"Typeface name":"Symbol","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"955","Unicode hex":"3BB"},{"Typeface name":"Symbol","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"956","Unicode hex":"3BC"},{"Typeface name":"Symbol","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"957","Unicode hex":"3BD"},{"Typeface name":"Symbol","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"959","Unicode hex":"3BF"},{"Typeface name":"Symbol","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"960","Unicode hex":"3C0"},{"Typeface name":"Symbol","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"952","Unicode hex":"3B8"},{"Typeface name":"Symbol","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"961","Unicode hex":"3C1"},{"Typeface name":"Symbol","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"963","Unicode hex":"3C3"},{"Typeface name":"Symbol","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"964","Unicode hex":"3C4"},{"Typeface name":"Symbol","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"965","Unicode hex":"3C5"},{"Typeface name":"Symbol","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"982","Unicode hex":"3D6"},{"Typeface name":"Symbol","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"969","Unicode hex":"3C9"},{"Typeface name":"Symbol","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"958","Unicode hex":"3BE"},{"Typeface name":"Symbol","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"968","Unicode hex":"3C8"},{"Typeface name":"Symbol","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"950","Unicode hex":"3B6"},{"Typeface name":"Symbol","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"123","Unicode hex":"7B"},{"Typeface name":"Symbol","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"124","Unicode hex":"7C"},{"Typeface name":"Symbol","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"125","Unicode hex":"7D"},{"Typeface name":"Symbol","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"126","Unicode hex":"7E"},{"Typeface name":"Symbol","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"8364","Unicode hex":"20AC"},{"Typeface name":"Symbol","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"978","Unicode hex":"3D2"},{"Typeface name":"Symbol","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"8242","Unicode hex":"2032"},{"Typeface name":"Symbol","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"8804","Unicode hex":"2264"},{"Typeface name":"Symbol","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"8260","Unicode hex":"2044"},{"Typeface name":"Symbol","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"8734","Unicode hex":"221E"},{"Typeface name":"Symbol","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"402","Unicode hex":"192"},{"Typeface name":"Symbol","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"9827","Unicode hex":"2663"},{"Typeface name":"Symbol","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"9830","Unicode hex":"2666"},{"Typeface name":"Symbol","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"9829","Unicode hex":"2665"},{"Typeface name":"Symbol","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"9824","Unicode hex":"2660"},{"Typeface name":"Symbol","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"8596","Unicode hex":"2194"},{"Typeface name":"Symbol","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"8592","Unicode hex":"2190"},{"Typeface name":"Symbol","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"8593","Unicode hex":"2191"},{"Typeface name":"Symbol","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"8594","Unicode hex":"2192"},{"Typeface name":"Symbol","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"8595","Unicode hex":"2193"},{"Typeface name":"Symbol","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"176","Unicode hex":"B0"},{"Typeface name":"Symbol","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"177","Unicode hex":"B1"},{"Typeface name":"Symbol","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"8243","Unicode hex":"2033"},{"Typeface name":"Symbol","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"8805","Unicode hex":"2265"},{"Typeface name":"Symbol","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"215","Unicode hex":"D7"},{"Typeface name":"Symbol","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"8733","Unicode hex":"221D"},{"Typeface name":"Symbol","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"8706","Unicode hex":"2202"},{"Typeface name":"Symbol","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"8226","Unicode hex":"2022"},{"Typeface name":"Symbol","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"247","Unicode hex":"F7"},{"Typeface name":"Symbol","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"8800","Unicode hex":"2260"},{"Typeface name":"Symbol","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"8801","Unicode hex":"2261"},{"Typeface name":"Symbol","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"8776","Unicode hex":"2248"},{"Typeface name":"Symbol","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"8230","Unicode hex":"2026"},{"Typeface name":"Symbol","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"9168","Unicode hex":"23D0"},{"Typeface name":"Symbol","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"9135","Unicode hex":"23AF"},{"Typeface name":"Symbol","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"8629","Unicode hex":"21B5"},{"Typeface name":"Symbol","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"8501","Unicode hex":"2135"},{"Typeface name":"Symbol","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"8465","Unicode hex":"2111"},{"Typeface name":"Symbol","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"8476","Unicode hex":"211C"},{"Typeface name":"Symbol","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"8472","Unicode hex":"2118"},{"Typeface name":"Symbol","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"8855","Unicode hex":"2297"},{"Typeface name":"Symbol","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"8853","Unicode hex":"2295"},{"Typeface name":"Symbol","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"8709","Unicode hex":"2205"},{"Typeface name":"Symbol","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"8745","Unicode hex":"2229"},{"Typeface name":"Symbol","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"8746","Unicode hex":"222A"},{"Typeface name":"Symbol","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"8835","Unicode hex":"2283"},{"Typeface name":"Symbol","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"8839","Unicode hex":"2287"},{"Typeface name":"Symbol","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"8836","Unicode hex":"2284"},{"Typeface name":"Symbol","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"8834","Unicode hex":"2282"},{"Typeface name":"Symbol","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"8838","Unicode hex":"2286"},{"Typeface name":"Symbol","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"8712","Unicode hex":"2208"},{"Typeface name":"Symbol","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"8713","Unicode hex":"2209"},{"Typeface name":"Symbol","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"8736","Unicode hex":"2220"},{"Typeface name":"Symbol","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"8711","Unicode hex":"2207"},{"Typeface name":"Symbol","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"174","Unicode hex":"AE"},{"Typeface name":"Symbol","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"169","Unicode hex":"A9"},{"Typeface name":"Symbol","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"8482","Unicode hex":"2122"},{"Typeface name":"Symbol","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"8719","Unicode hex":"220F"},{"Typeface name":"Symbol","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"8730","Unicode hex":"221A"},{"Typeface name":"Symbol","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"8901","Unicode hex":"22C5"},{"Typeface name":"Symbol","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"172","Unicode hex":"AC"},{"Typeface name":"Symbol","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"8743","Unicode hex":"2227"},{"Typeface name":"Symbol","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"8744","Unicode hex":"2228"},{"Typeface name":"Symbol","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"8660","Unicode hex":"21D4"},{"Typeface name":"Symbol","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"8656","Unicode hex":"21D0"},{"Typeface name":"Symbol","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"8657","Unicode hex":"21D1"},{"Typeface name":"Symbol","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"8658","Unicode hex":"21D2"},{"Typeface name":"Symbol","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"8659","Unicode hex":"21D3"},{"Typeface name":"Symbol","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"9674","Unicode hex":"25CA"},{"Typeface name":"Symbol","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"12296","Unicode hex":"3008"},{"Typeface name":"Symbol","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"174","Unicode hex":"AE"},{"Typeface name":"Symbol","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"169","Unicode hex":"A9"},{"Typeface name":"Symbol","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"8482","Unicode hex":"2122"},{"Typeface name":"Symbol","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"8721","Unicode hex":"2211"},{"Typeface name":"Symbol","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"9115","Unicode hex":"239B"},{"Typeface name":"Symbol","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"9116","Unicode hex":"239C"},{"Typeface name":"Symbol","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"9117","Unicode hex":"239D"},{"Typeface name":"Symbol","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"9121","Unicode hex":"23A1"},{"Typeface name":"Symbol","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"9122","Unicode hex":"23A2"},{"Typeface name":"Symbol","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"9123","Unicode hex":"23A3"},{"Typeface name":"Symbol","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"9127","Unicode hex":"23A7"},{"Typeface name":"Symbol","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"9128","Unicode hex":"23A8"},{"Typeface name":"Symbol","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"9129","Unicode hex":"23A9"},{"Typeface name":"Symbol","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"9130","Unicode hex":"23AA"},{"Typeface name":"Symbol","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"63743","Unicode hex":"F8FF"},{"Typeface name":"Symbol","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"12297","Unicode hex":"3009"},{"Typeface name":"Symbol","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"8747","Unicode hex":"222B"},{"Typeface name":"Symbol","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"8992","Unicode hex":"2320"},{"Typeface name":"Symbol","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"9134","Unicode hex":"23AE"},{"Typeface name":"Symbol","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"8993","Unicode hex":"2321"},{"Typeface name":"Symbol","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"9118","Unicode hex":"239E"},{"Typeface name":"Symbol","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"9119","Unicode hex":"239F"},{"Typeface name":"Symbol","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"9120","Unicode hex":"23A0"},{"Typeface name":"Symbol","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"9124","Unicode hex":"23A4"},{"Typeface name":"Symbol","Dingbat dec":"250","Dingbat hex":"FA","Unicode dec":"9125","Unicode hex":"23A5"},{"Typeface name":"Symbol","Dingbat dec":"251","Dingbat hex":"FB","Unicode dec":"9126","Unicode hex":"23A6"},{"Typeface name":"Symbol","Dingbat dec":"252","Dingbat hex":"FC","Unicode dec":"9131","Unicode hex":"23AB"},{"Typeface name":"Symbol","Dingbat dec":"253","Dingbat hex":"FD","Unicode dec":"9132","Unicode hex":"23AC"},{"Typeface name":"Symbol","Dingbat dec":"254","Dingbat hex":"FE","Unicode dec":"9133","Unicode hex":"23AD"},{"Typeface name":"Webdings","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Webdings","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"128375","Unicode hex":"1F577"},{"Typeface name":"Webdings","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"128376","Unicode hex":"1F578"},{"Typeface name":"Webdings","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"128370","Unicode hex":"1F572"},{"Typeface name":"Webdings","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"128374","Unicode hex":"1F576"},{"Typeface name":"Webdings","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"127942","Unicode hex":"1F3C6"},{"Typeface name":"Webdings","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"127894","Unicode hex":"1F396"},{"Typeface name":"Webdings","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"128391","Unicode hex":"1F587"},{"Typeface name":"Webdings","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"128488","Unicode hex":"1F5E8"},{"Typeface name":"Webdings","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"128489","Unicode hex":"1F5E9"},{"Typeface name":"Webdings","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"128496","Unicode hex":"1F5F0"},{"Typeface name":"Webdings","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"128497","Unicode hex":"1F5F1"},{"Typeface name":"Webdings","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"127798","Unicode hex":"1F336"},{"Typeface name":"Webdings","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"127895","Unicode hex":"1F397"},{"Typeface name":"Webdings","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"128638","Unicode hex":"1F67E"},{"Typeface name":"Webdings","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"128636","Unicode hex":"1F67C"},{"Typeface name":"Webdings","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"128469","Unicode hex":"1F5D5"},{"Typeface name":"Webdings","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"128470","Unicode hex":"1F5D6"},{"Typeface name":"Webdings","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"128471","Unicode hex":"1F5D7"},{"Typeface name":"Webdings","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"9204","Unicode hex":"23F4"},{"Typeface name":"Webdings","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"9205","Unicode hex":"23F5"},{"Typeface name":"Webdings","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"9206","Unicode hex":"23F6"},{"Typeface name":"Webdings","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"9207","Unicode hex":"23F7"},{"Typeface name":"Webdings","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"9194","Unicode hex":"23EA"},{"Typeface name":"Webdings","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"9193","Unicode hex":"23E9"},{"Typeface name":"Webdings","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"9198","Unicode hex":"23EE"},{"Typeface name":"Webdings","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"9197","Unicode hex":"23ED"},{"Typeface name":"Webdings","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"9208","Unicode hex":"23F8"},{"Typeface name":"Webdings","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"9209","Unicode hex":"23F9"},{"Typeface name":"Webdings","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"9210","Unicode hex":"23FA"},{"Typeface name":"Webdings","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"128474","Unicode hex":"1F5DA"},{"Typeface name":"Webdings","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"128499","Unicode hex":"1F5F3"},{"Typeface name":"Webdings","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"128736","Unicode hex":"1F6E0"},{"Typeface name":"Webdings","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"127959","Unicode hex":"1F3D7"},{"Typeface name":"Webdings","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"127960","Unicode hex":"1F3D8"},{"Typeface name":"Webdings","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"127961","Unicode hex":"1F3D9"},{"Typeface name":"Webdings","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"127962","Unicode hex":"1F3DA"},{"Typeface name":"Webdings","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"127964","Unicode hex":"1F3DC"},{"Typeface name":"Webdings","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"127981","Unicode hex":"1F3ED"},{"Typeface name":"Webdings","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"127963","Unicode hex":"1F3DB"},{"Typeface name":"Webdings","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"127968","Unicode hex":"1F3E0"},{"Typeface name":"Webdings","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"127958","Unicode hex":"1F3D6"},{"Typeface name":"Webdings","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"127965","Unicode hex":"1F3DD"},{"Typeface name":"Webdings","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"128739","Unicode hex":"1F6E3"},{"Typeface name":"Webdings","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"128269","Unicode hex":"1F50D"},{"Typeface name":"Webdings","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"127956","Unicode hex":"1F3D4"},{"Typeface name":"Webdings","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"128065","Unicode hex":"1F441"},{"Typeface name":"Webdings","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"128066","Unicode hex":"1F442"},{"Typeface name":"Webdings","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"127966","Unicode hex":"1F3DE"},{"Typeface name":"Webdings","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"127957","Unicode hex":"1F3D5"},{"Typeface name":"Webdings","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"128740","Unicode hex":"1F6E4"},{"Typeface name":"Webdings","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"127967","Unicode hex":"1F3DF"},{"Typeface name":"Webdings","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"128755","Unicode hex":"1F6F3"},{"Typeface name":"Webdings","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"128364","Unicode hex":"1F56C"},{"Typeface name":"Webdings","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"128363","Unicode hex":"1F56B"},{"Typeface name":"Webdings","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"128360","Unicode hex":"1F568"},{"Typeface name":"Webdings","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"128264","Unicode hex":"1F508"},{"Typeface name":"Webdings","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"127892","Unicode hex":"1F394"},{"Typeface name":"Webdings","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"127893","Unicode hex":"1F395"},{"Typeface name":"Webdings","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"128492","Unicode hex":"1F5EC"},{"Typeface name":"Webdings","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"128637","Unicode hex":"1F67D"},{"Typeface name":"Webdings","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"128493","Unicode hex":"1F5ED"},{"Typeface name":"Webdings","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"128490","Unicode hex":"1F5EA"},{"Typeface name":"Webdings","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"128491","Unicode hex":"1F5EB"},{"Typeface name":"Webdings","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"11156","Unicode hex":"2B94"},{"Typeface name":"Webdings","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"10004","Unicode hex":"2714"},{"Typeface name":"Webdings","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"128690","Unicode hex":"1F6B2"},{"Typeface name":"Webdings","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"11036","Unicode hex":"2B1C"},{"Typeface name":"Webdings","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"128737","Unicode hex":"1F6E1"},{"Typeface name":"Webdings","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"128230","Unicode hex":"1F4E6"},{"Typeface name":"Webdings","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"128753","Unicode hex":"1F6F1"},{"Typeface name":"Webdings","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"11035","Unicode hex":"2B1B"},{"Typeface name":"Webdings","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"128657","Unicode hex":"1F691"},{"Typeface name":"Webdings","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"128712","Unicode hex":"1F6C8"},{"Typeface name":"Webdings","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"128745","Unicode hex":"1F6E9"},{"Typeface name":"Webdings","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"128752","Unicode hex":"1F6F0"},{"Typeface name":"Webdings","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"128968","Unicode hex":"1F7C8"},{"Typeface name":"Webdings","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"128372","Unicode hex":"1F574"},{"Typeface name":"Webdings","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"11044","Unicode hex":"2B24"},{"Typeface name":"Webdings","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"128741","Unicode hex":"1F6E5"},{"Typeface name":"Webdings","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"128660","Unicode hex":"1F694"},{"Typeface name":"Webdings","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"128472","Unicode hex":"1F5D8"},{"Typeface name":"Webdings","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"128473","Unicode hex":"1F5D9"},{"Typeface name":"Webdings","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"10067","Unicode hex":"2753"},{"Typeface name":"Webdings","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"128754","Unicode hex":"1F6F2"},{"Typeface name":"Webdings","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"128647","Unicode hex":"1F687"},{"Typeface name":"Webdings","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"128653","Unicode hex":"1F68D"},{"Typeface name":"Webdings","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"9971","Unicode hex":"26F3"},{"Typeface name":"Webdings","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"10680","Unicode hex":"29B8"},{"Typeface name":"Webdings","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"8854","Unicode hex":"2296"},{"Typeface name":"Webdings","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"128685","Unicode hex":"1F6AD"},{"Typeface name":"Webdings","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"128494","Unicode hex":"1F5EE"},{"Typeface name":"Webdings","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"9168","Unicode hex":"23D0"},{"Typeface name":"Webdings","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"128495","Unicode hex":"1F5EF"},{"Typeface name":"Webdings","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"128498","Unicode hex":"1F5F2"},{"Typeface name":"Webdings","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"128697","Unicode hex":"1F6B9"},{"Typeface name":"Webdings","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"128698","Unicode hex":"1F6BA"},{"Typeface name":"Webdings","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"128713","Unicode hex":"1F6C9"},{"Typeface name":"Webdings","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"128714","Unicode hex":"1F6CA"},{"Typeface name":"Webdings","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"128700","Unicode hex":"1F6BC"},{"Typeface name":"Webdings","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"128125","Unicode hex":"1F47D"},{"Typeface name":"Webdings","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"127947","Unicode hex":"1F3CB"},{"Typeface name":"Webdings","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"9975","Unicode hex":"26F7"},{"Typeface name":"Webdings","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"127938","Unicode hex":"1F3C2"},{"Typeface name":"Webdings","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"127948","Unicode hex":"1F3CC"},{"Typeface name":"Webdings","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"127946","Unicode hex":"1F3CA"},{"Typeface name":"Webdings","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"127940","Unicode hex":"1F3C4"},{"Typeface name":"Webdings","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"127949","Unicode hex":"1F3CD"},{"Typeface name":"Webdings","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"127950","Unicode hex":"1F3CE"},{"Typeface name":"Webdings","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"128664","Unicode hex":"1F698"},{"Typeface name":"Webdings","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"128480","Unicode hex":"1F5E0"},{"Typeface name":"Webdings","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"128738","Unicode hex":"1F6E2"},{"Typeface name":"Webdings","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"128176","Unicode hex":"1F4B0"},{"Typeface name":"Webdings","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"127991","Unicode hex":"1F3F7"},{"Typeface name":"Webdings","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"128179","Unicode hex":"1F4B3"},{"Typeface name":"Webdings","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"128106","Unicode hex":"1F46A"},{"Typeface name":"Webdings","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"128481","Unicode hex":"1F5E1"},{"Typeface name":"Webdings","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"128482","Unicode hex":"1F5E2"},{"Typeface name":"Webdings","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"128483","Unicode hex":"1F5E3"},{"Typeface name":"Webdings","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"10031","Unicode hex":"272F"},{"Typeface name":"Webdings","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"128388","Unicode hex":"1F584"},{"Typeface name":"Webdings","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"128389","Unicode hex":"1F585"},{"Typeface name":"Webdings","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"128387","Unicode hex":"1F583"},{"Typeface name":"Webdings","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"128390","Unicode hex":"1F586"},{"Typeface name":"Webdings","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"128441","Unicode hex":"1F5B9"},{"Typeface name":"Webdings","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"128442","Unicode hex":"1F5BA"},{"Typeface name":"Webdings","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"128443","Unicode hex":"1F5BB"},{"Typeface name":"Webdings","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"128373","Unicode hex":"1F575"},{"Typeface name":"Webdings","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"128368","Unicode hex":"1F570"},{"Typeface name":"Webdings","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"128445","Unicode hex":"1F5BD"},{"Typeface name":"Webdings","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"128446","Unicode hex":"1F5BE"},{"Typeface name":"Webdings","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"128203","Unicode hex":"1F4CB"},{"Typeface name":"Webdings","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"128466","Unicode hex":"1F5D2"},{"Typeface name":"Webdings","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"128467","Unicode hex":"1F5D3"},{"Typeface name":"Webdings","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"128366","Unicode hex":"1F56E"},{"Typeface name":"Webdings","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"128218","Unicode hex":"1F4DA"},{"Typeface name":"Webdings","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"128478","Unicode hex":"1F5DE"},{"Typeface name":"Webdings","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"128479","Unicode hex":"1F5DF"},{"Typeface name":"Webdings","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"128451","Unicode hex":"1F5C3"},{"Typeface name":"Webdings","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"128450","Unicode hex":"1F5C2"},{"Typeface name":"Webdings","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"128444","Unicode hex":"1F5BC"},{"Typeface name":"Webdings","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"127917","Unicode hex":"1F3AD"},{"Typeface name":"Webdings","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"127900","Unicode hex":"1F39C"},{"Typeface name":"Webdings","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"127896","Unicode hex":"1F398"},{"Typeface name":"Webdings","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"127897","Unicode hex":"1F399"},{"Typeface name":"Webdings","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"127911","Unicode hex":"1F3A7"},{"Typeface name":"Webdings","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"128191","Unicode hex":"1F4BF"},{"Typeface name":"Webdings","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"127902","Unicode hex":"1F39E"},{"Typeface name":"Webdings","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"128247","Unicode hex":"1F4F7"},{"Typeface name":"Webdings","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"127903","Unicode hex":"1F39F"},{"Typeface name":"Webdings","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"127916","Unicode hex":"1F3AC"},{"Typeface name":"Webdings","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"128253","Unicode hex":"1F4FD"},{"Typeface name":"Webdings","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"128249","Unicode hex":"1F4F9"},{"Typeface name":"Webdings","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"128254","Unicode hex":"1F4FE"},{"Typeface name":"Webdings","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"128251","Unicode hex":"1F4FB"},{"Typeface name":"Webdings","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"127898","Unicode hex":"1F39A"},{"Typeface name":"Webdings","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"127899","Unicode hex":"1F39B"},{"Typeface name":"Webdings","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"128250","Unicode hex":"1F4FA"},{"Typeface name":"Webdings","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"128187","Unicode hex":"1F4BB"},{"Typeface name":"Webdings","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"128421","Unicode hex":"1F5A5"},{"Typeface name":"Webdings","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"128422","Unicode hex":"1F5A6"},{"Typeface name":"Webdings","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"128423","Unicode hex":"1F5A7"},{"Typeface name":"Webdings","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"128377","Unicode hex":"1F579"},{"Typeface name":"Webdings","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"127918","Unicode hex":"1F3AE"},{"Typeface name":"Webdings","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"128379","Unicode hex":"1F57B"},{"Typeface name":"Webdings","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"128380","Unicode hex":"1F57C"},{"Typeface name":"Webdings","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"128223","Unicode hex":"1F4DF"},{"Typeface name":"Webdings","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"128385","Unicode hex":"1F581"},{"Typeface name":"Webdings","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"128384","Unicode hex":"1F580"},{"Typeface name":"Webdings","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"128424","Unicode hex":"1F5A8"},{"Typeface name":"Webdings","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"128425","Unicode hex":"1F5A9"},{"Typeface name":"Webdings","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"128447","Unicode hex":"1F5BF"},{"Typeface name":"Webdings","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"128426","Unicode hex":"1F5AA"},{"Typeface name":"Webdings","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"128476","Unicode hex":"1F5DC"},{"Typeface name":"Webdings","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"128274","Unicode hex":"1F512"},{"Typeface name":"Webdings","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"128275","Unicode hex":"1F513"},{"Typeface name":"Webdings","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"128477","Unicode hex":"1F5DD"},{"Typeface name":"Webdings","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"128229","Unicode hex":"1F4E5"},{"Typeface name":"Webdings","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"128228","Unicode hex":"1F4E4"},{"Typeface name":"Webdings","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"128371","Unicode hex":"1F573"},{"Typeface name":"Webdings","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"127779","Unicode hex":"1F323"},{"Typeface name":"Webdings","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"127780","Unicode hex":"1F324"},{"Typeface name":"Webdings","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"127781","Unicode hex":"1F325"},{"Typeface name":"Webdings","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"127782","Unicode hex":"1F326"},{"Typeface name":"Webdings","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"9729","Unicode hex":"2601"},{"Typeface name":"Webdings","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"127784","Unicode hex":"1F328"},{"Typeface name":"Webdings","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"127783","Unicode hex":"1F327"},{"Typeface name":"Webdings","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"127785","Unicode hex":"1F329"},{"Typeface name":"Webdings","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"127786","Unicode hex":"1F32A"},{"Typeface name":"Webdings","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"127788","Unicode hex":"1F32C"},{"Typeface name":"Webdings","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"127787","Unicode hex":"1F32B"},{"Typeface name":"Webdings","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"127772","Unicode hex":"1F31C"},{"Typeface name":"Webdings","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"127777","Unicode hex":"1F321"},{"Typeface name":"Webdings","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"128715","Unicode hex":"1F6CB"},{"Typeface name":"Webdings","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"128719","Unicode hex":"1F6CF"},{"Typeface name":"Webdings","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"127869","Unicode hex":"1F37D"},{"Typeface name":"Webdings","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"127864","Unicode hex":"1F378"},{"Typeface name":"Webdings","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"128718","Unicode hex":"1F6CE"},{"Typeface name":"Webdings","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"128717","Unicode hex":"1F6CD"},{"Typeface name":"Webdings","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"9413","Unicode hex":"24C5"},{"Typeface name":"Webdings","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"9855","Unicode hex":"267F"},{"Typeface name":"Webdings","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"128710","Unicode hex":"1F6C6"},{"Typeface name":"Webdings","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"128392","Unicode hex":"1F588"},{"Typeface name":"Webdings","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"127891","Unicode hex":"1F393"},{"Typeface name":"Webdings","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"128484","Unicode hex":"1F5E4"},{"Typeface name":"Webdings","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"128485","Unicode hex":"1F5E5"},{"Typeface name":"Webdings","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"128486","Unicode hex":"1F5E6"},{"Typeface name":"Webdings","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"128487","Unicode hex":"1F5E7"},{"Typeface name":"Webdings","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"128746","Unicode hex":"1F6EA"},{"Typeface name":"Webdings","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"128063","Unicode hex":"1F43F"},{"Typeface name":"Webdings","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"128038","Unicode hex":"1F426"},{"Typeface name":"Webdings","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"128031","Unicode hex":"1F41F"},{"Typeface name":"Webdings","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"128021","Unicode hex":"1F415"},{"Typeface name":"Webdings","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"128008","Unicode hex":"1F408"},{"Typeface name":"Webdings","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"128620","Unicode hex":"1F66C"},{"Typeface name":"Webdings","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"128622","Unicode hex":"1F66E"},{"Typeface name":"Webdings","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"128621","Unicode hex":"1F66D"},{"Typeface name":"Webdings","Dingbat dec":"250","Dingbat hex":"FA","Unicode dec":"128623","Unicode hex":"1F66F"},{"Typeface name":"Webdings","Dingbat dec":"251","Dingbat hex":"FB","Unicode dec":"128506","Unicode hex":"1F5FA"},{"Typeface name":"Webdings","Dingbat dec":"252","Dingbat hex":"FC","Unicode dec":"127757","Unicode hex":"1F30D"},{"Typeface name":"Webdings","Dingbat dec":"253","Dingbat hex":"FD","Unicode dec":"127759","Unicode hex":"1F30F"},{"Typeface name":"Webdings","Dingbat dec":"254","Dingbat hex":"FE","Unicode dec":"127758","Unicode hex":"1F30E"},{"Typeface name":"Webdings","Dingbat dec":"255","Dingbat hex":"FF","Unicode dec":"128330","Unicode hex":"1F54A"},{"Typeface name":"Wingdings","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Wingdings","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"128393","Unicode hex":"1F589"},{"Typeface name":"Wingdings","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"9986","Unicode hex":"2702"},{"Typeface name":"Wingdings","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"9985","Unicode hex":"2701"},{"Typeface name":"Wingdings","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"128083","Unicode hex":"1F453"},{"Typeface name":"Wingdings","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"128365","Unicode hex":"1F56D"},{"Typeface name":"Wingdings","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"128366","Unicode hex":"1F56E"},{"Typeface name":"Wingdings","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"128367","Unicode hex":"1F56F"},{"Typeface name":"Wingdings","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"128383","Unicode hex":"1F57F"},{"Typeface name":"Wingdings","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"9990","Unicode hex":"2706"},{"Typeface name":"Wingdings","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"128386","Unicode hex":"1F582"},{"Typeface name":"Wingdings","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"128387","Unicode hex":"1F583"},{"Typeface name":"Wingdings","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"128234","Unicode hex":"1F4EA"},{"Typeface name":"Wingdings","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"128235","Unicode hex":"1F4EB"},{"Typeface name":"Wingdings","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"128236","Unicode hex":"1F4EC"},{"Typeface name":"Wingdings","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"128237","Unicode hex":"1F4ED"},{"Typeface name":"Wingdings","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"128448","Unicode hex":"1F5C0"},{"Typeface name":"Wingdings","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"128449","Unicode hex":"1F5C1"},{"Typeface name":"Wingdings","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"128462","Unicode hex":"1F5CE"},{"Typeface name":"Wingdings","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"128463","Unicode hex":"1F5CF"},{"Typeface name":"Wingdings","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"128464","Unicode hex":"1F5D0"},{"Typeface name":"Wingdings","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"128452","Unicode hex":"1F5C4"},{"Typeface name":"Wingdings","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"8987","Unicode hex":"231B"},{"Typeface name":"Wingdings","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"128430","Unicode hex":"1F5AE"},{"Typeface name":"Wingdings","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"128432","Unicode hex":"1F5B0"},{"Typeface name":"Wingdings","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"128434","Unicode hex":"1F5B2"},{"Typeface name":"Wingdings","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"128435","Unicode hex":"1F5B3"},{"Typeface name":"Wingdings","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"128436","Unicode hex":"1F5B4"},{"Typeface name":"Wingdings","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"128427","Unicode hex":"1F5AB"},{"Typeface name":"Wingdings","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"128428","Unicode hex":"1F5AC"},{"Typeface name":"Wingdings","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"9991","Unicode hex":"2707"},{"Typeface name":"Wingdings","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"9997","Unicode hex":"270D"},{"Typeface name":"Wingdings","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"128398","Unicode hex":"1F58E"},{"Typeface name":"Wingdings","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"9996","Unicode hex":"270C"},{"Typeface name":"Wingdings","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"128399","Unicode hex":"1F58F"},{"Typeface name":"Wingdings","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"128077","Unicode hex":"1F44D"},{"Typeface name":"Wingdings","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"128078","Unicode hex":"1F44E"},{"Typeface name":"Wingdings","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"9756","Unicode hex":"261C"},{"Typeface name":"Wingdings","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"9758","Unicode hex":"261E"},{"Typeface name":"Wingdings","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"9757","Unicode hex":"261D"},{"Typeface name":"Wingdings","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"9759","Unicode hex":"261F"},{"Typeface name":"Wingdings","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"128400","Unicode hex":"1F590"},{"Typeface name":"Wingdings","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"9786","Unicode hex":"263A"},{"Typeface name":"Wingdings","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"128528","Unicode hex":"1F610"},{"Typeface name":"Wingdings","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"9785","Unicode hex":"2639"},{"Typeface name":"Wingdings","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"128163","Unicode hex":"1F4A3"},{"Typeface name":"Wingdings","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"128369","Unicode hex":"1F571"},{"Typeface name":"Wingdings","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"127987","Unicode hex":"1F3F3"},{"Typeface name":"Wingdings","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"127985","Unicode hex":"1F3F1"},{"Typeface name":"Wingdings","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"9992","Unicode hex":"2708"},{"Typeface name":"Wingdings","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"9788","Unicode hex":"263C"},{"Typeface name":"Wingdings","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"127778","Unicode hex":"1F322"},{"Typeface name":"Wingdings","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"10052","Unicode hex":"2744"},{"Typeface name":"Wingdings","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"128326","Unicode hex":"1F546"},{"Typeface name":"Wingdings","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"10014","Unicode hex":"271E"},{"Typeface name":"Wingdings","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"128328","Unicode hex":"1F548"},{"Typeface name":"Wingdings","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"10016","Unicode hex":"2720"},{"Typeface name":"Wingdings","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"10017","Unicode hex":"2721"},{"Typeface name":"Wingdings","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"9770","Unicode hex":"262A"},{"Typeface name":"Wingdings","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"9775","Unicode hex":"262F"},{"Typeface name":"Wingdings","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"128329","Unicode hex":"1F549"},{"Typeface name":"Wingdings","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"9784","Unicode hex":"2638"},{"Typeface name":"Wingdings","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"9800","Unicode hex":"2648"},{"Typeface name":"Wingdings","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"9801","Unicode hex":"2649"},{"Typeface name":"Wingdings","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"9802","Unicode hex":"264A"},{"Typeface name":"Wingdings","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"9803","Unicode hex":"264B"},{"Typeface name":"Wingdings","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"9804","Unicode hex":"264C"},{"Typeface name":"Wingdings","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"9805","Unicode hex":"264D"},{"Typeface name":"Wingdings","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"9806","Unicode hex":"264E"},{"Typeface name":"Wingdings","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"9807","Unicode hex":"264F"},{"Typeface name":"Wingdings","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"9808","Unicode hex":"2650"},{"Typeface name":"Wingdings","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"9809","Unicode hex":"2651"},{"Typeface name":"Wingdings","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"9810","Unicode hex":"2652"},{"Typeface name":"Wingdings","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"9811","Unicode hex":"2653"},{"Typeface name":"Wingdings","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"128624","Unicode hex":"1F670"},{"Typeface name":"Wingdings","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"128629","Unicode hex":"1F675"},{"Typeface name":"Wingdings","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"9899","Unicode hex":"26AB"},{"Typeface name":"Wingdings","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"128318","Unicode hex":"1F53E"},{"Typeface name":"Wingdings","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"9724","Unicode hex":"25FC"},{"Typeface name":"Wingdings","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"128911","Unicode hex":"1F78F"},{"Typeface name":"Wingdings","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"128912","Unicode hex":"1F790"},{"Typeface name":"Wingdings","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"10065","Unicode hex":"2751"},{"Typeface name":"Wingdings","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"10066","Unicode hex":"2752"},{"Typeface name":"Wingdings","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"128927","Unicode hex":"1F79F"},{"Typeface name":"Wingdings","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"10731","Unicode hex":"29EB"},{"Typeface name":"Wingdings","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"9670","Unicode hex":"25C6"},{"Typeface name":"Wingdings","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"10070","Unicode hex":"2756"},{"Typeface name":"Wingdings","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"11049","Unicode hex":"2B29"},{"Typeface name":"Wingdings","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"8999","Unicode hex":"2327"},{"Typeface name":"Wingdings","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"11193","Unicode hex":"2BB9"},{"Typeface name":"Wingdings","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"8984","Unicode hex":"2318"},{"Typeface name":"Wingdings","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"127989","Unicode hex":"1F3F5"},{"Typeface name":"Wingdings","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"127990","Unicode hex":"1F3F6"},{"Typeface name":"Wingdings","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"128630","Unicode hex":"1F676"},{"Typeface name":"Wingdings","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"128631","Unicode hex":"1F677"},{"Typeface name":"Wingdings","Dingbat dec":"127","Dingbat hex":"7F","Unicode dec":"9647","Unicode hex":"25AF"},{"Typeface name":"Wingdings","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"127243","Unicode hex":"1F10B"},{"Typeface name":"Wingdings","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"10112","Unicode hex":"2780"},{"Typeface name":"Wingdings","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"10113","Unicode hex":"2781"},{"Typeface name":"Wingdings","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"10114","Unicode hex":"2782"},{"Typeface name":"Wingdings","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"10115","Unicode hex":"2783"},{"Typeface name":"Wingdings","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"10116","Unicode hex":"2784"},{"Typeface name":"Wingdings","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"10117","Unicode hex":"2785"},{"Typeface name":"Wingdings","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"10118","Unicode hex":"2786"},{"Typeface name":"Wingdings","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"10119","Unicode hex":"2787"},{"Typeface name":"Wingdings","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"10120","Unicode hex":"2788"},{"Typeface name":"Wingdings","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"10121","Unicode hex":"2789"},{"Typeface name":"Wingdings","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"127244","Unicode hex":"1F10C"},{"Typeface name":"Wingdings","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"10122","Unicode hex":"278A"},{"Typeface name":"Wingdings","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"10123","Unicode hex":"278B"},{"Typeface name":"Wingdings","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"10124","Unicode hex":"278C"},{"Typeface name":"Wingdings","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"10125","Unicode hex":"278D"},{"Typeface name":"Wingdings","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"10126","Unicode hex":"278E"},{"Typeface name":"Wingdings","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"10127","Unicode hex":"278F"},{"Typeface name":"Wingdings","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"10128","Unicode hex":"2790"},{"Typeface name":"Wingdings","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"10129","Unicode hex":"2791"},{"Typeface name":"Wingdings","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"10130","Unicode hex":"2792"},{"Typeface name":"Wingdings","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"10131","Unicode hex":"2793"},{"Typeface name":"Wingdings","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"128610","Unicode hex":"1F662"},{"Typeface name":"Wingdings","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"128608","Unicode hex":"1F660"},{"Typeface name":"Wingdings","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"128609","Unicode hex":"1F661"},{"Typeface name":"Wingdings","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"128611","Unicode hex":"1F663"},{"Typeface name":"Wingdings","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"128606","Unicode hex":"1F65E"},{"Typeface name":"Wingdings","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"128604","Unicode hex":"1F65C"},{"Typeface name":"Wingdings","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"128605","Unicode hex":"1F65D"},{"Typeface name":"Wingdings","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"128607","Unicode hex":"1F65F"},{"Typeface name":"Wingdings","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"8729","Unicode hex":"2219"},{"Typeface name":"Wingdings","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"8226","Unicode hex":"2022"},{"Typeface name":"Wingdings","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"11037","Unicode hex":"2B1D"},{"Typeface name":"Wingdings","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"11096","Unicode hex":"2B58"},{"Typeface name":"Wingdings","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"128902","Unicode hex":"1F786"},{"Typeface name":"Wingdings","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"128904","Unicode hex":"1F788"},{"Typeface name":"Wingdings","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"128906","Unicode hex":"1F78A"},{"Typeface name":"Wingdings","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"128907","Unicode hex":"1F78B"},{"Typeface name":"Wingdings","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"128319","Unicode hex":"1F53F"},{"Typeface name":"Wingdings","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"9642","Unicode hex":"25AA"},{"Typeface name":"Wingdings","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"128910","Unicode hex":"1F78E"},{"Typeface name":"Wingdings","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"128961","Unicode hex":"1F7C1"},{"Typeface name":"Wingdings","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"128965","Unicode hex":"1F7C5"},{"Typeface name":"Wingdings","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"9733","Unicode hex":"2605"},{"Typeface name":"Wingdings","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"128971","Unicode hex":"1F7CB"},{"Typeface name":"Wingdings","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"128975","Unicode hex":"1F7CF"},{"Typeface name":"Wingdings","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"128979","Unicode hex":"1F7D3"},{"Typeface name":"Wingdings","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"128977","Unicode hex":"1F7D1"},{"Typeface name":"Wingdings","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"11216","Unicode hex":"2BD0"},{"Typeface name":"Wingdings","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"8982","Unicode hex":"2316"},{"Typeface name":"Wingdings","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"11214","Unicode hex":"2BCE"},{"Typeface name":"Wingdings","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"11215","Unicode hex":"2BCF"},{"Typeface name":"Wingdings","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"11217","Unicode hex":"2BD1"},{"Typeface name":"Wingdings","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"10026","Unicode hex":"272A"},{"Typeface name":"Wingdings","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"10032","Unicode hex":"2730"},{"Typeface name":"Wingdings","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"128336","Unicode hex":"1F550"},{"Typeface name":"Wingdings","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"128337","Unicode hex":"1F551"},{"Typeface name":"Wingdings","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"128338","Unicode hex":"1F552"},{"Typeface name":"Wingdings","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"128339","Unicode hex":"1F553"},{"Typeface name":"Wingdings","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"128340","Unicode hex":"1F554"},{"Typeface name":"Wingdings","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"128341","Unicode hex":"1F555"},{"Typeface name":"Wingdings","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"128342","Unicode hex":"1F556"},{"Typeface name":"Wingdings","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"128343","Unicode hex":"1F557"},{"Typeface name":"Wingdings","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"128344","Unicode hex":"1F558"},{"Typeface name":"Wingdings","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"128345","Unicode hex":"1F559"},{"Typeface name":"Wingdings","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"128346","Unicode hex":"1F55A"},{"Typeface name":"Wingdings","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"128347","Unicode hex":"1F55B"},{"Typeface name":"Wingdings","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"11184","Unicode hex":"2BB0"},{"Typeface name":"Wingdings","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"11185","Unicode hex":"2BB1"},{"Typeface name":"Wingdings","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"11186","Unicode hex":"2BB2"},{"Typeface name":"Wingdings","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"11187","Unicode hex":"2BB3"},{"Typeface name":"Wingdings","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"11188","Unicode hex":"2BB4"},{"Typeface name":"Wingdings","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"11189","Unicode hex":"2BB5"},{"Typeface name":"Wingdings","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"11190","Unicode hex":"2BB6"},{"Typeface name":"Wingdings","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"11191","Unicode hex":"2BB7"},{"Typeface name":"Wingdings","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"128618","Unicode hex":"1F66A"},{"Typeface name":"Wingdings","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"128619","Unicode hex":"1F66B"},{"Typeface name":"Wingdings","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"128597","Unicode hex":"1F655"},{"Typeface name":"Wingdings","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"128596","Unicode hex":"1F654"},{"Typeface name":"Wingdings","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"128599","Unicode hex":"1F657"},{"Typeface name":"Wingdings","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"128598","Unicode hex":"1F656"},{"Typeface name":"Wingdings","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"128592","Unicode hex":"1F650"},{"Typeface name":"Wingdings","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"128593","Unicode hex":"1F651"},{"Typeface name":"Wingdings","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"128594","Unicode hex":"1F652"},{"Typeface name":"Wingdings","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"128595","Unicode hex":"1F653"},{"Typeface name":"Wingdings","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"9003","Unicode hex":"232B"},{"Typeface name":"Wingdings","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"8998","Unicode hex":"2326"},{"Typeface name":"Wingdings","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"11160","Unicode hex":"2B98"},{"Typeface name":"Wingdings","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"11162","Unicode hex":"2B9A"},{"Typeface name":"Wingdings","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"11161","Unicode hex":"2B99"},{"Typeface name":"Wingdings","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"11163","Unicode hex":"2B9B"},{"Typeface name":"Wingdings","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"11144","Unicode hex":"2B88"},{"Typeface name":"Wingdings","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"11146","Unicode hex":"2B8A"},{"Typeface name":"Wingdings","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"11145","Unicode hex":"2B89"},{"Typeface name":"Wingdings","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"11147","Unicode hex":"2B8B"},{"Typeface name":"Wingdings","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"129128","Unicode hex":"1F868"},{"Typeface name":"Wingdings","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"129130","Unicode hex":"1F86A"},{"Typeface name":"Wingdings","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"129129","Unicode hex":"1F869"},{"Typeface name":"Wingdings","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"129131","Unicode hex":"1F86B"},{"Typeface name":"Wingdings","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"129132","Unicode hex":"1F86C"},{"Typeface name":"Wingdings","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"129133","Unicode hex":"1F86D"},{"Typeface name":"Wingdings","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"129135","Unicode hex":"1F86F"},{"Typeface name":"Wingdings","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"129134","Unicode hex":"1F86E"},{"Typeface name":"Wingdings","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"129144","Unicode hex":"1F878"},{"Typeface name":"Wingdings","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"129146","Unicode hex":"1F87A"},{"Typeface name":"Wingdings","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"129145","Unicode hex":"1F879"},{"Typeface name":"Wingdings","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"129147","Unicode hex":"1F87B"},{"Typeface name":"Wingdings","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"129148","Unicode hex":"1F87C"},{"Typeface name":"Wingdings","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"129149","Unicode hex":"1F87D"},{"Typeface name":"Wingdings","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"129151","Unicode hex":"1F87F"},{"Typeface name":"Wingdings","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"129150","Unicode hex":"1F87E"},{"Typeface name":"Wingdings","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"8678","Unicode hex":"21E6"},{"Typeface name":"Wingdings","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"8680","Unicode hex":"21E8"},{"Typeface name":"Wingdings","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"8679","Unicode hex":"21E7"},{"Typeface name":"Wingdings","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"8681","Unicode hex":"21E9"},{"Typeface name":"Wingdings","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"11012","Unicode hex":"2B04"},{"Typeface name":"Wingdings","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"8691","Unicode hex":"21F3"},{"Typeface name":"Wingdings","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"11009","Unicode hex":"2B01"},{"Typeface name":"Wingdings","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"11008","Unicode hex":"2B00"},{"Typeface name":"Wingdings","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"11011","Unicode hex":"2B03"},{"Typeface name":"Wingdings","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"11010","Unicode hex":"2B02"},{"Typeface name":"Wingdings","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"129196","Unicode hex":"1F8AC"},{"Typeface name":"Wingdings","Dingbat dec":"250","Dingbat hex":"FA","Unicode dec":"129197","Unicode hex":"1F8AD"},{"Typeface name":"Wingdings","Dingbat dec":"251","Dingbat hex":"FB","Unicode dec":"128502","Unicode hex":"1F5F6"},{"Typeface name":"Wingdings","Dingbat dec":"252","Dingbat hex":"FC","Unicode dec":"10003","Unicode hex":"2713"},{"Typeface name":"Wingdings","Dingbat dec":"253","Dingbat hex":"FD","Unicode dec":"128503","Unicode hex":"1F5F7"},{"Typeface name":"Wingdings","Dingbat dec":"254","Dingbat hex":"FE","Unicode dec":"128505","Unicode hex":"1F5F9"},{"Typeface name":"Wingdings 2","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Wingdings 2","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"128394","Unicode hex":"1F58A"},{"Typeface name":"Wingdings 2","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"128395","Unicode hex":"1F58B"},{"Typeface name":"Wingdings 2","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"128396","Unicode hex":"1F58C"},{"Typeface name":"Wingdings 2","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"128397","Unicode hex":"1F58D"},{"Typeface name":"Wingdings 2","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"9988","Unicode hex":"2704"},{"Typeface name":"Wingdings 2","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"9984","Unicode hex":"2700"},{"Typeface name":"Wingdings 2","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"128382","Unicode hex":"1F57E"},{"Typeface name":"Wingdings 2","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"128381","Unicode hex":"1F57D"},{"Typeface name":"Wingdings 2","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"128453","Unicode hex":"1F5C5"},{"Typeface name":"Wingdings 2","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"128454","Unicode hex":"1F5C6"},{"Typeface name":"Wingdings 2","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"128455","Unicode hex":"1F5C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"128456","Unicode hex":"1F5C8"},{"Typeface name":"Wingdings 2","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"128457","Unicode hex":"1F5C9"},{"Typeface name":"Wingdings 2","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"128458","Unicode hex":"1F5CA"},{"Typeface name":"Wingdings 2","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"128459","Unicode hex":"1F5CB"},{"Typeface name":"Wingdings 2","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"128460","Unicode hex":"1F5CC"},{"Typeface name":"Wingdings 2","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"128461","Unicode hex":"1F5CD"},{"Typeface name":"Wingdings 2","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"128203","Unicode hex":"1F4CB"},{"Typeface name":"Wingdings 2","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"128465","Unicode hex":"1F5D1"},{"Typeface name":"Wingdings 2","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"128468","Unicode hex":"1F5D4"},{"Typeface name":"Wingdings 2","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"128437","Unicode hex":"1F5B5"},{"Typeface name":"Wingdings 2","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"128438","Unicode hex":"1F5B6"},{"Typeface name":"Wingdings 2","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"128439","Unicode hex":"1F5B7"},{"Typeface name":"Wingdings 2","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"128440","Unicode hex":"1F5B8"},{"Typeface name":"Wingdings 2","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"128429","Unicode hex":"1F5AD"},{"Typeface name":"Wingdings 2","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"128431","Unicode hex":"1F5AF"},{"Typeface name":"Wingdings 2","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"128433","Unicode hex":"1F5B1"},{"Typeface name":"Wingdings 2","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"128402","Unicode hex":"1F592"},{"Typeface name":"Wingdings 2","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"128403","Unicode hex":"1F593"},{"Typeface name":"Wingdings 2","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"128408","Unicode hex":"1F598"},{"Typeface name":"Wingdings 2","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"128409","Unicode hex":"1F599"},{"Typeface name":"Wingdings 2","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"128410","Unicode hex":"1F59A"},{"Typeface name":"Wingdings 2","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"128411","Unicode hex":"1F59B"},{"Typeface name":"Wingdings 2","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"128072","Unicode hex":"1F448"},{"Typeface name":"Wingdings 2","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"128073","Unicode hex":"1F449"},{"Typeface name":"Wingdings 2","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"128412","Unicode hex":"1F59C"},{"Typeface name":"Wingdings 2","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"128413","Unicode hex":"1F59D"},{"Typeface name":"Wingdings 2","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"128414","Unicode hex":"1F59E"},{"Typeface name":"Wingdings 2","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"128415","Unicode hex":"1F59F"},{"Typeface name":"Wingdings 2","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"128416","Unicode hex":"1F5A0"},{"Typeface name":"Wingdings 2","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"128417","Unicode hex":"1F5A1"},{"Typeface name":"Wingdings 2","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"128070","Unicode hex":"1F446"},{"Typeface name":"Wingdings 2","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"128071","Unicode hex":"1F447"},{"Typeface name":"Wingdings 2","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"128418","Unicode hex":"1F5A2"},{"Typeface name":"Wingdings 2","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"128419","Unicode hex":"1F5A3"},{"Typeface name":"Wingdings 2","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"128401","Unicode hex":"1F591"},{"Typeface name":"Wingdings 2","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"128500","Unicode hex":"1F5F4"},{"Typeface name":"Wingdings 2","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"128504","Unicode hex":"1F5F8"},{"Typeface name":"Wingdings 2","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"128501","Unicode hex":"1F5F5"},{"Typeface name":"Wingdings 2","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"9745","Unicode hex":"2611"},{"Typeface name":"Wingdings 2","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"11197","Unicode hex":"2BBD"},{"Typeface name":"Wingdings 2","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"9746","Unicode hex":"2612"},{"Typeface name":"Wingdings 2","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"11198","Unicode hex":"2BBE"},{"Typeface name":"Wingdings 2","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"11199","Unicode hex":"2BBF"},{"Typeface name":"Wingdings 2","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"128711","Unicode hex":"1F6C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"10680","Unicode hex":"29B8"},{"Typeface name":"Wingdings 2","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"128625","Unicode hex":"1F671"},{"Typeface name":"Wingdings 2","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"128628","Unicode hex":"1F674"},{"Typeface name":"Wingdings 2","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"128626","Unicode hex":"1F672"},{"Typeface name":"Wingdings 2","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"128627","Unicode hex":"1F673"},{"Typeface name":"Wingdings 2","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"8253","Unicode hex":"203D"},{"Typeface name":"Wingdings 2","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"128633","Unicode hex":"1F679"},{"Typeface name":"Wingdings 2","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"128634","Unicode hex":"1F67A"},{"Typeface name":"Wingdings 2","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"128635","Unicode hex":"1F67B"},{"Typeface name":"Wingdings 2","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"128614","Unicode hex":"1F666"},{"Typeface name":"Wingdings 2","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"128612","Unicode hex":"1F664"},{"Typeface name":"Wingdings 2","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"128613","Unicode hex":"1F665"},{"Typeface name":"Wingdings 2","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"128615","Unicode hex":"1F667"},{"Typeface name":"Wingdings 2","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"128602","Unicode hex":"1F65A"},{"Typeface name":"Wingdings 2","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"128600","Unicode hex":"1F658"},{"Typeface name":"Wingdings 2","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"128601","Unicode hex":"1F659"},{"Typeface name":"Wingdings 2","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"128603","Unicode hex":"1F65B"},{"Typeface name":"Wingdings 2","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"9450","Unicode hex":"24EA"},{"Typeface name":"Wingdings 2","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"9312","Unicode hex":"2460"},{"Typeface name":"Wingdings 2","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"9313","Unicode hex":"2461"},{"Typeface name":"Wingdings 2","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"9314","Unicode hex":"2462"},{"Typeface name":"Wingdings 2","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"9315","Unicode hex":"2463"},{"Typeface name":"Wingdings 2","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"9316","Unicode hex":"2464"},{"Typeface name":"Wingdings 2","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"9317","Unicode hex":"2465"},{"Typeface name":"Wingdings 2","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"9318","Unicode hex":"2466"},{"Typeface name":"Wingdings 2","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"9319","Unicode hex":"2467"},{"Typeface name":"Wingdings 2","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"9320","Unicode hex":"2468"},{"Typeface name":"Wingdings 2","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"9321","Unicode hex":"2469"},{"Typeface name":"Wingdings 2","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"9471","Unicode hex":"24FF"},{"Typeface name":"Wingdings 2","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"10102","Unicode hex":"2776"},{"Typeface name":"Wingdings 2","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"10103","Unicode hex":"2777"},{"Typeface name":"Wingdings 2","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"10104","Unicode hex":"2778"},{"Typeface name":"Wingdings 2","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"10105","Unicode hex":"2779"},{"Typeface name":"Wingdings 2","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"10106","Unicode hex":"277A"},{"Typeface name":"Wingdings 2","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"10107","Unicode hex":"277B"},{"Typeface name":"Wingdings 2","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"10108","Unicode hex":"277C"},{"Typeface name":"Wingdings 2","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"10109","Unicode hex":"277D"},{"Typeface name":"Wingdings 2","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"10110","Unicode hex":"277E"},{"Typeface name":"Wingdings 2","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"10111","Unicode hex":"277F"},{"Typeface name":"Wingdings 2","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"9737","Unicode hex":"2609"},{"Typeface name":"Wingdings 2","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"127765","Unicode hex":"1F315"},{"Typeface name":"Wingdings 2","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"9789","Unicode hex":"263D"},{"Typeface name":"Wingdings 2","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"9790","Unicode hex":"263E"},{"Typeface name":"Wingdings 2","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"11839","Unicode hex":"2E3F"},{"Typeface name":"Wingdings 2","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"10013","Unicode hex":"271D"},{"Typeface name":"Wingdings 2","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"128327","Unicode hex":"1F547"},{"Typeface name":"Wingdings 2","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"128348","Unicode hex":"1F55C"},{"Typeface name":"Wingdings 2","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"128349","Unicode hex":"1F55D"},{"Typeface name":"Wingdings 2","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"128350","Unicode hex":"1F55E"},{"Typeface name":"Wingdings 2","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"128351","Unicode hex":"1F55F"},{"Typeface name":"Wingdings 2","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"128352","Unicode hex":"1F560"},{"Typeface name":"Wingdings 2","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"128353","Unicode hex":"1F561"},{"Typeface name":"Wingdings 2","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"128354","Unicode hex":"1F562"},{"Typeface name":"Wingdings 2","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"128355","Unicode hex":"1F563"},{"Typeface name":"Wingdings 2","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"128356","Unicode hex":"1F564"},{"Typeface name":"Wingdings 2","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"128357","Unicode hex":"1F565"},{"Typeface name":"Wingdings 2","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"128358","Unicode hex":"1F566"},{"Typeface name":"Wingdings 2","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"128359","Unicode hex":"1F567"},{"Typeface name":"Wingdings 2","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"128616","Unicode hex":"1F668"},{"Typeface name":"Wingdings 2","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"128617","Unicode hex":"1F669"},{"Typeface name":"Wingdings 2","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"8901","Unicode hex":"22C5"},{"Typeface name":"Wingdings 2","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"128900","Unicode hex":"1F784"},{"Typeface name":"Wingdings 2","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"10625","Unicode hex":"2981"},{"Typeface name":"Wingdings 2","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"9679","Unicode hex":"25CF"},{"Typeface name":"Wingdings 2","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"9675","Unicode hex":"25CB"},{"Typeface name":"Wingdings 2","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"128901","Unicode hex":"1F785"},{"Typeface name":"Wingdings 2","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"128903","Unicode hex":"1F787"},{"Typeface name":"Wingdings 2","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"128905","Unicode hex":"1F789"},{"Typeface name":"Wingdings 2","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"8857","Unicode hex":"2299"},{"Typeface name":"Wingdings 2","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"10687","Unicode hex":"29BF"},{"Typeface name":"Wingdings 2","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"128908","Unicode hex":"1F78C"},{"Typeface name":"Wingdings 2","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"128909","Unicode hex":"1F78D"},{"Typeface name":"Wingdings 2","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"9726","Unicode hex":"25FE"},{"Typeface name":"Wingdings 2","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"9632","Unicode hex":"25A0"},{"Typeface name":"Wingdings 2","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"9633","Unicode hex":"25A1"},{"Typeface name":"Wingdings 2","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"128913","Unicode hex":"1F791"},{"Typeface name":"Wingdings 2","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"128914","Unicode hex":"1F792"},{"Typeface name":"Wingdings 2","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"128915","Unicode hex":"1F793"},{"Typeface name":"Wingdings 2","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"128916","Unicode hex":"1F794"},{"Typeface name":"Wingdings 2","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"9635","Unicode hex":"25A3"},{"Typeface name":"Wingdings 2","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"128917","Unicode hex":"1F795"},{"Typeface name":"Wingdings 2","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"128918","Unicode hex":"1F796"},{"Typeface name":"Wingdings 2","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"128919","Unicode hex":"1F797"},{"Typeface name":"Wingdings 2","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"128920","Unicode hex":"1F798"},{"Typeface name":"Wingdings 2","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"11049","Unicode hex":"2B29"},{"Typeface name":"Wingdings 2","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"11045","Unicode hex":"2B25"},{"Typeface name":"Wingdings 2","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"9671","Unicode hex":"25C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"128922","Unicode hex":"1F79A"},{"Typeface name":"Wingdings 2","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"9672","Unicode hex":"25C8"},{"Typeface name":"Wingdings 2","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"128923","Unicode hex":"1F79B"},{"Typeface name":"Wingdings 2","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"128924","Unicode hex":"1F79C"},{"Typeface name":"Wingdings 2","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"128925","Unicode hex":"1F79D"},{"Typeface name":"Wingdings 2","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"128926","Unicode hex":"1F79E"},{"Typeface name":"Wingdings 2","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"11050","Unicode hex":"2B2A"},{"Typeface name":"Wingdings 2","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"11047","Unicode hex":"2B27"},{"Typeface name":"Wingdings 2","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"9674","Unicode hex":"25CA"},{"Typeface name":"Wingdings 2","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"128928","Unicode hex":"1F7A0"},{"Typeface name":"Wingdings 2","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"9686","Unicode hex":"25D6"},{"Typeface name":"Wingdings 2","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"9687","Unicode hex":"25D7"},{"Typeface name":"Wingdings 2","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"11210","Unicode hex":"2BCA"},{"Typeface name":"Wingdings 2","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"11211","Unicode hex":"2BCB"},{"Typeface name":"Wingdings 2","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"11200","Unicode hex":"2BC0"},{"Typeface name":"Wingdings 2","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"11201","Unicode hex":"2BC1"},{"Typeface name":"Wingdings 2","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"11039","Unicode hex":"2B1F"},{"Typeface name":"Wingdings 2","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"11202","Unicode hex":"2BC2"},{"Typeface name":"Wingdings 2","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"11043","Unicode hex":"2B23"},{"Typeface name":"Wingdings 2","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"11042","Unicode hex":"2B22"},{"Typeface name":"Wingdings 2","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"11203","Unicode hex":"2BC3"},{"Typeface name":"Wingdings 2","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"11204","Unicode hex":"2BC4"},{"Typeface name":"Wingdings 2","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"128929","Unicode hex":"1F7A1"},{"Typeface name":"Wingdings 2","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"128930","Unicode hex":"1F7A2"},{"Typeface name":"Wingdings 2","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"128931","Unicode hex":"1F7A3"},{"Typeface name":"Wingdings 2","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"128932","Unicode hex":"1F7A4"},{"Typeface name":"Wingdings 2","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"128933","Unicode hex":"1F7A5"},{"Typeface name":"Wingdings 2","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"128934","Unicode hex":"1F7A6"},{"Typeface name":"Wingdings 2","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"128935","Unicode hex":"1F7A7"},{"Typeface name":"Wingdings 2","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"128936","Unicode hex":"1F7A8"},{"Typeface name":"Wingdings 2","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"128937","Unicode hex":"1F7A9"},{"Typeface name":"Wingdings 2","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"128938","Unicode hex":"1F7AA"},{"Typeface name":"Wingdings 2","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"128939","Unicode hex":"1F7AB"},{"Typeface name":"Wingdings 2","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"128940","Unicode hex":"1F7AC"},{"Typeface name":"Wingdings 2","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"128941","Unicode hex":"1F7AD"},{"Typeface name":"Wingdings 2","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"128942","Unicode hex":"1F7AE"},{"Typeface name":"Wingdings 2","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"128943","Unicode hex":"1F7AF"},{"Typeface name":"Wingdings 2","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"128944","Unicode hex":"1F7B0"},{"Typeface name":"Wingdings 2","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"128945","Unicode hex":"1F7B1"},{"Typeface name":"Wingdings 2","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"128946","Unicode hex":"1F7B2"},{"Typeface name":"Wingdings 2","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"128947","Unicode hex":"1F7B3"},{"Typeface name":"Wingdings 2","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"128948","Unicode hex":"1F7B4"},{"Typeface name":"Wingdings 2","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"128949","Unicode hex":"1F7B5"},{"Typeface name":"Wingdings 2","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"128950","Unicode hex":"1F7B6"},{"Typeface name":"Wingdings 2","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"128951","Unicode hex":"1F7B7"},{"Typeface name":"Wingdings 2","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"128952","Unicode hex":"1F7B8"},{"Typeface name":"Wingdings 2","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"128953","Unicode hex":"1F7B9"},{"Typeface name":"Wingdings 2","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"128954","Unicode hex":"1F7BA"},{"Typeface name":"Wingdings 2","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"128955","Unicode hex":"1F7BB"},{"Typeface name":"Wingdings 2","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"128956","Unicode hex":"1F7BC"},{"Typeface name":"Wingdings 2","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"128957","Unicode hex":"1F7BD"},{"Typeface name":"Wingdings 2","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"128958","Unicode hex":"1F7BE"},{"Typeface name":"Wingdings 2","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"128959","Unicode hex":"1F7BF"},{"Typeface name":"Wingdings 2","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"128960","Unicode hex":"1F7C0"},{"Typeface name":"Wingdings 2","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"128962","Unicode hex":"1F7C2"},{"Typeface name":"Wingdings 2","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"128964","Unicode hex":"1F7C4"},{"Typeface name":"Wingdings 2","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"128966","Unicode hex":"1F7C6"},{"Typeface name":"Wingdings 2","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"128969","Unicode hex":"1F7C9"},{"Typeface name":"Wingdings 2","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"128970","Unicode hex":"1F7CA"},{"Typeface name":"Wingdings 2","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"10038","Unicode hex":"2736"},{"Typeface name":"Wingdings 2","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"128972","Unicode hex":"1F7CC"},{"Typeface name":"Wingdings 2","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"128974","Unicode hex":"1F7CE"},{"Typeface name":"Wingdings 2","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"128976","Unicode hex":"1F7D0"},{"Typeface name":"Wingdings 2","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"128978","Unicode hex":"1F7D2"},{"Typeface name":"Wingdings 2","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"10041","Unicode hex":"2739"},{"Typeface name":"Wingdings 2","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"128963","Unicode hex":"1F7C3"},{"Typeface name":"Wingdings 2","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"128967","Unicode hex":"1F7C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"10031","Unicode hex":"272F"},{"Typeface name":"Wingdings 2","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"128973","Unicode hex":"1F7CD"},{"Typeface name":"Wingdings 2","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"128980","Unicode hex":"1F7D4"},{"Typeface name":"Wingdings 2","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"11212","Unicode hex":"2BCC"},{"Typeface name":"Wingdings 2","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"11213","Unicode hex":"2BCD"},{"Typeface name":"Wingdings 2","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"8251","Unicode hex":"203B"},{"Typeface name":"Wingdings 2","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"8258","Unicode hex":"2042"},{"Typeface name":"Wingdings 3","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Wingdings 3","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"11104","Unicode hex":"2B60"},{"Typeface name":"Wingdings 3","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"11106","Unicode hex":"2B62"},{"Typeface name":"Wingdings 3","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"11105","Unicode hex":"2B61"},{"Typeface name":"Wingdings 3","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"11107","Unicode hex":"2B63"},{"Typeface name":"Wingdings 3","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"11110","Unicode hex":"2B66"},{"Typeface name":"Wingdings 3","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"11111","Unicode hex":"2B67"},{"Typeface name":"Wingdings 3","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"11113","Unicode hex":"2B69"},{"Typeface name":"Wingdings 3","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"11112","Unicode hex":"2B68"},{"Typeface name":"Wingdings 3","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"11120","Unicode hex":"2B70"},{"Typeface name":"Wingdings 3","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"11122","Unicode hex":"2B72"},{"Typeface name":"Wingdings 3","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"11121","Unicode hex":"2B71"},{"Typeface name":"Wingdings 3","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"11123","Unicode hex":"2B73"},{"Typeface name":"Wingdings 3","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"11126","Unicode hex":"2B76"},{"Typeface name":"Wingdings 3","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"11128","Unicode hex":"2B78"},{"Typeface name":"Wingdings 3","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"11131","Unicode hex":"2B7B"},{"Typeface name":"Wingdings 3","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"11133","Unicode hex":"2B7D"},{"Typeface name":"Wingdings 3","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"11108","Unicode hex":"2B64"},{"Typeface name":"Wingdings 3","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"11109","Unicode hex":"2B65"},{"Typeface name":"Wingdings 3","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"11114","Unicode hex":"2B6A"},{"Typeface name":"Wingdings 3","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"11116","Unicode hex":"2B6C"},{"Typeface name":"Wingdings 3","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"11115","Unicode hex":"2B6B"},{"Typeface name":"Wingdings 3","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"11117","Unicode hex":"2B6D"},{"Typeface name":"Wingdings 3","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"11085","Unicode hex":"2B4D"},{"Typeface name":"Wingdings 3","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"11168","Unicode hex":"2BA0"},{"Typeface name":"Wingdings 3","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"11169","Unicode hex":"2BA1"},{"Typeface name":"Wingdings 3","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"11170","Unicode hex":"2BA2"},{"Typeface name":"Wingdings 3","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"11171","Unicode hex":"2BA3"},{"Typeface name":"Wingdings 3","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"11172","Unicode hex":"2BA4"},{"Typeface name":"Wingdings 3","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"11173","Unicode hex":"2BA5"},{"Typeface name":"Wingdings 3","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"11174","Unicode hex":"2BA6"},{"Typeface name":"Wingdings 3","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"11175","Unicode hex":"2BA7"},{"Typeface name":"Wingdings 3","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"11152","Unicode hex":"2B90"},{"Typeface name":"Wingdings 3","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"11153","Unicode hex":"2B91"},{"Typeface name":"Wingdings 3","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"11154","Unicode hex":"2B92"},{"Typeface name":"Wingdings 3","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"11155","Unicode hex":"2B93"},{"Typeface name":"Wingdings 3","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"11136","Unicode hex":"2B80"},{"Typeface name":"Wingdings 3","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"11139","Unicode hex":"2B83"},{"Typeface name":"Wingdings 3","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"11134","Unicode hex":"2B7E"},{"Typeface name":"Wingdings 3","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"11135","Unicode hex":"2B7F"},{"Typeface name":"Wingdings 3","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"11140","Unicode hex":"2B84"},{"Typeface name":"Wingdings 3","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"11142","Unicode hex":"2B86"},{"Typeface name":"Wingdings 3","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"11141","Unicode hex":"2B85"},{"Typeface name":"Wingdings 3","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"11143","Unicode hex":"2B87"},{"Typeface name":"Wingdings 3","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"11151","Unicode hex":"2B8F"},{"Typeface name":"Wingdings 3","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"11149","Unicode hex":"2B8D"},{"Typeface name":"Wingdings 3","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"11150","Unicode hex":"2B8E"},{"Typeface name":"Wingdings 3","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"11148","Unicode hex":"2B8C"},{"Typeface name":"Wingdings 3","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"11118","Unicode hex":"2B6E"},{"Typeface name":"Wingdings 3","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"11119","Unicode hex":"2B6F"},{"Typeface name":"Wingdings 3","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"9099","Unicode hex":"238B"},{"Typeface name":"Wingdings 3","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"8996","Unicode hex":"2324"},{"Typeface name":"Wingdings 3","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"8963","Unicode hex":"2303"},{"Typeface name":"Wingdings 3","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"8997","Unicode hex":"2325"},{"Typeface name":"Wingdings 3","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"9251","Unicode hex":"2423"},{"Typeface name":"Wingdings 3","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"9085","Unicode hex":"237D"},{"Typeface name":"Wingdings 3","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"8682","Unicode hex":"21EA"},{"Typeface name":"Wingdings 3","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"11192","Unicode hex":"2BB8"},{"Typeface name":"Wingdings 3","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"129184","Unicode hex":"1F8A0"},{"Typeface name":"Wingdings 3","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"129185","Unicode hex":"1F8A1"},{"Typeface name":"Wingdings 3","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"129186","Unicode hex":"1F8A2"},{"Typeface name":"Wingdings 3","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"129187","Unicode hex":"1F8A3"},{"Typeface name":"Wingdings 3","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"129188","Unicode hex":"1F8A4"},{"Typeface name":"Wingdings 3","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"129189","Unicode hex":"1F8A5"},{"Typeface name":"Wingdings 3","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"129190","Unicode hex":"1F8A6"},{"Typeface name":"Wingdings 3","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"129191","Unicode hex":"1F8A7"},{"Typeface name":"Wingdings 3","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"129192","Unicode hex":"1F8A8"},{"Typeface name":"Wingdings 3","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"129193","Unicode hex":"1F8A9"},{"Typeface name":"Wingdings 3","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"129194","Unicode hex":"1F8AA"},{"Typeface name":"Wingdings 3","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"129195","Unicode hex":"1F8AB"},{"Typeface name":"Wingdings 3","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"129104","Unicode hex":"1F850"},{"Typeface name":"Wingdings 3","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"129106","Unicode hex":"1F852"},{"Typeface name":"Wingdings 3","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"129105","Unicode hex":"1F851"},{"Typeface name":"Wingdings 3","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"129107","Unicode hex":"1F853"},{"Typeface name":"Wingdings 3","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"129108","Unicode hex":"1F854"},{"Typeface name":"Wingdings 3","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"129109","Unicode hex":"1F855"},{"Typeface name":"Wingdings 3","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"129111","Unicode hex":"1F857"},{"Typeface name":"Wingdings 3","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"129110","Unicode hex":"1F856"},{"Typeface name":"Wingdings 3","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"129112","Unicode hex":"1F858"},{"Typeface name":"Wingdings 3","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"129113","Unicode hex":"1F859"},{"Typeface name":"Wingdings 3","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"9650","Unicode hex":"25B2"},{"Typeface name":"Wingdings 3","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"9660","Unicode hex":"25BC"},{"Typeface name":"Wingdings 3","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"9651","Unicode hex":"25B3"},{"Typeface name":"Wingdings 3","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"9661","Unicode hex":"25BD"},{"Typeface name":"Wingdings 3","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"9664","Unicode hex":"25C0"},{"Typeface name":"Wingdings 3","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"9654","Unicode hex":"25B6"},{"Typeface name":"Wingdings 3","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"9665","Unicode hex":"25C1"},{"Typeface name":"Wingdings 3","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"9655","Unicode hex":"25B7"},{"Typeface name":"Wingdings 3","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"9699","Unicode hex":"25E3"},{"Typeface name":"Wingdings 3","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"9698","Unicode hex":"25E2"},{"Typeface name":"Wingdings 3","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"9700","Unicode hex":"25E4"},{"Typeface name":"Wingdings 3","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"9701","Unicode hex":"25E5"},{"Typeface name":"Wingdings 3","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"128896","Unicode hex":"1F780"},{"Typeface name":"Wingdings 3","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"128898","Unicode hex":"1F782"},{"Typeface name":"Wingdings 3","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"128897","Unicode hex":"1F781"},{"Typeface name":"Wingdings 3","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"128899","Unicode hex":"1F783"},{"Typeface name":"Wingdings 3","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"11205","Unicode hex":"2BC5"},{"Typeface name":"Wingdings 3","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"11206","Unicode hex":"2BC6"},{"Typeface name":"Wingdings 3","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"11207","Unicode hex":"2BC7"},{"Typeface name":"Wingdings 3","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"11208","Unicode hex":"2BC8"},{"Typeface name":"Wingdings 3","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"11164","Unicode hex":"2B9C"},{"Typeface name":"Wingdings 3","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"11166","Unicode hex":"2B9E"},{"Typeface name":"Wingdings 3","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"11165","Unicode hex":"2B9D"},{"Typeface name":"Wingdings 3","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"11167","Unicode hex":"2B9F"},{"Typeface name":"Wingdings 3","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"129040","Unicode hex":"1F810"},{"Typeface name":"Wingdings 3","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"129042","Unicode hex":"1F812"},{"Typeface name":"Wingdings 3","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"129041","Unicode hex":"1F811"},{"Typeface name":"Wingdings 3","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"129043","Unicode hex":"1F813"},{"Typeface name":"Wingdings 3","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"129044","Unicode hex":"1F814"},{"Typeface name":"Wingdings 3","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"129046","Unicode hex":"1F816"},{"Typeface name":"Wingdings 3","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"129045","Unicode hex":"1F815"},{"Typeface name":"Wingdings 3","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"129047","Unicode hex":"1F817"},{"Typeface name":"Wingdings 3","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"129048","Unicode hex":"1F818"},{"Typeface name":"Wingdings 3","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"129050","Unicode hex":"1F81A"},{"Typeface name":"Wingdings 3","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"129049","Unicode hex":"1F819"},{"Typeface name":"Wingdings 3","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"129051","Unicode hex":"1F81B"},{"Typeface name":"Wingdings 3","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"129052","Unicode hex":"1F81C"},{"Typeface name":"Wingdings 3","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"129054","Unicode hex":"1F81E"},{"Typeface name":"Wingdings 3","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"129053","Unicode hex":"1F81D"},{"Typeface name":"Wingdings 3","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"129055","Unicode hex":"1F81F"},{"Typeface name":"Wingdings 3","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"129024","Unicode hex":"1F800"},{"Typeface name":"Wingdings 3","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"129026","Unicode hex":"1F802"},{"Typeface name":"Wingdings 3","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"129025","Unicode hex":"1F801"},{"Typeface name":"Wingdings 3","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"129027","Unicode hex":"1F803"},{"Typeface name":"Wingdings 3","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"129028","Unicode hex":"1F804"},{"Typeface name":"Wingdings 3","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"129030","Unicode hex":"1F806"},{"Typeface name":"Wingdings 3","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"129029","Unicode hex":"1F805"},{"Typeface name":"Wingdings 3","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"129031","Unicode hex":"1F807"},{"Typeface name":"Wingdings 3","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"129032","Unicode hex":"1F808"},{"Typeface name":"Wingdings 3","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"129034","Unicode hex":"1F80A"},{"Typeface name":"Wingdings 3","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"129033","Unicode hex":"1F809"},{"Typeface name":"Wingdings 3","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"129035","Unicode hex":"1F80B"},{"Typeface name":"Wingdings 3","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"129056","Unicode hex":"1F820"},{"Typeface name":"Wingdings 3","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"129058","Unicode hex":"1F822"},{"Typeface name":"Wingdings 3","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"129060","Unicode hex":"1F824"},{"Typeface name":"Wingdings 3","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"129062","Unicode hex":"1F826"},{"Typeface name":"Wingdings 3","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"129064","Unicode hex":"1F828"},{"Typeface name":"Wingdings 3","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"129066","Unicode hex":"1F82A"},{"Typeface name":"Wingdings 3","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"129068","Unicode hex":"1F82C"},{"Typeface name":"Wingdings 3","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"129180","Unicode hex":"1F89C"},{"Typeface name":"Wingdings 3","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"129181","Unicode hex":"1F89D"},{"Typeface name":"Wingdings 3","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"129182","Unicode hex":"1F89E"},{"Typeface name":"Wingdings 3","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"129183","Unicode hex":"1F89F"},{"Typeface name":"Wingdings 3","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"129070","Unicode hex":"1F82E"},{"Typeface name":"Wingdings 3","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"129072","Unicode hex":"1F830"},{"Typeface name":"Wingdings 3","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"129074","Unicode hex":"1F832"},{"Typeface name":"Wingdings 3","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"129076","Unicode hex":"1F834"},{"Typeface name":"Wingdings 3","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"129078","Unicode hex":"1F836"},{"Typeface name":"Wingdings 3","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"129080","Unicode hex":"1F838"},{"Typeface name":"Wingdings 3","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"129082","Unicode hex":"1F83A"},{"Typeface name":"Wingdings 3","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"129081","Unicode hex":"1F839"},{"Typeface name":"Wingdings 3","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"129083","Unicode hex":"1F83B"},{"Typeface name":"Wingdings 3","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"129176","Unicode hex":"1F898"},{"Typeface name":"Wingdings 3","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"129178","Unicode hex":"1F89A"},{"Typeface name":"Wingdings 3","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"129177","Unicode hex":"1F899"},{"Typeface name":"Wingdings 3","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"129179","Unicode hex":"1F89B"},{"Typeface name":"Wingdings 3","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"129084","Unicode hex":"1F83C"},{"Typeface name":"Wingdings 3","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"129086","Unicode hex":"1F83E"},{"Typeface name":"Wingdings 3","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"129085","Unicode hex":"1F83D"},{"Typeface name":"Wingdings 3","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"129087","Unicode hex":"1F83F"},{"Typeface name":"Wingdings 3","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"129088","Unicode hex":"1F840"},{"Typeface name":"Wingdings 3","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"129090","Unicode hex":"1F842"},{"Typeface name":"Wingdings 3","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"129089","Unicode hex":"1F841"},{"Typeface name":"Wingdings 3","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"129091","Unicode hex":"1F843"},{"Typeface name":"Wingdings 3","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"129092","Unicode hex":"1F844"},{"Typeface name":"Wingdings 3","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"129094","Unicode hex":"1F846"},{"Typeface name":"Wingdings 3","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"129093","Unicode hex":"1F845"},{"Typeface name":"Wingdings 3","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"129095","Unicode hex":"1F847"},{"Typeface name":"Wingdings 3","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"11176","Unicode hex":"2BA8"},{"Typeface name":"Wingdings 3","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"11177","Unicode hex":"2BA9"},{"Typeface name":"Wingdings 3","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"11178","Unicode hex":"2BAA"},{"Typeface name":"Wingdings 3","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"11179","Unicode hex":"2BAB"},{"Typeface name":"Wingdings 3","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"11180","Unicode hex":"2BAC"},{"Typeface name":"Wingdings 3","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"11181","Unicode hex":"2BAD"},{"Typeface name":"Wingdings 3","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"11182","Unicode hex":"2BAE"},{"Typeface name":"Wingdings 3","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"11183","Unicode hex":"2BAF"},{"Typeface name":"Wingdings 3","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"129120","Unicode hex":"1F860"},{"Typeface name":"Wingdings 3","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"129122","Unicode hex":"1F862"},{"Typeface name":"Wingdings 3","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"129121","Unicode hex":"1F861"},{"Typeface name":"Wingdings 3","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"129123","Unicode hex":"1F863"},{"Typeface name":"Wingdings 3","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"129124","Unicode hex":"1F864"},{"Typeface name":"Wingdings 3","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"129125","Unicode hex":"1F865"},{"Typeface name":"Wingdings 3","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"129127","Unicode hex":"1F867"},{"Typeface name":"Wingdings 3","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"129126","Unicode hex":"1F866"},{"Typeface name":"Wingdings 3","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"129136","Unicode hex":"1F870"},{"Typeface name":"Wingdings 3","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"129138","Unicode hex":"1F872"},{"Typeface name":"Wingdings 3","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"129137","Unicode hex":"1F871"},{"Typeface name":"Wingdings 3","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"129139","Unicode hex":"1F873"},{"Typeface name":"Wingdings 3","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"129140","Unicode hex":"1F874"},{"Typeface name":"Wingdings 3","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"129141","Unicode hex":"1F875"},{"Typeface name":"Wingdings 3","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"129143","Unicode hex":"1F877"},{"Typeface name":"Wingdings 3","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"129142","Unicode hex":"1F876"},{"Typeface name":"Wingdings 3","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"129152","Unicode hex":"1F880"},{"Typeface name":"Wingdings 3","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"129154","Unicode hex":"1F882"},{"Typeface name":"Wingdings 3","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"129153","Unicode hex":"1F881"},{"Typeface name":"Wingdings 3","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"129155","Unicode hex":"1F883"},{"Typeface name":"Wingdings 3","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"129156","Unicode hex":"1F884"},{"Typeface name":"Wingdings 3","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"129157","Unicode hex":"1F885"},{"Typeface name":"Wingdings 3","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"129159","Unicode hex":"1F887"},{"Typeface name":"Wingdings 3","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"129158","Unicode hex":"1F886"},{"Typeface name":"Wingdings 3","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"129168","Unicode hex":"1F890"},{"Typeface name":"Wingdings 3","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"129170","Unicode hex":"1F892"},{"Typeface name":"Wingdings 3","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"129169","Unicode hex":"1F891"},{"Typeface name":"Wingdings 3","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"129171","Unicode hex":"1F893"},{"Typeface name":"Wingdings 3","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"129172","Unicode hex":"1F894"},{"Typeface name":"Wingdings 3","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"129174","Unicode hex":"1F896"},{"Typeface name":"Wingdings 3","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"129173","Unicode hex":"1F895"},{"Typeface name":"Wingdings 3","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"129175","Unicode hex":"1F897"}];lot.default=AYo;var fYo=Xo&&Xo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tT,"__esModule",{value:!0});tT.hex=tT.dec=tT.codePoint=void 0;var gYo=fYo(lot),Vjn={},mYo=String.fromCodePoint?String.fromCodePoint:bYo;for(var J5e=0,E9t=gYo.default;J5e0&&(re=r.concat(re),r=[]),bg.map(g(Ae),h(re),function(ce,ie){return new ed.Paragraph(ie,ce)}).insertExtra()},"w:r":function(ne){return bg.map(A(ne.firstOrEmpty("w:rPr")),h(ne.children),function(Ae,Y){var re=L();return re!==null&&(Y=[new ed.Hyperlink(Y,re)]),new ed.Run(Y,Ae)})},"w:fldChar":x,"w:instrText":Q,"w:t":function(ne){return Jk(new ed.Text(ne.text()))},"w:tab":function(ne){return Jk(new ed.Tab)},"w:noBreakHyphen":function(){return Jk(new ed.Text("‑"))},"w:softHyphen":function(ne){return Jk(new ed.Text("­"))},"w:sym":T,"w:hyperlink":function(ne){var Ae=ne.attributes["r:id"],Y=ne.attributes["w:anchor"];return h(ne.children).map(function(re){function ce(J){var he=ne.attributes["w:tgtFrame"]||null;return new ed.Hyperlink(re,Pp.extend({targetFrame:he},J))}if(Ae){var ie=o.findTargetByRelationshipId(Ae);return Y&&(ie=P9t.replaceFragment(ie,Y)),ce({href:ie})}else return Y?ce({anchor:Y}):re})},"w:tbl":R,"w:tr":I,"w:tc":W,"w:footnoteReference":M("footnote"),"w:endnoteReference":M("endnote"),"w:commentReference":B,"w:br":function(ne){var Ae=ne.attributes["w:type"];return Ae==null||Ae==="textWrapping"?Jk(ed.lineBreak):Ae==="page"?Jk(ed.pageBreak):Ae==="column"?Jk(ed.columnBreak):aq([ux("Unsupported break type: "+Ae)])},"w:bookmarkStart":function(ne){var Ae=ne.attributes["w:name"];return Ae==="_GoBack"?dN():Jk(new ed.BookmarkStart({name:Ae}))},"mc:AlternateContent":function(ne){return P(ne.firstOrEmpty("mc:Fallback"))},"w:sdt":function(ne){var Ae=h(ne.firstOrEmpty("w:sdtContent").children);return Ae.map(function(Y){var re=ne.firstOrEmpty("w:sdtPr").first("wordml:checkbox");if(re){var ce=re.first("wordml:checked"),ie=!!ce&&p(ce.attributes["wordml:val"]),J=ed.checkbox({checked:ie}),he=!1,pe=Y.map(F9t._elementsOfType(ed.types.text,function(Le){return Le.value.length>0&&!he?(he=!0,J):Le}));return he?pe:J}else return Y})},"w:ins":P,"w:object":P,"w:smartTag":P,"w:drawing":P,"w:pict":function(ne){return P(ne).toExtra()},"v:roundrect":P,"v:shape":P,"v:textbox":P,"w:txbxContent":P,"wp:inline":K,"wp:anchor":K,"v:imagedata":$,"v:group":P,"v:rect":P};return{readXmlElement:f,readXmlElements:h};function R(ne){var Ae=N(ne.firstOrEmpty("w:tblPr"));return h(ne.children).flatMap(V).flatMap(function(Y){return Ae.map(function(re){return ed.Table(Y,re)})})}function N(ne){return y(ne).map(function(Ae){return{styleId:Ae.styleId,styleName:Ae.name}})}function I(ne){var Ae=ne.firstOrEmpty("w:trPr"),Y=!!Ae.first("w:del");if(Y)return dN();var re=!!Ae.first("w:tblHeader");return h(ne.children).map(function(ce){return ed.TableRow(ce,{isHeader:re})})}function W(ne){return h(ne.children).map(function(Ae){var Y=ne.firstOrEmpty("w:tcPr"),re=Y.firstOrEmpty("w:gridSpan").attributes["w:val"],ce=re?parseInt(re,10):1,ie=ed.TableCell(Ae,{colSpan:ce});return ie._vMerge=H(Y),ie})}function H(ne){var Ae=ne.first("w:vMerge");if(Ae){var Y=Ae.attributes["w:val"];return Y==="continue"||!Y}else return null}function V(ne){var Ae=Pp.any(ne,function(ce){return ce.type!==ed.types.tableRow});if(Ae)return Z(ne),ide(ne,[ux("unexpected non-row element in table, cell merging may be incorrect")]);var Y=Pp.any(ne,function(ce){return Pp.any(ce.children,function(ie){return ie.type!==ed.types.tableCell})});if(Y)return Z(ne),ide(ne,[ux("unexpected non-cell element in table row, cell merging may be incorrect")]);var re={};return ne.forEach(function(ce){var ie=0;ce.children.forEach(function(J){J._vMerge&&re[ie]?re[ie].rowSpan++:(re[ie]=J,J._vMerge=!1),ie+=J.colSpan})}),ne.forEach(function(ce){ce.children=ce.children.filter(function(ie){return!ie._vMerge}),ce.children.forEach(function(ie){delete ie._vMerge})}),Jk(ne)}function Z(ne){ne.forEach(function(Ae){var Y=F9t.getDescendantsOfType(Ae,ed.types.tableCell);Y.forEach(function(re){delete re._vMerge})})}function K(ne){var Ae=ne.getElementsByTagName("a:graphic").getElementsByTagName("a:graphicData").getElementsByTagName("pic:pic").getElementsByTagName("pic:blipFill").getElementsByTagName("a:blip");return R9t(Ae.map(X.bind(null,ne)))}function X(ne,Ae){var Y=ne.firstOrEmpty("wp:docPr"),re=Y.attributes,ce=ee(re.descr)?re.title:re.descr,ie=q(Ae);return ie===null?aq([ux("Could not find image file for a:blip element")]):de(ie,ce).map(function(J){var he=Y.firstOrEmpty("a:hlinkClick"),pe=he.attributes["r:id"];if(pe){var Le=o.findTargetByRelationshipId(pe);return new ed.Hyperlink([J],{href:Le})}else return J})}function ee(ne){return ne==null||/^\s*$/.test(ne)}function q(ne){var Ae=ne.attributes["r:embed"],Y=ne.attributes["r:link"];if(Ae)return oe(Ae);if(Y){var re=o.findTargetByRelationshipId(Y);return{path:re,read:l.read.bind(l,re)}}else return null}function $(ne){var Ae=ne.attributes["r:id"];return Ae?de(oe(Ae),ne.attributes["o:title"]):aq([ux("A v:imagedata element without a relationship ID was ignored")])}function oe(ne){var Ae=P9t.uriToZipEntryName("word",o.findTargetByRelationshipId(ne));return{path:Ae,read:a.read.bind(a,Ae)}}function de(ne,Ae){var Y=s.findContentType(ne.path),re=ed.Image({readImage:ne.read,altText:Ae,contentType:Y}),ce=TYo[Y]?[]:ux("Image of type "+Y+" is unlikely to display in web browsers");return ide(re,ce)}function ke(ne,Ae){return ux(ne+" style with ID "+Ae+" was referenced but not defined in the document")}}function qjn(e,t,n){var r=t.firstOrEmpty("w:ilvl").attributes["w:val"],o=t.firstOrEmpty("w:numId").attributes["w:val"];if(r!==void 0&&o!==void 0)return n.findLevel(o,r);if(e!=null){var s=n.findLevelByParagraphStyleId(e);if(s!=null)return s}return o!==void 0?n.findLevel(o,"0"):null}var TYo={"image/png":!0,"image/gif":!0,"image/jpeg":!0,"image/svg+xml":!0,"image/tiff":!0},EYo={"office-word:wrap":!0,"v:shadow":!0,"v:shapetype":!0,"w:annotationRef":!0,"w:bookmarkEnd":!0,"w:sectPr":!0,"w:proofErr":!0,"w:lastRenderedPageBreak":!0,"w:commentRangeStart":!0,"w:commentRangeEnd":!0,"w:del":!0,"w:footnoteRef":!0,"w:endnoteRef":!0,"w:pPr":!0,"w:rPr":!0,"w:tblPr":!0,"w:tblGrid":!0,"w:trPr":!0,"w:tcPr":!0};function aq(e){return new bg(null,null,e)}function dN(){return new bg(null)}function Jk(e){return new bg(e)}function ide(e,t){return new bg(e,null,t)}function bg(e,t,n){this.value=e||[],this.extra=t||[],this._result=new Xjn({element:this.value,extra:t},n),this.messages=this._result.messages}bg.prototype.toExtra=function(){return new bg(null,$3e(this.extra,this.value),this.messages)};bg.prototype.insertExtra=function(){var e=this.extra;return e&&e.length?new bg($3e(this.value,e),null,this.messages):this};bg.prototype.map=function(e){var t=this._result.map(function(n){return e(n.element)});return new bg(t.value,this.extra,t.messages)};bg.prototype.flatMap=function(e){var t=this._result.flatMap(function(n){return e(n.element)._result});return new bg(t.value.element,$3e(this.extra,t.value.extra),t.messages)};bg.map=function(e,t,n){return new bg(n(e.value,t.value),$3e(e.extra,t.extra),e.messages.concat(t.messages))};function R9t(e){var t=Xjn.combine(Pp.pluck(e,"_result"));return new bg(Pp.flatten(Pp.pluck(t.value,"element")),Pp.filter(Pp.flatten(Pp.pluck(t.value,"extra")),DYo),t.messages)}function $3e(e,t){return Pp.flatten([e,t])}function DYo(e){return e}var Gjn={};Gjn.DocumentXmlReader=FYo;var QYo=wa,BYo=D2.Result;function FYo(e){var t=e.bodyReader;function n(r){var o=r.first("w:body");if(o==null)throw new Error("Could not find the body element: are you sure this is a docx file?");var s=t.readXmlElements(o.children).map(function(a){return new QYo.Document(a,{notes:e.notes,comments:e.comments})});return new BYo(s.value,s.messages)}return{convertXmlToDocument:n}}var ewe={};ewe.readRelationships=PYo;ewe.defaultValue=new hot([]);ewe.Relationships=hot;function PYo(e){var t=[];return e.children.forEach(function(n){if(n.name==="relationships:Relationship"){var r={relationshipId:n.attributes.Id,target:n.attributes.Target,type:n.attributes.Type};t.push(r)}}),new hot(t)}function hot(e){var t={};e.forEach(function(r){t[r.relationshipId]=r.target});var n={};return e.forEach(function(r){n[r.type]||(n[r.type]=[]),n[r.type].push(r.target)}),{findTargetByRelationshipId:function(r){return t[r]},findTargetsByType:function(r){return n[r]||[]}}}var Aot={};Aot.readContentTypesFromXml=RYo;var MYo={png:"png",gif:"gif",jpeg:"jpeg",jpg:"jpeg",tif:"tiff",tiff:"tiff",bmp:"bmp"};Aot.defaultContentTypes=Kjn({},{});function RYo(e){var t={},n={};return e.children.forEach(function(r){if(r.name==="content-types:Default"&&(t[r.attributes.Extension]=r.attributes.ContentType),r.name==="content-types:Override"){var o=r.attributes.PartName;o.charAt(0)==="/"&&(o=o.substring(1)),n[o]=r.attributes.ContentType}}),Kjn(n,t)}function Kjn(e,t){return{findContentType:function(n){var r=e[n];if(r)return r;var o=n.split("."),s=o[o.length-1];if(t.hasOwnProperty(s))return t[s];var a=MYo[s.toLowerCase()];return a?"image/"+a:null}}}var twe={},rde=Sh;twe.readNumberingXml=IYo;twe.Numbering=fot;twe.defaultNumbering=new fot({},{});function fot(e,t,n){var r=rde.flatten(rde.values(t).map(function(l){return rde.values(l.levels)})),o=rde.indexBy(r.filter(function(l){return l.paragraphStyleId!=null}),"paragraphStyleId");function s(l,d){var u=e[l];if(u){var h=t[u.abstractNumId];if(h){if(h.numStyleLink==null)return t[u.abstractNumId].levels[d];var f=n.findNumberingStyleById(h.numStyleLink);return s(f.numId,d)}else return null}else return null}function a(l){return o[l]||null}return{findLevel:s,findLevelByParagraphStyleId:a}}function IYo(e,t){if(!t||!t.styles)throw new Error("styles is missing");var n=NYo(e),r=jYo(e);return new fot(r,n,t.styles)}function NYo(e){var t={};return e.getElementsByTagName("w:abstractNum").forEach(function(n){var r=n.attributes["w:abstractNumId"];t[r]=UYo(n)}),t}function UYo(e){var t={},n=null;e.getElementsByTagName("w:lvl").forEach(function(o){var s=o.attributes["w:ilvl"],a=o.firstOrEmpty("w:numFmt").attributes["w:val"],l=a!=="bullet",d=o.firstOrEmpty("w:pStyle").attributes["w:val"];s===void 0?n={isOrdered:l,level:"0",paragraphStyleId:d}:t[s]={isOrdered:l,level:s,paragraphStyleId:d}}),n!==null&&t[n.level]===void 0&&(t[n.level]=n);var r=e.firstOrEmpty("w:numStyleLink").attributes["w:val"];return{levels:t,numStyleLink:r}}function jYo(e){var t={};return e.getElementsByTagName("w:num").forEach(function(n){var r=n.attributes["w:numId"],o=n.first("w:abstractNumId").attributes["w:val"];t[r]={abstractNumId:o}}),t}var nwe={};nwe.readStylesXml=WYo;nwe.Styles=ote;nwe.defaultStyles=new ote({},{});function ote(e,t,n,r){return{findParagraphStyleById:function(o){return e[o]},findCharacterStyleById:function(o){return t[o]},findTableStyleById:function(o){return n[o]},findNumberingStyleById:function(o){return r[o]}}}ote.EMPTY=new ote({},{},{},{});function WYo(e){var t={},n={},r={},o={},s={paragraph:t,character:n,table:r,numbering:o};return e.getElementsByTagName("w:style").forEach(function(a){var l=HYo(a),d=s[l.type];d&&d[l.styleId]===void 0&&(d[l.styleId]=l)}),new ote(t,n,r,o)}function HYo(e){var t=e.attributes["w:type"];if(t==="numbering")return zYo(t,e);var n=Jjn(e),r=VYo(e);return{type:t,styleId:n,name:r}}function VYo(e){var t=e.first("w:name");return t?t.attributes["w:val"]:null}function zYo(e,t){var n=Jjn(t),r=t.firstOrEmpty("w:pPr").firstOrEmpty("w:numPr").firstOrEmpty("w:numId").attributes["w:val"];return{type:e,numId:r,styleId:n}}function Jjn(e){return e.attributes["w:styleId"]}var got={},ZYo=wa,YYo=D2.Result;got.createFootnotesReader=_jn.bind(Xo,"footnote");got.createEndnotesReader=_jn.bind(Xo,"endnote");function _jn(e,t){function n(s){return YYo.combine(s.getElementsByTagName("w:"+e).filter(r).map(o))}function r(s){var a=s.attributes["w:type"];return a!=="continuationSeparator"&&a!=="separator"}function o(s){var a=s.attributes["w:id"];return t.readXmlElements(s.children).map(function(l){return ZYo.Note({noteType:e,noteId:a,body:l})})}return n}var $jn={},XYo=wa,qYo=D2.Result;function GYo(e){function t(r){return qYo.combine(r.getElementsByTagName("w:comment").map(n))}function n(r){var o=r.attributes["w:id"];function s(a){return(r.attributes[a]||"").trim()||null}return e.readXmlElements(r.children).map(function(a){return XYo.comment({commentId:o,body:a,authorName:s("w:author"),authorInitials:s("w:initials")})})}return t}$jn.createCommentsReader=GYo;var eWn={},KYo=Wf;eWn.Files=JYo;function JYo(){function e(t){return KYo.reject(new Error("could not open external image: '"+t+`' cannot open linked files from a web browser`))}return{read:e}}zrt.read=rXo;zrt._findPartPaths=nWn;var _Yo=Wf,$Yo=wa,$5e=D2.Result,cke=Dre,tWn=Xrt.readXmlFromZipFile,eXo=aot.createBodyReader,tXo=Gjn.DocumentXmlReader,nz=ewe,I9t=Aot,N9t=twe,U9t=nwe,j9t=got,nXo=$jn,iXo=eWn.Files;function rXo(e,t,n){t=t||{},n=n||{};var r=new iXo({externalFileAccess:n.externalFileAccess,relativeToFile:t.path});return _Yo.props({contentTypes:sXo(e),partPaths:nWn(e),docxFile:e,files:r}).also(function(o){return{styles:lXo(e,o.partPaths.styles)}}).also(function(o){return{numbering:aXo(e,o.partPaths.numbering,o.styles)}}).also(function(o){return{footnotes:ode(o.partPaths.footnotes,o,function(s,a){return a?j9t.createFootnotesReader(s)(a):new $5e([])}),endnotes:ode(o.partPaths.endnotes,o,function(s,a){return a?j9t.createEndnotesReader(s)(a):new $5e([])}),comments:ode(o.partPaths.comments,o,function(s,a){return a?nXo.createCommentsReader(s)(a):new $5e([])})}}).also(function(o){return{notes:o.footnotes.flatMap(function(s){return o.endnotes.map(function(a){return new $Yo.Notes(s.concat(a))})})}}).then(function(o){return ode(o.partPaths.mainDocument,o,function(s,a){return o.notes.flatMap(function(l){return o.comments.flatMap(function(d){var u=new tXo({bodyReader:s,notes:l,comments:d});return u.convertXmlToDocument(a)})})})})}function nWn(e){return cXo(e).then(function(t){var n=W9t({docxFile:e,relationships:t,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",basePath:"",fallbackPath:"word/document.xml"});if(!e.exists(n))throw new Error("Could not find main document part. Are you sure this is a valid .docx file?");return RZ({filename:iWn(n),readElement:nz.readRelationships,defaultValue:nz.defaultValue})(e).then(function(r){function o(s){return W9t({docxFile:e,relationships:r,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/"+s,basePath:cke.splitPath(n).dirname,fallbackPath:"word/"+s+".xml"})}return{mainDocument:n,comments:o("comments"),endnotes:o("endnotes"),footnotes:o("footnotes"),numbering:o("numbering"),styles:o("styles")}})})}function W9t(e){var t=e.docxFile,n=e.relationships,r=e.relationshipType,o=e.basePath,s=e.fallbackPath,a=n.findTargetsByType(r),l=a.map(function(u){return oXo(cke.joinPath(o,u),"/")}),d=l.filter(function(u){return t.exists(u)});return d.length===0?s:d[0]}function oXo(e,t){return e.substring(0,t.length)===t?e.substring(t.length):e}function RZ(e){return function(t){return tWn(t,e.filename).then(function(n){return n?e.readElement(n):e.defaultValue})}}function ode(e,t,n){var r=RZ({filename:iWn(e),readElement:nz.readRelationships,defaultValue:nz.defaultValue});return r(t.docxFile).then(function(o){var s=new eXo({relationships:o,contentTypes:t.contentTypes,docxFile:t.docxFile,numbering:t.numbering,styles:t.styles,files:t.files});return tWn(t.docxFile,e).then(function(a){return n(s,a)})})}function iWn(e){var t=cke.splitPath(e);return cke.joinPath(t.dirname,"_rels",t.basename+".rels")}var sXo=RZ({filename:"[Content_Types].xml",readElement:I9t.readContentTypesFromXml,defaultValue:I9t.defaultContentTypes});function aXo(e,t,n){return RZ({filename:t,readElement:function(r){return N9t.readNumberingXml(r,{styles:n})},defaultValue:N9t.defaultNumbering})(e)}function lXo(e,t){return RZ({filename:t,readElement:U9t.readStylesXml,defaultValue:U9t.defaultStyles})(e)}var cXo=RZ({filename:"_rels/.rels",readElement:nz.readRelationships,defaultValue:nz.defaultValue}),mot={},dXo=Sh,uXo=Wf,ste=R6;mot.writeStyleMap=AXo;mot.readStyleMap=mXo;var hXo="http://schemas.zwobble.org/mammoth/style-map",dke="mammoth/style-map",rWn="/"+dke;function AXo(e,t){return e.write(dke,t),fXo(e).then(function(){return gXo(e)})}function fXo(e){var t="word/_rels/document.xml.rels",n="http://schemas.openxmlformats.org/package/2006/relationships",r="{"+n+"}Relationship";return e.read(t,"utf8").then(ste.readString).then(function(o){var s=o.children;oWn(s,r,"Id",{Id:"rMammothStyleMap",Type:hXo,Target:rWn});var a={"":n};return e.write(t,ste.writeString(o,a))})}function gXo(e){var t="[Content_Types].xml",n="http://schemas.openxmlformats.org/package/2006/content-types",r="{"+n+"}Override";return e.read(t,"utf8").then(ste.readString).then(function(o){var s=o.children;oWn(s,r,"PartName",{PartName:rWn,ContentType:"text/prs.mammoth.style-map"});var a={"":n};return e.write(t,ste.writeString(o,a))})}function oWn(e,t,n,r){var o=dXo.find(e,function(s){return s.name===t&&s.attributes[n]===r[n]});o?o.attributes=r:e.push(ste.element(t,r))}function mXo(e){return e.exists(dke)?e.read(dke,"utf8"):uXo.resolve(null)}var kot={},W7={},hx={},D9={},H9t;function sWn(){if(H9t)return D9;H9t=1;var e=rwe();function t(d,u,h){return r(e.element(d,u,{fresh:!1}),h)}function n(d,u,h){var f=e.element(d,u,{fresh:!0});return r(f,h)}function r(d,u){return{type:"element",tag:d,children:u||[]}}function o(d){return{type:"text",value:d}}var s={type:"forceWrite"};D9.freshElement=n,D9.nonFreshElement=t,D9.elementWithTag=r,D9.text=o,D9.forceWrite=s;var a={br:!0,hr:!0,img:!0,input:!0};function l(d){return d.children.length===0&&a[d.tag.tagName]}return D9.isVoidElement=l,D9}var eTe,V9t;function kXo(){if(V9t)return eTe;V9t=1;var e=Sh,t=sWn();function n(m){return r(u(m))}function r(m){var v=[];return m.map(o).forEach(function(p){d(v,p)}),v}function o(m){return s[m.type](m)}var s={element:a,text:l,forceWrite:l};function a(m){return t.elementWithTag(m.tag,r(m.children))}function l(m){return m}function d(m,v){var p=m[m.length-1];v.type==="element"&&!v.tag.fresh&&p&&p.type==="element"&&v.tag.matchesElement(p.tag)?(v.tag.separator&&d(p.children,t.text(v.tag.separator)),v.children.forEach(function(b){d(p.children,b)})):m.push(v)}function u(m){return h(m,function(v){return f[v.type](v)})}function h(m,v){return e.flatten(e.map(m,v),!0)}var f={element:k,text:A,forceWrite:g};function g(m){return[m]}function k(m){var v=u(m.children);return v.length===0&&!t.isVoidElement(m)?[]:[t.elementWithTag(m.tag,v)]}function A(m){return m.value.length===0?[]:[m]}return eTe=n,eTe}var z9t;function iwe(){if(z9t)return hx;z9t=1;var e=sWn();hx.freshElement=e.freshElement,hx.nonFreshElement=e.nonFreshElement,hx.elementWithTag=e.elementWithTag,hx.text=e.text,hx.forceWrite=e.forceWrite,hx.simplify=kXo();function t(a,l){l.forEach(function(d){n(a,d)})}function n(a,l){r[l.type](a,l)}var r={element:o,text:s,forceWrite:function(){}};function o(a,l){e.isVoidElement(l)?a.selfClosing(l.tag.tagName,l.tag.attributes):(a.open(l.tag.tagName,l.tag.attributes),t(a,l.children),a.close(l.tag.tagName))}function s(a,l){a.text(l.value)}return hx.write=t,hx}var Z9t;function rwe(){if(Z9t)return W7;Z9t=1;var e=Sh,t=iwe();W7.topLevelElement=n,W7.elements=r,W7.element=s;function n(l,d){return r([s(l,d,{fresh:!0})])}function r(l){return new o(l.map(function(d){return e.isString(d)?s(d):d}))}function o(l){this._elements=l}o.prototype.wrap=function(d){for(var u=d(),h=this._elements.length-1;h>=0;h--)u=this._elements[h].wrapNodes(u);return u};function s(l,d,u){return u=u||{},new a(l,d,u)}function a(l,d,u){var h={};e.isArray(l)?(l.forEach(function(f){h[f]=!0}),l=l[0]):h[l]=!0,this.tagName=l,this.tagNames=h,this.attributes=d||{},this.fresh=u.fresh,this.separator=u.separator}return a.prototype.matchesElement=function(l){return this.tagNames[l.tagName]&&e.isEqual(this.attributes||{},l.attributes||{})},a.prototype.wrap=function(d){return this.wrapNodes(d())},a.prototype.wrapNodes=function(d){return[t.elementWithTag(this,d)]},W7.empty=r([]),W7.ignore={wrap:function(){return[]}},W7}var vot={};(function(e){var t=Sh,n=Wf,r=iwe();e.imgElement=o;function o(s){return function(a,l){return n.when(s(a)).then(function(d){var u={};return a.altText&&(u.alt=a.altText),t.extend(u,d),[r.freshElement("img",u)]})}}e.inline=e.imgElement,e.dataUri=o(function(s){return s.readAsBase64String().then(function(a){return{src:"data:"+s.contentType+";base64,"+a}})})})(vot);var aWn={},lWn={},cWn=Sh;lWn.writer=vXo;function vXo(e){return e=e||{},e.prettyPrint?pXo():dWn()}var sde={div:!0,p:!0,ul:!0,li:!0};function pXo(){var e=0,t=" ",n=[],r=!0,o=!1,s=dWn();function a(A,m){sde[A]&&g(),n.push(A),s.open(A,m),sde[A]&&e++,r=!1}function l(A){sde[A]&&(e--,g()),n.pop(),s.close(A)}function d(A){f();var m=k()?A:A.replace(` `,` `+t);s.text(m)}function u(A,m){g(),s.selfClosing(A,m)}function h(){return n.length===0||sde[n[n.length-1]]}function f(){o||(g(),o=!0)}function g(){if(o=!1,!r&&h()&&!k()){s._append(` `);for(var A=0;A")}function n(d){e.push("")}function r(d,u){var h=o(u);e.push("<"+d+h+" />")}function o(d){return cWn.map(d,function(u,h){return" "+h+'="'+OXo(u)+'"'}).join("")}function s(d){e.push(bXo(d))}function a(d){e.push(d)}function l(){return e.join("")}return{asString:l,open:t,close:n,text:s,selfClosing:r,_append:a}}function bXo(e){return e.replace(/&/g,"&").replace(//g,">")}function OXo(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}var uWn={},wXo=Sh;function Y9t(e){return uke(e,e)}function uke(e,t){return function(){return{start:e,end:t}}}function yXo(e){var t=e.href||"";return t?{start:"[",end:"]("+t+")",anchorPosition:"before"}:{}}function CXo(e){var t=e.src||"",n=e.alt||"";return t||n?{start:"!["+n+"]("+t+")"}:{}}function X9t(e){return function(t,n){return{start:n?` `:"",end:n?"":` `,list:{isOrdered:e.isOrdered,indent:n?n.indent+1:0,count:0}}}}function xXo(e,t,n){t=t||{indent:0,isOrdered:!1,count:0},t.count++,n.hasClosed=!1;var r=t.isOrdered?t.count+".":"-",o=AWn(" ",t.indent)+r+" ";return{start:o,end:function(){if(!n.hasClosed)return n.hasClosed=!0,` `}}}var hWn={p:uke("",` `),br:uke("",` `),ul:X9t({isOrdered:!1}),ol:X9t({isOrdered:!0}),li:xXo,strong:Y9t("__"),em:Y9t("*"),a:yXo,img:CXo};(function(){for(var e=1;e<=6;e++)hWn["h"+e]=uke(AWn("#",e)+" ",` `)})();function AWn(e,t){return new Array(t+1).join(e)}function LXo(){var e=[],t=[],n=null,r={};function o(h,f){f=f||{};var g=hWn[h]||function(){return{}},k=g(f,n,r);t.push({end:k.end,list:n}),k.list&&(n=k.list);var A=k.anchorPosition==="before";A&&s(f),e.push(k.start||""),A||s(f)}function s(h){h.id&&e.push('')}function a(h){var f=t.pop();n=f.list;var g=wXo.isFunction(f.end)?f.end():f.end;e.push(g||"")}function l(h,f){o(h,f),a()}function d(h){e.push(SXo(h))}function u(){return e.join("")}return{asString:u,open:o,close:a,text:d,selfClosing:l}}uWn.writer=LXo;function SXo(e){return e.replace(/\\/g,"\\\\").replace(/([\`\*_\{\}\[\]\(\)\#\+\-\.\!])/g,"\\$1")}var TXo=lWn,EXo=uWn;aWn.writer=DXo;function DXo(e){return e=e||{},e.outputFormat==="markdown"?EXo.writer():TXo.writer(e)}var OS=Sh,q9t=Wf,Jhe=wa,K2=rwe(),MXe=D2,QXo=vot,La=iwe(),BXo=aWn;kot.DocumentConverter=FXo;function FXo(e){return{convertToHtml:function(t){var n=OS.indexBy(t.type===Jhe.types.document?t.comments:[],"commentId"),r=new PXo(e,n);return r.convertToHtml(t)}}}function PXo(e,t){var n=1,r=[],o=[];e=OS.extend({ignoreEmptyParagraphs:!0},e);var s=e.idPrefix===void 0?"":e.idPrefix,a=e.ignoreEmptyParagraphs,l=K2.topLevelElement("p"),d=e.styleMap||[];function u(N){var I=[],W=f(N,I,{}),H=[];fWn(W,function(Z){Z.type==="deferred"&&H.push(Z)});var V={};return q9t.mapSeries(H,function(Z){return Z.value().then(function(K){V[Z.id]=K})}).then(function(){function Z(X){return tTe(X,function(ee){return ee.type==="deferred"?V[ee.id]:ee.children?[OS.extend({},ee,{children:Z(ee.children)})]:[ee]})}var K=BXo.writer({prettyPrint:e.prettyPrint,outputFormat:e.outputFormat});return La.write(K,La.simplify(Z(W))),new MXe.Result(K.asString(),I)})}function h(N,I,W){return tTe(N,function(H){return f(H,I,W)})}function f(N,I,W){if(!W)throw new Error("options not set");var H=R[N.type];return H?H(N,I,W):[]}function g(N,I,W){return k(N,I).wrap(function(){var H=h(N.children,I,W);return a?H:[La.forceWrite].concat(H)})}function k(N,I){var W=p(N);return W?W.to:(N.styleId&&I.push(G9t("paragraph",N)),l)}function A(N,I,W){var H=function(){return h(N.children,I,W)},V=[];if(N.highlight!==null){var Z=v({type:"highlight",color:N.highlight});Z&&V.push(Z)}N.isSmallCaps&&V.push(m("smallCaps")),N.isAllCaps&&V.push(m("allCaps")),N.isStrikethrough&&V.push(m("strikethrough","s")),N.isUnderline&&V.push(m("underline")),N.verticalAlignment===Jhe.verticalAlignment.subscript&&V.push(K2.element("sub",{},{fresh:!1})),N.verticalAlignment===Jhe.verticalAlignment.superscript&&V.push(K2.element("sup",{},{fresh:!1})),N.isItalic&&V.push(m("italic","em")),N.isBold&&V.push(m("bold","strong"));var K=K2.empty,X=p(N);return X?K=X.to:N.styleId&&I.push(G9t("run",N)),V.push(K),V.forEach(function(ee){H=ee.wrap.bind(ee,H)}),H()}function m(N,I){var W=v({type:N});return W||(I?K2.element(I,{},{fresh:!1}):K2.empty)}function v(N,I){var W=p(N);return W?W.to:I}function p(N){for(var I=0;Is){var h=u[1],g=new nTe(e[l].name,h,a.range(s,f));return{token:g,endIndex:f}}}}var f=s+1,g=new nTe("unrecognisedCharacter",o.substring(s,f),a.range(s,f));return{token:g,endIndex:f}}function r(o,s){return new nTe("end",null,s.range(o.length,o.length))}return{tokenise:t}}GO.Parser=kWn.Parser;GO.rules=pot;GO.errors=Oot;GO.results=bot;GO.StringSource=wWn;GO.Token=yWn;GO.bottomUp=CWn;GO.RegexTokeniser=xWn.RegexTokeniser;GO.rule=function(e){var t;return function(n){return t||(t=e()),t(n)}};var Dg={};Dg.paragraph=VXo;Dg.run=zXo;Dg.table=ZXo;Dg.bold=new KO("bold");Dg.italic=new KO("italic");Dg.underline=new KO("underline");Dg.strikethrough=new KO("strikethrough");Dg.allCaps=new KO("allCaps");Dg.smallCaps=new KO("smallCaps");Dg.highlight=YXo;Dg.commentReference=new KO("commentReference");Dg.lineBreak=new awe({breakType:"line"});Dg.pageBreak=new awe({breakType:"page"});Dg.columnBreak=new awe({breakType:"column"});Dg.equalTo=qXo;Dg.startsWith=GXo;function VXo(e){return new KO("paragraph",e)}function zXo(e){return new KO("run",e)}function ZXo(e){return new KO("table",e)}function YXo(e){return new LWn(e)}function KO(e,t){t=t||{},this._elementType=e,this._styleId=t.styleId,this._styleName=t.styleName,t.list&&(this._listIndex=t.list.levelIndex,this._listIsOrdered=t.list.isOrdered)}KO.prototype.matches=function(e){return e.type===this._elementType&&(this._styleId===void 0||e.styleId===this._styleId)&&(this._styleName===void 0||e.styleName&&this._styleName.operator(this._styleName.operand,e.styleName))&&(this._listIndex===void 0||XXo(e,this._listIndex,this._listIsOrdered))&&(this._breakType===void 0||this._breakType===e.breakType)};function LWn(e){e=e||{},this._color=e.color}LWn.prototype.matches=function(e){return e.type==="highlight"&&(this._color===void 0||e.color===this._color)};function awe(e){e=e||{},this._breakType=e.breakType}awe.prototype.matches=function(e){return e.type==="break"&&(this._breakType===void 0||e.breakType===this._breakType)};function XXo(e,t,n){return e.numbering&&e.numbering.level==t&&e.numbering.isOrdered==n}function qXo(e){return{operator:KXo,operand:e}}function GXo(e){return{operator:JXo,operand:e}}function KXo(e,t){return e.toUpperCase()===t.toUpperCase()}function JXo(e,t){return t.toUpperCase().indexOf(e.toUpperCase())===0}var SWn={},_Xo=GO,$Xo=_Xo.RegexTokeniser;SWn.tokenise=eqo;var K9t="'((?:\\\\.|[^'])*)";function eqo(e){var t="(?:[a-zA-Z\\-_]|\\\\.)",n=new $Xo([{name:"identifier",regex:new RegExp("("+t+"(?:"+t+"|[0-9])*)")},{name:"dot",regex:/\./},{name:"colon",regex:/:/},{name:"gt",regex:/>/},{name:"whitespace",regex:/\s+/},{name:"arrow",regex:/=>/},{name:"equals",regex:/=/},{name:"startsWith",regex:/\^=/},{name:"open-paren",regex:/\(/},{name:"close-paren",regex:/\)/},{name:"open-square-bracket",regex:/\[/},{name:"close-square-bracket",regex:/\]/},{name:"string",regex:new RegExp(K9t+"'")},{name:"unterminated-string",regex:new RegExp(K9t)},{name:"integer",regex:/([0-9]+)/},{name:"choice",regex:/\|/},{name:"bang",regex:/(!)/}]);return n.tokenise(e)}var tqo=Sh,ni=GO,Vg=Dg,_he=rwe(),nqo=SWn.tokenise,iTe=D2;owe.readHtmlPath=sqo;owe.readDocumentMatcher=oqo;owe.readStyle=iqo;function iqo(e){return wot(fqo,e)}function rqo(){return ni.rules.sequence(ni.rules.sequence.capture(TWn()),ni.rules.tokenOfType("whitespace"),ni.rules.tokenOfType("arrow"),ni.rules.sequence.capture(ni.rules.optional(ni.rules.sequence(ni.rules.tokenOfType("whitespace"),ni.rules.sequence.capture(EWn())).head())),ni.rules.tokenOfType("end")).map(function(e,t){return{from:e,to:t.valueOrElse(_he.empty)}})}function oqo(e){return wot(TWn(),e)}function TWn(){var e=ni.rules.sequence,t=function(C,x){return ni.rules.then(ni.rules.token("identifier",C),function(){return x})},n=t("p",Vg.paragraph),r=t("r",Vg.run),o=ni.rules.firstOf("p or r or table",n,r),s=ni.rules.sequence(ni.rules.tokenOfType("dot"),ni.rules.sequence.cut(),ni.rules.sequence.capture(lwe)).map(function(C){return{styleId:C}}),a=ni.rules.firstOf("style name matcher",ni.rules.then(ni.rules.sequence(ni.rules.tokenOfType("equals"),ni.rules.sequence.cut(),ni.rules.sequence.capture(GU)).head(),function(C){return{styleName:Vg.equalTo(C)}}),ni.rules.then(ni.rules.sequence(ni.rules.tokenOfType("startsWith"),ni.rules.sequence.cut(),ni.rules.sequence.capture(GU)).head(),function(C){return{styleName:Vg.startsWith(C)}})),l=ni.rules.sequence(ni.rules.tokenOfType("open-square-bracket"),ni.rules.sequence.cut(),ni.rules.token("identifier","style-name"),ni.rules.sequence.capture(a),ni.rules.tokenOfType("close-square-bracket")).head(),d=ni.rules.firstOf("list type",t("ordered-list",{isOrdered:!0}),t("unordered-list",{isOrdered:!1})),u=e(ni.rules.tokenOfType("colon"),e.capture(d),e.cut(),ni.rules.tokenOfType("open-paren"),e.capture(aqo),ni.rules.tokenOfType("close-paren")).map(function(C,x){return{list:{isOrdered:C.isOrdered,levelIndex:x-1}}});function h(C){var x=ni.rules.firstOf.apply(ni.rules.firstOf,["matcher suffix"].concat(C)),L=ni.rules.zeroOrMore(x);return ni.rules.then(L,function(S){var E={};return S.forEach(function(Q){tqo.extend(E,Q)}),E})}var f=e(e.capture(o),e.capture(h([s,l,u]))).map(function(C,x){return C(x)}),g=e(ni.rules.token("identifier","table"),e.capture(h([s,l]))).map(function(C){return Vg.table(C)}),k=t("b",Vg.bold),A=t("i",Vg.italic),m=t("u",Vg.underline),v=t("strike",Vg.strikethrough),p=t("all-caps",Vg.allCaps),b=t("small-caps",Vg.smallCaps),O=e(ni.rules.token("identifier","highlight"),ni.rules.sequence.capture(ni.rules.optional(ni.rules.sequence(ni.rules.tokenOfType("open-square-bracket"),ni.rules.sequence.cut(),ni.rules.token("identifier","color"),ni.rules.tokenOfType("equals"),ni.rules.sequence.capture(GU),ni.rules.tokenOfType("close-square-bracket")).head()))).map(function(C){return Vg.highlight({color:C.valueOrElse(void 0)})}),w=t("comment-reference",Vg.commentReference),y=e(ni.rules.token("identifier","br"),e.cut(),ni.rules.tokenOfType("open-square-bracket"),ni.rules.token("identifier","type"),ni.rules.tokenOfType("equals"),e.capture(GU),ni.rules.tokenOfType("close-square-bracket")).map(function(C){switch(C){case"line":return Vg.lineBreak;case"page":return Vg.pageBreak;case"column":return Vg.columnBreak}});return ni.rules.firstOf("element type",f,g,k,A,m,v,p,b,O,w,y)}function sqo(e){return wot(EWn(),e)}function EWn(){var e=ni.rules.sequence.capture,t=ni.rules.tokenOfType("whitespace"),n=ni.rules.then(ni.rules.optional(ni.rules.sequence(ni.rules.tokenOfType("colon"),ni.rules.token("identifier","fresh"))),function(a){return a.map(function(){return!0}).valueOrElse(!1)}),r=ni.rules.then(ni.rules.optional(ni.rules.sequence(ni.rules.tokenOfType("colon"),ni.rules.token("identifier","separator"),ni.rules.tokenOfType("open-paren"),e(GU),ni.rules.tokenOfType("close-paren")).head()),function(a){return a.valueOrElse("")}),o=ni.rules.oneOrMoreWithSeparator(lwe,ni.rules.tokenOfType("choice")),s=ni.rules.sequence(e(o),e(ni.rules.zeroOrMore(uqo)),e(n),e(r)).map(function(a,l,d,u){var h={},f={};return l.forEach(function(g){g.append&&h[g.name]?h[g.name]+=" "+g.value:h[g.name]=g.value}),d&&(f.fresh=!0),u&&(f.separator=u),_he.element(a,h,f)});return ni.rules.firstOf("html path",ni.rules.then(ni.rules.tokenOfType("bang"),function(){return _he.ignore}),ni.rules.then(ni.rules.zeroOrMoreWithSeparator(s,ni.rules.sequence(t,ni.rules.tokenOfType("gt"),t)),_he.elements))}var lwe=ni.rules.then(ni.rules.tokenOfType("identifier"),DWn),aqo=ni.rules.tokenOfType("integer"),GU=ni.rules.then(ni.rules.tokenOfType("string"),DWn),lqo={n:` `,r:"\r",t:" "};function DWn(e){return e.replace(/\\(.)/g,function(t,n){return lqo[n]||n})}var cqo=ni.rules.sequence(ni.rules.tokenOfType("open-square-bracket"),ni.rules.sequence.cut(),ni.rules.sequence.capture(lwe),ni.rules.tokenOfType("equals"),ni.rules.sequence.capture(GU),ni.rules.tokenOfType("close-square-bracket")).map(function(e,t){return{name:e,value:t,append:!1}}),dqo=ni.rules.sequence(ni.rules.tokenOfType("dot"),ni.rules.sequence.cut(),ni.rules.sequence.capture(lwe)).map(function(e){return{name:"class",value:e,append:!0}}),uqo=ni.rules.firstOf("attribute or class",cqo,dqo);function wot(e,t){var n=nqo(t),r=ni.Parser(),o=r.parseTokens(e,n);return o.isSuccess()?iTe.success(o.value()):new iTe.Result(null,[iTe.warning(hqo(t,o))])}function hqo(e,t){return"Did not understand this style mapping, so ignored it: "+e+` `+t.errors().map(Aqo).join(` `)}function Aqo(e){return"Error was at character number "+e.characterNumber()+": Expected "+e.expected+" but got "+e.actual}var fqo=rqo(),cwe={};cwe.readOptions=kqo;var QWn=Sh,gqo=cwe._defaultStyleMap=["p.Heading1 => h1:fresh","p.Heading2 => h2:fresh","p.Heading3 => h3:fresh","p.Heading4 => h4:fresh","p.Heading5 => h5:fresh","p.Heading6 => h6:fresh","p[style-name='Heading 1'] => h1:fresh","p[style-name='Heading 2'] => h2:fresh","p[style-name='Heading 3'] => h3:fresh","p[style-name='Heading 4'] => h4:fresh","p[style-name='Heading 5'] => h5:fresh","p[style-name='Heading 6'] => h6:fresh","p[style-name='heading 1'] => h1:fresh","p[style-name='heading 2'] => h2:fresh","p[style-name='heading 3'] => h3:fresh","p[style-name='heading 4'] => h4:fresh","p[style-name='heading 5'] => h5:fresh","p[style-name='heading 6'] => h6:fresh","p.Heading => h1:fresh","p[style-name='Heading'] => h1:fresh","r[style-name='Strong'] => strong","p[style-name='footnote text'] => p:fresh","r[style-name='footnote reference'] =>","p[style-name='endnote text'] => p:fresh","r[style-name='endnote reference'] =>","p[style-name='annotation text'] => p:fresh","r[style-name='annotation reference'] =>","p[style-name='Footnote'] => p:fresh","r[style-name='Footnote anchor'] =>","p[style-name='Endnote'] => p:fresh","r[style-name='Endnote anchor'] =>","p:unordered-list(1) => ul > li:fresh","p:unordered-list(2) => ul|ol > li > ul > li:fresh","p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:ordered-list(1) => ol > li:fresh","p:ordered-list(2) => ul|ol > li > ol > li:fresh","p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","r[style-name='Hyperlink'] =>","p[style-name='Normal'] => p:fresh","p.Body => p:fresh","p[style-name='Body'] => p:fresh"],mqo=cwe._standardOptions={externalFileAccess:!1,transformDocument:vqo,includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function kqo(e){return e=e||{},QWn.extend({},mqo,e,{customStyleMap:J9t(e.styleMap),readStyleMap:function(){var t=this.customStyleMap;return this.includeEmbeddedStyleMap&&(t=t.concat(J9t(this.embeddedStyleMap))),this.includeDefaultStyleMap&&(t=t.concat(gqo)),t}})}function J9t(e){return e?QWn.isString(e)?e.split(` `).map(function(t){return t.trim()}).filter(function(t){return t!==""&&t.charAt(0)!=="#"}):e:[]}function vqo(e){return e}var BWn={},_9t=Wf,pqo=Dre;BWn.openZip=bqo;function bqo(e){return e.arrayBuffer?_9t.resolve(pqo.openArrayBuffer(e.arrayBuffer)):_9t.reject(new Error("Could not find file in options"))}var FWn={},Oqo=rwe(),wqo=iwe();FWn.element=yqo;function yqo(e){return function(t){return wqo.elementWithTag(Oqo.element(e),[t])}}var Cqo=Sh,PWn=zrt,yot=mot,xqo=kot.DocumentConverter,Lqo=gWn.convertElementToRawText,Sqo=owe.readStyle,Tqo=cwe.readOptions,dwe=BWn,Eqo=D2.Result;T2.convertToHtml=Dqo;T2.convertToMarkdown=Qqo;T2.convert=Cot;T2.extractRawText=Mqo;T2.images=vot;T2.transforms=BE;T2.underline=FWn;T2.embedStyleMap=Rqo;T2.readEmbeddedStyleMap=Bqo;function Dqo(e,t){return Cot(e,t)}function Qqo(e,t){var n=Object.create(t||{});return n.outputFormat="markdown",Cot(e,n)}function Cot(e,t){return t=Tqo(t),dwe.openZip(e).tap(function(n){return yot.readStyleMap(n).then(function(r){t.embeddedStyleMap=r})}).then(function(n){return PWn.read(n,e,t).then(function(r){return r.map(t.transformDocument)}).then(function(r){return Fqo(r,t)})})}function Bqo(e){return dwe.openZip(e).then(yot.readStyleMap)}function Fqo(e,t){var n=Pqo(t.readStyleMap()),r=Cqo.extend({},t,{styleMap:n.value}),o=new xqo(r);return e.flatMapThen(function(s){return n.flatMapThen(function(a){return o.convertToHtml(s)})})}function Pqo(e){return Eqo.combine((e||[]).map(Sqo)).map(function(t){return t.filter(function(n){return!!n})})}function Mqo(e){return dwe.openZip(e).then(PWn.read).then(function(t){return t.map(Lqo)})}function Rqo(e,t){return dwe.openZip(e).tap(function(n){return yot.writeStyleMap(n,t)}).then(function(n){return n.toArrayBuffer()}).then(function(n){return{toArrayBuffer:function(){return n},toBuffer:function(){return Buffer.from(n)}}})}T2.styleMapping=function(){throw new Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)};const Iqo={class:"purgeNovel"},Nqo={class:"data"},Uqo={class:"dragIcon"},jqo={class:"uploadText"},Wqo={class:"uploadHint"},Hqo={class:"formItem"},Vqo={class:"label"},zqo={class:"uploadWrap"},Zqo={class:"footerInfo f ac jb",style:{"margin-top":"8px"}},Yqo={class:"charCount"},Xqo={key:0,class:"tips warn"},qqo={style:{"margin-top":"16px","text-align":"right"}},Gqo={class:"fc to2Box"},Kqo={class:"ellipsisText"},Jqo={class:"selectedInfo"},_qo={style:{"margin-top":"16px","text-align":"right"}},$qo=qe({__name:"importNovel",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:Vs(["select"],["update:modelValue"]),setup(e,{emit:t}){const{project:n}=Br(Ad()),r=Pl(e,"modelValue"),o=le("To1"),s=le(),a=le(""),l=le([]),d=le([]),u=le(!1),h=[{colKey:"row-select",type:"multiple",width:60},{colKey:"index",title:$t("workbench.novel.import.col.chapter"),width:100},{colKey:"reel",title:$t("workbench.novel.import.col.reel"),width:100},{colKey:"chapter",title:$t("workbench.novel.import.col.chapterName"),width:200,ellipsis:!0},{colKey:"chapterData",title:$t("workbench.novel.import.col.chapterData"),ellipsis:!0}],f=G(()=>{if(!a.value)return[];try{return PVo(a.value).flatMap(C=>C.chapters.map(x=>({index:x.index,reel:C.reel,chapter:x.chapter,chapterData:x.text})))}catch(C){return console.error("解析小说内容出错:",C),[]}}),g=G(()=>f.value.filter(C=>d.value.includes(C.index))),k=G(()=>g.value.reduce((C,x)=>C+x.chapterData.length,0));function A(){var C;(C=s.value)==null||C.triggerUpload()}async function m(C){var L;const x=(L=C.dataTransfer)==null?void 0:L.files;x&&x.length>0&&await b({raw:x[0]})}async function v(C){const x=await C.arrayBuffer();return C.type==="text/plain"?new TextDecoder().decode(x):(await T2.extractRawText({arrayBuffer:x})).value}function p(){return Promise.resolve({response:{},status:"success"})}async function b(C){const x=C.raw;if(!x)return window.$message.error($t("workbench.novel.import.msg.selectFile")),!1;const L=["text/plain","application/vnd.openxmlformats-officedocument.wordprocessingml.document"];if(x.type==="application/msword")return window.$message.warning($t("workbench.novel.import.msg.docNotSupported")),!1;if(!L.includes(x.type))return window.$message.error($t("workbench.novel.import.msg.unsupportedType")),!1;if(x.size>10*1024*1024)return window.$message.error($t("workbench.novel.import.msg.fileTooLarge")),!1;Lc(!0);try{a.value=await v(x)}catch{window.$message.error($t("workbench.novel.import.msg.parseFailed"))}finally{Lc(!1)}return!1}function O(C,x){d.value=C}const w=t;async function y(){var C;if(u.value=!0,!g.value.length){window.$message.warning($t("workbench.novel.import.msg.selectChapters")),u.value=!1;return}try{await Xt.post("/novel/addNovel",{projectId:(C=n.value)==null?void 0:C.id,data:g.value}),u.value=!1,w("select"),window.$message.success($t("workbench.novel.import.msg.saveSuccess"))}catch(x){window.$message.error(x.message),u.value=!1}finally{u.value=!1,r.value=!1}}return ut(r,C=>{C||(a.value="",l.value=[],d.value=[],o.value="To1")}),(C,x)=>{const L=lie,S=dn("i-upload-one"),E=JF,Q=RA,T=fi,M=zz,B=Va,P=y6,F=Vz,R=Aa;return we(),Re("div",Iqo,[c(R,{footer:!1,visible:r.value,"onUpdate:visible":x[5]||(x[5]=N=>r.value=N),header:C.$t("workbench.novel.import.title"),width:"50%",placement:"center"},{default:me(()=>[ae("div",Nqo,[c(F,{value:ge(o),disabled:""},{default:me(()=>[c(M,{value:"To1",label:C.$t("workbench.novel.import.step1"),style:{height:"680px","overflow-y":"auto"}},{default:me(()=>[ae("div",{class:"uploadArea",onClick:A,onDragover:x[1]||(x[1]=Mi(()=>{},["prevent"])),onDrop:Mi(m,["prevent"])},[c(L,{ref_key:"uploadRef",ref:s,modelValue:ge(l),"onUpdate:modelValue":x[0]||(x[0]=N=>yn(l)?l.value=N:null),theme:"file",multiple:!1,max:1,"before-upload":b,"request-method":p,style:{display:"none"}},null,8,["modelValue"]),ae("div",Uqo,[c(S,{theme:"outline",size:"32",fill:"var(--td-brand-color)"})]),ae("p",jqo,Ee(C.$t("workbench.novel.import.dragUpload")),1),ae("p",Wqo,Ee(C.$t("workbench.novel.import.uploadHint")),1)],32),c(E,null,{default:me(()=>[ft(Ee(C.$t("workbench.novel.import.or")),1)]),_:1}),ae("div",Hqo,[ae("div",Vqo,Ee(C.$t("workbench.novel.import.pasteLabel")),1),ae("div",zqo,[c(Q,{modelValue:ge(a),"onUpdate:modelValue":x[2]||(x[2]=N=>yn(a)?a.value=N:null),placeholder:C.$t("workbench.novel.import.pastePlaceholder"),autosize:{minRows:12,maxRows:12}},null,8,["modelValue","placeholder"])]),ae("div",Zqo,[ae("div",null,[ae("span",Yqo,Ee(ge(a).length)+" "+Ee(C.$t("workbench.novel.import.chars")),1),ge(a).length>0&&ge(a).length<100?(we(),Re("span",Xqo,Ee(C.$t("workbench.novel.import.tooShort")),1)):Ft("",!0)]),ae("span",null,Ee(C.$t("workbench.novel.import.parsedChapters",{count:ge(f).length})),1)])]),ae("div",qqo,[c(T,{theme:"primary",style:{"margin-left":"10px"},disabled:!ge(a)||!ge(f).length,onClick:x[3]||(x[3]=N=>o.value="To2")},{default:me(()=>[ft(Ee(C.$t("workbench.novel.import.nextStep")),1)]),_:1},8,["disabled"])])]),_:1},8,["label"]),c(M,{value:"To2",label:C.$t("workbench.novel.import.step2"),style:{height:"680px","overflow-y":"auto"}},{default:me(()=>[ae("div",Gqo,[c(P,{ref:"tableRef","row-key":"index",data:ge(f),columns:h,"selected-row-keys":ge(d),hover:"",style:{flex:"1","overflow-y":"auto"},onSelectChange:O},{chapterData:me(({row:N})=>[c(B,{content:N.chapterData,placement:"top"},{default:me(()=>[ae("span",Kqo,Ee(N.chapterData),1)]),_:2},1032,["content"])]),_:1},8,["data","selected-row-keys"]),ae("div",Jqo,Ee(C.$t("workbench.novel.import.selectedInfo",{count:ge(k)})),1),ae("div",_qo,[c(T,{variant:"outline",onClick:x[4]||(x[4]=N=>o.value="To1")},{default:me(()=>[ft(Ee(C.$t("workbench.novel.import.prevStep")),1)]),_:1}),c(T,{theme:"primary",style:{"margin-left":"10px"},loading:ge(u),onClick:y},{default:me(()=>[...x[6]||(x[6]=[ft(" 保存 ",-1)])]),_:1},8,["loading"])])])]),_:1},8,["label"])]),_:1},8,["value"])])]),_:1},8,["visible","header"])])}}}),eGo=fr($qo,[["__scopeId","data-v-6eae6c03"]]),tGo={class:"editNodel"},nGo={class:"data",style:{"overflow-x":"hidden"}},iGo={class:"editNodel-footer"},rGo=qe({__name:"editNodel",props:Vs({formData:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:Vs(["select"],["update:modelValue"]),setup(e,{emit:t}){const n=Pl(e,"modelValue"),r=e,o=t;async function s(){console.log("保存的章节数据:",r.formData);try{await Xt.post("/novel/updateNovel",{id:r.formData.id,index:r.formData.index,reel:r.formData.reel,chapter:r.formData.chapter,chapterData:r.formData.chapterData,event:r.formData.event}),o("select"),window.$message.success($t("workbench.novel.editDialog.msg.updateSuccess"))}catch(a){window.$message.error(a.message)}finally{n.value=!1}n.value=!1}return(a,l)=>{const d=Rc,u=HA,h=RA,f=yg,g=fi,k=Aa;return we(),Re("div",tGo,[c(k,{visible:n.value,"onUpdate:visible":l[4]||(l[4]=A=>n.value=A),header:a.$t("workbench.novel.editDialog.title"),width:"50%",top:"10vh",placement:"center"},{footer:me(()=>[ae("div",iGo,[c(g,{onClick:l[3]||(l[3]=A=>n.value=!1)},{default:me(()=>[ft(Ee(a.$t("workbench.novel.editDialog.cancel")),1)]),_:1}),c(g,{theme:"primary",onClick:s},{default:me(()=>[ft(Ee(a.$t("workbench.novel.editDialog.save")),1)]),_:1})])]),default:me(()=>[ae("div",nGo,[c(f,{"label-width":"80px"},{default:me(()=>[c(u,{label:a.$t("workbench.novel.editDialog.chapterName")},{default:me(()=>[c(d,{placeholder:a.$t("workbench.novel.editDialog.chapterNamePh"),modelValue:e.formData.chapter,"onUpdate:modelValue":l[0]||(l[0]=A=>e.formData.chapter=A)},null,8,["placeholder","modelValue"])]),_:1},8,["label"]),c(u,{label:a.$t("workbench.novel.editDialog.eventContent")},{default:me(()=>[c(h,{modelValue:e.formData.event,"onUpdate:modelValue":l[1]||(l[1]=A=>e.formData.event=A),placeholder:a.$t("workbench.novel.editDialog.eventContentPh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c(u,{label:a.$t("workbench.novel.editDialog.chapterContent")},{default:me(()=>[c(h,{placeholder:a.$t("workbench.novel.editDialog.chapterContentPh"),modelValue:e.formData.chapterData,"onUpdate:modelValue":l[2]||(l[2]=A=>e.formData.chapterData=A),autosize:{minRows:15,maxRows:15}},null,8,["placeholder","modelValue"])]),_:1},8,["label"])]),_:1})])]),_:1},8,["visible","header"])])}}}),oGo=fr(rGo,[["__scopeId","data-v-9e187c61"]]),sGo={class:"novel",ref:"novelRef"},aGo={class:"headBtn jb ac",ref:"headBtnRef"},lGo={class:"f"},cGo={key:2,class:"eventCell"},dGo={class:"eventPreview"},uGo={class:"chapterDataCell"},hGo={class:"chapterPreview"},AGo={class:"previewDialogContent"},ade=80,fGo=qe({__name:"index",setup(e){const{otherSetting:t}=Br(qs()),{project:n}=Br(Ad()),r=le(""),o=le([{colKey:"row-select",type:"multiple",width:50,align:"center"},{colKey:"index",title:$t("workbench.novel.col.id"),width:50,align:"center"},{colKey:"reel",title:$t("workbench.novel.col.reel"),width:100,align:"center",cell:"preview"},{colKey:"chapter",title:$t("workbench.novel.col.chapter"),width:100,ellipsis:!0},{colKey:"chapterData",title:$t("workbench.novel.col.chapterData"),ellipsis:!0},{colKey:"event",title:$t("workbench.novel.col.event"),ellipsis:!0},{colKey:"operation",title:$t("workbench.novel.col.operation"),width:200,align:"center"}]),s=le(!1),a=le({id:-1,index:0,reel:"",chapter:"",chapterData:"",event:""}),l=le(!1),d=le(""),u=le("");function h(P){return P?P.length<=ade?P:`${P.slice(0,ade)}...`:$t("workbench.novel.none")}function f(P,F){d.value=P,u.value=F||"",l.value=!0}const g=le([]),k=le(!1),A=le([]),m=le({page:1,pageSize:10,total:0});vn(()=>{p()}),Ma(()=>{B()});function v(){m.value.page=1,p()}function p(){var P;k.value=!0,Xt.post("/novel/getNovel",{projectId:(P=n.value)==null?void 0:P.id,page:m.value.page,limit:m.value.pageSize,search:r.value}).then(F=>{g.value=F.data.data,m.value.total=F.data.total}).finally(()=>{k.value=!1})}function b(P){m.value.page=P.current,m.value.pageSize=P.pageSize,p()}const O=le(!1);function w(){O.value=!0}function y(P,F){A.value=P.filter(Boolean)}function C(){if(A.value.length===0)return;const P=Kr.confirm({header:$t("workbench.novel.msg.batchDeleteHeader"),body:$t("workbench.novel.msg.batchDeleteBody",{count:A.value.length}),onConfirm:async()=>{await Xt.post("/novel/batchDeleteNovel",{ids:A.value}),p(),window.$message.success($t("workbench.novel.msg.batchDeleteSuccess")),P.destroy()}})}function x(P){s.value=!0,a.value={...P}}function L(P){const F=Kr.confirm({header:$t("workbench.novel.msg.deleteHeader"),body:$t("workbench.novel.msg.deleteBody",{name:P.chapter}),onConfirm:async()=>{try{await Xt.post("/novel/delNovel",{id:P.id}),window.$message.success($t("workbench.novel.msg.deleteSuccess")),g.value.length===1&&m.value.page>1&&(m.value.page-=1),p()}catch(R){window.$message.error(R.message)}window.$message.success($t("workbench.novel.msg.deleteSuccess")),F.destroy()}})}function S(){const P=Kr.confirm({header:$t("workbench.novel.msg.eventAnalysisHeader"),body:$t("workbench.novel.msg.eventAnalysisBody",{count:A.value.length}),onConfirm:()=>{var F;P.destroy(),Xt.post("/novel/event/generateEvents",{projectId:(F=n.value)==null?void 0:F.id,novelIds:A.value,concurrentCount:t.value.assetsBatchGenereateSize}).then(R=>{A.value.length=0,p()})}})}const E=G(()=>g.value.filter(P=>!P.eventState));let Q=null;async function T(){if(E.value.length===0)return;const P=E.value.map(F=>F.id);try{const{data:F}=await Xt.post("/novel/getNovelEventState",{ids:P});Array.isArray(F)&&F.forEach(R=>{const N=g.value.find(I=>I.id===R.id);N&&(N.eventState=R.eventState,N.eventState==-1&&(N.errorReason=R.errorReason),R.event!==void 0&&(N.event=R.event))})}catch(F){console.error("轮询事件状态失败:",F)}}function M(){Q||(Q=setInterval(async()=>{if(E.value.length===0){B();return}await T()},3e3))}function B(){Q&&(clearInterval(Q),Q=null)}return ut(E,P=>{P.length>0?M():B()}),Ma(()=>{B()}),(P,F)=>{const R=NO,N=fi,I=Bv,W=Rc,H=Mc,V=s4e,Z=y6,K=Aa;return we(),Re("div",sGo,[ae("div",aGo,[c(I,null,{default:me(()=>[c(N,{theme:"primary",onClick:w},{icon:me(()=>[c(R,{name:"add"})]),default:me(()=>[ft(" "+Ee(P.$t("workbench.novel.importText")),1)]),_:1}),c(N,{theme:"danger",disabled:ge(A).length===0,onClick:C},{icon:me(()=>[c(R,{name:"delete"})]),default:me(()=>[ft(" "+Ee(P.$t("workbench.novel.batchDelete"))+" "+Ee(ge(A).length>0?`(${ge(A).length})`:""),1)]),_:1},8,["disabled"]),c(N,{onClick:S,disabled:ge(A).length===0},{icon:me(()=>[c(R,{name:"analytics"})]),default:me(()=>[ft(" "+Ee(P.$t("workbench.novel.eventAnalysis"))+" "+Ee(ge(A).length>0?`(${ge(A).length})`:""),1)]),_:1},8,["disabled"])]),_:1}),ae("div",lGo,[c(W,{modelValue:ge(r),"onUpdate:modelValue":F[0]||(F[0]=X=>yn(r)?r.value=X:null),placeholder:P.$t("workbench.novel.searchPlaceholder"),clearable:"",style:{width:"260px"}},null,8,["modelValue","placeholder"]),c(N,{onClick:v,style:{"margin-left":"10px"}},{icon:me(()=>[c(R,{name:"search"})]),default:me(()=>[ft(" "+Ee(P.$t("workbench.novel.search")),1)]),_:1})])],512),c(Z,{ref:"tableRef",style:{"margin-top":"10px",flex:"1",display:"flex","flex-direction":"column"},columns:ge(o),data:ge(g),"selected-row-keys":ge(A),"select-on-row-click":!0,keyboardRowHover:!1,"row-key":"id",hover:"",stripe:"",size:"small",pagination:ge(m),loading:ge(k),"lazy-load":"","table-layout":"fixed",onSelectChange:y,onPageChange:b},{startTime:me(({row:X})=>[ae("span",null,Ee(ge(Z5)(X.startTime).format("YYYY-MM-DD HH:mm:ss")),1)]),event:me(({row:X})=>[X.eventState==0?(we(),Ot(H,{key:0,size:"small",text:P.$t("workbench.novel.generating")},null,8,["text"])):X.eventState==-1&&!X.event?(we(),Ot(N,{key:1,theme:"danger",variant:"text",size:"small",onClick:Mi(ee=>f(P.$t("workbench.novel.genFailed"),X==null?void 0:X.errorReason),["stop"])},{default:me(()=>[ft(Ee(P.$t("workbench.novel.genFailed")),1)]),_:1},8,["onClick"])):(we(),Re("div",cGo,[ae("div",dGo,Ee(h(X.event)),1),X.event&&X.event.length>ade?(we(),Ot(V,{key:0,theme:"success",hover:"color",onClick:ee=>f(P.$t("workbench.novel.col.event"),X.event)},{default:me(()=>[ft(Ee(P.$t("workbench.novel.viewDetail")),1)]),_:1},8,["onClick"])):Ft("",!0)]))]),chapterData:me(({row:X})=>[ae("div",uGo,[ae("div",hGo,Ee(h(X.chapterData)),1),X.chapterData&&X.chapterData.length>ade?(we(),Ot(V,{key:0,theme:"success",hover:"color",onClick:Mi(ee=>f(P.$t("workbench.novel.col.chapterData"),X.chapterData),["stop"])},{default:me(()=>[ft(Ee(P.$t("workbench.novel.viewDetail")),1)]),_:1},8,["onClick"])):Ft("",!0)])]),operation:me(({row:X})=>[c(I,{size:0},{default:me(()=>[c(N,{theme:"primary",disabled:X.eventState==0,variant:"text",onClick:ee=>x(X)},{icon:me(()=>[c(R,{name:"edit"})]),default:me(()=>[ft(" "+Ee(P.$t("workbench.novel.edit")),1)]),_:1},8,["disabled","onClick"]),c(N,{theme:"danger",disabled:X.eventState==0,variant:"text",onClick:ee=>L(X)},{icon:me(()=>[c(R,{name:"delete"})]),default:me(()=>[ft(" "+Ee(P.$t("workbench.novel.delete")),1)]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:1},8,["columns","data","selected-row-keys","pagination","loading"]),c(K,{visible:ge(l),"onUpdate:visible":F[1]||(F[1]=X=>yn(l)?l.value=X:null),header:ge(d),width:"900px",placement:"top",top:"10vh","destroy-on-close":"",footer:!1},{default:me(()=>[ae("div",AGo,Ee(ge(u)||P.$t("workbench.novel.none")),1)]),_:1},8,["visible","header"]),c(eGo,{modelValue:ge(O),"onUpdate:modelValue":F[2]||(F[2]=X=>yn(O)?O.value=X:null),onSelect:p},null,8,["modelValue"]),c(oGo,{modelValue:ge(s),"onUpdate:modelValue":F[3]||(F[3]=X=>yn(s)?s.value=X:null),formData:ge(a),onSelect:p},null,8,["modelValue","formData"])],512)}}}),gGo=fr(fGo,[["__scopeId","data-v-c917544e"]]),mGo=Object.freeze(Object.defineProperty({__proto__:null,default:gGo},Symbol.toStringTag,{value:"Module"})),kGo={class:"addAssets"},vGo={class:"data"},pGo=qe({__name:"addAssets",props:Vs({type:{},title:{},formData:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:Vs(["getFilteredData"],["update:modelValue"]),setup(e,{emit:t}){const{project:n}=Br(Ad()),r=e,o=Pl(e,"modelValue"),s=le({name:[{required:!0,message:$t("workbench.assets.add.nameRequired"),trigger:"blur"}],describe:[{required:!0,message:$t("workbench.assets.add.describeRequired"),trigger:"blur"}]});function a(){o.value=!1}const l=le(),d=t;function u(){var h;(h=l.value)==null||h.validate().then(async f=>{var g;f==!0&&(r.formData.id!==0?await Xt.post("/assets/updateAssets",{id:r.formData.id,name:r.formData.name,describe:r.formData.describe,remark:r.formData.remark,prompt:r.formData.prompt}).then(()=>{window.$message.success($t("workbench.assets.add.updateSuccess")),d("getFilteredData"),o.value=!1}):await Xt.post("/assets/addAssets",{name:r.formData.name,describe:r.formData.describe,remark:r.formData.remark,type:r.type,projectId:(g=n.value)==null?void 0:g.id,prompt:r.formData.prompt}).then(()=>{window.$message.success($t("workbench.assets.add.addSuccess")),d("getFilteredData"),o.value=!1}))})}return(h,f)=>{const g=Rc,k=HA,A=RA,m=yg,v=Aa;return we(),Re("div",kGo,[c(v,{visible:o.value,"onUpdate:visible":f[4]||(f[4]=p=>o.value=p),closable:!1,width:"40vw",header:r.title,maskClosable:!1,onCloseBtnClick:a,onConfirm:u,onCancel:a},{default:me(()=>[ae("div",vGo,[c(m,{data:r.formData,rules:ge(s),ref_key:"formRef",ref:l},{default:me(()=>[c(k,{label:h.$t("workbench.assets.add.name"),name:"name"},{default:me(()=>[c(g,{modelValue:r.formData.name,"onUpdate:modelValue":f[0]||(f[0]=p=>r.formData.name=p),placeholder:h.$t("workbench.assets.add.namePh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c(k,{label:h.$t("workbench.assets.add.describe"),name:"describe"},{default:me(()=>[c(A,{modelValue:r.formData.describe,"onUpdate:modelValue":f[1]||(f[1]=p=>r.formData.describe=p),placeholder:h.$t("workbench.assets.add.describePh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c(k,{label:h.$t("workbench.assets.add.remark"),name:"remark"},{default:me(()=>[c(g,{modelValue:r.formData.remark,"onUpdate:modelValue":f[2]||(f[2]=p=>r.formData.remark=p),placeholder:h.$t("workbench.assets.add.remarkPh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),r.type!=="clip"?(we(),Ot(k,{key:0,label:h.$t("workbench.assets.add.prompt"),name:"prompt"},{default:me(()=>[c(A,{modelValue:r.formData.prompt,"onUpdate:modelValue":f[3]||(f[3]=p=>r.formData.prompt=p),autosize:{minRows:3,maxRows:5},placeholder:h.$t("workbench.assets.add.promptPh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):Ft("",!0)]),_:1},8,["data","rules"])])]),_:1},8,["visible","header"])])}}}),bGo=fr(pGo,[["__scopeId","data-v-5b2206fc"]]),OGo={class:"data"},wGo={class:"audio-list"},yGo={class:"audio-upload-row"},CGo=["onClick","onDrop"],xGo={class:"audio-filename"},LGo={class:"audio-filename audio-filename--existing"},SGo=["onChange"],TGo=qe({__name:"addAudioAssets",props:Vs({formData:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:Vs(["getFilteredData"],["update:modelValue"]),setup(e,{emit:t}){const{project:n}=Br(Ad()),r=e,o=Pl(e,"modelValue"),s=le({name:[{required:!0,message:$t("workbench.assets.add.nameRequired"),trigger:"blur"}],describe:[{required:!0,message:$t("workbench.assets.add.describeRequired"),trigger:"blur"}]});function a(){o.value=!1,u.value=[{file:null,text:"",name:"",describe:""}]}const l=le(),d=t,u=le([{file:null,text:"",name:"",describe:""}]),h=le([]);ut(()=>r.formData.sonAssets,b=>{b&&b.length>0?u.value=b.map(O=>({id:O.id,src:O.src,file:null,text:O.prompt,name:O.name||"",describe:O.describe||""})):u.value=[{file:null,text:"",name:"",describe:""}]},{immediate:!0});function f(){u.value.push({file:null,text:"",name:"",describe:""})}function g(b){u.value.splice(b,1),u.value.length===0&&u.value.push({file:null,text:"",name:"",describe:""})}function k(b){var O;(O=h.value[b])==null||O.click()}function A(b,O){var C;const w=b.target,y=(C=w.files)==null?void 0:C[0];y&&(u.value[O].file=y,u.value[O].src=void 0,u.value[O].name||(u.value[O].name=y.name)),w.value=""}function m(b,O){var y,C;const w=(C=(y=b.dataTransfer)==null?void 0:y.files)==null?void 0:C[0];w&&w.type.startsWith("audio/")?(u.value[O].file=w,u.value[O].name||(u.value[O].name=w.name)):w&&window.$message.warning($t("workbench.assets.add.pleaseUploadAudio"))}async function v(b){return new Promise((O,w)=>{const y=new FileReader;y.onload=()=>{O(y.result)},y.onerror=w,y.readAsDataURL(b)})}function p(){var b;(b=l.value)==null||b.validate().then(async O=>{var w;if(O==!0){const y=(await Promise.all(u.value.map(async x=>x.id!=null&&x.src?{id:x.id,src:x.src,prompt:x.text||"",name:x.name||x.src.split("/").pop()||"",describe:x.describe||""}:x.file?{base64:await v(x.file),prompt:x.text||"",name:x.name||x.file.name,describe:x.describe||""}:null))).filter(x=>!!x),C={name:r.formData.name,describe:r.formData.sex+"|"+r.formData.describe,projectId:((w=n.value)==null?void 0:w.id)??0,assetsItem:y};console.log(r.formData.id),r.formData.id?await Xt.post("/assets/updateAudioAssets",{id:r.formData.id,...C}).then(()=>{window.$message.success($t("workbench.assets.add.updateSuccess")),d("getFilteredData"),o.value=!1}):await Xt.post("/assets/addAudioAssets",C).then(()=>{window.$message.success($t("workbench.assets.add.addSuccess")),d("getFilteredData"),o.value=!1})}})}return(b,O)=>{const w=Rc,y=HA,C=RA,x=dn("i-volume-notice"),L=Gd,S=dn("i-upload-one"),E=dn("i-close"),Q=fi,T=dn("i-plus"),M=yg,B=Aa;return we(),Ot(B,{visible:o.value,"onUpdate:visible":O[4]||(O[4]=P=>o.value=P),closable:!1,width:"40vw",header:r.formData.id?"编辑":"新增",maskClosable:!1,onCloseBtnClick:a,onConfirm:p,onCancel:a},{default:me(()=>[ae("div",OGo,[c(M,{data:r.formData,rules:ge(s),ref_key:"formRef",ref:l},{default:me(()=>[c(y,{label:b.$t("workbench.assets.add.audioName"),name:"name"},{default:me(()=>[c(w,{modelValue:r.formData.name,"onUpdate:modelValue":O[0]||(O[0]=P=>r.formData.name=P),placeholder:b.$t("workbench.assets.add.audioNamePh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c(y,{label:b.$t("workbench.assets.add.describe"),name:"describe"},{default:me(()=>[c(C,{modelValue:r.formData.describe,"onUpdate:modelValue":O[1]||(O[1]=P=>r.formData.describe=P),placeholder:b.$t("workbench.assets.add.describePh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c(y,{label:b.$t("workbench.assets.add.sex"),name:"remark"},{default:me(()=>[c(w,{modelValue:r.formData.sex,"onUpdate:modelValue":O[2]||(O[2]=P=>r.formData.sex=P),placeholder:b.$t("workbench.assets.add.sexPh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c(y,{label:b.$t("workbench.assets.add.audioFile"),name:"audioFile"},{default:me(()=>[ae("div",wGo,[(we(!0),Re(Yt,null,hi(ge(u),(P,F)=>(we(),Re("div",{key:F,class:"audio-item"},[ae("div",yGo,[ae("div",{class:"audio-file-area",onClick:R=>k(F),onDragover:O[3]||(O[3]=Mi(()=>{},["prevent"])),onDrop:Mi(R=>m(R,F),["prevent"])},[P.file?(we(),Re(Yt,{key:0},[c(x,{size:"16"}),ae("span",xGo,Ee(P.file.name),1)],64)):P.src?(we(),Re(Yt,{key:1},[c(x,{size:"16",fill:"var(--td-success-color)"}),ae("span",LGo,Ee(P.name),1),c(L,{size:"small",theme:"success",variant:"light",style:{"margin-left":"auto","flex-shrink":"0"}},{default:me(()=>[...O[5]||(O[5]=[ft("已上传",-1)])]),_:1})],64)):(we(),Re(Yt,{key:2},[c(S,{size:"16",fill:"var(--td-brand-color)"}),O[6]||(O[6]=ae("span",{class:"audio-upload-hint"},"点击或拖拽上传音频",-1))],64)),ae("input",{ref_for:!0,ref:R=>ge(h)[F]=R,type:"file",accept:"audio/*",style:{display:"none"},onChange:R=>A(R,F)},null,40,SGo)],40,CGo),c(Q,{theme:"danger",variant:"outline",shape:"circle",size:"small",onClick:R=>g(F)},{icon:me(()=>[c(E,{size:"12"})]),_:1},8,["onClick"])]),c(w,{modelValue:P.text,"onUpdate:modelValue":R=>P.text=R,placeholder:"请输入该音频对应的文本内容",class:"audio-text-input"},null,8,["modelValue","onUpdate:modelValue"]),c(w,{modelValue:P.describe,"onUpdate:modelValue":R=>P.describe=R,placeholder:"请输入该音频的描述",class:"audio-text-input"},null,8,["modelValue","onUpdate:modelValue"])]))),128)),c(Q,{theme:"primary",variant:"outline",size:"small",onClick:f},{icon:me(()=>[c(T)]),default:me(()=>[O[7]||(O[7]=ft(" 添加音频 ",-1))]),_:1})])]),_:1},8,["label"])]),_:1},8,["data","rules"])])]),_:1},8,["visible","header"])}}}),EGo=fr(TGo,[["__scopeId","data-v-4658a6e9"]]),DGo={class:"generateImage"},QGo={class:"data f"},BGo={class:"uploadReferenceImage"},FGo={class:"jb"},PGo={style:{"font-size":"16px","font-weight":"900"}},MGo={class:"upload"},RGo={class:"rawPicturePrompt"},IGo={class:"jb"},NGo={style:{"font-size":"16px","font-weight":"900"}},UGo={style:{"margin-left":"5px","font-size":"13px"}},jGo={class:"input"},WGo={class:"selectModel f"},HGo={style:{width:"60%"}},VGo={style:{"font-size":"16px","font-weight":"900"}},zGo={style:{width:"40%","margin-left":"15px"}},ZGo={style:{"font-size":"16px","font-weight":"900"}},YGo={class:"generateButton",style:{"margin-top":"20px"}},XGo={class:"resultImages",style:{gap:"20px","flex-wrap":"wrap"}},qGo={class:"image f w"},GGo=["onClick","onMouseenter"],KGo={key:0,class:"generating-overlay f ac jc"},JGo={key:1,class:"failed-overlay f ac jc"},_Go={style:{"text-align":"center"}},$Go={style:{"margin-top":"10px",color:"#d0021b","font-weight":"bold"}},eKo={class:"preview"},tKo={class:"selected"},nKo={class:"delImage"},iKo={class:"customUpload"},rKo={class:"uploadPlaceholder f ac jc",style:{width:"180px",height:"180px",border:"2px dashed #d9d9d9","border-radius":"20px",cursor:"pointer"}},oKo={class:"keep"},sKo=qe({__name:"generateImage",props:Vs({formData:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:Vs(["update"],["update:modelValue"]),setup(e,{emit:t}){const{project:n}=Br(Ad()),r=e,o=Pl(e,"modelValue");function s(){o.value=!1,u.value=!1,E(),A("update")}const a=le([]),l=le(!1),d=le(!1),u=le(!1),h=le(""),f=le(""),g=le(!1);async function k(){var P;g.value=!0;try{const{data:F}=await Xt.post("/assetsGenerate/polishAssetsPrompt",{projectId:(P=n.value)==null?void 0:P.id,assetsId:r.formData.id,type:r.formData.type??"props",name:r.formData.name,describe:r.formData.describe?r.formData.describe:$t("workbench.assets.noDescription")});window.$message.success($t("workbench.assets.gen.promptSuccess")),F.assetsId===r.formData.id&&(r.formData.prompt=F.prompt)}catch(F){window.$message.error(F.message??$t("workbench.assets.gen.promptFail"))}finally{g.value=!1}}const A=t,m=le("1K");async function v(){var P;if(!r.formData.prompt){window.$message.error($t("workbench.assets.gen.fillPrompt"));return}if(!m.value){window.$message.error($t("workbench.assets.gen.pickResolution"));return}if(!h.value){window.$message.error($t("workbench.assets.gen.pickModel"));return}u.value=!0;try{let F="";if(a.value.length>0){const R=a.value[0].raw;R instanceof File&&(F=await new Promise(N=>{const I=new FileReader;I.onload=W=>{var V;const H=(V=W.target)==null?void 0:V.result;N(H)},I.readAsDataURL(R)}))}await Xt.post("/assetsGenerate/generateAssets",{type:r.formData.type??"props",projectId:(P=n.value)==null?void 0:P.id,name:r.formData.name??$t("workbench.assets.gen.unnamed"),base64:F,prompt:r.formData.prompt,model:h.value,id:r.formData.id,resolution:m.value}),window.$message.success($t("workbench.assets.gen.assetGenSuccess")),await Q()}catch(F){window.$message.error(F.message??$t("workbench.assets.gen.assetGenFail")),Q()}finally{u.value=!1}}const p=le([]);function b(P){var F;if(P.length>0){const R=((F=P[0])==null?void 0:F.raw)||P[0];if(R instanceof File){const N=new FileReader;N.onload=I=>{var H;const W=(H=I.target)==null?void 0:H.result;O.value.push({id:"",src:W,state:"已完成"}),window.$message.success($t("workbench.assets.gen.uploadOk")),p.value=[]},N.readAsDataURL(R)}}}const O=le([]),w=le(!1),y=le();function C(P){w.value=!0,y.value=P}const x=le(null),L=le(null);ut(()=>o.value,P=>{P&&(a.value=[],f.value="",x.value=null,L.value=null,u.value=!1,Q())});let S=null;function E(){S&&(clearTimeout(S),S=null)}async function Q(){const{data:P}=await Xt.post("/assets/getImage",{assetsId:r.formData.id}),F=P.tempAssets.map(I=>({id:I.id,src:I.filePath,state:I.state,selected:I.selected??!1}));O.value=F;const R=F.findIndex(I=>I.selected);R!==-1&&(x.value=R);const N=F.some(I=>I.state==="生成中");E(),N&&o.value&&(S=setTimeout(()=>Q(),3e3))}function T(P){O.value[P].state==="已完成"&&(x.value=P,window.$message.success($t("workbench.assets.gen.imageSelected")))}function M(P,F){const R=Kr.confirm({header:$t("workbench.assets.confirmDeleteHeader"),body:$t("workbench.assets.confirmDeleteBody"),confirmBtn:$t("workbench.assets.deleteBtn"),cancelBtn:$t("workbench.assets.cancelBtn"),theme:"warning",onConfirm:async()=>{try{Xt.post("/assets/delImage",{id:P}),window.$message.success($t("workbench.assets.deleteSuccess")),O.value.splice(F,1),x.value===F?x.value=null:x.value!==null&&x.value>F&&x.value--,R.destroy()}catch{window.$message.error($t("workbench.assets.deleteFail")),R.destroy()}}})}async function B(){var P;if(x.value!==null){const F=O.value[x.value],R=!F.id;await Xt.post("/assets/saveAssets",{id:r.formData.id,base64:R?F.src:"",type:r.formData.type,prompt:r.formData.prompt,projectId:(P=n.value)==null?void 0:P.id,imageId:R?void 0:Number(F.id)}),window.$message.success($t("workbench.assets.gen.imageSaved")),o.value=!1,A("update")}}return(P,F)=>{const R=Gd,N=lie,I=dn("i-magic"),W=RA,H=Mc,V=UO,Z=Em,K=fi,X=yh,ee=JF,q=dn("i-close-one"),$=Wu,oe=dn("i-preview-open"),de=dn("i-check-one"),ke=dn("i-delete"),ne=dn("i-plus"),Ae=iC,Y=Aa;return we(),Re("div",DGo,[c(Y,{visible:o.value,"onUpdate:visible":F[7]||(F[7]=re=>o.value=re),top:"4vh",width:"80vw",header:P.$t("workbench.assets.gen.header"),maskClosable:!1,footer:!1,onCloseBtnClick:s},{default:me(()=>[ae("div",QGo,[c(X,{bordered:!1,style:{width:"40%"}},{default:me(()=>[ae("div",BGo,[ae("div",FGo,[ae("span",PGo,Ee(P.$t("workbench.assets.gen.uploadRef")),1),c(R,null,{default:me(()=>[ft(Ee(P.$t("workbench.assets.gen.optional")),1)]),_:1})]),ae("div",MGo,[c(N,{modelValue:ge(a),"onUpdate:modelValue":F[0]||(F[0]=re=>yn(a)?a.value=re:null),autoUpload:ge(l),disabled:ge(u),theme:"image",abridgeName:[10,8],draggable:"",action:"",accept:"image/*",showImageFileName:ge(d)},null,8,["modelValue","autoUpload","disabled","showImageFileName"])])]),ae("div",RGo,[ae("div",IGo,[ae("span",NGo,Ee(P.$t("workbench.assets.gen.promptLabel")),1),ae("div",{class:"ac",style:{cursor:"pointer"},onClick:Mi(k,["stop"])},[c(I,{theme:"outline",size:"18"}),ae("span",UGo,Ee(P.$t("workbench.assets.gen.smartGenerate")),1)])]),ae("div",jGo,[c(H,{loading:ge(g),text:P.$t("workbench.assets.gen.generatingPrompt")},{default:me(()=>[c(W,{modelValue:r.formData.prompt,"onUpdate:modelValue":F[1]||(F[1]=re=>r.formData.prompt=re),placeholder:P.$t("workbench.assets.gen.promptPlaceholder"),autosize:{minRows:15,maxRows:15},disabled:ge(u)},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["loading","text"])])]),ae("div",WGo,[ae("div",HGo,[ae("span",VGo,Ee(P.$t("workbench.assets.gen.selectModel")),1),c(W8,{modelValue:ge(h),"onUpdate:modelValue":F[2]||(F[2]=re=>yn(h)?h.value=re:null),type:"image"},null,8,["modelValue"])]),ae("div",zGo,[ae("span",ZGo,Ee(P.$t("workbench.assets.gen.selectResolution")),1),c(Z,{modelValue:ge(m),"onUpdate:modelValue":F[3]||(F[3]=re=>yn(m)?m.value=re:null)},{default:me(()=>[c(V,{key:"1K",label:"1K",value:"1K"}),c(V,{key:"2K",label:"2K",value:"2K"}),c(V,{key:"4K",label:"4K",value:"4K"})]),_:1},8,["modelValue"])])]),ae("div",YGo,[c(K,{theme:"primary",size:"large",block:"",loading:ge(u),onClick:v},{default:me(()=>[ft(Ee(P.$t("workbench.assets.gen.generateBtn")),1)]),_:1},8,["loading"])])]),_:1}),c(ee,{layout:"vertical",style:{height:"700px"}}),c(X,{title:P.$t("workbench.assets.gen.resultTitle"),bordered:!1,style:{width:"60%"}},{actions:me(()=>[ge(O).length?(we(),Ot(R,{key:0},{default:me(()=>[ft(Ee(P.$t("workbench.assets.gen.generatedCount",{count:ge(O).length})),1)]),_:1})):Ft("",!0)]),default:me(()=>[ae("div",XGo,[ae("div",qGo,[(we(!0),Re(Yt,null,hi(ge(O),(re,ce)=>(we(),Re("div",{key:ce,class:no(["resultImage",{"is-selected":ge(x)===ce,"is-disabled":re.state!=="已完成"}]),onClick:ie=>re.state==="已完成"?T(ce):null,onMouseenter:ie=>L.value=ce,onMouseleave:F[4]||(F[4]=ie=>L.value=null)},[re.state==="生成中"?(we(),Re("div",KGo,[c(H,{text:P.$t("workbench.assets.gen.generatingLabel")},null,8,["text"])])):re.state==="生成失败"&&!re.src?(we(),Re("div",JGo,[ae("div",_Go,[c(q,{theme:"filled",size:"40",fill:"#d0021b"}),ae("div",$Go,Ee(P.$t("workbench.assets.gen.genFailed")),1)])])):(we(),Ot($,{key:2,src:re.src,fit:"cover",style:{width:"100%",height:"100%",borderRadius:"20px"}},{loading:me(()=>[c(H)]),_:1},8,["src"])),gh(ae("div",eKo,[c(oe,{theme:"outline",size:"25",fill:"#ffffff",onClick:Mi(ie=>C(re.src),["stop"])},null,8,["onClick"])],512),[[nk,ge(L)===ce&&re.state==="已完成"]]),gh(ae("div",tKo,[c(de,{theme:"filled",size:"25",fill:"#000"})],512),[[nk,ge(x)===ce&&re.state==="已完成"]]),gh(ae("div",nKo,[c(ke,{theme:"outline",size:"20",fill:"#d0021b",onClick:Mi(ie=>M(re.id,ce),["stop"])},null,8,["onClick"])],512),[[nk,ge(L)===ce]])],42,GGo))),128)),ae("div",iKo,[c(N,{ref:"customUploadRef",action:"",modelValue:ge(p),"onUpdate:modelValue":F[5]||(F[5]=re=>yn(p)?p.value=re:null),disabled:ge(u),autoUpload:!1,theme:"custom",accept:"image/*",max:1,onChange:b,showImageFileName:!1},{default:me(()=>[ae("div",rKo,[c(ne,{theme:"outline",size:"24",fill:"#4a4a4a"})])]),_:1},8,["modelValue","disabled"])])])]),ae("div",oKo,[c(K,{theme:"primary",size:"large",block:"",disabled:ge(x)===null,onClick:B},{default:me(()=>[ft(Ee(P.$t("workbench.assets.gen.confirmSelect")),1)]),_:1},8,["disabled"])])]),_:1},8,["title"])]),c(Ae,{modelValue:ge(w),"onUpdate:modelValue":F[6]||(F[6]=re=>yn(w)?w.value=re:null),images:[ge(y)]},null,8,["modelValue","images"])]),_:1},8,["visible","header"])])}}}),aKo=fr(sKo,[["__scopeId","data-v-999c0778"]]),lKo={class:"assets"},cKo={class:"data"},dKo={class:"tabLabel"},uKo={class:"panelContent"},hKo={class:"toolbar"},AKo={class:"data"},fKo={class:"generatePrompt"},gKo={class:"generateImage"},mKo={class:"f ac"},kKo={class:"assetsList f w"},vKo={class:"expandedContent"},pKo={class:"previewCell"},bKo={key:0,class:"imageTrigger generatingImage"},OKo={class:"generatingLabel"},wKo=["onClick"],yKo=["src","alt"],CKo={key:1,class:"noImage"},xKo={key:2,class:"imageHoverOverlay"},LKo={class:"hoverText"},SKo={class:"promptCell"},TKo={class:"previewCell"},EKo=["onClick"],DKo=["src","alt"],QKo={key:1,class:"noImage"},BKo={key:2,class:"imageHoverOverlay"},FKo={class:"hoverText"},PKo={class:"promptCell"},MKo={class:"previewCell"},RKo={key:0,class:"imageTrigger generatingImage"},IKo={class:"generatingLabel"},NKo=["onClick"],UKo=["src","alt"],jKo={key:1,class:"noImage"},WKo={key:2,class:"imageHoverOverlay"},HKo={class:"hoverText"},VKo={class:"previewCell"},zKo=["onClick"],ZKo=["src","alt"],YKo={class:"mediaHoverOverlay"},XKo={class:"hoverText"},qKo=["onClick"],GKo=["src"],KKo={class:"mediaHoverOverlay"},JKo={class:"hoverText"},_Ko=["onClick"],$Ko={class:"mediaHoverOverlay"},eJo={class:"hoverText"},tJo={key:3,class:"mediaTrigger noMedia"},nJo={class:"expandedContent"},iJo={class:"previewCell"},rJo=["onClick"],oJo={class:"mediaHoverOverlay"},sJo={class:"hoverText"},aJo={class:"promptCell"},lJo={class:"previewCell"},cJo=["onClick"],dJo={class:"mediaHoverOverlay"},uJo={class:"hoverText"},hJo={class:"mediaPreviewDialog"},AJo=["src"],fJo={key:1,class:"audioWrapper"},gJo={class:"audioIcon"},mJo={class:"audioName"},kJo=["src"],vJo={class:"batch"},pJo=qe({__name:"index",props:{selectorMode:{type:Boolean,default:!1},allowedTypes:{},clipMediaTypes:{},multiple:{type:Boolean,default:!0}},setup(e,{expose:t}){var jt,en;const{otherSetting:n}=Br(qs()),r=e,o=le(!1),s=le({name:"",describe:"",sex:""});vn(()=>{C()}),Ma(()=>{yt(),Ke()});const{project:a}=Br(Ad()),l=[{name:$t("workbench.assets.role"),value:"role",icon:"i-permissions"},{name:$t("workbench.assets.prop"),value:"tool",icon:"i-tool"},{name:$t("workbench.assets.scene"),value:"scene",icon:"i-landscape"},{name:$t("workbench.assets.clip"),value:"clip",icon:"i-editing"},{name:$t("workbench.assets.audio"),value:"audio",icon:"i-audio-file"}],d=le((jt=r.allowedTypes)!=null&&jt.length?l.filter(bt=>r.allowedTypes.includes(bt.value)):l),u=((en=d.value[0])==null?void 0:en.value)||"role",h=le(u),f=le(""),g={role:$t("workbench.assets.role"),tool:$t("workbench.assets.prop"),scene:$t("workbench.assets.scene"),clip:$t("workbench.assets.clip"),audio:$t("workbench.assets.audio")},k=le([]),A=le([]),m=le([]),v=le(!1),p=bt=>{const Dt=Qe(bt);return(Dt==null?void 0:Dt.promptState)==="生成中"||(Dt==null?void 0:Dt.state)==="生成中"},b=le([]),O=le({page:1,pageSize:10,total:0,showJumper:!0});function w(){O.value.page=1,y(h.value)}async function y(bt){var Dt,Ct;try{v.value=!0;const{data:On}=await Xt.post("/assets/getAssetsApi",{projectId:(Dt=a.value)==null?void 0:Dt.id,type:bt,name:f.value||void 0,page:O.value.page,limit:O.value.pageSize});return b.value=On.data||[],bt==="clip"&&((Ct=r.clipMediaTypes)!=null&&Ct.length)&&(b.value=b.value.filter(Fn=>{const di=he(Fn.src);return r.clipMediaTypes.includes(di)})),O.value.total=On.total||0,b.value}catch(On){console.error("加载资产数据失败:",On),b.value=[],O.value.total=0}finally{v.value=!1}}async function C(){h.value==="role"||h.value==="tool"||h.value==="scene"||h.value==="clip"||h.value,await y(h.value)}function x(bt){f.value="",k.value=[],A.value=[],m.value=[],O.value.page=1,C()}const L=le({id:0,name:"",describe:"",remark:"",src:"",prompt:""}),S=le(!1),{open:E,onChange:Q,onCancel:T}=hyn({multiple:!1,reset:!0,accept:".png,.jpg,.jpeg,.mp3,.mp4"});async function M(bt){if(bt==="clip"){const Dt=await new Promise(Fn=>{E(),Q(di=>Fn(di)),T(()=>Fn(null))});if(!(Dt!=null&&Dt.length))return;const Ct=Dt[0],On=new FileReader;On.onload=async Fn=>{var Pi;const di=On.result;await Xt.post("/assets/uploadClip",{projectId:(Pi=a.value)==null?void 0:Pi.id,base64Data:di,name:Ct.name}),window.$message.success($t("workbench.assets.uploadSuccess")),y(h.value)},On.readAsDataURL(Ct)}else bt=="audio"?(o.value=!0,s.value={name:"",describe:"",sex:""}):(S.value=!0,L.value={id:0,name:"",describe:"",remark:"",prompt:""})}const B=le(!1),P=le(""),F=le("1K"),R=le("");function N(bt){R.value=bt===1?$t("workbench.assets.batchGenPrompt"):$t("workbench.assets.batchGenImage"),B.value=!0}function I(){R.value===$t("workbench.assets.batchGenPrompt")?H():R.value===$t("workbench.assets.batchGenImage")&&V()}function W(){const bt=[];return b.value.forEach(Dt=>{var Ct;(Ct=Dt.sonAssets)!=null&&Ct.length&&Dt.sonAssets.forEach(On=>{A.value.includes(On.id)&&bt.push(On)})}),bt}async function H(){var On;const bt=b.value.filter(Fn=>k.value.includes(Fn.id)),Dt=W(),Ct=[...bt,...Dt];if(Ct.length===0){window.$message.warning($t("workbench.assets.selectAtLeastOne"));return}bt.forEach(Fn=>{const di=b.value.find(Pi=>Pi.id===Fn.id);di&&(di.promptState="生成中")}),Dt.forEach(Fn=>{b.value.forEach(di=>{var Ci;const Pi=(Ci=di.sonAssets)==null?void 0:Ci.find(Ir=>Ir.id===Fn.id);Pi&&(Pi.promptState="生成中")})}),k.value=k.value.filter(Fn=>!bt.some(di=>di.id===Fn)),A.value=A.value.filter(Fn=>!Dt.some(di=>di.id===Fn)),B.value=!1;try{await Xt.post("/assetsGenerate/batchPolishAssetsPrompt",{projectId:(On=a.value)==null?void 0:On.id,concurrentCount:n.value.assetsBatchGenereateSize,items:Ct.map(Fn=>({assetsId:Fn.id,type:Fn.type??"props",name:Fn.name,describe:Fn.describe?Fn.describe:$t("workbench.assets.noDescription")}))})}catch{window.$message.error($t("workbench.assets.promptGenFail"))}}async function V(){var Pi;const bt=b.value.filter(Ci=>k.value.includes(Ci.id)),Dt=W(),Ct=[...bt,...Dt];if(Ct.length===0){window.$message.warning($t("workbench.assets.selectAtLeastOne"));return}if(!P.value){window.$message.error($t("workbench.assets.selectModel"));return}if(!F.value){window.$message.error($t("workbench.assets.selectResolution"));return}const On=Ct.filter(Ci=>Ci.prompt?!0:(window.$message.warning($t("workbench.assets.noPromptForImage",{name:Ci.name})),!1));if(On.length===0)return;const Fn=On.filter(Ci=>k.value.includes(Ci.id)),di=On.filter(Ci=>A.value.includes(Ci.id));Fn.forEach(Ci=>{const Ir=b.value.find(Gr=>Gr.id===Ci.id);Ir&&(Ir.state="生成中")}),di.forEach(Ci=>{b.value.forEach(Ir=>{var Sr;const Gr=(Sr=Ir.sonAssets)==null?void 0:Sr.find(Po=>Po.id===Ci.id);Gr&&(Gr.state="生成中")})}),k.value=k.value.filter(Ci=>!On.some(Ir=>Ir.id===Ci)),A.value=A.value.filter(Ci=>!On.some(Ir=>Ir.id===Ci)),B.value=!1;try{await Xt.post("/assetsGenerate/batchGenerateImageAssets",{projectId:(Pi=a.value)==null?void 0:Pi.id,model:P.value,resolution:F.value,concurrentCount:n.value.assetsBatchGenereateSize,items:On.map(Ci=>({id:Ci.id,type:Ci.type??"props",name:Ci.name??$t("workbench.cornerScape.unnamed"),prompt:Ci.prompt||Ci.describe}))})}catch(Ci){window.$message.error($t("workbench.assets.imageGenFail",{name:"",error:Ci.message??""})),On.forEach(Ir=>{const Gr=b.value.find(Sr=>Sr.id===Ir.id);Gr?Gr.state="生成失败":b.value.forEach(Sr=>{var Ti;const Po=(Ti=Sr.sonAssets)==null?void 0:Ti.find(ri=>ri.id===Ir.id);Po&&(Po.state="生成失败")})})}}function Z(){const bt=b.value.filter(Ct=>k.value.includes(Ct.id));if(bt.length===0){window.$message.warning($t("workbench.assets.selectAtLeastOne"));return}const Dt=Kr.confirm({header:$t("workbench.assets.confirmDeleteHeader"),body:$t("workbench.assets.confirmBatchDeleteBody"),confirmBtn:$t("workbench.assets.deleteBtn"),cancelBtn:$t("workbench.assets.cancelBtn"),theme:"warning",onConfirm:async()=>{await Xt.post("/assets/batchDelete",{id:bt.map(Ct=>Ct.id)}),window.$message.success($t("workbench.assets.deleteSuccess")),y(h.value),Dt.destroy()}})}const K=r.multiple?"multiple":"single",X=[{colKey:"row-select",type:K,width:50,align:"center",fixed:"left",disabled:bt=>{var Dt;return p(((Dt=bt.row)==null?void 0:Dt.id)??bt.id)}},{colKey:"src",title:$t("workbench.assets.colPreview"),width:100,align:"center",cell:"previewWithLoading"},{colKey:"name",title:$t("workbench.assets.colName"),width:100,align:"left",ellipsis:!0},{colKey:"prompt",title:$t("workbench.assets.colPrompt"),width:200,align:"left",ellipsis:!0,cell:"prompt"},{colKey:"describe",title:$t("workbench.assets.colDescribe"),width:200,align:"left",ellipsis:!0},{colKey:"remark",title:$t("workbench.assets.colRemark"),minWidth:200,align:"left",ellipsis:!0},{colKey:"startTime",title:$t("workbench.assets.colCreateTime"),width:200,align:"center",cell:"startTime"},{colKey:"operation",title:$t("workbench.assets.colOperation"),width:280,align:"center",fixed:"right",cell:"operation"}],ee=[{colKey:"row-select",type:K,width:50,align:"center",fixed:"left"},{colKey:"src",title:$t("workbench.assets.colPreview"),width:100,align:"center",cell:"previewWithLoading"},{colKey:"name",title:$t("workbench.assets.colName"),width:100,align:"left",ellipsis:!0},{colKey:"prompt",title:$t("workbench.assets.colPrompt"),width:200,align:"left",ellipsis:!0,cell:"prompt"},{colKey:"describe",title:$t("workbench.assets.colDescribe"),width:100,align:"left",ellipsis:!0},{colKey:"remark",title:$t("workbench.assets.colRemark"),minWidth:150,align:"left",ellipsis:!0},{colKey:"operation",title:$t("workbench.assets.colOperation"),width:280,align:"center",fixed:"right",cell:"operation"}],q=[{colKey:"row-select",type:"multiple",width:50,align:"center",fixed:"left"},{colKey:"name",title:$t("workbench.assets.colName"),width:200,align:"left",ellipsis:!0},{colKey:"describe",title:$t("workbench.assets.colDescribe"),width:200,align:"left",ellipsis:!0},{colKey:"remark",title:$t("workbench.assets.colRemark"),minWidth:200,align:"left",ellipsis:!0},{colKey:"startTime",title:$t("workbench.assets.colCreateTime"),width:200,align:"center",cell:"startTime"},{colKey:"operation",title:$t("workbench.assets.colOperation"),width:180,align:"center",fixed:"right",cell:"operation"}],$=[{colKey:"row-select",type:K,width:50,align:"center",fixed:"left"},{colKey:"name",title:$t("workbench.assets.audioName"),width:200,align:"left",ellipsis:!0},{colKey:"sex",title:$t("workbench.assets.sex"),width:200,align:"left",ellipsis:!0},{colKey:"describe",title:$t("workbench.assets.colDescribe"),width:200,align:"left",ellipsis:!0},{colKey:"startTime",title:$t("workbench.assets.colCreateTime"),width:200,align:"center",cell:"startTime"},{colKey:"operation",title:$t("workbench.assets.colOperation"),width:180,align:"center",fixed:"right",cell:"operation"}],oe=[{colKey:"row-select",type:K,width:50,align:"center",fixed:"left"},{colKey:"src",title:$t("workbench.assets.colPreview"),width:100,align:"center",cell:"previewWithLoading"},{colKey:"prompt",title:$t("workbench.assets.audioText"),width:100,align:"left",ellipsis:!0},{colKey:"operation",title:$t("workbench.assets.colOperation"),width:280,align:"center",fixed:"right",cell:"operation"}];function de(bt){const Dt=bt.filter(Ct=>!p(Ct));r.multiple?k.value=Dt:k.value=Dt.length>0?[Dt[Dt.length-1]]:[]}function ke(bt){r.multiple?A.value=bt:A.value=bt.length>0?[bt[bt.length-1]]:[]}function ne(bt){bt.length>3&&(bt=bt.slice(-3)),m.value=bt}function Ae(bt){O.value.page=bt.current,O.value.pageSize=bt.pageSize,C()}const Y=le(!1),re=le({id:void 0,name:"",describe:"",type:"",prompt:"",src:""});function ce(bt){re.value={id:bt.id,name:bt.name,describe:bt.describe,type:bt.type,prompt:bt.prompt,src:bt.src},Y.value=!0}function ie(bt){console.log(bt),bt.type=="audio"?(s.value={...bt},o.value=!0):(L.value={...bt},S.value=!0)}function J(bt){const Dt=Kr.confirm({header:$t("workbench.assets.confirmDeleteHeader"),body:$t("workbench.assets.confirmDeleteBody"),confirmBtn:$t("workbench.assets.deleteBtn"),cancelBtn:$t("workbench.assets.cancelBtn"),theme:"warning",onConfirm:async()=>{try{await Xt.post("/assets/delAssets",{id:bt.id}),window.$message.success($t("workbench.assets.deleteSuccess")),y(h.value),Dt.destroy()}catch(Ct){console.error("删除资产失败:",Ct),window.$message.error($t("workbench.assets.deleteFail")),Dt.destroy()}}})}t({selectedRowKeys:k,selectedSubRowKeys:A,tableData:b});function he(bt){var Ct;if(!bt)return"unknown";const Dt=((Ct=bt.split("?")[0].split(".").pop())==null?void 0:Ct.toLowerCase())??"";return["png","jpg","jpeg","gif","webp","bmp","svg"].includes(Dt)?"image":["mp4","webm","ogg","mov","avi","mkv"].includes(Dt)?"video":["mp3","wav","ogg","aac","flac","m4a"].includes(Dt)?"audio":"unknown"}const pe=le(!1),Le=le(""),Be=le("unknown"),ve=le("");function ue(bt,Dt){bt&&(Le.value=bt,Be.value=he(bt),ve.value=Dt,pe.value=!0)}function be(){pe.value=!1,Le.value=""}function xe(){const bt=[];return b.value.forEach(Dt=>{var Ct;bt.push(Dt),(Ct=Dt.sonAssets)!=null&&Ct.length&&bt.push(...Dt.sonAssets)}),bt}function Qe(bt){var Dt;for(const Ct of b.value){if(Ct.id===bt)return Ct;const On=(Dt=Ct.sonAssets)==null?void 0:Dt.find(Fn=>Fn.id===bt);if(On)return On}}const Fe=G(()=>xe().filter(bt=>bt.promptState=="生成中")),Ge=G(()=>xe().filter(bt=>bt.state==="生成中"));let Xe=null,$e=null;async function vt(){if(Fe.value.length===0)return;const bt=Fe.value.map(Dt=>Dt.id);try{const{data:Dt}=await Xt.post("/assets/pollingPromptAssets",{ids:bt});Array.isArray(Dt)&&Dt.length&&(Dt.forEach(Ct=>{const On=Qe(Ct.id);On&&(On.promptState=Ct.promptState,Ct.prompt!==void 0&&(On.prompt=Ct.prompt))}),y(h.value))}catch(Dt){console.error("轮询提示词状态失败:",Dt)}}async function mt(){if(Ge.value.length===0)return;const bt=Ge.value.map(Dt=>Dt.id);try{const{data:Dt}=await Xt.post("/assets/pollingImageAssets",{ids:bt});Array.isArray(Dt)&&Dt.length&&(Dt.forEach(Ct=>{const On=Qe(Ct.id);On&&(On.state=Ct.state,Ct.filePath!==void 0&&(On.filePath=Ct.filePath),Ct.src!==void 0&&(On.src=Ct.src),!Ct.src&&Ct.filePath&&Ct.state!=="生成中"&&(On.src=Ct.filePath))}),y(h.value))}catch(Dt){console.error("轮询图片生成状态失败:",Dt)}}function rt(){Xe||(Xe=setInterval(async()=>{if(Fe.value.length===0){yt();return}await vt()},3e3))}function yt(){Xe&&(clearInterval(Xe),Xe=null)}function Rt(){$e||($e=setInterval(async()=>{if(Ge.value.length===0){Ke();return}await mt()},3e3))}function Ke(){$e&&(clearInterval($e),$e=null)}ut(Fe,bt=>{bt.length>0?rt():yt()}),ut(Ge,bt=>{bt.length>0?Rt():Ke()});async function ze(bt,Dt){const{data:Ct}=await Xt.post("/common/getBigImage",{url:bt.src});bt.src=Ct,_n(()=>{Dt()})}return(bt,Dt)=>{const Ct=NO,On=fi,Fn=wg,di=Bv,Pi=Rc,Ci=Mc,Ir=iC,Gr=dn("i-magic"),Sr=y6,Po=zz,Ti=Vz,ri=Aa,or=HA,Rs=UO,Es=Em,dt=yg;return we(),Re("div",lKo,[ae("div",cKo,[c(Ti,{modelValue:ge(h),"onUpdate:modelValue":Dt[3]||(Dt[3]=lt=>yn(h)?h.value=lt:null),onChange:x},{default:me(()=>[(we(!0),Re(Yt,null,hi(ge(d),(lt,Ht)=>(we(),Ot(Po,{key:Ht,value:lt.value},{label:me(()=>[ae("div",dKo,[(we(),Ot(Ud(lt.icon),{theme:"outline",size:"20"})),ae("span",null,Ee(lt.name),1)])]),default:me(()=>[ae("div",uKo,[ae("div",hKo,[c(di,null,{default:me(()=>[c(On,{theme:"primary",onClick:Tt=>M(lt.value)},{icon:me(()=>[c(Ct,{name:"add"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.addPrefix"))+Ee(lt.name),1)]),_:2},1032,["onClick"]),c(Fn,{placement:"bottom"},{content:me(()=>[ae("div",AKo,[ae("div",fKo,[ae("span",{onClick:Dt[0]||(Dt[0]=Tt=>N(1))},Ee(bt.$t("workbench.assets.generatePrompt")),1)]),ae("div",gKo,[ae("span",{onClick:Dt[1]||(Dt[1]=Tt=>N(2))},Ee(bt.$t("workbench.assets.generateImage")),1)])])]),default:me(()=>[ge(h)!="clip"&&ge(h)!="audio"?(we(),Ot(On,{key:0,theme:"primary"},{icon:me(()=>[c(Ct,{name:"indent-left"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.batchGenerate")),1)]),_:1})):Ft("",!0)]),_:1}),c(On,{theme:"default",variant:"outline",onClick:Z},{icon:me(()=>[c(Ct,{name:"delete"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.batchDelete")),1)]),_:1})]),_:2},1024),ae("div",mKo,[c(Pi,{modelValue:ge(f),"onUpdate:modelValue":Dt[2]||(Dt[2]=Tt=>yn(f)?f.value=Tt:null),placeholder:bt.$t("workbench.assets.searchPlaceholder"),clearable:"",style:{width:"260px"}},null,8,["modelValue","placeholder"]),c(On,{style:{"margin-left":"5px"},onClick:w},{icon:me(()=>[c(Ct,{name:"search"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.search")),1)]),_:1})])]),ae("div",kKo,[["role","tool","scene"].includes(ge(h))?(we(),Ot(Sr,{key:0,columns:X,data:ge(b),"selected-row-keys":ge(k),"expanded-row-keys":ge(m),"row-key":"id",hover:"",height:"calc(100vh - 300px)",stripe:"",size:"small",pagination:ge(O),loading:ge(v),"lazy-load":"","table-layout":"fixed","select-on-row-click":!1,onSelectChange:de,onExpandChange:ne,onPageChange:Ae},{expandedRow:me(({row:Tt})=>[ae("div",vKo,[c(Sr,{columns:ee,data:Tt.sonAssets||[],"selected-row-keys":ge(A),"row-key":"id",hover:"",size:"small","table-layout":"fixed","select-on-row-click":!1,onSelectChange:ke},{previewWithLoading:me(({row:kn})=>[ae("div",pKo,[kn.state==="生成中"?(we(),Re("div",bKo,[c(Ci,{size:"small"}),ae("span",OKo,Ee(bt.$t("workbench.assets.generating")),1)])):(we(),Ot(Ir,{key:1,images:[kn.src],closeOnEscKeydown:!0,closeOnOverlay:!0},{trigger:me(({open:qt})=>[ae("div",{class:"imageTrigger",onClick:oo=>kn.src&&ze(kn,qt())},[kn.src?(we(),Re("img",{key:0,src:kn.src,alt:kn.name,class:"previewImage"},null,8,yKo)):(we(),Re("div",CKo,[c(Ct,{name:"image",size:"24px"})])),kn.src?(we(),Re("div",xKo,[c(Ct,{name:"browse",size:"20px"}),ae("span",LKo,Ee(bt.$t("workbench.assets.preview")),1)])):Ft("",!0)],8,wKo)]),_:2},1032,["images"]))])]),prompt:me(({row:kn})=>[ae("div",SKo,[kn.promptState==="生成中"?(we(),Ot(Ci,{key:0,size:"small",style:{"margin-right":"4px"}})):Ft("",!0),ae("span",{class:no({"generating-text":kn.promptState==="生成中"})},Ee(kn.prompt),3)])]),operation:me(({row:kn})=>[c(di,{size:0},{default:me(()=>[c(On,{theme:"primary",variant:"text",disabled:p(kn.id),onClick:qt=>ce(kn)},{icon:me(()=>[c(Gr,{size:18})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.generate")),1)]),_:1},8,["disabled","onClick"]),c(On,{theme:"primary",variant:"text",onClick:qt=>ie(kn)},{icon:me(()=>[c(Ct,{name:"edit"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.edit")),1)]),_:1},8,["onClick"]),c(On,{theme:"danger",variant:"text",disabled:p(kn.id),onClick:qt=>J(kn)},{icon:me(()=>[c(Ct,{name:"delete"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.delete")),1)]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:1},8,["data","selected-row-keys"])])]),preview:me(({row:Tt})=>[ae("div",TKo,[c(Ir,{images:[Tt.src],closeOnEscKeydown:!0,closeOnOverlay:!0},{trigger:me(({open:kn})=>[ae("div",{class:"imageTrigger",onClick:qt=>Tt.src&&ze(Tt,kn())},[Tt.src?(we(),Re("img",{key:0,src:Tt.src,alt:Tt.name,class:"previewImage"},null,8,DKo)):(we(),Re("div",QKo,[c(Ct,{name:"image",size:"24px"})])),Tt.src?(we(),Re("div",BKo,[c(Ct,{name:"browse",size:"20px"}),ae("span",FKo,Ee(bt.$t("workbench.assets.preview")),1)])):Ft("",!0)],8,EKo)]),_:2},1032,["images"])])]),prompt:me(({row:Tt})=>[ae("div",PKo,[Tt.promptState==="生成中"?(we(),Ot(Ci,{key:0,size:"small",style:{"margin-right":"4px"}})):Ft("",!0),ae("span",{class:no({"generating-text":Tt.promptState==="生成中"})},Ee(Tt.prompt),3)])]),previewWithLoading:me(({row:Tt})=>[ae("div",MKo,[Tt.state==="生成中"?(we(),Re("div",RKo,[c(Ci,{size:"small"}),ae("span",IKo,Ee(bt.$t("workbench.assets.generating")),1)])):(we(),Ot(Ir,{key:1,images:[Tt.src],closeOnEscKeydown:!0,closeOnOverlay:!0},{trigger:me(({open:kn})=>[ae("div",{class:"imageTrigger",onClick:qt=>Tt.src&&ze(Tt,kn())},[Tt.src?(we(),Re("img",{key:0,src:Tt.src,alt:Tt.name,class:"previewImage"},null,8,UKo)):(we(),Re("div",jKo,[c(Ct,{name:"image",size:"24px"})])),Tt.src?(we(),Re("div",WKo,[c(Ct,{name:"browse",size:"20px"}),ae("span",HKo,Ee(bt.$t("workbench.assets.preview")),1)])):Ft("",!0)],8,NKo)]),_:2},1032,["images"]))])]),startTime:me(({row:Tt})=>[ae("span",null,Ee(ge(Z5)(Tt.startTime).format("YYYY-MM-DD HH:mm:ss")),1)]),operation:me(({row:Tt})=>[c(di,{size:0},{default:me(()=>[c(On,{theme:"primary",variant:"text",disabled:p(Tt.id),onClick:kn=>ce(Tt)},{icon:me(()=>[c(Gr,{size:18})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.generate")),1)]),_:1},8,["disabled","onClick"]),c(On,{theme:"primary",variant:"text",onClick:kn=>ie(Tt)},{icon:me(()=>[c(Ct,{name:"edit"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.edit")),1)]),_:1},8,["onClick"]),c(On,{theme:"danger",variant:"text",disabled:p(Tt.id),onClick:kn=>J(Tt)},{icon:me(()=>[c(Ct,{name:"delete"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.delete")),1)]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:1},8,["data","selected-row-keys","expanded-row-keys","pagination","loading"])):Ft("",!0),ge(h)=="clip"?(we(),Ot(Sr,{key:1,columns:q,data:ge(b),"selected-row-keys":ge(k),"expanded-row-keys":ge(m),"row-key":"id",hover:"",stripe:"",size:"small",pagination:ge(O),loading:ge(v),"lazy-load":"","table-layout":"fixed",onSelectChange:de,onExpandChange:ne,onPageChange:Ae},{preview:me(({row:Tt})=>[ae("div",VKo,[he(Tt.src)==="image"?(we(),Ot(Ir,{key:0,images:[Tt.src],closeOnEscKeydown:!0,closeOnOverlay:!0},{trigger:me(({open:kn})=>[ae("div",{class:"mediaTrigger",onClick:qt=>Tt.src&&kn()},[ae("img",{src:Tt.src,alt:Tt.name},null,8,ZKo),ae("div",YKo,[c(Ct,{name:"browse",size:"20px"}),ae("span",XKo,Ee(bt.$t("workbench.assets.preview")),1)])],8,zKo)]),_:2},1032,["images"])):he(Tt.src)==="video"?(we(),Re("div",{key:1,class:"mediaTrigger videoThumb",onClick:kn=>ue(Tt.src,Tt.name)},[ae("video",{src:Tt.src,class:"thumbVideo"},null,8,GKo),ae("div",KKo,[c(Ct,{name:"play-circle",size:"24px"}),ae("span",JKo,Ee(bt.$t("workbench.assets.play")),1)])],8,qKo)):he(Tt.src)==="audio"?(we(),Re("div",{key:2,class:"mediaTrigger audioThumb",onClick:kn=>ue(Tt.src,Tt.name)},[c(Ct,{name:"music",size:"28px"}),ae("div",$Ko,[c(Ct,{name:"play-circle",size:"24px"}),ae("span",eJo,Ee(bt.$t("workbench.assets.play")),1)])],8,_Ko)):(we(),Re("div",tJo,[c(Ct,{name:"image",size:"24px"})]))])]),startTime:me(({row:Tt})=>[ae("span",null,Ee(ge(Z5)(Tt.startTime).format("YYYY-MM-DD HH:mm:ss")),1)]),operation:me(({row:Tt})=>[c(di,{size:0},{default:me(()=>[c(On,{theme:"primary",variant:"text",onClick:kn=>ie(Tt)},{icon:me(()=>[c(Ct,{name:"edit"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.edit")),1)]),_:1},8,["onClick"]),c(On,{theme:"danger",variant:"text",onClick:kn=>J(Tt)},{icon:me(()=>[c(Ct,{name:"delete"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)]),_:1},8,["data","selected-row-keys","expanded-row-keys","pagination","loading"])):Ft("",!0),ge(h)=="audio"?(we(),Ot(Sr,{key:2,columns:$,data:ge(b),"selected-row-keys":ge(k),"expanded-row-keys":ge(m),"row-key":"id",hover:"",stripe:"",size:"small",pagination:ge(O),loading:ge(v),"lazy-load":"","table-layout":"fixed",onSelectChange:de,onExpandChange:ne,onPageChange:Ae},Sj({preview:me(({row:Tt})=>[ae("div",lJo,[ae("div",{class:"mediaTrigger audioThumb",onClick:kn=>ue(Tt.src,Tt.name)},[c(Ct,{name:"music",size:"28px"}),ae("div",dJo,[c(Ct,{name:"play-circle",size:"24px"}),ae("span",uJo,Ee(bt.$t("workbench.assets.play")),1)])],8,cJo)])]),startTime:me(({row:Tt})=>[ae("span",null,Ee(ge(Z5)(Tt.startTime).format("YYYY-MM-DD HH:mm:ss")),1)]),operation:me(({row:Tt})=>[c(di,{size:0},{default:me(()=>[c(On,{theme:"primary",variant:"text",onClick:kn=>ie(Tt)},{icon:me(()=>[c(Ct,{name:"edit"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.edit")),1)]),_:1},8,["onClick"]),c(On,{theme:"danger",variant:"text",onClick:kn=>J(Tt)},{icon:me(()=>[c(Ct,{name:"delete"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)]),_:2},[e.selectorMode?void 0:{name:"expandedRow",fn:me(({row:Tt})=>[ae("div",nJo,[c(Sr,{columns:oe,data:Tt.sonAssets||[],"selected-row-keys":ge(A),"row-key":"id",hover:"",size:"small","table-layout":"fixed",stripe:"","select-on-row-click":!1,onSelectChange:ke},{previewWithLoading:me(({row:kn})=>[ae("div",iJo,[ae("div",{class:"mediaTrigger audioThumb",onClick:qt=>ue(kn.src,kn.name)},[c(Ct,{name:"music",size:"28px"}),ae("div",oJo,[c(Ct,{name:"play-circle",size:"24px"}),ae("span",sJo,Ee(bt.$t("workbench.assets.play")),1)])],8,rJo)])]),prompt:me(({row:kn})=>[ae("div",aJo,[ae("span",null,Ee(kn.prompt),1)])]),operation:me(({row:kn})=>[c(di,{size:0},{default:me(()=>[c(On,{theme:"danger",variant:"text",disabled:p(kn.id),onClick:qt=>J(kn)},{icon:me(()=>[c(Ct,{name:"delete"})]),default:me(()=>[ft(" "+Ee(bt.$t("workbench.assets.delete")),1)]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:1},8,["data","selected-row-keys"])])]),key:"0"}]),1032,["data","selected-row-keys","expanded-row-keys","pagination","loading"])):Ft("",!0)])])]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),c(bGo,{modelValue:ge(S),"onUpdate:modelValue":Dt[4]||(Dt[4]=lt=>yn(S)?S.value=lt:null),type:ge(h),title:g[ge(h)],formData:ge(L),onGetFilteredData:Dt[5]||(Dt[5]=lt=>y(ge(h)))},null,8,["modelValue","type","title","formData"]),c(aKo,{modelValue:ge(Y),"onUpdate:modelValue":Dt[6]||(Dt[6]=lt=>yn(Y)?Y.value=lt:null),onUpdate:C,formData:ge(re)},null,8,["modelValue","formData"]),ge(o)?(we(),Ot(EGo,{key:0,modelValue:ge(o),"onUpdate:modelValue":Dt[7]||(Dt[7]=lt=>yn(o)?o.value=lt:null),formData:ge(s),onGetFilteredData:Dt[8]||(Dt[8]=lt=>y(ge(h)))},null,8,["modelValue","formData"])):Ft("",!0),c(ri,{visible:ge(pe),"onUpdate:visible":Dt[9]||(Dt[9]=lt=>yn(pe)?pe.value=lt:null),header:ge(ve)||bt.$t("workbench.assets.mediaPreview"),footer:!1,width:"600px",placement:"center",destroyOnClose:"",onClose:be},{default:me(()=>[ae("div",hJo,[ge(Be)==="video"?(we(),Re("video",{key:0,src:ge(Le),controls:"",autoplay:"",class:"mediaPlayer videoPlayer"},null,8,AJo)):ge(Be)==="audio"?(we(),Re("div",fJo,[ae("div",gJo,[c(Ct,{name:"music",size:"64px"})]),ae("p",mJo,Ee(ge(ve)),1),ae("audio",{src:ge(Le),controls:"",autoplay:"",class:"mediaPlayer audioPlayer"},null,8,kJo)])):Ft("",!0)])]),_:1},8,["visible","header"]),c(ri,{visible:ge(B),"onUpdate:visible":Dt[12]||(Dt[12]=lt=>yn(B)?B.value=lt:null),header:ge(R),width:"600px",top:"10vh",placement:"center",destroyOnClose:"",onConfirm:I,onClose:Dt[13]||(Dt[13]=lt=>B.value=!1)},{default:me(()=>[ae("div",vJo,[ae("span",null,Ee(bt.$t("workbench.assets.confirmBatch",{type:ge(R)})),1),c(dt,{labelAlign:"top"},{default:me(()=>[ge(R)===bt.$t("workbench.assets.batchGenImage")?(we(),Ot(or,{key:0,label:bt.$t("workbench.assets.model"),name:"selectValue"},{default:me(()=>[c(W8,{modelValue:ge(P),"onUpdate:modelValue":Dt[10]||(Dt[10]=lt=>yn(P)?P.value=lt:null),type:"image"},null,8,["modelValue"])]),_:1},8,["label"])):Ft("",!0),ge(R)===bt.$t("workbench.assets.batchGenImage")?(we(),Ot(or,{key:1,label:bt.$t("workbench.assets.resolution"),name:"resolution"},{default:me(()=>[c(Es,{modelValue:ge(F),"onUpdate:modelValue":Dt[11]||(Dt[11]=lt=>yn(F)?F.value=lt:null),placeholder:bt.$t("workbench.assets.resolutionPh")},{default:me(()=>[c(Rs,{key:"1K",label:"1K",value:"1K"}),c(Rs,{key:"2K",label:"2K",value:"2K"}),c(Rs,{key:"4K",label:"4K",value:"4K"})]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"])):Ft("",!0)]),_:1})])]),_:1},8,["visible","header"])])}}}),MWn=fr(pJo,[["__scopeId","data-v-ab2ca0c1"]]),bJo=Object.freeze(Object.defineProperty({__proto__:null,default:MWn},Symbol.toStringTag,{value:"Module"}));function IZ(e={}){const{types:t,clipMediaTypes:n,multiple:r=!0,title:o=window.$t("common.selectAssets"),selectorMode:s=!1}=e;return new Promise(a=>{const l=document.createElement("div");document.body.appendChild(l);const d=le(!1),u=le();let h=!1;const f=()=>{E8(null,l),l.remove()},g=A=>{h||(h=!0,d.value=!1,k(),a(A))},k=()=>{var v,p;const A=Qn(Aa,{visible:d.value,header:o,width:"80%",top:"5vh",destroyOnClose:!0,confirmBtn:window.$t("common.confirm"),cancelBtn:window.$t("common.cancel"),onConfirm:()=>{var x,L,S;const b=((x=u.value)==null?void 0:x.selectedRowKeys)||[],O=((L=u.value)==null?void 0:L.selectedSubRowKeys)||[],w=((S=u.value)==null?void 0:S.tableData)||[],y=w.filter(E=>b.includes(E.id)),C=[];w.forEach(E=>{var Q;(Q=E.sonAssets)==null||Q.forEach(T=>{O.includes(T.id)&&C.push(T)})}),g([...y,...C])},onClose:()=>g([]),onCancel:()=>g([]),onClosed:()=>f()},{default:()=>Qn("div",{style:"height: 72vh; overflow: auto;"},[Qn(MWn,{ref:u,selectorMode:s,allowedTypes:t,clipMediaTypes:n,multiple:r})])}),m=(p=(v=document.querySelector("#app"))==null?void 0:v.__vue_app__)==null?void 0:p._context;m&&(A.appContext=m),E8(A,l)};k(),_n(()=>{d.value=!0,k()})})}const OJo={class:"details"},wJo={class:"fc",style:{width:"100%"}},yJo={class:"scriptLen"},CJo={class:"assets-section"},xJo={class:"assets-header"},LJo={key:0,class:"assets-list"},SJo={key:1,class:"assets-empty"},TJo={style:{"margin-top":"16px","text-align":"right"}},EJo=qe({__name:"editScript",props:Vs({item:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:Vs(["searchScripts"],["update:modelValue"]),setup(e,{emit:t}){const{otherSetting:n}=Br(qs()),r=Pl(e,"modelValue"),o=e,s=le([]);ut(()=>{var h;return(h=o.item)==null?void 0:h.relatedAssets},h=>{s.value=(h==null?void 0:h.map(f=>({id:f.id,name:f.name})))??[]},{immediate:!0});async function a(){const h=await IZ({title:$t("workbench.script.edit.msg.selectAssetsTitle"),types:["role","tool","scene"]});if(h.length){const f=new Set(s.value.map(g=>g.id));for(const g of h)f.has(g.id)||s.value.push({id:g.id,name:g.name})}}function l(h){s.value=s.value.filter(f=>f.id!==h)}const d=t;async function u(){try{await Xt.post("/script/updateScript",{id:o.item.id,name:o.item.name,content:o.item.content,assets:s.value.map(h=>h.id)}),d("searchScripts"),r.value=!1,window.$message.success($t("workbench.script.edit.msg.updateSuccess"))}catch(h){window.$message.error((h==null?void 0:h.message)??$t("workbench.script.edit.msg.updateFailed"))}finally{}}return(h,f)=>{const g=F3i,k=Rc,A=HA,m=RA,v=dn("i-plus"),p=fi,b=Gd,O=yg,w=Aa;return we(),Re("div",OJo,[c(w,{footer:!1,visible:r.value,"onUpdate:visible":f[3]||(f[3]=y=>r.value=y),width:"60vw",top:"5vh",onConfirm:u},{header:me(()=>[c(g,{level:"h4",style:{margin:"0"}},{default:me(()=>[ft(Ee(h.$t("workbench.script.edit.title")),1)]),_:1})]),default:me(()=>[c(O,{data:o.item,"label-align":"top",class:"detailsForm"},{default:me(()=>[c(A,{label:h.$t("workbench.script.edit.scriptName"),name:"name"},{default:me(()=>[c(k,{modelValue:o.item.name,"onUpdate:modelValue":f[0]||(f[0]=y=>o.item.name=y),maxlength:10,placeholder:h.$t("workbench.script.edit.scriptNamePh")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),c(A,{label:h.$t("workbench.script.edit.scriptContent"),name:"content"},{default:me(()=>[ae("div",wJo,[c(m,{modelValue:o.item.content,"onUpdate:modelValue":f[1]||(f[1]=y=>o.item.content=y),placeholder:h.$t("workbench.script.edit.scriptContentPh"),autosize:{minRows:20,maxRows:20}},null,8,["modelValue","placeholder"]),ae("div",yJo,Ee(o.item.content.length)+"/"+Ee(ge(n).scriptEpisodeLength),1)])]),_:1},8,["label"]),c(A,{label:h.$t("workbench.script.edit.relatedAssets"),name:"assets"},{default:me(()=>[ae("div",CJo,[ae("div",xJo,[c(p,{size:"small",theme:"primary",variant:"outline",onClick:a},{icon:me(()=>[c(v)]),default:me(()=>[ft(" "+Ee(h.$t("workbench.script.edit.selectAssets")),1)]),_:1})]),ge(s).length?(we(),Re("div",LJo,[(we(!0),Re(Yt,null,hi(ge(s),y=>(we(),Ot(b,{key:y.id,closable:"",variant:"light-outline",onClose:C=>l(y.id)},{default:me(()=>[ft(Ee(y.name),1)]),_:2},1032,["onClose"]))),128))])):(we(),Re("div",SJo,Ee(h.$t("workbench.script.edit.noAssets")),1))])]),_:1},8,["label"])]),_:1},8,["data"]),ae("div",TJo,[c(p,{variant:"outline",onClick:f[2]||(f[2]=y=>r.value=!1)},{default:me(()=>[ft(Ee(h.$t("workbench.novel.import.prevStep")),1)]),_:1}),c(p,{theme:"primary",style:{"margin-left":"10px"},disabled:o.item.content.length>ge(n).scriptEpisodeLength,onClick:u},{default:me(()=>[...f[4]||(f[4]=[ft(" 保存 ",-1)])]),_:1},8,["disabled"])])]),_:1},8,["visible"])])}}}),DJo=fr(EJo,[["__scopeId","data-v-201a7fd3"]]),QJo={class:"addScript"},BJo={class:"data"},FJo={class:"section name"},PJo={class:"section-label"},MJo={class:"section upload"},RJo={class:"section-label"},IJo={class:"dragIcon"},NJo={class:"upload-text"},UJo={class:"upload-hint"},jJo={class:"section content"},WJo={class:"section-label"},HJo={class:"scriptLen"},VJo={class:"section assets-section"},zJo={class:"assets-header"},ZJo={class:"section-label"},YJo={key:0,class:"assets-list"},XJo={key:1,class:"assets-empty"},qJo={class:"dialog-footer"},GJo=qe({__name:"addScript",props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:Vs(["searchScripts"],["update:modelValue"]),setup(e,{emit:t}){const{otherSetting:n}=Br(qs()),{project:r}=Br(Ad()),o=Pl(e,"modelValue"),s=le(null),a=le(""),l=le([]),d=le(""),u=le(!1);function h(){var C;(C=s.value)==null||C.triggerUpload()}async function f(C){const x=await C.arrayBuffer();return C.type==="text/plain"?new TextDecoder().decode(x):(await T2.extractRawText({arrayBuffer:x})).value}async function g(C){const x=C.raw;if(!x)return window.$message.error($t("workbench.script.add.msg.fileReadFailed")),!1;const L=["text/plain","application/vnd.openxmlformats-officedocument.wordprocessingml.document"];if(x.type==="application/msword")return window.$message.warning($t("workbench.script.add.msg.docNotSupported")),l.value=[],!1;if(!L.includes(x.type))return window.$message.error($t("workbench.script.add.msg.unsupportedType")),l.value=[],!1;if(x.size>10*1024*1024)return window.$message.error($t("workbench.script.add.msg.fileTooLarge")),l.value=[],!1;const S=Lc({fullscreen:!0,attach:"body",text:$t("workbench.script.add.msg.parsing")});try{a.value=await f(x),d.value=a.value}catch(E){console.error("文件解析失败:",E),window.$message.error($t("workbench.script.add.msg.parseFailed")),l.value=[]}finally{S.hide()}return!1}async function k(C){var L;const x=(L=C.dataTransfer)==null?void 0:L.files;if(x&&x.length>0){l.value=[];const S=x[0];await g({raw:S})}}const A=le([]);async function m(){const C=await IZ({title:$t("workbench.script.add.msg.selectAssetsTitle"),types:["role","tool","scene"]});if(C.length){const x=new Set(A.value.map(L=>L.id));for(const L of C)x.has(L.id)||A.value.push({id:L.id,name:L.name})}}function v(C){A.value=A.value.filter(x=>x.id!==C)}function p(){o.value=!1,d.value="",a.value="",l.value=[],A.value=[]}function b(){d.value="",a.value="",l.value=[],A.value=[],o.value=!1}const O=t;async function w(){var C;if(!d.value.trim()){window.$message.warning($t("workbench.script.add.msg.enterContent"));return}if(!y.value.trim()){window.$message.warning($t("workbench.script.add.msg.enterName"));return}u.value=!0;try{await Xt.post("/script/addScript",{name:y.value,content:d.value,projectId:(C=r.value)==null?void 0:C.id,assets:A.value.map(x=>x.id)}),window.$message.success($t("workbench.script.add.msg.addSuccess")),b(),O("searchScripts")}catch(x){console.error("添加剧本失败:",x),window.$message.error(x.message??$t("workbench.script.add.msg.addFailed"))}finally{u.value=!1}}const y=le("");return(C,x)=>{const L=Rc,S=lie,E=dn("i-upload-one"),Q=RA,T=dn("i-plus"),M=fi,B=Gd,P=Aa;return we(),Re("div",QJo,[c(P,{visible:o.value,"onUpdate:visible":x[4]||(x[4]=F=>o.value=F),width:"60vw",top:"5vh",header:C.$t("workbench.script.add.title"),closable:!1,maskClosable:!1},{footer:me(()=>[ae("div",qJo,[c(M,{theme:"default",onClick:p},{default:me(()=>[ft(Ee(C.$t("workbench.script.add.cancel")),1)]),_:1}),c(M,{theme:"primary",loading:ge(u),disabled:ge(d).length>ge(n).scriptEpisodeLength,onClick:w},{default:me(()=>[ft(Ee(C.$t("workbench.script.add.confirm")),1)]),_:1},8,["loading","disabled"])])]),default:me(()=>[ae("div",BJo,[ae("div",FJo,[ae("span",PJo,Ee(C.$t("workbench.script.add.scriptName")),1),c(L,{modelValue:ge(y),"onUpdate:modelValue":x[0]||(x[0]=F=>yn(y)?y.value=F:null),placeholder:C.$t("workbench.script.add.scriptNamePh")},null,8,["modelValue","placeholder"])]),ae("div",MJo,[ae("span",RJo,Ee(C.$t("workbench.script.add.uploadFile")),1),ae("div",{class:"upload-area",onClick:h,onDragover:x[2]||(x[2]=Mi(()=>{},["prevent"])),onDrop:Mi(k,["prevent"])},[c(S,{ref_key:"uploadRef",ref:s,modelValue:ge(l),"onUpdate:modelValue":x[1]||(x[1]=F=>yn(l)?l.value=F:null),theme:"file",multiple:!1,max:1,"before-upload":g,style:{display:"none"}},null,8,["modelValue"]),ae("div",IJo,[c(E,{theme:"outline",size:"32",fill:"var(--td-brand-color)"})]),ae("p",NJo,Ee(C.$t("workbench.script.add.dragUpload")),1),ae("p",UJo,Ee(C.$t("workbench.script.add.uploadHint")),1)],32)]),ae("div",jJo,[ae("span",WJo,Ee(C.$t("workbench.script.add.scriptContent")),1),c(Q,{modelValue:ge(d),"onUpdate:modelValue":x[3]||(x[3]=F=>yn(d)?d.value=F:null),placeholder:C.$t("workbench.script.add.scriptContentPh"),name:"description",autosize:{minRows:12,maxRows:12}},null,8,["modelValue","placeholder"]),ae("div",HJo,Ee(ge(d).length)+"/"+Ee(ge(n).scriptEpisodeLength),1)]),ae("div",VJo,[ae("div",zJo,[ae("span",ZJo,Ee(C.$t("workbench.script.add.relatedAssets")),1),c(M,{size:"small",theme:"primary",variant:"outline",onClick:m},{icon:me(()=>[c(T)]),default:me(()=>[ft(" "+Ee(C.$t("workbench.script.add.selectAssets")),1)]),_:1})]),ge(A).length?(we(),Re("div",YJo,[(we(!0),Re(Yt,null,hi(ge(A),F=>(we(),Ot(B,{key:F.id,closable:"",variant:"light-outline",onClose:R=>v(F.id)},{default:me(()=>[ft(Ee(F.name),1)]),_:2},1032,["onClose"]))),128))])):(we(),Re("div",XJo,Ee(C.$t("workbench.script.add.noAssets")),1))])])]),_:1},8,["visible","header"])])}}}),KJo=fr(GJo,[["__scopeId","data-v-5acadc25"]]),JJo=/第\s*([0-90-9零一二三四五六七八九十百千万]+)\s*集\s*([^\n\r]*)/g,rTe={零:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9},$9t={十:10,百:100,千:1e3};function _Jo(e){if(/^\d+$/.test(e))return parseInt(e,10);if(/^十[一二三四五六七八九]?$/.test(e))return e.length===1?10:10+rTe[e[1]];let t=0,n=0;for(const r of e)rTe[r]!==void 0?n=rTe[r]:$9t[r]!==void 0&&(n===0&&r==="十"&&(n=1),t+=n*$9t[r],n=0);return t+=n,t}function $Jo(e){const t=e.match(/^\/(.*)\/([ igmuy]*)$/);return t?new RegExp(t[1],t[2].includes("g")?t[2]:t[2]+"g"):new RegExp(e,"g")}function e_o(e,t){var a;let n;const r=t==null?void 0:t.trim();r?n=$Jo(r):n=JJo,n.lastIndex=0;const o=Array.from(e.matchAll(n)),s=[];if(o.length===0&&e.trim()!=="")s.push({index:1,chapter:"",text:e.trim()});else for(let l=0;ll.index-d.index),s}const t_o={class:"purgeNovel"},n_o={class:"data"},i_o={class:"regexRow f ac",style:{"margin-top":"10px",gap:"8px"}},r_o={class:"regexLabel"},o_o={class:"dragIcon"},s_o={class:"uploadText"},a_o={class:"uploadHint"},l_o={class:"formItem"},c_o={class:"label"},d_o={class:"uploadWrap"},u_o={class:"footerInfo f ac jb",style:{"margin-top":"8px"}},h_o={class:"charCount"},A_o={key:0,class:"tips warn"},f_o={style:{"margin-top":"16px","text-align":"right"}},g_o={class:"fc to2Box"},m_o={class:"ellipsisText"},k_o={class:"selectedInfo"},v_o={style:{"margin-top":"16px","text-align":"right"}},p_o=qe({__name:"batchAddScript",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:Vs(["select"],["update:modelValue"]),setup(e,{emit:t}){const{otherSetting:n}=Br(qs()),{project:r}=Br(Ad()),o=Pl(e,"modelValue"),s=le("To1"),a=le(),l=le(""),d=le([]),u=le([]),h=le(!1),f=le(""),g=le(""),k=le(!1);ut(f,Q=>{if(!Q.trim()){g.value="";return}try{const T=Q.match(/^\/(.*)\/([ igmuy]*)$/);new RegExp(T?T[1]:Q),g.value=""}catch{g.value=$t("workbench.script.import.regexInvalid")}});const A=[{colKey:"row-select",type:"multiple",width:60},{colKey:"index",title:$t("workbench.script.import.col.chapter"),width:100},{colKey:"scriptName",title:$t("workbench.script.import.col.scriptName"),width:200,ellipsis:!0},{colKey:"scriptData",title:$t("workbench.script.import.col.scriptData"),ellipsis:!0}],m=G(()=>{if(!l.value)return[];try{return e_o(l.value,f.value||void 0).map(Q=>({index:Q.index,scriptName:Q.chapter,scriptData:Q.text}))}catch(Q){return console.error("解析剧本内容出错:",Q),[]}}),v=G(()=>m.value.filter(Q=>u.value.includes(Q.index))),p=G(()=>v.value.reduce((Q,T)=>Q+T.scriptData.length,0));function b(){var Q;(Q=a.value)==null||Q.triggerUpload()}async function O(Q){var M;const T=(M=Q.dataTransfer)==null?void 0:M.files;T&&T.length>0&&await C({raw:T[0]})}async function w(Q){const T=await Q.arrayBuffer();return Q.type==="text/plain"?new TextDecoder().decode(T):(await T2.extractRawText({arrayBuffer:T})).value}function y(){return Promise.resolve({response:{},status:"success"})}async function C(Q){const T=Q.raw;if(!T)return window.$message.error($t("workbench.novel.import.msg.selectFile")),!1;const M=["text/plain","application/vnd.openxmlformats-officedocument.wordprocessingml.document"];if(T.type==="application/msword")return window.$message.warning($t("workbench.novel.import.msg.docNotSupported")),!1;if(!M.includes(T.type))return window.$message.error($t("workbench.novel.import.msg.unsupportedType")),!1;if(T.size>10*1024*1024)return window.$message.error($t("workbench.novel.import.msg.fileTooLarge")),!1;Lc(!0);try{l.value=await w(T)}catch{window.$message.error($t("workbench.novel.import.msg.parseFailed"))}finally{Lc(!1)}return!1}function x(Q,T){u.value=Q}const L=t;async function S(){var Q;if(h.value=!0,!v.value.length){window.$message.warning($t("workbench.script.import.msg.selectChapters")),h.value=!1;return}try{await Xt.post("/script/batchAddScript",{projectId:(Q=r.value)==null?void 0:Q.id,data:v.value}),L("select"),window.$message.success($t("workbench.script.import.msg.saveSuccess")),o.value=!1}catch(T){window.$message.error(T.message)}finally{h.value=!1}}ut(o,Q=>{Q||(l.value="",d.value=[],u.value=[],s.value="To1",f.value="",g.value="")});async function E(){if(!l.value.trim()){window.$message.warning($t("workbench.script.import.msg.selectChapters"));return}const Q=l.value.slice(0,2e3);k.value=!0;try{const{data:T}=await Xt.post("/script/getAiRegex",{content:Q});T&&(f.value=T)}catch(T){window.$message.error(T.message)}finally{k.value=!1}}return(Q,T)=>{const M=Rc,B=fi,P=lie,F=dn("i-upload-one"),R=JF,N=RA,I=zz,W=Va,H=y6,V=Vz,Z=Aa;return we(),Re("div",t_o,[c(Z,{footer:!1,visible:o.value,"onUpdate:visible":T[6]||(T[6]=K=>o.value=K),header:Q.$t("workbench.script.import.batchTitle"),width:"50%",placement:"center"},{default:me(()=>[ae("div",n_o,[c(V,{value:ge(s),disabled:""},{default:me(()=>[c(I,{value:"To1",label:Q.$t("workbench.novel.import.step1"),style:{height:"680px","overflow-y":"auto"}},{default:me(()=>[ae("div",i_o,[ae("span",r_o,Ee(Q.$t("workbench.script.import.episodeRegex")),1),c(M,{modelValue:ge(f),"onUpdate:modelValue":T[0]||(T[0]=K=>yn(f)?f.value=K:null),placeholder:Q.$t("workbench.script.import.episodeRegexPh"),clearable:"",disabled:ge(k),style:{flex:"1"},status:ge(g)?"error":void 0,tips:ge(g)||void 0},null,8,["modelValue","placeholder","disabled","status","tips"]),c(B,{loading:ge(k),onClick:E},{default:me(()=>[ft(Ee(Q.$t("workbench.script.import.getAiRegex")),1)]),_:1},8,["loading"])]),ae("div",{class:"uploadArea",onClick:b,onDragover:T[2]||(T[2]=Mi(()=>{},["prevent"])),onDrop:Mi(O,["prevent"])},[c(P,{ref_key:"uploadRef",ref:a,modelValue:ge(d),"onUpdate:modelValue":T[1]||(T[1]=K=>yn(d)?d.value=K:null),theme:"file",multiple:!1,max:1,"before-upload":C,"request-method":y,style:{display:"none"}},null,8,["modelValue"]),ae("div",o_o,[c(F,{theme:"outline",size:"32",fill:"var(--td-brand-color)"})]),ae("p",s_o,Ee(Q.$t("workbench.script.add.dragUpload")),1),ae("p",a_o,Ee(Q.$t("workbench.novel.import.uploadHint")),1)],32),c(R,null,{default:me(()=>[ft(Ee(Q.$t("workbench.novel.import.or")),1)]),_:1}),ae("div",l_o,[ae("div",c_o,Ee(Q.$t("workbench.script.import.pasteLabel")),1),ae("div",d_o,[c(N,{modelValue:ge(l),"onUpdate:modelValue":T[3]||(T[3]=K=>yn(l)?l.value=K:null),placeholder:Q.$t("workbench.script.add.scriptContentPh"),autosize:{minRows:10,maxRows:10}},null,8,["modelValue","placeholder"])]),ae("div",u_o,[ae("div",null,[ae("span",h_o,Ee(ge(l).length)+" "+Ee(Q.$t("workbench.novel.import.chars")),1),ge(l).length>0&&ge(l).length<100?(we(),Re("span",A_o,Ee(Q.$t("workbench.novel.import.tooShort")),1)):Ft("",!0)]),ae("span",null,Ee(Q.$t("workbench.script.import.parsedChapters",{count:ge(m).length})),1)])]),ae("div",f_o,[c(B,{theme:"primary",style:{"margin-left":"10px"},disabled:!ge(l)||!ge(m).length,onClick:T[4]||(T[4]=K=>s.value="To2")},{default:me(()=>[ft(Ee(Q.$t("workbench.novel.import.nextStep")),1)]),_:1},8,["disabled"])])]),_:1},8,["label"]),c(I,{value:"To2",label:Q.$t("workbench.novel.import.step2"),style:{height:"680px","overflow-y":"auto"}},{default:me(()=>[ae("div",g_o,[c(H,{ref:"tableRef","row-key":"index",data:ge(m),columns:A,"selected-row-keys":ge(u),hover:"",style:{flex:"1","overflow-y":"auto"},onSelectChange:x},{chapterData:me(({row:K})=>[c(W,{content:K.chapterData,placement:"top"},{default:me(()=>[ae("span",m_o,Ee(K.chapterData),1)]),_:2},1032,["content"])]),_:1},8,["data","selected-row-keys"]),ae("div",k_o,Ee(Q.$t("workbench.novel.import.selectedInfo",{count:ge(p)})),1),ae("div",v_o,[c(B,{variant:"outline",onClick:T[5]||(T[5]=K=>s.value="To1")},{default:me(()=>[ft(Ee(Q.$t("workbench.novel.import.prevStep")),1)]),_:1}),c(B,{theme:"primary",style:{"margin-left":"10px"},disabled:ge(p)>ge(n).scriptEpisodeLength,loading:ge(h),onClick:S},{default:me(()=>[...T[7]||(T[7]=[ft(" 保存 ",-1)])]),_:1},8,["disabled","loading"])])])]),_:1},8,["label"])]),_:1},8,["value"])])]),_:1},8,["visible","header"])])}}}),b_o=fr(p_o,[["__scopeId","data-v-094e2b43"]]),O_o={class:"script"},w_o={class:"actionBar"},y_o={class:"actionBar-left f ac"},C_o={key:0,class:"actionBar-right f ac"},x_o={class:"contentArea"},L_o={key:0,class:"emptyState"},S_o={key:1,class:"scriptsList f w"},T_o=["onClick"],E_o={class:"cardHeader"},D_o={class:"cardTitle"},Q_o={class:"content"},B_o={class:"del"},F_o=qe({__name:"index",setup(e){const{clearScriptCache:t}=w3e(),{otherSetting:n}=Br(qs()),{project:r}=Br(Ad()),o=le([]),s=le(""),a=le(!1),l=le([]),d=le(!1),u=le(!1),h=G(()=>o.value.length>0&&l.value.length===o.value.length);function f(M){const B=l.value.indexOf(M);B===-1?l.value.push(M):l.value.splice(B,1)}function g(M){M?l.value=o.value.map(B=>B.id):l.value=[]}async function k(){var M;try{const B=await Xt.post("/script/getScrptApi",{projectId:(M=r.value)==null?void 0:M.id,name:s.value});o.value=B.data}catch(B){console.error("搜索剧本失败:",B),window.$message.error($t("workbench.script.msg.searchFailed"))}}vn(k);function A(){k()}function m(){a.value=!0}function v(){u.value=!0}async function p(){if(!l.value.length){window.$message.warning($t("workbench.script.msg.selectsExport"));return}try{const M=await Xt.post("/script/exportScript",{id:l.value},{responseType:"blob"}),B=new Blob([M],{type:"application/zip"}),P=URL.createObjectURL(B),F=document.createElement("a");F.href=P,F.download=`script_${new Date().toISOString().slice(0,10)}.zip`,document.body.appendChild(F),F.click(),document.body.removeChild(F),URL.revokeObjectURL(P),window.$message.success($t("workbench.script.msg.exportSuccess"))}catch(M){console.error("导出剧本失败:",M),window.$message.error(M.message??$t("workbench.script.msg.exportFailed"))}}const b=le({id:0,name:"",content:""}),O=le(!1);function w(M){b.value={...M},O.value=!0}async function y(M){const B=Kr.confirm({header:$t("workbench.script.msg.deleteHeader"),body:$t("workbench.script.msg.deleteBody"),confirmBtn:$t("workbench.script.msg.deleteConfirm"),cancelBtn:$t("workbench.script.msg.cancel"),theme:"warning",onConfirm:async()=>{try{await Xt.post("/script/delScript",{ids:[M]}),window.$message.success($t("workbench.script.msg.deleteSuccess")),t(r.value.id,M),k(),B.destroy(),l.value=l.value.filter(P=>P!==M)}catch(P){console.error("删除剧本失败:",P),window.$message.error($t("workbench.script.msg.deleteFailed")),B.destroy()}},onClose:()=>{B.destroy()}})}async function C(){if(!r.value)return window.$message.error($t("workbench.script.msg.projectNotFound"));d.value=!0;try{await Xt.post("/script/extractAssets",{scriptIds:l.value,projectId:r.value.id,groupSize:n.value.assetsBatchGenereateSize}),k(),l.value=[]}catch(M){window.$message.error((M==null?void 0:M.message)||$t("workbench.script.msg.extractFailed"))}finally{d.value=!1}}async function x(){if(!l.value.length){window.$message.warning($t("workbench.script.msg.selectDelScript"));return}const M=new Set(Q.value.map(P=>P.id));if(l.value.some(P=>M.has(P)))return window.$message.error($t("workbench.script.msg.extractingInProgress"));const B=Kr.confirm({header:$t("workbench.script.msg.batchDeleteHeader"),body:$t("workbench.script.msg.batchDeleteBody",{count:l.value.length}),confirmBtn:$t("workbench.script.msg.deleteConfirm"),cancelBtn:$t("workbench.script.msg.cancel"),theme:"warning",onConfirm:async()=>{try{await Xt.post("/script/delScript",{ids:l.value}),window.$message.success($t("workbench.script.msg.batchDeleteSuccess"));for(const P of l.value)t(r.value.id,P);k(),B.destroy()}catch(P){console.error("删除剧本失败:",P),window.$message.error($t("workbench.script.msg.deleteFailed")),B.destroy()}finally{l.value=[]}},onClose:()=>{B.destroy()}})}let L=null;function S(){L||(L=setInterval(async()=>{if(Q.value.length===0){E();return}await T()},3e3))}function E(){L&&(clearInterval(L),L=null)}const Q=G(()=>o.value.filter(M=>M.extractState==0));async function T(){if(Q.value.length===0)return;const M=Q.value.map(B=>B.id);try{const{data:B}=await Xt.post("/script/pollScriptAssets",{ids:M});B.length&&k()}catch(B){console.error("轮询事件状态失败:",B)}}return ut(()=>Q.value,M=>{M.length>0?S():E()}),Ma(()=>{E()}),(M,B)=>{const P=Rc,F=dn("i-search"),R=fi,N=dn("i-plus"),I=dn("i-export"),W=dn("i-delete"),H=nC,V=pO,Z=Mc,K=Gd,X=Va,ee=yh;return we(),Re("div",O_o,[ae("div",w_o,[ae("div",y_o,[c(P,{placeholder:M.$t("workbench.script.searchPlaceholder"),modelValue:ge(s),"onUpdate:modelValue":B[0]||(B[0]=q=>yn(s)?s.value=q:null),class:"searchInput",clearable:"",style:{width:"300px"}},null,8,["placeholder","modelValue"]),c(R,{theme:"primary",onClick:A},{icon:me(()=>[c(F)]),default:me(()=>[ft(" "+Ee(M.$t("workbench.script.search")),1)]),_:1}),c(R,{theme:"primary",onClick:m},{icon:me(()=>[c(N)]),default:me(()=>[ft(" "+Ee(M.$t("workbench.script.addScript")),1)]),_:1}),c(R,{theme:"primary",onClick:v},{icon:me(()=>[c(N)]),default:me(()=>[ft(" "+Ee(M.$t("workbench.script.batchAddScript")),1)]),_:1})]),ge(o).length?(we(),Re("div",C_o,[c(R,{theme:ge(h)?"default":"primary",variant:"outline",onClick:B[1]||(B[1]=q=>g(!ge(h)))},{default:me(()=>[ft(Ee(ge(h)?M.$t("workbench.script.cancelSelectAll"):M.$t("workbench.script.selectAll")),1)]),_:1},8,["theme"]),c(R,{theme:"primary",onClick:p,disabled:ge(l).length===0},{icon:me(()=>[c(I)]),default:me(()=>[ft(" "+Ee(M.$t("workbench.script.exportScript"))+Ee(ge(l).length?`(${ge(l).length})`:""),1)]),_:1},8,["disabled"]),c(R,{theme:"primary",onClick:C,loading:ge(d),disabled:ge(l).length===0},{icon:me(()=>[c(I)]),default:me(()=>[ft(" "+Ee(M.$t("workbench.script.extractAssets"))+Ee(ge(l).length?`(${ge(l).length})`:""),1)]),_:1},8,["loading","disabled"]),c(R,{theme:"primary",onClick:x,disabled:ge(l).length===0},{icon:me(()=>[c(W)]),default:me(()=>[ft(" "+Ee(M.$t("workbench.script.deleteScript"))+Ee(ge(l).length?`(${ge(l).length})`:""),1)]),_:1},8,["disabled"])])):Ft("",!0)]),ae("div",x_o,[ge(o).length===0?(we(),Re("div",L_o,[c(H)])):(we(),Re("div",S_o,[(we(!0),Re(Yt,null,hi(ge(o),(q,$)=>(we(),Re("div",{key:$,onClick:oe=>w(q),class:"scriptCard"},[c(ee,{shadow:"","hover-shadow":"",style:{width:"400px",cursor:"pointer"}},{header:me(()=>[ae("div",E_o,[ae("span",D_o,Ee(q.name),1),c(V,{checked:ge(l).includes(q.id),onClick:B[2]||(B[2]=Mi(()=>{},["stop"])),onChange:oe=>f(q.id),class:"cardCheckbox"},null,8,["checked","onChange"])])]),default:me(()=>{var oe;return[ae("span",Q_o,Ee(q.content),1),(q==null?void 0:q.extractState)==0?(we(),Ot(Z,{key:0,text:M.$t("workbench.script.msg.extracting"),size:"small"},null,8,["text"])):Ft("",!0),(q==null?void 0:q.extractState)==2?(we(),Ot(Z,{key:1,text:M.$t("workbench.script.msg.waitExtract"),size:"small"},null,8,["text"])):Ft("",!0),(q==null?void 0:q.extractState)==-1?(we(),Ot(X,{key:2,content:q.errorReason,theme:"light"},{default:me(()=>[c(K,{theme:"danger",size:"small"},{default:me(()=>[ft(Ee(M.$t("workbench.script.msg.extractFailed")),1)]),_:1})]),_:1},8,["content"])):(oe=q.relatedAssets)!=null&&oe.length?(we(),Re("div",{key:3,class:"assetTags",onClick:B[3]||(B[3]=Mi(()=>{},["stop"]))},[(we(!0),Re(Yt,null,hi(q.relatedAssets,de=>(we(),Ot(K,{key:de.id,variant:"light-outline",size:"small"},{default:me(()=>[ft(Ee(de.name),1)]),_:2},1024))),128))])):Ft("",!0),ae("div",B_o,[c(W,{theme:"outline",size:"18",onClick:Mi(de=>y(q.id),["stop"]),style:{cursor:"pointer"}},null,8,["onClick"])])]}),_:2},1024)],8,T_o))),128))]))]),c(DJo,{modelValue:ge(O),"onUpdate:modelValue":B[4]||(B[4]=q=>yn(O)?O.value=q:null),item:ge(b),onSearchScripts:k},null,8,["modelValue","item"]),c(KJo,{modelValue:ge(a),"onUpdate:modelValue":B[5]||(B[5]=q=>yn(a)?a.value=q:null),onSearchScripts:k},null,8,["modelValue"]),c(b_o,{modelValue:ge(u),"onUpdate:modelValue":B[6]||(B[6]=q=>yn(u)?u.value=q:null),onSelect:k},null,8,["modelValue"])])}}}),P_o=fr(F_o,[["__scopeId","data-v-7e5a6937"]]),M_o=Object.freeze(Object.defineProperty({__proto__:null,default:P_o},Symbol.toStringTag,{value:"Module"}));function r4(e){"@babel/helpers - typeof";return r4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r4(e)}function R_o(e,t){if(r4(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(r4(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RWn(e){var t=R_o(e,"string");return r4(t)=="symbol"?t:t+""}function k1(e,t,n){return(t=RWn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}/** * @tdesign-vue-next/chat v0.5.1 * (c) 2026 tdesign * @license MIT */var I_o={actions:{type:Function},actionbar:{type:Function},autoScroll:{type:Boolean,default:!0},defaultScrollTo:{type:String,default:"bottom",validator:function(t){return t?["top","bottom"].includes(t):!0}},animation:{type:String,default:"skeleton",validator:function(t){return t?["skeleton","moving","gradient"].includes(t):!0}},avatar:{type:Function},clearHistory:{type:Boolean,default:!0},content:{type:Function},data:{type:Array},datetime:{type:Function},isStreamLoad:Boolean,layout:{type:String,default:"both",validator:function(t){return t?["both","single"].includes(t):!0}},name:{type:Function},reasoning:{type:Function},reverse:{type:Boolean,default:!1},showScrollButton:{type:Boolean,default:!0},textLoading:Boolean,onClear:Function,onScroll:Function};function eSt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n"u"?hwe:window,lde=["moz","webkit"],wW="AnimationFrame",rz=p8["request"+wW],ate=p8["cancel"+wW]||p8["cancelRequest"+wW];for(var lq=0;!rz&&lq1&&h.includes(Boolean)&&h.includes(Function)&&u===""&&!l)return s;if(u===!1||u===null)return;if(u===!0)return cde(t,n,o)||s;if(ii(u))return u(Qn,o);var f=[void 0,""].includes(u);return f&&l?cde(t,n,o):u}if(l)return cde(t,n,o);var g=t.props[T1(n)]||t.props[Gv(n)];return g===!1||g===null?void 0:g===!0?s:ii(g)?g(Qn,o):g}},e$o={classPrefix:"t",animation:{include:["ripple","expand","fade"],exclude:[]},attach:null,calendar:{firstDayOfWeek:1,fillWithZero:!0,controllerConfig:void 0},icon:{},input:{autocomplete:""},dialog:{closeOnEscKeydown:!0,closeOnOverlayClick:!0,confirmBtnTheme:{default:"primary",info:"primary",warning:"primary",danger:"primary",success:"primary"}},message:{},popconfirm:{confirmBtnTheme:{default:"primary",warning:"primary",danger:"primary"}},table:{expandIcon:void 0,sortIcon:void 0,filterIcon:void 0,treeExpandAndFoldIcon:void 0,hideSortTips:!1,size:"medium"},select:{clearIcon:void 0,filterable:!1},drawer:{closeOnEscKeydown:!0,closeOnOverlayClick:!0,size:"small"},tree:{folderIcon:void 0},datePicker:{firstDayOfWeek:1},steps:{checkIcon:void 0,errorIcon:void 0},tag:{closeIcon:void 0},form:{requiredMark:void 0},empty:{titleText:{maintenance:void 0,success:void 0,fail:void 0,empty:void 0,networkError:void 0},image:{maintenance:void 0,success:void 0,fail:void 0,empty:void 0,networkError:void 0}}},t$o={exports:{}},sTe={exports:{}},oSt;function n$o(){return oSt||(oSt=1,function(e,t){(function(n,r){e.exports=r()})(hwe,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",a="second",l="minute",d="hour",u="day",h="week",f="month",g="quarter",k="year",A="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var F=["th","st","nd","rd"],R=P%100;return"["+P+(F[(R-20)%10]||F[R]||F[0])+"]"}},O=function(P,F,R){var N=String(P);return!N||N.length>=F?P:""+Array(F+1-N.length).join(R)+P},w={s:O,z:function(P){var F=-P.utcOffset(),R=Math.abs(F),N=Math.floor(R/60),I=R%60;return(F<=0?"+":"-")+O(N,2,"0")+":"+O(I,2,"0")},m:function B(P,F){if(P.date()1)return B(W[0])}else{var H=P.name;C[H]=P,N=H}return!R&&N&&(y=N),N||!R&&y},E=function(P,F){if(L(P))return P.clone();var R=r4(F)=="object"?F:{};return R.date=P,R.args=arguments,new T(R)},Q=w;Q.l=S,Q.i=L,Q.w=function(B,P){return E(B,{locale:P.$L,utc:P.$u,x:P.$x,$offset:P.$offset})};var T=function(){function B(F){this.$L=S(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[x]=!0}var P=B.prototype;return P.parse=function(F){this.$d=function(R){var N=R.date,I=R.utc;if(N===null)return new Date(NaN);if(Q.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var W=N.match(v);if(W){var H=W[2]-1||0,V=(W[7]||"0").substring(0,3);return I?new Date(Date.UTC(W[1],H,W[3]||1,W[4]||0,W[5]||0,W[6]||0,V)):new Date(W[1],H,W[3]||1,W[4]||0,W[5]||0,W[6]||0,V)}}return new Date(N)}(F),this.init()},P.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},P.$utils=function(){return Q},P.isValid=function(){return this.$d.toString()!==m},P.isSame=function(F,R){var N=E(F);return this.startOf(R)<=N&&N<=this.endOf(R)},P.isAfter=function(F,R){return E(F)1?o-1:0),a=1;a0){var l=s[0],d=s[1];typeof l=="number"?(n=l,d&&r4(d)==="object"?r=d:r.count=n):r4(l)==="object"&&l!==null&&(r=l)}if(t.includes("|")){var u=t.split("|").map(function(A){return A.trim()});if(typeof n=="number"){var h=s$o(n);h0){var k=/\{\s*([\w-]+)\s*\}/g;t=t.replace(k,function(A,m){return Object.prototype.hasOwnProperty.call(r,m)?String(r[m]):A})}return t}return""}var sSt=le();function l$o(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1?arguments[1]:void 0,n=null;ps()?(n=kt(o$o,null),n||(n=sSt)):n=sSt;var r=G(function(){var l;return((l=n)===null||l===void 0?void 0:l.value)||r$o}),o=G(function(){return Object.assign({},r.value[e],t)}),s=G(function(){return r.value.classPrefix}),a=function(d){for(var u=arguments.length,h=new Array(u>1?u-1:0),f=1;f1?r===Array.from(t.popupStack[n]).pop():!0}),k1(this,"getLastZIndex",function(){return t.zIndexStack[t.zIndexStack.length-1]})});new h$o;function Lot(e,t,n,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"value",s=ps(),a=s.emit,l=s.vnode,d=le(),u=l.props||{},h=Object.prototype.hasOwnProperty.call(u,"modelValue")||Object.prototype.hasOwnProperty.call(u,"model-value"),f=Object.prototype.hasOwnProperty.call(u,o)||Object.prototype.hasOwnProperty.call(u,Gv(o));return h?[t,function(g){a("update:modelValue",g);for(var k=arguments.length,A=new Array(k>1?k-1:0),m=1;m1?k-1:0),m=1;m1?k-1:0),m=1;me.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return a=u.done,u},e:function(u){l=!0,s=u},f:function(){try{a||n.return==null||n.return()}finally{if(l)throw s}}}}function p$o(e,t){if(e){if(typeof e=="string")return cSt(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cSt(e,t):void 0}}function cSt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n"u"?"undefined":bn(globalThis))=="object"&&globalThis)||e((typeof window>"u"?"undefined":bn(window))=="object"&&window)||e((typeof self>"u"?"undefined":bn(self))=="object"&&self)||e(bn(S1)=="object"&&S1)||e(bn(dde)=="object"&&dde)||function(){return this}()||Function("return this")()}function Ps(){return hSt?uSt:(hSt=1,uSt=function(t){try{return!!t()}catch{return!0}})}function Mre(){return fSt?ASt:(fSt=1,ASt=!Ps()(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}))}function iR(){if(gSt)return cTe;gSt=1;var e=Mre(),t=Function.prototype,n=t.apply,r=t.call;return cTe=(typeof Reflect>"u"?"undefined":bn(Reflect))=="object"&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),cTe}function Ks(){if(mSt)return dTe;mSt=1;var e=Mre(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return dTe=e?r:function(o){return function(){return n.apply(o,arguments)}},dTe}function mC(){if(vSt)return kSt;vSt=1;var e=Ks(),t=e({}.toString),n=e("".slice);return kSt=function(o){return n(t(o),8,-1)}}function Rre(){if(bSt)return pSt;bSt=1;var e=mC(),t=Ks();return pSt=function(r){if(e(r)==="Function")return t(r)}}function Gc(){if(wSt)return OSt;wSt=1;var e=(typeof document>"u"?"undefined":bn(document))=="object"&&document.all;return OSt=e===void 0&&e!==void 0?function(t){return typeof t=="function"||t===e}:function(t){return typeof t=="function"}}var ySt,CSt,uTe,xSt,hTe={};function Ed(){return CSt?ySt:(CSt=1,ySt=!Ps()(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}))}function ud(){if(xSt)return uTe;xSt=1;var e=Mre(),t=Function.prototype.call;return uTe=e?t.bind(t):function(){return t.apply(t,arguments)},uTe}var LSt,SSt,TSt,ESt,DSt,QSt,BSt,FSt,PSt,MSt,RSt,ISt,NSt,USt,jSt,ATe,WSt,HSt,VSt,zSt,ZSt,YSt,XSt,fTe,qSt,GSt,KSt,JSt,_St,$St,e5t,t5t,n5t,i5t,r5t,o5t,s5t,gTe={};function fwe(){if(LSt)return gTe;LSt=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return gTe.f=n?function(r){var o=t(this,r);return!!o&&o.enumerable}:e,gTe}function ME(){return TSt?SSt:(TSt=1,SSt=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}})}function gwe(){if(DSt)return ESt;DSt=1;var e=Ks(),t=Ps(),n=mC(),r=Object,o=e("".split);return ESt=t(function(){return!r("z").propertyIsEnumerable(0)})?function(s){return n(s)==="String"?o(s,""):r(s)}:r}function rR(){return BSt?QSt:(BSt=1,QSt=function(t){return t==null})}function Q4(){if(PSt)return FSt;PSt=1;var e=rR(),t=TypeError;return FSt=function(r){if(e(r))throw new t("Can't call method on "+r);return r}}function JO(){if(RSt)return MSt;RSt=1;var e=gwe(),t=Q4();return MSt=function(r){return e(t(r))}}function Ku(){if(NSt)return ISt;NSt=1;var e=Gc();return ISt=function(n){return bn(n)=="object"?n!==null:e(n)}}function Ol(){return jSt?USt:(jSt=1,USt={})}function aA(){if(WSt)return ATe;WSt=1;var e=Ol(),t=vc(),n=Gc(),r=function(s){return n(s)?s:void 0};return ATe=function(s,a){return arguments.length<2?r(e[s])||r(t[s]):e[s]&&e[s][a]||t[s]&&t[s][a]},ATe}function wl(){return VSt?HSt:(VSt=1,HSt=Ks()({}.isPrototypeOf))}function RE(){return ZSt?zSt:(ZSt=1,zSt=typeof navigator<"u"&&String(navigator.userAgent)||"")}function NZ(){if(XSt)return YSt;XSt=1;var e,t,n=vc(),r=RE(),o=n.process,s=n.Deno,a=o&&o.versions||s&&s.version,l=a&&a.v8;return l&&(t=(e=l.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),YSt=t}function oz(){if(qSt)return fTe;qSt=1;var e=NZ(),t=Ps(),n=vc().String;return fTe=!!Object.getOwnPropertySymbols&&!t(function(){var r=Symbol("symbol detection");return!n(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&e&&e<41}),fTe}function YWn(){return KSt?GSt:(KSt=1,GSt=oz()&&!Symbol.sham&&bn(Symbol.iterator)=="symbol")}function Ire(){if(_St)return JSt;_St=1;var e=aA(),t=Gc(),n=wl(),r=Object;return JSt=YWn()?function(o){return bn(o)=="symbol"}:function(o){var s=e("Symbol");return t(s)&&n(s.prototype,r(o))}}function IE(){if(e5t)return $St;e5t=1;var e=String;return $St=function(n){try{return e(n)}catch{return"Object"}}}function rA(){if(n5t)return t5t;n5t=1;var e=Gc(),t=IE(),n=TypeError;return t5t=function(o){if(e(o))return o;throw new n(t(o)+" is not a function")}}function mwe(){if(r5t)return i5t;r5t=1;var e=rA(),t=rR();return i5t=function(r,o){var s=r[o];return t(s)?void 0:e(s)}}function w$o(){if(s5t)return o5t;s5t=1;var e=ud(),t=Gc(),n=Ku(),r=TypeError;return o5t=function(s,a){var l,d;if(a==="string"&&t(l=s.toString)&&!n(d=e(l,s))||t(l=s.valueOf)&&!n(d=e(l,s))||a!=="string"&&t(l=s.toString)&&!n(d=e(l,s)))return d;throw new r("Can't convert object to primitive value")}}var a5t,l5t,c5t,d5t,mTe={exports:{}};function N1(){return l5t?a5t:(l5t=1,a5t=!0)}function y$o(){if(d5t)return c5t;d5t=1;var e=vc(),t=Object.defineProperty;return c5t=function(r,o){try{t(e,r,{value:o,configurable:!0,writable:!0})}catch{e[r]=o}return o}}var u5t,h5t,A5t,f5t,g5t,m5t,k5t,v5t,p5t,b5t,O5t,w5t,y5t,C5t,x5t,L5t,S5t,T5t,E5t,D5t,Q5t,B5t,kTe,F5t;function Tot(){if(u5t)return mTe.exports;u5t=1;var e=N1(),t=vc(),n=y$o(),r="__core-js_shared__",o=mTe.exports=t[r]||n(r,{});return(o.versions||(o.versions=[])).push({version:"3.37.1",mode:e?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"}),mTe.exports}function yW(){if(A5t)return h5t;A5t=1;var e=Tot();return h5t=function(n,r){return e[n]||(e[n]=r||{})}}function Bg(){if(g5t)return f5t;g5t=1;var e=Q4(),t=Object;return f5t=function(r){return t(e(r))}}function Xd(){if(k5t)return m5t;k5t=1;var e=Ks(),t=Bg(),n=e({}.hasOwnProperty);return m5t=Object.hasOwn||function(r,o){return n(t(r),o)}}function kwe(){if(p5t)return v5t;p5t=1;var e=Ks(),t=0,n=Math.random(),r=e(1 .toString);return v5t=function(s){return"Symbol("+(s===void 0?"":s)+")_"+r(++t+n,36)}}function Kc(){if(O5t)return b5t;O5t=1;var e=vc(),t=yW(),n=Xd(),r=kwe(),o=oz(),s=YWn(),a=e.Symbol,l=t("wks"),d=s?a.for||a:a&&a.withoutSetter||r;return b5t=function(h){return n(l,h)||(l[h]=o&&n(a,h)?a[h]:d("Symbol."+h)),l[h]}}function XWn(){if(y5t)return w5t;y5t=1;var e=ud(),t=Ku(),n=Ire(),r=mwe(),o=w$o(),s=TypeError,a=Kc()("toPrimitive");return w5t=function(d,u){if(!t(d)||n(d))return d;var h,f=r(d,a);if(f){if(u===void 0&&(u="default"),h=e(f,d,u),!t(h)||n(h))return h;throw new s("Can't convert object to primitive value")}return u===void 0&&(u="number"),o(d,u)}}function Eot(){if(x5t)return C5t;x5t=1;var e=XWn(),t=Ire();return C5t=function(r){var o=e(r,"string");return t(o)?o:o+""}}function Dot(){if(S5t)return L5t;S5t=1;var e=vc(),t=Ku(),n=e.document,r=t(n)&&t(n.createElement);return L5t=function(s){return r?n.createElement(s):{}}}function qWn(){if(E5t)return T5t;E5t=1;var e=Ed(),t=Ps(),n=Dot();return T5t=!e&&!t(function(){return Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a!==7})}function NE(){if(D5t)return hTe;D5t=1;var e=Ed(),t=ud(),n=fwe(),r=ME(),o=JO(),s=Eot(),a=Xd(),l=qWn(),d=Object.getOwnPropertyDescriptor;return hTe.f=e?d:function(u,h){if(u=o(u),h=s(h),l)try{return d(u,h)}catch{}if(a(u,h))return r(!t(n.f,u,h),u[h])},hTe}function GWn(){if(B5t)return Q5t;B5t=1;var e=Ps(),t=Gc(),n=/#|\.prototype\./,r=function(u,h){var f=s[o(u)];return f===l||f!==a&&(t(h)?e(h):!!h)},o=r.normalize=function(d){return String(d).replace(n,".").toLowerCase()},s=r.data={},a=r.NATIVE="N",l=r.POLYFILL="P";return Q5t=r}function rg(){if(F5t)return kTe;F5t=1;var e=Rre(),t=rA(),n=Mre(),r=e(e.bind);return kTe=function(s,a){return t(s),a===void 0?s:n?r(s,a):function(){return s.apply(a,arguments)}},kTe}var P5t,M5t,R5t,I5t,N5t,U5t,j5t,W5t,H5t,V5t,z5t,vTe,Z5t,Y5t,X5t,q5t,G5t,K5t,J5t,_5t,$5t,eTt,tTt,pTe={};function KWn(){return M5t?P5t:(M5t=1,P5t=Ed()&&Ps()(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}))}function ZA(){if(I5t)return R5t;I5t=1;var e=Ku(),t=String,n=TypeError;return R5t=function(o){if(e(o))return o;throw new n(t(o)+" is not an object")}}function Q2(){if(N5t)return pTe;N5t=1;var e=Ed(),t=qWn(),n=KWn(),r=ZA(),o=Eot(),s=TypeError,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",h="writable";return pTe.f=e?n?function(f,g,k){if(r(f),g=o(g),r(k),typeof f=="function"&&g==="prototype"&&"value"in k&&h in k&&!k[h]){var A=l(f,g);A&&A[h]&&(f[g]=k.value,k={configurable:u in k?k[u]:A[u],enumerable:d in k?k[d]:A[d],writable:!1})}return a(f,g,k)}:a:function(f,g,k){if(r(f),g=o(g),r(k),t)try{return a(f,g,k)}catch{}if("get"in k||"set"in k)throw new s("Accessors not supported");return"value"in k&&(f[g]=k.value),f},pTe}function N6(){if(j5t)return U5t;j5t=1;var e=Ed(),t=Q2(),n=ME();return U5t=e?function(r,o,s){return t.f(r,o,n(1,s))}:function(r,o,s){return r[o]=s,r}}function ai(){if(H5t)return W5t;H5t=1;var e=vc(),t=iR(),n=Rre(),r=Gc(),o=NE().f,s=GWn(),a=Ol(),l=rg(),d=N6(),u=Xd(),h=function(g){var k=function A(m,v,p){if(this instanceof A){switch(arguments.length){case 0:return new g;case 1:return new g(m);case 2:return new g(m,v)}return new g(m,v,p)}return t(g,this,arguments)};return k.prototype=g.prototype,k};return W5t=function(g,k){var A,m,v,p,b,O,w,y,C,x=g.target,L=g.global,S=g.stat,E=g.proto,Q=L?e:S?e[x]:e[x]&&e[x].prototype,T=L?a:a[x]||d(a,x,{})[x],M=T.prototype;for(p in k)m=!(A=s(L?p:x+(S?".":"#")+p,g.forced))&&Q&&u(Q,p),O=T[p],m&&(w=g.dontCallGetSet?(C=o(Q,p))&&C.value:Q[p]),b=m&&w?w:k[p],(A||E||bn(O)!=bn(b))&&(y=g.bind&&m?l(b,e):g.wrap&&m?h(b):E&&r(b)?n(b):b,(g.sham||b&&b.sham||O&&O.sham)&&d(y,"sham",!0),d(T,p,y),E&&(u(a,v=x+"Prototype")||d(a,v,{}),d(a[v],p,b),g.real&&M&&(A||!M[p])&&d(M,p,b)))}}function U6(){return z5t?V5t:(z5t=1,V5t=Ks()([].slice))}function JWn(){if(Z5t)return vTe;Z5t=1;var e=Ks(),t=rA(),n=Ku(),r=Xd(),o=U6(),s=Mre(),a=Function,l=e([].concat),d=e([].join),u={};return vTe=s?a.bind:function(h){var f=t(this),g=f.prototype,k=o(arguments,1),A=function m(){var v=l(k,o(arguments));return this instanceof m?function(p,b,O){if(!r(u,b)){for(var w=[],y=0;y0?t:e)(r)}}function UZ(){if(oTt)return rTt;oTt=1;var e=C$o();return rTt=function(n){var r=+n;return r!=r||r===0?0:e(r)}}function Nre(){if(sTt)return bTe;sTt=1;var e=UZ(),t=Math.max,n=Math.min;return bTe=function(o,s){var a=e(o);return a<0?t(a+s,0):n(a,s)},bTe}function pwe(){if(lTt)return aTt;lTt=1;var e=UZ(),t=Math.min;return aTt=function(r){var o=e(r);return o>0?t(o,9007199254740991):0}}function _O(){if(dTt)return cTt;dTt=1;var e=pwe();return cTt=function(n){return e(n.length)}}function Bot(){if(hTt)return uTt;hTt=1;var e=JO(),t=Nre(),n=_O(),r=function(s){return function(a,l,d){var u=e(a),h=n(u);if(h===0)return!s&&-1;var f,g=t(d,h);if(s&&l!=l){for(;h>g;)if((f=u[g++])!=f)return!0}else for(;h>g;g++)if((s||g in u)&&u[g]===l)return s||g||0;return!s&&-1}};return uTt={includes:r(!0),indexOf:r(!1)}}function Ure(){return fTt?ATt:(fTt=1,ATt={})}function eHn(){if(mTt)return gTt;mTt=1;var e=Ks(),t=Xd(),n=JO(),r=Bot().indexOf,o=Ure(),s=e([].push);return gTt=function(l,d){var u,h=n(l),f=0,g=[];for(u in h)!t(o,u)&&t(h,u)&&s(g,u);for(;d.length>f;)t(h,u=d[f++])&&(~r(g,u)||s(g,u));return g}}function Fot(){return vTt?kTt:(vTt=1,kTt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function jre(){if(bTt)return pTt;bTt=1;var e=eHn(),t=Fot();return pTt=Object.keys||function(n){return e(n,t)}}function Pot(){if(OTt)return OTe;OTt=1;var e=Ed(),t=KWn(),n=Q2(),r=ZA(),o=JO(),s=jre();return OTe.f=e&&!t?Object.defineProperties:function(a,l){r(a);for(var d,u=o(l),h=s(l),f=h.length,g=0;f>g;)n.f(a,d=h[g++],u[d]);return a},OTe}function tHn(){return yTt?wTt:(yTt=1,wTt=aA()("document","documentElement"))}function bwe(){if(xTt)return CTt;xTt=1;var e=yW(),t=kwe(),n=e("keys");return CTt=function(o){return n[o]||(n[o]=t(o))}}function UE(){if(STt)return LTt;STt=1;var e,t=ZA(),n=Pot(),r=Fot(),o=Ure(),s=tHn(),a=Dot(),l="prototype",d="script",u=bwe()("IE_PROTO"),h=function(){},f=function(m){return"<"+d+">"+m+""},g=function(m){m.write(f("")),m.close();var v=m.parentWindow.Object;return m=null,v},k=function(){try{e=new ActiveXObject("htmlfile")}catch{}var m,v,p;k=typeof document<"u"?document.domain&&e?g(e):(v=a("iframe"),p="java"+d+":",v.style.display="none",s.appendChild(v),v.src=String(p),(m=v.contentWindow.document).open(),m.write(f("document.F=Object")),m.close(),m.F):g(e);for(var b=r.length;b--;)delete k[l][r[b]];return k()};return o[u]=!0,LTt=Object.create||function(A,m){var v;return A!==null?(h[l]=t(A),v=new h,h[l]=null,v[u]=A):v=k(),m===void 0?v:n.f(v,m)}}function x$o(){return DTt?ETt:(DTt=1,function(){if(TTt)return O$o;TTt=1;var e=ai(),t=aA(),n=iR(),r=JWn(),o=$Wn(),s=ZA(),a=Ku(),l=UE(),d=Ps(),u=t("Reflect","construct"),h=Object.prototype,f=[].push,g=d(function(){function m(){}return!(u(function(){},[],m)instanceof m)}),k=!d(function(){u(function(){})}),A=g||k;e({target:"Reflect",stat:!0,forced:A,sham:A},{construct:function(v,p){o(v),s(p);var b=arguments.length<3?v:o(arguments[2]);if(k&&!g)return u(v,p,b);if(v===b){switch(p.length){case 0:return new v;case 1:return new v(p[0]);case 2:return new v(p[0],p[1]);case 3:return new v(p[0],p[1],p[2]);case 4:return new v(p[0],p[1],p[2],p[3])}var O=[null];return n(f,O,p),new(n(r,v,O))}var w=b.prototype,y=l(a(w)?w:h),C=n(v,y,p);return a(C)?C:y}})}(),ETt=Ol().Reflect.construct)}function nHn(){return BTt?QTt:(BTt=1,QTt=x$o())}var MTt,RTt,ITt,NTt,UTt,jTt,WTt,Di=ji(PTt?FTt:(PTt=1,FTt=nHn())),L$o={};function S$o(){return ITt?RTt:(ITt=1,function(){if(MTt)return L$o;MTt=1;var e=ai(),t=Bg(),n=jre();e({target:"Object",stat:!0,forced:Ps()(function(){n(1)})},{keys:function(o){return n(t(o))}})}(),RTt=Ol().Object.keys)}function T$o(){return UTt?NTt:(UTt=1,NTt=S$o())}var HTt,VTt,ol=ji(WTt?jTt:(WTt=1,jTt=T$o())),E$o={},D$o={};function lA(){if(VTt)return HTt;VTt=1;var e=j6(),t=String;return HTt=function(r){if(e(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return t(r)}}var zTt,wTe={};function Owe(){if(zTt)return wTe;zTt=1;var e=eHn(),t=Fot().concat("length","prototype");return wTe.f=Object.getOwnPropertyNames||function(n){return e(n,t)},wTe}var ZTt,yTe={};function iHn(){if(ZTt)return yTe;ZTt=1;var e=mC(),t=JO(),n=Owe().f,r=U6(),o=(typeof window>"u"?"undefined":bn(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];return yTe.f=function(s){return o&&e(s)==="Window"?function(a){try{return n(a)}catch{return r(o)}}(s):n(t(s))},yTe}var YTt,XTt,qTt,GTt,KTt,JTt={};function hke(){return YTt||(YTt=1,JTt.f=Object.getOwnPropertySymbols),JTt}function Yy(){if(qTt)return XTt;qTt=1;var e=N6();return XTt=function(n,r,o,s){return s&&s.enumerable?n[r]=o:e(n,r,o),n}}function Wre(){if(KTt)return GTt;KTt=1;var e=Q2();return GTt=function(n,r,o){return e.f(n,r,o)}}var _Tt,$Tt,eEt,tEt,nEt,iEt,rEt,oEt,sEt,aEt,lEt,cEt,dEt,uEt,hEt,AEt,fEt,gEt,mEt,kEt,vEt,pEt,CTe={};function wwe(){if(_Tt)return CTe;_Tt=1;var e=Kc();return CTe.f=e,CTe}function du(){if(eEt)return $Tt;eEt=1;var e=Ol(),t=Xd(),n=wwe(),r=Q2().f;return $Tt=function(s){var a=e.Symbol||(e.Symbol={});t(a,s)||r(a,s,{value:n.f(s)})}}function rHn(){if(nEt)return tEt;nEt=1;var e=ud(),t=aA(),n=Kc(),r=Yy();return tEt=function(){var s=t("Symbol"),a=s&&s.prototype,l=a&&a.valueOf,d=n("toPrimitive");a&&!a[d]&&r(a,d,function(u){return e(l,this)},{arity:1})}}function Q$o(){if(rEt)return iEt;rEt=1;var e=Qot(),t=j6();return iEt=e?{}.toString:function(){return"[object "+t(this)+"]"}}function Xy(){if(sEt)return oEt;sEt=1;var e=Qot(),t=Q2().f,n=N6(),r=Xd(),o=Q$o(),s=Kc()("toStringTag");return oEt=function(l,d,u,h){var f=u?l:l&&l.prototype;f&&(r(f,s)||t(f,s,{configurable:!0,value:d}),h&&!e&&n(f,"toString",o))}}function B$o(){if(lEt)return aEt;lEt=1;var e=vc(),t=Gc(),n=e.WeakMap;return aEt=t(n)&&/native code/.test(String(n))}function jE(){if(dEt)return cEt;dEt=1;var e,t,n,r=B$o(),o=vc(),s=Ku(),a=N6(),l=Xd(),d=Tot(),u=bwe(),h=Ure(),f="Object already initialized",g=o.TypeError,k=o.WeakMap;if(r||d.state){var A=d.state||(d.state=new k);A.get=A.get,A.has=A.has,A.set=A.set,e=function(p,b){if(A.has(p))throw new g(f);return b.facade=p,A.set(p,b),b},t=function(p){return A.get(p)||{}},n=function(p){return A.has(p)}}else{var m=u("state");h[m]=!0,e=function(p,b){if(l(p,m))throw new g(f);return b.facade=p,a(p,m,b),b},t=function(p){return l(p,m)?p[m]:{}},n=function(p){return l(p,m)}}return cEt={set:e,get:t,has:n,enforce:function(p){return n(p)?t(p):e(p,{})},getterFor:function(p){return function(b){var O;if(!s(b)||(O=t(b)).type!==p)throw new g("Incompatible receiver, "+p+" required");return O}}}}function oR(){if(hEt)return uEt;hEt=1;var e=mC();return uEt=Array.isArray||function(t){return e(t)==="Array"}}function F$o(){if(fEt)return AEt;fEt=1;var e=oR(),t=vwe(),n=Ku(),r=Kc()("species"),o=Array;return AEt=function(a){var l;return e(a)&&(l=a.constructor,(t(l)&&(l===o||e(l.prototype))||n(l)&&(l=l[r])===null)&&(l=void 0)),l===void 0?o:l}}function Mot(){if(mEt)return gEt;mEt=1;var e=F$o();return gEt=function(n,r){return new(e(n))(r===0?0:r)}}function W6(){if(vEt)return kEt;vEt=1;var e=rg(),t=Ks(),n=gwe(),r=Bg(),o=_O(),s=Mot(),a=t([].push),l=function(u){var h=u===1,f=u===2,g=u===3,k=u===4,A=u===6,m=u===7,v=u===5||A;return function(p,b,O,w){for(var y,C,x=r(p),L=n(x),S=o(L),E=e(b,O),Q=0,T=w||s,M=h?T(p,S):f||m?T(p,0):void 0;S>Q;Q++)if((v||Q in L)&&(C=E(y=L[Q],Q,x),u))if(h)M[Q]=C;else if(C)switch(u){case 3:return!0;case 5:return y;case 6:return Q;case 2:a(M,y)}else switch(u){case 4:return!1;case 7:a(M,y)}return A?-1:g||k?k:M}};return kEt={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}}var bEt,OEt,wEt,P$o={};function yEt(){return OEt?bEt:(OEt=1,bEt=oz()&&!!Symbol.for&&!!Symbol.keyFor)}var CEt,M$o={},xTe,xEt,LEt,SEt={};function R$o(){if(xEt)return xTe;xEt=1;var e=Ks(),t=oR(),n=Gc(),r=mC(),o=lA(),s=e([].push);return xTe=function(l){if(n(l))return l;if(t(l)){for(var d=l.length,u=[],h=0;h=51||!e(function(){var a=[];return(a.constructor={})[r]=function(){return{foo:1}},a[s](Boolean).foo!==1})}}function Jc(){if(jEt)return UEt;jEt=1;var e=vc(),t=Ol();return UEt=function(r,o){var s=t[r+"Prototype"],a=s&&s[o];if(a)return a;var l=e[r],d=l&&l.prototype;return d&&d[o]}}function W$o(){return HEt?WEt:(HEt=1,function(){if(NEt)return j$o;NEt=1;var e=ai(),t=W6().filter;e({target:"Array",proto:!0,forced:!Hre()("filter")},{filter:function(r){return t(this,r,arguments.length>1?arguments[1]:void 0)}})}(),WEt=Jc()("Array","filter"))}function H$o(){if(zEt)return VEt;zEt=1;var e=wl(),t=W$o(),n=Array.prototype;return VEt=function(o){var s=o.filter;return o===n||e(n,o)&&s===n.filter?t:s}}function V$o(){return YEt?ZEt:(YEt=1,ZEt=H$o())}var GEt,Sd=ji(qEt?XEt:(qEt=1,XEt=V$o())),LTe={exports:{}},z$o={},KEt,JEt,_Et,$Et,e7t;function Z$o(){if(KEt)return LTe.exports;KEt=1,function(){if(GEt)return z$o;GEt=1;var n=ai(),r=Ps(),o=JO(),s=NE().f,a=Ed();n({target:"Object",stat:!0,forced:!a||r(function(){s(1)}),sham:!a},{getOwnPropertyDescriptor:function(d,u){return s(o(d),u)}})}();var e=Ol().Object,t=LTe.exports=function(n,r){return e.getOwnPropertyDescriptor(n,r)};return e.getOwnPropertyDescriptor.sham&&(t.sham=!0),LTe.exports}function aHn(){return _Et?JEt:(_Et=1,JEt=Z$o())}var t7t,n7t,STe,i7t,r7t,o7t,s7t,a7t,l7t,Ju=ji(e7t?$Et:(e7t=1,$Et=aHn())),Y$o={};function jZ(){if(n7t)return t7t;n7t=1;var e=Ps();return t7t=function(n,r){var o=[][n];return!!o&&e(function(){o.call(null,r||function(){return 1},1)})}}function X$o(){if(i7t)return STe;i7t=1;var e=W6().forEach,t=jZ()("forEach");return STe=t?[].forEach:function(n){return e(this,n,arguments.length>1?arguments[1]:void 0)},STe}function q$o(){return s7t?o7t:(s7t=1,function(){if(r7t)return Y$o;r7t=1;var e=ai(),t=X$o();e({target:"Array",proto:!0,forced:[].forEach!==t},{forEach:t})}(),o7t=Jc()("Array","forEach"))}function G$o(){return l7t?a7t:(l7t=1,a7t=q$o())}var c7t,d7t,u7t,h7t;function lHn(){if(d7t)return c7t;d7t=1;var e=j6(),t=Xd(),n=wl(),r=G$o(),o=Array.prototype,s={DOMTokenList:!0,NodeList:!0};return c7t=function(l){var d=l.forEach;return l===o||n(o,l)&&d===o.forEach||t(s,e(l))?r:d}}var TTe,A7t,f7t,g7t,m7t,k7t,v7t,p7t,b7t,O7t,w7t,vi=ji(h7t?u7t:(h7t=1,u7t=lHn())),K$o={};function cHn(){if(A7t)return TTe;A7t=1;var e=aA(),t=Ks(),n=Owe(),r=hke(),o=ZA(),s=t([].concat);return TTe=e("Reflect","ownKeys")||function(a){var l=n.f(o(a)),d=r.f;return d?s(l,d(a)):l},TTe}function Vre(){if(g7t)return f7t;g7t=1;var e=Ed(),t=Q2(),n=ME();return f7t=function(o,s,a){e?t.f(o,s,n(0,a)):o[s]=a}}function J$o(){return v7t?k7t:(v7t=1,function(){if(m7t)return K$o;m7t=1;var e=ai(),t=Ed(),n=cHn(),r=JO(),o=NE(),s=Vre();e({target:"Object",stat:!0,sham:!t},{getOwnPropertyDescriptors:function(l){for(var d,u,h=r(l),f=o.f,g=n(h),k={},A=0;g.length>A;)(u=f(h,d=g[A++]))!==void 0&&s(k,d,u);return k}})}(),k7t=Ol().Object.getOwnPropertyDescriptors)}function _$o(){return b7t?p7t:(b7t=1,p7t=J$o())}var y7t,Xu=ji(w7t?O7t:(w7t=1,O7t=_$o())),ETe={exports:{}},C7t={};function $$o(){if(y7t)return C7t;y7t=1;var e=ai(),t=Ed(),n=Pot().f;return e({target:"Object",stat:!0,forced:Object.defineProperties!==n,sham:!t},{defineProperties:n}),C7t}var x7t,L7t,S7t,T7t,E7t;function ees(){if(x7t)return ETe.exports;x7t=1,$$o();var e=Ol().Object,t=ETe.exports=function(n,r){return e.defineProperties(n,r)};return e.defineProperties.sham&&(t.sham=!0),ETe.exports}function tes(){return S7t?L7t:(S7t=1,L7t=ees())}var D7t,$O=ji(E7t?T7t:(E7t=1,T7t=tes())),DTe={exports:{}},Q7t={};function nes(){if(D7t)return Q7t;D7t=1;var e=ai(),t=Ed(),n=Q2().f;return e({target:"Object",stat:!0,forced:Object.defineProperty!==n,sham:!t},{defineProperty:n}),Q7t}var B7t,F7t,P7t,M7t,R7t;function ies(){if(B7t)return DTe.exports;B7t=1,nes();var e=Ol().Object,t=DTe.exports=function(n,r,o){return e.defineProperty(n,r,o)};return e.defineProperty.sham&&(t.sham=!0),DTe.exports}function dHn(){return P7t?F7t:(P7t=1,F7t=ies())}var I7t,N7t,U7t,j7t,W7t,H7t,wk=ji(R7t?M7t:(R7t=1,M7t=dHn()));function Er(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function res(){return N7t?I7t:(N7t=1,I7t=dHn())}function oes(){return j7t?U7t:(j7t=1,U7t=res())}function uHn(){return H7t?W7t:(H7t=1,W7t=oes())}var V7t,z7t,Z7t,ywe=ji(uHn()),Y7t={};function Rot(){if(z7t)return V7t;z7t=1;var e=TypeError;return V7t=function(n){if(n>9007199254740991)throw e("Maximum allowed index exceeded");return n}}function hHn(){if(Z7t)return Y7t;Z7t=1;var e=ai(),t=Ps(),n=oR(),r=Ku(),o=Bg(),s=_O(),a=Rot(),l=Vre(),d=Mot(),u=Hre(),h=Kc(),f=NZ(),g=h("isConcatSpreadable"),k=f>=51||!t(function(){var m=[];return m[g]=!1,m.concat()[0]!==m}),A=function(v){if(!r(v))return!1;var p=v[g];return p!==void 0?!!p:n(v)};return e({target:"Array",proto:!0,arity:1,forced:!k||!u("concat")},{concat:function(v){var p,b,O,w,y,C=o(this),x=d(C,0),L=0;for(p=-1,O=arguments.length;p=A.length)return k.target=void 0,a(void 0,!0);switch(k.kind){case"keys":return a(m,!1);case"values":return a(A[m],!1)}return a([m,A[m]],!1)},"values");var g=n.Arguments=n.Array;if(t("keys"),t("values"),t("entries"),!l&&d&&g.name!=="values")try{o(g,"name",{value:"values"})}catch{}return QTe}function Aes(){return NDt?IDt:(NDt=1,IDt={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0})}function H6(){if(UDt)return HDt;UDt=1,kC();var e=Aes(),t=vc(),n=Xy(),r=WZ();for(var o in e)n(t[o],o),r[o]=r.Array;return HDt}function pHn(){if(WDt)return jDt;WDt=1;var e=ces();return H6(),jDt=e}var VDt,fes={},zDt,ZDt,YDt,XDt,qDt;function ges(){if(qDt)return XDt;qDt=1;var e=pHn();return function(){if(VDt)return fes;VDt=1;var t=Kc(),n=Q2().f,r=t("metadata"),o=Function.prototype;o[r]===void 0&&n(o,r,{value:null})}(),zDt||(zDt=1,du()("asyncDispose")),ZDt||(ZDt=1,du()("dispose")),YDt||(YDt=1,du()("metadata")),XDt=e}var GDt,KDt,JDt;function _Dt(){if(KDt)return GDt;KDt=1;var e=aA(),t=Ks(),n=e("Symbol"),r=n.keyFor,o=t(n.prototype.valueOf);return GDt=n.isRegisteredSymbol||function(s){try{return r(o(s))!==void 0}catch{return!1}}}var BTe,$Dt,eQt;function tQt(){if($Dt)return BTe;$Dt=1;for(var e=yW(),t=aA(),n=Ks(),r=Ire(),o=Kc(),s=t("Symbol"),a=s.isWellKnownSymbol,l=t("Object","getOwnPropertyNames"),d=n(s.prototype.valueOf),u=e("wks"),h=0,f=l(s),g=f.length;h=v?u?"":void 0:(g=s(A,m))<55296||g>56319||m+1===v||(k=s(A,m+1))<56320||k>57343?u?o(A,m):g:u?a(A,m,m+2):k-56320+(g-55296<<10)+65536}};return fQt={codeAt:l(!1),charAt:l(!0)}}function sR(){if(mQt)return SQt;mQt=1;var e=bHn().charAt,t=lA(),n=jE(),r=Iot(),o=xwe(),s="String Iterator",a=n.set,l=n.getterFor(s);return r(String,"String",function(d){a(this,{type:s,string:t(d),index:0})},function(){var d,u=l(this),h=u.string,f=u.index;return f>=h.length?o(void 0,!0):(d=e(h,f),u.index+=d.length,o(d,!1))}),SQt}function kes(){return vQt?kQt:(vQt=1,kC(),sR(),AHn(),kQt=wwe().f("iterator"))}function ves(){if(bQt)return pQt;bQt=1;var e=kes();return H6(),pQt=e}function pes(){return wQt?OQt:(wQt=1,OQt=ves())}function bes(){return CQt?yQt:(CQt=1,yQt=pes())}function OHn(){return LQt?xQt:(LQt=1,xQt=bes())}var Oes=ji(OHn());function Cd(e){return Cd=typeof KU=="function"&&bn(Oes)=="symbol"?function(t){return bn(t)}:function(t){return t&&typeof KU=="function"&&t.constructor===KU&&t!==KU.prototype?"symbol":bn(t)},Cd(e)}var TQt,EQt,DQt,QQt,BQt,FQt,PQt,MQt,RQt,IQt;function wes(){return EQt?TQt:(EQt=1,fHn(),TQt=wwe().f("toPrimitive"))}function yes(){return QQt?DQt:(QQt=1,DQt=wes())}function Ces(){return FQt?BQt:(FQt=1,BQt=yes())}function xes(){return MQt?PQt:(MQt=1,PQt=Ces())}function Les(){return IQt?RQt:(IQt=1,RQt=xes())}var Ses=ji(Les());function wHn(e){var t=function(n,r){if(Cd(n)!="object"||!n)return n;var o=n[Ses];if(o!==void 0){var s=o.call(n,r);if(Cd(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return Cd(t)=="symbol"?t:t+""}function NQt(e,t){for(var n=0;ng,v=n(k)?k:l(k),p=m?s(arguments,g):[],b=m?function(){t(v,this,p)}:v;return f?h(b,A):h(b)}:h},FTe}var GBt,KBt,JBt,_Bt,$Bt,eFt,_es={};function DHn(){return KBt||(KBt=1,function(){if(XBt)return Kes;XBt=1;var e=ai(),t=vc(),n=qBt()(t.setInterval,!0);e({global:!0,bind:!0,forced:t.setInterval!==n},{setInterval:n})}(),function(){if(GBt)return _es;GBt=1;var e=ai(),t=vc(),n=qBt()(t.setTimeout,!0);e({global:!0,bind:!0,forced:t.setTimeout!==n},{setTimeout:n})}()),Ges}function $es(){return _Bt?JBt:(_Bt=1,DHn(),JBt=Ol().setTimeout)}var tFt,nFt,iFt,rFt,oFt,sFt,aFt,lFt,cFt,Iu=ji(eFt?$Bt:(eFt=1,$Bt=$es())),ets={};function tts(){return iFt?nFt:(iFt=1,function(){if(tFt)return ets;tFt=1;var e=ai(),t=W6().map;e({target:"Array",proto:!0,forced:!Hre()("map")},{map:function(r){return t(this,r,arguments.length>1?arguments[1]:void 0)}})}(),nFt=Jc()("Array","map"))}function nts(){if(oFt)return rFt;oFt=1;var e=wl(),t=tts(),n=Array.prototype;return rFt=function(o){var s=o.map;return o===n||e(n,o)&&s===n.map?t:s}}function its(){return aFt?sFt:(aFt=1,sFt=nts())}var dFt,uFt,hFt,cs=ji(cFt?lFt:(cFt=1,lFt=its())),rts={};function ots(){return hFt?uFt:(hFt=1,function(){if(dFt)return rts;dFt=1;var e=ai(),t=Bot().includes,n=Ps(),r=zre();e({target:"Array",proto:!0,forced:n(function(){return!Array(1).includes()})},{includes:function(s){return t(this,s,arguments.length>1?arguments[1]:void 0)}}),r("includes")}(),uFt=Jc()("Array","includes"))}var AFt,fFt,gFt,mFt,kFt,vFt,pFt,bFt,OFt,wFt,yFt,CFt,xFt,LFt,SFt,sts={};function QHn(){if(fFt)return AFt;fFt=1;var e=Ku(),t=mC(),n=Kc()("match");return AFt=function(o){var s;return e(o)&&((s=o[n])!==void 0?!!s:t(o)==="RegExp")}}function Uot(){if(mFt)return gFt;mFt=1;var e=QHn(),t=TypeError;return gFt=function(r){if(e(r))throw new t("The method doesn't accept regular expressions");return r}}function jot(){if(vFt)return kFt;vFt=1;var e=Kc()("match");return kFt=function(n){var r=/./;try{"/./"[n](r)}catch{try{return r[e]=!1,"/./"[n](r)}catch{}}return!1}}function ats(){return OFt?bFt:(OFt=1,function(){if(pFt)return sts;pFt=1;var e=ai(),t=Ks(),n=Uot(),r=Q4(),o=lA(),s=jot(),a=t("".indexOf);e({target:"String",proto:!0,forced:!s("includes")},{includes:function(d){return!!~a(o(r(this)),o(n(d)),arguments.length>1?arguments[1]:void 0)}})}(),bFt=Jc()("String","includes"))}function lts(){if(yFt)return wFt;yFt=1;var e=wl(),t=ots(),n=ats(),r=Array.prototype,o=String.prototype;return wFt=function(a){var l=a.includes;return a===r||e(r,a)&&l===r.includes?t:typeof a=="string"||a===o||e(o,a)&&l===o.includes?n:l}}function cts(){return xFt?CFt:(xFt=1,CFt=lts())}var PTe,TFt,EFt,DFt,QFt,BFt,FFt,PFt,MFt,Dv=ji(SFt?LFt:(SFt=1,LFt=cts())),dts={};function BHn(){if(TFt)return PTe;TFt=1;var e=Ed(),t=Ks(),n=ud(),r=Ps(),o=jre(),s=hke(),a=fwe(),l=Bg(),d=gwe(),u=Object.assign,h=Object.defineProperty,f=t([].concat);return PTe=!u||r(function(){if(e&&u({b:1},u(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var g={},k={},A=Symbol("assign detection"),m="abcdefghijklmnopqrst";return g[A]=7,m.split("").forEach(function(v){k[v]=v}),u({},g)[A]!==7||o(u({},k)).join("")!==m})?function(g,k){for(var A=l(g),m=arguments.length,v=1,p=s.f,b=a.f;m>v;)for(var O,w=d(arguments[v++]),y=p?f(o(w),p(w)):o(w),C=y.length,x=0;C>x;)O=y[x++],e&&!n(b,w,O)||(A[O]=w[O]);return A}:u,PTe}function uts(){return QFt?DFt:(QFt=1,function(){if(EFt)return dts;EFt=1;var e=ai(),t=BHn();e({target:"Object",stat:!0,arity:2,forced:Object.assign!==t},{assign:t})}(),DFt=Ol().Object.assign)}function hts(){return FFt?BFt:(FFt=1,BFt=uts())}var RFt,IFt,NFt,UFt,jFt,WFt,HFt,VFt,NB=ji(MFt?PFt:(MFt=1,PFt=hts())),zFt={};function Ats(){if(IFt)return RFt;IFt=1;var e=ZA();return RFt=function(){var n=e(this),r="";return n.hasIndices&&(r+="d"),n.global&&(r+="g"),n.ignoreCase&&(r+="i"),n.multiline&&(r+="m"),n.dotAll&&(r+="s"),n.unicode&&(r+="u"),n.unicodeSets&&(r+="v"),n.sticky&&(r+="y"),r}}function fts(){if(UFt)return NFt;UFt=1;var e=ud(),t=Xd(),n=wl(),r=Ats(),o=RegExp.prototype;return NFt=function(a){var l=a.flags;return l!==void 0||"flags"in o||t(a,"flags")||!n(o,a)?l:e(r,a)}}function gts(){if(WFt)return jFt;WFt=1;var e=Ks(),t=Bg(),n=Math.floor,r=e("".charAt),o=e("".replace),s=e("".slice),a=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;return jFt=function(u,h,f,g,k,A){var m=f+u.length,v=g.length,p=l;return k!==void 0&&(k=t(k),p=a),o(A,p,function(b,O){var w;switch(r(O,0)){case"$":return"$";case"&":return u;case"`":return s(h,0,f);case"'":return s(h,m);case"<":w=k[s(O,1,-1)];break;default:var y=+O;if(y===0)return b;if(y>v){var C=n(y/10);return C===0?b:C<=v?g[C-1]===void 0?r(O,1):g[C-1]+r(O,1):b}w=g[y-1]}return w===void 0?"":w})}}function FHn(){if(HFt)return zFt;HFt=1;var e=ai(),t=ud(),n=Ks(),r=Q4(),o=Gc(),s=rR(),a=QHn(),l=lA(),d=mwe(),u=fts(),h=gts(),f=Kc(),g=N1(),k=f("replace"),A=TypeError,m=n("".indexOf),v=n("".replace),p=n("".slice),b=Math.max;return e({target:"String",proto:!0},{replaceAll:function(w,y){var C,x,L,S,E,Q,T,M,B,P=r(this),F=0,R=0,N="";if(!s(w)){if((C=a(w))&&(x=l(r(u(w))),!~m(x,"g")))throw new A("`.replaceAll` does not allow non-global regexes");if(L=d(w,k))return t(L,w,P,y);if(g&&C)return v(l(P),w,y)}for(S=l(P),E=l(w),(Q=o(y))||(y=l(y)),T=E.length,M=b(1,T),F=m(S,E);F!==-1;)B=Q?l(y(E,F,S)):h(E,S,F,[],void 0,y),N+=p(S,R,F)+B,R=F+T,F=F+M>S.length?-1:m(S,E,F+M);return R-1}}(),o=function(){if(gPt)return ITe;gPt=1;var a=ude();return ITe=function(d,u){var h=this.__data__,f=a(h,d);return f<0?(++this.size,h.push([d,u])):h[f][1]=u,this},ITe}();function s(a){var l=-1,d=a==null?0:a.length;for(this.clear();++l"u"?"undefined":bn(self))=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return TPt=n}function Ake(){if(QPt)return DPt;QPt=1;var e=rO().Symbol;return DPt=e}function VZ(){if(IPt)return RPt;IPt=1;var e=Ake(),t=function(){if(FPt)return BPt;FPt=1;var o=Ake(),s=Object.prototype,a=s.hasOwnProperty,l=s.toString,d=o?o.toStringTag:void 0;return BPt=function(h){var f=a.call(h,d),g=h[d];try{h[d]=void 0;var k=!0}catch{}var A=l.call(h);return k&&(f?h[d]=g:delete h[d]),A}}(),n=function(){if(MPt)return PPt;MPt=1;var o=Object.prototype.toString;return PPt=function(a){return o.call(a)}}(),r=e?e.toStringTag:void 0;return RPt=function(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":r&&r in Object(s)?t(s):n(s)}}function qy(){return UPt?NPt:(UPt=1,NPt=function(t){var n=bn(t);return t!=null&&(n=="object"||n=="function")})}function Wot(){if(WPt)return jPt;WPt=1;var e=VZ(),t=qy();return jPt=function(r){if(!t(r))return!1;var o=e(r);return o=="[object Function]"||o=="[object GeneratorFunction]"||o=="[object AsyncFunction]"||o=="[object Proxy]"}}function wts(){if(ZPt)return zPt;ZPt=1;var e=function(){if(VPt)return HPt;VPt=1;var n=rO()["__core-js_shared__"];return HPt=n}(),t=function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();return zPt=function(r){return!!t&&t in r}}function RHn(){if(XPt)return YPt;XPt=1;var e=Function.prototype.toString;return YPt=function(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}}function RQ(){if($Pt)return _Pt;$Pt=1;var e=function(){if(GPt)return qPt;GPt=1;var n=Wot(),r=wts(),o=qy(),s=RHn(),a=/^\[object .+?Constructor\]$/,l=Function.prototype,d=Object.prototype,u=l.toString,h=d.hasOwnProperty,f=RegExp("^"+u.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return qPt=function(k){return!(!o(k)||r(k))&&(n(k)?f:a).test(s(k))}}(),t=JPt?KPt:(JPt=1,KPt=function(r,o){return r==null?void 0:r[o]});return _Pt=function(r,o){var s=t(r,o);return e(s)?s:void 0}}function Hot(){if(tMt)return eMt;tMt=1;var e=RQ()(rO(),"Map");return eMt=e}function hde(){if(iMt)return nMt;iMt=1;var e=RQ()(Object,"create");return nMt=e}function yts(){if(gMt)return fMt;gMt=1;var e=function(){if(oMt)return rMt;oMt=1;var a=hde();return rMt=function(){this.__data__=a?a(null):{},this.size=0}}(),t=aMt?sMt:(aMt=1,sMt=function(l){var d=this.has(l)&&delete this.__data__[l];return this.size-=d?1:0,d}),n=function(){if(cMt)return lMt;cMt=1;var a=hde(),l=Object.prototype.hasOwnProperty;return lMt=function(u){var h=this.__data__;if(a){var f=h[u];return f==="__lodash_hash_undefined__"?void 0:f}return l.call(h,u)?h[u]:void 0}}(),r=function(){if(uMt)return dMt;uMt=1;var a=hde(),l=Object.prototype.hasOwnProperty;return dMt=function(u){var h=this.__data__;return a?h[u]!==void 0:l.call(h,u)}}(),o=function(){if(AMt)return hMt;AMt=1;var a=hde();return hMt=function(d,u){var h=this.__data__;return this.size+=this.has(d)?0:1,h[d]=a&&u===void 0?"__lodash_hash_undefined__":u,this}}();function s(a){var l=-1,d=a==null?0:a.length;for(this.clear();++l-1&&t%1==0&&t<=9007199254740991})}function Twe(){if(bRt)return pRt;bRt=1;var e=Wot(),t=YHn();return pRt=function(r){return r!=null&&t(r.length)&&!e(r)}}var yRt,CRt,WTe={exports:{}},xRt,LRt,SRt,TRt,ERt,DRt,QRt;function Yot(){return xRt||(xRt=1,function(e,t){var n=rO(),r=CRt?yRt:(CRt=1,yRt=function(){return!1}),o=t&&!t.nodeType&&t,s=o&&e&&!e.nodeType&&e,a=s&&s.exports===o?n.Buffer:void 0,l=(a?a.isBuffer:void 0)||r;e.exports=l}(WTe,WTe.exports)),WTe.exports}function Xot(){return QRt?DRt:(QRt=1,DRt=function(t){return function(n){return t(n)}})}var BRt,FRt,PRt,MRt,RRt,IRt,NRt,HTe,URt,jRt,WRt,HRt,VRt,zRt,ZRt,YRt,XRt,qRt,GRt,KRt,JRt,_Rt,$Rt,VTe,eIt,zTe,tIt,nIt,iIt,rIt,oIt,ZTe,sIt,aIt,lIt,cIt,dIt,YTe,uIt,hIt,AIt,fIt,gIt,XTe,mIt,qTe,kIt,vIt,pIt,GTe={exports:{}};function qot(){return BRt||(BRt=1,e=GTe,t=GTe.exports,n=MHn(),r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,s=o&&o.exports===r&&n.process,a=function(){try{var l=o&&o.require&&o.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}(),e.exports=a),GTe.exports;var e,t,n,r,o,s,a}function XHn(){if(PRt)return FRt;PRt=1;var e=function(){if(ERt)return TRt;ERt=1;var s=VZ(),a=YHn(),l=_T(),d={};return d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d["[object Arguments]"]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d["[object Function]"]=d["[object Map]"]=d["[object Number]"]=d["[object Object]"]=d["[object RegExp]"]=d["[object Set]"]=d["[object String]"]=d["[object WeakMap]"]=!1,TRt=function(h){return l(h)&&a(h.length)&&!!d[s(h)]}}(),t=Xot(),n=qot(),r=n&&n.isTypedArray,o=r?t(r):e;return FRt=o}function qHn(){return RRt?MRt:(RRt=1,MRt=function(t,n){if((n!=="constructor"||typeof t[n]!="function")&&n!="__proto__")return t[n]})}function GHn(){if(NRt)return IRt;NRt=1;var e=Vot(),t=Swe(),n=Object.prototype.hasOwnProperty;return IRt=function(o,s,a){var l=o[s];n.call(o,s)&&t(l,a)&&(a!==void 0||s in o)||e(o,s,a)}}function vG(){if(URt)return HTe;URt=1;var e=GHn(),t=Vot();return HTe=function(r,o,s,a){var l=!s;s||(s={});for(var d=-1,u=o.length;++d-1&&n%1==0&&n0){if(++a>=800)return arguments[0]}else a=0;return s.apply(void 0,arguments)}},YTe}(),n=t(e);return hIt=n}function Qts(){if(kIt)return qTe;kIt=1;var e=function(){if(gIt)return fIt;gIt=1;var n=_Hn(),r=Tts(),o=Dts();return fIt=function(a,l){return o(r(a,l,n),a+"")}}(),t=function(){if(mIt)return XTe;mIt=1;var n=Swe(),r=Twe(),o=KHn(),s=qy();return XTe=function(l,d,u){if(!s(u))return!1;var h=bn(d);return!!(h=="number"?r(u)&&o(d,u.length):h=="string"&&d in u)&&n(u[d],l)},XTe}();return qTe=function(r){return e(function(o,s){var a=-1,l=s.length,d=l>1?s[l-1]:void 0,u=l>2?s[2]:void 0;for(d=r.length>3&&typeof d=="function"?(l--,d):void 0,u&&t(s[0],s[1],u)&&(d=l<3?void 0:d,l=1),o=Object(o);++a1?arguments[1]:void 0,p=v!==void 0;p&&(v=e(v,m>2?arguments[2]:void 0));var b,O,w,y,C,x,L=u(k),S=0;if(!L||this===h&&o(L))for(b=a(k),O=A?new this(b):h(b);b>S;S++)x=p?v(k[S],S):k[S],l(O,S,x);else for(O=A?new this:[],C=(y=d(k,L)).next;!(w=t(C,y)).done;S++)x=p?r(y,v,[w.value,S],!0):w.value,l(O,S,x);return O.length=S,O},$Te}function nVn(){if(NIt)return IIt;NIt=1;var e=Kc()("iterator"),t=!1;try{var n=0,r={next:function(){return{done:!!n++}},return:function(){t=!0}};r[e]=function(){return this},Array.from(r,function(){throw 2})}catch{}return IIt=function(s,a){try{if(!a&&!t)return!1}catch{return!1}var l=!1;try{var d={};d[e]=function(){return{next:function(){return{done:l=!0}}}},s(d)}catch{}return l}}function Uts(){return WIt?jIt:(WIt=1,sR(),function(){if(UIt)return Its;UIt=1;var e=ai(),t=tVn();e({target:"Array",stat:!0,forced:!nVn()(function(n){Array.from(n)})},{from:t})}(),jIt=Ol().Array.from)}function iVn(){return VIt?HIt:(VIt=1,HIt=Uts())}var YIt,XIt,qIt,GIt,KIt,JIt,_It,$It,Xl=ji(ZIt?zIt:(ZIt=1,zIt=iVn()));function jts(){return XIt?YIt:(XIt=1,kC(),YIt=Jc()("Array","keys"))}function Wts(){return GIt?qIt:(GIt=1,qIt=jts())}function Hts(){if(JIt)return KIt;JIt=1,H6();var e=j6(),t=Xd(),n=wl(),r=Wts(),o=Array.prototype,s={DOMTokenList:!0,NodeList:!0};return KIt=function(l){var d=l.keys;return l===o||n(o,l)&&d===o.keys||t(s,e(l))?r:d}}var eNt,tNt,nNt,iNt,rNt,oNt,sNt,aNt,lNt,gL=ji($It?_It:($It=1,_It=Hts())),Vts={};function zts(){return nNt?tNt:(nNt=1,function(){if(eNt)return Vts;eNt=1;var e=ai(),t=W6().findIndex,n=zre(),r="findIndex",o=!0;r in[]&&Array(1)[r](function(){o=!1}),e({target:"Array",proto:!0,forced:o},{findIndex:function(a){return t(this,a,arguments.length>1?arguments[1]:void 0)}}),n(r)}(),tNt=Jc()("Array","findIndex"))}function Zts(){if(rNt)return iNt;rNt=1;var e=wl(),t=zts(),n=Array.prototype;return iNt=function(o){var s=o.findIndex;return o===n||e(n,o)&&s===n.findIndex?t:s}}function Yts(){return sNt?oNt:(sNt=1,oNt=Zts())}var cNt,dNt,uNt,hNt,ANt,fNt,gNt,mNt,kNt,vNt,pNt,bNt,ONt,fke=ji(lNt?aNt:(lNt=1,aNt=Yts())),Xts={};function rVn(){if(dNt)return cNt;dNt=1;var e=Ed(),t=oR(),n=TypeError,r=Object.getOwnPropertyDescriptor,o=e&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(s){return s instanceof TypeError}}();return cNt=o?function(s,a){if(t(s)&&!r(s,"length").writable)throw new n("Cannot set read only .length");return s.length=a}:function(s,a){return s.length=a}}function oVn(){if(hNt)return uNt;hNt=1;var e=IE(),t=TypeError;return uNt=function(r,o){if(!delete r[o])throw new t("Cannot delete property "+e(o)+" of "+e(r))}}function qts(){return gNt?fNt:(gNt=1,function(){if(ANt)return Xts;ANt=1;var e=ai(),t=Bg(),n=Nre(),r=UZ(),o=_O(),s=rVn(),a=Rot(),l=Mot(),d=Vre(),u=oVn(),h=Hre()("splice"),f=Math.max,g=Math.min;e({target:"Array",proto:!0,forced:!h},{splice:function(A,m){var v,p,b,O,w,y,C=t(this),x=o(C),L=n(A,x),S=arguments.length;for(S===0?v=p=0:S===1?(v=0,p=x-L):(v=S-2,p=g(f(r(m),0),x-L)),a(x+v-p),b=l(C,p),O=0;Ox-p+v;O--)u(C,O-1)}else if(v>p)for(O=x-p;O>L;O--)y=O+v-1,(w=O+p-1)in C?C[y]=C[w]:u(C,y);for(O=0;O>>0||(h(u,A)?16:10))}:a}function ins(){return HNt?WNt:(HNt=1,function(){if(jNt)return nns;jNt=1;var e=ai(),t=sVn();e({global:!0,forced:parseInt!==t},{parseInt:t})}(),WNt=Ol().parseInt)}function rns(){return zNt?VNt:(zNt=1,VNt=ins())}var ry=ji(YNt?ZNt:(YNt=1,ZNt=rns()));function d6(e,t){var n,r,o,s=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return/^\n/.test(e)?s?((n=(r=e.match(/^\n+/g))===null||r===void 0||(o=r[0])===null||o===void 0?void 0:o.length)!==null&&n!==void 0?n:0)>1?` `.concat(t):` `.concat(t):` `.concat(t):t}function UXe(e,t){var n=(e.match(/\n/g)||[]).length;return e!==""&&(n-=2),n+t}var XNt,qNt,GNt,KNt,JNt,_Nt,$Nt;function ons(){return GNt?qNt:(GNt=1,XNt||(XNt=1,ai()({target:"Array",stat:!0},{isArray:oR()})),qNt=Ol().Array.isArray)}function aVn(){return JNt?KNt:(JNt=1,KNt=ons())}var MA=ji($Nt?_Nt:($Nt=1,_Nt=aVn()));function sns(e,t){if(MA(t))return t}function lVn(e){return typeof localStorage<"u"&&localStorage.getItem("cherry-".concat(e))!==null}function cVn(){var e="false";return typeof localStorage<"u"&&(e=localStorage.getItem("cherry-classicBr")),e==="true"}function eEe(e,t){var n;return typeof localStorage<"u"&&!!localStorage.getItem(nt(n="".concat(e,"-")).call(n,t))}function eUt(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"cherry",n="default";if(typeof localStorage<"u"){var r=localStorage.getItem("".concat(t,"-theme"));r&&(n=r)}return e?"theme__".concat(n):n}function ans(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"cherry",t="default";if(typeof localStorage<"u"){var n=localStorage.getItem("".concat(e,"-codeTheme"));n&&(t=n)}return t}var tUt,nUt,iUt,rUt,oUt,sUt,aUt,lns={};function cns(){return iUt?nUt:(iUt=1,function(){if(tUt)return lns;tUt=1;var e=ai(),t=Ks(),n=Nre(),r=RangeError,o=String.fromCharCode,s=String.fromCodePoint,a=t([].join);e({target:"String",stat:!0,arity:1,forced:!!s&&s.length!==1},{fromCodePoint:function(d){for(var u,h=[],f=arguments.length,g=0;f>g;){if(u=+arguments[g++],n(u,1114111)!==u)throw new r(u+" is not a valid code point");h[g]=u<65536?o(u):o(55296+((u-=65536)>>10),u%1024+56320)}return a(h,"")}})}(),nUt=Ol().String.fromCodePoint)}function dns(){return oUt?rUt:(oUt=1,rUt=cns())}var lUt,cUt,dUt,uUt,hUt,AUt,fUt,gUt,mUt,jXe=ji(aUt?sUt:(aUt=1,sUt=dns())),uns={};function hns(){return dUt?cUt:(dUt=1,function(){if(lUt)return uns;lUt=1;var e=ai(),t=Rre(),n=Bot().indexOf,r=jZ(),o=t([].indexOf),s=!!o&&1/o([1],1,-0)<0;e({target:"Array",proto:!0,forced:s||!r("indexOf")},{indexOf:function(l){var d=arguments.length>1?arguments[1]:void 0;return s?o(this,l,d)||0:n(this,l,d)}})}(),cUt=Jc()("Array","indexOf"))}function Ans(){if(hUt)return uUt;hUt=1;var e=wl(),t=hns(),n=Array.prototype;return uUt=function(o){var s=o.indexOf;return o===n||e(n,o)&&s===n.indexOf?t:s}}function dVn(){return fUt?AUt:(fUt=1,AUt=Ans())}var kUt,vUt,Ys=ji(mUt?gUt:(mUt=1,gUt=dVn()));function pUt(e,t){var n=ol(e);if(Yu){var r=Yu(e);t&&(r=Sd(r).call(r,function(o){return Ju(e,o).enumerable})),n.push.apply(n,r)}return n}function uN(e){for(var t=1;t":">","&":"&",'"':""","'":"'"},fns={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"},Jot=uN(uN(uN(uN(uN(uN({},{34:""",38:"&",39:"'",60:"<",62:">"}),{192:"À",193:"Á",194:"Â",195:"Ã",196:"Ä",197:"Å",198:"Æ",199:"Ç",200:"È",201:"É",202:"Ê",203:"Ë",204:"Ì",205:"Í",206:"Î",207:"Ï",208:"Ð",209:"Ñ",210:"Ò",211:"Ó",212:"Ô",213:"Õ",214:"Ö",216:"Ø",217:"Ù",218:"Ú",219:"Û",220:"Ü",221:"Ý",222:"Þ",223:"ß",224:"à",225:"á",226:"â",227:"ã",228:"ä",229:"å",230:"æ",231:"ç",232:"è",233:"é",234:"ê",235:"ë",236:"ì",237:"í",238:"î",239:"ï",240:"ð",241:"ñ",242:"ò",243:"ó",244:"ô",245:"õ",246:"ö",248:"ø",249:"ù",250:"ú",251:"û",252:"ü",253:"ý",254:"þ",255:"ÿ"}),{160:" ",161:"¡",162:"¢",163:"£",164:"¤",165:"¥",166:"¦",167:"§",168:"¨",169:"©",170:"ª",171:"«",172:"¬",173:"­",174:"®",175:"¯",176:"°",177:"±",178:"²",179:"³",180:"´",181:"µ",182:"¶",184:"¸",185:"¹",186:"º",187:"»",188:"¼",189:"½",190:"¾",191:"¿",215:"×",247:"÷"}),{8704:"∀",8706:"∂",8707:"∃",8709:"∅",8711:"∇",8712:"∈",8713:"∉",8715:"∋",8719:"∏",8721:"∑",8722:"−",8727:"∗",8730:"√",8733:"∝",8734:"∞",8736:"∠",8743:"∧",8744:"∨",8745:"∩",8746:"∪",8747:"∫",8756:"∴",8764:"∼",8773:"≅",8776:"≈",8800:"≠",8801:"≡",8804:"≤",8805:"≥",8834:"⊂",8835:"⊃",8836:"⊄",8838:"⊆",8839:"⊇",8853:"⊕",8855:"⊗",8869:"⊥",8901:"⋅"}),{913:"Α",914:"Β",915:"Γ",916:"Δ",917:"Ε",918:"Ζ",919:"Η",920:"Θ",921:"Ι",922:"Κ",923:"Λ",924:"Μ",925:"Ν",926:"Ξ",927:"Ο",928:"Π",929:"Ρ",931:"Σ",932:"Τ",933:"Υ",934:"Φ",935:"Χ",936:"Ψ",937:"Ω",945:"α",946:"β",947:"γ",948:"δ",949:"ε",950:"ζ",951:"η",952:"θ",953:"ι",954:"κ",955:"λ",956:"μ",957:"ν",958:"ξ",959:"ο",960:"π",961:"ρ",962:"ς",963:"σ",964:"τ",965:"υ",966:"φ",967:"χ",968:"ψ",969:"ω",977:"ϑ",978:"ϒ",982:"ϖ"}),{338:"Œ",339:"œ",352:"Š",353:"š",376:"Ÿ",402:"ƒ",710:"ˆ",732:"˜",8194:" ",8195:" ",8201:" ",8204:"‌",8205:"‍",8206:"‎",8207:"‏",8211:"–",8212:"—",8216:"‘",8217:"’",8218:"‚",8220:"“",8221:"”",8222:"„",8224:"†",8225:"‡",8226:"•",8230:"…",8240:"‰",8242:"′",8243:"″",8249:"‹",8250:"›",8254:"‾",8364:"€",8482:"™",8592:"←",8593:"↑",8594:"→",8595:"↓",8596:"↔",8629:"↵",8968:"⌈",8969:"⌉",8970:"⌊",8971:"⌋",9674:"◊",9824:"♠",9827:"♣",9829:"♥",9830:"♦"}),OUt=ol(Jot),wUt=cs(OUt).call(OUt,function(e){return Jot[e].replace(/^&(\w+);$/g,function(t,n){return n.toLowerCase()})}),WXe=function(t){return typeof t!="string"||t.length<=0},yUt=function(t){try{var n=jXe(t);return!WXe(n)}catch{return!1}},Xre=["h1|h2|h3|h4|h5|h6","ul|ol|li|dd|dl|dt","table|thead|tbody|tfoot|col|colgroup|th|td|tr","div|article|section|footer|aside|details|summary|code|audio|video|canvas|figure","address|center|cite|p|pre|blockquote|marquee|caption|figcaption|track|source|output|svg"].join("|"),gns=["span|a|link|b|s|i|del|u|em|strong|sup|sub|kbd","nav|font|bdi|samp|map|area|small|time|bdo|var|wbr|meter|dfn","ruby|rt|rp|mark|q|progress|input|textarea|select|ins"].join("|"),mns=new RegExp(nt(kUt=nt(vUt="^(".concat(Xre,"|")).call(vUt,gns,"|")).call(kUt,"br|img|hr",")( |$|/)"),"i");function eM(e,t){return typeof e!="string"?"":t?e.replace(/[<>&]/g,function(n){return bUt[n]||n}):e.replace(/[<>&"']/g,function(n){return bUt[n]||n})}function G0(e,t){if(typeof e!="string")return"";var n=uVn(e);return n=function(r){return typeof r!="string"?"":r.replace(/&(\w+);?/g,function(o,s){return fns[s]||o})}(n),eM(n,t)}function uVn(e){return e.replace(/&#(\d+);?/g,function(t,n){return Jot[n]||t})}function kns(e){var t=function(o){return o.replace(/&#x([0-9a-f]+);?/gi,function(s,a){var l=ry("0x".concat(a),16);try{return jXe(l)}catch{return s}})}(function(o){return o.replace(/&#(\d+);?/g,function(s,a){try{return jXe(a)}catch{return s}})}(e)).match(/^\s*([\w\W]+?)(?=:)/i);if(!t)return!0;var n=["javascript","data"],r=t[1].replace(/[\s]/g,"");return Ys(n).call(n,r.toLowerCase())===-1}function N5(e){return encodeURI(e).replace(/%25/g,"%")}function hVn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(hVn=function(){return!!e})()}var CUt=0,mc=function(){function e(){var t,n,r,o,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{needCache:!1},a=s.needCache,l=s.defaultCache,d=l===void 0?{}:l;return Er(this,e),n=this,o=[{}],r=gi(r=e),(t=rs(n,hVn()?Di(r,o||[],gi(n).constructor):r.apply(n,o))).needCache=!!a,t.sign="",a&&(t.cache=d||{},t.cacheKey="~~C".concat(CUt),CUt+=1),t.failedResetCacheTimes=0,t.cacheData={},t.cacheDataMap=[],t}return vs(e,yu),Dr(e,[{key:"cacheAndGetData",value:function(n,r,o,s){var a=this;if(!this.cacheData[n]){if(this.cacheDataMap.length>o){var l,d=Ov(l=this.cacheDataMap).call(l,s);vi(d).call(d,function(u){delete a.cacheData[u]})}this.cacheData[n]=r(n),this.cacheDataMap.push(n)}return this.cacheData[n]}},{key:"initBrReg",value:function(){var n=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.classicBr=lVn("classicBr")?cVn():n,this.removeBrAfterBlock=null,this.removeBrBeforeBlock=null,this.removeNewlinesBetweenTags=null}},{key:"$cleanParagraph",value:function(n){var r=n.replace(/^\n+/,"").replace(/\n+$/,"");return this.classicBr?r:this.joinRawHtml(r).replace(/\n/g,"
").replace(/\r/g,` `)}},{key:"joinRawHtml",value:function(n){if(!this.removeBrAfterBlock){var r,o,s,a,l=(r=(o=this.$engine.htmlWhiteListAppend)===null||o===void 0?void 0:o.split("|"))!==null&&r!==void 0?r:[];l=Sd(s=cs(l).call(l,function(u){return/[a-z-]+/gi.test(u)?u:null})).call(s,function(u){return u!==null});var d=nt(l).call(l,Xre).join("|");this.removeBrAfterBlock=new RegExp("<(".concat(d,")(>| [^>]*?>)[^\\S\\n]*?\\n"),"ig"),this.removeBrBeforeBlock=new RegExp("\\n[^\\S\\n]*?<\\/(".concat(d,")>[^\\S\\n]*?\\n"),"ig"),this.removeNewlinesBetweenTags=new RegExp(nt(a="<\\/(".concat(d,")>[^\\S\\n]*?\\n([^\\S\\n]*?)<(")).call(a,d,")(>| [^>]*?>)"),"ig")}return n.replace(this.removeBrAfterBlock,"<$1$2").replace(this.removeBrBeforeBlock,"").replace(this.removeNewlinesBetweenTags,"\r$2<$3$4")}},{key:"toHtml",value:function(n,r){return n}},{key:"beforeMakeHtml",value:function(n){return n}},{key:"makeHtml",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(o){return{sign:"",html:o}};return this.needCache?n:r(n).html}},{key:"afterMakeHtml",value:function(n){return this.restoreCache(n)}},{key:"isContainsCache",value:function(n,r){if(r){var o=/^(\s*~~C\d+I\w+\$\s*)+$/g.test(n),s=new RegExp("~~C\\d+I".concat(e.IN_PARAGRAPH_CACHE_KEY_PREFIX_REGEX,"\\w+\\$"),"g").test(n);return o&&!s}return new RegExp("~~C\\d+I(?!".concat(e.IN_PARAGRAPH_CACHE_KEY_PREFIX_REGEX,")\\w+\\$"),"g").test(n)}},{key:"$splitHtmlByCache",value:function(n){var r=new RegExp("\\n*~~C\\d+I(?!".concat(e.IN_PARAGRAPH_CACHE_KEY_PREFIX_REGEX,")\\w+\\$\\n?"),"g");return{caches:n.match(r),contents:n.split(r)}}},{key:"makeExcludingCached",value:function(n,r){for(var o=this.$splitHtmlByCache(n),s=o.caches,a=o.contents,l=cs(a).call(a,r),d="",u=0;u2&&arguments[2]!==void 0&&arguments[2],f=(o=(s=r.match(/^\n+/))===null||s===void 0?void 0:s[0])!==null&&o!==void 0?o:"",g=(a=(l=r.match(/\n+$/))===null||l===void 0?void 0:l[0])!==null&&a!==void 0?a:"";return h?d6(r,n):nt(d=nt(u="".concat(f)).call(u,n)).call(d,g)}},{key:"getLineCount",value:function(n){var r,o,s,a=n,l=(r=(o=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"").match(/^\n+/g))===null||o===void 0||(s=o[0])===null||s===void 0?void 0:s.length)!==null&&r!==void 0?r:0;l=l===1?1:0,a=a.replace(/^\n+/g,"");var d=new RegExp(` *~~C\\d+I(?:`.concat(e.IN_PARAGRAPH_CACHE_KEY_PREFIX_REGEX,")?\\w+?_L(\\d+)\\$"),"g"),u=0;return a=a.replace(d,function(h,f){return u+=ry(f,10),h.replace(/^\n+/g,"")}),l+u+(a.match(/\n/g)||[]).length+1}},{key:"pushCache",value:function(n){var r,o,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(this.needCache){var l=s||this.$engine.hash(n),d=nt(r=nt(o="".concat(this.cacheKey,"I")).call(o,l,"_L")).call(r,a,"$");return this.cache[l]={content:n,key:d},d}}},{key:"popCache",value:function(n){if(this.needCache)return this.cache[n].content||""}},{key:"testHasCache",value:function(n){return!(!this.needCache||!this.cache[n])&&this.cache[n].key}},{key:"resetCache",value:function(){this.needCache&&(this.cache={})}},{key:"restoreCache",value:function(n){var r,o=this;if(!this.needCache)return n;var s=new RegExp(nt(r="".concat(this.cacheKey,"I((?:")).call(r,e.IN_PARAGRAPH_CACHE_KEY_PREFIX_REGEX,")?\\w+)\\$"),"g"),a=n.replace(s,function(l,d){return o.popCache(d.replace(/_L\d+$/,""))});return this.timer&&(clearTimeout(this.timer),this.failedResetCacheTimes+=1,this.timer=null),this.timer=Iu(function(){o.resetCache()},500),this.failedResetCacheTimes>5&&(this.failedResetCacheTimes=0,Iu(function(){o.resetCache()},500)),a}},{key:"checkCache",value:function(n,r){var o,s,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.sign=this.$engine.hash(n),this.cache[this.sign]?nt(o=nt(s="".concat(this.cacheKey,"I")).call(s,this.sign,"_L")).call(o,a,"$"):this.toHtml(n,r)}},{key:"mounted",value:function(){}},{key:"signWithCache",value:function(n){return!1}}])}();ei(mc,"HOOK_TYPE",az.PAR),ei(mc,"IN_PARAGRAPH_CACHE_KEY_PREFIX","!"),ei(mc,"IN_PARAGRAPH_CACHE_KEY_PREFIX_REGEX","\\!");var xUt,LUt,SUt,TUt,EUt,DUt,vns={},tEe={exports:{}};function pns(){return LUt?xUt:(LUt=1,xUt=Ps()(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))}function bns(){if(TUt)return SUt;TUt=1;var e=Ps(),t=Ku(),n=mC(),r=pns(),o=Object.isExtensible,s=e(function(){});return SUt=s||r?function(a){return!!t(a)&&(!r||n(a)!=="ArrayBuffer")&&(!o||o(a))}:o}function Ons(){return DUt?EUt:(DUt=1,EUt=!Ps()(function(){return Object.isExtensible(Object.preventExtensions({}))}))}var QUt,nEe,BUt,FUt,PUt,MUt,RUt,IUt,NUt,UUt,jUt,iEe,WUt,HUt,VUt;function AVn(){if(QUt)return tEe.exports;QUt=1;var e=ai(),t=Ks(),n=Ure(),r=Ku(),o=Xd(),s=Q2().f,a=Owe(),l=iHn(),d=bns(),u=kwe(),h=Ons(),f=!1,g=u("meta"),k=0,A=function(p){s(p,g,{value:{objectID:"O"+k++,weakData:{}}})},m=tEe.exports={enable:function(){m.enable=function(){},f=!0;var p=a.f,b=t([].splice),O={};O[g]=1,p(O).length&&(a.f=function(w){for(var y=p(w),C=0,x=y.length;CO;O++)if((y=P(A[O]))&&a(g,y))return y;return new f(!1)}p=l(A,b)}for(C=E?A.next:p.next;!(x=t(C,p)).done;){try{y=P(x.value)}catch(F){u(p,"throw",F)}if(bn(y)=="object"&&y&&a(g,y))return y}return new f(!1)},nEe}function qre(){if(PUt)return FUt;PUt=1;var e=wl(),t=TypeError;return FUt=function(r,o){if(e(o,r))return r;throw new t("Incorrect invocation")}}function fVn(){if(RUt)return MUt;RUt=1;var e=ai(),t=vc(),n=AVn(),r=Ps(),o=N6(),s=FO(),a=qre(),l=Gc(),d=Ku(),u=rR(),h=Xy(),f=Q2().f,g=W6().forEach,k=Ed(),A=jE(),m=A.set,v=A.getterFor;return MUt=function(b,O,w){var y,C=b.indexOf("Map")!==-1,x=b.indexOf("Weak")!==-1,L=C?"set":"add",S=t[b],E=S&&S.prototype,Q={};if(k&&l(S)&&(x||E.forEach&&!r(function(){new S().entries().next()}))){var T=(y=O(function(B,P){m(a(B,T),{type:b,collection:new S}),u(P)||s(P,B[L],{that:B,AS_ENTRIES:C})})).prototype,M=v(b);g(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(B){var P=B==="add"||B==="set";!(B in E)||x&&B==="clear"||o(T,B,function(F,R){var N=M(this).collection;if(!P&&x&&!d(F))return B==="get"&&void 0;var I=N[B](F===0?0:F,R);return P?this:I})}),x||f(T,"size",{configurable:!0,get:function(){return M(this).collection.size}})}else y=w.getConstructor(O,b,C,L),n.enable();return h(y,b,!1,!0),Q[b]=y,e({global:!0,forced:!0},Q),x||w.setStrong(y,b,C),y}}function gVn(){if(NUt)return IUt;NUt=1;var e=Yy();return IUt=function(n,r,o){for(var s in r)o&&o.unsafe&&n[s]?n[s]=r[s]:e(n,s,r[s],o);return n}}function mVn(){if(jUt)return UUt;jUt=1;var e=aA(),t=Wre(),n=Kc(),r=Ed(),o=n("species");return UUt=function(a){var l=e(a);r&&l&&!l[o]&&t(l,o,{configurable:!0,get:function(){return this}})}}function kVn(){if(WUt)return iEe;WUt=1;var e=UE(),t=Wre(),n=gVn(),r=rg(),o=qre(),s=rR(),a=FO(),l=Iot(),d=xwe(),u=mVn(),h=Ed(),f=AVn().fastKey,g=jE(),k=g.set,A=g.getterFor;return iEe={getConstructor:function(v,p,b,O){var w=v(function(S,E){o(S,y),k(S,{type:p,index:e(null),first:void 0,last:void 0,size:0}),h||(S.size=0),s(E)||a(E,S[O],{that:S,AS_ENTRIES:b})}),y=w.prototype,C=A(p),x=function(E,Q,T){var M,B,P=C(E),F=L(E,Q);return F?F.value=T:(P.last=F={index:B=f(Q,!0),key:Q,value:T,previous:M=P.last,next:void 0,removed:!1},P.first||(P.first=F),M&&(M.next=F),h?P.size++:E.size++,B!=="F"&&(P.index[B]=F)),E},L=function(E,Q){var T,M=C(E),B=f(Q);if(B!=="F")return M.index[B];for(T=M.first;T;T=T.next)if(T.key===Q)return T};return n(y,{clear:function(){for(var E=C(this),Q=E.first;Q;)Q.removed=!0,Q.previous&&(Q.previous=Q.previous.next=void 0),Q=Q.next;E.first=E.last=void 0,E.index=e(null),h?E.size=0:this.size=0},delete:function(E){var Q=this,T=C(Q),M=L(Q,E);if(M){var B=M.next,P=M.previous;delete T.index[M.index],M.removed=!0,P&&(P.next=B),B&&(B.previous=P),T.first===M&&(T.first=B),T.last===M&&(T.last=P),h?T.size--:Q.size--}return!!M},forEach:function(E){for(var Q,T=C(this),M=r(E,arguments.length>1?arguments[1]:void 0);Q=Q?Q.next:T.first;)for(M(Q.value,Q.key,this);Q&&Q.removed;)Q=Q.previous},has:function(E){return!!L(this,E)}}),n(y,b?{get:function(E){var Q=L(this,E);return Q&&Q.value},set:function(E,Q){return x(this,E===0?0:E,Q)}}:{add:function(E){return x(this,E=E===0?0:E,E)}}),h&&t(y,"size",{configurable:!0,get:function(){return C(this).size}}),w},setStrong:function(v,p,b){var O=p+" Iterator",w=A(p),y=A(O);l(v,p,function(C,x){k(this,{type:O,target:C,state:w(C),kind:x,last:void 0})},function(){for(var C=y(this),x=C.kind,L=C.last;L&&L.removed;)L=L.previous;return C.target&&(C.last=L=L?L.next:C.state.first)?d(x==="keys"?L.key:x==="values"?L.value:[L.key,L.value],!1):(C.target=void 0,d(void 0,!0))},b?"entries":"values",!b,!0),u(p)}},iEe}function wns(){return VUt||(VUt=1,HUt||(HUt=1,fVn()("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},kVn()))),vns}var zUt,ZUt,YUt,XUt,qUt,GUt,KUt,JUt,_Ut,$Ut={};function vVn(){return ZUt?zUt:(ZUt=1,zUt=function(t,n){return n===1?function(r,o){return r[t](o)}:function(r,o,s){return r[t](o,s)}})}function lb(){if(XUt)return YUt;XUt=1;var e=aA(),t=vVn(),n=e("Map");return YUt={Map:n,set:t("set",2),get:t("get",1),has:t("has",1),remove:t("delete",1),proto:n.prototype}}function pVn(){if(qUt)return $Ut;qUt=1;var e=ai(),t=Ks(),n=rA(),r=Q4(),o=FO(),s=lb(),a=N1(),l=Ps(),d=s.Map,u=s.has,h=s.get,f=s.set,g=t([].push),k=a||l(function(){return d.groupBy("ab",function(A){return A}).get("a").length!==1});return e({target:"Map",stat:!0,forced:a||k},{groupBy:function(m,v){r(m),n(v);var p=new d,b=0;return o(m,function(O){var w=v(O,b++);u(p,w)?g(h(p,w),O):f(p,w,[O])}),p}}),$Ut}function yns(){return KUt?GUt:(KUt=1,kC(),wns(),pVn(),sR(),GUt=Ol().Map)}function bVn(){if(_Ut)return JUt;_Ut=1;var e=yns();return H6(),JUt=e}var ejt,tjt,njt;function Cns(){if(njt)return tjt;njt=1;var e=bVn();return ejt||(ejt=1,pVn()),tjt=e}var rEe,ijt,rjt,xns={};function Lns(){if(ijt)return rEe;ijt=1;var e=rg(),t=ZA(),n=Bg(),r=FO();return rEe=function(s,a,l){return function(d){var u=n(d),h=arguments.length,f=h>1?arguments[1]:void 0,g=f!==void 0,k=g?e(f,h>2?arguments[2]:void 0):void 0,A=new s,m=0;return r(u,function(v){var p=g?k(v,m++):v;l?a(A,t(p)[0],p[1]):a(A,p)}),A}},rEe}var oEe,ojt,sjt,Sns={};function Tns(){if(ojt)return oEe;ojt=1;var e=ZA();return oEe=function(n,r,o){return function(){for(var s=new n,a=arguments.length,l=0;l2?arguments[2]:void 0;if(!n(l)&&!n(k))throw new o("At least one callback required");return e(f,u,a)?(d=e(h,u,a),n(l)&&(d=l(d),e(g,u,a,d))):n(k)&&(d=k(),e(g,u,a,d)),d},lEe}var Qjt,Bjt,Fjt,Pjt,Mjt;function Zns(){if(Fjt)return Bjt;Fjt=1;var e=Cns();return function(){if(rjt)return xns;rjt=1;var t=ai(),n=lb();t({target:"Map",stat:!0,forced:!0},{from:Lns()(n.Map,n.set,!0)})}(),function(){if(sjt)return Sns;sjt=1;var t=ai(),n=lb();t({target:"Map",stat:!0,forced:!0},{of:Tns()(n.Map,n.set,!0)})}(),function(){if(cjt)return Ens;cjt=1;var t=ai(),n=p0(),r=lb().remove;t({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var s,a=n(this),l=!0,d=0,u=arguments.length;d1?arguments[1]:void 0);return o(l,function(u,h){if(!d(u,h,l))return!1},!0)!==!1}})}(),function(){if(fjt)return Bns;fjt=1;var t=ai(),n=rg(),r=p0(),o=lb(),s=D3(),a=o.Map,l=o.set;t({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(u){var h=r(this),f=n(u,arguments.length>1?arguments[1]:void 0),g=new a;return s(h,function(k,A){f(k,A,h)&&l(g,A,k)}),g}})}(),function(){if(gjt)return Fns;gjt=1;var t=ai(),n=rg(),r=p0(),o=D3();t({target:"Map",proto:!0,real:!0,forced:!0},{find:function(a){var l=r(this),d=n(a,arguments.length>1?arguments[1]:void 0),u=o(l,function(h,f){if(d(h,f,l))return{value:h}},!0);return u&&u.value}})}(),function(){if(mjt)return Pns;mjt=1;var t=ai(),n=rg(),r=p0(),o=D3();t({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(a){var l=r(this),d=n(a,arguments.length>1?arguments[1]:void 0),u=o(l,function(h,f){if(d(h,f,l))return{key:f}},!0);return u&&u.key}})}(),function(){if(pjt)return Mns;pjt=1;var t=ai(),n=Rns(),r=p0(),o=D3();t({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(a){return o(r(this),function(l){if(n(l,a))return!0},!0)===!0}})}(),function(){if(bjt)return Ins;bjt=1;var t=ai(),n=ud(),r=FO(),o=Gc(),s=rA(),a=lb().Map;t({target:"Map",stat:!0,forced:!0},{keyBy:function(d,u){var h=new(o(this)?this:a);s(u);var f=s(h.set);return r(d,function(g){n(f,h,u(g),g)}),h}})}(),function(){if(Ojt)return Nns;Ojt=1;var t=ai(),n=p0(),r=D3();t({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(s){var a=r(n(this),function(l,d){if(l===s)return{key:d}},!0);return a&&a.key}})}(),function(){if(wjt)return Uns;wjt=1;var t=ai(),n=rg(),r=p0(),o=lb(),s=D3(),a=o.Map,l=o.set;t({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(u){var h=r(this),f=n(u,arguments.length>1?arguments[1]:void 0),g=new a;return s(h,function(k,A){l(g,f(k,A,h),k)}),g}})}(),function(){if(yjt)return jns;yjt=1;var t=ai(),n=rg(),r=p0(),o=lb(),s=D3(),a=o.Map,l=o.set;t({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(u){var h=r(this),f=n(u,arguments.length>1?arguments[1]:void 0),g=new a;return s(h,function(k,A){l(g,A,f(k,A,h))}),g}})}(),function(){if(Cjt)return Wns;Cjt=1;var t=ai(),n=p0(),r=FO(),o=lb().set;t({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(a){for(var l=n(this),d=arguments.length,u=0;u1?arguments[1]:void 0);return o(l,function(u,h){if(d(u,h,l))return!0},!0)===!0}})}(),function(){if(Sjt)return zns;Sjt=1;var t=ai(),n=rA(),r=p0(),o=lb(),s=TypeError,a=o.get,l=o.has,d=o.set;t({target:"Map",proto:!0,real:!0,forced:!0},{update:function(h,f){var g=r(this),k=arguments.length;n(f);var A=l(g,h);if(!A&&k<3)throw new s("Updating absent value");var m=A?a(g,h):n(k>2?arguments[2]:void 0)(h,g);return d(g,h,f(m,h,g)),g}})}(),Ejt||(Ejt=1,ai()({target:"Map",proto:!0,real:!0,forced:!0},{upsert:Djt()})),Qjt||(Qjt=1,ai()({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:Djt()})),Bjt=e}function Yns(){return Mjt?Pjt:(Mjt=1,Pjt=Zns())}var Rjt,Ijt,Njt,Ujt,jjt,Wjt,Hjt=ji(Yns());function Xns(){return Ijt?Rjt:(Ijt=1,Rjt=dVn())}function qns(){return Ujt?Njt:(Ujt=1,Njt=Xns())}function Gns(){return Wjt?jjt:(Wjt=1,jjt=qns())}var Vjt,zjt,Zjt,Yjt,Xjt,qjt,Kns=ji(Gns());function Jns(){return zjt?Vjt:(zjt=1,Vjt=nHn())}function _ns(){return Yjt?Zjt:(Yjt=1,Zjt=Jns())}function $ns(){return qjt?Xjt:(qjt=1,Xjt=_ns())}var Gjt,Kjt,Jjt,_jt,$jt,eWt,tWt,nWt,iWt,rWt,oWt,sWt,aWt,OVn=ji($ns()),eis={};function tis(){return Jjt?Kjt:(Jjt=1,function(){if(Gjt)return eis;Gjt=1;var e=ai(),t=Bg(),n=_O(),r=rVn(),o=Rot();e({target:"Array",proto:!0,arity:1,forced:Ps()(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(s){return s instanceof TypeError}}()},{push:function(a){var l=t(this),d=n(l),u=arguments.length;o(d+u);for(var h=0;h=this.hookList[g].length?this.hookList[g].push(o):Ov(p=this.hookList[g]).call(p,b,0,o)}else this.hookList[g].push(o)}}}])}();function dWt(e,t){var n=ol(e);if(Yu){var r=Yu(e);t&&(r=Sd(r).call(r,function(o){return Ju(e,o).enumerable})),n.push.apply(n,r)}return n}function uWt(e){for(var t=1;t\\x00-\\x1f"\\(\\)]*)?'),DVn=new RegExp("(?:\\/\\/)".concat(_ot.source)),fWt=new RegExp("^".concat(_ot.source,"$")),gWt=new RegExp("^".concat(DVn.source,"$")),lis=/^([ \t]*)([*+-][ ](\[[ x]\])?|[0-9一二三四五六七八九十零]+\.|[a-z]\.|\b(?:M{0,3}(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3}))\b\.)([^\r\n]*)/;function Qwe(){var e,t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],n={begin:"(?:^|\\n)(\\n*)",content:["(\\h*\\|[^\\n]+\\|?\\h*)","\\n","(?:(?:\\h*\\|\\h*:?[-]{1,}:?\\h*)+\\|?\\h*)","((\\n\\h*\\|[^\\n]+\\|?\\h*)*)"].join(""),end:"(?=$|\\n)"};n.reg=Bf(n,"g",!0);var r={begin:"(?:^|\\n)(\\n*)",content:["(\\|?[^\\n|]+(\\|[^\\n|]+)+\\|?)","\\n","(?:\\|?\\h*:?[-]{1,}:?[\\h]*(?:\\|[\\h]*:?[-]{1,}:?\\h*)+\\|?)","((\\n\\|?([^\\n|]+(\\|[^\\n|]*)+)\\|?)*)"].join(""),end:"(?=$|\\n)"};return r.reg=Bf(r,"g",!0),t===!1?{strict:n,loose:r}:Bf({begin:"",content:nt(e="(?:".concat(n.begin+n.content+n.end,"|")).call(e,r.begin+r.content+r.end,")"),end:""},"g",!0)}function Bwe(){var e={begin:/(?:^|\n)(\n*((?:>[\t ]*)*)(?:[^\S\n]*))(`{3,})([^`]*?)\n/,content:/([\w\W]*?)/,end:/[^\S\n]*\3[ \t]*(?=$|\n+)/,reg:new RegExp("")};return e.reg=new RegExp(e.begin.source+e.content.source+e.end.source,"g"),uWt(uWt({},e),{},{begin:e.begin.source,content:e.content.source,end:e.end.source})}var mWt,kWt,vWt,pWt,bWt,OWt,cis=/{{(cherry-paste-[^|\n]+?)\|<<([^>]+?)>>}}/g,dis=/(\[[^\n]*?\]\(data:image\/[a-z]{1,10};base64,)([^)]+)\)/g,uis=/(data:image\/[a-z]{1,10};base64,)([0-9a-zA-Z+/=]+)/g,his=/[^\n|`\s]{6000,}/g,Ais=/(!\[[^\n]*?\]\([^)]+\)\{[^}]* data-xml=)([^}]+)\}/g,wWt=/(!\[[^\n]*?\]\(data:image\/[a-z]{1,10};base64,[^)]+\)\{data-type=drawio data-xml=[^}]+\})/g,tAe=function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").replace(Bwe().reg,function(t){return t.replace(/^.*$/gm,"/n")}).replace(/(`+)(.+?(?:\n.+?)*?)\1/g,function(t){return t.replace(/[![\]()]/g,".")})};function fis(){return kWt?mWt:(kWt=1,mWt=aVn())}function gis(){return pWt?vWt:(pWt=1,vWt=fis())}function mis(){return OWt?bWt:(OWt=1,bWt=gis())}var yWt,CWt,xWt,LWt,SWt,TWt,EWt,DWt,QWt,BWt,QVn=ji(mis());function ZXe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n3&&arguments[3]!==void 0&&arguments[3],s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1;if(!t)return e;t.lastIndex=0;for(var a=0,l=[];(r=t.exec(e))!==null;){var d={begin:r.index,length:r[0].length};if(o&&r.index===a-s){var u,h=est(r),f=h[0],g=ba(h).call(h,2);l.push({begin:d.begin+s,length:d.length-s,replacedText:n.apply(void 0,nt(u=[ba(f).call(f,s),""]).call(u,$T(g)))})}else l.push(YWt(YWt({},d),{},{replacedText:n.apply(void 0,$T(r))}));a=t.lastIndex,t.lastIndex-=s}return t.lastIndex=0,function(k,A){if(!A.length)return k;var m=[],v=0;return vi(A).call(A,function(p,b){m.push(ba(k).call(k,v,p.begin)),m.push(p.replacedText),v=p.begin+p.length,b===A.length-1&&m.push(ba(k).call(k,v))}),m.join("")}(e,l)}function UVn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(UVn=function(){return!!e})()}var jVn=function(){function e(){return Er(this,e),t=this,r=arguments,n=gi(n=e),rs(t,UVn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,yu),Dr(e,[{key:"toHtml",value:function(n,r,o,s){var a,l;return nt(a=nt(l="".concat(r,'')).call(a,s,"")}},{key:"makeHtml",value:function(n){return ku()?n.replace(this.RULE.reg,this.toHtml):PO(n,this.RULE.reg,this.toHtml,!0,1)}},{key:"rule",value:function(){var n={begin:ku()?"((?')).call(a,s,"")}},{key:"makeHtml",value:function(n){return ku()?n.replace(this.RULE.reg,this.toHtml):PO(n,this.RULE.reg,this.toHtml,!0,1)}},{key:"rule",value:function(){var n={begin:ku()?"((?')).call(a,s,"")}},{key:"makeHtml",value:function(n){return this.test(n)?ku()?n.replace(this.RULE.reg,this.toHtml):PO(n,this.RULE.reg,this.toHtml,!0,1):n}},{key:"rule",value:function(){var n={begin:ku()?"((?0&&arguments[0]!==void 0?arguments[0]:{config:void 0}).config;return Er(this,e),n=this,o=[{config:s}],r=gi(r=e),t=rs(n,ZVn()?Di(r,o||[],gi(n).constructor):r.apply(n,o)),s?(t.needWhitespace=!!s.needWhitespace,t):rs(t)}return vs(e,yu),Dr(e,[{key:"makeHtml",value:function(n){return this.test(n)?n.replace(this.RULE.reg,"$1$2"):n}},{key:"rule",value:function(){var n={};return(n=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{config:void 0}).config.needWhitespace?fde(fde({},n),{},{begin:"(^|[\\s])\\~T\\~T",end:"\\~T\\~T(?=\\s|$)",content:"([\\w\\W]+?)"}):fde(fde({},n),{},{begin:"(^|[^\\\\])\\~T\\~T",end:"\\~T\\~T",content:"([\\w\\W]+?)"})).reg=new RegExp(n.begin+n.content+n.end,"g"),n}}])}();function XVn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(XVn=function(){return!!e})()}ei(YVn,"HOOK_NAME","strikethrough");var qVn=function(){function e(){return Er(this,e),t=this,r=arguments,n=gi(n=e),rs(t,XVn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,yu),Dr(e,[{key:"toHtml",value:function(n,r,o){var s;return nt(s="".concat(r,"")).call(s,o,"")}},{key:"makeHtml",value:function(n){return ku()?n.replace(this.RULE.reg,this.toHtml):PO(n,this.RULE.reg,this.toHtml,!0,1)}},{key:"rule",value:function(){var n={begin:ku()?"((?")).call(s,o,"")}},{key:"makeHtml",value:function(n){return ku()?n.replace(this.RULE.reg,this.toHtml):PO(n,this.RULE.reg,this.toHtml,!0,1)}},{key:"rule",value:function(){var n={begin:ku()?"((?"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(w){var p=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(w.stack)||[])[1];if(p){var b=document.getElementsByTagName("script");for(var O in b)if(b[O].src==p)return b[O]}return null}},isActive:function(p,b,O){for(var w="no-"+b;p;){var y=p.classList;if(y.contains(b))return!0;if(y.contains(w))return!1;p=p.parentElement}return!!O}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(p,b){var O=a.util.clone(a.languages[p]);for(var w in b)O[w]=b[w];return O},insertBefore:function(p,b,O,w){var y=(w=w||a.languages)[p],C={};for(var x in y)if(y.hasOwnProperty(x)){if(x==b)for(var L in O)O.hasOwnProperty(L)&&(C[L]=O[L]);O.hasOwnProperty(x)||(C[x]=y[x])}var S=w[p];return w[p]=C,a.languages.DFS(a.languages,function(E,Q){Q===S&&E!=p&&(this[E]=C)}),C},DFS:function v(p,b,O,w){w=w||{};var y=a.util.objId;for(var C in p)if(p.hasOwnProperty(C)){b.call(p,C,p[C],O||C);var x=p[C],L=a.util.type(x);L!=="Object"||w[y(x)]?L!=="Array"||w[y(x)]||(w[y(x)]=!0,v(x,b,C,w)):(w[y(x)]=!0,v(x,b,null,w))}}},plugins:{},highlightAll:function(p,b){a.highlightAllUnder(document,p,b)},highlightAllUnder:function(p,b,O){var w={callback:O,container:p,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",w),w.elements=Array.prototype.slice.apply(w.container.querySelectorAll(w.selector)),a.hooks.run("before-all-elements-highlight",w);for(var y,C=0;y=w.elements[C++];)a.highlightElement(y,b===!0,w.callback)},highlightElement:function(p,b,O){var w=a.util.getLanguage(p),y=a.languages[w];a.util.setLanguage(p,w);var C=p.parentElement;C&&C.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(C,w);var x={element:p,language:w,grammar:y,code:p.textContent};function L(E){x.highlightedCode=E,a.hooks.run("before-insert",x),x.element.innerHTML=x.highlightedCode,a.hooks.run("after-highlight",x),a.hooks.run("complete",x),O&&O.call(x.element)}if(a.hooks.run("before-sanity-check",x),(C=x.element.parentElement)&&C.nodeName.toLowerCase()==="pre"&&!C.hasAttribute("tabindex")&&C.setAttribute("tabindex","0"),!x.code)return a.hooks.run("complete",x),void(O&&O.call(x.element));if(a.hooks.run("before-highlight",x),x.grammar)if(b&&n.Worker){var S=new Worker(a.filename);S.onmessage=function(E){L(E.data)},S.postMessage(JSON.stringify({language:x.language,code:x.code,immediateClose:!0}))}else L(a.highlight(x.code,x.grammar,x.language));else L(a.util.encode(x.code))},highlight:function(p,b,O){var w={code:p,grammar:b,language:O};if(a.hooks.run("before-tokenize",w),!w.grammar)throw new Error('The language "'+w.language+'" has no grammar.');return w.tokens=a.tokenize(w.code,w.grammar),a.hooks.run("after-tokenize",w),l.stringify(a.util.encode(w.tokens),w.language)},tokenize:function(p,b){var O=b.rest;if(O){for(var w in O)b[w]=O[w];delete b.rest}var y=new h;return f(y,y.head,p),u(p,y,b,y.head,0),function(C){for(var x=[],L=C.head.next;L!==C.tail;)x.push(L.value),L=L.next;return x}(y)},hooks:{all:{},add:function(p,b){var O=a.hooks.all;O[p]=O[p]||[],O[p].push(b)},run:function(p,b){var O=a.hooks.all[p];if(O&&O.length)for(var w,y=0;w=O[y++];)w(b)}},Token:l};function l(v,p,b,O){this.type=v,this.content=p,this.alias=b,this.length=0|(O||"").length}function d(v,p,b,O){v.lastIndex=p;var w=v.exec(b);if(w&&O&&w[1]){var y=w[1].length;w.index+=y,w[0]=w[0].slice(y)}return w}function u(v,p,b,O,w,y){for(var C in b)if(b.hasOwnProperty(C)&&b[C]){var x=b[C];x=Array.isArray(x)?x:[x];for(var L=0;L=y.reach);R+=F.value.length,F=F.next){var N=F.value;if(p.length>v.length)return;if(!(N instanceof l)){var I,W=1;if(T){if(!(I=d(P,R,v,Q))||I.index>=v.length)break;var H=I.index,V=I.index+I[0].length,Z=R;for(Z+=F.value.length;H>=Z;)Z+=(F=F.next).value.length;if(R=Z-=F.value.length,F.value instanceof l)continue;for(var K=F;K!==p.tail&&(Zy.reach&&(y.reach=$);var oe=F.prev;if(ee&&(oe=f(p,oe,ee),R+=ee.length),g(p,oe,W),F=f(p,oe,new l(C,E?a.tokenize(X,E):X,M,X)),q&&f(p,F,q),W>1){var de={cause:C+","+L,reach:$};u(v,p,b,F.prev,R,de),y&&de.reach>y.reach&&(y.reach=de.reach)}}}}}}function h(){var v={value:null,prev:null,next:null},p={value:null,prev:v,next:null};v.next=p,this.head=v,this.tail=p,this.length=0}function f(v,p,b){var O=p.next,w={value:b,prev:p,next:O};return p.next=w,O.prev=w,v.length++,w}function g(v,p,b){for(var O=p.next,w=0;w"+w.content+""},!n.document)return n.addEventListener&&(a.disableWorkerMessageHandler||n.addEventListener("message",function(v){var p=JSON.parse(v.data),b=p.language,O=p.code,w=p.immediateClose;n.postMessage(a.highlight(O,a.languages[b],b)),w&&n.close()},!1)),a;var k=a.util.currentScript();function A(){a.manual||a.highlightAll()}if(k&&(a.filename=k.src,k.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var m=document.readyState;m==="loading"||m==="interactive"&&k&&k.defer?document.addEventListener("DOMContentLoaded",A):window.requestAnimationFrame?window.requestAnimationFrame(A):window.setTimeout(A,16)}return a}(typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=t),S1!==void 0&&(S1.Prism=t)}(GWt)),GWt.exports),nAe=ji(Sis);function JVn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(JVn=function(){return!!e})()}Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.markup={comment:{pattern:/\x3C!--(?:(?!\x3C!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|\x3C!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^$/i;var o={"included-cdata":{pattern://i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var s={};s[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:o},Prism.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(t,n){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:Prism.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),nAe.manual=!0;var Tis={figure:"figure"},CW=function(){function e(t){t.externals;var n,r,o,s,a,l,d,u,h,f,g,k,A,m,v,p,b=t.config,O=t.cherry;return Er(this,e),k=this,m=[{needCache:!0}],A=gi(A=e),g=rs(k,JVn()?Di(A,m||[],gi(k).constructor):A.apply(k,m)),e.inlineCodeCache={},g.codeCache={},g.codeCacheList=[],g.customLang=[],g.customParser={},g.lineNumber=b.lineNumber,g.copyCode=b.copyCode,g.expandCode=b.expandCode,g.editCode=b.editCode,g.changeLang=b.changeLang,g.selfClosing=b.selfClosing,g.mermaid=b.mermaid,g.indentedCodeBlock=b.indentedCodeBlock===void 0||b.indentedCodeBlock,g.INLINE_CODE_REGEX=/(`+)(.+?(?:\n.+?)*?)\1/g,b&&b.customRenderer&&(g.customLang=cs(v=ol(b.customRenderer)).call(v,function(w){return w.toLowerCase()}),vi(p=ol(b.customRenderer)).call(p,function(w){g.customParser[w.toLowerCase()]=b.customRenderer[w]})),g.customHighlighter=b.highlighter,g.failedCleanCacheTimes=0,g.codeTimer=null,g.$cherry=O,g.needCleanFlowCursor=(O==null||(n=O.options)===null||n===void 0||(r=n.engine)===null||r===void 0||(o=r.global)===null||o===void 0?void 0:o.flowSessionContext)&&(O==null||(s=O.options)===null||s===void 0||(a=s.engine)===null||a===void 0||(l=a.global)===null||l===void 0?void 0:l.flowSessionCursor),g.showInlineColor=(O==null||(d=O.options)===null||d===void 0||(u=d.engine)===null||u===void 0||(h=u.syntax)===null||h===void 0||(f=h.inlineCode)===null||f===void 0?void 0:f.showColor)===void 0||O.options.engine.syntax.inlineCode.showColor,g}return vs(e,mc),Dr(e,[{key:"afterMakeHtml",value:function(n){var r=this;return this.codeTimer&&(clearTimeout(this.codeTimer),this.failedCleanCacheTimes+=1,this.codeTimer=null),this.codeTimer=Iu(function(){r.$resetCache()},500),this.failedCleanCacheTimes>5&&(this.failedCleanCacheTimes=0,Iu(function(){r.$resetCache()},500)),this.restoreCache(n)}},{key:"$resetCache",value:function(){if(this.codeCacheList.length>100){for(var n,r=0;r')).call(A,g,"")},u="",h=this.needCleanFlowCursor?r.replace(/CHERRYFLOWSESSIONCURSOR/,""):r;return!!(u=n==="all"?a.render(h,o.sign,this.$engine,o.lang):a.render(h,o.sign,this.$engine,{mermaidConfig:this.mermaid,updateCache:function(g){s.$codeCache(o.sign,d(g)),s.pushCache(d(g),o.sign,o.lines)},fallback:function(){return s.$codeReplace(h,n,o.sign,o.lines)}}))&&d(u)}},{key:"fillTag",value:function(n){var r=[];return cs(n).call(n,function(o){if(!o)return"";for(var s=o;r.length;){var a,l=r.pop();s=nt(a="".concat(l)).call(a,s)}var d=s.match(/|<\/span>/g),u=0;if(!d)return s;for(;d.length;){var h=d.pop();/<\/span>/.test(h)?u+=1:u?u-=1:r.unshift(h.match(//)[0])}for(var f=0;f");return s})}},{key:"renderLineNumber",value:function(n){if(!this.lineNumber)return n;var r=n.split(` `);return r.pop(),r=this.fillTag(r),''.concat(r.join(` `),"")}},{key:"isInternalCustomLangCovered",value:function(n){var r;return Ys(r=this.customLang).call(r,n)!==-1}},{key:"computeLines",value:function(n,r,o){var s=r,a=this.getLineCount(n,s);return{sign:this.$engine.hash(n.replace(/^\n+/,"")+a),lines:a}}},{key:"appendMermaid",value:function(n,r){var o=n,s=r;if(/^flow([ ](TD|LR))?$/i.test(s)&&!this.isInternalCustomLangCovered(s)){var a,l=s.match(/^flow(?:[ ](TD|LR))?$/i)||[];o=nt(a="graph ".concat(l[1]||"TD",` `)).call(a,o),s="mermaid"}return/^seq$/i.test(s)&&!this.isInternalCustomLangCovered(s)&&(o=`sequenceDiagram `.concat(o),s="mermaid"),s==="mermaid"&&(o=o.replace(/(^[\s]*)stateDiagram-v2\n/,`$1stateDiagram `)),[o,s]}},{key:"wrapCode",value:function(n,r){var o;return nt(o='')).call(o,n,"")}},{key:"renderCodeBlock",value:function(n,r,o,s){var a,l,d,u,h,f,g,k,A,m,v=n,p=r;/\s*CHERRY_FLOW_SESSION_CURSOR/.test(p)&&(p=p.replace(/\s*CHERRY_FLOW_SESSION_CURSOR/,""));var b=p=p.toLowerCase();this.customHighlighter?v=this.customHighlighter(v,p):(p&&nAe.languages[p]||(p="javascript"),v=nAe.highlight(v,nAe.languages[p],p),v=this.renderLineNumber(v));var O=this.expandCode&&((a=n.match(/\n/g))===null||a===void 0?void 0:a.length)>10,w=nt(l='
')).call(l,this.wrapCode(v,p),"
");return v=nt(d=nt(u=nt(h=nt(f=nt(g=nt(k=nt(A=nt(m=`
`)).call(d,this.customWrapperRender(b,v,w),` `),O&&(v+=`
`),v+="
"}},{key:"customWrapperRender",value:function(n,r,o){var s,a=(s=this.$cherry.options.engine.syntax.codeBlock.wrapperRender)!==null&&s!==void 0&&s;return typeof a=="function"?a(n,r,o):o}},{key:"$getIndentedCodeReg",value:function(){return new RegExp("(?:^|\\n\\s*\\n)(?: {4}|\\t)([\\s\\S]+?)(?=$|\\n( {0,3}[^ \\t\\n]|\\n[^ \\t\\n]))","g")}},{key:"$getIndentCodeBlock",value:function(n){var r=this;return this.indentedCodeBlock?this.$recoverCodeInIndent(n).replace(this.$getIndentedCodeReg(),function(o,s){var a,l,d=(o.match(/\n/g)||[]).length,u=r.$engine.hash(o),h=nt(a=nt(l='
')).call(a,eM(s.replace(/\n( {4}|\t)/g,`
`)),"
");return d6(o,r.pushCache(h,u,d))}):n}},{key:"$replaceCodeInIndent",value:function(n){return this.indentedCodeBlock?n.replace(this.$getIndentedCodeReg(),function(r){return r.replace(/`/g,"~~~IndentCode")}):n}},{key:"$recoverCodeInIndent",value:function(n){return this.indentedCodeBlock?n.replace(this.$getIndentedCodeReg(),function(r){return r.replace(/~~~IndentCode/g,"`")}):n}},{key:"$dealUnclosingCode",value:function(n){var r=n.match(/(?:^|\n)(\n*((?:>[\t ]*)*)(?:[^\S\n]*))(`{3,})([^`]*?)(?=CHERRY_FLOW_SESSION_CURSOR|$|\n)/g);if(!r||r.length<=0)return n;var o=!1,s=Sd(r).call(r,function(u){return o===!1?(o=!0,!0):!/```[^`\s]+/.test(u)&&(o=!1,!0)});if(s.length%2==1){var a,l=s[s.length-1].replace(/(`)[^`]+$/,"$1").replace(/\n+/,""),d=n.replace(/\n+$/,"").replace(/\n`{1,2}$/,"");return nt(a="".concat(d,` `)).call(a,l,` `)}return n}},{key:"beforeMakeHtml",value:function(n,r,o){var s=this,a=n;return(this.selfClosing||this.$cherry.options.engine.global.flowSessionContext)&&(a=this.$dealUnclosingCode(a)),a=(a=(a=this.$replaceCodeInIndent(a)).replace(this.RULE.reg,function(l,d,u,h,f,g){var k,A;function m(M){if(u){var B=new RegExp(`^ *`,""),P=M.match(B)[0];M=P+u+M.replace(B,function(F){return""})}return M}var v=g,p=s.computeLines(l,d,g),b=p.sign,O=p.lines,w=s.$codeCache(b);if(w&&w!=="")return m(s.getCacheWithSpace(s.pushCache(w,b,O),l));v=(v=(v=s.$recoverCodeInIndent(v)).replace(/~D/g,"$")).replace(/~T/g,"~");var y=(k=d==null||(A=d.match(/[ ]/g))===null||A===void 0?void 0:A.length)!==null&&k!==void 0?k:0;if(y>0){var C=new RegExp("(^|\\n)[ ]{1,".concat(y,"}"),"g");v=v.replace(C,"$1")}if(u){var x=new RegExp("(^|\\n)".concat(u),"g");v=v.replace(x,"$1")}var L=Gi(f).call(f).toLowerCase();if(/^(math|katex|latex)$/i.test(L)&&!s.isInternalCustomLangCovered(L)){var S,E=l.match(/^\s*/g);return nt(S="".concat(E,`~D~D `)).call(S,v,"~D~D")}var Q=hg(s.appendMermaid(v,L),2);v=Q[0];var T=L=Q[1];return L=s.formatLang(L),s.isInternalCustomLangCovered(L)&&(w=s.parseCustomLanguage(L,v,{lines:O,sign:b,match:l,addBlockQuoteSignToResult:m,lang:T}))&&w!==""?(s.$codeCache(b,w),s.getCacheWithSpace(s.pushCache(w,b,O),l)):(w=s.$codeReplace(v,L,b,O),m(s.getCacheWithSpace(s.pushCache(w,b,O),l)))})).replace(Qwe(!0),function(l){var d;return cs(d=l.replace(/\\\|/g,"~CHERRYNormalLine").split("|")).call(d,function(u){return s.makeInlineCode(u,!1).replace(/~CHERRYNormalLine/g,"\\|")}).join("|").replace(/`/g,"\\`")}),a=this.makeInlineCode(a,!0),a=this.$getIndentCodeBlock(a)}},{key:"formatLang",value:function(n){var r;return Ys(r=this.customLang).call(r,"all")!==-1&&n!=="mermaid"?"all":n}},{key:"makeInlineCode",value:function(n){var r=this,o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],s=n;if(this.INLINE_CODE_REGEX.test(s)&&(s=(s=s.replace(/\\`/g,"~~not~inlineCode")).replace(this.INLINE_CODE_REGEX,function(l,d,u){if(Gi(u).call(u)==="`")return l;var h=u.replace(/~~not~inlineCode/g,"\\`");h=(h=(h=r.$replaceSpecialChar(h)).replace(/~CHERRYNormalLine/g,"|")).replace(/\\/g,"\\\\");var f=Gi(h).call(h),g=/^#([0-9a-fA-F]{6})$/i.test(f),k=/^rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)$/i.test(f),A=/^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/i.test(f),m=eM(h),v="";if(r.showInlineColor&&(g||k||A)){var p,b=f;v=nt(p="".concat(m,'')}else v="".concat(m,"");var O=r.$engine.hash(v);return e.inlineCodeCache[O]=v,"~~CODE".concat(O,"$")}),s=s.replace(/~~not~inlineCode/g,"\\`")),o&&(this.$cherry.options.engine.syntax.inlineCode.selfClosing||this.$cherry.options.engine.global.flowSessionContext)){var a=!1;s=s.replace(/(^|\n)([^\n]+)(\n$)/,function(l,d,u,h){var f,g,k,A,m=u.replace(/\\`/g,"~~not~inlineCode").replace(/`+$/,"");return(a=/(`+)([^`]+)$/.test(m)&&!/(`+)([^`]*~~CODE[^`]+)$/.test(m))?(m=m.replace(/(`+)([^`]+)$/,"$1$2$1").replace(/~~not~inlineCode/g,"\\`"),nt(f=nt(g="".concat(d)).call(g,m)).call(f,h)):(m=m.replace(/~~not~inlineCode/g,"\\`"),nt(k=nt(A="".concat(d)).call(A,m)).call(k,h))}),a&&(s=this.makeInlineCode(s,!1))}return s}},{key:"makeHtml",value:function(n){return n}},{key:"$replaceSpecialChar",value:function(n){var r=n.replace(/~Q/g,"\\~");return r=(r=(r=(r=r.replace(/~Y/g,"\\!")).replace(/~Z/g,"\\#")).replace(/~&/g,"\\&")).replace(/~K/g,"\\/")}},{key:"rule",value:function(){return Bwe()}}])}();function _Vn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(_Vn=function(){return!!e})()}ei(CW,"HOOK_NAME","codeBlock"),ei(CW,"inlineCodeCache",{});var $Vn=function(){function e(){return Er(this,e),t=this,r=arguments,n=gi(n=e),rs(t,_Vn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,mc),Dr(e,[{key:"makeHtml",value:function(n){return n}},{key:"afterMakeHtml",value:function(n){var r=n;return ol(CW.inlineCodeCache).length>0&&(r=r.replace(/~~CODE([0-9a-zA-Z]+)\$/g,function(o,s){return CW.inlineCodeCache[s]})),r}},{key:"$cleanCache",value:function(){CW.inlineCodeCache={}}},{key:"rule",value:function(){var n={begin:"(`+)[ ]*",end:"[ ]*\\1",content:"(.+?(?:\\n.+?)*?)"};return n.reg=Bf(n,"g"),n}}])}();ei($Vn,"HOOK_NAME","inlineCode");var KWt={exports:{}},JWt,_Wt={exports:{}},ezn=b$o(Object.freeze({__proto__:null,default:{}}));function Ta(){return JWt?_Wt.exports:(JWt=1,e=function(){var n=n||function(r){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&S1!==void 0&&S1.crypto&&(o=S1.crypto),!o)try{o=ezn}catch{}var s=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function p(){}return function(b){var O;return p.prototype=b,O=new p,p.prototype=null,O}}(),l={},d=l.lib={},u=d.Base={extend:function(b){var O=a(this);return b&&O.mixIn(b),O.hasOwnProperty("init")&&this.init!==O.init||(O.init=function(){O.$super.init.apply(this,arguments)}),O.init.prototype=O,O.$super=this,O},create:function(){var b=this.extend();return b.init.apply(b,arguments),b},init:function(){},mixIn:function(b){for(var O in b)b.hasOwnProperty(O)&&(this[O]=b[O]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.init.prototype.extend(this)}},h=d.WordArray=u.extend({init:function(b,O){b=this.words=b||[],this.sigBytes=O??4*b.length},toString:function(b){return(b||g).stringify(this)},concat:function(b){var O=this.words,w=b.words,y=this.sigBytes,C=b.sigBytes;if(this.clamp(),y%4)for(var x=0;x>>2]>>>24-x%4*8&255;O[y+x>>>2]|=L<<24-(y+x)%4*8}else for(var S=0;S>>2]=w[S>>>2];return this.sigBytes+=C,this},clamp:function(){var b=this.words,O=this.sigBytes;b[O>>>2]&=4294967295<<32-O%4*8,b.length=r.ceil(O/4)},clone:function(){var b=u.clone.call(this);return b.words=this.words.slice(0),b},random:function(b){for(var O=[],w=0;w>>2]>>>24-C%4*8&255;y.push((x>>>4).toString(16)),y.push((15&x).toString(16))}return y.join("")},parse:function(b){for(var O=b.length,w=[],y=0;y>>3]|=parseInt(b.substr(y,2),16)<<24-y%8*4;return new h.init(w,O/2)}},k=f.Latin1={stringify:function(b){for(var O=b.words,w=b.sigBytes,y=[],C=0;C>>2]>>>24-C%4*8&255;y.push(String.fromCharCode(x))}return y.join("")},parse:function(b){for(var O=b.length,w=[],y=0;y>>2]|=(255&b.charCodeAt(y))<<24-y%4*8;return new h.init(w,O)}},A=f.Utf8={stringify:function(b){try{return decodeURIComponent(escape(k.stringify(b)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(b){return k.parse(unescape(encodeURIComponent(b)))}},m=d.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(b){typeof b=="string"&&(b=A.parse(b)),this._data.concat(b),this._nDataBytes+=b.sigBytes},_process:function(b){var O,w=this._data,y=w.words,C=w.sigBytes,x=this.blockSize,L=C/(4*x),S=(L=b?r.ceil(L):r.max((0|L)-this._minBufferSize,0))*x,E=r.min(4*S,C);if(S){for(var Q=0;Q>>2]>>>24-f%4*8&255)<<16|(l[f+1>>>2]>>>24-(f+1)%4*8&255)<<8|l[f+2>>>2]>>>24-(f+2)%4*8&255,k=0;k<4&&f+.75*k>>6*(3-k)&63));var A=u.charAt(64);if(A)for(;h.length%4;)h.push(A);return h.join("")},parse:function(a){var l=a.length,d=this._map,u=this._reverseMap;if(!u){u=this._reverseMap=[];for(var h=0;h>>6-b%4*2;v[p>>>2]|=O<<24-p%4*8,p++}return o.create(v,p)}(a,l,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64},sHt.exports=e(Ta()));var e}var aHt,lHt={exports:{}};function Eis(){return aHt?lHt.exports:(aHt=1,e=function(n){var r,o;return o=(r=n).lib.WordArray,r.enc.Base64url={stringify:function(a,l){l===void 0&&(l=!0);var d=a.words,u=a.sigBytes,h=l?this._safe_map:this._map;a.clamp();for(var f=[],g=0;g>>2]>>>24-g%4*8&255)<<16|(d[g+1>>>2]>>>24-(g+1)%4*8&255)<<8|d[g+2>>>2]>>>24-(g+2)%4*8&255,A=0;A<4&&g+.75*A>>6*(3-A)&63));var m=h.charAt(64);if(m)for(;f.length%4;)f.push(m);return f.join("")},parse:function(a,l){l===void 0&&(l=!0);var d=a.length,u=l?this._safe_map:this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var f=0;f>>6-O%4*2;p[b>>>2]|=w<<24-b%4*8,b++}return o.create(p,b)}(a,d,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},n.enc.Base64url},lHt.exports=e(Ta()));var e}var cHt,dHt={exports:{}};function mD(){return cHt?dHt.exports:(cHt=1,e=function(n){return function(r){var o=n,s=o.lib,a=s.WordArray,l=s.Hasher,d=o.algo,u=[];(function(){for(var m=0;m<64;m++)u[m]=4294967296*r.abs(r.sin(m+1))|0})();var h=d.MD5=l.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(v,p){for(var b=0;b<16;b++){var O=p+b,w=v[O];v[O]=16711935&(w<<8|w>>>24)|4278255360&(w<<24|w>>>8)}var y=this._hash.words,C=v[p+0],x=v[p+1],L=v[p+2],S=v[p+3],E=v[p+4],Q=v[p+5],T=v[p+6],M=v[p+7],B=v[p+8],P=v[p+9],F=v[p+10],R=v[p+11],N=v[p+12],I=v[p+13],W=v[p+14],H=v[p+15],V=y[0],Z=y[1],K=y[2],X=y[3];V=f(V,Z,K,X,C,7,u[0]),X=f(X,V,Z,K,x,12,u[1]),K=f(K,X,V,Z,L,17,u[2]),Z=f(Z,K,X,V,S,22,u[3]),V=f(V,Z,K,X,E,7,u[4]),X=f(X,V,Z,K,Q,12,u[5]),K=f(K,X,V,Z,T,17,u[6]),Z=f(Z,K,X,V,M,22,u[7]),V=f(V,Z,K,X,B,7,u[8]),X=f(X,V,Z,K,P,12,u[9]),K=f(K,X,V,Z,F,17,u[10]),Z=f(Z,K,X,V,R,22,u[11]),V=f(V,Z,K,X,N,7,u[12]),X=f(X,V,Z,K,I,12,u[13]),K=f(K,X,V,Z,W,17,u[14]),V=g(V,Z=f(Z,K,X,V,H,22,u[15]),K,X,x,5,u[16]),X=g(X,V,Z,K,T,9,u[17]),K=g(K,X,V,Z,R,14,u[18]),Z=g(Z,K,X,V,C,20,u[19]),V=g(V,Z,K,X,Q,5,u[20]),X=g(X,V,Z,K,F,9,u[21]),K=g(K,X,V,Z,H,14,u[22]),Z=g(Z,K,X,V,E,20,u[23]),V=g(V,Z,K,X,P,5,u[24]),X=g(X,V,Z,K,W,9,u[25]),K=g(K,X,V,Z,S,14,u[26]),Z=g(Z,K,X,V,B,20,u[27]),V=g(V,Z,K,X,I,5,u[28]),X=g(X,V,Z,K,L,9,u[29]),K=g(K,X,V,Z,M,14,u[30]),V=k(V,Z=g(Z,K,X,V,N,20,u[31]),K,X,Q,4,u[32]),X=k(X,V,Z,K,B,11,u[33]),K=k(K,X,V,Z,R,16,u[34]),Z=k(Z,K,X,V,W,23,u[35]),V=k(V,Z,K,X,x,4,u[36]),X=k(X,V,Z,K,E,11,u[37]),K=k(K,X,V,Z,M,16,u[38]),Z=k(Z,K,X,V,F,23,u[39]),V=k(V,Z,K,X,I,4,u[40]),X=k(X,V,Z,K,C,11,u[41]),K=k(K,X,V,Z,S,16,u[42]),Z=k(Z,K,X,V,T,23,u[43]),V=k(V,Z,K,X,P,4,u[44]),X=k(X,V,Z,K,N,11,u[45]),K=k(K,X,V,Z,H,16,u[46]),V=A(V,Z=k(Z,K,X,V,L,23,u[47]),K,X,C,6,u[48]),X=A(X,V,Z,K,M,10,u[49]),K=A(K,X,V,Z,W,15,u[50]),Z=A(Z,K,X,V,Q,21,u[51]),V=A(V,Z,K,X,N,6,u[52]),X=A(X,V,Z,K,S,10,u[53]),K=A(K,X,V,Z,F,15,u[54]),Z=A(Z,K,X,V,x,21,u[55]),V=A(V,Z,K,X,B,6,u[56]),X=A(X,V,Z,K,H,10,u[57]),K=A(K,X,V,Z,T,15,u[58]),Z=A(Z,K,X,V,I,21,u[59]),V=A(V,Z,K,X,E,6,u[60]),X=A(X,V,Z,K,R,10,u[61]),K=A(K,X,V,Z,L,15,u[62]),Z=A(Z,K,X,V,P,21,u[63]),y[0]=y[0]+V|0,y[1]=y[1]+Z|0,y[2]=y[2]+K|0,y[3]=y[3]+X|0},_doFinalize:function(){var v=this._data,p=v.words,b=8*this._nDataBytes,O=8*v.sigBytes;p[O>>>5]|=128<<24-O%32;var w=r.floor(b/4294967296),y=b;p[15+(O+64>>>9<<4)]=16711935&(w<<8|w>>>24)|4278255360&(w<<24|w>>>8),p[14+(O+64>>>9<<4)]=16711935&(y<<8|y>>>24)|4278255360&(y<<24|y>>>8),v.sigBytes=4*(p.length+1),this._process();for(var C=this._hash,x=C.words,L=0;L<4;L++){var S=x[L];x[L]=16711935&(S<<8|S>>>24)|4278255360&(S<<24|S>>>8)}return C},clone:function(){var v=l.clone.call(this);return v._hash=this._hash.clone(),v}});function f(m,v,p,b,O,w,y){var C=m+(v&p|~v&b)+O+y;return(C<>>32-w)+v}function g(m,v,p,b,O,w,y){var C=m+(v&b|p&~b)+O+y;return(C<>>32-w)+v}function k(m,v,p,b,O,w,y){var C=m+(v^p^b)+O+y;return(C<>>32-w)+v}function A(m,v,p,b,O,w,y){var C=m+(p^(v|~b))+O+y;return(C<>>32-w)+v}o.MD5=l._createHelper(h),o.HmacMD5=l._createHmacHelper(h)}(Math),n.MD5},dHt.exports=e(Ta()));var e}var uHt,hHt={exports:{}};function tzn(){return uHt?hHt.exports:(uHt=1,e=function(n){var r,o,s,a,l,d,u;return o=(r=n).lib,s=o.WordArray,a=o.Hasher,l=r.algo,d=[],u=l.SHA1=a.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(f,g){for(var k=this._hash.words,A=k[0],m=k[1],v=k[2],p=k[3],b=k[4],O=0;O<80;O++){if(O<16)d[O]=0|f[g+O];else{var w=d[O-3]^d[O-8]^d[O-14]^d[O-16];d[O]=w<<1|w>>>31}var y=(A<<5|A>>>27)+b+d[O];y+=O<20?1518500249+(m&v|~m&p):O<40?1859775393+(m^v^p):O<60?(m&v|m&p|v&p)-1894007588:(m^v^p)-899497514,b=p,p=v,v=m<<30|m>>>2,m=A,A=y}k[0]=k[0]+A|0,k[1]=k[1]+m|0,k[2]=k[2]+v|0,k[3]=k[3]+p|0,k[4]=k[4]+b|0},_doFinalize:function(){var f=this._data,g=f.words,k=8*this._nDataBytes,A=8*f.sigBytes;return g[A>>>5]|=128<<24-A%32,g[14+(A+64>>>9<<4)]=Math.floor(k/4294967296),g[15+(A+64>>>9<<4)]=k,f.sigBytes=4*g.length,this._process(),this._hash},clone:function(){var f=a.clone.call(this);return f._hash=this._hash.clone(),f}}),r.SHA1=a._createHelper(u),r.HmacSHA1=a._createHmacHelper(u),n.SHA1},hHt.exports=e(Ta()));var e}var AHt,fHt={exports:{}};function uEe(){return AHt?fHt.exports:(AHt=1,e=function(n){return function(r){var o=n,s=o.lib,a=s.WordArray,l=s.Hasher,d=o.algo,u=[],h=[];(function(){function k(p){for(var b=r.sqrt(p),O=2;O<=b;O++)if(!(p%O))return!1;return!0}function A(p){return 4294967296*(p-(0|p))|0}for(var m=2,v=0;v<64;)k(m)&&(v<8&&(u[v]=A(r.pow(m,.5))),h[v]=A(r.pow(m,1/3)),v++),m++})();var f=[],g=d.SHA256=l.extend({_doReset:function(){this._hash=new a.init(u.slice(0))},_doProcessBlock:function(A,m){for(var v=this._hash.words,p=v[0],b=v[1],O=v[2],w=v[3],y=v[4],C=v[5],x=v[6],L=v[7],S=0;S<64;S++){if(S<16)f[S]=0|A[m+S];else{var E=f[S-15],Q=(E<<25|E>>>7)^(E<<14|E>>>18)^E>>>3,T=f[S-2],M=(T<<15|T>>>17)^(T<<13|T>>>19)^T>>>10;f[S]=Q+f[S-7]+M+f[S-16]}var B=p&b^p&O^b&O,P=(p<<30|p>>>2)^(p<<19|p>>>13)^(p<<10|p>>>22),F=L+((y<<26|y>>>6)^(y<<21|y>>>11)^(y<<7|y>>>25))+(y&C^~y&x)+h[S]+f[S];L=x,x=C,C=y,y=w+F|0,w=O,O=b,b=p,p=F+(P+B)|0}v[0]=v[0]+p|0,v[1]=v[1]+b|0,v[2]=v[2]+O|0,v[3]=v[3]+w|0,v[4]=v[4]+y|0,v[5]=v[5]+C|0,v[6]=v[6]+x|0,v[7]=v[7]+L|0},_doFinalize:function(){var A=this._data,m=A.words,v=8*this._nDataBytes,p=8*A.sigBytes;return m[p>>>5]|=128<<24-p%32,m[14+(p+64>>>9<<4)]=r.floor(v/4294967296),m[15+(p+64>>>9<<4)]=v,A.sigBytes=4*m.length,this._process(),this._hash},clone:function(){var A=l.clone.call(this);return A._hash=this._hash.clone(),A}});o.SHA256=l._createHelper(g),o.HmacSHA256=l._createHmacHelper(g)}(Math),n.SHA256},fHt.exports=e(Ta()));var e}var gHt,mHt={exports:{}},kHt,vHt={exports:{}};function pHt(){return kHt?vHt.exports:(kHt=1,e=function(n){return function(){var r=n,o=r.lib.Hasher,s=r.x64,a=s.Word,l=s.WordArray,d=r.algo;function u(){return a.create.apply(a,arguments)}var h=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],f=[];(function(){for(var k=0;k<80;k++)f[k]=u()})();var g=d.SHA512=o.extend({_doReset:function(){this._hash=new l.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(A,m){for(var v=this._hash.words,p=v[0],b=v[1],O=v[2],w=v[3],y=v[4],C=v[5],x=v[6],L=v[7],S=p.high,E=p.low,Q=b.high,T=b.low,M=O.high,B=O.low,P=w.high,F=w.low,R=y.high,N=y.low,I=C.high,W=C.low,H=x.high,V=x.low,Z=L.high,K=L.low,X=S,ee=E,q=Q,$=T,oe=M,de=B,ke=P,ne=F,Ae=R,Y=N,re=I,ce=W,ie=H,J=V,he=Z,pe=K,Le=0;Le<80;Le++){var Be,ve,ue=f[Le];if(Le<16)ve=ue.high=0|A[m+2*Le],Be=ue.low=0|A[m+2*Le+1];else{var be=f[Le-15],xe=be.high,Qe=be.low,Fe=(xe>>>1|Qe<<31)^(xe>>>8|Qe<<24)^xe>>>7,Ge=(Qe>>>1|xe<<31)^(Qe>>>8|xe<<24)^(Qe>>>7|xe<<25),Xe=f[Le-2],$e=Xe.high,vt=Xe.low,mt=($e>>>19|vt<<13)^($e<<3|vt>>>29)^$e>>>6,rt=(vt>>>19|$e<<13)^(vt<<3|$e>>>29)^(vt>>>6|$e<<26),yt=f[Le-7],Rt=yt.high,Ke=yt.low,ze=f[Le-16],jt=ze.high,en=ze.low;ve=(ve=(ve=Fe+Rt+((Be=Ge+Ke)>>>0>>0?1:0))+mt+((Be+=rt)>>>0>>0?1:0))+jt+((Be+=en)>>>0>>0?1:0),ue.high=ve,ue.low=Be}var bt,Dt=Ae&re^~Ae&ie,Ct=Y&ce^~Y&J,On=X&q^X&oe^q&oe,Fn=ee&$^ee&de^$&de,di=(X>>>28|ee<<4)^(X<<30|ee>>>2)^(X<<25|ee>>>7),Pi=(ee>>>28|X<<4)^(ee<<30|X>>>2)^(ee<<25|X>>>7),Ci=(Ae>>>14|Y<<18)^(Ae>>>18|Y<<14)^(Ae<<23|Y>>>9),Ir=(Y>>>14|Ae<<18)^(Y>>>18|Ae<<14)^(Y<<23|Ae>>>9),Gr=h[Le],Sr=Gr.high,Po=Gr.low,Ti=he+Ci+((bt=pe+Ir)>>>0>>0?1:0),ri=Pi+Fn;he=ie,pe=J,ie=re,J=ce,re=Ae,ce=Y,Ae=ke+(Ti=(Ti=(Ti=Ti+Dt+((bt+=Ct)>>>0>>0?1:0))+Sr+((bt+=Po)>>>0>>0?1:0))+ve+((bt+=Be)>>>0>>0?1:0))+((Y=ne+bt|0)>>>0>>0?1:0)|0,ke=oe,ne=de,oe=q,de=$,q=X,$=ee,X=Ti+(di+On+(ri>>>0>>0?1:0))+((ee=bt+ri|0)>>>0>>0?1:0)|0}E=p.low=E+ee,p.high=S+X+(E>>>0>>0?1:0),T=b.low=T+$,b.high=Q+q+(T>>>0<$>>>0?1:0),B=O.low=B+de,O.high=M+oe+(B>>>0>>0?1:0),F=w.low=F+ne,w.high=P+ke+(F>>>0>>0?1:0),N=y.low=N+Y,y.high=R+Ae+(N>>>0>>0?1:0),W=C.low=W+ce,C.high=I+re+(W>>>0>>0?1:0),V=x.low=V+J,x.high=H+ie+(V>>>0>>0?1:0),K=L.low=K+pe,L.high=Z+he+(K>>>0>>0?1:0)},_doFinalize:function(){var A=this._data,m=A.words,v=8*this._nDataBytes,p=8*A.sigBytes;return m[p>>>5]|=128<<24-p%32,m[30+(p+128>>>10<<5)]=Math.floor(v/4294967296),m[31+(p+128>>>10<<5)]=v,A.sigBytes=4*m.length,this._process(),this._hash.toX32()},clone:function(){var A=o.clone.call(this);return A._hash=this._hash.clone(),A},blockSize:32});r.SHA512=o._createHelper(g),r.HmacSHA512=o._createHmacHelper(g)}(),n.SHA512},vHt.exports=e(Ta(),iAe()));var e}var bHt,OHt={exports:{}},wHt,yHt={exports:{}},CHt,xHt={exports:{}},LHt,SHt={exports:{}};function YXe(){return LHt?SHt.exports:(LHt=1,e=function(n){var r,o,s;o=(r=n).lib.Base,s=r.enc.Utf8,r.algo.HMAC=o.extend({init:function(l,d){l=this._hasher=new l.init,typeof d=="string"&&(d=s.parse(d));var u=l.blockSize,h=4*u;d.sigBytes>h&&(d=l.finalize(d)),d.clamp();for(var f=this._oKey=d.clone(),g=this._iKey=d.clone(),k=f.words,A=g.words,m=0;m>>2];C.sigBytes-=x}},o.BlockCipher=f.extend({cfg:f.cfg.extend({mode:A,padding:m}),reset:function(){var C;f.reset.call(this);var x=this.cfg,L=x.iv,S=x.mode;this._xformMode==this._ENC_XFORM_MODE?C=S.createEncryptor:(C=S.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==C?this._mode.init(this,L&&L.words):(this._mode=C.call(S,this,L&&L.words),this._mode.__creator=C)},_doProcessBlock:function(C,x){this._mode.processBlock(C,x)},_doFinalize:function(){var C,x=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(x.pad(this._data,this.blockSize),C=this._process(!0)):(C=this._process(!0),x.unpad(C)),C},blockSize:4}),v=o.CipherParams=s.extend({init:function(C){this.mixIn(C)},toString:function(C){return(C||this.formatter).stringify(this)}}),p=(r.format={}).OpenSSL={stringify:function(C){var x=C.ciphertext,L=C.salt;return(L?a.create([1398893684,1701076831]).concat(L).concat(x):x).toString(u)},parse:function(C){var x,L=u.parse(C),S=L.words;return S[0]==1398893684&&S[1]==1701076831&&(x=a.create(S.slice(2,4)),S.splice(0,4),L.sigBytes-=16),v.create({ciphertext:L,salt:x})}},b=o.SerializableCipher=s.extend({cfg:s.extend({format:p}),encrypt:function(C,x,L,S){S=this.cfg.extend(S);var E=C.createEncryptor(L,S),Q=E.finalize(x),T=E.cfg;return v.create({ciphertext:Q,key:L,iv:T.iv,algorithm:C,mode:T.mode,padding:T.padding,blockSize:C.blockSize,formatter:S.format})},decrypt:function(C,x,L,S){return S=this.cfg.extend(S),x=this._parse(x,S.format),C.createDecryptor(L,S).finalize(x.ciphertext)},_parse:function(C,x){return typeof C=="string"?x.parse(C,this):C}}),O=(r.kdf={}).OpenSSL={execute:function(C,x,L,S,E){if(S||(S=a.random(8)),E)Q=h.create({keySize:x+L,hasher:E}).compute(C,S);else var Q=h.create({keySize:x+L}).compute(C,S);var T=a.create(Q.words.slice(x),4*L);return Q.sigBytes=4*x,v.create({key:Q,iv:T,salt:S})}},w=o.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:O}),encrypt:function(C,x,L,S){var E=(S=this.cfg.extend(S)).kdf.execute(L,C.keySize,C.ivSize,S.salt,S.hasher);S.iv=E.iv;var Q=b.encrypt.call(this,C,x,E.key,S);return Q.mixIn(E),Q},decrypt:function(C,x,L,S){S=this.cfg.extend(S),x=this._parse(x,S.format);var E=S.kdf.execute(L,C.keySize,C.ivSize,x.salt,S.hasher);return S.iv=E.iv,b.decrypt.call(this,C,x,E.key,S)}}))},FHt.exports=e(Ta(),wS()));var e}var PHt,MHt={exports:{}},RHt,IHt={exports:{}},NHt,UHt={exports:{}};function Dis(){return NHt?UHt.exports:(NHt=1,e=function(n){return n.mode.CTRGladman=function(){var r=n.lib.BlockCipherMode.extend();function o(a){if(255&~(a>>24))a+=1<<24;else{var l=a>>16&255,d=a>>8&255,u=255&a;l===255?(l=0,d===255?(d=0,u===255?u=0:++u):++d):++l,a=0,a+=l<<16,a+=d<<8,a+=u}return a}var s=r.Encryptor=r.extend({processBlock:function(l,d){var u=this._cipher,h=u.blockSize,f=this._iv,g=this._counter;f&&(g=this._counter=f.slice(0),this._iv=void 0),function(m){(m[0]=o(m[0]))===0&&(m[1]=o(m[1]))}(g);var k=g.slice(0);u.encryptBlock(k,0);for(var A=0;A>24&255,v=A>>16&255,p=A>>8&255,b=255&A,O=k.sbox[0][m]+k.sbox[1][v];return O^=k.sbox[2][p],O+=k.sbox[3][b],O}function f(k,A,m){for(var v,p=A,b=m,O=0;O=O&&(C=0);for(var L=0,S=0,E=0,Q=0;Q<18;Q+=2)E=f(p,L,S),L=E.left,S=E.right,p.pbox[Q]=L,p.pbox[Q+1]=S;for(var T=0;T<4;T++)for(var M=0;M<256;M+=2)E=f(p,L,S),L=E.left,S=E.right,p.sbox[T][M]=L,p.sbox[T][M+1]=S})(u,m,v)}},encryptBlock:function(A,m){var v=f(u,A[m],A[m+1]);A[m]=v.left,A[m+1]=v.right},decryptBlock:function(A,m){var v=function(p,b,O){for(var w,y=b,C=O,x=17;x>1;--x)y^=p.pbox[x],C=h(p,y)^C,w=y,y=C,C=w;return w=y,y=C,C=w,C^=p.pbox[1],y^=p.pbox[0],{left:y,right:C}}(u,A[m],A[m+1]);A[m]=v.left,A[m+1]=v.right},blockSize:2,keySize:4,ivSize:2});r.Blowfish=o._createHelper(g)}(),n.Blowfish},AVt.exports=e(Ta(),gD(),mD(),wS(),nf()));var e}var fVt,gVt,Bis=(fVt||(fVt=1,gVt=function(t){return t},KWt.exports=gVt(Ta(),iAe(),function(){return tHt?nHt.exports:(tHt=1,e=function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n.lib.WordArray,o=r.init,s=r.init=function(a){if(a instanceof ArrayBuffer&&(a=new Uint8Array(a)),(a instanceof Int8Array||typeof Uint8ClampedArray<"u"&&a instanceof Uint8ClampedArray||a instanceof Int16Array||a instanceof Uint16Array||a instanceof Int32Array||a instanceof Uint32Array||a instanceof Float32Array||a instanceof Float64Array)&&(a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength)),a instanceof Uint8Array){for(var l=a.byteLength,d=[],u=0;u>>2]|=a[u]<<24-u%4*8;o.call(this,d,l)}else o.apply(this,arguments)};s.prototype=r}}(),n.lib.WordArray},nHt.exports=e(Ta()));var e}(),function(){return iHt?rHt.exports:(iHt=1,e=function(n){return function(){var r=n,o=r.lib.WordArray,s=r.enc;function a(l){return l<<8&4278255360|l>>>8&16711935}s.Utf16=s.Utf16BE={stringify:function(d){for(var u=d.words,h=d.sigBytes,f=[],g=0;g>>2]>>>16-g%4*8&65535;f.push(String.fromCharCode(k))}return f.join("")},parse:function(d){for(var u=d.length,h=[],f=0;f>>1]|=d.charCodeAt(f)<<16-f%2*16;return o.create(h,2*u)}},s.Utf16LE={stringify:function(d){for(var u=d.words,h=d.sigBytes,f=[],g=0;g>>2]>>>16-g%4*8&65535);f.push(String.fromCharCode(k))}return f.join("")},parse:function(d){for(var u=d.length,h=[],f=0;f>>1]|=a(d.charCodeAt(f)<<16-f%2*16);return o.create(h,2*u)}}}(),n.enc.Utf16},rHt.exports=e(Ta()));var e}(),gD(),Eis(),mD(),tzn(),uEe(),function(){return gHt?mHt.exports:(gHt=1,e=function(n){var r,o,s,a,l;return o=(r=n).lib.WordArray,s=r.algo,a=s.SHA256,l=s.SHA224=a.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=a._doFinalize.call(this);return u.sigBytes-=4,u}}),r.SHA224=a._createHelper(l),r.HmacSHA224=a._createHmacHelper(l),n.SHA224},mHt.exports=e(Ta(),uEe()));var e}(),pHt(),function(){return bHt?OHt.exports:(bHt=1,e=function(n){var r,o,s,a,l,d,u;return o=(r=n).x64,s=o.Word,a=o.WordArray,l=r.algo,d=l.SHA512,u=l.SHA384=d.extend({_doReset:function(){this._hash=new a.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var f=d._doFinalize.call(this);return f.sigBytes-=16,f}}),r.SHA384=d._createHelper(u),r.HmacSHA384=d._createHmacHelper(u),n.SHA384},OHt.exports=e(Ta(),iAe(),pHt()));var e}(),function(){return wHt?yHt.exports:(wHt=1,e=function(n){return function(r){var o=n,s=o.lib,a=s.WordArray,l=s.Hasher,d=o.x64.Word,u=o.algo,h=[],f=[],g=[];(function(){for(var m=1,v=0,p=0;p<24;p++){h[m+5*v]=(p+1)*(p+2)/2%64;var b=(2*m+3*v)%5;m=v%5,v=b}for(m=0;m<5;m++)for(v=0;v<5;v++)f[m+5*v]=v+(2*m+3*v)%5*5;for(var O=1,w=0;w<24;w++){for(var y=0,C=0,x=0;x<7;x++){if(1&O){var L=(1<>>24)|4278255360&(y<<24|y>>>8),C=16711935&(C<<8|C>>>24)|4278255360&(C<<24|C>>>8),(K=b[w]).high^=C,K.low^=y}for(var x=0;x<24;x++){for(var L=0;L<5;L++){for(var S=0,E=0,Q=0;Q<5;Q++)S^=(K=b[L+5*Q]).high,E^=K.low;var T=k[L];T.high=S,T.low=E}for(L=0;L<5;L++){var M=k[(L+4)%5],B=k[(L+1)%5],P=B.high,F=B.low;for(S=M.high^(P<<1|F>>>31),E=M.low^(F<<1|P>>>31),Q=0;Q<5;Q++)(K=b[L+5*Q]).high^=S,K.low^=E}for(var R=1;R<25;R++){var N=(K=b[R]).high,I=K.low,W=h[R];W<32?(S=N<>>32-W,E=I<>>32-W):(S=I<>>64-W,E=N<>>64-W);var H=k[f[R]];H.high=S,H.low=E}var V=k[0],Z=b[0];for(V.high=Z.high,V.low=Z.low,L=0;L<5;L++)for(Q=0;Q<5;Q++){var K=b[R=L+5*Q],X=k[R],ee=k[(L+1)%5+5*Q],q=k[(L+2)%5+5*Q];K.high=X.high^~ee.high&q.high,K.low=X.low^~ee.low&q.low}K=b[0];var $=g[x];K.high^=$.high,K.low^=$.low}},_doFinalize:function(){var v=this._data,p=v.words,b=(this._nDataBytes,8*v.sigBytes),O=32*this.blockSize;p[b>>>5]|=1<<24-b%32,p[(r.ceil((b+1)/O)*O>>>5)-1]|=128,v.sigBytes=4*p.length,this._process();for(var w=this._state,y=this.cfg.outputLength/8,C=y/8,x=[],L=0;L>>24)|4278255360&(E<<24|E>>>8),Q=16711935&(Q<<8|Q>>>24)|4278255360&(Q<<24|Q>>>8),x.push(Q),x.push(E)}return new a.init(x,y)},clone:function(){for(var v=l.clone.call(this),p=v._state=this._state.slice(0),b=0;b<25;b++)p[b]=p[b].clone();return v}});o.SHA3=l._createHelper(A),o.HmacSHA3=l._createHmacHelper(A)}(Math),n.SHA3},yHt.exports=e(Ta(),iAe()));var e}(),function(){return CHt?xHt.exports:(CHt=1,e=function(n){return function(){var r=n,o=r.lib,s=o.WordArray,a=o.Hasher,l=r.algo,d=s.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=s.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),h=s.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=s.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),g=s.create([0,1518500249,1859775393,2400959708,2840853838]),k=s.create([1352829926,1548603684,1836072691,2053994217,0]),A=l.RIPEMD160=a.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(C,x){for(var L=0;L<16;L++){var S=x+L,E=C[S];C[S]=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8)}var Q,T,M,B,P,F,R,N,I,W,H,V=this._hash.words,Z=g.words,K=k.words,X=d.words,ee=u.words,q=h.words,$=f.words;for(F=Q=V[0],R=T=V[1],N=M=V[2],I=B=V[3],W=P=V[4],L=0;L<80;L+=1)H=Q+C[x+X[L]]|0,H+=L<16?m(T,M,B)+Z[0]:L<32?v(T,M,B)+Z[1]:L<48?p(T,M,B)+Z[2]:L<64?b(T,M,B)+Z[3]:O(T,M,B)+Z[4],H=(H=w(H|=0,q[L]))+P|0,Q=P,P=B,B=w(M,10),M=T,T=H,H=F+C[x+ee[L]]|0,H+=L<16?O(R,N,I)+K[0]:L<32?b(R,N,I)+K[1]:L<48?p(R,N,I)+K[2]:L<64?v(R,N,I)+K[3]:m(R,N,I)+K[4],H=(H=w(H|=0,$[L]))+W|0,F=W,W=I,I=w(N,10),N=R,R=H;H=V[1]+M+I|0,V[1]=V[2]+B+W|0,V[2]=V[3]+P+F|0,V[3]=V[4]+Q+R|0,V[4]=V[0]+T+N|0,V[0]=H},_doFinalize:function(){var C=this._data,x=C.words,L=8*this._nDataBytes,S=8*C.sigBytes;x[S>>>5]|=128<<24-S%32,x[14+(S+64>>>9<<4)]=16711935&(L<<8|L>>>24)|4278255360&(L<<24|L>>>8),C.sigBytes=4*(x.length+1),this._process();for(var E=this._hash,Q=E.words,T=0;T<5;T++){var M=Q[T];Q[T]=16711935&(M<<8|M>>>24)|4278255360&(M<<24|M>>>8)}return E},clone:function(){var C=a.clone.call(this);return C._hash=this._hash.clone(),C}});function m(y,C,x){return y^C^x}function v(y,C,x){return y&C|~y&x}function p(y,C,x){return(y|~C)^x}function b(y,C,x){return y&x|C&~x}function O(y,C,x){return y^(C|~x)}function w(y,C){return y<>>32-C}r.RIPEMD160=a._createHelper(A),r.HmacRIPEMD160=a._createHmacHelper(A)}(),n.RIPEMD160},xHt.exports=e(Ta()));var e}(),YXe(),function(){return THt?EHt.exports:(THt=1,e=function(n){var r,o,s,a,l,d,u,h;return s=(o=(r=n).lib).Base,a=o.WordArray,d=(l=r.algo).SHA256,u=l.HMAC,h=l.PBKDF2=s.extend({cfg:s.extend({keySize:4,hasher:d,iterations:25e4}),init:function(g){this.cfg=this.cfg.extend(g)},compute:function(g,k){for(var A=this.cfg,m=u.create(A.hasher,g),v=a.create(),p=a.create([1]),b=v.words,O=p.words,w=A.keySize,y=A.iterations;b.length>>2]|=d<<24-u%4*8,o.sigBytes+=d},unpad:function(o){var s=255&o.words[o.sigBytes-1>>>2];o.sigBytes-=s}},n.pad.Ansix923},ZHt.exports=e(Ta(),nf()));var e}(),function(){return YHt?XHt.exports:(YHt=1,e=function(n){return n.pad.Iso10126={pad:function(o,s){var a=4*s,l=a-o.sigBytes%a;o.concat(n.lib.WordArray.random(l-1)).concat(n.lib.WordArray.create([l<<24],1))},unpad:function(o){var s=255&o.words[o.sigBytes-1>>>2];o.sigBytes-=s}},n.pad.Iso10126},XHt.exports=e(Ta(),nf()));var e}(),function(){return qHt?GHt.exports:(qHt=1,e=function(n){return n.pad.Iso97971={pad:function(o,s){o.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(o,s)},unpad:function(o){n.pad.ZeroPadding.unpad(o),o.sigBytes--}},n.pad.Iso97971},GHt.exports=e(Ta(),nf()));var e}(),function(){return KHt?JHt.exports:(KHt=1,e=function(n){return n.pad.ZeroPadding={pad:function(o,s){var a=4*s;o.clamp(),o.sigBytes+=a-(o.sigBytes%a||a)},unpad:function(o){var s=o.words,a=o.sigBytes-1;for(a=o.sigBytes-1;a>=0;a--)if(s[a>>>2]>>>24-a%4*8&255){o.sigBytes=a+1;break}}},n.pad.ZeroPadding},JHt.exports=e(Ta(),nf()));var e}(),function(){return _Ht?$Ht.exports:(_Ht=1,e=function(n){return n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding},$Ht.exports=e(Ta(),nf()));var e}(),function(){return eVt?tVt.exports:(eVt=1,e=function(n){var r,o,s;return o=(r=n).lib.CipherParams,s=r.enc.Hex,r.format.Hex={stringify:function(l){return l.ciphertext.toString(s)},parse:function(l){var d=s.parse(l);return o.create({ciphertext:d})}},n.format.Hex},tVt.exports=e(Ta(),nf()));var e}(),function(){return nVt?iVt.exports:(nVt=1,e=function(n){return function(){var r=n,o=r.lib.BlockCipher,s=r.algo,a=[],l=[],d=[],u=[],h=[],f=[],g=[],k=[],A=[],m=[];(function(){for(var b=[],O=0;O<256;O++)b[O]=O<128?O<<1:O<<1^283;var w=0,y=0;for(O=0;O<256;O++){var C=y^y<<1^y<<2^y<<3^y<<4;C=C>>>8^255&C^99,a[w]=C,l[C]=w;var x=b[w],L=b[x],S=b[L],E=257*b[C]^16843008*C;d[w]=E<<24|E>>>8,u[w]=E<<16|E>>>16,h[w]=E<<8|E>>>24,f[w]=E,E=16843009*S^65537*L^257*x^16843008*w,g[C]=E<<24|E>>>8,k[C]=E<<16|E>>>16,A[C]=E<<8|E>>>24,m[C]=E,w?(w=x^b[b[b[S^x]]],y^=b[b[y]]):w=y=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],p=s.AES=o.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var O=this._keyPriorReset=this._key,w=O.words,y=O.sigBytes/4,C=4*((this._nRounds=y+6)+1),x=this._keySchedule=[],L=0;L6&&L%y==4&&(Q=a[Q>>>24]<<24|a[Q>>>16&255]<<16|a[Q>>>8&255]<<8|a[255&Q]):(Q=a[(Q=Q<<8|Q>>>24)>>>24]<<24|a[Q>>>16&255]<<16|a[Q>>>8&255]<<8|a[255&Q],Q^=v[L/y|0]<<24),x[L]=x[L-y]^Q);for(var S=this._invKeySchedule=[],E=0;E>>24]]^k[a[Q>>>16&255]]^A[a[Q>>>8&255]]^m[a[255&Q]]}}},encryptBlock:function(O,w){this._doCryptBlock(O,w,this._keySchedule,d,u,h,f,a)},decryptBlock:function(O,w){var y=O[w+1];O[w+1]=O[w+3],O[w+3]=y,this._doCryptBlock(O,w,this._invKeySchedule,g,k,A,m,l),y=O[w+1],O[w+1]=O[w+3],O[w+3]=y},_doCryptBlock:function(O,w,y,C,x,L,S,E){for(var Q=this._nRounds,T=O[w]^y[0],M=O[w+1]^y[1],B=O[w+2]^y[2],P=O[w+3]^y[3],F=4,R=1;R>>24]^x[M>>>16&255]^L[B>>>8&255]^S[255&P]^y[F++],I=C[M>>>24]^x[B>>>16&255]^L[P>>>8&255]^S[255&T]^y[F++],W=C[B>>>24]^x[P>>>16&255]^L[T>>>8&255]^S[255&M]^y[F++],H=C[P>>>24]^x[T>>>16&255]^L[M>>>8&255]^S[255&B]^y[F++];T=N,M=I,B=W,P=H}N=(E[T>>>24]<<24|E[M>>>16&255]<<16|E[B>>>8&255]<<8|E[255&P])^y[F++],I=(E[M>>>24]<<24|E[B>>>16&255]<<16|E[P>>>8&255]<<8|E[255&T])^y[F++],W=(E[B>>>24]<<24|E[P>>>16&255]<<16|E[T>>>8&255]<<8|E[255&M])^y[F++],H=(E[P>>>24]<<24|E[T>>>16&255]<<16|E[M>>>8&255]<<8|E[255&B])^y[F++],O[w]=N,O[w+1]=I,O[w+2]=W,O[w+3]=H},keySize:8});r.AES=o._createHelper(p)}(),n.AES},iVt.exports=e(Ta(),gD(),mD(),wS(),nf()));var e}(),function(){return rVt?oVt.exports:(rVt=1,e=function(n){return function(){var r=n,o=r.lib,s=o.WordArray,a=o.BlockCipher,l=r.algo,d=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],u=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],f=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],g=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],k=l.DES=a.extend({_doReset:function(){for(var b=this._key.words,O=[],w=0;w<56;w++){var y=d[w]-1;O[w]=b[y>>>5]>>>31-y%32&1}for(var C=this._subKeys=[],x=0;x<16;x++){var L=C[x]=[],S=h[x];for(w=0;w<24;w++)L[w/6|0]|=O[(u[w]-1+S)%28]<<31-w%6,L[4+(w/6|0)]|=O[28+(u[w+24]-1+S)%28]<<31-w%6;for(L[0]=L[0]<<1|L[0]>>>31,w=1;w<7;w++)L[w]=L[w]>>>4*(w-1)+3;L[7]=L[7]<<5|L[7]>>>27}var E=this._invSubKeys=[];for(w=0;w<16;w++)E[w]=C[15-w]},encryptBlock:function(b,O){this._doCryptBlock(b,O,this._subKeys)},decryptBlock:function(b,O){this._doCryptBlock(b,O,this._invSubKeys)},_doCryptBlock:function(b,O,w){this._lBlock=b[O],this._rBlock=b[O+1],A.call(this,4,252645135),A.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),A.call(this,1,1431655765);for(var y=0;y<16;y++){for(var C=w[y],x=this._lBlock,L=this._rBlock,S=0,E=0;E<8;E++)S|=f[E][((L^C[E])&g[E])>>>0];this._lBlock=L,this._rBlock=x^S}var Q=this._lBlock;this._lBlock=this._rBlock,this._rBlock=Q,A.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),A.call(this,16,65535),A.call(this,4,252645135),b[O]=this._lBlock,b[O+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function A(p,b){var O=(this._lBlock>>>p^this._rBlock)&b;this._rBlock^=O,this._lBlock^=O<>>p^this._lBlock)&b;this._lBlock^=O,this._rBlock^=O<192.");var O=b.slice(0,2),w=b.length<4?b.slice(0,2):b.slice(2,4),y=b.length<6?b.slice(0,2):b.slice(4,6);this._des1=k.createEncryptor(s.create(O)),this._des2=k.createEncryptor(s.create(w)),this._des3=k.createEncryptor(s.create(y))},encryptBlock:function(b,O){this._des1.encryptBlock(b,O),this._des2.decryptBlock(b,O),this._des3.encryptBlock(b,O)},decryptBlock:function(b,O){this._des3.decryptBlock(b,O),this._des2.encryptBlock(b,O),this._des1.decryptBlock(b,O)},keySize:6,ivSize:2,blockSize:2});r.TripleDES=a._createHelper(v)}(),n.TripleDES},oVt.exports=e(Ta(),gD(),mD(),wS(),nf()));var e}(),function(){return sVt?aVt.exports:(sVt=1,e=function(n){return function(){var r=n,o=r.lib.StreamCipher,s=r.algo,a=s.RC4=o.extend({_doReset:function(){for(var h=this._key,f=h.words,g=h.sigBytes,k=this._S=[],A=0;A<256;A++)k[A]=A;A=0;for(var m=0;A<256;A++){var v=A%g,p=f[v>>>2]>>>24-v%4*8&255;m=(m+k[A]+p)%256;var b=k[A];k[A]=k[m],k[m]=b}this._i=this._j=0},_doProcessBlock:function(h,f){h[f]^=l.call(this)},keySize:8,ivSize:0});function l(){for(var u=this._S,h=this._i,f=this._j,g=0,k=0;k<4;k++){f=(f+u[h=(h+1)%256])%256;var A=u[h];u[h]=u[f],u[f]=A,g|=u[(u[h]+u[f])%256]<<24-8*k}return this._i=h,this._j=f,g}r.RC4=o._createHelper(a);var d=s.RC4Drop=a.extend({cfg:a.cfg.extend({drop:192}),_doReset:function(){a._doReset.call(this);for(var h=this.cfg.drop;h>0;h--)l.call(this)}});r.RC4Drop=o._createHelper(d)}(),n.RC4},aVt.exports=e(Ta(),gD(),mD(),wS(),nf()));var e}(),function(){return lVt?cVt.exports:(lVt=1,e=function(n){return function(){var r=n,o=r.lib.StreamCipher,s=r.algo,a=[],l=[],d=[],u=s.Rabbit=o.extend({_doReset:function(){for(var g=this._key.words,k=this.cfg.iv,A=0;A<4;A++)g[A]=16711935&(g[A]<<8|g[A]>>>24)|4278255360&(g[A]<<24|g[A]>>>8);var m=this._X=[g[0],g[3]<<16|g[2]>>>16,g[1],g[0]<<16|g[3]>>>16,g[2],g[1]<<16|g[0]>>>16,g[3],g[2]<<16|g[1]>>>16],v=this._C=[g[2]<<16|g[2]>>>16,4294901760&g[0]|65535&g[1],g[3]<<16|g[3]>>>16,4294901760&g[1]|65535&g[2],g[0]<<16|g[0]>>>16,4294901760&g[2]|65535&g[3],g[1]<<16|g[1]>>>16,4294901760&g[3]|65535&g[0]];for(this._b=0,A=0;A<4;A++)h.call(this);for(A=0;A<8;A++)v[A]^=m[A+4&7];if(k){var p=k.words,b=p[0],O=p[1],w=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8),y=16711935&(O<<8|O>>>24)|4278255360&(O<<24|O>>>8),C=w>>>16|4294901760&y,x=y<<16|65535&w;for(v[0]^=w,v[1]^=C,v[2]^=y,v[3]^=x,v[4]^=w,v[5]^=C,v[6]^=y,v[7]^=x,A=0;A<4;A++)h.call(this)}},_doProcessBlock:function(g,k){var A=this._X;h.call(this),a[0]=A[0]^A[5]>>>16^A[3]<<16,a[1]=A[2]^A[7]>>>16^A[5]<<16,a[2]=A[4]^A[1]>>>16^A[7]<<16,a[3]=A[6]^A[3]>>>16^A[1]<<16;for(var m=0;m<4;m++)a[m]=16711935&(a[m]<<8|a[m]>>>24)|4278255360&(a[m]<<24|a[m]>>>8),g[k+m]^=a[m]},blockSize:4,ivSize:2});function h(){for(var f=this._X,g=this._C,k=0;k<8;k++)l[k]=g[k];for(g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0>>0?1:0)|0,this._b=g[7]>>>0>>0?1:0,k=0;k<8;k++){var A=f[k]+g[k],m=65535&A,v=A>>>16,p=((m*m>>>17)+m*v>>>15)+v*v,b=((4294901760&A)*A|0)+((65535&A)*A|0);d[k]=p^b}f[0]=d[0]+(d[7]<<16|d[7]>>>16)+(d[6]<<16|d[6]>>>16)|0,f[1]=d[1]+(d[0]<<8|d[0]>>>24)+d[7]|0,f[2]=d[2]+(d[1]<<16|d[1]>>>16)+(d[0]<<16|d[0]>>>16)|0,f[3]=d[3]+(d[2]<<8|d[2]>>>24)+d[1]|0,f[4]=d[4]+(d[3]<<16|d[3]>>>16)+(d[2]<<16|d[2]>>>16)|0,f[5]=d[5]+(d[4]<<8|d[4]>>>24)+d[3]|0,f[6]=d[6]+(d[5]<<16|d[5]>>>16)+(d[4]<<16|d[4]>>>16)|0,f[7]=d[7]+(d[6]<<8|d[6]>>>24)+d[5]|0}r.Rabbit=o._createHelper(u)}(),n.Rabbit},cVt.exports=e(Ta(),gD(),mD(),wS(),nf()));var e}(),function(){return dVt?uVt.exports:(dVt=1,e=function(n){return function(){var r=n,o=r.lib.StreamCipher,s=r.algo,a=[],l=[],d=[],u=s.RabbitLegacy=o.extend({_doReset:function(){var g=this._key.words,k=this.cfg.iv,A=this._X=[g[0],g[3]<<16|g[2]>>>16,g[1],g[0]<<16|g[3]>>>16,g[2],g[1]<<16|g[0]>>>16,g[3],g[2]<<16|g[1]>>>16],m=this._C=[g[2]<<16|g[2]>>>16,4294901760&g[0]|65535&g[1],g[3]<<16|g[3]>>>16,4294901760&g[1]|65535&g[2],g[0]<<16|g[0]>>>16,4294901760&g[2]|65535&g[3],g[1]<<16|g[1]>>>16,4294901760&g[3]|65535&g[0]];this._b=0;for(var v=0;v<4;v++)h.call(this);for(v=0;v<8;v++)m[v]^=A[v+4&7];if(k){var p=k.words,b=p[0],O=p[1],w=16711935&(b<<8|b>>>24)|4278255360&(b<<24|b>>>8),y=16711935&(O<<8|O>>>24)|4278255360&(O<<24|O>>>8),C=w>>>16|4294901760&y,x=y<<16|65535&w;for(m[0]^=w,m[1]^=C,m[2]^=y,m[3]^=x,m[4]^=w,m[5]^=C,m[6]^=y,m[7]^=x,v=0;v<4;v++)h.call(this)}},_doProcessBlock:function(g,k){var A=this._X;h.call(this),a[0]=A[0]^A[5]>>>16^A[3]<<16,a[1]=A[2]^A[7]>>>16^A[5]<<16,a[2]=A[4]^A[1]>>>16^A[7]<<16,a[3]=A[6]^A[3]>>>16^A[1]<<16;for(var m=0;m<4;m++)a[m]=16711935&(a[m]<<8|a[m]>>>24)|4278255360&(a[m]<<24|a[m]>>>8),g[k+m]^=a[m]},blockSize:4,ivSize:2});function h(){for(var f=this._X,g=this._C,k=0;k<8;k++)l[k]=g[k];for(g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0>>0?1:0)|0,this._b=g[7]>>>0>>0?1:0,k=0;k<8;k++){var A=f[k]+g[k],m=65535&A,v=A>>>16,p=((m*m>>>17)+m*v>>>15)+v*v,b=((4294901760&A)*A|0)+((65535&A)*A|0);d[k]=p^b}f[0]=d[0]+(d[7]<<16|d[7]>>>16)+(d[6]<<16|d[6]>>>16)|0,f[1]=d[1]+(d[0]<<8|d[0]>>>24)+d[7]|0,f[2]=d[2]+(d[1]<<16|d[1]>>>16)+(d[0]<<16|d[0]>>>16)|0,f[3]=d[3]+(d[2]<<8|d[2]>>>24)+d[1]|0,f[4]=d[4]+(d[3]<<16|d[3]>>>16)+(d[2]<<16|d[2]>>>16)|0,f[5]=d[5]+(d[4]<<8|d[4]>>>24)+d[3]|0,f[6]=d[6]+(d[5]<<16|d[5]>>>16)+(d[4]<<16|d[4]>>>16)|0,f[7]=d[7]+(d[6]<<8|d[6]>>>24)+d[5]|0}r.RabbitLegacy=o._createHelper(u)}(),n.RabbitLegacy},uVt.exports=e(Ta(),gD(),mD(),wS(),nf()));var e}(),Qis())),KWt.exports),XXe=ji(Bis),gde={},hEe=/^cherry-inner:\/\/([0-9a-f]+)$/i;function AEe(e){return function(t,n,r){if(b8.isInnerLink(t)){var o=e(b8.get(t),n,r);return b8.replace(t,o)}return e(t,n,r)}}var b8=function(){function e(){Er(this,e)}return Dr(e,null,[{key:"isInnerLink",value:function(n){return hEe.test(n)}},{key:"set",value:function(n){var r=XXe.SHA256(n).toString();return gde[r]=n,"cherry-inner://".concat(r)}},{key:"get",value:function(n){var r,o=hg((r=n.match(hEe))!==null&&r!==void 0?r:[],2)[1];if(o)return gde[o]}},{key:"replace",value:function(n,r){var o,s=hg((o=n.match(hEe))!==null&&o!==void 0?o:[],2)[1];if(s)return gde[s]=r,n}},{key:"restoreAll",value:function(n){return n.replace(/cherry-inner:\/\/([0-9a-f]+)/gi,function(r){var o=e.get(r);return typeof o=="string"?o:r})}},{key:"clear",value:function(){gde={}}}])}();function nzn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(nzn=function(){return!!e})()}var izn=function(){function e(t){var n,r,o,s,a=t.config;return t.globalConfig,Er(this,e),r=this,s=[{config:a}],o=gi(o=e),(n=rs(r,nzn()?Di(o,s||[],gi(r).constructor):o.apply(r,s))).target=a.target?'target="'.concat(a.target,'"'):a.openNewPage?'target="_blank"':"",n.rel=a.rel?'rel="'.concat(a.rel,'"'):"",n}return vs(e,yu),Dr(e,[{key:"checkBrackets",value:function(n){for(var r=[],o="[".concat(n,"]"),s=function(d){return 1&ba(o).call(o,0,d).match(/\\*$/)[0].length},a=o.length-1;o[a]&&(a!==o.length-1||!s(a));a--)if(o[a]!=="]"||s(a)||r.push("]"),o[a]==="["&&!s(a)&&(r.pop(),!r.length))return{isValid:!0,coreText:ba(o).call(o,a+1,o.length-1),extraLeadingChar:ba(o).call(o,0,a)};return{isValid:!1,coreText:n,extraLeadingChar:""}}},{key:"toHtml",value:function(n,r,o,s,a,l,d){var u=s===void 0?"ref":"url",h="";if(u==="ref")return n;if(u==="url"){var f,g=this.checkBrackets(o),k=g.isValid,A=g.coreText,m=g.extraLeadingChar;if(!k)return n;h=a&&Gi(a).call(a)!==""?' title="'.concat(eM(a.replace(/["']/g,"")),'"'):"",d?h+=' target="'.concat(d.replace(/{target\s*=\s*(.*?)}/,"$1"),'"'):this.target&&(h+=" ".concat(this.target));var v=Gi(s).call(s).replace(/~1D/g,"~D"),p=A.replace(/~1D/g,"~D");if(kns(v)){var b,O,w,y,C,x;v=N5(v=this.$engine.urlProcessor(v,"link"));var L=(b=this.$engine.$cherry.options.engine.syntax.link.attrRender(p,v))!==null&&b!==void 0?b:"";return nt(O=nt(w=nt(y=nt(C=nt(x="".concat(r+m,'")).call(O,p,"")}return nt(f="".concat(r+m,"")).call(f,o,"")}return n}},{key:"toStdMarkdown",value:function(n){return n}},{key:"makeHtml",value:function(n){var r,o,s=n.replace(this.RULE.reg,function(a){return a.replace(/~D/g,"~1D")});return ku()?s=s.replace(this.RULE.reg,_l(r=this.toHtml).call(r,this)):s=PO(s,this.RULE.reg,_l(o=this.toHtml).call(o,this),!0,1),s=s.replace(this.RULE.reg,function(a){return a.replace(/~1D/g,"~D")})}},{key:"rule",value:function(){var n,r={begin:ku()?"((?0;(d>>>=1)&&(a+=a))1&d&&(l+=a);return l}}function Fis(){return bVt?pVt:(bVt=1,vVt||(vVt=1,ai()({target:"String",proto:!0},{repeat:rzn()})),pVt=Jc()("String","repeat"))}function Pis(){if(wVt)return OVt;wVt=1;var e=wl(),t=Fis(),n=String.prototype;return OVt=function(o){var s=o.repeat;return typeof o=="string"||o===n||e(n,o)&&s===n.repeat?t:s}}function Mis(){return CVt?yVt:(CVt=1,yVt=Pis())}var oy=ji(LVt?xVt:(LVt=1,xVt=Mis()));function ozn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(ozn=function(){return!!e})()}var szn=function(){function e(){var t,n,r,o,s=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{config:void 0}).config;return Er(this,e),n=this,o=[{config:s}],r=gi(r=e),t=rs(n,ozn()?Di(r,o||[],gi(n).constructor):r.apply(n,o)),s?(t.allowWhitespace=!!s.allowWhitespace,t):rs(t)}return vs(e,yu),Dr(e,[{key:"makeHtml",value:function(n,r){var o=function(l,d,u,h){var f,g,k,A=u.length%2==1?"em":"strong",m=Math.floor(u.length/2),v=oy("").call("",m),p=oy("").call("",m);return A==="em"&&(/[\u4e00-\u9fa5]$/.test(h)?v+='':v+="",p="".concat(p)),nt(f=nt(g=nt(k="".concat(d)).call(k,v)).call(g,r(h).html.replace(/_/g,"~U"))).call(f,p)},s=n;return s=(s=this.allowWhitespace?(s=(s=s.replace(/(^[\s]*|\n[\s]*)(\*)([^\s*](?:.*?)(?:(?:\n.*?)*?))\*/g,o)).replace(/(^[\s]*|\n[\s]*)(\*{2,})((?:.*?)(?:(?:\n.*?)*?))\2/g,o)).replace(/([^\n*\\\s][ ]*)(\*+)((?:.*?)(?:(?:\n.*?)*?))\2/g,o):s.replace(this.RULE.asterisk.reg,o)).replace(this.RULE.underscore.reg,function(a,l,d,u,h,f){var g,k,A;if(Gi(u).call(u)==="")return a;var m=d.length%2==1?"em":"strong",v=Math.floor(d.length/2),p=oy("").call("",v),b=oy("").call("",v),O=r(u).html;return m==="em"&&(p+="",b="".concat(b)),nt(g=nt(k=nt(A="".concat(l)).call(A,p)).call(k,O)).call(g,b)}),s.replace(/~U/g,"_")}},{key:"test",value:function(n,r){return this.RULE[r].reg&&this.RULE[r].reg.test(n)}},{key:"rule",value:function(){var n=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{config:void 0}).config,r=!!n&&!!n.allowWhitespace,o=function(d,u){var h,f,g,k="[^".concat(u,"\\s]");return d?"(?:.*?)(?:(?:\\n.*?)*?)":nt(h=nt(f=nt(g="(".concat(k,"|")).call(g,k,`(.*?( `)).call(f,k,".*)*)")).call(h,k,")")},s={begin:"(^|[^\\\\])([*]+)",content:"(".concat(o(r,"*"),")"),end:"\\2"},a={begin:"(^|".concat(AWt,")(_+)"),content:"(".concat(o(r,"_"),")"),end:"\\2(?=".concat(AWt,"|$)")};return s.reg=Bf(s,"g"),a.reg=Bf(a,"g"),{asterisk:s,underscore:a}}}])}();function azn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(azn=function(){return!!e})()}ei(szn,"HOOK_NAME","fontEmphasis");var lzn=function(){function e(t){var n,r,o,s;return Er(this,e),r=this,o=gi(o=e),(n=rs(r,azn()?Di(o,[],gi(r).constructor):o.apply(r,s))).initBrReg(t.globalConfig.classicBr),n}return vs(e,mc),Dr(e,[{key:"makeHtml",value:function(n,r){var o=this;return this.test(n)?n.replace(this.RULE.reg,function(s,a,l){var d;if(o.isContainsCache(s,!0))return s;var u,h=function(g){var k,A,m,v,p,b;if(Gi(g).call(g)==="")return"";var O=o.cacheAndGetData(g,r,3e3,-100),w=O.sign,y=O.html,C="p";new RegExp("<(".concat(Xre,")[^>]*>"),"i").test(y)&&(C="div");var x=o.getLineCount(g,g);return nt(k=nt(A=nt(m=nt(v=nt(p=nt(b="<".concat(C,' data-sign="')).call(b,w)).call(p,x,'" data-type="')).call(v,C,'" data-lines="')).call(m,x,'">')).call(A,o.$cleanParagraph(y),"")};return o.isContainsCache(l)?o.makeExcludingCached(nt(u="".concat(a)).call(u,l),h):h(nt(d="".concat(a)).call(d,l))}):n}},{key:"rule",value:function(){var n={begin:"(?:^|\\n)(\\n*)",end:"(?=\\s*$|\\n\\n)",content:"([\\s\\S]+?)"};return n.reg=new RegExp(n.begin+n.content+n.end,"g"),n}}])}();ei(lzn,"HOOK_NAME","normalParagraph");var SVt,TVt,EVt,DVt,QVt,BVt,FVt,PVt,MVt,RVt,IVt,NVt,UVt,Ris={};function Iis(){if(TVt)return SVt;TVt=1;var e=Xd();return SVt=function(n){return n!==void 0&&(e(n,"value")||e(n,"writable"))}}function Nis(){return QVt?DVt:(QVt=1,function(){if(EVt)return Ris;EVt=1;var e=ai(),t=ud(),n=Ku(),r=ZA(),o=Iis(),s=NE(),a=HZ();e({target:"Reflect",stat:!0},{get:function l(d,u){var h,f,g=arguments.length<3?d:arguments[2];return r(d)===g?d[u]:(h=s.f(d,u))?o(h)?h.value:h.get===void 0?void 0:t(h.get,g):n(f=a(d))?l(f,u,g):void 0}})}(),DVt=Ol().Reflect.get)}function Uis(){return FVt?BVt:(FVt=1,BVt=Nis())}function jis(){return MVt?PVt:(MVt=1,PVt=Uis())}function Wis(){return IVt?RVt:(IVt=1,RVt=jis())}function His(){return UVt?NVt:(UVt=1,NVt=Wis())}var jVt,WVt,HVt,VVt,zVt,ZVt,YVt=ji(His());function Vis(){return WVt?jVt:(WVt=1,jVt=aHn())}function zis(){return VVt?HVt:(VVt=1,HVt=Vis())}function Zis(){return ZVt?zVt:(ZVt=1,zVt=zis())}var Yis=ji(Zis());function dte(){var e;return dte=typeof Reflect<"u"&&YVt?Lwe(e=YVt).call(e):function(t,n,r){var o=function(a,l){for(;!{}.hasOwnProperty.call(a,l)&&(a=gi(a))!==null;);return a}(t,n);if(o){var s=Yis(o,n);return s.get?s.get.call(arguments.length<3?t:r):s.value}},dte.apply(null,arguments)}function czn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(czn=function(){return!!e})()}var mde="atx",kde="setext",Xis=/[\s\-_]/,qis=/[A-Za-z]/,Gis=/[0-9]/,dzn=function(){function e(){var t,n,r,o,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{config:void 0,externals:void 0,cherry:void 0},a=(s.externals,s.config),l=s.cherry;return Er(this,e),n=this,o=[{needCache:!0}],r=gi(r=e),(t=rs(n,czn()?Di(r,o||[],gi(n).constructor):r.apply(n,o))).strict=!a||!!a.strict,t.RULE=t.rule(),t.headerIDCache=[],t.headerIDCounter={},t.config=a||{},t.$cherry=l,t}return vs(e,mc),Dr(e,[{key:"$parseTitleText",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return typeof n!="string"?"":n.replace(/<.*?>/g,"").replace(/</g,"<").replace(/>/g,">")}},{key:"$generateId",value:function(n){for(var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],o=n.length,s="",a=0;a255)try{s+=encodeURIComponent(l)}catch{}}return s}},{key:"generateIDNoDup",value:function(n){var r,o=n.replace(/</g,"<").replace(/>/g,">"),s=this.$generateId(o,!0),a=Ys(r=this.headerIDCache).call(r,s);if(a!==-1)this.headerIDCounter[a]+=1,s+="-".concat(this.headerIDCounter[a]+1);else{var l=this.headerIDCache.push(s);this.headerIDCounter[l-1]=1}return s}},{key:"$wrapHeader",value:function(n,r,o,s){var a,l,d,u,h,f,g,k,A,m,v,p=n,b=s(p=(a=this.$cherry)!==null&&a!==void 0&&(l=a.options)!==null&&l!==void 0&&(d=l.engine)!==null&&d!==void 0&&(u=d.syntax)!==null&&u!==void 0&&u.space?p.replace(/^\s/,""):Gi(p).call(p)),O=b.html,w=O.match(/\s+\{#([A-Za-z0-9-]+)\}$/);w!==null&&(O=O.substring(0,w.index),v=hg(w,2)[1]);var y=this.$parseTitleText(O);v||(v=this.generateIDNoDup(y.replace(/~fn#([0-9]+)#/g,"")));var C="safe_".concat(v),x=this.$engine.hash(nt(h=nt(f=nt(g="".concat(r,"-")).call(g,b.sign,"-")).call(f,v,"-")).call(h,o));return{html:[nt(k=nt(A=nt(m="'),this.$getAnchor(v),"".concat(O),"")].join(""),sign:"".concat(x)}}},{key:"$getAnchor",value:function(n){return(this.config.anchorStyle||"default")==="none"?"":'')}},{key:"beforeMakeHtml",value:function(n){var r=this,o=n;return(this.$engine.$cherry.options.engine.global.flowSessionContext||this.$engine.$cherry.options.engine.syntax.header&&this.$engine.$cherry.options.engine.syntax.header.selfClosing)&&(o=(o=(o=o.replace(/(\n\s*-{1,})\s*$/,"$1 ")).replace(/(^\s*|\n\s*)#{1,}\s*CHERRYFLOWSESSIONCURSOR\s*$/,"$1CHERRYFLOWSESSIONCURSOR")).replace(/(^\s*|\n\s*)#{1,}\s*$/,"$1")),this.test(o,mde)&&(o=o.replace(this.RULE[mde].reg,function(s,a,l,d){return Gi(d).call(d)===""?s:r.getCacheWithSpace(r.pushCache(s),s,!0)})),this.test(o,kde)&&(o=o.replace(this.RULE[kde].reg,function(s,a,l){return Gi(l).call(l)===""||r.isContainsCache(l)?s:r.getCacheWithSpace(r.pushCache(s),s,!0)})),o}},{key:"makeHtml",value:function(n,r){var o=this,s=this.restoreCache(n);return this.test(s,mde)&&(s=s.replace(this.RULE[mde].reg,function(a,l,d,u){var h=UXe(l,o.getLineCount(a.replace(/^\n+/,""))),f=u.replace(/\s+#+\s*$/,""),g=o.$wrapHeader(f,d.length,h,r),k=g.html,A=g.sign;return o.getCacheWithSpace(o.pushCache(k,A,h),a,!0)})),this.test(s,kde)&&(s=s.replace(this.RULE[kde].reg,function(a,l,d,u){if(o.isContainsCache(d))return a;var h=UXe(l,o.getLineCount(a.replace(/^\n+/,""))),f=u[0]==="-"?2:1,g=o.$wrapHeader(d,f,h,r),k=g.html,A=g.sign;return o.getCacheWithSpace(o.pushCache(k,A,h),a,!0)})),s}},{key:"afterMakeHtml",value:function(n){var r,o,s,a,l,d=(r=e,o="afterMakeHtml",s=this,l=dte(gi(1&(a=3)?r.prototype:r),o,s),2&a&&typeof l=="function"?function(u){return l.apply(s,u)}:l)([n]);return this.headerIDCache=[],this.headerIDCounter={},d}},{key:"test",value:function(n,r){return this.RULE[r].reg&&this.RULE[r].reg.test(n)}},{key:"rule",value:function(){var n={begin:"(?:^|\\n)(\\n*)",content:["(?:\\h*","(.+)",")\\n","(?:\\h*","([=]+|[-]+)",")"].join(""),end:"(?=$|\\n)"};n.reg=Bf(n,"g",!0);var r={begin:"(?:^|\\n)(\\n*)(?:\\h*(#{1,6}))",content:"(.+?)",end:"(?=$|\\n)"};return this.strict&&(r.begin+="(?=\\h+)"),r.reg=Bf(r,"g",!0),{setext:n,atx:r}}}])}();function uzn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(uzn=function(){return!!e})()}ei(dzn,"HOOK_NAME","header");var XVt,qVt,hzn=function(){function e(){return Er(this,e),t=this,r=arguments,n=gi(n=e),rs(t,uzn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,yu),Dr(e,[{key:"rule",value:function(){return{begin:"",content:"",end:"",reg:new RegExp("")}}},{key:"beforeMakeHtml",value:function(n){return n.replace(/\\\n/g,`\\ `)}},{key:"afterMakeHtml",value:function(n){var r=n.replace(/~Q/g,"~");return r=(r=(r=(r=(r=r.replace(/~X/g,"`")).replace(/~Y/g,"!")).replace(/~Z/g,"#")).replace(/~&/g,"&")).replace(/~K/g,"/")}}])}();ei(hzn,"HOOK_NAME","transfer");var GVt,KVt,aR=ji(qVt?XVt:(qVt=1,XVt=pHn())),JVt,_Vt,$Vt,ezt,tzt,nzt,izt,rzt,ozt,szt,azt,lzt,czt,lR=ji(KVt?GVt:(KVt=1,GVt=BVn())),Kis={};function Jis(){if(_Vt)return JVt;_Vt=1;var e=rA(),t=Bg(),n=gwe(),r=_O(),o=TypeError,s="Reduce of empty array with no initial value",a=function(d){return function(u,h,f,g){var k=t(u),A=n(k),m=r(k);if(e(h),m===0&&f<2)throw new o(s);var v=d?m-1:0,p=d?-1:1;if(f<2)for(;;){if(v in A){g=A[v],v+=p;break}if(v+=p,d?v<0:m<=v)throw new o(s)}for(;d?v>=0:m>v;v+=p)v in A&&(g=h(g,A[v],v,k));return g}};return JVt={left:a(!1),right:a(!0)}}function Gre(){if(ezt)return $Vt;ezt=1;var e=vc();return $Vt=mC()(e.process)==="process"}function _is(){return izt?nzt:(izt=1,function(){if(tzt)return Kis;tzt=1;var e=ai(),t=Jis().left,n=jZ(),r=NZ();e({target:"Array",proto:!0,forced:!Gre()&&r>79&&r<83||!n("reduce")},{reduce:function(s){var a=arguments.length;return t(this,s,a,a>1?arguments[1]:void 0)}})}(),nzt=Jc()("Array","reduce"))}function $is(){if(ozt)return rzt;ozt=1;var e=wl(),t=_is(),n=Array.prototype;return rzt=function(o){var s=o.reduce;return o===n||e(n,o)&&s===n.reduce?t:s}}function ers(){return azt?szt:(azt=1,szt=$is())}var dzt,uzt,hzt,Azt,fzt,gzt,mzt,kzt,vzt,gke=ji(czt?lzt:(czt=1,lzt=ers())),trs={};function nrs(){return hzt?uzt:(hzt=1,function(){if(dzt)return trs;dzt=1;var e,t=ai(),n=Rre(),r=NE().f,o=pwe(),s=lA(),a=Uot(),l=Q4(),d=jot(),u=N1(),h=n("".slice),f=Math.min,g=d("startsWith");t({target:"String",proto:!0,forced:!(!u&&!g&&(e=r(String.prototype,"startsWith"),e&&!e.writable)||g)},{startsWith:function(A){var m=s(l(this));a(A);var v=o(f(arguments.length>1?arguments[1]:void 0,m.length)),p=s(A);return h(m,v,v+p.length)===p}})}(),uzt=Jc()("String","startsWith"))}function irs(){if(fzt)return Azt;fzt=1;var e=wl(),t=nrs(),n=String.prototype;return Azt=function(o){var s=o.startsWith;return typeof o=="string"||o===n||e(n,o)&&s===n.startsWith?t:s}}function rrs(){return mzt?gzt:(mzt=1,gzt=irs())}var O8=ji(vzt?kzt:(vzt=1,kzt=rrs()));function ors(e,t){var n=aR!==void 0&&lR(e)||e["@@iterator"];if(!n){if(MA(e)||(n=function(d,u){if(d){var h;if(typeof d=="string")return pzt(d,u);var f=ba(h={}.toString.call(d)).call(h,8,-1);return f==="Object"&&d.constructor&&(f=d.constructor.name),f==="Map"||f==="Set"?Xl(d):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?pzt(d,u):void 0}}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return a=u.done,u},e:function(u){l=!0,s=u},f:function(){try{a||n.return==null||n.return()}finally{if(l)throw s}}}}function pzt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&q1.warn(`DEPRECATION WARNING: The chart options syntax is outdated and will be removed in a future version. Please switch to standard JSON format. e.g., Change '{ title: My Chart }' to '{ "title": "My Chart" }'. Offending string:`,n),l}var m="{".concat(r,"}");try{return JSON.parse(m,function(v,p){if(v!=="__proto__"&&v!=="constructor"&&v!=="prototype")return p})}catch(v){return q1.error(`Invalid JSON format in chart options. Please check your syntax. Common errors include missing quotes on keys, using single quotes for strings, or a trailing comma. `+"Error: ".concat(v.message,` `)+"Attempted to parse:",m),{}}}},{key:"$parseColumnAlignRules",value:function(n){var r=["U","L","R","C"],o=cs(n).call(n,function(s){var a=0;return/^:/.test(s)&&(a+=1),/:$/.test(s)&&(a+=2),r[a]});return{textAlignRules:o,COLUMN_ALIGN_MAP:{L:"left",R:"right",C:"center"}}}},{key:"$parseTable",value:function(n,r,o){var s,a,l=this,d=0,u=cs(n).call(n,function(C,x){var L=C.replace(/\\\|/g,"~CS").split("|");return L[0]===""&&L.shift(),L[L.length-1]===""&&L.pop(),x!==1&&(d=Math.max(d,L.length)),cs(L).call(L,function(S){return Gi(S).call(S)})}),h=this.$parseColumnAlignRules(u[1]),f=h.textAlignRules,g=h.COLUMN_ALIGN_MAP,k={header:[],rows:[],colLength:d,rowLength:u.length-2},A=this.$parseChartOptions(u[0][0]),m=this.$engine.hash(u[0][0]);A&&(u[0][0]="");var v=cs(s=this.$extendColumns(u[0],d)).call(s,function(C,x){var L;k.header.push(C.replace(/~CS/g,"\\|"));var S=r(C.replace(/~CS/g,"\\|")).html;return nt(L="~CTH".concat(f[x]||"U"," ")).call(L,S," ~CTH$")}).join(""),p=gke(u).call(u,function(C,x,L){var S;if(L<=1)return C;var E=L-2;k.rows[E]=[];var Q=cs(S=l.$extendColumns(x,d)).call(S,function(T,M){var B;k.rows[E].push(T.replace(/~CS/g,"\\|"));var P=r(T.replace(/~CS/g,"\\|")).html;return nt(B="~CTD".concat(f[M]||"U"," ")).call(B,P," ~CTD$")});return C.push("~CTR".concat(Q.join(""),"~CTR$")),C},[]).join(""),b=this.$renderTable(g,v,p,o);if(!A)return b;var O=this.chartRenderEngine.render(A.type,A.options,k),w='
'.concat(O,"
"),y=nt(a="".concat(b.sign)).call(a,m);return{html:b.html.replace(/(^
)/,"$1".concat(w)).replace(/(^
0}},{key:"$renderTable",value:function(n,r,o,s){var a,l,d,u,h=this.$testHeadEmpty(r)?nt(a="~CTHD".concat(r,"~CTHD$~CTBD")).call(a,o,"~CTBD$"):"~CTBD".concat(o,"~CTBD$"),f=this.$engine.hash(h),g=h.replace(/~CTHD\$/g,"").replace(/~CTHD/g,"").replace(/~CTBD\$/g,"").replace(/~CTBD/g,"").replace(/~CTR\$/g,"").replace(/~CTR/g,"").replace(/[ ]?~CTH\$/g,"").replace(/[ ]?~CTD\$/g,"").replace(/~CT(D|H)(L|R|C|U)[ ]?/g,function(k,A,m){var v="":' align="'.concat(n[m],'">')}).replace(/\\\|/g,"|");return{html:nt(l=nt(d=nt(u='
`)).call(l,g,"
"),sign:f}}},{key:"makeHtml",value:function(n,r){var o=this,s=n;return(this.$engine.$cherry.options.engine.global.flowSessionContext||this.selfClosing)&&/(^|^(\s*[^|\s])[^\n]*\n|\n\n|\n(\s*[^|\s])[^\n]*\n)\s*\|[^\n]+\n{0,1}[|:-\s]*\n*$/.test(s)&&(s="".concat(s.replace(/\n[|:-\s]*\n*$/,""),` |-|`)),this.test(s,wzt)&&(s=s.replace(this.RULE[wzt].reg,function(a,l){var d,u=o.getLineCount(a,l),h=cs(d=Gi(a).call(a).split(/\n/)).call(d,function(A){var m;return Gi(m=String(A)).call(m)}),f=o.$parseTable(h,r,u,s),g=f.html,k=f.sign;return o.getCacheWithSpace(o.pushCache(g,k,u),a)})),this.test(s,Ozt)&&(s=s.replace(this.RULE[Ozt].reg,function(a,l){var d,u=o.getLineCount(a,l),h=cs(d=Gi(a).call(a).split(/\n/)).call(d,function(A){var m;return Gi(m=String(A)).call(m)}),f=o.$parseTable(h,r,u,s),g=f.html,k=f.sign;return o.getCacheWithSpace(o.pushCache(g,k,u),a)})),s}},{key:"test",value:function(n,r){return this.RULE[r].reg&&this.RULE[r].reg.test(n)}},{key:"rule",value:function(){return Qwe()}}])}();function n2(){return(typeof window>"u"?"undefined":Cd(window))==="object"}function gzn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(gzn=function(){return!!e})()}ei(fzn,"HOOK_NAME","table");var mzn=function(){function e(t){var n,r,o,s;return Er(this,e),r=this,s=[{needCache:!0}],o=gi(o=e),(n=rs(r,gzn()?Di(o,s||[],gi(r).constructor):o.apply(r,s))).classicBr=lVn("classicBr")?cVn():t.globalConfig.classicBr,n}return vs(e,mc),Dr(e,[{key:"beforeMakeHtml",value:function(n){var r=this;return this.test(n)?n.replace(this.RULE.reg,function(o,s,a){var l,d;if(a===0)return o;var u,h,f=(l=(d=s.match(/\n/g))===null||d===void 0?void 0:d.length)!==null&&l!==void 0?l:0,g="br".concat(f),k="";n2()?k=r.classicBr?nt(u=''):nt(h='

 

'):k=r.classicBr?"":"
";var A=r.pushCache(k,g,f);return` `.concat(A,` `)}):n}},{key:"makeHtml",value:function(n,r){return n}},{key:"rule",value:function(){var n={begin:"(?:\\n)",end:"",content:"((?:\\h*\\n){2,})"};return n.reg=Bf(n,"g",!0),n}}])}();function kzn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(kzn=function(){return!!e})()}ei(mzn,"HOOK_NAME","br");var vzn=function(){function e(){return Er(this,e),t=this,r=[{needCache:!0}],n=gi(n=e),rs(t,kzn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,mc),Dr(e,[{key:"beforeMakeHtml",value:function(n){var r=this;return n.replace(this.RULE.reg,function(o,s){var a,l=(s.match(/\n/g)||[]).length+1,d="hr".concat(l);return d6(o,r.pushCache(nt(a='
'),d))})}},{key:"makeHtml",value:function(n,r){return n}},{key:"rule",value:function(){var n={begin:"(?:^|\\n)(\\n*)[ ]*",end:"(?=$|\\n)",content:"((?:-[ \\t]*){3,}|(?:\\*[ \\t]*){3,}|(?:_[ \\t]*){3,})"};return n.reg=new RegExp(n.begin+n.content+n.end,"g"),n}}])}();ei(vzn,"HOOK_NAME","hr");var pG={processExtendAttributesInAlt:function(t){var n=t.match(/#([0-9]+(px|em|pt|pc|in|mm|cm|ex|%)|auto)/g);if(!n)return"";var r="",o=hg(n,2),s=o[0],a=o[1];return s&&(r="width:".concat(s.replace(/[ #]*/g,""),";")),a&&(r+="height:".concat(a.replace(/[ #]*/g,""),";")),r},processExtendStyleInAlt:function(t){var n={extendStyles:"",extendClasses:""};return this.$addDecorationStyle(n,t),this.$addAlignmentStyle(n,t),n},$addDecorationStyle:function(t,n){var r=n.match(/#(border|shadow|radius|B|S|R)/g);if(r)for(var o=0;o')).call(g,G0(s||""),"");return nt(p="".concat(o)).call(p,this.config.videoWrapper?this.config.videoWrapper(a,n,L):L)}return r}},{key:"toHtml",value:function(n,r,o,s,a,l,d){var u=s===void 0?"ref":"url",h="";if(u==="ref")return n;if(u==="url"){var f,g,k,A,m,v,p,b,O=pG.processExtendAttributesInAlt(o),w=pG.processExtendStyleInAlt(o),y=w.extendStyles,C=w.extendClasses;(O||y)&&(y=nt(b='style="'.concat(O)).call(b,y,'"')),C&&(C=' class="'.concat(C,'" ')),h=a&&Gi(a).call(a)!==""?' title="'.concat(G0(a.replace(/["']/g,"")),'"'):"";var x,L="src",S=this.$engine.$cherry.options;if(S.callback&&S.callback.beforeImageMounted){var E=S.callback.beforeImageMounted(L,s);L=E.srcProp||L,x=E.src||s}var Q=d?d.replace(/[{}]/g,"").replace(/([^=\s]+)=([^\s]+)/g,'$1="$2"').replace(/&/g,"&"):"";return nt(f=nt(g=nt(k=nt(A=nt(m=nt(v=nt(p="".concat(r,"')).call(k,G0(o||")}return n}},{key:"toMediaHtml",value:function(n,r,o,s,a,l,d,u,h){return/(video|audio)/.test(o)?this.replaceToHtml(o,n,r,s,a,l,h):n}},{key:"makeHtml",value:function(n){var r,o,s,a,l=n;return this.test(l)&&(l=ku()?l.replace(this.RULE.reg,_l(r=this.toHtml).call(r,this)):PO(l,this.RULE.reg,_l(o=this.toHtml).call(o,this),!0,1)),this.testMedia(l)&&(l=ku()?l.replace(this.RULE.regExtend,_l(s=this.toMediaHtml).call(s,this)):PO(l,this.RULE.regExtend,_l(a=this.toMediaHtml).call(a,this),!0,1)),l}},{key:"testMedia",value:function(n){return this.RULE.regExtend&&this.RULE.regExtend.test(n)}},{key:"rule",value:function(n){var r,o={begin:ku()?"((?-1?"ul":"ol",t.listStyle=function(d){return/^en-[a-z]/.test(d)?"lower-alpha":/^[a-z]/.test(d)?"lower-greek":/^[一二三四五六七八九十]/.test(d)?"cjk-ideographic":/^I/.test(d)?"upper-roman":/^\+/.test(d)?"circle":/^\*/.test(d)?"square":"default"}(s),t.start=Number(s.replace(".",""))?Number(s.replace(".","")):1,l}):(t.type="blank",e)}var lrs=Dr(function e(){Er(this,e),this.index=0,this.space=0,this.type="",this.start=1,this.listStyle="",this.strs=[],this.children=[],this.lines=0}),wzn=function(){function e(t){var n,r,o,s,a=t.config;return Er(this,e),r=this,s=[{needCache:!0}],o=gi(o=e),(n=rs(r,Ozn()?Di(o,s||[],gi(r).constructor):o.apply(r,s))).config=a||{},n.tree=[],n.emptyLines=0,n.indentSpace=Math.max(n.config.indentSpace,2),n}return vs(e,mc),Dr(e,[{key:"addNode",value:function(n,r,o,s){n.type==="blank"?this.tree[s].strs.push(n.strs[0]):(this.tree[o].children.push(r),this.tree[r]=xzt(xzt({},n),{},{parent:o}))}},{key:"buildTree",value:function(n,r){var o=n.split(` `);this.tree=[],o.unshift("");for(var s=n.match(/\n*$/g)[0].length,a=0;al.space;)d-=1;var u=l.space,h=this.tree[d].space;u".concat(p.strs.join("
"),"

");p.lines+=d.getLineCount(p.strs.join(` `));var w=p.children.length?d.renderTree(k):"";return n.lines+=p.lines,u+=p.lines,/<\/span>/.test(O)&&(b.class+=" check-list-item"),nt(A=nt(m=nt(v="".concat(g,"")).call(m,O)).call(A,w,"")},"");return n.parent===void 0&&(h["data-lines"]=n.index===0?u+this.emptyLines:u,h["data-sign"]=this.sign),r[0]&&o==="ol"&&(h.start=this.tree[r[0]].start),h.class="cherry-list__".concat(this.tree[r[0]].listStyle),nt(s=nt(a=nt(l="<".concat(o)).call(l,Lzt(h),">")).call(a,f,"")}},{key:"renderTree",value:function(n){var r=this,o=0,s=this.tree[n],a=s.children,l=gke(a).call(a,function(d,u,h){if(h===0||r.tree[a[h]].type===r.tree[a[h-1]].type)return d;var f=r.renderSubTree(s,ba(a).call(a,o,h),r.tree[a[h-1]].type);return o=h,d+f},"");return l+(a.length?this.renderSubTree(s,ba(a).call(a,o,a.length),this.tree[a[a.length-1]].type):"")}},{key:"toHtml",value:function(n,r){var o,s;this.emptyLines=(o=(s=n.match(/^\n\n/))===null||s===void 0?void 0:s.length)!==null&&o!==void 0?o:0;var a=n.replace(/~0$/g,"").replace(/^\n+/,"");this.buildTree(function(d){return d.replace(/^((?:|[\t ]+)[*+-]\s+)\[(\s|x)\]/gm,function(u,h,f){var g,k=/\s/.test(f)?'':'';return nt(g="".concat(h)).call(g,k)})}(a),r);var l=this.renderTree(0);return this.pushCache(l,this.sign,this.$getLineNum(n))}},{key:"$getLineNum",value:function(n){var r,o,s,a,l=(r=(o=n.match(/^\n\n/))===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:0;return(s=(a=n.replace(/^\n+/,"").replace(/\n+$/,` `).match(/\n/g))===null||a===void 0?void 0:a.length)!==null&&s!==void 0?s:0+l}},{key:"makeHtml",value:function(n,r){var o=this,s="".concat(n,"~0");return this.test(s)&&(s=s.replace(this.RULE.reg,function(a){return o.getCacheWithSpace(o.checkCache(a,r,o.$getLineNum(a)),a)})),s=s.replace(/~0$/g,"")}},{key:"rule",value:function(){var n={begin:`(?:^| )( *)(([ ]{0,3}([*+-]|\\d+[.]|en-[a-z]\\.|[a-z]\\.|[I一二三四五六七八九十]+\\.)[ \\t]+)`,content:"([^\\r]+?)",end:"(~0|\\n{2,}(?=\\S)(?![ \\t]*(?:[*+-]|\\d+[.]|en-[a-z]\\.|[a-z]\\.|[I一二三四五六七八九十]+\\.)[ \\t]+)))"};return n.reg=new RegExp(n.begin+n.content+n.end,"gm"),n}}])}();function yzn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(yzn=function(){return!!e})()}ei(wzn,"HOOK_NAME","list");var Czn=function(){function e(){return Er(this,e),t=this,r=[{needCache:!0}],n=gi(n=e),rs(t,yzn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,mc),Dr(e,[{key:"handleMatch",value:function(n,r){var o=this;return n.replace(this.RULE.reg,function(s,a,l){var d,u,h,f=o.getLineCount(s,a),g=o.$engine.hash(s),k=o.testHasCache(g);if(k!==!1)return o.getCacheWithSpace(k,s);var A=nt(d=nt(u='
'),m=l.split(/\n1&&(v=` <`.concat(ba(m).call(m,1).join(` <`)));var p=m[0].replace(/^([ \t]*>)/gm,"");return A+=o.cacheAndGetData(p,function(b){return o.$engine.makeHtmlForBlockquote(b).replace(/((?:.+?\\n(?![*+-]|\\d+[.]|[a-z]\\.))(?:>*.+?\\n(?![*+-]|\\d+[.]|[a-z]\\.))*(?:>*.+?)","|",">(?:.+?)",")"].join(""),end:"(?=(\\n)|$)"};return n.reg=Bf(n,"g"),n}}])}();function xzn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(xzn=function(){return!!e})()}ei(Czn,"HOOK_NAME","blockquote");var qXe=function(){function e(t){var n,r,o,s,a=t.config;return t.globalConfig,Er(this,e),r=this,s=[{config:a}],o=gi(o=e),(n=rs(r,xzn()?Di(o,s||[],gi(r).constructor):o.apply(r,s))).enableShortLink=!!a.enableShortLink,n.shortLinkLength=a.shortLinkLength,n.target=a.target?'target="'.concat(a.target,'"'):a.openNewPage?'target="_blank"':"",n.rel=a.rel?'rel="'.concat(a.rel,'"'):"",n}return vs(e,yu),Dr(e,[{key:"isLinkInHtmlAttribute",value:function(n,r,o){for(var s,a=new RegExp(["<","([a-zA-Z][a-zA-Z0-9-]*)","(",["\\s+[a-zA-Z_:][a-zA-Z0-9_.:-]*","(",["\\s*=\\s*","(",["([^\\s\"'=<>`]+)","('[^']*')",'("[^"]*")'].join("|"),")"].join(""),")?"].join(""),")*","\\s*[/]?>"].join(""),"g");(s=a.exec(n))!==null&&!(s.index>r+o);)if(s.index=r+o)return!0;return!1}},{key:"isLinkInATag",value:function(n,r,o){for(var s,a=/]*>[^<]*<\/a>/gi;(s=a.exec(n))!==null&&!(s.index>r+o);)if(s.index=r+o)return!0;return!1}},{key:"makeHtml",value:function(n,r){var o=this;return this.test(n)&&(zXe.test(n)||_ot.test(n))?n.replace(this.RULE.reg,function(s,a,l,d,u,h,f){var g,k,A,m=d==null?void 0:d.replace(/CHERRYFLOWSESSIONCURSOR/g,"");if(o.isLinkInHtmlAttribute(f,h,l.length+m.length)||o.isLinkInATag(f,h,l.length+m.length))return s;var v=l.toLowerCase(),p="",b="",O=!0;if((a!=="<"&&a!=="<"||u!==">"&&u!==">")&&(p=a,b=u,O=!1),Gi(m).call(m)===""||!O&&v===""&&!/www\./.test(m))return s;switch(v){case"javascript:":return s;case"mailto:":var w,y,C,x,L,S;return dEe.test(m)?nt(w=nt(y=nt(C=nt(x=nt(L="".concat(p,'")).call(y,G0(m),"")).call(w,b):s;case"":var E,Q,T,M,B,P,F,R,N,I;if(p===b||!O)return dEe.test(m)?nt(E=nt(Q=nt(T=nt(M=nt(B="".concat(p,'")).call(Q,G0(m),"")).call(E,b):fWt.test(m)?nt(P=nt(F="".concat(p)).call(F,o.renderLink("//".concat(m),m))).call(P,b):s;if(O)return dEe.test(m)?nt(R=nt(N=nt(I='")).call(R,G0(m),""):gWt.test(m)||fWt.test(m)?o.renderLink(m):s;default:return gWt.test(m)?nt(g=nt(k="".concat(p)).call(k,o.renderLink(nt(A="".concat(v)).call(A,m)))).call(g,b):s}return s}):n}},{key:"rule",value:function(){var n,r={begin:"(?)"};return r.reg=Bf(r,"ig"),r}},{key:"renderLink",value:function(n,r){var o,s,a,l,d,u,h=r==null?void 0:r.replace(/CHERRYFLOWSESSIONCURSOR/g,"");if(typeof h!="string")if(this.enableShortLink){var f,g=n.replace(/^https?:\/\//i,"");h=nt(f="".concat(g.substring(0,this.shortLinkLength))).call(f,g.length>this.shortLinkLength?"...":"")}else h=n;var k=this.$engine.urlProcessor(n,"autolink"),A=N5(k),m=G0(h),v=Sd(o=[this.target,this.rel]).call(o,Boolean).join(" "),p=(s=this.$engine.$cherry.options.engine.syntax.autoLink.attrRender(k,k))!==null&&s!==void 0?s:"";return nt(a=nt(l=nt(d=nt(u='")).call(a,e.escapePreservedSymbol(m),"")}}])}();function mke(){var e,t,n,r;if(n2()){var o=this;o.katex=(e=(t=o.$externals)===null||t===void 0?void 0:t.katex)!==null&&e!==void 0?e:window.katex,o.MathJax=(n=(r=o.$externals)===null||r===void 0?void 0:r.MathJax)!==null&&n!==void 0?n:window.MathJax}}ei(qXe,"HOOK_NAME","autoLink"),ei(qXe,"escapePreservedSymbol",function(e){return e.replace(/_/g,"_").replace(/\*/g,"*")});var Szt,Tzt,Ezt,Dzt,Qzt,Bzt,Fzt,Pzt,Mzt,Rzt=["&","<",">",'"',"'"],Lzn=function(t){return t.replace(new RegExp(EVn,"g"),function(n){return Ys(Rzt).call(Rzt,n)!==-1?eM(n):"\\".concat(n)})},crs={};function drs(){if(Tzt)return Szt;Tzt=1;var e=vc(),t=Ps(),n=Ks(),r=lA(),o=Kot().trim,s=Dwe(),a=n("".charAt),l=e.parseFloat,d=e.Symbol,u=d&&d.iterator,h=1/l(s+"-0")!=-1/0||u&&!t(function(){l(Object(u))});return Szt=h?function(f){var g=o(r(f)),k=l(g);return k===0&&a(g,0)==="-"?-0:k}:l}function urs(){return Qzt?Dzt:(Qzt=1,function(){if(Ezt)return crs;Ezt=1;var e=ai(),t=drs();e({global:!0,forced:parseFloat!==t},{parseFloat:t})}(),Dzt=Ol().parseFloat)}function hrs(){return Fzt?Bzt:(Fzt=1,Bzt=urs())}var fEe,Izt,Nzt,Uzt,jzt,Wzt,Hzt,Vzt,zzt,Zzt,gEe,Yzt,Xzt,qzt,A1=ji(Mzt?Pzt:(Mzt=1,Pzt=hrs())),Ars={},frs={};function grs(){if(Izt)return fEe;Izt=1;var e=Xd(),t=cHn(),n=NE(),r=Q2();return fEe=function(s,a,l){for(var d=t(a),u=r.f,h=n.f,f=0;f2&&d(w,arguments[2]);var C=[];return h(b,A,{that:C}),a(w,"errors",C),w};r?r(m,k):o(m,k,{name:!0});var v=m.prototype=s(k.prototype,{constructor:l(1,m),message:l(1,""),name:l(1,"AggregateError")});e({global:!0,constructor:!0,arity:2},{AggregateError:m})}()),Ars}var Gzt,Kzt,Jzt,_zt,$zt,eZt,tZt,nZt,iZt,rZt,oZt,sZt,aZt,lZt,cZt,dZt,uZt,hZt,AZt,fZt,gZt,mZt,kZt,vZt,pZt,bZt,OZt,wZt,Ors={},wrs={};function Tzn(){if(Kzt)return Gzt;Kzt=1;var e=ZA(),t=$Wn(),n=rR(),r=Kc()("species");return Gzt=function(s,a){var l,d=e(s).constructor;return d===void 0||n(l=e(d)[r])?a:t(l)}}function Ezn(){return _zt?Jzt:(_zt=1,Jzt=/(?:ipad|iphone|ipod).*applewebkit/i.test(RE()))}function Dzn(){if(eZt)return $zt;eZt=1;var e,t,n,r,o=vc(),s=iR(),a=rg(),l=Gc(),d=Xd(),u=Ps(),h=tHn(),f=U6(),g=Dot(),k=sz(),A=Ezn(),m=Gre(),v=o.setImmediate,p=o.clearImmediate,b=o.process,O=o.Dispatch,w=o.Function,y=o.MessageChannel,C=o.String,x=0,L={},S="onreadystatechange";u(function(){e=o.location});var E=function(P){if(d(L,P)){var F=L[P];delete L[P],F()}},Q=function(P){return function(){E(P)}},T=function(P){E(P.data)},M=function(P){o.postMessage(C(P),e.protocol+"//"+e.host)};return v&&p||(v=function(P){k(arguments.length,1);var F=l(P)?P:w(P),R=f(arguments,1);return L[++x]=function(){s(F,void 0,R)},t(x),x},p=function(P){delete L[P]},m?t=function(P){b.nextTick(Q(P))}:O&&O.now?t=function(P){O.now(Q(P))}:y&&!A?(r=(n=new y).port2,n.port1.onmessage=T,t=a(r.postMessage,r)):o.addEventListener&&l(o.postMessage)&&!o.importScripts&&e&&e.protocol!=="file:"&&!u(M)?(t=M,o.addEventListener("message",T,!1)):t=S in g("script")?function(B){h.appendChild(g("script"))[S]=function(){h.removeChild(this),E(B)}}:function(B){setTimeout(Q(B),0)}),$zt={set:v,clear:p}}function Qzn(){if(nZt)return tZt;nZt=1;var e=vc(),t=Ed(),n=Object.getOwnPropertyDescriptor;return tZt=function(o){if(!t)return e[o];var s=n(e,o);return s&&s.value}}function Bzn(){if(rZt)return iZt;rZt=1;var e=function(){this.head=null,this.tail=null};return e.prototype={add:function(n){var r={item:n,next:null},o=this.tail;o?o.next=r:this.head=r,this.tail=r},get:function(){var n=this.head;if(n)return(this.head=n.next)===null&&(this.tail=null),n.item}},iZt=e}function yrs(){return sZt?oZt:(sZt=1,oZt=/ipad|iphone|ipod/i.test(RE())&&typeof Pebble<"u")}function Crs(){return lZt?aZt:(lZt=1,aZt=/web0s(?!.*chrome)/i.test(RE()))}function xrs(){if(dZt)return cZt;dZt=1;var e,t,n,r,o,s=vc(),a=Qzn(),l=rg(),d=Dzn().set,u=Bzn(),h=Ezn(),f=yrs(),g=Crs(),k=Gre(),A=s.MutationObserver||s.WebKitMutationObserver,m=s.document,v=s.process,p=s.Promise,b=a("queueMicrotask");if(!b){var O=new u,w=function(){var C,x;for(k&&(C=v.domain)&&C.exit();x=O.get();)try{x()}catch(L){throw O.head&&e(),L}C&&C.enter()};h||k||g||!A||!m?!f&&p&&p.resolve?((r=p.resolve(void 0)).constructor=p,o=l(r.then,r),e=function(){o(w)}):k?e=function(){v.nextTick(w)}:(d=l(d,s),e=function(){d(w)}):(t=!0,n=m.createTextNode(""),new A(w).observe(n,{characterData:!0}),e=function(){n.data=t=!t}),b=function(C){O.head||e(),O.add(C)}}return cZt=b}function Lrs(){return hZt||(hZt=1,uZt=function(t,n){try{arguments.length===1?console.error(t):console.error(t,n)}catch{}}),uZt}function xW(){return fZt?AZt:(fZt=1,AZt=function(t){try{return{error:!1,value:t()}}catch(n){return{error:!0,value:n}}})}function LW(){return mZt?gZt:(mZt=1,gZt=vc().Promise)}function Fzn(){return vZt?kZt:(vZt=1,kZt=(typeof Deno>"u"?"undefined":bn(Deno))=="object"&&Deno&&bn(Deno.version)=="object")}function Srs(){return bZt?pZt:(bZt=1,pZt=!Fzn()&&!Gre()&&(typeof window>"u"?"undefined":bn(window))=="object"&&(typeof document>"u"?"undefined":bn(document))=="object")}function bG(){if(wZt)return OZt;wZt=1;var e=vc(),t=LW(),n=Gc(),r=GWn(),o=_Wn(),s=Kc(),a=Srs(),l=Fzn(),d=N1(),u=NZ(),h=t&&t.prototype,f=s("species"),g=!1,k=n(e.PromiseRejectionEvent),A=r("Promise",function(){var m=o(t),v=m!==String(t);if(!v&&u===66||d&&(!h.catch||!h.finally))return!0;if(!u||u<51||!/native code/.test(m)){var p=new t(function(O){O(1)}),b=function(w){w(function(){},function(){})};if((p.constructor={})[f]=b,!(g=p.then(function(){})instanceof b))return!0}return!v&&(a||l)&&!k});return OZt={CONSTRUCTOR:A,REJECTION_EVENT:k,SUBCLASSING:g}}var yZt,CZt,mEe={};function YL(){if(yZt)return mEe;yZt=1;var e=rA(),t=TypeError,n=function(o){var s,a;this.promise=new o(function(l,d){if(s!==void 0||a!==void 0)throw new t("Bad Promise constructor");s=l,a=d}),this.resolve=e(s),this.reject=e(a)};return mEe.f=function(r){return new n(r)},mEe}var xZt,LZt,SZt,Trs={};function kke(){if(LZt)return xZt;LZt=1;var e=LW(),t=nVn(),n=bG().CONSTRUCTOR;return xZt=n||!t(function(r){e.all(r).then(void 0,function(){})})}var TZt,Ers={},EZt,Drs={},DZt,Qrs={},QZt,BZt,FZt,PZt,Brs={};function Pzn(){if(BZt)return QZt;BZt=1;var e=ZA(),t=Ku(),n=YL();return QZt=function(o,s){if(e(o),t(s)&&s.constructor===o)return s;var a=n.f(o);return(0,a.resolve)(s),a.promise}}function Frs(){return PZt||(PZt=1,function(){if(CZt)return wrs;CZt=1;var e,t,n,r=ai(),o=N1(),s=Gre(),a=vc(),l=ud(),d=Yy(),u=Cwe(),h=Xy(),f=mVn(),g=rA(),k=Gc(),A=Ku(),m=qre(),v=Tzn(),p=Dzn().set,b=xrs(),O=Lrs(),w=xW(),y=Bzn(),C=jE(),x=LW(),L=bG(),S=YL(),E="Promise",Q=L.CONSTRUCTOR,T=L.REJECTION_EVENT,M=L.SUBCLASSING,B=C.getterFor(E),P=C.set,F=x&&x.prototype,R=x,N=F,I=a.TypeError,W=a.document,H=a.process,V=S.f,Z=V,K=!!(W&&W.createEvent&&a.dispatchEvent),X="unhandledrejection",ee=function(ie){var J;return!(!A(ie)||!k(J=ie.then))&&J},q=function(ie,J){var he,pe,Le,Be=J.value,ve=J.state===1,ue=ve?ie.ok:ie.fail,be=ie.resolve,xe=ie.reject,Qe=ie.domain;try{ue?(ve||(J.rejection===2&&ne(J),J.rejection=1),ue===!0?he=Be:(Qe&&Qe.enter(),he=ue(Be),Qe&&(Qe.exit(),Le=!0)),he===ie.promise?xe(new I("Promise-chain cycle")):(pe=ee(he))?l(pe,he,be,xe):be(he)):xe(Be)}catch(Fe){Qe&&!Le&&Qe.exit(),xe(Fe)}},$=function(ie,J){ie.notified||(ie.notified=!0,b(function(){for(var he,pe=ie.reactions;he=pe.get();)q(he,ie);ie.notified=!1,J&&!ie.rejection&&de(ie)}))},oe=function(ie,J,he){var pe,Le;K?((pe=W.createEvent("Event")).promise=J,pe.reason=he,pe.initEvent(ie,!1,!0),a.dispatchEvent(pe)):pe={promise:J,reason:he},!T&&(Le=a["on"+ie])?Le(pe):ie===X&&O("Unhandled promise rejection",he)},de=function(ie){l(p,a,function(){var J,he=ie.facade,pe=ie.value;if(ke(ie)&&(J=w(function(){s?H.emit("unhandledRejection",pe,he):oe(X,he,pe)}),ie.rejection=s||ke(ie)?2:1,J.error))throw J.value})},ke=function(ie){return ie.rejection!==1&&!ie.parent},ne=function(ie){l(p,a,function(){var J=ie.facade;s?H.emit("rejectionHandled",J):oe("rejectionhandled",J,ie.value)})},Ae=function(ie,J,he){return function(pe){ie(J,pe,he)}},Y=function(ie,J,he){ie.done||(ie.done=!0,he&&(ie=he),ie.value=J,ie.state=2,$(ie,!0))},re=function ce(ie,J,he){if(!ie.done){ie.done=!0,he&&(ie=he);try{if(ie.facade===J)throw new I("Promise can't be resolved itself");var pe=ee(J);pe?b(function(){var Le={done:!1};try{l(pe,J,Ae(ce,Le,ie),Ae(Y,Le,ie))}catch(Be){Y(Le,Be,ie)}}):(ie.value=J,ie.state=1,$(ie,!1))}catch(Le){Y({done:!1},Le,ie)}}};if(Q&&(N=(R=function(ie){m(this,N),g(ie),l(e,this);var J=B(this);try{ie(Ae(re,J),Ae(Y,J))}catch(he){Y(J,he)}}).prototype,(e=function(ie){P(this,{type:E,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:0,value:void 0})}).prototype=d(N,"then",function(ce,ie){var J=B(this),he=V(v(this,R));return J.parent=!0,he.ok=!k(ce)||ce,he.fail=k(ie)&&ie,he.domain=s?H.domain:void 0,J.state===0?J.reactions.add(he):b(function(){q(he,J)}),he.promise}),t=function(){var ie=new e,J=B(ie);this.promise=ie,this.resolve=Ae(re,J),this.reject=Ae(Y,J)},S.f=V=function(ie){return ie===R||ie===void 0?new t(ie):Z(ie)},!o&&k(x)&&F!==Object.prototype)){n=F.then,M||d(F,"then",function(ce,ie){var J=this;return new R(function(he,pe){l(n,J,he,pe)}).then(ce,ie)},{unsafe:!0});try{delete F.constructor}catch{}u&&u(F,N)}r({global:!0,constructor:!0,wrap:!0,forced:Q},{Promise:R}),h(R,E,!1,!0),f(E)}(),function(){if(SZt)return Trs;SZt=1;var e=ai(),t=ud(),n=rA(),r=YL(),o=xW(),s=FO();e({target:"Promise",stat:!0,forced:kke()},{all:function(l){var d=this,u=r.f(d),h=u.resolve,f=u.reject,g=o(function(){var k=n(d.resolve),A=[],m=0,v=1;s(l,function(p){var b=m++,O=!1;v++,t(k,d,p).then(function(w){O||(O=!0,A[b]=w,--v||h(A))},f)}),--v||h(A)});return g.error&&f(g.value),u.promise}})}(),function(){if(TZt)return Ers;TZt=1;var e=ai(),t=N1(),n=bG().CONSTRUCTOR,r=LW(),o=aA(),s=Gc(),a=Yy(),l=r&&r.prototype;if(e({target:"Promise",proto:!0,forced:n,real:!0},{catch:function(h){return this.then(void 0,h)}}),!t&&s(r)){var d=o("Promise").prototype.catch;l.catch!==d&&a(l,"catch",d,{unsafe:!0})}}(),function(){if(EZt)return Drs;EZt=1;var e=ai(),t=ud(),n=rA(),r=YL(),o=xW(),s=FO();e({target:"Promise",stat:!0,forced:kke()},{race:function(l){var d=this,u=r.f(d),h=u.reject,f=o(function(){var g=n(d.resolve);s(l,function(k){t(g,d,k).then(u.resolve,h)})});return f.error&&h(f.value),u.promise}})}(),function(){if(DZt)return Qrs;DZt=1;var e=ai(),t=YL();e({target:"Promise",stat:!0,forced:bG().CONSTRUCTOR},{reject:function(r){var o=t.f(this);return(0,o.reject)(r),o.promise}})}(),function(){if(FZt)return Brs;FZt=1;var e=ai(),t=aA(),n=N1(),r=LW(),o=bG().CONSTRUCTOR,s=Pzn(),a=t("Promise"),l=n&&!o;e({target:"Promise",stat:!0,forced:n||o},{resolve:function(u){return s(l&&this===a?r:this,u)}})}()),Ors}var MZt,RZt={};function Mzn(){if(MZt)return RZt;MZt=1;var e=ai(),t=ud(),n=rA(),r=YL(),o=xW(),s=FO();return e({target:"Promise",stat:!0,forced:kke()},{allSettled:function(l){var d=this,u=r.f(d),h=u.resolve,f=u.reject,g=o(function(){var k=n(d.resolve),A=[],m=0,v=1;s(l,function(p){var b=m++,O=!1;v++,t(k,d,p).then(function(w){O||(O=!0,A[b]={status:"fulfilled",value:w},--v||h(A))},function(w){O||(O=!0,A[b]={status:"rejected",reason:w},--v||h(A))})}),--v||h(A)});return g.error&&f(g.value),u.promise}}),RZt}var IZt,NZt={};function Rzn(){if(IZt)return NZt;IZt=1;var e=ai(),t=ud(),n=rA(),r=aA(),o=YL(),s=xW(),a=FO(),l="No one promise resolved";return e({target:"Promise",stat:!0,forced:kke()},{any:function(u){var h=this,f=r("AggregateError"),g=o.f(h),k=g.resolve,A=g.reject,m=s(function(){var v=n(h.resolve),p=[],b=0,O=1,w=!1;a(u,function(y){var C=b++,x=!1;O++,t(v,h,y).then(function(L){x||w||(w=!0,k(L))},function(L){x||w||(x=!0,p[C]=L,--O||A(new f(p,l)))})}),--O||A(new f(p,l))});return m.error&&A(m.value),g.promise}}),NZt}var UZt,jZt={};function Izn(){if(UZt)return jZt;UZt=1;var e=ai(),t=YL();return e({target:"Promise",stat:!0},{withResolvers:function(){var r=t.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}}),jZt}var WZt,HZt,VZt,zZt,ZZt,YZt,XZt,Prs={};function Mrs(){return VZt?HZt:(VZt=1,Szn(),kC(),Frs(),Mzn(),Rzn(),Izn(),function(){if(WZt)return Prs;WZt=1;var e=ai(),t=N1(),n=LW(),r=Ps(),o=aA(),s=Gc(),a=Tzn(),l=Pzn(),d=Yy(),u=n&&n.prototype;if(e({target:"Promise",proto:!0,real:!0,forced:!!n&&r(function(){u.finally.call({then:function(){}},function(){})})},{finally:function(g){var k=a(this,o("Promise")),A=s(g);return this.then(A?function(m){return l(k,g()).then(function(){return m})}:g,A?function(m){return l(k,g()).then(function(){throw m})}:g)}}),!t&&s(n)){var h=o("Promise").prototype.finally;u.finally!==h&&d(u,"finally",h,{unsafe:!0})}}(),sR(),HZt=Ol().Promise)}function Nzn(){if(ZZt)return zZt;ZZt=1;var e=Mrs();return H6(),zZt=e}var oO=ji(XZt?YZt:(XZt=1,YZt=Nzn()));function qZt(e,t){var n=A1(e),r=A1(t);return r>=0?n:n>=0?n+r:Math.min(n,r)}function Rrs(e){var t=e.previousElementSibling,n=e.nextElementSibling;if(!t){var r=getComputedStyle(e),o=e.getBoundingClientRect();if(!n)return{height:Math.max(A1(r.marginTop)+o.height+A1(r.marginBottom),0),offsetTop:e.offsetTop-Math.abs(A1(r.marginTop))};var s=getComputedStyle(n),a=qZt(r.marginBottom,s.marginTop);return{height:Math.max(A1(r.marginTop)+o.height+a,0),offsetTop:e.offsetTop-Math.abs(A1(r.marginTop))}}var l,d,u,h,f=getComputedStyle(e),g=e.getBoundingClientRect(),k=getComputedStyle(t),A=(l=k.marginBottom,d=f.marginTop,u=A1(l),(h=A1(d))<0?0:u>=0?Math.max(h-u,0):h);if(!n)return{height:Math.max(A+g.height+A1(f.marginBottom),0),offsetTop:e.offsetTop-Math.abs(A1(f.marginTop))};var m=getComputedStyle(n),v=qZt(f.marginBottom,m.marginTop);return{height:Math.max(A+g.height+v,0),offsetTop:e.offsetTop-Math.abs(A)}}function Uzn(e,t){if(!e||!e.tagName)return"";var n,r,o=document.createElement("div");return o.appendChild(e.cloneNode(!1)),n=o.innerHTML,r=Ys(n).call(n,">")+1,n=n.substring(0,r)+e.innerHTML+n.substring(r),o=null,n}function ig(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=document.createElement(e);return o.className=n,r!==void 0&&vi(t=ol(r)).call(t,function(s){var a=r[s];if(O8(s).call(s,"data-")){var l=s.replace(/^data-/,"");o.dataset[l]=a}else o.setAttribute(s,a)}),o}function GZt(e,t){return new oO(function(n,r){if(document.getElementById(t))n();else{var o=document.createElement("script");o.src=e,o.async=!0,o.onload=n,o.onerror=r,document.head.appendChild(o)}})}function jzn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(jzn=function(){return!!e})()}var tst=function(){function e(t){var n,r,o,s,a,l=t.config,d=t.cherry;return Er(this,e),o=this,a=[{needCache:!0}],s=gi(s=e),ei(r=rs(o,jzn()?Di(s,a||[],gi(o).constructor):s.apply(o,a)),"engine","MathJax"),ei(r,"katex",void 0),ei(r,"MathJax",void 0),r.engine=n2()?(n=l.engine)!==null&&n!==void 0?n:"MathJax":"node",r.$cherry=d,r.lastCode="",r}return vs(e,mc),Dr(e,[{key:"toHtml",value:function(n,r,o,s){var a;_l(mke).call(mke,this)("engine");var l=n.replace(/^[ \f\r\t\v]*/,"").replace(/\s*$/,""),d=r.replace(/^[ \f\r\t\v]*\n/,""),u=this.$engine.hash(n),h=this.getLineCount(l,d);/\n/.test(r)||(h-=1),/\n\s*$/.test(n)||(h-=1),h=h>0?h:0;var f="",g=s.replace(/\\~D/g,"$").replace(/\\~T/g,"~").replace(/~T/g,"~");if(this.engine==="katex")if(this.katex){var k,A,m,v=this.katex.renderToString(g,{throwOnError:!1,displayMode:!0});this.isSelfClosing()&&(/class="katex-error"/.test(v)&&this.lastCode&&(v=this.lastCode),this.lastCode=v),f=nt(k=nt(A=nt(m='
')).call(k,v,"
")}else{var p,b;f=nt(p=nt(b='
'),this.$engine.asyncRenderHandler.add("math-block-".concat(u))}else if((a=this.MathJax)!==null&&a!==void 0&&a.tex2svg){var O,w,y,C=Uzn(this.MathJax.tex2svg(g));this.isSelfClosing()&&(/data-mml-node="merror"/.test(C)&&this.lastCode&&(C=this.lastCode),this.lastCode=C),f=nt(O=nt(w=nt(y='
')).call(O,C,"
")}else{var x,L;f=nt(x=nt(L='
$$')).call(x,Lzn(s),"$$
")}return o+this.getCacheWithSpace(this.pushCache(f,u,h),n)}},{key:"isSelfClosing",value:function(){return this.$cherry.options.engine.syntax.mathBlock&&this.$cherry.options.engine.syntax.mathBlock.selfClosing||this.$cherry.options.engine.global.flowSessionContext}},{key:"$dealUnclosingMath",value:function(n){var r=n.replace(/(^|[^\\])(~D|~D~D)(CHERRYFLOWSESSIONCURSOR\n*|\n*)$/,"$1$3");return/(^|[^\\])~D~D/.test(r)&&(r=r.replace(/(CHERRYFLOWSESSIONCURSOR\n*|\n*)$/,"~D~D$1")),r}},{key:"makeMath",value:function(n){var r,o;return ku()?n.replace(this.RULE.reg,_l(o=this.toHtml).call(o,this)):PO(n,this.RULE.reg,_l(r=this.toHtml).call(r,this),!0,1)}},{key:"beforeMakeHtml",value:function(n){var r=this.makeMath(n);return this.isSelfClosing()&&r!==(r=this.$dealUnclosingMath(r))&&(r=this.makeMath(r)),r}},{key:"makeHtml",value:function(n){return n}},{key:"rule",value:function(){var n={begin:ku()?"(\\s*)((?')).call(f,A,"")}else{var m,v,p;h=nt(m=nt(v=nt(p="".concat(r,''),this.$engine.asyncRenderHandler.add("math-inline-".concat(d))}else if((s=this.MathJax)!==null&&s!==void 0&&s.tex2svg){var b,O,w,y=Uzn(this.MathJax.tex2svg(u,{em:12,ex:6,display:!1}));this.isSelfClosing()&&(/data-mml-node="merror"/.test(y)&&this.lastCode&&(y=this.lastCode),this.lastCode=y),h=nt(b=nt(O=nt(w="".concat(r,'')).call(b,y,"")}else{var C,x;h=nt(C=nt(x="".concat(r,`$')).call(C,Lzn(o),"$")}return this.pushCache(h,mc.IN_PARAGRAPH_CACHE_KEY_PREFIX+d)}},{key:"isSelfClosing",value:function(){return this.$cherry.options.engine.syntax.inlineMath&&this.$cherry.options.engine.syntax.inlineMath.selfClosing||this.$cherry.options.engine.global.flowSessionContext}},{key:"$dealUnclosingMath",value:function(n){var r=n.replace(/(^|[^\\])(~D)(CHERRYFLOWSESSIONCURSOR\n*|\n*)$/,"$1$3"),o=r.replace(/(^|[^\\])~D~D/g,"");return/(^|[^\\])~D/.test(o)&&(r=r.replace(/(CHERRYFLOWSESSIONCURSOR\n*|\n*)$/,"~D$1")),r}},{key:"beforeMakeHtml",value:function(n){var r=this,o=n;return o=o.replace(Qwe(!0),function(s){var a;return cs(a=s.split("|")).call(a,function(l){return r.makeInlineMath(l)}).join("|").replace(/\\~D/g,"~D").replace(/~D/g,"\\~D")}),o=this.makeInlineMath(o),this.isSelfClosing()&&o!==(o=this.$dealUnclosingMath(o))&&(o=this.makeInlineMath(o)),o}},{key:"makeInlineMath",value:function(n){var r,o;return this.test(n)?ku()?n.replace(this.RULE.reg,_l(o=this.toHtml).call(o,this)):PO(n,this.RULE.reg,_l(r=this.toHtml).call(r,this),!0,1):n}},{key:"makeHtml",value:function(n){return n}},{key:"rule",value:function(){var n={begin:ku()?"((?1?arguments[1]:void 0,a),u=l>2?arguments[2]:void 0,h=u===void 0?a:t(u,a);h>d;)s[d++]=o;return s},kEe}function Urs(){return $Zt?_Zt:($Zt=1,function(){if(JZt)return Irs;JZt=1;var e=ai(),t=Nrs(),n=zre();e({target:"Array",proto:!0},{fill:t}),n("fill")}(),_Zt=Jc()("Array","fill"))}function jrs(){if(tYt)return eYt;tYt=1;var e=wl(),t=Urs(),n=Array.prototype;return eYt=function(o){var s=o.fill;return o===n||e(n,o)&&s===n.fill?t:s}}function Wrs(){return iYt?nYt:(iYt=1,nYt=jrs())}var sYt=ji(oYt?rYt:(oYt=1,rYt=Wrs()));function Vzn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(Vzn=function(){return!!e})()}function zzn(e){return e}var aYt={tocStyle:"plain",tocNodeClass:"toc-li",tocContainerClass:"toc",tocTitleClass:"toc-title",linkProcessor:zzn,showAutoNumber:!1},lYt='

 

',Zzn=function(){function e(t){t.externals;var n,r,o,s,a,l=t.config;return Er(this,e),o=this,a=[{needCache:!0}],s=gi(s=e),ei(r=rs(o,Vzn()?Di(s,a||[],gi(o).constructor):s.apply(o,a)),"tocStyle","nested"),ei(r,"tocNodeClass","toc-li"),ei(r,"tocContainerClass","toc"),ei(r,"tocTitleClass","toc-title"),ei(r,"linkProcessor",zzn),ei(r,"baseLevel",1),ei(r,"isFirstTocToken",!0),ei(r,"allowMultiToc",!1),ei(r,"showAutoNumber",!1),vi(n=ol(aYt)).call(n,function(d){r[d]=l[d]||aYt[d]}),r}return vs(e,mc),Dr(e,[{key:"beforeMakeHtml",value:function(n){var r=this,o=n;return this.test(o,"extend")&&(o=o.replace(this.RULE.extend.reg,function(s,a,l){var d;if(!r.allowMultiToc&&!r.isFirstTocToken)return nt(d=` `.concat(a)).call(d,lYt);var u=r.pushCache(s);return r.isFirstTocToken=!1,d6(s,u)})),this.test(o,"standard")&&(o=o.replace(this.RULE.standard.reg,function(s,a,l){var d;return r.allowMultiToc||r.isFirstTocToken?(r.isFirstTocToken=!1,d6(s,r.pushCache(s))):nt(d=` `.concat(a)).call(d,lYt)})),o}},{key:"makeHtml",value:function(n){return n}},{key:"$makeLevel",value:function(n){for(var r="",o=this.baseLevel;o2&&arguments[2]!==void 0)||arguments[2],g="",k="";r&&(g=this.$makeLevel(n.level));var A=this.linkProcessor("#".concat(n.id).replace(/safe_/g,""));n.isInBlockquote&&(k='');var m=f?"":"";return nt(o=nt(s=nt(a=nt(l=nt(d=nt(u=nt(h='
  • `)).call(u,g)).call(d,k,'')).call(s,n.text,"")).call(o,m)}},{key:"$makePlainToc",value:function(n){var r=this;return cs(n).call(n,function(o){return r.$makeTocItem(o,!0)}).join("")}},{key:"$makeNestedToc",value:function(n){var r,o,s=this,a=0,l=sYt(r=new Array(7)).call(r,!1),d=sYt(o=new Array(7)).call(o,!1),u="";vi(n).call(n,function(f){var g=f.level;if(a===0){for(var k=g;k>=s.baseLevel;k--)u+="
      ",d[k]=!0;return u+=s.$makeTocItem(f,!1,!1),l[g]=!0,void(a=g)}if(g=g;A--)l[A]&&(u+="",l[A]=!1),d[A]&&A>g&&(u+="
    ",d[A]=!1);l[g]=!0,u+=s.$makeTocItem(f,!1,!1),a=g}else if(g===a)l[a]&&(u+="
  • "),u+=s.$makeTocItem(f,!1,!1),l[g]=!0,d[g]=!0;else{for(var m=a+1;m<=g;m++)u+="
      ",d[m]=!0;l[g]=!0,u+=s.$makeTocItem(f,!1,!1),a=g}});for(var h=a;h>=this.baseLevel;h--)l[h]&&(u+="",l[h]=!1),d[h]&&(u+="
    ",d[h]=!1);return u}},{key:"$makeToc",value:function(n,r,o){var s,a,l,d,u,h,f,g=UXe(o,1),k=nt(s=nt(a=nt(l=nt(d='
    ');return k+=nt(u='

    ')).call(u,(h=(f=this.$locale)===null||f===void 0?void 0:f.toc)!==null&&h!==void 0?h:"目录","

    "),n.length<=0?"":(this.baseLevel=Math.min.apply(Math,$T(cs(n).call(n,function(A){return A.level}))),this.tocStyle==="nested"?k+=this.$makeNestedToc(n):k+=this.$makePlainToc(n),k+="
    ")}},{key:"afterMakeHtml",value:function(n){var r,o,s,a,l,d=this,u=(r=e,o="afterMakeHtml",s=this,l=dte(gi(1&(a=3)?r.prototype:r),o,s),2&a&&typeof l=="function"?function(g){return l.apply(s,g)}:l)([n]),h=[],f="";return u.replace(/]*?) id="([^"]+?)"[^>]*?>(?:|)(.+?)<\/h\1>/g,function(g,k,A,m,v){var p,b,O=v.replace(/~fn#[0-9]+#/g,""),w=Dv(A).call(A,'data-in-blockquote="true"');h.push({level:+k,id:m,text:O,isInBlockquote:w}),f+=nt(p=nt(b="".concat(k)).call(b,v)).call(p,w)}),f=this.$engine.hash(f),u=(u=(u=u.replace(/(?:^|\n)(\[\[|\[|【【)(toc|TOC)(\]\]|\]|】】)([<~])/,function(g){return g.replace(/(\]\]|\]|】】)([<~])/,`$1 $2`)})).replace(this.RULE.extend.reg,function(g,k){return d.$makeToc(h,f,k)})).replace(this.RULE.standard.reg,function(g,k){return d.$makeToc(h,f,k)}),this.isFirstTocToken=!0,u}},{key:"test",value:function(n,r){return!!this.RULE[r].reg&&this.RULE[r].reg.test(n)}},{key:"rule",value:function(){var n={begin:"(?:^|\\n)(\\n*)",end:"(?=$|\\n)",content:"[ ]*((?:【【|\\[\\[)(?:toc|TOC)(?:\\]\\]|】】))[ ]*"};n.reg=new RegExp(n.begin+n.content+n.end,"g");var r={begin:"(?:^|\\n)(\\n*)",end:"(?=$|\\n)",content:"[ ]*(\\[(?:toc|TOC)\\])[ ]*"};return r.reg=new RegExp(r.begin+r.content+r.end,"g"),{extend:n,standard:r}}}])}();function Yzn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(Yzn=function(){return!!e})()}ei(Zzn,"HOOK_NAME","toc");var Xzn=function(){function e(t){t.externals;var n,r,o,s,a=t.config,l=t.cherry;return Er(this,e),r=this,o=gi(o=e),(n=rs(r,Yzn()?Di(o,[],gi(r).constructor):o.apply(r,s))).config=a,n.$cherry=l,n.footnoteCache={},n.footnoteMap={},n.footnote=[],n}return vs(e,mc),Dr(e,[{key:"$cleanCache",value:function(){this.footnoteCache={},this.footnoteMap={},this.footnote=[]}},{key:"pushFootnoteCache",value:function(n,r){this.footnoteCache[n]=r}},{key:"getFootnoteCache",value:function(n){return this.footnoteCache[n]||null}},{key:"pushFootNote",value:function(n,r){var o,s,a,l,d,u,h,f,g,k,A,m,v,p,b=this;if(this.footnoteMap[n])return this.footnoteMap[n];var O=n.replace(/"/g,"'"),w=this.footnote.length+1,y={},C=this.config.refNumber.render(w,O)||"[".concat(w,"]"),x=((o=this.config.refNumber)===null||o===void 0?void 0:o.appendClass)||"",L=(s=this.config.refList)===null||s===void 0||(a=s.listItem)===null||a===void 0?void 0:a.render(w,O,r,function(){var T,M,B,P,F=b.config.refNumber.render(w,O)||"[".concat(w,"]");return nt(T=nt(M=nt(B=nt(P='')).call(T,F,"")});y.fnref=nt(l=nt(d=nt(u=nt(h='')).call(l,C,""),y.num=w,y.note=L||y.fnref+Gi(r).call(r),y.note=this.$engine.makeHtmlForFootnote(y.note);var S=this.config.bubbleCard?"cherry-show-bubble-card":"",E=nt(f="footnote ".concat(x," ")).call(f,S).replace(/ {2,}/g," ");y.fn=nt(g=nt(k=nt(A=nt(m=nt(v=nt(p='')).call(g,C,""),this.footnote.push(y);var Q="\0~fn#".concat(w-1,"#\0");return this.footnoteMap[n]=Q,Q}},{key:"getFootNote",value:function(){return this.footnote}},{key:"formatFootNote",value:function(){var n,r,o,s,a,l,d,u,h,f,g,k,A,m,v,p,b=this.getFootNote();if(b.length<=0)return"";var O=((n=this.config.refList)===null||n===void 0||(r=n.listItem)===null||r===void 0?void 0:r.appendClass)||"",w=cs(b).call(b,function(E,Q){var T,M;return nt(T=nt(M='
    ')).call(T,E.note,"
    ")}).join(""),y=this.$engine.hash(w),C=((o=this.config.refList)===null||o===void 0||(s=o.title)===null||s===void 0?void 0:s.render())||((a=(l=this.$engine)===null||l===void 0||(d=l.$cherry)===null||d===void 0||(u=d.locale)===null||u===void 0?void 0:u.footnoteTitle)!==null&&a!==void 0?a:"title"),x=this.config.refList?"":"hidden",L=((h=this.config.refList)===null||h===void 0?void 0:h.appendClass)||"",S=((f=this.config.refList)===null||f===void 0||(g=f.title)===null||g===void 0?void 0:g.appendClass)||"";return w=nt(k=nt(A=nt(m=nt(v=nt(p='
    ')).call(A,C,"
    ")).call(k,w,"
    ")}},{key:"beforeMakeHtml",value:function(n){var r=this,o=n;o=o.replace(this.RULE.reg,function(a,l,d,u){return r.pushFootnoteCache(d,u),(a.match(/\n/g)||[]).join("")});var s=[];return o=o.replace(/\[\^([^\]]+?)\](?!:)/g,function(a,l){var d=r.getFootnoteCache(l);if(d)return r.pushFootNote(l,d);if(r.config.selfClosing||r.$cherry.options.engine.global.flowSessionContext){var u,h,f,g,k=l.replace(/"/g,"'");Ys(s).call(s,k)===-1&&s.push(k);var A=r.footnote.length+Ys(s).call(s,k)+1,m=((u=r.config.refNumber)===null||u===void 0?void 0:u.appendClass)||"",v="footnote ".concat(m),p=r.config.refNumber.render(A,k)||"[".concat(A,"]");return nt(h=nt(f=nt(g='')).call(h,p,"")}return a}),o+=this.formatFootNote()}},{key:"makeHtml",value:function(n,r){return n}},{key:"afterMakeHtml",value:function(n){var r=this.getFootNote();return n.replace(/\0~fn#([0-9]+)#\0/g,function(o,s){return r[s].fn})}},{key:"rule",value:function(){var n={begin:"(^|\\n)[ ]*",content:["\\[\\^([^\\]]+?)\\]:\\h*","([\\s\\S]+?)"].join(""),end:"(?=\\s*$|\\n\\n)"};return n.reg=Bf(n,"g",!0),n}}])}();ei(Xzn,"HOOK_NAME","footnote");var cYt,dYt,uYt,hYt,AYt,fYt,gYt,mYt,kYt,Hrs={};function Vrs(){return uYt?dYt:(uYt=1,function(){if(cYt)return Hrs;cYt=1;var e,t=ai(),n=Rre(),r=NE().f,o=pwe(),s=lA(),a=Uot(),l=Q4(),d=jot(),u=N1(),h=n("".slice),f=Math.min,g=d("endsWith");t({target:"String",proto:!0,forced:!(!u&&!g&&(e=r(String.prototype,"endsWith"),e&&!e.writable)||g)},{endsWith:function(A){var m=s(l(this));a(A);var v=arguments.length>1?arguments[1]:void 0,p=m.length,b=v===void 0?p:f(o(v),p),O=s(A);return h(m,b-O.length,b)===O}})}(),dYt=Jc()("String","endsWith"))}function zrs(){if(AYt)return hYt;AYt=1;var e=wl(),t=Vrs(),n=String.prototype;return hYt=function(o){var s=o.endsWith;return typeof o=="string"||o===n||e(n,o)&&s===n.endsWith?t:s}}function Zrs(){return gYt?fYt:(gYt=1,fYt=zrs())}var vke=ji(kYt?mYt:(kYt=1,mYt=Zrs()));function qzn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(qzn=function(){return!!e})()}var Gzn=function(){function e(t){var n,r,o,s;return t.externals,t.config,Er(this,e),r=this,o=gi(o=e),(n=rs(r,qzn()?Di(o,[],gi(r).constructor):o.apply(r,s))).commentCache={},n}return vs(e,mc),Dr(e,[{key:"$cleanCache",value:function(){this.commentCache={}}},{key:"unwrapUrl",value:function(n){var r=Gi(n).call(n);return O8(r).call(r,"<")&&vke(r).call(r,">")?ba(r).call(r,1,-1):O8(r).call(r,"<")&&vke(r).call(r,">")?ba(r).call(r,5,-5):r}},{key:"pushCommentReferenceCache",value:function(n,r){var o,s=est(r.split(/[ ]+/g)),a=s[0],l=ba(s).call(s,1),d=b8.set(this.unwrapUrl(a));this.commentCache["".concat(n).toLowerCase()]=nt(o=[d]).call(o,$T(l)).join(" ")}},{key:"getCommentReferenceCache",value:function(n){return this.commentCache["".concat(n).toLowerCase()]||null}},{key:"beforeMakeHtml",value:function(n){var r=this,o=n;return this.test(o)&&(o=(o=o.replace(this.RULE.reg,function(s,a,l,d){var u;return r.pushCommentReferenceCache(l,d),((u=s.match(/\n/g))!==null&&u!==void 0?u:[]).join("")})).replace(/(\[[^\]]*?\])?(?:\[([^\]\n]+?)\])/g,function(s,a,l){var d,u,h=r.getCommentReferenceCache(l);return h?a?nt(u="".concat(a,"(")).call(u,h,")"):nt(d="[".concat(l,"](")).call(d,h,")"):s}),this.$cleanCache()),o}},{key:"makeHtml",value:function(n,r){return n}},{key:"afterMakeHtml",value:function(n){return b8.restoreAll(n)}},{key:"rule",value:function(){var n={begin:"(^|\\n)[ ]*",content:["\\[([^^][^\\]]*?)\\]:\\h*","([^\\n]+?)"].join(""),end:"(?=$|\\n)"};return n.reg=Bf(n,"g",!0),n}}])}();ei(Gzn,"HOOK_NAME","commentReference");var vYt,pYt,bYt,OYt,wYt,yYt,CYt,xYt,LYt,Yrs={};function Xrs(){return bYt?pYt:(bYt=1,function(){if(vYt)return Yrs;vYt=1;var e=ai(),t=W6().some;e({target:"Array",proto:!0,forced:!jZ()("some")},{some:function(r){return t(this,r,arguments.length>1?arguments[1]:void 0)}})}(),pYt=Jc()("Array","some"))}function qrs(){if(wYt)return OYt;wYt=1;var e=wl(),t=Xrs(),n=Array.prototype;return OYt=function(o){var s=o.some;return o===n||e(n,o)&&s===n.some?t:s}}function Grs(){return CYt?yYt:(CYt=1,yYt=qrs())}var IQ=ji(LYt?xYt:(LYt=1,xYt=Grs())),Kzn=Object.entries,SYt=Object.setPrototypeOf,Krs=Object.isFrozen,Jrs=Object.getPrototypeOf,_rs=Object.getOwnPropertyDescriptor,G1=Object.freeze,p4=Object.seal,Jzn=Object.create,_zn=typeof Reflect<"u"&&Reflect,GXe=_zn.apply,KXe=_zn.construct;G1||(G1=function(t){return t}),p4||(p4=function(t){return t}),GXe||(GXe=function(t,n,r){return t.apply(n,r)}),KXe||(KXe=function(t,n){return VWn(t,ao(n))});var vde=K1(Array.prototype.forEach),$rs=K1(Array.prototype.lastIndexOf),TYt=K1(Array.prototype.pop),dq=K1(Array.prototype.push),eos=K1(Array.prototype.splice),rAe=K1(String.prototype.toLowerCase),vEe=K1(String.prototype.toString),EYt=K1(String.prototype.match),uq=K1(String.prototype.replace),tos=K1(String.prototype.indexOf),nos=K1(String.prototype.trim),kb=K1(Object.prototype.hasOwnProperty),Gm=K1(RegExp.prototype.test),hq=(DYt=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:rAe;SYt&&SYt(e,null);for(var r=t.length;r--;){var o=t[r];if(typeof o=="string"){var s=n(o);s!==o&&(Krs(t)||(t[r]=s),o=s)}e[o]=!0}return e}function ios(e){for(var t=0;t/gm),los=p4(/\$\{[\w\W]*/gm),cos=p4(/^data-[\-\w.\u00B7-\uFFFF]+$/),dos=p4(/^aria-[\-\w]+$/),$zn=p4(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),uos=p4(/^(?:\w+script|data):/i),hos=p4(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),eZn=p4(/^html$/i),Aos=p4(/^[a-z][.\w]*(-[.\w]+)+$/i),Ax=Object.freeze({__proto__:null,ARIA_ATTR:dos,ATTR_WHITESPACE:hos,CUSTOM_ELEMENT:Aos,DATA_ATTR:cos,DOCTYPE_NAME:eZn,ERB_EXPR:aos,IS_ALLOWED_URI:$zn,IS_SCRIPT_OR_DATA:uos,MUSTACHE_EXPR:sos,TMPLIT_EXPR:los}),fos=1,gos=3,mos=7,kos=8,vos=9,pos=function(){return typeof window>"u"?null:window},bos=function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pos(),n=function(Ne){return e(Ne)};if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==vos||!t.Element)return n.isSupported=!1,n;var r=t.document,o=r,s=o.currentScript,a=t.DocumentFragment,l=t.HTMLTemplateElement,d=t.Node,u=t.Element,h=t.NodeFilter,f=t.NamedNodeMap,g=f===void 0?t.NamedNodeMap||t.MozNamedAttrMap:f,k=t.HTMLFormElement,A=t.DOMParser,m=t.trustedTypes,v=u.prototype,p=Aq(v,"cloneNode"),b=Aq(v,"remove"),O=Aq(v,"nextSibling"),w=Aq(v,"childNodes"),y=Aq(v,"parentNode");if(typeof l=="function"){var C=r.createElement("template");C.content&&C.content.ownerDocument&&(r=C.content.ownerDocument)}var x,L="",S=r,E=S.implementation,Q=S.createNodeIterator,T=S.createDocumentFragment,M=S.getElementsByTagName,B=o.importNode,P={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported=typeof Kzn=="function"&&typeof y=="function"&&E&&E.createHTMLDocument!==void 0;var F=Ax.MUSTACHE_EXPR,R=Ax.ERB_EXPR,N=Ax.TMPLIT_EXPR,I=Ax.DATA_ATTR,W=Ax.ARIA_ATTR,H=Ax.IS_SCRIPT_OR_DATA,V=Ax.ATTR_WHITESPACE,Z=Ax.CUSTOM_ELEMENT,K=Ax.IS_ALLOWED_URI,X=null,ee=sa({},[].concat(ao(QYt),ao(pEe),ao(bEe),ao(OEe),ao(BYt))),q=null,$=sa({},[].concat(ao(FYt),ao(wEe),ao(PYt),ao(pde))),oe=Object.seal(Jzn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),de=null,ke=null,ne=!0,Ae=!0,Y=!1,re=!0,ce=!1,ie=!0,J=!1,he=!1,pe=!1,Le=!1,Be=!1,ve=!1,ue=!0,be=!1,xe=!0,Qe=!1,Fe={},Ge=null,Xe=sa({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),$e=null,vt=sa({},["audio","video","img","source","image","track"]),mt=null,rt=sa({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yt="http://www.w3.org/1998/Math/MathML",Rt="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml",ze=Ke,jt=!1,en=null,bt=sa({},[yt,Rt,Ke],vEe),Dt=sa({},["mi","mo","mn","ms","mtext"]),Ct=sa({},["annotation-xml"]),On=sa({},["title","style","font","a","script"]),Fn=null,di=["application/xhtml+xml","text/html"],Pi=null,Ci=null,Ir=r.createElement("form"),Gr=function(Ne){return Ne instanceof RegExp||Ne instanceof Function},Sr=function(){var Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!Ci||Ci!==Ne){if(Ne&&bn(Ne)=="object"||(Ne={}),Ne=Qx(Ne),Fn=di.indexOf(Ne.PARSER_MEDIA_TYPE)===-1?"text/html":Ne.PARSER_MEDIA_TYPE,Pi=Fn==="application/xhtml+xml"?vEe:rAe,X=kb(Ne,"ALLOWED_TAGS")?sa({},Ne.ALLOWED_TAGS,Pi):ee,q=kb(Ne,"ALLOWED_ATTR")?sa({},Ne.ALLOWED_ATTR,Pi):$,en=kb(Ne,"ALLOWED_NAMESPACES")?sa({},Ne.ALLOWED_NAMESPACES,vEe):bt,mt=kb(Ne,"ADD_URI_SAFE_ATTR")?sa(Qx(rt),Ne.ADD_URI_SAFE_ATTR,Pi):rt,$e=kb(Ne,"ADD_DATA_URI_TAGS")?sa(Qx(vt),Ne.ADD_DATA_URI_TAGS,Pi):vt,Ge=kb(Ne,"FORBID_CONTENTS")?sa({},Ne.FORBID_CONTENTS,Pi):Xe,de=kb(Ne,"FORBID_TAGS")?sa({},Ne.FORBID_TAGS,Pi):Qx({}),ke=kb(Ne,"FORBID_ATTR")?sa({},Ne.FORBID_ATTR,Pi):Qx({}),Fe=!!kb(Ne,"USE_PROFILES")&&Ne.USE_PROFILES,ne=Ne.ALLOW_ARIA_ATTR!==!1,Ae=Ne.ALLOW_DATA_ATTR!==!1,Y=Ne.ALLOW_UNKNOWN_PROTOCOLS||!1,re=Ne.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ce=Ne.SAFE_FOR_TEMPLATES||!1,ie=Ne.SAFE_FOR_XML!==!1,J=Ne.WHOLE_DOCUMENT||!1,Le=Ne.RETURN_DOM||!1,Be=Ne.RETURN_DOM_FRAGMENT||!1,ve=Ne.RETURN_TRUSTED_TYPE||!1,pe=Ne.FORCE_BODY||!1,ue=Ne.SANITIZE_DOM!==!1,be=Ne.SANITIZE_NAMED_PROPS||!1,xe=Ne.KEEP_CONTENT!==!1,Qe=Ne.IN_PLACE||!1,K=Ne.ALLOWED_URI_REGEXP||$zn,ze=Ne.NAMESPACE||Ke,Dt=Ne.MATHML_TEXT_INTEGRATION_POINTS||Dt,Ct=Ne.HTML_INTEGRATION_POINTS||Ct,oe=Ne.CUSTOM_ELEMENT_HANDLING||{},Ne.CUSTOM_ELEMENT_HANDLING&&Gr(Ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(oe.tagNameCheck=Ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ne.CUSTOM_ELEMENT_HANDLING&&Gr(Ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(oe.attributeNameCheck=Ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ne.CUSTOM_ELEMENT_HANDLING&&typeof Ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(oe.allowCustomizedBuiltInElements=Ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ce&&(Ae=!1),Be&&(Le=!0),Fe&&(X=sa({},BYt),q=[],Fe.html===!0&&(sa(X,QYt),sa(q,FYt)),Fe.svg===!0&&(sa(X,pEe),sa(q,wEe),sa(q,pde)),Fe.svgFilters===!0&&(sa(X,bEe),sa(q,wEe),sa(q,pde)),Fe.mathMl===!0&&(sa(X,OEe),sa(q,PYt),sa(q,pde))),Ne.ADD_TAGS&&(X===ee&&(X=Qx(X)),sa(X,Ne.ADD_TAGS,Pi)),Ne.ADD_ATTR&&(q===$&&(q=Qx(q)),sa(q,Ne.ADD_ATTR,Pi)),Ne.ADD_URI_SAFE_ATTR&&sa(mt,Ne.ADD_URI_SAFE_ATTR,Pi),Ne.FORBID_CONTENTS&&(Ge===Xe&&(Ge=Qx(Ge)),sa(Ge,Ne.FORBID_CONTENTS,Pi)),xe&&(X["#text"]=!0),J&&sa(X,["html","head","body"]),X.table&&(sa(X,["tbody"]),delete de.tbody),Ne.TRUSTED_TYPES_POLICY){if(typeof Ne.TRUSTED_TYPES_POLICY.createHTML!="function")throw hq('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ne.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw hq('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=Ne.TRUSTED_TYPES_POLICY,L=x.createHTML("")}else x===void 0&&(x=function(Lt,En){if(bn(Lt)!="object"||typeof Lt.createPolicy!="function")return null;var Cn=null,Bn="data-tt-policy-suffix";En&&En.hasAttribute(Bn)&&(Cn=En.getAttribute(Bn));var bi="dompurify"+(Cn?"#"+Cn:"");try{return Lt.createPolicy(bi,{createHTML:function(We){return We},createScriptURL:function(We){return We}})}catch{return console.warn("TrustedTypes policy "+bi+" could not be created."),null}}(m,s)),x!==null&&typeof L=="string"&&(L=x.createHTML(""));G1&&G1(Ne),Ci=Ne}},Po=sa({},[].concat(ao(pEe),ao(bEe),ao(ros))),Ti=sa({},[].concat(ao(OEe),ao(oos))),ri=function(Ne){dq(n.removed,{element:Ne});try{y(Ne).removeChild(Ne)}catch{b(Ne)}},or=function(Ne,Lt){try{dq(n.removed,{attribute:Lt.getAttributeNode(Ne),from:Lt})}catch{dq(n.removed,{attribute:null,from:Lt})}if(Lt.removeAttribute(Ne),Ne==="is")if(Le||Be)try{ri(Lt)}catch{}else try{Lt.setAttribute(Ne,"")}catch{}},Rs=function(Ne){var Lt=null,En=null;if(pe)Ne=""+Ne;else{var Cn=EYt(Ne,/^[\r\n\t ]+/);En=Cn&&Cn[0]}Fn==="application/xhtml+xml"&&ze===Ke&&(Ne=''+Ne+"");var Bn=x?x.createHTML(Ne):Ne;if(ze===Ke)try{Lt=new A().parseFromString(Bn,Fn)}catch{}if(!Lt||!Lt.documentElement){Lt=E.createDocument(ze,"template",null);try{Lt.documentElement.innerHTML=jt?L:Bn}catch{}}var bi=Lt.body||Lt.documentElement;return Ne&&En&&bi.insertBefore(r.createTextNode(En),bi.childNodes[0]||null),ze===Ke?M.call(Lt,J?"html":"body")[0]:J?Lt.documentElement:bi},Es=function(Ne){return Q.call(Ne.ownerDocument||Ne,Ne,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},dt=function(Ne){return Ne instanceof k&&(typeof Ne.nodeName!="string"||typeof Ne.textContent!="string"||typeof Ne.removeChild!="function"||!(Ne.attributes instanceof g)||typeof Ne.removeAttribute!="function"||typeof Ne.setAttribute!="function"||typeof Ne.namespaceURI!="string"||typeof Ne.insertBefore!="function"||typeof Ne.hasChildNodes!="function")},lt=function(Ne){return typeof d=="function"&&Ne instanceof d};function Ht(st,Ne,Lt){vde(st,function(En){En.call(n,Ne,Lt,Ci)})}var Tt=function(Ne){var Lt=null;if(Ht(P.beforeSanitizeElements,Ne,null),dt(Ne))return ri(Ne),!0;var En=Pi(Ne.nodeName);if(Ht(P.uponSanitizeElement,Ne,{tagName:En,allowedTags:X}),ie&&Ne.hasChildNodes()&&!lt(Ne.firstElementChild)&&Gm(/<[/\w!]/g,Ne.innerHTML)&&Gm(/<[/\w!]/g,Ne.textContent)||Ne.nodeType===mos||ie&&Ne.nodeType===kos&&Gm(/<[/\w]/g,Ne.data))return ri(Ne),!0;if(!X[En]||de[En]){if(!de[En]&&qt(En)&&(oe.tagNameCheck instanceof RegExp&&Gm(oe.tagNameCheck,En)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(En)))return!1;if(xe&&!Ge[En]){var Cn=y(Ne)||Ne.parentNode,Bn=w(Ne)||Ne.childNodes;if(Bn&&Cn)for(var bi=Bn.length-1;bi>=0;--bi){var Ue=p(Bn[bi],!0);Ue.__removalCount=(Ne.__removalCount||0)+1,Cn.insertBefore(Ue,O(Ne))}}return ri(Ne),!0}return Ne instanceof u&&!function(We){var Bt=y(We);Bt&&Bt.tagName||(Bt={namespaceURI:ze,tagName:"template"});var fn=rAe(We.tagName),Sn=rAe(Bt.tagName);return!!en[We.namespaceURI]&&(We.namespaceURI===Rt?Bt.namespaceURI===Ke?fn==="svg":Bt.namespaceURI===yt?fn==="svg"&&(Sn==="annotation-xml"||Dt[Sn]):!!Po[fn]:We.namespaceURI===yt?Bt.namespaceURI===Ke?fn==="math":Bt.namespaceURI===Rt?fn==="math"&&Ct[Sn]:!!Ti[fn]:We.namespaceURI===Ke?!(Bt.namespaceURI===Rt&&!Ct[Sn])&&!(Bt.namespaceURI===yt&&!Dt[Sn])&&!Ti[fn]&&(On[fn]||!Po[fn]):!(Fn!=="application/xhtml+xml"||!en[We.namespaceURI]))}(Ne)?(ri(Ne),!0):En!=="noscript"&&En!=="noembed"&&En!=="noframes"||!Gm(/<\/no(script|embed|frames)/i,Ne.innerHTML)?(ce&&Ne.nodeType===gos&&(Lt=Ne.textContent,vde([F,R,N],function(We){Lt=uq(Lt,We," ")}),Ne.textContent!==Lt&&(dq(n.removed,{element:Ne.cloneNode()}),Ne.textContent=Lt)),Ht(P.afterSanitizeElements,Ne,null),!1):(ri(Ne),!0)},kn=function(Ne,Lt,En){if(ue&&(Lt==="id"||Lt==="name")&&(En in r||En in Ir))return!1;if(!(Ae&&!ke[Lt]&&Gm(I,Lt))){if(!(ne&&Gm(W,Lt))){if(!q[Lt]||ke[Lt]){if(!(qt(Ne)&&(oe.tagNameCheck instanceof RegExp&&Gm(oe.tagNameCheck,Ne)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(Ne))&&(oe.attributeNameCheck instanceof RegExp&&Gm(oe.attributeNameCheck,Lt)||oe.attributeNameCheck instanceof Function&&oe.attributeNameCheck(Lt))||Lt==="is"&&oe.allowCustomizedBuiltInElements&&(oe.tagNameCheck instanceof RegExp&&Gm(oe.tagNameCheck,En)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(En))))return!1}else if(!mt[Lt]){if(!Gm(K,uq(En,V,""))){if((Lt!=="src"&&Lt!=="xlink:href"&&Lt!=="href"||Ne==="script"||tos(En,"data:")!==0||!$e[Ne])&&!(Y&&!Gm(H,uq(En,V,"")))){if(En)return!1}}}}}return!0},qt=function(Ne){return Ne!=="annotation-xml"&&EYt(Ne,Z)},oo=function(Ne){Ht(P.beforeSanitizeAttributes,Ne,null);var Lt=Ne.attributes;if(!(!Lt||dt(Ne))){for(var En={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q,forceKeepAttr:void 0},Cn=Lt.length,Bn=function(){var We=Lt[Cn],Bt=We.name,fn=We.namespaceURI,Sn=We.value,kr=Pi(Bt),_r=Sn,zo=Bt==="value"?_r:nos(_r);if(En.attrName=kr,En.attrValue=zo,En.keepAttr=!0,En.forceKeepAttr=void 0,Ht(P.uponSanitizeAttribute,Ne,En),zo=En.attrValue,!be||kr!=="id"&&kr!=="name"||(or(Bt,Ne),zo="user-content-"+zo),ie&&Gm(/((--!?|])>)|<\/(style|title)/i,zo))return or(Bt,Ne),0;if(En.forceKeepAttr)return 0;if(!En.keepAttr||!re&&Gm(/\/>/i,zo))return or(Bt,Ne),0;ce&&vde([F,R,N],function(Cu){zo=uq(zo,Cu," ")});var yl=Pi(Ne.nodeName);if(kn(yl,kr,zo)){if(x&&bn(m)=="object"&&typeof m.getAttributeType=="function"&&!fn)switch(m.getAttributeType(yl,kr)){case"TrustedHTML":zo=x.createHTML(zo);break;case"TrustedScriptURL":zo=x.createScriptURL(zo)}if(zo!==_r)try{fn?Ne.setAttributeNS(fn,Bt,zo):Ne.setAttribute(Bt,zo),dt(Ne)?ri(Ne):TYt(n.removed)}catch{or(Bt,Ne)}}else or(Bt,Ne)},bi;Cn--;)bi=Bn();Ht(P.afterSanitizeAttributes,Ne,null)}},zn=function st(Ne){var Lt=null,En=Es(Ne);for(Ht(P.beforeSanitizeShadowDOM,Ne,null);Lt=En.nextNode();)Ht(P.uponSanitizeShadowNode,Lt,null),Tt(Lt),oo(Lt),Lt.content instanceof a&&st(Lt.content);Ht(P.afterSanitizeShadowDOM,Ne,null)};return n.sanitize=function(st){var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Lt=null,En=null,Cn=null,Bn=null;if(jt=!st,jt&&(st="\x3C!-->"),typeof st!="string"&&!lt(st)){if(typeof st.toString!="function")throw hq("toString is not a function");if(typeof(st=st.toString())!="string")throw hq("dirty is not a string, aborting")}if(!n.isSupported)return st;if(he||Sr(Ne),n.removed=[],typeof st=="string"&&(Qe=!1),Qe){if(st.nodeName){var bi=Pi(st.nodeName);if(!X[bi]||de[bi])throw hq("root node is forbidden and cannot be sanitized in-place")}}else if(st instanceof d)Lt=Rs("\x3C!---->"),En=Lt.ownerDocument.importNode(st,!0),En.nodeType===fos&&En.nodeName==="BODY"||En.nodeName==="HTML"?Lt=En:Lt.appendChild(En);else{if(!Le&&!ce&&!J&&st.indexOf("<")===-1)return x&&ve?x.createHTML(st):st;if(Lt=Rs(st),!Lt)return Le?null:ve?L:""}Lt&&pe&&ri(Lt.firstChild);for(var Ue=Es(Qe?st:Lt);Cn=Ue.nextNode();)Tt(Cn),oo(Cn),Cn.content instanceof a&&zn(Cn.content);if(Qe)return st;if(Le){if(Be)for(Bn=T.call(Lt.ownerDocument);Lt.firstChild;)Bn.appendChild(Lt.firstChild);else Bn=Lt;return(q.shadowroot||q.shadowrootmode)&&(Bn=B.call(o,Bn,!0)),Bn}var We=J?Lt.outerHTML:Lt.innerHTML;return J&&X["!doctype"]&&Lt.ownerDocument&&Lt.ownerDocument.doctype&&Lt.ownerDocument.doctype.name&&Gm(eZn,Lt.ownerDocument.doctype.name)&&(We=" `+We),ce&&vde([F,R,N],function(Bt){We=uq(We,Bt," ")}),x&&ve?x.createHTML(We):We},n.setConfig=function(){Sr(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),he=!0},n.clearConfig=function(){Ci=null,he=!1},n.isValidAttribute=function(st,Ne,Lt){Ci||Sr({});var En=Pi(st),Cn=Pi(Ne);return kn(En,Cn,Lt)},n.addHook=function(st,Ne){typeof Ne=="function"&&dq(P[st],Ne)},n.removeHook=function(st,Ne){if(Ne!==void 0){var Lt=$rs(P[st],Ne);return Lt===-1?void 0:eos(P[st],Lt,1)[0]}return TYt(P[st])},n.removeHooks=function(st){P[st]=[]},n.removeAllHooks=function(){P={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),JXe=bos(window);function tZn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(tZn=function(){return!!e})()}var MYt=["href","src"];JXe.addHook("afterSanitizeAttributes",function(e){vi(MYt).call(MYt,function(t){if(e.hasAttribute(t)){var n=e.getAttribute(t);e.setAttribute(t,n.replace(/\\/g,"%5c"))}})});var nZn=function(){function e(t){var n,r,o,s,a=t.config;return Er(this,e),r=this,s=[{needCache:!0}],o=gi(o=e),(n=rs(r,tZn()?Di(o,s||[],gi(r).constructor):o.apply(r,s))).filterStyle=a.filterStyle||!1,n.removeTrailingNewline=a.removeTrailingNewline||!1,n}return vs(e,mc),Dr(e,[{key:"isAutoLinkTag",value:function(n){var r=[/^<([a-z][a-z0-9+.-]{1,31}:\/\/[^<> `]+)>$/i,/^<(mailto:[^<> `]+)>$/i,/^<([^()<>[\]:'@\\,"\s`]+@[^()<>[\]:'@\\,"\s`.]+\.[^()<>[\]:'@\\,"\s`]+)>$/i];return IQ(r).call(r,function(o){return o.test(n)})}},{key:"isHtmlComment",value:function(n){return/^\x3C!--.*?-->$/.test(n)}},{key:"beforeMakeHtml",value:function(n,r){var o=this;this.$engine.htmlWhiteListAppend?(this.htmlWhiteListAppend=new RegExp("^(".concat(this.$engine.htmlWhiteListAppend,")( |$|/)"),"i"),this.htmlWhiteList=this.$engine.htmlWhiteListAppend.split("|")):(this.htmlWhiteListAppend=!1,this.htmlWhiteList=[]);var s=/^[ ]+/i;this.$engine.htmlBlackList&&(s=/\*/.test(this.$engine.htmlBlackList)?/^[^ ]+( |$|\/)/i:new RegExp("^(".concat(this.$engine.htmlBlackList,")( |$|/)"),"i"));var a=n;return a=(a=(a=(a=(a=(a=function(l){if(typeof l!="string")return"";var d=l.replace(/&(\w+);?/g,function(u,h){return Ys(u).call(u,";")===-1||Ys(wUt).call(wUt,h.toLowerCase())===-1?u.replace(/&/g,"&"):u});return(d=d.replace(/&#(?!x)(\d*);?/gi,function(u,h){return WXe(h)||Ys(u).call(u,";")===-1||h.length>7||!yUt(h)?u.replace(/&/g,"&"):u})).replace(/&#x([0-9a-f]*);?/gi,function(u,h){if(WXe(h))return u.replace(/&/g,"&");var f="0x".concat(h),g=ry(f,16);return isNaN(g)||Ys(u).call(u,";")===-1||h.length>6||!yUt(f)?u.replace(/&/g,"&"):u})}(a=uVn(a))).replace(/<[/]?([^<]*?)>/g,function(l,d){if(s&&s.test(d)&&!o.isAutoLinkTag(l)&&!o.isHtmlComment(l))return l.replace(//g,">");if(!(mns.test(d)||o.isAutoLinkTag(l)||o.isHtmlComment(l)||o.htmlWhiteListAppend!==!1&&o.htmlWhiteListAppend.test(d)))return l.replace(//g,">");var u=l;return d.replace(/^a .*? href="([^"]+)"/,function(h,f){var g=o.$engine.urlProcessor(f,"link");u=u.replace(/ href="[^"]+"/,' href="'.concat(g,'"'))}),d.replace(/^a href="([^"]+)"/,function(h,f){var g=o.$engine.urlProcessor(f,"link");u=u.replace(/ href="[^"]+"/,' href="'.concat(g,'"'))}),d.replace(/^img .*? src="([^"]+)"/,function(h,f){var g=o.$engine.urlProcessor(f,"image");u=u.replace(/ src="[^"]+"/,' src="'.concat(g,'"'))}),d.replace(/^img src="([^"]+)"/,function(h,f){var g=o.$engine.urlProcessor(f,"image");u=u.replace(/ src="[^"]+"/,' src="'.concat(g,'"'))}),u.replace(//g,"$#62;")})).replace(/<(?=(\w|\n|$))/g,"<")).replace(/<\//g,"</")).replace(/\$#60;/g,"<").replace(/\$#62;/g,">")).replace(/\\</g,"<").replace(/\\>/g,">").replace(/\\/g,">"),this.filterStyle&&(a=(a=a.replace(/<([^/][^>]+?) style="[^>\n]+?"([^>\n]*)>/gi,"<$1$2>")).replace(/<([^/][^>]+?) style='[^>\n]+?'([^>\n]*)>/gi,"<$1$2>")),this.removeTrailingNewline&&(a=a.replace(/(<\/[^>\n]+>)\s*\n\s*\n+/g,`$1 `)),a}},{key:"makeHtml",value:function(n,r){return n}},{key:"afterMakeHtml",value:function(n){var r,o,s=n,a={ALLOW_UNKNOWN_PROTOCOLS:!0,ADD_ATTR:["target"]},l=this.$engine.$cherry.options.engine.global.htmlAttrWhiteList;if(a.ADD_ATTR=nt(r=a.ADD_ATTR).call(r,(o=l==null?void 0:l.split(/[;,|]/))!==null&&o!==void 0?o:[]),this.htmlWhiteListAppend!==!1){var d;if(a.ADD_TAGS=this.htmlWhiteList,(this.htmlWhiteListAppend.test("style")||this.htmlWhiteListAppend.test("ALL"))&&(s=s.replace(/| [^>]*>).*?<\/style>/gi,function(m){return m.replace(/
    /gi,"")})),(this.htmlWhiteListAppend.test("iframe")||this.htmlWhiteListAppend.test("ALL"))&&(a.ADD_ATTR=nt(d=a.ADD_ATTR).call(d,["align","frameborder","height","longdesc","marginheight","marginwidth","name","sandbox","scrolling","seamless","src","srcdoc","width"]),a.SANITIZE_DOM=!1,s=s.replace(/| [^>]*>).*?<\/iframe>/gi,function(m){return m.replace(/
    /gi,"").replace(/\n/g,"")})),this.htmlWhiteListAppend.test("script")||this.htmlWhiteListAppend.test("ALL"))return s=s.replace(/| [^>]*>).*?<\/script>/gi,function(m){return m.replace(/
    /gi,"")})}n2()||(a.FORBID_ATTR=["data-sign","data-lines"]),a.ADD_TAGS||(a.ADD_TAGS=[]),typeof a.ADD_TAGS=="string"?a.ADD_TAGS+="|foreignObject":MA(a.ADD_TAGS)&&a.ADD_TAGS.push("foreignObject"),a.HTML_INTEGRATION_POINTS||(a.HTML_INTEGRATION_POINTS={}),a.HTML_INTEGRATION_POINTS.foreignobject=!0;var u=s.split(` `),h=100,f=Math.round(1.2*u.length/h);if(u.length>h){for(var g=[],k=0;k>>0===s))throw new RangeError("Invalid code point: ".concat(s));s<=65535?t=e.push(s):(s-=65536,t=e.push(55296+(s>>10),s%1024+56320)),t>=16383&&(n+=String.fromCharCode.apply(null,e),e.length=0)}return n+String.fromCharCode.apply(null,e)}var rZn=function(){function e(){var t,n,r,o,s=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{config:void 0}).config;if(Er(this,e),n=this,o=[{config:s}],r=gi(r=e),(t=rs(n,iZn()?Di(r,o||[],gi(n).constructor):r.apply(n,o))).options={useUnicode:!0,upperCase:!1,customHandled:!1,resourceURL:"https://github.githubassets.com/images/icons/emoji/unicode/${code}.png?v8",emojis:wos({},Oos)},Cd(s)!=="object")return rs(t);var a=s.useUnicode,l=s.customResourceURL,d=s.customRenderer,u=s.upperCase;return t.options.useUnicode=typeof a=="boolean"?a:t.options.useUnicode,t.options.upperCase=typeof u=="boolean"?u:t.options.upperCase,a===!1&&typeof l=="string"&&(t.options.resourceURL=l),typeof d=="function"&&(t.options.customHandled=!0,t.options.customRenderer=d),t}return vs(e,yu),Dr(e,[{key:"makeHtml",value:function(n,r){var o=this;return this.test(n)?n.replace(this.RULE.reg,function(s,a){var l;if(o.options.customHandled&&typeof o.options.customRenderer=="function")return o.options.customRenderer(a);var d=o.options.emojis[a];if(typeof d!="string")return s;if(o.options.useUnicode){var u,h=cs(u=d.split("-")).call(u,function(g){return"0x".concat(g)});return yos.apply(void 0,$T(h))}o.options.upperCase&&(d=d.toUpperCase());var f=o.options.resourceURL.replace(/\$\{code\}/g,d);return nt(l='')).call(l,G0(a),'')}):n}},{key:"rule",value:function(){var n={begin:":",content:"([a-zA-Z0-9+_]+?)",end:":"};return n.reg=Bf(n,"g"),n}}])}();function oZn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(oZn=function(){return!!e})()}ei(rZn,"HOOK_NAME","emoji");var sZn=function(){function e(){return Er(this,e),t=this,r=arguments,n=gi(n=e),rs(t,oZn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,yu),Dr(e,[{key:"makeHtml",value:function(n){return this.test(n)?n.replace(this.RULE.reg,'$1$2$3'):n}},{key:"rule",value:function(){var n={begin:"(^| )\\/",end:"\\/( |$)",content:"([^\\n]+?)"};return n.reg=new RegExp(n.begin+n.content+n.end,"g"),n}}])}();function aZn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(aZn=function(){return!!e})()}ei(sZn,"HOOK_NAME","underline");var lZn=function(){function e(){return Er(this,e),t=this,r=arguments,n=gi(n=e),rs(t,aZn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,yu),Dr(e,[{key:"makeHtml",value:function(n){return this.test(n)?n.replace(this.RULE.reg,"$1$2$3"):n}},{key:"rule",value:function(){var n={begin:"(^| )==",end:"==( |$|\\n)",content:"([^\\n]+?)"};return n.reg=new RegExp(n.begin+n.content+n.end,"g"),n}}])}();ei(lZn,"HOOK_NAME","highLight");var IYt,NYt,UYt;function Cos(){if(UYt)return NYt;UYt=1;var e=Nzn();return IYt||(IYt=1,Izn()),NYt=e}var jYt,WYt,HYt,xos={},VYt,zYt,ZYt,YYt,XYt;function Los(){if(ZYt)return zYt;ZYt=1;var e=Cos();return jYt||(jYt=1,Szn()),WYt||(WYt=1,Mzn()),function(){if(HYt)return xos;HYt=1;var t=ai(),n=iR(),r=U6(),o=YL(),s=rA(),a=xW();t({target:"Promise",stat:!0,forced:!0},{try:function(d){var u=r(arguments,1),h=o.f(this),f=a(function(){return n(s(d),void 0,u)});return(f.error?h.reject:h.resolve)(f.value),h.promise}})}(),VYt||(VYt=1,Rzn()),zYt=e}function cZn(){return XYt?YYt:(XYt=1,YYt=Los())}var dZn=ji(cZn());function qYt(e,t,n,r,o,s,a){try{var l=e[s](a),d=l.value}catch(u){return void n(u)}l.done?t(d):dZn.resolve(d).then(r,o)}function eE(e){return function(){var t=this,n=arguments;return new dZn(function(r,o){var s=e.apply(t,n);function a(d){qYt(s,r,o,a,l,"next",d)}function l(d){qYt(s,r,o,a,l,"throw",d)}a(void 0)})}}var GYt,KYt,JYt,_Yt,$Yt,eXt,tXt,nXt={exports:{}},iXt={exports:{}};function Sos(){return GYt||(GYt=1,function(e){var t=Not(),n=OHn();function r(o){return e.exports=r=typeof t=="function"&&bn(n)=="symbol"?function(s){return bn(s)}:function(s){return s&&typeof t=="function"&&s.constructor===t&&s!==t.prototype?"symbol":bn(s)},e.exports.__esModule=!0,e.exports.default=e.exports,r(o)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(iXt)),iXt.exports}function Tos(){return JYt?KYt:(JYt=1,KYt=lHn())}function Eos(){return $Yt?_Yt:($Yt=1,_Yt=Tos())}function Dos(){return tXt?eXt:(tXt=1,eXt=Eos())}var rXt,oXt,sXt,aXt,lXt,cXt,dXt,uXt,hXt,AXt,fXt,gXt,mXt,Qos={};function Bos(){return sXt?oXt:(sXt=1,function(){if(rXt)return Qos;rXt=1;var e=ai(),t=Ks(),n=oR(),r=t([].reverse),o=[1,2];e({target:"Array",proto:!0,forced:String(o)===String(o.reverse())},{reverse:function(){return n(this)&&(this.length=this.length),r(this)}})}(),oXt=Jc()("Array","reverse"))}function Fos(){if(lXt)return aXt;lXt=1;var e=wl(),t=Bos(),n=Array.prototype;return aXt=function(o){var s=o.reverse;return o===n||e(n,o)&&s===n.reverse?t:s}}function Pos(){return dXt?cXt:(dXt=1,cXt=Fos())}function Mos(){return hXt?uXt:(hXt=1,uXt=Pos())}function Ros(){return fXt?AXt:(fXt=1,AXt=Mos())}function Ios(){return mXt?gXt:(mXt=1,gXt=Ros())}var kXt,yEe,vXt,pXt,bXt,OXt,wXt,CEe,yXt,CXt,xXt,LXt,SXt,Nos=function(){if(vXt)return yEe;vXt=1;var e=(kXt||(kXt=1,function(t){var n=Sos().default,r=uHn(),o=Not(),s=THn(),a=LHn(),l=Dos(),d=wVn(),u=CHn(),h=cZn(),f=Ios(),g=RVn();function k(){t.exports=k=function(){return m},t.exports.__esModule=!0,t.exports.default=t.exports;var A,m={},v=Object.prototype,p=v.hasOwnProperty,b=r||function(oe,de,ke){oe[de]=ke.value},O=typeof o=="function"?o:{},w=O.iterator||"@@iterator",y=O.asyncIterator||"@@asyncIterator",C=O.toStringTag||"@@toStringTag";function x(oe,de,ke){return r(oe,de,{value:ke,enumerable:!0,configurable:!0,writable:!0}),oe[de]}try{x({},"")}catch{x=function(ke,ne,Ae){return ke[ne]=Ae}}function L(oe,de,ke,ne){var Ae=de&&de.prototype instanceof P?de:P,Y=s(Ae.prototype),re=new q(ne||[]);return b(Y,"_invoke",{value:Z(oe,ke,re)}),Y}function S(oe,de,ke){try{return{type:"normal",arg:oe.call(de,ke)}}catch(ne){return{type:"throw",arg:ne}}}m.wrap=L;var E="suspendedStart",Q="suspendedYield",T="executing",M="completed",B={};function P(){}function F(){}function R(){}var N={};x(N,w,function(){return this});var I=a&&a(a($([])));I&&I!==v&&p.call(I,w)&&(N=I);var W=R.prototype=P.prototype=s(N);function H(oe){var de;l(de=["next","throw","return"]).call(de,function(ke){x(oe,ke,function(ne){return this._invoke(ke,ne)})})}function V(oe,de){function ke(Ae,Y,re,ce){var ie=S(oe[Ae],oe,Y);if(ie.type!=="throw"){var J=ie.arg,he=J.value;return he&&n(he)=="object"&&p.call(he,"__await")?de.resolve(he.__await).then(function(pe){ke("next",pe,re,ce)},function(pe){ke("throw",pe,re,ce)}):de.resolve(he).then(function(pe){J.value=pe,re(J)},function(pe){return ke("throw",pe,re,ce)})}ce(ie.arg)}var ne;b(this,"_invoke",{value:function(Y,re){function ce(){return new de(function(ie,J){ke(Y,re,ie,J)})}return ne=ne?ne.then(ce,ce):ce()}})}function Z(oe,de,ke){var ne=E;return function(Ae,Y){if(ne===T)throw Error("Generator is already running");if(ne===M){if(Ae==="throw")throw Y;return{value:A,done:!0}}for(ke.method=Ae,ke.arg=Y;;){var re=ke.delegate;if(re){var ce=K(re,ke);if(ce){if(ce===B)continue;return ce}}if(ke.method==="next")ke.sent=ke._sent=ke.arg;else if(ke.method==="throw"){if(ne===E)throw ne=M,ke.arg;ke.dispatchException(ke.arg)}else ke.method==="return"&&ke.abrupt("return",ke.arg);ne=T;var ie=S(oe,de,ke);if(ie.type==="normal"){if(ne=ke.done?M:Q,ie.arg===B)continue;return{value:ie.arg,done:ke.done}}ie.type==="throw"&&(ne=M,ke.method="throw",ke.arg=ie.arg)}}}function K(oe,de){var ke=de.method,ne=oe.iterator[ke];if(ne===A)return de.delegate=null,ke==="throw"&&oe.iterator.return&&(de.method="return",de.arg=A,K(oe,de),de.method==="throw")||ke!=="return"&&(de.method="throw",de.arg=new TypeError("The iterator does not provide a '"+ke+"' method")),B;var Ae=S(ne,oe.iterator,de.arg);if(Ae.type==="throw")return de.method="throw",de.arg=Ae.arg,de.delegate=null,B;var Y=Ae.arg;return Y?Y.done?(de[oe.resultName]=Y.value,de.next=oe.nextLoc,de.method!=="return"&&(de.method="next",de.arg=A),de.delegate=null,B):Y:(de.method="throw",de.arg=new TypeError("iterator result is not an object"),de.delegate=null,B)}function X(oe){var de,ke={tryLoc:oe[0]};1 in oe&&(ke.catchLoc=oe[1]),2 in oe&&(ke.finallyLoc=oe[2],ke.afterLoc=oe[3]),d(de=this.tryEntries).call(de,ke)}function ee(oe){var de=oe.completion||{};de.type="normal",delete de.arg,oe.completion=de}function q(oe){this.tryEntries=[{tryLoc:"root"}],l(oe).call(oe,X,this),this.reset(!0)}function $(oe){if(oe||oe===""){var de=oe[w];if(de)return de.call(oe);if(typeof oe.next=="function")return oe;if(!isNaN(oe.length)){var ke=-1,ne=function Ae(){for(;++ke=0;--Ae){var Y=this.tryEntries[Ae],re=Y.completion;if(Y.tryLoc==="root")return ne("end");if(Y.tryLoc<=this.prev){var ce=p.call(Y,"catchLoc"),ie=p.call(Y,"finallyLoc");if(ce&&ie){if(this.prev=0;--ne){var Ae=this.tryEntries[ne];if(Ae.tryLoc<=this.prev&&p.call(Ae,"finallyLoc")&&this.prev=0;--ke){var ne=this.tryEntries[ke];if(ne.finallyLoc===de)return this.complete(ne.completion,ne.afterLoc),ee(ne),B}},catch:function(de){for(var ke=this.tryEntries.length-1;ke>=0;--ke){var ne=this.tryEntries[ke];if(ne.tryLoc===de){var Ae=ne.completion;if(Ae.type==="throw"){var Y=Ae.arg;ee(ne)}return Y}}throw Error("illegal catch attempt")},delegateYield:function(de,ke,ne){return this.delegate={iterator:$(de),resultName:ke,nextLoc:ne},this.method==="next"&&(this.arg=A),B}},m}t.exports=k,t.exports.__esModule=!0,t.exports.default=t.exports}(nXt)),nXt.exports)();yEe=e;try{regeneratorRuntime=e}catch{(typeof globalThis>"u"?"undefined":bn(globalThis))=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return yEe}(),km=ji(Nos);function uZn(){if(wXt)return OXt;wXt=1;var e=VZ(),t=_T();return OXt=function(r){return bn(r)=="symbol"||t(r)&&e(r)=="[object Symbol]"}}function Uos(){if(yXt)return CEe;yXt=1;var e=Ake(),t=(bXt||(bXt=1,pXt=function(l,d){for(var u=-1,h=l==null?0:l.length,f=Array(h);++u=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return a=u.done,u},e:function(u){l=!0,s=u},f:function(){try{a||n.return==null||n.return()}finally{if(l)throw s}}}}function DXt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n",keyword:"》",value:">"}],zos=[{icon:"FullWidth",label:"[]",keyword:"【】",value:"[]",goLeft:1},{icon:"FullWidth",label:"【】",keyword:"【",value:"【】",goLeft:1},{icon:"link",label:"link",keyword:"【】",value:"[title](https://url)",selection:{from:19,to:14}},{icon:"FullWidth",label:"()",keyword:"(",value:"()",goLeft:1},{icon:"FullWidth",label:"()",keyword:"(",value:"()",goLeft:1},{icon:"FullWidth",label:"<>",keyword:"《》",value:"<>",goLeft:1},{icon:"FullWidth",label:"《》",keyword:"《》",value:"《》",goLeft:1},{icon:"FullWidth",label:'""',keyword:"“”",value:'""',goLeft:1},{icon:"FullWidth",label:"“”",keyword:"“”",value:"”“",goLeft:1},{icon:"FullWidth",label:"inlineCode",keyword:"`",value:"``",goLeft:1},{icon:"FullWidth",label:"codeBlock",keyword:"`",value:"```\n\n```\n",goTop:2},{icon:"FullWidth",label:"inlineMath",keyword:"$",value:"$$",goLeft:1},{icon:"FullWidth",label:"mathBlock",keyword:"$",value:`$$ $$ `,goTop:2},{icon:"FullWidth",label:"inlineMath",keyword:"¥",value:"$$",goLeft:1},{icon:"FullWidth",label:"mathBlock",keyword:"¥",value:`$$ $$ `,goTop:2},{icon:"FullWidth",label:"inlineMath",keyword:"¥",value:"$$",goLeft:1},{icon:"FullWidth",label:"mathBlock",keyword:"¥",value:`$$ $$ `,goTop:2}],Zos=(xEe=cs(JU).call(JU,function(e){return{icon:"FullWidth",label:e,keyword:"```",value:"```".concat(e,"\n\n```\n"),goTop:2,exactMatch:!0}}),LEe=[],vi(JU).call(JU,function(e){var t,n="",r=Hos(e);try{for(r.s();!(t=r.n()).done;)n+=t.value,LEe.push({icon:"FullWidth",label:e,keyword:"```".concat(n),value:"```".concat(e,"\n\n```\n"),goTop:2,exactMatch:!0})}catch(o){r.e(o)}finally{r.f()}}),nt(xEe).call(xEe,LEe)),BXt=nt(TXt=nt(QXt).call(QXt,zos)).call(TXt,Zos);function Yos(e,t){var n=aR!==void 0&&lR(e)||e["@@iterator"];if(!n){if(MA(e)||(n=function(d,u){if(d){var h;if(typeof d=="string")return FXt(d,u);var f=ba(h={}.toString.call(d)).call(h,8,-1);return f==="Object"&&d.constructor&&(f=d.constructor.name),f==="Map"||f==="Set"?Xl(d):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?FXt(d,u):void 0}}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return a=u.done,u},e:function(u){l=!0,s=u},f:function(){try{a||n.return==null||n.return()}finally{if(l)throw s}}}}function FXt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0?L=C.systemSuggestList:C&&MA(C.extendSystemSuggestList)&&C.extendSystemSuggestList.length>0&&(L=nt(SEe).call(SEe,C.extendSystemSuggestList));var S=cs(L).call(L,function(Q){return Ode(Ode({},Q),{},{label:y[Q.label]||Q.label})}),E=cs(BXt).call(BXt,function(Q){return Ode(Ode({},Q),{},{label:y[Q.label]||Q.label})});return(w[0]==="/"||w[0]==="、"||Dv("#").call("#",w[0]))&&vi(S).call(S,function(Q){Q.keyword="".concat(w[0],Q.keyword)}),Sd(x=nt(E).call(E,S)).call(x,function(Q){var T;return O8(T=Q.keyword).call(T,w[0])})}(f,l.$cherry.locale,l.$cherry.options.editor.suggester);if(/^\s$/.test(m))A(!1);else{var p=m.replace(/\s+/g,"").replace(new RegExp("^".concat(f),"g"),"").replace(/^[#]+/,"#").replace(/^[/]+/,"/").split("").join(".*?"),b=new RegExp("^.*?".concat(p,".*?$"),"i"),O=Sd(v).call(v,function(w){return w.exactMatch?!m||w.keyword===m:!m||b.test(w.keyword)});A(O.length!==0&&O)}},echo:function(){return""}})};for(d.s();!(s=d.n()).done;)u()}catch(h){d.e(h)}finally{d.f()}o=o?nt(a).call(a,o):a,vi(o).call(o,function(h){h.suggestList?(h.keyword||(h.keyword="@"),r.suggester[h.keyword]=h):console.warn("[cherry-suggester]: the suggestList of config is missing.")}),this.suggesterPanel.hasEditor()&&(this.suggesterPanel.editor=null),this.inited=!0}},{key:"makeHtml",value:function(n){var r,o;if(!this.RULE.reg)return n;if(!this.suggesterPanel.hasEditor()&&n2()){var s=this.$engine.$cherry.editor;this.suggesterPanel.setEditor(s),this.suggesterPanel.setSuggester(this.suggester),this.suggesterPanel.bindEvent()}return ku()?n.replace(this.RULE.reg,_l(o=this.toHtml).call(o,this)):PO(n,this.RULE.reg,_l(r=this.toHtml).call(r,this),!0,1)}},{key:"toHtml",value:function(n,r,o,s){var a,l,d,u,h;return s?((l=this.suggester[o])===null||l===void 0||(d=l.echo)===null||d===void 0?void 0:d.call(this,s))||nt(u=nt(h="".concat(r,'')).call(h,o)).call(u,s,""):((a=this.suggester[o])===null||a===void 0?void 0:a.echo)===!1?"".concat(r):this.suggester[o]?s?r+s:"".concat(r):r+s}},{key:"rule",value:function(){var n,r,o,s,a,l,d,u=this;if((n=this.config)===null||n===void 0||!n.suggester||ol((r=this.config)===null||r===void 0?void 0:r.suggester).length<=0)return{};MA(this.config.suggester)?a=cs(l=this.config.suggester).call(l,function(f){return f.keyword||""}):a=cs(d=ol(this.config.suggester)).call(d,function(f){return u.config.suggester[f].keyword||""});var h=cs(a).call(a,function(f){return Wos(f)}).join("|");return{reg:new RegExp(nt(o=nt(s="".concat(ku()?"((?
    '),this.searchCache=!1,this.searchKeyCache=[],this.optionList=[],this.cursorMove=!0,this.suggesterConfig={},this.$cherry=t,this.panelPosition="below"},[{key:"tryCreatePanel",value:function(){!this.$suggesterPanel&&n2()&&document&&(this.$cherry.wrapperDom.appendChild(this.createDom(this.panelWrap)),this.$suggesterPanel=this.$cherry.wrapperDom.querySelector(".cherry-suggester-panel"))}},{key:"hasEditor",value:function(){return!!this.editor&&!!this.editor.editor.display&&!!this.editor.editor.display.wrapper}},{key:"setEditor",value:function(t){this.editor=t}},{key:"setSuggester",value:function(t){this.suggesterConfig=t}},{key:"bindEvent",value:function(){var t,n,r=this;if((t=this.editor)!==null&&t!==void 0&&(n=t.options)!==null&&n!==void 0&&n.showSuggestList){var o=!1;this.editor.editor.on("change",function(l,d){o=!0,r.onCodeMirrorChange(l,d)}),this.editor.editor.on("keydown",function(l,d){o=!0,r.enableRelate()&&r.onKeyDown(l,d)}),this.editor.editor.on("cursorActivity",function(){o||r.stopRelate(),o=!1});var s=this.editor.editor.getOption("extraKeys"),a=["Up","Down","Enter"];vi(a).call(a,function(l){if(typeof s[l]=="function"){var d=s[l];s[l]=function(h){if(r.cursorMove){var f=d.call(h,h);if(f)return f}}}else if(s[l]){if(typeof s[l]=="string"){var u=s[l];s[l]=function(h){r.cursorMove&&r.editor.editor.execCommand(u)}}}else s[l]=function(){if(r.cursorMove)return(_U||{toString:function(){return"Pass"}}).toString()}}),this.editor.editor.setOption("extraKeys",s),this.editor.editor.on("scroll",function(l,d){r.searchCache&&r.relocatePanel(r.editor.editor)}),this.onClickPanelItem()}}},{key:"onClickPanelItem",value:function(){var t=this;this.tryCreatePanel(),this.$suggesterPanel.addEventListener("click",function(n){var r,o,s,a,l=(r=t.$suggesterPanel,o=n.target,a=-1,vi(s=r.childNodes).call(s,function(d,u){return d===o?a=u:""}),a);l>-1&&(t.editor.editor.focus(),t.pasteSelectResult(l)),t.stopRelate()},!1)}},{key:"showSuggesterPanel",value:function(t){var n=t.left,r=t.top,o=t.items;this.tryCreatePanel(),!this.$suggesterPanel&&n2()&&(this.$cherry.wrapperDom.appendChild(this.createDom(this.panelWrap)),this.$suggesterPanel=this.$cherry.wrapperDom.querySelector(".cherry-suggester-panel")),this.updatePanel(o),this.$suggesterPanel.style.left="".concat(n,"px"),this.$suggesterPanel.style.top="".concat(r,"px"),this.$suggesterPanel.style.display="block",this.$suggesterPanel.style.position="absolute",this.$suggesterPanel.style.zIndex="100"}},{key:"hideSuggesterPanel",value:function(){this.tryCreatePanel(),this.$suggesterPanel&&(this.$suggesterPanel.style.display="none")}},{key:"updatePanel",value:function(t){var n=this;this.tryCreatePanel();var r=cs(t).call(t,function(s,a){if(Cd(s)==="object"&&s!==null){var l,d=s.label;return s!=null&&s.icon&&(d=nt(l='')).call(l,d)),n.renderPanelItem(d,!1)}return n.renderPanelItem(s,!1)}).join(""),o=this.suggesterConfig[this.keyword];o&&typeof o.suggestListRender=="function"&&(r=o.suggestListRender.call(this,t)||r),this.$suggesterPanel.innerHTML="",typeof r=="string"?this.$suggesterPanel.innerHTML=r:MA(r)&&r.length>0?vi(r).call(r,function(s){n.$suggesterPanel.appendChild(s)}):Cd(r)==="object"&&r.nodeType===1&&this.$suggesterPanel.appendChild(r)}},{key:"renderPanelItem",value:function(t,n){return n?'
    '.concat(t,"
    "):'
    '.concat(t,"
    ")}},{key:"createDom",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";this.template||(this.template=document.createElement("div")),this.template.innerHTML=Gi(t).call(t);var n=document.createDocumentFragment();return cs(Array.prototype).call(this.template.childNodes,function(r,o){n.appendChild(r)}),n}},{key:"relocatePanel",value:function(t){var n=this.$cherry.wrapperDom.querySelector(".CodeMirror-cursors .CodeMirror-cursor");if(n||(n=this.$cherry.wrapperDom.querySelector(".CodeMirror-selected")),!n)return!1;var r,o=this.$cherry.wrapperDom.getBoundingClientRect(),s=n.getBoundingClientRect(),a=s.left-o.left,l=s.top-o.top,d=s.height;this.panelPosition==="below"?r=l+d+5:r=l-(this.$suggesterPanel?this.$suggesterPanel.offsetHeight:380)-5,this.showSuggesterPanel({left:a,top:r,items:this.optionList})}},{key:"getCursorPos",value:function(t){var n=document.querySelector(".CodeMirror-cursors .CodeMirror-cursor");if(!n)return null;var r=t.getCursor(),o=t.lineInfo(r.line).handle.height,s=n.getBoundingClientRect(),a=s.top+o;return{left:s.left,top:a}}},{key:"startRelate",value:function(t,n,r){var o=this;this.cursorFrom=r,this.keyword=n,this.searchCache=!0,requestAnimationFrame(function(){o.relocatePanelWithBoundaryCheck()})}},{key:"relocatePanelWithBoundaryCheck",value:function(){this.tryCreatePanel(),this.updatePanel(this.optionList),this.$suggesterPanel.style.visibility="hidden",this.$suggesterPanel.style.display="block",this.$suggesterPanel.style.position="absolute";var t=this.$suggesterPanel.offsetHeight||380,n=this.$cherry.wrapperDom.querySelector(".CodeMirror-cursors .CodeMirror-cursor");if(n||(n=this.$cherry.wrapperDom.querySelector(".CodeMirror-selected")),!n)return this.$suggesterPanel.style.display="none",!1;var r,o=this.$cherry.wrapperDom.getBoundingClientRect(),s=n.getBoundingClientRect(),a=s.left-o.left,l=s.top-o.top,d=l+s.height,u=this.$cherry.wrapperDom.clientHeight-d,h=l;u>=t+10?(r=d+5,this.panelPosition="below"):h>=t+10?(r=l-t-5,this.panelPosition="above"):u>h?(r=d+5,this.panelPosition="below"):(r=Math.max(10,l-t-5),this.panelPosition="above"),this.$suggesterPanel.style.left="".concat(a,"px"),this.$suggesterPanel.style.top="".concat(r,"px"),this.$suggesterPanel.style.visibility="visible",this.$suggesterPanel.style.zIndex="100"}},{key:"stopRelate",value:function(){this.hideSuggesterPanel(),this.cursorFrom=null,this.cursorTo=null,this.keyword="",this.searchKeyCache=[],this.searchCache=!1,this.cursorMove=!0,this.optionList=[],this.panelPosition="below"}},{key:"pasteSelectResult",value:function(t,n){var r=this.cursorFrom;if(r){var o,s=MA(this.searchKeyCache)?this.searchKeyCache.join("").length:0;if(o=s>0?{line:r.line,ch:r.ch+s}:this.cursorTo?{line:this.cursorTo.line,ch:this.cursorTo.ch}:{line:r.line,ch:r.ch},this.optionList[t]){var a,l,d="";if(Cd(this.optionList[t])==="object"&&this.optionList[t]!==null&&typeof this.optionList[t].value=="string")d=this.optionList[t].value;else if(Cd(this.optionList[t])==="object"&&this.optionList[t]!==null&&typeof this.optionList[t].value=="function")d=this.optionList[t].value();else{var u;d=nt(u=" ".concat(this.keyword)).call(u,this.optionList[t]," ")}if(vke(d).call(d," ")&&(a=this.editor)!==null&&a!==void 0&&(l=a.editor)!==null&&l!==void 0&&l.getLine&&o&&o.ch!==null&&(this.editor.editor.getLine(o.line)||"")[o.ch]===" "&&(o={line:o.line,ch:o.ch+1}),d&&this.editor.editor.replaceRange(d,r,o),this.optionList[t].goLeft){var h=this.editor.editor.getCursor();this.editor.editor.setCursor(h.line,h.ch-this.optionList[t].goLeft)}if(this.optionList[t].goTop){var f=this.editor.editor.getCursor();this.editor.editor.setCursor(f.line-this.optionList[t].goTop,f.ch)}if(this.optionList[t].selection){var g=this.editor.editor.getCursor().line,k=this.editor.editor.getCursor().ch;this.editor.editor.setSelection({line:g,ch:k-this.optionList[t].selection.from},{line:g,ch:k-this.optionList[t].selection.to})}}}}},{key:"findSelectedItemIndex",value:function(){return fke(Array.prototype).call(this.$suggesterPanel.childNodes,function(t){return t.classList.contains("cherry-suggester-panel__item--selected")})}},{key:"enableRelate",value:function(){return this.searchCache}},{key:"onCodeMirrorChange",value:function(t,n){var r=this,o=n.text,s=n.from,a=n.to,l=n.origin,d=o.length===1?o[0]:"";if(!this.enableRelate()&&this.suggesterConfig[d]&&this.startRelate(t,d,s),this.enableRelate()&&(d||l==="+delete")){var u;if(this.cursorTo=a,d)this.searchKeyCache.push(d);else if(l==="+delete"&&(this.searchKeyCache.pop(),this.searchKeyCache.length===0))return void this.stopRelate();typeof((u=this.suggesterConfig[this.keyword])===null||u===void 0?void 0:u.suggestList)=="function"&&this.suggesterConfig[this.keyword].suggestList(this.searchKeyCache.join(""),function(h){h!==!1?(r.optionList=h&&h.length?h:[],r.updatePanel(r.optionList)):r.stopRelate()})}}},{key:"onKeyDown",value:function(t,n){var r,o=this;if(this.tryCreatePanel(),!this.$suggesterPanel)return!1;var s=n.keyCode;if(Dv(r=[38,40]).call(r,s)){if(this.optionList.length===0)return void Iu(function(){o.stopRelate()},0);this.cursorMove=!1;var a=this.$suggesterPanel.querySelector(".cherry-suggester-panel__item--selected"),l=a||null,d=null;if(a?(s!==38||l.previousElementSibling?s!==40||l.nextElementSibling?s===38?d=l.previousElementSibling:s===40&&(d=l.nextElementSibling):d=this.$suggesterPanel.firstElementChild:d=this.$suggesterPanel.lastElementChild,l&&l.classList&&l.classList.remove("cherry-suggester-panel__item--selected")):s===38?d=this.$suggesterPanel.lastElementChild:s===40&&(d=this.$suggesterPanel.firstElementChild),!d)return void Iu(function(){o.stopRelate()},0);d.classList.add("cherry-suggester-panel__item--selected");var u=this.$suggesterPanel.offsetHeight,h=this.$suggesterPanel.scrollTop,f=h+u,g=d.offsetTop,k=d.offsetHeight;(gf)&&(this.$suggesterPanel.scrollTop=g-u/2)}else if(s===13){var A=this.findSelectedItemIndex();A>=0&&(n.stopPropagation(),this.cursorMove=!1,this.pasteSelectResult(A,n),t.focus()),Iu(function(){o.stopRelate()},0)}else s!==27&&s!==37&&s!==39||(n.stopPropagation(),t.focus(),Iu(function(){o.stopRelate()},0))}}])}();function gZn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(gZn=function(){return!!e})()}var mZn=function(){function e(){return Er(this,e),t=this,r=arguments,n=gi(n=e),rs(t,gZn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,yu),Dr(e,[{key:"makeHtml",value:function(n){return this.test(n)?n.replace(this.RULE.reg,"$1$2$3$4"):n}},{key:"rule",value:function(){var n={begin:"(^| )\\{",end:"\\}( |$)",content:`([^ ]+?)\\|([^ ]+?)`};return n.reg=new RegExp(n.begin+n.content+n.end,"g"),n}}])}();function kZn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(kZn=function(){return!!e})()}ei(mZn,"HOOK_NAME","ruby");var vZn=function(){function e(t){var n,r,o,s;Er(this,e),r=this,s=[{needCache:!0}],o=gi(o=e),n=rs(r,kZn()?Di(o,s||[],gi(r).constructor):o.apply(r,s));var a=t.config,l=a.enableJustify,d=l!==void 0&&l,u=a.enableAlign,h=u!==void 0&&u,f=a.enablePanel,g=f===void 0||f;return n.enableAlign=d||h,n.enablePanel=g,n.initBrReg(t.globalConfig.classicBr),n}return vs(e,mc),Dr(e,[{key:"makeHtml",value:function(n,r){var o=this;return n.replace(this.RULE.reg,function(s,a,l,d){var u,h,f,g,k,A=o.$getTargetType(l);if(!o.enablePanel&&/primary|info|warning|danger|success/i.test(A)||!o.enableAlign&&/(left|right|center|justify)/i.test(A))return s;var m=o.getLineCount(s,a),v=o.$engine.hash(s),p=o.testHasCache(v);if(p!==!1)return d6(s,p);var b=o.$getPanelInfo(l,d,r),O=b.title,w=b.body,y=b.appendStyle,C=b.className;return d6(s,o.pushCache(nt(u=nt(h=nt(f=nt(g=nt(k='
    ")).call(h,O)).call(u,w,"
    "),v,m))})}},{key:"$getClassByType",value:function(n){return/(left|right|center|justify)/i.test(n)?"cherry-text-align cherry-text-align__".concat(n):"cherry-panel cherry-panel__".concat(n)}},{key:"$getPanelInfo",value:function(n,r,o){var s,a=this,l={type:this.$getTargetType(n),title:o(this.$getTitle(n)).html,body:r,appendStyle:"",className:""};l.className=this.$getClassByType(l.type),/(left|right|center|justify)/i.test(l.type)&&(l.appendStyle='style="text-align:'.concat(l.type,';"')),l.title=nt(s='
    ')).call(s,l.title,"
    ");var d=function(f){var g,k;if(Gi(f).call(f)==="")return"";var A=o(f).html,m="p";return new RegExp("<(".concat(Xre,")[^>]*>"),"i").test(A)&&(m="div"),nt(g=nt(k="<".concat(m,">")).call(k,a.$cleanParagraph(A),"")},u="";return u=this.isContainsCache(l.body)?this.makeExcludingCached(l.body,d):d(l.body),l.body='
    '.concat(u,"
    "),l}},{key:"$getTitle",value:function(n){var r=Gi(n).call(n);return/\s/.test(r)?r.replace(/[^\s]+\s/,""):""}},{key:"$getTargetType",value:function(n){var r=/\s/.test(Gi(n).call(n))?Gi(n).call(n).replace(/\s.*$/,""):n;switch(Gi(r).call(r).toLowerCase()){case"primary":case"p":default:return"primary";case"info":case"i":return"info";case"warning":case"w":return"warning";case"danger":case"d":return"danger";case"success":case"s":return"success";case"right":case"r":return"right";case"center":case"c":return"center";case"left":case"l":return"left";case"justify":case"j":return"justify"}}},{key:"rule",value:function(){return(n={begin:/(?:^|\n)(\n*(?:[^\S\n]*)):::([^:][^\n]+?)\s*\n/,content:/([\w\W]*?)/,end:/\n[ \t]*:::[ \t]*(?=$|\n+)/}).reg=new RegExp(n.begin.source+n.content.source+n.end.source,"g"),n;var n}}])}();function pZn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(pZn=function(){return!!e})()}ei(vZn,"HOOK_NAME","panel");var bZn=function(){function e(){return Er(this,e),t=this,r=[{needCache:!0}],n=gi(n=e),rs(t,pZn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,mc),Dr(e,[{key:"makeHtml",value:function(n,r){var o=this;return n.replace(this.RULE.reg,function(s,a,l,d,u){var h,f,g,k=o.getLineCount(s,a),A=o.$engine.hash(s),m=o.testHasCache(A);if(m!==!1)return d6(s,m);var v=o.$getDetailInfo(l,d,u,r),p=v.type,b=v.html;return d6(s,o.pushCache(nt(h=nt(f=nt(g='
    ')).call(h,b,"
    "),A,k))})}},{key:"$getDetailInfo",value:function(n,r,o,s){var a=this,l=/\n\s*(\+\+|\+\+-)\s*[^\n]+\n/.test(o)?"multiple":"single",d=o.split(/\n\s*(\+\+[-]{0,1}\s*[^\n]+)\n/),u=n==="-",h=r,f="";return l==="multiple"?vi(d).call(d,function(g){if(/^\s*\+\+/.test(g))return u=/^\s*\+\+-/.test(g),h=g.replace(/\+\+[-]{0,1}\s*([^\n]+)$/,"$1"),!0;f+=a.$getDetailHtml(u,h,g,s)}):f=this.$getDetailHtml(u,h,o,s),{type:l,html:f}}},{key:"$getDetailHtml",value:function(n,r,o,s){var a=this,l="
    "),d=function(f){var g,k;if(Gi(f).call(f)==="")return"";var A=s(f).html,m="p";return new RegExp("<(".concat(Xre,")[^>]*>"),"i").test(A)&&(m="div"),nt(g=nt(k="<".concat(m,">")).call(k,a.$cleanParagraph(A),"")};l+="".concat(s(r).html,"");var u="";return u=this.isContainsCache(o)?this.makeExcludingCached(o,d):d(o),l+='
    '.concat(u,"
    "),l+="
    "}},{key:"rule",value:function(){return(n={begin:/(?:^|\n)(\n*(?:[^\S\n]*))\+\+\+([-]{0,1})\s+([^\n]+)\n/,content:/([\w\W]+?)/,end:/\n[ \t]*\+\+\+[ \t]*(?=$|\n+)/}).reg=new RegExp(n.begin.source+n.content.source+n.end.source,"g"),n;var n}}])}();ei(bZn,"HOOK_NAME","detail");var PXt,MXt,RXt,IXt,NXt,TEe,UXt,jXt,WXt,HXt,VXt,qos={};function Gos(){if(MXt)return PXt;MXt=1;var e=Ks(),t=pwe(),n=lA(),r=rzn(),o=Q4(),s=e(r),a=e("".slice),l=Math.ceil,d=function(h){return function(f,g,k){var A,m,v=n(o(f)),p=t(g),b=v.length,O=k===void 0?" ":n(k);return p<=b||O===""?v:((m=s(O,l((A=p-b)/O.length))).length>A&&(m=a(m,0,A)),h?v+m:m+v)}};return PXt={start:d(!1),end:d(!0)}}function Kos(){if(IXt)return RXt;IXt=1;var e=Ks(),t=Ps(),n=Gos().start,r=RangeError,o=isFinite,s=Math.abs,a=Date.prototype,l=a.toISOString,d=e(a.getTime),u=e(a.getUTCDate),h=e(a.getUTCFullYear),f=e(a.getUTCHours),g=e(a.getUTCMilliseconds),k=e(a.getUTCMinutes),A=e(a.getUTCMonth),m=e(a.getUTCSeconds);return RXt=t(function(){return l.call(new Date(-50000000000001))!=="0385-07-25T07:06:39.999Z"})||!t(function(){l.call(new Date(NaN))})?function(){if(!o(d(this)))throw new r("Invalid time value");var v=this,p=h(v),b=g(v),O=p<0?"-":p>9999?"+":"";return O+n(s(p),O?6:4,0)+"-"+n(A(v)+1,2,0)+"-"+n(u(v),2,0)+"T"+n(f(v),2,0)+":"+n(k(v),2,0)+":"+n(m(v),2,0)+"."+n(b,3,0)+"Z"}:l}function Jos(){if(UXt)return TEe;UXt=1,function(){if(NXt)return qos;NXt=1;var n=ai(),r=ud(),o=Bg(),s=XWn(),a=Kos(),l=mC();n({target:"Date",proto:!0,forced:Ps()(function(){return new Date(NaN).toJSON()!==null||r(Date.prototype.toJSON,{toISOString:function(){return 1}})!==1})},{toJSON:function(u){var h=o(this),f=s(h,"number");return typeof f!="number"||isFinite(f)?"toISOString"in h||l(h)!=="Date"?h.toISOString():r(a,h):null}})}(),oHn();var e=Ol(),t=iR();return e.JSON||(e.JSON={stringify:JSON.stringify}),TEe=function(r,o,s){return t(e.JSON.stringify,null,arguments)},TEe}function _os(){return WXt?jXt:(WXt=1,jXt=Jos())}var $os=ji(VXt?HXt:(VXt=1,HXt=_os()));function OZn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(OZn=function(){return!!e})()}var wZn=function(){function e(t){return Er(this,e),n=this,o=[{needCache:!0}],r=gi(r=e),rs(n,OZn()?Di(r,o||[],gi(n).constructor):r.apply(n,o));var n,r,o}return vs(e,mc),Dr(e,[{key:"beforeMakeHtml",value:function(n){var r=this;return n.replace(this.RULE.reg,function(o,s){var a,l,d,u,h,f=(a=(l=o.match(/\n/g))===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0,g="fontMatter".concat(f);try{h=JSON.parse(Gi(s).call(s))}catch{var k=Gi(s).call(s).split(` `);h={},vi(k).call(k,function(p){var b=hg(p.split(":"),2),O=b[0],w=b[1];if(typeof O=="string"&&typeof w=="string"){if(O.length>1024)return;h[Gi(O).call(O)]=Gi(w).call(w)}})}if(ol(h).length<=0)return o;("font-size"in h||"fontSize"in h)&&(r.$engine.$cherry.previewer.getDom().style.fontSize=h["font-size"]||h.fontSize);var A=nt(d=nt(u='

    '),m=r.pushCache(A,g,f);return"".concat(m,` `)})}},{key:"makeHtml",value:function(n,r){return n}},{key:"rule",value:function(){var n={begin:"^\\s*-{3}[^\\n]*\\n",end:"\\n-{3}[^\\n]*\\n",content:"([\\s\\S]+?)"};return n.reg=Bf(n,"g",!0),n}}])}();function yZn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(yZn=function(){return!!e})()}ei(wZn,"HOOK_NAME","frontMatter");var CZn=function(){function e(){return Er(this,e),t=this,r=arguments,n=gi(n=e),rs(t,yZn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,yu),Dr(e,[{key:"makeHtml",value:function(n,r){return n.replace(this.RULE.reg,function(o){return oy(" ").call(" ",o.length)})}},{key:"rule",value:function(){var n={begin:"",end:"",content:"",reg:/\s{2,}/g};return n}}])}();function xZn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(xZn=function(){return!!e})()}ei(CZn,"HOOK_NAME","space");var LZn=function(){function e(t){t.config;var n,r,o,s,a=t.cherry;return Er(this,e),r=this,s=[{needCache:!1}],o=gi(o=e),(n=rs(r,xZn()?Di(o,s||[],gi(r).constructor):o.apply(r,s))).$cherry=a,n}return vs(e,mc),Dr(e,[{key:"$dealEmphasis",value:function(n){if(!(this.$cherry.options.engine.syntax.fontEmphasis&&this.$cherry.options.engine.syntax.fontEmphasis.selfClosing||this.$cherry.options.engine.global.flowSessionContext))return n;var r=n;if(/(^|\n)[^\n]*\*{1,3}[^\n]*$/.test(r)&&r.match(/(^|\n)([^\n]+)$/)){r=r.replace(/(~D{1,2})([^\n]+?)\1/g,function(d,u,h){var f,g;return nt(f=nt(g="".concat(u)).call(g,h.replace(/\*/g,"Σ*CONTENT*TMP"))).call(f,u)});for(var o=r.match(/(^|\n)([^\n]+)$/)[2].split(/(\*{1,3})/g),s=[],a=0;a")}),r}},{key:"dealLink",value:function(n){var r;return this.$cherry.options.engine.syntax.link&&(r=this.$cherry.options.engine.syntax.link)!==null&&r!==void 0&&r.selfClosing||this.$cherry.options.engine.global.flowSessionContext?n.replace(/([^[]*?)\[([^\n\]]*?)(\]\([^)]*|\]|)$/,function(o,s,a,l){var d,u,h=l?l.replace(/^(\]\(|\])/,""):"";return nt(d=nt(u="".concat(s,'')).call(d,a,"")}):n}},{key:"makeHtml",value:function(n,r){var o=/\n$/.test(n)?` `:"",s=n.replace(/\n$/,""),a=/CHERRYFLOWSESSIONCURSOR([*_~^]*)$/.test(s)?"CHERRYFLOWSESSIONCURSOR":"";return s=s.replace(/CHERRYFLOWSESSIONCURSOR([*_~^]*)$/g,"$1"),s=this.$dealEmphasis(s),s=this.dealMedia(s),s=(s=this.dealLink(s))+a+o}}])}();ei(LZn,"HOOK_NAME","aiFlowAutoClose");var zXt,ZXt,YXt=[wZn,CW,$Vn,Hzn,tst,LZn,nZn,Xzn,Gzn,hzn,mzn,fzn,Zzn,Czn,dzn,vzn,wzn,bZn,vZn,lzn,rZn,bzn,izn,qXe,szn,HVn,jVn,zVn,KVn,qVn,mZn,YVn,sZn,lZn,fZn,CZn],ess={};function tss(){return ZXt||(ZXt=1,zXt||(zXt=1,fVn()("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},kVn()))),ess}var XXt,qXt,GXt,KXt,EEe,JXt,DEe,_Xt,$Xt,eqt,tqt,nqt,iqt,rqt,oqt,sqt,aqt,lqt,cqt,nss={};function cR(){if(qXt)return XXt;qXt=1;var e=IE(),t=TypeError;return XXt=function(r){if(bn(r)=="object"&&"size"in r&&"has"in r&&"add"in r&&"delete"in r&&"keys"in r)return r;throw new t(e(r)+" is not a set")}}function dR(){if(KXt)return GXt;KXt=1;var e=aA(),t=vVn(),n=e("Set"),r=n.prototype;return GXt={Set:n,add:t("add",1),has:t("has",1),remove:t("delete",1),proto:r}}function Kre(){if(JXt)return EEe;JXt=1;var e=WE();return EEe=function(n,r,o){return o?e(n.keys(),r,!0):n.forEach(r)},EEe}function nst(){if(_Xt)return DEe;_Xt=1;var e=dR(),t=Kre(),n=e.Set,r=e.add;return DEe=function(s){var a=new n;return t(s,function(l){r(a,l)}),a},DEe}function Jre(){return eqt||(eqt=1,$Xt=function(t){return t.size}),$Xt}function iss(){return nqt?tqt:(nqt=1,tqt=function(t){return{iterator:t,next:t.next,done:!1}})}function uR(){if(rqt)return iqt;rqt=1;var e=rA(),t=ZA(),n=ud(),r=UZ(),o=iss(),s="Invalid size",a=RangeError,l=TypeError,d=Math.max,u=function(f,g){this.set=f,this.size=d(g,0),this.has=e(f.has),this.keys=e(f.keys)};return u.prototype={getIterator:function(){return o(t(n(this.keys,this.set)))},includes:function(f){return n(this.has,this.set,f)}},iqt=function(f){t(f);var g=+f.size;if(g!=g)throw new l(s);var k=r(g);if(k<0)throw new a(s);return new u(f,k)}}function rss(){if(sqt)return oqt;sqt=1;var e=cR(),t=dR(),n=nst(),r=Jre(),o=uR(),s=Kre(),a=WE(),l=t.has,d=t.remove;return oqt=function(h){var f=e(this),g=o(h),k=n(f);return r(f)<=g.size?s(f,function(A){g.includes(A)&&d(k,A)}):a(g.getIterator(),function(A){l(f,A)&&d(k,A)}),k}}function V7(){return lqt?aqt:(lqt=1,aqt=function(){return!1})}var dqt,uqt,hqt,oss={};function sss(){if(uqt)return dqt;uqt=1;var e=cR(),t=dR(),n=Jre(),r=uR(),o=Kre(),s=WE(),a=t.Set,l=t.add,d=t.has;return dqt=function(h){var f=e(this),g=r(h),k=new a;return n(f)>g.size?s(g.getIterator(),function(A){d(f,A)&&l(k,A)}):o(f,function(A){g.includes(A)&&l(k,A)}),k}}var QEe,Aqt,fqt,ass={};function lss(){if(Aqt)return QEe;Aqt=1;var e=cR(),t=dR().has,n=Jre(),r=uR(),o=Kre(),s=WE(),a=Ewe();return QEe=function(d){var u=e(this),h=r(d);if(n(u)<=h.size)return o(u,function(g){if(h.includes(g))return!1},!0)!==!1;var f=h.getIterator();return s(f,function(g){if(t(u,g))return a(f,"normal",!1)})!==!1},QEe}var gqt,mqt,kqt,css={};function dss(){if(mqt)return gqt;mqt=1;var e=cR(),t=Jre(),n=Kre(),r=uR();return gqt=function(s){var a=e(this),l=r(s);return!(t(a)>l.size)&&n(a,function(d){if(!l.includes(d))return!1},!0)!==!1}}var BEe,vqt,pqt,uss={};function hss(){if(vqt)return BEe;vqt=1;var e=cR(),t=dR().has,n=Jre(),r=uR(),o=WE(),s=Ewe();return BEe=function(l){var d=e(this),u=r(l);if(n(d)0&&arguments[0]!==void 0?arguments[0]:"";this.originMd=t}},{key:"handleSyncRenderCompleted",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";this.md=t,this.pendingRenderers.size===0&&this.handleAllCompleted()}},{key:"add",value:function(t){this.pendingRenderers.add(t)}},{key:"done",value:function(t){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).replacer,r=n===void 0?function(o){return o}:n;this.pendingRenderers.has(t)&&(this.pendingRenderers.delete(t),this.md=r(this.md),this.pendingRenderers.size===0&&this.handleAllCompleted())}},{key:"clear",value:function(){this.pendingRenderers.clear(),this.originMd="",this.md=""}},{key:"handleAllCompleted",value:function(){var t,n;this.$cherry.$event?this.$cherry.$event.emit("afterAsyncRender",{markdownText:this.originMd,html:this.md}):(t=this.$cherry.options.callback)===null||t===void 0||(n=t.afterAsyncRender)===null||n===void 0||n.call(t,this.originMd,this.md)}}])}(),Pqt=ji(Fqt?Bqt:(Fqt=1,Bqt=SHn())),bss={run:function(t){var n,r="
    ".concat(t,"
    ");this.tagParser.formatEngine=this.mdFormatEngine,r=r.replace(/\x3C!--[\s\S]*?-->/g,"");var o=this.htmlParser.parseHtml(r);return o=this.paragraphStyleClear(o),Gi(n=this.$dealHtml(o).replace(/\n{3,}/g,` `).replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")).call(n,` `)},$dealHtml:function(t){for(var n="",r=0;r0&&(n+=o.content.replace(/ /g," ").replace(/[\n]+/g,` `).replace(/^[ \t\n]+\n\s*$/,` `))}return n},$handleTagObject:function(t,n){var r,o=n;return t.attrs.class&&/(ch-icon-square|ch-icon-check)/.test(t.attrs.class)?Ys(r=t.attrs.class).call(r,"ch-icon-check")>=0?o+="[x]":o+="[ ]":t.attrs.class&&/cherry-code-preview-lang-select/.test(t.attrs.class)?o+="":o+=this.$dealTag(t),o},$dealTag:function(t){var n=this,r="";return t.children&&(r=n.$dealHtml(t.children)),/(style|meta|link|script)/.test(t.name)?"":t.name==="code"||t.name==="pre"?n.tagParser.codeParser(t,n.$dealCodeTag(t),t.name==="pre"):typeof n.tagParser["".concat(t.name,"Parser")]=="function"?n.tagParser["".concat(t.name,"Parser")](t,r):r},$dealCodeTag:function(t){if(t.children.length<0)return"";for(var n="",r=0;r])+>/g,empty:Pqt?Pqt(null):{},parseTags:function(t){var n,r=this,o=0,s={type:"tag",name:"",voidElement:!1,attrs:{},children:[]};return t.replace(this.attrRE,function(a){o%2?n=a:o===0?((r.lookup[a]||t.charAt(t.length-2)==="/")&&(s.voidElement=!0),s.name=a):s.attrs[n]=a.replace(/['"]/g,""),o+=1}),s},parseHtml:function(t,n){var r=this,o=n||{};o.components||(o.components=this.empty);var s,a=[],l=-1,d=[],u={},h=!1;return t.replace(this.tagRE,function(f,g){if(h){if(f!==""))return;h=!1}var k,A=f.charAt(1)!=="/",m=g+f.length,v=t.charAt(m);A&&(l+=1,(s=r.parseTags(f)).type==="tag"&&o.components[s.name]&&(s.type="component",h=!0),s.voidElement||h||!v||v==="<"||s.children.push({type:"text",content:ba(t).call(t,m,Ys(t).call(t,"<",m))}),u[s.tagName]=s,l===0&&a.push(s),(k=d[l-1])&&k.children.push(s),d[l]=s),A&&!s.voidElement||(l-=1,!h&&v!=="<"&&v&&d[l]&&d[l].children.push({type:"text",content:ba(t).call(t,m,Ys(t).call(t,"<",m))}))}),a}},tagParser:{formatEngine:{},pParser:function(t,n){var r=n;return/\n$/.test(r)?r:"".concat(r,` `)},divParser:function(t,n){var r=n;return/\n$/.test(r)?r:"".concat(r,` `)},spanParser:function(t,n){var r=n.replace(/\t/g,"").replace(/\n/g," ");return t.attrs&&t.attrs.style,r},codeParser:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return this.formatEngine.convertCode(n,r)},brParser:function(t,n){return this.formatEngine.convertBr(n,` `)},imgParser:function(t,n){return t.attrs&&t.attrs["data-control"]==="tapd-graph"?this.formatEngine.convertGraph(t.attrs.title,t.attrs.src,t.attrs["data-origin-xml"],t):t.attrs&&t.attrs.src?this.formatEngine.convertImg(t.attrs.alt,t.attrs.src):void 0},videoParser:function(t,n){if(t.attrs&&t.attrs.src)return this.formatEngine.convertVideo(n,t.attrs.src,t.attrs.poster,t.attrs.title)},bParser:function(t,n){for(var r=n.split(` `),o=[],s=0;s0?o:""}return""},bgColorAttrParser:function(t){var n=t.match(/background-color:\s*([^;]+?);/);if(n&&n[1]){var r="";if(/rgb\([ 0-9]+,[ 0-9]+,[ 0-9]+\)/.test(n[1])){var o,s,a,l,d,u=n[1].match(/rgb\(([ 0-9]+),([ 0-9]+),([ 0-9]+)\)/);u[1]&&u[2]&&u[3]&&(u[1]=ry(Gi(o=u[1]).call(o),10),u[2]=ry(Gi(s=u[2]).call(s),10),u[3]=ry(Gi(a=u[3]).call(a),10),r=nt(l=nt(d="#".concat(u[1].toString(16))).call(d,u[2].toString(16))).call(l,u[3].toString(16)))}else r=hg(n,2)[1];return r}return""}}},mdFormatEngine:{convertColor:function(t,n){var r,o=Gi(t).call(t);return!o||/\n/.test(o)?o:n?nt(r="!!".concat(n," ")).call(r,o,"!!"):o},convertSize:function(t,n){var r,o=Gi(t).call(t);return!o||/\n/.test(o)?o:n?nt(r="!".concat(n," ")).call(r,o,"!"):o},convertBgColor:function(t,n){var r,o=Gi(t).call(t);return!o||/\n/.test(o)?o:n?nt(r="!!!".concat(n," ")).call(r,o,"!!!"):o},convertBr:function(t,n){return t+n},convertCode:function(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return/\n/.test(t)||n?"```\n".concat(t.replace(/\n+$/,""),"\n```"):"`".concat(t.replace(/`/g,"\\`"),"`")},convertB:function(t){return/^\s*$/.test(t)?"":"**".concat(t,"**")},convertI:function(t){return/^\s*$/.test(t)?"":"*".concat(t,"*")},convertU:function(t){return/^\s*$/.test(t)?"":" /".concat(t,"/ ")},convertImg:function(t,n){var r,o=t&&t.length>0?t:"image";return nt(r="![".concat(o,"](")).call(r,n,")")},convertGraph:function(t,n,r,o){var s,a,l,d=t&&t.length>0?t:"graph",u="";if(o)try{var h,f=o.attrs;vi(h=ol(f)).call(h,function(g){var k;Object.prototype.hasOwnProperty.call(f,g)&&Ys(g).call(g,"data-graph-")>=0&&f[g]&&(u+=nt(k=" ".concat(g,"=")).call(k,f[g]))})}catch{}return nt(s=nt(a=nt(l="![".concat(d,"](")).call(l,n,"){data-control=tapd-graph data-origin-xml=")).call(a,r)).call(s,u,"}")},convertVideo:function(t,n,r,o){var s,a,l=o&&o.length>0?o:"video";return nt(s=nt(a="!video[".concat(l,"](")).call(a,n,"){poster=")).call(s,r,"}")},convertA:function(t,n){var r;if(t===n)return"".concat(t," ");var o=Gi(t).call(t);return o&&nt(r="[".concat(o,"](")).call(r,n,")")},convertSup:function(t){return"^".concat(Gi(t).call(t).replace(/\^/g,"\\^"),"^")},convertSub:function(t){return"^^".concat(Gi(t).call(t).replace(/\^\^/g,"\\^\\^"),"^^")},convertTd:function(t){return"~|".concat(Gi(t).call(t).replace(/\n{1,}/g,"
    ").replace(/ /g,"~s~")," ~|")},convertTh:function(t){return/^\s*$/.test(t)?"":"~|".concat(Gi(t).call(t).replace(/\n{1,}/g,"
    ")," ~|")},convertTr:function(t){return/^\s*$/.test(t)?"":"".concat(Gi(t).call(t).replace(/\n/g,""),` `)},convertThead:function(t){var n,r="".concat(t.replace(/[ \t]+/g,"").replace(/~\|~\|/g,"~|").replace(/~\|/g,"|"),` `),o=r.match(/\|/g).length-1;return nt(n="".concat(r,"|")).call(n,oy(":-:|").call(":-:|",o),` `)},convertTable:function(t){var n=` `.concat(t.replace(/[ \t]+/g,"").replace(/~\|~\|/g,"~|").replace(/~\|/g,"|"),` `).replace(/\n{2,}/g,` `).replace(/\n[ \t]+\n/g,` `).replace(/~s~/g," ");if(!/\|:-:\|/.test(n)){var r=n.match(/^\n[^\n]+\n/);if(r){var o=r[0].match(/\|/g);if(o){var s,a,l=o.length-1;n=nt(s=nt(a=` |`.concat(oy(" |").call(" |",l),` |`)).call(a,oy(":-:|").call(":-:|",l))).call(s,n)}}}return n},convertLi:function(t){return"- ".concat(t.replace(/^\n/,"").replace(/\n+$/,"").replace(/\n+/g,` `),` `)},convertUl:function(t){return"".concat(t,` `)},convertOl:function(t){for(var n=t.split(` `),r=1,o=0;o".concat(Gi(t).call(t),` `)},convertAddress:function(t){return">".concat(Gi(t).call(t),` `)}},paragraphStyleClear:function(t){for(var n=0;n1)for(var l=0;l䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(function(e){return e.charCodeAt(0)})),wss=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(function(e){return e.charCodeAt(0)})),FEe,yss=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Mqt=(FEe=String.fromCodePoint)!==null&&FEe!==void 0?FEe:function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e),t};function Css(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=yss.get(e))!==null&&t!==void 0?t:e}var mf;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(mf||(mf={}));var U5,rf,Iw;function _Xe(e){return e>=mf.ZERO&&e<=mf.NINE}function xss(e){return e===mf.EQUALS||function(t){return t>=mf.UPPER_A&&t<=mf.UPPER_Z||t>=mf.LOWER_A&&t<=mf.LOWER_Z||_Xe(t)}(e)}(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(U5||(U5={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(rf||(rf={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(Iw||(Iw={}));var Lss=function(){function e(t,n,r){gr(this,e),this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=rf.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Iw.Strict}return mr(e,[{key:"startEntity",value:function(n){this.decodeMode=n,this.state=rf.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}},{key:"write",value:function(n,r){switch(this.state){case rf.EntityStart:return n.charCodeAt(r)===mf.NUM?(this.state=rf.NumericStart,this.consumed+=1,this.stateNumericStart(n,r+1)):(this.state=rf.NamedEntity,this.stateNamedEntity(n,r));case rf.NumericStart:return this.stateNumericStart(n,r);case rf.NumericDecimal:return this.stateNumericDecimal(n,r);case rf.NumericHex:return this.stateNumericHex(n,r);case rf.NamedEntity:return this.stateNamedEntity(n,r)}}},{key:"stateNumericStart",value:function(n,r){return r>=n.length?-1:(32|n.charCodeAt(r))===mf.LOWER_X?(this.state=rf.NumericHex,this.consumed+=1,this.stateNumericHex(n,r+1)):(this.state=rf.NumericDecimal,this.stateNumericDecimal(n,r))}},{key:"addToNumericResult",value:function(n,r,o,s){if(r!==o){var a=o-r;this.result=this.result*Math.pow(s,a)+Number.parseInt(n.substr(r,a),s),this.consumed+=a}}},{key:"stateNumericHex",value:function(n,r){for(var o=r;r=mf.UPPER_A&&a<=mf.UPPER_F||a>=mf.LOWER_A&&a<=mf.LOWER_F)))return this.addToNumericResult(n,o,r,16),this.emitNumericEntity(s,3);r+=1}var a;return this.addToNumericResult(n,o,r,16),-1}},{key:"stateNumericDecimal",value:function(n,r){for(var o=r;r>14;r>14,a!==0){if(l===mf.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==Iw.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}},{key:"emitNotTerminatedNamedEntity",value:function(){var n,r=this.result,o=this.decodeTree,s=(o[r]&U5.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,s,this.consumed),(n=this.errors)===null||n===void 0||n.missingSemicolonAfterCharacterReference(),this.consumed}},{key:"emitNamedEntityData",value:function(n,r,o){var s=this.decodeTree;return this.emitCodePoint(r===1?s[n]&~U5.VALUE_LENGTH:s[n+1],o),r===3&&this.emitCodePoint(s[n+2],o),o}},{key:"end",value:function(){var n;switch(this.state){case rf.NamedEntity:return this.result===0||this.decodeMode===Iw.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case rf.NumericDecimal:return this.emitNumericEntity(0,2);case rf.NumericHex:return this.emitNumericEntity(0,3);case rf.NumericStart:return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case rf.EntityStart:return 0}}}])}();function Sss(e,t,n,r){var o=(t&U5.BRANCH_LENGTH)>>7,s=t&U5.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){var a=r-s;return a<0||a>=o?-1:e[n+a]-1}for(var l=n,d=l+o-1;l<=d;){var u=l+d>>>1,h=e[u];if(hr))return e[u+o];d=u-1}}return-1}var po,ui,Nw;function Bx(e){return e===po.Space||e===po.NewLine||e===po.Tab||e===po.FormFeed||e===po.CarriageReturn}function wde(e){return e===po.Slash||e===po.Gt||Bx(e)}(function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Number=35]="Number",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"})(po||(po={})),function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.InSpecialComment=20]="InSpecialComment",e[e.InCommentLike=21]="InCommentLike",e[e.BeforeSpecialS=22]="BeforeSpecialS",e[e.BeforeSpecialT=23]="BeforeSpecialT",e[e.SpecialStartSequence=24]="SpecialStartSequence",e[e.InSpecialTag=25]="InSpecialTag",e[e.InEntity=26]="InEntity"}(ui||(ui={})),function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"}(Nw||(Nw={}));var Th={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])},Tss=function(){function e(t,n){var r=this,o=t.xmlMode,s=o===void 0?!1:o,a=t.decodeEntities,l=a===void 0?!0:a;gr(this,e),this.cbs=n,this.state=ui.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=ui.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=s,this.decodeEntities=l,this.entityDecoder=new Lss(s?wss:Oss,function(d,u){return r.emitCodePoint(d,u)})}return mr(e,[{key:"reset",value:function(){this.state=ui.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=ui.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}},{key:"write",value:function(n){this.offset+=this.buffer.length,this.buffer=n,this.parse()}},{key:"end",value:function(){this.running&&this.finish()}},{key:"pause",value:function(){this.running=!1}},{key:"resume",value:function(){this.running=!0,this.indexthis.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=ui.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&n===po.Amp&&this.startEntity()}},{key:"stateSpecialStartSequence",value:function(n){var r=this.sequenceIndex===this.currentSequence.length;if(r?wde(n):(32|n)===this.currentSequence[this.sequenceIndex]){if(!r)return void this.sequenceIndex++}else this.isSpecial=!1;this.sequenceIndex=0,this.state=ui.InTagName,this.stateInTagName(n)}},{key:"stateInSpecialTag",value:function(n){if(this.sequenceIndex===this.currentSequence.length){if(n===po.Gt||Bx(n)){var r=this.index-this.currentSequence.length;if(this.sectionStart=po.LowerA&&r<=po.LowerZ||r>=po.UpperA&&r<=po.UpperZ}(n)}},{key:"startSpecial",value:function(n,r){this.isSpecial=!0,this.currentSequence=n,this.sequenceIndex=r,this.state=ui.SpecialStartSequence}},{key:"stateBeforeTagName",value:function(n){if(n===po.ExclamationMark)this.state=ui.BeforeDeclaration,this.sectionStart=this.index+1;else if(n===po.Questionmark)this.state=ui.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(n)){var r=32|n;this.sectionStart=this.index,this.xmlMode?this.state=ui.InTagName:r===Th.ScriptEnd[2]?this.state=ui.BeforeSpecialS:r===Th.TitleEnd[2]||r===Th.XmpEnd[2]?this.state=ui.BeforeSpecialT:this.state=ui.InTagName}else n===po.Slash?this.state=ui.BeforeClosingTagName:(this.state=ui.Text,this.stateText(n))}},{key:"stateInTagName",value:function(n){wde(n)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=ui.BeforeAttributeName,this.stateBeforeAttributeName(n))}},{key:"stateBeforeClosingTagName",value:function(n){Bx(n)||(n===po.Gt?this.state=ui.Text:(this.state=this.isTagStartChar(n)?ui.InClosingTagName:ui.InSpecialComment,this.sectionStart=this.index))}},{key:"stateInClosingTagName",value:function(n){(n===po.Gt||Bx(n))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=ui.AfterClosingTagName,this.stateAfterClosingTagName(n))}},{key:"stateAfterClosingTagName",value:function(n){(n===po.Gt||this.fastForwardTo(po.Gt))&&(this.state=ui.Text,this.sectionStart=this.index+1)}},{key:"stateBeforeAttributeName",value:function(n){n===po.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=ui.InSpecialTag,this.sequenceIndex=0):this.state=ui.Text,this.sectionStart=this.index+1):n===po.Slash?this.state=ui.InSelfClosingTag:Bx(n)||(this.state=ui.InAttributeName,this.sectionStart=this.index)}},{key:"stateInSelfClosingTag",value:function(n){n===po.Gt?(this.cbs.onselfclosingtag(this.index),this.state=ui.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Bx(n)||(this.state=ui.BeforeAttributeName,this.stateBeforeAttributeName(n))}},{key:"stateInAttributeName",value:function(n){(n===po.Eq||wde(n))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=ui.AfterAttributeName,this.stateAfterAttributeName(n))}},{key:"stateAfterAttributeName",value:function(n){n===po.Eq?this.state=ui.BeforeAttributeValue:n===po.Slash||n===po.Gt?(this.cbs.onattribend(Nw.NoValue,this.sectionStart),this.sectionStart=-1,this.state=ui.BeforeAttributeName,this.stateBeforeAttributeName(n)):Bx(n)||(this.cbs.onattribend(Nw.NoValue,this.sectionStart),this.state=ui.InAttributeName,this.sectionStart=this.index)}},{key:"stateBeforeAttributeValue",value:function(n){n===po.DoubleQuote?(this.state=ui.InAttributeValueDq,this.sectionStart=this.index+1):n===po.SingleQuote?(this.state=ui.InAttributeValueSq,this.sectionStart=this.index+1):Bx(n)||(this.sectionStart=this.index,this.state=ui.InAttributeValueNq,this.stateInAttributeValueNoQuotes(n))}},{key:"handleInAttributeValue",value:function(n,r){n===r||!this.decodeEntities&&this.fastForwardTo(r)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(r===po.DoubleQuote?Nw.Double:Nw.Single,this.index+1),this.state=ui.BeforeAttributeName):this.decodeEntities&&n===po.Amp&&this.startEntity()}},{key:"stateInAttributeValueDoubleQuotes",value:function(n){this.handleInAttributeValue(n,po.DoubleQuote)}},{key:"stateInAttributeValueSingleQuotes",value:function(n){this.handleInAttributeValue(n,po.SingleQuote)}},{key:"stateInAttributeValueNoQuotes",value:function(n){Bx(n)||n===po.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(Nw.Unquoted,this.index),this.state=ui.BeforeAttributeName,this.stateBeforeAttributeName(n)):this.decodeEntities&&n===po.Amp&&this.startEntity()}},{key:"stateBeforeDeclaration",value:function(n){n===po.OpeningSquareBracket?(this.state=ui.CDATASequence,this.sequenceIndex=0):this.state=n===po.Dash?ui.BeforeComment:ui.InDeclaration}},{key:"stateInDeclaration",value:function(n){(n===po.Gt||this.fastForwardTo(po.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=ui.Text,this.sectionStart=this.index+1)}},{key:"stateInProcessingInstruction",value:function(n){(n===po.Gt||this.fastForwardTo(po.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=ui.Text,this.sectionStart=this.index+1)}},{key:"stateBeforeComment",value:function(n){n===po.Dash?(this.state=ui.InCommentLike,this.currentSequence=Th.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=ui.InDeclaration}},{key:"stateInSpecialComment",value:function(n){(n===po.Gt||this.fastForwardTo(po.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=ui.Text,this.sectionStart=this.index+1)}},{key:"stateBeforeSpecialS",value:function(n){var r=32|n;r===Th.ScriptEnd[3]?this.startSpecial(Th.ScriptEnd,4):r===Th.StyleEnd[3]?this.startSpecial(Th.StyleEnd,4):(this.state=ui.InTagName,this.stateInTagName(n))}},{key:"stateBeforeSpecialT",value:function(n){switch(32|n){case Th.TitleEnd[3]:this.startSpecial(Th.TitleEnd,4);break;case Th.TextareaEnd[3]:this.startSpecial(Th.TextareaEnd,4);break;case Th.XmpEnd[3]:this.startSpecial(Th.XmpEnd,4);break;default:this.state=ui.InTagName,this.stateInTagName(n)}}},{key:"startEntity",value:function(){this.baseState=this.state,this.state=ui.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?Iw.Strict:this.baseState===ui.Text||this.baseState===ui.InSpecialTag?Iw.Legacy:Iw.Attribute)}},{key:"stateInEntity",value:function(){var n=this.entityDecoder.write(this.buffer,this.index-this.offset);n>=0?(this.state=this.baseState,n===0&&(this.index=this.entityStart)):this.index=this.offset+this.buffer.length-1}},{key:"cleanup",value:function(){this.running&&this.sectionStart!==this.index&&(this.state===ui.Text||this.state===ui.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):this.state!==ui.InAttributeValueDq&&this.state!==ui.InAttributeValueSq&&this.state!==ui.InAttributeValueNq||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}},{key:"shouldContinue",value:function(){return this.index=n||(this.state===ui.InCommentLike?this.currentSequence===Th.CdataEnd?this.cbs.oncdata(this.sectionStart,n,0):this.cbs.oncomment(this.sectionStart,n,0):this.state===ui.InTagName||this.state===ui.BeforeAttributeName||this.state===ui.BeforeAttributeValue||this.state===ui.AfterAttributeName||this.state===ui.InAttributeName||this.state===ui.InAttributeValueSq||this.state===ui.InAttributeValueDq||this.state===ui.InAttributeValueNq||this.state===ui.InClosingTagName||this.cbs.ontext(this.sectionStart,n))}},{key:"emitCodePoint",value:function(n,r){this.baseState!==ui.Text&&this.baseState!==ui.InSpecialTag?(this.sectionStart1&&arguments[1]!==void 0?arguments[1]:{};gr(this,e);var r,o,s,a,l,d;this.options=n,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=t??{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=(r=n.lowerCaseTags)!==null&&r!==void 0?r:this.htmlMode,this.lowerCaseAttributeNames=(o=n.lowerCaseAttributeNames)!==null&&o!==void 0?o:this.htmlMode,this.recognizeSelfClosing=(s=n.recognizeSelfClosing)!==null&&s!==void 0?s:!this.htmlMode,this.tokenizer=new((a=n.Tokenizer)!==null&&a!==void 0?a:Tss)(this.options,this),this.foreignContext=[!this.htmlMode],(d=(l=this.cbs).onparserinit)===null||d===void 0||d.call(l,this)}return mr(e,[{key:"ontext",value:function(n,r){var o,s,a=this.getSlice(n,r);this.endIndex=r-1,(s=(o=this.cbs).ontext)===null||s===void 0||s.call(o,a),this.startIndex=r}},{key:"ontextentity",value:function(n,r){var o,s;this.endIndex=r-1,(s=(o=this.cbs).ontext)===null||s===void 0||s.call(o,Mqt(n)),this.startIndex=r}},{key:"isVoidElement",value:function(n){return this.htmlMode&&Dss.has(n)}},{key:"onopentagname",value:function(n,r){this.endIndex=r;var o=this.getSlice(n,r);this.lowerCaseTagNames&&(o=o.toLowerCase()),this.emitOpenTag(o)}},{key:"emitOpenTag",value:function(n){var r,o,s,a;this.openTagStart=this.startIndex,this.tagname=n;var l=this.htmlMode&&Ess.get(n);if(l)for(;this.stack.length>0&&l.has(this.stack[0]);){var d=this.stack.shift();(o=(r=this.cbs).onclosetag)===null||o===void 0||o.call(r,d,!0)}this.isVoidElement(n)||(this.stack.unshift(n),this.htmlMode&&(Uqt.has(n)?this.foreignContext.unshift(!0):jqt.has(n)&&this.foreignContext.unshift(!1))),(a=(s=this.cbs).onopentagname)===null||a===void 0||a.call(s,n),this.cbs.onopentag&&(this.attribs={})}},{key:"endOpenTag",value:function(n){var r,o;this.startIndex=this.openTagStart,this.attribs&&((o=(r=this.cbs).onopentag)===null||o===void 0||o.call(r,this.tagname,this.attribs,n),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}},{key:"onopentagend",value:function(n){this.endIndex=n,this.endOpenTag(!1),this.startIndex=n+1}},{key:"onclosetag",value:function(n,r){var o,s,a,l,d,u,h,f;this.endIndex=r;var g=this.getSlice(n,r);if(this.lowerCaseTagNames&&(g=g.toLowerCase()),this.htmlMode&&(Uqt.has(g)||jqt.has(g))&&this.foreignContext.shift(),this.isVoidElement(g))this.htmlMode&&g==="br"&&((l=(a=this.cbs).onopentagname)===null||l===void 0||l.call(a,"br"),(u=(d=this.cbs).onopentag)===null||u===void 0||u.call(d,"br",{},!0),(f=(h=this.cbs).onclosetag)===null||f===void 0||f.call(h,"br",!1));else{var k=this.stack.indexOf(g);if(k!==-1)for(var A=0;A<=k;A++){var m=this.stack.shift();(s=(o=this.cbs).onclosetag)===null||s===void 0||s.call(o,m,A!==k)}else this.htmlMode&&g==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=r+1}},{key:"onselfclosingtag",value:function(n){this.endIndex=n,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=n+1):this.onopentagend(n)}},{key:"closeCurrentTag",value:function(n){var r,o,s=this.tagname;this.endOpenTag(n),this.stack[0]===s&&((o=(r=this.cbs).onclosetag)===null||o===void 0||o.call(r,s,!n),this.stack.shift())}},{key:"onattribname",value:function(n,r){this.startIndex=n;var o=this.getSlice(n,r);this.attribname=this.lowerCaseAttributeNames?o.toLowerCase():o}},{key:"onattribdata",value:function(n,r){this.attribvalue+=this.getSlice(n,r)}},{key:"onattribentity",value:function(n){this.attribvalue+=Mqt(n)}},{key:"onattribend",value:function(n,r){var o,s;this.endIndex=r,(s=(o=this.cbs).onattribute)===null||s===void 0||s.call(o,this.attribname,this.attribvalue,n===Nw.Double?'"':n===Nw.Single?"'":n===Nw.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}},{key:"getInstructionName",value:function(n){var r=n.search(Qss),o=r<0?n:n.substr(0,r);return this.lowerCaseTagNames&&(o=o.toLowerCase()),o}},{key:"ondeclaration",value:function(n,r){this.endIndex=r;var o=this.getSlice(n,r);if(this.cbs.onprocessinginstruction){var s=this.getInstructionName(o);this.cbs.onprocessinginstruction("!".concat(s),"!".concat(o))}this.startIndex=r+1}},{key:"onprocessinginstruction",value:function(n,r){this.endIndex=r;var o=this.getSlice(n,r);if(this.cbs.onprocessinginstruction){var s=this.getInstructionName(o);this.cbs.onprocessinginstruction("?".concat(s),"?".concat(o))}this.startIndex=r+1}},{key:"oncomment",value:function(n,r,o){var s,a,l,d;this.endIndex=r,(a=(s=this.cbs).oncomment)===null||a===void 0||a.call(s,this.getSlice(n,r-o)),(d=(l=this.cbs).oncommentend)===null||d===void 0||d.call(l),this.startIndex=r+1}},{key:"oncdata",value:function(n,r,o){var s,a,l,d,u,h,f,g,k,A;this.endIndex=r;var m=this.getSlice(n,r-o);!this.htmlMode||this.options.recognizeCDATA?((a=(s=this.cbs).oncdatastart)===null||a===void 0||a.call(s),(d=(l=this.cbs).ontext)===null||d===void 0||d.call(l,m),(h=(u=this.cbs).oncdataend)===null||h===void 0||h.call(u)):((g=(f=this.cbs).oncomment)===null||g===void 0||g.call(f,"[CDATA[".concat(m,"]]")),(A=(k=this.cbs).oncommentend)===null||A===void 0||A.call(k)),this.startIndex=r+1}},{key:"onend",value:function(){var n,r;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(var o=0;o=this.buffers[0].length;)this.shiftBuffer();for(var o=this.buffers[0].slice(n-this.bufferOffset,r-this.bufferOffset);r-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),o+=this.buffers[0].slice(0,r-this.bufferOffset);return o}},{key:"shiftBuffer",value:function(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}},{key:"write",value:function(n){var r,o;this.ended?(o=(r=this.cbs).onerror)===null||o===void 0||o.call(r,new Error(".write() after done!")):(this.buffers.push(n),this.tokenizer.running&&(this.tokenizer.write(n),this.writeIndex++))}},{key:"end",value:function(n){var r,o;this.ended?(o=(r=this.cbs).onerror)===null||o===void 0||o.call(r,new Error(".end() after done!")):(n&&this.write(n),this.ended=!0,this.tokenizer.end())}},{key:"pause",value:function(){this.tokenizer.pause()}},{key:"resume",value:function(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex0&&arguments[0]!==void 0?arguments[0]:!1;return FZn(this,n)}}])}(),ist=function(e){function t(n){var r;return gr(this,t),r=PE(this,t),r.data=n,r}return Vo(t,e),mr(t,[{key:"nodeValue",get:function(){return this.data},set:function(r){this.data=r}}])}(TZn),$Xe=function(e){function t(){var n;return gr(this,t),n=PE(this,t,arguments),n.type=ql.Text,n}return Vo(t,e),mr(t,[{key:"nodeType",get:function(){return 3}}])}(ist),EZn=function(e){function t(){var n;return gr(this,t),n=PE(this,t,arguments),n.type=ql.Comment,n}return Vo(t,e),mr(t,[{key:"nodeType",get:function(){return 8}}])}(ist),DZn=function(e){function t(n,r){var o;return gr(this,t),o=PE(this,t,[r]),o.name=n,o.type=ql.Directive,o}return Vo(t,e),mr(t,[{key:"nodeType",get:function(){return 1}}])}(ist),rst=function(e){function t(n){var r;return gr(this,t),r=PE(this,t),r.children=n,r}return Vo(t,e),mr(t,[{key:"firstChild",get:function(){var r;return(r=this.children[0])!==null&&r!==void 0?r:null}},{key:"lastChild",get:function(){return this.children.length>0?this.children[this.children.length-1]:null}},{key:"childNodes",get:function(){return this.children},set:function(r){this.children=r}}])}(TZn),QZn=function(e){function t(){var n;return gr(this,t),n=PE(this,t,arguments),n.type=ql.CDATA,n}return Vo(t,e),mr(t,[{key:"nodeType",get:function(){return 4}}])}(rst),eqe=function(e){function t(){var n;return gr(this,t),n=PE(this,t,arguments),n.type=ql.Root,n}return Vo(t,e),mr(t,[{key:"nodeType",get:function(){return 9}}])}(rst),BZn=function(e){function t(n,r){var o,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n==="script"?ql.Script:n==="style"?ql.Style:ql.Tag;return gr(this,t),o=PE(this,t,[s]),o.name=n,o.attribs=r,o.type=a,o}return Vo(t,e),mr(t,[{key:"nodeType",get:function(){return 1}},{key:"tagName",get:function(){return this.name},set:function(r){this.name=r}},{key:"attributes",get:function(){var r=this;return Object.keys(this.attribs).map(function(o){var s,a;return{name:o,value:r.attribs[o],namespace:(s=r["x-attribsNamespace"])===null||s===void 0?void 0:s[o],prefix:(a=r["x-attribsPrefix"])===null||a===void 0?void 0:a[o]}})}}])}(rst);function Pss(e){return Fss(e)}function Mss(e){return e.type===ql.CDATA}function Rss(e){return e.type===ql.Text}function Iss(e){return e.type===ql.Comment}function Nss(e){return e.type===ql.Root}function FZn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;if(Rss(e))n=new $Xe(e.data);else if(Iss(e))n=new EZn(e.data);else if(Pss(e)){var r=t?PEe(e.children):[],o=new BZn(e.name,lTe({},e.attribs),r);r.forEach(function(h){return h.parent=o}),e.namespace!=null&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=lTe({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=lTe({},e["x-attribsPrefix"])),n=o}else if(Mss(e)){var s=t?PEe(e.children):[],a=new QZn(s);s.forEach(function(h){return h.parent=a}),n=a}else if(Nss(e)){var l=t?PEe(e.children):[],d=new eqe(l);l.forEach(function(h){return h.parent=d}),e["x-mode"]&&(d["x-mode"]=e["x-mode"]),n=d}else{if(!function(h){return h.type===ql.Directive}(e))throw new Error("Not implemented yet: ".concat(e.type));{var u=new DZn(e.name,e.data);e["x-name"]!=null&&(u["x-name"]=e["x-name"],u["x-publicId"]=e["x-publicId"],u["x-systemId"]=e["x-systemId"]),n=u}}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function PEe(e){for(var t=e.map(function(r){return FZn(r,!0)}),n=1;n䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(function(e){return e.charCodeAt(0)})),Wss=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(function(e){return e.charCodeAt(0)})),Hss=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Vss=(MEe=String.fromCodePoint)!==null&&MEe!==void 0?MEe:function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e),t};function zss(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Hss.get(e))!==null&&t!==void 0?t:e}var kf;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(kf||(kf={}));var j5,of,GD;function tqe(e){return e>=kf.ZERO&&e<=kf.NINE}function Zss(e){return e===kf.EQUALS||function(t){return t>=kf.UPPER_A&&t<=kf.UPPER_Z||t>=kf.LOWER_A&&t<=kf.LOWER_Z||tqe(t)}(e)}(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(j5||(j5={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(of||(of={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(GD||(GD={}));var Yss=function(){function e(t,n,r){gr(this,e),this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=of.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=GD.Strict}return mr(e,[{key:"startEntity",value:function(n){this.decodeMode=n,this.state=of.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}},{key:"write",value:function(n,r){switch(this.state){case of.EntityStart:return n.charCodeAt(r)===kf.NUM?(this.state=of.NumericStart,this.consumed+=1,this.stateNumericStart(n,r+1)):(this.state=of.NamedEntity,this.stateNamedEntity(n,r));case of.NumericStart:return this.stateNumericStart(n,r);case of.NumericDecimal:return this.stateNumericDecimal(n,r);case of.NumericHex:return this.stateNumericHex(n,r);case of.NamedEntity:return this.stateNamedEntity(n,r)}}},{key:"stateNumericStart",value:function(n,r){return r>=n.length?-1:(32|n.charCodeAt(r))===kf.LOWER_X?(this.state=of.NumericHex,this.consumed+=1,this.stateNumericHex(n,r+1)):(this.state=of.NumericDecimal,this.stateNumericDecimal(n,r))}},{key:"addToNumericResult",value:function(n,r,o,s){if(r!==o){var a=o-r;this.result=this.result*Math.pow(s,a)+parseInt(n.substr(r,a),s),this.consumed+=a}}},{key:"stateNumericHex",value:function(n,r){for(var o=r;r=kf.UPPER_A&&a<=kf.UPPER_F||a>=kf.LOWER_A&&a<=kf.LOWER_F)))return this.addToNumericResult(n,o,r,16),this.emitNumericEntity(s,3);r+=1}var a;return this.addToNumericResult(n,o,r,16),-1}},{key:"stateNumericDecimal",value:function(n,r){for(var o=r;r>14;r>14,a!==0){if(l===kf.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==GD.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}},{key:"emitNotTerminatedNamedEntity",value:function(){var n,r=this.result,o=this.decodeTree,s=(o[r]&j5.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,s,this.consumed),(n=this.errors)===null||n===void 0||n.missingSemicolonAfterCharacterReference(),this.consumed}},{key:"emitNamedEntityData",value:function(n,r,o){var s=this.decodeTree;return this.emitCodePoint(r===1?s[n]&~j5.VALUE_LENGTH:s[n+1],o),r===3&&this.emitCodePoint(s[n+2],o),o}},{key:"end",value:function(){var n;switch(this.state){case of.NamedEntity:return this.result===0||this.decodeMode===GD.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case of.NumericDecimal:return this.emitNumericEntity(0,2);case of.NumericHex:return this.emitNumericEntity(0,3);case of.NumericStart:return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case of.EntityStart:return 0}}}])}();function Hqt(e){var t="",n=new Yss(e,function(r){return t+=Vss(r)});return function(r,o){for(var s=0,a=0;(a=r.indexOf("&",a))>=0;){t+=r.slice(s,a),n.startEntity(o);var l=n.write(r,a+1);if(l<0){s=a+n.end();break}s=a+l,a=l===0?s+1:s}var d=t+r.slice(s);return t="",d}}function Xss(e,t,n,r){var o=(t&j5.BRANCH_LENGTH)>>7,s=t&j5.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){var a=r-s;return a<0||a>=o?-1:e[n+a]-1}for(var l=n,d=l+o-1;l<=d;){var u=l+d>>>1,h=e[u];if(hr))return e[u+o];d=u-1}}return-1}Hqt(jss),Hqt(Wss);function yde(e){for(var t=1;t=this.capacity)for(var r,o=gL(r=this.cache).call(r),s=Math.min(100,this.cache.size),a=0;a]+? data-lines="[^"]+?") data-content="([\s\S]+?)"><\/\1>/g,function(d,u,h,f,g,k){var A,m,v,p,b,O=u==="div",w=u==="div"?"math-block-".concat(h):"math-inline-".concat(h),y=window.katex.renderToString(decodeURI(k),{throwOnError:!1,displayMode:O});return l.push(w),nt(A=nt(m=nt(v=nt(p=nt(b="<".concat(u,' data-sign="')).call(b,h,'" class="')).call(p,f,'" ')).call(v,g,">")).call(m,y,"")}),vi(l).call(l,function(d){n.asyncRenderHandler.done(d)}),n.$cherry.previewer.isPreviewerHidden()&&(n.$cherry.previewer.options.previewerCache.html=n.asyncRenderHandler.md)})}}}},{key:"$configInit",value:function(t){if(t.hooksConfig&&LVn(t.hooksConfig.hooksList,Array))for(var n=0;n2e3){var r,o,s=ba(r=Xl(gL(o=this.hashStrMap).call(o))).call(r,0,200);vi(s).call(s,function(a){return n.hashStrMap.delete(a)})}return this.hashStrMap.get(t)||this.hashStrMap.set(t,XXe.SHA256(t).toString()),this.hashStrMap.get(t)}},{key:"$checkCache",value:function(t,n){var r=this.hash(t);return this.hashCache.get(r)===void 0&&this.hashCache.set(r,n(t)),{sign:r,html:this.hashCache.get(r)}}},{key:"$dealParagraph",value:function(t){var n;return this.$fireHookAction(t,"paragraph","makeHtml",_l(n=this.$dealSentenceByCache).call(n,this))}},{key:"$cacheBigData",value:function(t){for(var n=this,r=t.replace(uis,function(a){var l="data:cherry/cache;sha256,".concat(n.hash(a));return n.cachedBigData[l]=a,l}),o=(r=(r=r.replace(dis,function(a,l,d){var u,h="bigDataBegin".concat(n.hash(d),"bigDataEnd");return n.cachedBigData[h]=d,nt(u="".concat(l)).call(u,h,")")})).replace(Ais,function(a,l,d){var u,h="bigDataBegin".concat(n.hash(d),"bigDataEnd");return n.cachedBigData[h]=d,nt(u="".concat(l)).call(u,h,"}")})).split(/\n/),s=0;s6e3&&(o[s]=o[s].replace(his,function(a){var l="bigDataBegin".concat(n.hash(a),"bigDataEnd");return n.cachedBigData[l]=a,l}));return r=(r=o.join(` `)).replace(cis,"")}},{key:"$deCacheBigData",value:function(t){var n=this;return t.replace(/data:cherry\/cache;sha256,[0-9a-f]+/g,function(r){return n.cachedBigData[r]}).replace(/bigDataBegin[^\n]+?bigDataEnd/g,function(r){return n.cachedBigData[r]})}},{key:"$setFlowSessionCursorCache",value:function(t){return this.$cherry.options.engine.global.flowSessionContext&&this.$cherry.options.engine.global.flowSessionCursor?/[*_~^]+\n*$/.test(t)?t.replace(/([*_~^]+\n*)$/,"CHERRYFLOWSESSIONCURSOR$1"):/:::\s*\n*$/.test(t)||/\+\+[+-]*\s*\n*$/.test(t)?t:/\n\s*`{1,}\s*\n*$/.test(t)?t.replace(/(\n\s*`{1,}\s*\n*)$/,"CHERRYFLOWSESSIONCURSOR$1"):/\n\s*[-*]$/.test(t)?t.replace(/(\n\s*[-*])$/,"CHERRYFLOWSESSIONCURSOR$1"):/\|[\s-:]+\|*\n*$/.test(t)?t:/\|\n*$/.test(t)?t.replace(/(\|\n*)$/,"CHERRYFLOWSESSIONCURSOR$1"):/\n+$/.test(t)?t.replace(/(\n+)$/,"CHERRYFLOWSESSIONCURSOR$1"):"".concat(t,"CHERRYFLOWSESSIONCURSOR"):t}},{key:"$clearFlowSessionCursorCache",value:function(t){var n=this;return this.$cherry.options.engine.global.flowSessionCursor?(this.clearCursorTimer&&clearTimeout(this.clearCursorTimer),this.clearCursorTimer=Iu(function(){n.$cherry.clearFlowSessionCursor()},2560),t.replace(/CHERRYFLOWSESSIONCURSOR/g,this.$cherry.options.engine.global.flowSessionCursor)):t}},{key:"makeHtml",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"string";this.$prepareMakeHtml(t);var r=this.$setFlowSessionCursorCache(t);return r=this.$cacheBigData(r),r=this.$beforeMakeHtml(r),r=this.$dealParagraph(r),r=this.$afterMakeHtml(r),this.$fireHookAction(r,"paragraph","$cleanCache"),r=this.$deCacheBigData(r),r=this.$clearFlowSessionCursorCache(r),this.$completeMakeHtml(r),n==="object"?qss(r.replace(/\n/g,"")):r}},{key:"makeHtmlForBlockquote",value:function(t){var n=t;return n=this.$dealParagraph(n),n=this.$fireHookAction(n,"paragraph","afterMakeHtml",{before:"blockquote"})}},{key:"makeHtmlForFootnote",value:function(t){var n=t;return n=this.$dealParagraph(n),n=this.$fireHookAction(n,"paragraph","afterMakeHtml",{before:"footnote"})}},{key:"mounted",value:function(){this.$fireHookAction("","sentence","mounted"),this.$fireHookAction("","paragraph","mounted")}},{key:"makeMarkdown",value:function(t){return bss.run(t)}}])}();function ost(){if(uGt)return dGt;uGt=1;var e=Array.isArray,t=Object.prototype.toString;return dGt=e||function(n){return t.call(n)==="[object Array]"}}function ute(){return AGt?hGt:(AGt=1,hGt="2")}function hte(){if(gGt)return fGt;gGt=1;var e=ute();return fGt=function(n){return n&&n.type==="VirtualNode"&&n.version===e}}function tM(){return kGt?mGt:(kGt=1,mGt=function(t){return t&&t.type==="Widget"})}function pke(){return pGt?vGt:(pGt=1,vGt=function(t){return t&&t.type==="Thunk"})}function bke(){return OGt?bGt:(OGt=1,bGt=function(t){return t&&(typeof t.hook=="function"&&!t.hasOwnProperty("hook")||typeof t.unhook=="function"&&!t.hasOwnProperty("unhook"))})}function Fwe(){if(xGt)return CGt;xGt=1;var e=ute();return CGt=function(n){return n&&n.type==="VirtualText"&&n.version===e}}function oas(){if(EGt)return TGt;EGt=1;var e=(SGt||(SGt=1,LGt=function(r){var o,s=String.prototype.split,a=/()??/.exec("")[1]===r;return o=function(d,u,h){if(Object.prototype.toString.call(u)!=="[object RegExp]")return s.call(d,u,h);var f,g,k,A,m=[],v=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.extended?"x":"")+(u.sticky?"y":""),p=0;for(u=new RegExp(u.source,v+"g"),d+="",a||(f=new RegExp("^"+u.source+"$(?!\\s)",v)),h=h===r?-1>>>0:h>>>0;(g=u.exec(d))&&!((k=g.index+g[0].length)>p&&(m.push(d.slice(p,g.index)),!a&&g.length>1&&g[0].replace(f,function(){for(var b=1;b1&&g.index=h));)u.lastIndex===g.index&&u.lastIndex++;return p===d.length?!A&&u.test("")||m.push(""):m.push(d.slice(p)),m.length>h?m.slice(0,h):m},o}()),LGt),t=/([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/,n=/^\.|#/;return TGt=function(o,s){if(!o)return"DIV";var a,l,d,u,h=!s.hasOwnProperty("id"),f=e(o,t),g=null;for(n.test(f[1])&&(g="DIV"),u=0;u=ee.length?Z.length:ee[de],ie=0;ie=ce&&oe.push(J)}for(var he,pe=oe.slice(),Le=0,Be=[],ve=[],ue=0;ueR?F:R,I=0;I=s&&d<=a;if(da))return!0;h=l-1}}return!1}function r(o,s){return o>s?1:-1}return rKt=function(s,a,l,d){return l&&l.length!==0?(l.sort(r),t(s,a,l,d,0)):{}}}function Aas(){if(lKt)return zEe;lKt=1;var e=IZn(),t=tM(),n=PZn(),r=function(){if(aKt)return sKt;aKt=1;var s=tM();return sKt=function(l,d){return!(!s(l)||!s(d))&&("name"in l&&"name"in d?l.id===d.id:l.init===d.init)}}();function o(s,a){typeof a.destroy=="function"&&t(a)&&a.destroy(s)}return zEe=function(a,l,d){var u=a.type,h=a.vNode,f=a.patch;switch(u){case n.REMOVE:return function(g,k){var A=g.parentNode;return A&&A.removeChild(g),o(g,k),null}(l,h);case n.INSERT:return function(g,k,A){var m=A.render(k,A);return g&&g.appendChild(m),g}(l,f,d);case n.VTEXT:return function(g,k,A,m){var v;if(g.nodeType===3)g.replaceData(0,g.length,A.text),v=g;else{var p=g.parentNode;v=m.render(A,m),p&&v!==g&&p.replaceChild(v,g)}return v}(l,0,f,d);case n.WIDGET:return function(g,k,A,m){var v,p=r(k,A);v=p?A.update(k,g)||g:m.render(A,m);var b=g.parentNode;return b&&v!==g&&b.replaceChild(v,g),p||o(g,k),v}(l,h,f,d);case n.VNODE:return function(g,k,A,m){var v=g.parentNode,p=m.render(A,m);return v&&p!==g&&v.replaceChild(p,g),p}(l,0,f,d);case n.ORDER:return function(g,k){for(var A,m,v,p=g.childNodes,b={},O=0;O=w++?null:p[v.to])}(l,f),l;case n.PROPS:return e(l,f,h.properties),l;case n.THUNK:return function(g,k){return g&&k&&g!==k&&g.parentNode&&g.parentNode.replaceChild(k,g),k}(l,d.patch(l,f,d));default:return l}},zEe}function fas(){if(cKt)return ZEe;cKt=1;var e=hKt(),t=ost(),n=function(){if(iKt)return VEe;iKt=1;var l=hKt(),d=IZn(),u=hte(),h=Fwe(),f=tM(),g=MZn();return VEe=function k(A,m){var v=m&&m.document||l,p=m?m.warn:null;if(A=g(A).a,f(A))return A.init();if(h(A))return v.createTextNode(A.text);if(!u(A))return p&&p("Item is not a valid virtual dom node",A),null;var b=A.namespace===null?v.createElement(A.tagName):v.createElementNS(A.namespace,A.tagName),O=A.properties;d(b,O);for(var w=A.children,y=0;y=o&&m>=r)return l[d]=u,this.$backtraceSnakes(l,r,o,d)}l[d]=u}return[]}},{key:"$backtraceSnakes",value:function(t,n,r,o){for(var s=[],a={x:r,y:n},l=o;l>0;l--){var d=t[l],u=t[l-1],h=a.x-a.y,f=d[h],g=h===-l||h!==l&&u[h+1]>u[h-1],k=g?h+1:h-1,A=u[k],m=A-k,v=g?A:A+1;s.unshift({xStart:A,xMid:v,xEnd:f}),a.x=A,a.y=m}return s}},{key:"assembleResult",value:function(t,n,r){var o=0,s=[],a={},l={},d={};return vi(t).call(t,function(u,h){var f=u.xStart;if(h===0&&u.xStart!==0)for(var g=0;g0;)o[d]=o[--d];d!==u++&&(o[d]=l)}else for(var h=t(a/2),f=r(e(o,0,h),s),g=r(e(o,h),s),k=f.length,A=g.length,m=0,v=0;m=rt.length)return mt.target=void 0,S(void 0,!0);var Rt=rt[yt];switch(mt.kind){case"keys":return S(Rt.key,!1);case"values":return S(Rt.value,!1)}return S([Rt.key,Rt.value],!1)},!0),xe=function(rt){this.entries=[],this.url=null,rt!==void 0&&(O(rt)?this.parseObject(rt):this.parseQuery(typeof rt=="string"?$(rt,0)==="?"?re(rt,1):rt:w(rt)))};xe.prototype={type:B,bindURL:function(rt){this.url=rt,this.update()},parseObject:function(rt){var yt,Rt,Ke,ze,jt,en,bt,Dt=this.entries,Ct=L(rt);if(Ct)for(Rt=(yt=x(rt,Ct)).next;!(Ke=r(Rt,yt)).done;){if(jt=(ze=x(b(Ke.value))).next,(en=r(jt,ze)).done||(bt=r(jt,ze)).done||!r(jt,ze).done)throw new X("Expected sequence with length 2");de(Dt,{key:w(en.value),value:w(bt.value)})}else for(var On in rt)m(rt,On)&&de(Dt,{key:On,value:w(rt[On])})},parseQuery:function(rt){if(rt)for(var yt,Rt,Ke=this.entries,ze=Y(rt,"&"),jt=0;jt0?arguments[0]:void 0));s||(this.size=rt.entries.length)},Fe=Qe.prototype;if(u(Fe,{append:function(rt,yt){var Rt=R(this);E(arguments.length,2),de(Rt.entries,{key:w(rt),value:w(yt)}),s||this.length++,Rt.updateURL()},delete:function(rt){for(var yt=R(this),Rt=E(arguments.length,1),Ke=yt.entries,ze=w(rt),jt=Rt<2?void 0:arguments[1],en=jt===void 0?jt:w(jt),bt=0;btRt.key?1:-1}),rt.updateURL()},forEach:function(rt){for(var yt,Rt=R(this).entries,Ke=v(rt,arguments.length>1?arguments[1]:void 0),ze=0;ze1?$e(arguments[1]):{})}}),A(W)){var vt=function(rt){return k(this,V),new W(rt,arguments.length>1?$e(arguments[1]):{})};V.constructor=vt,vt.prototype=V,e({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:vt})}}return mKt={URLSearchParams:Qe,getState:R}}var vKt,pKt,bKt,OKt,wKt={};function vas(){if(pKt)return vKt;pKt=1;var e=Ks(),t=2147483647,n=/[^\0-\u007E]/,r=/[.\u3002\uFF0E\uFF61]/g,o="Overflow: input needs wider integers to process",s=RangeError,a=e(r.exec),l=Math.floor,d=String.fromCharCode,u=e("".charCodeAt),h=e([].join),f=e([].push),g=e("".replace),k=e("".split),A=e("".toLowerCase),m=function(O){return O+22+75*(O<26)},v=function(O,w,y){var C=0;for(O=y?l(O/700):O>>1,O+=l(O/w);O>455;)O=l(O/35),C+=36;return l(C+36*O/(O+38))},p=function(O){var w=[];O=function(W){for(var H=[],V=0,Z=W.length;V=55296&&K<=56319&&V=L&&Cl((t-S)/B))throw new s(o);for(S+=(M-L)*B,L=M,y=0;yt)throw new s(o);if(C===L){for(var P=S,F=36;;){var R=F<=E?1:F>=E+26?26:F-E;if(P?@[\\\]^|]/,ie=/[\0\t\n\r #/:<>?@[\\\]^|]/,J=/^[\u0000-\u0020]+/,he=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,pe=/[\t\n\r]/g,Le=function(lt){var Ht,Tt,kn,qt;if(typeof lt=="number"){for(Ht=[],Tt=0;Tt<4;Tt++)X(Ht,lt%256),lt=T(lt/256);return F(Ht,".")}if(bn(lt)=="object"){for(Ht="",kn=function(oo){for(var zn=null,st=1,Ne=null,Lt=0,En=0;En<8;En++)oo[En]!==0?(Lt>st&&(zn=Ne,st=Lt),Ne=null,Lt=0):(Ne===null&&(Ne=En),++Lt);return Lt>st&&(zn=Ne,st=Lt),zn}(lt),Tt=0;Tt<8;Tt++)qt&<[Tt]===0||(qt&&(qt=!1),kn===Tt?(Ht+=Tt?":":"::",qt=!0):(Ht+=R(lt[Tt],16),Tt<7&&(Ht+=":")));return"["+Ht+"]"}return lt},Be={},ve=f({},Be,{" ":1,'"':1,"<":1,">":1,"`":1}),ue=f({},ve,{"#":1,"?":1,"{":1,"}":1}),be=f({},ue,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),xe=function(lt,Ht){var Tt=A(lt,0);return Tt>32&&Tt<127&&!h(Ht,lt)?lt:encodeURIComponent(lt)},Qe={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Fe=function(lt,Ht){var Tt;return lt.length===2&&P(oe,B(lt,0))&&((Tt=B(lt,1))===":"||!Ht&&Tt==="|")},Ge=function(lt){var Ht;return lt.length>1&&Fe(Z(lt,0,2))&&(lt.length===2||(Ht=B(lt,2))==="/"||Ht==="\\"||Ht==="?"||Ht==="#")},Xe=function(lt){return lt==="."||K(lt)==="%2e"},$e={},vt={},mt={},rt={},yt={},Rt={},Ke={},ze={},jt={},en={},bt={},Dt={},Ct={},On={},Fn={},di={},Pi={},Ci={},Ir={},Gr={},Sr={},Po=function dt(lt,Ht,Tt){var kn,qt,oo,zn=v(lt);if(Ht){if(qt=this.parse(zn))throw new E(qt);this.searchParams=null}else{if(Tt!==void 0&&(kn=new dt(Tt,!0)),qt=this.parse(zn,null,kn))throw new E(qt);(oo=L(new x)).bindURL(this),this.searchParams=oo}};Po.prototype={type:"URL",parse:function(lt,Ht,Tt){var kn,qt,oo,zn,st,Ne=this,Lt=Ht||$e,En=0,Cn="",Bn=!1,bi=!1,Ue=!1;for(lt=v(lt),Ht||(Ne.scheme="",Ne.username="",Ne.password="",Ne.host=null,Ne.port=null,Ne.path=[],Ne.query=null,Ne.fragment=null,Ne.cannotBeABaseURL=!1,lt=W(lt,J,""),lt=W(lt,he,"$1")),lt=W(lt,pe,""),kn=g(lt);En<=kn.length;){switch(qt=kn[En],Lt){case $e:if(!qt||!P(oe,qt)){if(Ht)return ee;Lt=mt;continue}Cn+=K(qt),Lt=vt;break;case vt:if(qt&&(P(de,qt)||qt==="+"||qt==="-"||qt==="."))Cn+=K(qt);else{if(qt!==":"){if(Ht)return ee;Cn="",Lt=mt,En=0;continue}if(Ht&&(Ne.isSpecial()!==h(Qe,Cn)||Cn==="file"&&(Ne.includesCredentials()||Ne.port!==null)||Ne.scheme==="file"&&!Ne.host))return;if(Ne.scheme=Cn,Ht)return void(Ne.isSpecial()&&Qe[Ne.scheme]===Ne.port&&(Ne.port=null));Cn="",Ne.scheme==="file"?Lt=On:Ne.isSpecial()&&Tt&&Tt.scheme===Ne.scheme?Lt=rt:Ne.isSpecial()?Lt=ze:kn[En+1]==="/"?(Lt=yt,En++):(Ne.cannotBeABaseURL=!0,I(Ne.path,""),Lt=Ir)}break;case mt:if(!Tt||Tt.cannotBeABaseURL&&qt!=="#")return ee;if(Tt.cannotBeABaseURL&&qt==="#"){Ne.scheme=Tt.scheme,Ne.path=k(Tt.path),Ne.query=Tt.query,Ne.fragment="",Ne.cannotBeABaseURL=!0,Lt=Sr;break}Lt=Tt.scheme==="file"?On:Rt;continue;case rt:if(qt!=="/"||kn[En+1]!=="/"){Lt=Rt;continue}Lt=jt,En++;break;case yt:if(qt==="/"){Lt=en;break}Lt=Ci;continue;case Rt:if(Ne.scheme=Tt.scheme,qt===e)Ne.username=Tt.username,Ne.password=Tt.password,Ne.host=Tt.host,Ne.port=Tt.port,Ne.path=k(Tt.path),Ne.query=Tt.query;else if(qt==="/"||qt==="\\"&&Ne.isSpecial())Lt=Ke;else if(qt==="?")Ne.username=Tt.username,Ne.password=Tt.password,Ne.host=Tt.host,Ne.port=Tt.port,Ne.path=k(Tt.path),Ne.query="",Lt=Gr;else{if(qt!=="#"){Ne.username=Tt.username,Ne.password=Tt.password,Ne.host=Tt.host,Ne.port=Tt.port,Ne.path=k(Tt.path),Ne.path.length--,Lt=Ci;continue}Ne.username=Tt.username,Ne.password=Tt.password,Ne.host=Tt.host,Ne.port=Tt.port,Ne.path=k(Tt.path),Ne.query=Tt.query,Ne.fragment="",Lt=Sr}break;case Ke:if(!Ne.isSpecial()||qt!=="/"&&qt!=="\\"){if(qt!=="/"){Ne.username=Tt.username,Ne.password=Tt.password,Ne.host=Tt.host,Ne.port=Tt.port,Lt=Ci;continue}Lt=en}else Lt=jt;break;case ze:if(Lt=jt,qt!=="/"||B(Cn,En+1)!=="/")continue;En++;break;case jt:if(qt!=="/"&&qt!=="\\"){Lt=en;continue}break;case en:if(qt==="@"){Bn&&(Cn="%40"+Cn),Bn=!0,oo=g(Cn);for(var We=0;We65535)return $;Ne.port=Ne.isSpecial()&&Sn===Qe[Ne.scheme]?null:Sn,Cn=""}if(Ht)return;Lt=Pi;continue}return $}Cn+=qt;break;case On:if(Ne.scheme="file",qt==="/"||qt==="\\")Lt=Fn;else{if(!Tt||Tt.scheme!=="file"){Lt=Ci;continue}switch(qt){case e:Ne.host=Tt.host,Ne.path=k(Tt.path),Ne.query=Tt.query;break;case"?":Ne.host=Tt.host,Ne.path=k(Tt.path),Ne.query="",Lt=Gr;break;case"#":Ne.host=Tt.host,Ne.path=k(Tt.path),Ne.query=Tt.query,Ne.fragment="",Lt=Sr;break;default:Ge(F(k(kn,En),""))||(Ne.host=Tt.host,Ne.path=k(Tt.path),Ne.shortenPath()),Lt=Ci;continue}}break;case Fn:if(qt==="/"||qt==="\\"){Lt=di;break}Tt&&Tt.scheme==="file"&&!Ge(F(k(kn,En),""))&&(Fe(Tt.path[0],!0)?I(Ne.path,Tt.path[0]):Ne.host=Tt.host),Lt=Ci;continue;case di:if(qt===e||qt==="/"||qt==="\\"||qt==="?"||qt==="#"){if(!Ht&&Fe(Cn))Lt=Ci;else if(Cn===""){if(Ne.host="",Ht)return;Lt=Pi}else{if(zn=Ne.parseHost(Cn))return zn;if(Ne.host==="localhost"&&(Ne.host=""),Ht)return;Cn="",Lt=Pi}continue}Cn+=qt;break;case Pi:if(Ne.isSpecial()){if(Lt=Ci,qt!=="/"&&qt!=="\\")continue}else if(Ht||qt!=="?")if(Ht||qt!=="#"){if(qt!==e&&(Lt=Ci,qt!=="/"))continue}else Ne.fragment="",Lt=Sr;else Ne.query="",Lt=Gr;break;case Ci:if(qt===e||qt==="/"||qt==="\\"&&Ne.isSpecial()||!Ht&&(qt==="?"||qt==="#")){if((st=K(st=Cn))===".."||st==="%2e."||st===".%2e"||st==="%2e%2e"?(Ne.shortenPath(),qt==="/"||qt==="\\"&&Ne.isSpecial()||I(Ne.path,"")):Xe(Cn)?qt==="/"||qt==="\\"&&Ne.isSpecial()||I(Ne.path,""):(Ne.scheme==="file"&&!Ne.path.length&&Fe(Cn)&&(Ne.host&&(Ne.host=""),Cn=B(Cn,0)+":"),I(Ne.path,Cn)),Cn="",Ne.scheme==="file"&&(qt===e||qt==="?"||qt==="#"))for(;Ne.path.length>1&&Ne.path[0]==="";)H(Ne.path);qt==="?"?(Ne.query="",Lt=Gr):qt==="#"&&(Ne.fragment="",Lt=Sr)}else Cn+=xe(qt,ue);break;case Ir:qt==="?"?(Ne.query="",Lt=Gr):qt==="#"?(Ne.fragment="",Lt=Sr):qt!==e&&(Ne.path[0]+=xe(qt,Be));break;case Gr:Ht||qt!=="#"?qt!==e&&(qt==="'"&&Ne.isSpecial()?Ne.query+="%27":Ne.query+=qt==="#"?"%23":xe(qt,Be)):(Ne.fragment="",Lt=Sr);break;case Sr:qt!==e&&(Ne.fragment+=xe(qt,ve))}En++}},parseHost:function(lt){var Ht,Tt,kn;if(B(lt,0)==="["){if(B(lt,lt.length-1)!=="]"||(Ht=function(qt){var oo,zn,st,Ne,Lt,En,Cn,Bn=[0,0,0,0,0,0,0,0],bi=0,Ue=null,We=0,Bt=function(){return B(qt,We)};if(Bt()===":"){if(B(qt,1)!==":")return;We+=2,Ue=++bi}for(;Bt();){if(bi===8)return;if(Bt()!==":"){for(oo=zn=0;zn<4&&P(re,Bt());)oo=16*oo+Q(Bt(),16),We++,zn++;if(Bt()==="."){if(zn===0||(We-=zn,bi>6))return;for(st=0;Bt();){if(Ne=null,st>0){if(!(Bt()==="."&&st<4))return;We++}if(!P(ke,Bt()))return;for(;P(ke,Bt());){if(Lt=Q(Bt(),10),Ne===null)Ne=Lt;else{if(Ne===0)return;Ne=10*Ne+Lt}if(Ne>255)return;We++}Bn[bi]=256*Bn[bi]+Ne,++st!=2&&st!==4||bi++}if(st!==4)return;break}if(Bt()===":"){if(We++,!Bt())return}else if(Bt())return;Bn[bi++]=oo}else{if(Ue!==null)return;We++,Ue=++bi}}if(Ue!==null)for(En=bi-Ue,bi=7;bi!==0&&En>0;)Cn=Bn[bi],Bn[bi--]=Bn[Ue+En-1],Bn[Ue+--En]=Cn;else if(bi!==8)return;return Bn}(Z(lt,1,-1)),!Ht))return q;this.host=Ht}else if(this.isSpecial()){if(lt=m(lt),P(ce,lt)||(Ht=function(qt){var oo,zn,st,Ne,Lt,En,Cn,Bn=V(qt,".");if(Bn.length&&Bn[Bn.length-1]===""&&Bn.length--,(oo=Bn.length)>4)return qt;for(zn=[],st=0;st1&&B(Ne,0)==="0"&&(Lt=P(ne,Ne)?16:8,Ne=Z(Ne,Lt===8?1:2)),Ne==="")En=0;else{if(!P(Lt===10?Y:Lt===8?Ae:re,Ne))return qt;En=Q(Ne,Lt)}I(zn,En)}for(st=0;st=M(256,5-oo))return null}else if(En>255)return null;for(Cn=N(zn),st=0;st1?arguments[1]:void 0,kn=y(Ht,new Po(lt,!1,Tt));n||(Ht.href=kn.serialize(),Ht.origin=kn.getOrigin(),Ht.protocol=kn.getProtocol(),Ht.username=kn.getUsername(),Ht.password=kn.getPassword(),Ht.host=kn.getHost(),Ht.hostname=kn.getHostname(),Ht.port=kn.getPort(),Ht.pathname=kn.getPathname(),Ht.search=kn.getSearch(),Ht.searchParams=kn.getSearchParams(),Ht.hash=kn.getHash())},ri=Ti.prototype,or=function(lt,Ht){return{get:function(){return C(this)[lt]()},set:Ht&&function(Tt){return C(this)[Ht](Tt)},configurable:!0,enumerable:!0}};if(n&&(d(ri,"href",or("serialize","setHref")),d(ri,"origin",or("getOrigin")),d(ri,"protocol",or("getProtocol","setProtocol")),d(ri,"username",or("getUsername","setUsername")),d(ri,"password",or("getPassword","setPassword")),d(ri,"host",or("getHost","setHost")),d(ri,"hostname",or("getHostname","setHostname")),d(ri,"port",or("getPort","setPort")),d(ri,"pathname",or("getPathname","setPathname")),d(ri,"search",or("getSearch","setSearch")),d(ri,"searchParams",or("getSearchParams")),d(ri,"hash",or("getHash","setHash"))),l(ri,"toJSON",function(){return C(this).serialize()},{enumerable:!0}),l(ri,"toString",function(){return C(this).serialize()},{enumerable:!0}),S){var Rs=S.createObjectURL,Es=S.revokeObjectURL;Rs&&l(Ti,"createObjectURL",s(Rs,S)),Es&&l(Ti,"revokeObjectURL",s(Es,S))}return p(Ti,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!n},{URL:Ti}),wKt}var yKt,bas={},CKt,Oas={},xKt,LKt,SKt,TKt,EKt,DKt;function was(){return LKt?xKt:(LKt=1,OKt||(OKt=1,pas()),function(){if(yKt)return bas;yKt=1;var e=ai(),t=aA(),n=Ps(),r=sz(),o=lA(),s=Oke(),a=t("URL"),l=s&&n(function(){a.canParse()}),d=n(function(){return a.canParse.length!==1});e({target:"URL",stat:!0,forced:!l||d},{canParse:function(h){var f=r(arguments.length,1),g=o(h),k=f<2||arguments[1]===void 0?void 0:o(arguments[1]);try{return!!new a(g,k)}catch{return!1}}})}(),function(){if(CKt)return Oas;CKt=1;var e=ai(),t=aA(),n=sz(),r=lA(),o=Oke(),s=t("URL");e({target:"URL",stat:!0,forced:!o},{parse:function(l){var d=n(arguments.length,1),u=r(l),h=d<2||arguments[1]===void 0?void 0:r(arguments[1]);try{return new s(u,h)}catch{return null}}})}(),xKt=Ol().URL)}function yas(){return TKt?SKt:(TKt=1,SKt=was())}var QKt,$U=ji(DKt?EKt:(DKt=1,EKt=yas())),BKt={exports:{}},FKt,Cas=(QKt||(QKt=1,FKt=BKt,function(e,t){FKt.exports=t()}(0,function(){var e=function(_,te){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(se,ye){se.__proto__=ye}||function(se,ye){for(var Pe in ye)Object.prototype.hasOwnProperty.call(ye,Pe)&&(se[Pe]=ye[Pe])},e(_,te)};function t(Ie,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function te(){this.constructor=Ie}e(Ie,_),Ie.prototype=_===null?Object.create(_):(te.prototype=_.prototype,new te)}var n=function(){return n=Object.assign||function(_){for(var te,se=1,ye=arguments.length;se0&&ye[ye.length-1])||wt[0]!==6&&wt[0]!==2)){Ye=0;continue}if(wt[0]===3&&(!ye||wt[1]>ye[0]&&wt[1]=55296&&Pe<=56319&&se>10),_e%1024+56320)),(Pe+1===se||ye.length>16384)&&(Ye+=String.fromCharCode.apply(String,ye),ye.length=0)}return Ye},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=typeof Uint8Array>"u"?[]:new Uint8Array(256),g=0;g<64;g++)f[h.charCodeAt(g)]=g;for(var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=typeof Uint8Array>"u"?[]:new Uint8Array(256),m=0;m<64;m++)A[k.charCodeAt(m)]=m;for(var v=function(_,te,se){return _.slice?_.slice(te,se):new Uint16Array(Array.prototype.slice.call(_,te,se))},p=function(){function Ie(_,te,se,ye,Pe,Ye){this.initialValue=_,this.errorValue=te,this.highStart=se,this.highValueIndex=ye,this.index=Pe,this.data=Ye}return Ie.prototype.get=function(_){var te;if(_>=0){if(_<55296||_>56319&&_<=65535)return te=((te=this.index[_>>5])<<2)+(31&_),this.data[te];if(_<=65535)return te=((te=this.index[2048+(_-55296>>5)])<<2)+(31&_),this.data[te];if(_>11),te=this.index[te],te+=_>>5&63,te=((te=this.index[te])<<2)+(31&_),this.data[te];if(_<=1114111)return this.data[this.highValueIndex]}return this.errorValue},Ie}(),b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=typeof Uint8Array>"u"?[]:new Uint8Array(256),w=0;w<64;w++)O[b.charCodeAt(w)]=w;var y=10,C=13,x=15,L=17,S=18,E=19,Q=20,T=21,M=22,B=24,P=25,F=26,R=27,N=28,I=30,W=32,H=33,V=34,Z=35,K=37,X=38,ee=39,q=40,$=42,oe=[9001,65288],de="×",ke="÷",ne=function(Ie){var _,te,se,ye=function(Je){var wt,Qt,Kt,Xn,In,Kn=.75*Je.length,Oi=Je.length,vr=0;Je[Je.length-1]==="="&&(Kn--,Je[Je.length-2]==="="&&Kn--);var qi=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&Uint8Array.prototype.slice!==void 0?new ArrayBuffer(Kn):new Array(Kn),Ko=Array.isArray(qi)?qi:new Uint8Array(qi);for(wt=0;wt>4,Ko[vr++]=(15&Kt)<<4|Xn>>2,Ko[vr++]=(3&Xn)<<6|63&In;return qi}(Ie),Pe=Array.isArray(ye)?function(Je){for(var wt=Je.length,Qt=[],Kt=0;Kt0;){var _e=ye[--Ye];if(Array.isArray(_)?_.indexOf(_e)!==-1:_===_e)for(var gt=se;gt<=ye.length;){var Je;if((Je=ye[++gt])===te)return!0;if(Je!==y)break}if(_e!==y)break}return!1},Le=function(_,te){for(var se=_;se>=0;){var ye=te[se];if(ye!==y)return ye;se--}return 0},Be=function(_,te,se,ye,Pe){if(se[ye]===0)return de;var Ye=ye-1;if(Array.isArray(Pe)&&Pe[Ye]===!0)return de;var _e=Ye-1,gt=Ye+1,Je=te[Ye],wt=_e>=0?te[_e]:0,Qt=te[gt];if(Je===2&&Qt===3)return de;if(Y.indexOf(Je)!==-1)return"!";if(Y.indexOf(Qt)!==-1||re.indexOf(Qt)!==-1)return de;if(Le(Ye,te)===8)return ke;if(ne.get(_[Ye])===11||(Je===W||Je===H)&&ne.get(_[gt])===11||Je===7||Qt===7||Je===9||[y,C,x].indexOf(Je)===-1&&Qt===9||[L,S,E,B,N].indexOf(Qt)!==-1||Le(Ye,te)===M||pe(23,M,Ye,te)||pe([L,S],T,Ye,te)||pe(12,12,Ye,te))return de;if(Je===y)return ke;if(Je===23||Qt===23)return de;if(Qt===16||Je===16)return ke;if([C,x,T].indexOf(Qt)!==-1||Je===14||wt===36&&he.indexOf(Je)!==-1||Je===N&&Qt===36||Qt===Q||Ae.indexOf(Qt)!==-1&&Je===P||Ae.indexOf(Je)!==-1&&Qt===P||Je===R&&[K,W,H].indexOf(Qt)!==-1||[K,W,H].indexOf(Je)!==-1&&Qt===F||Ae.indexOf(Je)!==-1&&ce.indexOf(Qt)!==-1||ce.indexOf(Je)!==-1&&Ae.indexOf(Qt)!==-1||[R,F].indexOf(Je)!==-1&&(Qt===P||[M,x].indexOf(Qt)!==-1&&te[gt+1]===P)||[M,x].indexOf(Je)!==-1&&Qt===P||Je===P&&[P,N,B].indexOf(Qt)!==-1)return de;if([P,N,B,L,S].indexOf(Qt)!==-1)for(var Kt=Ye;Kt>=0;){if((Xn=te[Kt])===P)return de;if([N,B].indexOf(Xn)===-1)break;Kt--}if([R,F].indexOf(Qt)!==-1)for(Kt=[L,S].indexOf(Je)!==-1?_e:Ye;Kt>=0;){var Xn;if((Xn=te[Kt])===P)return de;if([N,B].indexOf(Xn)===-1)break;Kt--}if(X===Je&&[X,ee,V,Z].indexOf(Qt)!==-1||[ee,V].indexOf(Je)!==-1&&[ee,q].indexOf(Qt)!==-1||[q,Z].indexOf(Je)!==-1&&Qt===q||J.indexOf(Je)!==-1&&[Q,F].indexOf(Qt)!==-1||J.indexOf(Qt)!==-1&&Je===R||Ae.indexOf(Je)!==-1&&Ae.indexOf(Qt)!==-1||Je===B&&Ae.indexOf(Qt)!==-1||Ae.concat(P).indexOf(Je)!==-1&&Qt===M&&oe.indexOf(_[gt])===-1||Ae.concat(P).indexOf(Qt)!==-1&&Je===S)return de;if(Je===41&&Qt===41){for(var In=se[Ye],Kn=1;In>0&&te[--In]===41;)Kn++;if(Kn%2!=0)return de}return Je===W&&Qt===H?de:ke},ve=function(_,te){te||(te={lineBreak:"normal",wordBreak:"normal"});var se=function(gt,Je){Je===void 0&&(Je="strict");var wt=[],Qt=[],Kt=[];return gt.forEach(function(Xn,In){var Kn=ne.get(Xn);if(Kn>50?(Kt.push(!0),Kn-=50):Kt.push(!1),["normal","auto","loose"].indexOf(Je)!==-1&&[8208,8211,12316,12448].indexOf(Xn)!==-1)return Qt.push(In),wt.push(16);if(Kn===4||Kn===11){if(In===0)return Qt.push(In),wt.push(I);var Oi=wt[In-1];return ie.indexOf(Oi)===-1?(Qt.push(Qt[In-1]),wt.push(Oi)):(Qt.push(In),wt.push(I))}return Qt.push(In),Kn===31?wt.push(Je==="strict"?T:K):Kn===$||Kn===29?wt.push(I):Kn===43?Xn>=131072&&Xn<=196605||Xn>=196608&&Xn<=262141?wt.push(K):wt.push(I):void wt.push(Kn)}),[Qt,wt,Kt]}(_,te.lineBreak),ye=se[0],Pe=se[1],Ye=se[2];te.wordBreak!=="break-all"&&te.wordBreak!=="break-word"||(Pe=Pe.map(function(gt){return[P,I,$].indexOf(gt)!==-1?K:gt}));var _e=te.wordBreak==="keep-all"?Ye.map(function(gt,Je){return gt&&_[Je]>=19968&&_[Je]<=40959}):void 0;return[ye,Pe,_e]},ue=function(){function Ie(_,te,se,ye){this.codePoints=_,this.required=te==="!",this.start=se,this.end=ye}return Ie.prototype.slice=function(){return u.apply(void 0,this.codePoints.slice(this.start,this.end))},Ie}(),be=45,xe=43,Qe=-1,Fe=function(_){return _>=48&&_<=57},Ge=function(_){return Fe(_)||_>=65&&_<=70||_>=97&&_<=102},Xe=function(_){return _===10||_===9||_===32},$e=function(_){return function(te){return function(se){return se>=97&&se<=122}(te)||function(se){return se>=65&&se<=90}(te)}(_)||function(te){return te>=128}(_)||_===95},vt=function(_){return $e(_)||Fe(_)||_===be},mt=function(_){return _>=0&&_<=8||_===11||_>=14&&_<=31||_===127},rt=function(_,te){return _===92&&te!==10},yt=function(_,te,se){return _===be?$e(te)||rt(te,se):!!$e(_)||!(_!==92||!rt(_,te))},Rt=function(_,te,se){return _===xe||_===be?!!Fe(te)||te===46&&Fe(se):Fe(_===46?te:_)},Ke=function(_){var te=0,se=1;_[te]!==xe&&_[te]!==be||(_[te]===be&&(se=-1),te++);for(var ye=[];Fe(_[te]);)ye.push(_[te++]);var Pe=ye.length?parseInt(u.apply(void 0,ye),10):0;_[te]===46&&te++;for(var Ye=[];Fe(_[te]);)Ye.push(_[te++]);var _e=Ye.length,gt=_e?parseInt(u.apply(void 0,Ye),10):0;_[te]!==69&&_[te]!==101||te++;var Je=1;_[te]!==xe&&_[te]!==be||(_[te]===be&&(Je=-1),te++);for(var wt=[];Fe(_[te]);)wt.push(_[te++]);var Qt=wt.length?parseInt(u.apply(void 0,wt),10):0;return se*(Pe+gt*Math.pow(10,-_e))*Math.pow(10,Je*Qt)},ze={type:2},jt={type:3},en={type:4},bt={type:13},Dt={type:8},Ct={type:21},On={type:9},Fn={type:10},di={type:11},Pi={type:12},Ci={type:14},Ir={type:23},Gr={type:1},Sr={type:25},Po={type:24},Ti={type:26},ri={type:27},or={type:28},Rs={type:29},Es={type:31},dt={type:32},lt=function(){function Ie(){this._value=[]}return Ie.prototype.write=function(_){this._value=this._value.concat(d(_))},Ie.prototype.read=function(){for(var _=[],te=this.consumeToken();te!==dt;)_.push(te),te=this.consumeToken();return _},Ie.prototype.consumeToken=function(){var _=this.consumeCodePoint();switch(_){case 34:return this.consumeStringToken(34);case 35:var te=this.peekCodePoint(0),se=this.peekCodePoint(1),ye=this.peekCodePoint(2);if(vt(te)||rt(se,ye)){var Pe=yt(te,se,ye)?2:1;return{type:5,value:this.consumeName(),flags:Pe}}break;case 36:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),bt;break;case 39:return this.consumeStringToken(39);case 40:return ze;case 41:return jt;case 42:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),Ci;break;case xe:if(Rt(_,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(_),this.consumeNumericToken();break;case 44:return en;case be:var Ye=_,_e=this.peekCodePoint(0),gt=this.peekCodePoint(1);if(Rt(Ye,_e,gt))return this.reconsumeCodePoint(_),this.consumeNumericToken();if(yt(Ye,_e,gt))return this.reconsumeCodePoint(_),this.consumeIdentLikeToken();if(_e===be&>===62)return this.consumeCodePoint(),this.consumeCodePoint(),Po;break;case 46:if(Rt(_,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(_),this.consumeNumericToken();break;case 47:if(this.peekCodePoint(0)===42)for(this.consumeCodePoint();;){var Je=this.consumeCodePoint();if(Je===42&&(Je=this.consumeCodePoint())===47)return this.consumeToken();if(Je===Qe)return this.consumeToken()}break;case 58:return Ti;case 59:return ri;case 60:if(this.peekCodePoint(0)===33&&this.peekCodePoint(1)===be&&this.peekCodePoint(2)===be)return this.consumeCodePoint(),this.consumeCodePoint(),Sr;break;case 64:var wt=this.peekCodePoint(0),Qt=this.peekCodePoint(1),Kt=this.peekCodePoint(2);if(yt(wt,Qt,Kt))return{type:7,value:this.consumeName()};break;case 91:return or;case 92:if(rt(_,this.peekCodePoint(0)))return this.reconsumeCodePoint(_),this.consumeIdentLikeToken();break;case 93:return Rs;case 61:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),Dt;break;case 123:return di;case 125:return Pi;case 117:case 85:var Xn=this.peekCodePoint(0),In=this.peekCodePoint(1);return Xn!==xe||!Ge(In)&&In!==63||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(_),this.consumeIdentLikeToken();case 124:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),On;if(this.peekCodePoint(0)===124)return this.consumeCodePoint(),Ct;break;case 126:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),Fn;break;case Qe:return dt}return Xe(_)?(this.consumeWhiteSpace(),Es):Fe(_)?(this.reconsumeCodePoint(_),this.consumeNumericToken()):$e(_)?(this.reconsumeCodePoint(_),this.consumeIdentLikeToken()):{type:6,value:u(_)}},Ie.prototype.consumeCodePoint=function(){var _=this._value.shift();return _===void 0?-1:_},Ie.prototype.reconsumeCodePoint=function(_){this._value.unshift(_)},Ie.prototype.peekCodePoint=function(_){return _>=this._value.length?-1:this._value[_]},Ie.prototype.consumeUnicodeRangeToken=function(){for(var _=[],te=this.consumeCodePoint();Ge(te)&&_.length<6;)_.push(te),te=this.consumeCodePoint();for(var se=!1;te===63&&_.length<6;)_.push(te),te=this.consumeCodePoint(),se=!0;if(se)return{type:30,start:parseInt(u.apply(void 0,_.map(function(Ye){return Ye===63?48:Ye})),16),end:parseInt(u.apply(void 0,_.map(function(Ye){return Ye===63?70:Ye})),16)};var ye=parseInt(u.apply(void 0,_),16);if(this.peekCodePoint(0)===be&&Ge(this.peekCodePoint(1))){this.consumeCodePoint(),te=this.consumeCodePoint();for(var Pe=[];Ge(te)&&Pe.length<6;)Pe.push(te),te=this.consumeCodePoint();return{type:30,start:ye,end:parseInt(u.apply(void 0,Pe),16)}}return{type:30,start:ye,end:ye}},Ie.prototype.consumeIdentLikeToken=function(){var _=this.consumeName();return _.toLowerCase()==="url"&&this.peekCodePoint(0)===40?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===40?(this.consumeCodePoint(),{type:19,value:_}):{type:20,value:_}},Ie.prototype.consumeUrlToken=function(){var _=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Qe)return{type:22,value:""};var te=this.peekCodePoint(0);if(te===39||te===34){var se=this.consumeStringToken(this.consumeCodePoint());return se.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Qe||this.peekCodePoint(0)===41)?(this.consumeCodePoint(),{type:22,value:se.value}):(this.consumeBadUrlRemnants(),Ir)}for(;;){var ye=this.consumeCodePoint();if(ye===Qe||ye===41)return{type:22,value:u.apply(void 0,_)};if(Xe(ye))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Qe||this.peekCodePoint(0)===41?(this.consumeCodePoint(),{type:22,value:u.apply(void 0,_)}):(this.consumeBadUrlRemnants(),Ir);if(ye===34||ye===39||ye===40||mt(ye))return this.consumeBadUrlRemnants(),Ir;if(ye===92){if(!rt(ye,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),Ir;_.push(this.consumeEscapedCodePoint())}else _.push(ye)}},Ie.prototype.consumeWhiteSpace=function(){for(;Xe(this.peekCodePoint(0));)this.consumeCodePoint()},Ie.prototype.consumeBadUrlRemnants=function(){for(;;){var _=this.consumeCodePoint();if(_===41||_===Qe)return;rt(_,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},Ie.prototype.consumeStringSlice=function(_){for(var te="";_>0;){var se=Math.min(5e4,_);te+=u.apply(void 0,this._value.splice(0,se)),_-=se}return this._value.shift(),te},Ie.prototype.consumeStringToken=function(_){for(var te="",se=0;;){var ye=this._value[se];if(ye===Qe||ye===void 0||ye===_)return{type:0,value:te+=this.consumeStringSlice(se)};if(ye===10)return this._value.splice(0,se),Gr;if(ye===92){var Pe=this._value[se+1];Pe!==Qe&&Pe!==void 0&&(Pe===10?(te+=this.consumeStringSlice(se),se=-1,this._value.shift()):rt(ye,Pe)&&(te+=this.consumeStringSlice(se),te+=u(this.consumeEscapedCodePoint()),se=-1))}se++}},Ie.prototype.consumeNumber=function(){var _=[],te=4,se=this.peekCodePoint(0);for(se!==xe&&se!==be||_.push(this.consumeCodePoint());Fe(this.peekCodePoint(0));)_.push(this.consumeCodePoint());se=this.peekCodePoint(0);var ye=this.peekCodePoint(1);if(se===46&&Fe(ye))for(_.push(this.consumeCodePoint(),this.consumeCodePoint()),te=8;Fe(this.peekCodePoint(0));)_.push(this.consumeCodePoint());se=this.peekCodePoint(0),ye=this.peekCodePoint(1);var Pe=this.peekCodePoint(2);if((se===69||se===101)&&((ye===xe||ye===be)&&Fe(Pe)||Fe(ye)))for(_.push(this.consumeCodePoint(),this.consumeCodePoint()),te=8;Fe(this.peekCodePoint(0));)_.push(this.consumeCodePoint());return[Ke(_),te]},Ie.prototype.consumeNumericToken=function(){var _=this.consumeNumber(),te=_[0],se=_[1],ye=this.peekCodePoint(0),Pe=this.peekCodePoint(1),Ye=this.peekCodePoint(2);return yt(ye,Pe,Ye)?{type:15,number:te,flags:se,unit:this.consumeName()}:ye===37?(this.consumeCodePoint(),{type:16,number:te,flags:se}):{type:17,number:te,flags:se}},Ie.prototype.consumeEscapedCodePoint=function(){var _=this.consumeCodePoint();if(Ge(_)){for(var te=u(_);Ge(this.peekCodePoint(0))&&te.length<6;)te+=u(this.consumeCodePoint());Xe(this.peekCodePoint(0))&&this.consumeCodePoint();var se=parseInt(te,16);return se===0||function(ye){return ye>=55296&&ye<=57343}(se)||se>1114111?65533:se}return _===Qe?65533:_},Ie.prototype.consumeName=function(){for(var _="";;){var te=this.consumeCodePoint();if(vt(te))_+=u(te);else{if(!rt(te,this.peekCodePoint(0)))return this.reconsumeCodePoint(te),_;_+=u(this.consumeEscapedCodePoint())}}},Ie}(),Ht=function(){function Ie(_){this._tokens=_}return Ie.create=function(_){var te=new lt;return te.write(_),new Ie(te.read())},Ie.parseValue=function(_){return Ie.create(_).parseComponentValue()},Ie.parseValues=function(_){return Ie.create(_).parseComponentValues()},Ie.prototype.parseComponentValue=function(){for(var _=this.consumeToken();_.type===31;)_=this.consumeToken();if(_.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(_);var te=this.consumeComponentValue();do _=this.consumeToken();while(_.type===31);if(_.type===32)return te;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},Ie.prototype.parseComponentValues=function(){for(var _=[];;){var te=this.consumeComponentValue();if(te.type===32)return _;_.push(te),_.push()}},Ie.prototype.consumeComponentValue=function(){var _=this.consumeToken();switch(_.type){case 11:case 28:case 2:return this.consumeSimpleBlock(_.type);case 19:return this.consumeFunction(_)}return _},Ie.prototype.consumeSimpleBlock=function(_){for(var te={type:_,values:[]},se=this.consumeToken();;){if(se.type===32||En(se,_))return te;this.reconsumeToken(se),te.values.push(this.consumeComponentValue()),se=this.consumeToken()}},Ie.prototype.consumeFunction=function(_){for(var te={name:_.value,values:[],type:18};;){var se=this.consumeToken();if(se.type===32||se.type===3)return te;this.reconsumeToken(se),te.values.push(this.consumeComponentValue())}},Ie.prototype.consumeToken=function(){var _=this._tokens.shift();return _===void 0?dt:_},Ie.prototype.reconsumeToken=function(_){this._tokens.unshift(_)},Ie}(),Tt=function(_){return _.type===15},kn=function(_){return _.type===17},qt=function(_){return _.type===20},oo=function(_){return _.type===0},zn=function(_,te){return qt(_)&&_.value===te},st=function(_){return _.type!==31},Ne=function(_){return _.type!==31&&_.type!==4},Lt=function(_){var te=[],se=[];return _.forEach(function(ye){if(ye.type===4){if(se.length===0)throw new Error("Error parsing function args, zero tokens for arg");return te.push(se),void(se=[])}ye.type!==31&&se.push(ye)}),se.length&&te.push(se),te},En=function(_,te){return te===11&&_.type===12||te===28&&_.type===29||te===2&&_.type===3},Cn=function(_){return _.type===17||_.type===15},Bn=function(_){return _.type===16||Cn(_)},bi=function(_){return _.length>1?[_[0],_[1]]:[_[0]]},Ue={type:17,number:0,flags:4},We={type:16,number:50,flags:4},Bt={type:16,number:100,flags:4},fn=function(_,te,se){var ye=_[0],Pe=_[1];return[Sn(ye,te),Sn(Pe!==void 0?Pe:ye,se)]},Sn=function(_,te){if(_.type===16)return _.number/100*te;if(Tt(_))switch(_.unit){case"rem":case"em":return 16*_.number;default:return _.number}return _.number},kr="grad",_r="turn",zo=function(_,te){if(te.type===15)switch(te.unit){case"deg":return Math.PI*te.number/180;case kr:return Math.PI/200*te.number;case"rad":return te.number;case _r:return 2*Math.PI*te.number}throw new Error("Unsupported angle type")},yl=function(_){return _.type===15&&(_.unit==="deg"||_.unit===kr||_.unit==="rad"||_.unit===_r)},Cu=function(_){switch(_.filter(qt).map(function(te){return te.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[Ue,Ue];case"to top":case"bottom":return xu(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Ue,Bt];case"to right":case"left":return xu(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Bt,Bt];case"to bottom":case"top":return xu(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Bt,Ue];case"to left":case"right":return xu(270)}return 0},xu=function(_){return Math.PI*_/180},Rm=function(_,te){if(te.type===18){var se=K6[te.name];if(se===void 0)throw new Error('Attempting to parse an unsupported color function "'+te.name+'"');return se(_,te.values)}if(te.type===5){if(te.value.length===3){var ye=te.value.substring(0,1),Pe=te.value.substring(1,2),Ye=te.value.substring(2,3);return Rg(parseInt(ye+ye,16),parseInt(Pe+Pe,16),parseInt(Ye+Ye,16),1)}if(te.value.length===4){ye=te.value.substring(0,1),Pe=te.value.substring(1,2),Ye=te.value.substring(2,3);var _e=te.value.substring(3,4);return Rg(parseInt(ye+ye,16),parseInt(Pe+Pe,16),parseInt(Ye+Ye,16),parseInt(_e+_e,16)/255)}if(te.value.length===6)return ye=te.value.substring(0,2),Pe=te.value.substring(2,4),Ye=te.value.substring(4,6),Rg(parseInt(ye,16),parseInt(Pe,16),parseInt(Ye,16),1);if(te.value.length===8)return ye=te.value.substring(0,2),Pe=te.value.substring(2,4),Ye=te.value.substring(4,6),_e=te.value.substring(6,8),Rg(parseInt(ye,16),parseInt(Pe,16),parseInt(Ye,16),parseInt(_e,16)/255)}if(te.type===20){var gt=YA[te.value.toUpperCase()];if(gt!==void 0)return gt}return YA.TRANSPARENT},Mg=function(_){return!(255&_)},tu=function(_){var te=255&_,se=255&_>>8,ye=255&_>>16,Pe=255&_>>24;return te<255?"rgba("+Pe+","+ye+","+se+","+te/255+")":"rgb("+Pe+","+ye+","+se+")"},Rg=function(_,te,se,ye){return(_<<24|te<<16|se<<8|Math.round(255*ye))>>>0},t3=function(_,te){if(_.type===17)return _.number;if(_.type===16){var se=te===3?1:255;return te===3?_.number/100*se:Math.round(_.number/100*se)}return 0},q6=function(_,te){var se=te.filter(Ne);if(se.length===3){var ye=se.map(t3),Pe=ye[0],Ye=ye[1],_e=ye[2];return Rg(Pe,Ye,_e,1)}if(se.length===4){var gt=se.map(t3),Je=(Pe=gt[0],Ye=gt[1],_e=gt[2],gt[3]);return Rg(Pe,Ye,_e,Je)}return 0};function G6(Ie,_,te){return te<0&&(te+=1),te>=1&&(te-=1),te<1/6?(_-Ie)*te*6+Ie:te<.5?_:te<2/3?6*(_-Ie)*(2/3-te)+Ie:Ie}var F2,yC=function(_,te){var se=te.filter(Ne),ye=se[0],Pe=se[1],Ye=se[2],_e=se[3],gt=(ye.type===17?xu(ye.number):zo(_,ye))/(2*Math.PI),Je=Bn(Pe)?Pe.number/100:0,wt=Bn(Ye)?Ye.number/100:0,Qt=_e!==void 0&&Bn(_e)?Sn(_e,1):1;if(Je===0)return Rg(255*wt,255*wt,255*wt,1);var Kt=wt<=.5?wt*(Je+1):wt+Je-wt*Je,Xn=2*wt-Kt,In=G6(Xn,Kt,gt+1/3),Kn=G6(Xn,Kt,gt),Oi=G6(Xn,Kt,gt-1/3);return Rg(255*In,255*Kn,255*Oi,Qt)},K6={hsl:yC,hsla:yC,rgb:q6,rgba:q6},o0=function(_,te){return Rm(_,Ht.create(te).parseComponentValue())},YA={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},CC={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(_,te){return te.map(function(se){if(qt(se))switch(se.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},xC={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Im=function(_,te){var se=Rm(_,te[0]),ye=te[1];return ye&&Bn(ye)?{color:se,stop:ye}:{color:se,stop:null}},LC=function(_,te){var se=_[0],ye=_[_.length-1];se.stop===null&&(se.stop=Ue),ye.stop===null&&(ye.stop=Bt);for(var Pe=[],Ye=0,_e=0;_e<_.length;_e++){var gt=_[_e].stop;if(gt!==null){var Je=Sn(gt,te);Je>Ye?Pe.push(Je):Pe.push(Ye),Ye=Je}else Pe.push(null)}var wt=null;for(_e=0;_eYe.optimumDistance)?{optimumCorner:_e,optimumDistance:wt}:Ye},{optimumDistance:Pe?1/0:-1/0,optimumCorner:null}).optimumCorner},P2=function(_,te){var se=xu(180),ye=[];return Lt(te).forEach(function(Pe,Ye){if(Ye===0){var _e=Pe[0];if(_e.type===20&&["top","left","right","bottom"].indexOf(_e.value)!==-1)return void(se=Cu(Pe));if(yl(_e))return void(se=(zo(_,_e)+xu(270))%xu(360))}var gt=Im(_,Pe);ye.push(gt)}),{angle:se,stops:ye,type:1}},SC="closest-side",TC="farthest-side",i3="closest-corner",M2="farthest-corner",Ik="circle",r3="ellipse",Ig="cover",R2="contain",Nm=function(_,te){var se=0,ye=3,Pe=[],Ye=[];return Lt(te).forEach(function(_e,gt){var Je=!0;if(gt===0?Je=_e.reduce(function(Qt,Kt){if(qt(Kt))switch(Kt.value){case"center":return Ye.push(We),!1;case"top":case"left":return Ye.push(Ue),!1;case"right":case"bottom":return Ye.push(Bt),!1}else if(Bn(Kt)||Cn(Kt))return Ye.push(Kt),!1;return Qt},Je):gt===1&&(Je=_e.reduce(function(Qt,Kt){if(qt(Kt))switch(Kt.value){case Ik:return se=0,!1;case r3:return se=1,!1;case R2:case SC:return ye=0,!1;case TC:return ye=1,!1;case i3:return ye=2,!1;case Ig:case M2:return ye=3,!1}else if(Cn(Kt)||Bn(Kt))return Array.isArray(ye)||(ye=[]),ye.push(Kt),!1;return Qt},Je)),Je){var wt=Im(_,_e);Pe.push(wt)}}),{size:ye,shape:se,stops:Pe,position:Ye,type:2}},N4=function(_,te){if(te.type===22){var se={url:te.value,type:0};return _.cache.addImage(te.value),se}if(te.type===18){var ye=TR[te.name];if(ye===void 0)throw new Error('Attempting to parse an unsupported image function "'+te.name+'"');return ye(_,te.values)}throw new Error("Unsupported image type "+te.type)},TR={"linear-gradient":function(_,te){var se=xu(180),ye=[];return Lt(te).forEach(function(Pe,Ye){if(Ye===0){var _e=Pe[0];if(_e.type===20&&_e.value==="to")return void(se=Cu(Pe));if(yl(_e))return void(se=zo(_,_e))}var gt=Im(_,Pe);ye.push(gt)}),{angle:se,stops:ye,type:1}},"-moz-linear-gradient":P2,"-ms-linear-gradient":P2,"-o-linear-gradient":P2,"-webkit-linear-gradient":P2,"radial-gradient":function(_,te){var se=0,ye=3,Pe=[],Ye=[];return Lt(te).forEach(function(_e,gt){var Je=!0;if(gt===0){var wt=!1;Je=_e.reduce(function(Kt,Xn){if(wt)if(qt(Xn))switch(Xn.value){case"center":return Ye.push(We),Kt;case"top":case"left":return Ye.push(Ue),Kt;case"right":case"bottom":return Ye.push(Bt),Kt}else(Bn(Xn)||Cn(Xn))&&Ye.push(Xn);else if(qt(Xn))switch(Xn.value){case Ik:return se=0,!1;case r3:return se=1,!1;case"at":return wt=!0,!1;case SC:return ye=0,!1;case Ig:case TC:return ye=1,!1;case R2:case i3:return ye=2,!1;case M2:return ye=3,!1}else if(Cn(Xn)||Bn(Xn))return Array.isArray(ye)||(ye=[]),ye.push(Xn),!1;return Kt},Je)}if(Je){var Qt=Im(_,_e);Pe.push(Qt)}}),{size:ye,shape:se,stops:Pe,position:Ye,type:2}},"-moz-radial-gradient":Nm,"-ms-radial-gradient":Nm,"-o-radial-gradient":Nm,"-webkit-radial-gradient":Nm,"-webkit-gradient":function(_,te){var se=xu(180),ye=[],Pe=1;return Lt(te).forEach(function(Ye,_e){var gt=Ye[0];if(_e===0){if(qt(gt)&>.value==="linear")return void(Pe=1);if(qt(gt)&>.value==="radial")return void(Pe=2)}if(gt.type===18){if(gt.name==="from"){var Je=Rm(_,gt.values[0]);ye.push({stop:Ue,color:Je})}else if(gt.name==="to")Je=Rm(_,gt.values[0]),ye.push({stop:Bt,color:Je});else if(gt.name==="color-stop"){var wt=gt.values.filter(Ne);if(wt.length===2){Je=Rm(_,wt[1]);var Qt=wt[0];kn(Qt)&&ye.push({stop:{type:16,number:100*Qt.number,flags:Qt.flags},color:Je})}}}}),Pe===1?{angle:(se+xu(180))%xu(360),stops:ye,type:Pe}:{size:3,shape:0,stops:ye,position:[],type:Pe}}},Cye={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(_,te){if(te.length===0)return[];var se=te[0];return se.type===20&&se.value==="none"?[]:te.filter(function(ye){return Ne(ye)&&function(Pe){return!(Pe.type===20&&Pe.value==="none"||Pe.type===18&&!TR[Pe.name])}(ye)}).map(function(ye){return N4(_,ye)})}},xye={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(_,te){return te.map(function(se){if(qt(se))switch(se.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Lye={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(_,te){return Lt(te).map(function(se){return se.filter(Bn)}).map(bi)}},Sye={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(_,te){return Lt(te).map(function(se){return se.filter(qt).map(function(ye){return ye.value}).join(" ")}).map(Tye)}},Tye=function(_){switch(_){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};(function(Ie){Ie.AUTO="auto",Ie.CONTAIN="contain",Ie.COVER="cover"})(F2||(F2={}));var Nl,Oc={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(_,te){return Lt(te).map(function(se){return se.filter(Eye)})}},Eye=function(_){return qt(_)||Bn(_)},ER=function(_){return{name:"border-"+_+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Dye=ER("top"),Qye=ER("right"),Bye=ER("bottom"),Fye=ER("left"),zE=function(_){return{name:"border-radius-"+_,initialValue:"0 0",prefix:!1,type:1,parse:function(se,ye){return bi(ye.filter(Bn))}}},Pye=zE("top-left"),hA=zE("top-right"),oY=zE("bottom-right"),EC=zE("bottom-left"),ZE=function(_){return{name:"border-"+_+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(se,ye){switch(ye){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},sY=ZE("top"),s0=ZE("right"),woe=ZE("bottom"),yoe=ZE("left"),YE=function(_){return{name:"border-"+_+"-width",initialValue:"0",type:0,prefix:!1,parse:function(se,ye){return Tt(ye)?ye.number:0}}},Coe=YE("top"),xoe=YE("right"),Loe=YE("bottom"),Um=YE("left"),Mye={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},a0={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(_,te){return te==="rtl"?1:0}},Rye={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(_,te){return te.filter(qt).reduce(function(se,ye){return se|Soe(ye.value)},0)}},Soe=function(_){switch(_){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},o3={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(_,te){switch(te){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},DR={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(_,te){return te.type===20&&te.value==="normal"?0:te.type===17||te.type===15?te.number:0}};(function(Ie){Ie.NORMAL="normal",Ie.STRICT="strict"})(Nl||(Nl={}));var DC,_c={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(_,te){return te==="strict"?Nl.STRICT:Nl.NORMAL}},s3={name:"line-height",initialValue:"normal",prefix:!1,type:4},QR=function(_,te){return qt(_)&&_.value==="normal"?1.2*te:_.type===17?te*_.number:Bn(_)?Sn(_,te):te},Iye={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(_,te){return te.type===20&&te.value==="none"?null:N4(_,te)}},aY={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(_,te){return te==="inside"?0:1}},lY={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(_,te){switch(te){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},BR=function(_){return{name:"margin-"+_,initialValue:"0",prefix:!1,type:4}},Nye=BR("top"),Toe=BR("right"),FR=BR("bottom"),J6=BR("left"),Uye={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(_,te){return te.filter(qt).map(function(se){switch(se.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},Eoe={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(_,te){return te==="break-word"?"break-word":"normal"}},XE=function(_){return{name:"padding-"+_,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},cY=XE("top"),dY=XE("right"),Doe=XE("bottom"),jye=XE("left"),uY={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(_,te){switch(te){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},hY={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(_,te){switch(te){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Wye={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(_,te){return te.length===1&&zn(te[0],"none")?[]:Lt(te).map(function(se){for(var ye={color:YA.TRANSPARENT,offsetX:Ue,offsetY:Ue,blur:Ue},Pe=0,Ye=0;Ye1?1:0],this.overflowWrap=Mt(_,Eoe,te.overflowWrap),this.paddingTop=Mt(_,cY,te.paddingTop),this.paddingRight=Mt(_,dY,te.paddingRight),this.paddingBottom=Mt(_,Doe,te.paddingBottom),this.paddingLeft=Mt(_,jye,te.paddingLeft),this.paintOrder=Mt(_,Jye,te.paintOrder),this.position=Mt(_,hY,te.position),this.textAlign=Mt(_,uY,te.textAlign),this.textDecorationColor=Mt(_,$6,(se=te.textDecorationColor)!==null&&se!==void 0?se:te.color),this.textDecorationLine=Mt(_,Yye,(ye=te.textDecorationLine)!==null&&ye!==void 0?ye:te.textDecoration),this.textShadow=Mt(_,Wye,te.textShadow),this.textTransform=Mt(_,Qoe,te.textTransform),this.transform=Mt(_,jm,te.transform),this.transformOrigin=Mt(_,Foe,te.transformOrigin),this.visibility=Mt(_,Hye,te.visibility),this.webkitTextStrokeColor=Mt(_,_ye,te.webkitTextStrokeColor),this.webkitTextStrokeWidth=Mt(_,$ye,te.webkitTextStrokeWidth),this.wordBreak=Mt(_,Vye,te.wordBreak),this.zIndex=Mt(_,zye,te.zIndex)}return Ie.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},Ie.prototype.isTransparent=function(){return Mg(this.backgroundColor)},Ie.prototype.isTransformed=function(){return this.transform!==null},Ie.prototype.isPositioned=function(){return this.position!==0},Ie.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},Ie.prototype.isFloating=function(){return this.float!==0},Ie.prototype.isInlineLevel=function(){return _u(this.display,4)||_u(this.display,33554432)||_u(this.display,268435456)||_u(this.display,536870912)||_u(this.display,67108864)||_u(this.display,134217728)},Ie}(),Gt=function(_,te){this.content=Mt(_,qye,te.content),this.quotes=Mt(_,Roe,te.quotes)},Tn=function(_,te){this.counterIncrement=Mt(_,Gye,te.counterIncrement),this.counterReset=Mt(_,e9,te.counterReset)},Mt=function(_,te,se){var ye=new lt,Pe=se!=null?se.toString():te.initialValue;ye.write(Pe);var Ye=new Ht(ye.read());switch(te.type){case 2:var _e=Ye.parseComponentValue();return te.parse(_,qt(_e)?_e.value:te.initialValue);case 0:return te.parse(_,Ye.parseComponentValue());case 1:return te.parse(_,Ye.parseComponentValues());case 4:return Ye.parseComponentValue();case 3:switch(te.format){case"angle":return zo(_,Ye.parseComponentValue());case"color":return Rm(_,Ye.parseComponentValue());case"image":return N4(_,Ye.parseComponentValue());case"length":var gt=Ye.parseComponentValue();return Cn(gt)?gt:Ue;case"length-percentage":var Je=Ye.parseComponentValue();return Bn(Je)?Je:Ue;case"time":return Poe(_,Ye.parseComponentValue())}}},ar=function(_,te){var se=function(ye){switch(ye.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(_);return se===1||te===se},so=function(_,te){this.context=_,this.textNodes=[],this.elements=[],this.flags=0,ar(te,3),this.styles=new t9(_,window.getComputedStyle(te,null)),bY(te)&&(this.styles.animationDuration.some(function(se){return se>0})&&(te.style.animationDuration="0s"),this.styles.transform!==null&&(te.style.transform="none")),this.bounds=l(this.context,te),ar(te,4)&&(this.flags|=16)},Ga="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fd=typeof Uint8Array>"u"?[]:new Uint8Array(256),dl=0;dl<64;dl++)fd[Ga.charCodeAt(dl)]=dl;for(var MR=function(_,te,se){return _.slice?_.slice(te,se):new Uint16Array(Array.prototype.slice.call(_,te,se))},eCe=function(){function Ie(_,te,se,ye,Pe,Ye){this.initialValue=_,this.errorValue=te,this.highStart=se,this.highValueIndex=ye,this.index=Pe,this.data=Ye}return Ie.prototype.get=function(_){var te;if(_>=0){if(_<55296||_>56319&&_<=65535)return te=((te=this.index[_>>5])<<2)+(31&_),this.data[te];if(_<=65535)return te=((te=this.index[2048+(_-55296>>5)])<<2)+(31&_),this.data[te];if(_>11),te=this.index[te],te+=_>>5&63,te=((te=this.index[te])<<2)+(31&_),this.data[te];if(_<=1114111)return this.data[this.highValueIndex]}return this.errorValue},Ie}(),l0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",RR=typeof Uint8Array>"u"?[]:new Uint8Array(256),IR=0;IR<64;IR++)RR[l0.charCodeAt(IR)]=IR;var I2,qE=8,n9=9,Ka=11,Noe=12,Uoe=function(){for(var _=[],te=0;te>10),_e%1024+56320)),(Pe+1===se||ye.length>16384)&&(Ye+=String.fromCharCode.apply(String,ye),ye.length=0)}return Ye},NR=function(Ie){var _,te,se,ye=function(Je){var wt,Qt,Kt,Xn,In,Kn=.75*Je.length,Oi=Je.length,vr=0;Je[Je.length-1]==="="&&(Kn--,Je[Je.length-2]==="="&&Kn--);var qi=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&Uint8Array.prototype.slice!==void 0?new ArrayBuffer(Kn):new Array(Kn),Ko=Array.isArray(qi)?qi:new Uint8Array(qi);for(wt=0;wt>4,Ko[vr++]=(15&Kt)<<4|Xn>>2,Ko[vr++]=(3&Xn)<<6|63&In;return qi}(Ie),Pe=Array.isArray(ye)?function(Je){for(var wt=Je.length,Qt=[],Kt=0;Kt=55296&&Qt<=56319&&Je=se)return{done:!0,value:null};for(var gt=c0;ye_e.x||Qt.y>_e.y;return _e=Qt,wt===0||Kt});return _.body.removeChild(te),gt}(document);return Object.defineProperty(Lu,"SUPPORT_WORD_BREAKING",{value:Ie}),Ie},get SUPPORT_SVG_DRAWING(){var Ie=function(_){var te=new Image,se=_.createElement("canvas"),ye=se.getContext("2d");if(!ye)return!1;te.src="data:image/svg+xml,";try{ye.drawImage(te,0,0),se.toDataURL()}catch{return!1}return!0}(document);return Object.defineProperty(Lu,"SUPPORT_SVG_DRAWING",{value:Ie}),Ie},get SUPPORT_FOREIGNOBJECT_DRAWING(){var Ie=typeof Array.from=="function"&&typeof window.fetch=="function"?function(_){var te=_.createElement("canvas"),se=100;te.width=se,te.height=se;var ye=te.getContext("2d");if(!ye)return Promise.reject(!1);ye.fillStyle="rgb(0, 255, 0)",ye.fillRect(0,0,se,se);var Pe=new Image,Ye=te.toDataURL();Pe.src=Ye;var _e=i9(se,se,0,0,Pe);return ye.fillStyle="red",ye.fillRect(0,0,se,se),gY(_e).then(function(gt){ye.drawImage(gt,0,0);var Je=ye.getImageData(0,0,se,se).data;ye.fillStyle="red",ye.fillRect(0,0,se,se);var wt=_.createElement("div");return wt.style.backgroundImage="url("+Ye+")",wt.style.height=se+"px",U4(Je)?gY(i9(se,se,0,0,wt)):Promise.reject(!1)}).then(function(gt){return ye.drawImage(gt,0,0),U4(ye.getImageData(0,0,se,se).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(Lu,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:Ie}),Ie},get SUPPORT_CORS_IMAGES(){var Ie=new Image().crossOrigin!==void 0;return Object.defineProperty(Lu,"SUPPORT_CORS_IMAGES",{value:Ie}),Ie},get SUPPORT_RESPONSE_TYPE(){var Ie=typeof new XMLHttpRequest().responseType=="string";return Object.defineProperty(Lu,"SUPPORT_RESPONSE_TYPE",{value:Ie}),Ie},get SUPPORT_CORS_XHR(){var Ie="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Lu,"SUPPORT_CORS_XHR",{value:Ie}),Ie},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var Ie=!(typeof Intl>"u"||!Intl.Segmenter);return Object.defineProperty(Lu,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:Ie}),Ie}},r9=function(_,te){this.text=_,this.bounds=te},joe=function(_,te){var se=te.ownerDocument;if(se){var ye=se.createElement("html2canvaswrapper");ye.appendChild(te.cloneNode(!0));var Pe=te.parentNode;if(Pe){Pe.replaceChild(ye,te);var Ye=l(_,ye);return ye.firstChild&&Pe.replaceChild(ye.firstChild,ye),Ye}}return a.EMPTY},GE=function(_,te,se){var ye=_.ownerDocument;if(!ye)throw new Error("Node has no owner document");var Pe=ye.createRange();return Pe.setStart(_,te),Pe.setEnd(_,te+se),Pe},jR=function(_){if(Lu.SUPPORT_NATIVE_TEXT_SEGMENTATION){var te=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(te.segment(_)).map(function(se){return se.segment})}return function(se){for(var ye,Pe=UR(se),Ye=[];!(ye=Pe.next()).done;)ye.value&&Ye.push(ye.value.slice());return Ye}(_)},KE=function(_,te){return te.letterSpacing!==0?jR(_):function(se,ye){if(Lu.SUPPORT_NATIVE_TEXT_SEGMENTATION){var Pe=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(Pe.segment(se)).map(function(Ye){return Ye.segment})}return WR(se,ye)}(_,te)},QC=[32,160,4961,65792,65793,4153,4241],WR=function(_,te){for(var se,ye=function(_e,gt){var Je=d(_e),wt=ve(Je,gt),Qt=wt[0],Kt=wt[1],Xn=wt[2],In=Je.length,Kn=0,Oi=0;return{next:function(){if(Oi>=In)return{done:!0,value:null};for(var qi=de;Oi0)if(Lu.SUPPORT_RANGE_BOUNDS){var Kt=GE(_e,wt,Qt.length).getClientRects();if(Kt.length>1){var Xn=jR(Qt),In=0;Xn.forEach(function(Oi){Je.push(new r9(Oi,a.fromDOMRectList(ye,GE(_e,In+wt,Oi.length).getClientRects()))),In+=Oi.length})}else Je.push(new r9(Qt,a.fromDOMRectList(ye,Kt)))}else{var Kn=_e.splitText(Qt.length);Je.push(new r9(Qt,joe(ye,_e))),_e=Kn}else Lu.SUPPORT_RANGE_BOUNDS||(_e=_e.splitText(Qt.length));wt+=Qt.length}),Je}(_,this.text,se,te)},rCe=function(_,te){switch(te){case 1:return _.toLowerCase();case 3:return _.replace(oCe,HR);case 2:return _.toUpperCase();default:return _}},oCe=/(^|\s|:|-|\(|\))([a-z])/g,HR=function(_,te,se){return _.length>0?te+se.toUpperCase():_},JE=function(Ie){function _(te,se){var ye=Ie.call(this,te,se)||this;return ye.src=se.currentSrc||se.src,ye.intrinsicWidth=se.naturalWidth,ye.intrinsicHeight=se.naturalHeight,ye.context.cache.addImage(ye.src),ye}return t(_,Ie),_}(so),VR=function(Ie){function _(te,se){var ye=Ie.call(this,te,se)||this;return ye.canvas=se,ye.intrinsicWidth=se.width,ye.intrinsicHeight=se.height,ye}return t(_,Ie),_}(so),Woe=function(Ie){function _(te,se){var ye=Ie.call(this,te,se)||this,Pe=new XMLSerializer,Ye=l(te,se);return se.setAttribute("width",Ye.width+"px"),se.setAttribute("height",Ye.height+"px"),ye.svg="data:image/svg+xml,"+encodeURIComponent(Pe.serializeToString(se)),ye.intrinsicWidth=se.width.baseVal.value,ye.intrinsicHeight=se.height.baseVal.value,ye.context.cache.addImage(ye.svg),ye}return t(_,Ie),_}(so),mY=function(Ie){function _(te,se){var ye=Ie.call(this,te,se)||this;return ye.value=se.value,ye}return t(_,Ie),_}(so),kY=function(Ie){function _(te,se){var ye=Ie.call(this,te,se)||this;return ye.start=se.start,ye.reversed=typeof se.reversed=="boolean"&&se.reversed===!0,ye}return t(_,Ie),_}(so),sCe=[{type:15,flags:0,unit:"px",number:3}],$u=[{type:16,flags:0,number:50}],eh="checkbox",zR="radio",aCe="password",vY=707406591,pY=function(Ie){function _(te,se){var ye,Pe,Ye,_e=Ie.call(this,te,se)||this;switch(_e.type=se.type.toLowerCase(),_e.checked=se.checked,_e.value=(Pe=(ye=se).type===aCe?new Array(ye.value.length+1).join("•"):ye.value).length===0?ye.placeholder||"":Pe,_e.type!==eh&&_e.type!==zR||(_e.styles.backgroundColor=3739148031,_e.styles.borderTopColor=_e.styles.borderRightColor=_e.styles.borderBottomColor=_e.styles.borderLeftColor=2779096575,_e.styles.borderTopWidth=_e.styles.borderRightWidth=_e.styles.borderBottomWidth=_e.styles.borderLeftWidth=1,_e.styles.borderTopStyle=_e.styles.borderRightStyle=_e.styles.borderBottomStyle=_e.styles.borderLeftStyle=1,_e.styles.backgroundClip=[0],_e.styles.backgroundOrigin=[0],_e.bounds=(Ye=_e.bounds).width>Ye.height?new a(Ye.left+(Ye.width-Ye.height)/2,Ye.top,Ye.height,Ye.height):Ye.width0)se.textNodes.push(new iCe(_,Pe,se.styles));else if(c9(Pe))if(Yoe(Pe)&&Pe.assignedNodes)Pe.assignedNodes().forEach(function(gt){return Ie(_,gt,se,ye)});else{var _e=a9(_,Pe);_e.styles.isVisible()&&(l9(Pe,_e,ye)?_e.flags|=4:lCe(_e.styles)&&(_e.flags|=2),s9.indexOf(Pe.tagName)!==-1&&(_e.flags|=8),se.elements.push(_e),Pe.slot,Pe.shadowRoot?Ie(_,Pe.shadowRoot,_e,ye):GR(Pe)||et(Pe)||N2(Pe)||Ie(_,Pe,_e,ye))}},a9=function(_,te){return Is(te)?new JE(_,te):t7(te)?new VR(_,te):et(te)?new Woe(_,te):qR(te)?new mY(_,te):e7(te)?new kY(_,te):Voe(te)?new pY(_,te):N2(te)?new ZR(_,te):GR(te)?new o9(_,te):zoe(te)?new YR(_,te):new so(_,te)},$E=function(_,te){var se=a9(_,te);return se.flags|=4,_E(_,te,se,se),se},l9=function(_,te,se){return te.styles.isPositionedWithZIndex()||te.styles.opacity<1||te.styles.isTransformed()||l3(_)&&se.styles.isTransparent()},lCe=function(_){return _.isPositioned()||_.isFloating()},Hoe=function(_){return _.nodeType===Node.TEXT_NODE},c9=function(_){return _.nodeType===Node.ELEMENT_NODE},bY=function(_){return c9(_)&&_.style!==void 0&&!XR(_)},XR=function(_){return bn(_.className)=="object"},qR=function(_){return _.tagName==="LI"},e7=function(_){return _.tagName==="OL"},Voe=function(_){return _.tagName==="INPUT"},et=function(_){return _.tagName==="svg"},l3=function(_){return _.tagName==="BODY"},t7=function(_){return _.tagName==="CANVAS"},Wm=function(_){return _.tagName==="VIDEO"},Is=function(_){return _.tagName==="IMG"},zoe=function(_){return _.tagName==="IFRAME"},Zoe=function(_){return _.tagName==="STYLE"},GR=function(_){return _.tagName==="TEXTAREA"},N2=function(_){return _.tagName==="SELECT"},Yoe=function(_){return _.tagName==="SLOT"},Xoe=function(_){return _.tagName.indexOf("-")>0},cCe=function(){function Ie(){this.counters={}}return Ie.prototype.getCounterValue=function(_){var te=this.counters[_];return te&&te.length?te[te.length-1]:1},Ie.prototype.getCounterValues=function(_){var te=this.counters[_];return te||[]},Ie.prototype.pop=function(_){var te=this;_.forEach(function(se){return te.counters[se].pop()})},Ie.prototype.parse=function(_){var te=this,se=_.counterIncrement,ye=_.counterReset,Pe=!0;se!==null&&se.forEach(function(_e){var gt=te.counters[_e.counter];gt&&_e.increment!==0&&(Pe=!1,gt.length||gt.push(1),gt[Math.max(0,gt.length-1)]+=_e.increment)});var Ye=[];return Pe&&ye.forEach(function(_e){var gt=te.counters[_e.counter];Ye.push(_e.counter),gt||(gt=te.counters[_e.counter]=[]),gt.push(_e.reset)}),Ye},Ie}(),qoe={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Goe={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},j4={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},dCe={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},d9=function(_,te,se,ye,Pe,Ye){return _se?n7(_,Pe,Ye.length>0):ye.integers.reduce(function(_e,gt,Je){for(;_>=gt;)_-=gt,_e+=ye.values[Je];return _e},"")+Ye},Koe=function(_,te,se,ye){var Pe="";do se||_--,Pe=ye(_)+Pe,_/=te;while(_*te>=te);return Pe},nu=function(_,te,se,ye,Pe){var Ye=se-te+1;return(_<0?"-":"")+(Koe(Math.abs(_),Ye,ye,function(_e){return u(Math.floor(_e%Ye)+te)})+Pe)},BC=function(_,te,se){se===void 0&&(se=". ");var ye=te.length;return Koe(Math.abs(_),ye,!1,function(Pe){return te[Math.floor(Pe%ye)]})+se},AA=function(_,te,se,ye,Pe,Ye){if(_<-9999||_>9999)return n7(_,4,Pe.length>0);var _e=Math.abs(_),gt=Pe;if(_e===0)return te[0]+gt;for(var Je=0;_e>0&&Je<=4;Je++){var wt=_e%10;wt===0&&_u(Ye,1)&>!==""?gt=te[wt]+gt:wt>1||wt===1&&Je===0||wt===1&&Je===1&&_u(Ye,2)||wt===1&&Je===1&&_u(Ye,4)&&_>100||wt===1&&Je>1&&_u(Ye,8)?gt=te[wt]+(Je>0?se[Je-1]:"")+gt:wt===1&&Je>0&&(gt=se[Je-1]+gt),_e=Math.floor(_e/10)}return(_<0?ye:"")+gt},Joe="十百千萬",_oe="拾佰仟萬",$oe="マイナス",OY="마이너스",n7=function(_,te,se){var ye=se?". ":"",Pe=se?"、":"",Ye=se?", ":"",_e=se?" ":"";switch(te){case 0:return"•"+_e;case 1:return"◦"+_e;case 2:return"◾"+_e;case 5:var gt=nu(_,48,57,!0,ye);return gt.length<4?"0"+gt:gt;case 4:return BC(_,"〇一二三四五六七八九",Pe);case 6:return d9(_,1,3999,qoe,3,ye).toLowerCase();case 7:return d9(_,1,3999,qoe,3,ye);case 8:return nu(_,945,969,!1,ye);case 9:return nu(_,97,122,!1,ye);case 10:return nu(_,65,90,!1,ye);case 11:return nu(_,1632,1641,!0,ye);case 12:case 49:return d9(_,1,9999,Goe,3,ye);case 35:return d9(_,1,9999,Goe,3,ye).toLowerCase();case 13:return nu(_,2534,2543,!0,ye);case 14:case 30:return nu(_,6112,6121,!0,ye);case 15:return BC(_,"子丑寅卯辰巳午未申酉戌亥",Pe);case 16:return BC(_,"甲乙丙丁戊己庚辛壬癸",Pe);case 17:case 48:return AA(_,"零一二三四五六七八九",Joe,"負",Pe,14);case 47:return AA(_,"零壹貳參肆伍陸柒捌玖",_oe,"負",Pe,15);case 42:return AA(_,"零一二三四五六七八九",Joe,"负",Pe,14);case 41:return AA(_,"零壹贰叁肆伍陆柒捌玖",_oe,"负",Pe,15);case 26:return AA(_,"〇一二三四五六七八九","十百千万",$oe,Pe,0);case 25:return AA(_,"零壱弐参四伍六七八九","拾百千万",$oe,Pe,7);case 31:return AA(_,"영일이삼사오육칠팔구","십백천만",OY,Ye,7);case 33:return AA(_,"零一二三四五六七八九","十百千萬",OY,Ye,0);case 32:return AA(_,"零壹貳參四五六七八九","拾百千",OY,Ye,7);case 18:return nu(_,2406,2415,!0,ye);case 20:return d9(_,1,19999,dCe,3,ye);case 21:return nu(_,2790,2799,!0,ye);case 22:return nu(_,2662,2671,!0,ye);case 22:return d9(_,1,10999,j4,3,ye);case 23:return BC(_,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return BC(_,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return nu(_,3302,3311,!0,ye);case 28:return BC(_,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",Pe);case 29:return BC(_,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",Pe);case 34:return nu(_,3792,3801,!0,ye);case 37:return nu(_,6160,6169,!0,ye);case 38:return nu(_,4160,4169,!0,ye);case 39:return nu(_,2918,2927,!0,ye);case 40:return nu(_,1776,1785,!0,ye);case 43:return nu(_,3046,3055,!0,ye);case 44:return nu(_,3174,3183,!0,ye);case 45:return nu(_,3664,3673,!0,ye);case 46:return nu(_,3872,3881,!0,ye);default:return nu(_,48,57,!0,ye)}},c3="data-html2canvas-ignore",ese=function(){function Ie(_,te,se){if(this.context=_,this.options=se,this.scrolledElements=[],this.referenceElement=te,this.counters=new cCe,this.quoteDepth=0,!te.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(te.ownerDocument.documentElement,!1)}return Ie.prototype.toIFrame=function(_,te){var se=this,ye=Uk(_,te);if(!ye.contentWindow)return Promise.reject("Unable to find iframe window");var Pe=_.defaultView.pageXOffset,Ye=_.defaultView.pageYOffset,_e=ye.contentWindow,gt=_e.document,Je=ACe(ye).then(function(){return r(se,void 0,void 0,function(){var wt,Qt;return o(this,function(Kt){switch(Kt.label){case 0:return this.scrolledElements.forEach(gCe),_e&&(_e.scrollTo(te.left,te.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||_e.scrollY===te.top&&_e.scrollX===te.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(_e.scrollX-te.left,_e.scrollY-te.top,0,0))),wt=this.options.onclone,(Qt=this.clonedReferenceElement)===void 0?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:gt.fonts&>.fonts.ready?[4,gt.fonts.ready]:[3,2];case 1:Kt.sent(),Kt.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,hCe(gt)]:[3,4];case 3:Kt.sent(),Kt.label=4;case 4:return typeof wt=="function"?[2,Promise.resolve().then(function(){return wt(gt,Qt)}).then(function(){return ye})]:[2,ye]}})})});return gt.open(),gt.write(tse(document.doctype)+""),nse(this.referenceElement.ownerDocument,Pe,Ye),gt.replaceChild(gt.adoptNode(this.documentElement),gt.documentElement),gt.close(),Je},Ie.prototype.createElementClone=function(_){if(ar(_,2),t7(_))return this.createCanvasClone(_);if(Wm(_))return this.createVideoClone(_);if(Zoe(_))return this.createStyleClone(_);var te=_.cloneNode(!1);return Is(te)&&(Is(_)&&_.currentSrc&&_.currentSrc!==_.src&&(te.src=_.currentSrc,te.srcset=""),te.loading==="lazy"&&(te.loading="eager")),Xoe(te)?this.createCustomElementClone(te):te},Ie.prototype.createCustomElementClone=function(_){var te=document.createElement("html2canvascustomelement");return wY(_.style,te),te},Ie.prototype.createStyleClone=function(_){try{var te=_.sheet;if(te&&te.cssRules){var se=[].slice.call(te.cssRules,0).reduce(function(Pe,Ye){return Ye&&typeof Ye.cssText=="string"?Pe+Ye.cssText:Pe},""),ye=_.cloneNode(!1);return ye.textContent=se,ye}}catch(Pe){if(this.context.logger.error("Unable to access cssRules property",Pe),Pe.name!=="SecurityError")throw Pe}return _.cloneNode(!1)},Ie.prototype.createCanvasClone=function(_){var te;if(this.options.inlineImages&&_.ownerDocument){var se=_.ownerDocument.createElement("img");try{return se.src=_.toDataURL(),se}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",_)}}var ye=_.cloneNode(!1);try{ye.width=_.width,ye.height=_.height;var Pe=_.getContext("2d"),Ye=ye.getContext("2d");if(Ye)if(!this.options.allowTaint&&Pe)Ye.putImageData(Pe.getImageData(0,0,_.width,_.height),0,0);else{var _e=(te=_.getContext("webgl2"))!==null&&te!==void 0?te:_.getContext("webgl");if(_e){var gt=_e.getContextAttributes();(gt==null?void 0:gt.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",_)}Ye.drawImage(_,0,0)}return ye}catch{this.context.logger.info("Unable to clone canvas as it is tainted",_)}return ye},Ie.prototype.createVideoClone=function(_){var te=_.ownerDocument.createElement("canvas");te.width=_.offsetWidth,te.height=_.offsetHeight;var se=te.getContext("2d");try{return se&&(se.drawImage(_,0,0,te.width,te.height),this.options.allowTaint||se.getImageData(0,0,te.width,te.height)),te}catch{this.context.logger.info("Unable to clone video as it is tainted",_)}var ye=_.ownerDocument.createElement("canvas");return ye.width=_.offsetWidth,ye.height=_.offsetHeight,ye},Ie.prototype.appendChildNode=function(_,te,se){c9(te)&&(te.tagName==="SCRIPT"||te.hasAttribute(c3)||typeof this.options.ignoreElements=="function"&&this.options.ignoreElements(te))||this.options.copyStyles&&c9(te)&&Zoe(te)||_.appendChild(this.cloneNode(te,se))},Ie.prototype.cloneChildNodes=function(_,te,se){for(var ye=this,Pe=_.shadowRoot?_.shadowRoot.firstChild:_.firstChild;Pe;Pe=Pe.nextSibling)if(c9(Pe)&&Yoe(Pe)&&typeof Pe.assignedNodes=="function"){var Ye=Pe.assignedNodes();Ye.length&&Ye.forEach(function(_e){return ye.appendChildNode(te,_e,se)})}else this.appendChildNode(te,Pe,se)},Ie.prototype.cloneNode=function(_,te){if(Hoe(_))return document.createTextNode(_.data);if(!_.ownerDocument)return _.cloneNode(!1);var se=_.ownerDocument.defaultView;if(se&&c9(_)&&(bY(_)||XR(_))){var ye=this.createElementClone(_);ye.style.transitionProperty="none";var Pe=se.getComputedStyle(_),Ye=se.getComputedStyle(_,":before"),_e=se.getComputedStyle(_,":after");this.referenceElement===_&&bY(ye)&&(this.clonedReferenceElement=ye),l3(ye)&&KR(ye);var gt=this.counters.parse(new Tn(this.context,Pe)),Je=this.resolvePseudoContent(_,ye,Ye,I2.BEFORE);Xoe(_)&&(te=!0),Wm(_)||this.cloneChildNodes(_,ye,te),Je&&ye.insertBefore(Je,ye.firstChild);var wt=this.resolvePseudoContent(_,ye,_e,I2.AFTER);return wt&&ye.appendChild(wt),this.counters.pop(gt),(Pe&&(this.options.copyStyles||XR(_))&&!zoe(_)||te)&&wY(Pe,ye),_.scrollTop===0&&_.scrollLeft===0||this.scrolledElements.push([ye,_.scrollLeft,_.scrollTop]),(GR(_)||N2(_))&&(GR(ye)||N2(ye))&&(ye.value=_.value),ye}return _.cloneNode(!1)},Ie.prototype.resolvePseudoContent=function(_,te,se,ye){var Pe=this;if(se){var Ye=se.content,_e=te.ownerDocument;if(_e&&Ye&&Ye!=="none"&&Ye!=="-moz-alt-content"&&se.display!=="none"){this.counters.parse(new Tn(this.context,se));var gt=new Gt(this.context,se),Je=_e.createElement("html2canvaspseudoelement");wY(se,Je),gt.content.forEach(function(Qt){if(Qt.type===0)Je.appendChild(_e.createTextNode(Qt.value));else if(Qt.type===22){var Kt=_e.createElement("img");Kt.src=Qt.value,Kt.style.opacity="1",Je.appendChild(Kt)}else if(Qt.type===18){if(Qt.name==="attr"){var Xn=Qt.values.filter(qt);Xn.length&&Je.appendChild(_e.createTextNode(_.getAttribute(Xn[0].value)||""))}else if(Qt.name==="counter"){var In=Qt.values.filter(Ne),Kn=In[0],Oi=In[1];if(Kn&&qt(Kn)){var vr=Pe.counters.getCounterValue(Kn.value),qi=Oi&&qt(Oi)?lY.parse(Pe.context,Oi.value):3;Je.appendChild(_e.createTextNode(n7(vr,qi,!1)))}}else if(Qt.name==="counters"){var Ko=Qt.values.filter(Ne),Zo=(Kn=Ko[0],Ko[1]);if(Oi=Ko[2],Kn&&qt(Kn)){var Ao=Pe.counters.getCounterValues(Kn.value),dr=Oi&&qt(Oi)?lY.parse(Pe.context,Oi.value):3,os=Zo&&Zo.type===0?Zo.value:"",ss=Ao.map(function(ko){return n7(ko,dr,!1)}).join(os);Je.appendChild(_e.createTextNode(ss))}}}else if(Qt.type===20)switch(Qt.value){case"open-quote":Je.appendChild(_e.createTextNode(Ioe(gt.quotes,Pe.quoteDepth++,!0)));break;case"close-quote":Je.appendChild(_e.createTextNode(Ioe(gt.quotes,--Pe.quoteDepth,!1)));break;default:Je.appendChild(_e.createTextNode(Qt.value))}}),Je.className=yY+" "+i7;var wt=ye===I2.BEFORE?" "+yY:" "+i7;return XR(te)?te.className.baseValue+=wt:te.className+=wt,Je}}},Ie.destroy=function(_){return!!_.parentNode&&(_.parentNode.removeChild(_),!0)},Ie}();(function(Ie){Ie[Ie.BEFORE=0]="BEFORE",Ie[Ie.AFTER=1]="AFTER"})(I2||(I2={}));var ul,Uk=function(_,te){var se=_.createElement("iframe");return se.className="html2canvas-container",se.style.visibility="hidden",se.style.position="fixed",se.style.left="-10000px",se.style.top="0px",se.style.border="0",se.width=te.width.toString(),se.height=te.height.toString(),se.scrolling="no",se.setAttribute(c3,"true"),_.body.appendChild(se),se},uCe=function(_){return new Promise(function(te){_.complete?te():_.src?(_.onload=te,_.onerror=te):te()})},hCe=function(_){return Promise.all([].slice.call(_.images,0).map(uCe))},ACe=function(_){return new Promise(function(te,se){var ye=_.contentWindow;if(!ye)return se("No window assigned for iframe");var Pe=ye.document;ye.onload=_.onload=function(){ye.onload=_.onload=null;var Ye=setInterval(function(){Pe.body.childNodes.length>0&&Pe.readyState==="complete"&&(clearInterval(Ye),te(_))},50)}})},fCe=["all","d","content"],wY=function(_,te){for(var se=_.length-1;se>=0;se--){var ye=_.item(se);fCe.indexOf(ye)===-1&&te.style.setProperty(ye,_.getPropertyValue(ye))}return te},tse=function(_){var te="";return _&&(te+=""),te},nse=function(_,te,se){_&&_.defaultView&&(te!==_.defaultView.pageXOffset||se!==_.defaultView.pageYOffset)&&_.defaultView.scrollTo(te,se)},gCe=function(_){var te=_[0],se=_[1],ye=_[2];te.scrollLeft=se,te.scrollTop=ye},yY="___html2canvas___pseudoelement_before",i7="___html2canvas___pseudoelement_after",u9=`{ content: "" !important; display: none !important; }`,KR=function(_){mCe(_,"."+yY+":before"+u9+` .`+i7+":after"+u9)},mCe=function(_,te){var se=_.ownerDocument;if(se){var ye=se.createElement("style");ye.textContent=te,_.appendChild(ye)}},CY=function(){function Ie(){}return Ie.getOrigin=function(_){var te=Ie._link;return te?(te.href=_,te.href=te.href,te.protocol+te.hostname+te.port):"about:blank"},Ie.isSameOrigin=function(_){return Ie.getOrigin(_)===Ie._origin},Ie.setContext=function(_){Ie._link=_.document.createElement("a"),Ie._origin=Ie.getOrigin(_.location.href)},Ie._origin="about:blank",Ie}(),kCe=function(){function Ie(_,te){this.context=_,this._options=te,this._cache={}}return Ie.prototype.addImage=function(_){var te=Promise.resolve();return this.has(_)||(JR(_)||d0(_))&&(this._cache[_]=this.loadImage(_)).catch(function(){}),te},Ie.prototype.match=function(_){return this._cache[_]},Ie.prototype.loadImage=function(_){return r(this,void 0,void 0,function(){var te,se,ye,Pe,Ye=this;return o(this,function(_e){switch(_e.label){case 0:return te=CY.isSameOrigin(_),se=!LY(_)&&this._options.useCORS===!0&&Lu.SUPPORT_CORS_IMAGES&&!te,ye=!LY(_)&&!te&&!JR(_)&&typeof this._options.proxy=="string"&&Lu.SUPPORT_CORS_XHR&&!se,te||this._options.allowTaint!==!1||LY(_)||JR(_)||ye||se?(Pe=_,ye?[4,this.proxy(Pe)]:[3,2]):[2];case 1:Pe=_e.sent(),_e.label=2;case 2:return this.context.logger.debug("Added image "+_.substring(0,256)),[4,new Promise(function(gt,Je){var wt=new Image;wt.onload=function(){return gt(wt)},wt.onerror=Je,(ise(Pe)||se)&&(wt.crossOrigin="anonymous"),wt.src=Pe,wt.complete===!0&&setTimeout(function(){return gt(wt)},500),Ye._options.imageTimeout>0&&setTimeout(function(){return Je("Timed out ("+Ye._options.imageTimeout+"ms) loading image")},Ye._options.imageTimeout)})];case 3:return[2,_e.sent()]}})})},Ie.prototype.has=function(_){return this._cache[_]!==void 0},Ie.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},Ie.prototype.proxy=function(_){var te=this,se=this._options.proxy;if(!se)throw new Error("No proxy defined");var ye=_.substring(0,256);return new Promise(function(Pe,Ye){var _e=Lu.SUPPORT_RESPONSE_TYPE?"blob":"text",gt=new XMLHttpRequest;gt.onload=function(){if(gt.status===200)if(_e==="text")Pe(gt.response);else{var Qt=new FileReader;Qt.addEventListener("load",function(){return Pe(Qt.result)},!1),Qt.addEventListener("error",function(Kt){return Ye(Kt)},!1),Qt.readAsDataURL(gt.response)}else Ye("Failed to proxy resource "+ye+" with status code "+gt.status)},gt.onerror=Ye;var Je=se.indexOf("?")>-1?"&":"?";if(gt.open("GET",""+se+Je+"url="+encodeURIComponent(_)+"&responseType="+_e),_e!=="text"&> instanceof XMLHttpRequest&&(gt.responseType=_e),te._options.imageTimeout){var wt=te._options.imageTimeout;gt.timeout=wt,gt.ontimeout=function(){return Ye("Timed out ("+wt+"ms) proxying "+ye)}}gt.send()})},Ie}(),W4=/^data:image\/svg\+xml/i,xY=/^data:image\/.*;base64,/i,FC=/^data:image\/.*/i,d0=function(_){return Lu.SUPPORT_SVG_DRAWING||!r7(_)},LY=function(_){return FC.test(_)},ise=function(_){return xY.test(_)},JR=function(_){return _.substr(0,4)==="blob"},r7=function(_){return _.substr(-3).toLowerCase()==="svg"||W4.test(_)},Ui=function(){function Ie(_,te){this.type=0,this.x=_,this.y=te}return Ie.prototype.add=function(_,te){return new Ie(this.x+_,this.y+te)},Ie}(),PC=function(_,te,se){return new Ui(_.x+(te.x-_.x)*se,_.y+(te.y-_.y)*se)},_R=function(){function Ie(_,te,se,ye){this.type=1,this.start=_,this.startControl=te,this.endControl=se,this.end=ye}return Ie.prototype.subdivide=function(_,te){var se=PC(this.start,this.startControl,_),ye=PC(this.startControl,this.endControl,_),Pe=PC(this.endControl,this.end,_),Ye=PC(se,ye,_),_e=PC(ye,Pe,_),gt=PC(Ye,_e,_);return te?new Ie(this.start,se,Ye,gt):new Ie(gt,_e,Pe,this.end)},Ie.prototype.add=function(_,te){return new Ie(this.start.add(_,te),this.startControl.add(_,te),this.endControl.add(_,te),this.end.add(_,te))},Ie.prototype.reverse=function(){return new Ie(this.end,this.endControl,this.startControl,this.start)},Ie}(),Hf=function(_){return _.type===1},vCe=function(_){var te=_.styles,se=_.bounds,ye=fn(te.borderTopLeftRadius,se.width,se.height),Pe=ye[0],Ye=ye[1],_e=fn(te.borderTopRightRadius,se.width,se.height),gt=_e[0],Je=_e[1],wt=fn(te.borderBottomRightRadius,se.width,se.height),Qt=wt[0],Kt=wt[1],Xn=fn(te.borderBottomLeftRadius,se.width,se.height),In=Xn[0],Kn=Xn[1],Oi=[];Oi.push((Pe+gt)/se.width),Oi.push((In+Qt)/se.width),Oi.push((Ye+Kn)/se.height),Oi.push((Je+Kt)/se.height);var vr=Math.max.apply(Math,Oi);vr>1&&(Pe/=vr,Ye/=vr,gt/=vr,Je/=vr,Qt/=vr,Kt/=vr,In/=vr,Kn/=vr);var qi=se.width-gt,Ko=se.height-Kt,Zo=se.width-Qt,Ao=se.height-Kn,dr=te.borderTopWidth,os=te.borderRightWidth,ss=te.borderBottomWidth,ko=te.borderLeftWidth,iu=Sn(te.paddingTop,_.bounds.width),Vf=Sn(te.paddingRight,_.bounds.width),zf=Sn(te.paddingBottom,_.bounds.width),Tu=Sn(te.paddingLeft,_.bounds.width);this.topLeftBorderDoubleOuterBox=Pe>0||Ye>0?Ic(se.left+ko/3,se.top+dr/3,Pe-ko/3,Ye-dr/3,ul.TOP_LEFT):new Ui(se.left+ko/3,se.top+dr/3),this.topRightBorderDoubleOuterBox=Pe>0||Ye>0?Ic(se.left+qi,se.top+dr/3,gt-os/3,Je-dr/3,ul.TOP_RIGHT):new Ui(se.left+se.width-os/3,se.top+dr/3),this.bottomRightBorderDoubleOuterBox=Qt>0||Kt>0?Ic(se.left+Zo,se.top+Ko,Qt-os/3,Kt-ss/3,ul.BOTTOM_RIGHT):new Ui(se.left+se.width-os/3,se.top+se.height-ss/3),this.bottomLeftBorderDoubleOuterBox=In>0||Kn>0?Ic(se.left+ko/3,se.top+Ao,In-ko/3,Kn-ss/3,ul.BOTTOM_LEFT):new Ui(se.left+ko/3,se.top+se.height-ss/3),this.topLeftBorderDoubleInnerBox=Pe>0||Ye>0?Ic(se.left+2*ko/3,se.top+2*dr/3,Pe-2*ko/3,Ye-2*dr/3,ul.TOP_LEFT):new Ui(se.left+2*ko/3,se.top+2*dr/3),this.topRightBorderDoubleInnerBox=Pe>0||Ye>0?Ic(se.left+qi,se.top+2*dr/3,gt-2*os/3,Je-2*dr/3,ul.TOP_RIGHT):new Ui(se.left+se.width-2*os/3,se.top+2*dr/3),this.bottomRightBorderDoubleInnerBox=Qt>0||Kt>0?Ic(se.left+Zo,se.top+Ko,Qt-2*os/3,Kt-2*ss/3,ul.BOTTOM_RIGHT):new Ui(se.left+se.width-2*os/3,se.top+se.height-2*ss/3),this.bottomLeftBorderDoubleInnerBox=In>0||Kn>0?Ic(se.left+2*ko/3,se.top+Ao,In-2*ko/3,Kn-2*ss/3,ul.BOTTOM_LEFT):new Ui(se.left+2*ko/3,se.top+se.height-2*ss/3),this.topLeftBorderStroke=Pe>0||Ye>0?Ic(se.left+ko/2,se.top+dr/2,Pe-ko/2,Ye-dr/2,ul.TOP_LEFT):new Ui(se.left+ko/2,se.top+dr/2),this.topRightBorderStroke=Pe>0||Ye>0?Ic(se.left+qi,se.top+dr/2,gt-os/2,Je-dr/2,ul.TOP_RIGHT):new Ui(se.left+se.width-os/2,se.top+dr/2),this.bottomRightBorderStroke=Qt>0||Kt>0?Ic(se.left+Zo,se.top+Ko,Qt-os/2,Kt-ss/2,ul.BOTTOM_RIGHT):new Ui(se.left+se.width-os/2,se.top+se.height-ss/2),this.bottomLeftBorderStroke=In>0||Kn>0?Ic(se.left+ko/2,se.top+Ao,In-ko/2,Kn-ss/2,ul.BOTTOM_LEFT):new Ui(se.left+ko/2,se.top+se.height-ss/2),this.topLeftBorderBox=Pe>0||Ye>0?Ic(se.left,se.top,Pe,Ye,ul.TOP_LEFT):new Ui(se.left,se.top),this.topRightBorderBox=gt>0||Je>0?Ic(se.left+qi,se.top,gt,Je,ul.TOP_RIGHT):new Ui(se.left+se.width,se.top),this.bottomRightBorderBox=Qt>0||Kt>0?Ic(se.left+Zo,se.top+Ko,Qt,Kt,ul.BOTTOM_RIGHT):new Ui(se.left+se.width,se.top+se.height),this.bottomLeftBorderBox=In>0||Kn>0?Ic(se.left,se.top+Ao,In,Kn,ul.BOTTOM_LEFT):new Ui(se.left,se.top+se.height),this.topLeftPaddingBox=Pe>0||Ye>0?Ic(se.left+ko,se.top+dr,Math.max(0,Pe-ko),Math.max(0,Ye-dr),ul.TOP_LEFT):new Ui(se.left+ko,se.top+dr),this.topRightPaddingBox=gt>0||Je>0?Ic(se.left+Math.min(qi,se.width-os),se.top+dr,qi>se.width+os?0:Math.max(0,gt-os),Math.max(0,Je-dr),ul.TOP_RIGHT):new Ui(se.left+se.width-os,se.top+dr),this.bottomRightPaddingBox=Qt>0||Kt>0?Ic(se.left+Math.min(Zo,se.width-ko),se.top+Math.min(Ko,se.height-ss),Math.max(0,Qt-os),Math.max(0,Kt-ss),ul.BOTTOM_RIGHT):new Ui(se.left+se.width-os,se.top+se.height-ss),this.bottomLeftPaddingBox=In>0||Kn>0?Ic(se.left+ko,se.top+Math.min(Ao,se.height-ss),Math.max(0,In-ko),Math.max(0,Kn-ss),ul.BOTTOM_LEFT):new Ui(se.left+ko,se.top+se.height-ss),this.topLeftContentBox=Pe>0||Ye>0?Ic(se.left+ko+Tu,se.top+dr+iu,Math.max(0,Pe-(ko+Tu)),Math.max(0,Ye-(dr+iu)),ul.TOP_LEFT):new Ui(se.left+ko+Tu,se.top+dr+iu),this.topRightContentBox=gt>0||Je>0?Ic(se.left+Math.min(qi,se.width+ko+Tu),se.top+dr+iu,qi>se.width+ko+Tu?0:gt-ko+Tu,Je-(dr+iu),ul.TOP_RIGHT):new Ui(se.left+se.width-(os+Vf),se.top+dr+iu),this.bottomRightContentBox=Qt>0||Kt>0?Ic(se.left+Math.min(Zo,se.width-(ko+Tu)),se.top+Math.min(Ko,se.height+dr+iu),Math.max(0,Qt-(os+Vf)),Kt-(ss+zf),ul.BOTTOM_RIGHT):new Ui(se.left+se.width-(os+Vf),se.top+se.height-(ss+zf)),this.bottomLeftContentBox=In>0||Kn>0?Ic(se.left+ko+Tu,se.top+Ao,Math.max(0,In-(ko+Tu)),Kn-(ss+zf),ul.BOTTOM_LEFT):new Ui(se.left+ko+Tu,se.top+se.height-(ss+zf))};(function(Ie){Ie[Ie.TOP_LEFT=0]="TOP_LEFT",Ie[Ie.TOP_RIGHT=1]="TOP_RIGHT",Ie[Ie.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",Ie[Ie.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(ul||(ul={}));var Ic=function(_,te,se,ye,Pe){var Ye=(Math.sqrt(2)-1)/3*4,_e=se*Ye,gt=ye*Ye,Je=_+se,wt=te+ye;switch(Pe){case ul.TOP_LEFT:return new _R(new Ui(_,wt),new Ui(_,wt-gt),new Ui(Je-_e,te),new Ui(Je,te));case ul.TOP_RIGHT:return new _R(new Ui(_,te),new Ui(_+_e,te),new Ui(Je,wt-gt),new Ui(Je,wt));case ul.BOTTOM_RIGHT:return new _R(new Ui(Je,te),new Ui(Je,te+gt),new Ui(_+_e,wt),new Ui(_,wt));case ul.BOTTOM_LEFT:default:return new _R(new Ui(Je,wt),new Ui(Je-_e,wt),new Ui(_,te+gt),new Ui(_,te))}},Su=function(_){return[_.topLeftBorderBox,_.topRightBorderBox,_.bottomRightBorderBox,_.bottomLeftBorderBox]},h9=function(_){return[_.topLeftPaddingBox,_.topRightPaddingBox,_.bottomRightPaddingBox,_.bottomLeftPaddingBox]},rse=function(_,te,se){this.offsetX=_,this.offsetY=te,this.matrix=se,this.type=0,this.target=6},Hm=function(_,te){this.path=_,this.target=te,this.type=1},SY=function(_){this.opacity=_,this.type=2,this.target=6},o7=function(_){return _.type===1},d3=function(_,te){return _.length===te.length&&_.some(function(se,ye){return se===te[ye]})},TY=function(_){this.element=_,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},qA=function(){function Ie(_,te){if(this.container=_,this.parent=te,this.effects=[],this.curves=new vCe(this.container),this.container.styles.opacity<1&&this.effects.push(new SY(this.container.styles.opacity)),this.container.styles.transform!==null){var se=this.container.bounds.left+this.container.styles.transformOrigin[0].number,ye=this.container.bounds.top+this.container.styles.transformOrigin[1].number,Pe=this.container.styles.transform;this.effects.push(new rse(se,ye,Pe))}if(this.container.styles.overflowX!==0){var Ye=Su(this.curves),_e=h9(this.curves);d3(Ye,_e)?this.effects.push(new Hm(Ye,6)):(this.effects.push(new Hm(Ye,2)),this.effects.push(new Hm(_e,4)))}}return Ie.prototype.getEffects=function(_){for(var te=[2,3].indexOf(this.container.styles.position)===-1,se=this.parent,ye=this.effects.slice(0);se;){var Pe=se.effects.filter(function(gt){return!o7(gt)});if(te||se.container.styles.position!==0||!se.parent){if(ye.unshift.apply(ye,Pe),te=[2,3].indexOf(se.container.styles.position)===-1,se.container.styles.overflowX!==0){var Ye=Su(se.curves),_e=h9(se.curves);d3(Ye,_e)||ye.unshift(new Hm(_e,6))}}else ye.unshift.apply(ye,Pe);se=se.parent}return ye.filter(function(gt){return _u(gt.target,_)})},Ie}(),EY=function Ie(_,te,se,ye){_.container.elements.forEach(function(Pe){var Ye=_u(Pe.flags,4),_e=_u(Pe.flags,2),gt=new qA(Pe,_);_u(Pe.styles.display,2048)&&ye.push(gt);var Je=_u(Pe.flags,8)?[]:ye;if(Ye||_e){var wt=Ye||Pe.styles.isPositioned()?se:te,Qt=new TY(gt);if(Pe.styles.isPositioned()||Pe.styles.opacity<1||Pe.styles.isTransformed()){var Kt=Pe.styles.zIndex.order;if(Kt<0){var Xn=0;wt.negativeZIndex.some(function(Kn,Oi){return Kt>Kn.element.container.styles.zIndex.order?(Xn=Oi,!1):Xn>0}),wt.negativeZIndex.splice(Xn,0,Qt)}else if(Kt>0){var In=0;wt.positiveZIndex.some(function(Kn,Oi){return Kt>=Kn.element.container.styles.zIndex.order?(In=Oi+1,!1):In>0}),wt.positiveZIndex.splice(In,0,Qt)}else wt.zeroOrAutoZIndexOrTransformedOrOpacity.push(Qt)}else Pe.styles.isFloating()?wt.nonPositionedFloats.push(Qt):wt.nonPositionedInlineLevel.push(Qt);Ie(gt,Qt,Ye?Qt:se,Je)}else Pe.styles.isInlineLevel()?te.inlineLevel.push(gt):te.nonInlineLevel.push(gt),Ie(gt,te,se,Je);_u(Pe.flags,8)&&ose(Pe,Je)})},ose=function(_,te){for(var se=_ instanceof kY?_.start:1,ye=_ instanceof kY&&_.reversed,Pe=0;Pe0&&te.intrinsicHeight>0){var Pe=u3(te),Ye=h9(se);this.path(Ye),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(ye,0,0,te.intrinsicWidth,te.intrinsicHeight,Pe.left,Pe.top,Pe.width,Pe.height),this.ctx.restore()}},_.prototype.renderNodeContent=function(te){return r(this,void 0,void 0,function(){var se,ye,Pe,Ye,_e,gt,Je,wt,Qt,Kt,Xn,In,Kn,Oi,vr,qi,Ko,Zo;return o(this,function(Ao){switch(Ao.label){case 0:this.applyEffects(te.getEffects(4)),se=te.container,ye=te.curves,Pe=se.styles,Ye=0,_e=se.textNodes,Ao.label=1;case 1:return Ye<_e.length?(gt=_e[Ye],[4,this.renderTextNode(gt,Pe)]):[3,4];case 2:Ao.sent(),Ao.label=3;case 3:return Ye++,[3,1];case 4:if(!(se instanceof JE))return[3,8];Ao.label=5;case 5:return Ao.trys.push([5,7,,8]),[4,this.context.cache.match(se.src)];case 6:return vr=Ao.sent(),this.renderReplacedElement(se,ye,vr),[3,8];case 7:return Ao.sent(),this.context.logger.error("Error loading image "+se.src),[3,8];case 8:if(se instanceof VR&&this.renderReplacedElement(se,ye,se.canvas),!(se instanceof Woe))return[3,12];Ao.label=9;case 9:return Ao.trys.push([9,11,,12]),[4,this.context.cache.match(se.svg)];case 10:return vr=Ao.sent(),this.renderReplacedElement(se,ye,vr),[3,12];case 11:return Ao.sent(),this.context.logger.error("Error loading svg "+se.svg.substring(0,255)),[3,12];case 12:return se instanceof YR&&se.tree?[4,new _(this.context,{scale:this.options.scale,backgroundColor:se.backgroundColor,x:0,y:0,width:se.width,height:se.height}).render(se.tree)]:[3,14];case 13:Je=Ao.sent(),se.width&&se.height&&this.ctx.drawImage(Je,0,0,se.width,se.height,se.bounds.left,se.bounds.top,se.bounds.width,se.bounds.height),Ao.label=14;case 14:if(se instanceof pY&&(wt=Math.min(se.bounds.width,se.bounds.height),se.type===eh?se.checked&&(this.ctx.save(),this.path([new Ui(se.bounds.left+.39363*wt,se.bounds.top+.79*wt),new Ui(se.bounds.left+.16*wt,se.bounds.top+.5549*wt),new Ui(se.bounds.left+.27347*wt,se.bounds.top+.44071*wt),new Ui(se.bounds.left+.39694*wt,se.bounds.top+.5649*wt),new Ui(se.bounds.left+.72983*wt,se.bounds.top+.23*wt),new Ui(se.bounds.left+.84*wt,se.bounds.top+.34085*wt),new Ui(se.bounds.left+.39363*wt,se.bounds.top+.79*wt)]),this.ctx.fillStyle=tu(vY),this.ctx.fill(),this.ctx.restore()):se.type===zR&&se.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(se.bounds.left+wt/2,se.bounds.top+wt/2,wt/4,0,2*Math.PI,!0),this.ctx.fillStyle=tu(vY),this.ctx.fill(),this.ctx.restore())),OCe(se)&&se.value.length){switch(Qt=this.createFontStyle(Pe),Ko=Qt[0],Kt=Qt[1],Xn=this.fontMetrics.getMetrics(Ko,Kt).baseline,this.ctx.font=Ko,this.ctx.fillStyle=tu(Pe.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=DY(se.styles.textAlign),Zo=u3(se),In=0,se.styles.textAlign){case 1:In+=Zo.width/2;break;case 2:In+=Zo.width}Kn=Zo.add(In,0,0,-Zo.height/2+1),this.ctx.save(),this.path([new Ui(Zo.left,Zo.top),new Ui(Zo.left+Zo.width,Zo.top),new Ui(Zo.left+Zo.width,Zo.top+Zo.height),new Ui(Zo.left,Zo.top+Zo.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new r9(se.value,Kn),Pe.letterSpacing,Xn),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!_u(se.styles.display,2048))return[3,20];if(se.styles.listStyleImage===null)return[3,19];if((Oi=se.styles.listStyleImage).type!==0)return[3,18];vr=void 0,qi=Oi.url,Ao.label=15;case 15:return Ao.trys.push([15,17,,18]),[4,this.context.cache.match(qi)];case 16:return vr=Ao.sent(),this.ctx.drawImage(vr,se.bounds.left-(vr.width+10),se.bounds.top),[3,18];case 17:return Ao.sent(),this.context.logger.error("Error loading list-style-image "+qi),[3,18];case 18:return[3,20];case 19:te.listValue&&se.styles.listStyleType!==-1&&(Ko=this.createFontStyle(Pe)[0],this.ctx.font=Ko,this.ctx.fillStyle=tu(Pe.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",Zo=new a(se.bounds.left,se.bounds.top+Sn(se.styles.paddingTop,se.bounds.width),se.bounds.width,QR(Pe.lineHeight,Pe.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new r9(te.listValue,Zo),Pe.letterSpacing,QR(Pe.lineHeight,Pe.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),Ao.label=20;case 20:return[2]}})})},_.prototype.renderStackContent=function(te){return r(this,void 0,void 0,function(){var se,ye,Pe,Ye,_e,gt,Je,wt,Qt,Kt,Xn,In,Kn,Oi,vr;return o(this,function(qi){switch(qi.label){case 0:return _u(te.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(te.element)];case 1:qi.sent(),se=0,ye=te.negativeZIndex,qi.label=2;case 2:return se0&&gA>0&&(ko=Pe.ctx.createPattern(dr,"repeat"),Pe.renderRepeat(Vf,ko,u0,th))):function(hl){return hl.type===2}(Qt)&&(iu=eI(te,se,[null,null,null]),Vf=iu[0],zf=iu[1],Tu=iu[2],fA=iu[3],gA=iu[4],Zf=Qt.position.length===0?[We]:Qt.position,u0=Sn(Zf[0],fA),th=Sn(Zf[Zf.length-1],gA),h3=function(hl,dc,Ds,Qd,Vm){var Wk=0,zm=0;switch(hl.size){case 0:hl.shape===0?Wk=zm=Math.min(Math.abs(dc),Math.abs(dc-Qd),Math.abs(Ds),Math.abs(Ds-Vm)):hl.shape===1&&(Wk=Math.min(Math.abs(dc),Math.abs(dc-Qd)),zm=Math.min(Math.abs(Ds),Math.abs(Ds-Vm)));break;case 2:if(hl.shape===0)Wk=zm=Math.min(XA(dc,Ds),XA(dc,Ds-Vm),XA(dc-Qd,Ds),XA(dc-Qd,Ds-Vm));else if(hl.shape===1){var j2=Math.min(Math.abs(Ds),Math.abs(Ds-Vm))/Math.min(Math.abs(dc),Math.abs(dc-Qd)),BY=n3(Qd,Vm,dc,Ds,!0),rI=BY[0],FY=BY[1];zm=j2*(Wk=XA(rI-dc,(FY-Ds)/j2))}break;case 1:hl.shape===0?Wk=zm=Math.max(Math.abs(dc),Math.abs(dc-Qd),Math.abs(Ds),Math.abs(Ds-Vm)):hl.shape===1&&(Wk=Math.max(Math.abs(dc),Math.abs(dc-Qd)),zm=Math.max(Math.abs(Ds),Math.abs(Ds-Vm)));break;case 3:if(hl.shape===0)Wk=zm=Math.max(XA(dc,Ds),XA(dc,Ds-Vm),XA(dc-Qd,Ds),XA(dc-Qd,Ds-Vm));else if(hl.shape===1){j2=Math.max(Math.abs(Ds),Math.abs(Ds-Vm))/Math.max(Math.abs(dc),Math.abs(dc-Qd));var PY=n3(Qd,Vm,dc,Ds,!1);rI=PY[0],FY=PY[1],zm=j2*(Wk=XA(rI-dc,(FY-Ds)/j2))}}return Array.isArray(hl.size)&&(Wk=Sn(hl.size[0],Qd),zm=hl.size.length===2?Sn(hl.size[1],Vm):Wk),[Wk,zm]}(Qt,u0,th,fA,gA),jk=h3[0],U2=h3[1],jk>0&&U2>0&&(MC=Pe.ctx.createRadialGradient(zf+u0,Tu+th,0,zf+u0,Tu+th,jk),LC(Qt.stops,2*jk).forEach(function(hl){return MC.addColorStop(hl.stop,tu(hl.color))}),Pe.path(Vf),Pe.ctx.fillStyle=MC,jk!==U2?(RC=te.bounds.left+.5*te.bounds.width,H4=te.bounds.top+.5*te.bounds.height,IC=1/(V4=U2/jk),Pe.ctx.save(),Pe.ctx.translate(RC,H4),Pe.ctx.transform(1,0,0,V4,0,0),Pe.ctx.translate(-RC,-H4),Pe.ctx.fillRect(zf,IC*(Tu-H4)+H4,fA,gA*IC),Pe.ctx.restore()):Pe.ctx.fill())),Ug.label=6;case 6:return se--,[2]}})},Pe=this,Ye=0,_e=te.styles.backgroundImage.slice(0).reverse(),Je.label=1;case 1:return Ye<_e.length?(gt=_e[Ye],[5,ye(gt)]):[3,4];case 2:Je.sent(),Je.label=3;case 3:return Ye++,[3,1];case 4:return[2]}})})},_.prototype.renderSolidBorder=function(te,se,ye){return r(this,void 0,void 0,function(){return o(this,function(Pe){return this.path(sse(ye,se)),this.ctx.fillStyle=tu(te),this.ctx.fill(),[2]})})},_.prototype.renderDoubleBorder=function(te,se,ye,Pe){return r(this,void 0,void 0,function(){var Ye,_e;return o(this,function(gt){switch(gt.label){case 0:return se<3?[4,this.renderSolidBorder(te,ye,Pe)]:[3,2];case 1:return gt.sent(),[2];case 2:return Ye=function(Je,wt){switch(wt){case 0:return Ng(Je.topLeftBorderBox,Je.topLeftBorderDoubleOuterBox,Je.topRightBorderBox,Je.topRightBorderDoubleOuterBox);case 1:return Ng(Je.topRightBorderBox,Je.topRightBorderDoubleOuterBox,Je.bottomRightBorderBox,Je.bottomRightBorderDoubleOuterBox);case 2:return Ng(Je.bottomRightBorderBox,Je.bottomRightBorderDoubleOuterBox,Je.bottomLeftBorderBox,Je.bottomLeftBorderDoubleOuterBox);default:return Ng(Je.bottomLeftBorderBox,Je.bottomLeftBorderDoubleOuterBox,Je.topLeftBorderBox,Je.topLeftBorderDoubleOuterBox)}}(Pe,ye),this.path(Ye),this.ctx.fillStyle=tu(te),this.ctx.fill(),_e=function(Je,wt){switch(wt){case 0:return Ng(Je.topLeftBorderDoubleInnerBox,Je.topLeftPaddingBox,Je.topRightBorderDoubleInnerBox,Je.topRightPaddingBox);case 1:return Ng(Je.topRightBorderDoubleInnerBox,Je.topRightPaddingBox,Je.bottomRightBorderDoubleInnerBox,Je.bottomRightPaddingBox);case 2:return Ng(Je.bottomRightBorderDoubleInnerBox,Je.bottomRightPaddingBox,Je.bottomLeftBorderDoubleInnerBox,Je.bottomLeftPaddingBox);default:return Ng(Je.bottomLeftBorderDoubleInnerBox,Je.bottomLeftPaddingBox,Je.topLeftBorderDoubleInnerBox,Je.topLeftPaddingBox)}}(Pe,ye),this.path(_e),this.ctx.fill(),[2]}})})},_.prototype.renderNodeBackgroundAndBorders=function(te){return r(this,void 0,void 0,function(){var se,ye,Pe,Ye,_e,gt,Je,wt,Qt=this;return o(this,function(Kt){switch(Kt.label){case 0:return this.applyEffects(te.getEffects(2)),se=te.container.styles,ye=!Mg(se.backgroundColor)||se.backgroundImage.length,Pe=[{style:se.borderTopStyle,color:se.borderTopColor,width:se.borderTopWidth},{style:se.borderRightStyle,color:se.borderRightColor,width:se.borderRightWidth},{style:se.borderBottomStyle,color:se.borderBottomColor,width:se.borderBottomWidth},{style:se.borderLeftStyle,color:se.borderLeftColor,width:se.borderLeftWidth}],Ye=dse(f9(se.backgroundClip,0),te.curves),ye||se.boxShadow.length?(this.ctx.save(),this.path(Ye),this.ctx.clip(),Mg(se.backgroundColor)||(this.ctx.fillStyle=tu(se.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(te.container)]):[3,2];case 1:Kt.sent(),this.ctx.restore(),se.boxShadow.slice(0).reverse().forEach(function(Xn){Qt.ctx.save();var In=Su(te.curves),Kn=Xn.inset?0:1e4,Oi=function(vr,qi,Ko,Zo,Ao){return vr.map(function(dr,os){switch(os){case 0:return dr.add(qi,Ko);case 1:return dr.add(qi+Zo,Ko);case 2:return dr.add(qi+Zo,Ko+Ao);case 3:return dr.add(qi,Ko+Ao)}return dr})}(In,-Kn+(Xn.inset?1:-1)*Xn.spread.number,(Xn.inset?1:-1)*Xn.spread.number,Xn.spread.number*(Xn.inset?-2:2),Xn.spread.number*(Xn.inset?-2:2));Xn.inset?(Qt.path(In),Qt.ctx.clip(),Qt.mask(Oi)):(Qt.mask(In),Qt.ctx.clip(),Qt.path(Oi)),Qt.ctx.shadowOffsetX=Xn.offsetX.number+Kn,Qt.ctx.shadowOffsetY=Xn.offsetY.number,Qt.ctx.shadowColor=tu(Xn.color),Qt.ctx.shadowBlur=Xn.blur.number,Qt.ctx.fillStyle=Xn.inset?tu(Xn.color):"rgba(0,0,0,1)",Qt.ctx.fill(),Qt.ctx.restore()}),Kt.label=2;case 2:_e=0,gt=0,Je=Pe,Kt.label=3;case 3:return gt0?wt.style!==2?[3,5]:[4,this.renderDashedDottedBorder(wt.color,wt.width,_e,te.curves,2)]:[3,11]:[3,13];case 4:return Kt.sent(),[3,11];case 5:return wt.style!==3?[3,7]:[4,this.renderDashedDottedBorder(wt.color,wt.width,_e,te.curves,3)];case 6:return Kt.sent(),[3,11];case 7:return wt.style!==4?[3,9]:[4,this.renderDoubleBorder(wt.color,wt.width,_e,te.curves)];case 8:return Kt.sent(),[3,11];case 9:return[4,this.renderSolidBorder(wt.color,_e,te.curves)];case 10:Kt.sent(),Kt.label=11;case 11:_e++,Kt.label=12;case 12:return gt++,[3,3];case 13:return[2]}})})},_.prototype.renderDashedDottedBorder=function(te,se,ye,Pe,Ye){return r(this,void 0,void 0,function(){var _e,gt,Je,wt,Qt,Kt,Xn,In,Kn,Oi,vr,qi,Ko,Zo,Ao,dr;return o(this,function(os){return this.ctx.save(),_e=function(ss,ko){switch(ko){case 0:return $R(ss.topLeftBorderStroke,ss.topRightBorderStroke);case 1:return $R(ss.topRightBorderStroke,ss.bottomRightBorderStroke);case 2:return $R(ss.bottomRightBorderStroke,ss.bottomLeftBorderStroke);default:return $R(ss.bottomLeftBorderStroke,ss.topLeftBorderStroke)}}(Pe,ye),gt=sse(Pe,ye),Ye===2&&(this.path(gt),this.ctx.clip()),Hf(gt[0])?(Je=gt[0].start.x,wt=gt[0].start.y):(Je=gt[0].x,wt=gt[0].y),Hf(gt[1])?(Qt=gt[1].end.x,Kt=gt[1].end.y):(Qt=gt[1].x,Kt=gt[1].y),Xn=Math.abs(ye===0||ye===2?Je-Qt:wt-Kt),this.ctx.beginPath(),Ye===3?this.formatPath(_e):this.formatPath(gt.slice(0,2)),In=se<3?3*se:2*se,Kn=se<3?2*se:se,Ye===3&&(In=se,Kn=se),Oi=!0,Xn<=2*In?Oi=!1:Xn<=2*In+Kn?(In*=vr=Xn/(2*In+Kn),Kn*=vr):(qi=Math.floor((Xn+Kn)/(In+Kn)),Ko=(Xn-qi*In)/(qi-1),Kn=(Zo=(Xn-(qi+1)*In)/qi)<=0||Math.abs(Kn-Ko)1&&arguments[1]!==void 0?arguments[1]:{};if(t.format!=="svg"){var n=t.width,r=n===void 0?e.width.baseVal.value:n,o=t.height,s=o===void 0?e.height.baseVal.value:o,a=t.scale,l=a===void 0?5:a,d=t.quality,u=d===void 0?1:d,h=t.backgroundColor,f=h===void 0?"white":h,g=t.filename,k=g===void 0?"formula":g,A=t.format,m=A===void 0?"png":A,v=t.mimeType,p=v===void 0?"image/png":v,b=wke(e),O=document.createElement("canvas"),w=O.getContext("2d"),y=new Image;y.src="data:image/svg+xml;base64,".concat(btoa(unescape(encodeURIComponent(b)))),y.onload=function(){O.width=r*l,O.height=s*l,w.fillStyle=f,w.fillRect(0,0,O.width,O.height),w.drawImage(y,0,0,O.width,O.height),O.toBlob(function(x){var L,S=$U.createObjectURL(x);PKt(S,nt(L="".concat(k,".")).call(L,m)),$U.revokeObjectURL(S)},p,u)}}else{var C;(function(x,L){var S=wke(x),E=new Blob([S],{type:"image/svg+xml;charset=utf-8"}),Q=$U.createObjectURL(E);PKt(Q,L),$U.revokeObjectURL(Q)})(e,(C=t.filename)!==null&&C!==void 0?C:"formula.svg")}}function wke(e){return new XMLSerializer().serializeToString(e)}function Sas(e,t){var n=aR!==void 0&&lR(e)||e["@@iterator"];if(!n){if(MA(e)||(n=function(d,u){if(d){var h;if(typeof d=="string")return MKt(d,u);var f=ba(h={}.toString.call(d)).call(h,8,-1);return f==="Object"&&d.constructor&&(f=d.constructor.name),f==="Map"||f==="Set"?Xl(d):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?MKt(d,u):void 0}}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return a=u.done,u},e:function(u){l=!0,s=u},f:function(){try{a||n.return==null||n.return()}finally{if(l)throw s}}}}function MKt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n3&&arguments[3]!==void 0?arguments[3]:"block",o=document.createElement("img");return o.src=e,o.width=t,o.height=n,o.style.maxWidth="100%",o.style.height="auto",o.style.display=r,o}var Eas=['[data-type="mermaid"]','[data-type="mathBlock"]'];function Das(e,t,n){return new oO(function(r,o){try{var s=wke(e),a=document.createElement("canvas"),l=a.getContext("2d");a.width=2*t,a.height=2*n;var d=new Image;d.onload=function(){try{l&&l.drawImage(d,0,0,a.width,a.height),r(a.toDataURL("image/png"))}catch(u){q1.log("SVG 绘制到 Canvas 失败:",u),o(u)}},d.onerror=function(u){q1.log("SVG 图片加载失败:",u),o(u)},d.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(s))}catch(u){o(u)}})}function Qas(e,t){return nqe.apply(this,arguments)}function nqe(){return nqe=eE(km.mark(function e(t,n){var r,o,s,a,l,d;return km.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if((r=t.querySelector("svg"))instanceof SVGSVGElement){u.next=3;break}return u.abrupt("return",!1);case 3:return o=r.getBoundingClientRect(),s=Math.max(1,Math.round(o.width)),a=Math.max(1,Math.round(o.height)),u.next=8,Das(r,s,a);case 8:return l=u.sent,d=Tas(l,s,a,n),t.replaceWith(d),u.abrupt("return",!0);case 12:case"end":return u.stop()}},e)})),nqe.apply(this,arguments)}function Bas(e){return iqe.apply(this,arguments)}function iqe(){return iqe=eE(km.mark(function e(t){var n,r,o,s,a,l,d,u,h;return km.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:n=document.createElement("div"),NB(n.style,{position:"fixed",left:"-100000px",top:"0",visibility:"hidden",pointerEvents:"none",width:"".concat(document.documentElement.clientWidth||document.body.clientWidth||1e3,"px")}),(r=document.createElement("div")).className="cherry-export-word-container",r.innerHTML=t,n.appendChild(r),document.body.appendChild(n),o=Xl(r.querySelectorAll(Eas.join(","))),s=Sas(o),f.prev=9,s.s();case 11:if((a=s.n()).done){f.next=25;break}return l=a.value,f.prev=13,d=l.getAttribute("data-type"),u=d==="mathBlock"?"inline-block":"block",f.next=18,Qas(l,u);case 18:f.next=23;break;case 20:f.prev=20,f.t0=f.catch(13),q1.log("[exportWord] 处理节点失败,已跳过该节点:",f.t0);case 23:f.next=11;break;case 25:f.next=30;break;case 27:f.prev=27,f.t1=f.catch(9),s.e(f.t1);case 30:return f.prev=30,s.f(),f.finish(30);case 33:return h=r.innerHTML,n.remove(),f.abrupt("return",h);case 36:case"end":return f.stop()}},e,null,[[9,27,30,33],[13,20]])})),iqe.apply(this,arguments)}function Fas(e,t){return UZn.apply(this,arguments)}function UZn(){return(UZn=eE(km.mark(function e(t,n){var r,o,s,a;return km.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return o=t,l.prev=1,l.next=4,Bas(t);case 4:o=l.sent,l.next=10;break;case 7:l.prev=7,l.t0=l.catch(1),q1.warn("[exportWord] 预处理失败,降级为原始 HTML:",l.t0);case 10:if(s=nt(r=` `.concat(n,` `)).call(r,o,` `),!navigator.clipboard||!navigator.clipboard.write){l.next=18;break}return a=new ClipboardItem({"text/html":new Blob([s],{type:"text/html"})}),l.next=15,navigator.clipboard.write([a]);case 15:Pas(),l.next=19;break;case 18:throw new Error("浏览器未授权粘贴板或不支持剪贴板写入");case 19:case"end":return l.stop()}},e,null,[[1,7]])}))).apply(this,arguments)}function Pas(){var e=document.createElement("div");e.className="cherry",e.innerHTML=`

    内容已复制到剪贴板

    请打开 Microsoft Word,然后按 Ctrl+V(Windows)或 Cmd+V(Mac)粘贴内容。

    部分样式可能会丢失或变更

    `,document.body.appendChild(e)}var jZn=function(t,n){var r=t.cloneNode(!0);r.className=r.className.replace("cherry-previewer--hidden",""),r.style.width="100%",r.style.height="auto",r.style.maxHeight="none";var o=r.querySelectorAll("mjx-assistive-mml");vi(o).call(o,function(u){u instanceof HTMLElement&&u.style.setProperty("visibility","hidden")});var s=document.createElement("div");s.className="cherry-export-wrapper";var a,l=t.closest(".cherry");l&&(s.className=nt(a="".concat(s.className," ")).call(a,l.className)),s.appendChild(r),document.body.appendChild(s);var d=document.body.style.overflow;document.body.style.overflow="visible",n(r,function(){s.remove(),document.body.style.overflow=d})};function Mas(e,t){jZn(e,function(n,r){window.scrollTo(0,0),n.innerHTML=n.innerHTML.replace(/
    `)).call(t,a,`
    `)}},{key:"$tryRemoveMe",value:function(t,n){/textarea/i.test(t.target.tagName)||(this.$remove(),n())}},{key:"$getPosition",value:function(){var t=this.target.getBoundingClientRect(),n=this.previewerDom.parentNode.getBoundingClientRect();return{top:t.top-n.top,left:t.left-n.left,width:t.width,height:t.height,maxLeft:n.width+n.left}}},{key:"setStyle",value:function(t,n,r){t.getBoundingClientRect()[n]!==r&&(t.style[n]=r)}},{key:"$remove",value:function(){this.bubbleCard={refNum:0,refTitle:"",content:""}}}])}();function iS(e,t){return rqe.apply(this,arguments)}function rqe(){return rqe=eE(km.mark(function e(t,n){var r,o;return km.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(o=function(l){t&&l.clipboardData.setData("text/plain",t),n&&l.clipboardData.setData("text/html",n),l.preventDefault()},t||n){s.next=3;break}throw new Error("没有提供任何内容进行复制");case 3:if(!navigator.clipboard||!window.ClipboardItem){s.next=16;break}return s.prev=4,r={},t&&(r["text/plain"]=new Blob([t],{type:"text/plain"})),n&&(r["text/html"]=new Blob([n],{type:"text/html"})),s.next=10,navigator.clipboard.write([new ClipboardItem(r)]);case 10:return s.abrupt("return");case 13:s.prev=13,s.t0=s.catch(4),console.warn("Clipboard API failed, falling back to execCommand:",s.t0);case 16:if(document.addEventListener("copy",o),s.prev=17,document.execCommand("copy")){s.next=21;break}throw new Error("Copy command was unsuccessful");case 21:return s.prev=21,document.removeEventListener("copy",o),s.finish(21);case 24:case"end":return s.stop()}},e,null,[[4,13],[17,,21,24]])})),rqe.apply(this,arguments)}var KEe=null;function Kas(){return HZn.apply(this,arguments)}function HZn(){return(HZn=eE(km.mark(function e(){return km.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(KEe){t.next=12;break}return t.prev=1,t.next=4,Promise.resolve({default:{}});case 4:return KEe=t.sent.default,t.next=7,Promise.resolve({default:{toString:function(){return"Pass"}}});case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),console.warn("CodeMirror not available:",t.t0);case 12:return t.abrupt("return",KEe);case 13:case"end":return t.stop()}},e,null,[[1,9]])}))).apply(this,arguments)}var bJt,OJt,JEe,wJt,yJt,CJt,xJt,LJt,_Ee,SJt,Jas=function(){return Dr(function n(r,o,s,a,l,d){Er(this,n),ei(this,"codeBlockEditor",{info:{},editorDom:{}}),this.trigger=r,this.target=o,this.previewerDom=a,this.container=s,this.codeMirror=l,this.$cherry=d.previewer.$cherry,this.parent=d,this.hasEditor=l!==null,this.$initReg()},[{key:"$initReg",value:function(){this.codeBlockReg=this.codeBlockReg?this.codeBlockReg:Bwe().reg}},{key:"emit",value:function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){};switch(r){case"remove":return this.$remove();case"scroll":case"resize":return this.$updateContainerPosition();case"previewUpdate":return this.$updateContainerPosition(),void(this.editing&&this.$setInputOffset());case"mouseup":return this.$tryRemoveMe(o,s)}}},{key:"$remove",value:function(){this.codeBlockEditor={info:{},codeBlockCodes:[],editorDom:{}}}},{key:"$tryRemoveMe",value:function(r,o){var s=this.codeBlockEditor.editorDom.inputDiv;this.editing&&s&&!s.contains(r.target)&&(this.editing=!1,this.$remove(),o())}},{key:"$findCodeInEditor",value:function(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.$collectCodeBlockDom(),this.$collectCodeBlockCode(),r?this.$setLangSelection(this.codeBlockEditor.info.codeBlockIndex):this.$setBlockSelection(this.codeBlockEditor.info.codeBlockIndex)}},{key:"$collectCodeBlockDom",value:function(){var r=Xl(this.previewerDom.querySelectorAll('[data-type="codeBlock"]'));this.codeBlockEditor.info={codeBlockNode:this.target,codeBlockIndex:Ys(r).call(r,this.target)}}},{key:"$collectCodeBlockCode",value:function(){if(this.codeMirror){var r=[];this.codeMirror.getValue().replace(this.codeBlockReg,function(o){var s,a=o.replace(/^\n*/,""),l=((s=(arguments.length<=1?0:arguments.length-1)-2+1)<1||arguments.length<=s?void 0:arguments[s])+o.match(/^\n*/)[0].length;O8(a).call(a,"```mermaid")||r.push({code:a,offset:l})}),this.codeBlockEditor.codeBlockCodes=r}else this.codeBlockEditor.codeBlockCodes=[]}},{key:"$setBlockSelection",value:function(r){var o,s,a,l;if(this.codeMirror){var d=this.codeBlockEditor.codeBlockCodes[r],u=this.codeMirror.getValue(),h=(o=(s=ba(u).call(u,0,d.offset).match(/\n/g))===null||s===void 0?void 0:s.length)!==null&&o!==void 0?o:0,f=h+d.code.match(/\n/g).length,g=ba(a=d.code).call(a,0,-3).match(/[^\n]+\n*$/)[0].length;this.codeBlockEditor.info.selection=[{line:f-1,ch:g},{line:h+1,ch:0}],(l=this.codeMirror).setSelection.apply(l,$T(this.codeBlockEditor.info.selection))}}},{key:"$setLangSelection",value:function(r){var o,s,a,l;if(this.codeMirror){var d=this.codeBlockEditor.codeBlockCodes[r],u=this.codeMirror.getValue(),h=(o=(s=ba(u).call(u,0,d.offset).match(/\n/g))===null||s===void 0?void 0:s.length)!==null&&o!==void 0?o:0,f=((a=d.code.match(/```\s*[^\n]+/)[0])!==null&&a!==void 0?a:"```").length;this.codeBlockEditor.info.selection=[{line:h,ch:3},{line:h,ch:f}],(l=this.codeMirror).setSelection.apply(l,$T(this.codeBlockEditor.info.selection))}}},{key:"showBubble",value:function(){var r=this,o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.$updateContainerPosition(),this.trigger==="hover"&&this.$showBtn(o),this.trigger==="click"&&this.hasEditor&&this.$showContentEditor(),this.container.addEventListener("wheel",function(s){s.stopPropagation(),s.preventDefault(),r.previewerDom.scrollTop+=s.deltaY/3},{passive:!1})}},{key:"$showContentEditor",value:(t=eE(km.mark(function n(){return km.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return this.editing=!0,this.$findCodeInEditor(),r.next=4,this.$drawEditor();case 4:case"end":return r.stop()}},n,this)})),function(){return t.apply(this,arguments)})},{key:"$showBtn",value:function(r){var o=this,s=this.target.dataset,a=s.changeLang,l=s.editCode,d=s.copyCode,u=s.lang,h=s.expandCode;if(this.container.innerHTML="",a==="true"&&r){this.container.innerHTML=function(O){var w,y=cs(JU).call(JU,function(C){var x,L;return O===C?nt(L='"):nt(x='")});return nt(w='`)}(u);var f=this.container.querySelector("#code-preview-lang-select");this.changeLangDom=f,this.changeLangDom.addEventListener("change",function(O){O.preventDefault(),O.stopPropagation(),o.parent.$removeAllPreviewerBubbles("click"),o.$changeLang(O.target.value||"")})}var g=.5;if(l==="true"&&r){var k=document.createElement("div");k.className="cherry-edit-code-block",k.innerHTML='',k.style.right="".concat(g,"em"),this.container.appendChild(k),k.addEventListener("click",function(O){O.preventDefault(),O.stopPropagation(),o.$expandCodeBlock(!0,O),o.$hideAllBtn(),o.parent.$removeAllPreviewerBubbles("click"),o.parent.showCodeBlockPreviewerBubbles("click",o.target)}),this.editDom=k,g+=.5}if(d==="true"){var A=document.createElement("div");A.className="cherry-copy-code-block",A.innerHTML='',A.style.right="".concat(g,"em"),this.container.appendChild(A),A.addEventListener("click",function(O){O.preventDefault(),O.stopPropagation(),o.parent.$removeAllPreviewerBubbles("click"),o.$copyCodeBlock()}),this.copyDom=A,g+=.5}var m=this.$cherry.options.engine.syntax.codeBlock.customBtns;if(m&&(this.codeBlockCustomBtns=[],vi(m).call(m,function(O){var w=document.createElement("div");w.className="cherry-code-block-custom-btn",w.innerHTML=O.html,w.style.right="".concat(g,"em"),o.container.appendChild(w),w.addEventListener("click",function(y){var C;y.preventDefault(),y.stopPropagation();var x=o.target.querySelector("pre").innerText,L=(C=o.target.dataset.lang)!==null&&C!==void 0?C:"";O.onClick(y,x,L,o.target)}),o.codeBlockCustomBtns.push(w),g+=.5})),h==="true"){var v=this.target.classList.contains("cherry-code-expand"),p=this.target.querySelector(".cherry-mask-code-block"),b=document.createElement("div");b.className="cherry-unExpand-code-block",b.innerHTML='',b.style.right="".concat(g,"em"),v&&p||b.classList.add("hidden"),this.container.appendChild(b),b.addEventListener("click",function(O){O.preventDefault(),O.stopPropagation(),o.parent.$removeAllPreviewerBubbles("click"),o.$expandCodeBlock(!1,O)}),this.unExpandDom=b,g+=.5}}},{key:"$hideAllBtn",value:function(){var r,o,s,a,l,d,u,h;(r=this.changeLangDom)!==null&&r!==void 0&&(o=r.style)!==null&&o!==void 0&&o.display&&(this.changeLangDom.style.display="none"),(s=this.editDom)!==null&&s!==void 0&&(a=s.style)!==null&&a!==void 0&&a.display&&(this.editDom.style.display="none"),(l=this.copyDom)!==null&&l!==void 0&&(d=l.style)!==null&&d!==void 0&&d.display&&(this.copyDom.style.display="none"),(u=this.unExpandDom)!==null&&u!==void 0&&(h=u.style)!==null&&h!==void 0&&h.display&&(this.unExpandDom.style.display="none")}},{key:"$changeLang",value:function(r){this.codeMirror&&(this.$findCodeInEditor(!0),this.codeMirror.replaceSelection(r,"around"))}},{key:"$drawEditor",value:(e=eE(km.mark(function n(){var r,o,s,a,l;return km.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(this.codeMirror){d.next=2;break}return d.abrupt("return");case 2:return d.next=4,Kas();case 4:r=d.sent,(o=document.createElement("div")).className="cherry-previewer-codeBlock-content-handler__input",(s=document.createElement("textarea")).id="codeMirrorEditor",o.appendChild(s),a=r.fromTextArea(s,{mode:"",theme:"default",scrollbarStyle:"null",lineNumbers:!0,autofocus:!0,lineWrapping:!0,cursorHeight:.85,indentUnit:4,tabSize:4,keyMap:"sublime"}),l=this.codeMirror,a.on("change",function(){l.replaceSelection(a.getValue(),"around")}),this.codeBlockEditor.editorDom.inputDiv=o,this.codeBlockEditor.editorDom.inputDom=a,this.$updateEditorPosition(),this.container.appendChild(this.codeBlockEditor.editorDom.inputDiv),this.codeBlockEditor.editorDom.inputDom.focus(),this.codeBlockEditor.editorDom.inputDom.refresh(),a.setValue(this.codeMirror.getSelection());case 20:case"end":return d.stop()}},n,this)})),function(){return e.apply(this,arguments)})},{key:"$expandCodeBlock",value:function(){var r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],o=arguments.length>1?arguments[1]:void 0;if(this.unExpandDom){this.target.classList.remove("cherry-code-unExpand"),this.target.classList.remove("cherry-code-expand"),this.unExpandDom.classList.remove("hidden");var s=this.target.querySelector("pre").innerText;r?(this.$cherry.options.callback.onExpandCode&&this.$cherry.options.callback.onUnExpandCode(o,s),this.target.classList.add("cherry-code-expand")):(this.$cherry.options.callback.onExpandCode&&this.$cherry.options.callback.onExpandCode(o,s),this.unExpandDom.classList.add("hidden"),this.target.classList.add("cherry-code-unExpand"))}}},{key:"$copyCodeBlock",value:function(){var r=this.target.querySelector("pre").innerText,o=this.$cherry.options.callback.onCopyCode({target:this.target},r);if(o===!1)return!1;var s=this.copyDom.querySelector("i.ch-icon-copy");s&&(s.className=s.className.replace("copy","ok"),Iu(function(){s.className=s.className.replace("ok","copy")},1e3)),iS(o)}},{key:"$updateContainerPosition",value:function(){this.codeBlockEditor.info.codeBlockNode=this.target;var r=this.$getPosition();this.setStyle(this.container,"width","".concat(r.width,"px")),this.setStyle(this.container,"top","".concat(r.top,"px")),this.setStyle(this.container,"left","".concat(r.left,"px"))}},{key:"$updateEditorPosition",value:function(){this.$setInputOffset();var r=getComputedStyle(this.codeBlockEditor.info.codeBlockNode),o=this.codeBlockEditor.editorDom.inputDom.getWrapperElement();this.setStyle(o,"fontSize",r.fontSize||"16px"),this.setStyle(o,"fontFamily",r.fontFamily),this.setStyle(o,"lineHeight","1.8em"),this.setStyle(o,"zIndex","1")}},{key:"$setInputOffset",value:function(){var r=this.$getPosition(),o=this.codeBlockEditor.editorDom.inputDiv;this.setStyle(o,"width","".concat(r.width,"px")),this.setStyle(o,"height","".concat(r.height+10,"px"))}},{key:"setStyle",value:function(r,o,s){r.getBoundingClientRect()[o]!==s&&(r.style[o]=s)}},{key:"$getPosition",value:function(){var r=this.codeBlockEditor.info.codeBlockNode.getBoundingClientRect(),o=this.previewerDom.parentNode.getBoundingClientRect();return{top:r.top-o.top,height:r.height,width:r.width,left:r.left-o.left,maxHeight:o.height}}}]);var e,t}(),TJt=function(t,n,r){return Math.min(Math.max(t,n),r)},EJt={open:function(){this.resetStyle(),this.dom.style.display="block",this.postMessage("ready?")},close:function(){this.dom.style.display="none"},postMessage:function(t){var n,r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n=this.iframeDom)===null||n===void 0||(r=n.contentWindow)===null||r===void 0||r.postMessage({eventName:t,value:o},"*")},resetStyle:function(){var t=this.dom;t.style.left="10%",t.style.top="10%"},bindEvents:function(){this.bindClickEvents(),this.bindDNDEvents()},bindClickEvents:function(){var t=this;this.headCloseButton.addEventListener("click",function(){t.close()}),this.footSureButton.addEventListener("click",function(){t.postMessage("getData")})},bindDNDEvents:function(){var t,n,r=this.dom,o=this.head,s=this.body,a=function(u){u.preventDefault();var h=TJt(u.clientX-t,0,window.innerWidth-16),f=TJt(u.clientY-n,0,window.innerHeight-16);r.style.left="".concat(h,"px"),r.style.top="".concat(f,"px")},l=function d(u){o.style.cursor="grab",s.style.pointerEvents=null,document.removeEventListener("mousemove",a),document.removeEventListener("mousemove",d)};o.addEventListener("mousedown",function(d){d.target.classList.contains("cherry-dialog--close")||(t=d.clientX-r.offsetLeft,n=d.clientY-r.offsetTop,o.style.cursor="grabbing",s.style.pointerEvents="none",document.addEventListener("mousemove",a),document.addEventListener("mouseup",l))})},draw:function(t,n,r){var o=this,s=t.iframeSrc,a=t.iframeStyle,l=t.title;if(this.onSubmit=r,this.onReady=n,this.dom)return new RegExp("".concat(s,"$"),"i").test(this.iframeDom.src)||(this.iframeDom.src=s),void this.open();window.addEventListener("message",function(d){if(d.data&&d.data.eventName)switch(d.data.eventName){case"getData:success":o.onSubmit(d.data.value),o.close();case"ready":o.onReady()}}),this.iframeDom=ig("iframe","cherry-dialog-iframe",{src:s,style:a}),this.dom=ig("div","cherry-dialog",{style:["z-index:9999","display: block","position: absolute","top: 10%;left: 10%;width: 80%;height: 80%;","background-color: #FFF","box-shadow: 0px 50px 100px -12px rgba(0,0,0,.05),0px 30px 60px -30px rgba(0,0,0,.1)","border-radius: 6px","border: 1px solid #ddd;"].join(";")}),this.head=ig("div","cherry-dialog--head",{style:["height: 30px","line-height: 30px","padding-left: 10px","padding-right: 10px","cursor: grab;"].join(";")}),this.body=ig("div","cherry-dialog--body",{style:["position: absolute","bottom: 30px","top: 30px","left: 0","right: 0","overflow: hidden"].join(";")}),this.foot=ig("div","cherry-dialog--foot",{style:["height: 30px","line-height: 30px","padding-left: 10px","padding-right: 10px","position: absolute","bottom: 0","left: 0","right: 0"].join(";")}),this.headTitle=ig("span","cherry-dialog--title",{style:"user-select:none;"}),this.headCloseButton=ig("i","cherry-dialog--close ch-icon ch-icon-close",{style:"float: right;font-size: 12px;cursor: pointer;"}),this.footSureButton=ig("button","cherry-dialog--sure",{style:["float: right","cursor: pointer","margin: 3px","background-color: #4d90fe","color: #FFF","border: 1px solid #4d90fe","border-radius: 2px","padding: 2px 15px","user-select:none"].join(";")}),this.headCloseButton.title="关闭",this.footSureButton.textContent="确定",this.headTitle.textContent=l,this.head.appendChild(this.headTitle),this.head.appendChild(this.headCloseButton),this.foot.appendChild(this.footSureButton),this.body.appendChild(this.iframeDom),this.dom.appendChild(this.head),this.dom.appendChild(this.body),this.dom.appendChild(this.foot),this.bindEvents(),document.body.appendChild(this.dom)}};function _as(){if(CJt)return yJt;CJt=1;var e=function(){if(wJt)return JEe;wJt=1;var n=/\s/;return JEe=function(o){for(var s=o.length;s--&&n.test(o.charAt(s)););return s},JEe}(),t=/^\s+/;return yJt=function(r){return r&&r.slice(0,e(r)+1).replace(t,"")}}var DJt,QJt,BJt,FJt,PJt,MJt,RJt,IJt,NJt,$as=function(){if(SJt)return _Ee;SJt=1;var e=qy(),t=function(){if(OJt)return bJt;OJt=1;var s=rO();return bJt=function(){return s.Date.now()}}(),n=function(){if(LJt)return xJt;LJt=1;var s=_as(),a=qy(),l=uZn(),d=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,h=/^0o[0-7]+$/i,f=parseInt;return xJt=function(k){if(typeof k=="number")return k;if(l(k))return NaN;if(a(k)){var A=typeof k.valueOf=="function"?k.valueOf():k;k=a(A)?A+"":A}if(typeof k!="string")return k===0?k:+k;k=s(k);var m=u.test(k);return m||h.test(k)?f(k.slice(2),m?2:8):d.test(k)?NaN:+k}}(),r=Math.max,o=Math.min;return _Ee=function(a,l,d){var u,h,f,g,k,A,m=0,v=!1,p=!1,b=!0;if(typeof a!="function")throw new TypeError("Expected a function");function O(L){var S=u,E=h;return u=h=void 0,m=L,g=a.apply(E,S)}function w(L){var S=L-A;return A===void 0||S>=l||S<0||p&&L-m>=f}function y(){var L=t();if(w(L))return C(L);k=setTimeout(y,function(S){var E=l-(S-A);return p?o(E,f-(S-m)):E}(L))}function C(L){return k=void 0,b&&u?O(L):(u=h=void 0,g)}function x(){var L=t(),S=w(L);if(u=arguments,h=this,A=L,S){if(k===void 0)return function(E){return m=E,k=setTimeout(y,l),v?O(E):g}(A);if(p)return clearTimeout(k),k=setTimeout(y,l),O(A)}return k===void 0&&(k=setTimeout(y,l)),g}return l=n(l)||0,e(d)&&(v=!!d.leading,f=(p="maxWait"in d)?r(n(d.maxWait)||0,l):f,b="trailing"in d?!!d.trailing:b),x.cancel=function(){k!==void 0&&clearTimeout(k),m=0,u=A=h=k=void 0},x.flush=function(){return k===void 0?g:C(t())},x},_Ee}(),els=ji($as),tls={};function nls(){return BJt?QJt:(BJt=1,function(){if(DJt)return tls;DJt=1;var e=ai(),t=W6().find,n=zre(),r="find",o=!0;r in[]&&Array(1)[r](function(){o=!1}),e({target:"Array",proto:!0,forced:o},{find:function(a){return t(this,a,arguments.length>1?arguments[1]:void 0)}}),n(r)}(),QJt=Jc()("Array","find"))}function ils(){if(PJt)return FJt;PJt=1;var e=wl(),t=nls(),n=Array.prototype;return FJt=function(o){var s=o.find;return o===n||e(n,o)&&s===n.find?t:s}}function rls(){return RJt?MJt:(RJt=1,MJt=ils())}var UJt,jJt,WJt,HJt,ols=ji(NJt?IJt:(NJt=1,IJt=rls())),sls=function(){return Dr(function e(t,n,r,o,s){Er(this,e),ei(this,"bubbleContainer",null),this.trigger=t,this.target=n,this.container=r,this.previewerDom=o,this.$cherry=s},[{key:"emit",value:function(t,n){switch(t){case"remove":case"scroll":return this.remove()}}},{key:"drawBubble",value:function(){var t,n,r=document.createElement("div");r.innerHTML=`
    `,r.id="formula-utils-bubble-container",r.className=["formula-utils-bubble-container"].join(" "),this.bubbleContainer=r,(t=this.$cherry)===null||t===void 0||(n=t.wrapperDom)===null||n===void 0||n.appendChild(r)}},{key:"showBubble",value:function(t,n){var r,o,s,a,l=(r=this.$cherry)===null||r===void 0||(o=r.wrapperDom)===null||o===void 0||(s=o.children)===null||s===void 0?void 0:s.namedItem("formula-utils-bubble-container"),d=this.target.getBoundingClientRect();l instanceof HTMLElement?this.bubbleContainer=l:this.drawBubble(),this.bubbleContainer.style.display="flex",this.bubbleContainer.style.top="".concat(n||d.top,"px"),this.bubbleContainer.style.left="".concat(t||d.left,"px"),this.bubbleContainer.addEventListener("click",_l(a=this.bubbleClickHandler).call(a,this),{once:!0})}},{key:"getLatexFromDOM",value:function(){var t,n,r=this.target.parentElement;if(!r)return null;for(var o=r;o&&((s=o.dataset)===null||s===void 0||!s.content);){var s;o=o.parentElement}if((t=o)!==null&&t!==void 0&&(n=t.dataset)!==null&&n!==void 0&&n.content)try{return decodeURI(o.dataset.content)}catch{return o.dataset.content}return null}},{key:"remove",value:function(){this.bubbleContainer&&(this.bubbleContainer.style.display="none")}},{key:"bubbleClickHandler",value:function(t){t.preventDefault(),t.stopPropagation();var n=t.target;if(n instanceof HTMLButtonElement){var r=n.dataset.name,o=r===void 0?"":r;switch(o){case"svg":case"png":case"jpg":this.target instanceof SVGSVGElement&&Las(this.target,{format:o});break;case"html":case"svgcode":if(this.target instanceof SVGSVGElement)if(o==="svgcode")iS(wke(this.target));else{var s=this.target.parentElement.querySelector("math");s.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),iS(void 0,s.outerHTML)}break;case"\\":case"$":case"$$":case"latex":case"mathml":case"docx":var a=this.getLatexFromDOM();if(a)if(o==="mathml"||o==="docx"){var l,d,u,h,f,g,k,A=(l=this.$cherry)===null||l===void 0||(d=l.engine)===null||d===void 0||(u=d.hooks)===null||u===void 0||(h=u.paragraph)===null||h===void 0?void 0:ols(h).call(h,function(O){return O instanceof tst});A&&A.engine==="MathJax"&&((f=window.MathJax)===null||f===void 0||f.texReset(),(g=window.MathJax)===null||g===void 0||(k=g.tex2mmlPromise)===null||k===void 0||k.call(g,a,{display:!0}).then(function(O){o==="mathml"&&iS(O)}))}else if(o==="latex")iS(a);else if(o==="$"){var m,v;iS(nt(m=nt(v="".concat(o)).call(v,a)).call(m,o))}else if(o==="$$"){var p,b;iS(nt(p=nt(b="".concat(o,` `)).call(b,a,` `)).call(p,o))}else o==="\\"&&iS("\\".concat(a))}}this.remove()}}])}(),als=function(){return Dr(function e(t,n,r,o,s){var a,l;Er(this,e),ei(this,"bubbleContainer",null),ei(this,"regList",lis),ei(this,"range",[]),ei(this,"position",{line:0,ch:0}),ei(this,"input",!1),ei(this,"isCheckbox",!1),this.trigger=t,this.target=n,this.container=r,this.previewerDom=o,this.editor=s,this.editor&&this.editor.editor?(this.insertLineBreak=!1,this.handleEditablesInputBinded=_l(a=this.handleEditablesInput).call(a,this),this.handleEditablesUnfocusBinded=_l(l=this.handleEditablesUnfocus).call(l,this),this.target.addEventListener("input",this.handleEditablesInputBinded,!1),this.target.addEventListener("focusout",this.handleEditablesUnfocusBinded,!1),this.setSelection()):console.warn("ListHandler: editor is not available, list editing is disabled")},[{key:"emit",value:function(t,n){if(t==="remove")return this.remove()}},{key:"remove",value:function(){if(this.editor&&this.editor.editor){this.bubbleContainer&&(this.bubbleContainer.style.display="none",this.bubbleContainer.children[0]instanceof HTMLTextAreaElement&&(this.bubbleContainer.children[0].value="")),this.target.removeAttribute("contenteditable"),this.target.removeEventListener("input",this.handleEditablesInputBinded,!1),this.target.removeEventListener("focusout",this.handleEditablesUnfocusBinded,!1);var t=this.editor.editor.getCursor();this.editor.editor.setSelection(t,t)}else this.target.removeAttribute("contenteditable")}},{key:"setSelection",value:function(){var t,n,r,o=this;if(this.editor&&this.editor.editor){var s=Xl(this.previewerDom.querySelectorAll("li.cherry-list-item")),a=fke(s).call(s,function(C){return C===o.target.parentElement});if(a!==-1){for(var l=(t=(n=tAe(this==null?void 0:this.editor.editor.getValue()))===null||n===void 0?void 0:n.split(` `))!==null&&t!==void 0?t:[],d=0,u=-1,h=-1,f=[],g=0;g0)break;var m=hg(A,5),v=m[1],p=m[2],b=m[3],O=m[4];d===a&&v!==void 0&&(u=g,f.push(O),h=Ys(k).call(k,O),p!=null&&vke(p).call(p,".")&&(h+=1),b&&(this.isCheckbox=!0)),d+=1}else f.length>0&&f.push(k)}var w={line:u,ch:h},y={line:u+f.length-1,ch:h+((r=f[f.length-1])===null||r===void 0?void 0:r.length)};this.editor.editor.setSelection(w,y),this.range=[w,y],this.position=this.editor.editor.getCursor()}}}},{key:"handleEditablesInput",value:function(t){this.input=!0,t.stopPropagation(),t.preventDefault(),t.target instanceof HTMLParagraphElement&&(t.inputType!=="insertParagraph"&&t.inputType!=="insertLineBreak"||(this.insertLineBreak=!0,this.handleInsertLineBreak(t)))}},{key:"handleEditablesUnfocus",value:function(t){if(t.stopPropagation(),t.preventDefault(),t.target instanceof HTMLParagraphElement){if(this.input){if(!this.insertLineBreak){var n=this.isCheckbox?t.target.innerHTML.replace(/<\/span>/,""):t.target.innerHTML,r=this.editor.$cherry.engine.makeMarkdown(n),o=hg(this.range,2),s=o[0],a=o[1];this.editor.editor.replaceRange(r,s,a)}this.isCheckbox=!1,this.input=!1,this.insertLineBreak=!1}this.remove()}}},{key:"handleInsertLineBreak",value:function(t){var n,r,o,s=[];"innerText"in t.target&&typeof t.target.innerText=="string"&&(s=t.target.innerText.split(` `));var a,l,d=est(s),u=d[0],h=ba(d).call(d,1),f=this.editor.editor.getCursor(),g=this.editor.editor.getLine(f.line),k=this.regList.exec(g),A=` - `;k!==null&&(A=nt(a=` `.concat(k[1])).call(a,(l=k[2])===null||l===void 0?void 0:l.replace("[x]","[ ] "))),A+=(n=h==null?void 0:h.join(""))!==null&&n!==void 0?n:"",this.editor.editor.replaceRange(u,{line:f.line,ch:(r=(o=k[2])===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:0},{line:f.line,ch:g.length}),this.editor.editor.replaceRange(A,{line:f.line,ch:g.length}),this.editor.editor.setCursor({line:f.line+1,ch:A.length+1}),this.editor.editor.focus(),this.remove()}}])}(),lls=function(){return Dr(function e(t){Er(this,e),this.previewer=t,this.editor=t.editor,this.previewerDom=this.previewer.getDom(),this.$cherry=t.$cherry,this.bubble={},this.bubbleHandler={},this.init()},[{key:"init",value:function(){var t,n,r,o=this;this.oldWrapperDomOverflow=this.previewer.$cherry.wrapperDom.style.overflow,this.previewerDom.addEventListener("click",_l(t=this.$onClick).call(t,this)),this.previewerDom.addEventListener("mouseover",_l(n=this.$onMouseOver).call(n,this)),document.addEventListener("mousedown",function(s){var a;vi(a=Z7(o.bubbleHandler)).call(a,function(l){return l.emit("mousedown",s)})}),document.addEventListener("mouseup",function(s){var a;vi(a=Z7(o.bubbleHandler)).call(a,function(l){return l.emit("mouseup",s,function(){return o.$removeAllPreviewerBubbles("click")})})}),document.addEventListener("mousemove",function(s){var a;vi(a=Z7(o.bubbleHandler)).call(a,function(l){return l.emit("mousemove",s)})}),document.addEventListener("keyup",function(s){var a;vi(a=Z7(o.bubbleHandler)).call(a,function(l){return l.emit("keyup",s)})}),this.$cherry.$event.on("editor.size.change",function(){var s;vi(s=Z7(o.bubbleHandler)).call(s,function(a){return a.emit("resize",{})})}),this.previewerDom.addEventListener("scroll",function(s){var a;vi(a=Z7(o.bubbleHandler)).call(a,function(l){return l.emit("scroll",s)})},!0),this.$cherry.$event.on("previewerClose",function(){return o.$removeAllPreviewerBubbles()}),this.previewer.options.afterUpdateCallBack.push(function(){var s;o.$checkAndRecreateTableHandlers(),vi(s=Z7(o.bubbleHandler)).call(s,function(a){return a.emit("previewUpdate",function(){return o.$removeAllPreviewerBubbles()})})}),this.previewerDom.addEventListener("change",_l(r=this.$onChange).call(r,this)),this.removeHoverBubble=els(function(){return o.$removeAllPreviewerBubbles("hover")},400)}},{key:"isCherryCodeBlock",value:function(t){if(Element.prototype.closest||(Element.prototype.closest=function(r){for(var o=this;o;){if(o.matches(r))return o;o=o.parentElement}return null}),this.$getClosestNode(t,"BLOCKQUOTE")!==!1)return!1;var n=t.closest('div[data-type="codeBlock"]');return n||!1}},{key:"isCherryTable",value:function(t){var n=this.$getClosestNode(t,"TABLE");if(!n)return!1;var r=this.$getClosestNode(t,"DIV");return(!r||!/simple-table/.test(r.className))&&n}},{key:"$hasEditor",value:function(){return!(!this.editor||!this.editor.editor)}},{key:"$isEnableBubbleAndEditorShow",value:function(){return!!this.previewer.options.enablePreviewerBubble&&!!this.$hasEditor()&&this.previewer.$cherry.getStatus().editor!=="hide"}},{key:"$onMouseOver",value:function(t){var n,r,o,s,a,l,d=t.target;if(d instanceof Element&&d.tagName!==void 0){switch(d.tagName){case"TD":case"TH":if(!this.$isEnableBubbleAndEditorShow())return;var u=this.isCherryTable(t.target);return u===!1?void 0:(this.removeHoverBubble.cancel(),this.$removeAllPreviewerBubbles("hover"),void this.$showTablePreviewerBubbles("hover",t.target,u));case"PRE":case"CODE":case"SPAN":case"DIV":var h=this.isCherryCodeBlock(t.target);return h===!1?void 0:void this.showCodeBlockPreviewerBubbles("hover",h);case"A":var f=((n=this.previewer)===null||n===void 0||(r=n.$cherry)===null||r===void 0||(o=r.options)===null||o===void 0||(s=o.engine)===null||s===void 0||(a=s.syntax)===null||a===void 0||(l=a.footnote)===null||l===void 0?void 0:l.bubbleCard)||!1;if(f!==!1&&/cherry-show-bubble-card/.test(t.target.className))return this.removeHoverBubble.cancel(),this.$removeAllPreviewerBubbles("hover"),void this.$showFootNoteBubbleCardPreviewerBubbles("hover",t.target,f)}this.removeHoverBubble()}}},{key:"$onMouseOut",value:function(){this.previewer.options.enablePreviewerBubble&&this.previewer.$cherry.getStatus().editor}},{key:"$dealCheckboxClick",value:function(t){var n=this;if(this.$hasEditor()){var r=t.target,o=Xl(this.previewerDom.querySelectorAll(".ch-icon-square, .ch-icon-check"));this.checkboxIdx=Ys(o).call(o,r);var s=tAe(this.editor.editor.getValue()).split(` `),a=0,l=-1,d=-1;vi(s).call(s,function(u,h){var f=Gi(u).call(u);/^-\s+\[[ x]\]/i.test(f)&&(a===n.checkboxIdx&&(l=h,d=Ys(u).call(u,"[")+1),a+=1)}),l!==-1&&(this.editor.editor.setSelection({line:l,ch:d},{line:l,ch:d+1}),this.editor.editor.replaceSelection(this.editor.editor.getSelection()===" "?"x":" ","around"))}}},{key:"$onClick",value:function(t){var n,r,o,s,a=this;if(((n=this.previewer.$cherry.options.callback)===null||n===void 0||(r=n.onClickPreview)===null||r===void 0?void 0:r.call(n,t))===!1)return!1;var l=t.target;if(l instanceof Element)if(l instanceof HTMLImageElement&&l.tagName==="IMG"&&l.getAttribute("data-type")==="drawio"&&this.$cherry.status.editor==="show"&&this.$hasEditor()){if(!this.beginChangeDrawioImg(l))return;var d=decodeURI(l.getAttribute("data-xml"));(function(){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,B={iframeSrc:arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",iframeStyle:arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",title:"draw.io"};EJt.draw(B,function(){EJt.postMessage("setData",T)},function(P){M(P)})})(this.previewer.$cherry.options.drawioIframeUrl,this.previewer.$cherry.options.drawioIframeStyle,d,function(T){var M,B=T.xmlData,P=T.base64;a.editor.editor.replaceSelection(nt(M="(".concat(P,"){data-type=drawio data-xml=")).call(M,encodeURI(B),"}"),"around")})}else{if(l.className==="expand-btn "||l.className==="ch-icon ch-icon-expand"){var u,h,f=this.$getClosestNode(l,"DIV");if(f.parentNode.parentNode.classList.remove("cherry-code-unExpand"),f.parentNode.parentNode.classList.add("cherry-code-expand"),this.$cherry.options.callback.onExpandCode){var g=f.parentNode.parentNode.innerText;this.$cherry.options.callback.onUnExpandCode(t,g)}(u=this.bubbleHandler)!==null&&u!==void 0&&(h=u.hover)!==null&&h!==void 0&&h.unExpandDom&&this.bubbleHandler.hover.unExpandDom.classList.remove("hidden")}if(l.tagName==="A"){if(((o=this.previewer.$cherry.options.toolbars.toc)===null||o===void 0?void 0:o.updateLocationHash)===!1&&l instanceof Element&&l.nodeName==="A"&&/level-\d+/.test(l.className)){var k,A=l.parentElement,m=Ys(k=Xl(A.parentElement.children)).call(k,A)-1;this.previewer.scrollToHeadByIndex(m),t.stopPropagation(),t.preventDefault()}if(l instanceof Element&&l.nodeName==="A"&&/(footnote|footnote-ref)/.test(l.className)){var v,p,b,O,w;if(l.classList.contains("footnote")&&(v=this.previewer.$cherry.options.engine)!==null&&v!==void 0&&(p=v.syntax)!==null&&p!==void 0&&(b=p.footnote)!==null&&b!==void 0&&(O=b.refNumber)!==null&&O!==void 0&&O.clickRefNumberCallback){var y,C=l.getAttribute("data-index"),x=l.getAttribute("data-key"),L=(y=this.previewer.getDomContainer().querySelector('.one-footnote[data-index="'.concat(C,'"]')).innerHTML)!==null&&y!==void 0?y:"",S=this.previewer.$cherry.options.engine.syntax.footnote.refNumber.clickRefNumberCallback(t,C,x,L);if(S===!1)return t.stopPropagation(),t.preventDefault(),S}if(((w=this.previewer.$cherry.options.toolbars.toc)===null||w===void 0?void 0:w.updateLocationHash)===!1){var E=l.getAttribute("href");this.previewer.scrollToId(E),t.stopPropagation(),t.preventDefault()}}}if(l.tagName==="svg"&&(l==null||(s=l.parentElement)===null||s===void 0?void 0:s.tagName)==="MJX-CONTAINER"&&this.$showFormulaPreviewerBubbles("click",l,{x:t.pageX,y:t.pageY}),this.$isEnableBubbleAndEditorShow()&&(l.className!=="ch-icon ch-icon-square"&&l.className!=="ch-icon ch-icon-check"||this.$dealCheckboxClick(t),this.$removeAllPreviewerBubbles("click"),l.tagName!==void 0))switch(l.tagName){case"IMG":l instanceof HTMLImageElement&&this.$showImgPreviewerBubbles(l,t);break;case"TD":case"TH":if(l instanceof HTMLElement){var Q=this.isCherryTable(l);if(Q===!1)return;this.$showTablePreviewerBubbles("click",l,Q)}break;case"P":l instanceof HTMLParagraphElement&&l.parentElement instanceof HTMLLIElement&&this.$getClosestNode(l,"BLOCKQUOTE")===!1&&(l.children.length!==0&&(t.preventDefault(),t.stopPropagation()),l.setAttribute("contenteditable","true"),l.focus(),this.$showListPreviewerBubbles("click",l))}}}},{key:"$onChange",value:function(t){}},{key:"$getClosestNode",value:function(t,n){return!(!t||!t.tagName)&&(t.tagName===n?t:t.parentNode.tagName!=="BODY"&&this.$getClosestNode(t.parentNode,n))}},{key:"$removeAllPreviewerBubbles",value:function(){var t,n,r,o,s=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";vi(t=Sd(n=qEe(this.bubble)).call(n,function(l){var d=hg(l,1)[0];return!a||a===d})).call(t,function(l){var d=hg(l,2),u=d[0];d[1].remove(),delete s.bubble[u]}),vi(r=Sd(o=qEe(this.bubbleHandler)).call(o,function(l){var d=hg(l,1)[0];return!a||a===d})).call(r,function(l){var d=hg(l,2),u=d[0];d[1].emit("remove"),delete s.bubbleHandler[u]}),ol(this.bubbleHandler).length<=0&&(this.previewer.$cherry.wrapperDom.style.overflow=this.oldWrapperDomOverflow||"")}},{key:"$checkAndRecreateTableHandlers",value:function(){var t,n=this;vi(t=qEe(this.bubbleHandler)).call(t,function(r){var o=hg(r,2),s=o[0],a=o[1];a instanceof pJt&&(n.$isTableHandlerValid(a)||n.$removePreviewerBubble(s))})}},{key:"$isTableHandlerValid",value:function(t){var n;if(!t.target||!document.contains(t.target))return!1;var r=t.$getClosestNode(t.target,"TABLE");return r!==!1&&!!this.previewerDom.contains(r)&&!(!r.textContent||Gi(n=r.textContent).call(n)==="")}},{key:"$removePreviewerBubble",value:function(t){this.bubble[t]&&(this.bubble[t].remove(),delete this.bubble[t]),this.bubbleHandler[t]&&(this.bubbleHandler[t].emit("remove"),delete this.bubbleHandler[t]),ol(this.bubbleHandler).length<=0&&(this.previewer.$cherry.wrapperDom.style.overflow=this.oldWrapperDomOverflow||"")}},{key:"$showFootNoteBubbleCardPreviewerBubbles",value:function(t,n,r){var o,s;if(this.bubbleHandler[t]&&((s=this.bubbleHandler[t])===null||s===void 0?void 0:s.aElement)===n)return void this.bubbleHandler[t].showBubble();this.$createPreviewerBubbles(t,"footnote-ref-hover-handler cherry-markdown ".concat((o=r.appendClass)!==null&&o!==void 0?o:""));var a=new Gas(t,n,this.bubble[t],this.previewer.$cherry,r);a.showBubble(),this.bubbleHandler[t]=a}},{key:"$showTablePreviewerBubbles",value:function(t,n,r){if(this.$hasEditor())if(this.bubbleHandler[t]&&this.bubbleHandler[t].tableElement===r)this.bubbleHandler[t].showBubble();else{this.$createPreviewerBubbles(t,t==="click"?"table-content-handler":"table-hover-handler");var o=new pJt(t,n,this.bubble[t],this.previewerDom,this.editor.editor,r,this.previewer.$cherry);o.showBubble(),this.bubbleHandler[t]=o}}},{key:"showCodeBlockPreviewerBubbles",value:function(t,n){var r,o;if(this.bubbleHandler[t]&&this.bubbleHandler[t].target===n)this.removeHoverBubble.cancel();else{this.$removeAllPreviewerBubbles("hover"),this.$createPreviewerBubbles(t,"codeBlock-".concat(t,"-handler"));var s=new Jas(t,n,this.bubble[t],this.previewerDom,(r=(o=this.editor)===null||o===void 0?void 0:o.editor)!==null&&r!==void 0?r:null,this);s.showBubble(this.$isEnableBubbleAndEditorShow()),this.bubbleHandler[t]=s}}},{key:"$showImgPreviewerBubbles",value:function(t,n){var r,o,s,a=this;if(this.$hasEditor()){this.$createPreviewerBubbles("click","img-handler");var l=Xl(this.previewerDom.querySelectorAll("img"));if(this.totalImgs=l.length,this.imgIndex=Ys(l).call(l,t),!this.beginChangeImgValue(t))return{emit:function(){}};var d=document.createElement("div");d.className="cherry-previewer-img-size-handler",this.bubble.click.appendChild(d),K3.showBubble(t,d,this.previewerDom),K3.bindChange(_l(r=this.changeImgSize).call(r,this));var u=document.createElement("div");u.className="cherry-previewer-img-tool-handler",this.bubble.click.appendChild(u),GEe.showBubble(t,u,this.previewerDom,n,this.previewer.$cherry.getLocales()),GEe.bindChange(_l(o=this.changeImgStyle).call(o,this));var h=_l(s=K3.updatePosition).call(s,K3);this.$cherry.$event.on("editor.size.change",h);var f=K3.remove;K3.remove=function(){return a.$cherry.$event.off("editor.size.change",h),f.call(K3)},this.bubbleHandler.click=K3,this.bubbleHandler.imgTool=GEe}}},{key:"$showFormulaPreviewerBubbles",value:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.$createPreviewerBubbles(t,"formula-hover-handler");var o=new sls(t,n,this.bubble[t],this.previewerDom,this.$cherry);o.showBubble((r==null?void 0:r.x)||0,(r==null?void 0:r.y)||0),this.bubbleHandler[t]=o}},{key:"$showListPreviewerBubbles",value:function(t,n){if(this.$hasEditor()){this.$createPreviewerBubbles(t,"list-hover-handler");var r=new als(t,n,this.bubble[t],this.previewerDom,this.editor);this.bubbleHandler[t]=r}}},{key:"beginChangeDrawioImg",value:function(t){var n,r=Xl(this.previewerDom.querySelectorAll('img[data-type="drawio"]')),o=r.length,s=Ys(r).call(r,t),a=tAe(this.editor.editor.getValue()),l=a.match(wWt),d=l[s]?Gi(n=l[s].replace(/^!\[.*?\]\((.*?)\)/,"$1")).call(n):"";if(l.length===o||t.getAttribute("src")===d)for(var u=a.split(wWt),h=0,f=0,g=0,k=0,A=0;A0&&arguments[0]!==void 0?arguments[0]:"click",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"img-size-handler";this.bubble[t]||(this.bubble[t]=document.createElement("div"),this.bubble[t].className="cherry-previewer-".concat(n),this.previewerDom.after(this.bubble[t]),t==="hover"&&(this.bubble[t].addEventListener("mouseover",this.removeHoverBubble.cancel),this.bubble[t].addEventListener("mouseout",this.removeHoverBubble)),this.previewer.$cherry.wrapperDom.style.overflow="hidden")}},{key:"$showBorderBubbles",value:function(){}},{key:"$showBtnBubbles",value:function(){}}])}();function cls(){return jJt?UJt:(jJt=1,DHn(),UJt=Ol().setInterval)}var VJt,zJt,ZJt,YJt,XJt,qJt,GJt,KJt,JJt,_Jt,$Jt,e_t,t_t,n_t,i_t,r_t,o_t,s_t,a_t,l_t,$Ee,c_t,d_t,u_t,h_t,A_t,f_t,g_t,m_t,k_t,v_t,p_t,b_t,O_t,w_t,y_t,C_t,x_t,L_t,S_t,T_t,E_t,D_t,Q_t,B_t,F_t,P_t,M_t,e7e,R_t,I_t,N_t,U_t,j_t,W_t,H_t,V_t,z_t,Z_t,Y_t,t7e,X_t,q_t,G_t,dls=ji(HJt?WJt:(HJt=1,WJt=cls())),K_t=function(){return Dr(function e(t,n){Er(this,e),ei(this,"options",{loadingImgPath:"",maxNumPerTime:2,noLoadImgNum:5,autoLoadImgNum:5,maxTryTimesPerSrc:2,beforeLoadOneImgCallback:function(o){},failLoadOneImgCallback:function(o){},afterLoadOneImgCallback:function(o){},afterLoadAllImgCallback:function(){}}),NB(this.options,t),this.previewer=n,this.srcLoadedList=[],this.srcFailLoadedList={},this.srcLoadingList=[],this.srcList=[],this.loadingImgNum=0,this.lastLoadAllNum=0,this.previewerDom=this.previewer.getDomContainer()},[{key:"isLoaded",value:function(t){var n;return Dv(n=this.srcLoadedList).call(n,t)}},{key:"isLoading",value:function(t){var n;return Dv(n=this.srcLoadingList).call(n,t)}},{key:"loadFailed",value:function(t){this.srcFailLoadedList[t]=this.srcFailLoadedList[t]?this.srcFailLoadedList[t]+1:1}},{key:"isFailLoadedMax",value:function(t){return this.srcFailLoadedList[t]&&this.srcFailLoadedList[t]>this.options.maxTryTimesPerSrc}},{key:"isLoadedAllDone",value:function(){var t=this.previewerDom.querySelectorAll("img[data-src]"),n=this.srcLoadedList.length;return t.length<=0&&this.lastLoadAllNum=g&&b.top<=f,w=o.srcList.length=o.options.maxNumPerTime)return{v:!1};var C,x=o.options.beforeLoadOneImgCallback(p);if(x!==void 0&&!x)return o.loadFailed(y),0;y=(C=p.getAttribute("data-src"))!==null&&C!==void 0?C:y,o.loadingImgNum+=1,o.srcList.push(y),o.srcLoadingList.push(y),o.tryLoadOneImg(y,function(){var L,S;p.setAttribute("src",y),p.removeAttribute("data-src"),o.srcLoadedList.push(y),o.loadingImgNum-=1,Ov(L=o.srcLoadingList).call(L,Ys(S=o.srcLoadingList).call(S,y),1),o.options.afterLoadOneImgCallback(p),o.loadOneImg()},function(){var L,S;o.loadFailed(y),o.loadingImgNum-=1,Ov(L=o.srcLoadingList).call(L,Ys(S=o.srcLoadingList).call(S,y),1),o.options.failLoadOneImgCallback(p),o.loadOneImg()})},m=0;m]*?)data-src="([^"]+)"([^>]*?)>/g,function(r,o,s,a){var l,d;return nt(l=nt(d="").replace(/ {2,}/g," ")})}},{key:"changeLoadedDataSrc2Src",value:function(t){var n=this;return t.replace(/]*?)data-src="([^"]+)"([^>]*?)>/g,function(r,o,s,a){var l,d;return n.isLoaded(s)?nt(l=nt(d="").replace(/ {2,}/g," "):r})}},{key:"$removeSrc",value:function(t){return" ".concat(t).replace(/^(.*?) src=".*?"(.*?$)/,"$1$2")}},{key:"changeSrc2DataSrc",value:function(t){var n=this,r=arguments.length>1&&arguments[1]!==void 0&&arguments[1],o=this.options.loadingImgPath,s=this.options.noLoadImgNum,a=0;return t.replace(/]*?)src="([^"]+)"([^>]*?)>/g,function(l,d,u,h){var f,g,k,A,m;if(/data-src="/.test(l)||!/ src="/.test(l)||s<0)return l;if(r===!1){if(a"):nt(f=nt(g="")})}}])}(),n7e=function(){},uls=function(){return Dr(function e(t){Er(this,e),ei(this,"applyingDomChanges",!1),ei(this,"syncScrollLockTimer",0),ei(this,"isMobilePreview",!1),this.options={previewerDom:document.createElement("div"),virtualDragLineDom:document.createElement("div"),editorMaskDom:document.createElement("div"),previewerMaskDom:document.createElement("div"),minBlockPercentage:.2,value:"",enablePreviewerBubble:!0,floatWhenClosePreviewer:!1,afterUpdateCallBack:[],isPreviewOnly:!1,previewerCache:{html:"",htmlChanged:!1,layout:{}},lazyLoadImg:{loadingImgPath:"",maxNumPerTime:2,noLoadImgNum:5,autoLoadImgNum:5,maxTryTimesPerSrc:2,beforeLoadOneImgCallback:function(r){},failLoadOneImgCallback:function(r){},afterLoadOneImgCallback:function(r){},afterLoadAllImgCallback:function(){}}},NB(this.options,t),this.$cherry=this.options.$cherry,this.instanceId=this.$cherry.getInstanceId(),this.animation={}},[{key:"init",value:function(t){this.disableScrollListener=!1,this.bindScroll(),this.editor=t,this.bindDrag(),this.$initPreviewerBubble(),this.lazyLoadImg=new K_t(this.options.lazyLoadImg,this),this.lazyLoadImg.doLazyLoad(),this.bindClick(),this.onMouseDown(),this.onSizeChange(),this.$cherry.options.previewer.isMobilePreview&&this.changePreviewToMobile(!0)}},{key:"initWithoutEditor",value:function(){this.disableScrollListener=!1,this.editor=null,this.$initPreviewerBubble(),this.lazyLoadImg=new K_t(this.options.lazyLoadImg,this),this.lazyLoadImg.doLazyLoad(),this.bindClick(),this.onMouseDown(),this.$cherry.options.previewer.isMobilePreview&&this.changePreviewToMobile(!0)}},{key:"onSizeChange",value:function(){var t=this;new ResizeObserver(function(){t.syncVirtualLayoutFromReal(),t.subMenusPositionChange(),t.$cherry.$event.emit("editor.size.change")}).observe(this.$cherry.wrapperDom)}},{key:"subMenusPositionChange",value:function(){var t,n=this;vi(t=["toolbar","sidebar","toolbarRight"]).call(t,function(r){n.$cherry[r]&&n.$cherry[r].updateSubMenuPosition()})}},{key:"$initPreviewerBubble",value:function(){this.previewerBubble=new lls(this)}},{key:"getDomContainer",value:function(){return this.isMobilePreview?this.options.previewerDom.querySelector(".cherry-mobile-previewer-content"):this.options.previewerDom}},{key:"getDom",value:function(){return this.options.previewerDom}},{key:"getValue",value:function(){var t,n,r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],o="";if(o=this.isPreviewerHidden()?this.options.previewerCache.html:this.getDomContainer().innerHTML,o=this.lazyLoadImg.changeDataSrc2Src(o),!r||!this.$cherry.wrapperDom)return o;var s=this.$cherry.wrapperDom.getAttribute("data-inline-code-theme"),a=this.$cherry.wrapperDom.getAttribute("data-code-block-theme");return nt(t=nt(n='
    ')).call(t,o,"
    ")}},{key:"isPreviewerHidden",value:function(){return this.options.previewerDom.classList.contains("cherry-previewer--hidden")}},{key:"isPreviewerFloat",value:function(){var t=this.$cherry.cherryDom.querySelector(".float-previewer-wrap");return this.$cherry.cherryDom.contains(t)}},{key:"isPreviewerNeedFloat",value:function(){return this.options.floatWhenClosePreviewer}},{key:"calculateRealLayout",value:function(t){var n,r,o,s,a=+(t/((((n=this.editor)===null||n===void 0||(r=n.options)===null||r===void 0||(o=r.editorDom)===null||o===void 0||(s=o.getBoundingClientRect())===null||s===void 0?void 0:s.width)||0)+this.options.previewerDom.getBoundingClientRect().width)).toFixed(3);a1-this.options.minBlockPercentage&&(a=+(1-this.options.minBlockPercentage).toFixed(3));var l=+(1-a).toFixed(3);return{editorPercentage:"".concat(100*a,"%"),previewerPercentage:"".concat(100*l,"%")}}},{key:"setRealLayout",value:function(t,n){var r,o,s=this,a=t,l=n;a&&l||(a="50%",l="50%"),(r=this.editor)!==null&&r!==void 0&&(o=r.options)!==null&&o!==void 0&&o.editorDom&&(this.editor.options.editorDom.style.width=a),this.options.previewerDom.style.width=l,Iu(function(){return s.syncVirtualLayoutFromReal()},0)}},{key:"syncVirtualLayoutFromReal",value:function(){var t,n;if((t=this.editor)!==null&&t!==void 0&&(n=t.options)!==null&&n!==void 0&&n.editorDom){var r=this.editor.options.editorDom.getBoundingClientRect(),o=this.options.previewerDom.getBoundingClientRect(),s=r.height,a=this.editor.options.editorDom.offsetTop,l=r.left,d=r.width,u=o.left?o.left-l:0,h=o.width||0,f=this.options,g=f.editorMaskDom,k=f.previewerMaskDom,A=f.virtualDragLineDom;this.$tryChangeValue(A,"top","".concat(a,"px")),this.$tryChangeValue(A,"left","".concat(u,"px")),this.$tryChangeValue(A,"bottom","0px"),this.$tryChangeValue(g,"height","".concat(s,"px")),this.$tryChangeValue(g,"top","".concat(a,"px")),this.$tryChangeValue(g,"left","0px"),this.$tryChangeValue(g,"width","".concat(d,"px")),this.$tryChangeValue(k,"height","".concat(s,"px")),this.$tryChangeValue(k,"top","".concat(a,"px")),this.$tryChangeValue(k,"left","".concat(u,"px")),this.$tryChangeValue(k,"width","".concat(h,"px"))}}},{key:"$tryChangeValue",value:function(t,n,r){t.style[n]!==r&&(t.style[n]=r)}},{key:"calculateVirtualLayout",value:function(t,n){var r,o,s,a,l=(((r=this.editor)===null||r===void 0||(o=r.options)===null||o===void 0||(s=o.editorDom)===null||s===void 0||(a=s.getBoundingClientRect())===null||a===void 0?void 0:a.width)||0)+this.options.previewerDom.getBoundingClientRect().width,d=t.toFixed(0),u=n-t;ul*(1-this.options.minBlockPercentage)&&(u=+(l*(1-this.options.minBlockPercentage)).toFixed(0));var h=l-u;return{startWidth:ry(d,10),leftWidth:u,rightWidth:h}}},{key:"setVirtualLayout",value:function(t,n,r){var o=this.options,s=o.editorMaskDom,a=o.previewerMaskDom,l=o.virtualDragLineDom;s.style.left="".concat(0,"px"),s.style.width="".concat(n,"px"),l.style.left="".concat(0+n,"px"),a.style.left="".concat(0+n,"px"),a.style.width="".concat(r,"px")}},{key:"bindDrag",value:function(){var t,n=this,r=function(a){var l,d,u,h;a&&a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,a.preventDefault?a.preventDefault():window.event.returnValue=!1;var f=((l=n.editor)===null||l===void 0||(d=l.options)===null||d===void 0||(u=d.editorDom)===null||u===void 0||(h=u.getBoundingClientRect())===null||h===void 0?void 0:h.left)||0,g=a.clientX,k=n.calculateVirtualLayout(f,g);return n.setVirtualLayout(k.startWidth,k.leftWidth,k.rightWidth),!1},o=function s(a){var l,d,u,h,f,g,k,A,m,v;a&&a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,a.preventDefault?a.preventDefault():window.event.returnValue=!1;var p=((l=n.editor)===null||l===void 0||(d=l.options)===null||d===void 0||(u=d.editorDom)===null||u===void 0||(h=u.getBoundingClientRect())===null||h===void 0?void 0:h.left)||0,b=a.clientX,O=n.calculateRealLayout(b-p);return n.options.previewerCache.layout=O,n.setRealLayout(O.editorPercentage,O.previewerPercentage),(f=n.editor)===null||f===void 0||(g=f.options)===null||g===void 0||(k=g.editorDom)===null||k===void 0||(A=k.classList)===null||A===void 0||A.remove("no-select"),n.options.previewerDom.classList.remove("no-select"),n.options.editorMaskDom.classList.remove("cherry-editor-mask--show"),n.options.previewerMaskDom.classList.remove("cherry-previewer-mask--show"),n.options.virtualDragLineDom.classList.remove("cherry-drag--show"),(m=n.editor)===null||m===void 0||(v=m.editor)===null||v===void 0||v.refresh(),YEe(document,"mousemove",r,!1),YEe(document,"mouseup",s,!1),!1};z7(this.options.virtualDragLineDom,"mousedown",function(s){var a,l,d,u;s&&s.stopPropagation?s.stopPropagation():s.cancelBubble=!0,s.preventDefault?s.preventDefault():window.event.returnValue=!1,n.syncVirtualLayoutFromReal();var h,f,g,k,A=((a=n.editor)===null||a===void 0||(l=a.options)===null||l===void 0||(d=l.editorDom)===null||d===void 0||(u=d.getBoundingClientRect())===null||u===void 0?void 0:u.left)||0,m=s.clientX,v=n.calculateVirtualLayout(A,m);return n.setVirtualLayout(v.startWidth,v.leftWidth,v.rightWidth),n.options.virtualDragLineDom.classList.contains("cherry-drag--show")||(n.options.virtualDragLineDom.classList.add("cherry-drag--show"),n.options.editorMaskDom.classList.add("cherry-editor-mask--show"),n.options.previewerMaskDom.classList.add("cherry-previewer-mask--show"),n.options.previewerDom.classList.add("no-select"),(h=n.editor)===null||h===void 0||(f=h.options)===null||f===void 0||(g=f.editorDom)===null||g===void 0||(k=g.classList)===null||k===void 0||k.add("no-select"),z7(document,"mousemove",r,!1),z7(document,"mouseup",o,!1)),!1},!1),z7(window,"resize",_l(t=this.syncVirtualLayoutFromReal).call(t,this),!1),this.setRealLayout()}},{key:"bindScroll",value:function(){var t=this,n=this.getDomContainer();n7e=function(){var o,s;if(!t.applyingDomChanges)if(t.disableScrollListener)t.disableScrollListener=!1;else if(n.scrollTop<=0)(s=t.editor)===null||s===void 0||s.scrollToLineNum(0,0,1);else if(n.scrollTop+n.offsetHeight+10>n.scrollHeight){var a;(a=t.editor)===null||a===void 0||a.scrollToLineNum(null)}else{for(var l,d,u=n.getBoundingClientRect(),h=0,f=n.children,g=0;g0)for(var a=0;a0&&(vi(t).call(t,function(s,a){var l;ba(l=s.sign).call(l,0,12)===ba(n).call(n,0,12)&&a>r&&(o={index:a>r?a:r,sign:n})}),o)}},{key:"$dealWithMyersDiffResult",value:function(t,n,r,o){var s=this;vi(t).call(t,function(a){switch(r[a.newIndex].dom&&(r[a.newIndex].dom.innerHTML=s.lazyLoadImg.changeLoadedDataSrc2Src(r[a.newIndex].dom.innerHTML)),a.type){case"delete":o.removeChild(n[a.oldIndex].dom);break;case"insert":n[a.oldIndex]?o.insertBefore(r[a.newIndex].dom,n[a.oldIndex].dom):o.appendChild(r[a.newIndex].dom);break;case"update":try{var l=!1;if(r[a.newIndex].dom.className==="cherry-table-container"&&r[a.newIndex].dom.querySelector(".cherry-table-figure")&&n[a.oldIndex].dom.querySelector(".cherry-table-figure"))n[a.oldIndex].dom.querySelector(".cherry-table-figure").replaceWith(r[a.newIndex].dom.querySelector(".cherry-table-figure")),n[a.oldIndex].dom.dataset.sign=r[a.oldIndex].dom.dataset.sign,s.$updateDom(r[a.newIndex].dom.querySelector(".cherry-table"),n[a.oldIndex].dom.querySelector(".cherry-table")),l=!0;else if(r[a.newIndex].dom.querySelector("svg"))throw new Error;l||s.$updateDom(r[a.newIndex].dom,n[a.oldIndex].dom)}catch{o.insertBefore(r[a.newIndex].dom,n[a.oldIndex].dom),o.removeChild(n[a.oldIndex].dom)}}})}},{key:"$dealUpdate",value:function(t,n,r){if(r.list!==n.list){if(r.list.length&&n.list.length){var o=new mas(r.list,n.list,function(d,u){return d[u].sign}),s=o.doDiff();this.$dealWithMyersDiffResult(s,n.list,r.list,t)}else if(r.list.length&&!n.list.length){var a;q1.log("add all"),vi(a=r.list).call(a,function(d){t.appendChild(d.dom)})}else if(!r.list.length&&n.list.length){var l;q1.log("delete all"),vi(l=n.list).call(l,function(d){t.removeChild(d.dom)})}}}},{key:"refresh",value:function(t){this.getDomContainer().innerHTML=t}},{key:"update",value:function(t){var n=this,r=this.lazyLoadImg.changeSrc2DataSrc(t);if(this.isPreviewerHidden())this.doHtmlCache(r);else{var o;window.clearTimeout(this.syncScrollLockTimer),this.applyingDomChanges=!0;var s=this.getDomContainer();(o=this.editor)!==null&&o!==void 0&&o.selectAll&&(s.innerHTML="");var a=null;window.DOMParser!==void 0?a=new DOMParser().parseFromString(r,"text/html").querySelector("body"):(a=document.createElement("div")).innerHTML=r;var l=this.$getSignData(a.children),d=this.$getSignData(s.children);try{this.$dealUpdate(s,d,l),this.afterUpdate()}finally{this.syncScrollLockTimer=Iu(function(){n.applyingDomChanges=!1},50)}}}},{key:"$dealEditAndPreviewOnly",value:function(){var t,n,r=this,o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.$removeModelClass(),this.options.virtualDragLineDom.classList.add("cherry-drag--hidden");var s,a,l,d,u,h,f,g,k=this.options.previewerDom,A=(t=this.editor)===null||t===void 0||(n=t.options)===null||n===void 0?void 0:n.editorDom;o?(k.classList.add("cherry-previewer--hidden"),A==null||(s=A.classList)===null||s===void 0||s.add("cherry-editor--full"),k.classList.remove("cherry-previewer--full"),A==null||(a=A.classList)===null||a===void 0||a.remove("cherry-editor--hidden")):(k.classList.add("cherry-previewer--full"),A==null||(l=A.classList)===null||l===void 0||l.add("cherry-editor--hidden"),k.classList.remove("cherry-previewer--hidden"),A==null||(d=A.classList)===null||d===void 0||d.remove("cherry-editor--full"),this.$cherry.options.engine.global.flowSessionContext&&!this.options.enablePreviewerBubble&&(A==null||A.remove(),(u=this.$cherry.toolbar)===null||u===void 0||(h=u.options)===null||h===void 0||(f=h.dom)===null||f===void 0||f.remove(),vi(g=this.$cherry.wrapperDom.querySelectorAll(".cherry-dropdown,.cherry-drag,.cherry-editor-mask,.cherry-previewer-mask,.cherry-suggester-panel")).call(g,function(v){return v.remove()})));var m={editorPercentage:"0%",previewerPercentage:"100%"};o&&(m={editorPercentage:"100%",previewerPercentage:"0%"}),this.setRealLayout(m.editorPercentage,m.previewerPercentage),Iu(function(){var v,p;return(v=r.editor)===null||v===void 0||(p=v.editor)===null||p===void 0?void 0:p.refresh()},0)}},{key:"previewOnly",value:function(){this.$dealEditAndPreviewOnly(!1),this.options.previewerCache.htmlChanged&&this.update(this.options.previewerCache.html),this.cleanHtmlCache(),this.$cherry.$event.emit("previewerOpen"),this.$cherry.$event.emit("editorClose")}},{key:"editOnly",value:function(){this.$dealEditAndPreviewOnly(!0),this.$cherry.$event.emit("previewerClose"),this.$cherry.$event.emit("editorOpen")}},{key:"floatPreviewer",value:function(){var t="100%",n="100%";this.setRealLayout(t,n),this.options.virtualDragLineDom.classList.add("cherry-drag--hidden"),this.$cherry.createFloatPreviewer()}},{key:"recoverFloatPreviewer",value:function(){this.editAndPreview(),this.$cherry.clearFloatPreviewer()}},{key:"recoverPreviewer",value:function(){this.editAndPreview()}},{key:"$removeModelClass",value:function(){var t,n,r,o;(t=this.editor)===null||t===void 0||(n=t.options)===null||n===void 0||(r=n.editorDom)===null||r===void 0||(o=r.classList)===null||o===void 0||o.remove("cherry-editor--hidden","cherry-editor--full"),this.options.previewerDom.classList.remove("cherry-previewer--hidden","cherry-preview--full"),this.options.virtualDragLineDom.classList.remove("cherry-drag--hidden")}},{key:"editAndPreview",value:function(){var t=this;this.$removeModelClass();var n=this.options.previewerCache.layout,r=n.editorPercentage,o=r===void 0?"50%":r,s=n.previewerPercentage,a=s===void 0?"50%":s;this.setRealLayout(o,a),this.options.previewerCache.htmlChanged&&this.update(this.options.previewerCache.html),this.$cherry.$event.emit("previewerOpen"),this.$cherry.$event.emit("editorOpen"),Iu(function(){var l,d;return(l=t.editor)===null||l===void 0||(d=l.editor)===null||d===void 0?void 0:d.refresh()},0)}},{key:"doHtmlCache",value:function(t){this.options.previewerCache.html=t,this.options.previewerCache.htmlChanged=!0}},{key:"cleanHtmlCache",value:function(){this.options.previewerCache.html="",this.options.previewerCache.htmlChanged=!1}},{key:"afterUpdate",value:function(){var t;cs(t=this.options.afterUpdateCallBack).call(t,function(n){return n()}),this.highlightLineNum===void 0&&(this.highlightLineNum=0),this.highlightLine(this.highlightLineNum)}},{key:"registerAfterUpdate",value:function(t){if(MA(t)){var n;this.options.afterUpdateCallBack=nt(n=this.options.afterUpdateCallBack).call(n,t)}else{if(!t)throw new Error("[markdown error]: Previewer registerAfterUpdate params are undefined");this.options.afterUpdateCallBack.push(t)}}},{key:"$getTopByLineNum",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=this.getDomContainer();if(t===null)return r.scrollHeight;for(var o=typeof t=="number"?t:ry(t,10),s=r.querySelectorAll("[data-sign]"),a=0,l=r.offsetTop,d=0;d1&&(k=g+(u-Math.abs(o-(a+u))-1)/u*f+f/u*n),k}a+=u}return r.scrollHeight}},{key:"highlightLine",value:function(t){var n,r,o,s,a,l=this.getDomContainer();if(vi(n=l.querySelectorAll(".cherry-highlight-line")).call(n,function(g){g.classList.remove("cherry-highlight-line")}),((r=this.$cherry)===null||r===void 0||(o=r.status)===null||o===void 0?void 0:o.previewer)==="show"&&((s=this.$cherry)===null||s===void 0||(a=s.status)===null||a===void 0?void 0:a.editor)==="show"){for(var d=l.querySelectorAll("[data-sign]"),u=0,h=0;h1&&arguments[1]!==void 0?arguments[1]:"auto",r=this.getDomContainer();this.getDomCanScroll(r).scrollTo({top:t,left:0,behavior:n})}},{key:"scrollToId",value:function(t){var n,r,o,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"smooth",a=this.getDomContainer(),l=this.getDomCanScroll(a),d=a.getElementsByTagName("img"),u=new SZn,h=!1;vi(n=Xl(d)).call(n,function(v){v.hasAttribute("width")||v.hasAttribute("height")||v.style.width||v.style.height||u.add(v)});var f=Gi(r=t.replace(/^\s*#/,"")).call(r);f=/[%:]/.test(f)?f:encodeURIComponent(f);var g=(o=a.querySelector('[id="'.concat(f,'"]')))!==null&&o!==void 0&&o;if(g===!1)return!1;var k=0;k=l.nodeName==="HTML"?l.scrollTop+g.getBoundingClientRect().y-10:l.scrollTop+g.getBoundingClientRect().y-l.getBoundingClientRect().y-10;var A=function(){u.clear();var p=0;p=l.nodeName==="HTML"?l.scrollTop+g.getBoundingClientRect().y-10:l.scrollTop+g.getBoundingClientRect().y-l.getBoundingClientRect().y-10,Math.abs(p-k)>5&&l.scrollTo({top:p,left:0,behavior:"instant"})},m=function v(){h||(h=!0,l.removeEventListener("scrollend",v),Iu(function(){var p,b=cs(p=Xl(u)).call(p,function(O){return O.complete?oO.resolve():new oO(function(w){var y=function C(){O.removeEventListener("load",C),O.removeEventListener("error",C),w()};O.addEventListener("load",y),O.addEventListener("error",y)})});oO.all(b).then(function(){requestAnimationFrame(A)})},100))};return l.addEventListener("scrollend",m),Iu(function(){l.removeEventListener("scrollend",m),m()},1e3),l.scrollTo({top:k,left:0,behavior:s}),!0}},{key:"$scrollAnimation",value:function(t){var n=this;if(this.animation.destinationTop=t,!this.animation.timer){var r=function o(){var s=n.getDomContainer(),a=s.scrollTop,l=n.animation.destinationTop-a,d=Math.ceil(Math.min(Math.abs(l),Math.max(1,Math.abs(l)/(100/16.7))));if(l===0||a>=s.scrollHeight||d>Math.abs(l))return cancelAnimationFrame(n.animation.timer),void(n.animation.timer=0);n.disableScrollListener=!0,n.getDomContainer().scrollTo(null,a+l/Math.abs(l)*d),n.animation.timer=requestAnimationFrame(o)};this.animation.timer=requestAnimationFrame(r)}}},{key:"scrollToLineNum",value:function(t,n){var r=this.$getTopByLineNum(t,n);this.$scrollAnimation(r)}},{key:"getDomCanScroll",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getDomContainer();return t.scrollHeight>t.clientHeight||t.clientHeightdocument.documentElement.clientHeight?document.documentElement:t:this.getDomCanScroll(t.parentElement):void 0}},{key:"scrollToHeadByIndex",value:function(t){var n,r=(n=this.getDomContainer().querySelectorAll("h1,h2,h3,h4,h5,h6,h7,h8")[t])!==null&&n!==void 0&&n;r!==!1&&this.scrollToId(r.id)}},{key:"bindClick",value:function(){}},{key:"onMouseDown",value:function(){var t=this;z7(this.getDomContainer(),"mousedown",function(){Iu(function(){t.$cherry.$event.emit("cleanAllSubMenus")})})}},{key:"export",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"pdf",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=n||this.$cherry.getFirstLineText("cherry-export");t==="pdf"?function(o,s){var a=document.title;document.title=s,jZn(o,function(l,d){var u=document.documentElement,h=u.classList.contains("cherry-export-only");h||u.classList.add("cherry-export-only"),l.innerHTML=l.innerHTML.replace(/class="cherry-code-unExpand("| )/g,'class="cherry-code-expand$1');try{window.print()}finally{d(),h||u.classList.remove("cherry-export-only"),document.title=a}})}(this.getDomContainer(),r):t==="screenShot"||t==="img"?Mas(this.getDomContainer(),r):t==="markdown"?function(o,s){var a=new Blob([o],{type:"text/markdown;charset=utf-8"}),l=document.createElement("a");l.style.display="none",l.href=$U.createObjectURL(a),l.download="".concat(s,".md"),document.body.appendChild(l),l.click(),document.body.removeChild(l)}(this.$cherry.getMarkdown(),r):t==="html"?function(o,s){var a=new Blob([o],{type:"text/markdown;charset=utf-8"}),l=document.createElement("a");l.style.display="none",l.href=$U.createObjectURL(a),l.download="".concat(s,".html"),document.body.appendChild(l),l.click(),document.body.removeChild(l)}(this.getValue(),r):t==="word"&&Fas(this.getValue(),r)}},{key:"changePreviewToMobile",value:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],n=this.getDomContainer();t?n.innerHTML="
    ".concat(n.innerHTML,"
    "):n.parentNode.innerHTML=n.innerHTML,this.isMobilePreview=t}}])}();function hls(){if(qJt)return XJt;qJt=1;var e=Zot(),t=function(){if(YJt)return ZJt;YJt=1;var r=VHn()(Object.keys,Object);return ZJt=r}(),n=Object.prototype.hasOwnProperty;return XJt=function(o){if(!e(o))return t(o);var s=[];for(var a in Object(o))n.call(o,a)&&a!="constructor"&&s.push(a);return s}}function i7e(){if(KJt)return GJt;KJt=1;var e=JHn(),t=hls(),n=Twe();return GJt=function(o){return n(o)?e(o):t(o)}}function VZn(){return r_t?i_t:(r_t=1,i_t=function(){return[]})}function oqe(){if(s_t)return o_t;s_t=1;var e=(n_t||(n_t=1,t_t=function(a,l){for(var d=-1,u=a==null?0:a.length,h=0,f=[];++d=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return a=u.done,u},e:function(u){l=!0,s=u},f:function(){try{a||n.return==null||n.return()}finally{if(l)throw s}}}}function $_t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`.concat(t,". ")).call(s,n,`
    `)).call(o,r,`
    `)}}}}},editor:{id:"code",name:"code",autoSave2Textarea:!1,height:"100%",defaultModel:"edit&preview",convertWhenPaste:!0,keyMap:"sublime",codemirror:{autofocus:!0,placeholder:""},writingStyle:"normal",keepDocumentScrollAfterInit:!1,showFullWidthMark:!0,showSuggestList:!0,maxUrlLength:-1,suggester:{}},toolbars:{showToolbar:!0,toolbar:["bold","italic","strikethrough","|","color","header","ruby","|","list","panel","detail",{insert:["image","audio","video","link","hr","br","code","formula","toc","table","line-table","bar-table","pdf","word"]},"graph","shortcutKey","togglePreview"],toolbarRight:[],sidebar:!1,bubble:["bold","italic","underline","strikethrough","sub","sup","quote","|","size","color"],float:["h1","h2","h3","|","checklist","quote","table","code"],hiddenToolbar:[],toc:!1,shortcutKey:{},shortcutKeySettings:{isReplace:!1,shortcutKeyMap:{}},config:{formula:{showLatexLive:!0,templateConfig:!1},mapTable:{sourceUrl:["https://geo.datav.aliyun.com/areas_v3/bound/100000_full.json","./assets/data/china.json"]},changeLocale:[{locale:"zh_CN",name:"中文"},{locale:"en_US",name:"English"},{locale:"ru_RU",name:"Русский"}]}},drawioIframeUrl:"",drawioIframeStyle:"border: none;",fileTypeLimitMap:{video:"video/*",audio:"audio/*",image:"image/*",word:".doc,.docx",pdf:".pdf",file:"*"},multipleFileSelection:{video:!1,audio:!1,image:!1,word:!1,pdf:!1,file:!1},callback:{urlProcessor:J2.urlProcessor,fileUpload:J2.fileUpload,fileUploadMulti:J2.fileUploadMulti,beforeImageMounted:J2.beforeImageMounted,onClickPreview:J2.onClickPreview,onCopyCode:J2.onCopyCode,onExpandCode:J2.onExpandCode,onUnExpandCode:J2.onUnExpandCode,changeString2Pinyin:J2.changeString2Pinyin,onPaste:J2.onPaste,onClickToc:function(t,n){return!0}},event:{afterChange:J2.afterChange,afterInit:J2.afterInit,focus:function(t){t.e,t.cherry},blur:function(t){t.e,t.cherry},selectionChange:function(t){t.selections,t.lastSelections,t.info},afterChangeLocale:function(t){},changeMainTheme:function(t){},changeCodeBlockTheme:function(t){}},previewer:{dom:!1,className:"cherry-markdown",isMobilePreview:!1,enablePreviewerBubble:!0,floatWhenClosePreviewer:!1,lazyLoadImg:{loadingImgPath:"",maxNumPerTime:2,noLoadImgNum:5,autoLoadImgNum:5,maxTryTimesPerSrc:2,beforeLoadOneImgCallback:function(t){return!0},failLoadOneImgCallback:function(t){},afterLoadOneImgCallback:function(t){},afterLoadAllImgCallback:function(){}}},nameSpace:"cherry",themeSettings:{themeList:[{className:"default",label:"默认"},{className:"dark",label:"暗黑"},{className:"gray",label:"沉稳"},{className:"abyss",label:"深海"},{className:"green",label:"清新"},{className:"red",label:"热情"},{className:"violet",label:"淡雅"},{className:"blue",label:"清幽"}],mainTheme:"default",codeBlockTheme:"default",inlineCodeTheme:"red"},isPreviewOnly:!1,autoScrollByCursor:!0,forceAppend:!0,locale:"zh_CN",locales:{},autoScrollByHashAfterInit:!1},pls=ZZn(vls),e$t,t$t,n$t,i$t,r$t,o$t,s$t,a$t,l$t,bls=function(){return Dr(function e(t){var n;Er(this,e),ei(this,"Events",{previewerClose:"previewerClose",previewerOpen:"previewerOpen",editorClose:"editorClose",editorOpen:"editorOpen",toolbarHide:"toolbarHide",toolbarShow:"toolbarShow",cleanAllSubMenus:"cleanAllSubMenus",afterChange:"afterChange",afterInit:"afterInit",afterAsyncRender:"afterAsyncRender",focus:"focus",blur:"blur",selectionChange:"selectionChange",afterChangeLocale:"afterChangeLocale",changeMainTheme:"changeMainTheme",changeCodeBlockTheme:"changeCodeBlockTheme"}),ei(this,"emitter",{all:n=n||new Map,on:function(o,s){var a=n.get(o);a?a.push(s):n.set(o,[s])},off:function(o,s){var a=n.get(o);a&&(s?a.splice(a.indexOf(s)>>>0,1):n.set(o,[]))},emit:function(o,s){var a=n.get(o);a&&a.slice().map(function(l){l(s)}),(a=n.get("*"))&&a.slice().map(function(l){l(o,s)})}}),this.instanceId=t},[{key:"setInstanceId",value:function(t){this.instanceId=t}},{key:"getInstanceId",value:function(){return this.instanceId}},{key:"clearAll",value:function(){this.emitter.all.clear()}},{key:"bindCallbacksByOptions",value:function(t){t.callback.afterChange&&this.on(this.Events.afterChange,function(n){t.callback.afterChange(n.markdownText,n.html)}),t.callback.afterInit&&this.on(this.Events.afterInit,function(n){t.callback.afterInit(n.markdownText,n.html)}),t.callback.afterAsyncRender&&this.on(this.Events.afterAsyncRender,function(n){t.callback.afterAsyncRender(n.markdownText,n.html)}),t.event.afterChange&&this.on(this.Events.afterChange,function(n){t.event.afterChange(n.markdownText,n.html)}),t.event.afterInit&&this.on(this.Events.afterInit,function(n){t.event.afterInit(n.markdownText,n.html)}),t.event.afterAsyncRender&&this.on(this.Events.afterAsyncRender,function(n){t.event.afterAsyncRender(n.markdownText,n.html)}),t.event.focus&&this.on(this.Events.focus,function(n){t.event.focus(n)}),t.event.blur&&this.on(this.Events.blur,function(n){t.event.blur(n)}),t.event.selectionChange&&this.on(this.Events.selectionChange,function(n){t.event.selectionChange(n)}),t.event.afterChangeLocale&&this.on(this.Events.afterChangeLocale,function(n){t.event.afterChangeLocale(n)}),t.event.changeMainTheme&&this.on(this.Events.changeMainTheme,function(n){t.event.changeMainTheme(n)}),t.event.changeCodeBlockTheme&&this.on(this.Events.changeCodeBlockTheme,function(n){t.event.changeCodeBlockTheme(n)})}},{key:"on",value:function(t,n){var r;this.emitter.on(nt(r="".concat(this.instanceId,":")).call(r,t),n)}},{key:"off",value:function(t,n){var r;this.emitter.off(nt(r="".concat(this.instanceId,":")).call(r,t),n)}},{key:"emit",value:function(t,n){var r;this.emitter.emit(nt(r="".concat(this.instanceId,":")).call(r,t),n)}}])}(),Ols={zh_CN:{bold:"加粗",code:"代码",graph:"画图",h1:"一级标题",h2:"二级标题",h3:"三级标题",h4:"四级标题",h5:"五级标题",header:"标题",insert:"插入",italic:"斜体",list:"列表",quickTable:"表格",quote:"引用",size:"大小",color:"文字颜色&背景",strikethrough:"删除线",sub:"下标",sup:"上标",togglePreview:"预览",fullScreen:"全屏",image:"图片",audio:"音频",video:"视频",link:"超链接",hr:"分隔线",br:"换行",toc:"目录",pdf:"pdf",word:"word",table:"表格","line-table":"折线表格","bar-table":"柱状表格","radar-table":"雷达表格","map-table":"地图表格",lineTable:"折线图",barTable:"柱状图",radarTable:"雷达图",mapTable:"地图",heatmapTable:"热力图",sankeyTable:"桑基图",pieTable:"饼图",proTable:"图表",formula:"公式",insertFormula:"公式",insertFlow:"流程图",insertSeq:"时序图",insertState:"状态图",insertClass:"类图",insertPie:"饼图",scatterTable:"散点图",insertGantt:"甘特图",checklist:"清单",ol:"有序列表",ul:"无序列表",undo:"撤销",redo:"恢复",previewClose:"关闭预览",codeTheme:"代码主题",switchModel:"模式切换",switchPreview:"预览",switchEdit:"返回编辑",classicBr:"经典换行",normalBr:"常规换行",settings:"设置",mobilePreview:"移动端预览",copy:"复制内容",export:"导出",underline:"下划线",pinyin:"拼音",file:"文件",pastePlain:"粘贴为纯文本格式",pasteMarkdown:"粘贴为markdown格式",hide:"隐藏工具栏",exportToPdf:"导出PDF",exportScreenshot:"导出长图",exportMarkdownFile:"导出markdown",exportHTMLFile:"导出html",exportWordFile:"导出word",theme:"主题",panel:"面板",detail:"手风琴",heading1:"一级标题",heading2:"二级标题",heading3:"三级标题",complement:"续写",summary:"总结",justify:"对齐方式",justifyLeft:"左对齐",justifyCenter:"居中",justifyRight:"右对齐",align:"对齐方式",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",alignJustify:"两端对齐",alignFloatLeft:"左浮动",alignFloatRight:"右浮动",publish:"发布",colorPickerText:"文字",colorPickerBackground:"背景",colorPickerClear:"清除颜色",colorPickerRecentColors:"最近使用颜色",colorPickerPresetColors:"系统预设颜色",small:"小",medium:"中",large:"大",superLarge:"特大",detailDefaultContent:`点击展开更多 内容 ++- 默认展开 内容 ++ 默认收起 内容`,inlineCode:"行内代码",codeBlock:"代码块",inlineMath:"行内公式",mathBlock:"块级公式",shortcutKeySetting:"快捷键设置",editShortcutKeyConfigTip:"双击快捷键区域或点击编辑按钮编辑快捷键",editingShortcutKeyConfigTip:"按Enter键保存,Backspace键移除新增的键",staticShortcutTip:"内置快捷键不可修改",disabledShortcutTip:"当前快捷键已禁用",wordCount:"字数统计",wordCountP:"段落",wordCountW:"单词",wordCountC:"字符",deleteColumn:"删除列",deleteRow:"删除行",addRow:"添加行",addCol:"添加列",moveRow:"移动行",moveCol:"移动列",shortcutStaticTitle:"以下快捷键无法修改",shortcutStatic1:"整行向左缩进",shortcutStatic2:"整行向右缩进",shortcutStatic3:"复制并粘贴一行",shortcutStatic4:"在下方插入空行",shortcutStatic5:"在上方插入空行",shortcutStatic6:"与上行互换",shortcutStatic7:"与下行互换",shortcutStatic8:"删除一行",shortcutStatic9:"按词语向左选中",shortcutStatic10:"按词语向右选中",shortcutStatic11:"按词语删除",shortcutStatic12:"选中括号内内容",shortcutStatic13:"插入多个光标",shortcutStatic14:"分别选中文本块的每一行",shortcutStatic15:"查找",shortcutStatic16:"选中所有相同的词",shortcutStatic17:"撤销",shortcutStatic18:"回滚撤销",leftMouseButton:"鼠标左键",disableShortcut:"禁用所有快捷键",enableShortcut:"取消禁用快捷键",recoverShortcut:"恢复默认配置",search:"搜索",autoWrap:"自动换行",footnoteTitle:"脚注",searchFor:"查找",replaceWith:"替换为",previousMatch:"查找上一个",nextMatch:"查找下一个",replace:"替换",replaceAll:"全部替换",regExpSearch:"正则表达式搜索",caseSensitiveSearch:"区分大小写搜索",wholeWordSearch:"全字匹配搜索",matchesFoundText:"处匹配",toggleReplace:"展开/收起替换框",close:"关闭",border:"边框",shadow:"阴影",radius:"圆角",customShortcut:"自定义快捷键",staticShortcut:"内置快捷键",edit:"编辑",save:"保存",cancel:"取消",saveAsImage:"保存为图片",mapChartLoading:"正在加载地图数据",mapChartLoadingTip:"如果长时间未显示,请检查网络连接",mapChartError:"地图数据加载失败",mapChartErrorTip:"请检查数据源或网络链接",mapChartRetry:"点击重新加载",chartRenderError:"图表渲染失败",chartLibraryNotLoadedTip:"ECharts 图表库未加载",radarData:"雷达图数据",scatterData:"散点数据",pieData:"数据分布",heatmapData:"热力图数据",mapData:"地图数据",maxValue:"最大值",minValue:"最小值",high:"高",low:"低"},en_US:{bold:"Bold",code:"Code",graph:"Graph",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",header:"Header",insert:"Insert",italic:"Italic",list:"List",quickTable:"Quick Table",quote:"Quote",size:"Size",color:"Text Color & Background",strikethrough:"Strikethrough",sub:"Sub",sup:"Sup",togglePreview:"Toggle Preview",fullScreen:"Full Screen",image:"Image",audio:"Audio",video:"Video",link:"Link",hr:"Horizontal Rule",br:"New Line",toc:"Table Of Content",pdf:"PDF",word:"Word",table:"Table","line-table":"Line Table","bar-table":"Bar Table","radar-table":"Radar Table","map-table":"Map Table",lineTable:"Line Table",barTable:"Bar Table",radarTable:"Radar Table",mapTable:"Map Table",heatmapTable:"Heatmap Table",sankeyTable:"Sankey Table",pieTable:"Pie Table",proTable:"Chart",formula:"Formula",insertFormula:"Insert Formula",insertFlow:"Insert Flow",insertSeq:"Insert Seq",insertState:"Insert State",insertClass:"Insert Class",insertPie:"Insert Pie",scatterTable:"Scatter Table",insertGantt:"Insert Gantt",checklist:"Checklist",ol:"Ordered List",ul:"Unordered List",undo:"Undo",redo:"Redo",previewClose:"Preview Close",codeTheme:"Code Theme",switchModel:"Switch Model",switchPreview:"Switch Preview",switchEdit:"Switch Edit",classicBr:"Classic New Line",normalBr:"Normal New Line",settings:"Settings",mobilePreview:"Mobile Preview",copy:"Copy",export:"Export",underline:"Underline",pinyin:"Pinyin",pastePlain:"Paste as Plain Text",pasteMarkdown:"Paste as Markdown",hide:"Hide Toolbar",exportToPdf:"Export to PDF",exportScreenshot:"Screenshot",exportMarkdownFile:"Export Markdown File",exportHTMLFile:"Export preview HTML File",exportWordFile:"Export to Word",heading1:"H1 Heading",heading2:"H2 Heading",heading3:"H3 Heading",panel:"Panel",detail:"Detail",complement:"Complement",summary:"Summary",justify:"justify",justifyLeft:"Left",justifyCenter:"Center",justifyRight:"Right",align:"Align",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",alignFloatLeft:"Align Float Left",alignFloatRight:"Align Float Right",publish:"Publish",colorPickerText:"Text",colorPickerBackground:"Background",colorPickerClear:"Clear Color",colorPickerRecentColors:"Recent Colors",colorPickerPresetColors:"Preset Colors",small:"Small",medium:"Medium",large:"Large",superLarge:"Super Large",detailDefaultContent:`Click to expand more Content ++- Expand by default Content ++ Collapse by default Content`,inlineCode:"Inline Code",codeBlock:"Code Block",inlineMath:"Inline Math",mathBlock:"Math Block",shortcutKeySetting:"Keyboard Shortcuts",editShortcutKeyConfigTip:"Double-click the shortcut key area or click the edit button to edit",editingShortcutKeyConfigTip:"Press Enter to save, Backspace to remove the newly added key",staticShortcutTip:"Built-in shortcuts cannot be modified",disabledShortcutTip:"Shortcuts are currently disabled",wordCount:"Word Count",wordCountP:"P",wordCountW:"W",wordCountC:"C",deleteColumn:"delete column",deleteRow:"delete row",addRow:"add row",addCol:"add column",moveRow:"move row",moveCol:"move column",shortcutStaticTitle:"The following shortcuts cannot be modified",shortcutStatic1:"Indent the whole line to the left",shortcutStatic2:"Indent the whole line to the right",shortcutStatic3:"Duplicate and paste a line",shortcutStatic4:"Insert a blank line below",shortcutStatic5:"Insert a blank line above",shortcutStatic6:"Swap with the line above",shortcutStatic7:"Swap with the line below",shortcutStatic8:"Delete a line",shortcutStatic9:"Select to the left by word",shortcutStatic10:"Select to the right by word",shortcutStatic11:"Delete by word",shortcutStatic12:"Select the content inside parentheses",shortcutStatic13:"Insert multiple cursors",shortcutStatic14:"Select each line of the text block separately",shortcutStatic15:"Find",shortcutStatic16:"Select all occurrences of the word",shortcutStatic17:"Undo",shortcutStatic18:"Redo",leftMouseButton:"left mouse button",disableShortcut:"Disable all shortcuts",enableShortcut:"Enable all shortcuts",recoverShortcut:"Restore default configuration",search:"Search",autoWrap:"Auto Wrap",footnoteTitle:"Footnote",searchFor:"Search for",replaceWith:"Replace with",previousMatch:"Previous Match",nextMatch:"Next Match",replace:"Replace",replaceAll:"Replace All",regExpSearch:"RegExp Search",caseSensitiveSearch:"CaseSensitive Search",wholeWordSearch:"Whole Word Search",matchesFoundText:"matches found.",toggleReplace:"Toggle Replace",close:"Close",border:"Border",shadow:"Shadow",radius:"Radius",customShortcut:"Custom Shortcuts",staticShortcut:"Built-in Shortcuts",edit:"Edit",save:"Save",cancel:"Cancel",saveAsImage:"Save as Image",mapChartLoading:"Loading map data",mapChartLoadingTip:"If it takes a long time to load, please check your network connection",mapChartError:"Map data loading failed",mapChartErrorTip:"Please check the data source or network connection",mapChartRetry:"Click to reload",chartRenderError:"Chart render failed",chartLibraryNotLoadedTip:"ECharts chart library not loaded",radarData:"Radar chart data",scatterData:"Scatter data",pieData:"Data distribution",heatmapData:"Heatmap data",mapData:"Map data",maxValue:"Max value",minValue:"Min value",high:"High",low:"Low"},ru_RU:{bold:"Жирный",code:"Код",graph:"График",h1:"Заголовок 1",h2:"Заголовок 2",h3:"Заголовок 3",h4:"Заголовок 4",h5:"Заголовок 5",header:"Заголовок",insert:"Вставить",italic:"Курсив",list:"Лист",quickTable:"Quick Table",quote:"Цитата",size:"Размер",color:"Цвет текста и фон",strikethrough:"Зачеркнуто",sub:"Sub",sup:"Sup",togglePreview:"Переключение предварительного просмотра",fullScreen:"Полноэкранный режим",image:"Изображение",audio:"Аудио",video:"Видео",link:"Ссылка",hr:"Горизонтальная линия",br:"Новая строка",toc:"Таблица содержания",pdf:"PDF",word:"Word",table:"Таблица","line-table":"линия таблица","bar-table":"бар стол","radar-table":"радарный стол","map-table":"таблица карты",lineTable:"линия таблица",barTable:"бар стол",radarTable:"радарный стол",mapTable:"таблица карты",heatmapTable:"таблица тепловой карты",sankeyTable:"Диаграмма Санки",pieTable:"стол для пирога",proTable:"диаграмма",formula:"Формула",insertFormula:"Вставить формулу",insertFlow:"Вставить поток",insertSeq:"Вставить Seq",insertState:"Вставить State",insertClass:"Вставить класс",insertPie:"Вставить Pie",scatterTable:"таблица рассеяния",insertGantt:"Вставить Gantt",checklist:"Контрольный список",ol:"Упорядоченный список",ul:"Неупорядоченный список",undo:"Отменить",redo:"Переделывать",previewClose:"Предварительный просмотр закрыт",codeTheme:"Тема для кода",switchModel:"Модель переключателя",switchPreview:"Переключите предварительный просмотр",switchEdit:"Переключить редактирование",classicBr:"Классическая новая линия",normalBr:"Обычная новая строка",settings:"Настройки",mobilePreview:"Предварительный просмотр на мобильном устройстве",copy:"Копировать",export:"Экспорт",underline:"Подчеркивать",pinyin:"Pinyin",pastePlain:"Вставить в виде обычного текста",pasteMarkdown:"Вставить как Markdown",hide:"Скрыть панель инструментов",exportToPdf:"Экспорт в формат PDF",exportScreenshot:"Скриншот",exportMarkdownFile:"Экспорт файла Markdown",exportHTMLFile:"Экспорт предварительного просмотра HTML-файла",exportWordFile:"Экспорт в Word",panel:"Панель",detail:"Аккордеон",heading1:"H1 Заголовок",heading2:"H2 Заголовок",heading3:"H3 Заголовок",complement:"Дополнение",summary:"Резюме",justify:"объяснить",justifyLeft:"Слева",justifyCenter:"Центр",justifyRight:"Справа",align:"Выравнивание",alignLeft:"Выровнять слева",alignCenter:"В центре",alignRight:"Выровнять вправо",alignJustify:"Выровнять концы",alignFloatLeft:"Выровнять вправо",alignFloatRight:"Выровнять слева",publish:"Публиковать",colorPickerText:"Текст",colorPickerBackground:"Фон",colorPickerClear:"Очистить цвет",colorPickerRecentColors:"Недавние цвета",colorPickerPresetColors:"Предустановленные цвета",small:"Маленький",medium:"Средний",large:"Большой",superLarge:"Очень большой",detailDefaultContent:`Нажмите, чтобы развернуть подробнее Содержание ++- Развернуть по умолчанию Содержание ++ Свернуть по умолчанию Содержание`,inlineCode:"Встроенный код",codeBlock:"Кодовый блок",inlineMath:"Встроенная формула",mathBlock:"Блочная формула",shortcutKeySetting:"Настройки горячих клавиш",editShortcutKeyConfigTip:"Дважды щёлкните или нажмите Редактировать, чтобы изменить сочетание клавиш.",editingShortcutKeyConfigTip:"Нажмите Enter для сохранения, Backspace для удаления добавленной клавиши",staticShortcutTip:"Встроенные сочетания клавиш нельзя изменить",disabledShortcutTip:"Сочетания клавиш в настоящее время отключены",wordCount:"Количество слов",wordCountP:"P",wordCountW:"W",wordCountC:"C",deleteColumn:"Удалить столбец",deleteRow:"Удалить строку",addRow:"Добавить строку",addCol:"Добавить столбец",moveRow:"Переместить строку",moveCol:"Переместить столбец",shortcutStaticTitle:"Следующие сочетания клавиш не могут быть изменены",shortcutStatic1:"Отступить всю строку влево",shortcutStatic2:"Отступить всю строку вправо",shortcutStatic3:"Скопировать и вставить строку",shortcutStatic4:"Вставить пустую строку ниже",shortcutStatic5:"Вставить пустую строку выше",shortcutStatic6:"Поменять с предыдущей строкой",shortcutStatic7:"Поменять с следующей строкой",shortcutStatic8:"Удалить строку",shortcutStatic9:"Выделить влево по слову",shortcutStatic10:"Выделить вправо по слову",shortcutStatic11:"Удалить по слову",shortcutStatic12:"Выделить содержимое внутри скобок",shortcutStatic13:"Вставить несколько курсоров",shortcutStatic14:"Выделить каждую строку текстового блока отдельно",shortcutStatic15:"Найти",shortcutStatic16:"Выделить все вхождения слова",shortcutStatic17:"Отменить",shortcutStatic18:"Вернуть отмену",leftMouseButton:"левая кнопка мыши",disableShortcut:"Отключить все горячие клавиши",enableShortcut:"Включить горячие клавиши",recoverShortcut:"Восстановить конфигурацию по умолчанию",search:"Поиск",autoWrap:"Автоперенос строк",footnoteTitle:"Сноска",searchFor:"Найти",replaceWith:"Заменить на",previousMatch:"Предыдущее",nextMatch:"Следующее",replace:"Заменить",replaceAll:"Заменить всё",regExpSearch:"Регулярное выражение",caseSensitiveSearch:"С учётом регистра",wholeWordSearch:"Целое слово",matchesFoundText:"совпадений найдено.",toggleReplace:"Показать замену",close:"Закрыть",border:"Рамка",shadow:"Тень",radius:"Скругление",customShortcut:"Пользовательские горячие клавиши",staticShortcut:"Встроенные горячие клавиши",edit:"Редактировать",save:"Сохранить",cancel:"Отмена",saveAsImage:"Сохранить как изображение",mapChartLoading:"Загрузка данных карты",mapChartLoadingTip:"Если загрузка занимает много времени, пожалуйста, проверьте подключение к интернету",mapChartError:"Ошибка загрузки данных карты",mapChartErrorTip:"Пожалуйста, проверьте источник данных или подключение к интернету",mapChartRetry:"Нажмите, чтобы перезагрузить",chartRenderError:"Ошибка рендеринга графика",chartLibraryNotLoadedTip:"Библиотека ECharts не загружена",radarData:"Данные радара",scatterData:"Данные скаттера",pieData:"Распределение данных",heatmapData:"Данные тепловой карты",mapData:"Картографические данные",maxValue:"Максимальное значение",minValue:"Минимальное значение",high:"Высокий",low:"Низкий"}},wls={};function yls(){return n$t?t$t:(n$t=1,function(){if(e$t)return wls;e$t=1;var e=ai(),t=W6().every;e({target:"Array",proto:!0,forced:!jZ()("every")},{every:function(r){return t(this,r,arguments.length>1?arguments[1]:void 0)}})}(),t$t=Jc()("Array","every"))}function Cls(){if(r$t)return i$t;r$t=1;var e=wl(),t=yls(),n=Array.prototype;return i$t=function(o){var s=o.every;return o===n||e(n,o)&&s===n.every?t:s}}function xls(){return s$t?o$t:(s$t=1,o$t=Cls())}var Lls=ji(l$t?a$t:(l$t=1,a$t=xls()));function Sls(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"absolute",n=e.getBoundingClientRect();return t==="fixed"?n:t==="sidebar"?{left:YZn.getTargetParentByButton(e).offsetLeft-130+n.width,top:e.offsetTop+n.height/2,width:n.width,height:n.height}:{left:e.offsetLeft,top:e.offsetTop,width:n.width,height:n.height}}var YZn=function(){function e(t){var n,r,o;Er(this,e),ei(this,"_onClick",void 0),this.$cherry=t,this.bubbleMenu=!1,this.subMenu=null,this.$currentMenuOptions=t.$currentMenuOptions,this.name=(n=(r=t.$currentMenuOptions)===null||r===void 0?void 0:r.name)!==null&&n!==void 0?n:"",typeof((o=t.$currentMenuOptions)===null||o===void 0?void 0:o.icon)=="string"&&(this.iconName=t.$currentMenuOptions.icon),this.iconType=null,this.editor=t.editor,this.locale=t.locale,this.dom=null,this.updateMarkdown=!0,this.subMenuConfig=[],this.noIcon=!1,this.cacheOnce=!1,this.positionModel="absolute",typeof this._onClick=="function"&&(q1.warn("`MenuBase._onClick` is deprecated. Override `fire` instead"),this.fire=this._onClick),this.shortcutKeyMap={}}return Dr(e,[{key:"getSubMenuConfig",value:function(){return this.subMenuConfig}},{key:"setName",value:function(n,r){this.name=n,this.iconName=r,this.$currentMenuOptions={name:n,icon:r}}},{key:"setCacheOnce",value:function(n){this.cacheOnce=n}},{key:"getAndCleanCacheOnce",value:function(){this.updateMarkdown=!0;var n=this.cacheOnce;return this.cacheOnce=!1,n}},{key:"hasCacheOnce",value:function(){return this.cacheOnce!==!1}},{key:"createIconFontIcon",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=ig("i","ch-icon ch-icon-".concat(n));return typeof(r==null?void 0:r.className)=="string"&&o.classList.add(r.className),o}},{key:"createSvgIcon",value:function(n){if(n.type!=="svg")throw new Error('except options.type is "svg", but get "${options.type}"');try{var r,o=(r=new DOMParser().parseFromString(n.content,"image/svg+xml"))===null||r===void 0?void 0:r.lastElementChild;return n.iconStyle&&o.setAttribute("style",n.iconStyle),n.iconClassName&&o.setAttribute("class",n.iconClassName),o}catch(s){throw new kJ(s)}}},{key:"createImageIcon",value:function(n){if(n.type!=="image")throw new Error('except options.type is "image", but get "${options.type}"');return ig("img","ch-icon".concat(n.iconClassName?" ".concat(n.iconClassName):""),{src:n.content,style:n.iconStyle})}},{key:"createBtn",value:function(){var n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=ig("span",n?"cherry-dropdown-item":"cherry-toolbar-button cherry-toolbar-".concat(this.iconName?this.iconName:this.name),{title:this.locale[this.name]||G0(this.name)});if(!this.noIcon){var o=null,s=this.$currentMenuOptions.icon;if(typeof s=="string")o=this.createIconFontIcon(this.iconName!==this.name?this.iconName:s),this.iconType="iconfont";else if(s instanceof HTMLElement)o=s,this.iconType="element";else if(Cd(s)==="object"){var a=s.type;if(a==="svg")o=this.createSvgIcon(s),this.iconType="svg";else if(a==="image")o=this.createImageIcon(s),this.iconType="image";else{if(a!=="iconfont")throw new Error('except customIcon.type is "svg", "image", "iconfont", but get "'.concat(a,'"'));o=this.createIconFontIcon(s.content),this.iconType="iconfont"}}o!==null&&(o.classList.add("cherry-menu-".concat(this.name)),r.appendChild(o))}return(n||this.noIcon)&&(r.innerHTML+=this.locale[this.name]||G0(this.name)),n||this.dom||(this.dom=r),r}},{key:"createSubBtnByConfig",value:function(n){if(Cd(n)==="object"&&n.name==="|")return ig("div","cherry-dropdown-separator");var r=n.name,o=n.iconName,s=n.icon,a=n.onclick,l=ig("span","cherry-dropdown-item",{title:this.locale[r]||G0(r)});if(o){var d=ig("i","ch-icon ch-icon-".concat(o));l.appendChild(d)}else if(s){var u=ig("img","ch-icon",{src:s,style:"width: 16px; height: 16px; vertical-align: sub;"});l.appendChild(u)}return l.innerHTML+=this.locale[r]||G0(r),l.addEventListener("click",a,!1),l}},{key:"fire",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(n==null||n.stopPropagation(),typeof this.onClick=="function"){var s=this.editor.editor.getSelections();this.isSelections=s.length>1;var a=cs(s).call(s,function(l,d,u){return r.onClick(l,o,n)||u[d]});!this.bubbleMenu&&this.updateMarkdown&&(IQ(a).call(a,function(l){return l instanceof oO})?oO.all(cs(a).call(a,function(l){return l instanceof oO?l:oO.resolve(l)})).then(function(l){var d=cs(l).call(l,function(u,h){return u==null?s[h]:String(u)});r.editor.editor.replaceSelections(d,"around"),r.editor.editor.focus(),r.$afterClick()}):(this.editor.editor.replaceSelections(a,"around"),this.editor.editor.focus(),this.$afterClick()))}}},{key:"$getSelectionRange",value:function(){var n=this.editor.editor.listSelections()[0],r=n.anchor,o=n.head;return r.line===o.line&&r.ch>o.ch||r.line>o.line?{begin:o,end:r}:{begin:r,end:o}}},{key:"registerAfterClickCb",value:function(n){this.afterClickCb=n}},{key:"$afterClick",value:function(){typeof this.afterClickCb!="function"||this.isSelections||(this.afterClickCb(),this.afterClickCb=null)}},{key:"setLessSelection",value:function(n,r){var o,s,a,l,d=this.editor.editor,u=this.$getSelectionRange(),h=u.begin,f=u.end,g={line:((o=n.match(/\n/g))===null||o===void 0?void 0:o.length)>0?h.line+n.match(/\n/g).length:h.line,ch:((s=n.match(/\n/g))===null||s===void 0?void 0:s.length)>0?n.replace(/^[\s\S]*?\n([^\n]*)$/,"$1").length:h.ch+n.length},k=((a=r.match(/\n/g))===null||a===void 0?void 0:a.length)>0?f.line-r.match(/\n/g).length:f.line,A={line:k,ch:((l=r.match(/\n/g))===null||l===void 0?void 0:l.length)>0?d.getLine(k).length:f.ch-r.length};d.setSelection(g,A)}},{key:"getMoreSelection",value:function(n,r,o){var s=this.editor.editor,a=this.$getSelectionRange(),l=a.begin,d=a.end,u=/\n/.test(n)?0:l.ch-n.length;u=u<0?0:u;var h,f=/\n/.test(n)?l.line-n.match(/\n/g).length:l.line,g={line:f=f<0?0:f,ch:u},k=d.line,A=d.ch;/\n/.test(r)?(k=d.line+r.match(/\n/g).length,A=(h=s.getLine(k))===null||h===void 0?void 0:h.length):A=s.getLine(d.line).length1&&arguments[1]!==void 0?arguments[1]:"word",o=arguments.length>2&&arguments[2]!==void 0&&arguments[2],s=this.editor.editor;if(this.isSelections||n&&!o)return n;if(r==="line"){var a=this.$getSelectionRange(),l=a.begin,d=a.end;return s.setSelection({line:l.line,ch:0},{line:d.line,ch:s.getLine(d.line).length}),s.getSelection()}if(r==="word"){var u=s.findWordAt(s.getCursor()),h=u.anchor,f=u.head;return s.setSelection(h,f),s.getSelection()}}},{key:"bindSubClick",value:function(n,r){return this.fire(null,n)}},{key:"onClick",value:function(n,r,o){return n}},{key:"shortcutKeys",get:function(){return[]}},{key:"updateMenuIcon",value:function(n){if(this.noIcon)return!1;var r;if(typeof n=="string")return this.iconType==="iconfont"&&((r=this.dom.querySelector("i"))===null||r===void 0||r.classList.replace("ch-icon-".concat(this.iconName),"ch-icon-".concat(n)),this.iconName=n,this.$currentMenuOptions.icon=n,this.iconType="iconfont",!0);if(n instanceof HTMLElement)return n.classList.add("ch-icon cherry-menu-".concat(this.name)),this.dom.replaceChildren(n),this.iconType="element",!0;var o=this.iconName;switch(n.type){case"iconfont":if(this.iconType==="iconfont"){var s;o=n.content,(s=this.dom.querySelector("i"))===null||s===void 0||s.classList.replace("ch-icon-".concat(this.iconName),"ch-icon-".concat(o)),this.iconName=o}else{var a=this.createIconFontIcon(n.content,{className:"cherry-menu-".concat(this.name)});n.iconClassName&&a.classList.add(n.iconClassName),n.iconStyle&&a.setAttribute("style",n.iconStyle),this.dom.replaceChildren(a)}this.iconType="iconfont";break;case"svg":this.dom.replaceChildren(this.createSvgIcon(n)),this.iconType="svg";break;case"image":this.dom.replaceChildren(this.createImageIcon(n)),this.iconType="image";break;case"element":throw Error("except the options argument instance of HTMLElement, but get a type of ".concat(Cd(n)))}}},{key:"getMenuPosition",value:function(){var n=e.getTargetParentByButton(this.dom),r=/cherry-sidebar/.test(n.className);return/cherry-bubble/.test(n.className)||/cherry-floatmenu/.test(n.className)?this.positionModel="fixed":this.positionModel=r?"sidebar":"absolute",Sls(this.dom,this.positionModel)}},{key:"hide",value:function(){this.dom.style.display="none"}},{key:"show",value:function(){this.dom.style.display="block"}},{key:"getActiveSubMenuIndex",value:function(n){return-1}}],[{key:"getTargetParentByButton",value:function(n){var r=n.parentElement;return r&&r.classList.contains("cherry-sidebar-list")&&(r=r.parentElement),/toolbar-(left|right)/.test(r.className)&&(r=r.parentElement),r}}])}();function r7e(e,t,n){return t=gi(t),rs(e,XZn()?Di(t,n||[],gi(e).constructor):t.apply(e,n))}function XZn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(XZn=function(){return!!e})()}function AN(e,t,n,r){var o=dte(gi(e.prototype),t,n);return 2&r&&typeof o=="function"?function(s){return o.apply(n,s)}:o}function sqe(e,t,n){if(Cd(e)!=="object"||!e)throw TypeError("first argument must be a object, but get ".concat(Cd(e)));var r;return MA(n)||Cd(n)!=="object"||n===null||Cd(e[t])!=="object"||e[t]===null?typeof n=="string"&&Cd(e[t])===n||typeof n=="function"&&e[t]instanceof n||!!MA(n)&&IQ(n).call(n,function(o){return sqe(e,t,o)}):Lls(r=ol(e[t])).call(r,function(o){return sqe(e[t],o,n[o])})}function c$t(e,t,n){var r,o={};return vi(r=ol(e)).call(r,function(s){Ys(t).call(t,s)!==-1&&(Cd(n)==="object"?sqe(e,s,n[s])&&(o[s]=e[s]):typeof n=="string"&&Cd(e[s])===n&&(o[s]=e[s]))}),o}var d$t,u$t,h$t,A$t,f$t,g$t,m$t,Tls={};function Els(){return h$t?u$t:(h$t=1,function(){if(d$t)return Tls;d$t=1;var e=ai(),t=sVn();e({target:"Number",stat:!0,forced:Number.parseInt!==t},{parseInt:t})}(),u$t=Ol().Number.parseInt)}function Dls(){return f$t?A$t:(f$t=1,A$t=Els())}var fN=ji(m$t?g$t:(m$t=1,g$t=Dls()));function Q9(e,t){var n=aR!==void 0&&lR(e)||e["@@iterator"];if(!n){if(MA(e)||(n=function(d,u){if(d){var h;if(typeof d=="string")return k$t(d,u);var f=ba(h={}.toString.call(d)).call(h,8,-1);return f==="Object"&&d.constructor&&(f=d.constructor.name),f==="Map"||f==="Set"?Xl(d):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?k$t(d,u):void 0}}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return a=u.done,u},e:function(u){l=!0,s=u},f:function(){try{a||n.return==null||n.return()}finally{if(l)throw s}}}}function k$t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&r.push(a.replace(/^\|{2,3}/,"").replace(/\|\|\s*$/,"").split("||"))}}catch(l){s.e(l)}finally{s.f()}return r}},{key:"$isMeerged",value:function(n,r){return!!n[r]&&(n[r][0]<0||n[r][1]<0)}},{key:"$getTdSpan",value:function(n,r){var o;return n[r]!==void 0?nt(o='rowspan="'.concat(n[r][0],'" colspan="')).call(o,n[r][1],'"'):""}},{key:"$dealTh",value:function(n){var r,o=/^\s*~T/.test(n),s=/~T\s*$/.test(n),a={style:"",content:""};return o&&s?a.align='align="center"':s?a.align='align="right"':o&&(a.align='align="left"'),a.content=Gi(r=n.replace(/^\s*~T/,"").replace(/~T\s*$/,"")).call(r),a}},{key:"makeHtml",value:function(n,r){var o=this;return n.replace(/(^|\n)\s*?((?:\|\|[^\n]+(?:$|\n))+)/g,function(s,a,l){var d,u,h,f=o.$engine.md5(l),g=l.match(/\n/g).length,k=/^\|\|\|/.test(l),A=/\|{2,3}\s*~T/.test(l)||/~T\s*\|\|/.test(l),m=l.split(/\n/),v="",p=[],b=[];if(A&&m[0]){v="";var O,w=Q9(m[0].replace(/^\|{2,3}/,"").replace(/\|\|\s*$/,"").split("||"));try{for(w.s();!(O=w.n()).done;){var y,C=O.value,x=o.$dealTh(C);b.push(x.align),v+=nt(y="")).call(y,r(x.content).html,"")}}catch(V){w.e(V)}finally{w.f()}v+="",m.shift()}m=o.$convertTrsString2Array(m);var L,S=k?o.$getColAndRowSpanMap(m):{},E=Q9(gL(m).call(m));try{for(E.s();!(L=E.n()).done;){var Q,T=L.value,M=m[T],B="",P=Q9(gL(M).call(M));try{for(P.s();!(Q=P.n()).done;){var F,R,N=Q.value,I=o.$getSpanKey(T,N),W=M[N];o.$isMeerged(S,I)||(B+=nt(F=nt(R="")).call(F,r(Gi(W).call(W)).html,""))}}catch(V){P.e(V)}finally{P.f()}B+="",p.push(B)}}catch(V){E.e(V)}finally{E.f()}var H=nt(d=nt(u='
    `)).call(d,v+p.join(""),"
    ");return nt(h="".concat(a)).call(h,o.pushCache(H,f))})}},{key:"rule",value:function(){return{}}}])}();function KZn(){try{var e=!Boolean.prototype.valueOf.call(Di(Boolean,[],function(){}))}catch{}return(KZn=function(){return!!e})()}ei(GZn,"HOOK_NAME","tapdTable");var JZn=function(){function e(){return Er(this,e),t=this,r=[{needCache:!0}],n=gi(n=e),rs(t,KZn()?Di(n,r||[],gi(t).constructor):n.apply(t,r));var t,n,r}return vs(e,mc),Dr(e,[{key:"makeHtml",value:function(n,r){var o=this;return n.replace(this.RULE.reg,function(s){var a,l,d=s.split(/[\r\n]/).length,u=s.replace("[html]","").replace("[/html]","").replace(/[\r\n]/g,"").replace(/</g,"<").replace(/>/g,">").replace('style="LAYOUT-GRID','style="');u=o._trimScripTag(u);var h=r(u);return nt(a=nt(l='
    ')).call(a,u,"
    ")})}},{key:"rule",value:function(){return{reg:/\[html\]([\s\S]*?)\[\/html\]/g}}},{key:"_trimScripTag",value:function(n){return n.replace(/(<(?:script|script\s[^>]*)>)([\s\S]*?)(<\/script>)/gi,"").replace(/(