diff --git a/play/app.js b/play/app.js index c5d87a9c..0137e79a 100644 --- a/play/app.js +++ b/play/app.js @@ -1373,7 +1373,7 @@ with amaranth_playground.show_waveforms(sim): amaranth_playground.show_verilog(verilog.convert(m, ports=[count])) # amaranth_playground.show_rtlil(rtlil.convert(m, ports=[count])) -`};function Zoi(){let{hash:i}=window.location;if(i!==""){history.replaceState(null,""," ");let e=i.substring(1);try{return JSON.parse(atob(e))}catch{try{return JSON.parse(decodeURIComponent(e.replace("+","%20")))}catch{}}}}function Xoi(i,e){return e.map((t,n)=>Si.createElement("span",{key:`${i}-${n}`,className:`terminal-${t.stream}`},t.text))}function Qoi(){let{mode:i,setMode:e}=xhe();(0,Qs.useEffect)(()=>IL.setTheme(i==="light"?"vs":"vs-dark"),[i]);let t=Zoi(),[n,o]=(0,Qs.useState)(t?.av??localStorage.getItem("amaranth-playground.amaranthVersion")??rE.amaranthVersions[0]);(0,Qs.useEffect)(()=>localStorage.setItem("amaranth-playground.amaranthVersion",n),[n]);let[r,s]=(0,Qs.useState)(!1),[a,l]=(0,Qs.useState)(!1),[c,d]=(0,Qs.useState)(localStorage.getItem("amaranth-playground.tutorialDone")!==null);(0,Qs.useEffect)(()=>c?localStorage.setItem("amaranth-playground.tutorialDone",""):void 0,[c]);let[u,h]=(0,Qs.useState)(c?"amaranth-source":"tutorial"),[f,p]=(0,Qs.useState)(t?.s??localStorage.getItem("amaranth-playground.source")??rE.demoCode);(0,Qs.useEffect)(()=>localStorage.setItem("amaranth-playground.source",f),[f]);let[m,y]=(0,Qs.useState)(null),[b,_]=(0,Qs.useState)(!0),[v,C]=(0,Qs.useState)(null),[w,S]=(0,Qs.useState)(!1),[x,k]=(0,Qs.useState)(null),[E,T]=(0,Qs.useState)(null),A=(0,Qs.useRef)(new tE(f,p,"python")),D=(0,Qs.useRef)(new tE(x,null,"rtlil"));(0,Qs.useEffect)(()=>{D.current.text=x??""},[x]);let L=(0,Qs.useRef)(new tE(E,null,"verilog"));(0,Qs.useEffect)(()=>{L.current.text=E??""},[E]);function I(){A.current.text=rE.demoCode,h("amaranth-source")}function M(){d(!0),h("amaranth-source")}async function N(){if(!r)try{s(!0),m!==null&&y([]);let G=!1,ae=!1,Y=!1;await y_t.runPython(f,{packages:rE.pythonPackages[n],onStdout:se=>y(Ue=>(Ue??[]).concat([{stream:"stdout",text:se}])),onStderr:se=>y(Ue=>(Ue??[]).concat([{stream:"stderr",text:se}])),onShowRtlil:se=>{G=!0,k(se)},onShowVerilog:se=>{ae=!0,T(se)},onShowWaveforms:se=>{Y=!0,C(se)}}),x&&!G&&(k(null),h(u==="rtlil-product"?"amaranth-source":u)),E&&!ae&&(T(null),h(u==="verilog-product"?"amaranth-source":u)),v&&!Y&&(C(null),h(u==="waveforms-product"?"amaranth-source":u)),S(!1)}catch(G){if(G instanceof eF)y(ae=>(ae??[]).concat([{stream:"stderr",text:G.message}])),h("python-output");else throw G}finally{s(!1)}}function P({key:G,title:ae,titleStyle:Y={},content:se}){return[Si.createElement(u1e,{key:`${G}-tab`,value:G,style:Y},ae),Si.createElement(f1e,{key:`${G}-tabpanel`,value:G,sx:{padding:0}},se)]}let R=[P({key:"tutorial",title:Si.createElement(vse.default,null),content:Si.createElement(a1,{sx:{padding:2,maxWidth:"80em"}},Si.createElement("p",null,"Hi there!"),Si.createElement("p",null,"On this page, you can experiment with the ",Si.createElement(df,{href:"https://amaranth-lang.org/"},"Amaranth")," hardware definition language: run a small program, watch its output, see the waveforms a simulation generates, look at the RTL the compiler produces, and share it with friends, if you like!"),Si.createElement("p",null,'To switch between views, use the tab bar right above this text. The tab with the "',Si.createElement(vse.default,{fontSize:"small"}),'" icon shows this tutorial. When you open this page, the only other visible tab will be "Amaranth Source", containing a demonstration program. Go ahead and open it! Then switch back to the tutorial by clicking ',Si.createElement(vse.default,{fontSize:"small"}),". (If the demonstration program doesn't appear, or if you edited it and now want to go back, you can ",Si.createElement(df,{onClick:I},"reload it"),".)"),Si.createElement("p",null,'The code you enter in the "Amaranth Source" tab is ordinary Python code that runs in an environment where the Amaranth Python package and its dependencies are already installed. You can write ',Si.createElement("code",null,"import amaranth"),` and start experimenting without any distractions. Once you're done, click the "`,Si.createElement(tF.default,{fontSize:"small"}),' Run" button in the top left, or press ',Si.createElement("kbd",null,"Ctrl"),"+",Si.createElement("kbd",null,"Enter")," while the editor is focused. Go ahead and try!"),Si.createElement("p",null,"You will see several new tabs appear:"),Si.createElement("ul",null,Si.createElement("li",null,'The "Python Output" tab contains the text from the standard output and standard error streams of the Python interpreter. If you run the ',Si.createElement("code",null,"print()")," function, this tab will contain the output. Any exceptions raised by the Python code will also be shown here."),Si.createElement("li",null,'The "Waveforms" tab visualizes how the values of signals change during the simulation. It appears only if the code includes a ',Si.createElement("code",null,"with amaranth_playground.show_waveforms(sim):")," statement. When you open the tab, the waveform viewer will display an overview of the entire simulation. You can scroll the mouse wheel to zoom, and drag the area with the waveforms with the left mouse button to move the viewport."),Si.createElement("li",null,'The "Generated Verilog" tab shows the output of the Amaranth compiler. It appears only if the code includes a ',Si.createElement("code",null,"amaranth_playground.show_verilog(...)")," ","statement.")),Si.createElement("p",null,`The contents of these tabs isn't automatically updated: you need to click the "`,Si.createElement(tF.default,{fontSize:"small"}),' Run" button every time you modify the code to see how the changes in it affect the results. Try changing something and clicking "',Si.createElement(tF.default,{fontSize:"small"}),' Run" now!'),Si.createElement("p",null,`The code you write in the "Amaranth Source" tab is automatically saved when you change it, so if you leave this page and come back to it later, it should be exactly as you left it. However, don't rely on it to save your important code: only one copy of the code is saved, so if you open this page in several browser tabs or windows, all but one programs will be lost.`),Si.createElement("p",null,'If you click the "',Si.createElement(Sxe.default,{fontSize:"small"}),` Share" button in the top right corner of this page, a popup with a link will appear right there. This link contains a copy of the source code you entered (and the Amaranth version you're using). You can bookmark it, or send it to someone else. When you click on the link, the code you're currently editing will be erased and replaced with the code contained in the link.`),Si.createElement("p",null,'The button with the "',i==="light"?Si.createElement(kxe.default,{fontSize:"small"}):Si.createElement(Lxe.default,{fontSize:"small"}),'" icon in the top right corner switches the color theme to use a ',i==="light"?"dark":"light"," background instead. For now, the waveform viewer always uses a dark background."),Si.createElement("p",null,"Have fun! You can now ",Si.createElement(df,{onClick:M},"mark the tutorial as complete")," ","and start experimenting, or continue reading if you want to know more details. If you want to see your design run on a real development board, try the ",Si.createElement(df,{href:"https://marketplace.visualstudio.com/items?itemName=yowasp.toolchain"},"YoWASP Toolchain")," extension for Visual Studio Code; it provides an end-to-end FPGA toolchain for the popular iCE40 and ECP5 FPGA families entirely in the browser. ","usb"in navigator?Si.createElement(Si.Fragment,null):Si.createElement(Si.Fragment,null,"(Your browser does not support WebUSB, so you will need to use a different browser or install a flashing utility separately.)")),Si.createElement("p",null,"The only functionality available in this playground that isn't a part of the Amaranth Python package or its dependencies is the ",Si.createElement("code",null,"amaranth_playground")," Python module. This built-in module provides three functions that are used to display the results of running a program in a separate tab and in the suitable format:"),Si.createElement("ul",null,Si.createElement("li",null,Si.createElement("code",null,"with amaranth_playground.show_waveforms(sim):")," displays waveforms by calling ",Si.createElement("code",null,"with sim.write_vcd(vcd_file=...)")," internally and then converting the VCD data to a format suitable for the interactive viewer."),Si.createElement("li",null,Si.createElement("code",null,"amaranth_playground.show_verilog(verilog.convert(m))")," displays Verilog code. This code is accepted by all FPGA and ASIC toolchains, and can be used to run Amaranth on essentially any hardware platform or RTL simulator."),Si.createElement("li",null,Si.createElement("code",null,"amaranth_playground.show_rtlil(rtlil.convert(m))")," displays ",Si.createElement(df,{href:"https://yosyshq.readthedocs.io/projects/yosys/en/latest/CHAPTER_Overview.html#the-rtl-intermediate-language-rtlil"},"RTLIL code"),", the ",Si.createElement(df,{href:"https://yosyshq.net"},"Yosys")," intermediate representation. This code is accepted by the open-source FPGA toolchain, and is used internally by the Amaranth compiler to produce Verilog code. Unless you are investigating a problem with the Amaranth compiler itself, the only reason to look at it is curiosity. (Which is a very good reason; try uncommenting the line with ",Si.createElement("code",null,"show_rtlil")," ","in the demonstration program and comparing the Verilog and RTLIL code side-by-side!)")),Si.createElement("p",null,"The demonstration program includes examples of using all three functions. (Remember, you can always ",Si.createElement(df,{onClick:I},"reload it")," if you changed the source.)"),Si.createElement("p",null,"\u2014 ",Si.createElement(df,{href:"https://github.com/whitequark"},'Catherine "whitequark"')),Si.createElement("p",null,"P.S.: Everything you see on this page works within your browser, and the code you enter is never sent over the network. Yes, I run Python, Amaranth, and Yosys in the browser using ",Si.createElement(df,{href:"https://webassembly.org/"},"WebAssembly"),". How cool is that?"),Si.createElement("p",null,"The source code of the playground itself is ",Si.createElement(df,{href:"https://github.com/amaranth-lang/playground"},"available on GitHub"),"."))}),P({key:"amaranth-source",title:"Amaranth Source",content:Si.createElement(Pre,{state:A.current,actions:[{id:"amaranth-playground.run",label:"Run Code",keybindings:[O8e.CtrlCmd|R8e.Enter],run:N}],padding:{top:10,bottom:10},focus:!0})})],z=(0,Qs.useRef)(f);return(0,Qs.useEffect)(()=>{f!=z.current&&S(!0),z.current=f},[f]),m!==null&&R.push(P({key:"python-output",title:"Python Output",content:Si.createElement(a1,{className:"terminal-output",sx:{paddingX:2,paddingY:1}},Xoi("python-output",m))})),(0,Qs.useEffect)(()=>{m!==null&&b&&h("python-output"),_(m===null)},[m]),v!==null&&R.push(P({key:"waveforms",title:"Waveforms",titleStyle:w?{textDecoration:"line-through"}:{},content:Si.createElement(a1,{sx:{display:"flex",flexDirection:"column",height:"100%"}},w&&Si.createElement(BI,{variant:"soft",color:"warning",sx:{borderRadius:0}},"The waveforms are out of date. Run the program again to refresh them."),Si.createElement(a1,{sx:{flexGrow:1}},Si.createElement(b_t,{data:v})))})),x!==null&&R.push(P({key:"rtlil-product",title:"Generated RTLIL",titleStyle:w?{textDecoration:"line-through"}:{},content:Si.createElement(a1,{sx:{display:"flex",flexDirection:"column",height:"100%"}},w&&Si.createElement(BI,{variant:"soft",color:"warning",sx:{borderRadius:0}},"The generated RTLIL is out of date. Run the program again to refresh it."),Si.createElement(a1,{sx:{flexGrow:1}},Si.createElement(Pre,{state:D.current,padding:{top:10,bottom:10},focus:!0})))})),E!==null&&R.push(P({key:"verilog-product",title:"Generated Verilog",titleStyle:w?{textDecoration:"line-through"}:{},content:Si.createElement(a1,{sx:{display:"flex",flexDirection:"column",height:"100%"}},w&&Si.createElement(BI,{variant:"soft",color:"warning",sx:{borderRadius:0}},"The generated Verilog is out of date. Run the program again to refresh it."),Si.createElement(a1,{sx:{flexGrow:1}},Si.createElement(Pre,{state:L.current,padding:{top:10,bottom:10},focus:!0})))})),Si.createElement(Si.Fragment,null,Si.createElement(a1,{sx:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",padding:2,gap:2}},Si.createElement(a1,{sx:{display:"flex",flexDirection:"row",gap:2}},Si.createElement(NU,{size:"lg",sx:{borderRadius:10},variant:"outlined",startDecorator:Si.createElement(tF.default,null),loading:r,onClick:()=>N()},"Run"),Si.createElement(Qfe,{size:"lg",sx:{borderRadius:10},variant:"outlined",value:n,onChange:(G,ae)=>o(ae)},rE.amaranthVersions.map(G=>Si.createElement(Jfe,{key:G,value:G},"Amaranth ",G))),Si.createElement(df,{href:`https://amaranth-lang.org/docs/amaranth/${n}/`,target:"_blank"},"Open documentation")," ",Si.createElement(a1,{sx:{flexGrow:1}}),Si.createElement(NU,{size:"lg",sx:{borderRadius:10},color:"neutral",variant:"outlined",endDecorator:Si.createElement(Sxe.default,null),onClick:()=>l(!0)},"Share"),Si.createElement(r1e,{anchorOrigin:{vertical:"top",horizontal:"right"},open:a,onClose:(G,ae)=>l(!1)},Si.createElement(df,{href:new URL("#"+btoa(JSON.stringify({av:n,s:f})),window.location.href).toString()},"Copy this link to share the source code")),Si.createElement(Yfe,{size:"lg",sx:{borderRadius:10},variant:"outlined",onClick:()=>e(i==="light"?"dark":"light")},i==="light"?Si.createElement(kxe.default,null):Si.createElement(Lxe.default,null))),Si.createElement(l1e,{sx:{height:"100%"},value:u,onChange:(G,ae)=>h(ae)},Si.createElement(c1e,null,R.map(([G,ae])=>G)),R.map(([G,ae])=>ae))))}(0,C_t.createRoot)(document.getElementById("root")).render(Si.createElement(whe,null,Si.createElement(khe,null),Si.createElement(Qoi,null)));console.log("Build ID:","636c2e4d3ba2453badbe6fc8b4e13fe9c6815436"); +`};function Zoi(){let{hash:i}=window.location;if(i!==""){history.replaceState(null,""," ");let e=i.substring(1);try{return JSON.parse(atob(e))}catch{try{return JSON.parse(decodeURIComponent(e.replace("+","%20")))}catch{}}}}function Xoi(i,e){return e.map((t,n)=>Si.createElement("span",{key:`${i}-${n}`,className:`terminal-${t.stream}`},t.text))}function Qoi(){let{mode:i,setMode:e}=xhe();(0,Qs.useEffect)(()=>IL.setTheme(i==="light"?"vs":"vs-dark"),[i]);let t=Zoi(),[n,o]=(0,Qs.useState)(t?.av??localStorage.getItem("amaranth-playground.amaranthVersion")??rE.amaranthVersions[0]);(0,Qs.useEffect)(()=>localStorage.setItem("amaranth-playground.amaranthVersion",n),[n]);let[r,s]=(0,Qs.useState)(!1),[a,l]=(0,Qs.useState)(!1),[c,d]=(0,Qs.useState)(localStorage.getItem("amaranth-playground.tutorialDone")!==null);(0,Qs.useEffect)(()=>c?localStorage.setItem("amaranth-playground.tutorialDone",""):void 0,[c]);let[u,h]=(0,Qs.useState)(c?"amaranth-source":"tutorial"),[f,p]=(0,Qs.useState)(t?.s??localStorage.getItem("amaranth-playground.source")??rE.demoCode);(0,Qs.useEffect)(()=>localStorage.setItem("amaranth-playground.source",f),[f]);let[m,y]=(0,Qs.useState)(null),[b,_]=(0,Qs.useState)(!0),[v,C]=(0,Qs.useState)(null),[w,S]=(0,Qs.useState)(!1),[x,k]=(0,Qs.useState)(null),[E,T]=(0,Qs.useState)(null),A=(0,Qs.useRef)(new tE(f,p,"python")),D=(0,Qs.useRef)(new tE(x,null,"rtlil"));(0,Qs.useEffect)(()=>{D.current.text=x??""},[x]);let L=(0,Qs.useRef)(new tE(E,null,"verilog"));(0,Qs.useEffect)(()=>{L.current.text=E??""},[E]);function I(){A.current.text=rE.demoCode,h("amaranth-source")}function M(){d(!0),h("amaranth-source")}async function N(){if(!r)try{s(!0),m!==null&&y([]);let G=!1,ae=!1,Y=!1;await y_t.runPython(f,{packages:rE.pythonPackages[n],onStdout:se=>y(Ue=>(Ue??[]).concat([{stream:"stdout",text:se}])),onStderr:se=>y(Ue=>(Ue??[]).concat([{stream:"stderr",text:se}])),onShowRtlil:se=>{G=!0,k(se)},onShowVerilog:se=>{ae=!0,T(se)},onShowWaveforms:se=>{Y=!0,C(se)}}),x&&!G&&(k(null),h(u==="rtlil-product"?"amaranth-source":u)),E&&!ae&&(T(null),h(u==="verilog-product"?"amaranth-source":u)),v&&!Y&&(C(null),h(u==="waveforms-product"?"amaranth-source":u)),S(!1)}catch(G){if(G instanceof eF)y(ae=>(ae??[]).concat([{stream:"stderr",text:G.message}])),h("python-output");else throw G}finally{s(!1)}}function P({key:G,title:ae,titleStyle:Y={},content:se}){return[Si.createElement(u1e,{key:`${G}-tab`,value:G,style:Y},ae),Si.createElement(f1e,{key:`${G}-tabpanel`,value:G,sx:{padding:0}},se)]}let R=[P({key:"tutorial",title:Si.createElement(vse.default,null),content:Si.createElement(a1,{sx:{padding:2,maxWidth:"80em"}},Si.createElement("p",null,"Hi there!"),Si.createElement("p",null,"On this page, you can experiment with the ",Si.createElement(df,{href:"https://amaranth-lang.org/"},"Amaranth")," hardware definition language: run a small program, watch its output, see the waveforms a simulation generates, look at the RTL the compiler produces, and share it with friends, if you like!"),Si.createElement("p",null,'To switch between views, use the tab bar right above this text. The tab with the "',Si.createElement(vse.default,{fontSize:"small"}),'" icon shows this tutorial. When you open this page, the only other visible tab will be "Amaranth Source", containing a demonstration program. Go ahead and open it! Then switch back to the tutorial by clicking ',Si.createElement(vse.default,{fontSize:"small"}),". (If the demonstration program doesn't appear, or if you edited it and now want to go back, you can ",Si.createElement(df,{onClick:I},"reload it"),".)"),Si.createElement("p",null,'The code you enter in the "Amaranth Source" tab is ordinary Python code that runs in an environment where the Amaranth Python package and its dependencies are already installed. You can write ',Si.createElement("code",null,"import amaranth"),` and start experimenting without any distractions. Once you're done, click the "`,Si.createElement(tF.default,{fontSize:"small"}),' Run" button in the top left, or press ',Si.createElement("kbd",null,"Ctrl"),"+",Si.createElement("kbd",null,"Enter")," while the editor is focused. Go ahead and try!"),Si.createElement("p",null,"You will see several new tabs appear:"),Si.createElement("ul",null,Si.createElement("li",null,'The "Python Output" tab contains the text from the standard output and standard error streams of the Python interpreter. If you run the ',Si.createElement("code",null,"print()")," function, this tab will contain the output. Any exceptions raised by the Python code will also be shown here."),Si.createElement("li",null,'The "Waveforms" tab visualizes how the values of signals change during the simulation. It appears only if the code includes a ',Si.createElement("code",null,"with amaranth_playground.show_waveforms(sim):")," statement. When you open the tab, the waveform viewer will display an overview of the entire simulation. You can scroll the mouse wheel to zoom, and drag the area with the waveforms with the left mouse button to move the viewport."),Si.createElement("li",null,'The "Generated Verilog" tab shows the output of the Amaranth compiler. It appears only if the code includes a ',Si.createElement("code",null,"amaranth_playground.show_verilog(...)")," ","statement.")),Si.createElement("p",null,`The contents of these tabs isn't automatically updated: you need to click the "`,Si.createElement(tF.default,{fontSize:"small"}),' Run" button every time you modify the code to see how the changes in it affect the results. Try changing something and clicking "',Si.createElement(tF.default,{fontSize:"small"}),' Run" now!'),Si.createElement("p",null,`The code you write in the "Amaranth Source" tab is automatically saved when you change it, so if you leave this page and come back to it later, it should be exactly as you left it. However, don't rely on it to save your important code: only one copy of the code is saved, so if you open this page in several browser tabs or windows, all but one programs will be lost.`),Si.createElement("p",null,'If you click the "',Si.createElement(Sxe.default,{fontSize:"small"}),` Share" button in the top right corner of this page, a popup with a link will appear right there. This link contains a copy of the source code you entered (and the Amaranth version you're using). You can bookmark it, or send it to someone else. When you click on the link, the code you're currently editing will be erased and replaced with the code contained in the link.`),Si.createElement("p",null,'The button with the "',i==="light"?Si.createElement(kxe.default,{fontSize:"small"}):Si.createElement(Lxe.default,{fontSize:"small"}),'" icon in the top right corner switches the color theme to use a ',i==="light"?"dark":"light"," background instead. For now, the waveform viewer always uses a dark background."),Si.createElement("p",null,"Have fun! You can now ",Si.createElement(df,{onClick:M},"mark the tutorial as complete")," ","and start experimenting, or continue reading if you want to know more details. If you want to see your design run on a real development board, try the ",Si.createElement(df,{href:"https://marketplace.visualstudio.com/items?itemName=yowasp.toolchain"},"YoWASP Toolchain")," extension for Visual Studio Code; it provides an end-to-end FPGA toolchain for the popular iCE40 and ECP5 FPGA families entirely in the browser. ","usb"in navigator?Si.createElement(Si.Fragment,null):Si.createElement(Si.Fragment,null,"(Your browser does not support WebUSB, so you will need to use a different browser or install a flashing utility separately.)")),Si.createElement("p",null,"The only functionality available in this playground that isn't a part of the Amaranth Python package or its dependencies is the ",Si.createElement("code",null,"amaranth_playground")," Python module. This built-in module provides three functions that are used to display the results of running a program in a separate tab and in the suitable format:"),Si.createElement("ul",null,Si.createElement("li",null,Si.createElement("code",null,"with amaranth_playground.show_waveforms(sim):")," displays waveforms by calling ",Si.createElement("code",null,"with sim.write_vcd(vcd_file=...)")," internally and then converting the VCD data to a format suitable for the interactive viewer."),Si.createElement("li",null,Si.createElement("code",null,"amaranth_playground.show_verilog(verilog.convert(m))")," displays Verilog code. This code is accepted by all FPGA and ASIC toolchains, and can be used to run Amaranth on essentially any hardware platform or RTL simulator."),Si.createElement("li",null,Si.createElement("code",null,"amaranth_playground.show_rtlil(rtlil.convert(m))")," displays ",Si.createElement(df,{href:"https://yosyshq.readthedocs.io/projects/yosys/en/latest/CHAPTER_Overview.html#the-rtl-intermediate-language-rtlil"},"RTLIL code"),", the ",Si.createElement(df,{href:"https://yosyshq.net"},"Yosys")," intermediate representation. This code is accepted by the open-source FPGA toolchain, and is used internally by the Amaranth compiler to produce Verilog code. Unless you are investigating a problem with the Amaranth compiler itself, the only reason to look at it is curiosity. (Which is a very good reason; try uncommenting the line with ",Si.createElement("code",null,"show_rtlil")," ","in the demonstration program and comparing the Verilog and RTLIL code side-by-side!)")),Si.createElement("p",null,"The demonstration program includes examples of using all three functions. (Remember, you can always ",Si.createElement(df,{onClick:I},"reload it")," if you changed the source.)"),Si.createElement("p",null,"\u2014 ",Si.createElement(df,{href:"https://github.com/whitequark"},'Catherine "whitequark"')),Si.createElement("p",null,"P.S.: Everything you see on this page works within your browser, and the code you enter is never sent over the network. Yes, I run Python, Amaranth, and Yosys in the browser using ",Si.createElement(df,{href:"https://webassembly.org/"},"WebAssembly"),". How cool is that?"),Si.createElement("p",null,"The source code of the playground itself is ",Si.createElement(df,{href:"https://github.com/amaranth-lang/playground"},"available on GitHub"),"."))}),P({key:"amaranth-source",title:"Amaranth Source",content:Si.createElement(Pre,{state:A.current,actions:[{id:"amaranth-playground.run",label:"Run Code",keybindings:[O8e.CtrlCmd|R8e.Enter],run:N}],padding:{top:10,bottom:10},focus:!0})})],z=(0,Qs.useRef)(f);return(0,Qs.useEffect)(()=>{f!=z.current&&S(!0),z.current=f},[f]),m!==null&&R.push(P({key:"python-output",title:"Python Output",content:Si.createElement(a1,{className:"terminal-output",sx:{paddingX:2,paddingY:1}},Xoi("python-output",m))})),(0,Qs.useEffect)(()=>{m!==null&&b&&h("python-output"),_(m===null)},[m]),v!==null&&R.push(P({key:"waveforms",title:"Waveforms",titleStyle:w?{textDecoration:"line-through"}:{},content:Si.createElement(a1,{sx:{display:"flex",flexDirection:"column",height:"100%"}},w&&Si.createElement(BI,{variant:"soft",color:"warning",sx:{borderRadius:0}},"The waveforms are out of date. Run the program again to refresh them."),Si.createElement(a1,{sx:{flexGrow:1}},Si.createElement(b_t,{data:v})))})),x!==null&&R.push(P({key:"rtlil-product",title:"Generated RTLIL",titleStyle:w?{textDecoration:"line-through"}:{},content:Si.createElement(a1,{sx:{display:"flex",flexDirection:"column",height:"100%"}},w&&Si.createElement(BI,{variant:"soft",color:"warning",sx:{borderRadius:0}},"The generated RTLIL is out of date. Run the program again to refresh it."),Si.createElement(a1,{sx:{flexGrow:1}},Si.createElement(Pre,{state:D.current,padding:{top:10,bottom:10},focus:!0})))})),E!==null&&R.push(P({key:"verilog-product",title:"Generated Verilog",titleStyle:w?{textDecoration:"line-through"}:{},content:Si.createElement(a1,{sx:{display:"flex",flexDirection:"column",height:"100%"}},w&&Si.createElement(BI,{variant:"soft",color:"warning",sx:{borderRadius:0}},"The generated Verilog is out of date. Run the program again to refresh it."),Si.createElement(a1,{sx:{flexGrow:1}},Si.createElement(Pre,{state:L.current,padding:{top:10,bottom:10},focus:!0})))})),Si.createElement(Si.Fragment,null,Si.createElement(a1,{sx:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",padding:2,gap:2}},Si.createElement(a1,{sx:{display:"flex",flexDirection:"row",gap:2}},Si.createElement(NU,{size:"lg",sx:{borderRadius:10},variant:"outlined",startDecorator:Si.createElement(tF.default,null),loading:r,onClick:()=>N()},"Run"),Si.createElement(Qfe,{size:"lg",sx:{borderRadius:10},variant:"outlined",value:n,onChange:(G,ae)=>o(ae)},rE.amaranthVersions.map(G=>Si.createElement(Jfe,{key:G,value:G},"Amaranth ",G))),Si.createElement(df,{href:`https://amaranth-lang.org/docs/amaranth/${n}/`,target:"_blank"},"Open documentation")," ",Si.createElement(a1,{sx:{flexGrow:1}}),Si.createElement(NU,{size:"lg",sx:{borderRadius:10},color:"neutral",variant:"outlined",endDecorator:Si.createElement(Sxe.default,null),onClick:()=>l(!0)},"Share"),Si.createElement(r1e,{anchorOrigin:{vertical:"top",horizontal:"right"},open:a,onClose:(G,ae)=>l(!1)},Si.createElement(df,{href:new URL("#"+btoa(JSON.stringify({av:n,s:f})),window.location.href).toString()},"Copy this link to share the source code")),Si.createElement(Yfe,{size:"lg",sx:{borderRadius:10},variant:"outlined",onClick:()=>e(i==="light"?"dark":"light")},i==="light"?Si.createElement(kxe.default,null):Si.createElement(Lxe.default,null))),Si.createElement(l1e,{sx:{height:"100%"},value:u,onChange:(G,ae)=>h(ae)},Si.createElement(c1e,null,R.map(([G,ae])=>G)),R.map(([G,ae])=>ae))))}(0,C_t.createRoot)(document.getElementById("root")).render(Si.createElement(whe,{defaultMode:"system"},Si.createElement(khe,null),Si.createElement(Qoi,null)));console.log("Build ID:","270449710221202d015d328213bfc9c10fa26f2d"); /*! Bundled license information: react/cjs/react.production.min.js: diff --git a/play/app.js.map b/play/app.js.map index 66cac44f..03ce5e26 100644 --- a/play/app.js.map +++ b/play/app.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../node_modules/react/cjs/react.production.min.js", "../node_modules/react/index.js", "../node_modules/scheduler/cjs/scheduler.production.min.js", "../node_modules/scheduler/index.js", "../node_modules/react-dom/cjs/react-dom.production.min.js", "../node_modules/react-dom/index.js", "../node_modules/react-dom/client.js", "../node_modules/@babel/runtime/helpers/interopRequireDefault.js", "../node_modules/@mui/utils/node/formatMuiErrorMessage/formatMuiErrorMessage.js", "../node_modules/@mui/utils/node/formatMuiErrorMessage/index.js", "../node_modules/@babel/runtime/helpers/esm/extends.js", "../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js", "../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js", "../node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js", "../node_modules/stylis/src/Enum.js", "../node_modules/stylis/src/Utility.js", "../node_modules/stylis/src/Tokenizer.js", "../node_modules/stylis/src/Parser.js", "../node_modules/stylis/src/Prefixer.js", "../node_modules/stylis/src/Serializer.js", "../node_modules/stylis/src/Middleware.js", "../node_modules/stylis/index.js", "../node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js", "../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js", "../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js", "../node_modules/hoist-non-react-statics/node_modules/react-is/index.js", "../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js", "../node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js", "../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js", "../node_modules/@emotion/hash/dist/emotion-hash.esm.js", "../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js", "../node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js", "../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js", "../node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js", "../node_modules/@emotion/react/dist/emotion-react.browser.esm.js", "../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js", "../node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js", "../node_modules/prop-types/lib/ReactPropTypesSecret.js", "../node_modules/prop-types/factoryWithThrowingShims.js", "../node_modules/prop-types/index.js", "../node_modules/react/cjs/react-jsx-runtime.production.min.js", "../node_modules/react/jsx-runtime.js", "../node_modules/@mui/styled-engine/node/StyledEngineProvider/StyledEngineProvider.js", "../node_modules/@mui/styled-engine/node/StyledEngineProvider/index.js", "../node_modules/@mui/styled-engine/node/GlobalStyles/GlobalStyles.js", "../node_modules/@mui/styled-engine/node/GlobalStyles/index.js", "../node_modules/@mui/styled-engine/node/index.js", "../node_modules/@babel/runtime/helpers/extends.js", "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js", "../node_modules/@mui/utils/node/chainPropTypes/chainPropTypes.js", "../node_modules/@mui/utils/node/chainPropTypes/index.js", "../node_modules/@mui/utils/node/deepmerge/deepmerge.js", "../node_modules/@mui/utils/node/deepmerge/index.js", "../node_modules/@mui/utils/node/elementAcceptingRef/elementAcceptingRef.js", "../node_modules/@mui/utils/node/elementAcceptingRef/index.js", "../node_modules/@mui/utils/node/elementTypeAcceptingRef/elementTypeAcceptingRef.js", "../node_modules/@mui/utils/node/elementTypeAcceptingRef/index.js", "../node_modules/@mui/utils/node/exactProp/exactProp.js", "../node_modules/@mui/utils/node/exactProp/index.js", "../node_modules/react-is/cjs/react-is.production.min.js", "../node_modules/react-is/index.js", "../node_modules/@mui/utils/node/getDisplayName/getDisplayName.js", "../node_modules/@mui/utils/node/getDisplayName/index.js", "../node_modules/@mui/utils/node/HTMLElementType/HTMLElementType.js", "../node_modules/@mui/utils/node/HTMLElementType/index.js", "../node_modules/@mui/utils/node/ponyfillGlobal/ponyfillGlobal.js", "../node_modules/@mui/utils/node/ponyfillGlobal/index.js", "../node_modules/@mui/utils/node/refType/refType.js", "../node_modules/@mui/utils/node/refType/index.js", "../node_modules/@mui/utils/node/capitalize/capitalize.js", "../node_modules/@mui/utils/node/capitalize/index.js", "../node_modules/@mui/utils/node/createChainedFunction/createChainedFunction.js", "../node_modules/@mui/utils/node/createChainedFunction/index.js", "../node_modules/@mui/utils/node/debounce/debounce.js", "../node_modules/@mui/utils/node/debounce/index.js", "../node_modules/@mui/utils/node/deprecatedPropType/deprecatedPropType.js", "../node_modules/@mui/utils/node/deprecatedPropType/index.js", "../node_modules/@mui/utils/node/isMuiElement/isMuiElement.js", "../node_modules/@mui/utils/node/isMuiElement/index.js", "../node_modules/@mui/utils/node/ownerDocument/ownerDocument.js", "../node_modules/@mui/utils/node/ownerDocument/index.js", "../node_modules/@mui/utils/node/ownerWindow/ownerWindow.js", "../node_modules/@mui/utils/node/ownerWindow/index.js", "../node_modules/@mui/utils/node/requirePropFactory/requirePropFactory.js", "../node_modules/@mui/utils/node/requirePropFactory/index.js", "../node_modules/@mui/utils/node/setRef/setRef.js", "../node_modules/@mui/utils/node/setRef/index.js", "../node_modules/@mui/utils/node/useEnhancedEffect/useEnhancedEffect.js", "../node_modules/@mui/utils/node/useEnhancedEffect/index.js", "../node_modules/@mui/utils/node/useId/useId.js", "../node_modules/@mui/utils/node/useId/index.js", "../node_modules/@mui/utils/node/unsupportedProp/unsupportedProp.js", "../node_modules/@mui/utils/node/unsupportedProp/index.js", "../node_modules/@mui/utils/node/useControlled/useControlled.js", "../node_modules/@mui/utils/node/useControlled/index.js", "../node_modules/@mui/utils/node/useEventCallback/useEventCallback.js", "../node_modules/@mui/utils/node/useEventCallback/index.js", "../node_modules/@mui/utils/node/useForkRef/useForkRef.js", "../node_modules/@mui/utils/node/useForkRef/index.js", "../node_modules/@mui/utils/node/useLazyRef/useLazyRef.js", "../node_modules/@mui/utils/node/useLazyRef/index.js", "../node_modules/@mui/utils/node/useOnMount/useOnMount.js", "../node_modules/@mui/utils/node/useTimeout/useTimeout.js", "../node_modules/@mui/utils/node/useTimeout/index.js", "../node_modules/@mui/utils/node/useOnMount/index.js", "../node_modules/@mui/utils/node/useIsFocusVisible/useIsFocusVisible.js", "../node_modules/@mui/utils/node/useIsFocusVisible/index.js", "../node_modules/@mui/utils/node/getScrollbarSize/getScrollbarSize.js", "../node_modules/@mui/utils/node/getScrollbarSize/index.js", "../node_modules/@mui/utils/node/scrollLeft/scrollLeft.js", "../node_modules/@mui/utils/node/scrollLeft/index.js", "../node_modules/@mui/utils/node/usePreviousProps/usePreviousProps.js", "../node_modules/@mui/utils/node/usePreviousProps/index.js", "../node_modules/@mui/utils/node/getValidReactChildren/getValidReactChildren.js", "../node_modules/@mui/utils/node/getValidReactChildren/index.js", "../node_modules/@mui/utils/node/visuallyHidden/visuallyHidden.js", "../node_modules/@mui/utils/node/visuallyHidden/index.js", "../node_modules/@mui/utils/node/integerPropType/integerPropType.js", "../node_modules/@mui/utils/node/integerPropType/index.js", "../node_modules/@mui/utils/node/resolveProps/resolveProps.js", "../node_modules/@mui/utils/node/resolveProps/index.js", "../node_modules/@mui/utils/node/composeClasses/composeClasses.js", "../node_modules/@mui/utils/node/composeClasses/index.js", "../node_modules/@mui/utils/node/ClassNameGenerator/ClassNameGenerator.js", "../node_modules/@mui/utils/node/ClassNameGenerator/index.js", "../node_modules/@mui/utils/node/generateUtilityClass/generateUtilityClass.js", "../node_modules/@mui/utils/node/generateUtilityClass/index.js", "../node_modules/@mui/utils/node/generateUtilityClasses/generateUtilityClasses.js", "../node_modules/@mui/utils/node/generateUtilityClasses/index.js", "../node_modules/@mui/utils/node/clamp/clamp.js", "../node_modules/@mui/utils/node/clamp/index.js", "../node_modules/@mui/utils/node/index.js", "../node_modules/@mui/system/createTheme/createBreakpoints.js", "../node_modules/@mui/system/createTheme/shape.js", "../node_modules/@mui/system/responsivePropType.js", "../node_modules/@mui/system/merge.js", "../node_modules/@mui/system/breakpoints.js", "../node_modules/@mui/system/style.js", "../node_modules/@mui/system/memoize.js", "../node_modules/@mui/system/spacing.js", "../node_modules/@mui/system/createTheme/createSpacing.js", "../node_modules/@mui/system/compose.js", "../node_modules/@mui/system/borders.js", "../node_modules/@mui/system/cssGrid.js", "../node_modules/@mui/system/palette.js", "../node_modules/@mui/system/sizing.js", "../node_modules/@mui/system/styleFunctionSx/defaultSxConfig.js", "../node_modules/@mui/system/styleFunctionSx/styleFunctionSx.js", "../node_modules/@mui/system/createTheme/applyStyles.js", "../node_modules/@mui/system/createTheme/createTheme.js", "../node_modules/@mui/system/createTheme/index.js", "../node_modules/@mui/system/useThemeWithoutDefault.js", "../node_modules/@mui/system/useTheme.js", "../node_modules/@mui/system/GlobalStyles/GlobalStyles.js", "../node_modules/@mui/system/GlobalStyles/index.js", "../node_modules/@mui/system/display.js", "../node_modules/@mui/system/flexbox.js", "../node_modules/@mui/system/positions.js", "../node_modules/@mui/system/shadows.js", "../node_modules/@mui/system/typography.js", "../node_modules/@mui/system/styleFunctionSx/extendSxProp.js", "../node_modules/@mui/system/styleFunctionSx/index.js", "../node_modules/@mui/system/getThemeValue.js", "../node_modules/clsx/dist/clsx.js", "../node_modules/@mui/system/createBox.js", "../node_modules/@mui/system/Box/boxClasses.js", "../node_modules/@mui/system/Box/Box.js", "../node_modules/@mui/system/Box/index.js", "../node_modules/@mui/system/createStyled.js", "../node_modules/@mui/system/styled.js", "../node_modules/@mui/system/useThemeProps/getThemeProps.js", "../node_modules/@mui/system/useThemeProps/useThemeProps.js", "../node_modules/@mui/system/useThemeProps/index.js", "../node_modules/@mui/system/colorManipulator.js", "../node_modules/@mui/private-theming/node/useTheme/ThemeContext.js", "../node_modules/@mui/private-theming/node/useTheme/useTheme.js", "../node_modules/@mui/private-theming/node/useTheme/index.js", "../node_modules/@mui/private-theming/node/ThemeProvider/nested.js", "../node_modules/@mui/private-theming/node/ThemeProvider/ThemeProvider.js", "../node_modules/@mui/private-theming/node/ThemeProvider/index.js", "../node_modules/@mui/private-theming/node/index.js", "../node_modules/@mui/system/ThemeProvider/ThemeProvider.js", "../node_modules/@mui/system/ThemeProvider/index.js", "../node_modules/@mui/system/cssVars/getInitColorSchemeScript.js", "../node_modules/@mui/system/cssVars/useCurrentColorScheme.js", "../node_modules/@mui/system/cssVars/createCssVarsProvider.js", "../node_modules/@mui/system/cssVars/createGetCssVar.js", "../node_modules/@mui/system/cssVars/cssVarsParser.js", "../node_modules/@mui/system/cssVars/prepareCssVars.js", "../node_modules/@mui/system/cssVars/createCssVarsTheme.js", "../node_modules/@mui/system/Container/createContainer.js", "../node_modules/@mui/system/Container/Container.js", "../node_modules/@mui/system/Container/containerClasses.js", "../node_modules/@mui/system/Container/index.js", "../node_modules/@mui/system/Unstable_Grid/traverseBreakpoints.js", "../node_modules/@mui/system/Unstable_Grid/gridGenerator.js", "../node_modules/@mui/system/Unstable_Grid/createGrid.js", "../node_modules/@mui/system/Unstable_Grid/Grid.js", "../node_modules/@mui/system/Unstable_Grid/GridProps.js", "../node_modules/@mui/system/Unstable_Grid/gridClasses.js", "../node_modules/@mui/system/Unstable_Grid/index.js", "../node_modules/@mui/system/Stack/createStack.js", "../node_modules/@mui/system/Stack/Stack.js", "../node_modules/@mui/system/Stack/StackProps.js", "../node_modules/@mui/system/Stack/stackClasses.js", "../node_modules/@mui/system/Stack/index.js", "../node_modules/@mui/system/index.js", "../node_modules/@mui/base/node/composeClasses/index.js", "../node_modules/@mui/base/node/ClassNameGenerator/index.js", "../node_modules/@mui/material/node/utils/capitalize.js", "../node_modules/@mui/material/node/utils/createChainedFunction.js", "../node_modules/@mui/material/node/styles/createMixins.js", "../node_modules/@mui/material/node/colors/common.js", "../node_modules/@mui/material/node/colors/grey.js", "../node_modules/@mui/material/node/colors/purple.js", "../node_modules/@mui/material/node/colors/red.js", "../node_modules/@mui/material/node/colors/orange.js", "../node_modules/@mui/material/node/colors/blue.js", "../node_modules/@mui/material/node/colors/lightBlue.js", "../node_modules/@mui/material/node/colors/green.js", "../node_modules/@mui/material/node/styles/createPalette.js", "../node_modules/@mui/material/node/styles/createTypography.js", "../node_modules/@mui/material/node/styles/shadows.js", "../node_modules/@mui/material/node/styles/createTransitions.js", "../node_modules/@mui/material/node/styles/zIndex.js", "../node_modules/@mui/material/node/styles/createTheme.js", "../node_modules/@mui/material/node/styles/defaultTheme.js", "../node_modules/@mui/material/node/styles/identifier.js", "../node_modules/@mui/material/node/styles/useThemeProps.js", "../node_modules/@mui/material/node/styles/styled.js", "../node_modules/@mui/material/node/SvgIcon/svgIconClasses.js", "../node_modules/@mui/material/node/SvgIcon/SvgIcon.js", "../node_modules/@mui/material/node/SvgIcon/index.js", "../node_modules/@mui/material/node/utils/createSvgIcon.js", "../node_modules/@mui/material/node/utils/debounce.js", "../node_modules/@mui/material/node/utils/deprecatedPropType.js", "../node_modules/@mui/material/node/utils/isMuiElement.js", "../node_modules/@mui/material/node/utils/ownerDocument.js", "../node_modules/@mui/material/node/utils/ownerWindow.js", "../node_modules/@mui/material/node/utils/requirePropFactory.js", "../node_modules/@mui/material/node/utils/setRef.js", "../node_modules/@mui/material/node/utils/useEnhancedEffect.js", "../node_modules/@mui/material/node/utils/useId.js", "../node_modules/@mui/material/node/utils/unsupportedProp.js", "../node_modules/@mui/material/node/utils/useControlled.js", "../node_modules/@mui/material/node/utils/useEventCallback.js", "../node_modules/@mui/material/node/utils/useForkRef.js", "../node_modules/@mui/material/node/utils/useIsFocusVisible.js", "../node_modules/@mui/material/node/utils/index.js", "../node_modules/@mui/icons-material/utils/createSvgIcon.js", "../node_modules/@mui/icons-material/PlayArrow.js", "../node_modules/@mui/icons-material/Share.js", "../node_modules/@mui/icons-material/DarkMode.js", "../node_modules/@mui/icons-material/LightMode.js", "../node_modules/@mui/icons-material/QuestionMark.js", "../node_modules/monaco-editor/esm/vs/base/common/arrays.js", "../node_modules/monaco-editor/esm/vs/base/common/types.js", "../node_modules/monaco-editor/esm/vs/base/common/objects.js", "../node_modules/monaco-editor/esm/vs/nls.js", "../node_modules/monaco-editor/esm/vs/base/common/platform.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/textModelDefaults.js", "../node_modules/monaco-editor/esm/vs/base/common/iterator.js", "../node_modules/monaco-editor/esm/vs/base/common/linkedList.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/wordHelper.js", "../node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js", "../node_modules/monaco-editor/esm/vs/base/common/errors.js", "../node_modules/monaco-editor/esm/vs/base/common/functional.js", "../node_modules/monaco-editor/esm/vs/base/common/lifecycle.js", "../node_modules/monaco-editor/esm/vs/base/common/stopwatch.js", "../node_modules/monaco-editor/esm/vs/base/common/event.js", "../node_modules/monaco-editor/esm/vs/base/common/cancellation.js", "../node_modules/monaco-editor/esm/vs/base/common/keyCodes.js", "../node_modules/monaco-editor/esm/vs/base/common/process.js", "../node_modules/monaco-editor/esm/vs/base/common/path.js", "../node_modules/monaco-editor/esm/vs/base/common/uri.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/position.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/range.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/selection.js", "../node_modules/monaco-editor/esm/vs/base/common/codicons.js", "../node_modules/monaco-editor/esm/vs/editor/common/tokenizationRegistry.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages.js", "../node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/editorBaseApi.js", "../node_modules/monaco-editor/esm/vs/base/browser/window.js", "../node_modules/monaco-editor/esm/vs/base/common/cache.js", "../node_modules/monaco-editor/esm/vs/base/common/lazy.js", "../node_modules/monaco-editor/esm/vs/base/common/strings.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/standalone-tokens.css", "../node_modules/monaco-editor/esm/vs/base/browser/browser.js", "../node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js", "../node_modules/monaco-editor/esm/vs/editor/browser/config/domFontInfo.js", "../node_modules/monaco-editor/esm/vs/editor/browser/config/charWidthReader.js", "../node_modules/monaco-editor/esm/vs/editor/common/config/editorZoom.js", "../node_modules/monaco-editor/esm/vs/editor/common/config/fontInfo.js", "../node_modules/monaco-editor/esm/vs/editor/browser/config/fontMeasurements.js", "../node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js", "../node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/model.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/resolverService.js", "../node_modules/monaco-editor/esm/vs/base/common/actions.js", "../node_modules/monaco-editor/esm/vs/base/common/themables.js", "../node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js", "../node_modules/monaco-editor/esm/vs/platform/contextkey/common/scanner.js", "../node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js", "../node_modules/monaco-editor/esm/vs/base/common/keybindings.js", "../node_modules/monaco-editor/esm/vs/base/common/assert.js", "../node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js", "../node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js", "../node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js", "../node_modules/monaco-editor/esm/vs/platform/telemetry/common/telemetry.js", "../node_modules/monaco-editor/esm/vs/platform/log/common/log.js", "../node_modules/monaco-editor/esm/vs/base/browser/canIUse.js", "../node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js", "../node_modules/monaco-editor/esm/vs/base/browser/iframe.js", "../node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js", "../node_modules/monaco-editor/esm/vs/base/common/symbols.js", "../node_modules/monaco-editor/esm/vs/base/common/async.js", "../node_modules/monaco-editor/esm/vs/base/browser/dompurify/dompurify.js", "../node_modules/monaco-editor/esm/vs/base/common/network.js", "../node_modules/monaco-editor/esm/vs/base/common/hash.js", "../node_modules/monaco-editor/esm/vs/base/browser/dom.js", "../node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js", "../node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js", "../node_modules/monaco-editor/esm/vs/base/browser/trustedTypes.js", "../node_modules/monaco-editor/esm/vs/base/browser/defaultWorkerFactory.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/languageConfiguration.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/supports.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/supports/characterPair.js", "../node_modules/monaco-editor/esm/vs/base/common/buffer.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/stringBuilder.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/supports/richEditBrackets.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/supports/electricCharacter.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/supports/indentRules.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/supports/onEnter.js", "../node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/language.js", "../node_modules/monaco-editor/esm/vs/platform/instantiation/common/descriptors.js", "../node_modules/monaco-editor/esm/vs/platform/instantiation/common/extensions.js", "../node_modules/monaco-editor/esm/vs/base/common/mime.js", "../node_modules/monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js", "../node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/modesRegistry.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/supports/languageBracketsConfiguration.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/languageConfigurationRegistry.js", "../node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js", "../node_modules/monaco-editor/esm/vs/base/common/diff/diff.js", "../node_modules/monaco-editor/esm/vs/base/common/uint.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/prefixSumComputer.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/linkComputer.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/supports/inplaceReplaceSupport.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/wordCharacterClassifier.js", "../node_modules/monaco-editor/esm/vs/editor/common/model.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/textModelSearch.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/unicodeTextModelHighlighter.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/linesDiffComputer.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/offsetRange.js", "../node_modules/monaco-editor/esm/vs/base/common/arraysFind.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/lineRange.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/rangeMapping.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/legacyLinesDiffComputer.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/utils.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.js", "../node_modules/monaco-editor/esm/vs/base/common/map.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js", "../node_modules/monaco-editor/esm/vs/editor/common/diff/linesDiffComputers.js", "../node_modules/monaco-editor/esm/vs/base/common/color.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/languageFeatures.js", "../node_modules/monaco-editor/esm/vs/editor/browser/services/editorWorkerService.js", "../node_modules/monaco-editor/esm/vs/editor/browser/services/webWorker.js", "../node_modules/monaco-editor/esm/vs/editor/common/editorCommon.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/nullTokenize.js", "../node_modules/monaco-editor/esm/vs/editor/common/encodedTokenAttributes.js", "../node_modules/monaco-editor/esm/vs/editor/common/tokens/lineTokens.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/lineDecorations.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/linePart.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLineRenderer.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewModel.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchCommon.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchLexer.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/colorizer.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/markerDecorations.js", "../node_modules/monaco-editor/esm/vs/editor/browser/services/markerDecorations.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/media/editor.css", "../node_modules/monaco-editor/esm/vs/editor/browser/config/elementSizeObserver.js", "../node_modules/monaco-editor/esm/vs/editor/browser/config/migrateOptions.js", "../node_modules/monaco-editor/esm/vs/editor/browser/config/tabFocus.js", "../node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js", "../node_modules/monaco-editor/esm/vs/editor/browser/config/editorConfiguration.js", "../node_modules/monaco-editor/esm/vs/base/browser/performance.js", "../node_modules/monaco-editor/esm/vs/base/browser/globalPointerMoveMonitor.js", "../node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js", "../node_modules/monaco-editor/esm/vs/editor/browser/editorDom.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewEventHandler.js", "../node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js", "../node_modules/monaco-editor/esm/vs/editor/browser/view/renderingContext.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/rangeUtil.js", "../node_modules/monaco-editor/esm/vs/platform/theme/common/theme.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLine.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/cursorColumns.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursor/cursorAtomicMoveOperations.js", "../node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js", "../node_modules/monaco-editor/esm/vs/base/common/decorators.js", "../node_modules/monaco-editor/esm/vs/base/browser/touch.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarArrow.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/abstractScrollbar.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarState.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/horizontalScrollbar.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/verticalScrollbar.js", "../node_modules/monaco-editor/esm/vs/base/common/scrollable.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/media/scrollbars.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js", "../node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseHandler.js", "../node_modules/monaco-editor/esm/vs/base/browser/event.js", "../node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaState.js", "../node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaInput.js", "../node_modules/monaco-editor/esm/vs/editor/browser/controller/pointerHandler.js", "../node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaHandler.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css", "../node_modules/monaco-editor/esm/vs/editor/browser/view/dynamicViewOverlay.js", "../node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/editorColorRegistry.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/margin/margin.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/margin/margin.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.js", "../node_modules/monaco-editor/esm/vs/base/common/ime.js", "../node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js", "../node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaHandler.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/indentation.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursorCommon.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursor/cursorColumnSelection.js", "../node_modules/monaco-editor/esm/vs/editor/common/commands/replaceCommand.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursor/cursorMoveOperations.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursor/cursorDeleteOperations.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursor/cursorWordOperations.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursor/cursorMoveCommands.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/enterAction.js", "../node_modules/monaco-editor/esm/vs/editor/common/commands/shiftCommand.js", "../node_modules/monaco-editor/esm/vs/editor/common/commands/surroundSelectionCommand.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/autoIndent.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursor/cursorTypeOperations.js", "../node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js", "../node_modules/monaco-editor/esm/vs/editor/browser/coreCommands.js", "../node_modules/monaco-editor/esm/vs/editor/browser/view/viewController.js", "../node_modules/monaco-editor/esm/vs/editor/browser/view/viewLayer.js", "../node_modules/monaco-editor/esm/vs/editor/browser/view/viewOverlays.js", "../node_modules/monaco-editor/esm/vs/editor/browser/view/viewUserInputEvents.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.css", "../node_modules/monaco-editor/esm/vs/editor/common/model/textModelPart.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/utils.js", "../node_modules/monaco-editor/esm/vs/editor/common/textModelGuides.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/guidesTextModelPart.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLines.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/domReadingContext.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLines.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/marginDecorations/marginDecorations.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/marginDecorations/marginDecorations.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.css", "../node_modules/monaco-editor/esm/vs/editor/common/core/rgba.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/minimapTokensColorTracker.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharSheet.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRenderer.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapPreBaked.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/overviewZoneManager.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewZones/viewZones.js", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/whitespace/whitespace.css", "../node_modules/monaco-editor/esm/vs/editor/browser/viewParts/whitespace/whitespace.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLinesViewportData.js", "../node_modules/monaco-editor/esm/vs/editor/common/editorTheme.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewContext.js", "../node_modules/monaco-editor/esm/vs/editor/browser/view.js", "../node_modules/monaco-editor/esm/vs/editor/common/editorAction.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/eolCounter.js", "../node_modules/monaco-editor/esm/vs/editor/common/textModelBracketPairs.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/nodeReader.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/parser.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/bracketPairsTree.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/textChange.js", "../node_modules/monaco-editor/esm/vs/base/common/extpath.js", "../node_modules/monaco-editor/esm/vs/base/common/resources.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/editStack.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/indentationGuesser.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/intervalTree.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/fixedArray.js", "../node_modules/monaco-editor/esm/vs/editor/common/tokens/contiguousMultilineTokens.js", "../node_modules/monaco-editor/esm/vs/editor/common/tokens/contiguousMultilineTokensBuilder.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/textModelTokens.js", "../node_modules/monaco-editor/esm/vs/editor/common/tokens/contiguousTokensEditing.js", "../node_modules/monaco-editor/esm/vs/editor/common/tokens/contiguousTokensStore.js", "../node_modules/monaco-editor/esm/vs/editor/common/tokens/sparseTokensStore.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/tokenizationTextModelPart.js", "../node_modules/monaco-editor/esm/vs/editor/common/textModelEvents.js", "../node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursor/oneCursor.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursor/cursorCollection.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursor/cursorContext.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewEvents.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewModelEventDispatcher.js", "../node_modules/monaco-editor/esm/vs/editor/common/cursor/cursor.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/textToHtmlTokenizer.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/linesLayout.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLayout.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelDecorations.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/modelLineProjection.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelLines.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/glyphLanesModel.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelImpl.js", "../node_modules/monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js", "../node_modules/monaco-editor/esm/vs/base/common/severity.js", "../node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js", "../node_modules/monaco-editor/esm/vs/editor/common/modelLineProjectionData.js", "../node_modules/monaco-editor/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js", "../node_modules/monaco-editor/esm/vs/editor/browser/view/domLineBreaksComputer.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/codeEditorContributions.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js", "../node_modules/monaco-editor/esm/vs/editor/browser/services/abstractCodeEditorService.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditorService.js", "../node_modules/monaco-editor/esm/vs/platform/layout/browser/layoutService.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneLayoutService.js", "../node_modules/monaco-editor/esm/vs/platform/dialogs/common/dialogs.js", "../node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedoService.js", "../node_modules/monaco-editor/esm/vs/base/common/numbers.js", "../node_modules/monaco-editor/esm/vs/platform/environment/common/environment.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/languageFeatureDebounce.js", "../node_modules/monaco-editor/esm/vs/editor/common/tokens/sparseMultilineTokens.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/semanticTokensProviderStyling.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/semanticTokensStyling.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/semanticTokensStylingService.js", "../node_modules/monaco-editor/esm/vs/base/common/glob.js", "../node_modules/monaco-editor/esm/vs/editor/common/languageSelector.js", "../node_modules/monaco-editor/esm/vs/editor/common/languageFeatureRegistry.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/languageFeaturesService.js", "../node_modules/monaco-editor/esm/vs/platform/hover/browser/hover.js", "../node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/hoverWidget/hover.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/hover/hover.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/hover/hoverWidget.js", "../node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js", "../node_modules/monaco-editor/esm/vs/base/browser/formattedTextRenderer.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabels.js", "../node_modules/monaco-editor/esm/vs/base/common/naturalLanguage/korean.js", "../node_modules/monaco-editor/esm/vs/base/common/filters.js", "../node_modules/monaco-editor/esm/vs/base/common/iconLabels.js", "../node_modules/monaco-editor/esm/vs/base/common/htmlContent.js", "../node_modules/monaco-editor/esm/vs/base/common/idGenerator.js", "../node_modules/monaco-editor/esm/vs/base/common/marked/marked.js", "../node_modules/monaco-editor/esm/vs/base/common/marshalling.js", "../node_modules/monaco-editor/esm/vs/base/browser/markdownRenderer.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/markdownRenderer/browser/renderedMarkdown.css", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/hoverWidget/hoverWidget.js", "../node_modules/monaco-editor/esm/vs/editor/browser/services/hoverService.js", "../node_modules/monaco-editor/esm/vs/editor/browser/services/bulkEditService.js", "../node_modules/monaco-editor/esm/vs/editor/common/config/diffEditor.js", "../node_modules/monaco-editor/esm/vs/editor/common/config/editorConfigurationSchema.js", "../node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js", "../node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationModels.js", "../node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingResolver.js", "../node_modules/monaco-editor/esm/vs/platform/keybinding/common/abstractKeybindingService.js", "../node_modules/monaco-editor/esm/vs/platform/keybinding/common/resolvedKeybindingItem.js", "../node_modules/monaco-editor/esm/vs/base/common/keybindingLabels.js", "../node_modules/monaco-editor/esm/vs/platform/keybinding/common/baseResolvedKeybinding.js", "../node_modules/monaco-editor/esm/vs/platform/keybinding/common/usLayoutResolvedKeybinding.js", "../node_modules/monaco-editor/esm/vs/platform/label/common/label.js", "../node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js", "../node_modules/monaco-editor/esm/vs/base/common/ternarySearchTree.js", "../node_modules/monaco-editor/esm/vs/platform/workspace/common/workspace.js", "../node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js", "../node_modules/monaco-editor/esm/vs/platform/workspace/common/workspaceTrust.js", "../node_modules/monaco-editor/esm/vs/base/common/range.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/contextview/contextview.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/contextview/contextview.js", "../node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextViewService.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/languagesAssociations.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/languagesRegistry.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/languageService.js", "../node_modules/monaco-editor/esm/vs/base/browser/dnd.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabelHover.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/list/splice.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/list/list.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/list/list.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/list/rangeMap.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/list/rowCache.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/list/listView.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/list/listWidget.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/selectBox/selectBoxCustom.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/selectBox/selectBoxNative.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/selectBox/selectBox.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/selectBox/selectBox.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdown.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdown.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js", "../node_modules/monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.css", "../node_modules/monaco-editor/esm/vs/platform/action/common/action.js", "../node_modules/monaco-editor/esm/vs/base/parts/storage/common/storage.js", "../node_modules/monaco-editor/esm/vs/platform/storage/common/storage.js", "../node_modules/monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js", "../node_modules/monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/menu/menu.js", "../node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuHandler.js", "../node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuService.js", "../node_modules/monaco-editor/esm/vs/platform/editor/common/editor.js", "../node_modules/monaco-editor/esm/vs/editor/browser/services/openerService.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/editorWorker.js", "../node_modules/monaco-editor/esm/vs/platform/markers/common/markers.js", "../node_modules/monaco-editor/esm/vs/base/common/collections.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/markerDecorationsService.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInput.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/list/listPaging.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/splitview/splitview.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/splitview/splitview.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/table/table.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/table/tableWidget.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/toggle/toggle.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/toggle/toggle.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInputToggles.js", "../node_modules/monaco-editor/esm/vs/base/common/navigator.js", "../node_modules/monaco-editor/esm/vs/base/common/history.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInput.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInput.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/tree/tree.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/tree/indexTreeModel.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/tree/media/tree.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/tree/abstractTree.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/tree/objectTreeModel.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/tree/compressedObjectTreeModel.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/tree/objectTree.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/tree/asyncDataTree.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/tree/dataTree.js", "../node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkeys.js", "../node_modules/monaco-editor/esm/vs/platform/list/browser/listService.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickInput.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickAccess.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/browser/media/quickInput.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconlabel.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabel.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.js", "../node_modules/monaco-editor/esm/vs/base/common/comparers.js", "../node_modules/monaco-editor/esm/vs/base/common/linkedText.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickInputUtils.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickInputList.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickInput.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/button/button.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/button/button.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickInputBox.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickInputController.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickInputService.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js", "../node_modules/monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/common/themes.js", "../node_modules/monaco-editor/esm/vs/platform/theme/common/iconRegistry.js", "../node_modules/monaco-editor/esm/vs/platform/theme/browser/iconsStyleSheet.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneThemeService.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js", "../node_modules/monaco-editor/esm/vs/platform/accessibility/browser/accessibilityService.js", "../node_modules/monaco-editor/esm/vs/platform/actions/common/menuService.js", "../node_modules/monaco-editor/esm/vs/platform/clipboard/browser/clipboardService.js", "../node_modules/monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js", "../node_modules/monaco-editor/esm/vs/platform/contextkey/browser/contextKeyService.js", "../node_modules/monaco-editor/esm/vs/platform/instantiation/common/graph.js", "../node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiationService.js", "../node_modules/monaco-editor/esm/vs/platform/markers/common/markerService.js", "../node_modules/monaco-editor/esm/vs/platform/configuration/common/configurations.js", "../node_modules/monaco-editor/esm/vs/platform/audioCues/browser/audioCueService.js", "../node_modules/monaco-editor/esm/vs/platform/log/common/logService.js", "../node_modules/monaco-editor/esm/vs/editor/common/editorFeatures.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js", "../node_modules/monaco-editor/esm/vs/base/common/observableInternal/logging.js", "../node_modules/monaco-editor/esm/vs/base/common/observableInternal/base.js", "../node_modules/monaco-editor/esm/vs/base/common/observableInternal/derived.js", "../node_modules/monaco-editor/esm/vs/base/common/observableInternal/autorun.js", "../node_modules/monaco-editor/esm/vs/base/common/observableInternal/utils.js", "../node_modules/monaco-editor/esm/vs/base/common/observable.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/style.css", "../node_modules/monaco-editor/esm/vs/editor/browser/stableEditorScroll.js", "../node_modules/monaco-editor/esm/vs/base/common/hotReload.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/utils.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.css", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/components/diffEditorDecorations.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/components/diffEditorSash.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/multiDiffEditorWidget/style.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/toolbar/toolbar.css", "../node_modules/monaco-editor/esm/vs/base/browser/ui/toolbar/toolbar.js", "../node_modules/monaco-editor/esm/vs/platform/actions/browser/toolbar.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/multiDiffEditorWidget/utils.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/multiDiffEditorWidget/diffEditorItemTemplate.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/multiDiffEditorWidget/objectPool.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/multiDiffEditorWidget/colors.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidget.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneEditor.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchCompile.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneLanguages.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/editorState/browser/editorState.js", "../node_modules/monaco-editor/esm/vs/editor/browser/editorBrowser.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/format/browser/formattingEdit.js", "../node_modules/monaco-editor/esm/vs/platform/extensions/common/extensions.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/format/browser/format.js", "../node_modules/monaco-editor/esm/vs/editor/editor.api.js", "../node_modules/monaco-editor/esm/vs/basic-languages/abap/abap.js", "../node_modules/monaco-editor/esm/vs/basic-languages/apex/apex.js", "../node_modules/monaco-editor/esm/vs/basic-languages/azcli/azcli.js", "../node_modules/monaco-editor/esm/vs/basic-languages/bat/bat.js", "../node_modules/monaco-editor/esm/vs/basic-languages/bicep/bicep.js", "../node_modules/monaco-editor/esm/vs/basic-languages/cameligo/cameligo.js", "../node_modules/monaco-editor/esm/vs/basic-languages/clojure/clojure.js", "../node_modules/monaco-editor/esm/vs/basic-languages/coffee/coffee.js", "../node_modules/monaco-editor/esm/vs/basic-languages/cpp/cpp.js", "../node_modules/monaco-editor/esm/vs/basic-languages/csharp/csharp.js", "../node_modules/monaco-editor/esm/vs/basic-languages/csp/csp.js", "../node_modules/monaco-editor/esm/vs/basic-languages/css/css.js", "../node_modules/monaco-editor/esm/vs/basic-languages/cypher/cypher.js", "../node_modules/monaco-editor/esm/vs/basic-languages/dart/dart.js", "../node_modules/monaco-editor/esm/vs/basic-languages/dockerfile/dockerfile.js", "../node_modules/monaco-editor/esm/vs/basic-languages/ecl/ecl.js", "../node_modules/monaco-editor/esm/vs/basic-languages/elixir/elixir.js", "../node_modules/monaco-editor/esm/vs/basic-languages/flow9/flow9.js", "../node_modules/monaco-editor/esm/vs/basic-languages/fsharp/fsharp.js", "../node_modules/monaco-editor/esm/vs/basic-languages/freemarker2/freemarker2.js", "../node_modules/monaco-editor/esm/vs/basic-languages/go/go.js", "../node_modules/monaco-editor/esm/vs/basic-languages/graphql/graphql.js", "../node_modules/monaco-editor/esm/vs/basic-languages/handlebars/handlebars.js", "../node_modules/monaco-editor/esm/vs/basic-languages/hcl/hcl.js", "../node_modules/monaco-editor/esm/vs/basic-languages/html/html.js", "../node_modules/monaco-editor/esm/vs/basic-languages/ini/ini.js", "../node_modules/monaco-editor/esm/vs/basic-languages/java/java.js", "../node_modules/monaco-editor/esm/vs/basic-languages/typescript/typescript.js", "../node_modules/monaco-editor/esm/vs/basic-languages/javascript/javascript.js", "../node_modules/monaco-editor/esm/vs/basic-languages/julia/julia.js", "../node_modules/monaco-editor/esm/vs/basic-languages/kotlin/kotlin.js", "../node_modules/monaco-editor/esm/vs/basic-languages/less/less.js", "../node_modules/monaco-editor/esm/vs/basic-languages/lexon/lexon.js", "../node_modules/monaco-editor/esm/vs/basic-languages/lua/lua.js", "../node_modules/monaco-editor/esm/vs/basic-languages/liquid/liquid.js", "../node_modules/monaco-editor/esm/vs/basic-languages/m3/m3.js", "../node_modules/monaco-editor/esm/vs/basic-languages/markdown/markdown.js", "../node_modules/monaco-editor/esm/vs/basic-languages/mdx/mdx.js", "../node_modules/monaco-editor/esm/vs/basic-languages/mips/mips.js", "../node_modules/monaco-editor/esm/vs/basic-languages/msdax/msdax.js", "../node_modules/monaco-editor/esm/vs/basic-languages/mysql/mysql.js", "../node_modules/monaco-editor/esm/vs/basic-languages/objective-c/objective-c.js", "../node_modules/monaco-editor/esm/vs/basic-languages/pascal/pascal.js", "../node_modules/monaco-editor/esm/vs/basic-languages/pascaligo/pascaligo.js", "../node_modules/monaco-editor/esm/vs/basic-languages/perl/perl.js", "../node_modules/monaco-editor/esm/vs/basic-languages/pgsql/pgsql.js", "../node_modules/monaco-editor/esm/vs/basic-languages/php/php.js", "../node_modules/monaco-editor/esm/vs/basic-languages/pla/pla.js", "../node_modules/monaco-editor/esm/vs/basic-languages/postiats/postiats.js", "../node_modules/monaco-editor/esm/vs/basic-languages/powerquery/powerquery.js", "../node_modules/monaco-editor/esm/vs/basic-languages/powershell/powershell.js", "../node_modules/monaco-editor/esm/vs/basic-languages/protobuf/protobuf.js", "../node_modules/monaco-editor/esm/vs/basic-languages/pug/pug.js", "../node_modules/monaco-editor/esm/vs/basic-languages/python/python.js", "../node_modules/monaco-editor/esm/vs/basic-languages/qsharp/qsharp.js", "../node_modules/monaco-editor/esm/vs/basic-languages/r/r.js", "../node_modules/monaco-editor/esm/vs/basic-languages/razor/razor.js", "../node_modules/monaco-editor/esm/vs/basic-languages/redis/redis.js", "../node_modules/monaco-editor/esm/vs/basic-languages/redshift/redshift.js", "../node_modules/monaco-editor/esm/vs/basic-languages/restructuredtext/restructuredtext.js", "../node_modules/monaco-editor/esm/vs/basic-languages/ruby/ruby.js", "../node_modules/monaco-editor/esm/vs/basic-languages/rust/rust.js", "../node_modules/monaco-editor/esm/vs/basic-languages/sb/sb.js", "../node_modules/monaco-editor/esm/vs/basic-languages/scala/scala.js", "../node_modules/monaco-editor/esm/vs/basic-languages/scheme/scheme.js", "../node_modules/monaco-editor/esm/vs/basic-languages/scss/scss.js", "../node_modules/monaco-editor/esm/vs/basic-languages/shell/shell.js", "../node_modules/monaco-editor/esm/vs/basic-languages/solidity/solidity.js", "../node_modules/monaco-editor/esm/vs/basic-languages/sophia/sophia.js", "../node_modules/monaco-editor/esm/vs/basic-languages/sparql/sparql.js", "../node_modules/monaco-editor/esm/vs/basic-languages/sql/sql.js", "../node_modules/monaco-editor/esm/vs/basic-languages/st/st.js", "../node_modules/monaco-editor/esm/vs/basic-languages/swift/swift.js", "../node_modules/monaco-editor/esm/vs/basic-languages/systemverilog/systemverilog.js", "../node_modules/monaco-editor/esm/vs/basic-languages/tcl/tcl.js", "../node_modules/monaco-editor/esm/vs/basic-languages/twig/twig.js", "../node_modules/monaco-editor/esm/vs/basic-languages/vb/vb.js", "../node_modules/monaco-editor/esm/vs/basic-languages/wgsl/wgsl.js", "../node_modules/monaco-editor/esm/vs/basic-languages/xml/xml.js", "../node_modules/monaco-editor/esm/vs/basic-languages/yaml/yaml.js", "../node_modules/monaco-editor/esm/vs/language/css/cssMode.js", "../node_modules/monaco-editor/esm/vs/language/html/htmlMode.js", "../node_modules/monaco-editor/esm/vs/language/json/jsonMode.js", "../node_modules/monaco-editor/esm/vs/language/typescript/tsMode.js", "../node_modules/monaco-editor/esm/vs/language/typescript/monaco.contribution.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/browser/outlineModel.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplaceCommand.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.css", "../node_modules/monaco-editor/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.css", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.js", "../node_modules/d3-array/dist/d3-array.js", "../node_modules/d3-axis/dist/d3-axis.js", "../node_modules/d3-dispatch/dist/d3-dispatch.js", "../node_modules/d3-selection/dist/d3-selection.js", "../node_modules/d3-drag/dist/d3-drag.js", "../node_modules/d3-color/dist/d3-color.js", "../node_modules/d3-interpolate/dist/d3-interpolate.js", "../node_modules/d3-timer/dist/d3-timer.js", "../node_modules/d3-ease/dist/d3-ease.js", "../node_modules/d3-transition/dist/d3-transition.js", "../node_modules/d3-brush/dist/d3-brush.js", "../node_modules/d3-path/dist/d3-path.js", "../node_modules/d3-chord/dist/d3-chord.js", "../node_modules/d3-contour/dist/d3-contour.js", "../node_modules/d3-delaunay/dist/d3-delaunay.js", "../node_modules/d3-dsv/dist/d3-dsv.js", "../node_modules/d3-fetch/dist/d3-fetch.js", "../node_modules/d3-quadtree/dist/d3-quadtree.js", "../node_modules/d3-force/dist/d3-force.js", "../node_modules/d3-format/dist/d3-format.js", "../node_modules/d3-geo/dist/d3-geo.js", "../node_modules/d3-hierarchy/dist/d3-hierarchy.js", "../node_modules/d3-polygon/dist/d3-polygon.js", "../node_modules/d3-random/dist/d3-random.js", "../node_modules/d3-time/dist/d3-time.js", "../node_modules/d3-time-format/dist/d3-time-format.js", "../node_modules/d3-scale/dist/d3-scale.js", "../node_modules/d3-scale-chromatic/dist/d3-scale-chromatic.js", "../node_modules/d3-shape/dist/d3-shape.js", "../node_modules/d3-zoom/dist/d3-zoom.js", "../node_modules/d3/dist/d3.node.js", "../node_modules/@fortawesome/free-solid-svg-icons/index.js", "../node_modules/d3-wave/dist/d3-wave.js", "../src/app.tsx", "../node_modules/@mui/joy/styles/identifier.js", "../node_modules/@mui/joy/styles/CssVarsProvider.js", "../node_modules/@mui/joy/styles/extendTheme.js", "../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js", "../node_modules/@mui/joy/styles/sxConfig.js", "../node_modules/@mui/joy/colors/colors.js", "../node_modules/@mui/joy/styles/shouldSkipGeneratingVar.js", "../node_modules/@mui/joy/className/index.js", "../node_modules/@mui/joy/styles/variantUtils.js", "../node_modules/@mui/joy/styles/defaultTheme.js", "../node_modules/@mui/joy/styles/styled.js", "../node_modules/@mui/joy/styles/useThemeProps.js", "../node_modules/@mui/joy/CssBaseline/CssBaseline.js", "../node_modules/@mui/joy/GlobalStyles/GlobalStyles.js", "../node_modules/@mui/joy/Box/Box.js", "../node_modules/@mui/joy/Box/boxClasses.js", "../node_modules/@mui/joy/Button/Button.js", "../node_modules/@mui/base/useButton/useButton.js", "../node_modules/@mui/base/utils/extractEventHandlers.js", "../node_modules/@mui/base/utils/useRootElementName.js", "../node_modules/@mui/joy/utils/useSlot.js", "../node_modules/@mui/base/utils/appendOwnerState.js", "../node_modules/@mui/base/utils/isHostComponent.js", "../node_modules/@mui/base/utils/areArraysEqual.js", "../node_modules/@mui/base/utils/ClassNameConfigurator.js", "../node_modules/@mui/base/utils/resolveComponentProps.js", "../node_modules/@mui/base/utils/useSlotProps.js", "../node_modules/@mui/base/utils/mergeSlotProps.js", "../node_modules/clsx/dist/clsx.mjs", "../node_modules/@mui/base/utils/omitEventHandlers.js", "../node_modules/@mui/base/utils/prepareForSlot.js", "../node_modules/@mui/joy/CircularProgress/CircularProgress.js", "../node_modules/@mui/base/index.js", "../node_modules/@mui/base/Badge/Badge.js", "../node_modules/@mui/base/useBadge/useBadge.js", "../node_modules/@mui/base/generateUtilityClass/index.js", "../node_modules/@mui/base/generateUtilityClasses/index.js", "../node_modules/@mui/base/Badge/badgeClasses.js", "../node_modules/@mui/base/Button/Button.js", "../node_modules/@mui/base/Button/buttonClasses.js", "../node_modules/@mui/base/ClickAwayListener/ClickAwayListener.js", "../node_modules/@mui/base/Dropdown/Dropdown.js", "../node_modules/@mui/base/useDropdown/DropdownContext.js", "../node_modules/@mui/base/useDropdown/useDropdown.js", "../node_modules/@mui/base/utils/useControllableReducer.js", "../node_modules/@mui/base/useDropdown/useDropdown.types.js", "../node_modules/@mui/base/useDropdown/dropdownReducer.js", "../node_modules/@mui/base/FocusTrap/FocusTrap.js", "../node_modules/@mui/base/FormControl/FormControl.js", "../node_modules/@mui/base/FormControl/FormControlContext.js", "../node_modules/@mui/base/FormControl/formControlClasses.js", "../node_modules/@mui/base/FormControl/useFormControlContext.js", "../node_modules/@mui/base/Input/Input.js", "../node_modules/@mui/base/Input/inputClasses.js", "../node_modules/@mui/base/useInput/useInput.js", "../node_modules/@mui/base/Menu/Menu.js", "../node_modules/@mui/base/Menu/menuClasses.js", "../node_modules/@mui/base/useMenu/useMenu.js", "../node_modules/@mui/base/useMenu/menuReducer.js", "../node_modules/@mui/base/useList/useList.js", "../node_modules/@mui/base/useList/listActions.types.js", "../node_modules/@mui/base/useList/listReducer.js", "../node_modules/@mui/base/utils/useTextNavigation.js", "../node_modules/@mui/base/useList/useListItem.js", "../node_modules/@mui/base/useList/ListContext.js", "../node_modules/@mui/base/useCompound/useCompoundParent.js", "../node_modules/@mui/base/useCompound/useCompoundItem.js", "../node_modules/@mui/base/utils/combineHooksSlotProps.js", "../node_modules/@mui/base/useMenu/MenuProvider.js", "../node_modules/@mui/base/Unstable_Popup/Popup.js", "../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs", "../node_modules/@floating-ui/core/dist/floating-ui.core.mjs", "../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs", "../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs", "../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs", "../node_modules/@mui/base/Portal/Portal.js", "../node_modules/@mui/base/Unstable_Popup/popupClasses.js", "../node_modules/@mui/base/useTransition/useTransitionStateManager.js", "../node_modules/@mui/base/useTransition/TransitionContext.js", "../node_modules/@mui/base/useTransition/useTransitionTrigger.js", "../node_modules/@mui/base/Unstable_Popup/PopupContext.js", "../node_modules/@mui/base/MenuButton/MenuButton.js", "../node_modules/@mui/base/useMenuButton/useMenuButton.js", "../node_modules/@mui/base/MenuButton/menuButtonClasses.js", "../node_modules/@mui/base/MenuItem/MenuItem.js", "../node_modules/@mui/base/MenuItem/menuItemClasses.js", "../node_modules/@mui/base/useMenuItem/useMenuItem.js", "../node_modules/@mui/base/useMenuItem/useMenuItemContextStabilizer.js", "../node_modules/@mui/base/Modal/Modal.js", "../node_modules/@mui/base/unstable_useModal/useModal.js", "../node_modules/@mui/base/unstable_useModal/ModalManager.js", "../node_modules/@mui/base/Modal/modalClasses.js", "../node_modules/@mui/base/NoSsr/NoSsr.js", "../node_modules/@mui/base/Unstable_NumberInput/NumberInput.js", "../node_modules/@mui/base/Unstable_NumberInput/numberInputClasses.js", "../node_modules/@mui/base/unstable_useNumberInput/useNumberInput.js", "../node_modules/@mui/base/unstable_useNumberInput/numberInputAction.types.js", "../node_modules/@mui/base/unstable_useNumberInput/numberInputReducer.js", "../node_modules/@mui/base/unstable_useNumberInput/utils.js", "../node_modules/@mui/base/OptionGroup/OptionGroup.js", "../node_modules/@mui/base/OptionGroup/optionGroupClasses.js", "../node_modules/@mui/base/Option/Option.js", "../node_modules/@mui/base/Option/optionClasses.js", "../node_modules/@mui/base/useOption/useOption.js", "../node_modules/@mui/base/useOption/useOptionContextStabilizer.js", "../node_modules/@mui/base/Popper/Popper.js", "../node_modules/@popperjs/core/lib/enums.js", "../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../node_modules/@popperjs/core/lib/utils/math.js", "../node_modules/@popperjs/core/lib/utils/userAgent.js", "../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../node_modules/@popperjs/core/lib/dom-utils/contains.js", "../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../node_modules/@popperjs/core/lib/utils/within.js", "../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../node_modules/@popperjs/core/lib/modifiers/arrow.js", "../node_modules/@popperjs/core/lib/utils/getVariation.js", "../node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../node_modules/@popperjs/core/lib/modifiers/flip.js", "../node_modules/@popperjs/core/lib/modifiers/hide.js", "../node_modules/@popperjs/core/lib/modifiers/offset.js", "../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../node_modules/@popperjs/core/lib/utils/debounce.js", "../node_modules/@popperjs/core/lib/utils/mergeByName.js", "../node_modules/@popperjs/core/lib/createPopper.js", "../node_modules/@popperjs/core/lib/popper.js", "../node_modules/@mui/base/Popper/popperClasses.js", "../node_modules/@mui/base/Select/Select.js", "../node_modules/@mui/base/useSelect/useSelect.js", "../node_modules/@mui/base/useSelect/useSelect.types.js", "../node_modules/@mui/base/useSelect/defaultOptionStringifier.js", "../node_modules/@mui/base/useSelect/selectReducer.js", "../node_modules/@mui/base/useSelect/SelectProvider.js", "../node_modules/@mui/base/Select/selectClasses.js", "../node_modules/@mui/base/Slider/Slider.js", "../node_modules/@mui/base/Slider/sliderClasses.js", "../node_modules/@mui/base/useSlider/useSlider.js", "../node_modules/@mui/base/Snackbar/Snackbar.js", "../node_modules/@mui/base/Snackbar/snackbarClasses.js", "../node_modules/@mui/base/useSnackbar/useSnackbar.js", "../node_modules/@mui/base/Switch/Switch.js", "../node_modules/@mui/base/useSwitch/useSwitch.js", "../node_modules/@mui/base/Switch/switchClasses.js", "../node_modules/@mui/base/TablePagination/TablePagination.js", "../node_modules/@mui/base/TablePagination/TablePaginationActions.js", "../node_modules/@mui/base/TablePagination/tablePaginationClasses.js", "../node_modules/@mui/base/TabPanel/TabPanel.js", "../node_modules/@mui/base/TabPanel/tabPanelClasses.js", "../node_modules/@mui/base/useTabPanel/useTabPanel.js", "../node_modules/@mui/base/Tabs/Tabs.js", "../node_modules/@mui/base/Tabs/tabsClasses.js", "../node_modules/@mui/base/useTabs/useTabs.js", "../node_modules/@mui/base/useTabs/TabsProvider.js", "../node_modules/@mui/base/Tabs/TabsContext.js", "../node_modules/@mui/base/TabsList/TabsList.js", "../node_modules/@mui/base/TabsList/tabsListClasses.js", "../node_modules/@mui/base/useTabsList/useTabsList.js", "../node_modules/@mui/base/useTabsList/useTabsList.types.js", "../node_modules/@mui/base/useTabsList/tabsListReducer.js", "../node_modules/@mui/base/useTabsList/TabsListProvider.js", "../node_modules/@mui/base/Tab/Tab.js", "../node_modules/@mui/base/Tab/tabClasses.js", "../node_modules/@mui/base/useTab/useTab.js", "../node_modules/@mui/base/TextareaAutosize/TextareaAutosize.js", "../node_modules/@mui/base/Transitions/CssAnimation.js", "../node_modules/@mui/base/Transitions/CssTransition.js", "../node_modules/@mui/base/useAutocomplete/useAutocomplete.js", "../node_modules/@mui/joy/CircularProgress/circularProgressClasses.js", "../node_modules/@mui/joy/Button/buttonClasses.js", "../node_modules/@mui/joy/ButtonGroup/ButtonGroupContext.js", "../node_modules/@mui/joy/ToggleButtonGroup/ToggleButtonGroupContext.js", "../node_modules/@mui/joy/IconButton/IconButton.js", "../node_modules/@mui/joy/IconButton/iconButtonClasses.js", "../node_modules/@mui/joy/Select/Select.js", "../node_modules/@mui/joy/List/List.js", "../node_modules/@mui/joy/styles/styleUtils.js", "../node_modules/@mui/joy/List/NestedListContext.js", "../node_modules/@mui/joy/List/GroupListContext.js", "../node_modules/@mui/joy/List/ListProvider.js", "../node_modules/@mui/joy/List/RowListContext.js", "../node_modules/@mui/joy/List/WrapListContext.js", "../node_modules/@mui/joy/internal/svg-icons/Unfold.js", "../node_modules/@mui/joy/utils/createSvgIcon.js", "../node_modules/@mui/joy/SvgIcon/SvgIcon.js", "../node_modules/@mui/joy/SvgIcon/svgIconClasses.js", "../node_modules/@mui/joy/Select/selectClasses.js", "../node_modules/@mui/joy/FormControl/FormControlContext.js", "../node_modules/@mui/joy/styles/variantColorInheritance.js", "../node_modules/@mui/joy/Option/Option.js", "../node_modules/@mui/joy/ListItemButton/ListItemButton.js", "../node_modules/@mui/joy/ListItem/listItemClasses.js", "../node_modules/@mui/joy/ListItemButton/listItemButtonClasses.js", "../node_modules/@mui/joy/ListItemButton/ListItemButtonOrientationContext.js", "../node_modules/@mui/joy/Option/optionClasses.js", "../node_modules/@mui/joy/Link/Link.js", "../node_modules/@mui/joy/Link/linkClasses.js", "../node_modules/@mui/joy/Typography/Typography.js", "../node_modules/@mui/joy/Typography/typographyClasses.js", "../node_modules/@mui/joy/Snackbar/Snackbar.js", "../node_modules/@mui/joy/colorInversion/colorInversionUtils.js", "../node_modules/@mui/joy/Snackbar/snackbarClasses.js", "../node_modules/@mui/joy/Alert/Alert.js", "../node_modules/@mui/joy/Alert/alertClasses.js", "../node_modules/@mui/joy/Tabs/Tabs.js", "../node_modules/@mui/joy/Tabs/SizeTabsContext.js", "../node_modules/@mui/joy/Tabs/tabsClasses.js", "../node_modules/@mui/joy/TabList/TabList.js", "../node_modules/@mui/joy/TabList/tabListClasses.js", "../node_modules/@mui/joy/Tab/tabClasses.js", "../node_modules/@mui/joy/Tab/Tab.js", "../node_modules/@mui/joy/TabPanel/TabPanel.js", "../node_modules/@mui/joy/TabPanel/tabPanelClasses.js", "../node_modules/monaco-editor/esm/vs/basic-languages/monaco.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/abap/abap.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/apex/apex.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/azcli/azcli.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/bat/bat.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/bicep/bicep.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/cameligo/cameligo.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/clojure/clojure.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/coffee/coffee.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/cpp/cpp.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/csharp/csharp.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/csp/csp.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/css/css.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/cypher/cypher.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/dart/dart.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/dockerfile/dockerfile.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/ecl/ecl.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/elixir/elixir.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/flow9/flow9.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/fsharp/fsharp.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/freemarker2/freemarker2.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/go/go.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/graphql/graphql.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/handlebars/handlebars.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/hcl/hcl.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/html/html.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/ini/ini.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/java/java.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/julia/julia.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/kotlin/kotlin.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/less/less.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/lexon/lexon.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/lua/lua.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/liquid/liquid.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/m3/m3.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/markdown/markdown.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/mdx/mdx.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/mips/mips.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/msdax/msdax.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/mysql/mysql.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/objective-c/objective-c.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/pascal/pascal.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/pascaligo/pascaligo.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/perl/perl.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/pgsql/pgsql.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/php/php.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/pla/pla.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/postiats/postiats.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/powerquery/powerquery.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/powershell/powershell.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/protobuf/protobuf.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/pug/pug.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/python/python.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/qsharp/qsharp.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/r/r.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/razor/razor.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/redis/redis.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/redshift/redshift.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/restructuredtext/restructuredtext.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/ruby/ruby.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/rust/rust.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/sb/sb.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/scala/scala.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/scheme/scheme.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/scss/scss.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/shell/shell.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/solidity/solidity.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/sophia/sophia.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/sparql/sparql.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/sql/sql.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/st/st.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/swift/swift.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/systemverilog/systemverilog.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/tcl/tcl.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/twig/twig.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/vb/vb.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/wgsl/wgsl.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/xml/xml.contribution.js", "../node_modules/monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution.js", "../node_modules/monaco-editor/esm/vs/language/css/monaco.contribution.js", "../node_modules/monaco-editor/esm/vs/language/html/monaco.contribution.js", "../node_modules/monaco-editor/esm/vs/language/json/monaco.contribution.js", "../node_modules/monaco-editor/esm/vs/editor/editor.main.js", "../node_modules/monaco-editor/esm/vs/editor/editor.all.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/browser/moveCaretCommand.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/browser/transpose.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/clipboard/browser/clipboard.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js", "../node_modules/monaco-editor/esm/vs/base/common/dataTransfer.js", "../node_modules/monaco-editor/esm/vs/base/common/uuid.js", "../node_modules/monaco-editor/esm/vs/editor/browser/dnd.js", "../node_modules/monaco-editor/esm/vs/platform/dnd/browser/dnd.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/edit.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/snippet/browser/snippetParser.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineProgress/browser/inlineProgress.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/message/browser/messageController.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeAction.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/common/types.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionController.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionKeybindingResolver.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js", "../node_modules/monaco-editor/esm/vs/platform/actionWidget/browser/actionWidget.js", "../node_modules/monaco-editor/esm/vs/platform/actionWidget/browser/actionList.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codelens/browser/codelensController.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codelens/browser/codelens.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codelens/browser/codeLensCache.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/codelens/browser/codelensWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/browser/colorContributions.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/browser/color.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/browser/colorPickerModel.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/browser/colorPickerWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/hover/browser/hover.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/peekView/browser/peekView.js", "../node_modules/monaco-editor/esm/vs/editor/browser/widget/embeddedCodeEditorWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/zoneWidget/browser/zoneWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/browser/goToSymbol.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/hover/browser/contentHover.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/hover/browser/hoverOperation.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/hover/browser/hoverTypes.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/resizable/resizable.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/hover/browser/resizableContentWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/hover/browser/marginHover.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/hover/browser/getHover.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/browser/gotoError.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/browser/markerNavigationService.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js", "../node_modules/monaco-editor/esm/vs/platform/severityIcon/browser/severityIcon.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsHintsWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/commandIds.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPickerWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/comment/browser/comment.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/comment/browser/blockCommentCommand.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/comment/browser/lineCommentCommand.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/dnd/browser/dnd.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/dnd/browser/dragAndDropCommand.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/treeViewsDnd.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/treeViewsDndService.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/find/browser/findController.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/find/browser/findModel.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/find/browser/findDecorations.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/find/browser/replaceAllCommand.js", "../node_modules/monaco-editor/esm/vs/base/common/search.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/find/browser/replacePattern.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/find/browser/findOptionsWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/find/browser/findState.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/find/browser/findWidget.js", "../node_modules/monaco-editor/esm/vs/platform/history/browser/contextScopedHistoryWidget.js", "../node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/replaceInput.js", "../node_modules/monaco-editor/esm/vs/platform/history/browser/historyWidgetKeybindingHint.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/folding/browser/folding.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/folding/browser/foldingModel.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/folding/browser/foldingRanges.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/folding/browser/hiddenRangeModel.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/folding/browser/indentRangeProvider.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/folding/browser/foldingDecorations.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/folding/browser/syntaxRangeProvider.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/format/browser/formatActions.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/browser/documentSymbols.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/commands.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/utils.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/ghostText.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/provideInlineCompletions.js", "../node_modules/monaco-editor/esm/vs/editor/common/model/bracketPairsTextModelPart/fixBrackets.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/singleTextEdit.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/snippet/browser/snippetController2.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggest.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/snippet/browser/snippetSession.js", "../node_modules/monaco-editor/esm/vs/base/common/labels.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/snippet/browser/snippetVariables.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/suggestWidgetInlineCompletionProvider.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestController.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestMemory.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/wordContextKey.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestAlternatives.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestCommitCharacters.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestModel.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/wordDistance.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/browser/bracketSelections.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/completionModel.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestOvertypingCapturer.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestWidgetStatus.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/getIconClasses.js", "../node_modules/monaco-editor/esm/vs/platform/files/common/files.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlineCompletions/browser/hoverParticipant.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/indentation/browser/indentation.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/indentation/browser/indentUtils.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlayHints/browser/inlayHintsContribution.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlayHints/browser/inlayHints.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js", "../node_modules/monaco-editor/esm/vs/editor/common/commands/trimTrailingWhitespaceCommand.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/browser/copyLinesCommand.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/browser/moveLinesCommand.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/browser/sortLinesCommand.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/links/browser/links.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/links/browser/getLinks.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/multicursor/browser/multicursor.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/browser/provideSignatureHelp.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/rename/browser/rename.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/rename/browser/renameInputField.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/semanticTokens/common/getSemanticTokens.js", "../node_modules/monaco-editor/esm/vs/editor/common/services/semanticTokensDto.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/semanticTokens/common/semanticTokensConfig.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/browser/wordSelections.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollContribution.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js", "../node_modules/monaco-editor/esm/vs/platform/action/common/actionCommonCategories.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollElement.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/tokenization/browser/tokenization.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js", "../node_modules/monaco-editor/esm/vs/platform/opener/browser/link.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/wordPartOperations/browser/wordPartOperations.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js", "../node_modules/monaco-editor/esm/vs/editor/edcore.main.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/browser/helpQuickAccess.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js", "../node_modules/monaco-editor/esm/vs/base/common/fuzzyScorer.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js", "../node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.js", "../node_modules/monaco-editor/esm/vs/base/common/errorMessage.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/browser/commandsQuickAccess.js", "../node_modules/monaco-editor/esm/vs/base/common/tfIdf.js", "../node_modules/monaco-editor/esm/vs/platform/quickinput/browser/pickerQuickAccess.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js", "../node_modules/monaco-editor/esm/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js", "../src/monaco.tsx", "../src/d3wave.tsx", "../src/runner.ts", "../src/config.ts"], - "sourcesContent": ["/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n", "/**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ca=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)}\nfunction Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0);\nfunction Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[];\nfunction Oh(){for(var a=0;ac?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState}\nfunction Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}}\nfunction ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}}\nfunction Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308,\n4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=\nci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d,\nf,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Uh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eHj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(),\nnull;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1;\nfunction Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n}\nfunction Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}\nfunction Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling}\nfunction ak(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0;\nZj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)}\nfunction ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk;\nWk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\nhj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)}\nfunction al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction $k(a){if(\"function\"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction yh(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)bj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n", "import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n", "import {MS, MOZ, WEBKIT} from './Enum.js'\nimport {hash, charat, strlen, indexof, replace, substr, match} from './Utility.js'\n\n/**\n * @param {string} value\n * @param {number} length\n * @param {object[]} children\n * @return {string}\n */\nexport function prefix (value, length, children) {\n\tswitch (hash(value, length)) {\n\t\t// color-adjust\n\t\tcase 5103:\n\t\t\treturn WEBKIT + 'print-' + value + value\n\t\t// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\t\tcase 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921:\n\t\t// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\t\tcase 5572: case 6356: case 5844: case 3191: case 6645: case 3005:\n\t\t// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\t\tcase 6391: case 5879: case 5623: case 6135: case 4599: case 4855:\n\t\t// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\t\tcase 4215: case 6389: case 5109: case 5365: case 5621: case 3829:\n\t\t\treturn WEBKIT + value + value\n\t\t// tab-size\n\t\tcase 4789:\n\t\t\treturn MOZ + value + value\n\t\t// appearance, user-select, transform, hyphens, text-size-adjust\n\t\tcase 5349: case 4246: case 4810: case 6968: case 2756:\n\t\t\treturn WEBKIT + value + MOZ + value + MS + value + value\n\t\t// writing-mode\n\t\tcase 5936:\n\t\t\tswitch (charat(value, length + 11)) {\n\t\t\t\t// vertical-l(r)\n\t\t\t\tcase 114:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value\n\t\t\t\t// vertical-r(l)\n\t\t\t\tcase 108:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value\n\t\t\t\t// horizontal(-)tb\n\t\t\t\tcase 45:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value\n\t\t\t\t// default: fallthrough to below\n\t\t\t}\n\t\t// flex, flex-direction, scroll-snap-type, writing-mode\n\t\tcase 6828: case 4268: case 2903:\n\t\t\treturn WEBKIT + value + MS + value + value\n\t\t// order\n\t\tcase 6165:\n\t\t\treturn WEBKIT + value + MS + 'flex-' + value + value\n\t\t// align-items\n\t\tcase 5187:\n\t\t\treturn WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value\n\t\t// align-self\n\t\tcase 5443:\n\t\t\treturn WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/g, '') + (!match(value, /flex-|baseline/) ? MS + 'grid-row-' + replace(value, /flex-|-self/g, '') : '') + value\n\t\t// align-content\n\t\tcase 4675:\n\t\t\treturn WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/g, '') + value\n\t\t// flex-shrink\n\t\tcase 5548:\n\t\t\treturn WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value\n\t\t// flex-basis\n\t\tcase 5292:\n\t\t\treturn WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value\n\t\t// flex-grow\n\t\tcase 6060:\n\t\t\treturn WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value\n\t\t// transition\n\t\tcase 4554:\n\t\t\treturn WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value\n\t\t// cursor\n\t\tcase 6187:\n\t\t\treturn replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value\n\t\t// background, background-image\n\t\tcase 5495: case 3959:\n\t\t\treturn replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1')\n\t\t// justify-content\n\t\tcase 4968:\n\t\t\treturn replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value\n\t\t// justify-self\n\t\tcase 4200:\n\t\t\tif (!match(value, /flex-|baseline/)) return MS + 'grid-column-align' + substr(value, length) + value\n\t\t\tbreak\n\t\t// grid-template-(columns|rows)\n\t\tcase 2592: case 3360:\n\t\t\treturn MS + replace(value, 'template-', '') + value\n\t\t// grid-(row|column)-start\n\t\tcase 4384: case 3616:\n\t\t\tif (children && children.some(function (element, index) { return length = index, match(element.props, /grid-\\w+-end/) })) {\n\t\t\t\treturn ~indexof(value + (children = children[length].value), 'span') ? value : (MS + replace(value, '-start', '') + value + MS + 'grid-row-span:' + (~indexof(children, 'span') ? match(children, /\\d+/) : +match(children, /\\d+/) - +match(value, /\\d+/)) + ';')\n\t\t\t}\n\t\t\treturn MS + replace(value, '-start', '') + value\n\t\t// grid-(row|column)-end\n\t\tcase 4896: case 4128:\n\t\t\treturn (children && children.some(function (element) { return match(element.props, /grid-\\w+-start/) })) ? value : MS + replace(replace(value, '-end', '-span'), 'span ', '') + value\n\t\t// (margin|padding)-inline-(start|end)\n\t\tcase 4095: case 3583: case 4068: case 2532:\n\t\t\treturn replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value\n\t\t// (min|max)?(width|height|inline-size|block-size)\n\t\tcase 8116: case 7059: case 5753: case 5535:\n\t\tcase 5445: case 5701: case 4933: case 4677:\n\t\tcase 5533: case 5789: case 5021: case 4765:\n\t\t\t// stretch, max-content, min-content, fill-available\n\t\t\tif (strlen(value) - 1 - length > 6)\n\t\t\t\tswitch (charat(value, length + 1)) {\n\t\t\t\t\t// (m)ax-content, (m)in-content\n\t\t\t\t\tcase 109:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (charat(value, length + 4) !== 45)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t// (f)ill-available, (f)it-content\n\t\t\t\t\tcase 102:\n\t\t\t\t\t\treturn replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value\n\t\t\t\t\t// (s)tretch\n\t\t\t\t\tcase 115:\n\t\t\t\t\t\treturn ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length, children) + value : value\n\t\t\t\t}\n\t\t\tbreak\n\t\t// grid-(column|row)\n\t\tcase 5152: case 5920:\n\t\t\treturn replace(value, /(.+?):(\\d+)(\\s*\\/\\s*(span)?\\s*(\\d+))?(.*)/, function (_, a, b, c, d, e, f) { return (MS + a + ':' + b + f) + (c ? (MS + a + '-span:' + (d ? e : +e - +b)) + f : '') + value })\n\t\t// position: sticky\n\t\tcase 4949:\n\t\t\t// stick(y)?\n\t\t\tif (charat(value, length + 6) === 121)\n\t\t\t\treturn replace(value, ':', ':' + WEBKIT) + value\n\t\t\tbreak\n\t\t// display: (flex|inline-flex|grid|inline-grid)\n\t\tcase 6444:\n\t\t\tswitch (charat(value, charat(value, 14) === 45 ? 18 : 11)) {\n\t\t\t\t// (inline-)?fle(x)\n\t\t\t\tcase 120:\n\t\t\t\t\treturn replace(value, /(.+:)([^;\\s!]+)(;|(\\s+)?!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value\n\t\t\t\t// (inline-)?gri(d)\n\t\t\t\tcase 100:\n\t\t\t\t\treturn replace(value, ':', ':' + MS) + value\n\t\t\t}\n\t\t\tbreak\n\t\t// scroll-margin, scroll-margin-(top|right|bottom|left)\n\t\tcase 5719: case 2647: case 2135: case 3927: case 2391:\n\t\t\treturn replace(value, 'scroll-', 'scroll-snap-') + value\n\t}\n\n\treturn value\n}\n", "import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n", "import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n", "export * from './src/Enum.js'\nexport * from './src/Utility.js'\nexport * from './src/Parser.js'\nexport * from './src/Prefixer.js'\nexport * from './src/Tokenizer.js'\nexport * from './src/Serializer.js'\nexport * from './src/Middleware.js'\n", "var weakMemoize = function weakMemoize(func) {\n // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps\n var cache = new WeakMap();\n return function (arg) {\n if (cache.has(arg)) {\n // $FlowFixMe\n return cache.get(arg);\n }\n\n var ret = func(arg);\n cache.set(arg, ret);\n return ret;\n };\n};\n\nexport { weakMemoize as default };\n", "import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, COMMENT, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\nvar ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';\n\nvar isIgnoringComment = function isIgnoringComment(element) {\n return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;\n};\n\nvar createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {\n return function (element, index, children) {\n if (element.type !== 'rule' || cache.compat) return;\n var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);\n\n if (unsafePseudoClasses) {\n var isNested = !!element.parent; // in nested rules comments become children of the \"auto-inserted\" rule and that's always the `element.parent`\n //\n // considering this input:\n // .a {\n // .b /* comm */ {}\n // color: hotpink;\n // }\n // we get output corresponding to this:\n // .a {\n // & {\n // /* comm */\n // color: hotpink;\n // }\n // .b {}\n // }\n\n var commentContainer = isNested ? element.parent.children : // global rule at the root level\n children;\n\n for (var i = commentContainer.length - 1; i >= 0; i--) {\n var node = commentContainer[i];\n\n if (node.line < element.line) {\n break;\n } // it is quite weird but comments are *usually* put at `column: element.column - 1`\n // so we seek *from the end* for the node that is earlier than the rule's `element` and check that\n // this will also match inputs like this:\n // .a {\n // /* comm */\n // .b {}\n // }\n //\n // but that is fine\n //\n // it would be the easiest to change the placement of the comment to be the first child of the rule:\n // .a {\n // .b { /* comm */ }\n // }\n // with such inputs we wouldn't have to search for the comment at all\n // TODO: consider changing this comment placement in the next major version\n\n\n if (node.column < element.column) {\n if (isIgnoringComment(node)) {\n return;\n }\n\n break;\n }\n }\n\n unsafePseudoClasses.forEach(function (unsafePseudoClass) {\n console.error(\"The pseudo class \\\"\" + unsafePseudoClass + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + unsafePseudoClass.split('-child')[0] + \"-of-type\\\".\");\n });\n }\n };\n};\n\nvar isImportRule = function isImportRule(element) {\n return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;\n};\n\nvar isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {\n for (var i = index - 1; i >= 0; i--) {\n if (!isImportRule(children[i])) {\n return true;\n }\n }\n\n return false;\n}; // use this to remove incorrect elements from further processing\n// so they don't get handed to the `sheet` (or anything else)\n// as that could potentially lead to additional logs which in turn could be overhelming to the user\n\n\nvar nullifyElement = function nullifyElement(element) {\n element.type = '';\n element.value = '';\n element[\"return\"] = '';\n element.children = '';\n element.props = '';\n};\n\nvar incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {\n if (!isImportRule(element)) {\n return;\n }\n\n if (element.parent) {\n console.error(\"`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.\");\n nullifyElement(element);\n } else if (isPrependedWithRegularRules(index, children)) {\n console.error(\"`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.\");\n nullifyElement(element);\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (process.env.NODE_ENV !== 'production' && !key) {\n throw new Error(\"You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\\n\" + \"If multiple caches share the same key they might \\\"fight\\\" for each other's style elements.\");\n }\n\n if (key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' '); // $FlowFixMe\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n if (process.env.NODE_ENV !== 'production') {\n omnipresentPlugins.push(createUnsafeSelectorsAlarm({\n get compat() {\n return cache.compat;\n }\n\n }), incorrectImportAlarm);\n }\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {\n if (!element.root) {\n if (element[\"return\"]) {\n currentSheet.insert(element[\"return\"]);\n } else if (element.value && element.type !== COMMENT) {\n // insert empty rule in non-production environments\n // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet\n currentSheet.insert(element.value + \"{}\");\n }\n }\n } : rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n currentSheet = {\n insert: function insert(rule) {\n sheet.insert(rule + serialized.map);\n }\n };\n }\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n", "/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n", "'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n", "import hoistNonReactStatics$1 from 'hoist-non-react-statics';\n\n// this file isolates this package that is not tree-shakeable\n// and if this module doesn't actually contain any logic of its own\n// then Rollup just use 'hoist-non-react-statics' directly in other chunks\n\nvar hoistNonReactStatics = (function (targetComponent, sourceComponent) {\n return hoistNonReactStatics$1(targetComponent, sourceComponent);\n});\n\nexport { hoistNonReactStatics as default };\n", "var isBrowser = \"object\" !== 'undefined';\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n", "/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport { murmur2 as default };\n", "var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n", "import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\\(|(no-)?(open|close)-quote/;\n var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n throw new Error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error(noComponentSelectorMessage);\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n return cached !== undefined ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*(;|$)/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//g;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n", "import * as React from 'react';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n", "import * as React from 'react';\nimport { useContext, forwardRef } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar isBrowser = \"object\" !== 'undefined';\nvar hasOwnProperty = {}.hasOwnProperty;\n\nvar EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nif (process.env.NODE_ENV !== 'production') {\n EmotionCacheContext.displayName = 'EmotionCacheContext';\n}\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache(func) {\n // $FlowFixMe\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nif (!isBrowser) {\n withEmotionCache = function withEmotionCache(func) {\n return function (props) {\n var cache = useContext(EmotionCacheContext);\n\n if (cache === null) {\n // yes, we're potentially creating this on every render\n // it doesn't actually matter though since it's only on the server\n // so there will only every be a single render\n // that could change in the future because of suspense and etc. but for now,\n // this works and i don't want to optimise for a future thing that we aren't sure about\n cache = createCache({\n key: 'css'\n });\n return /*#__PURE__*/React.createElement(EmotionCacheContext.Provider, {\n value: cache\n }, func(props, cache));\n } else {\n return func(props, cache);\n }\n };\n };\n}\n\nvar ThemeContext = /* #__PURE__ */React.createContext({});\n\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'EmotionThemeContext';\n}\n\nvar useTheme = function useTheme() {\n return React.useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {\n throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');\n }\n\n return mergedTheme;\n }\n\n if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {\n throw new Error('[ThemeProvider] Please make your theme prop a plain object');\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = React.useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/React.createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n\n var render = function render(props, ref) {\n var theme = React.useContext(ThemeContext);\n return /*#__PURE__*/React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n }; // $FlowFixMe\n\n\n var WithTheme = /*#__PURE__*/React.forwardRef(render);\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar getLastPart = function getLastPart(functionName) {\n // The match may be something like 'Object.createEmotionProps' or\n // 'Loader.prototype.render'\n var parts = functionName.split('.');\n return parts[parts.length - 1];\n};\n\nvar getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {\n // V8\n var match = /^\\s+at\\s+([A-Za-z0-9$.]+)\\s/.exec(line);\n if (match) return getLastPart(match[1]); // Safari / Firefox\n\n match = /^([A-Za-z0-9$.]+)@/.exec(line);\n if (match) return getLastPart(match[1]);\n return undefined;\n};\n\nvar internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS\n// identifiers, thus we only need to replace what is a valid character for JS,\n// but not for CSS.\n\nvar sanitizeIdentifier = function sanitizeIdentifier(identifier) {\n return identifier.replace(/\\$/g, '-');\n};\n\nvar getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {\n if (!stackTrace) return undefined;\n var lines = stackTrace.split('\\n');\n\n for (var i = 0; i < lines.length; i++) {\n var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just \"Error\"\n\n if (!functionName) continue; // If we reach one of these, we have gone too far and should quit\n\n if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an\n // uppercase letter\n\n if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);\n }\n\n return undefined;\n};\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' && // check if there is a css declaration\n props.css.indexOf(':') !== -1) {\n throw new Error(\"Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`\" + props.css + \"`\");\n }\n\n var newProps = {};\n\n for (var key in props) {\n if (hasOwnProperty.call(props, key)) {\n newProps[key] = props[key];\n }\n }\n\n newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when\n // the label hasn't already been computed\n\n if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {\n var label = getLabelFromStackTrace(new Error().stack);\n if (label) newProps[labelPropName] = label;\n }\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));\n\n if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {\n var labelFromStack = props[labelPropName];\n\n if (labelFromStack) {\n serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);\n }\n }\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var key in props) {\n if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {\n newProps[key] = props[key];\n }\n }\n\n newProps.ref = ref;\n newProps.className = className;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Emotion.displayName = 'EmotionCssPropInternal';\n}\n\nvar Emotion$1 = Emotion;\n\nexport { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwnProperty as h, isBrowser as i, useTheme as u, withEmotionCache as w };\n", "import { h as hasOwnProperty, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, i as isBrowser$1 } from './emotion-element-c39617d8.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-c39617d8.browser.esm.js';\nimport * as React from 'react';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { serializeStyles } from '@emotion/serialize';\nimport '@emotion/cache';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport 'hoist-non-react-statics';\n\nvar pkg = {\n\tname: \"@emotion/react\",\n\tversion: \"11.11.3\",\n\tmain: \"dist/emotion-react.cjs.js\",\n\tmodule: \"dist/emotion-react.esm.js\",\n\tbrowser: {\n\t\t\"./dist/emotion-react.esm.js\": \"./dist/emotion-react.browser.esm.js\"\n\t},\n\texports: {\n\t\t\".\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./dist/emotion-react.worker.esm.js\",\n\t\t\t\tbrowser: \"./dist/emotion-react.browser.esm.js\",\n\t\t\t\t\"default\": \"./dist/emotion-react.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/emotion-react.cjs.mjs\",\n\t\t\t\"default\": \"./dist/emotion-react.cjs.js\"\n\t\t},\n\t\t\"./jsx-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs\",\n\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js\"\n\t\t},\n\t\t\"./_isolated-hnrs\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js\",\n\t\t\t\tbrowser: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js\",\n\t\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs\",\n\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js\"\n\t\t},\n\t\t\"./jsx-dev-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs\",\n\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\",\n\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\"./macro\": {\n\t\t\ttypes: {\n\t\t\t\t\"import\": \"./macro.d.mts\",\n\t\t\t\t\"default\": \"./macro.d.ts\"\n\t\t\t},\n\t\t\t\"default\": \"./macro.js\"\n\t\t}\n\t},\n\ttypes: \"types/index.d.ts\",\n\tfiles: [\n\t\t\"src\",\n\t\t\"dist\",\n\t\t\"jsx-runtime\",\n\t\t\"jsx-dev-runtime\",\n\t\t\"_isolated-hnrs\",\n\t\t\"types/*.d.ts\",\n\t\t\"macro.*\"\n\t],\n\tsideEffects: false,\n\tauthor: \"Emotion Contributors\",\n\tlicense: \"MIT\",\n\tscripts: {\n\t\t\"test:typescript\": \"dtslint types\"\n\t},\n\tdependencies: {\n\t\t\"@babel/runtime\": \"^7.18.3\",\n\t\t\"@emotion/babel-plugin\": \"^11.11.0\",\n\t\t\"@emotion/cache\": \"^11.11.0\",\n\t\t\"@emotion/serialize\": \"^1.1.3\",\n\t\t\"@emotion/use-insertion-effect-with-fallbacks\": \"^1.0.1\",\n\t\t\"@emotion/utils\": \"^1.2.1\",\n\t\t\"@emotion/weak-memoize\": \"^0.3.1\",\n\t\t\"hoist-non-react-statics\": \"^3.3.1\"\n\t},\n\tpeerDependencies: {\n\t\treact: \">=16.8.0\"\n\t},\n\tpeerDependenciesMeta: {\n\t\t\"@types/react\": {\n\t\t\toptional: true\n\t\t}\n\t},\n\tdevDependencies: {\n\t\t\"@definitelytyped/dtslint\": \"0.0.112\",\n\t\t\"@emotion/css\": \"11.11.2\",\n\t\t\"@emotion/css-prettifier\": \"1.1.3\",\n\t\t\"@emotion/server\": \"11.11.0\",\n\t\t\"@emotion/styled\": \"11.11.0\",\n\t\t\"html-tag-names\": \"^1.1.2\",\n\t\treact: \"16.14.0\",\n\t\t\"svg-tag-names\": \"^1.1.1\",\n\t\ttypescript: \"^4.5.5\"\n\t},\n\trepository: \"https://github.com/emotion-js/emotion/tree/main/packages/react\",\n\tpublishConfig: {\n\t\taccess: \"public\"\n\t},\n\t\"umd:main\": \"dist/emotion-react.umd.min.js\",\n\tpreconstruct: {\n\t\tentrypoints: [\n\t\t\t\"./index.js\",\n\t\t\t\"./jsx-runtime.js\",\n\t\t\t\"./jsx-dev-runtime.js\",\n\t\t\t\"./_isolated-hnrs.js\"\n\t\t],\n\t\tumdName: \"emotionReact\",\n\t\texports: {\n\t\t\tenvConditions: [\n\t\t\t\t\"browser\",\n\t\t\t\t\"worker\"\n\t\t\t],\n\t\t\textra: {\n\t\t\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\t\t\"./macro\": {\n\t\t\t\t\ttypes: {\n\t\t\t\t\t\t\"import\": \"./macro.d.mts\",\n\t\t\t\t\t\t\"default\": \"./macro.d.ts\"\n\t\t\t\t\t},\n\t\t\t\t\t\"default\": \"./macro.js\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar jsx = function jsx(type, props) {\n var args = arguments;\n\n if (props == null || !hasOwnProperty.call(props, 'css')) {\n // $FlowFixMe\n return React.createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n } // $FlowFixMe\n\n\n return React.createElement.apply(null, createElementArgArray);\n};\n\nvar warnedAboutCssPropForGlobal = false; // maintain place over rerenders.\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is\n // probably using the custom createElement which\n // means it will be turned into a className prop\n // $FlowFixMe I don't really want to add it to the type since it shouldn't be used\n props.className || props.css)) {\n console.error(\"It looks like you're using the css prop on Global, did you mean to use the styles prop instead?\");\n warnedAboutCssPropForGlobal = true;\n }\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));\n\n if (!isBrowser$1) {\n var _ref;\n\n var serializedNames = serialized.name;\n var serializedStyles = serialized.styles;\n var next = serialized.next;\n\n while (next !== undefined) {\n serializedNames += ' ' + next.name;\n serializedStyles += next.styles;\n next = next.next;\n }\n\n var shouldCache = cache.compat === true;\n var rules = cache.insert(\"\", {\n name: serializedNames,\n styles: serializedStyles\n }, cache.sheet, shouldCache);\n\n if (shouldCache) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"style\", (_ref = {}, _ref[\"data-emotion\"] = cache.key + \"-global \" + serializedNames, _ref.dangerouslySetInnerHTML = {\n __html: rules\n }, _ref.nonce = cache.sheet.nonce, _ref));\n } // yes, i know these hooks are used conditionally\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = React.useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false; // $FlowFixMe\n\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Global.displayName = 'EmotionGlobal';\n}\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nvar keyframes = function keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name; // $FlowFixMe\n\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n};\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {\n console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.');\n }\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: React.useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nif (process.env.NODE_ENV !== 'production') {\n ClassNames.displayName = 'EmotionClassNames';\n}\n\nif (process.env.NODE_ENV !== 'production') {\n var isBrowser = \"object\" !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked\n\n var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';\n\n if (isBrowser && !isTestEnv) {\n // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later\n var globalContext = // $FlowIgnore\n typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef\n : isBrowser ? window : global;\n var globalKey = \"__EMOTION_REACT_\" + pkg.version.split('.')[0] + \"__\";\n\n if (globalContext[globalKey]) {\n console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');\n }\n\n globalContext[globalKey] = true;\n }\n}\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n", "import _extends from '@babel/runtime/helpers/esm/extends';\nimport * as React from 'react';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { withEmotionCache, ThemeContext } from '@emotion/react';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar testOmitPropsOnStringTag = isPropValid;\n\nvar testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {\n return key !== 'theme';\n};\n\nvar getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {\n return typeof tag === 'string' && // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;\n};\nvar composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {\n var shouldForwardProp;\n\n if (options) {\n var optionsShouldForwardProp = options.shouldForwardProp;\n shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {\n return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);\n } : optionsShouldForwardProp;\n }\n\n if (typeof shouldForwardProp !== 'function' && isReal) {\n shouldForwardProp = tag.__emotion_forwardProp;\n }\n\n return shouldForwardProp;\n};\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar createStyled = function createStyled(tag, options) {\n if (process.env.NODE_ENV !== 'production') {\n if (tag === undefined) {\n throw new Error('You are trying to create a styled element with an undefined component.\\nYou may have forgotten to import it.');\n }\n }\n\n var isReal = tag.__emotion_real === tag;\n var baseTag = isReal && tag.__emotion_base || tag;\n var identifierName;\n var targetClassName;\n\n if (options !== undefined) {\n identifierName = options.label;\n targetClassName = options.target;\n }\n\n var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);\n var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);\n var shouldUseAs = !defaultShouldForwardProp('as');\n return function () {\n var args = arguments;\n var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];\n\n if (identifierName !== undefined) {\n styles.push(\"label:\" + identifierName + \";\");\n }\n\n if (args[0] == null || args[0].raw === undefined) {\n styles.push.apply(styles, args);\n } else {\n if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles.push(args[0][0]);\n var len = args.length;\n var i = 1;\n\n for (; i < len; i++) {\n if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles.push(args[i], args[0][i]);\n }\n } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class\n\n\n var Styled = withEmotionCache(function (props, cache, ref) {\n var FinalTag = shouldUseAs && props.as || baseTag;\n var className = '';\n var classInterpolations = [];\n var mergedProps = props;\n\n if (props.theme == null) {\n mergedProps = {};\n\n for (var key in props) {\n mergedProps[key] = props[key];\n }\n\n mergedProps.theme = React.useContext(ThemeContext);\n }\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, classInterpolations, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);\n className += cache.key + \"-\" + serialized.name;\n\n if (targetClassName !== undefined) {\n className += \" \" + targetClassName;\n }\n\n var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;\n var newProps = {};\n\n for (var _key in props) {\n if (shouldUseAs && _key === 'as') continue;\n\n if ( // $FlowFixMe\n finalShouldForwardProp(_key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps.className = className;\n newProps.ref = ref;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof FinalTag === 'string'\n }), /*#__PURE__*/React.createElement(FinalTag, newProps));\n });\n Styled.displayName = identifierName !== undefined ? identifierName : \"Styled(\" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + \")\";\n Styled.defaultProps = tag.defaultProps;\n Styled.__emotion_real = Styled;\n Styled.__emotion_base = baseTag;\n Styled.__emotion_styles = styles;\n Styled.__emotion_forwardProp = shouldForwardProp;\n Object.defineProperty(Styled, 'toString', {\n value: function value() {\n if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {\n return 'NO_COMPONENT_SELECTOR';\n } // $FlowFixMe: coerce undefined to string\n\n\n return \".\" + targetClassName;\n }\n });\n\n Styled.withComponent = function (nextTag, nextOptions) {\n return createStyled(nextTag, _extends({}, options, nextOptions, {\n shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)\n })).apply(void 0, styles);\n };\n\n return Styled;\n };\n};\n\nexport { createStyled as default };\n", "import createStyled from '../base/dist/emotion-styled-base.browser.esm.js';\nimport '@babel/runtime/helpers/extends';\nimport 'react';\nimport '@emotion/is-prop-valid';\nimport '@emotion/react';\nimport '@emotion/utils';\nimport '@emotion/serialize';\nimport '@emotion/use-insertion-effect-with-fallbacks';\n\nvar tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG\n'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];\n\nvar newStyled = createStyled.bind();\ntags.forEach(function (tagName) {\n // $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type\n newStyled[tagName] = newStyled(tagName);\n});\n\nexport { newStyled as default };\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n", "/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = StyledEngineProvider;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _react2 = require(\"@emotion/react\");\nvar _cache = _interopRequireDefault(require(\"@emotion/cache\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// prepend: true moves MUI styles to the top of the so they're loaded first.\n// It allows developers to easily override MUI styles with other styling solutions, like CSS modules.\nlet cache;\nif (typeof document === 'object') {\n cache = (0, _cache.default)({\n key: 'css',\n prepend: true\n });\n}\nfunction StyledEngineProvider(props) {\n const {\n injectFirst,\n children\n } = props;\n return injectFirst && cache ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.CacheProvider, {\n value: cache,\n children: children\n }) : children;\n}\nprocess.env.NODE_ENV !== \"production\" ? StyledEngineProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: _propTypes.default.node,\n /**\n * By default, the styles are injected last in the element of the page.\n * As a result, they gain more specificity than any other style sheet.\n * If you want to override MUI's styles, set this prop.\n */\n injectFirst: _propTypes.default.bool\n} : void 0;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _StyledEngineProvider.default;\n }\n});\nvar _StyledEngineProvider = _interopRequireDefault(require(\"./StyledEngineProvider\"));", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = GlobalStyles;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _react2 = require(\"@emotion/react\");\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction isEmpty(obj) {\n return obj === undefined || obj === null || Object.keys(obj).length === 0;\n}\nfunction GlobalStyles(props) {\n const {\n styles,\n defaultTheme = {}\n } = props;\n const globalStyles = typeof styles === 'function' ? themeInput => styles(isEmpty(themeInput) ? defaultTheme : themeInput) : styles;\n return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Global, {\n styles: globalStyles\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GlobalStyles.propTypes = {\n defaultTheme: _propTypes.default.object,\n styles: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.string, _propTypes.default.object, _propTypes.default.func])\n} : void 0;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _GlobalStyles.default;\n }\n});\nvar _GlobalStyles = _interopRequireDefault(require(\"./GlobalStyles\"));", "/**\n * @mui/styled-engine v5.15.9\n *\n * @license MIT\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\"use strict\";\n'use client';\n\n/* eslint-disable no-underscore-dangle */\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"GlobalStyles\", {\n enumerable: true,\n get: function () {\n return _GlobalStyles.default;\n }\n});\nObject.defineProperty(exports, \"StyledEngineProvider\", {\n enumerable: true,\n get: function () {\n return _StyledEngineProvider.default;\n }\n});\nObject.defineProperty(exports, \"ThemeContext\", {\n enumerable: true,\n get: function () {\n return _react.ThemeContext;\n }\n});\nObject.defineProperty(exports, \"css\", {\n enumerable: true,\n get: function () {\n return _react.css;\n }\n});\nexports.default = styled;\nexports.internal_processStyles = void 0;\nObject.defineProperty(exports, \"keyframes\", {\n enumerable: true,\n get: function () {\n return _react.keyframes;\n }\n});\nvar _styled = _interopRequireDefault(require(\"@emotion/styled\"));\nvar _react = require(\"@emotion/react\");\nvar _StyledEngineProvider = _interopRequireDefault(require(\"./StyledEngineProvider\"));\nvar _GlobalStyles = _interopRequireDefault(require(\"./GlobalStyles\"));\nfunction styled(tag, options) {\n const stylesFactory = (0, _styled.default)(tag, options);\n if (process.env.NODE_ENV !== 'production') {\n return (...styles) => {\n const component = typeof tag === 'string' ? `\"${tag}\"` : 'component';\n if (styles.length === 0) {\n console.error([`MUI: Seems like you called \\`styled(${component})()\\` without a \\`style\\` argument.`, 'You must provide a `styles` argument: `styled(\"div\")(styleYouForgotToPass)`.'].join('\\n'));\n } else if (styles.some(style => style === undefined)) {\n console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);\n }\n return stylesFactory(...styles);\n };\n }\n return stylesFactory;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst internal_processStyles = (tag, processor) => {\n // Emotion attaches all the styles as `__emotion_styles`.\n // Ref: https://github.com/emotion-js/emotion/blob/16d971d0da229596d6bcc39d282ba9753c9ee7cf/packages/styled/src/base.js#L186\n if (Array.isArray(tag.__emotion_styles)) {\n tag.__emotion_styles = processor(tag.__emotion_styles);\n }\n};\nexports.internal_processStyles = internal_processStyles;", "function _extends() {\n module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _extends.apply(this, arguments);\n}\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nmodule.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = chainPropTypes;\nfunction chainPropTypes(propType1, propType2) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n return function validate(...args) {\n return propType1(...args) || propType2(...args);\n };\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _chainPropTypes.default;\n }\n});\nvar _chainPropTypes = _interopRequireDefault(require(\"./chainPropTypes\"));", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = deepmerge;\nexports.isPlainObject = isPlainObject;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\n// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js\nfunction isPlainObject(item) {\n if (typeof item !== 'object' || item === null) {\n return false;\n }\n const prototype = Object.getPrototypeOf(item);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);\n}\nfunction deepClone(source) {\n if (!isPlainObject(source)) {\n return source;\n }\n const output = {};\n Object.keys(source).forEach(key => {\n output[key] = deepClone(source[key]);\n });\n return output;\n}\nfunction deepmerge(target, source, options = {\n clone: true\n}) {\n const output = options.clone ? (0, _extends2.default)({}, target) : target;\n if (isPlainObject(target) && isPlainObject(source)) {\n Object.keys(source).forEach(key => {\n // Avoid prototype pollution\n if (key === '__proto__') {\n return;\n }\n if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {\n // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.\n output[key] = deepmerge(target[key], source[key], options);\n } else if (options.clone) {\n output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];\n } else {\n output[key] = source[key];\n }\n });\n }\n return output;\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {};\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _deepmerge.default;\n }\n});\nvar _deepmerge = _interopRequireWildcard(require(\"./deepmerge\"));\nObject.keys(_deepmerge).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _deepmerge[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _deepmerge[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _chainPropTypes = _interopRequireDefault(require(\"../chainPropTypes\"));\nfunction isClassComponent(elementType) {\n // elementType.prototype?.isReactComponent\n const {\n prototype = {}\n } = elementType;\n return Boolean(prototype.isReactComponent);\n}\nfunction acceptingRef(props, propName, componentName, location, propFullName) {\n const element = props[propName];\n const safePropName = propFullName || propName;\n if (element == null ||\n // When server-side rendering React doesn't warn either.\n // This is not an accurate check for SSR.\n // This is only in place for Emotion compat.\n // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.\n typeof window === 'undefined') {\n return null;\n }\n let warningHint;\n const elementType = element.type;\n /**\n * Blacklisting instead of whitelisting\n *\n * Blacklisting will miss some components, such as React.Fragment. Those will at least\n * trigger a warning in React.\n * We can't whitelist because there is no safe way to detect React.forwardRef\n * or class components. \"Safe\" means there's no public API.\n *\n */\n if (typeof elementType === 'function' && !isClassComponent(elementType)) {\n warningHint = 'Did you accidentally use a plain function component for an element instead?';\n }\n if (warningHint !== undefined) {\n return new Error(`Invalid ${location} \\`${safePropName}\\` supplied to \\`${componentName}\\`. ` + `Expected an element that can hold a ref. ${warningHint} ` + 'For more information see https://mui.com/r/caveat-with-refs-guide');\n }\n return null;\n}\nconst elementAcceptingRef = (0, _chainPropTypes.default)(_propTypes.default.element, acceptingRef);\nelementAcceptingRef.isRequired = (0, _chainPropTypes.default)(_propTypes.default.element.isRequired, acceptingRef);\nvar _default = exports.default = elementAcceptingRef;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _elementAcceptingRef.default;\n }\n});\nvar _elementAcceptingRef = _interopRequireDefault(require(\"./elementAcceptingRef\"));", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _chainPropTypes = _interopRequireDefault(require(\"../chainPropTypes\"));\nfunction isClassComponent(elementType) {\n // elementType.prototype?.isReactComponent\n const {\n prototype = {}\n } = elementType;\n return Boolean(prototype.isReactComponent);\n}\nfunction elementTypeAcceptingRef(props, propName, componentName, location, propFullName) {\n const propValue = props[propName];\n const safePropName = propFullName || propName;\n if (propValue == null ||\n // When server-side rendering React doesn't warn either.\n // This is not an accurate check for SSR.\n // This is only in place for emotion compat.\n // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.\n typeof window === 'undefined') {\n return null;\n }\n let warningHint;\n\n /**\n * Blacklisting instead of whitelisting\n *\n * Blacklisting will miss some components, such as React.Fragment. Those will at least\n * trigger a warning in React.\n * We can't whitelist because there is no safe way to detect React.forwardRef\n * or class components. \"Safe\" means there's no public API.\n *\n */\n if (typeof propValue === 'function' && !isClassComponent(propValue)) {\n warningHint = 'Did you accidentally provide a plain function component instead?';\n }\n if (warningHint !== undefined) {\n return new Error(`Invalid ${location} \\`${safePropName}\\` supplied to \\`${componentName}\\`. ` + `Expected an element type that can hold a ref. ${warningHint} ` + 'For more information see https://mui.com/r/caveat-with-refs-guide');\n }\n return null;\n}\nvar _default = exports.default = (0, _chainPropTypes.default)(_propTypes.default.elementType, elementTypeAcceptingRef);", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _elementTypeAcceptingRef.default;\n }\n});\nvar _elementTypeAcceptingRef = _interopRequireDefault(require(\"./elementTypeAcceptingRef\"));", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exactProp;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\n// This module is based on https://github.com/airbnb/prop-types-exact repository.\n// However, in order to reduce the number of dependencies and to remove some extra safe checks\n// the module was forked.\n\nconst specialProperty = 'exact-prop: \\u200b';\nfunction exactProp(propTypes) {\n if (process.env.NODE_ENV === 'production') {\n return propTypes;\n }\n return (0, _extends2.default)({}, propTypes, {\n [specialProperty]: props => {\n const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));\n if (unsupportedProps.length > 0) {\n return new Error(`The following props are not supported: ${unsupportedProps.map(prop => `\\`${prop}\\``).join(', ')}. Please remove them.`);\n }\n return null;\n }\n });\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _exactProp.default;\n }\n});\nvar _exactProp = _interopRequireDefault(require(\"./exactProp\"));", "/**\n * @license React\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=Symbol.for(\"react.element\"),c=Symbol.for(\"react.portal\"),d=Symbol.for(\"react.fragment\"),e=Symbol.for(\"react.strict_mode\"),f=Symbol.for(\"react.profiler\"),g=Symbol.for(\"react.provider\"),h=Symbol.for(\"react.context\"),k=Symbol.for(\"react.server_context\"),l=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),n=Symbol.for(\"react.suspense_list\"),p=Symbol.for(\"react.memo\"),q=Symbol.for(\"react.lazy\"),t=Symbol.for(\"react.offscreen\"),u;u=Symbol.for(\"react.module.reference\");\nfunction v(a){if(\"object\"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;\nexports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};\nexports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||\"object\"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getDisplayName;\nexports.getFunctionName = getFunctionName;\nvar _reactIs = require(\"react-is\");\n// Simplified polyfill for IE11 support\n// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3\nconst fnNameMatchRegex = /^\\s*function(?:\\s|\\s*\\/\\*.*\\*\\/\\s*)+([^(\\s/]*)\\s*/;\nfunction getFunctionName(fn) {\n const match = `${fn}`.match(fnNameMatchRegex);\n const name = match && match[1];\n return name || '';\n}\nfunction getFunctionComponentName(Component, fallback = '') {\n return Component.displayName || Component.name || getFunctionName(Component) || fallback;\n}\nfunction getWrappedName(outerType, innerType, wrapperName) {\n const functionName = getFunctionComponentName(innerType);\n return outerType.displayName || (functionName !== '' ? `${wrapperName}(${functionName})` : wrapperName);\n}\n\n/**\n * cherry-pick from\n * https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js\n * originally forked from recompose/getDisplayName with added IE11 support\n */\nfunction getDisplayName(Component) {\n if (Component == null) {\n return undefined;\n }\n if (typeof Component === 'string') {\n return Component;\n }\n if (typeof Component === 'function') {\n return getFunctionComponentName(Component, 'Component');\n }\n\n // TypeScript can't have components as objects but they exist in the form of `memo` or `Suspense`\n if (typeof Component === 'object') {\n switch (Component.$$typeof) {\n case _reactIs.ForwardRef:\n return getWrappedName(Component, Component.render, 'ForwardRef');\n case _reactIs.Memo:\n return getWrappedName(Component, Component.type, 'memo');\n default:\n return undefined;\n }\n }\n return undefined;\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {};\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _getDisplayName.default;\n }\n});\nvar _getDisplayName = _interopRequireWildcard(require(\"./getDisplayName\"));\nObject.keys(_getDisplayName).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _getDisplayName[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _getDisplayName[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = HTMLElementType;\nfunction HTMLElementType(props, propName, componentName, location, propFullName) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n const propValue = props[propName];\n const safePropName = propFullName || propName;\n if (propValue == null) {\n return null;\n }\n if (propValue && propValue.nodeType !== 1) {\n return new Error(`Invalid ${location} \\`${safePropName}\\` supplied to \\`${componentName}\\`. ` + `Expected an HTMLElement.`);\n }\n return null;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _HTMLElementType.default;\n }\n});\nvar _HTMLElementType = _interopRequireDefault(require(\"./HTMLElementType\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n/* eslint-disable */\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar _default = exports.default = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _ponyfillGlobal.default;\n }\n});\nvar _ponyfillGlobal = _interopRequireDefault(require(\"./ponyfillGlobal\"));", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nconst refType = _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]);\nvar _default = exports.default = refType;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _refType.default;\n }\n});\nvar _refType = _interopRequireDefault(require(\"./refType\"));", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = capitalize;\nvar _formatMuiErrorMessage2 = _interopRequireDefault(require(\"@mui/utils/formatMuiErrorMessage\"));\n// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.\n//\n// A strict capitalization should uppercase the first letter of each word in the sentence.\n// We only handle the first word.\nfunction capitalize(string) {\n if (typeof string !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`capitalize(string)\\` expects a string argument.` : (0, _formatMuiErrorMessage2.default)(7));\n }\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _capitalize.default;\n }\n});\nvar _capitalize = _interopRequireDefault(require(\"./capitalize\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createChainedFunction;\n/**\n * Safe chained function.\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n */\nfunction createChainedFunction(...funcs) {\n return funcs.reduce((acc, func) => {\n if (func == null) {\n return acc;\n }\n return function chainedFunction(...args) {\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, () => {});\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _createChainedFunction.default;\n }\n});\nvar _createChainedFunction = _interopRequireDefault(require(\"./createChainedFunction\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = debounce;\n// Corresponds to 10 frames at 60 Hz.\n// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.\nfunction debounce(func, wait = 166) {\n let timeout;\n function debounced(...args) {\n const later = () => {\n // @ts-ignore\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n return debounced;\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {};\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _debounce.default;\n }\n});\nvar _debounce = _interopRequireWildcard(require(\"./debounce\"));\nObject.keys(_debounce).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _debounce[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _debounce[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = deprecatedPropType;\nfunction deprecatedPropType(validator, reason) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n return (props, propName, componentName, location, propFullName) => {\n const componentNameSafe = componentName || '<>';\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The ${location} \\`${propFullNameSafe}\\` of ` + `\\`${componentNameSafe}\\` is deprecated. ${reason}`);\n }\n return null;\n };\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _deprecatedPropType.default;\n }\n});\nvar _deprecatedPropType = _interopRequireDefault(require(\"./deprecatedPropType\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isMuiElement;\nvar React = _interopRequireWildcard(require(\"react\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction isMuiElement(element, muiNames) {\n var _muiName, _element$type;\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName\n // relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45\n // eslint-disable-next-line no-underscore-dangle\n (_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _isMuiElement.default;\n }\n});\nvar _isMuiElement = _interopRequireDefault(require(\"./isMuiElement\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = ownerDocument;\nfunction ownerDocument(node) {\n return node && node.ownerDocument || document;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _ownerDocument.default;\n }\n});\nvar _ownerDocument = _interopRequireDefault(require(\"./ownerDocument\"));", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = ownerWindow;\nvar _ownerDocument = _interopRequireDefault(require(\"../ownerDocument\"));\nfunction ownerWindow(node) {\n const doc = (0, _ownerDocument.default)(node);\n return doc.defaultView || window;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _ownerWindow.default;\n }\n});\nvar _ownerWindow = _interopRequireDefault(require(\"./ownerWindow\"));", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = requirePropFactory;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nfunction requirePropFactory(componentNameInError, Component) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n\n // eslint-disable-next-line react/forbid-foreign-prop-types\n const prevPropTypes = Component ? (0, _extends2.default)({}, Component.propTypes) : null;\n const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {\n const propFullNameSafe = propFullName || propName;\n const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];\n if (defaultTypeChecker) {\n const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);\n if (typeCheckerResult) {\n return typeCheckerResult;\n }\n }\n if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {\n return new Error(`The prop \\`${propFullNameSafe}\\` of ` + `\\`${componentNameInError}\\` can only be used together with the \\`${requiredProp}\\` prop.`);\n }\n return null;\n };\n return requireProp;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _requirePropFactory.default;\n }\n});\nvar _requirePropFactory = _interopRequireDefault(require(\"./requirePropFactory\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = setRef;\n/**\n * TODO v5: consider making it private\n *\n * passes {value} to {ref}\n *\n * WARNING: Be sure to only call this inside a callback that is passed as a ref.\n * Otherwise, make sure to cleanup the previous {ref} if it changes. See\n * https://github.com/mui/material-ui/issues/13539\n *\n * Useful if you want to expose the ref of an inner component to the public API\n * while still using it inside the component.\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\n */\nfunction setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _setRef.default;\n }\n});\nvar _setRef = _interopRequireDefault(require(\"./setRef\"));", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar React = _interopRequireWildcard(require(\"react\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n/**\n * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.\n * This is useful for effects that are only needed for client-side rendering but not for SSR.\n *\n * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * and confirm it doesn't apply to your use-case.\n */\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nvar _default = exports.default = useEnhancedEffect;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _useEnhancedEffect.default;\n }\n});\nvar _useEnhancedEffect = _interopRequireDefault(require(\"./useEnhancedEffect\"));", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = useId;\nvar React = _interopRequireWildcard(require(\"react\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nlet globalId = 0;\nfunction useGlobalId(idOverride) {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`mui-${globalId}`);\n }\n }, [defaultId]);\n return id;\n}\n\n// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseId = React['useId'.toString()];\n/**\n *\n * @example
\n * @param idOverride\n * @returns {string}\n */\nfunction useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride);\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _useId.default;\n }\n});\nvar _useId = _interopRequireDefault(require(\"./useId\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = unsupportedProp;\nfunction unsupportedProp(props, propName, componentName, location, propFullName) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The prop \\`${propFullNameSafe}\\` is not supported. Please remove it.`);\n }\n return null;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _unsupportedProp.default;\n }\n});\nvar _unsupportedProp = _interopRequireDefault(require(\"./unsupportedProp\"));", "\"use strict\";\n'use client';\n\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = useControlled;\nvar React = _interopRequireWildcard(require(\"react\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && defaultValue !== defaultProp) {\n console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _useControlled.default;\n }\n});\nvar _useControlled = _interopRequireDefault(require(\"./useControlled\"));", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _useEnhancedEffect = _interopRequireDefault(require(\"../useEnhancedEffect\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n/**\n * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892\n * See RFC in https://github.com/reactjs/rfcs/pull/220\n */\n\nfunction useEventCallback(fn) {\n const ref = React.useRef(fn);\n (0, _useEnhancedEffect.default)(() => {\n ref.current = fn;\n });\n return React.useRef((...args) =>\n // @ts-expect-error hide `this`\n (0, ref.current)(...args)).current;\n}\nvar _default = exports.default = useEventCallback;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _useEventCallback.default;\n }\n});\nvar _useEventCallback = _interopRequireDefault(require(\"./useEventCallback\"));", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = useForkRef;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _setRef = _interopRequireDefault(require(\"../setRef\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction useForkRef(...refs) {\n /**\n * This will create a new function if the refs passed to this hook change and are all defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior.\n */\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return instance => {\n refs.forEach(ref => {\n (0, _setRef.default)(ref, instance);\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _useForkRef.default;\n }\n});\nvar _useForkRef = _interopRequireDefault(require(\"./useForkRef\"));", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = useLazyRef;\nvar React = _interopRequireWildcard(require(\"react\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized lazily with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useLazyRef(sortColumns, columns)\n */\nfunction useLazyRef(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _useLazyRef.default;\n }\n});\nvar _useLazyRef = _interopRequireDefault(require(\"./useLazyRef\"));", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = useOnMount;\nvar React = _interopRequireWildcard(require(\"react\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst EMPTY = [];\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nfunction useOnMount(fn) {\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Timeout = void 0;\nexports.default = useTimeout;\nvar _useLazyRef = _interopRequireDefault(require(\"../useLazyRef/useLazyRef\"));\nvar _useOnMount = _interopRequireDefault(require(\"../useOnMount/useOnMount\"));\nclass Timeout {\n constructor() {\n this.currentId = 0;\n this.clear = () => {\n if (this.currentId !== 0) {\n clearTimeout(this.currentId);\n this.currentId = 0;\n }\n };\n this.disposeEffect = () => {\n return this.clear;\n };\n }\n static create() {\n return new Timeout();\n }\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = 0;\n fn();\n }, delay);\n }\n}\nexports.Timeout = Timeout;\nfunction useTimeout() {\n const timeout = (0, _useLazyRef.default)(Timeout.create).current;\n (0, _useOnMount.default)(timeout.disposeEffect);\n return timeout;\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"Timeout\", {\n enumerable: true,\n get: function () {\n return _useTimeout.Timeout;\n }\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _useTimeout.default;\n }\n});\nvar _useTimeout = _interopRequireWildcard(require(\"./useTimeout\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _useOnMount.default;\n }\n});\nvar _useOnMount = _interopRequireDefault(require(\"./useOnMount\"));", "\"use strict\";\n'use client';\n\n// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = useIsFocusVisible;\nexports.teardown = teardown;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _useTimeout = require(\"../useTimeout/useTimeout\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nlet hadKeyboardEvent = true;\nlet hadFocusVisibleRecently = false;\nconst hadFocusVisibleRecentlyTimeout = new _useTimeout.Timeout();\nconst inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @returns {boolean}\n */\nfunction focusTriggersKeyboardModality(node) {\n const {\n type,\n tagName\n } = node;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n if (node.isContentEditable) {\n return true;\n }\n return false;\n}\n\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n hadKeyboardEvent = true;\n}\n\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\nfunction teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\nfunction isFocusVisible(event) {\n const {\n target\n } = event;\n try {\n return target.matches(':focus-visible');\n } catch (error) {\n // Browsers not implementing :focus-visible will throw a SyntaxError.\n // We use our own heuristic for those browsers.\n // Rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n }\n\n // No need for validFocusTarget check. The user does that by attaching it to\n // focusable events only.\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\nfunction useIsFocusVisible() {\n const ref = React.useCallback(node => {\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n const isFocusVisibleRef = React.useRef(false);\n\n /**\n * Should be called if a blur event is fired\n */\n function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n hadFocusVisibleRecentlyTimeout.start(100, () => {\n hadFocusVisibleRecently = false;\n });\n isFocusVisibleRef.current = false;\n return true;\n }\n return false;\n }\n\n /**\n * Should be called if a blur event is fired\n */\n function handleFocusVisible(event) {\n if (isFocusVisible(event)) {\n isFocusVisibleRef.current = true;\n return true;\n }\n return false;\n }\n return {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref\n };\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {};\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _useIsFocusVisible.default;\n }\n});\nvar _useIsFocusVisible = _interopRequireWildcard(require(\"./useIsFocusVisible\"));\nObject.keys(_useIsFocusVisible).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _useIsFocusVisible[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _useIsFocusVisible[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getScrollbarSize;\n// A change of the browser zoom change the scrollbar size.\n// Credit https://github.com/twbs/bootstrap/blob/488fd8afc535ca3a6ad4dc581f5e89217b6a36ac/js/src/util/scrollbar.js#L14-L18\nfunction getScrollbarSize(doc) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = doc.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _getScrollbarSize.default;\n }\n});\nvar _getScrollbarSize = _interopRequireDefault(require(\"./getScrollbarSize\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.detectScrollType = detectScrollType;\nexports.getNormalizedScrollLeft = getNormalizedScrollLeft;\n// Source from https://github.com/alitaheri/normalize-scroll-left\nlet cachedType;\n\n/**\n * Based on the jquery plugin https://github.com/othree/jquery.rtl-scroll-type\n *\n * Types of scrollLeft, assuming scrollWidth=100 and direction is rtl.\n *\n * Type | <- Most Left | Most Right -> | Initial\n * ---------------- | ------------ | ------------- | -------\n * default | 0 | 100 | 100\n * negative (spec*) | -100 | 0 | 0\n * reverse | 100 | 0 | 0\n *\n * Edge 85: default\n * Safari 14: negative\n * Chrome 85: negative\n * Firefox 81: negative\n * IE11: reverse\n *\n * spec* https://drafts.csswg.org/cssom-view/#dom-window-scroll\n */\nfunction detectScrollType() {\n if (cachedType) {\n return cachedType;\n }\n const dummy = document.createElement('div');\n const container = document.createElement('div');\n container.style.width = '10px';\n container.style.height = '1px';\n dummy.appendChild(container);\n dummy.dir = 'rtl';\n dummy.style.fontSize = '14px';\n dummy.style.width = '4px';\n dummy.style.height = '1px';\n dummy.style.position = 'absolute';\n dummy.style.top = '-1000px';\n dummy.style.overflow = 'scroll';\n document.body.appendChild(dummy);\n cachedType = 'reverse';\n if (dummy.scrollLeft > 0) {\n cachedType = 'default';\n } else {\n dummy.scrollLeft = 1;\n if (dummy.scrollLeft === 0) {\n cachedType = 'negative';\n }\n }\n document.body.removeChild(dummy);\n return cachedType;\n}\n\n// Based on https://stackoverflow.com/a/24394376\nfunction getNormalizedScrollLeft(element, direction) {\n const scrollLeft = element.scrollLeft;\n\n // Perform the calculations only when direction is rtl to avoid messing up the ltr behavior\n if (direction !== 'rtl') {\n return scrollLeft;\n }\n const type = detectScrollType();\n switch (type) {\n case 'negative':\n return element.scrollWidth - element.clientWidth + scrollLeft;\n case 'reverse':\n return element.scrollWidth - element.clientWidth - scrollLeft;\n default:\n return scrollLeft;\n }\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _scrollLeft = require(\"./scrollLeft\");\nObject.keys(_scrollLeft).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _scrollLeft[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _scrollLeft[key];\n }\n });\n});", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar React = _interopRequireWildcard(require(\"react\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst usePreviousProps = value => {\n const ref = React.useRef({});\n React.useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n};\nvar _default = exports.default = usePreviousProps;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _usePreviousProps.default;\n }\n});\nvar _usePreviousProps = _interopRequireDefault(require(\"./usePreviousProps\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getValidReactChildren;\nvar React = _interopRequireWildcard(require(\"react\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n/**\n * Gets only the valid children of a component,\n * and ignores any nullish or falsy child.\n *\n * @param children the children\n */\nfunction getValidReactChildren(children) {\n return React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child));\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _getValidReactChildren.default;\n }\n});\nvar _getValidReactChildren = _interopRequireDefault(require(\"./getValidReactChildren\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst visuallyHidden = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: -1,\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n whiteSpace: 'nowrap',\n width: '1px'\n};\nvar _default = exports.default = visuallyHidden;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _visuallyHidden.default;\n }\n});\nvar _visuallyHidden = _interopRequireDefault(require(\"./visuallyHidden\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nexports.getTypeByValue = getTypeByValue;\nfunction getTypeByValue(value) {\n const valueType = typeof value;\n switch (valueType) {\n case 'number':\n if (Number.isNaN(value)) {\n return 'NaN';\n }\n if (!Number.isFinite(value)) {\n return 'Infinity';\n }\n if (value !== Math.floor(value)) {\n return 'float';\n }\n return 'number';\n case 'object':\n if (value === null) {\n return 'null';\n }\n return value.constructor.name;\n default:\n return valueType;\n }\n}\n\n// IE 11 support\nfunction ponyfillIsInteger(x) {\n // eslint-disable-next-line no-restricted-globals\n return typeof x === 'number' && isFinite(x) && Math.floor(x) === x;\n}\nconst isInteger = Number.isInteger || ponyfillIsInteger;\nfunction requiredInteger(props, propName, componentName, location) {\n const propValue = props[propName];\n if (propValue == null || !isInteger(propValue)) {\n const propType = getTypeByValue(propValue);\n return new RangeError(`Invalid ${location} \\`${propName}\\` of type \\`${propType}\\` supplied to \\`${componentName}\\`, expected \\`integer\\`.`);\n }\n return null;\n}\nfunction validator(props, propName, ...other) {\n const propValue = props[propName];\n if (propValue === undefined) {\n return null;\n }\n return requiredInteger(props, propName, ...other);\n}\nfunction validatorNoop() {\n return null;\n}\nvalidator.isRequired = requiredInteger;\nvalidatorNoop.isRequired = validatorNoop;\nvar _default = exports.default = process.env.NODE_ENV === 'production' ? validatorNoop : validator;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {};\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _integerPropType.default;\n }\n});\nvar _integerPropType = _interopRequireWildcard(require(\"./integerPropType\"));\nObject.keys(_integerPropType).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _integerPropType[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _integerPropType[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = resolveProps;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\n/**\n * Add keys, values of `defaultProps` that does not exist in `props`\n * @param {object} defaultProps\n * @param {object} props\n * @returns {object} resolved props\n */\nfunction resolveProps(defaultProps, props) {\n const output = (0, _extends2.default)({}, props);\n Object.keys(defaultProps).forEach(propName => {\n if (propName.toString().match(/^(components|slots)$/)) {\n output[propName] = (0, _extends2.default)({}, defaultProps[propName], output[propName]);\n } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {\n const defaultSlotProps = defaultProps[propName] || {};\n const slotProps = props[propName];\n output[propName] = {};\n if (!slotProps || !Object.keys(slotProps)) {\n // Reduce the iteration if the slot props is empty\n output[propName] = defaultSlotProps;\n } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {\n // Reduce the iteration if the default slot props is empty\n output[propName] = slotProps;\n } else {\n output[propName] = (0, _extends2.default)({}, slotProps);\n Object.keys(defaultSlotProps).forEach(slotPropName => {\n output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);\n });\n }\n } else if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n });\n return output;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _resolveProps.default;\n }\n});\nvar _resolveProps = _interopRequireDefault(require(\"./resolveProps\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = composeClasses;\nfunction composeClasses(slots, getUtilityClass, classes = undefined) {\n const output = {};\n Object.keys(slots).forEach(\n // `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.\n // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208\n slot => {\n output[slot] = slots[slot].reduce((acc, key) => {\n if (key) {\n const utilityClass = getUtilityClass(key);\n if (utilityClass !== '') {\n acc.push(utilityClass);\n }\n if (classes && classes[key]) {\n acc.push(classes[key]);\n }\n }\n return acc;\n }, []).join(' ');\n });\n return output;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _composeClasses.default;\n }\n});\nvar _composeClasses = _interopRequireDefault(require(\"./composeClasses\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst defaultGenerator = componentName => componentName;\nconst createClassNameGenerator = () => {\n let generate = defaultGenerator;\n return {\n configure(generator) {\n generate = generator;\n },\n generate(componentName) {\n return generate(componentName);\n },\n reset() {\n generate = defaultGenerator;\n }\n };\n};\nconst ClassNameGenerator = createClassNameGenerator();\nvar _default = exports.default = ClassNameGenerator;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _ClassNameGenerator.default;\n }\n});\nvar _ClassNameGenerator = _interopRequireDefault(require(\"./ClassNameGenerator\"));", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = generateUtilityClass;\nexports.globalStateClasses = void 0;\nexports.isGlobalState = isGlobalState;\nvar _ClassNameGenerator = _interopRequireDefault(require(\"../ClassNameGenerator\"));\nconst globalStateClasses = exports.globalStateClasses = {\n active: 'active',\n checked: 'checked',\n completed: 'completed',\n disabled: 'disabled',\n error: 'error',\n expanded: 'expanded',\n focused: 'focused',\n focusVisible: 'focusVisible',\n open: 'open',\n readOnly: 'readOnly',\n required: 'required',\n selected: 'selected'\n};\nfunction generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {\n const globalStateClass = globalStateClasses[slot];\n return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${_ClassNameGenerator.default.generate(componentName)}-${slot}`;\n}\nfunction isGlobalState(slot) {\n return globalStateClasses[slot] !== undefined;\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {};\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _generateUtilityClass.default;\n }\n});\nvar _generateUtilityClass = _interopRequireWildcard(require(\"./generateUtilityClass\"));\nObject.keys(_generateUtilityClass).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _generateUtilityClass[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _generateUtilityClass[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = generateUtilityClasses;\nvar _generateUtilityClass = _interopRequireDefault(require(\"../generateUtilityClass\"));\nfunction generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {\n const result = {};\n slots.forEach(slot => {\n result[slot] = (0, _generateUtilityClass.default)(componentName, slot, globalStatePrefix);\n });\n return result;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _generateUtilityClasses.default;\n }\n});\nvar _generateUtilityClasses = _interopRequireDefault(require(\"./generateUtilityClasses\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nfunction clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}\nvar _default = exports.default = clamp;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _clamp.default;\n }\n});\nvar _clamp = _interopRequireDefault(require(\"./clamp\"));", "/**\n * @mui/utils v5.15.9\n *\n * @license MIT\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n chainPropTypes: true,\n deepmerge: true,\n isPlainObject: true,\n elementAcceptingRef: true,\n elementTypeAcceptingRef: true,\n exactProp: true,\n formatMuiErrorMessage: true,\n getDisplayName: true,\n HTMLElementType: true,\n ponyfillGlobal: true,\n refType: true,\n unstable_capitalize: true,\n unstable_createChainedFunction: true,\n unstable_debounce: true,\n unstable_deprecatedPropType: true,\n unstable_isMuiElement: true,\n unstable_ownerDocument: true,\n unstable_ownerWindow: true,\n unstable_requirePropFactory: true,\n unstable_setRef: true,\n unstable_useEnhancedEffect: true,\n unstable_useId: true,\n unstable_unsupportedProp: true,\n unstable_useControlled: true,\n unstable_useEventCallback: true,\n unstable_useForkRef: true,\n unstable_useLazyRef: true,\n unstable_useTimeout: true,\n unstable_Timeout: true,\n unstable_useOnMount: true,\n unstable_useIsFocusVisible: true,\n unstable_getScrollbarSize: true,\n unstable_detectScrollType: true,\n unstable_getNormalizedScrollLeft: true,\n usePreviousProps: true,\n getValidReactChildren: true,\n visuallyHidden: true,\n integerPropType: true,\n internal_resolveProps: true,\n unstable_composeClasses: true,\n unstable_generateUtilityClass: true,\n unstable_isGlobalState: true,\n unstable_generateUtilityClasses: true,\n unstable_ClassNameGenerator: true,\n clamp: true\n};\nObject.defineProperty(exports, \"HTMLElementType\", {\n enumerable: true,\n get: function () {\n return _HTMLElementType.default;\n }\n});\nObject.defineProperty(exports, \"chainPropTypes\", {\n enumerable: true,\n get: function () {\n return _chainPropTypes.default;\n }\n});\nObject.defineProperty(exports, \"clamp\", {\n enumerable: true,\n get: function () {\n return _clamp.default;\n }\n});\nObject.defineProperty(exports, \"deepmerge\", {\n enumerable: true,\n get: function () {\n return _deepmerge.default;\n }\n});\nObject.defineProperty(exports, \"elementAcceptingRef\", {\n enumerable: true,\n get: function () {\n return _elementAcceptingRef.default;\n }\n});\nObject.defineProperty(exports, \"elementTypeAcceptingRef\", {\n enumerable: true,\n get: function () {\n return _elementTypeAcceptingRef.default;\n }\n});\nObject.defineProperty(exports, \"exactProp\", {\n enumerable: true,\n get: function () {\n return _exactProp.default;\n }\n});\nObject.defineProperty(exports, \"formatMuiErrorMessage\", {\n enumerable: true,\n get: function () {\n return _formatMuiErrorMessage.default;\n }\n});\nObject.defineProperty(exports, \"getDisplayName\", {\n enumerable: true,\n get: function () {\n return _getDisplayName.default;\n }\n});\nObject.defineProperty(exports, \"getValidReactChildren\", {\n enumerable: true,\n get: function () {\n return _getValidReactChildren.default;\n }\n});\nObject.defineProperty(exports, \"integerPropType\", {\n enumerable: true,\n get: function () {\n return _integerPropType.default;\n }\n});\nObject.defineProperty(exports, \"internal_resolveProps\", {\n enumerable: true,\n get: function () {\n return _resolveProps.default;\n }\n});\nObject.defineProperty(exports, \"isPlainObject\", {\n enumerable: true,\n get: function () {\n return _deepmerge.isPlainObject;\n }\n});\nObject.defineProperty(exports, \"ponyfillGlobal\", {\n enumerable: true,\n get: function () {\n return _ponyfillGlobal.default;\n }\n});\nObject.defineProperty(exports, \"refType\", {\n enumerable: true,\n get: function () {\n return _refType.default;\n }\n});\nObject.defineProperty(exports, \"unstable_ClassNameGenerator\", {\n enumerable: true,\n get: function () {\n return _ClassNameGenerator.default;\n }\n});\nObject.defineProperty(exports, \"unstable_Timeout\", {\n enumerable: true,\n get: function () {\n return _useTimeout.Timeout;\n }\n});\nObject.defineProperty(exports, \"unstable_capitalize\", {\n enumerable: true,\n get: function () {\n return _capitalize.default;\n }\n});\nObject.defineProperty(exports, \"unstable_composeClasses\", {\n enumerable: true,\n get: function () {\n return _composeClasses.default;\n }\n});\nObject.defineProperty(exports, \"unstable_createChainedFunction\", {\n enumerable: true,\n get: function () {\n return _createChainedFunction.default;\n }\n});\nObject.defineProperty(exports, \"unstable_debounce\", {\n enumerable: true,\n get: function () {\n return _debounce.default;\n }\n});\nObject.defineProperty(exports, \"unstable_deprecatedPropType\", {\n enumerable: true,\n get: function () {\n return _deprecatedPropType.default;\n }\n});\nObject.defineProperty(exports, \"unstable_detectScrollType\", {\n enumerable: true,\n get: function () {\n return _scrollLeft.detectScrollType;\n }\n});\nObject.defineProperty(exports, \"unstable_generateUtilityClass\", {\n enumerable: true,\n get: function () {\n return _generateUtilityClass.default;\n }\n});\nObject.defineProperty(exports, \"unstable_generateUtilityClasses\", {\n enumerable: true,\n get: function () {\n return _generateUtilityClasses.default;\n }\n});\nObject.defineProperty(exports, \"unstable_getNormalizedScrollLeft\", {\n enumerable: true,\n get: function () {\n return _scrollLeft.getNormalizedScrollLeft;\n }\n});\nObject.defineProperty(exports, \"unstable_getScrollbarSize\", {\n enumerable: true,\n get: function () {\n return _getScrollbarSize.default;\n }\n});\nObject.defineProperty(exports, \"unstable_isGlobalState\", {\n enumerable: true,\n get: function () {\n return _generateUtilityClass.isGlobalState;\n }\n});\nObject.defineProperty(exports, \"unstable_isMuiElement\", {\n enumerable: true,\n get: function () {\n return _isMuiElement.default;\n }\n});\nObject.defineProperty(exports, \"unstable_ownerDocument\", {\n enumerable: true,\n get: function () {\n return _ownerDocument.default;\n }\n});\nObject.defineProperty(exports, \"unstable_ownerWindow\", {\n enumerable: true,\n get: function () {\n return _ownerWindow.default;\n }\n});\nObject.defineProperty(exports, \"unstable_requirePropFactory\", {\n enumerable: true,\n get: function () {\n return _requirePropFactory.default;\n }\n});\nObject.defineProperty(exports, \"unstable_setRef\", {\n enumerable: true,\n get: function () {\n return _setRef.default;\n }\n});\nObject.defineProperty(exports, \"unstable_unsupportedProp\", {\n enumerable: true,\n get: function () {\n return _unsupportedProp.default;\n }\n});\nObject.defineProperty(exports, \"unstable_useControlled\", {\n enumerable: true,\n get: function () {\n return _useControlled.default;\n }\n});\nObject.defineProperty(exports, \"unstable_useEnhancedEffect\", {\n enumerable: true,\n get: function () {\n return _useEnhancedEffect.default;\n }\n});\nObject.defineProperty(exports, \"unstable_useEventCallback\", {\n enumerable: true,\n get: function () {\n return _useEventCallback.default;\n }\n});\nObject.defineProperty(exports, \"unstable_useForkRef\", {\n enumerable: true,\n get: function () {\n return _useForkRef.default;\n }\n});\nObject.defineProperty(exports, \"unstable_useId\", {\n enumerable: true,\n get: function () {\n return _useId.default;\n }\n});\nObject.defineProperty(exports, \"unstable_useIsFocusVisible\", {\n enumerable: true,\n get: function () {\n return _useIsFocusVisible.default;\n }\n});\nObject.defineProperty(exports, \"unstable_useLazyRef\", {\n enumerable: true,\n get: function () {\n return _useLazyRef.default;\n }\n});\nObject.defineProperty(exports, \"unstable_useOnMount\", {\n enumerable: true,\n get: function () {\n return _useOnMount.default;\n }\n});\nObject.defineProperty(exports, \"unstable_useTimeout\", {\n enumerable: true,\n get: function () {\n return _useTimeout.default;\n }\n});\nObject.defineProperty(exports, \"usePreviousProps\", {\n enumerable: true,\n get: function () {\n return _usePreviousProps.default;\n }\n});\nObject.defineProperty(exports, \"visuallyHidden\", {\n enumerable: true,\n get: function () {\n return _visuallyHidden.default;\n }\n});\nvar _chainPropTypes = _interopRequireDefault(require(\"./chainPropTypes\"));\nvar _deepmerge = _interopRequireWildcard(require(\"./deepmerge\"));\nvar _elementAcceptingRef = _interopRequireDefault(require(\"./elementAcceptingRef\"));\nvar _elementTypeAcceptingRef = _interopRequireDefault(require(\"./elementTypeAcceptingRef\"));\nvar _exactProp = _interopRequireDefault(require(\"./exactProp\"));\nvar _formatMuiErrorMessage = _interopRequireDefault(require(\"./formatMuiErrorMessage\"));\nvar _getDisplayName = _interopRequireDefault(require(\"./getDisplayName\"));\nvar _HTMLElementType = _interopRequireDefault(require(\"./HTMLElementType\"));\nvar _ponyfillGlobal = _interopRequireDefault(require(\"./ponyfillGlobal\"));\nvar _refType = _interopRequireDefault(require(\"./refType\"));\nvar _capitalize = _interopRequireDefault(require(\"./capitalize\"));\nvar _createChainedFunction = _interopRequireDefault(require(\"./createChainedFunction\"));\nvar _debounce = _interopRequireDefault(require(\"./debounce\"));\nvar _deprecatedPropType = _interopRequireDefault(require(\"./deprecatedPropType\"));\nvar _isMuiElement = _interopRequireDefault(require(\"./isMuiElement\"));\nvar _ownerDocument = _interopRequireDefault(require(\"./ownerDocument\"));\nvar _ownerWindow = _interopRequireDefault(require(\"./ownerWindow\"));\nvar _requirePropFactory = _interopRequireDefault(require(\"./requirePropFactory\"));\nvar _setRef = _interopRequireDefault(require(\"./setRef\"));\nvar _useEnhancedEffect = _interopRequireDefault(require(\"./useEnhancedEffect\"));\nvar _useId = _interopRequireDefault(require(\"./useId\"));\nvar _unsupportedProp = _interopRequireDefault(require(\"./unsupportedProp\"));\nvar _useControlled = _interopRequireDefault(require(\"./useControlled\"));\nvar _useEventCallback = _interopRequireDefault(require(\"./useEventCallback\"));\nvar _useForkRef = _interopRequireDefault(require(\"./useForkRef\"));\nvar _useLazyRef = _interopRequireDefault(require(\"./useLazyRef\"));\nvar _useTimeout = _interopRequireWildcard(require(\"./useTimeout\"));\nvar _useOnMount = _interopRequireDefault(require(\"./useOnMount\"));\nvar _useIsFocusVisible = _interopRequireDefault(require(\"./useIsFocusVisible\"));\nvar _getScrollbarSize = _interopRequireDefault(require(\"./getScrollbarSize\"));\nvar _scrollLeft = require(\"./scrollLeft\");\nvar _usePreviousProps = _interopRequireDefault(require(\"./usePreviousProps\"));\nvar _getValidReactChildren = _interopRequireDefault(require(\"./getValidReactChildren\"));\nvar _visuallyHidden = _interopRequireDefault(require(\"./visuallyHidden\"));\nvar _integerPropType = _interopRequireDefault(require(\"./integerPropType\"));\nvar _resolveProps = _interopRequireDefault(require(\"./resolveProps\"));\nvar _composeClasses = _interopRequireDefault(require(\"./composeClasses\"));\nvar _generateUtilityClass = _interopRequireWildcard(require(\"./generateUtilityClass\"));\nObject.keys(_generateUtilityClass).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _generateUtilityClass[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _generateUtilityClass[key];\n }\n });\n});\nvar _generateUtilityClasses = _interopRequireDefault(require(\"./generateUtilityClasses\"));\nvar _ClassNameGenerator = _interopRequireDefault(require(\"./ClassNameGenerator\"));\nvar _clamp = _interopRequireDefault(require(\"./clamp\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.breakpointKeys = void 0;\nexports.default = createBreakpoints;\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nconst _excluded = [\"values\", \"unit\", \"step\"];\n// Sorted ASC by size. That's important.\n// It can't be configured as it's used statically for propTypes.\nconst breakpointKeys = exports.breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];\nconst sortBreakpointsValues = values => {\n const breakpointsAsArray = Object.keys(values).map(key => ({\n key,\n val: values[key]\n })) || [];\n // Sort in ascending order\n breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);\n return breakpointsAsArray.reduce((acc, obj) => {\n return (0, _extends2.default)({}, acc, {\n [obj.key]: obj.val\n });\n }, {});\n};\n\n// Keep in mind that @media is inclusive by the CSS specification.\nfunction createBreakpoints(breakpoints) {\n const {\n // The breakpoint **start** at this value.\n // For instance with the first breakpoint xs: [xs, sm).\n values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n },\n unit = 'px',\n step = 5\n } = breakpoints,\n other = (0, _objectWithoutPropertiesLoose2.default)(breakpoints, _excluded);\n const sortedValues = sortBreakpointsValues(values);\n const keys = Object.keys(sortedValues);\n function up(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (min-width:${value}${unit})`;\n }\n function down(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (max-width:${value - step / 100}${unit})`;\n }\n function between(start, end) {\n const endIndex = keys.indexOf(end);\n return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;\n }\n function only(key) {\n if (keys.indexOf(key) + 1 < keys.length) {\n return between(key, keys[keys.indexOf(key) + 1]);\n }\n return up(key);\n }\n function not(key) {\n // handle first and last key separately, for better readability\n const keyIndex = keys.indexOf(key);\n if (keyIndex === 0) {\n return up(keys[1]);\n }\n if (keyIndex === keys.length - 1) {\n return down(keys[keyIndex]);\n }\n return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');\n }\n return (0, _extends2.default)({\n keys,\n values: sortedValues,\n up,\n down,\n between,\n only,\n not,\n unit\n }, other);\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst shape = {\n borderRadius: 4\n};\nvar _default = exports.default = shape;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nconst responsivePropType = process.env.NODE_ENV !== 'production' ? _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.object, _propTypes.default.array]) : {};\nvar _default = exports.default = responsivePropType;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nfunction merge(acc, item) {\n if (!item) {\n return acc;\n }\n return (0, _utils.deepmerge)(acc, item, {\n clone: false // No need to clone deep, it's way faster.\n });\n}\nvar _default = exports.default = merge;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.computeBreakpointsBase = computeBreakpointsBase;\nexports.createEmptyBreakpointObject = createEmptyBreakpointObject;\nexports.default = void 0;\nexports.handleBreakpoints = handleBreakpoints;\nexports.mergeBreakpointsInOrder = mergeBreakpointsInOrder;\nexports.removeUnusedBreakpoints = removeUnusedBreakpoints;\nexports.resolveBreakpointValues = resolveBreakpointValues;\nexports.values = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _utils = require(\"@mui/utils\");\nvar _merge = _interopRequireDefault(require(\"./merge\"));\n// The breakpoint **start** at this value.\n// For instance with the first breakpoint xs: [xs, sm[.\nconst values = exports.values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n};\nconst defaultBreakpoints = {\n // Sorted ASC by size. That's important.\n // It can't be configured as it's used statically for propTypes.\n keys: ['xs', 'sm', 'md', 'lg', 'xl'],\n up: key => `@media (min-width:${values[key]}px)`\n};\nfunction handleBreakpoints(props, propValue, styleFromPropValue) {\n const theme = props.theme || {};\n if (Array.isArray(propValue)) {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return propValue.reduce((acc, item, index) => {\n acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);\n return acc;\n }, {});\n }\n if (typeof propValue === 'object') {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return Object.keys(propValue).reduce((acc, breakpoint) => {\n // key is breakpoint\n if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {\n const mediaKey = themeBreakpoints.up(breakpoint);\n acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);\n } else {\n const cssKey = breakpoint;\n acc[cssKey] = propValue[cssKey];\n }\n return acc;\n }, {});\n }\n const output = styleFromPropValue(propValue);\n return output;\n}\nfunction breakpoints(styleFunction) {\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const newStyleFunction = props => {\n const theme = props.theme || {};\n const base = styleFunction(props);\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n const extended = themeBreakpoints.keys.reduce((acc, key) => {\n if (props[key]) {\n acc = acc || {};\n acc[themeBreakpoints.up(key)] = styleFunction((0, _extends2.default)({\n theme\n }, props[key]));\n }\n return acc;\n }, null);\n return (0, _merge.default)(base, extended);\n };\n newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? (0, _extends2.default)({}, styleFunction.propTypes, {\n xs: _propTypes.default.object,\n sm: _propTypes.default.object,\n md: _propTypes.default.object,\n lg: _propTypes.default.object,\n xl: _propTypes.default.object\n }) : {};\n newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl', ...styleFunction.filterProps];\n return newStyleFunction;\n}\nfunction createEmptyBreakpointObject(breakpointsInput = {}) {\n var _breakpointsInput$key;\n const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {\n const breakpointStyleKey = breakpointsInput.up(key);\n acc[breakpointStyleKey] = {};\n return acc;\n }, {});\n return breakpointsInOrder || {};\n}\nfunction removeUnusedBreakpoints(breakpointKeys, style) {\n return breakpointKeys.reduce((acc, key) => {\n const breakpointOutput = acc[key];\n const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;\n if (isBreakpointUnused) {\n delete acc[key];\n }\n return acc;\n }, style);\n}\nfunction mergeBreakpointsInOrder(breakpointsInput, ...styles) {\n const emptyBreakpoints = createEmptyBreakpointObject(breakpointsInput);\n const mergedOutput = [emptyBreakpoints, ...styles].reduce((prev, next) => (0, _utils.deepmerge)(prev, next), {});\n return removeUnusedBreakpoints(Object.keys(emptyBreakpoints), mergedOutput);\n}\n\n// compute base for responsive values; e.g.,\n// [1,2,3] => {xs: true, sm: true, md: true}\n// {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true}\nfunction computeBreakpointsBase(breakpointValues, themeBreakpoints) {\n // fixed value\n if (typeof breakpointValues !== 'object') {\n return {};\n }\n const base = {};\n const breakpointsKeys = Object.keys(themeBreakpoints);\n if (Array.isArray(breakpointValues)) {\n breakpointsKeys.forEach((breakpoint, i) => {\n if (i < breakpointValues.length) {\n base[breakpoint] = true;\n }\n });\n } else {\n breakpointsKeys.forEach(breakpoint => {\n if (breakpointValues[breakpoint] != null) {\n base[breakpoint] = true;\n }\n });\n }\n return base;\n}\nfunction resolveBreakpointValues({\n values: breakpointValues,\n breakpoints: themeBreakpoints,\n base: customBase\n}) {\n const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);\n const keys = Object.keys(base);\n if (keys.length === 0) {\n return breakpointValues;\n }\n let previous;\n return keys.reduce((acc, breakpoint, i) => {\n if (Array.isArray(breakpointValues)) {\n acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];\n previous = i;\n } else if (typeof breakpointValues === 'object') {\n acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];\n previous = breakpoint;\n } else {\n acc[breakpoint] = breakpointValues;\n }\n return acc;\n }, {});\n}\nvar _default = exports.default = breakpoints;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nexports.getPath = getPath;\nexports.getStyleValue = getStyleValue;\nvar _utils = require(\"@mui/utils\");\nvar _responsivePropType = _interopRequireDefault(require(\"./responsivePropType\"));\nvar _breakpoints = require(\"./breakpoints\");\nfunction getPath(obj, path, checkVars = true) {\n if (!path || typeof path !== 'string') {\n return null;\n }\n\n // Check if CSS variables are used\n if (obj && obj.vars && checkVars) {\n const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);\n if (val != null) {\n return val;\n }\n }\n return path.split('.').reduce((acc, item) => {\n if (acc && acc[item] != null) {\n return acc[item];\n }\n return null;\n }, obj);\n}\nfunction getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {\n let value;\n if (typeof themeMapping === 'function') {\n value = themeMapping(propValueFinal);\n } else if (Array.isArray(themeMapping)) {\n value = themeMapping[propValueFinal] || userValue;\n } else {\n value = getPath(themeMapping, propValueFinal) || userValue;\n }\n if (transform) {\n value = transform(value, userValue, themeMapping);\n }\n return value;\n}\nfunction style(options) {\n const {\n prop,\n cssProperty = options.prop,\n themeKey,\n transform\n } = options;\n\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const fn = props => {\n if (props[prop] == null) {\n return null;\n }\n const propValue = props[prop];\n const theme = props.theme;\n const themeMapping = getPath(theme, themeKey) || {};\n const styleFromPropValue = propValueFinal => {\n let value = getStyleValue(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : (0, _utils.unstable_capitalize)(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return (0, _breakpoints.handleBreakpoints)(props, propValue, styleFromPropValue);\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? {\n [prop]: _responsivePropType.default\n } : {};\n fn.filterProps = [prop];\n return fn;\n}\nvar _default = exports.default = style;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = memoize;\nfunction memoize(fn) {\n const cache = {};\n return arg => {\n if (cache[arg] === undefined) {\n cache[arg] = fn(arg);\n }\n return cache[arg];\n };\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createUnarySpacing = createUnarySpacing;\nexports.createUnaryUnit = createUnaryUnit;\nexports.default = void 0;\nexports.getStyleFromPropValue = getStyleFromPropValue;\nexports.getValue = getValue;\nexports.margin = margin;\nexports.marginKeys = void 0;\nexports.padding = padding;\nexports.paddingKeys = void 0;\nvar _responsivePropType = _interopRequireDefault(require(\"./responsivePropType\"));\nvar _breakpoints = require(\"./breakpoints\");\nvar _style = require(\"./style\");\nvar _merge = _interopRequireDefault(require(\"./merge\"));\nvar _memoize = _interopRequireDefault(require(\"./memoize\"));\nconst properties = {\n m: 'margin',\n p: 'padding'\n};\nconst directions = {\n t: 'Top',\n r: 'Right',\n b: 'Bottom',\n l: 'Left',\n x: ['Left', 'Right'],\n y: ['Top', 'Bottom']\n};\nconst aliases = {\n marginX: 'mx',\n marginY: 'my',\n paddingX: 'px',\n paddingY: 'py'\n};\n\n// memoize() impact:\n// From 300,000 ops/sec\n// To 350,000 ops/sec\nconst getCssProperties = (0, _memoize.default)(prop => {\n // It's not a shorthand notation.\n if (prop.length > 2) {\n if (aliases[prop]) {\n prop = aliases[prop];\n } else {\n return [prop];\n }\n }\n const [a, b] = prop.split('');\n const property = properties[a];\n const direction = directions[b] || '';\n return Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];\n});\nconst marginKeys = exports.marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd'];\nconst paddingKeys = exports.paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];\nconst spacingKeys = [...marginKeys, ...paddingKeys];\nfunction createUnaryUnit(theme, themeKey, defaultValue, propName) {\n var _getPath;\n const themeSpacing = (_getPath = (0, _style.getPath)(theme, themeKey, false)) != null ? _getPath : defaultValue;\n if (typeof themeSpacing === 'number') {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (typeof abs !== 'number') {\n console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);\n }\n }\n return themeSpacing * abs;\n };\n }\n if (Array.isArray(themeSpacing)) {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!Number.isInteger(abs)) {\n console.error([`MUI: The \\`theme.${themeKey}\\` array type cannot be combined with non integer values.` + `You should either use an integer value that can be used as index, or define the \\`theme.${themeKey}\\` as a number.`].join('\\n'));\n } else if (abs > themeSpacing.length - 1) {\n console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join('\\n'));\n }\n }\n return themeSpacing[abs];\n };\n }\n if (typeof themeSpacing === 'function') {\n return themeSpacing;\n }\n if (process.env.NODE_ENV !== 'production') {\n console.error([`MUI: The \\`theme.${themeKey}\\` value (${themeSpacing}) is invalid.`, 'It should be a number, an array or a function.'].join('\\n'));\n }\n return () => undefined;\n}\nfunction createUnarySpacing(theme) {\n return createUnaryUnit(theme, 'spacing', 8, 'spacing');\n}\nfunction getValue(transformer, propValue) {\n if (typeof propValue === 'string' || propValue == null) {\n return propValue;\n }\n const abs = Math.abs(propValue);\n const transformed = transformer(abs);\n if (propValue >= 0) {\n return transformed;\n }\n if (typeof transformed === 'number') {\n return -transformed;\n }\n return `-${transformed}`;\n}\nfunction getStyleFromPropValue(cssProperties, transformer) {\n return propValue => cssProperties.reduce((acc, cssProperty) => {\n acc[cssProperty] = getValue(transformer, propValue);\n return acc;\n }, {});\n}\nfunction resolveCssProperty(props, keys, prop, transformer) {\n // Using a hash computation over an array iteration could be faster, but with only 28 items,\n // it's doesn't worth the bundle size.\n if (keys.indexOf(prop) === -1) {\n return null;\n }\n const cssProperties = getCssProperties(prop);\n const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);\n const propValue = props[prop];\n return (0, _breakpoints.handleBreakpoints)(props, propValue, styleFromPropValue);\n}\nfunction style(props, keys) {\n const transformer = createUnarySpacing(props.theme);\n return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(_merge.default, {});\n}\nfunction margin(props) {\n return style(props, marginKeys);\n}\nmargin.propTypes = process.env.NODE_ENV !== 'production' ? marginKeys.reduce((obj, key) => {\n obj[key] = _responsivePropType.default;\n return obj;\n}, {}) : {};\nmargin.filterProps = marginKeys;\nfunction padding(props) {\n return style(props, paddingKeys);\n}\npadding.propTypes = process.env.NODE_ENV !== 'production' ? paddingKeys.reduce((obj, key) => {\n obj[key] = _responsivePropType.default;\n return obj;\n}, {}) : {};\npadding.filterProps = paddingKeys;\nfunction spacing(props) {\n return style(props, spacingKeys);\n}\nspacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((obj, key) => {\n obj[key] = _responsivePropType.default;\n return obj;\n}, {}) : {};\nspacing.filterProps = spacingKeys;\nvar _default = exports.default = spacing;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createSpacing;\nvar _spacing = require(\"../spacing\");\n// The different signatures imply different meaning for their arguments that can't be expressed structurally.\n// We express the difference with variable names.\n\nfunction createSpacing(spacingInput = 8) {\n // Already transformed.\n if (spacingInput.mui) {\n return spacingInput;\n }\n\n // Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.\n // Smaller components, such as icons, can align to a 4dp grid.\n // https://m2.material.io/design/layout/understanding-layout.html\n const transform = (0, _spacing.createUnarySpacing)({\n spacing: spacingInput\n });\n const spacing = (...argsInput) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!(argsInput.length <= 4)) {\n console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);\n }\n }\n const args = argsInput.length === 0 ? [1] : argsInput;\n return args.map(argument => {\n const output = transform(argument);\n return typeof output === 'number' ? `${output}px` : output;\n }).join(' ');\n };\n spacing.mui = true;\n return spacing;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _merge = _interopRequireDefault(require(\"./merge\"));\nfunction compose(...styles) {\n const handlers = styles.reduce((acc, style) => {\n style.filterProps.forEach(prop => {\n acc[prop] = style;\n });\n return acc;\n }, {});\n\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const fn = props => {\n return Object.keys(props).reduce((acc, prop) => {\n if (handlers[prop]) {\n return (0, _merge.default)(acc, handlers[prop](props));\n }\n return acc;\n }, {});\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce((acc, style) => Object.assign(acc, style.propTypes), {}) : {};\n fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);\n return fn;\n}\nvar _default = exports.default = compose;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.borderTopColor = exports.borderTop = exports.borderRightColor = exports.borderRight = exports.borderRadius = exports.borderLeftColor = exports.borderLeft = exports.borderColor = exports.borderBottomColor = exports.borderBottom = exports.border = void 0;\nexports.borderTransform = borderTransform;\nexports.outlineColor = exports.outline = exports.default = void 0;\nvar _responsivePropType = _interopRequireDefault(require(\"./responsivePropType\"));\nvar _style = _interopRequireDefault(require(\"./style\"));\nvar _compose = _interopRequireDefault(require(\"./compose\"));\nvar _spacing = require(\"./spacing\");\nvar _breakpoints = require(\"./breakpoints\");\nfunction borderTransform(value) {\n if (typeof value !== 'number') {\n return value;\n }\n return `${value}px solid`;\n}\nfunction createBorderStyle(prop, transform) {\n return (0, _style.default)({\n prop,\n themeKey: 'borders',\n transform\n });\n}\nconst border = exports.border = createBorderStyle('border', borderTransform);\nconst borderTop = exports.borderTop = createBorderStyle('borderTop', borderTransform);\nconst borderRight = exports.borderRight = createBorderStyle('borderRight', borderTransform);\nconst borderBottom = exports.borderBottom = createBorderStyle('borderBottom', borderTransform);\nconst borderLeft = exports.borderLeft = createBorderStyle('borderLeft', borderTransform);\nconst borderColor = exports.borderColor = createBorderStyle('borderColor');\nconst borderTopColor = exports.borderTopColor = createBorderStyle('borderTopColor');\nconst borderRightColor = exports.borderRightColor = createBorderStyle('borderRightColor');\nconst borderBottomColor = exports.borderBottomColor = createBorderStyle('borderBottomColor');\nconst borderLeftColor = exports.borderLeftColor = createBorderStyle('borderLeftColor');\nconst outline = exports.outline = createBorderStyle('outline', borderTransform);\nconst outlineColor = exports.outlineColor = createBorderStyle('outlineColor');\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nconst borderRadius = props => {\n if (props.borderRadius !== undefined && props.borderRadius !== null) {\n const transformer = (0, _spacing.createUnaryUnit)(props.theme, 'shape.borderRadius', 4, 'borderRadius');\n const styleFromPropValue = propValue => ({\n borderRadius: (0, _spacing.getValue)(transformer, propValue)\n });\n return (0, _breakpoints.handleBreakpoints)(props, props.borderRadius, styleFromPropValue);\n }\n return null;\n};\nexports.borderRadius = borderRadius;\nborderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {\n borderRadius: _responsivePropType.default\n} : {};\nborderRadius.filterProps = ['borderRadius'];\nconst borders = (0, _compose.default)(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius, outline, outlineColor);\nvar _default = exports.default = borders;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.rowGap = exports.gridTemplateRows = exports.gridTemplateColumns = exports.gridTemplateAreas = exports.gridRow = exports.gridColumn = exports.gridAutoRows = exports.gridAutoFlow = exports.gridAutoColumns = exports.gridArea = exports.gap = exports.default = exports.columnGap = void 0;\nvar _style = _interopRequireDefault(require(\"./style\"));\nvar _compose = _interopRequireDefault(require(\"./compose\"));\nvar _spacing = require(\"./spacing\");\nvar _breakpoints = require(\"./breakpoints\");\nvar _responsivePropType = _interopRequireDefault(require(\"./responsivePropType\"));\n// false positive\n// eslint-disable-next-line react/function-component-definition\nconst gap = props => {\n if (props.gap !== undefined && props.gap !== null) {\n const transformer = (0, _spacing.createUnaryUnit)(props.theme, 'spacing', 8, 'gap');\n const styleFromPropValue = propValue => ({\n gap: (0, _spacing.getValue)(transformer, propValue)\n });\n return (0, _breakpoints.handleBreakpoints)(props, props.gap, styleFromPropValue);\n }\n return null;\n};\nexports.gap = gap;\ngap.propTypes = process.env.NODE_ENV !== 'production' ? {\n gap: _responsivePropType.default\n} : {};\ngap.filterProps = ['gap'];\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nconst columnGap = props => {\n if (props.columnGap !== undefined && props.columnGap !== null) {\n const transformer = (0, _spacing.createUnaryUnit)(props.theme, 'spacing', 8, 'columnGap');\n const styleFromPropValue = propValue => ({\n columnGap: (0, _spacing.getValue)(transformer, propValue)\n });\n return (0, _breakpoints.handleBreakpoints)(props, props.columnGap, styleFromPropValue);\n }\n return null;\n};\nexports.columnGap = columnGap;\ncolumnGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n columnGap: _responsivePropType.default\n} : {};\ncolumnGap.filterProps = ['columnGap'];\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nconst rowGap = props => {\n if (props.rowGap !== undefined && props.rowGap !== null) {\n const transformer = (0, _spacing.createUnaryUnit)(props.theme, 'spacing', 8, 'rowGap');\n const styleFromPropValue = propValue => ({\n rowGap: (0, _spacing.getValue)(transformer, propValue)\n });\n return (0, _breakpoints.handleBreakpoints)(props, props.rowGap, styleFromPropValue);\n }\n return null;\n};\nexports.rowGap = rowGap;\nrowGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n rowGap: _responsivePropType.default\n} : {};\nrowGap.filterProps = ['rowGap'];\nconst gridColumn = exports.gridColumn = (0, _style.default)({\n prop: 'gridColumn'\n});\nconst gridRow = exports.gridRow = (0, _style.default)({\n prop: 'gridRow'\n});\nconst gridAutoFlow = exports.gridAutoFlow = (0, _style.default)({\n prop: 'gridAutoFlow'\n});\nconst gridAutoColumns = exports.gridAutoColumns = (0, _style.default)({\n prop: 'gridAutoColumns'\n});\nconst gridAutoRows = exports.gridAutoRows = (0, _style.default)({\n prop: 'gridAutoRows'\n});\nconst gridTemplateColumns = exports.gridTemplateColumns = (0, _style.default)({\n prop: 'gridTemplateColumns'\n});\nconst gridTemplateRows = exports.gridTemplateRows = (0, _style.default)({\n prop: 'gridTemplateRows'\n});\nconst gridTemplateAreas = exports.gridTemplateAreas = (0, _style.default)({\n prop: 'gridTemplateAreas'\n});\nconst gridArea = exports.gridArea = (0, _style.default)({\n prop: 'gridArea'\n});\nconst grid = (0, _compose.default)(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);\nvar _default = exports.default = grid;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.color = exports.bgcolor = exports.backgroundColor = void 0;\nexports.paletteTransform = paletteTransform;\nvar _style = _interopRequireDefault(require(\"./style\"));\nvar _compose = _interopRequireDefault(require(\"./compose\"));\nfunction paletteTransform(value, userValue) {\n if (userValue === 'grey') {\n return userValue;\n }\n return value;\n}\nconst color = exports.color = (0, _style.default)({\n prop: 'color',\n themeKey: 'palette',\n transform: paletteTransform\n});\nconst bgcolor = exports.bgcolor = (0, _style.default)({\n prop: 'bgcolor',\n cssProperty: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nconst backgroundColor = exports.backgroundColor = (0, _style.default)({\n prop: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nconst palette = (0, _compose.default)(color, bgcolor, backgroundColor);\nvar _default = exports.default = palette;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.sizeWidth = exports.sizeHeight = exports.minWidth = exports.minHeight = exports.maxWidth = exports.maxHeight = exports.height = exports.default = exports.boxSizing = void 0;\nexports.sizingTransform = sizingTransform;\nexports.width = void 0;\nvar _style = _interopRequireDefault(require(\"./style\"));\nvar _compose = _interopRequireDefault(require(\"./compose\"));\nvar _breakpoints = require(\"./breakpoints\");\nfunction sizingTransform(value) {\n return value <= 1 && value !== 0 ? `${value * 100}%` : value;\n}\nconst width = exports.width = (0, _style.default)({\n prop: 'width',\n transform: sizingTransform\n});\nconst maxWidth = props => {\n if (props.maxWidth !== undefined && props.maxWidth !== null) {\n const styleFromPropValue = propValue => {\n var _props$theme, _props$theme2;\n const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || _breakpoints.values[propValue];\n if (!breakpoint) {\n return {\n maxWidth: sizingTransform(propValue)\n };\n }\n if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {\n return {\n maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`\n };\n }\n return {\n maxWidth: breakpoint\n };\n };\n return (0, _breakpoints.handleBreakpoints)(props, props.maxWidth, styleFromPropValue);\n }\n return null;\n};\nexports.maxWidth = maxWidth;\nmaxWidth.filterProps = ['maxWidth'];\nconst minWidth = exports.minWidth = (0, _style.default)({\n prop: 'minWidth',\n transform: sizingTransform\n});\nconst height = exports.height = (0, _style.default)({\n prop: 'height',\n transform: sizingTransform\n});\nconst maxHeight = exports.maxHeight = (0, _style.default)({\n prop: 'maxHeight',\n transform: sizingTransform\n});\nconst minHeight = exports.minHeight = (0, _style.default)({\n prop: 'minHeight',\n transform: sizingTransform\n});\nconst sizeWidth = exports.sizeWidth = (0, _style.default)({\n prop: 'size',\n cssProperty: 'width',\n transform: sizingTransform\n});\nconst sizeHeight = exports.sizeHeight = (0, _style.default)({\n prop: 'size',\n cssProperty: 'height',\n transform: sizingTransform\n});\nconst boxSizing = exports.boxSizing = (0, _style.default)({\n prop: 'boxSizing'\n});\nconst sizing = (0, _compose.default)(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);\nvar _default = exports.default = sizing;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _spacing = require(\"../spacing\");\nvar _borders = require(\"../borders\");\nvar _cssGrid = require(\"../cssGrid\");\nvar _palette = require(\"../palette\");\nvar _sizing = require(\"../sizing\");\nconst defaultSxConfig = {\n // borders\n border: {\n themeKey: 'borders',\n transform: _borders.borderTransform\n },\n borderTop: {\n themeKey: 'borders',\n transform: _borders.borderTransform\n },\n borderRight: {\n themeKey: 'borders',\n transform: _borders.borderTransform\n },\n borderBottom: {\n themeKey: 'borders',\n transform: _borders.borderTransform\n },\n borderLeft: {\n themeKey: 'borders',\n transform: _borders.borderTransform\n },\n borderColor: {\n themeKey: 'palette'\n },\n borderTopColor: {\n themeKey: 'palette'\n },\n borderRightColor: {\n themeKey: 'palette'\n },\n borderBottomColor: {\n themeKey: 'palette'\n },\n borderLeftColor: {\n themeKey: 'palette'\n },\n outline: {\n themeKey: 'borders',\n transform: _borders.borderTransform\n },\n outlineColor: {\n themeKey: 'palette'\n },\n borderRadius: {\n themeKey: 'shape.borderRadius',\n style: _borders.borderRadius\n },\n // palette\n color: {\n themeKey: 'palette',\n transform: _palette.paletteTransform\n },\n bgcolor: {\n themeKey: 'palette',\n cssProperty: 'backgroundColor',\n transform: _palette.paletteTransform\n },\n backgroundColor: {\n themeKey: 'palette',\n transform: _palette.paletteTransform\n },\n // spacing\n p: {\n style: _spacing.padding\n },\n pt: {\n style: _spacing.padding\n },\n pr: {\n style: _spacing.padding\n },\n pb: {\n style: _spacing.padding\n },\n pl: {\n style: _spacing.padding\n },\n px: {\n style: _spacing.padding\n },\n py: {\n style: _spacing.padding\n },\n padding: {\n style: _spacing.padding\n },\n paddingTop: {\n style: _spacing.padding\n },\n paddingRight: {\n style: _spacing.padding\n },\n paddingBottom: {\n style: _spacing.padding\n },\n paddingLeft: {\n style: _spacing.padding\n },\n paddingX: {\n style: _spacing.padding\n },\n paddingY: {\n style: _spacing.padding\n },\n paddingInline: {\n style: _spacing.padding\n },\n paddingInlineStart: {\n style: _spacing.padding\n },\n paddingInlineEnd: {\n style: _spacing.padding\n },\n paddingBlock: {\n style: _spacing.padding\n },\n paddingBlockStart: {\n style: _spacing.padding\n },\n paddingBlockEnd: {\n style: _spacing.padding\n },\n m: {\n style: _spacing.margin\n },\n mt: {\n style: _spacing.margin\n },\n mr: {\n style: _spacing.margin\n },\n mb: {\n style: _spacing.margin\n },\n ml: {\n style: _spacing.margin\n },\n mx: {\n style: _spacing.margin\n },\n my: {\n style: _spacing.margin\n },\n margin: {\n style: _spacing.margin\n },\n marginTop: {\n style: _spacing.margin\n },\n marginRight: {\n style: _spacing.margin\n },\n marginBottom: {\n style: _spacing.margin\n },\n marginLeft: {\n style: _spacing.margin\n },\n marginX: {\n style: _spacing.margin\n },\n marginY: {\n style: _spacing.margin\n },\n marginInline: {\n style: _spacing.margin\n },\n marginInlineStart: {\n style: _spacing.margin\n },\n marginInlineEnd: {\n style: _spacing.margin\n },\n marginBlock: {\n style: _spacing.margin\n },\n marginBlockStart: {\n style: _spacing.margin\n },\n marginBlockEnd: {\n style: _spacing.margin\n },\n // display\n displayPrint: {\n cssProperty: false,\n transform: value => ({\n '@media print': {\n display: value\n }\n })\n },\n display: {},\n overflow: {},\n textOverflow: {},\n visibility: {},\n whiteSpace: {},\n // flexbox\n flexBasis: {},\n flexDirection: {},\n flexWrap: {},\n justifyContent: {},\n alignItems: {},\n alignContent: {},\n order: {},\n flex: {},\n flexGrow: {},\n flexShrink: {},\n alignSelf: {},\n justifyItems: {},\n justifySelf: {},\n // grid\n gap: {\n style: _cssGrid.gap\n },\n rowGap: {\n style: _cssGrid.rowGap\n },\n columnGap: {\n style: _cssGrid.columnGap\n },\n gridColumn: {},\n gridRow: {},\n gridAutoFlow: {},\n gridAutoColumns: {},\n gridAutoRows: {},\n gridTemplateColumns: {},\n gridTemplateRows: {},\n gridTemplateAreas: {},\n gridArea: {},\n // positions\n position: {},\n zIndex: {\n themeKey: 'zIndex'\n },\n top: {},\n right: {},\n bottom: {},\n left: {},\n // shadows\n boxShadow: {\n themeKey: 'shadows'\n },\n // sizing\n width: {\n transform: _sizing.sizingTransform\n },\n maxWidth: {\n style: _sizing.maxWidth\n },\n minWidth: {\n transform: _sizing.sizingTransform\n },\n height: {\n transform: _sizing.sizingTransform\n },\n maxHeight: {\n transform: _sizing.sizingTransform\n },\n minHeight: {\n transform: _sizing.sizingTransform\n },\n boxSizing: {},\n // typography\n fontFamily: {\n themeKey: 'typography'\n },\n fontSize: {\n themeKey: 'typography'\n },\n fontStyle: {\n themeKey: 'typography'\n },\n fontWeight: {\n themeKey: 'typography'\n },\n letterSpacing: {},\n textTransform: {},\n lineHeight: {},\n textAlign: {},\n typography: {\n cssProperty: false,\n themeKey: 'typography'\n }\n};\nvar _default = exports.default = defaultSxConfig;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nexports.unstable_createStyleFunctionSx = unstable_createStyleFunctionSx;\nvar _utils = require(\"@mui/utils\");\nvar _merge = _interopRequireDefault(require(\"../merge\"));\nvar _style = require(\"../style\");\nvar _breakpoints = require(\"../breakpoints\");\nvar _defaultSxConfig = _interopRequireDefault(require(\"./defaultSxConfig\"));\nfunction objectsHaveSameKeys(...objects) {\n const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);\n const union = new Set(allKeys);\n return objects.every(object => union.size === Object.keys(object).length);\n}\nfunction callIfFn(maybeFn, arg) {\n return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction unstable_createStyleFunctionSx() {\n function getThemeValue(prop, val, theme, config) {\n const props = {\n [prop]: val,\n theme\n };\n const options = config[prop];\n if (!options) {\n return {\n [prop]: val\n };\n }\n const {\n cssProperty = prop,\n themeKey,\n transform,\n style\n } = options;\n if (val == null) {\n return null;\n }\n\n // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123\n if (themeKey === 'typography' && val === 'inherit') {\n return {\n [prop]: val\n };\n }\n const themeMapping = (0, _style.getPath)(theme, themeKey) || {};\n if (style) {\n return style(props);\n }\n const styleFromPropValue = propValueFinal => {\n let value = (0, _style.getStyleValue)(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = (0, _style.getStyleValue)(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : (0, _utils.unstable_capitalize)(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return (0, _breakpoints.handleBreakpoints)(props, val, styleFromPropValue);\n }\n function styleFunctionSx(props) {\n var _theme$unstable_sxCon;\n const {\n sx,\n theme = {}\n } = props || {};\n if (!sx) {\n return null; // Emotion & styled-components will neglect null\n }\n const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : _defaultSxConfig.default;\n\n /*\n * Receive `sxInput` as object or callback\n * and then recursively check keys & values to create media query object styles.\n * (the result will be used in `styled`)\n */\n function traverse(sxInput) {\n let sxObject = sxInput;\n if (typeof sxInput === 'function') {\n sxObject = sxInput(theme);\n } else if (typeof sxInput !== 'object') {\n // value\n return sxInput;\n }\n if (!sxObject) {\n return null;\n }\n const emptyBreakpoints = (0, _breakpoints.createEmptyBreakpointObject)(theme.breakpoints);\n const breakpointsKeys = Object.keys(emptyBreakpoints);\n let css = emptyBreakpoints;\n Object.keys(sxObject).forEach(styleKey => {\n const value = callIfFn(sxObject[styleKey], theme);\n if (value !== null && value !== undefined) {\n if (typeof value === 'object') {\n if (config[styleKey]) {\n css = (0, _merge.default)(css, getThemeValue(styleKey, value, theme, config));\n } else {\n const breakpointsValues = (0, _breakpoints.handleBreakpoints)({\n theme\n }, value, x => ({\n [styleKey]: x\n }));\n if (objectsHaveSameKeys(breakpointsValues, value)) {\n css[styleKey] = styleFunctionSx({\n sx: value,\n theme\n });\n } else {\n css = (0, _merge.default)(css, breakpointsValues);\n }\n }\n } else {\n css = (0, _merge.default)(css, getThemeValue(styleKey, value, theme, config));\n }\n }\n });\n return (0, _breakpoints.removeUnusedBreakpoints)(breakpointsKeys, css);\n }\n return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);\n }\n return styleFunctionSx;\n}\nconst styleFunctionSx = unstable_createStyleFunctionSx();\nstyleFunctionSx.filterProps = ['sx'];\nvar _default = exports.default = styleFunctionSx;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = applyStyles;\n/**\n * A universal utility to style components with multiple color modes. Always use it from the theme object.\n * It works with:\n * - [Basic theme](https://mui.com/material-ui/customization/dark-mode/)\n * - [CSS theme variables](https://mui.com/material-ui/experimental-api/css-theme-variables/overview/)\n * - Zero-runtime engine\n *\n * Tips: Use an array over object spread and place `theme.applyStyles()` last.\n *\n * \u2705 [{ background: '#e5e5e5' }, theme.applyStyles('dark', { background: '#1c1c1c' })]\n *\n * \uD83D\uDEAB { background: '#e5e5e5', ...theme.applyStyles('dark', { background: '#1c1c1c' })}\n *\n * @example\n * 1. using with `styled`:\n * ```jsx\n * const Component = styled('div')(({ theme }) => [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ]);\n * ```\n *\n * @example\n * 2. using with `sx` prop:\n * ```jsx\n * [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ]}\n * />\n * ```\n *\n * @example\n * 3. theming a component:\n * ```jsx\n * extendTheme({\n * components: {\n * MuiButton: {\n * styleOverrides: {\n * root: ({ theme }) => [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ],\n * },\n * }\n * }\n * })\n *```\n */\nfunction applyStyles(key, styles) {\n // @ts-expect-error this is 'any' type\n const theme = this;\n if (theme.vars && typeof theme.getColorSchemeSelector === 'function') {\n // If CssVarsProvider is used as a provider,\n // returns '* :where([data-mui-color-scheme=\"light|dark\"]) &'\n const selector = theme.getColorSchemeSelector(key).replace(/(\\[[^\\]]+\\])/, '*:where($1)');\n return {\n [selector]: styles\n };\n }\n if (theme.palette.mode === key) {\n return styles;\n }\n return {};\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _utils = require(\"@mui/utils\");\nvar _createBreakpoints = _interopRequireDefault(require(\"./createBreakpoints\"));\nvar _shape = _interopRequireDefault(require(\"./shape\"));\nvar _createSpacing = _interopRequireDefault(require(\"./createSpacing\"));\nvar _styleFunctionSx = _interopRequireDefault(require(\"../styleFunctionSx/styleFunctionSx\"));\nvar _defaultSxConfig = _interopRequireDefault(require(\"../styleFunctionSx/defaultSxConfig\"));\nvar _applyStyles = _interopRequireDefault(require(\"./applyStyles\"));\nconst _excluded = [\"breakpoints\", \"palette\", \"spacing\", \"shape\"];\nfunction createTheme(options = {}, ...args) {\n const {\n breakpoints: breakpointsInput = {},\n palette: paletteInput = {},\n spacing: spacingInput,\n shape: shapeInput = {}\n } = options,\n other = (0, _objectWithoutPropertiesLoose2.default)(options, _excluded);\n const breakpoints = (0, _createBreakpoints.default)(breakpointsInput);\n const spacing = (0, _createSpacing.default)(spacingInput);\n let muiTheme = (0, _utils.deepmerge)({\n breakpoints,\n direction: 'ltr',\n components: {},\n // Inject component definitions.\n palette: (0, _extends2.default)({\n mode: 'light'\n }, paletteInput),\n spacing,\n shape: (0, _extends2.default)({}, _shape.default, shapeInput)\n }, other);\n muiTheme.applyStyles = _applyStyles.default;\n muiTheme = args.reduce((acc, argument) => (0, _utils.deepmerge)(acc, argument), muiTheme);\n muiTheme.unstable_sxConfig = (0, _extends2.default)({}, _defaultSxConfig.default, other == null ? void 0 : other.unstable_sxConfig);\n muiTheme.unstable_sx = function sx(props) {\n return (0, _styleFunctionSx.default)({\n sx: props,\n theme: this\n });\n };\n return muiTheme;\n}\nvar _default = exports.default = createTheme;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _createTheme.default;\n }\n});\nObject.defineProperty(exports, \"private_createBreakpoints\", {\n enumerable: true,\n get: function () {\n return _createBreakpoints.default;\n }\n});\nObject.defineProperty(exports, \"unstable_applyStyles\", {\n enumerable: true,\n get: function () {\n return _applyStyles.default;\n }\n});\nvar _createTheme = _interopRequireDefault(require(\"./createTheme\"));\nvar _createBreakpoints = _interopRequireDefault(require(\"./createBreakpoints\"));\nvar _applyStyles = _interopRequireDefault(require(\"./applyStyles\"));", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _styledEngine = require(\"@mui/styled-engine\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction isObjectEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction useTheme(defaultTheme = null) {\n const contextTheme = React.useContext(_styledEngine.ThemeContext);\n return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;\n}\nvar _default = exports.default = useTheme;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.systemDefaultTheme = exports.default = void 0;\nvar _createTheme = _interopRequireDefault(require(\"./createTheme\"));\nvar _useThemeWithoutDefault = _interopRequireDefault(require(\"./useThemeWithoutDefault\"));\nconst systemDefaultTheme = exports.systemDefaultTheme = (0, _createTheme.default)();\nfunction useTheme(defaultTheme = systemDefaultTheme) {\n return (0, _useThemeWithoutDefault.default)(defaultTheme);\n}\nvar _default = exports.default = useTheme;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _styledEngine = require(\"@mui/styled-engine\");\nvar _useTheme = _interopRequireDefault(require(\"../useTheme\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction GlobalStyles({\n styles,\n themeId,\n defaultTheme = {}\n}) {\n const upperTheme = (0, _useTheme.default)(defaultTheme);\n const globalStyles = typeof styles === 'function' ? styles(themeId ? upperTheme[themeId] || upperTheme : upperTheme) : styles;\n return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledEngine.GlobalStyles, {\n styles: globalStyles\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GlobalStyles.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the TypeScript types and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * @ignore\n */\n defaultTheme: _propTypes.default.object,\n /**\n * @ignore\n */\n styles: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.array, _propTypes.default.func, _propTypes.default.number, _propTypes.default.object, _propTypes.default.string, _propTypes.default.bool]),\n /**\n * @ignore\n */\n themeId: _propTypes.default.string\n} : void 0;\nvar _default = exports.default = GlobalStyles;", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {};\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _GlobalStyles.default;\n }\n});\nvar _GlobalStyles = _interopRequireWildcard(require(\"./GlobalStyles\"));\nObject.keys(_GlobalStyles).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _GlobalStyles[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _GlobalStyles[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.whiteSpace = exports.visibility = exports.textOverflow = exports.overflow = exports.displayRaw = exports.displayPrint = exports.default = void 0;\nvar _style = _interopRequireDefault(require(\"./style\"));\nvar _compose = _interopRequireDefault(require(\"./compose\"));\nconst displayPrint = exports.displayPrint = (0, _style.default)({\n prop: 'displayPrint',\n cssProperty: false,\n transform: value => ({\n '@media print': {\n display: value\n }\n })\n});\nconst displayRaw = exports.displayRaw = (0, _style.default)({\n prop: 'display'\n});\nconst overflow = exports.overflow = (0, _style.default)({\n prop: 'overflow'\n});\nconst textOverflow = exports.textOverflow = (0, _style.default)({\n prop: 'textOverflow'\n});\nconst visibility = exports.visibility = (0, _style.default)({\n prop: 'visibility'\n});\nconst whiteSpace = exports.whiteSpace = (0, _style.default)({\n prop: 'whiteSpace'\n});\nvar _default = exports.default = (0, _compose.default)(displayPrint, displayRaw, overflow, textOverflow, visibility, whiteSpace);", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.order = exports.justifySelf = exports.justifyItems = exports.justifyContent = exports.flexWrap = exports.flexShrink = exports.flexGrow = exports.flexDirection = exports.flexBasis = exports.flex = exports.default = exports.alignSelf = exports.alignItems = exports.alignContent = void 0;\nvar _style = _interopRequireDefault(require(\"./style\"));\nvar _compose = _interopRequireDefault(require(\"./compose\"));\nconst flexBasis = exports.flexBasis = (0, _style.default)({\n prop: 'flexBasis'\n});\nconst flexDirection = exports.flexDirection = (0, _style.default)({\n prop: 'flexDirection'\n});\nconst flexWrap = exports.flexWrap = (0, _style.default)({\n prop: 'flexWrap'\n});\nconst justifyContent = exports.justifyContent = (0, _style.default)({\n prop: 'justifyContent'\n});\nconst alignItems = exports.alignItems = (0, _style.default)({\n prop: 'alignItems'\n});\nconst alignContent = exports.alignContent = (0, _style.default)({\n prop: 'alignContent'\n});\nconst order = exports.order = (0, _style.default)({\n prop: 'order'\n});\nconst flex = exports.flex = (0, _style.default)({\n prop: 'flex'\n});\nconst flexGrow = exports.flexGrow = (0, _style.default)({\n prop: 'flexGrow'\n});\nconst flexShrink = exports.flexShrink = (0, _style.default)({\n prop: 'flexShrink'\n});\nconst alignSelf = exports.alignSelf = (0, _style.default)({\n prop: 'alignSelf'\n});\nconst justifyItems = exports.justifyItems = (0, _style.default)({\n prop: 'justifyItems'\n});\nconst justifySelf = exports.justifySelf = (0, _style.default)({\n prop: 'justifySelf'\n});\nconst flexbox = (0, _compose.default)(flexBasis, flexDirection, flexWrap, justifyContent, alignItems, alignContent, order, flex, flexGrow, flexShrink, alignSelf, justifyItems, justifySelf);\nvar _default = exports.default = flexbox;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.zIndex = exports.top = exports.right = exports.position = exports.left = exports.default = exports.bottom = void 0;\nvar _style = _interopRequireDefault(require(\"./style\"));\nvar _compose = _interopRequireDefault(require(\"./compose\"));\nconst position = exports.position = (0, _style.default)({\n prop: 'position'\n});\nconst zIndex = exports.zIndex = (0, _style.default)({\n prop: 'zIndex',\n themeKey: 'zIndex'\n});\nconst top = exports.top = (0, _style.default)({\n prop: 'top'\n});\nconst right = exports.right = (0, _style.default)({\n prop: 'right'\n});\nconst bottom = exports.bottom = (0, _style.default)({\n prop: 'bottom'\n});\nconst left = exports.left = (0, _style.default)({\n prop: 'left'\n});\nvar _default = exports.default = (0, _compose.default)(position, zIndex, top, right, bottom, left);", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _style = _interopRequireDefault(require(\"./style\"));\nconst boxShadow = (0, _style.default)({\n prop: 'boxShadow',\n themeKey: 'shadows'\n});\nvar _default = exports.default = boxShadow;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.typographyVariant = exports.textTransform = exports.textAlign = exports.lineHeight = exports.letterSpacing = exports.fontWeight = exports.fontStyle = exports.fontSize = exports.fontFamily = exports.default = void 0;\nvar _style = _interopRequireDefault(require(\"./style\"));\nvar _compose = _interopRequireDefault(require(\"./compose\"));\nconst fontFamily = exports.fontFamily = (0, _style.default)({\n prop: 'fontFamily',\n themeKey: 'typography'\n});\nconst fontSize = exports.fontSize = (0, _style.default)({\n prop: 'fontSize',\n themeKey: 'typography'\n});\nconst fontStyle = exports.fontStyle = (0, _style.default)({\n prop: 'fontStyle',\n themeKey: 'typography'\n});\nconst fontWeight = exports.fontWeight = (0, _style.default)({\n prop: 'fontWeight',\n themeKey: 'typography'\n});\nconst letterSpacing = exports.letterSpacing = (0, _style.default)({\n prop: 'letterSpacing'\n});\nconst textTransform = exports.textTransform = (0, _style.default)({\n prop: 'textTransform'\n});\nconst lineHeight = exports.lineHeight = (0, _style.default)({\n prop: 'lineHeight'\n});\nconst textAlign = exports.textAlign = (0, _style.default)({\n prop: 'textAlign'\n});\nconst typographyVariant = exports.typographyVariant = (0, _style.default)({\n prop: 'typography',\n cssProperty: false,\n themeKey: 'typography'\n});\nconst typography = (0, _compose.default)(typographyVariant, fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textAlign, textTransform);\nvar _default = exports.default = typography;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = extendSxProp;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _utils = require(\"@mui/utils\");\nvar _defaultSxConfig = _interopRequireDefault(require(\"./defaultSxConfig\"));\nconst _excluded = [\"sx\"];\nconst splitProps = props => {\n var _props$theme$unstable, _props$theme;\n const result = {\n systemProps: {},\n otherProps: {}\n };\n const config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : _defaultSxConfig.default;\n Object.keys(props).forEach(prop => {\n if (config[prop]) {\n result.systemProps[prop] = props[prop];\n } else {\n result.otherProps[prop] = props[prop];\n }\n });\n return result;\n};\nfunction extendSxProp(props) {\n const {\n sx: inSx\n } = props,\n other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);\n const {\n systemProps,\n otherProps\n } = splitProps(other);\n let finalSx;\n if (Array.isArray(inSx)) {\n finalSx = [systemProps, ...inSx];\n } else if (typeof inSx === 'function') {\n finalSx = (...args) => {\n const result = inSx(...args);\n if (!(0, _utils.isPlainObject)(result)) {\n return systemProps;\n }\n return (0, _extends2.default)({}, systemProps, result);\n };\n } else {\n finalSx = (0, _extends2.default)({}, systemProps, inSx);\n }\n return (0, _extends2.default)({}, otherProps, {\n sx: finalSx\n });\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _styleFunctionSx.default;\n }\n});\nObject.defineProperty(exports, \"extendSxProp\", {\n enumerable: true,\n get: function () {\n return _extendSxProp.default;\n }\n});\nObject.defineProperty(exports, \"unstable_createStyleFunctionSx\", {\n enumerable: true,\n get: function () {\n return _styleFunctionSx.unstable_createStyleFunctionSx;\n }\n});\nObject.defineProperty(exports, \"unstable_defaultSxConfig\", {\n enumerable: true,\n get: function () {\n return _defaultSxConfig.default;\n }\n});\nvar _styleFunctionSx = _interopRequireWildcard(require(\"./styleFunctionSx\"));\nvar _extendSxProp = _interopRequireDefault(require(\"./extendSxProp\"));\nvar _defaultSxConfig = _interopRequireDefault(require(\"./defaultSxConfig\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styleFunctionMapping = exports.propToStyleFunction = exports.default = void 0;\nvar _borders = _interopRequireDefault(require(\"./borders\"));\nvar _display = _interopRequireDefault(require(\"./display\"));\nvar _flexbox = _interopRequireDefault(require(\"./flexbox\"));\nvar _cssGrid = _interopRequireDefault(require(\"./cssGrid\"));\nvar _positions = _interopRequireDefault(require(\"./positions\"));\nvar _palette = _interopRequireDefault(require(\"./palette\"));\nvar _shadows = _interopRequireDefault(require(\"./shadows\"));\nvar _sizing = _interopRequireDefault(require(\"./sizing\"));\nvar _spacing = _interopRequireDefault(require(\"./spacing\"));\nvar _typography = _interopRequireDefault(require(\"./typography\"));\nconst filterPropsMapping = {\n borders: _borders.default.filterProps,\n display: _display.default.filterProps,\n flexbox: _flexbox.default.filterProps,\n grid: _cssGrid.default.filterProps,\n positions: _positions.default.filterProps,\n palette: _palette.default.filterProps,\n shadows: _shadows.default.filterProps,\n sizing: _sizing.default.filterProps,\n spacing: _spacing.default.filterProps,\n typography: _typography.default.filterProps\n};\nconst styleFunctionMapping = exports.styleFunctionMapping = {\n borders: _borders.default,\n display: _display.default,\n flexbox: _flexbox.default,\n grid: _cssGrid.default,\n positions: _positions.default,\n palette: _palette.default,\n shadows: _shadows.default,\n sizing: _sizing.default,\n spacing: _spacing.default,\n typography: _typography.default\n};\nconst propToStyleFunction = exports.propToStyleFunction = Object.keys(filterPropsMapping).reduce((acc, styleFnName) => {\n filterPropsMapping[styleFnName].forEach(propName => {\n acc[propName] = styleFunctionMapping[styleFnName];\n });\n return acc;\n}, {});\nfunction getThemeValue(prop, value, theme) {\n const inputProps = {\n [prop]: value,\n theme\n };\n const styleFunction = propToStyleFunction[prop];\n return styleFunction ? styleFunction(inputProps) : {\n [prop]: value\n };\n}\nvar _default = exports.default = getThemeValue;", "function r(e){var o,t,f=\"\";if(\"string\"==typeof e||\"number\"==typeof e)f+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var n=e.length;for(o=0;o prop !== 'theme' && prop !== 'sx' && prop !== 'as'\n })(_styleFunctionSx.default);\n const Box = /*#__PURE__*/React.forwardRef(function Box(inProps, ref) {\n const theme = (0, _useTheme.default)(defaultTheme);\n const _extendSxProp = (0, _styleFunctionSx.extendSxProp)(inProps),\n {\n className,\n component = 'div'\n } = _extendSxProp,\n other = (0, _objectWithoutPropertiesLoose2.default)(_extendSxProp, _excluded);\n return /*#__PURE__*/(0, _jsxRuntime.jsx)(BoxRoot, (0, _extends2.default)({\n as: component,\n ref: ref,\n className: (0, _clsx.default)(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),\n theme: themeId ? theme[themeId] || theme : theme\n }, other));\n });\n return Box;\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nconst boxClasses = (0, _utils.unstable_generateUtilityClasses)('MuiBox', ['root']);\nvar _default = exports.default = boxClasses;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _utils = require(\"@mui/utils\");\nvar _createBox = _interopRequireDefault(require(\"../createBox\"));\nvar _boxClasses = _interopRequireDefault(require(\"./boxClasses\"));\nconst Box = (0, _createBox.default)({\n defaultClassName: _boxClasses.default.root,\n generateClassName: _utils.unstable_ClassNameGenerator.generate\n});\nprocess.env.NODE_ENV !== \"production\" ? Box.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the d.ts file and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * @ignore\n */\n children: _propTypes.default.node,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: _propTypes.default.elementType,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])\n} : void 0;\nvar _default = exports.default = Box;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n boxClasses: true\n};\nObject.defineProperty(exports, \"boxClasses\", {\n enumerable: true,\n get: function () {\n return _boxClasses.default;\n }\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _Box.default;\n }\n});\nvar _Box = _interopRequireDefault(require(\"./Box\"));\nvar _boxClasses = _interopRequireWildcard(require(\"./boxClasses\"));\nObject.keys(_boxClasses).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _boxClasses[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _boxClasses[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createStyled;\nexports.shouldForwardProp = shouldForwardProp;\nexports.systemDefaultTheme = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _styledEngine = _interopRequireWildcard(require(\"@mui/styled-engine\"));\nvar _utils = require(\"@mui/utils\");\nvar _createTheme = _interopRequireDefault(require(\"./createTheme\"));\nvar _styleFunctionSx = _interopRequireDefault(require(\"./styleFunctionSx\"));\nconst _excluded = [\"ownerState\"],\n _excluded2 = [\"variants\"],\n _excluded3 = [\"name\", \"slot\", \"skipVariantsResolver\", \"skipSx\", \"overridesResolver\"];\n/* eslint-disable no-underscore-dangle */\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\n// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40\nfunction isStringTag(tag) {\n return typeof tag === 'string' &&\n // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96;\n}\n\n// Update /system/styled/#api in case if this changes\nfunction shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nconst systemDefaultTheme = exports.systemDefaultTheme = (0, _createTheme.default)();\nconst lowercaseFirstLetter = string => {\n if (!string) {\n return string;\n }\n return string.charAt(0).toLowerCase() + string.slice(1);\n};\nfunction resolveTheme({\n defaultTheme,\n theme,\n themeId\n}) {\n return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;\n}\nfunction defaultOverridesResolver(slot) {\n if (!slot) {\n return null;\n }\n return (props, styles) => styles[slot];\n}\nfunction processStyleArg(callableStyle, _ref) {\n let {\n ownerState\n } = _ref,\n props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);\n const resolvedStylesArg = typeof callableStyle === 'function' ? callableStyle((0, _extends2.default)({\n ownerState\n }, props)) : callableStyle;\n if (Array.isArray(resolvedStylesArg)) {\n return resolvedStylesArg.flatMap(resolvedStyle => processStyleArg(resolvedStyle, (0, _extends2.default)({\n ownerState\n }, props)));\n }\n if (!!resolvedStylesArg && typeof resolvedStylesArg === 'object' && Array.isArray(resolvedStylesArg.variants)) {\n const {\n variants = []\n } = resolvedStylesArg,\n otherStyles = (0, _objectWithoutPropertiesLoose2.default)(resolvedStylesArg, _excluded2);\n let result = otherStyles;\n variants.forEach(variant => {\n let isMatch = true;\n if (typeof variant.props === 'function') {\n isMatch = variant.props((0, _extends2.default)({\n ownerState\n }, props));\n } else {\n Object.keys(variant.props).forEach(key => {\n if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {\n isMatch = false;\n }\n });\n }\n if (isMatch) {\n if (!Array.isArray(result)) {\n result = [result];\n }\n result.push(typeof variant.style === 'function' ? variant.style((0, _extends2.default)({\n ownerState\n }, props)) : variant.style);\n }\n });\n return result;\n }\n return resolvedStylesArg;\n}\nfunction createStyled(input = {}) {\n const {\n themeId,\n defaultTheme = systemDefaultTheme,\n rootShouldForwardProp = shouldForwardProp,\n slotShouldForwardProp = shouldForwardProp\n } = input;\n const systemSx = props => {\n return (0, _styleFunctionSx.default)((0, _extends2.default)({}, props, {\n theme: resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }))\n }));\n };\n systemSx.__mui_systemSx = true;\n return (tag, inputOptions = {}) => {\n // Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.\n (0, _styledEngine.internal_processStyles)(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));\n const {\n name: componentName,\n slot: componentSlot,\n skipVariantsResolver: inputSkipVariantsResolver,\n skipSx: inputSkipSx,\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))\n } = inputOptions,\n options = (0, _objectWithoutPropertiesLoose2.default)(inputOptions, _excluded3);\n\n // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.\n const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;\n const skipSx = inputSkipSx || false;\n let label;\n if (process.env.NODE_ENV !== 'production') {\n if (componentName) {\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;\n }\n }\n let shouldForwardPropOption = shouldForwardProp;\n\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n if (componentSlot === 'Root' || componentSlot === 'root') {\n shouldForwardPropOption = rootShouldForwardProp;\n } else if (componentSlot) {\n // any other slot specified\n shouldForwardPropOption = slotShouldForwardProp;\n } else if (isStringTag(tag)) {\n // for string (html) tag, preserve the behavior in emotion & styled-components.\n shouldForwardPropOption = undefined;\n }\n const defaultStyledResolver = (0, _styledEngine.default)(tag, (0, _extends2.default)({\n shouldForwardProp: shouldForwardPropOption,\n label\n }, options));\n const transformStyleArg = stylesArg => {\n // On the server Emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg || (0, _utils.isPlainObject)(stylesArg)) {\n return props => processStyleArg(stylesArg, (0, _extends2.default)({}, props, {\n theme: resolveTheme({\n theme: props.theme,\n defaultTheme,\n themeId\n })\n }));\n }\n return stylesArg;\n };\n const muiStyledResolver = (styleArg, ...expressions) => {\n let transformedStyleArg = transformStyleArg(styleArg);\n const expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : [];\n if (componentName && overridesResolver) {\n expressionsWithDefaultTheme.push(props => {\n const theme = resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }));\n if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) {\n return null;\n }\n const styleOverrides = theme.components[componentName].styleOverrides;\n const resolvedStyleOverrides = {};\n // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly\n Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {\n resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, (0, _extends2.default)({}, props, {\n theme\n }));\n });\n return overridesResolver(props, resolvedStyleOverrides);\n });\n }\n if (componentName && !skipVariantsResolver) {\n expressionsWithDefaultTheme.push(props => {\n var _theme$components;\n const theme = resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }));\n const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;\n return processStyleArg({\n variants: themeVariants\n }, (0, _extends2.default)({}, props, {\n theme\n }));\n });\n }\n if (!skipSx) {\n expressionsWithDefaultTheme.push(systemSx);\n }\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;\n if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {\n const placeholders = new Array(numOfCustomFnsApplied).fill('');\n // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.\n transformedStyleArg = [...styleArg, ...placeholders];\n transformedStyleArg.raw = [...styleArg.raw, ...placeholders];\n }\n const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);\n if (process.env.NODE_ENV !== 'production') {\n let displayName;\n if (componentName) {\n displayName = `${componentName}${(0, _utils.unstable_capitalize)(componentSlot || '')}`;\n }\n if (displayName === undefined) {\n displayName = `Styled(${(0, _utils.getDisplayName)(tag)})`;\n }\n Component.displayName = displayName;\n }\n if (tag.muiName) {\n Component.muiName = tag.muiName;\n }\n return Component;\n };\n if (defaultStyledResolver.withConfig) {\n muiStyledResolver.withConfig = defaultStyledResolver.withConfig;\n }\n return muiStyledResolver;\n };\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createStyled = _interopRequireDefault(require(\"./createStyled\"));\nconst styled = (0, _createStyled.default)();\nvar _default = exports.default = styled;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getThemeProps;\nvar _utils = require(\"@mui/utils\");\nfunction getThemeProps(params) {\n const {\n theme,\n name,\n props\n } = params;\n if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {\n return props;\n }\n return (0, _utils.internal_resolveProps)(theme.components[name].defaultProps, props);\n}", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = useThemeProps;\nvar _getThemeProps = _interopRequireDefault(require(\"./getThemeProps\"));\nvar _useTheme = _interopRequireDefault(require(\"../useTheme\"));\nfunction useThemeProps({\n props,\n name,\n defaultTheme,\n themeId\n}) {\n let theme = (0, _useTheme.default)(defaultTheme);\n if (themeId) {\n theme = theme[themeId] || theme;\n }\n const mergedProps = (0, _getThemeProps.default)({\n theme,\n name,\n props\n });\n return mergedProps;\n}", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _useThemeProps.default;\n }\n});\nObject.defineProperty(exports, \"getThemeProps\", {\n enumerable: true,\n get: function () {\n return _getThemeProps.default;\n }\n});\nvar _useThemeProps = _interopRequireDefault(require(\"./useThemeProps\"));\nvar _getThemeProps = _interopRequireDefault(require(\"./getThemeProps\"));", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.alpha = alpha;\nexports.blend = blend;\nexports.colorChannel = void 0;\nexports.darken = darken;\nexports.decomposeColor = decomposeColor;\nexports.emphasize = emphasize;\nexports.getContrastRatio = getContrastRatio;\nexports.getLuminance = getLuminance;\nexports.hexToRgb = hexToRgb;\nexports.hslToRgb = hslToRgb;\nexports.lighten = lighten;\nexports.private_safeAlpha = private_safeAlpha;\nexports.private_safeColorChannel = void 0;\nexports.private_safeDarken = private_safeDarken;\nexports.private_safeEmphasize = private_safeEmphasize;\nexports.private_safeLighten = private_safeLighten;\nexports.recomposeColor = recomposeColor;\nexports.rgbToHex = rgbToHex;\nvar _formatMuiErrorMessage2 = _interopRequireDefault(require(\"@mui/utils/formatMuiErrorMessage\"));\nvar _utils = require(\"@mui/utils\");\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clampWrapper(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n return (0, _utils.clamp)(value, min, max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\nfunction hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nfunction decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : (0, _formatMuiErrorMessage2.default)(9, color));\n }\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : (0, _formatMuiErrorMessage2.default)(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\nconst colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');\n};\nexports.colorChannel = colorChannel;\nconst private_safeColorChannel = (color, warning) => {\n try {\n return colorChannel(color);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n};\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nexports.private_safeColorChannel = private_safeColorChannel;\nfunction recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.indexOf('color') !== -1) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n return `${type}(${values})`;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\nfunction rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\nfunction hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nfunction getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nfunction getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction alpha(color, value) {\n color = decomposeColor(color);\n value = clampWrapper(value);\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n return recomposeColor(color);\n}\nfunction private_safeAlpha(color, value, warning) {\n try {\n return alpha(color, value);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeDarken(color, coefficient, warning) {\n try {\n return darken(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeLighten(color, coefficient, warning) {\n try {\n return lighten(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nfunction private_safeEmphasize(color, coefficient, warning) {\n try {\n return private_safeEmphasize(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Blend a transparent overlay color with a background color, resulting in a single\n * RGB color.\n * @param {string} background - CSS color\n * @param {string} overlay - CSS color\n * @param {number} opacity - Opacity multiplier in the range 0 - 1\n * @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.\n */\nfunction blend(background, overlay, opacity, gamma = 1.0) {\n const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);\n const backgroundColor = decomposeColor(background);\n const overlayColor = decomposeColor(overlay);\n const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];\n return recomposeColor({\n type: 'rgb',\n values: rgb\n });\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar React = _interopRequireWildcard(require(\"react\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst ThemeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'ThemeContext';\n}\nvar _default = exports.default = ThemeContext;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = useTheme;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _ThemeContext = _interopRequireDefault(require(\"./ThemeContext\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction useTheme() {\n const theme = React.useContext(_ThemeContext.default);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n return theme;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _useTheme.default;\n }\n});\nvar _useTheme = _interopRequireDefault(require(\"./useTheme\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar _default = exports.default = hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _utils = require(\"@mui/utils\");\nvar _ThemeContext = _interopRequireDefault(require(\"../useTheme/ThemeContext\"));\nvar _useTheme = _interopRequireDefault(require(\"../useTheme\"));\nvar _nested = _interopRequireDefault(require(\"./nested\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// To support composition of theme.\nfunction mergeOuterLocalTheme(outerTheme, localTheme) {\n if (typeof localTheme === 'function') {\n const mergedTheme = localTheme(outerTheme);\n if (process.env.NODE_ENV !== 'production') {\n if (!mergedTheme) {\n console.error(['MUI: You should return an object from your theme function, i.e.', ' ({})} />'].join('\\n'));\n }\n }\n return mergedTheme;\n }\n return (0, _extends2.default)({}, outerTheme, localTheme);\n}\n\n/**\n * This component takes a `theme` prop.\n * It makes the `theme` available down the React tree thanks to React context.\n * This component should preferably be used at **the root of your component tree**.\n */\nfunction ThemeProvider(props) {\n const {\n children,\n theme: localTheme\n } = props;\n const outerTheme = (0, _useTheme.default)();\n if (process.env.NODE_ENV !== 'production') {\n if (outerTheme === null && typeof localTheme === 'function') {\n console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\\n'));\n }\n }\n const theme = React.useMemo(() => {\n const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);\n if (output != null) {\n output[_nested.default] = outerTheme !== null;\n }\n return output;\n }, [localTheme, outerTheme]);\n return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeContext.default.Provider, {\n value: theme,\n children: children\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: _propTypes.default.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]).isRequired\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = (0, _utils.exactProp)(ThemeProvider.propTypes) : void 0;\n}\nvar _default = exports.default = ThemeProvider;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _ThemeProvider.default;\n }\n});\nObject.defineProperty(exports, \"unstable_nested\", {\n enumerable: true,\n get: function () {\n return _nested.default;\n }\n});\nvar _ThemeProvider = _interopRequireDefault(require(\"./ThemeProvider\"));\nvar _nested = _interopRequireDefault(require(\"./nested\"));", "/**\n * @mui/private-theming v5.15.9\n *\n * @license MIT\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n ThemeProvider: true,\n useTheme: true\n};\nObject.defineProperty(exports, \"ThemeProvider\", {\n enumerable: true,\n get: function () {\n return _ThemeProvider.default;\n }\n});\nObject.defineProperty(exports, \"useTheme\", {\n enumerable: true,\n get: function () {\n return _useTheme.default;\n }\n});\nvar _ThemeProvider = _interopRequireWildcard(require(\"./ThemeProvider\"));\nObject.keys(_ThemeProvider).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _ThemeProvider[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _ThemeProvider[key];\n }\n });\n});\nvar _useTheme = _interopRequireDefault(require(\"./useTheme\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _privateTheming = require(\"@mui/private-theming\");\nvar _utils = require(\"@mui/utils\");\nvar _styledEngine = require(\"@mui/styled-engine\");\nvar _useThemeWithoutDefault = _interopRequireDefault(require(\"../useThemeWithoutDefault\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst EMPTY_THEME = {};\nfunction useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {\n return React.useMemo(() => {\n const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;\n if (typeof localTheme === 'function') {\n const mergedTheme = localTheme(resolvedTheme);\n const result = themeId ? (0, _extends2.default)({}, upperTheme, {\n [themeId]: mergedTheme\n }) : mergedTheme;\n // must return a function for the private theme to NOT merge with the upper theme.\n // see the test case \"use provided theme from a callback\" in ThemeProvider.test.js\n if (isPrivate) {\n return () => result;\n }\n return result;\n }\n return themeId ? (0, _extends2.default)({}, upperTheme, {\n [themeId]: localTheme\n }) : (0, _extends2.default)({}, upperTheme, localTheme);\n }, [themeId, upperTheme, localTheme, isPrivate]);\n}\n\n/**\n * This component makes the `theme` available down the React tree.\n * It should preferably be used at **the root of your component tree**.\n *\n * // existing use case\n * // theme scoping\n */\nfunction ThemeProvider(props) {\n const {\n children,\n theme: localTheme,\n themeId\n } = props;\n const upperTheme = (0, _useThemeWithoutDefault.default)(EMPTY_THEME);\n const upperPrivateTheme = (0, _privateTheming.useTheme)() || EMPTY_THEME;\n if (process.env.NODE_ENV !== 'production') {\n if (upperTheme === null && typeof localTheme === 'function' || themeId && upperTheme && !upperTheme[themeId] && typeof localTheme === 'function') {\n console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\\n'));\n }\n }\n const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);\n const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);\n return /*#__PURE__*/(0, _jsxRuntime.jsx)(_privateTheming.ThemeProvider, {\n theme: privateTheme,\n children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledEngine.ThemeContext.Provider, {\n value: engineTheme,\n children: children\n })\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the d.ts file and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * Your component tree.\n */\n children: _propTypes.default.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]).isRequired,\n /**\n * The design system's unique id for getting the corresponded theme when there are multiple design systems.\n */\n themeId: _propTypes.default.string\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = (0, _utils.exactProp)(ThemeProvider.propTypes) : void 0;\n}\nvar _default = exports.default = ThemeProvider;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _ThemeProvider.default;\n }\n});\nvar _ThemeProvider = _interopRequireDefault(require(\"./ThemeProvider\"));", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DEFAULT_MODE_STORAGE_KEY = exports.DEFAULT_COLOR_SCHEME_STORAGE_KEY = exports.DEFAULT_ATTRIBUTE = void 0;\nexports.default = getInitColorSchemeScript;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst DEFAULT_MODE_STORAGE_KEY = exports.DEFAULT_MODE_STORAGE_KEY = 'mode';\nconst DEFAULT_COLOR_SCHEME_STORAGE_KEY = exports.DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';\nconst DEFAULT_ATTRIBUTE = exports.DEFAULT_ATTRIBUTE = 'data-color-scheme';\nfunction getInitColorSchemeScript(options) {\n const {\n defaultMode = 'light',\n defaultLightColorScheme = 'light',\n defaultDarkColorScheme = 'dark',\n modeStorageKey = DEFAULT_MODE_STORAGE_KEY,\n colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,\n attribute = DEFAULT_ATTRIBUTE,\n colorSchemeNode = 'document.documentElement'\n } = options || {};\n return /*#__PURE__*/(0, _jsxRuntime.jsx)(\"script\", {\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML: {\n __html: `(function() {\ntry {\n var mode = localStorage.getItem('${modeStorageKey}') || '${defaultMode}';\n var colorScheme = '';\n if (mode === 'system') {\n // handle system mode\n var mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (mql.matches) {\n colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';\n } else {\n colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';\n }\n }\n if (mode === 'light') {\n colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';\n }\n if (mode === 'dark') {\n colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';\n }\n if (colorScheme) {\n ${colorSchemeNode}.setAttribute('${attribute}', colorScheme);\n }\n} catch(e){}})();`\n }\n }, \"mui-color-scheme-init\");\n}", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = useCurrentColorScheme;\nexports.getColorScheme = getColorScheme;\nexports.getSystemMode = getSystemMode;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _getInitColorSchemeScript = require(\"./getInitColorSchemeScript\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction getSystemMode(mode) {\n if (typeof window !== 'undefined' && mode === 'system') {\n const mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (mql.matches) {\n return 'dark';\n }\n return 'light';\n }\n return undefined;\n}\nfunction processState(state, callback) {\n if (state.mode === 'light' || state.mode === 'system' && state.systemMode === 'light') {\n return callback('light');\n }\n if (state.mode === 'dark' || state.mode === 'system' && state.systemMode === 'dark') {\n return callback('dark');\n }\n return undefined;\n}\nfunction getColorScheme(state) {\n return processState(state, mode => {\n if (mode === 'light') {\n return state.lightColorScheme;\n }\n if (mode === 'dark') {\n return state.darkColorScheme;\n }\n return undefined;\n });\n}\nfunction initializeValue(key, defaultValue) {\n if (typeof window === 'undefined') {\n return undefined;\n }\n let value;\n try {\n value = localStorage.getItem(key) || undefined;\n if (!value) {\n // the first time that user enters the site.\n localStorage.setItem(key, defaultValue);\n }\n } catch (e) {\n // Unsupported\n }\n return value || defaultValue;\n}\nfunction useCurrentColorScheme(options) {\n const {\n defaultMode = 'light',\n defaultLightColorScheme,\n defaultDarkColorScheme,\n supportedColorSchemes = [],\n modeStorageKey = _getInitColorSchemeScript.DEFAULT_MODE_STORAGE_KEY,\n colorSchemeStorageKey = _getInitColorSchemeScript.DEFAULT_COLOR_SCHEME_STORAGE_KEY,\n storageWindow = typeof window === 'undefined' ? undefined : window\n } = options;\n const joinedColorSchemes = supportedColorSchemes.join(',');\n const [state, setState] = React.useState(() => {\n const initialMode = initializeValue(modeStorageKey, defaultMode);\n const lightColorScheme = initializeValue(`${colorSchemeStorageKey}-light`, defaultLightColorScheme);\n const darkColorScheme = initializeValue(`${colorSchemeStorageKey}-dark`, defaultDarkColorScheme);\n return {\n mode: initialMode,\n systemMode: getSystemMode(initialMode),\n lightColorScheme,\n darkColorScheme\n };\n });\n const colorScheme = getColorScheme(state);\n const setMode = React.useCallback(mode => {\n setState(currentState => {\n if (mode === currentState.mode) {\n // do nothing if mode does not change\n return currentState;\n }\n const newMode = !mode ? defaultMode : mode;\n try {\n localStorage.setItem(modeStorageKey, newMode);\n } catch (e) {\n // Unsupported\n }\n return (0, _extends2.default)({}, currentState, {\n mode: newMode,\n systemMode: getSystemMode(newMode)\n });\n });\n }, [modeStorageKey, defaultMode]);\n const setColorScheme = React.useCallback(value => {\n if (!value) {\n setState(currentState => {\n try {\n localStorage.setItem(`${colorSchemeStorageKey}-light`, defaultLightColorScheme);\n localStorage.setItem(`${colorSchemeStorageKey}-dark`, defaultDarkColorScheme);\n } catch (e) {\n // Unsupported\n }\n return (0, _extends2.default)({}, currentState, {\n lightColorScheme: defaultLightColorScheme,\n darkColorScheme: defaultDarkColorScheme\n });\n });\n } else if (typeof value === 'string') {\n if (value && !joinedColorSchemes.includes(value)) {\n console.error(`\\`${value}\\` does not exist in \\`theme.colorSchemes\\`.`);\n } else {\n setState(currentState => {\n const newState = (0, _extends2.default)({}, currentState);\n processState(currentState, mode => {\n try {\n localStorage.setItem(`${colorSchemeStorageKey}-${mode}`, value);\n } catch (e) {\n // Unsupported\n }\n if (mode === 'light') {\n newState.lightColorScheme = value;\n }\n if (mode === 'dark') {\n newState.darkColorScheme = value;\n }\n });\n return newState;\n });\n }\n } else {\n setState(currentState => {\n const newState = (0, _extends2.default)({}, currentState);\n const newLightColorScheme = value.light === null ? defaultLightColorScheme : value.light;\n const newDarkColorScheme = value.dark === null ? defaultDarkColorScheme : value.dark;\n if (newLightColorScheme) {\n if (!joinedColorSchemes.includes(newLightColorScheme)) {\n console.error(`\\`${newLightColorScheme}\\` does not exist in \\`theme.colorSchemes\\`.`);\n } else {\n newState.lightColorScheme = newLightColorScheme;\n try {\n localStorage.setItem(`${colorSchemeStorageKey}-light`, newLightColorScheme);\n } catch (error) {\n // Unsupported\n }\n }\n }\n if (newDarkColorScheme) {\n if (!joinedColorSchemes.includes(newDarkColorScheme)) {\n console.error(`\\`${newDarkColorScheme}\\` does not exist in \\`theme.colorSchemes\\`.`);\n } else {\n newState.darkColorScheme = newDarkColorScheme;\n try {\n localStorage.setItem(`${colorSchemeStorageKey}-dark`, newDarkColorScheme);\n } catch (error) {\n // Unsupported\n }\n }\n }\n return newState;\n });\n }\n }, [joinedColorSchemes, colorSchemeStorageKey, defaultLightColorScheme, defaultDarkColorScheme]);\n const handleMediaQuery = React.useCallback(e => {\n if (state.mode === 'system') {\n setState(currentState => (0, _extends2.default)({}, currentState, {\n systemMode: e != null && e.matches ? 'dark' : 'light'\n }));\n }\n }, [state.mode]);\n\n // Ref hack to avoid adding handleMediaQuery as a dep\n const mediaListener = React.useRef(handleMediaQuery);\n mediaListener.current = handleMediaQuery;\n React.useEffect(() => {\n const handler = (...args) => mediaListener.current(...args);\n\n // Always listen to System preference\n const media = window.matchMedia('(prefers-color-scheme: dark)');\n\n // Intentionally use deprecated listener methods to support iOS & old browsers\n media.addListener(handler);\n handler(media);\n return () => media.removeListener(handler);\n }, []);\n\n // Handle when localStorage has changed\n React.useEffect(() => {\n const handleStorage = event => {\n const value = event.newValue;\n if (typeof event.key === 'string' && event.key.startsWith(colorSchemeStorageKey) && (!value || joinedColorSchemes.match(value))) {\n // If the key is deleted, value will be null then reset color scheme to the default one.\n if (event.key.endsWith('light')) {\n setColorScheme({\n light: value\n });\n }\n if (event.key.endsWith('dark')) {\n setColorScheme({\n dark: value\n });\n }\n }\n if (event.key === modeStorageKey && (!value || ['light', 'dark', 'system'].includes(value))) {\n setMode(value || defaultMode);\n }\n };\n if (storageWindow) {\n // For syncing color-scheme changes between iframes\n storageWindow.addEventListener('storage', handleStorage);\n return () => storageWindow.removeEventListener('storage', handleStorage);\n }\n return undefined;\n }, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode, storageWindow]);\n return (0, _extends2.default)({}, state, {\n colorScheme,\n setMode,\n setColorScheme\n });\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DISABLE_CSS_TRANSITION = void 0;\nexports.default = createCssVarsProvider;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _formatMuiErrorMessage2 = _interopRequireDefault(require(\"@mui/utils/formatMuiErrorMessage\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _utils = require(\"@mui/utils\");\nvar _styledEngine = require(\"@mui/styled-engine\");\nvar _privateTheming = require(\"@mui/private-theming\");\nvar _ThemeProvider = _interopRequireDefault(require(\"../ThemeProvider\"));\nvar _getInitColorSchemeScript = _interopRequireWildcard(require(\"./getInitColorSchemeScript\"));\nvar _useCurrentColorScheme = _interopRequireDefault(require(\"./useCurrentColorScheme\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nconst _excluded = [\"colorSchemes\", \"components\", \"generateCssVars\", \"cssVarPrefix\"];\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst DISABLE_CSS_TRANSITION = exports.DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}';\nfunction createCssVarsProvider(options) {\n const {\n themeId,\n /**\n * This `theme` object needs to follow a certain structure to\n * be used correctly by the finel `CssVarsProvider`. It should have a\n * `colorSchemes` key with the light and dark (and any other) palette.\n * It should also ideally have a vars object created using `prepareCssVars`.\n */\n theme: defaultTheme = {},\n attribute: defaultAttribute = _getInitColorSchemeScript.DEFAULT_ATTRIBUTE,\n modeStorageKey: defaultModeStorageKey = _getInitColorSchemeScript.DEFAULT_MODE_STORAGE_KEY,\n colorSchemeStorageKey: defaultColorSchemeStorageKey = _getInitColorSchemeScript.DEFAULT_COLOR_SCHEME_STORAGE_KEY,\n defaultMode: designSystemMode = 'light',\n defaultColorScheme: designSystemColorScheme,\n disableTransitionOnChange: designSystemTransitionOnChange = false,\n resolveTheme,\n excludeVariablesFromRoot\n } = options;\n if (!defaultTheme.colorSchemes || typeof designSystemColorScheme === 'string' && !defaultTheme.colorSchemes[designSystemColorScheme] || typeof designSystemColorScheme === 'object' && !defaultTheme.colorSchemes[designSystemColorScheme == null ? void 0 : designSystemColorScheme.light] || typeof designSystemColorScheme === 'object' && !defaultTheme.colorSchemes[designSystemColorScheme == null ? void 0 : designSystemColorScheme.dark]) {\n console.error(`MUI: \\`${designSystemColorScheme}\\` does not exist in \\`theme.colorSchemes\\`.`);\n }\n const ColorSchemeContext = /*#__PURE__*/React.createContext(undefined);\n const useColorScheme = () => {\n const value = React.useContext(ColorSchemeContext);\n if (!value) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`useColorScheme\\` must be called under ` : (0, _formatMuiErrorMessage2.default)(19));\n }\n return value;\n };\n function CssVarsProvider({\n children,\n theme: themeProp = defaultTheme,\n modeStorageKey = defaultModeStorageKey,\n colorSchemeStorageKey = defaultColorSchemeStorageKey,\n attribute = defaultAttribute,\n defaultMode = designSystemMode,\n defaultColorScheme = designSystemColorScheme,\n disableTransitionOnChange = designSystemTransitionOnChange,\n storageWindow = typeof window === 'undefined' ? undefined : window,\n documentNode = typeof document === 'undefined' ? undefined : document,\n colorSchemeNode = typeof document === 'undefined' ? undefined : document.documentElement,\n colorSchemeSelector = ':root',\n disableNestedContext = false,\n disableStyleSheetGeneration = false\n }) {\n const hasMounted = React.useRef(false);\n const upperTheme = (0, _privateTheming.useTheme)();\n const ctx = React.useContext(ColorSchemeContext);\n const nested = !!ctx && !disableNestedContext;\n const scopedTheme = themeProp[themeId];\n const _ref = scopedTheme || themeProp,\n {\n colorSchemes = {},\n components = {},\n generateCssVars = () => ({\n vars: {},\n css: {}\n }),\n cssVarPrefix\n } = _ref,\n restThemeProp = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);\n const allColorSchemes = Object.keys(colorSchemes);\n const defaultLightColorScheme = typeof defaultColorScheme === 'string' ? defaultColorScheme : defaultColorScheme.light;\n const defaultDarkColorScheme = typeof defaultColorScheme === 'string' ? defaultColorScheme : defaultColorScheme.dark;\n\n // 1. Get the data about the `mode`, `colorScheme`, and setter functions.\n const {\n mode: stateMode,\n setMode,\n systemMode,\n lightColorScheme,\n darkColorScheme,\n colorScheme: stateColorScheme,\n setColorScheme\n } = (0, _useCurrentColorScheme.default)({\n supportedColorSchemes: allColorSchemes,\n defaultLightColorScheme,\n defaultDarkColorScheme,\n modeStorageKey,\n colorSchemeStorageKey,\n defaultMode,\n storageWindow\n });\n let mode = stateMode;\n let colorScheme = stateColorScheme;\n if (nested) {\n mode = ctx.mode;\n colorScheme = ctx.colorScheme;\n }\n const calculatedMode = (() => {\n if (mode) {\n return mode;\n }\n // This scope occurs on the server\n if (defaultMode === 'system') {\n return designSystemMode;\n }\n return defaultMode;\n })();\n const calculatedColorScheme = (() => {\n if (!colorScheme) {\n // This scope occurs on the server\n if (calculatedMode === 'dark') {\n return defaultDarkColorScheme;\n }\n // use light color scheme, if default mode is 'light' | 'system'\n return defaultLightColorScheme;\n }\n return colorScheme;\n })();\n\n // 2. Create CSS variables and store them in objects (to be generated in stylesheets in the final step)\n const {\n css: rootCss,\n vars: rootVars\n } = generateCssVars();\n\n // 3. Start composing the theme object\n const theme = (0, _extends2.default)({}, restThemeProp, {\n components,\n colorSchemes,\n cssVarPrefix,\n vars: rootVars,\n getColorSchemeSelector: targetColorScheme => `[${attribute}=\"${targetColorScheme}\"] &`\n });\n\n // 4. Create color CSS variables and store them in objects (to be generated in stylesheets in the final step)\n // The default color scheme stylesheet is constructed to have the least CSS specificity.\n // The other color schemes uses selector, default as data attribute, to increase the CSS specificity so that they can override the default color scheme stylesheet.\n const defaultColorSchemeStyleSheet = {};\n const otherColorSchemesStyleSheet = {};\n Object.entries(colorSchemes).forEach(([key, scheme]) => {\n const {\n css,\n vars\n } = generateCssVars(key);\n theme.vars = (0, _utils.deepmerge)(theme.vars, vars);\n if (key === calculatedColorScheme) {\n // 4.1 Merge the selected color scheme to the theme\n Object.keys(scheme).forEach(schemeKey => {\n if (scheme[schemeKey] && typeof scheme[schemeKey] === 'object') {\n // shallow merge the 1st level structure of the theme.\n theme[schemeKey] = (0, _extends2.default)({}, theme[schemeKey], scheme[schemeKey]);\n } else {\n theme[schemeKey] = scheme[schemeKey];\n }\n });\n if (theme.palette) {\n theme.palette.colorScheme = key;\n }\n }\n const resolvedDefaultColorScheme = (() => {\n if (typeof defaultColorScheme === 'string') {\n return defaultColorScheme;\n }\n if (defaultMode === 'dark') {\n return defaultColorScheme.dark;\n }\n return defaultColorScheme.light;\n })();\n if (key === resolvedDefaultColorScheme) {\n if (excludeVariablesFromRoot) {\n const excludedVariables = {};\n excludeVariablesFromRoot(cssVarPrefix).forEach(cssVar => {\n excludedVariables[cssVar] = css[cssVar];\n delete css[cssVar];\n });\n defaultColorSchemeStyleSheet[`[${attribute}=\"${key}\"]`] = excludedVariables;\n }\n defaultColorSchemeStyleSheet[`${colorSchemeSelector}, [${attribute}=\"${key}\"]`] = css;\n } else {\n otherColorSchemesStyleSheet[`${colorSchemeSelector === ':root' ? '' : colorSchemeSelector}[${attribute}=\"${key}\"]`] = css;\n }\n });\n theme.vars = (0, _utils.deepmerge)(theme.vars, rootVars);\n\n // 5. Declaring effects\n // 5.1 Updates the selector value to use the current color scheme which tells CSS to use the proper stylesheet.\n React.useEffect(() => {\n if (colorScheme && colorSchemeNode) {\n // attaches attribute to because the css variables are attached to :root (html)\n colorSchemeNode.setAttribute(attribute, colorScheme);\n }\n }, [colorScheme, attribute, colorSchemeNode]);\n\n // 5.2 Remove the CSS transition when color scheme changes to create instant experience.\n // credit: https://github.com/pacocoursey/next-themes/blob/b5c2bad50de2d61ad7b52a9c5cdc801a78507d7a/index.tsx#L313\n React.useEffect(() => {\n let timer;\n if (disableTransitionOnChange && hasMounted.current && documentNode) {\n const css = documentNode.createElement('style');\n css.appendChild(documentNode.createTextNode(DISABLE_CSS_TRANSITION));\n documentNode.head.appendChild(css);\n\n // Force browser repaint\n (() => window.getComputedStyle(documentNode.body))();\n timer = setTimeout(() => {\n documentNode.head.removeChild(css);\n }, 1);\n }\n return () => {\n clearTimeout(timer);\n };\n }, [colorScheme, disableTransitionOnChange, documentNode]);\n React.useEffect(() => {\n hasMounted.current = true;\n return () => {\n hasMounted.current = false;\n };\n }, []);\n const contextValue = React.useMemo(() => ({\n mode,\n systemMode,\n setMode,\n lightColorScheme,\n darkColorScheme,\n colorScheme,\n setColorScheme,\n allColorSchemes\n }), [allColorSchemes, colorScheme, darkColorScheme, lightColorScheme, mode, setColorScheme, setMode, systemMode]);\n let shouldGenerateStyleSheet = true;\n if (disableStyleSheetGeneration || nested && (upperTheme == null ? void 0 : upperTheme.cssVarPrefix) === cssVarPrefix) {\n shouldGenerateStyleSheet = false;\n }\n const element = /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {\n children: [shouldGenerateStyleSheet && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {\n children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledEngine.GlobalStyles, {\n styles: {\n [colorSchemeSelector]: rootCss\n }\n }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledEngine.GlobalStyles, {\n styles: defaultColorSchemeStyleSheet\n }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledEngine.GlobalStyles, {\n styles: otherColorSchemesStyleSheet\n })]\n }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeProvider.default, {\n themeId: scopedTheme ? themeId : undefined,\n theme: resolveTheme ? resolveTheme(theme) : theme,\n children: children\n })]\n });\n if (nested) {\n return element;\n }\n return /*#__PURE__*/(0, _jsxRuntime.jsx)(ColorSchemeContext.Provider, {\n value: contextValue,\n children: element\n });\n }\n process.env.NODE_ENV !== \"production\" ? CssVarsProvider.propTypes = {\n /**\n * The body attribute name to attach colorScheme.\n */\n attribute: _propTypes.default.string,\n /**\n * The component tree.\n */\n children: _propTypes.default.node,\n /**\n * The node used to attach the color-scheme attribute\n */\n colorSchemeNode: _propTypes.default.any,\n /**\n * The CSS selector for attaching the generated custom properties\n */\n colorSchemeSelector: _propTypes.default.string,\n /**\n * localStorage key used to store `colorScheme`\n */\n colorSchemeStorageKey: _propTypes.default.string,\n /**\n * The initial color scheme used.\n */\n defaultColorScheme: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),\n /**\n * The initial mode used.\n */\n defaultMode: _propTypes.default.string,\n /**\n * If `true`, the provider creates its own context and generate stylesheet as if it is a root `CssVarsProvider`.\n */\n disableNestedContext: _propTypes.default.bool,\n /**\n * If `true`, the style sheet won't be generated.\n *\n * This is useful for controlling nested CssVarsProvider behavior.\n */\n disableStyleSheetGeneration: _propTypes.default.bool,\n /**\n * Disable CSS transitions when switching between modes or color schemes.\n */\n disableTransitionOnChange: _propTypes.default.bool,\n /**\n * The document to attach the attribute to.\n */\n documentNode: _propTypes.default.any,\n /**\n * The key in the local storage used to store current color scheme.\n */\n modeStorageKey: _propTypes.default.string,\n /**\n * The window that attaches the 'storage' event listener.\n * @default window\n */\n storageWindow: _propTypes.default.any,\n /**\n * The calculated theme object that will be passed through context.\n */\n theme: _propTypes.default.object\n } : void 0;\n const defaultLightColorScheme = typeof designSystemColorScheme === 'string' ? designSystemColorScheme : designSystemColorScheme.light;\n const defaultDarkColorScheme = typeof designSystemColorScheme === 'string' ? designSystemColorScheme : designSystemColorScheme.dark;\n const getInitColorSchemeScript = params => (0, _getInitColorSchemeScript.default)((0, _extends2.default)({\n attribute: defaultAttribute,\n colorSchemeStorageKey: defaultColorSchemeStorageKey,\n defaultMode: designSystemMode,\n defaultLightColorScheme,\n defaultDarkColorScheme,\n modeStorageKey: defaultModeStorageKey\n }, params));\n return {\n CssVarsProvider,\n useColorScheme,\n getInitColorSchemeScript\n };\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createGetCssVar;\n/**\n * The benefit of this function is to help developers get CSS var from theme without specifying the whole variable\n * and they does not need to remember the prefix (defined once).\n */\nfunction createGetCssVar(prefix = '') {\n function appendVar(...vars) {\n if (!vars.length) {\n return '';\n }\n const value = vars[0];\n if (typeof value === 'string' && !value.match(/(#|\\(|\\)|(-?(\\d*\\.)?\\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\\d*\\.)?\\d+)$|(\\d+ \\d+ \\d+)/)) {\n return `, var(--${prefix ? `${prefix}-` : ''}${value}${appendVar(...vars.slice(1))})`;\n }\n return `, ${value}`;\n }\n\n // AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error.\n const getCssVar = (field, ...fallbacks) => {\n return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...fallbacks)})`;\n };\n return getCssVar;\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.assignNestedKeys = void 0;\nexports.default = cssVarsParser;\nexports.walkObjectDeep = void 0;\n/**\n * This function create an object from keys, value and then assign to target\n *\n * @param {Object} obj : the target object to be assigned\n * @param {string[]} keys\n * @param {string | number} value\n *\n * @example\n * const source = {}\n * assignNestedKeys(source, ['palette', 'primary'], 'var(--palette-primary)')\n * console.log(source) // { palette: { primary: 'var(--palette-primary)' } }\n *\n * @example\n * const source = { palette: { primary: 'var(--palette-primary)' } }\n * assignNestedKeys(source, ['palette', 'secondary'], 'var(--palette-secondary)')\n * console.log(source) // { palette: { primary: 'var(--palette-primary)', secondary: 'var(--palette-secondary)' } }\n */\nconst assignNestedKeys = (obj, keys, value, arrayKeys = []) => {\n let temp = obj;\n keys.forEach((k, index) => {\n if (index === keys.length - 1) {\n if (Array.isArray(temp)) {\n temp[Number(k)] = value;\n } else if (temp && typeof temp === 'object') {\n temp[k] = value;\n }\n } else if (temp && typeof temp === 'object') {\n if (!temp[k]) {\n temp[k] = arrayKeys.includes(k) ? [] : {};\n }\n temp = temp[k];\n }\n });\n};\n\n/**\n *\n * @param {Object} obj : source object\n * @param {Function} callback : a function that will be called when\n * - the deepest key in source object is reached\n * - the value of the deepest key is NOT `undefined` | `null`\n *\n * @example\n * walkObjectDeep({ palette: { primary: { main: '#000000' } } }, console.log)\n * // ['palette', 'primary', 'main'] '#000000'\n */\nexports.assignNestedKeys = assignNestedKeys;\nconst walkObjectDeep = (obj, callback, shouldSkipPaths) => {\n function recurse(object, parentKeys = [], arrayKeys = []) {\n Object.entries(object).forEach(([key, value]) => {\n if (!shouldSkipPaths || shouldSkipPaths && !shouldSkipPaths([...parentKeys, key])) {\n if (value !== undefined && value !== null) {\n if (typeof value === 'object' && Object.keys(value).length > 0) {\n recurse(value, [...parentKeys, key], Array.isArray(value) ? [...arrayKeys, key] : arrayKeys);\n } else {\n callback([...parentKeys, key], value, arrayKeys);\n }\n }\n }\n });\n }\n recurse(obj);\n};\nexports.walkObjectDeep = walkObjectDeep;\nconst getCssValue = (keys, value) => {\n if (typeof value === 'number') {\n if (['lineHeight', 'fontWeight', 'opacity', 'zIndex'].some(prop => keys.includes(prop))) {\n // CSS property that are unitless\n return value;\n }\n const lastKey = keys[keys.length - 1];\n if (lastKey.toLowerCase().indexOf('opacity') >= 0) {\n // opacity values are unitless\n return value;\n }\n return `${value}px`;\n }\n return value;\n};\n\n/**\n * a function that parse theme and return { css, vars }\n *\n * @param {Object} theme\n * @param {{\n * prefix?: string,\n * shouldSkipGeneratingVar?: (objectPathKeys: Array, value: string | number) => boolean\n * }} options.\n * `prefix`: The prefix of the generated CSS variables. This function does not change the value.\n *\n * @returns {{ css: Object, vars: Object }} `css` is the stylesheet, `vars` is an object to get css variable (same structure as theme).\n *\n * @example\n * const { css, vars } = parser({\n * fontSize: 12,\n * lineHeight: 1.2,\n * palette: { primary: { 500: 'var(--color)' } }\n * }, { prefix: 'foo' })\n *\n * console.log(css) // { '--foo-fontSize': '12px', '--foo-lineHeight': 1.2, '--foo-palette-primary-500': 'var(--color)' }\n * console.log(vars) // { fontSize: 'var(--foo-fontSize)', lineHeight: 'var(--foo-lineHeight)', palette: { primary: { 500: 'var(--foo-palette-primary-500)' } } }\n */\nfunction cssVarsParser(theme, options) {\n const {\n prefix,\n shouldSkipGeneratingVar\n } = options || {};\n const css = {};\n const vars = {};\n const varsWithDefaults = {};\n walkObjectDeep(theme, (keys, value, arrayKeys) => {\n if (typeof value === 'string' || typeof value === 'number') {\n if (!shouldSkipGeneratingVar || !shouldSkipGeneratingVar(keys, value)) {\n // only create css & var if `shouldSkipGeneratingVar` return false\n const cssVar = `--${prefix ? `${prefix}-` : ''}${keys.join('-')}`;\n Object.assign(css, {\n [cssVar]: getCssValue(keys, value)\n });\n assignNestedKeys(vars, keys, `var(${cssVar})`, arrayKeys);\n assignNestedKeys(varsWithDefaults, keys, `var(${cssVar}, ${value})`, arrayKeys);\n }\n }\n }, keys => keys[0] === 'vars' // skip 'vars/*' paths\n );\n return {\n css,\n vars,\n varsWithDefaults\n };\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _utils = require(\"@mui/utils\");\nvar _cssVarsParser = _interopRequireDefault(require(\"./cssVarsParser\"));\nconst _excluded = [\"colorSchemes\", \"components\"],\n _excluded2 = [\"light\"];\nfunction prepareCssVars(theme, parserConfig) {\n // @ts-ignore - ignore components do not exist\n const {\n colorSchemes = {}\n } = theme,\n otherTheme = (0, _objectWithoutPropertiesLoose2.default)(theme, _excluded);\n const {\n vars: rootVars,\n css: rootCss,\n varsWithDefaults: rootVarsWithDefaults\n } = (0, _cssVarsParser.default)(otherTheme, parserConfig);\n let themeVars = rootVarsWithDefaults;\n const colorSchemesMap = {};\n const {\n light\n } = colorSchemes,\n otherColorSchemes = (0, _objectWithoutPropertiesLoose2.default)(colorSchemes, _excluded2);\n Object.entries(otherColorSchemes || {}).forEach(([key, scheme]) => {\n const {\n vars,\n css,\n varsWithDefaults\n } = (0, _cssVarsParser.default)(scheme, parserConfig);\n themeVars = (0, _utils.deepmerge)(themeVars, varsWithDefaults);\n colorSchemesMap[key] = {\n css,\n vars\n };\n });\n if (light) {\n // light color scheme vars should be merged last to set as default\n const {\n css,\n vars,\n varsWithDefaults\n } = (0, _cssVarsParser.default)(light, parserConfig);\n themeVars = (0, _utils.deepmerge)(themeVars, varsWithDefaults);\n colorSchemesMap.light = {\n css,\n vars\n };\n }\n const generateCssVars = colorScheme => {\n if (!colorScheme) {\n return {\n css: (0, _extends2.default)({}, rootCss),\n vars: rootVars\n };\n }\n return {\n css: (0, _extends2.default)({}, colorSchemesMap[colorScheme].css),\n vars: colorSchemesMap[colorScheme].vars\n };\n };\n return {\n vars: themeVars,\n generateCssVars\n };\n}\nvar _default = exports.default = prepareCssVars;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _prepareCssVars = _interopRequireDefault(require(\"./prepareCssVars\"));\nconst _excluded = [\"cssVarPrefix\", \"shouldSkipGeneratingVar\"];\nfunction createCssVarsTheme(theme) {\n const {\n cssVarPrefix,\n shouldSkipGeneratingVar\n } = theme,\n otherTheme = (0, _objectWithoutPropertiesLoose2.default)(theme, _excluded);\n return (0, _extends2.default)({}, theme, (0, _prepareCssVars.default)(otherTheme, {\n prefix: cssVarPrefix,\n shouldSkipGeneratingVar\n }));\n}\nvar _default = exports.default = createCssVarsTheme;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createContainer;\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _clsx = _interopRequireDefault(require(\"clsx\"));\nvar _utils = require(\"@mui/utils\");\nvar _useThemeProps = _interopRequireDefault(require(\"../useThemeProps\"));\nvar _styled = _interopRequireDefault(require(\"../styled\"));\nvar _createTheme = _interopRequireDefault(require(\"../createTheme\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nconst _excluded = [\"className\", \"component\", \"disableGutters\", \"fixed\", \"maxWidth\", \"classes\"];\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst defaultTheme = (0, _createTheme.default)();\nconst defaultCreateStyledComponent = (0, _styled.default)('div', {\n name: 'MuiContainer',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[`maxWidth${(0, _utils.unstable_capitalize)(String(ownerState.maxWidth))}`], ownerState.fixed && styles.fixed, ownerState.disableGutters && styles.disableGutters];\n }\n});\nconst useThemePropsDefault = inProps => (0, _useThemeProps.default)({\n props: inProps,\n name: 'MuiContainer',\n defaultTheme\n});\nconst useUtilityClasses = (ownerState, componentName) => {\n const getContainerUtilityClass = slot => {\n return (0, _utils.unstable_generateUtilityClass)(componentName, slot);\n };\n const {\n classes,\n fixed,\n disableGutters,\n maxWidth\n } = ownerState;\n const slots = {\n root: ['root', maxWidth && `maxWidth${(0, _utils.unstable_capitalize)(String(maxWidth))}`, fixed && 'fixed', disableGutters && 'disableGutters']\n };\n return (0, _utils.unstable_composeClasses)(slots, getContainerUtilityClass, classes);\n};\nfunction createContainer(options = {}) {\n const {\n // This will allow adding custom styled fn (for example for custom sx style function)\n createStyledComponent = defaultCreateStyledComponent,\n useThemeProps = useThemePropsDefault,\n componentName = 'MuiContainer'\n } = options;\n const ContainerRoot = createStyledComponent(({\n theme,\n ownerState\n }) => (0, _extends2.default)({\n width: '100%',\n marginLeft: 'auto',\n boxSizing: 'border-box',\n marginRight: 'auto',\n display: 'block'\n }, !ownerState.disableGutters && {\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n // @ts-ignore module augmentation fails if custom breakpoints are used\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3)\n }\n }), ({\n theme,\n ownerState\n }) => ownerState.fixed && Object.keys(theme.breakpoints.values).reduce((acc, breakpointValueKey) => {\n const breakpoint = breakpointValueKey;\n const value = theme.breakpoints.values[breakpoint];\n if (value !== 0) {\n // @ts-ignore\n acc[theme.breakpoints.up(breakpoint)] = {\n maxWidth: `${value}${theme.breakpoints.unit}`\n };\n }\n return acc;\n }, {}), ({\n theme,\n ownerState\n }) => (0, _extends2.default)({}, ownerState.maxWidth === 'xs' && {\n // @ts-ignore module augmentation fails if custom breakpoints are used\n [theme.breakpoints.up('xs')]: {\n // @ts-ignore module augmentation fails if custom breakpoints are used\n maxWidth: Math.max(theme.breakpoints.values.xs, 444)\n }\n }, ownerState.maxWidth &&\n // @ts-ignore module augmentation fails if custom breakpoints are used\n ownerState.maxWidth !== 'xs' && {\n // @ts-ignore module augmentation fails if custom breakpoints are used\n [theme.breakpoints.up(ownerState.maxWidth)]: {\n // @ts-ignore module augmentation fails if custom breakpoints are used\n maxWidth: `${theme.breakpoints.values[ownerState.maxWidth]}${theme.breakpoints.unit}`\n }\n }));\n const Container = /*#__PURE__*/React.forwardRef(function Container(inProps, ref) {\n const props = useThemeProps(inProps);\n const {\n className,\n component = 'div',\n disableGutters = false,\n fixed = false,\n maxWidth = 'lg'\n } = props,\n other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);\n const ownerState = (0, _extends2.default)({}, props, {\n component,\n disableGutters,\n fixed,\n maxWidth\n });\n\n // @ts-ignore module augmentation fails if custom breakpoints are used\n const classes = useUtilityClasses(ownerState, componentName);\n return (\n /*#__PURE__*/\n // @ts-ignore theme is injected by the styled util\n (0, _jsxRuntime.jsx)(ContainerRoot, (0, _extends2.default)({\n as: component\n // @ts-ignore module augmentation fails if custom breakpoints are used\n ,\n ownerState: ownerState,\n className: (0, _clsx.default)(classes.root, className),\n ref: ref\n }, other))\n );\n });\n process.env.NODE_ENV !== \"production\" ? Container.propTypes /* remove-proptypes */ = {\n children: _propTypes.default.node,\n classes: _propTypes.default.object,\n className: _propTypes.default.string,\n component: _propTypes.default.elementType,\n disableGutters: _propTypes.default.bool,\n fixed: _propTypes.default.bool,\n maxWidth: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), _propTypes.default.string]),\n sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])\n } : void 0;\n return Container;\n}", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _createContainer = _interopRequireDefault(require(\"./createContainer\"));\n/**\n *\n * Demos:\n *\n * - [Container (Material UI)](https://mui.com/material-ui/react-container/)\n * - [Container (MUI System)](https://mui.com/system/react-container/)\n *\n * API:\n *\n * - [Container API](https://mui.com/system/api/container/)\n */\nconst Container = (0, _createContainer.default)();\nprocess.env.NODE_ENV !== \"production\" ? Container.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the TypeScript types and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * @ignore\n */\n children: _propTypes.default.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: _propTypes.default.object,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: _propTypes.default.elementType,\n /**\n * If `true`, the left and right padding is removed.\n * @default false\n */\n disableGutters: _propTypes.default.bool,\n /**\n * Set the max-width to match the min-width of the current breakpoint.\n * This is useful if you'd prefer to design for a fixed set of sizes\n * instead of trying to accommodate a fully fluid viewport.\n * It's fluid by default.\n * @default false\n */\n fixed: _propTypes.default.bool,\n /**\n * Determine the max-width of the container.\n * The container width grows with the size of the screen.\n * Set to `false` to disable `maxWidth`.\n * @default 'lg'\n */\n maxWidth: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), _propTypes.default.string]),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])\n} : void 0;\nvar _default = exports.default = Container;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nexports.getContainerUtilityClass = getContainerUtilityClass;\nvar _utils = require(\"@mui/utils\");\nfunction getContainerUtilityClass(slot) {\n return (0, _utils.unstable_generateUtilityClass)('MuiContainer', slot);\n}\nconst containerClasses = (0, _utils.unstable_generateUtilityClasses)('MuiContainer', ['root', 'disableGutters', 'fixed', 'maxWidthXs', 'maxWidthSm', 'maxWidthMd', 'maxWidthLg', 'maxWidthXl']);\nvar _default = exports.default = containerClasses;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n containerClasses: true\n};\nObject.defineProperty(exports, \"containerClasses\", {\n enumerable: true,\n get: function () {\n return _containerClasses.default;\n }\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _Container.default;\n }\n});\nvar _Container = _interopRequireDefault(require(\"./Container\"));\nvar _containerClasses = _interopRequireWildcard(require(\"./containerClasses\"));\nObject.keys(_containerClasses).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _containerClasses[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _containerClasses[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.traverseBreakpoints = exports.filterBreakpointKeys = void 0;\nconst filterBreakpointKeys = (breakpointsKeys, responsiveKeys) => breakpointsKeys.filter(key => responsiveKeys.includes(key));\nexports.filterBreakpointKeys = filterBreakpointKeys;\nconst traverseBreakpoints = (breakpoints, responsive, iterator) => {\n const smallestBreakpoint = breakpoints.keys[0]; // the keys is sorted from smallest to largest by `createBreakpoints`.\n\n if (Array.isArray(responsive)) {\n responsive.forEach((breakpointValue, index) => {\n iterator((responsiveStyles, style) => {\n if (index <= breakpoints.keys.length - 1) {\n if (index === 0) {\n Object.assign(responsiveStyles, style);\n } else {\n responsiveStyles[breakpoints.up(breakpoints.keys[index])] = style;\n }\n }\n }, breakpointValue);\n });\n } else if (responsive && typeof responsive === 'object') {\n // prevent null\n // responsive could be a very big object, pick the smallest responsive values\n\n const keys = Object.keys(responsive).length > breakpoints.keys.length ? breakpoints.keys : filterBreakpointKeys(breakpoints.keys, Object.keys(responsive));\n keys.forEach(key => {\n if (breakpoints.keys.indexOf(key) !== -1) {\n // @ts-ignore already checked that responsive is an object\n const breakpointValue = responsive[key];\n if (breakpointValue !== undefined) {\n iterator((responsiveStyles, style) => {\n if (smallestBreakpoint === key) {\n Object.assign(responsiveStyles, style);\n } else {\n responsiveStyles[breakpoints.up(key)] = style;\n }\n }, breakpointValue);\n }\n }\n });\n } else if (typeof responsive === 'number' || typeof responsive === 'string') {\n iterator((responsiveStyles, style) => {\n Object.assign(responsiveStyles, style);\n }, responsive);\n }\n};\nexports.traverseBreakpoints = traverseBreakpoints;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.generateSpacingClassNames = exports.generateSizeClassNames = exports.generateGridStyles = exports.generateGridSizeStyles = exports.generateGridRowSpacingStyles = exports.generateGridOffsetStyles = exports.generateGridDirectionStyles = exports.generateGridColumnsStyles = exports.generateGridColumnSpacingStyles = exports.generateDirectionClasses = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _traverseBreakpoints = require(\"./traverseBreakpoints\");\nfunction appendLevel(level) {\n if (!level) {\n return '';\n }\n return `Level${level}`;\n}\nfunction isNestedContainer(ownerState) {\n return ownerState.unstable_level > 0 && ownerState.container;\n}\nfunction createGetSelfSpacing(ownerState) {\n return function getSelfSpacing(axis) {\n return `var(--Grid-${axis}Spacing${appendLevel(ownerState.unstable_level)})`;\n };\n}\nfunction createGetParentSpacing(ownerState) {\n return function getParentSpacing(axis) {\n if (ownerState.unstable_level === 0) {\n return `var(--Grid-${axis}Spacing)`;\n }\n return `var(--Grid-${axis}Spacing${appendLevel(ownerState.unstable_level - 1)})`;\n };\n}\nfunction getParentColumns(ownerState) {\n if (ownerState.unstable_level === 0) {\n return `var(--Grid-columns)`;\n }\n return `var(--Grid-columns${appendLevel(ownerState.unstable_level - 1)})`;\n}\nconst generateGridSizeStyles = ({\n theme,\n ownerState\n}) => {\n const getSelfSpacing = createGetSelfSpacing(ownerState);\n const styles = {};\n (0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.gridSize, (appendStyle, value) => {\n let style = {};\n if (value === true) {\n style = {\n flexBasis: 0,\n flexGrow: 1,\n maxWidth: '100%'\n };\n }\n if (value === 'auto') {\n style = {\n flexBasis: 'auto',\n flexGrow: 0,\n flexShrink: 0,\n maxWidth: 'none',\n width: 'auto'\n };\n }\n if (typeof value === 'number') {\n style = {\n flexGrow: 0,\n flexBasis: 'auto',\n width: `calc(100% * ${value} / ${getParentColumns(ownerState)}${isNestedContainer(ownerState) ? ` + ${getSelfSpacing('column')}` : ''})`\n };\n }\n appendStyle(styles, style);\n });\n return styles;\n};\nexports.generateGridSizeStyles = generateGridSizeStyles;\nconst generateGridOffsetStyles = ({\n theme,\n ownerState\n}) => {\n const styles = {};\n (0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.gridOffset, (appendStyle, value) => {\n let style = {};\n if (value === 'auto') {\n style = {\n marginLeft: 'auto'\n };\n }\n if (typeof value === 'number') {\n style = {\n marginLeft: value === 0 ? '0px' : `calc(100% * ${value} / ${getParentColumns(ownerState)})`\n };\n }\n appendStyle(styles, style);\n });\n return styles;\n};\nexports.generateGridOffsetStyles = generateGridOffsetStyles;\nconst generateGridColumnsStyles = ({\n theme,\n ownerState\n}) => {\n if (!ownerState.container) {\n return {};\n }\n const styles = isNestedContainer(ownerState) ? {\n [`--Grid-columns${appendLevel(ownerState.unstable_level)}`]: getParentColumns(ownerState)\n } : {\n '--Grid-columns': 12\n };\n (0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.columns, (appendStyle, value) => {\n appendStyle(styles, {\n [`--Grid-columns${appendLevel(ownerState.unstable_level)}`]: value\n });\n });\n return styles;\n};\nexports.generateGridColumnsStyles = generateGridColumnsStyles;\nconst generateGridRowSpacingStyles = ({\n theme,\n ownerState\n}) => {\n if (!ownerState.container) {\n return {};\n }\n const getParentSpacing = createGetParentSpacing(ownerState);\n const styles = isNestedContainer(ownerState) ? {\n // Set the default spacing as its parent spacing.\n // It will be overridden if spacing props are provided\n [`--Grid-rowSpacing${appendLevel(ownerState.unstable_level)}`]: getParentSpacing('row')\n } : {};\n (0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.rowSpacing, (appendStyle, value) => {\n var _theme$spacing;\n appendStyle(styles, {\n [`--Grid-rowSpacing${appendLevel(ownerState.unstable_level)}`]: typeof value === 'string' ? value : (_theme$spacing = theme.spacing) == null ? void 0 : _theme$spacing.call(theme, value)\n });\n });\n return styles;\n};\nexports.generateGridRowSpacingStyles = generateGridRowSpacingStyles;\nconst generateGridColumnSpacingStyles = ({\n theme,\n ownerState\n}) => {\n if (!ownerState.container) {\n return {};\n }\n const getParentSpacing = createGetParentSpacing(ownerState);\n const styles = isNestedContainer(ownerState) ? {\n // Set the default spacing as its parent spacing.\n // It will be overridden if spacing props are provided\n [`--Grid-columnSpacing${appendLevel(ownerState.unstable_level)}`]: getParentSpacing('column')\n } : {};\n (0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.columnSpacing, (appendStyle, value) => {\n var _theme$spacing2;\n appendStyle(styles, {\n [`--Grid-columnSpacing${appendLevel(ownerState.unstable_level)}`]: typeof value === 'string' ? value : (_theme$spacing2 = theme.spacing) == null ? void 0 : _theme$spacing2.call(theme, value)\n });\n });\n return styles;\n};\nexports.generateGridColumnSpacingStyles = generateGridColumnSpacingStyles;\nconst generateGridDirectionStyles = ({\n theme,\n ownerState\n}) => {\n if (!ownerState.container) {\n return {};\n }\n const styles = {};\n (0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.direction, (appendStyle, value) => {\n appendStyle(styles, {\n flexDirection: value\n });\n });\n return styles;\n};\nexports.generateGridDirectionStyles = generateGridDirectionStyles;\nconst generateGridStyles = ({\n ownerState\n}) => {\n const getSelfSpacing = createGetSelfSpacing(ownerState);\n const getParentSpacing = createGetParentSpacing(ownerState);\n return (0, _extends2.default)({\n minWidth: 0,\n boxSizing: 'border-box'\n }, ownerState.container && (0, _extends2.default)({\n display: 'flex',\n flexWrap: 'wrap'\n }, ownerState.wrap && ownerState.wrap !== 'wrap' && {\n flexWrap: ownerState.wrap\n }, {\n margin: `calc(${getSelfSpacing('row')} / -2) calc(${getSelfSpacing('column')} / -2)`\n }, ownerState.disableEqualOverflow && {\n margin: `calc(${getSelfSpacing('row')} * -1) 0px 0px calc(${getSelfSpacing('column')} * -1)`\n }), (!ownerState.container || isNestedContainer(ownerState)) && (0, _extends2.default)({\n padding: `calc(${getParentSpacing('row')} / 2) calc(${getParentSpacing('column')} / 2)`\n }, (ownerState.disableEqualOverflow || ownerState.parentDisableEqualOverflow) && {\n padding: `${getParentSpacing('row')} 0px 0px ${getParentSpacing('column')}`\n }));\n};\nexports.generateGridStyles = generateGridStyles;\nconst generateSizeClassNames = gridSize => {\n const classNames = [];\n Object.entries(gridSize).forEach(([key, value]) => {\n if (value !== false && value !== undefined) {\n classNames.push(`grid-${key}-${String(value)}`);\n }\n });\n return classNames;\n};\nexports.generateSizeClassNames = generateSizeClassNames;\nconst generateSpacingClassNames = (spacing, smallestBreakpoint = 'xs') => {\n function isValidSpacing(val) {\n if (val === undefined) {\n return false;\n }\n return typeof val === 'string' && !Number.isNaN(Number(val)) || typeof val === 'number' && val > 0;\n }\n if (isValidSpacing(spacing)) {\n return [`spacing-${smallestBreakpoint}-${String(spacing)}`];\n }\n if (typeof spacing === 'object' && !Array.isArray(spacing)) {\n const classNames = [];\n Object.entries(spacing).forEach(([key, value]) => {\n if (isValidSpacing(value)) {\n classNames.push(`spacing-${key}-${String(value)}`);\n }\n });\n return classNames;\n }\n return [];\n};\nexports.generateSpacingClassNames = generateSpacingClassNames;\nconst generateDirectionClasses = direction => {\n if (direction === undefined) {\n return [];\n }\n if (typeof direction === 'object') {\n return Object.entries(direction).map(([key, value]) => `direction-${key}-${value}`);\n }\n return [`direction-xs-${String(direction)}`];\n};\nexports.generateDirectionClasses = generateDirectionClasses;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createGrid;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _clsx = _interopRequireDefault(require(\"clsx\"));\nvar _utils = require(\"@mui/utils\");\nvar _styled = _interopRequireDefault(require(\"../styled\"));\nvar _useThemeProps = _interopRequireDefault(require(\"../useThemeProps\"));\nvar _useTheme = _interopRequireDefault(require(\"../useTheme\"));\nvar _styleFunctionSx = require(\"../styleFunctionSx\");\nvar _createTheme = _interopRequireDefault(require(\"../createTheme\"));\nvar _gridGenerator = require(\"./gridGenerator\");\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nconst _excluded = [\"className\", \"children\", \"columns\", \"container\", \"component\", \"direction\", \"wrap\", \"spacing\", \"rowSpacing\", \"columnSpacing\", \"disableEqualOverflow\", \"unstable_level\"];\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst defaultTheme = (0, _createTheme.default)();\n\n// widening Theme to any so that the consumer can own the theme structure.\nconst defaultCreateStyledComponent = (0, _styled.default)('div', {\n name: 'MuiGrid',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n});\nfunction useThemePropsDefault(props) {\n return (0, _useThemeProps.default)({\n props,\n name: 'MuiGrid',\n defaultTheme\n });\n}\nfunction createGrid(options = {}) {\n const {\n // This will allow adding custom styled fn (for example for custom sx style function)\n createStyledComponent = defaultCreateStyledComponent,\n useThemeProps = useThemePropsDefault,\n componentName = 'MuiGrid'\n } = options;\n const OverflowContext = /*#__PURE__*/React.createContext(undefined);\n const useUtilityClasses = (ownerState, theme) => {\n const {\n container,\n direction,\n spacing,\n wrap,\n gridSize\n } = ownerState;\n const slots = {\n root: ['root', container && 'container', wrap !== 'wrap' && `wrap-xs-${String(wrap)}`, ...(0, _gridGenerator.generateDirectionClasses)(direction), ...(0, _gridGenerator.generateSizeClassNames)(gridSize), ...(container ? (0, _gridGenerator.generateSpacingClassNames)(spacing, theme.breakpoints.keys[0]) : [])]\n };\n return (0, _utils.unstable_composeClasses)(slots, slot => (0, _utils.unstable_generateUtilityClass)(componentName, slot), {});\n };\n const GridRoot = createStyledComponent(_gridGenerator.generateGridColumnsStyles, _gridGenerator.generateGridColumnSpacingStyles, _gridGenerator.generateGridRowSpacingStyles, _gridGenerator.generateGridSizeStyles, _gridGenerator.generateGridDirectionStyles, _gridGenerator.generateGridStyles, _gridGenerator.generateGridOffsetStyles);\n const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {\n var _inProps$columns, _inProps$spacing, _ref, _inProps$rowSpacing, _ref2, _inProps$columnSpacin, _ref3, _disableEqualOverflow;\n const theme = (0, _useTheme.default)();\n const themeProps = useThemeProps(inProps);\n const props = (0, _styleFunctionSx.extendSxProp)(themeProps); // `color` type conflicts with html color attribute.\n const overflow = React.useContext(OverflowContext);\n const {\n className,\n children,\n columns: columnsProp = 12,\n container = false,\n component = 'div',\n direction = 'row',\n wrap = 'wrap',\n spacing: spacingProp = 0,\n rowSpacing: rowSpacingProp = spacingProp,\n columnSpacing: columnSpacingProp = spacingProp,\n disableEqualOverflow: themeDisableEqualOverflow,\n unstable_level: level = 0\n } = props,\n rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);\n // Because `disableEqualOverflow` can be set from the theme's defaultProps, the **nested** grid should look at the instance props instead.\n let disableEqualOverflow = themeDisableEqualOverflow;\n if (level && themeDisableEqualOverflow !== undefined) {\n disableEqualOverflow = inProps.disableEqualOverflow;\n }\n // collect breakpoints related props because they can be customized from the theme.\n const gridSize = {};\n const gridOffset = {};\n const other = {};\n Object.entries(rest).forEach(([key, val]) => {\n if (theme.breakpoints.values[key] !== undefined) {\n gridSize[key] = val;\n } else if (theme.breakpoints.values[key.replace('Offset', '')] !== undefined) {\n gridOffset[key.replace('Offset', '')] = val;\n } else {\n other[key] = val;\n }\n });\n const columns = (_inProps$columns = inProps.columns) != null ? _inProps$columns : level ? undefined : columnsProp;\n const spacing = (_inProps$spacing = inProps.spacing) != null ? _inProps$spacing : level ? undefined : spacingProp;\n const rowSpacing = (_ref = (_inProps$rowSpacing = inProps.rowSpacing) != null ? _inProps$rowSpacing : inProps.spacing) != null ? _ref : level ? undefined : rowSpacingProp;\n const columnSpacing = (_ref2 = (_inProps$columnSpacin = inProps.columnSpacing) != null ? _inProps$columnSpacin : inProps.spacing) != null ? _ref2 : level ? undefined : columnSpacingProp;\n const ownerState = (0, _extends2.default)({}, props, {\n level,\n columns,\n container,\n direction,\n wrap,\n spacing,\n rowSpacing,\n columnSpacing,\n gridSize,\n gridOffset,\n disableEqualOverflow: (_ref3 = (_disableEqualOverflow = disableEqualOverflow) != null ? _disableEqualOverflow : overflow) != null ? _ref3 : false,\n // use context value if exists.\n parentDisableEqualOverflow: overflow // for nested grid\n });\n const classes = useUtilityClasses(ownerState, theme);\n let result = /*#__PURE__*/(0, _jsxRuntime.jsx)(GridRoot, (0, _extends2.default)({\n ref: ref,\n as: component,\n ownerState: ownerState,\n className: (0, _clsx.default)(classes.root, className)\n }, other, {\n children: React.Children.map(children, child => {\n if ( /*#__PURE__*/React.isValidElement(child) && (0, _utils.unstable_isMuiElement)(child, ['Grid'])) {\n var _child$props$unstable;\n return /*#__PURE__*/React.cloneElement(child, {\n unstable_level: (_child$props$unstable = child.props.unstable_level) != null ? _child$props$unstable : level + 1\n });\n }\n return child;\n })\n }));\n if (disableEqualOverflow !== undefined && disableEqualOverflow !== (overflow != null ? overflow : false)) {\n // There are 2 possibilities that should wrap with the OverflowContext to communicate with the nested grids:\n // 1. It is the root grid with `disableEqualOverflow`.\n // 2. It is a nested grid with different `disableEqualOverflow` from the context.\n result = /*#__PURE__*/(0, _jsxRuntime.jsx)(OverflowContext.Provider, {\n value: disableEqualOverflow,\n children: result\n });\n }\n return result;\n });\n process.env.NODE_ENV !== \"production\" ? Grid.propTypes /* remove-proptypes */ = {\n children: _propTypes.default.node,\n className: _propTypes.default.string,\n columns: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.number, _propTypes.default.object]),\n columnSpacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),\n component: _propTypes.default.elementType,\n container: _propTypes.default.bool,\n direction: _propTypes.default.oneOfType([_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), _propTypes.default.object]),\n disableEqualOverflow: _propTypes.default.bool,\n lg: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),\n lgOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),\n md: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),\n mdOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),\n rowSpacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),\n sm: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),\n smOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),\n spacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),\n sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),\n wrap: _propTypes.default.oneOf(['nowrap', 'wrap-reverse', 'wrap']),\n xl: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),\n xlOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),\n xs: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),\n xsOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number])\n } : void 0;\n\n // @ts-ignore internal logic for nested grid\n Grid.muiName = 'Grid';\n return Grid;\n}", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _createGrid = _interopRequireDefault(require(\"./createGrid\"));\n/**\n *\n * Demos:\n *\n * - [Grid (Joy UI)](https://mui.com/joy-ui/react-grid/)\n * - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)\n *\n * API:\n *\n * - [Grid API](https://mui.com/system/api/grid/)\n */\nconst Grid = (0, _createGrid.default)();\nprocess.env.NODE_ENV !== \"production\" ? Grid.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the TypeScript types and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * The content of the component.\n */\n children: _propTypes.default.node,\n /**\n * The number of columns.\n * @default 12\n */\n columns: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.number, _propTypes.default.object]),\n /**\n * Defines the horizontal space between the type `item` components.\n * It overrides the value of the `spacing` prop.\n */\n columnSpacing: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),\n /**\n * If `true`, the component will have the flex *container* behavior.\n * You should be wrapping *items* with a *container*.\n * @default false\n */\n container: _propTypes.default.bool,\n /**\n * Defines the `flex-direction` style property.\n * It is applied for all screen sizes.\n * @default 'row'\n */\n direction: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), _propTypes.default.object]),\n /**\n * If `true`, the negative margin and padding are apply only to the top and left sides of the grid.\n */\n disableEqualOverflow: _propTypes.default.bool,\n /**\n * If a number, it sets the number of columns the grid item uses.\n * It can't be greater than the total number of columns of the container (12 by default).\n * If 'auto', the grid item's width matches its content.\n * If false, the prop is ignored.\n * If true, the grid item's width grows to use the space available in the grid container.\n * The value is applied for the `lg` breakpoint and wider screens if not overridden.\n * @default false\n */\n lg: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),\n /**\n * If a number, it sets the margin-left equals to the number of columns the grid item uses.\n * If 'auto', the grid item push itself to the right-end of the container.\n * The value is applied for the `lg` breakpoint and wider screens if not overridden.\n */\n lgOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),\n /**\n * If a number, it sets the number of columns the grid item uses.\n * It can't be greater than the total number of columns of the container (12 by default).\n * If 'auto', the grid item's width matches its content.\n * If false, the prop is ignored.\n * If true, the grid item's width grows to use the space available in the grid container.\n * The value is applied for the `md` breakpoint and wider screens if not overridden.\n * @default false\n */\n md: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),\n /**\n * If a number, it sets the margin-left equals to the number of columns the grid item uses.\n * If 'auto', the grid item push itself to the right-end of the container.\n * The value is applied for the `md` breakpoint and wider screens if not overridden.\n */\n mdOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),\n /**\n * Defines the vertical space between the type `item` components.\n * It overrides the value of the `spacing` prop.\n */\n rowSpacing: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),\n /**\n * If a number, it sets the number of columns the grid item uses.\n * It can't be greater than the total number of columns of the container (12 by default).\n * If 'auto', the grid item's width matches its content.\n * If false, the prop is ignored.\n * If true, the grid item's width grows to use the space available in the grid container.\n * The value is applied for the `sm` breakpoint and wider screens if not overridden.\n * @default false\n */\n sm: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),\n /**\n * If a number, it sets the margin-left equals to the number of columns the grid item uses.\n * If 'auto', the grid item push itself to the right-end of the container.\n * The value is applied for the `sm` breakpoint and wider screens if not overridden.\n */\n smOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),\n /**\n * Defines the space between the type `item` components.\n * It can only be used on a type `container` component.\n * @default 0\n */\n spacing: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),\n /**\n * @ignore\n */\n sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),\n /**\n * @internal\n * The level of the grid starts from `0`\n * and increases when the grid nests inside another grid regardless of container or item.\n *\n * ```js\n * // level 0\n * // level 1\n * // level 2\n * // level 1\n * ```\n *\n * Only consecutive grid is considered nesting.\n * A grid container will start at `0` if there are non-Grid element above it.\n *\n * ```js\n * // level 0\n *
\n * // level 0\n * // level 1\n * ```\n */\n unstable_level: _propTypes.default.number,\n /**\n * Defines the `flex-wrap` style property.\n * It's applied for all screen sizes.\n * @default 'wrap'\n */\n wrap: _propTypes.default.oneOf(['nowrap', 'wrap-reverse', 'wrap']),\n /**\n * If a number, it sets the number of columns the grid item uses.\n * It can't be greater than the total number of columns of the container (12 by default).\n * If 'auto', the grid item's width matches its content.\n * If false, the prop is ignored.\n * If true, the grid item's width grows to use the space available in the grid container.\n * The value is applied for the `xl` breakpoint and wider screens if not overridden.\n * @default false\n */\n xl: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),\n /**\n * If a number, it sets the margin-left equals to the number of columns the grid item uses.\n * If 'auto', the grid item push itself to the right-end of the container.\n * The value is applied for the `xl` breakpoint and wider screens if not overridden.\n */\n xlOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),\n /**\n * If a number, it sets the number of columns the grid item uses.\n * It can't be greater than the total number of columns of the container (12 by default).\n * If 'auto', the grid item's width matches its content.\n * If false, the prop is ignored.\n * If true, the grid item's width grows to use the space available in the grid container.\n * The value is applied for all the screen sizes with the lowest priority.\n * @default false\n */\n xs: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),\n /**\n * If a number, it sets the margin-left equals to the number of columns the grid item uses.\n * If 'auto', the grid item push itself to the right-end of the container.\n * The value is applied for the `xs` breakpoint and wider screens if not overridden.\n */\n xsOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number])\n} : void 0;\nvar _default = exports.default = Grid;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nexports.getGridUtilityClass = getGridUtilityClass;\nvar _utils = require(\"@mui/utils\");\nfunction getGridUtilityClass(slot) {\n return (0, _utils.unstable_generateUtilityClass)('MuiGrid', slot);\n}\nconst SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\nconst DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];\nconst WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];\nconst GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\nconst gridClasses = (0, _utils.unstable_generateUtilityClasses)('MuiGrid', ['root', 'container', 'item',\n// spacings\n...SPACINGS.map(spacing => `spacing-xs-${spacing}`),\n// direction values\n...DIRECTIONS.map(direction => `direction-xs-${direction}`),\n// wrap values\n...WRAPS.map(wrap => `wrap-xs-${wrap}`),\n// grid sizes for all breakpoints\n...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);\nvar _default = exports.default = gridClasses;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n createGrid: true,\n gridClasses: true,\n unstable_traverseBreakpoints: true\n};\nObject.defineProperty(exports, \"createGrid\", {\n enumerable: true,\n get: function () {\n return _createGrid.default;\n }\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _Grid.default;\n }\n});\nObject.defineProperty(exports, \"gridClasses\", {\n enumerable: true,\n get: function () {\n return _gridClasses.default;\n }\n});\nObject.defineProperty(exports, \"unstable_traverseBreakpoints\", {\n enumerable: true,\n get: function () {\n return _traverseBreakpoints.traverseBreakpoints;\n }\n});\nvar _Grid = _interopRequireDefault(require(\"./Grid\"));\nvar _createGrid = _interopRequireDefault(require(\"./createGrid\"));\nvar _GridProps = require(\"./GridProps\");\nObject.keys(_GridProps).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _GridProps[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _GridProps[key];\n }\n });\n});\nvar _gridClasses = _interopRequireWildcard(require(\"./gridClasses\"));\nObject.keys(_gridClasses).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _gridClasses[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _gridClasses[key];\n }\n });\n});\nvar _traverseBreakpoints = require(\"./traverseBreakpoints\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createStack;\nexports.style = void 0;\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _clsx = _interopRequireDefault(require(\"clsx\"));\nvar _utils = require(\"@mui/utils\");\nvar _styled = _interopRequireDefault(require(\"../styled\"));\nvar _useThemeProps = _interopRequireDefault(require(\"../useThemeProps\"));\nvar _styleFunctionSx = require(\"../styleFunctionSx\");\nvar _createTheme = _interopRequireDefault(require(\"../createTheme\"));\nvar _breakpoints = require(\"../breakpoints\");\nvar _spacing = require(\"../spacing\");\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nconst _excluded = [\"component\", \"direction\", \"spacing\", \"divider\", \"children\", \"className\", \"useFlexGap\"];\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst defaultTheme = (0, _createTheme.default)();\n// widening Theme to any so that the consumer can own the theme structure.\nconst defaultCreateStyledComponent = (0, _styled.default)('div', {\n name: 'MuiStack',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n});\nfunction useThemePropsDefault(props) {\n return (0, _useThemeProps.default)({\n props,\n name: 'MuiStack',\n defaultTheme\n });\n}\n\n/**\n * Return an array with the separator React element interspersed between\n * each React node of the input children.\n *\n * > joinChildren([1,2,3], 0)\n * [1,0,2,0,3]\n */\nfunction joinChildren(children, separator) {\n const childrenArray = React.Children.toArray(children).filter(Boolean);\n return childrenArray.reduce((output, child, index) => {\n output.push(child);\n if (index < childrenArray.length - 1) {\n output.push( /*#__PURE__*/React.cloneElement(separator, {\n key: `separator-${index}`\n }));\n }\n return output;\n }, []);\n}\nconst getSideFromDirection = direction => {\n return {\n row: 'Left',\n 'row-reverse': 'Right',\n column: 'Top',\n 'column-reverse': 'Bottom'\n }[direction];\n};\nconst style = ({\n ownerState,\n theme\n}) => {\n let styles = (0, _extends2.default)({\n display: 'flex',\n flexDirection: 'column'\n }, (0, _breakpoints.handleBreakpoints)({\n theme\n }, (0, _breakpoints.resolveBreakpointValues)({\n values: ownerState.direction,\n breakpoints: theme.breakpoints.values\n }), propValue => ({\n flexDirection: propValue\n })));\n if (ownerState.spacing) {\n const transformer = (0, _spacing.createUnarySpacing)(theme);\n const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {\n if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {\n acc[breakpoint] = true;\n }\n return acc;\n }, {});\n const directionValues = (0, _breakpoints.resolveBreakpointValues)({\n values: ownerState.direction,\n base\n });\n const spacingValues = (0, _breakpoints.resolveBreakpointValues)({\n values: ownerState.spacing,\n base\n });\n if (typeof directionValues === 'object') {\n Object.keys(directionValues).forEach((breakpoint, index, breakpoints) => {\n const directionValue = directionValues[breakpoint];\n if (!directionValue) {\n const previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column';\n directionValues[breakpoint] = previousDirectionValue;\n }\n });\n }\n const styleFromPropValue = (propValue, breakpoint) => {\n if (ownerState.useFlexGap) {\n return {\n gap: (0, _spacing.getValue)(transformer, propValue)\n };\n }\n return {\n // The useFlexGap={false} implement relies on each child to give up control of the margin.\n // We need to reset the margin to avoid double spacing.\n '& > :not(style):not(style)': {\n margin: 0\n },\n '& > :not(style) ~ :not(style)': {\n [`margin${getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)}`]: (0, _spacing.getValue)(transformer, propValue)\n }\n };\n };\n styles = (0, _utils.deepmerge)(styles, (0, _breakpoints.handleBreakpoints)({\n theme\n }, spacingValues, styleFromPropValue));\n }\n styles = (0, _breakpoints.mergeBreakpointsInOrder)(theme.breakpoints, styles);\n return styles;\n};\nexports.style = style;\nfunction createStack(options = {}) {\n const {\n // This will allow adding custom styled fn (for example for custom sx style function)\n createStyledComponent = defaultCreateStyledComponent,\n useThemeProps = useThemePropsDefault,\n componentName = 'MuiStack'\n } = options;\n const useUtilityClasses = () => {\n const slots = {\n root: ['root']\n };\n return (0, _utils.unstable_composeClasses)(slots, slot => (0, _utils.unstable_generateUtilityClass)(componentName, slot), {});\n };\n const StackRoot = createStyledComponent(style);\n const Stack = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {\n const themeProps = useThemeProps(inProps);\n const props = (0, _styleFunctionSx.extendSxProp)(themeProps); // `color` type conflicts with html color attribute.\n const {\n component = 'div',\n direction = 'column',\n spacing = 0,\n divider,\n children,\n className,\n useFlexGap = false\n } = props,\n other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);\n const ownerState = {\n direction,\n spacing,\n useFlexGap\n };\n const classes = useUtilityClasses();\n return /*#__PURE__*/(0, _jsxRuntime.jsx)(StackRoot, (0, _extends2.default)({\n as: component,\n ownerState: ownerState,\n ref: ref,\n className: (0, _clsx.default)(classes.root, className)\n }, other, {\n children: divider ? joinChildren(children, divider) : children\n }));\n });\n process.env.NODE_ENV !== \"production\" ? Stack.propTypes /* remove-proptypes */ = {\n children: _propTypes.default.node,\n direction: _propTypes.default.oneOfType([_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), _propTypes.default.object]),\n divider: _propTypes.default.node,\n spacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),\n sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])\n } : void 0;\n return Stack;\n}", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _createStack = _interopRequireDefault(require(\"./createStack\"));\n/**\n *\n * Demos:\n *\n * - [Stack (Joy UI)](https://mui.com/joy-ui/react-stack/)\n * - [Stack (Material UI)](https://mui.com/material-ui/react-stack/)\n * - [Stack (MUI System)](https://mui.com/system/react-stack/)\n *\n * API:\n *\n * - [Stack API](https://mui.com/system/api/stack/)\n */\nconst Stack = (0, _createStack.default)();\nprocess.env.NODE_ENV !== \"production\" ? Stack.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the TypeScript types and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * The content of the component.\n */\n children: _propTypes.default.node,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: _propTypes.default.elementType,\n /**\n * Defines the `flex-direction` style property.\n * It is applied for all screen sizes.\n * @default 'column'\n */\n direction: _propTypes.default.oneOfType([_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), _propTypes.default.object]),\n /**\n * Add an element between each child.\n */\n divider: _propTypes.default.node,\n /**\n * Defines the space between immediate children.\n * @default 0\n */\n spacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),\n /**\n * The system prop, which allows defining system overrides as well as additional CSS styles.\n */\n sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),\n /**\n * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.\n *\n * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),\n * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.\n *\n * To enable this flag globally, follow the theme's default props configuration.\n * @default false\n */\n useFlexGap: _propTypes.default.bool\n} : void 0;\nvar _default = exports.default = Stack;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nexports.getStackUtilityClass = getStackUtilityClass;\nvar _utils = require(\"@mui/utils\");\nfunction getStackUtilityClass(slot) {\n return (0, _utils.unstable_generateUtilityClass)('MuiStack', slot);\n}\nconst stackClasses = (0, _utils.unstable_generateUtilityClasses)('MuiStack', ['root']);\nvar _default = exports.default = stackClasses;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n createStack: true,\n stackClasses: true\n};\nObject.defineProperty(exports, \"createStack\", {\n enumerable: true,\n get: function () {\n return _createStack.default;\n }\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _Stack.default;\n }\n});\nObject.defineProperty(exports, \"stackClasses\", {\n enumerable: true,\n get: function () {\n return _stackClasses.default;\n }\n});\nvar _Stack = _interopRequireDefault(require(\"./Stack\"));\nvar _createStack = _interopRequireDefault(require(\"./createStack\"));\nvar _StackProps = require(\"./StackProps\");\nObject.keys(_StackProps).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _StackProps[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _StackProps[key];\n }\n });\n});\nvar _stackClasses = _interopRequireWildcard(require(\"./stackClasses\"));\nObject.keys(_stackClasses).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _stackClasses[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _stackClasses[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "/**\n * @mui/system v5.15.9\n *\n * @license MIT\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n experimental_sx: true,\n css: true,\n keyframes: true,\n StyledEngineProvider: true,\n GlobalStyles: true,\n borders: true,\n breakpoints: true,\n handleBreakpoints: true,\n mergeBreakpointsInOrder: true,\n unstable_resolveBreakpointValues: true,\n compose: true,\n display: true,\n flexbox: true,\n grid: true,\n palette: true,\n positions: true,\n shadows: true,\n sizing: true,\n spacing: true,\n style: true,\n getPath: true,\n getStyleValue: true,\n typography: true,\n unstable_styleFunctionSx: true,\n unstable_createStyleFunctionSx: true,\n unstable_extendSxProp: true,\n unstable_defaultSxConfig: true,\n unstable_getThemeValue: true,\n Box: true,\n createBox: true,\n createStyled: true,\n styled: true,\n createTheme: true,\n createBreakpoints: true,\n createSpacing: true,\n shape: true,\n useThemeProps: true,\n getThemeProps: true,\n useTheme: true,\n useThemeWithoutDefault: true,\n ThemeProvider: true,\n unstable_createCssVarsProvider: true,\n unstable_createGetCssVar: true,\n unstable_cssVarsParser: true,\n unstable_prepareCssVars: true,\n unstable_createCssVarsTheme: true,\n responsivePropType: true,\n createContainer: true,\n Container: true,\n Unstable_Grid: true,\n Stack: true\n};\nObject.defineProperty(exports, \"Box\", {\n enumerable: true,\n get: function () {\n return _Box.default;\n }\n});\nObject.defineProperty(exports, \"Container\", {\n enumerable: true,\n get: function () {\n return _Container.default;\n }\n});\nObject.defineProperty(exports, \"GlobalStyles\", {\n enumerable: true,\n get: function () {\n return _GlobalStyles.default;\n }\n});\nObject.defineProperty(exports, \"Stack\", {\n enumerable: true,\n get: function () {\n return _Stack.default;\n }\n});\nObject.defineProperty(exports, \"StyledEngineProvider\", {\n enumerable: true,\n get: function () {\n return _styledEngine.StyledEngineProvider;\n }\n});\nObject.defineProperty(exports, \"ThemeProvider\", {\n enumerable: true,\n get: function () {\n return _ThemeProvider.default;\n }\n});\nObject.defineProperty(exports, \"Unstable_Grid\", {\n enumerable: true,\n get: function () {\n return _Grid.default;\n }\n});\nObject.defineProperty(exports, \"borders\", {\n enumerable: true,\n get: function () {\n return _borders.default;\n }\n});\nObject.defineProperty(exports, \"breakpoints\", {\n enumerable: true,\n get: function () {\n return _breakpoints.default;\n }\n});\nObject.defineProperty(exports, \"compose\", {\n enumerable: true,\n get: function () {\n return _compose.default;\n }\n});\nObject.defineProperty(exports, \"createBox\", {\n enumerable: true,\n get: function () {\n return _createBox.default;\n }\n});\nObject.defineProperty(exports, \"createBreakpoints\", {\n enumerable: true,\n get: function () {\n return _createBreakpoints.default;\n }\n});\nObject.defineProperty(exports, \"createContainer\", {\n enumerable: true,\n get: function () {\n return _createContainer.default;\n }\n});\nObject.defineProperty(exports, \"createSpacing\", {\n enumerable: true,\n get: function () {\n return _createSpacing.default;\n }\n});\nObject.defineProperty(exports, \"createStyled\", {\n enumerable: true,\n get: function () {\n return _createStyled.default;\n }\n});\nObject.defineProperty(exports, \"createTheme\", {\n enumerable: true,\n get: function () {\n return _createTheme.default;\n }\n});\nObject.defineProperty(exports, \"css\", {\n enumerable: true,\n get: function () {\n return _styledEngine.css;\n }\n});\nObject.defineProperty(exports, \"display\", {\n enumerable: true,\n get: function () {\n return _display.default;\n }\n});\nexports.experimental_sx = experimental_sx;\nObject.defineProperty(exports, \"flexbox\", {\n enumerable: true,\n get: function () {\n return _flexbox.default;\n }\n});\nObject.defineProperty(exports, \"getPath\", {\n enumerable: true,\n get: function () {\n return _style.getPath;\n }\n});\nObject.defineProperty(exports, \"getStyleValue\", {\n enumerable: true,\n get: function () {\n return _style.getStyleValue;\n }\n});\nObject.defineProperty(exports, \"getThemeProps\", {\n enumerable: true,\n get: function () {\n return _useThemeProps.getThemeProps;\n }\n});\nObject.defineProperty(exports, \"grid\", {\n enumerable: true,\n get: function () {\n return _cssGrid.default;\n }\n});\nObject.defineProperty(exports, \"handleBreakpoints\", {\n enumerable: true,\n get: function () {\n return _breakpoints.handleBreakpoints;\n }\n});\nObject.defineProperty(exports, \"keyframes\", {\n enumerable: true,\n get: function () {\n return _styledEngine.keyframes;\n }\n});\nObject.defineProperty(exports, \"mergeBreakpointsInOrder\", {\n enumerable: true,\n get: function () {\n return _breakpoints.mergeBreakpointsInOrder;\n }\n});\nObject.defineProperty(exports, \"palette\", {\n enumerable: true,\n get: function () {\n return _palette.default;\n }\n});\nObject.defineProperty(exports, \"positions\", {\n enumerable: true,\n get: function () {\n return _positions.default;\n }\n});\nObject.defineProperty(exports, \"responsivePropType\", {\n enumerable: true,\n get: function () {\n return _responsivePropType.default;\n }\n});\nObject.defineProperty(exports, \"shadows\", {\n enumerable: true,\n get: function () {\n return _shadows.default;\n }\n});\nObject.defineProperty(exports, \"shape\", {\n enumerable: true,\n get: function () {\n return _shape.default;\n }\n});\nObject.defineProperty(exports, \"sizing\", {\n enumerable: true,\n get: function () {\n return _sizing.default;\n }\n});\nObject.defineProperty(exports, \"spacing\", {\n enumerable: true,\n get: function () {\n return _spacing.default;\n }\n});\nObject.defineProperty(exports, \"style\", {\n enumerable: true,\n get: function () {\n return _style.default;\n }\n});\nObject.defineProperty(exports, \"styled\", {\n enumerable: true,\n get: function () {\n return _styled.default;\n }\n});\nObject.defineProperty(exports, \"typography\", {\n enumerable: true,\n get: function () {\n return _typography.default;\n }\n});\nObject.defineProperty(exports, \"unstable_createCssVarsProvider\", {\n enumerable: true,\n get: function () {\n return _createCssVarsProvider.default;\n }\n});\nObject.defineProperty(exports, \"unstable_createCssVarsTheme\", {\n enumerable: true,\n get: function () {\n return _createCssVarsTheme.default;\n }\n});\nObject.defineProperty(exports, \"unstable_createGetCssVar\", {\n enumerable: true,\n get: function () {\n return _createGetCssVar.default;\n }\n});\nObject.defineProperty(exports, \"unstable_createStyleFunctionSx\", {\n enumerable: true,\n get: function () {\n return _styleFunctionSx.unstable_createStyleFunctionSx;\n }\n});\nObject.defineProperty(exports, \"unstable_cssVarsParser\", {\n enumerable: true,\n get: function () {\n return _cssVarsParser.default;\n }\n});\nObject.defineProperty(exports, \"unstable_defaultSxConfig\", {\n enumerable: true,\n get: function () {\n return _styleFunctionSx.unstable_defaultSxConfig;\n }\n});\nObject.defineProperty(exports, \"unstable_extendSxProp\", {\n enumerable: true,\n get: function () {\n return _styleFunctionSx.extendSxProp;\n }\n});\nObject.defineProperty(exports, \"unstable_getThemeValue\", {\n enumerable: true,\n get: function () {\n return _getThemeValue.default;\n }\n});\nObject.defineProperty(exports, \"unstable_prepareCssVars\", {\n enumerable: true,\n get: function () {\n return _prepareCssVars.default;\n }\n});\nObject.defineProperty(exports, \"unstable_resolveBreakpointValues\", {\n enumerable: true,\n get: function () {\n return _breakpoints.resolveBreakpointValues;\n }\n});\nObject.defineProperty(exports, \"unstable_styleFunctionSx\", {\n enumerable: true,\n get: function () {\n return _styleFunctionSx.default;\n }\n});\nObject.defineProperty(exports, \"useTheme\", {\n enumerable: true,\n get: function () {\n return _useTheme.default;\n }\n});\nObject.defineProperty(exports, \"useThemeProps\", {\n enumerable: true,\n get: function () {\n return _useThemeProps.default;\n }\n});\nObject.defineProperty(exports, \"useThemeWithoutDefault\", {\n enumerable: true,\n get: function () {\n return _useThemeWithoutDefault.default;\n }\n});\nvar _formatMuiErrorMessage2 = _interopRequireDefault(require(\"@mui/utils/formatMuiErrorMessage\"));\nvar _styledEngine = require(\"@mui/styled-engine\");\nvar _GlobalStyles = _interopRequireDefault(require(\"./GlobalStyles\"));\nvar _borders = _interopRequireWildcard(require(\"./borders\"));\nObject.keys(_borders).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _borders[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _borders[key];\n }\n });\n});\nvar _breakpoints = _interopRequireWildcard(require(\"./breakpoints\"));\nvar _compose = _interopRequireDefault(require(\"./compose\"));\nvar _display = _interopRequireDefault(require(\"./display\"));\nvar _flexbox = _interopRequireWildcard(require(\"./flexbox\"));\nObject.keys(_flexbox).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _flexbox[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _flexbox[key];\n }\n });\n});\nvar _cssGrid = _interopRequireWildcard(require(\"./cssGrid\"));\nObject.keys(_cssGrid).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _cssGrid[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _cssGrid[key];\n }\n });\n});\nvar _palette = _interopRequireWildcard(require(\"./palette\"));\nObject.keys(_palette).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _palette[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _palette[key];\n }\n });\n});\nvar _positions = _interopRequireWildcard(require(\"./positions\"));\nObject.keys(_positions).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _positions[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _positions[key];\n }\n });\n});\nvar _shadows = _interopRequireDefault(require(\"./shadows\"));\nvar _sizing = _interopRequireWildcard(require(\"./sizing\"));\nObject.keys(_sizing).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _sizing[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _sizing[key];\n }\n });\n});\nvar _spacing = _interopRequireWildcard(require(\"./spacing\"));\nObject.keys(_spacing).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _spacing[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _spacing[key];\n }\n });\n});\nvar _style = _interopRequireWildcard(require(\"./style\"));\nvar _typography = _interopRequireWildcard(require(\"./typography\"));\nObject.keys(_typography).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _typography[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _typography[key];\n }\n });\n});\nvar _styleFunctionSx = _interopRequireWildcard(require(\"./styleFunctionSx\"));\nvar _getThemeValue = _interopRequireDefault(require(\"./getThemeValue\"));\nvar _Box = _interopRequireDefault(require(\"./Box\"));\nvar _createBox = _interopRequireDefault(require(\"./createBox\"));\nvar _createStyled = _interopRequireWildcard(require(\"./createStyled\"));\nObject.keys(_createStyled).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _createStyled[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _createStyled[key];\n }\n });\n});\nvar _styled = _interopRequireDefault(require(\"./styled\"));\nvar _createTheme = _interopRequireDefault(require(\"./createTheme\"));\nvar _createBreakpoints = _interopRequireDefault(require(\"./createTheme/createBreakpoints\"));\nvar _createSpacing = _interopRequireDefault(require(\"./createTheme/createSpacing\"));\nvar _shape = _interopRequireDefault(require(\"./createTheme/shape\"));\nvar _useThemeProps = _interopRequireWildcard(require(\"./useThemeProps\"));\nvar _useTheme = _interopRequireDefault(require(\"./useTheme\"));\nvar _useThemeWithoutDefault = _interopRequireDefault(require(\"./useThemeWithoutDefault\"));\nvar _colorManipulator = require(\"./colorManipulator\");\nObject.keys(_colorManipulator).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _colorManipulator[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _colorManipulator[key];\n }\n });\n});\nvar _ThemeProvider = _interopRequireDefault(require(\"./ThemeProvider\"));\nvar _createCssVarsProvider = _interopRequireDefault(require(\"./cssVars/createCssVarsProvider\"));\nvar _createGetCssVar = _interopRequireDefault(require(\"./cssVars/createGetCssVar\"));\nvar _cssVarsParser = _interopRequireDefault(require(\"./cssVars/cssVarsParser\"));\nvar _prepareCssVars = _interopRequireDefault(require(\"./cssVars/prepareCssVars\"));\nvar _createCssVarsTheme = _interopRequireDefault(require(\"./cssVars/createCssVarsTheme\"));\nvar _responsivePropType = _interopRequireDefault(require(\"./responsivePropType\"));\nvar _createContainer = _interopRequireDefault(require(\"./Container/createContainer\"));\nvar _Container = _interopRequireWildcard(require(\"./Container\"));\nObject.keys(_Container).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _Container[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _Container[key];\n }\n });\n});\nvar _Grid = _interopRequireDefault(require(\"./Unstable_Grid/Grid\"));\nvar _Unstable_Grid = require(\"./Unstable_Grid\");\nObject.keys(_Unstable_Grid).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _Unstable_Grid[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _Unstable_Grid[key];\n }\n });\n});\nvar _Stack = _interopRequireDefault(require(\"./Stack/Stack\"));\nvar _Stack2 = require(\"./Stack\");\nObject.keys(_Stack2).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _Stack2[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _Stack2[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n// TODO: Remove this function in v6\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction experimental_sx() {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The \\`experimental_sx\\` has been moved to \\`theme.unstable_sx\\`.For more details, see https://github.com/mui/material-ui/pull/35150.` : (0, _formatMuiErrorMessage2.default)(20));\n}\n\n/** ----------------- */\n/** Layout components */", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"unstable_composeClasses\", {\n enumerable: true,\n get: function () {\n return _utils.unstable_composeClasses;\n }\n});\nvar _utils = require(\"@mui/utils\");", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"unstable_ClassNameGenerator\", {\n enumerable: true,\n get: function () {\n return _utils.unstable_ClassNameGenerator;\n }\n});\nvar _utils = require(\"@mui/utils\");", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_capitalize;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_createChainedFunction;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createMixins;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nfunction createMixins(breakpoints, mixins) {\n return (0, _extends2.default)({\n toolbar: {\n minHeight: 56,\n [breakpoints.up('xs')]: {\n '@media (orientation: landscape)': {\n minHeight: 48\n }\n },\n [breakpoints.up('sm')]: {\n minHeight: 64\n }\n }\n }, mixins);\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst common = {\n black: '#000',\n white: '#fff'\n};\nvar _default = exports.default = common;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst grey = {\n 50: '#fafafa',\n 100: '#f5f5f5',\n 200: '#eeeeee',\n 300: '#e0e0e0',\n 400: '#bdbdbd',\n 500: '#9e9e9e',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#f5f5f5',\n A200: '#eeeeee',\n A400: '#bdbdbd',\n A700: '#616161'\n};\nvar _default = exports.default = grey;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst purple = {\n 50: '#f3e5f5',\n 100: '#e1bee7',\n 200: '#ce93d8',\n 300: '#ba68c8',\n 400: '#ab47bc',\n 500: '#9c27b0',\n 600: '#8e24aa',\n 700: '#7b1fa2',\n 800: '#6a1b9a',\n 900: '#4a148c',\n A100: '#ea80fc',\n A200: '#e040fb',\n A400: '#d500f9',\n A700: '#aa00ff'\n};\nvar _default = exports.default = purple;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst red = {\n 50: '#ffebee',\n 100: '#ffcdd2',\n 200: '#ef9a9a',\n 300: '#e57373',\n 400: '#ef5350',\n 500: '#f44336',\n 600: '#e53935',\n 700: '#d32f2f',\n 800: '#c62828',\n 900: '#b71c1c',\n A100: '#ff8a80',\n A200: '#ff5252',\n A400: '#ff1744',\n A700: '#d50000'\n};\nvar _default = exports.default = red;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst orange = {\n 50: '#fff3e0',\n 100: '#ffe0b2',\n 200: '#ffcc80',\n 300: '#ffb74d',\n 400: '#ffa726',\n 500: '#ff9800',\n 600: '#fb8c00',\n 700: '#f57c00',\n 800: '#ef6c00',\n 900: '#e65100',\n A100: '#ffd180',\n A200: '#ffab40',\n A400: '#ff9100',\n A700: '#ff6d00'\n};\nvar _default = exports.default = orange;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst blue = {\n 50: '#e3f2fd',\n 100: '#bbdefb',\n 200: '#90caf9',\n 300: '#64b5f6',\n 400: '#42a5f5',\n 500: '#2196f3',\n 600: '#1e88e5',\n 700: '#1976d2',\n 800: '#1565c0',\n 900: '#0d47a1',\n A100: '#82b1ff',\n A200: '#448aff',\n A400: '#2979ff',\n A700: '#2962ff'\n};\nvar _default = exports.default = blue;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst lightBlue = {\n 50: '#e1f5fe',\n 100: '#b3e5fc',\n 200: '#81d4fa',\n 300: '#4fc3f7',\n 400: '#29b6f6',\n 500: '#03a9f4',\n 600: '#039be5',\n 700: '#0288d1',\n 800: '#0277bd',\n 900: '#01579b',\n A100: '#80d8ff',\n A200: '#40c4ff',\n A400: '#00b0ff',\n A700: '#0091ea'\n};\nvar _default = exports.default = lightBlue;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst green = {\n 50: '#e8f5e9',\n 100: '#c8e6c9',\n 200: '#a5d6a7',\n 300: '#81c784',\n 400: '#66bb6a',\n 500: '#4caf50',\n 600: '#43a047',\n 700: '#388e3c',\n 800: '#2e7d32',\n 900: '#1b5e20',\n A100: '#b9f6ca',\n A200: '#69f0ae',\n A400: '#00e676',\n A700: '#00c853'\n};\nvar _default = exports.default = green;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.dark = void 0;\nexports.default = createPalette;\nexports.light = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _formatMuiErrorMessage2 = _interopRequireDefault(require(\"@mui/utils/formatMuiErrorMessage\"));\nvar _utils = require(\"@mui/utils\");\nvar _system = require(\"@mui/system\");\nvar _common = _interopRequireDefault(require(\"../colors/common\"));\nvar _grey = _interopRequireDefault(require(\"../colors/grey\"));\nvar _purple = _interopRequireDefault(require(\"../colors/purple\"));\nvar _red = _interopRequireDefault(require(\"../colors/red\"));\nvar _orange = _interopRequireDefault(require(\"../colors/orange\"));\nvar _blue = _interopRequireDefault(require(\"../colors/blue\"));\nvar _lightBlue = _interopRequireDefault(require(\"../colors/lightBlue\"));\nvar _green = _interopRequireDefault(require(\"../colors/green\"));\nconst _excluded = [\"mode\", \"contrastThreshold\", \"tonalOffset\"];\nconst light = exports.light = {\n // The colors used to style the text.\n text: {\n // The most important text.\n primary: 'rgba(0, 0, 0, 0.87)',\n // Secondary text.\n secondary: 'rgba(0, 0, 0, 0.6)',\n // Disabled text have even lower visual prominence.\n disabled: 'rgba(0, 0, 0, 0.38)'\n },\n // The color used to divide different elements.\n divider: 'rgba(0, 0, 0, 0.12)',\n // The background colors used to style the surfaces.\n // Consistency between these values is important.\n background: {\n paper: _common.default.white,\n default: _common.default.white\n },\n // The colors used to style the action elements.\n action: {\n // The color of an active action like an icon button.\n active: 'rgba(0, 0, 0, 0.54)',\n // The color of an hovered action.\n hover: 'rgba(0, 0, 0, 0.04)',\n hoverOpacity: 0.04,\n // The color of a selected action.\n selected: 'rgba(0, 0, 0, 0.08)',\n selectedOpacity: 0.08,\n // The color of a disabled action.\n disabled: 'rgba(0, 0, 0, 0.26)',\n // The background color of a disabled action.\n disabledBackground: 'rgba(0, 0, 0, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(0, 0, 0, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.12\n }\n};\nconst dark = exports.dark = {\n text: {\n primary: _common.default.white,\n secondary: 'rgba(255, 255, 255, 0.7)',\n disabled: 'rgba(255, 255, 255, 0.5)',\n icon: 'rgba(255, 255, 255, 0.5)'\n },\n divider: 'rgba(255, 255, 255, 0.12)',\n background: {\n paper: '#121212',\n default: '#121212'\n },\n action: {\n active: _common.default.white,\n hover: 'rgba(255, 255, 255, 0.08)',\n hoverOpacity: 0.08,\n selected: 'rgba(255, 255, 255, 0.16)',\n selectedOpacity: 0.16,\n disabled: 'rgba(255, 255, 255, 0.3)',\n disabledBackground: 'rgba(255, 255, 255, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(255, 255, 255, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.24\n }\n};\nfunction addLightOrDark(intent, direction, shade, tonalOffset) {\n const tonalOffsetLight = tonalOffset.light || tonalOffset;\n const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;\n if (!intent[direction]) {\n if (intent.hasOwnProperty(shade)) {\n intent[direction] = intent[shade];\n } else if (direction === 'light') {\n intent.light = (0, _system.lighten)(intent.main, tonalOffsetLight);\n } else if (direction === 'dark') {\n intent.dark = (0, _system.darken)(intent.main, tonalOffsetDark);\n }\n }\n}\nfunction getDefaultPrimary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: _blue.default[200],\n light: _blue.default[50],\n dark: _blue.default[400]\n };\n }\n return {\n main: _blue.default[700],\n light: _blue.default[400],\n dark: _blue.default[800]\n };\n}\nfunction getDefaultSecondary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: _purple.default[200],\n light: _purple.default[50],\n dark: _purple.default[400]\n };\n }\n return {\n main: _purple.default[500],\n light: _purple.default[300],\n dark: _purple.default[700]\n };\n}\nfunction getDefaultError(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: _red.default[500],\n light: _red.default[300],\n dark: _red.default[700]\n };\n }\n return {\n main: _red.default[700],\n light: _red.default[400],\n dark: _red.default[800]\n };\n}\nfunction getDefaultInfo(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: _lightBlue.default[400],\n light: _lightBlue.default[300],\n dark: _lightBlue.default[700]\n };\n }\n return {\n main: _lightBlue.default[700],\n light: _lightBlue.default[500],\n dark: _lightBlue.default[900]\n };\n}\nfunction getDefaultSuccess(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: _green.default[400],\n light: _green.default[300],\n dark: _green.default[700]\n };\n }\n return {\n main: _green.default[800],\n light: _green.default[500],\n dark: _green.default[900]\n };\n}\nfunction getDefaultWarning(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: _orange.default[400],\n light: _orange.default[300],\n dark: _orange.default[700]\n };\n }\n return {\n main: '#ed6c02',\n // closest to orange[800] that pass 3:1.\n light: _orange.default[500],\n dark: _orange.default[900]\n };\n}\nfunction createPalette(palette) {\n const {\n mode = 'light',\n contrastThreshold = 3,\n tonalOffset = 0.2\n } = palette,\n other = (0, _objectWithoutPropertiesLoose2.default)(palette, _excluded);\n const primary = palette.primary || getDefaultPrimary(mode);\n const secondary = palette.secondary || getDefaultSecondary(mode);\n const error = palette.error || getDefaultError(mode);\n const info = palette.info || getDefaultInfo(mode);\n const success = palette.success || getDefaultSuccess(mode);\n const warning = palette.warning || getDefaultWarning(mode);\n\n // Use the same logic as\n // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59\n // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54\n function getContrastText(background) {\n const contrastText = (0, _system.getContrastRatio)(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;\n if (process.env.NODE_ENV !== 'production') {\n const contrast = (0, _system.getContrastRatio)(background, contrastText);\n if (contrast < 3) {\n console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\\n'));\n }\n }\n return contrastText;\n }\n const augmentColor = ({\n color,\n name,\n mainShade = 500,\n lightShade = 300,\n darkShade = 700\n }) => {\n color = (0, _extends2.default)({}, color);\n if (!color.main && color[mainShade]) {\n color.main = color[mainShade];\n }\n if (!color.hasOwnProperty('main')) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\nThe color object needs to have a \\`main\\` property or a \\`${mainShade}\\` property.` : (0, _formatMuiErrorMessage2.default)(11, name ? ` (${name})` : '', mainShade));\n }\n if (typeof color.main !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n\\`color.main\\` should be a string, but \\`${JSON.stringify(color.main)}\\` was provided instead.\n\nDid you intend to use one of the following approaches?\n\nimport { green } from \"@mui/material/colors\";\n\nconst theme1 = createTheme({ palette: {\n primary: green,\n} });\n\nconst theme2 = createTheme({ palette: {\n primary: { main: green[500] },\n} });` : (0, _formatMuiErrorMessage2.default)(12, name ? ` (${name})` : '', JSON.stringify(color.main)));\n }\n addLightOrDark(color, 'light', lightShade, tonalOffset);\n addLightOrDark(color, 'dark', darkShade, tonalOffset);\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n return color;\n };\n const modes = {\n dark,\n light\n };\n if (process.env.NODE_ENV !== 'production') {\n if (!modes[mode]) {\n console.error(`MUI: The palette mode \\`${mode}\\` is not supported.`);\n }\n }\n const paletteOutput = (0, _utils.deepmerge)((0, _extends2.default)({\n // A collection of common colors.\n common: (0, _extends2.default)({}, _common.default),\n // prevent mutable object.\n // The palette mode, can be light or dark.\n mode,\n // The colors used to represent primary interface elements for a user.\n primary: augmentColor({\n color: primary,\n name: 'primary'\n }),\n // The colors used to represent secondary interface elements for a user.\n secondary: augmentColor({\n color: secondary,\n name: 'secondary',\n mainShade: 'A400',\n lightShade: 'A200',\n darkShade: 'A700'\n }),\n // The colors used to represent interface elements that the user should be made aware of.\n error: augmentColor({\n color: error,\n name: 'error'\n }),\n // The colors used to represent potentially dangerous actions or important messages.\n warning: augmentColor({\n color: warning,\n name: 'warning'\n }),\n // The colors used to present information to the user that is neutral and not necessarily important.\n info: augmentColor({\n color: info,\n name: 'info'\n }),\n // The colors used to indicate the successful completion of an action that user triggered.\n success: augmentColor({\n color: success,\n name: 'success'\n }),\n // The grey colors.\n grey: _grey.default,\n // Used by `getContrastText()` to maximize the contrast between\n // the background and the text.\n contrastThreshold,\n // Takes a background color and returns the text color that maximizes the contrast.\n getContrastText,\n // Generate a rich color object.\n augmentColor,\n // Used by the functions below to shift a color's luminance by approximately\n // two indexes within its tonal palette.\n // E.g., shift from Red 500 to Red 300 or Red 700.\n tonalOffset\n }, modes[mode]), other);\n return paletteOutput;\n}", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createTypography;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _utils = require(\"@mui/utils\");\nconst _excluded = [\"fontFamily\", \"fontSize\", \"fontWeightLight\", \"fontWeightRegular\", \"fontWeightMedium\", \"fontWeightBold\", \"htmlFontSize\", \"allVariants\", \"pxToRem\"];\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\nconst caseAllCaps = {\n textTransform: 'uppercase'\n};\nconst defaultFontFamily = '\"Roboto\", \"Helvetica\", \"Arial\", sans-serif';\n\n/**\n * @see @link{https://m2.material.io/design/typography/the-type-system.html}\n * @see @link{https://m2.material.io/design/typography/understanding-typography.html}\n */\nfunction createTypography(palette, typography) {\n const _ref = typeof typography === 'function' ? typography(palette) : typography,\n {\n fontFamily = defaultFontFamily,\n // The default font size of the Material Specification.\n fontSize = 14,\n // px\n fontWeightLight = 300,\n fontWeightRegular = 400,\n fontWeightMedium = 500,\n fontWeightBold = 700,\n // Tell MUI what's the font-size on the html element.\n // 16px is the default font-size used by browsers.\n htmlFontSize = 16,\n // Apply the CSS properties to all the variants.\n allVariants,\n pxToRem: pxToRem2\n } = _ref,\n other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof fontSize !== 'number') {\n console.error('MUI: `fontSize` is required to be a number.');\n }\n if (typeof htmlFontSize !== 'number') {\n console.error('MUI: `htmlFontSize` is required to be a number.');\n }\n }\n const coef = fontSize / 14;\n const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);\n const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => (0, _extends2.default)({\n fontFamily,\n fontWeight,\n fontSize: pxToRem(size),\n // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/\n lineHeight\n }, fontFamily === defaultFontFamily ? {\n letterSpacing: `${round(letterSpacing / size)}em`\n } : {}, casing, allVariants);\n const variants = {\n h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),\n h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),\n h3: buildVariant(fontWeightRegular, 48, 1.167, 0),\n h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),\n h5: buildVariant(fontWeightRegular, 24, 1.334, 0),\n h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),\n subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),\n subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),\n body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),\n body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),\n button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),\n caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),\n overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),\n // TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.\n inherit: {\n fontFamily: 'inherit',\n fontWeight: 'inherit',\n fontSize: 'inherit',\n lineHeight: 'inherit',\n letterSpacing: 'inherit'\n }\n };\n return (0, _utils.deepmerge)((0, _extends2.default)({\n htmlFontSize,\n pxToRem,\n fontFamily,\n fontSize,\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold\n }, variants), other, {\n clone: false // No need to clone deep\n });\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nconst shadowKeyUmbraOpacity = 0.2;\nconst shadowKeyPenumbraOpacity = 0.14;\nconst shadowAmbientShadowOpacity = 0.12;\nfunction createShadow(...px) {\n return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(',');\n}\n\n// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss\nconst shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];\nvar _default = exports.default = shadows;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createTransitions;\nexports.easing = exports.duration = void 0;\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nconst _excluded = [\"duration\", \"easing\", \"delay\"];\n// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves\n// to learn the context in which each easing should be used.\nconst easing = exports.easing = {\n // This is the most common easing curve.\n easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n // Objects enter the screen at full velocity from off-screen and\n // slowly decelerate to a resting point.\n easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',\n // Objects leave the screen at full velocity. They do not decelerate when off-screen.\n easeIn: 'cubic-bezier(0.4, 0, 1, 1)',\n // The sharp curve is used by objects that may return to the screen at any time.\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'\n};\n\n// Follow https://m2.material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\nconst duration = exports.duration = {\n shortest: 150,\n shorter: 200,\n short: 250,\n // most basic recommended timing\n standard: 300,\n // this is to be used in complex animations\n complex: 375,\n // recommended when something is entering screen\n enteringScreen: 225,\n // recommended when something is leaving screen\n leavingScreen: 195\n};\nfunction formatMs(milliseconds) {\n return `${Math.round(milliseconds)}ms`;\n}\nfunction getAutoHeightDuration(height) {\n if (!height) {\n return 0;\n }\n const constant = height / 36;\n\n // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10\n return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);\n}\nfunction createTransitions(inputTransitions) {\n const mergedEasing = (0, _extends2.default)({}, easing, inputTransitions.easing);\n const mergedDuration = (0, _extends2.default)({}, duration, inputTransitions.duration);\n const create = (props = ['all'], options = {}) => {\n const {\n duration: durationOption = mergedDuration.standard,\n easing: easingOption = mergedEasing.easeInOut,\n delay = 0\n } = options,\n other = (0, _objectWithoutPropertiesLoose2.default)(options, _excluded);\n if (process.env.NODE_ENV !== 'production') {\n const isString = value => typeof value === 'string';\n // IE11 support, replace with Number.isNaN\n // eslint-disable-next-line no-restricted-globals\n const isNumber = value => !isNaN(parseFloat(value));\n if (!isString(props) && !Array.isArray(props)) {\n console.error('MUI: Argument \"props\" must be a string or Array.');\n }\n if (!isNumber(durationOption) && !isString(durationOption)) {\n console.error(`MUI: Argument \"duration\" must be a number or a string but found ${durationOption}.`);\n }\n if (!isString(easingOption)) {\n console.error('MUI: Argument \"easing\" must be a string.');\n }\n if (!isNumber(delay) && !isString(delay)) {\n console.error('MUI: Argument \"delay\" must be a number or a string.');\n }\n if (typeof options !== 'object') {\n console.error(['MUI: Secong argument of transition.create must be an object.', \"Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`\"].join('\\n'));\n }\n if (Object.keys(other).length !== 0) {\n console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(',')}].`);\n }\n }\n return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');\n };\n return (0, _extends2.default)({\n getAutoHeightDuration,\n create\n }, inputTransitions, {\n easing: mergedEasing,\n duration: mergedDuration\n });\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n// We need to centralize the zIndex definitions as they work\n// like global values in the browser.\nconst zIndex = {\n mobileStepper: 1000,\n fab: 1050,\n speedDial: 1050,\n appBar: 1100,\n drawer: 1200,\n modal: 1300,\n snackbar: 1400,\n tooltip: 1500\n};\nvar _default = exports.default = zIndex;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createMuiTheme = createMuiTheme;\nexports.default = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _formatMuiErrorMessage2 = _interopRequireDefault(require(\"@mui/utils/formatMuiErrorMessage\"));\nvar _utils = require(\"@mui/utils\");\nvar _system = require(\"@mui/system\");\nvar _generateUtilityClass = _interopRequireDefault(require(\"@mui/utils/generateUtilityClass\"));\nvar _createMixins = _interopRequireDefault(require(\"./createMixins\"));\nvar _createPalette = _interopRequireDefault(require(\"./createPalette\"));\nvar _createTypography = _interopRequireDefault(require(\"./createTypography\"));\nvar _shadows = _interopRequireDefault(require(\"./shadows\"));\nvar _createTransitions = _interopRequireDefault(require(\"./createTransitions\"));\nvar _zIndex = _interopRequireDefault(require(\"./zIndex\"));\nconst _excluded = [\"breakpoints\", \"mixins\", \"spacing\", \"palette\", \"transitions\", \"typography\", \"shape\"];\nfunction createTheme(options = {}, ...args) {\n const {\n mixins: mixinsInput = {},\n palette: paletteInput = {},\n transitions: transitionsInput = {},\n typography: typographyInput = {}\n } = options,\n other = (0, _objectWithoutPropertiesLoose2.default)(options, _excluded);\n if (options.vars) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`vars\\` is a private field used for CSS variables support.\nPlease use another name.` : (0, _formatMuiErrorMessage2.default)(18));\n }\n const palette = (0, _createPalette.default)(paletteInput);\n const systemTheme = (0, _system.createTheme)(options);\n let muiTheme = (0, _utils.deepmerge)(systemTheme, {\n mixins: (0, _createMixins.default)(systemTheme.breakpoints, mixinsInput),\n palette,\n // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.\n shadows: _shadows.default.slice(),\n typography: (0, _createTypography.default)(palette, typographyInput),\n transitions: (0, _createTransitions.default)(transitionsInput),\n zIndex: (0, _extends2.default)({}, _zIndex.default)\n });\n muiTheme = (0, _utils.deepmerge)(muiTheme, other);\n muiTheme = args.reduce((acc, argument) => (0, _utils.deepmerge)(acc, argument), muiTheme);\n if (process.env.NODE_ENV !== 'production') {\n // TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.\n const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];\n const traverse = (node, component) => {\n let key;\n\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\n for (key in node) {\n const child = node[key];\n if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n const stateClass = (0, _generateUtilityClass.default)('', key);\n console.error([`MUI: The \\`${component}\\` component increases ` + `the CSS specificity of the \\`${key}\\` internal state.`, 'You can not override it like this: ', JSON.stringify(node, null, 2), '', `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({\n root: {\n [`&.${stateClass}`]: child\n }\n }, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\\n'));\n }\n // Remove the style to prevent global conflicts.\n node[key] = {};\n }\n }\n };\n Object.keys(muiTheme.components).forEach(component => {\n const styleOverrides = muiTheme.components[component].styleOverrides;\n if (styleOverrides && component.indexOf('Mui') === 0) {\n traverse(styleOverrides, component);\n }\n });\n }\n muiTheme.unstable_sxConfig = (0, _extends2.default)({}, _system.unstable_defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);\n muiTheme.unstable_sx = function sx(props) {\n return (0, _system.unstable_styleFunctionSx)({\n sx: props,\n theme: this\n });\n };\n return muiTheme;\n}\nlet warnedOnce = false;\nfunction createMuiTheme(...args) {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnce) {\n warnedOnce = true;\n console.error(['MUI: the createMuiTheme function was renamed to createTheme.', '', \"You should use `import { createTheme } from '@mui/material/styles'`\"].join('\\n'));\n }\n }\n return createTheme(...args);\n}\nvar _default = exports.default = createTheme;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createTheme = _interopRequireDefault(require(\"./createTheme\"));\nconst defaultTheme = (0, _createTheme.default)();\nvar _default = exports.default = defaultTheme;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = exports.default = '$$material';", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = useThemeProps;\nvar _system = require(\"@mui/system\");\nvar _defaultTheme = _interopRequireDefault(require(\"./defaultTheme\"));\nvar _identifier = _interopRequireDefault(require(\"./identifier\"));\nfunction useThemeProps({\n props,\n name\n}) {\n return (0, _system.useThemeProps)({\n props,\n name,\n defaultTheme: _defaultTheme.default,\n themeId: _identifier.default\n });\n}", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.slotShouldForwardProp = exports.rootShouldForwardProp = exports.default = void 0;\nvar _system = require(\"@mui/system\");\nvar _defaultTheme = _interopRequireDefault(require(\"./defaultTheme\"));\nvar _identifier = _interopRequireDefault(require(\"./identifier\"));\nconst rootShouldForwardProp = prop => (0, _system.shouldForwardProp)(prop) && prop !== 'classes';\nexports.rootShouldForwardProp = rootShouldForwardProp;\nconst slotShouldForwardProp = exports.slotShouldForwardProp = _system.shouldForwardProp;\nconst styled = (0, _system.createStyled)({\n themeId: _identifier.default,\n defaultTheme: _defaultTheme.default,\n rootShouldForwardProp\n});\nvar _default = exports.default = styled;", "\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nexports.getSvgIconUtilityClass = getSvgIconUtilityClass;\nvar _generateUtilityClasses = _interopRequireDefault(require(\"@mui/utils/generateUtilityClasses\"));\nvar _generateUtilityClass = _interopRequireDefault(require(\"@mui/utils/generateUtilityClass\"));\nfunction getSvgIconUtilityClass(slot) {\n return (0, _generateUtilityClass.default)('MuiSvgIcon', slot);\n}\nconst svgIconClasses = (0, _generateUtilityClasses.default)('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);\nvar _default = exports.default = svgIconClasses;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _clsx = _interopRequireDefault(require(\"clsx\"));\nvar _composeClasses = require(\"@mui/base/composeClasses\");\nvar _capitalize = _interopRequireDefault(require(\"../utils/capitalize\"));\nvar _useThemeProps = _interopRequireDefault(require(\"../styles/useThemeProps\"));\nvar _styled = _interopRequireDefault(require(\"../styles/styled\"));\nvar _svgIconClasses = require(\"./svgIconClasses\");\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nconst _excluded = [\"children\", \"className\", \"color\", \"component\", \"fontSize\", \"htmlColor\", \"inheritViewBox\", \"titleAccess\", \"viewBox\"];\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nconst useUtilityClasses = ownerState => {\n const {\n color,\n fontSize,\n classes\n } = ownerState;\n const slots = {\n root: ['root', color !== 'inherit' && `color${(0, _capitalize.default)(color)}`, `fontSize${(0, _capitalize.default)(fontSize)}`]\n };\n return (0, _composeClasses.unstable_composeClasses)(slots, _svgIconClasses.getSvgIconUtilityClass, classes);\n};\nconst SvgIconRoot = (0, _styled.default)('svg', {\n name: 'MuiSvgIcon',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.color !== 'inherit' && styles[`color${(0, _capitalize.default)(ownerState.color)}`], styles[`fontSize${(0, _capitalize.default)(ownerState.fontSize)}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette2, _palette3;\n return {\n userSelect: 'none',\n width: '1em',\n height: '1em',\n display: 'inline-block',\n // the will define the property that has `currentColor`\n // e.g. heroicons uses fill=\"none\" and stroke=\"currentColor\"\n fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',\n flexShrink: 0,\n transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {\n duration: (_theme$transitions2 = theme.transitions) == null || (_theme$transitions2 = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2.shorter\n }),\n fontSize: {\n inherit: 'inherit',\n small: ((_theme$typography = theme.typography) == null || (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',\n medium: ((_theme$typography2 = theme.typography) == null || (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',\n large: ((_theme$typography3 = theme.typography) == null || (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'\n }[ownerState.fontSize],\n // TODO v5 deprecate, v6 remove for sx\n color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null || (_palette = _palette[ownerState.color]) == null ? void 0 : _palette.main) != null ? _palette$ownerState$c : {\n action: (_palette2 = (theme.vars || theme).palette) == null || (_palette2 = _palette2.action) == null ? void 0 : _palette2.active,\n disabled: (_palette3 = (theme.vars || theme).palette) == null || (_palette3 = _palette3.action) == null ? void 0 : _palette3.disabled,\n inherit: undefined\n }[ownerState.color]\n };\n});\nconst SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {\n const props = (0, _useThemeProps.default)({\n props: inProps,\n name: 'MuiSvgIcon'\n });\n const {\n children,\n className,\n color = 'inherit',\n component = 'svg',\n fontSize = 'medium',\n htmlColor,\n inheritViewBox = false,\n titleAccess,\n viewBox = '0 0 24 24'\n } = props,\n other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);\n const hasSvgAsChild = /*#__PURE__*/React.isValidElement(children) && children.type === 'svg';\n const ownerState = (0, _extends2.default)({}, props, {\n color,\n component,\n fontSize,\n instanceFontSize: inProps.fontSize,\n inheritViewBox,\n viewBox,\n hasSvgAsChild\n });\n const more = {};\n if (!inheritViewBox) {\n more.viewBox = viewBox;\n }\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/(0, _jsxRuntime.jsxs)(SvgIconRoot, (0, _extends2.default)({\n as: component,\n className: (0, _clsx.default)(classes.root, className),\n focusable: \"false\",\n color: htmlColor,\n \"aria-hidden\": titleAccess ? undefined : true,\n role: titleAccess ? 'img' : undefined,\n ref: ref\n }, more, other, hasSvgAsChild && children.props, {\n ownerState: ownerState,\n children: [hasSvgAsChild ? children.props.children : children, titleAccess ? /*#__PURE__*/(0, _jsxRuntime.jsx)(\"title\", {\n children: titleAccess\n }) : null]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? SvgIcon.propTypes /* remove-proptypes */ = {\n // \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Warning \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n // \u2502 These PropTypes are generated from the TypeScript type definitions. \u2502\n // \u2502 To update them, edit the d.ts file and run `pnpm proptypes`. \u2502\n // \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n /**\n * Node passed into the SVG element.\n */\n children: _propTypes.default.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: _propTypes.default.object,\n /**\n * @ignore\n */\n className: _propTypes.default.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n * You can use the `htmlColor` prop to apply a color attribute to the SVG element.\n * @default 'inherit'\n */\n color: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['inherit', 'action', 'disabled', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), _propTypes.default.string]),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: _propTypes.default.elementType,\n /**\n * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.\n * @default 'medium'\n */\n fontSize: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['inherit', 'large', 'medium', 'small']), _propTypes.default.string]),\n /**\n * Applies a color attribute to the SVG element.\n */\n htmlColor: _propTypes.default.string,\n /**\n * If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`\n * prop will be ignored.\n * Useful when you want to reference a custom `component` and have `SvgIcon` pass that\n * `component`'s viewBox to the root node.\n * @default false\n */\n inheritViewBox: _propTypes.default.bool,\n /**\n * The shape-rendering attribute. The behavior of the different options is described on the\n * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).\n * If you are having issues with blurry icons you should investigate this prop.\n */\n shapeRendering: _propTypes.default.string,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),\n /**\n * Provides a human-readable title for the element that contains it.\n * https://www.w3.org/TR/SVG-access/#Equivalent\n */\n titleAccess: _propTypes.default.string,\n /**\n * Allows you to redefine what the coordinates without units mean inside an SVG element.\n * For example, if the SVG element is 500 (width) by 200 (height),\n * and you pass viewBox=\"0 0 50 20\",\n * this means that the coordinates inside the SVG will go from the top left corner (0,0)\n * to bottom right (50,20) and each unit will be worth 10px.\n * @default '0 0 24 24'\n */\n viewBox: _propTypes.default.string\n} : void 0;\nSvgIcon.muiName = 'SvgIcon';\nvar _default = exports.default = SvgIcon;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n svgIconClasses: true\n};\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _SvgIcon.default;\n }\n});\nObject.defineProperty(exports, \"svgIconClasses\", {\n enumerable: true,\n get: function () {\n return _svgIconClasses.default;\n }\n});\nvar _SvgIcon = _interopRequireDefault(require(\"./SvgIcon\"));\nvar _svgIconClasses = _interopRequireWildcard(require(\"./svgIconClasses\"));\nObject.keys(_svgIconClasses).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n if (key in exports && exports[key] === _svgIconClasses[key]) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function () {\n return _svgIconClasses[key];\n }\n });\n});\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createSvgIcon;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _SvgIcon = _interopRequireDefault(require(\"../SvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n/**\n * Private module reserved for @mui packages.\n */function createSvgIcon(path, displayName) {\n function Component(props, ref) {\n return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SvgIcon.default, (0, _extends2.default)({\n \"data-testid\": `${displayName}Icon`,\n ref: ref\n }, props, {\n children: path\n }));\n }\n if (process.env.NODE_ENV !== 'production') {\n // Need to set `displayName` on the inner component for React.memo.\n // React prior to 16.14 ignores `displayName` on the wrapper.\n Component.displayName = `${displayName}Icon`;\n }\n Component.muiName = _SvgIcon.default.muiName;\n return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));\n}", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_debounce;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_deprecatedPropType;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_isMuiElement;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_ownerDocument;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_ownerWindow;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_requirePropFactory;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_setRef;", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_useEnhancedEffect;", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_useId;", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_unsupportedProp;", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_useControlled;", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_useEventCallback;", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_useForkRef;", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _utils = require(\"@mui/utils\");\nvar _default = exports.default = _utils.unstable_useIsFocusVisible;", "\"use strict\";\n'use client';\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"capitalize\", {\n enumerable: true,\n get: function () {\n return _capitalize.default;\n }\n});\nObject.defineProperty(exports, \"createChainedFunction\", {\n enumerable: true,\n get: function () {\n return _createChainedFunction.default;\n }\n});\nObject.defineProperty(exports, \"createSvgIcon\", {\n enumerable: true,\n get: function () {\n return _createSvgIcon.default;\n }\n});\nObject.defineProperty(exports, \"debounce\", {\n enumerable: true,\n get: function () {\n return _debounce.default;\n }\n});\nObject.defineProperty(exports, \"deprecatedPropType\", {\n enumerable: true,\n get: function () {\n return _deprecatedPropType.default;\n }\n});\nObject.defineProperty(exports, \"isMuiElement\", {\n enumerable: true,\n get: function () {\n return _isMuiElement.default;\n }\n});\nObject.defineProperty(exports, \"ownerDocument\", {\n enumerable: true,\n get: function () {\n return _ownerDocument.default;\n }\n});\nObject.defineProperty(exports, \"ownerWindow\", {\n enumerable: true,\n get: function () {\n return _ownerWindow.default;\n }\n});\nObject.defineProperty(exports, \"requirePropFactory\", {\n enumerable: true,\n get: function () {\n return _requirePropFactory.default;\n }\n});\nObject.defineProperty(exports, \"setRef\", {\n enumerable: true,\n get: function () {\n return _setRef.default;\n }\n});\nexports.unstable_ClassNameGenerator = void 0;\nObject.defineProperty(exports, \"unstable_useEnhancedEffect\", {\n enumerable: true,\n get: function () {\n return _useEnhancedEffect.default;\n }\n});\nObject.defineProperty(exports, \"unstable_useId\", {\n enumerable: true,\n get: function () {\n return _useId.default;\n }\n});\nObject.defineProperty(exports, \"unsupportedProp\", {\n enumerable: true,\n get: function () {\n return _unsupportedProp.default;\n }\n});\nObject.defineProperty(exports, \"useControlled\", {\n enumerable: true,\n get: function () {\n return _useControlled.default;\n }\n});\nObject.defineProperty(exports, \"useEventCallback\", {\n enumerable: true,\n get: function () {\n return _useEventCallback.default;\n }\n});\nObject.defineProperty(exports, \"useForkRef\", {\n enumerable: true,\n get: function () {\n return _useForkRef.default;\n }\n});\nObject.defineProperty(exports, \"useIsFocusVisible\", {\n enumerable: true,\n get: function () {\n return _useIsFocusVisible.default;\n }\n});\nvar _ClassNameGenerator = require(\"@mui/base/ClassNameGenerator\");\nvar _capitalize = _interopRequireDefault(require(\"./capitalize\"));\nvar _createChainedFunction = _interopRequireDefault(require(\"./createChainedFunction\"));\nvar _createSvgIcon = _interopRequireDefault(require(\"./createSvgIcon\"));\nvar _debounce = _interopRequireDefault(require(\"./debounce\"));\nvar _deprecatedPropType = _interopRequireDefault(require(\"./deprecatedPropType\"));\nvar _isMuiElement = _interopRequireDefault(require(\"./isMuiElement\"));\nvar _ownerDocument = _interopRequireDefault(require(\"./ownerDocument\"));\nvar _ownerWindow = _interopRequireDefault(require(\"./ownerWindow\"));\nvar _requirePropFactory = _interopRequireDefault(require(\"./requirePropFactory\"));\nvar _setRef = _interopRequireDefault(require(\"./setRef\"));\nvar _useEnhancedEffect = _interopRequireDefault(require(\"./useEnhancedEffect\"));\nvar _useId = _interopRequireDefault(require(\"./useId\"));\nvar _unsupportedProp = _interopRequireDefault(require(\"./unsupportedProp\"));\nvar _useControlled = _interopRequireDefault(require(\"./useControlled\"));\nvar _useEventCallback = _interopRequireDefault(require(\"./useEventCallback\"));\nvar _useForkRef = _interopRequireDefault(require(\"./useForkRef\"));\nvar _useIsFocusVisible = _interopRequireDefault(require(\"./useIsFocusVisible\"));\n// TODO: remove this export once ClassNameGenerator is stable\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst unstable_ClassNameGenerator = exports.unstable_ClassNameGenerator = {\n configure: generator => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', \"You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead\", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\\n'));\n }\n _ClassNameGenerator.unstable_ClassNameGenerator.configure(generator);\n }\n};", "\"use strict\";\n'use client';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _utils.createSvgIcon;\n }\n});\nvar _utils = require(\"@mui/material/utils\");", "\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M8 5v14l11-7z\"\n}), 'PlayArrow');", "\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92\"\n}), 'Share');", "\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1\"\n}), 'DarkMode');", "\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z\"\n}), 'LightMode');", "\"use strict\";\n\"use client\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = exports.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2\"\n}), 'QuestionMark');", "/**\n * Returns the last element of an array.\n * @param array The array.\n * @param n Which element from the end (default is zero).\n */\nexport function tail(array, n = 0) {\n return array[array.length - (1 + n)];\n}\nexport function tail2(arr) {\n if (arr.length === 0) {\n throw new Error('Invalid tail call');\n }\n return [arr.slice(0, arr.length - 1), arr[arr.length - 1]];\n}\nexport function equals(one, other, itemEquals = (a, b) => a === b) {\n if (one === other) {\n return true;\n }\n if (!one || !other) {\n return false;\n }\n if (one.length !== other.length) {\n return false;\n }\n for (let i = 0, len = one.length; i < len; i++) {\n if (!itemEquals(one[i], other[i])) {\n return false;\n }\n }\n return true;\n}\n/**\n * Remove the element at `index` by replacing it with the last element. This is faster than `splice`\n * but changes the order of the array\n */\nexport function removeFastWithoutKeepingOrder(array, index) {\n const last = array.length - 1;\n if (index < last) {\n array[index] = array[last];\n }\n array.pop();\n}\n/**\n * Performs a binary search algorithm over a sorted array.\n *\n * @param array The array being searched.\n * @param key The value we search for.\n * @param comparator A function that takes two array elements and returns zero\n * if they are equal, a negative number if the first element precedes the\n * second one in the sorting order, or a positive number if the second element\n * precedes the first one.\n * @return See {@link binarySearch2}\n */\nexport function binarySearch(array, key, comparator) {\n return binarySearch2(array.length, i => comparator(array[i], key));\n}\n/**\n * Performs a binary search algorithm over a sorted collection. Useful for cases\n * when we need to perform a binary search over something that isn't actually an\n * array, and converting data to an array would defeat the use of binary search\n * in the first place.\n *\n * @param length The collection length.\n * @param compareToKey A function that takes an index of an element in the\n * collection and returns zero if the value at this index is equal to the\n * search key, a negative number if the value precedes the search key in the\n * sorting order, or a positive number if the search key precedes the value.\n * @return A non-negative index of an element, if found. If not found, the\n * result is -(n+1) (or ~n, using bitwise notation), where n is the index\n * where the key should be inserted to maintain the sorting order.\n */\nexport function binarySearch2(length, compareToKey) {\n let low = 0, high = length - 1;\n while (low <= high) {\n const mid = ((low + high) / 2) | 0;\n const comp = compareToKey(mid);\n if (comp < 0) {\n low = mid + 1;\n }\n else if (comp > 0) {\n high = mid - 1;\n }\n else {\n return mid;\n }\n }\n return -(low + 1);\n}\nexport function quickSelect(nth, data, compare) {\n nth = nth | 0;\n if (nth >= data.length) {\n throw new TypeError('invalid index');\n }\n const pivotValue = data[Math.floor(data.length * Math.random())];\n const lower = [];\n const higher = [];\n const pivots = [];\n for (const value of data) {\n const val = compare(value, pivotValue);\n if (val < 0) {\n lower.push(value);\n }\n else if (val > 0) {\n higher.push(value);\n }\n else {\n pivots.push(value);\n }\n }\n if (nth < lower.length) {\n return quickSelect(nth, lower, compare);\n }\n else if (nth < lower.length + pivots.length) {\n return pivots[0];\n }\n else {\n return quickSelect(nth - (lower.length + pivots.length), higher, compare);\n }\n}\nexport function groupBy(data, compare) {\n const result = [];\n let currentGroup = undefined;\n for (const element of data.slice(0).sort(compare)) {\n if (!currentGroup || compare(currentGroup[0], element) !== 0) {\n currentGroup = [element];\n result.push(currentGroup);\n }\n else {\n currentGroup.push(element);\n }\n }\n return result;\n}\n/**\n * Splits the given items into a list of (non-empty) groups.\n * `shouldBeGrouped` is used to decide if two consecutive items should be in the same group.\n * The order of the items is preserved.\n */\nexport function* groupAdjacentBy(items, shouldBeGrouped) {\n let currentGroup;\n let last;\n for (const item of items) {\n if (last !== undefined && shouldBeGrouped(last, item)) {\n currentGroup.push(item);\n }\n else {\n if (currentGroup) {\n yield currentGroup;\n }\n currentGroup = [item];\n }\n last = item;\n }\n if (currentGroup) {\n yield currentGroup;\n }\n}\nexport function forEachAdjacent(arr, f) {\n for (let i = 0; i <= arr.length; i++) {\n f(i === 0 ? undefined : arr[i - 1], i === arr.length ? undefined : arr[i]);\n }\n}\nexport function forEachWithNeighbors(arr, f) {\n for (let i = 0; i < arr.length; i++) {\n f(i === 0 ? undefined : arr[i - 1], arr[i], i + 1 === arr.length ? undefined : arr[i + 1]);\n }\n}\n/**\n * @returns New array with all falsy values removed. The original array IS NOT modified.\n */\nexport function coalesce(array) {\n return array.filter(e => !!e);\n}\n/**\n * Remove all falsy values from `array`. The original array IS modified.\n */\nexport function coalesceInPlace(array) {\n let to = 0;\n for (let i = 0; i < array.length; i++) {\n if (!!array[i]) {\n array[to] = array[i];\n to += 1;\n }\n }\n array.length = to;\n}\n/**\n * @returns false if the provided object is an array and not empty.\n */\nexport function isFalsyOrEmpty(obj) {\n return !Array.isArray(obj) || obj.length === 0;\n}\nexport function isNonEmptyArray(obj) {\n return Array.isArray(obj) && obj.length > 0;\n}\n/**\n * Removes duplicates from the given array. The optional keyFn allows to specify\n * how elements are checked for equality by returning an alternate value for each.\n */\nexport function distinct(array, keyFn = value => value) {\n const seen = new Set();\n return array.filter(element => {\n const key = keyFn(element);\n if (seen.has(key)) {\n return false;\n }\n seen.add(key);\n return true;\n });\n}\nexport function firstOrDefault(array, notFoundValue) {\n return array.length > 0 ? array[0] : notFoundValue;\n}\nexport function range(arg, to) {\n let from = typeof to === 'number' ? arg : 0;\n if (typeof to === 'number') {\n from = arg;\n }\n else {\n from = 0;\n to = arg;\n }\n const result = [];\n if (from <= to) {\n for (let i = from; i < to; i++) {\n result.push(i);\n }\n }\n else {\n for (let i = from; i > to; i--) {\n result.push(i);\n }\n }\n return result;\n}\n/**\n * Insert `insertArr` inside `target` at `insertIndex`.\n * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array\n */\nexport function arrayInsert(target, insertIndex, insertArr) {\n const before = target.slice(0, insertIndex);\n const after = target.slice(insertIndex);\n return before.concat(insertArr, after);\n}\n/**\n * Pushes an element to the start of the array, if found.\n */\nexport function pushToStart(arr, value) {\n const index = arr.indexOf(value);\n if (index > -1) {\n arr.splice(index, 1);\n arr.unshift(value);\n }\n}\n/**\n * Pushes an element to the end of the array, if found.\n */\nexport function pushToEnd(arr, value) {\n const index = arr.indexOf(value);\n if (index > -1) {\n arr.splice(index, 1);\n arr.push(value);\n }\n}\nexport function pushMany(arr, items) {\n for (const item of items) {\n arr.push(item);\n }\n}\nexport function asArray(x) {\n return Array.isArray(x) ? x : [x];\n}\n/**\n * Insert the new items in the array.\n * @param array The original array.\n * @param start The zero-based location in the array from which to start inserting elements.\n * @param newItems The items to be inserted\n */\nexport function insertInto(array, start, newItems) {\n const startIdx = getActualStartIndex(array, start);\n const originalLength = array.length;\n const newItemsLength = newItems.length;\n array.length = originalLength + newItemsLength;\n // Move the items after the start index, start from the end so that we don't overwrite any value.\n for (let i = originalLength - 1; i >= startIdx; i--) {\n array[i + newItemsLength] = array[i];\n }\n for (let i = 0; i < newItemsLength; i++) {\n array[i + startIdx] = newItems[i];\n }\n}\n/**\n * Removes elements from an array and inserts new elements in their place, returning the deleted elements. Alternative to the native Array.splice method, it\n * can only support limited number of items due to the maximum call stack size limit.\n * @param array The original array.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n * @returns An array containing the elements that were deleted.\n */\nexport function splice(array, start, deleteCount, newItems) {\n const index = getActualStartIndex(array, start);\n let result = array.splice(index, deleteCount);\n if (result === undefined) {\n // see https://bugs.webkit.org/show_bug.cgi?id=261140\n result = [];\n }\n insertInto(array, index, newItems);\n return result;\n}\n/**\n * Determine the actual start index (same logic as the native splice() or slice())\n * If greater than the length of the array, start will be set to the length of the array. In this case, no element will be deleted but the method will behave as an adding function, adding as many element as item[n*] provided.\n * If negative, it will begin that many elements from the end of the array. (In this case, the origin -1, meaning -n is the index of the nth last element, and is therefore equivalent to the index of array.length - n.) If array.length + start is less than 0, it will begin from index 0.\n * @param array The target array.\n * @param start The operation index.\n */\nfunction getActualStartIndex(array, start) {\n return start < 0 ? Math.max(start + array.length, 0) : Math.min(start, array.length);\n}\nexport var CompareResult;\n(function (CompareResult) {\n function isLessThan(result) {\n return result < 0;\n }\n CompareResult.isLessThan = isLessThan;\n function isLessThanOrEqual(result) {\n return result <= 0;\n }\n CompareResult.isLessThanOrEqual = isLessThanOrEqual;\n function isGreaterThan(result) {\n return result > 0;\n }\n CompareResult.isGreaterThan = isGreaterThan;\n function isNeitherLessOrGreaterThan(result) {\n return result === 0;\n }\n CompareResult.isNeitherLessOrGreaterThan = isNeitherLessOrGreaterThan;\n CompareResult.greaterThan = 1;\n CompareResult.lessThan = -1;\n CompareResult.neitherLessOrGreaterThan = 0;\n})(CompareResult || (CompareResult = {}));\nexport function compareBy(selector, comparator) {\n return (a, b) => comparator(selector(a), selector(b));\n}\nexport function tieBreakComparators(...comparators) {\n return (item1, item2) => {\n for (const comparator of comparators) {\n const result = comparator(item1, item2);\n if (!CompareResult.isNeitherLessOrGreaterThan(result)) {\n return result;\n }\n }\n return CompareResult.neitherLessOrGreaterThan;\n };\n}\n/**\n * The natural order on numbers.\n*/\nexport const numberComparator = (a, b) => a - b;\nexport const booleanComparator = (a, b) => numberComparator(a ? 1 : 0, b ? 1 : 0);\nexport function reverseOrder(comparator) {\n return (a, b) => -comparator(a, b);\n}\nexport class ArrayQueue {\n /**\n * Constructs a queue that is backed by the given array. Runtime is O(1).\n */\n constructor(items) {\n this.items = items;\n this.firstIdx = 0;\n this.lastIdx = this.items.length - 1;\n }\n get length() {\n return this.lastIdx - this.firstIdx + 1;\n }\n /**\n * Consumes elements from the beginning of the queue as long as the predicate returns true.\n * If no elements were consumed, `null` is returned. Has a runtime of O(result.length).\n */\n takeWhile(predicate) {\n // P(k) := k <= this.lastIdx && predicate(this.items[k])\n // Find s := min { k | k >= this.firstIdx && !P(k) } and return this.data[this.firstIdx...s)\n let startIdx = this.firstIdx;\n while (startIdx < this.items.length && predicate(this.items[startIdx])) {\n startIdx++;\n }\n const result = startIdx === this.firstIdx ? null : this.items.slice(this.firstIdx, startIdx);\n this.firstIdx = startIdx;\n return result;\n }\n /**\n * Consumes elements from the end of the queue as long as the predicate returns true.\n * If no elements were consumed, `null` is returned.\n * The result has the same order as the underlying array!\n */\n takeFromEndWhile(predicate) {\n // P(k) := this.firstIdx >= k && predicate(this.items[k])\n // Find s := max { k | k <= this.lastIdx && !P(k) } and return this.data(s...this.lastIdx]\n let endIdx = this.lastIdx;\n while (endIdx >= 0 && predicate(this.items[endIdx])) {\n endIdx--;\n }\n const result = endIdx === this.lastIdx ? null : this.items.slice(endIdx + 1, this.lastIdx + 1);\n this.lastIdx = endIdx;\n return result;\n }\n peek() {\n if (this.length === 0) {\n return undefined;\n }\n return this.items[this.firstIdx];\n }\n dequeue() {\n const result = this.items[this.firstIdx];\n this.firstIdx++;\n return result;\n }\n takeCount(count) {\n const result = this.items.slice(this.firstIdx, this.firstIdx + count);\n this.firstIdx += count;\n return result;\n }\n}\n/**\n * This class is faster than an iterator and array for lazy computed data.\n*/\nexport class CallbackIterable {\n constructor(\n /**\n * Calls the callback for every item.\n * Stops when the callback returns false.\n */\n iterate) {\n this.iterate = iterate;\n }\n toArray() {\n const result = [];\n this.iterate(item => { result.push(item); return true; });\n return result;\n }\n filter(predicate) {\n return new CallbackIterable(cb => this.iterate(item => predicate(item) ? cb(item) : true));\n }\n map(mapFn) {\n return new CallbackIterable(cb => this.iterate(item => cb(mapFn(item))));\n }\n findLast(predicate) {\n let result;\n this.iterate(item => {\n if (predicate(item)) {\n result = item;\n }\n return true;\n });\n return result;\n }\n findLastMaxBy(comparator) {\n let result;\n let first = true;\n this.iterate(item => {\n if (first || CompareResult.isGreaterThan(comparator(item, result))) {\n first = false;\n result = item;\n }\n return true;\n });\n return result;\n }\n}\nCallbackIterable.empty = new CallbackIterable(_callback => { });\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * @returns whether the provided parameter is a JavaScript String or not.\n */\nexport function isString(str) {\n return (typeof str === 'string');\n}\n/**\n * @returns whether the provided parameter is of type `object` but **not**\n *\t`null`, an `array`, a `regexp`, nor a `date`.\n */\nexport function isObject(obj) {\n // The method can't do a type cast since there are type (like strings) which\n // are subclasses of any put not positvely matched by the function. Hence type\n // narrowing results in wrong results.\n return typeof obj === 'object'\n && obj !== null\n && !Array.isArray(obj)\n && !(obj instanceof RegExp)\n && !(obj instanceof Date);\n}\n/**\n * @returns whether the provided parameter is of type `Buffer` or Uint8Array dervived type\n */\nexport function isTypedArray(obj) {\n const TypedArray = Object.getPrototypeOf(Uint8Array);\n return typeof obj === 'object'\n && obj instanceof TypedArray;\n}\n/**\n * In **contrast** to just checking `typeof` this will return `false` for `NaN`.\n * @returns whether the provided parameter is a JavaScript Number or not.\n */\nexport function isNumber(obj) {\n return (typeof obj === 'number' && !isNaN(obj));\n}\n/**\n * @returns whether the provided parameter is an Iterable, casting to the given generic\n */\nexport function isIterable(obj) {\n return !!obj && typeof obj[Symbol.iterator] === 'function';\n}\n/**\n * @returns whether the provided parameter is a JavaScript Boolean or not.\n */\nexport function isBoolean(obj) {\n return (obj === true || obj === false);\n}\n/**\n * @returns whether the provided parameter is undefined.\n */\nexport function isUndefined(obj) {\n return (typeof obj === 'undefined');\n}\n/**\n * @returns whether the provided parameter is defined.\n */\nexport function isDefined(arg) {\n return !isUndefinedOrNull(arg);\n}\n/**\n * @returns whether the provided parameter is undefined or null.\n */\nexport function isUndefinedOrNull(obj) {\n return (isUndefined(obj) || obj === null);\n}\nexport function assertType(condition, type) {\n if (!condition) {\n throw new Error(type ? `Unexpected type, expected '${type}'` : 'Unexpected type');\n }\n}\n/**\n * Asserts that the argument passed in is neither undefined nor null.\n */\nexport function assertIsDefined(arg) {\n if (isUndefinedOrNull(arg)) {\n throw new Error('Assertion Failed: argument is undefined or null');\n }\n return arg;\n}\n/**\n * @returns whether the provided parameter is a JavaScript Function or not.\n */\nexport function isFunction(obj) {\n return (typeof obj === 'function');\n}\nexport function validateConstraints(args, constraints) {\n const len = Math.min(args.length, constraints.length);\n for (let i = 0; i < len; i++) {\n validateConstraint(args[i], constraints[i]);\n }\n}\nexport function validateConstraint(arg, constraint) {\n if (isString(constraint)) {\n if (typeof arg !== constraint) {\n throw new Error(`argument does not match constraint: typeof ${constraint}`);\n }\n }\n else if (isFunction(constraint)) {\n try {\n if (arg instanceof constraint) {\n return;\n }\n }\n catch (_a) {\n // ignore\n }\n if (!isUndefinedOrNull(arg) && arg.constructor === constraint) {\n return;\n }\n if (constraint.length === 1 && constraint.call(undefined, arg) === true) {\n return;\n }\n throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { isTypedArray, isObject, isUndefinedOrNull } from './types.js';\nexport function deepClone(obj) {\n if (!obj || typeof obj !== 'object') {\n return obj;\n }\n if (obj instanceof RegExp) {\n return obj;\n }\n const result = Array.isArray(obj) ? [] : {};\n Object.entries(obj).forEach(([key, value]) => {\n result[key] = value && typeof value === 'object' ? deepClone(value) : value;\n });\n return result;\n}\nexport function deepFreeze(obj) {\n if (!obj || typeof obj !== 'object') {\n return obj;\n }\n const stack = [obj];\n while (stack.length > 0) {\n const obj = stack.shift();\n Object.freeze(obj);\n for (const key in obj) {\n if (_hasOwnProperty.call(obj, key)) {\n const prop = obj[key];\n if (typeof prop === 'object' && !Object.isFrozen(prop) && !isTypedArray(prop)) {\n stack.push(prop);\n }\n }\n }\n }\n return obj;\n}\nconst _hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function cloneAndChange(obj, changer) {\n return _cloneAndChange(obj, changer, new Set());\n}\nfunction _cloneAndChange(obj, changer, seen) {\n if (isUndefinedOrNull(obj)) {\n return obj;\n }\n const changed = changer(obj);\n if (typeof changed !== 'undefined') {\n return changed;\n }\n if (Array.isArray(obj)) {\n const r1 = [];\n for (const e of obj) {\n r1.push(_cloneAndChange(e, changer, seen));\n }\n return r1;\n }\n if (isObject(obj)) {\n if (seen.has(obj)) {\n throw new Error('Cannot clone recursive data-structure');\n }\n seen.add(obj);\n const r2 = {};\n for (const i2 in obj) {\n if (_hasOwnProperty.call(obj, i2)) {\n r2[i2] = _cloneAndChange(obj[i2], changer, seen);\n }\n }\n seen.delete(obj);\n return r2;\n }\n return obj;\n}\n/**\n * Copies all properties of source into destination. The optional parameter \"overwrite\" allows to control\n * if existing properties on the destination should be overwritten or not. Defaults to true (overwrite).\n */\nexport function mixin(destination, source, overwrite = true) {\n if (!isObject(destination)) {\n return source;\n }\n if (isObject(source)) {\n Object.keys(source).forEach(key => {\n if (key in destination) {\n if (overwrite) {\n if (isObject(destination[key]) && isObject(source[key])) {\n mixin(destination[key], source[key], overwrite);\n }\n else {\n destination[key] = source[key];\n }\n }\n }\n else {\n destination[key] = source[key];\n }\n });\n }\n return destination;\n}\nexport function equals(one, other) {\n if (one === other) {\n return true;\n }\n if (one === null || one === undefined || other === null || other === undefined) {\n return false;\n }\n if (typeof one !== typeof other) {\n return false;\n }\n if (typeof one !== 'object') {\n return false;\n }\n if ((Array.isArray(one)) !== (Array.isArray(other))) {\n return false;\n }\n let i;\n let key;\n if (Array.isArray(one)) {\n if (one.length !== other.length) {\n return false;\n }\n for (i = 0; i < one.length; i++) {\n if (!equals(one[i], other[i])) {\n return false;\n }\n }\n }\n else {\n const oneKeys = [];\n for (key in one) {\n oneKeys.push(key);\n }\n oneKeys.sort();\n const otherKeys = [];\n for (key in other) {\n otherKeys.push(key);\n }\n otherKeys.sort();\n if (!equals(oneKeys, otherKeys)) {\n return false;\n }\n for (i = 0; i < oneKeys.length; i++) {\n if (!equals(one[oneKeys[i]], other[oneKeys[i]])) {\n return false;\n }\n }\n }\n return true;\n}\nexport function getAllPropertyNames(obj) {\n let res = [];\n while (Object.prototype !== obj) {\n res = res.concat(Object.getOwnPropertyNames(obj));\n obj = Object.getPrototypeOf(obj);\n }\n return res;\n}\nexport function getAllMethodNames(obj) {\n const methods = [];\n for (const prop of getAllPropertyNames(obj)) {\n if (typeof obj[prop] === 'function') {\n methods.push(prop);\n }\n }\n return methods;\n}\nexport function createProxyObject(methodNames, invoke) {\n const createProxyMethod = (method) => {\n return function () {\n const args = Array.prototype.slice.call(arguments, 0);\n return invoke(method, args);\n };\n };\n const result = {};\n for (const methodName of methodNames) {\n result[methodName] = createProxyMethod(methodName);\n }\n return result;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nlet isPseudo = (typeof document !== 'undefined' && document.location && document.location.hash.indexOf('pseudo=true') >= 0);\nconst DEFAULT_TAG = 'i-default';\nfunction _format(message, args) {\n let result;\n if (args.length === 0) {\n result = message;\n }\n else {\n result = message.replace(/\\{(\\d+)\\}/g, (match, rest) => {\n const index = rest[0];\n const arg = args[index];\n let result = match;\n if (typeof arg === 'string') {\n result = arg;\n }\n else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) {\n result = String(arg);\n }\n return result;\n });\n }\n if (isPseudo) {\n // FF3B and FF3D is the Unicode zenkaku representation for [ and ]\n result = '\\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\\uFF3D';\n }\n return result;\n}\nfunction findLanguageForModule(config, name) {\n let result = config[name];\n if (result) {\n return result;\n }\n result = config['*'];\n if (result) {\n return result;\n }\n return null;\n}\nfunction endWithSlash(path) {\n if (path.charAt(path.length - 1) === '/') {\n return path;\n }\n return path + '/';\n}\nasync function getMessagesFromTranslationsService(translationServiceUrl, language, name) {\n const url = endWithSlash(translationServiceUrl) + endWithSlash(language) + 'vscode/' + endWithSlash(name);\n const res = await fetch(url);\n if (res.ok) {\n const messages = await res.json();\n return messages;\n }\n throw new Error(`${res.status} - ${res.statusText}`);\n}\nfunction createScopedLocalize(scope) {\n return function (idx, defaultValue) {\n const restArgs = Array.prototype.slice.call(arguments, 2);\n return _format(scope[idx], restArgs);\n };\n}\nfunction createScopedLocalize2(scope) {\n return (idx, defaultValue, ...args) => ({\n value: _format(scope[idx], args),\n original: _format(defaultValue, args)\n });\n}\n/**\n * @skipMangle\n */\nexport function localize(data, message, ...args) {\n return _format(message, args);\n}\n/**\n * @skipMangle\n */\nexport function localize2(data, message, ...args) {\n const original = _format(message, args);\n return {\n value: original,\n original\n };\n}\n/**\n * @skipMangle\n */\nexport function getConfiguredDefaultLocale(_) {\n // This returns undefined because this implementation isn't used and is overwritten by the loader\n // when loaded.\n return undefined;\n}\n/**\n * @skipMangle\n */\nexport function setPseudoTranslation(value) {\n isPseudo = value;\n}\n/**\n * Invoked in a built product at run-time\n * @skipMangle\n */\nexport function create(key, data) {\n var _a;\n return {\n localize: createScopedLocalize(data[key]),\n localize2: createScopedLocalize2(data[key]),\n getConfiguredDefaultLocale: (_a = data.getConfiguredDefaultLocale) !== null && _a !== void 0 ? _a : ((_) => undefined)\n };\n}\n/**\n * Invoked by the loader at run-time\n * @skipMangle\n */\nexport function load(name, req, load, config) {\n var _a;\n const pluginConfig = (_a = config['vs/nls']) !== null && _a !== void 0 ? _a : {};\n if (!name || name.length === 0) {\n // TODO: We need to give back the mangled names here\n return load({\n localize: localize,\n localize2: localize2,\n getConfiguredDefaultLocale: () => { var _a; return (_a = pluginConfig.availableLanguages) === null || _a === void 0 ? void 0 : _a['*']; }\n });\n }\n const language = pluginConfig.availableLanguages ? findLanguageForModule(pluginConfig.availableLanguages, name) : null;\n const useDefaultLanguage = language === null || language === DEFAULT_TAG;\n let suffix = '.nls';\n if (!useDefaultLanguage) {\n suffix = suffix + '.' + language;\n }\n const messagesLoaded = (messages) => {\n if (Array.isArray(messages)) {\n messages.localize = createScopedLocalize(messages);\n messages.localize2 = createScopedLocalize2(messages);\n }\n else {\n messages.localize = createScopedLocalize(messages[name]);\n messages.localize2 = createScopedLocalize2(messages[name]);\n }\n messages.getConfiguredDefaultLocale = () => { var _a; return (_a = pluginConfig.availableLanguages) === null || _a === void 0 ? void 0 : _a['*']; };\n load(messages);\n };\n if (typeof pluginConfig.loadBundle === 'function') {\n pluginConfig.loadBundle(name, language, (err, messages) => {\n // We have an error. Load the English default strings to not fail\n if (err) {\n req([name + '.nls'], messagesLoaded);\n }\n else {\n messagesLoaded(messages);\n }\n });\n }\n else if (pluginConfig.translationServiceUrl && !useDefaultLanguage) {\n (async () => {\n var _a;\n try {\n const messages = await getMessagesFromTranslationsService(pluginConfig.translationServiceUrl, language, name);\n return messagesLoaded(messages);\n }\n catch (err) {\n // Language is already as generic as it gets, so require default messages\n if (!language.includes('-')) {\n console.error(err);\n return req([name + '.nls'], messagesLoaded);\n }\n try {\n // Since there is a dash, the language configured is a specific sub-language of the same generic language.\n // Since we were unable to load the specific language, try to load the generic language. Ex. we failed to find a\n // Swiss German (de-CH), so try to load the generic German (de) messages instead.\n const genericLanguage = language.split('-')[0];\n const messages = await getMessagesFromTranslationsService(pluginConfig.translationServiceUrl, genericLanguage, name);\n // We got some messages, so we configure the configuration to use the generic language for this session.\n (_a = pluginConfig.availableLanguages) !== null && _a !== void 0 ? _a : (pluginConfig.availableLanguages = {});\n pluginConfig.availableLanguages['*'] = genericLanguage;\n return messagesLoaded(messages);\n }\n catch (err) {\n console.error(err);\n return req([name + '.nls'], messagesLoaded);\n }\n }\n })();\n }\n else {\n req([name + suffix], messagesLoaded, (err) => {\n if (suffix === '.nls') {\n console.error('Failed trying to load default language strings', err);\n return;\n }\n console.error(`Failed to load message bundle for language ${language}. Falling back to the default language:`, err);\n req([name + '.nls'], messagesLoaded);\n });\n }\n}\n", "var _a;\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as nls from '../../nls.js';\nexport const LANGUAGE_DEFAULT = 'en';\nlet _isWindows = false;\nlet _isMacintosh = false;\nlet _isLinux = false;\nlet _isLinuxSnap = false;\nlet _isNative = false;\nlet _isWeb = false;\nlet _isElectron = false;\nlet _isIOS = false;\nlet _isCI = false;\nlet _isMobile = false;\nlet _locale = undefined;\nlet _language = LANGUAGE_DEFAULT;\nlet _platformLocale = LANGUAGE_DEFAULT;\nlet _translationsConfigFile = undefined;\nlet _userAgent = undefined;\nconst $globalThis = globalThis;\nlet nodeProcess = undefined;\nif (typeof $globalThis.vscode !== 'undefined' && typeof $globalThis.vscode.process !== 'undefined') {\n // Native environment (sandboxed)\n nodeProcess = $globalThis.vscode.process;\n}\nelse if (typeof process !== 'undefined') {\n // Native environment (non-sandboxed)\n nodeProcess = process;\n}\nconst isElectronProcess = typeof ((_a = nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.versions) === null || _a === void 0 ? void 0 : _a.electron) === 'string';\nconst isElectronRenderer = isElectronProcess && (nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.type) === 'renderer';\n// Native environment\nif (typeof nodeProcess === 'object') {\n _isWindows = (nodeProcess.platform === 'win32');\n _isMacintosh = (nodeProcess.platform === 'darwin');\n _isLinux = (nodeProcess.platform === 'linux');\n _isLinuxSnap = _isLinux && !!nodeProcess.env['SNAP'] && !!nodeProcess.env['SNAP_REVISION'];\n _isElectron = isElectronProcess;\n _isCI = !!nodeProcess.env['CI'] || !!nodeProcess.env['BUILD_ARTIFACTSTAGINGDIRECTORY'];\n _locale = LANGUAGE_DEFAULT;\n _language = LANGUAGE_DEFAULT;\n const rawNlsConfig = nodeProcess.env['VSCODE_NLS_CONFIG'];\n if (rawNlsConfig) {\n try {\n const nlsConfig = JSON.parse(rawNlsConfig);\n const resolved = nlsConfig.availableLanguages['*'];\n _locale = nlsConfig.locale;\n _platformLocale = nlsConfig.osLocale;\n // VSCode's default language is 'en'\n _language = resolved ? resolved : LANGUAGE_DEFAULT;\n _translationsConfigFile = nlsConfig._translationsConfigFile;\n }\n catch (e) {\n }\n }\n _isNative = true;\n}\n// Web environment\nelse if (typeof navigator === 'object' && !isElectronRenderer) {\n _userAgent = navigator.userAgent;\n _isWindows = _userAgent.indexOf('Windows') >= 0;\n _isMacintosh = _userAgent.indexOf('Macintosh') >= 0;\n _isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;\n _isLinux = _userAgent.indexOf('Linux') >= 0;\n _isMobile = (_userAgent === null || _userAgent === void 0 ? void 0 : _userAgent.indexOf('Mobi')) >= 0;\n _isWeb = true;\n const configuredLocale = nls.getConfiguredDefaultLocale(\n // This call _must_ be done in the file that calls `nls.getConfiguredDefaultLocale`\n // to ensure that the NLS AMD Loader plugin has been loaded and configured.\n // This is because the loader plugin decides what the default locale is based on\n // how it's able to resolve the strings.\n nls.localize({ key: 'ensureLoaderPluginIsLoaded', comment: ['{Locked}'] }, '_'));\n _locale = configuredLocale || LANGUAGE_DEFAULT;\n _language = _locale;\n _platformLocale = navigator.language;\n}\n// Unknown environment\nelse {\n console.error('Unable to resolve platform.');\n}\nlet _platform = 0 /* Platform.Web */;\nif (_isMacintosh) {\n _platform = 1 /* Platform.Mac */;\n}\nelse if (_isWindows) {\n _platform = 3 /* Platform.Windows */;\n}\nelse if (_isLinux) {\n _platform = 2 /* Platform.Linux */;\n}\nexport const isWindows = _isWindows;\nexport const isMacintosh = _isMacintosh;\nexport const isLinux = _isLinux;\nexport const isNative = _isNative;\nexport const isWeb = _isWeb;\nexport const isWebWorker = (_isWeb && typeof $globalThis.importScripts === 'function');\nexport const webWorkerOrigin = isWebWorker ? $globalThis.origin : undefined;\nexport const isIOS = _isIOS;\nexport const isMobile = _isMobile;\nexport const userAgent = _userAgent;\n/**\n * The language used for the user interface. The format of\n * the string is all lower case (e.g. zh-tw for Traditional\n * Chinese)\n */\nexport const language = _language;\nexport const setTimeout0IsFaster = (typeof $globalThis.postMessage === 'function' && !$globalThis.importScripts);\n/**\n * See https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#:~:text=than%204%2C%20then-,set%20timeout%20to%204,-.\n *\n * Works similarly to `setTimeout(0)` but doesn't suffer from the 4ms artificial delay\n * that browsers set when the nesting level is > 5.\n */\nexport const setTimeout0 = (() => {\n if (setTimeout0IsFaster) {\n const pending = [];\n $globalThis.addEventListener('message', (e) => {\n if (e.data && e.data.vscodeScheduleAsyncWork) {\n for (let i = 0, len = pending.length; i < len; i++) {\n const candidate = pending[i];\n if (candidate.id === e.data.vscodeScheduleAsyncWork) {\n pending.splice(i, 1);\n candidate.callback();\n return;\n }\n }\n }\n });\n let lastId = 0;\n return (callback) => {\n const myId = ++lastId;\n pending.push({\n id: myId,\n callback: callback\n });\n $globalThis.postMessage({ vscodeScheduleAsyncWork: myId }, '*');\n };\n }\n return (callback) => setTimeout(callback);\n})();\nexport const OS = (_isMacintosh || _isIOS ? 2 /* OperatingSystem.Macintosh */ : (_isWindows ? 1 /* OperatingSystem.Windows */ : 3 /* OperatingSystem.Linux */));\nlet _isLittleEndian = true;\nlet _isLittleEndianComputed = false;\nexport function isLittleEndian() {\n if (!_isLittleEndianComputed) {\n _isLittleEndianComputed = true;\n const test = new Uint8Array(2);\n test[0] = 1;\n test[1] = 2;\n const view = new Uint16Array(test.buffer);\n _isLittleEndian = (view[0] === (2 << 8) + 1);\n }\n return _isLittleEndian;\n}\nexport const isChrome = !!(userAgent && userAgent.indexOf('Chrome') >= 0);\nexport const isFirefox = !!(userAgent && userAgent.indexOf('Firefox') >= 0);\nexport const isSafari = !!(!isChrome && (userAgent && userAgent.indexOf('Safari') >= 0));\nexport const isEdge = !!(userAgent && userAgent.indexOf('Edg/') >= 0);\nexport const isAndroid = !!(userAgent && userAgent.indexOf('Android') >= 0);\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport const EDITOR_MODEL_DEFAULTS = {\n tabSize: 4,\n indentSize: 4,\n insertSpaces: true,\n detectIndentation: true,\n trimAutoWhitespace: true,\n largeFileOptimizations: true,\n bracketPairColorizationOptions: {\n enabled: true,\n independentColorPoolPerBracketType: false,\n },\n};\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport var Iterable;\n(function (Iterable) {\n function is(thing) {\n return thing && typeof thing === 'object' && typeof thing[Symbol.iterator] === 'function';\n }\n Iterable.is = is;\n const _empty = Object.freeze([]);\n function empty() {\n return _empty;\n }\n Iterable.empty = empty;\n function* single(element) {\n yield element;\n }\n Iterable.single = single;\n function wrap(iterableOrElement) {\n if (is(iterableOrElement)) {\n return iterableOrElement;\n }\n else {\n return single(iterableOrElement);\n }\n }\n Iterable.wrap = wrap;\n function from(iterable) {\n return iterable || _empty;\n }\n Iterable.from = from;\n function* reverse(array) {\n for (let i = array.length - 1; i >= 0; i--) {\n yield array[i];\n }\n }\n Iterable.reverse = reverse;\n function isEmpty(iterable) {\n return !iterable || iterable[Symbol.iterator]().next().done === true;\n }\n Iterable.isEmpty = isEmpty;\n function first(iterable) {\n return iterable[Symbol.iterator]().next().value;\n }\n Iterable.first = first;\n function some(iterable, predicate) {\n for (const element of iterable) {\n if (predicate(element)) {\n return true;\n }\n }\n return false;\n }\n Iterable.some = some;\n function find(iterable, predicate) {\n for (const element of iterable) {\n if (predicate(element)) {\n return element;\n }\n }\n return undefined;\n }\n Iterable.find = find;\n function* filter(iterable, predicate) {\n for (const element of iterable) {\n if (predicate(element)) {\n yield element;\n }\n }\n }\n Iterable.filter = filter;\n function* map(iterable, fn) {\n let index = 0;\n for (const element of iterable) {\n yield fn(element, index++);\n }\n }\n Iterable.map = map;\n function* concat(...iterables) {\n for (const iterable of iterables) {\n yield* iterable;\n }\n }\n Iterable.concat = concat;\n function reduce(iterable, reducer, initialValue) {\n let value = initialValue;\n for (const element of iterable) {\n value = reducer(value, element);\n }\n return value;\n }\n Iterable.reduce = reduce;\n /**\n * Returns an iterable slice of the array, with the same semantics as `array.slice()`.\n */\n function* slice(arr, from, to = arr.length) {\n if (from < 0) {\n from += arr.length;\n }\n if (to < 0) {\n to += arr.length;\n }\n else if (to > arr.length) {\n to = arr.length;\n }\n for (; from < to; from++) {\n yield arr[from];\n }\n }\n Iterable.slice = slice;\n /**\n * Consumes `atMost` elements from iterable and returns the consumed elements,\n * and an iterable for the rest of the elements.\n */\n function consume(iterable, atMost = Number.POSITIVE_INFINITY) {\n const consumed = [];\n if (atMost === 0) {\n return [consumed, iterable];\n }\n const iterator = iterable[Symbol.iterator]();\n for (let i = 0; i < atMost; i++) {\n const next = iterator.next();\n if (next.done) {\n return [consumed, Iterable.empty()];\n }\n consumed.push(next.value);\n }\n return [consumed, { [Symbol.iterator]() { return iterator; } }];\n }\n Iterable.consume = consume;\n async function asyncToArray(iterable) {\n const result = [];\n for await (const item of iterable) {\n result.push(item);\n }\n return Promise.resolve(result);\n }\n Iterable.asyncToArray = asyncToArray;\n})(Iterable || (Iterable = {}));\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nclass Node {\n constructor(element) {\n this.element = element;\n this.next = Node.Undefined;\n this.prev = Node.Undefined;\n }\n}\nNode.Undefined = new Node(undefined);\nexport class LinkedList {\n constructor() {\n this._first = Node.Undefined;\n this._last = Node.Undefined;\n this._size = 0;\n }\n get size() {\n return this._size;\n }\n isEmpty() {\n return this._first === Node.Undefined;\n }\n clear() {\n let node = this._first;\n while (node !== Node.Undefined) {\n const next = node.next;\n node.prev = Node.Undefined;\n node.next = Node.Undefined;\n node = next;\n }\n this._first = Node.Undefined;\n this._last = Node.Undefined;\n this._size = 0;\n }\n unshift(element) {\n return this._insert(element, false);\n }\n push(element) {\n return this._insert(element, true);\n }\n _insert(element, atTheEnd) {\n const newNode = new Node(element);\n if (this._first === Node.Undefined) {\n this._first = newNode;\n this._last = newNode;\n }\n else if (atTheEnd) {\n // push\n const oldLast = this._last;\n this._last = newNode;\n newNode.prev = oldLast;\n oldLast.next = newNode;\n }\n else {\n // unshift\n const oldFirst = this._first;\n this._first = newNode;\n newNode.next = oldFirst;\n oldFirst.prev = newNode;\n }\n this._size += 1;\n let didRemove = false;\n return () => {\n if (!didRemove) {\n didRemove = true;\n this._remove(newNode);\n }\n };\n }\n shift() {\n if (this._first === Node.Undefined) {\n return undefined;\n }\n else {\n const res = this._first.element;\n this._remove(this._first);\n return res;\n }\n }\n pop() {\n if (this._last === Node.Undefined) {\n return undefined;\n }\n else {\n const res = this._last.element;\n this._remove(this._last);\n return res;\n }\n }\n _remove(node) {\n if (node.prev !== Node.Undefined && node.next !== Node.Undefined) {\n // middle\n const anchor = node.prev;\n anchor.next = node.next;\n node.next.prev = anchor;\n }\n else if (node.prev === Node.Undefined && node.next === Node.Undefined) {\n // only node\n this._first = Node.Undefined;\n this._last = Node.Undefined;\n }\n else if (node.next === Node.Undefined) {\n // last\n this._last = this._last.prev;\n this._last.next = Node.Undefined;\n }\n else if (node.prev === Node.Undefined) {\n // first\n this._first = this._first.next;\n this._first.prev = Node.Undefined;\n }\n // done\n this._size -= 1;\n }\n *[Symbol.iterator]() {\n let node = this._first;\n while (node !== Node.Undefined) {\n yield node.element;\n node = node.next;\n }\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Iterable } from '../../../base/common/iterator.js';\nimport { LinkedList } from '../../../base/common/linkedList.js';\nexport const USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\\\|;:\\'\",.<>/?';\n/**\n * Create a word definition regular expression based on default word separators.\n * Optionally provide allowed separators that should be included in words.\n *\n * The default would look like this:\n * /(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)/g\n */\nfunction createWordRegExp(allowInWords = '') {\n let source = '(-?\\\\d*\\\\.\\\\d\\\\w*)|([^';\n for (const sep of USUAL_WORD_SEPARATORS) {\n if (allowInWords.indexOf(sep) >= 0) {\n continue;\n }\n source += '\\\\' + sep;\n }\n source += '\\\\s]+)';\n return new RegExp(source, 'g');\n}\n// catches numbers (including floating numbers) in the first group, and alphanum in the second\nexport const DEFAULT_WORD_REGEXP = createWordRegExp();\nexport function ensureValidWordDefinition(wordDefinition) {\n let result = DEFAULT_WORD_REGEXP;\n if (wordDefinition && (wordDefinition instanceof RegExp)) {\n if (!wordDefinition.global) {\n let flags = 'g';\n if (wordDefinition.ignoreCase) {\n flags += 'i';\n }\n if (wordDefinition.multiline) {\n flags += 'm';\n }\n if (wordDefinition.unicode) {\n flags += 'u';\n }\n result = new RegExp(wordDefinition.source, flags);\n }\n else {\n result = wordDefinition;\n }\n }\n result.lastIndex = 0;\n return result;\n}\nconst _defaultConfig = new LinkedList();\n_defaultConfig.unshift({\n maxLen: 1000,\n windowSize: 15,\n timeBudget: 150\n});\nexport function getWordAtText(column, wordDefinition, text, textOffset, config) {\n // Ensure the regex has the 'g' flag, otherwise this will loop forever\n wordDefinition = ensureValidWordDefinition(wordDefinition);\n if (!config) {\n config = Iterable.first(_defaultConfig);\n }\n if (text.length > config.maxLen) {\n // don't throw strings that long at the regexp\n // but use a sub-string in which a word must occur\n let start = column - config.maxLen / 2;\n if (start < 0) {\n start = 0;\n }\n else {\n textOffset += start;\n }\n text = text.substring(start, column + config.maxLen / 2);\n return getWordAtText(column, wordDefinition, text, textOffset, config);\n }\n const t1 = Date.now();\n const pos = column - 1 - textOffset;\n let prevRegexIndex = -1;\n let match = null;\n for (let i = 1;; i++) {\n // check time budget\n if (Date.now() - t1 >= config.timeBudget) {\n break;\n }\n // reset the index at which the regexp should start matching, also know where it\n // should stop so that subsequent search don't repeat previous searches\n const regexIndex = pos - config.windowSize * i;\n wordDefinition.lastIndex = Math.max(0, regexIndex);\n const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex);\n if (!thisMatch && match) {\n // stop: we have something\n break;\n }\n match = thisMatch;\n // stop: searched at start\n if (regexIndex <= 0) {\n break;\n }\n prevRegexIndex = regexIndex;\n }\n if (match) {\n const result = {\n word: match[0],\n startColumn: textOffset + 1 + match.index,\n endColumn: textOffset + 1 + match.index + match[0].length\n };\n wordDefinition.lastIndex = 0;\n return result;\n }\n return null;\n}\nfunction _findRegexMatchEnclosingPosition(wordDefinition, text, pos, stopPos) {\n let match;\n while (match = wordDefinition.exec(text)) {\n const matchIndex = match.index || 0;\n if (matchIndex <= pos && wordDefinition.lastIndex >= pos) {\n return match;\n }\n else if (stopPos > 0 && matchIndex > stopPos) {\n return null;\n }\n }\n return null;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as arrays from '../../../base/common/arrays.js';\nimport * as objects from '../../../base/common/objects.js';\nimport * as platform from '../../../base/common/platform.js';\nimport { EDITOR_MODEL_DEFAULTS } from '../core/textModelDefaults.js';\nimport { USUAL_WORD_SEPARATORS } from '../core/wordHelper.js';\nimport * as nls from '../../../nls.js';\n/**\n * @internal\n * The width of the minimap gutter, in pixels.\n */\nexport const MINIMAP_GUTTER_WIDTH = 8;\n//#endregion\n/**\n * An event describing that the configuration of the editor has changed.\n */\nexport class ConfigurationChangedEvent {\n /**\n * @internal\n */\n constructor(values) {\n this._values = values;\n }\n hasChanged(id) {\n return this._values[id];\n }\n}\n/**\n * @internal\n */\nexport class ComputeOptionsMemory {\n constructor() {\n this.stableMinimapLayoutInput = null;\n this.stableFitMaxMinimapScale = 0;\n this.stableFitRemainingWidth = 0;\n }\n}\n/**\n * @internal\n */\nclass BaseEditorOption {\n constructor(id, name, defaultValue, schema) {\n this.id = id;\n this.name = name;\n this.defaultValue = defaultValue;\n this.schema = schema;\n }\n applyUpdate(value, update) {\n return applyUpdate(value, update);\n }\n compute(env, options, value) {\n return value;\n }\n}\nexport class ApplyUpdateResult {\n constructor(newValue, didChange) {\n this.newValue = newValue;\n this.didChange = didChange;\n }\n}\nfunction applyUpdate(value, update) {\n if (typeof value !== 'object' || typeof update !== 'object' || !value || !update) {\n return new ApplyUpdateResult(update, value !== update);\n }\n if (Array.isArray(value) || Array.isArray(update)) {\n const arrayEquals = Array.isArray(value) && Array.isArray(update) && arrays.equals(value, update);\n return new ApplyUpdateResult(update, !arrayEquals);\n }\n let didChange = false;\n for (const key in update) {\n if (update.hasOwnProperty(key)) {\n const result = applyUpdate(value[key], update[key]);\n if (result.didChange) {\n value[key] = result.newValue;\n didChange = true;\n }\n }\n }\n return new ApplyUpdateResult(value, didChange);\n}\n/**\n * @internal\n */\nclass ComputedEditorOption {\n constructor(id) {\n this.schema = undefined;\n this.id = id;\n this.name = '_never_';\n this.defaultValue = undefined;\n }\n applyUpdate(value, update) {\n return applyUpdate(value, update);\n }\n validate(input) {\n return this.defaultValue;\n }\n}\nclass SimpleEditorOption {\n constructor(id, name, defaultValue, schema) {\n this.id = id;\n this.name = name;\n this.defaultValue = defaultValue;\n this.schema = schema;\n }\n applyUpdate(value, update) {\n return applyUpdate(value, update);\n }\n validate(input) {\n if (typeof input === 'undefined') {\n return this.defaultValue;\n }\n return input;\n }\n compute(env, options, value) {\n return value;\n }\n}\n/**\n * @internal\n */\nexport function boolean(value, defaultValue) {\n if (typeof value === 'undefined') {\n return defaultValue;\n }\n if (value === 'false') {\n // treat the string 'false' as false\n return false;\n }\n return Boolean(value);\n}\nclass EditorBooleanOption extends SimpleEditorOption {\n constructor(id, name, defaultValue, schema = undefined) {\n if (typeof schema !== 'undefined') {\n schema.type = 'boolean';\n schema.default = defaultValue;\n }\n super(id, name, defaultValue, schema);\n }\n validate(input) {\n return boolean(input, this.defaultValue);\n }\n}\n/**\n * @internal\n */\nexport function clampedInt(value, defaultValue, minimum, maximum) {\n if (typeof value === 'undefined') {\n return defaultValue;\n }\n let r = parseInt(value, 10);\n if (isNaN(r)) {\n return defaultValue;\n }\n r = Math.max(minimum, r);\n r = Math.min(maximum, r);\n return r | 0;\n}\nclass EditorIntOption extends SimpleEditorOption {\n static clampedInt(value, defaultValue, minimum, maximum) {\n return clampedInt(value, defaultValue, minimum, maximum);\n }\n constructor(id, name, defaultValue, minimum, maximum, schema = undefined) {\n if (typeof schema !== 'undefined') {\n schema.type = 'integer';\n schema.default = defaultValue;\n schema.minimum = minimum;\n schema.maximum = maximum;\n }\n super(id, name, defaultValue, schema);\n this.minimum = minimum;\n this.maximum = maximum;\n }\n validate(input) {\n return EditorIntOption.clampedInt(input, this.defaultValue, this.minimum, this.maximum);\n }\n}\n/**\n * @internal\n */\nexport function clampedFloat(value, defaultValue, minimum, maximum) {\n if (typeof value === 'undefined') {\n return defaultValue;\n }\n const r = EditorFloatOption.float(value, defaultValue);\n return EditorFloatOption.clamp(r, minimum, maximum);\n}\nclass EditorFloatOption extends SimpleEditorOption {\n static clamp(n, min, max) {\n if (n < min) {\n return min;\n }\n if (n > max) {\n return max;\n }\n return n;\n }\n static float(value, defaultValue) {\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'undefined') {\n return defaultValue;\n }\n const r = parseFloat(value);\n return (isNaN(r) ? defaultValue : r);\n }\n constructor(id, name, defaultValue, validationFn, schema) {\n if (typeof schema !== 'undefined') {\n schema.type = 'number';\n schema.default = defaultValue;\n }\n super(id, name, defaultValue, schema);\n this.validationFn = validationFn;\n }\n validate(input) {\n return this.validationFn(EditorFloatOption.float(input, this.defaultValue));\n }\n}\nclass EditorStringOption extends SimpleEditorOption {\n static string(value, defaultValue) {\n if (typeof value !== 'string') {\n return defaultValue;\n }\n return value;\n }\n constructor(id, name, defaultValue, schema = undefined) {\n if (typeof schema !== 'undefined') {\n schema.type = 'string';\n schema.default = defaultValue;\n }\n super(id, name, defaultValue, schema);\n }\n validate(input) {\n return EditorStringOption.string(input, this.defaultValue);\n }\n}\n/**\n * @internal\n */\nexport function stringSet(value, defaultValue, allowedValues, renamedValues) {\n if (typeof value !== 'string') {\n return defaultValue;\n }\n if (renamedValues && value in renamedValues) {\n return renamedValues[value];\n }\n if (allowedValues.indexOf(value) === -1) {\n return defaultValue;\n }\n return value;\n}\nclass EditorStringEnumOption extends SimpleEditorOption {\n constructor(id, name, defaultValue, allowedValues, schema = undefined) {\n if (typeof schema !== 'undefined') {\n schema.type = 'string';\n schema.enum = allowedValues;\n schema.default = defaultValue;\n }\n super(id, name, defaultValue, schema);\n this._allowedValues = allowedValues;\n }\n validate(input) {\n return stringSet(input, this.defaultValue, this._allowedValues);\n }\n}\nclass EditorEnumOption extends BaseEditorOption {\n constructor(id, name, defaultValue, defaultStringValue, allowedValues, convert, schema = undefined) {\n if (typeof schema !== 'undefined') {\n schema.type = 'string';\n schema.enum = allowedValues;\n schema.default = defaultStringValue;\n }\n super(id, name, defaultValue, schema);\n this._allowedValues = allowedValues;\n this._convert = convert;\n }\n validate(input) {\n if (typeof input !== 'string') {\n return this.defaultValue;\n }\n if (this._allowedValues.indexOf(input) === -1) {\n return this.defaultValue;\n }\n return this._convert(input);\n }\n}\n//#endregion\n//#region autoIndent\nfunction _autoIndentFromString(autoIndent) {\n switch (autoIndent) {\n case 'none': return 0 /* EditorAutoIndentStrategy.None */;\n case 'keep': return 1 /* EditorAutoIndentStrategy.Keep */;\n case 'brackets': return 2 /* EditorAutoIndentStrategy.Brackets */;\n case 'advanced': return 3 /* EditorAutoIndentStrategy.Advanced */;\n case 'full': return 4 /* EditorAutoIndentStrategy.Full */;\n }\n}\n//#endregion\n//#region accessibilitySupport\nclass EditorAccessibilitySupport extends BaseEditorOption {\n constructor() {\n super(2 /* EditorOption.accessibilitySupport */, 'accessibilitySupport', 0 /* AccessibilitySupport.Unknown */, {\n type: 'string',\n enum: ['auto', 'on', 'off'],\n enumDescriptions: [\n nls.localize('accessibilitySupport.auto', \"Use platform APIs to detect when a Screen Reader is attached.\"),\n nls.localize('accessibilitySupport.on', \"Optimize for usage with a Screen Reader.\"),\n nls.localize('accessibilitySupport.off', \"Assume a screen reader is not attached.\"),\n ],\n default: 'auto',\n tags: ['accessibility'],\n description: nls.localize('accessibilitySupport', \"Controls if the UI should run in a mode where it is optimized for screen readers.\")\n });\n }\n validate(input) {\n switch (input) {\n case 'auto': return 0 /* AccessibilitySupport.Unknown */;\n case 'off': return 1 /* AccessibilitySupport.Disabled */;\n case 'on': return 2 /* AccessibilitySupport.Enabled */;\n }\n return this.defaultValue;\n }\n compute(env, options, value) {\n if (value === 0 /* AccessibilitySupport.Unknown */) {\n // The editor reads the `accessibilitySupport` from the environment\n return env.accessibilitySupport;\n }\n return value;\n }\n}\nclass EditorComments extends BaseEditorOption {\n constructor() {\n const defaults = {\n insertSpace: true,\n ignoreEmptyLines: true,\n };\n super(23 /* EditorOption.comments */, 'comments', defaults, {\n 'editor.comments.insertSpace': {\n type: 'boolean',\n default: defaults.insertSpace,\n description: nls.localize('comments.insertSpace', \"Controls whether a space character is inserted when commenting.\")\n },\n 'editor.comments.ignoreEmptyLines': {\n type: 'boolean',\n default: defaults.ignoreEmptyLines,\n description: nls.localize('comments.ignoreEmptyLines', 'Controls if empty lines should be ignored with toggle, add or remove actions for line comments.')\n },\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n insertSpace: boolean(input.insertSpace, this.defaultValue.insertSpace),\n ignoreEmptyLines: boolean(input.ignoreEmptyLines, this.defaultValue.ignoreEmptyLines),\n };\n }\n}\nfunction _cursorBlinkingStyleFromString(cursorBlinkingStyle) {\n switch (cursorBlinkingStyle) {\n case 'blink': return 1 /* TextEditorCursorBlinkingStyle.Blink */;\n case 'smooth': return 2 /* TextEditorCursorBlinkingStyle.Smooth */;\n case 'phase': return 3 /* TextEditorCursorBlinkingStyle.Phase */;\n case 'expand': return 4 /* TextEditorCursorBlinkingStyle.Expand */;\n case 'solid': return 5 /* TextEditorCursorBlinkingStyle.Solid */;\n }\n}\n//#endregion\n//#region cursorStyle\n/**\n * The style in which the editor's cursor should be rendered.\n */\nexport var TextEditorCursorStyle;\n(function (TextEditorCursorStyle) {\n /**\n * As a vertical line (sitting between two characters).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"Line\"] = 1] = \"Line\";\n /**\n * As a block (sitting on top of a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"Block\"] = 2] = \"Block\";\n /**\n * As a horizontal line (sitting under a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"Underline\"] = 3] = \"Underline\";\n /**\n * As a thin vertical line (sitting between two characters).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"LineThin\"] = 4] = \"LineThin\";\n /**\n * As an outlined block (sitting on top of a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"BlockOutline\"] = 5] = \"BlockOutline\";\n /**\n * As a thin horizontal line (sitting under a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"UnderlineThin\"] = 6] = \"UnderlineThin\";\n})(TextEditorCursorStyle || (TextEditorCursorStyle = {}));\nfunction _cursorStyleFromString(cursorStyle) {\n switch (cursorStyle) {\n case 'line': return TextEditorCursorStyle.Line;\n case 'block': return TextEditorCursorStyle.Block;\n case 'underline': return TextEditorCursorStyle.Underline;\n case 'line-thin': return TextEditorCursorStyle.LineThin;\n case 'block-outline': return TextEditorCursorStyle.BlockOutline;\n case 'underline-thin': return TextEditorCursorStyle.UnderlineThin;\n }\n}\n//#endregion\n//#region editorClassName\nclass EditorClassName extends ComputedEditorOption {\n constructor() {\n super(140 /* EditorOption.editorClassName */);\n }\n compute(env, options, _) {\n const classNames = ['monaco-editor'];\n if (options.get(39 /* EditorOption.extraEditorClassName */)) {\n classNames.push(options.get(39 /* EditorOption.extraEditorClassName */));\n }\n if (env.extraEditorClassName) {\n classNames.push(env.extraEditorClassName);\n }\n if (options.get(73 /* EditorOption.mouseStyle */) === 'default') {\n classNames.push('mouse-default');\n }\n else if (options.get(73 /* EditorOption.mouseStyle */) === 'copy') {\n classNames.push('mouse-copy');\n }\n if (options.get(110 /* EditorOption.showUnused */)) {\n classNames.push('showUnused');\n }\n if (options.get(138 /* EditorOption.showDeprecated */)) {\n classNames.push('showDeprecated');\n }\n return classNames.join(' ');\n }\n}\n//#endregion\n//#region emptySelectionClipboard\nclass EditorEmptySelectionClipboard extends EditorBooleanOption {\n constructor() {\n super(37 /* EditorOption.emptySelectionClipboard */, 'emptySelectionClipboard', true, { description: nls.localize('emptySelectionClipboard', \"Controls whether copying without a selection copies the current line.\") });\n }\n compute(env, options, value) {\n return value && env.emptySelectionClipboard;\n }\n}\nclass EditorFind extends BaseEditorOption {\n constructor() {\n const defaults = {\n cursorMoveOnType: true,\n seedSearchStringFromSelection: 'always',\n autoFindInSelection: 'never',\n globalFindClipboard: false,\n addExtraSpaceOnTop: true,\n loop: true\n };\n super(41 /* EditorOption.find */, 'find', defaults, {\n 'editor.find.cursorMoveOnType': {\n type: 'boolean',\n default: defaults.cursorMoveOnType,\n description: nls.localize('find.cursorMoveOnType', \"Controls whether the cursor should jump to find matches while typing.\")\n },\n 'editor.find.seedSearchStringFromSelection': {\n type: 'string',\n enum: ['never', 'always', 'selection'],\n default: defaults.seedSearchStringFromSelection,\n enumDescriptions: [\n nls.localize('editor.find.seedSearchStringFromSelection.never', 'Never seed search string from the editor selection.'),\n nls.localize('editor.find.seedSearchStringFromSelection.always', 'Always seed search string from the editor selection, including word at cursor position.'),\n nls.localize('editor.find.seedSearchStringFromSelection.selection', 'Only seed search string from the editor selection.')\n ],\n description: nls.localize('find.seedSearchStringFromSelection', \"Controls whether the search string in the Find Widget is seeded from the editor selection.\")\n },\n 'editor.find.autoFindInSelection': {\n type: 'string',\n enum: ['never', 'always', 'multiline'],\n default: defaults.autoFindInSelection,\n enumDescriptions: [\n nls.localize('editor.find.autoFindInSelection.never', 'Never turn on Find in Selection automatically (default).'),\n nls.localize('editor.find.autoFindInSelection.always', 'Always turn on Find in Selection automatically.'),\n nls.localize('editor.find.autoFindInSelection.multiline', 'Turn on Find in Selection automatically when multiple lines of content are selected.')\n ],\n description: nls.localize('find.autoFindInSelection', \"Controls the condition for turning on Find in Selection automatically.\")\n },\n 'editor.find.globalFindClipboard': {\n type: 'boolean',\n default: defaults.globalFindClipboard,\n description: nls.localize('find.globalFindClipboard', \"Controls whether the Find Widget should read or modify the shared find clipboard on macOS.\"),\n included: platform.isMacintosh\n },\n 'editor.find.addExtraSpaceOnTop': {\n type: 'boolean',\n default: defaults.addExtraSpaceOnTop,\n description: nls.localize('find.addExtraSpaceOnTop', \"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.\")\n },\n 'editor.find.loop': {\n type: 'boolean',\n default: defaults.loop,\n description: nls.localize('find.loop', \"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.\")\n },\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n cursorMoveOnType: boolean(input.cursorMoveOnType, this.defaultValue.cursorMoveOnType),\n seedSearchStringFromSelection: typeof _input.seedSearchStringFromSelection === 'boolean'\n ? (_input.seedSearchStringFromSelection ? 'always' : 'never')\n : stringSet(input.seedSearchStringFromSelection, this.defaultValue.seedSearchStringFromSelection, ['never', 'always', 'selection']),\n autoFindInSelection: typeof _input.autoFindInSelection === 'boolean'\n ? (_input.autoFindInSelection ? 'always' : 'never')\n : stringSet(input.autoFindInSelection, this.defaultValue.autoFindInSelection, ['never', 'always', 'multiline']),\n globalFindClipboard: boolean(input.globalFindClipboard, this.defaultValue.globalFindClipboard),\n addExtraSpaceOnTop: boolean(input.addExtraSpaceOnTop, this.defaultValue.addExtraSpaceOnTop),\n loop: boolean(input.loop, this.defaultValue.loop),\n };\n }\n}\n//#endregion\n//#region fontLigatures\n/**\n * @internal\n */\nexport class EditorFontLigatures extends BaseEditorOption {\n constructor() {\n super(51 /* EditorOption.fontLigatures */, 'fontLigatures', EditorFontLigatures.OFF, {\n anyOf: [\n {\n type: 'boolean',\n description: nls.localize('fontLigatures', \"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.\"),\n },\n {\n type: 'string',\n description: nls.localize('fontFeatureSettings', \"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.\")\n }\n ],\n description: nls.localize('fontLigaturesGeneral', \"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property.\"),\n default: false\n });\n }\n validate(input) {\n if (typeof input === 'undefined') {\n return this.defaultValue;\n }\n if (typeof input === 'string') {\n if (input === 'false' || input.length === 0) {\n return EditorFontLigatures.OFF;\n }\n if (input === 'true') {\n return EditorFontLigatures.ON;\n }\n return input;\n }\n if (Boolean(input)) {\n return EditorFontLigatures.ON;\n }\n return EditorFontLigatures.OFF;\n }\n}\nEditorFontLigatures.OFF = '\"liga\" off, \"calt\" off';\nEditorFontLigatures.ON = '\"liga\" on, \"calt\" on';\n//#endregion\n//#region fontVariations\n/**\n * @internal\n */\nexport class EditorFontVariations extends BaseEditorOption {\n constructor() {\n super(54 /* EditorOption.fontVariations */, 'fontVariations', EditorFontVariations.OFF, {\n anyOf: [\n {\n type: 'boolean',\n description: nls.localize('fontVariations', \"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.\"),\n },\n {\n type: 'string',\n description: nls.localize('fontVariationSettings', \"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.\")\n }\n ],\n description: nls.localize('fontVariationsGeneral', \"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property.\"),\n default: false\n });\n }\n validate(input) {\n if (typeof input === 'undefined') {\n return this.defaultValue;\n }\n if (typeof input === 'string') {\n if (input === 'false') {\n return EditorFontVariations.OFF;\n }\n if (input === 'true') {\n return EditorFontVariations.TRANSLATE;\n }\n return input;\n }\n if (Boolean(input)) {\n return EditorFontVariations.TRANSLATE;\n }\n return EditorFontVariations.OFF;\n }\n compute(env, options, value) {\n // The value is computed from the fontWeight if it is true.\n // So take the result from env.fontInfo\n return env.fontInfo.fontVariationSettings;\n }\n}\n// Text is laid out using default settings.\nEditorFontVariations.OFF = 'normal';\n// Translate `fontWeight` config to the `font-variation-settings` CSS property.\nEditorFontVariations.TRANSLATE = 'translate';\n//#endregion\n//#region fontInfo\nclass EditorFontInfo extends ComputedEditorOption {\n constructor() {\n super(50 /* EditorOption.fontInfo */);\n }\n compute(env, options, _) {\n return env.fontInfo;\n }\n}\n//#endregion\n//#region fontSize\nclass EditorFontSize extends SimpleEditorOption {\n constructor() {\n super(52 /* EditorOption.fontSize */, 'fontSize', EDITOR_FONT_DEFAULTS.fontSize, {\n type: 'number',\n minimum: 6,\n maximum: 100,\n default: EDITOR_FONT_DEFAULTS.fontSize,\n description: nls.localize('fontSize', \"Controls the font size in pixels.\")\n });\n }\n validate(input) {\n const r = EditorFloatOption.float(input, this.defaultValue);\n if (r === 0) {\n return EDITOR_FONT_DEFAULTS.fontSize;\n }\n return EditorFloatOption.clamp(r, 6, 100);\n }\n compute(env, options, value) {\n // The final fontSize respects the editor zoom level.\n // So take the result from env.fontInfo\n return env.fontInfo.fontSize;\n }\n}\n//#endregion\n//#region fontWeight\nclass EditorFontWeight extends BaseEditorOption {\n constructor() {\n super(53 /* EditorOption.fontWeight */, 'fontWeight', EDITOR_FONT_DEFAULTS.fontWeight, {\n anyOf: [\n {\n type: 'number',\n minimum: EditorFontWeight.MINIMUM_VALUE,\n maximum: EditorFontWeight.MAXIMUM_VALUE,\n errorMessage: nls.localize('fontWeightErrorMessage', \"Only \\\"normal\\\" and \\\"bold\\\" keywords or numbers between 1 and 1000 are allowed.\")\n },\n {\n type: 'string',\n pattern: '^(normal|bold|1000|[1-9][0-9]{0,2})$'\n },\n {\n enum: EditorFontWeight.SUGGESTION_VALUES\n }\n ],\n default: EDITOR_FONT_DEFAULTS.fontWeight,\n description: nls.localize('fontWeight', \"Controls the font weight. Accepts \\\"normal\\\" and \\\"bold\\\" keywords or numbers between 1 and 1000.\")\n });\n }\n validate(input) {\n if (input === 'normal' || input === 'bold') {\n return input;\n }\n return String(EditorIntOption.clampedInt(input, EDITOR_FONT_DEFAULTS.fontWeight, EditorFontWeight.MINIMUM_VALUE, EditorFontWeight.MAXIMUM_VALUE));\n }\n}\nEditorFontWeight.SUGGESTION_VALUES = ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'];\nEditorFontWeight.MINIMUM_VALUE = 1;\nEditorFontWeight.MAXIMUM_VALUE = 1000;\nclass EditorGoToLocation extends BaseEditorOption {\n constructor() {\n const defaults = {\n multiple: 'peek',\n multipleDefinitions: 'peek',\n multipleTypeDefinitions: 'peek',\n multipleDeclarations: 'peek',\n multipleImplementations: 'peek',\n multipleReferences: 'peek',\n alternativeDefinitionCommand: 'editor.action.goToReferences',\n alternativeTypeDefinitionCommand: 'editor.action.goToReferences',\n alternativeDeclarationCommand: 'editor.action.goToReferences',\n alternativeImplementationCommand: '',\n alternativeReferenceCommand: '',\n };\n const jsonSubset = {\n type: 'string',\n enum: ['peek', 'gotoAndPeek', 'goto'],\n default: defaults.multiple,\n enumDescriptions: [\n nls.localize('editor.gotoLocation.multiple.peek', 'Show Peek view of the results (default)'),\n nls.localize('editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a Peek view'),\n nls.localize('editor.gotoLocation.multiple.goto', 'Go to the primary result and enable Peek-less navigation to others')\n ]\n };\n const alternativeCommandOptions = ['', 'editor.action.referenceSearch.trigger', 'editor.action.goToReferences', 'editor.action.peekImplementation', 'editor.action.goToImplementation', 'editor.action.peekTypeDefinition', 'editor.action.goToTypeDefinition', 'editor.action.peekDeclaration', 'editor.action.revealDeclaration', 'editor.action.peekDefinition', 'editor.action.revealDefinitionAside', 'editor.action.revealDefinition'];\n super(58 /* EditorOption.gotoLocation */, 'gotoLocation', defaults, {\n 'editor.gotoLocation.multiple': {\n deprecationMessage: nls.localize('editor.gotoLocation.multiple.deprecated', \"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.\"),\n },\n 'editor.gotoLocation.multipleDefinitions': {\n description: nls.localize('editor.editor.gotoLocation.multipleDefinitions', \"Controls the behavior the 'Go to Definition'-command when multiple target locations exist.\"),\n ...jsonSubset,\n },\n 'editor.gotoLocation.multipleTypeDefinitions': {\n description: nls.localize('editor.editor.gotoLocation.multipleTypeDefinitions', \"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.\"),\n ...jsonSubset,\n },\n 'editor.gotoLocation.multipleDeclarations': {\n description: nls.localize('editor.editor.gotoLocation.multipleDeclarations', \"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.\"),\n ...jsonSubset,\n },\n 'editor.gotoLocation.multipleImplementations': {\n description: nls.localize('editor.editor.gotoLocation.multipleImplemenattions', \"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.\"),\n ...jsonSubset,\n },\n 'editor.gotoLocation.multipleReferences': {\n description: nls.localize('editor.editor.gotoLocation.multipleReferences', \"Controls the behavior the 'Go to References'-command when multiple target locations exist.\"),\n ...jsonSubset,\n },\n 'editor.gotoLocation.alternativeDefinitionCommand': {\n type: 'string',\n default: defaults.alternativeDefinitionCommand,\n enum: alternativeCommandOptions,\n description: nls.localize('alternativeDefinitionCommand', \"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.\")\n },\n 'editor.gotoLocation.alternativeTypeDefinitionCommand': {\n type: 'string',\n default: defaults.alternativeTypeDefinitionCommand,\n enum: alternativeCommandOptions,\n description: nls.localize('alternativeTypeDefinitionCommand', \"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.\")\n },\n 'editor.gotoLocation.alternativeDeclarationCommand': {\n type: 'string',\n default: defaults.alternativeDeclarationCommand,\n enum: alternativeCommandOptions,\n description: nls.localize('alternativeDeclarationCommand', \"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.\")\n },\n 'editor.gotoLocation.alternativeImplementationCommand': {\n type: 'string',\n default: defaults.alternativeImplementationCommand,\n enum: alternativeCommandOptions,\n description: nls.localize('alternativeImplementationCommand', \"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.\")\n },\n 'editor.gotoLocation.alternativeReferenceCommand': {\n type: 'string',\n default: defaults.alternativeReferenceCommand,\n enum: alternativeCommandOptions,\n description: nls.localize('alternativeReferenceCommand', \"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.\")\n },\n });\n }\n validate(_input) {\n var _a, _b, _c, _d, _e;\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n multiple: stringSet(input.multiple, this.defaultValue.multiple, ['peek', 'gotoAndPeek', 'goto']),\n multipleDefinitions: (_a = input.multipleDefinitions) !== null && _a !== void 0 ? _a : stringSet(input.multipleDefinitions, 'peek', ['peek', 'gotoAndPeek', 'goto']),\n multipleTypeDefinitions: (_b = input.multipleTypeDefinitions) !== null && _b !== void 0 ? _b : stringSet(input.multipleTypeDefinitions, 'peek', ['peek', 'gotoAndPeek', 'goto']),\n multipleDeclarations: (_c = input.multipleDeclarations) !== null && _c !== void 0 ? _c : stringSet(input.multipleDeclarations, 'peek', ['peek', 'gotoAndPeek', 'goto']),\n multipleImplementations: (_d = input.multipleImplementations) !== null && _d !== void 0 ? _d : stringSet(input.multipleImplementations, 'peek', ['peek', 'gotoAndPeek', 'goto']),\n multipleReferences: (_e = input.multipleReferences) !== null && _e !== void 0 ? _e : stringSet(input.multipleReferences, 'peek', ['peek', 'gotoAndPeek', 'goto']),\n alternativeDefinitionCommand: EditorStringOption.string(input.alternativeDefinitionCommand, this.defaultValue.alternativeDefinitionCommand),\n alternativeTypeDefinitionCommand: EditorStringOption.string(input.alternativeTypeDefinitionCommand, this.defaultValue.alternativeTypeDefinitionCommand),\n alternativeDeclarationCommand: EditorStringOption.string(input.alternativeDeclarationCommand, this.defaultValue.alternativeDeclarationCommand),\n alternativeImplementationCommand: EditorStringOption.string(input.alternativeImplementationCommand, this.defaultValue.alternativeImplementationCommand),\n alternativeReferenceCommand: EditorStringOption.string(input.alternativeReferenceCommand, this.defaultValue.alternativeReferenceCommand),\n };\n }\n}\nclass EditorHover extends BaseEditorOption {\n constructor() {\n const defaults = {\n enabled: true,\n delay: 300,\n hidingDelay: 300,\n sticky: true,\n above: true,\n };\n super(60 /* EditorOption.hover */, 'hover', defaults, {\n 'editor.hover.enabled': {\n type: 'boolean',\n default: defaults.enabled,\n description: nls.localize('hover.enabled', \"Controls whether the hover is shown.\")\n },\n 'editor.hover.delay': {\n type: 'number',\n default: defaults.delay,\n minimum: 0,\n maximum: 10000,\n description: nls.localize('hover.delay', \"Controls the delay in milliseconds after which the hover is shown.\")\n },\n 'editor.hover.sticky': {\n type: 'boolean',\n default: defaults.sticky,\n description: nls.localize('hover.sticky', \"Controls whether the hover should remain visible when mouse is moved over it.\")\n },\n 'editor.hover.hidingDelay': {\n type: 'integer',\n minimum: 0,\n default: defaults.hidingDelay,\n description: nls.localize('hover.hidingDelay', \"Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.\")\n },\n 'editor.hover.above': {\n type: 'boolean',\n default: defaults.above,\n description: nls.localize('hover.above', \"Prefer showing hovers above the line, if there's space.\")\n },\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n enabled: boolean(input.enabled, this.defaultValue.enabled),\n delay: EditorIntOption.clampedInt(input.delay, this.defaultValue.delay, 0, 10000),\n sticky: boolean(input.sticky, this.defaultValue.sticky),\n hidingDelay: EditorIntOption.clampedInt(input.hidingDelay, this.defaultValue.hidingDelay, 0, 600000),\n above: boolean(input.above, this.defaultValue.above),\n };\n }\n}\n/**\n * @internal\n */\nexport class EditorLayoutInfoComputer extends ComputedEditorOption {\n constructor() {\n super(143 /* EditorOption.layoutInfo */);\n }\n compute(env, options, _) {\n return EditorLayoutInfoComputer.computeLayout(options, {\n memory: env.memory,\n outerWidth: env.outerWidth,\n outerHeight: env.outerHeight,\n isDominatedByLongLines: env.isDominatedByLongLines,\n lineHeight: env.fontInfo.lineHeight,\n viewLineCount: env.viewLineCount,\n lineNumbersDigitCount: env.lineNumbersDigitCount,\n typicalHalfwidthCharacterWidth: env.fontInfo.typicalHalfwidthCharacterWidth,\n maxDigitWidth: env.fontInfo.maxDigitWidth,\n pixelRatio: env.pixelRatio,\n glyphMarginDecorationLaneCount: env.glyphMarginDecorationLaneCount\n });\n }\n static computeContainedMinimapLineCount(input) {\n const typicalViewportLineCount = input.height / input.lineHeight;\n const extraLinesBeforeFirstLine = Math.floor(input.paddingTop / input.lineHeight);\n let extraLinesBeyondLastLine = Math.floor(input.paddingBottom / input.lineHeight);\n if (input.scrollBeyondLastLine) {\n extraLinesBeyondLastLine = Math.max(extraLinesBeyondLastLine, typicalViewportLineCount - 1);\n }\n const desiredRatio = (extraLinesBeforeFirstLine + input.viewLineCount + extraLinesBeyondLastLine) / (input.pixelRatio * input.height);\n const minimapLineCount = Math.floor(input.viewLineCount / desiredRatio);\n return { typicalViewportLineCount, extraLinesBeforeFirstLine, extraLinesBeyondLastLine, desiredRatio, minimapLineCount };\n }\n static _computeMinimapLayout(input, memory) {\n const outerWidth = input.outerWidth;\n const outerHeight = input.outerHeight;\n const pixelRatio = input.pixelRatio;\n if (!input.minimap.enabled) {\n return {\n renderMinimap: 0 /* RenderMinimap.None */,\n minimapLeft: 0,\n minimapWidth: 0,\n minimapHeightIsEditorHeight: false,\n minimapIsSampling: false,\n minimapScale: 1,\n minimapLineHeight: 1,\n minimapCanvasInnerWidth: 0,\n minimapCanvasInnerHeight: Math.floor(pixelRatio * outerHeight),\n minimapCanvasOuterWidth: 0,\n minimapCanvasOuterHeight: outerHeight,\n };\n }\n // Can use memory if only the `viewLineCount` and `remainingWidth` have changed\n const stableMinimapLayoutInput = memory.stableMinimapLayoutInput;\n const couldUseMemory = (stableMinimapLayoutInput\n // && input.outerWidth === lastMinimapLayoutInput.outerWidth !!! INTENTIONAL OMITTED\n && input.outerHeight === stableMinimapLayoutInput.outerHeight\n && input.lineHeight === stableMinimapLayoutInput.lineHeight\n && input.typicalHalfwidthCharacterWidth === stableMinimapLayoutInput.typicalHalfwidthCharacterWidth\n && input.pixelRatio === stableMinimapLayoutInput.pixelRatio\n && input.scrollBeyondLastLine === stableMinimapLayoutInput.scrollBeyondLastLine\n && input.paddingTop === stableMinimapLayoutInput.paddingTop\n && input.paddingBottom === stableMinimapLayoutInput.paddingBottom\n && input.minimap.enabled === stableMinimapLayoutInput.minimap.enabled\n && input.minimap.side === stableMinimapLayoutInput.minimap.side\n && input.minimap.size === stableMinimapLayoutInput.minimap.size\n && input.minimap.showSlider === stableMinimapLayoutInput.minimap.showSlider\n && input.minimap.renderCharacters === stableMinimapLayoutInput.minimap.renderCharacters\n && input.minimap.maxColumn === stableMinimapLayoutInput.minimap.maxColumn\n && input.minimap.scale === stableMinimapLayoutInput.minimap.scale\n && input.verticalScrollbarWidth === stableMinimapLayoutInput.verticalScrollbarWidth\n // && input.viewLineCount === lastMinimapLayoutInput.viewLineCount !!! INTENTIONAL OMITTED\n // && input.remainingWidth === lastMinimapLayoutInput.remainingWidth !!! INTENTIONAL OMITTED\n && input.isViewportWrapping === stableMinimapLayoutInput.isViewportWrapping);\n const lineHeight = input.lineHeight;\n const typicalHalfwidthCharacterWidth = input.typicalHalfwidthCharacterWidth;\n const scrollBeyondLastLine = input.scrollBeyondLastLine;\n const minimapRenderCharacters = input.minimap.renderCharacters;\n let minimapScale = (pixelRatio >= 2 ? Math.round(input.minimap.scale * 2) : input.minimap.scale);\n const minimapMaxColumn = input.minimap.maxColumn;\n const minimapSize = input.minimap.size;\n const minimapSide = input.minimap.side;\n const verticalScrollbarWidth = input.verticalScrollbarWidth;\n const viewLineCount = input.viewLineCount;\n const remainingWidth = input.remainingWidth;\n const isViewportWrapping = input.isViewportWrapping;\n const baseCharHeight = minimapRenderCharacters ? 2 : 3;\n let minimapCanvasInnerHeight = Math.floor(pixelRatio * outerHeight);\n const minimapCanvasOuterHeight = minimapCanvasInnerHeight / pixelRatio;\n let minimapHeightIsEditorHeight = false;\n let minimapIsSampling = false;\n let minimapLineHeight = baseCharHeight * minimapScale;\n let minimapCharWidth = minimapScale / pixelRatio;\n let minimapWidthMultiplier = 1;\n if (minimapSize === 'fill' || minimapSize === 'fit') {\n const { typicalViewportLineCount, extraLinesBeforeFirstLine, extraLinesBeyondLastLine, desiredRatio, minimapLineCount } = EditorLayoutInfoComputer.computeContainedMinimapLineCount({\n viewLineCount: viewLineCount,\n scrollBeyondLastLine: scrollBeyondLastLine,\n paddingTop: input.paddingTop,\n paddingBottom: input.paddingBottom,\n height: outerHeight,\n lineHeight: lineHeight,\n pixelRatio: pixelRatio\n });\n // ratio is intentionally not part of the layout to avoid the layout changing all the time\n // when doing sampling\n const ratio = viewLineCount / minimapLineCount;\n if (ratio > 1) {\n minimapHeightIsEditorHeight = true;\n minimapIsSampling = true;\n minimapScale = 1;\n minimapLineHeight = 1;\n minimapCharWidth = minimapScale / pixelRatio;\n }\n else {\n let fitBecomesFill = false;\n let maxMinimapScale = minimapScale + 1;\n if (minimapSize === 'fit') {\n const effectiveMinimapHeight = Math.ceil((extraLinesBeforeFirstLine + viewLineCount + extraLinesBeyondLastLine) * minimapLineHeight);\n if (isViewportWrapping && couldUseMemory && remainingWidth <= memory.stableFitRemainingWidth) {\n // There is a loop when using `fit` and viewport wrapping:\n // - view line count impacts minimap layout\n // - minimap layout impacts viewport width\n // - viewport width impacts view line count\n // To break the loop, once we go to a smaller minimap scale, we try to stick with it.\n fitBecomesFill = true;\n maxMinimapScale = memory.stableFitMaxMinimapScale;\n }\n else {\n fitBecomesFill = (effectiveMinimapHeight > minimapCanvasInnerHeight);\n }\n }\n if (minimapSize === 'fill' || fitBecomesFill) {\n minimapHeightIsEditorHeight = true;\n const configuredMinimapScale = minimapScale;\n minimapLineHeight = Math.min(lineHeight * pixelRatio, Math.max(1, Math.floor(1 / desiredRatio)));\n if (isViewportWrapping && couldUseMemory && remainingWidth <= memory.stableFitRemainingWidth) {\n // There is a loop when using `fill` and viewport wrapping:\n // - view line count impacts minimap layout\n // - minimap layout impacts viewport width\n // - viewport width impacts view line count\n // To break the loop, once we go to a smaller minimap scale, we try to stick with it.\n maxMinimapScale = memory.stableFitMaxMinimapScale;\n }\n minimapScale = Math.min(maxMinimapScale, Math.max(1, Math.floor(minimapLineHeight / baseCharHeight)));\n if (minimapScale > configuredMinimapScale) {\n minimapWidthMultiplier = Math.min(2, minimapScale / configuredMinimapScale);\n }\n minimapCharWidth = minimapScale / pixelRatio / minimapWidthMultiplier;\n minimapCanvasInnerHeight = Math.ceil((Math.max(typicalViewportLineCount, extraLinesBeforeFirstLine + viewLineCount + extraLinesBeyondLastLine)) * minimapLineHeight);\n if (isViewportWrapping) {\n // remember for next time\n memory.stableMinimapLayoutInput = input;\n memory.stableFitRemainingWidth = remainingWidth;\n memory.stableFitMaxMinimapScale = minimapScale;\n }\n else {\n memory.stableMinimapLayoutInput = null;\n memory.stableFitRemainingWidth = 0;\n }\n }\n }\n }\n // Given:\n // (leaving 2px for the cursor to have space after the last character)\n // viewportColumn = (contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth\n // minimapWidth = viewportColumn * minimapCharWidth\n // contentWidth = remainingWidth - minimapWidth\n // What are good values for contentWidth and minimapWidth ?\n // minimapWidth = ((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth) * minimapCharWidth\n // typicalHalfwidthCharacterWidth * minimapWidth = (contentWidth - verticalScrollbarWidth - 2) * minimapCharWidth\n // typicalHalfwidthCharacterWidth * minimapWidth = (remainingWidth - minimapWidth - verticalScrollbarWidth - 2) * minimapCharWidth\n // (typicalHalfwidthCharacterWidth + minimapCharWidth) * minimapWidth = (remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth\n // minimapWidth = ((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth)\n const minimapMaxWidth = Math.floor(minimapMaxColumn * minimapCharWidth);\n const minimapWidth = Math.min(minimapMaxWidth, Math.max(0, Math.floor(((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth))) + MINIMAP_GUTTER_WIDTH);\n let minimapCanvasInnerWidth = Math.floor(pixelRatio * minimapWidth);\n const minimapCanvasOuterWidth = minimapCanvasInnerWidth / pixelRatio;\n minimapCanvasInnerWidth = Math.floor(minimapCanvasInnerWidth * minimapWidthMultiplier);\n const renderMinimap = (minimapRenderCharacters ? 1 /* RenderMinimap.Text */ : 2 /* RenderMinimap.Blocks */);\n const minimapLeft = (minimapSide === 'left' ? 0 : (outerWidth - minimapWidth - verticalScrollbarWidth));\n return {\n renderMinimap,\n minimapLeft,\n minimapWidth,\n minimapHeightIsEditorHeight,\n minimapIsSampling,\n minimapScale,\n minimapLineHeight,\n minimapCanvasInnerWidth,\n minimapCanvasInnerHeight,\n minimapCanvasOuterWidth,\n minimapCanvasOuterHeight,\n };\n }\n static computeLayout(options, env) {\n const outerWidth = env.outerWidth | 0;\n const outerHeight = env.outerHeight | 0;\n const lineHeight = env.lineHeight | 0;\n const lineNumbersDigitCount = env.lineNumbersDigitCount | 0;\n const typicalHalfwidthCharacterWidth = env.typicalHalfwidthCharacterWidth;\n const maxDigitWidth = env.maxDigitWidth;\n const pixelRatio = env.pixelRatio;\n const viewLineCount = env.viewLineCount;\n const wordWrapOverride2 = options.get(135 /* EditorOption.wordWrapOverride2 */);\n const wordWrapOverride1 = (wordWrapOverride2 === 'inherit' ? options.get(134 /* EditorOption.wordWrapOverride1 */) : wordWrapOverride2);\n const wordWrap = (wordWrapOverride1 === 'inherit' ? options.get(130 /* EditorOption.wordWrap */) : wordWrapOverride1);\n const wordWrapColumn = options.get(133 /* EditorOption.wordWrapColumn */);\n const isDominatedByLongLines = env.isDominatedByLongLines;\n const showGlyphMargin = options.get(57 /* EditorOption.glyphMargin */);\n const showLineNumbers = (options.get(67 /* EditorOption.lineNumbers */).renderType !== 0 /* RenderLineNumbersType.Off */);\n const lineNumbersMinChars = options.get(68 /* EditorOption.lineNumbersMinChars */);\n const scrollBeyondLastLine = options.get(104 /* EditorOption.scrollBeyondLastLine */);\n const padding = options.get(83 /* EditorOption.padding */);\n const minimap = options.get(72 /* EditorOption.minimap */);\n const scrollbar = options.get(102 /* EditorOption.scrollbar */);\n const verticalScrollbarWidth = scrollbar.verticalScrollbarSize;\n const verticalScrollbarHasArrows = scrollbar.verticalHasArrows;\n const scrollbarArrowSize = scrollbar.arrowSize;\n const horizontalScrollbarHeight = scrollbar.horizontalScrollbarSize;\n const folding = options.get(43 /* EditorOption.folding */);\n const showFoldingDecoration = options.get(109 /* EditorOption.showFoldingControls */) !== 'never';\n let lineDecorationsWidth = options.get(65 /* EditorOption.lineDecorationsWidth */);\n if (folding && showFoldingDecoration) {\n lineDecorationsWidth += 16;\n }\n let lineNumbersWidth = 0;\n if (showLineNumbers) {\n const digitCount = Math.max(lineNumbersDigitCount, lineNumbersMinChars);\n lineNumbersWidth = Math.round(digitCount * maxDigitWidth);\n }\n let glyphMarginWidth = 0;\n if (showGlyphMargin) {\n glyphMarginWidth = lineHeight * env.glyphMarginDecorationLaneCount;\n }\n let glyphMarginLeft = 0;\n let lineNumbersLeft = glyphMarginLeft + glyphMarginWidth;\n let decorationsLeft = lineNumbersLeft + lineNumbersWidth;\n let contentLeft = decorationsLeft + lineDecorationsWidth;\n const remainingWidth = outerWidth - glyphMarginWidth - lineNumbersWidth - lineDecorationsWidth;\n let isWordWrapMinified = false;\n let isViewportWrapping = false;\n let wrappingColumn = -1;\n if (wordWrapOverride1 === 'inherit' && isDominatedByLongLines) {\n // Force viewport width wrapping if model is dominated by long lines\n isWordWrapMinified = true;\n isViewportWrapping = true;\n }\n else if (wordWrap === 'on' || wordWrap === 'bounded') {\n isViewportWrapping = true;\n }\n else if (wordWrap === 'wordWrapColumn') {\n wrappingColumn = wordWrapColumn;\n }\n const minimapLayout = EditorLayoutInfoComputer._computeMinimapLayout({\n outerWidth: outerWidth,\n outerHeight: outerHeight,\n lineHeight: lineHeight,\n typicalHalfwidthCharacterWidth: typicalHalfwidthCharacterWidth,\n pixelRatio: pixelRatio,\n scrollBeyondLastLine: scrollBeyondLastLine,\n paddingTop: padding.top,\n paddingBottom: padding.bottom,\n minimap: minimap,\n verticalScrollbarWidth: verticalScrollbarWidth,\n viewLineCount: viewLineCount,\n remainingWidth: remainingWidth,\n isViewportWrapping: isViewportWrapping,\n }, env.memory || new ComputeOptionsMemory());\n if (minimapLayout.renderMinimap !== 0 /* RenderMinimap.None */ && minimapLayout.minimapLeft === 0) {\n // the minimap is rendered to the left, so move everything to the right\n glyphMarginLeft += minimapLayout.minimapWidth;\n lineNumbersLeft += minimapLayout.minimapWidth;\n decorationsLeft += minimapLayout.minimapWidth;\n contentLeft += minimapLayout.minimapWidth;\n }\n const contentWidth = remainingWidth - minimapLayout.minimapWidth;\n // (leaving 2px for the cursor to have space after the last character)\n const viewportColumn = Math.max(1, Math.floor((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth));\n const verticalArrowSize = (verticalScrollbarHasArrows ? scrollbarArrowSize : 0);\n if (isViewportWrapping) {\n // compute the actual wrappingColumn\n wrappingColumn = Math.max(1, viewportColumn);\n if (wordWrap === 'bounded') {\n wrappingColumn = Math.min(wrappingColumn, wordWrapColumn);\n }\n }\n return {\n width: outerWidth,\n height: outerHeight,\n glyphMarginLeft: glyphMarginLeft,\n glyphMarginWidth: glyphMarginWidth,\n glyphMarginDecorationLaneCount: env.glyphMarginDecorationLaneCount,\n lineNumbersLeft: lineNumbersLeft,\n lineNumbersWidth: lineNumbersWidth,\n decorationsLeft: decorationsLeft,\n decorationsWidth: lineDecorationsWidth,\n contentLeft: contentLeft,\n contentWidth: contentWidth,\n minimap: minimapLayout,\n viewportColumn: viewportColumn,\n isWordWrapMinified: isWordWrapMinified,\n isViewportWrapping: isViewportWrapping,\n wrappingColumn: wrappingColumn,\n verticalScrollbarWidth: verticalScrollbarWidth,\n horizontalScrollbarHeight: horizontalScrollbarHeight,\n overviewRuler: {\n top: verticalArrowSize,\n width: verticalScrollbarWidth,\n height: (outerHeight - 2 * verticalArrowSize),\n right: 0\n }\n };\n }\n}\n//#endregion\n//#region WrappingStrategy\nclass WrappingStrategy extends BaseEditorOption {\n constructor() {\n super(137 /* EditorOption.wrappingStrategy */, 'wrappingStrategy', 'simple', {\n 'editor.wrappingStrategy': {\n enumDescriptions: [\n nls.localize('wrappingStrategy.simple', \"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width.\"),\n nls.localize('wrappingStrategy.advanced', \"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.\")\n ],\n type: 'string',\n enum: ['simple', 'advanced'],\n default: 'simple',\n description: nls.localize('wrappingStrategy', \"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.\")\n }\n });\n }\n validate(input) {\n return stringSet(input, 'simple', ['simple', 'advanced']);\n }\n compute(env, options, value) {\n const accessibilitySupport = options.get(2 /* EditorOption.accessibilitySupport */);\n if (accessibilitySupport === 2 /* AccessibilitySupport.Enabled */) {\n // if we know for a fact that a screen reader is attached, we switch our strategy to advanced to\n // help that the editor's wrapping points match the textarea's wrapping points\n return 'advanced';\n }\n return value;\n }\n}\n//#endregion\n//#region lightbulb\nexport var ShowLightbulbIconMode;\n(function (ShowLightbulbIconMode) {\n ShowLightbulbIconMode[\"Off\"] = \"off\";\n ShowLightbulbIconMode[\"OnCode\"] = \"onCode\";\n ShowLightbulbIconMode[\"On\"] = \"on\";\n})(ShowLightbulbIconMode || (ShowLightbulbIconMode = {}));\nclass EditorLightbulb extends BaseEditorOption {\n constructor() {\n const defaults = { enabled: ShowLightbulbIconMode.OnCode };\n super(64 /* EditorOption.lightbulb */, 'lightbulb', defaults, {\n 'editor.lightbulb.enabled': {\n type: 'string',\n tags: ['experimental'],\n enum: [ShowLightbulbIconMode.Off, ShowLightbulbIconMode.OnCode, ShowLightbulbIconMode.On],\n default: defaults.enabled,\n enumDescriptions: [\n nls.localize('editor.lightbulb.enabled.off', 'Disable the code action menu.'),\n nls.localize('editor.lightbulb.enabled.onCode', 'Show the code action menu when the cursor is on lines with code.'),\n nls.localize('editor.lightbulb.enabled.on', 'Show the code action menu when the cursor is on lines with code or on empty lines.'),\n ],\n description: nls.localize('enabled', \"Enables the Code Action lightbulb in the editor.\")\n }\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n enabled: stringSet(input.enabled, this.defaultValue.enabled, [ShowLightbulbIconMode.Off, ShowLightbulbIconMode.OnCode, ShowLightbulbIconMode.On])\n };\n }\n}\nclass EditorStickyScroll extends BaseEditorOption {\n constructor() {\n const defaults = { enabled: false, maxLineCount: 5, defaultModel: 'outlineModel', scrollWithEditor: true };\n super(114 /* EditorOption.stickyScroll */, 'stickyScroll', defaults, {\n 'editor.stickyScroll.enabled': {\n type: 'boolean',\n default: defaults.enabled,\n description: nls.localize('editor.stickyScroll.enabled', \"Shows the nested current scopes during the scroll at the top of the editor.\"),\n tags: ['experimental']\n },\n 'editor.stickyScroll.maxLineCount': {\n type: 'number',\n default: defaults.maxLineCount,\n minimum: 1,\n maximum: 10,\n description: nls.localize('editor.stickyScroll.maxLineCount', \"Defines the maximum number of sticky lines to show.\")\n },\n 'editor.stickyScroll.defaultModel': {\n type: 'string',\n enum: ['outlineModel', 'foldingProviderModel', 'indentationModel'],\n default: defaults.defaultModel,\n description: nls.localize('editor.stickyScroll.defaultModel', \"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.\")\n },\n 'editor.stickyScroll.scrollWithEditor': {\n type: 'boolean',\n default: defaults.scrollWithEditor,\n description: nls.localize('editor.stickyScroll.scrollWithEditor', \"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.\")\n },\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n enabled: boolean(input.enabled, this.defaultValue.enabled),\n maxLineCount: EditorIntOption.clampedInt(input.maxLineCount, this.defaultValue.maxLineCount, 1, 10),\n defaultModel: stringSet(input.defaultModel, this.defaultValue.defaultModel, ['outlineModel', 'foldingProviderModel', 'indentationModel']),\n scrollWithEditor: boolean(input.scrollWithEditor, this.defaultValue.scrollWithEditor)\n };\n }\n}\nclass EditorInlayHints extends BaseEditorOption {\n constructor() {\n const defaults = { enabled: 'on', fontSize: 0, fontFamily: '', padding: false };\n super(139 /* EditorOption.inlayHints */, 'inlayHints', defaults, {\n 'editor.inlayHints.enabled': {\n type: 'string',\n default: defaults.enabled,\n description: nls.localize('inlayHints.enable', \"Enables the inlay hints in the editor.\"),\n enum: ['on', 'onUnlessPressed', 'offUnlessPressed', 'off'],\n markdownEnumDescriptions: [\n nls.localize('editor.inlayHints.on', \"Inlay hints are enabled\"),\n nls.localize('editor.inlayHints.onUnlessPressed', \"Inlay hints are showing by default and hide when holding {0}\", platform.isMacintosh ? `Ctrl+Option` : `Ctrl+Alt`),\n nls.localize('editor.inlayHints.offUnlessPressed', \"Inlay hints are hidden by default and show when holding {0}\", platform.isMacintosh ? `Ctrl+Option` : `Ctrl+Alt`),\n nls.localize('editor.inlayHints.off', \"Inlay hints are disabled\"),\n ],\n },\n 'editor.inlayHints.fontSize': {\n type: 'number',\n default: defaults.fontSize,\n markdownDescription: nls.localize('inlayHints.fontSize', \"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.\", '`#editor.fontSize#`', '`5`')\n },\n 'editor.inlayHints.fontFamily': {\n type: 'string',\n default: defaults.fontFamily,\n markdownDescription: nls.localize('inlayHints.fontFamily', \"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.\", '`#editor.fontFamily#`')\n },\n 'editor.inlayHints.padding': {\n type: 'boolean',\n default: defaults.padding,\n description: nls.localize('inlayHints.padding', \"Enables the padding around the inlay hints in the editor.\")\n }\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n if (typeof input.enabled === 'boolean') {\n input.enabled = input.enabled ? 'on' : 'off';\n }\n return {\n enabled: stringSet(input.enabled, this.defaultValue.enabled, ['on', 'off', 'offUnlessPressed', 'onUnlessPressed']),\n fontSize: EditorIntOption.clampedInt(input.fontSize, this.defaultValue.fontSize, 0, 100),\n fontFamily: EditorStringOption.string(input.fontFamily, this.defaultValue.fontFamily),\n padding: boolean(input.padding, this.defaultValue.padding)\n };\n }\n}\n//#endregion\n//#region lineDecorationsWidth\nclass EditorLineDecorationsWidth extends BaseEditorOption {\n constructor() {\n super(65 /* EditorOption.lineDecorationsWidth */, 'lineDecorationsWidth', 10);\n }\n validate(input) {\n if (typeof input === 'string' && /^\\d+(\\.\\d+)?ch$/.test(input)) {\n const multiple = parseFloat(input.substring(0, input.length - 2));\n return -multiple; // negative numbers signal a multiple\n }\n else {\n return EditorIntOption.clampedInt(input, this.defaultValue, 0, 1000);\n }\n }\n compute(env, options, value) {\n if (value < 0) {\n // negative numbers signal a multiple\n return EditorIntOption.clampedInt(-value * env.fontInfo.typicalHalfwidthCharacterWidth, this.defaultValue, 0, 1000);\n }\n else {\n return value;\n }\n }\n}\n//#endregion\n//#region lineHeight\nclass EditorLineHeight extends EditorFloatOption {\n constructor() {\n super(66 /* EditorOption.lineHeight */, 'lineHeight', EDITOR_FONT_DEFAULTS.lineHeight, x => EditorFloatOption.clamp(x, 0, 150), { markdownDescription: nls.localize('lineHeight', \"Controls the line height. \\n - Use 0 to automatically compute the line height from the font size.\\n - Values between 0 and 8 will be used as a multiplier with the font size.\\n - Values greater than or equal to 8 will be used as effective values.\") });\n }\n compute(env, options, value) {\n // The lineHeight is computed from the fontSize if it is 0.\n // Moreover, the final lineHeight respects the editor zoom level.\n // So take the result from env.fontInfo\n return env.fontInfo.lineHeight;\n }\n}\nclass EditorMinimap extends BaseEditorOption {\n constructor() {\n const defaults = {\n enabled: true,\n size: 'proportional',\n side: 'right',\n showSlider: 'mouseover',\n autohide: false,\n renderCharacters: true,\n maxColumn: 120,\n scale: 1,\n };\n super(72 /* EditorOption.minimap */, 'minimap', defaults, {\n 'editor.minimap.enabled': {\n type: 'boolean',\n default: defaults.enabled,\n description: nls.localize('minimap.enabled', \"Controls whether the minimap is shown.\")\n },\n 'editor.minimap.autohide': {\n type: 'boolean',\n default: defaults.autohide,\n description: nls.localize('minimap.autohide', \"Controls whether the minimap is hidden automatically.\")\n },\n 'editor.minimap.size': {\n type: 'string',\n enum: ['proportional', 'fill', 'fit'],\n enumDescriptions: [\n nls.localize('minimap.size.proportional', \"The minimap has the same size as the editor contents (and might scroll).\"),\n nls.localize('minimap.size.fill', \"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling).\"),\n nls.localize('minimap.size.fit', \"The minimap will shrink as necessary to never be larger than the editor (no scrolling).\"),\n ],\n default: defaults.size,\n description: nls.localize('minimap.size', \"Controls the size of the minimap.\")\n },\n 'editor.minimap.side': {\n type: 'string',\n enum: ['left', 'right'],\n default: defaults.side,\n description: nls.localize('minimap.side', \"Controls the side where to render the minimap.\")\n },\n 'editor.minimap.showSlider': {\n type: 'string',\n enum: ['always', 'mouseover'],\n default: defaults.showSlider,\n description: nls.localize('minimap.showSlider', \"Controls when the minimap slider is shown.\")\n },\n 'editor.minimap.scale': {\n type: 'number',\n default: defaults.scale,\n minimum: 1,\n maximum: 3,\n enum: [1, 2, 3],\n description: nls.localize('minimap.scale', \"Scale of content drawn in the minimap: 1, 2 or 3.\")\n },\n 'editor.minimap.renderCharacters': {\n type: 'boolean',\n default: defaults.renderCharacters,\n description: nls.localize('minimap.renderCharacters', \"Render the actual characters on a line as opposed to color blocks.\")\n },\n 'editor.minimap.maxColumn': {\n type: 'number',\n default: defaults.maxColumn,\n description: nls.localize('minimap.maxColumn', \"Limit the width of the minimap to render at most a certain number of columns.\")\n }\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n enabled: boolean(input.enabled, this.defaultValue.enabled),\n autohide: boolean(input.autohide, this.defaultValue.autohide),\n size: stringSet(input.size, this.defaultValue.size, ['proportional', 'fill', 'fit']),\n side: stringSet(input.side, this.defaultValue.side, ['right', 'left']),\n showSlider: stringSet(input.showSlider, this.defaultValue.showSlider, ['always', 'mouseover']),\n renderCharacters: boolean(input.renderCharacters, this.defaultValue.renderCharacters),\n scale: EditorIntOption.clampedInt(input.scale, 1, 1, 3),\n maxColumn: EditorIntOption.clampedInt(input.maxColumn, this.defaultValue.maxColumn, 1, 10000),\n };\n }\n}\n//#endregion\n//#region multiCursorModifier\nfunction _multiCursorModifierFromString(multiCursorModifier) {\n if (multiCursorModifier === 'ctrlCmd') {\n return (platform.isMacintosh ? 'metaKey' : 'ctrlKey');\n }\n return 'altKey';\n}\nclass EditorPadding extends BaseEditorOption {\n constructor() {\n super(83 /* EditorOption.padding */, 'padding', { top: 0, bottom: 0 }, {\n 'editor.padding.top': {\n type: 'number',\n default: 0,\n minimum: 0,\n maximum: 1000,\n description: nls.localize('padding.top', \"Controls the amount of space between the top edge of the editor and the first line.\")\n },\n 'editor.padding.bottom': {\n type: 'number',\n default: 0,\n minimum: 0,\n maximum: 1000,\n description: nls.localize('padding.bottom', \"Controls the amount of space between the bottom edge of the editor and the last line.\")\n }\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n top: EditorIntOption.clampedInt(input.top, 0, 0, 1000),\n bottom: EditorIntOption.clampedInt(input.bottom, 0, 0, 1000)\n };\n }\n}\nclass EditorParameterHints extends BaseEditorOption {\n constructor() {\n const defaults = {\n enabled: true,\n cycle: true\n };\n super(85 /* EditorOption.parameterHints */, 'parameterHints', defaults, {\n 'editor.parameterHints.enabled': {\n type: 'boolean',\n default: defaults.enabled,\n description: nls.localize('parameterHints.enabled', \"Enables a pop-up that shows parameter documentation and type information as you type.\")\n },\n 'editor.parameterHints.cycle': {\n type: 'boolean',\n default: defaults.cycle,\n description: nls.localize('parameterHints.cycle', \"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.\")\n },\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n enabled: boolean(input.enabled, this.defaultValue.enabled),\n cycle: boolean(input.cycle, this.defaultValue.cycle)\n };\n }\n}\n//#endregion\n//#region pixelRatio\nclass EditorPixelRatio extends ComputedEditorOption {\n constructor() {\n super(141 /* EditorOption.pixelRatio */);\n }\n compute(env, options, _) {\n return env.pixelRatio;\n }\n}\nclass EditorQuickSuggestions extends BaseEditorOption {\n constructor() {\n const defaults = {\n other: 'on',\n comments: 'off',\n strings: 'off'\n };\n const types = [\n { type: 'boolean' },\n {\n type: 'string',\n enum: ['on', 'inline', 'off'],\n enumDescriptions: [nls.localize('on', \"Quick suggestions show inside the suggest widget\"), nls.localize('inline', \"Quick suggestions show as ghost text\"), nls.localize('off', \"Quick suggestions are disabled\")]\n }\n ];\n super(88 /* EditorOption.quickSuggestions */, 'quickSuggestions', defaults, {\n type: 'object',\n additionalProperties: false,\n properties: {\n strings: {\n anyOf: types,\n default: defaults.strings,\n description: nls.localize('quickSuggestions.strings', \"Enable quick suggestions inside strings.\")\n },\n comments: {\n anyOf: types,\n default: defaults.comments,\n description: nls.localize('quickSuggestions.comments', \"Enable quick suggestions inside comments.\")\n },\n other: {\n anyOf: types,\n default: defaults.other,\n description: nls.localize('quickSuggestions.other', \"Enable quick suggestions outside of strings and comments.\")\n },\n },\n default: defaults,\n markdownDescription: nls.localize('quickSuggestions', \"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.\", `#editor.suggestOnTriggerCharacters#`)\n });\n this.defaultValue = defaults;\n }\n validate(input) {\n if (typeof input === 'boolean') {\n // boolean -> all on/off\n const value = input ? 'on' : 'off';\n return { comments: value, strings: value, other: value };\n }\n if (!input || typeof input !== 'object') {\n // invalid object\n return this.defaultValue;\n }\n const { other, comments, strings } = input;\n const allowedValues = ['on', 'inline', 'off'];\n let validatedOther;\n let validatedComments;\n let validatedStrings;\n if (typeof other === 'boolean') {\n validatedOther = other ? 'on' : 'off';\n }\n else {\n validatedOther = stringSet(other, this.defaultValue.other, allowedValues);\n }\n if (typeof comments === 'boolean') {\n validatedComments = comments ? 'on' : 'off';\n }\n else {\n validatedComments = stringSet(comments, this.defaultValue.comments, allowedValues);\n }\n if (typeof strings === 'boolean') {\n validatedStrings = strings ? 'on' : 'off';\n }\n else {\n validatedStrings = stringSet(strings, this.defaultValue.strings, allowedValues);\n }\n return {\n other: validatedOther,\n comments: validatedComments,\n strings: validatedStrings\n };\n }\n}\nclass EditorRenderLineNumbersOption extends BaseEditorOption {\n constructor() {\n super(67 /* EditorOption.lineNumbers */, 'lineNumbers', { renderType: 1 /* RenderLineNumbersType.On */, renderFn: null }, {\n type: 'string',\n enum: ['off', 'on', 'relative', 'interval'],\n enumDescriptions: [\n nls.localize('lineNumbers.off', \"Line numbers are not rendered.\"),\n nls.localize('lineNumbers.on', \"Line numbers are rendered as absolute number.\"),\n nls.localize('lineNumbers.relative', \"Line numbers are rendered as distance in lines to cursor position.\"),\n nls.localize('lineNumbers.interval', \"Line numbers are rendered every 10 lines.\")\n ],\n default: 'on',\n description: nls.localize('lineNumbers', \"Controls the display of line numbers.\")\n });\n }\n validate(lineNumbers) {\n let renderType = this.defaultValue.renderType;\n let renderFn = this.defaultValue.renderFn;\n if (typeof lineNumbers !== 'undefined') {\n if (typeof lineNumbers === 'function') {\n renderType = 4 /* RenderLineNumbersType.Custom */;\n renderFn = lineNumbers;\n }\n else if (lineNumbers === 'interval') {\n renderType = 3 /* RenderLineNumbersType.Interval */;\n }\n else if (lineNumbers === 'relative') {\n renderType = 2 /* RenderLineNumbersType.Relative */;\n }\n else if (lineNumbers === 'on') {\n renderType = 1 /* RenderLineNumbersType.On */;\n }\n else {\n renderType = 0 /* RenderLineNumbersType.Off */;\n }\n }\n return {\n renderType,\n renderFn\n };\n }\n}\n//#endregion\n//#region renderValidationDecorations\n/**\n * @internal\n */\nexport function filterValidationDecorations(options) {\n const renderValidationDecorations = options.get(97 /* EditorOption.renderValidationDecorations */);\n if (renderValidationDecorations === 'editable') {\n return options.get(90 /* EditorOption.readOnly */);\n }\n return renderValidationDecorations === 'on' ? false : true;\n}\nclass EditorRulers extends BaseEditorOption {\n constructor() {\n const defaults = [];\n const columnSchema = { type: 'number', description: nls.localize('rulers.size', \"Number of monospace characters at which this editor ruler will render.\") };\n super(101 /* EditorOption.rulers */, 'rulers', defaults, {\n type: 'array',\n items: {\n anyOf: [\n columnSchema,\n {\n type: [\n 'object'\n ],\n properties: {\n column: columnSchema,\n color: {\n type: 'string',\n description: nls.localize('rulers.color', \"Color of this editor ruler.\"),\n format: 'color-hex'\n }\n }\n }\n ]\n },\n default: defaults,\n description: nls.localize('rulers', \"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.\")\n });\n }\n validate(input) {\n if (Array.isArray(input)) {\n const rulers = [];\n for (const _element of input) {\n if (typeof _element === 'number') {\n rulers.push({\n column: EditorIntOption.clampedInt(_element, 0, 0, 10000),\n color: null\n });\n }\n else if (_element && typeof _element === 'object') {\n const element = _element;\n rulers.push({\n column: EditorIntOption.clampedInt(element.column, 0, 0, 10000),\n color: element.color\n });\n }\n }\n rulers.sort((a, b) => a.column - b.column);\n return rulers;\n }\n return this.defaultValue;\n }\n}\n//#endregion\n//#region readonly\n/**\n * Configuration options for readonly message\n */\nclass ReadonlyMessage extends BaseEditorOption {\n constructor() {\n const defaults = undefined;\n super(91 /* EditorOption.readOnlyMessage */, 'readOnlyMessage', defaults);\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n return _input;\n }\n}\nfunction _scrollbarVisibilityFromString(visibility, defaultValue) {\n if (typeof visibility !== 'string') {\n return defaultValue;\n }\n switch (visibility) {\n case 'hidden': return 2 /* ScrollbarVisibility.Hidden */;\n case 'visible': return 3 /* ScrollbarVisibility.Visible */;\n default: return 1 /* ScrollbarVisibility.Auto */;\n }\n}\nclass EditorScrollbar extends BaseEditorOption {\n constructor() {\n const defaults = {\n vertical: 1 /* ScrollbarVisibility.Auto */,\n horizontal: 1 /* ScrollbarVisibility.Auto */,\n arrowSize: 11,\n useShadows: true,\n verticalHasArrows: false,\n horizontalHasArrows: false,\n horizontalScrollbarSize: 12,\n horizontalSliderSize: 12,\n verticalScrollbarSize: 14,\n verticalSliderSize: 14,\n handleMouseWheel: true,\n alwaysConsumeMouseWheel: true,\n scrollByPage: false,\n ignoreHorizontalScrollbarInContentHeight: false,\n };\n super(102 /* EditorOption.scrollbar */, 'scrollbar', defaults, {\n 'editor.scrollbar.vertical': {\n type: 'string',\n enum: ['auto', 'visible', 'hidden'],\n enumDescriptions: [\n nls.localize('scrollbar.vertical.auto', \"The vertical scrollbar will be visible only when necessary.\"),\n nls.localize('scrollbar.vertical.visible', \"The vertical scrollbar will always be visible.\"),\n nls.localize('scrollbar.vertical.fit', \"The vertical scrollbar will always be hidden.\"),\n ],\n default: 'auto',\n description: nls.localize('scrollbar.vertical', \"Controls the visibility of the vertical scrollbar.\")\n },\n 'editor.scrollbar.horizontal': {\n type: 'string',\n enum: ['auto', 'visible', 'hidden'],\n enumDescriptions: [\n nls.localize('scrollbar.horizontal.auto', \"The horizontal scrollbar will be visible only when necessary.\"),\n nls.localize('scrollbar.horizontal.visible', \"The horizontal scrollbar will always be visible.\"),\n nls.localize('scrollbar.horizontal.fit', \"The horizontal scrollbar will always be hidden.\"),\n ],\n default: 'auto',\n description: nls.localize('scrollbar.horizontal', \"Controls the visibility of the horizontal scrollbar.\")\n },\n 'editor.scrollbar.verticalScrollbarSize': {\n type: 'number',\n default: defaults.verticalScrollbarSize,\n description: nls.localize('scrollbar.verticalScrollbarSize', \"The width of the vertical scrollbar.\")\n },\n 'editor.scrollbar.horizontalScrollbarSize': {\n type: 'number',\n default: defaults.horizontalScrollbarSize,\n description: nls.localize('scrollbar.horizontalScrollbarSize', \"The height of the horizontal scrollbar.\")\n },\n 'editor.scrollbar.scrollByPage': {\n type: 'boolean',\n default: defaults.scrollByPage,\n description: nls.localize('scrollbar.scrollByPage', \"Controls whether clicks scroll by page or jump to click position.\")\n },\n 'editor.scrollbar.ignoreHorizontalScrollbarInContentHeight': {\n type: 'boolean',\n default: defaults.ignoreHorizontalScrollbarInContentHeight,\n description: nls.localize('scrollbar.ignoreHorizontalScrollbarInContentHeight', \"When set, the horizontal scrollbar will not increase the size of the editor's content.\")\n }\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n const horizontalScrollbarSize = EditorIntOption.clampedInt(input.horizontalScrollbarSize, this.defaultValue.horizontalScrollbarSize, 0, 1000);\n const verticalScrollbarSize = EditorIntOption.clampedInt(input.verticalScrollbarSize, this.defaultValue.verticalScrollbarSize, 0, 1000);\n return {\n arrowSize: EditorIntOption.clampedInt(input.arrowSize, this.defaultValue.arrowSize, 0, 1000),\n vertical: _scrollbarVisibilityFromString(input.vertical, this.defaultValue.vertical),\n horizontal: _scrollbarVisibilityFromString(input.horizontal, this.defaultValue.horizontal),\n useShadows: boolean(input.useShadows, this.defaultValue.useShadows),\n verticalHasArrows: boolean(input.verticalHasArrows, this.defaultValue.verticalHasArrows),\n horizontalHasArrows: boolean(input.horizontalHasArrows, this.defaultValue.horizontalHasArrows),\n handleMouseWheel: boolean(input.handleMouseWheel, this.defaultValue.handleMouseWheel),\n alwaysConsumeMouseWheel: boolean(input.alwaysConsumeMouseWheel, this.defaultValue.alwaysConsumeMouseWheel),\n horizontalScrollbarSize: horizontalScrollbarSize,\n horizontalSliderSize: EditorIntOption.clampedInt(input.horizontalSliderSize, horizontalScrollbarSize, 0, 1000),\n verticalScrollbarSize: verticalScrollbarSize,\n verticalSliderSize: EditorIntOption.clampedInt(input.verticalSliderSize, verticalScrollbarSize, 0, 1000),\n scrollByPage: boolean(input.scrollByPage, this.defaultValue.scrollByPage),\n ignoreHorizontalScrollbarInContentHeight: boolean(input.ignoreHorizontalScrollbarInContentHeight, this.defaultValue.ignoreHorizontalScrollbarInContentHeight),\n };\n }\n}\n/**\n * @internal\n*/\nexport const inUntrustedWorkspace = 'inUntrustedWorkspace';\n/**\n * @internal\n */\nexport const unicodeHighlightConfigKeys = {\n allowedCharacters: 'editor.unicodeHighlight.allowedCharacters',\n invisibleCharacters: 'editor.unicodeHighlight.invisibleCharacters',\n nonBasicASCII: 'editor.unicodeHighlight.nonBasicASCII',\n ambiguousCharacters: 'editor.unicodeHighlight.ambiguousCharacters',\n includeComments: 'editor.unicodeHighlight.includeComments',\n includeStrings: 'editor.unicodeHighlight.includeStrings',\n allowedLocales: 'editor.unicodeHighlight.allowedLocales',\n};\nclass UnicodeHighlight extends BaseEditorOption {\n constructor() {\n const defaults = {\n nonBasicASCII: inUntrustedWorkspace,\n invisibleCharacters: true,\n ambiguousCharacters: true,\n includeComments: inUntrustedWorkspace,\n includeStrings: true,\n allowedCharacters: {},\n allowedLocales: { _os: true, _vscode: true },\n };\n super(124 /* EditorOption.unicodeHighlighting */, 'unicodeHighlight', defaults, {\n [unicodeHighlightConfigKeys.nonBasicASCII]: {\n restricted: true,\n type: ['boolean', 'string'],\n enum: [true, false, inUntrustedWorkspace],\n default: defaults.nonBasicASCII,\n description: nls.localize('unicodeHighlight.nonBasicASCII', \"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.\")\n },\n [unicodeHighlightConfigKeys.invisibleCharacters]: {\n restricted: true,\n type: 'boolean',\n default: defaults.invisibleCharacters,\n description: nls.localize('unicodeHighlight.invisibleCharacters', \"Controls whether characters that just reserve space or have no width at all are highlighted.\")\n },\n [unicodeHighlightConfigKeys.ambiguousCharacters]: {\n restricted: true,\n type: 'boolean',\n default: defaults.ambiguousCharacters,\n description: nls.localize('unicodeHighlight.ambiguousCharacters', \"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.\")\n },\n [unicodeHighlightConfigKeys.includeComments]: {\n restricted: true,\n type: ['boolean', 'string'],\n enum: [true, false, inUntrustedWorkspace],\n default: defaults.includeComments,\n description: nls.localize('unicodeHighlight.includeComments', \"Controls whether characters in comments should also be subject to Unicode highlighting.\")\n },\n [unicodeHighlightConfigKeys.includeStrings]: {\n restricted: true,\n type: ['boolean', 'string'],\n enum: [true, false, inUntrustedWorkspace],\n default: defaults.includeStrings,\n description: nls.localize('unicodeHighlight.includeStrings', \"Controls whether characters in strings should also be subject to Unicode highlighting.\")\n },\n [unicodeHighlightConfigKeys.allowedCharacters]: {\n restricted: true,\n type: 'object',\n default: defaults.allowedCharacters,\n description: nls.localize('unicodeHighlight.allowedCharacters', \"Defines allowed characters that are not being highlighted.\"),\n additionalProperties: {\n type: 'boolean'\n }\n },\n [unicodeHighlightConfigKeys.allowedLocales]: {\n restricted: true,\n type: 'object',\n additionalProperties: {\n type: 'boolean'\n },\n default: defaults.allowedLocales,\n description: nls.localize('unicodeHighlight.allowedLocales', \"Unicode characters that are common in allowed locales are not being highlighted.\")\n },\n });\n }\n applyUpdate(value, update) {\n let didChange = false;\n if (update.allowedCharacters && value) {\n // Treat allowedCharacters atomically\n if (!objects.equals(value.allowedCharacters, update.allowedCharacters)) {\n value = { ...value, allowedCharacters: update.allowedCharacters };\n didChange = true;\n }\n }\n if (update.allowedLocales && value) {\n // Treat allowedLocales atomically\n if (!objects.equals(value.allowedLocales, update.allowedLocales)) {\n value = { ...value, allowedLocales: update.allowedLocales };\n didChange = true;\n }\n }\n const result = super.applyUpdate(value, update);\n if (didChange) {\n return new ApplyUpdateResult(result.newValue, true);\n }\n return result;\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n nonBasicASCII: primitiveSet(input.nonBasicASCII, inUntrustedWorkspace, [true, false, inUntrustedWorkspace]),\n invisibleCharacters: boolean(input.invisibleCharacters, this.defaultValue.invisibleCharacters),\n ambiguousCharacters: boolean(input.ambiguousCharacters, this.defaultValue.ambiguousCharacters),\n includeComments: primitiveSet(input.includeComments, inUntrustedWorkspace, [true, false, inUntrustedWorkspace]),\n includeStrings: primitiveSet(input.includeStrings, inUntrustedWorkspace, [true, false, inUntrustedWorkspace]),\n allowedCharacters: this.validateBooleanMap(_input.allowedCharacters, this.defaultValue.allowedCharacters),\n allowedLocales: this.validateBooleanMap(_input.allowedLocales, this.defaultValue.allowedLocales),\n };\n }\n validateBooleanMap(map, defaultValue) {\n if ((typeof map !== 'object') || !map) {\n return defaultValue;\n }\n const result = {};\n for (const [key, value] of Object.entries(map)) {\n if (value === true) {\n result[key] = true;\n }\n }\n return result;\n }\n}\n/**\n * Configuration options for inline suggestions\n */\nclass InlineEditorSuggest extends BaseEditorOption {\n constructor() {\n const defaults = {\n enabled: true,\n mode: 'subwordSmart',\n showToolbar: 'onHover',\n suppressSuggestions: false,\n keepOnBlur: false,\n fontFamily: 'default'\n };\n super(62 /* EditorOption.inlineSuggest */, 'inlineSuggest', defaults, {\n 'editor.inlineSuggest.enabled': {\n type: 'boolean',\n default: defaults.enabled,\n description: nls.localize('inlineSuggest.enabled', \"Controls whether to automatically show inline suggestions in the editor.\")\n },\n 'editor.inlineSuggest.showToolbar': {\n type: 'string',\n default: defaults.showToolbar,\n enum: ['always', 'onHover', 'never'],\n enumDescriptions: [\n nls.localize('inlineSuggest.showToolbar.always', \"Show the inline suggestion toolbar whenever an inline suggestion is shown.\"),\n nls.localize('inlineSuggest.showToolbar.onHover', \"Show the inline suggestion toolbar when hovering over an inline suggestion.\"),\n nls.localize('inlineSuggest.showToolbar.never', \"Never show the inline suggestion toolbar.\"),\n ],\n description: nls.localize('inlineSuggest.showToolbar', \"Controls when to show the inline suggestion toolbar.\"),\n },\n 'editor.inlineSuggest.suppressSuggestions': {\n type: 'boolean',\n default: defaults.suppressSuggestions,\n description: nls.localize('inlineSuggest.suppressSuggestions', \"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.\")\n },\n 'editor.inlineSuggest.fontFamily': {\n type: 'string',\n default: defaults.fontFamily,\n description: nls.localize('inlineSuggest.fontFamily', \"Controls the font family of the inline suggestions.\")\n },\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n enabled: boolean(input.enabled, this.defaultValue.enabled),\n mode: stringSet(input.mode, this.defaultValue.mode, ['prefix', 'subword', 'subwordSmart']),\n showToolbar: stringSet(input.showToolbar, this.defaultValue.showToolbar, ['always', 'onHover', 'never']),\n suppressSuggestions: boolean(input.suppressSuggestions, this.defaultValue.suppressSuggestions),\n keepOnBlur: boolean(input.keepOnBlur, this.defaultValue.keepOnBlur),\n fontFamily: EditorStringOption.string(input.fontFamily, this.defaultValue.fontFamily)\n };\n }\n}\n/**\n * Configuration options for inline suggestions\n */\nclass BracketPairColorization extends BaseEditorOption {\n constructor() {\n const defaults = {\n enabled: EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions.enabled,\n independentColorPoolPerBracketType: EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions.independentColorPoolPerBracketType,\n };\n super(15 /* EditorOption.bracketPairColorization */, 'bracketPairColorization', defaults, {\n 'editor.bracketPairColorization.enabled': {\n type: 'boolean',\n default: defaults.enabled,\n markdownDescription: nls.localize('bracketPairColorization.enabled', \"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.\", '`#workbench.colorCustomizations#`')\n },\n 'editor.bracketPairColorization.independentColorPoolPerBracketType': {\n type: 'boolean',\n default: defaults.independentColorPoolPerBracketType,\n description: nls.localize('bracketPairColorization.independentColorPoolPerBracketType', \"Controls whether each bracket type has its own independent color pool.\")\n },\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n enabled: boolean(input.enabled, this.defaultValue.enabled),\n independentColorPoolPerBracketType: boolean(input.independentColorPoolPerBracketType, this.defaultValue.independentColorPoolPerBracketType),\n };\n }\n}\n/**\n * Configuration options for inline suggestions\n */\nclass GuideOptions extends BaseEditorOption {\n constructor() {\n const defaults = {\n bracketPairs: false,\n bracketPairsHorizontal: 'active',\n highlightActiveBracketPair: true,\n indentation: true,\n highlightActiveIndentation: true\n };\n super(16 /* EditorOption.guides */, 'guides', defaults, {\n 'editor.guides.bracketPairs': {\n type: ['boolean', 'string'],\n enum: [true, 'active', false],\n enumDescriptions: [\n nls.localize('editor.guides.bracketPairs.true', \"Enables bracket pair guides.\"),\n nls.localize('editor.guides.bracketPairs.active', \"Enables bracket pair guides only for the active bracket pair.\"),\n nls.localize('editor.guides.bracketPairs.false', \"Disables bracket pair guides.\"),\n ],\n default: defaults.bracketPairs,\n description: nls.localize('editor.guides.bracketPairs', \"Controls whether bracket pair guides are enabled or not.\")\n },\n 'editor.guides.bracketPairsHorizontal': {\n type: ['boolean', 'string'],\n enum: [true, 'active', false],\n enumDescriptions: [\n nls.localize('editor.guides.bracketPairsHorizontal.true', \"Enables horizontal guides as addition to vertical bracket pair guides.\"),\n nls.localize('editor.guides.bracketPairsHorizontal.active', \"Enables horizontal guides only for the active bracket pair.\"),\n nls.localize('editor.guides.bracketPairsHorizontal.false', \"Disables horizontal bracket pair guides.\"),\n ],\n default: defaults.bracketPairsHorizontal,\n description: nls.localize('editor.guides.bracketPairsHorizontal', \"Controls whether horizontal bracket pair guides are enabled or not.\")\n },\n 'editor.guides.highlightActiveBracketPair': {\n type: 'boolean',\n default: defaults.highlightActiveBracketPair,\n description: nls.localize('editor.guides.highlightActiveBracketPair', \"Controls whether the editor should highlight the active bracket pair.\")\n },\n 'editor.guides.indentation': {\n type: 'boolean',\n default: defaults.indentation,\n description: nls.localize('editor.guides.indentation', \"Controls whether the editor should render indent guides.\")\n },\n 'editor.guides.highlightActiveIndentation': {\n type: ['boolean', 'string'],\n enum: [true, 'always', false],\n enumDescriptions: [\n nls.localize('editor.guides.highlightActiveIndentation.true', \"Highlights the active indent guide.\"),\n nls.localize('editor.guides.highlightActiveIndentation.always', \"Highlights the active indent guide even if bracket guides are highlighted.\"),\n nls.localize('editor.guides.highlightActiveIndentation.false', \"Do not highlight the active indent guide.\"),\n ],\n default: defaults.highlightActiveIndentation,\n description: nls.localize('editor.guides.highlightActiveIndentation', \"Controls whether the editor should highlight the active indent guide.\")\n }\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n bracketPairs: primitiveSet(input.bracketPairs, this.defaultValue.bracketPairs, [true, false, 'active']),\n bracketPairsHorizontal: primitiveSet(input.bracketPairsHorizontal, this.defaultValue.bracketPairsHorizontal, [true, false, 'active']),\n highlightActiveBracketPair: boolean(input.highlightActiveBracketPair, this.defaultValue.highlightActiveBracketPair),\n indentation: boolean(input.indentation, this.defaultValue.indentation),\n highlightActiveIndentation: primitiveSet(input.highlightActiveIndentation, this.defaultValue.highlightActiveIndentation, [true, false, 'always']),\n };\n }\n}\nfunction primitiveSet(value, defaultValue, allowedValues) {\n const idx = allowedValues.indexOf(value);\n if (idx === -1) {\n return defaultValue;\n }\n return allowedValues[idx];\n}\nclass EditorSuggest extends BaseEditorOption {\n constructor() {\n const defaults = {\n insertMode: 'insert',\n filterGraceful: true,\n snippetsPreventQuickSuggestions: false,\n localityBonus: false,\n shareSuggestSelections: false,\n selectionMode: 'always',\n showIcons: true,\n showStatusBar: false,\n preview: false,\n previewMode: 'subwordSmart',\n showInlineDetails: true,\n showMethods: true,\n showFunctions: true,\n showConstructors: true,\n showDeprecated: true,\n matchOnWordStartOnly: true,\n showFields: true,\n showVariables: true,\n showClasses: true,\n showStructs: true,\n showInterfaces: true,\n showModules: true,\n showProperties: true,\n showEvents: true,\n showOperators: true,\n showUnits: true,\n showValues: true,\n showConstants: true,\n showEnums: true,\n showEnumMembers: true,\n showKeywords: true,\n showWords: true,\n showColors: true,\n showFiles: true,\n showReferences: true,\n showFolders: true,\n showTypeParameters: true,\n showSnippets: true,\n showUsers: true,\n showIssues: true,\n };\n super(117 /* EditorOption.suggest */, 'suggest', defaults, {\n 'editor.suggest.insertMode': {\n type: 'string',\n enum: ['insert', 'replace'],\n enumDescriptions: [\n nls.localize('suggest.insertMode.insert', \"Insert suggestion without overwriting text right of the cursor.\"),\n nls.localize('suggest.insertMode.replace', \"Insert suggestion and overwrite text right of the cursor.\"),\n ],\n default: defaults.insertMode,\n description: nls.localize('suggest.insertMode', \"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.\")\n },\n 'editor.suggest.filterGraceful': {\n type: 'boolean',\n default: defaults.filterGraceful,\n description: nls.localize('suggest.filterGraceful', \"Controls whether filtering and sorting suggestions accounts for small typos.\")\n },\n 'editor.suggest.localityBonus': {\n type: 'boolean',\n default: defaults.localityBonus,\n description: nls.localize('suggest.localityBonus', \"Controls whether sorting favors words that appear close to the cursor.\")\n },\n 'editor.suggest.shareSuggestSelections': {\n type: 'boolean',\n default: defaults.shareSuggestSelections,\n markdownDescription: nls.localize('suggest.shareSuggestSelections', \"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).\")\n },\n 'editor.suggest.selectionMode': {\n type: 'string',\n enum: ['always', 'never', 'whenTriggerCharacter', 'whenQuickSuggestion'],\n enumDescriptions: [\n nls.localize('suggest.insertMode.always', \"Always select a suggestion when automatically triggering IntelliSense.\"),\n nls.localize('suggest.insertMode.never', \"Never select a suggestion when automatically triggering IntelliSense.\"),\n nls.localize('suggest.insertMode.whenTriggerCharacter', \"Select a suggestion only when triggering IntelliSense from a trigger character.\"),\n nls.localize('suggest.insertMode.whenQuickSuggestion', \"Select a suggestion only when triggering IntelliSense as you type.\"),\n ],\n default: defaults.selectionMode,\n markdownDescription: nls.localize('suggest.selectionMode', \"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.\")\n },\n 'editor.suggest.snippetsPreventQuickSuggestions': {\n type: 'boolean',\n default: defaults.snippetsPreventQuickSuggestions,\n description: nls.localize('suggest.snippetsPreventQuickSuggestions', \"Controls whether an active snippet prevents quick suggestions.\")\n },\n 'editor.suggest.showIcons': {\n type: 'boolean',\n default: defaults.showIcons,\n description: nls.localize('suggest.showIcons', \"Controls whether to show or hide icons in suggestions.\")\n },\n 'editor.suggest.showStatusBar': {\n type: 'boolean',\n default: defaults.showStatusBar,\n description: nls.localize('suggest.showStatusBar', \"Controls the visibility of the status bar at the bottom of the suggest widget.\")\n },\n 'editor.suggest.preview': {\n type: 'boolean',\n default: defaults.preview,\n description: nls.localize('suggest.preview', \"Controls whether to preview the suggestion outcome in the editor.\")\n },\n 'editor.suggest.showInlineDetails': {\n type: 'boolean',\n default: defaults.showInlineDetails,\n description: nls.localize('suggest.showInlineDetails', \"Controls whether suggest details show inline with the label or only in the details widget.\")\n },\n 'editor.suggest.maxVisibleSuggestions': {\n type: 'number',\n deprecationMessage: nls.localize('suggest.maxVisibleSuggestions.dep', \"This setting is deprecated. The suggest widget can now be resized.\"),\n },\n 'editor.suggest.filteredTypes': {\n type: 'object',\n deprecationMessage: nls.localize('deprecated', \"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.\")\n },\n 'editor.suggest.showMethods': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showMethods', \"When enabled IntelliSense shows `method`-suggestions.\")\n },\n 'editor.suggest.showFunctions': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showFunctions', \"When enabled IntelliSense shows `function`-suggestions.\")\n },\n 'editor.suggest.showConstructors': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showConstructors', \"When enabled IntelliSense shows `constructor`-suggestions.\")\n },\n 'editor.suggest.showDeprecated': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showDeprecated', \"When enabled IntelliSense shows `deprecated`-suggestions.\")\n },\n 'editor.suggest.matchOnWordStartOnly': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.matchOnWordStartOnly', \"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.\")\n },\n 'editor.suggest.showFields': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showFields', \"When enabled IntelliSense shows `field`-suggestions.\")\n },\n 'editor.suggest.showVariables': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showVariables', \"When enabled IntelliSense shows `variable`-suggestions.\")\n },\n 'editor.suggest.showClasses': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showClasss', \"When enabled IntelliSense shows `class`-suggestions.\")\n },\n 'editor.suggest.showStructs': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showStructs', \"When enabled IntelliSense shows `struct`-suggestions.\")\n },\n 'editor.suggest.showInterfaces': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showInterfaces', \"When enabled IntelliSense shows `interface`-suggestions.\")\n },\n 'editor.suggest.showModules': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showModules', \"When enabled IntelliSense shows `module`-suggestions.\")\n },\n 'editor.suggest.showProperties': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showPropertys', \"When enabled IntelliSense shows `property`-suggestions.\")\n },\n 'editor.suggest.showEvents': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showEvents', \"When enabled IntelliSense shows `event`-suggestions.\")\n },\n 'editor.suggest.showOperators': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showOperators', \"When enabled IntelliSense shows `operator`-suggestions.\")\n },\n 'editor.suggest.showUnits': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showUnits', \"When enabled IntelliSense shows `unit`-suggestions.\")\n },\n 'editor.suggest.showValues': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showValues', \"When enabled IntelliSense shows `value`-suggestions.\")\n },\n 'editor.suggest.showConstants': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showConstants', \"When enabled IntelliSense shows `constant`-suggestions.\")\n },\n 'editor.suggest.showEnums': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showEnums', \"When enabled IntelliSense shows `enum`-suggestions.\")\n },\n 'editor.suggest.showEnumMembers': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showEnumMembers', \"When enabled IntelliSense shows `enumMember`-suggestions.\")\n },\n 'editor.suggest.showKeywords': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showKeywords', \"When enabled IntelliSense shows `keyword`-suggestions.\")\n },\n 'editor.suggest.showWords': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showTexts', \"When enabled IntelliSense shows `text`-suggestions.\")\n },\n 'editor.suggest.showColors': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showColors', \"When enabled IntelliSense shows `color`-suggestions.\")\n },\n 'editor.suggest.showFiles': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showFiles', \"When enabled IntelliSense shows `file`-suggestions.\")\n },\n 'editor.suggest.showReferences': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showReferences', \"When enabled IntelliSense shows `reference`-suggestions.\")\n },\n 'editor.suggest.showCustomcolors': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showCustomcolors', \"When enabled IntelliSense shows `customcolor`-suggestions.\")\n },\n 'editor.suggest.showFolders': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showFolders', \"When enabled IntelliSense shows `folder`-suggestions.\")\n },\n 'editor.suggest.showTypeParameters': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showTypeParameters', \"When enabled IntelliSense shows `typeParameter`-suggestions.\")\n },\n 'editor.suggest.showSnippets': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showSnippets', \"When enabled IntelliSense shows `snippet`-suggestions.\")\n },\n 'editor.suggest.showUsers': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showUsers', \"When enabled IntelliSense shows `user`-suggestions.\")\n },\n 'editor.suggest.showIssues': {\n type: 'boolean',\n default: true,\n markdownDescription: nls.localize('editor.suggest.showIssues', \"When enabled IntelliSense shows `issues`-suggestions.\")\n }\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n insertMode: stringSet(input.insertMode, this.defaultValue.insertMode, ['insert', 'replace']),\n filterGraceful: boolean(input.filterGraceful, this.defaultValue.filterGraceful),\n snippetsPreventQuickSuggestions: boolean(input.snippetsPreventQuickSuggestions, this.defaultValue.filterGraceful),\n localityBonus: boolean(input.localityBonus, this.defaultValue.localityBonus),\n shareSuggestSelections: boolean(input.shareSuggestSelections, this.defaultValue.shareSuggestSelections),\n selectionMode: stringSet(input.selectionMode, this.defaultValue.selectionMode, ['always', 'never', 'whenQuickSuggestion', 'whenTriggerCharacter']),\n showIcons: boolean(input.showIcons, this.defaultValue.showIcons),\n showStatusBar: boolean(input.showStatusBar, this.defaultValue.showStatusBar),\n preview: boolean(input.preview, this.defaultValue.preview),\n previewMode: stringSet(input.previewMode, this.defaultValue.previewMode, ['prefix', 'subword', 'subwordSmart']),\n showInlineDetails: boolean(input.showInlineDetails, this.defaultValue.showInlineDetails),\n showMethods: boolean(input.showMethods, this.defaultValue.showMethods),\n showFunctions: boolean(input.showFunctions, this.defaultValue.showFunctions),\n showConstructors: boolean(input.showConstructors, this.defaultValue.showConstructors),\n showDeprecated: boolean(input.showDeprecated, this.defaultValue.showDeprecated),\n matchOnWordStartOnly: boolean(input.matchOnWordStartOnly, this.defaultValue.matchOnWordStartOnly),\n showFields: boolean(input.showFields, this.defaultValue.showFields),\n showVariables: boolean(input.showVariables, this.defaultValue.showVariables),\n showClasses: boolean(input.showClasses, this.defaultValue.showClasses),\n showStructs: boolean(input.showStructs, this.defaultValue.showStructs),\n showInterfaces: boolean(input.showInterfaces, this.defaultValue.showInterfaces),\n showModules: boolean(input.showModules, this.defaultValue.showModules),\n showProperties: boolean(input.showProperties, this.defaultValue.showProperties),\n showEvents: boolean(input.showEvents, this.defaultValue.showEvents),\n showOperators: boolean(input.showOperators, this.defaultValue.showOperators),\n showUnits: boolean(input.showUnits, this.defaultValue.showUnits),\n showValues: boolean(input.showValues, this.defaultValue.showValues),\n showConstants: boolean(input.showConstants, this.defaultValue.showConstants),\n showEnums: boolean(input.showEnums, this.defaultValue.showEnums),\n showEnumMembers: boolean(input.showEnumMembers, this.defaultValue.showEnumMembers),\n showKeywords: boolean(input.showKeywords, this.defaultValue.showKeywords),\n showWords: boolean(input.showWords, this.defaultValue.showWords),\n showColors: boolean(input.showColors, this.defaultValue.showColors),\n showFiles: boolean(input.showFiles, this.defaultValue.showFiles),\n showReferences: boolean(input.showReferences, this.defaultValue.showReferences),\n showFolders: boolean(input.showFolders, this.defaultValue.showFolders),\n showTypeParameters: boolean(input.showTypeParameters, this.defaultValue.showTypeParameters),\n showSnippets: boolean(input.showSnippets, this.defaultValue.showSnippets),\n showUsers: boolean(input.showUsers, this.defaultValue.showUsers),\n showIssues: boolean(input.showIssues, this.defaultValue.showIssues),\n };\n }\n}\nclass SmartSelect extends BaseEditorOption {\n constructor() {\n super(112 /* EditorOption.smartSelect */, 'smartSelect', {\n selectLeadingAndTrailingWhitespace: true,\n selectSubwords: true,\n }, {\n 'editor.smartSelect.selectLeadingAndTrailingWhitespace': {\n description: nls.localize('selectLeadingAndTrailingWhitespace', \"Whether leading and trailing whitespace should always be selected.\"),\n default: true,\n type: 'boolean'\n },\n 'editor.smartSelect.selectSubwords': {\n description: nls.localize('selectSubwords', \"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected.\"),\n default: true,\n type: 'boolean'\n }\n });\n }\n validate(input) {\n if (!input || typeof input !== 'object') {\n return this.defaultValue;\n }\n return {\n selectLeadingAndTrailingWhitespace: boolean(input.selectLeadingAndTrailingWhitespace, this.defaultValue.selectLeadingAndTrailingWhitespace),\n selectSubwords: boolean(input.selectSubwords, this.defaultValue.selectSubwords),\n };\n }\n}\nclass WrappingIndentOption extends BaseEditorOption {\n constructor() {\n super(136 /* EditorOption.wrappingIndent */, 'wrappingIndent', 1 /* WrappingIndent.Same */, {\n 'editor.wrappingIndent': {\n type: 'string',\n enum: ['none', 'same', 'indent', 'deepIndent'],\n enumDescriptions: [\n nls.localize('wrappingIndent.none', \"No indentation. Wrapped lines begin at column 1.\"),\n nls.localize('wrappingIndent.same', \"Wrapped lines get the same indentation as the parent.\"),\n nls.localize('wrappingIndent.indent', \"Wrapped lines get +1 indentation toward the parent.\"),\n nls.localize('wrappingIndent.deepIndent', \"Wrapped lines get +2 indentation toward the parent.\"),\n ],\n description: nls.localize('wrappingIndent', \"Controls the indentation of wrapped lines.\"),\n default: 'same'\n }\n });\n }\n validate(input) {\n switch (input) {\n case 'none': return 0 /* WrappingIndent.None */;\n case 'same': return 1 /* WrappingIndent.Same */;\n case 'indent': return 2 /* WrappingIndent.Indent */;\n case 'deepIndent': return 3 /* WrappingIndent.DeepIndent */;\n }\n return 1 /* WrappingIndent.Same */;\n }\n compute(env, options, value) {\n const accessibilitySupport = options.get(2 /* EditorOption.accessibilitySupport */);\n if (accessibilitySupport === 2 /* AccessibilitySupport.Enabled */) {\n // if we know for a fact that a screen reader is attached, we use no indent wrapping to\n // help that the editor's wrapping points match the textarea's wrapping points\n return 0 /* WrappingIndent.None */;\n }\n return value;\n }\n}\nclass EditorWrappingInfoComputer extends ComputedEditorOption {\n constructor() {\n super(144 /* EditorOption.wrappingInfo */);\n }\n compute(env, options, _) {\n const layoutInfo = options.get(143 /* EditorOption.layoutInfo */);\n return {\n isDominatedByLongLines: env.isDominatedByLongLines,\n isWordWrapMinified: layoutInfo.isWordWrapMinified,\n isViewportWrapping: layoutInfo.isViewportWrapping,\n wrappingColumn: layoutInfo.wrappingColumn,\n };\n }\n}\nclass EditorDropIntoEditor extends BaseEditorOption {\n constructor() {\n const defaults = { enabled: true, showDropSelector: 'afterDrop' };\n super(36 /* EditorOption.dropIntoEditor */, 'dropIntoEditor', defaults, {\n 'editor.dropIntoEditor.enabled': {\n type: 'boolean',\n default: defaults.enabled,\n markdownDescription: nls.localize('dropIntoEditor.enabled', \"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).\"),\n },\n 'editor.dropIntoEditor.showDropSelector': {\n type: 'string',\n markdownDescription: nls.localize('dropIntoEditor.showDropSelector', \"Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped.\"),\n enum: [\n 'afterDrop',\n 'never'\n ],\n enumDescriptions: [\n nls.localize('dropIntoEditor.showDropSelector.afterDrop', \"Show the drop selector widget after a file is dropped into the editor.\"),\n nls.localize('dropIntoEditor.showDropSelector.never', \"Never show the drop selector widget. Instead the default drop provider is always used.\"),\n ],\n default: 'afterDrop',\n },\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n enabled: boolean(input.enabled, this.defaultValue.enabled),\n showDropSelector: stringSet(input.showDropSelector, this.defaultValue.showDropSelector, ['afterDrop', 'never']),\n };\n }\n}\nclass EditorPasteAs extends BaseEditorOption {\n constructor() {\n const defaults = { enabled: true, showPasteSelector: 'afterPaste' };\n super(84 /* EditorOption.pasteAs */, 'pasteAs', defaults, {\n 'editor.pasteAs.enabled': {\n type: 'boolean',\n default: defaults.enabled,\n markdownDescription: nls.localize('pasteAs.enabled', \"Controls whether you can paste content in different ways.\"),\n },\n 'editor.pasteAs.showPasteSelector': {\n type: 'string',\n markdownDescription: nls.localize('pasteAs.showPasteSelector', \"Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted.\"),\n enum: [\n 'afterPaste',\n 'never'\n ],\n enumDescriptions: [\n nls.localize('pasteAs.showPasteSelector.afterPaste', \"Show the paste selector widget after content is pasted into the editor.\"),\n nls.localize('pasteAs.showPasteSelector.never', \"Never show the paste selector widget. Instead the default pasting behavior is always used.\"),\n ],\n default: 'afterPaste',\n },\n });\n }\n validate(_input) {\n if (!_input || typeof _input !== 'object') {\n return this.defaultValue;\n }\n const input = _input;\n return {\n enabled: boolean(input.enabled, this.defaultValue.enabled),\n showPasteSelector: stringSet(input.showPasteSelector, this.defaultValue.showPasteSelector, ['afterPaste', 'never']),\n };\n }\n}\n//#endregion\nconst DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \\'Courier New\\', monospace';\nconst DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \\'Courier New\\', monospace';\nconst DEFAULT_LINUX_FONT_FAMILY = '\\'Droid Sans Mono\\', \\'monospace\\', monospace';\n/**\n * @internal\n */\nexport const EDITOR_FONT_DEFAULTS = {\n fontFamily: (platform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isLinux ? DEFAULT_LINUX_FONT_FAMILY : DEFAULT_WINDOWS_FONT_FAMILY)),\n fontWeight: 'normal',\n fontSize: (platform.isMacintosh ? 12 : 14),\n lineHeight: 0,\n letterSpacing: 0,\n};\n/**\n * @internal\n */\nexport const editorOptionsRegistry = [];\nfunction register(option) {\n editorOptionsRegistry[option.id] = option;\n return option;\n}\nexport const EditorOptions = {\n acceptSuggestionOnCommitCharacter: register(new EditorBooleanOption(0 /* EditorOption.acceptSuggestionOnCommitCharacter */, 'acceptSuggestionOnCommitCharacter', true, { markdownDescription: nls.localize('acceptSuggestionOnCommitCharacter', \"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.\") })),\n acceptSuggestionOnEnter: register(new EditorStringEnumOption(1 /* EditorOption.acceptSuggestionOnEnter */, 'acceptSuggestionOnEnter', 'on', ['on', 'smart', 'off'], {\n markdownEnumDescriptions: [\n '',\n nls.localize('acceptSuggestionOnEnterSmart', \"Only accept a suggestion with `Enter` when it makes a textual change.\"),\n ''\n ],\n markdownDescription: nls.localize('acceptSuggestionOnEnter', \"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.\")\n })),\n accessibilitySupport: register(new EditorAccessibilitySupport()),\n accessibilityPageSize: register(new EditorIntOption(3 /* EditorOption.accessibilityPageSize */, 'accessibilityPageSize', 10, 1, 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */, {\n description: nls.localize('accessibilityPageSize', \"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default.\"),\n tags: ['accessibility']\n })),\n ariaLabel: register(new EditorStringOption(4 /* EditorOption.ariaLabel */, 'ariaLabel', nls.localize('editorViewAccessibleLabel', \"Editor content\"))),\n ariaRequired: register(new EditorBooleanOption(5 /* EditorOption.ariaRequired */, 'ariaRequired', false, undefined)),\n screenReaderAnnounceInlineSuggestion: register(new EditorBooleanOption(8 /* EditorOption.screenReaderAnnounceInlineSuggestion */, 'screenReaderAnnounceInlineSuggestion', true, {\n description: nls.localize('screenReaderAnnounceInlineSuggestion', \"Control whether inline suggestions are announced by a screen reader.\"),\n tags: ['accessibility']\n })),\n autoClosingBrackets: register(new EditorStringEnumOption(6 /* EditorOption.autoClosingBrackets */, 'autoClosingBrackets', 'languageDefined', ['always', 'languageDefined', 'beforeWhitespace', 'never'], {\n enumDescriptions: [\n '',\n nls.localize('editor.autoClosingBrackets.languageDefined', \"Use language configurations to determine when to autoclose brackets.\"),\n nls.localize('editor.autoClosingBrackets.beforeWhitespace', \"Autoclose brackets only when the cursor is to the left of whitespace.\"),\n '',\n ],\n description: nls.localize('autoClosingBrackets', \"Controls whether the editor should automatically close brackets after the user adds an opening bracket.\")\n })),\n autoClosingComments: register(new EditorStringEnumOption(7 /* EditorOption.autoClosingComments */, 'autoClosingComments', 'languageDefined', ['always', 'languageDefined', 'beforeWhitespace', 'never'], {\n enumDescriptions: [\n '',\n nls.localize('editor.autoClosingComments.languageDefined', \"Use language configurations to determine when to autoclose comments.\"),\n nls.localize('editor.autoClosingComments.beforeWhitespace', \"Autoclose comments only when the cursor is to the left of whitespace.\"),\n '',\n ],\n description: nls.localize('autoClosingComments', \"Controls whether the editor should automatically close comments after the user adds an opening comment.\")\n })),\n autoClosingDelete: register(new EditorStringEnumOption(9 /* EditorOption.autoClosingDelete */, 'autoClosingDelete', 'auto', ['always', 'auto', 'never'], {\n enumDescriptions: [\n '',\n nls.localize('editor.autoClosingDelete.auto', \"Remove adjacent closing quotes or brackets only if they were automatically inserted.\"),\n '',\n ],\n description: nls.localize('autoClosingDelete', \"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.\")\n })),\n autoClosingOvertype: register(new EditorStringEnumOption(10 /* EditorOption.autoClosingOvertype */, 'autoClosingOvertype', 'auto', ['always', 'auto', 'never'], {\n enumDescriptions: [\n '',\n nls.localize('editor.autoClosingOvertype.auto', \"Type over closing quotes or brackets only if they were automatically inserted.\"),\n '',\n ],\n description: nls.localize('autoClosingOvertype', \"Controls whether the editor should type over closing quotes or brackets.\")\n })),\n autoClosingQuotes: register(new EditorStringEnumOption(11 /* EditorOption.autoClosingQuotes */, 'autoClosingQuotes', 'languageDefined', ['always', 'languageDefined', 'beforeWhitespace', 'never'], {\n enumDescriptions: [\n '',\n nls.localize('editor.autoClosingQuotes.languageDefined', \"Use language configurations to determine when to autoclose quotes.\"),\n nls.localize('editor.autoClosingQuotes.beforeWhitespace', \"Autoclose quotes only when the cursor is to the left of whitespace.\"),\n '',\n ],\n description: nls.localize('autoClosingQuotes', \"Controls whether the editor should automatically close quotes after the user adds an opening quote.\")\n })),\n autoIndent: register(new EditorEnumOption(12 /* EditorOption.autoIndent */, 'autoIndent', 4 /* EditorAutoIndentStrategy.Full */, 'full', ['none', 'keep', 'brackets', 'advanced', 'full'], _autoIndentFromString, {\n enumDescriptions: [\n nls.localize('editor.autoIndent.none', \"The editor will not insert indentation automatically.\"),\n nls.localize('editor.autoIndent.keep', \"The editor will keep the current line's indentation.\"),\n nls.localize('editor.autoIndent.brackets', \"The editor will keep the current line's indentation and honor language defined brackets.\"),\n nls.localize('editor.autoIndent.advanced', \"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages.\"),\n nls.localize('editor.autoIndent.full', \"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.\"),\n ],\n description: nls.localize('autoIndent', \"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.\")\n })),\n automaticLayout: register(new EditorBooleanOption(13 /* EditorOption.automaticLayout */, 'automaticLayout', false)),\n autoSurround: register(new EditorStringEnumOption(14 /* EditorOption.autoSurround */, 'autoSurround', 'languageDefined', ['languageDefined', 'quotes', 'brackets', 'never'], {\n enumDescriptions: [\n nls.localize('editor.autoSurround.languageDefined', \"Use language configurations to determine when to automatically surround selections.\"),\n nls.localize('editor.autoSurround.quotes', \"Surround with quotes but not brackets.\"),\n nls.localize('editor.autoSurround.brackets', \"Surround with brackets but not quotes.\"),\n ''\n ],\n description: nls.localize('autoSurround', \"Controls whether the editor should automatically surround selections when typing quotes or brackets.\")\n })),\n bracketPairColorization: register(new BracketPairColorization()),\n bracketPairGuides: register(new GuideOptions()),\n stickyTabStops: register(new EditorBooleanOption(115 /* EditorOption.stickyTabStops */, 'stickyTabStops', false, { description: nls.localize('stickyTabStops', \"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.\") })),\n codeLens: register(new EditorBooleanOption(17 /* EditorOption.codeLens */, 'codeLens', true, { description: nls.localize('codeLens', \"Controls whether the editor shows CodeLens.\") })),\n codeLensFontFamily: register(new EditorStringOption(18 /* EditorOption.codeLensFontFamily */, 'codeLensFontFamily', '', { description: nls.localize('codeLensFontFamily', \"Controls the font family for CodeLens.\") })),\n codeLensFontSize: register(new EditorIntOption(19 /* EditorOption.codeLensFontSize */, 'codeLensFontSize', 0, 0, 100, {\n type: 'number',\n default: 0,\n minimum: 0,\n maximum: 100,\n markdownDescription: nls.localize('codeLensFontSize', \"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.\")\n })),\n colorDecorators: register(new EditorBooleanOption(20 /* EditorOption.colorDecorators */, 'colorDecorators', true, { description: nls.localize('colorDecorators', \"Controls whether the editor should render the inline color decorators and color picker.\") })),\n colorDecoratorActivatedOn: register(new EditorStringEnumOption(146 /* EditorOption.colorDecoratorsActivatedOn */, 'colorDecoratorsActivatedOn', 'clickAndHover', ['clickAndHover', 'hover', 'click'], {\n enumDescriptions: [\n nls.localize('editor.colorDecoratorActivatedOn.clickAndHover', \"Make the color picker appear both on click and hover of the color decorator\"),\n nls.localize('editor.colorDecoratorActivatedOn.hover', \"Make the color picker appear on hover of the color decorator\"),\n nls.localize('editor.colorDecoratorActivatedOn.click', \"Make the color picker appear on click of the color decorator\")\n ],\n description: nls.localize('colorDecoratorActivatedOn', \"Controls the condition to make a color picker appear from a color decorator\")\n })),\n colorDecoratorsLimit: register(new EditorIntOption(21 /* EditorOption.colorDecoratorsLimit */, 'colorDecoratorsLimit', 500, 1, 1000000, {\n markdownDescription: nls.localize('colorDecoratorsLimit', \"Controls the max number of color decorators that can be rendered in an editor at once.\")\n })),\n columnSelection: register(new EditorBooleanOption(22 /* EditorOption.columnSelection */, 'columnSelection', false, { description: nls.localize('columnSelection', \"Enable that the selection with the mouse and keys is doing column selection.\") })),\n comments: register(new EditorComments()),\n contextmenu: register(new EditorBooleanOption(24 /* EditorOption.contextmenu */, 'contextmenu', true)),\n copyWithSyntaxHighlighting: register(new EditorBooleanOption(25 /* EditorOption.copyWithSyntaxHighlighting */, 'copyWithSyntaxHighlighting', true, { description: nls.localize('copyWithSyntaxHighlighting', \"Controls whether syntax highlighting should be copied into the clipboard.\") })),\n cursorBlinking: register(new EditorEnumOption(26 /* EditorOption.cursorBlinking */, 'cursorBlinking', 1 /* TextEditorCursorBlinkingStyle.Blink */, 'blink', ['blink', 'smooth', 'phase', 'expand', 'solid'], _cursorBlinkingStyleFromString, { description: nls.localize('cursorBlinking', \"Control the cursor animation style.\") })),\n cursorSmoothCaretAnimation: register(new EditorStringEnumOption(27 /* EditorOption.cursorSmoothCaretAnimation */, 'cursorSmoothCaretAnimation', 'off', ['off', 'explicit', 'on'], {\n enumDescriptions: [\n nls.localize('cursorSmoothCaretAnimation.off', \"Smooth caret animation is disabled.\"),\n nls.localize('cursorSmoothCaretAnimation.explicit', \"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture.\"),\n nls.localize('cursorSmoothCaretAnimation.on', \"Smooth caret animation is always enabled.\")\n ],\n description: nls.localize('cursorSmoothCaretAnimation', \"Controls whether the smooth caret animation should be enabled.\")\n })),\n cursorStyle: register(new EditorEnumOption(28 /* EditorOption.cursorStyle */, 'cursorStyle', TextEditorCursorStyle.Line, 'line', ['line', 'block', 'underline', 'line-thin', 'block-outline', 'underline-thin'], _cursorStyleFromString, { description: nls.localize('cursorStyle', \"Controls the cursor style.\") })),\n cursorSurroundingLines: register(new EditorIntOption(29 /* EditorOption.cursorSurroundingLines */, 'cursorSurroundingLines', 0, 0, 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */, { description: nls.localize('cursorSurroundingLines', \"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.\") })),\n cursorSurroundingLinesStyle: register(new EditorStringEnumOption(30 /* EditorOption.cursorSurroundingLinesStyle */, 'cursorSurroundingLinesStyle', 'default', ['default', 'all'], {\n enumDescriptions: [\n nls.localize('cursorSurroundingLinesStyle.default', \"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API.\"),\n nls.localize('cursorSurroundingLinesStyle.all', \"`cursorSurroundingLines` is enforced always.\")\n ],\n markdownDescription: nls.localize('cursorSurroundingLinesStyle', \"Controls when `#cursorSurroundingLines#` should be enforced.\")\n })),\n cursorWidth: register(new EditorIntOption(31 /* EditorOption.cursorWidth */, 'cursorWidth', 0, 0, 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */, { markdownDescription: nls.localize('cursorWidth', \"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.\") })),\n disableLayerHinting: register(new EditorBooleanOption(32 /* EditorOption.disableLayerHinting */, 'disableLayerHinting', false)),\n disableMonospaceOptimizations: register(new EditorBooleanOption(33 /* EditorOption.disableMonospaceOptimizations */, 'disableMonospaceOptimizations', false)),\n domReadOnly: register(new EditorBooleanOption(34 /* EditorOption.domReadOnly */, 'domReadOnly', false)),\n dragAndDrop: register(new EditorBooleanOption(35 /* EditorOption.dragAndDrop */, 'dragAndDrop', true, { description: nls.localize('dragAndDrop', \"Controls whether the editor should allow moving selections via drag and drop.\") })),\n emptySelectionClipboard: register(new EditorEmptySelectionClipboard()),\n dropIntoEditor: register(new EditorDropIntoEditor()),\n stickyScroll: register(new EditorStickyScroll()),\n experimentalWhitespaceRendering: register(new EditorStringEnumOption(38 /* EditorOption.experimentalWhitespaceRendering */, 'experimentalWhitespaceRendering', 'svg', ['svg', 'font', 'off'], {\n enumDescriptions: [\n nls.localize('experimentalWhitespaceRendering.svg', \"Use a new rendering method with svgs.\"),\n nls.localize('experimentalWhitespaceRendering.font', \"Use a new rendering method with font characters.\"),\n nls.localize('experimentalWhitespaceRendering.off', \"Use the stable rendering method.\"),\n ],\n description: nls.localize('experimentalWhitespaceRendering', \"Controls whether whitespace is rendered with a new, experimental method.\")\n })),\n extraEditorClassName: register(new EditorStringOption(39 /* EditorOption.extraEditorClassName */, 'extraEditorClassName', '')),\n fastScrollSensitivity: register(new EditorFloatOption(40 /* EditorOption.fastScrollSensitivity */, 'fastScrollSensitivity', 5, x => (x <= 0 ? 5 : x), { markdownDescription: nls.localize('fastScrollSensitivity', \"Scrolling speed multiplier when pressing `Alt`.\") })),\n find: register(new EditorFind()),\n fixedOverflowWidgets: register(new EditorBooleanOption(42 /* EditorOption.fixedOverflowWidgets */, 'fixedOverflowWidgets', false)),\n folding: register(new EditorBooleanOption(43 /* EditorOption.folding */, 'folding', true, { description: nls.localize('folding', \"Controls whether the editor has code folding enabled.\") })),\n foldingStrategy: register(new EditorStringEnumOption(44 /* EditorOption.foldingStrategy */, 'foldingStrategy', 'auto', ['auto', 'indentation'], {\n enumDescriptions: [\n nls.localize('foldingStrategy.auto', \"Use a language-specific folding strategy if available, else the indentation-based one.\"),\n nls.localize('foldingStrategy.indentation', \"Use the indentation-based folding strategy.\"),\n ],\n description: nls.localize('foldingStrategy', \"Controls the strategy for computing folding ranges.\")\n })),\n foldingHighlight: register(new EditorBooleanOption(45 /* EditorOption.foldingHighlight */, 'foldingHighlight', true, { description: nls.localize('foldingHighlight', \"Controls whether the editor should highlight folded ranges.\") })),\n foldingImportsByDefault: register(new EditorBooleanOption(46 /* EditorOption.foldingImportsByDefault */, 'foldingImportsByDefault', false, { description: nls.localize('foldingImportsByDefault', \"Controls whether the editor automatically collapses import ranges.\") })),\n foldingMaximumRegions: register(new EditorIntOption(47 /* EditorOption.foldingMaximumRegions */, 'foldingMaximumRegions', 5000, 10, 65000, // limit must be less than foldingRanges MAX_FOLDING_REGIONS\n { description: nls.localize('foldingMaximumRegions', \"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.\") })),\n unfoldOnClickAfterEndOfLine: register(new EditorBooleanOption(48 /* EditorOption.unfoldOnClickAfterEndOfLine */, 'unfoldOnClickAfterEndOfLine', false, { description: nls.localize('unfoldOnClickAfterEndOfLine', \"Controls whether clicking on the empty content after a folded line will unfold the line.\") })),\n fontFamily: register(new EditorStringOption(49 /* EditorOption.fontFamily */, 'fontFamily', EDITOR_FONT_DEFAULTS.fontFamily, { description: nls.localize('fontFamily', \"Controls the font family.\") })),\n fontInfo: register(new EditorFontInfo()),\n fontLigatures2: register(new EditorFontLigatures()),\n fontSize: register(new EditorFontSize()),\n fontWeight: register(new EditorFontWeight()),\n fontVariations: register(new EditorFontVariations()),\n formatOnPaste: register(new EditorBooleanOption(55 /* EditorOption.formatOnPaste */, 'formatOnPaste', false, { description: nls.localize('formatOnPaste', \"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.\") })),\n formatOnType: register(new EditorBooleanOption(56 /* EditorOption.formatOnType */, 'formatOnType', false, { description: nls.localize('formatOnType', \"Controls whether the editor should automatically format the line after typing.\") })),\n glyphMargin: register(new EditorBooleanOption(57 /* EditorOption.glyphMargin */, 'glyphMargin', true, { description: nls.localize('glyphMargin', \"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.\") })),\n gotoLocation: register(new EditorGoToLocation()),\n hideCursorInOverviewRuler: register(new EditorBooleanOption(59 /* EditorOption.hideCursorInOverviewRuler */, 'hideCursorInOverviewRuler', false, { description: nls.localize('hideCursorInOverviewRuler', \"Controls whether the cursor should be hidden in the overview ruler.\") })),\n hover: register(new EditorHover()),\n inDiffEditor: register(new EditorBooleanOption(61 /* EditorOption.inDiffEditor */, 'inDiffEditor', false)),\n letterSpacing: register(new EditorFloatOption(63 /* EditorOption.letterSpacing */, 'letterSpacing', EDITOR_FONT_DEFAULTS.letterSpacing, x => EditorFloatOption.clamp(x, -5, 20), { description: nls.localize('letterSpacing', \"Controls the letter spacing in pixels.\") })),\n lightbulb: register(new EditorLightbulb()),\n lineDecorationsWidth: register(new EditorLineDecorationsWidth()),\n lineHeight: register(new EditorLineHeight()),\n lineNumbers: register(new EditorRenderLineNumbersOption()),\n lineNumbersMinChars: register(new EditorIntOption(68 /* EditorOption.lineNumbersMinChars */, 'lineNumbersMinChars', 5, 1, 300)),\n linkedEditing: register(new EditorBooleanOption(69 /* EditorOption.linkedEditing */, 'linkedEditing', false, { description: nls.localize('linkedEditing', \"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.\") })),\n links: register(new EditorBooleanOption(70 /* EditorOption.links */, 'links', true, { description: nls.localize('links', \"Controls whether the editor should detect links and make them clickable.\") })),\n matchBrackets: register(new EditorStringEnumOption(71 /* EditorOption.matchBrackets */, 'matchBrackets', 'always', ['always', 'near', 'never'], { description: nls.localize('matchBrackets', \"Highlight matching brackets.\") })),\n minimap: register(new EditorMinimap()),\n mouseStyle: register(new EditorStringEnumOption(73 /* EditorOption.mouseStyle */, 'mouseStyle', 'text', ['text', 'default', 'copy'])),\n mouseWheelScrollSensitivity: register(new EditorFloatOption(74 /* EditorOption.mouseWheelScrollSensitivity */, 'mouseWheelScrollSensitivity', 1, x => (x === 0 ? 1 : x), { markdownDescription: nls.localize('mouseWheelScrollSensitivity', \"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.\") })),\n mouseWheelZoom: register(new EditorBooleanOption(75 /* EditorOption.mouseWheelZoom */, 'mouseWheelZoom', false, {\n markdownDescription: platform.isMacintosh\n ? nls.localize('mouseWheelZoom.mac', \"Zoom the font of the editor when using mouse wheel and holding `Cmd`.\")\n : nls.localize('mouseWheelZoom', \"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.\")\n })),\n multiCursorMergeOverlapping: register(new EditorBooleanOption(76 /* EditorOption.multiCursorMergeOverlapping */, 'multiCursorMergeOverlapping', true, { description: nls.localize('multiCursorMergeOverlapping', \"Merge multiple cursors when they are overlapping.\") })),\n multiCursorModifier: register(new EditorEnumOption(77 /* EditorOption.multiCursorModifier */, 'multiCursorModifier', 'altKey', 'alt', ['ctrlCmd', 'alt'], _multiCursorModifierFromString, {\n markdownEnumDescriptions: [\n nls.localize('multiCursorModifier.ctrlCmd', \"Maps to `Control` on Windows and Linux and to `Command` on macOS.\"),\n nls.localize('multiCursorModifier.alt', \"Maps to `Alt` on Windows and Linux and to `Option` on macOS.\")\n ],\n markdownDescription: nls.localize({\n key: 'multiCursorModifier',\n comment: [\n '- `ctrlCmd` refers to a value the setting can take and should not be localized.',\n '- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized.'\n ]\n }, \"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).\")\n })),\n multiCursorPaste: register(new EditorStringEnumOption(78 /* EditorOption.multiCursorPaste */, 'multiCursorPaste', 'spread', ['spread', 'full'], {\n markdownEnumDescriptions: [\n nls.localize('multiCursorPaste.spread', \"Each cursor pastes a single line of the text.\"),\n nls.localize('multiCursorPaste.full', \"Each cursor pastes the full text.\")\n ],\n markdownDescription: nls.localize('multiCursorPaste', \"Controls pasting when the line count of the pasted text matches the cursor count.\")\n })),\n multiCursorLimit: register(new EditorIntOption(79 /* EditorOption.multiCursorLimit */, 'multiCursorLimit', 10000, 1, 100000, {\n markdownDescription: nls.localize('multiCursorLimit', \"Controls the max number of cursors that can be in an active editor at once.\")\n })),\n occurrencesHighlight: register(new EditorStringEnumOption(80 /* EditorOption.occurrencesHighlight */, 'occurrencesHighlight', 'singleFile', ['off', 'singleFile', 'multiFile'], {\n markdownEnumDescriptions: [\n nls.localize('occurrencesHighlight.off', \"Does not highlight occurrences.\"),\n nls.localize('occurrencesHighlight.singleFile', \"Highlights occurrences only in the current file.\"),\n nls.localize('occurrencesHighlight.multiFile', \"Experimental: Highlights occurrences across all valid open files.\")\n ],\n markdownDescription: nls.localize('occurrencesHighlight', \"Controls whether occurrences should be highlighted across open files.\")\n })),\n overviewRulerBorder: register(new EditorBooleanOption(81 /* EditorOption.overviewRulerBorder */, 'overviewRulerBorder', true, { description: nls.localize('overviewRulerBorder', \"Controls whether a border should be drawn around the overview ruler.\") })),\n overviewRulerLanes: register(new EditorIntOption(82 /* EditorOption.overviewRulerLanes */, 'overviewRulerLanes', 3, 0, 3)),\n padding: register(new EditorPadding()),\n pasteAs: register(new EditorPasteAs()),\n parameterHints: register(new EditorParameterHints()),\n peekWidgetDefaultFocus: register(new EditorStringEnumOption(86 /* EditorOption.peekWidgetDefaultFocus */, 'peekWidgetDefaultFocus', 'tree', ['tree', 'editor'], {\n enumDescriptions: [\n nls.localize('peekWidgetDefaultFocus.tree', \"Focus the tree when opening peek\"),\n nls.localize('peekWidgetDefaultFocus.editor', \"Focus the editor when opening peek\")\n ],\n description: nls.localize('peekWidgetDefaultFocus', \"Controls whether to focus the inline editor or the tree in the peek widget.\")\n })),\n definitionLinkOpensInPeek: register(new EditorBooleanOption(87 /* EditorOption.definitionLinkOpensInPeek */, 'definitionLinkOpensInPeek', false, { description: nls.localize('definitionLinkOpensInPeek', \"Controls whether the Go to Definition mouse gesture always opens the peek widget.\") })),\n quickSuggestions: register(new EditorQuickSuggestions()),\n quickSuggestionsDelay: register(new EditorIntOption(89 /* EditorOption.quickSuggestionsDelay */, 'quickSuggestionsDelay', 10, 0, 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */, { description: nls.localize('quickSuggestionsDelay', \"Controls the delay in milliseconds after which quick suggestions will show up.\") })),\n readOnly: register(new EditorBooleanOption(90 /* EditorOption.readOnly */, 'readOnly', false)),\n readOnlyMessage: register(new ReadonlyMessage()),\n renameOnType: register(new EditorBooleanOption(92 /* EditorOption.renameOnType */, 'renameOnType', false, { description: nls.localize('renameOnType', \"Controls whether the editor auto renames on type.\"), markdownDeprecationMessage: nls.localize('renameOnTypeDeprecate', \"Deprecated, use `editor.linkedEditing` instead.\") })),\n renderControlCharacters: register(new EditorBooleanOption(93 /* EditorOption.renderControlCharacters */, 'renderControlCharacters', true, { description: nls.localize('renderControlCharacters', \"Controls whether the editor should render control characters.\"), restricted: true })),\n renderFinalNewline: register(new EditorStringEnumOption(94 /* EditorOption.renderFinalNewline */, 'renderFinalNewline', (platform.isLinux ? 'dimmed' : 'on'), ['off', 'on', 'dimmed'], { description: nls.localize('renderFinalNewline', \"Render last line number when the file ends with a newline.\") })),\n renderLineHighlight: register(new EditorStringEnumOption(95 /* EditorOption.renderLineHighlight */, 'renderLineHighlight', 'line', ['none', 'gutter', 'line', 'all'], {\n enumDescriptions: [\n '',\n '',\n '',\n nls.localize('renderLineHighlight.all', \"Highlights both the gutter and the current line.\"),\n ],\n description: nls.localize('renderLineHighlight', \"Controls how the editor should render the current line highlight.\")\n })),\n renderLineHighlightOnlyWhenFocus: register(new EditorBooleanOption(96 /* EditorOption.renderLineHighlightOnlyWhenFocus */, 'renderLineHighlightOnlyWhenFocus', false, { description: nls.localize('renderLineHighlightOnlyWhenFocus', \"Controls if the editor should render the current line highlight only when the editor is focused.\") })),\n renderValidationDecorations: register(new EditorStringEnumOption(97 /* EditorOption.renderValidationDecorations */, 'renderValidationDecorations', 'editable', ['editable', 'on', 'off'])),\n renderWhitespace: register(new EditorStringEnumOption(98 /* EditorOption.renderWhitespace */, 'renderWhitespace', 'selection', ['none', 'boundary', 'selection', 'trailing', 'all'], {\n enumDescriptions: [\n '',\n nls.localize('renderWhitespace.boundary', \"Render whitespace characters except for single spaces between words.\"),\n nls.localize('renderWhitespace.selection', \"Render whitespace characters only on selected text.\"),\n nls.localize('renderWhitespace.trailing', \"Render only trailing whitespace characters.\"),\n ''\n ],\n description: nls.localize('renderWhitespace', \"Controls how the editor should render whitespace characters.\")\n })),\n revealHorizontalRightPadding: register(new EditorIntOption(99 /* EditorOption.revealHorizontalRightPadding */, 'revealHorizontalRightPadding', 15, 0, 1000)),\n roundedSelection: register(new EditorBooleanOption(100 /* EditorOption.roundedSelection */, 'roundedSelection', true, { description: nls.localize('roundedSelection', \"Controls whether selections should have rounded corners.\") })),\n rulers: register(new EditorRulers()),\n scrollbar: register(new EditorScrollbar()),\n scrollBeyondLastColumn: register(new EditorIntOption(103 /* EditorOption.scrollBeyondLastColumn */, 'scrollBeyondLastColumn', 4, 0, 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */, { description: nls.localize('scrollBeyondLastColumn', \"Controls the number of extra characters beyond which the editor will scroll horizontally.\") })),\n scrollBeyondLastLine: register(new EditorBooleanOption(104 /* EditorOption.scrollBeyondLastLine */, 'scrollBeyondLastLine', true, { description: nls.localize('scrollBeyondLastLine', \"Controls whether the editor will scroll beyond the last line.\") })),\n scrollPredominantAxis: register(new EditorBooleanOption(105 /* EditorOption.scrollPredominantAxis */, 'scrollPredominantAxis', true, { description: nls.localize('scrollPredominantAxis', \"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.\") })),\n selectionClipboard: register(new EditorBooleanOption(106 /* EditorOption.selectionClipboard */, 'selectionClipboard', true, {\n description: nls.localize('selectionClipboard', \"Controls whether the Linux primary clipboard should be supported.\"),\n included: platform.isLinux\n })),\n selectionHighlight: register(new EditorBooleanOption(107 /* EditorOption.selectionHighlight */, 'selectionHighlight', true, { description: nls.localize('selectionHighlight', \"Controls whether the editor should highlight matches similar to the selection.\") })),\n selectOnLineNumbers: register(new EditorBooleanOption(108 /* EditorOption.selectOnLineNumbers */, 'selectOnLineNumbers', true)),\n showFoldingControls: register(new EditorStringEnumOption(109 /* EditorOption.showFoldingControls */, 'showFoldingControls', 'mouseover', ['always', 'never', 'mouseover'], {\n enumDescriptions: [\n nls.localize('showFoldingControls.always', \"Always show the folding controls.\"),\n nls.localize('showFoldingControls.never', \"Never show the folding controls and reduce the gutter size.\"),\n nls.localize('showFoldingControls.mouseover', \"Only show the folding controls when the mouse is over the gutter.\"),\n ],\n description: nls.localize('showFoldingControls', \"Controls when the folding controls on the gutter are shown.\")\n })),\n showUnused: register(new EditorBooleanOption(110 /* EditorOption.showUnused */, 'showUnused', true, { description: nls.localize('showUnused', \"Controls fading out of unused code.\") })),\n showDeprecated: register(new EditorBooleanOption(138 /* EditorOption.showDeprecated */, 'showDeprecated', true, { description: nls.localize('showDeprecated', \"Controls strikethrough deprecated variables.\") })),\n inlayHints: register(new EditorInlayHints()),\n snippetSuggestions: register(new EditorStringEnumOption(111 /* EditorOption.snippetSuggestions */, 'snippetSuggestions', 'inline', ['top', 'bottom', 'inline', 'none'], {\n enumDescriptions: [\n nls.localize('snippetSuggestions.top', \"Show snippet suggestions on top of other suggestions.\"),\n nls.localize('snippetSuggestions.bottom', \"Show snippet suggestions below other suggestions.\"),\n nls.localize('snippetSuggestions.inline', \"Show snippets suggestions with other suggestions.\"),\n nls.localize('snippetSuggestions.none', \"Do not show snippet suggestions.\"),\n ],\n description: nls.localize('snippetSuggestions', \"Controls whether snippets are shown with other suggestions and how they are sorted.\")\n })),\n smartSelect: register(new SmartSelect()),\n smoothScrolling: register(new EditorBooleanOption(113 /* EditorOption.smoothScrolling */, 'smoothScrolling', false, { description: nls.localize('smoothScrolling', \"Controls whether the editor will scroll using an animation.\") })),\n stopRenderingLineAfter: register(new EditorIntOption(116 /* EditorOption.stopRenderingLineAfter */, 'stopRenderingLineAfter', 10000, -1, 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */)),\n suggest: register(new EditorSuggest()),\n inlineSuggest: register(new InlineEditorSuggest()),\n inlineCompletionsAccessibilityVerbose: register(new EditorBooleanOption(147 /* EditorOption.inlineCompletionsAccessibilityVerbose */, 'inlineCompletionsAccessibilityVerbose', false, { description: nls.localize('inlineCompletionsAccessibilityVerbose', \"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.\") })),\n suggestFontSize: register(new EditorIntOption(118 /* EditorOption.suggestFontSize */, 'suggestFontSize', 0, 0, 1000, { markdownDescription: nls.localize('suggestFontSize', \"Font size for the suggest widget. When set to {0}, the value of {1} is used.\", '`0`', '`#editor.fontSize#`') })),\n suggestLineHeight: register(new EditorIntOption(119 /* EditorOption.suggestLineHeight */, 'suggestLineHeight', 0, 0, 1000, { markdownDescription: nls.localize('suggestLineHeight', \"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.\", '`0`', '`#editor.lineHeight#`') })),\n suggestOnTriggerCharacters: register(new EditorBooleanOption(120 /* EditorOption.suggestOnTriggerCharacters */, 'suggestOnTriggerCharacters', true, { description: nls.localize('suggestOnTriggerCharacters', \"Controls whether suggestions should automatically show up when typing trigger characters.\") })),\n suggestSelection: register(new EditorStringEnumOption(121 /* EditorOption.suggestSelection */, 'suggestSelection', 'first', ['first', 'recentlyUsed', 'recentlyUsedByPrefix'], {\n markdownEnumDescriptions: [\n nls.localize('suggestSelection.first', \"Always select the first suggestion.\"),\n nls.localize('suggestSelection.recentlyUsed', \"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently.\"),\n nls.localize('suggestSelection.recentlyUsedByPrefix', \"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.\"),\n ],\n description: nls.localize('suggestSelection', \"Controls how suggestions are pre-selected when showing the suggest list.\")\n })),\n tabCompletion: register(new EditorStringEnumOption(122 /* EditorOption.tabCompletion */, 'tabCompletion', 'off', ['on', 'off', 'onlySnippets'], {\n enumDescriptions: [\n nls.localize('tabCompletion.on', \"Tab complete will insert the best matching suggestion when pressing tab.\"),\n nls.localize('tabCompletion.off', \"Disable tab completions.\"),\n nls.localize('tabCompletion.onlySnippets', \"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.\"),\n ],\n description: nls.localize('tabCompletion', \"Enables tab completions.\")\n })),\n tabIndex: register(new EditorIntOption(123 /* EditorOption.tabIndex */, 'tabIndex', 0, -1, 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */)),\n unicodeHighlight: register(new UnicodeHighlight()),\n unusualLineTerminators: register(new EditorStringEnumOption(125 /* EditorOption.unusualLineTerminators */, 'unusualLineTerminators', 'prompt', ['auto', 'off', 'prompt'], {\n enumDescriptions: [\n nls.localize('unusualLineTerminators.auto', \"Unusual line terminators are automatically removed.\"),\n nls.localize('unusualLineTerminators.off', \"Unusual line terminators are ignored.\"),\n nls.localize('unusualLineTerminators.prompt', \"Unusual line terminators prompt to be removed.\"),\n ],\n description: nls.localize('unusualLineTerminators', \"Remove unusual line terminators that might cause problems.\")\n })),\n useShadowDOM: register(new EditorBooleanOption(126 /* EditorOption.useShadowDOM */, 'useShadowDOM', true)),\n useTabStops: register(new EditorBooleanOption(127 /* EditorOption.useTabStops */, 'useTabStops', true, { description: nls.localize('useTabStops', \"Inserting and deleting whitespace follows tab stops.\") })),\n wordBreak: register(new EditorStringEnumOption(128 /* EditorOption.wordBreak */, 'wordBreak', 'normal', ['normal', 'keepAll'], {\n markdownEnumDescriptions: [\n nls.localize('wordBreak.normal', \"Use the default line break rule.\"),\n nls.localize('wordBreak.keepAll', \"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.\"),\n ],\n description: nls.localize('wordBreak', \"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.\")\n })),\n wordSeparators: register(new EditorStringOption(129 /* EditorOption.wordSeparators */, 'wordSeparators', USUAL_WORD_SEPARATORS, { description: nls.localize('wordSeparators', \"Characters that will be used as word separators when doing word related navigations or operations.\") })),\n wordWrap: register(new EditorStringEnumOption(130 /* EditorOption.wordWrap */, 'wordWrap', 'off', ['off', 'on', 'wordWrapColumn', 'bounded'], {\n markdownEnumDescriptions: [\n nls.localize('wordWrap.off', \"Lines will never wrap.\"),\n nls.localize('wordWrap.on', \"Lines will wrap at the viewport width.\"),\n nls.localize({\n key: 'wordWrap.wordWrapColumn',\n comment: [\n '- `editor.wordWrapColumn` refers to a different setting and should not be localized.'\n ]\n }, \"Lines will wrap at `#editor.wordWrapColumn#`.\"),\n nls.localize({\n key: 'wordWrap.bounded',\n comment: [\n '- viewport means the edge of the visible window size.',\n '- `editor.wordWrapColumn` refers to a different setting and should not be localized.'\n ]\n }, \"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.\"),\n ],\n description: nls.localize({\n key: 'wordWrap',\n comment: [\n '- \\'off\\', \\'on\\', \\'wordWrapColumn\\' and \\'bounded\\' refer to values the setting can take and should not be localized.',\n '- `editor.wordWrapColumn` refers to a different setting and should not be localized.'\n ]\n }, \"Controls how lines should wrap.\")\n })),\n wordWrapBreakAfterCharacters: register(new EditorStringOption(131 /* EditorOption.wordWrapBreakAfterCharacters */, 'wordWrapBreakAfterCharacters', \n // allow-any-unicode-next-line\n ' \\t})]?|/&.,;\u00A2\u00B0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63')),\n wordWrapBreakBeforeCharacters: register(new EditorStringOption(132 /* EditorOption.wordWrapBreakBeforeCharacters */, 'wordWrapBreakBeforeCharacters', \n // allow-any-unicode-next-line\n '([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\u00A3\u00A5\uFF04\uFFE1\uFFE5+\uFF0B')),\n wordWrapColumn: register(new EditorIntOption(133 /* EditorOption.wordWrapColumn */, 'wordWrapColumn', 80, 1, 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */, {\n markdownDescription: nls.localize({\n key: 'wordWrapColumn',\n comment: [\n '- `editor.wordWrap` refers to a different setting and should not be localized.',\n '- \\'wordWrapColumn\\' and \\'bounded\\' refer to values the different setting can take and should not be localized.'\n ]\n }, \"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.\")\n })),\n wordWrapOverride1: register(new EditorStringEnumOption(134 /* EditorOption.wordWrapOverride1 */, 'wordWrapOverride1', 'inherit', ['off', 'on', 'inherit'])),\n wordWrapOverride2: register(new EditorStringEnumOption(135 /* EditorOption.wordWrapOverride2 */, 'wordWrapOverride2', 'inherit', ['off', 'on', 'inherit'])),\n // Leave these at the end (because they have dependencies!)\n editorClassName: register(new EditorClassName()),\n defaultColorDecorators: register(new EditorBooleanOption(145 /* EditorOption.defaultColorDecorators */, 'defaultColorDecorators', false, { markdownDescription: nls.localize('defaultColorDecorators', \"Controls whether inline color decorations should be shown using the default document color provider\") })),\n pixelRatio: register(new EditorPixelRatio()),\n tabFocusMode: register(new EditorBooleanOption(142 /* EditorOption.tabFocusMode */, 'tabFocusMode', false, { markdownDescription: nls.localize('tabFocusMode', \"Controls whether the editor receives tabs or defers them to the workbench for navigation.\") })),\n layoutInfo: register(new EditorLayoutInfoComputer()),\n wrappingInfo: register(new EditorWrappingInfoComputer()),\n wrappingIndent: register(new WrappingIndentOption()),\n wrappingStrategy: register(new WrappingStrategy())\n};\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// Avoid circular dependency on EventEmitter by implementing a subset of the interface.\nexport class ErrorHandler {\n constructor() {\n this.listeners = [];\n this.unexpectedErrorHandler = function (e) {\n setTimeout(() => {\n if (e.stack) {\n if (ErrorNoTelemetry.isErrorNoTelemetry(e)) {\n throw new ErrorNoTelemetry(e.message + '\\n\\n' + e.stack);\n }\n throw new Error(e.message + '\\n\\n' + e.stack);\n }\n throw e;\n }, 0);\n };\n }\n emit(e) {\n this.listeners.forEach((listener) => {\n listener(e);\n });\n }\n onUnexpectedError(e) {\n this.unexpectedErrorHandler(e);\n this.emit(e);\n }\n // For external errors, we don't want the listeners to be called\n onUnexpectedExternalError(e) {\n this.unexpectedErrorHandler(e);\n }\n}\nexport const errorHandler = new ErrorHandler();\nexport function onUnexpectedError(e) {\n // ignore errors from cancelled promises\n if (!isCancellationError(e)) {\n errorHandler.onUnexpectedError(e);\n }\n return undefined;\n}\nexport function onUnexpectedExternalError(e) {\n // ignore errors from cancelled promises\n if (!isCancellationError(e)) {\n errorHandler.onUnexpectedExternalError(e);\n }\n return undefined;\n}\nexport function transformErrorForSerialization(error) {\n if (error instanceof Error) {\n const { name, message } = error;\n const stack = error.stacktrace || error.stack;\n return {\n $isError: true,\n name,\n message,\n stack,\n noTelemetry: ErrorNoTelemetry.isErrorNoTelemetry(error)\n };\n }\n // return as is\n return error;\n}\nconst canceledName = 'Canceled';\n/**\n * Checks if the given error is a promise in canceled state\n */\nexport function isCancellationError(error) {\n if (error instanceof CancellationError) {\n return true;\n }\n return error instanceof Error && error.name === canceledName && error.message === canceledName;\n}\n// !!!IMPORTANT!!!\n// Do NOT change this class because it is also used as an API-type.\nexport class CancellationError extends Error {\n constructor() {\n super(canceledName);\n this.name = this.message;\n }\n}\n/**\n * @deprecated use {@link CancellationError `new CancellationError()`} instead\n */\nexport function canceled() {\n const error = new Error(canceledName);\n error.name = error.message;\n return error;\n}\nexport function illegalArgument(name) {\n if (name) {\n return new Error(`Illegal argument: ${name}`);\n }\n else {\n return new Error('Illegal argument');\n }\n}\nexport function illegalState(name) {\n if (name) {\n return new Error(`Illegal state: ${name}`);\n }\n else {\n return new Error('Illegal state');\n }\n}\nexport class NotSupportedError extends Error {\n constructor(message) {\n super('NotSupported');\n if (message) {\n this.message = message;\n }\n }\n}\n/**\n * Error that when thrown won't be logged in telemetry as an unhandled error.\n */\nexport class ErrorNoTelemetry extends Error {\n constructor(msg) {\n super(msg);\n this.name = 'CodeExpectedError';\n }\n static fromError(err) {\n if (err instanceof ErrorNoTelemetry) {\n return err;\n }\n const result = new ErrorNoTelemetry();\n result.message = err.message;\n result.stack = err.stack;\n return result;\n }\n static isErrorNoTelemetry(err) {\n return err.name === 'CodeExpectedError';\n }\n}\n/**\n * This error indicates a bug.\n * Do not throw this for invalid user input.\n * Only catch this error to recover gracefully from bugs.\n */\nexport class BugIndicatingError extends Error {\n constructor(message) {\n super(message || 'An unexpected bug occurred.');\n Object.setPrototypeOf(this, BugIndicatingError.prototype);\n // Because we know for sure only buggy code throws this,\n // we definitely want to break here and fix the bug.\n // eslint-disable-next-line no-debugger\n // debugger;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Given a function, returns a function that is only calling that function once.\n */\nexport function createSingleCallFunction(fn, fnDidRunCallback) {\n const _this = this;\n let didCall = false;\n let result;\n return function () {\n if (didCall) {\n return result;\n }\n didCall = true;\n if (fnDidRunCallback) {\n try {\n result = fn.apply(_this, arguments);\n }\n finally {\n fnDidRunCallback();\n }\n }\n else {\n result = fn.apply(_this, arguments);\n }\n return result;\n };\n}\n", "import { createSingleCallFunction } from './functional.js';\nimport { Iterable } from './iterator.js';\n// #region Disposable Tracking\n/**\n * Enables logging of potentially leaked disposables.\n *\n * A disposable is considered leaked if it is not disposed or not registered as the child of\n * another disposable. This tracking is very simple an only works for classes that either\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\n */\nconst TRACK_DISPOSABLES = false;\nlet disposableTracker = null;\nexport function setDisposableTracker(tracker) {\n disposableTracker = tracker;\n}\nif (TRACK_DISPOSABLES) {\n const __is_disposable_tracked__ = '__is_disposable_tracked__';\n setDisposableTracker(new class {\n trackDisposable(x) {\n const stack = new Error('Potentially leaked disposable').stack;\n setTimeout(() => {\n if (!x[__is_disposable_tracked__]) {\n console.log(stack);\n }\n }, 3000);\n }\n setParent(child, parent) {\n if (child && child !== Disposable.None) {\n try {\n child[__is_disposable_tracked__] = true;\n }\n catch (_a) {\n // noop\n }\n }\n }\n markAsDisposed(disposable) {\n if (disposable && disposable !== Disposable.None) {\n try {\n disposable[__is_disposable_tracked__] = true;\n }\n catch (_a) {\n // noop\n }\n }\n }\n markAsSingleton(disposable) { }\n });\n}\nexport function trackDisposable(x) {\n disposableTracker === null || disposableTracker === void 0 ? void 0 : disposableTracker.trackDisposable(x);\n return x;\n}\nexport function markAsDisposed(disposable) {\n disposableTracker === null || disposableTracker === void 0 ? void 0 : disposableTracker.markAsDisposed(disposable);\n}\nfunction setParentOfDisposable(child, parent) {\n disposableTracker === null || disposableTracker === void 0 ? void 0 : disposableTracker.setParent(child, parent);\n}\nfunction setParentOfDisposables(children, parent) {\n if (!disposableTracker) {\n return;\n }\n for (const child of children) {\n disposableTracker.setParent(child, parent);\n }\n}\n/**\n * Indicates that the given object is a singleton which does not need to be disposed.\n*/\nexport function markAsSingleton(singleton) {\n disposableTracker === null || disposableTracker === void 0 ? void 0 : disposableTracker.markAsSingleton(singleton);\n return singleton;\n}\n/**\n * Check if `thing` is {@link IDisposable disposable}.\n */\nexport function isDisposable(thing) {\n return typeof thing.dispose === 'function' && thing.dispose.length === 0;\n}\nexport function dispose(arg) {\n if (Iterable.is(arg)) {\n const errors = [];\n for (const d of arg) {\n if (d) {\n try {\n d.dispose();\n }\n catch (e) {\n errors.push(e);\n }\n }\n }\n if (errors.length === 1) {\n throw errors[0];\n }\n else if (errors.length > 1) {\n throw new AggregateError(errors, 'Encountered errors while disposing of store');\n }\n return Array.isArray(arg) ? [] : arg;\n }\n else if (arg) {\n arg.dispose();\n return arg;\n }\n}\n/**\n * Combine multiple disposable values into a single {@link IDisposable}.\n */\nexport function combinedDisposable(...disposables) {\n const parent = toDisposable(() => dispose(disposables));\n setParentOfDisposables(disposables, parent);\n return parent;\n}\n/**\n * Turn a function that implements dispose into an {@link IDisposable}.\n *\n * @param fn Clean up function, guaranteed to be called only **once**.\n */\nexport function toDisposable(fn) {\n const self = trackDisposable({\n dispose: createSingleCallFunction(() => {\n markAsDisposed(self);\n fn();\n })\n });\n return self;\n}\n/**\n * Manages a collection of disposable values.\n *\n * This is the preferred way to manage multiple disposables. A `DisposableStore` is safer to work with than an\n * `IDisposable[]` as it considers edge cases, such as registering the same value multiple times or adding an item to a\n * store that has already been disposed of.\n */\nexport class DisposableStore {\n constructor() {\n this._toDispose = new Set();\n this._isDisposed = false;\n trackDisposable(this);\n }\n /**\n * Dispose of all registered disposables and mark this object as disposed.\n *\n * Any future disposables added to this object will be disposed of on `add`.\n */\n dispose() {\n if (this._isDisposed) {\n return;\n }\n markAsDisposed(this);\n this._isDisposed = true;\n this.clear();\n }\n /**\n * @return `true` if this object has been disposed of.\n */\n get isDisposed() {\n return this._isDisposed;\n }\n /**\n * Dispose of all registered disposables but do not mark this object as disposed.\n */\n clear() {\n if (this._toDispose.size === 0) {\n return;\n }\n try {\n dispose(this._toDispose);\n }\n finally {\n this._toDispose.clear();\n }\n }\n /**\n * Add a new {@link IDisposable disposable} to the collection.\n */\n add(o) {\n if (!o) {\n return o;\n }\n if (o === this) {\n throw new Error('Cannot register a disposable on itself!');\n }\n setParentOfDisposable(o, this);\n if (this._isDisposed) {\n if (!DisposableStore.DISABLE_DISPOSED_WARNING) {\n 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);\n }\n }\n else {\n this._toDispose.add(o);\n }\n return o;\n }\n /**\n * Deletes the value from the store, but does not dispose it.\n */\n deleteAndLeak(o) {\n if (!o) {\n return;\n }\n if (this._toDispose.has(o)) {\n this._toDispose.delete(o);\n setParentOfDisposable(o, null);\n }\n }\n}\nDisposableStore.DISABLE_DISPOSED_WARNING = false;\n/**\n * Abstract base class for a {@link IDisposable disposable} object.\n *\n * Subclasses can {@linkcode _register} disposables that will be automatically cleaned up when this object is disposed of.\n */\nexport class Disposable {\n constructor() {\n this._store = new DisposableStore();\n trackDisposable(this);\n setParentOfDisposable(this._store, this);\n }\n dispose() {\n markAsDisposed(this);\n this._store.dispose();\n }\n /**\n * Adds `o` to the collection of disposables managed by this object.\n */\n _register(o) {\n if (o === this) {\n throw new Error('Cannot register a disposable on itself!');\n }\n return this._store.add(o);\n }\n}\n/**\n * A disposable that does nothing when it is disposed of.\n *\n * TODO: This should not be a static property.\n */\nDisposable.None = Object.freeze({ dispose() { } });\n/**\n * Manages the lifecycle of a disposable value that may be changed.\n *\n * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\n */\nexport class MutableDisposable {\n constructor() {\n this._isDisposed = false;\n trackDisposable(this);\n }\n get value() {\n return this._isDisposed ? undefined : this._value;\n }\n set value(value) {\n var _a;\n if (this._isDisposed || value === this._value) {\n return;\n }\n (_a = this._value) === null || _a === void 0 ? void 0 : _a.dispose();\n if (value) {\n setParentOfDisposable(value, this);\n }\n this._value = value;\n }\n /**\n * Resets the stored value and disposed of the previously stored value.\n */\n clear() {\n this.value = undefined;\n }\n dispose() {\n var _a;\n this._isDisposed = true;\n markAsDisposed(this);\n (_a = this._value) === null || _a === void 0 ? void 0 : _a.dispose();\n this._value = undefined;\n }\n}\nexport class RefCountedDisposable {\n constructor(_disposable) {\n this._disposable = _disposable;\n this._counter = 1;\n }\n acquire() {\n this._counter++;\n return this;\n }\n release() {\n if (--this._counter === 0) {\n this._disposable.dispose();\n }\n return this;\n }\n}\nexport class ImmortalReference {\n constructor(object) {\n this.object = object;\n }\n dispose() { }\n}\n/**\n * A map the manages the lifecycle of the values that it stores.\n */\nexport class DisposableMap {\n constructor() {\n this._store = new Map();\n this._isDisposed = false;\n trackDisposable(this);\n }\n /**\n * Disposes of all stored values and mark this object as disposed.\n *\n * Trying to use this object after it has been disposed of is an error.\n */\n dispose() {\n markAsDisposed(this);\n this._isDisposed = true;\n this.clearAndDisposeAll();\n }\n /**\n * Disposes of all stored values and clear the map, but DO NOT mark this object as disposed.\n */\n clearAndDisposeAll() {\n if (!this._store.size) {\n return;\n }\n try {\n dispose(this._store.values());\n }\n finally {\n this._store.clear();\n }\n }\n get(key) {\n return this._store.get(key);\n }\n set(key, value, skipDisposeOnOverwrite = false) {\n var _a;\n if (this._isDisposed) {\n console.warn(new Error('Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!').stack);\n }\n if (!skipDisposeOnOverwrite) {\n (_a = this._store.get(key)) === null || _a === void 0 ? void 0 : _a.dispose();\n }\n this._store.set(key, value);\n }\n /**\n * Delete the value stored for `key` from this map and also dispose of it.\n */\n deleteAndDispose(key) {\n var _a;\n (_a = this._store.get(key)) === null || _a === void 0 ? void 0 : _a.dispose();\n this._store.delete(key);\n }\n [Symbol.iterator]() {\n return this._store[Symbol.iterator]();\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nconst hasPerformanceNow = (globalThis.performance && typeof globalThis.performance.now === 'function');\nexport class StopWatch {\n static create(highResolution) {\n return new StopWatch(highResolution);\n }\n constructor(highResolution) {\n this._now = hasPerformanceNow && highResolution === false ? Date.now : globalThis.performance.now.bind(globalThis.performance);\n this._startTime = this._now();\n this._stopTime = -1;\n }\n stop() {\n this._stopTime = this._now();\n }\n elapsed() {\n if (this._stopTime !== -1) {\n return this._stopTime - this._startTime;\n }\n return this._now() - this._startTime;\n }\n}\n", "import { onUnexpectedError } from './errors.js';\nimport { createSingleCallFunction } from './functional.js';\nimport { combinedDisposable, Disposable, DisposableStore, toDisposable } from './lifecycle.js';\nimport { LinkedList } from './linkedList.js';\nimport { StopWatch } from './stopwatch.js';\n// -----------------------------------------------------------------------------------------------------------------------\n// Uncomment the next line to print warnings whenever an emitter with listeners is disposed. That is a sign of code smell.\n// -----------------------------------------------------------------------------------------------------------------------\nconst _enableDisposeWithListenerWarning = false;\n// _enableDisposeWithListenerWarning = Boolean(\"TRUE\"); // causes a linter warning so that it cannot be pushed\n// -----------------------------------------------------------------------------------------------------------------------\n// Uncomment the next line to print warnings whenever a snapshotted event is used repeatedly without cleanup.\n// See https://github.com/microsoft/vscode/issues/142851\n// -----------------------------------------------------------------------------------------------------------------------\nconst _enableSnapshotPotentialLeakWarning = false;\nexport var Event;\n(function (Event) {\n Event.None = () => Disposable.None;\n function _addLeakageTraceLogic(options) {\n if (_enableSnapshotPotentialLeakWarning) {\n const { onDidAddListener: origListenerDidAdd } = options;\n const stack = Stacktrace.create();\n let count = 0;\n options.onDidAddListener = () => {\n if (++count === 2) {\n console.warn('snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here');\n stack.print();\n }\n origListenerDidAdd === null || origListenerDidAdd === void 0 ? void 0 : origListenerDidAdd();\n };\n }\n }\n /**\n * Given an event, returns another event which debounces calls and defers the listeners to a later task via a shared\n * `setTimeout`. The event is converted into a signal (`Event`) to avoid additional object creation as a\n * result of merging events and to try prevent race conditions that could arise when using related deferred and\n * non-deferred events.\n *\n * This is useful for deferring non-critical work (eg. general UI updates) to ensure it does not block critical work\n * (eg. latency of keypress to text rendered).\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @param event The event source for the new event.\n * @param disposable A disposable store to add the new EventEmitter to.\n */\n function defer(event, disposable) {\n return debounce(event, () => void 0, 0, undefined, true, undefined, disposable);\n }\n Event.defer = defer;\n /**\n * Given an event, returns another event which only fires once.\n *\n * @param event The event source for the new event.\n */\n function once(event) {\n return (listener, thisArgs = null, disposables) => {\n // we need this, in case the event fires during the listener call\n let didFire = false;\n let result = undefined;\n result = event(e => {\n if (didFire) {\n return;\n }\n else if (result) {\n result.dispose();\n }\n else {\n didFire = true;\n }\n return listener.call(thisArgs, e);\n }, null, disposables);\n if (didFire) {\n result.dispose();\n }\n return result;\n };\n }\n Event.once = once;\n /**\n * Maps an event of one type into an event of another type using a mapping function, similar to how\n * `Array.prototype.map` works.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @param event The event source for the new event.\n * @param map The mapping function.\n * @param disposable A disposable store to add the new EventEmitter to.\n */\n function map(event, map, disposable) {\n return snapshot((listener, thisArgs = null, disposables) => event(i => listener.call(thisArgs, map(i)), null, disposables), disposable);\n }\n Event.map = map;\n /**\n * Wraps an event in another event that performs some function on the event object before firing.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @param event The event source for the new event.\n * @param each The function to perform on the event object.\n * @param disposable A disposable store to add the new EventEmitter to.\n */\n function forEach(event, each, disposable) {\n return snapshot((listener, thisArgs = null, disposables) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables), disposable);\n }\n Event.forEach = forEach;\n function filter(event, filter, disposable) {\n return snapshot((listener, thisArgs = null, disposables) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables), disposable);\n }\n Event.filter = filter;\n /**\n * Given an event, returns the same event but typed as `Event`.\n */\n function signal(event) {\n return event;\n }\n Event.signal = signal;\n function any(...events) {\n return (listener, thisArgs = null, disposables) => {\n const disposable = combinedDisposable(...events.map(event => event(e => listener.call(thisArgs, e))));\n return addAndReturnDisposable(disposable, disposables);\n };\n }\n Event.any = any;\n /**\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n */\n function reduce(event, merge, initial, disposable) {\n let output = initial;\n return map(event, e => {\n output = merge(output, e);\n return output;\n }, disposable);\n }\n Event.reduce = reduce;\n function snapshot(event, disposable) {\n let listener;\n const options = {\n onWillAddFirstListener() {\n listener = event(emitter.fire, emitter);\n },\n onDidRemoveLastListener() {\n listener === null || listener === void 0 ? void 0 : listener.dispose();\n }\n };\n if (!disposable) {\n _addLeakageTraceLogic(options);\n }\n const emitter = new Emitter(options);\n disposable === null || disposable === void 0 ? void 0 : disposable.add(emitter);\n return emitter.event;\n }\n /**\n * Adds the IDisposable to the store if it's set, and returns it. Useful to\n * Event function implementation.\n */\n function addAndReturnDisposable(d, store) {\n if (store instanceof Array) {\n store.push(d);\n }\n else if (store) {\n store.add(d);\n }\n return d;\n }\n function debounce(event, merge, delay = 100, leading = false, flushOnListenerRemove = false, leakWarningThreshold, disposable) {\n let subscription;\n let output = undefined;\n let handle = undefined;\n let numDebouncedCalls = 0;\n let doFire;\n const options = {\n leakWarningThreshold,\n onWillAddFirstListener() {\n subscription = event(cur => {\n numDebouncedCalls++;\n output = merge(output, cur);\n if (leading && !handle) {\n emitter.fire(output);\n output = undefined;\n }\n doFire = () => {\n const _output = output;\n output = undefined;\n handle = undefined;\n if (!leading || numDebouncedCalls > 1) {\n emitter.fire(_output);\n }\n numDebouncedCalls = 0;\n };\n if (typeof delay === 'number') {\n clearTimeout(handle);\n handle = setTimeout(doFire, delay);\n }\n else {\n if (handle === undefined) {\n handle = 0;\n queueMicrotask(doFire);\n }\n }\n });\n },\n onWillRemoveListener() {\n if (flushOnListenerRemove && numDebouncedCalls > 0) {\n doFire === null || doFire === void 0 ? void 0 : doFire();\n }\n },\n onDidRemoveLastListener() {\n doFire = undefined;\n subscription.dispose();\n }\n };\n if (!disposable) {\n _addLeakageTraceLogic(options);\n }\n const emitter = new Emitter(options);\n disposable === null || disposable === void 0 ? void 0 : disposable.add(emitter);\n return emitter.event;\n }\n Event.debounce = debounce;\n /**\n * Debounces an event, firing after some delay (default=0) with an array of all event original objects.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n */\n function accumulate(event, delay = 0, disposable) {\n return Event.debounce(event, (last, e) => {\n if (!last) {\n return [e];\n }\n last.push(e);\n return last;\n }, delay, undefined, true, undefined, disposable);\n }\n Event.accumulate = accumulate;\n /**\n * Filters an event such that some condition is _not_ met more than once in a row, effectively ensuring duplicate\n * event objects from different sources do not fire the same event object.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @param event The event source for the new event.\n * @param equals The equality condition.\n * @param disposable A disposable store to add the new EventEmitter to.\n *\n * @example\n * ```\n * // Fire only one time when a single window is opened or focused\n * Event.latch(Event.any(onDidOpenWindow, onDidFocusWindow))\n * ```\n */\n function latch(event, equals = (a, b) => a === b, disposable) {\n let firstCall = true;\n let cache;\n return filter(event, value => {\n const shouldEmit = firstCall || !equals(value, cache);\n firstCall = false;\n cache = value;\n return shouldEmit;\n }, disposable);\n }\n Event.latch = latch;\n /**\n * Splits an event whose parameter is a union type into 2 separate events for each type in the union.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @example\n * ```\n * const event = new EventEmitter().event;\n * const [numberEvent, undefinedEvent] = Event.split(event, isUndefined);\n * ```\n *\n * @param event The event source for the new event.\n * @param isT A function that determines what event is of the first type.\n * @param disposable A disposable store to add the new EventEmitter to.\n */\n function split(event, isT, disposable) {\n return [\n Event.filter(event, isT, disposable),\n Event.filter(event, e => !isT(e), disposable),\n ];\n }\n Event.split = split;\n /**\n * Buffers an event until it has a listener attached.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @param event The event source for the new event.\n * @param flushAfterTimeout Determines whether to flush the buffer after a timeout immediately or after a\n * `setTimeout` when the first event listener is added.\n * @param _buffer Internal: A source event array used for tests.\n *\n * @example\n * ```\n * // Start accumulating events, when the first listener is attached, flush\n * // the event after a timeout such that multiple listeners attached before\n * // the timeout would receive the event\n * this.onInstallExtension = Event.buffer(service.onInstallExtension, true);\n * ```\n */\n function buffer(event, flushAfterTimeout = false, _buffer = [], disposable) {\n let buffer = _buffer.slice();\n let listener = event(e => {\n if (buffer) {\n buffer.push(e);\n }\n else {\n emitter.fire(e);\n }\n });\n if (disposable) {\n disposable.add(listener);\n }\n const flush = () => {\n buffer === null || buffer === void 0 ? void 0 : buffer.forEach(e => emitter.fire(e));\n buffer = null;\n };\n const emitter = new Emitter({\n onWillAddFirstListener() {\n if (!listener) {\n listener = event(e => emitter.fire(e));\n if (disposable) {\n disposable.add(listener);\n }\n }\n },\n onDidAddFirstListener() {\n if (buffer) {\n if (flushAfterTimeout) {\n setTimeout(flush);\n }\n else {\n flush();\n }\n }\n },\n onDidRemoveLastListener() {\n if (listener) {\n listener.dispose();\n }\n listener = null;\n }\n });\n if (disposable) {\n disposable.add(emitter);\n }\n return emitter.event;\n }\n Event.buffer = buffer;\n /**\n * Wraps the event in an {@link IChainableEvent}, allowing a more functional programming style.\n *\n * @example\n * ```\n * // Normal\n * const onEnterPressNormal = Event.filter(\n * Event.map(onKeyPress.event, e => new StandardKeyboardEvent(e)),\n * e.keyCode === KeyCode.Enter\n * ).event;\n *\n * // Using chain\n * const onEnterPressChain = Event.chain(onKeyPress.event, $ => $\n * .map(e => new StandardKeyboardEvent(e))\n * .filter(e => e.keyCode === KeyCode.Enter)\n * );\n * ```\n */\n function chain(event, sythensize) {\n const fn = (listener, thisArgs, disposables) => {\n const cs = sythensize(new ChainableSynthesis());\n return event(function (value) {\n const result = cs.evaluate(value);\n if (result !== HaltChainable) {\n listener.call(thisArgs, result);\n }\n }, undefined, disposables);\n };\n return fn;\n }\n Event.chain = chain;\n const HaltChainable = Symbol('HaltChainable');\n class ChainableSynthesis {\n constructor() {\n this.steps = [];\n }\n map(fn) {\n this.steps.push(fn);\n return this;\n }\n forEach(fn) {\n this.steps.push(v => {\n fn(v);\n return v;\n });\n return this;\n }\n filter(fn) {\n this.steps.push(v => fn(v) ? v : HaltChainable);\n return this;\n }\n reduce(merge, initial) {\n let last = initial;\n this.steps.push(v => {\n last = merge(last, v);\n return last;\n });\n return this;\n }\n latch(equals = (a, b) => a === b) {\n let firstCall = true;\n let cache;\n this.steps.push(value => {\n const shouldEmit = firstCall || !equals(value, cache);\n firstCall = false;\n cache = value;\n return shouldEmit ? value : HaltChainable;\n });\n return this;\n }\n evaluate(value) {\n for (const step of this.steps) {\n value = step(value);\n if (value === HaltChainable) {\n break;\n }\n }\n return value;\n }\n }\n /**\n * Creates an {@link Event} from a node event emitter.\n */\n function fromNodeEventEmitter(emitter, eventName, map = id => id) {\n const fn = (...args) => result.fire(map(...args));\n const onFirstListenerAdd = () => emitter.on(eventName, fn);\n const onLastListenerRemove = () => emitter.removeListener(eventName, fn);\n const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove });\n return result.event;\n }\n Event.fromNodeEventEmitter = fromNodeEventEmitter;\n /**\n * Creates an {@link Event} from a DOM event emitter.\n */\n function fromDOMEventEmitter(emitter, eventName, map = id => id) {\n const fn = (...args) => result.fire(map(...args));\n const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn);\n const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn);\n const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove });\n return result.event;\n }\n Event.fromDOMEventEmitter = fromDOMEventEmitter;\n /**\n * Creates a promise out of an event, using the {@link Event.once} helper.\n */\n function toPromise(event) {\n return new Promise(resolve => once(event)(resolve));\n }\n Event.toPromise = toPromise;\n /**\n * Creates an event out of a promise that fires once when the promise is\n * resolved with the result of the promise or `undefined`.\n */\n function fromPromise(promise) {\n const result = new Emitter();\n promise.then(res => {\n result.fire(res);\n }, () => {\n result.fire(undefined);\n }).finally(() => {\n result.dispose();\n });\n return result.event;\n }\n Event.fromPromise = fromPromise;\n function runAndSubscribe(event, handler, initial) {\n handler(initial);\n return event(e => handler(e));\n }\n Event.runAndSubscribe = runAndSubscribe;\n class EmitterObserver {\n constructor(_observable, store) {\n this._observable = _observable;\n this._counter = 0;\n this._hasChanged = false;\n const options = {\n onWillAddFirstListener: () => {\n _observable.addObserver(this);\n },\n onDidRemoveLastListener: () => {\n _observable.removeObserver(this);\n }\n };\n if (!store) {\n _addLeakageTraceLogic(options);\n }\n this.emitter = new Emitter(options);\n if (store) {\n store.add(this.emitter);\n }\n }\n beginUpdate(_observable) {\n // assert(_observable === this.obs);\n this._counter++;\n }\n handlePossibleChange(_observable) {\n // assert(_observable === this.obs);\n }\n handleChange(_observable, _change) {\n // assert(_observable === this.obs);\n this._hasChanged = true;\n }\n endUpdate(_observable) {\n // assert(_observable === this.obs);\n this._counter--;\n if (this._counter === 0) {\n this._observable.reportChanges();\n if (this._hasChanged) {\n this._hasChanged = false;\n this.emitter.fire(this._observable.get());\n }\n }\n }\n }\n /**\n * Creates an event emitter that is fired when the observable changes.\n * Each listeners subscribes to the emitter.\n */\n function fromObservable(obs, store) {\n const observer = new EmitterObserver(obs, store);\n return observer.emitter.event;\n }\n Event.fromObservable = fromObservable;\n /**\n * Each listener is attached to the observable directly.\n */\n function fromObservableLight(observable) {\n return (listener, thisArgs, disposables) => {\n let count = 0;\n let didChange = false;\n const observer = {\n beginUpdate() {\n count++;\n },\n endUpdate() {\n count--;\n if (count === 0) {\n observable.reportChanges();\n if (didChange) {\n didChange = false;\n listener.call(thisArgs);\n }\n }\n },\n handlePossibleChange() {\n // noop\n },\n handleChange() {\n didChange = true;\n }\n };\n observable.addObserver(observer);\n observable.reportChanges();\n const disposable = {\n dispose() {\n observable.removeObserver(observer);\n }\n };\n if (disposables instanceof DisposableStore) {\n disposables.add(disposable);\n }\n else if (Array.isArray(disposables)) {\n disposables.push(disposable);\n }\n return disposable;\n };\n }\n Event.fromObservableLight = fromObservableLight;\n})(Event || (Event = {}));\nexport class EventProfiling {\n constructor(name) {\n this.listenerCount = 0;\n this.invocationCount = 0;\n this.elapsedOverall = 0;\n this.durations = [];\n this.name = `${name}_${EventProfiling._idPool++}`;\n EventProfiling.all.add(this);\n }\n start(listenerCount) {\n this._stopWatch = new StopWatch();\n this.listenerCount = listenerCount;\n }\n stop() {\n if (this._stopWatch) {\n const elapsed = this._stopWatch.elapsed();\n this.durations.push(elapsed);\n this.elapsedOverall += elapsed;\n this.invocationCount += 1;\n this._stopWatch = undefined;\n }\n }\n}\nEventProfiling.all = new Set();\nEventProfiling._idPool = 0;\nlet _globalLeakWarningThreshold = -1;\nclass LeakageMonitor {\n constructor(threshold, name = Math.random().toString(18).slice(2, 5)) {\n this.threshold = threshold;\n this.name = name;\n this._warnCountdown = 0;\n }\n dispose() {\n var _a;\n (_a = this._stacks) === null || _a === void 0 ? void 0 : _a.clear();\n }\n check(stack, listenerCount) {\n const threshold = this.threshold;\n if (threshold <= 0 || listenerCount < threshold) {\n return undefined;\n }\n if (!this._stacks) {\n this._stacks = new Map();\n }\n const count = (this._stacks.get(stack.value) || 0);\n this._stacks.set(stack.value, count + 1);\n this._warnCountdown -= 1;\n if (this._warnCountdown <= 0) {\n // only warn on first exceed and then every time the limit\n // is exceeded by 50% again\n this._warnCountdown = threshold * 0.5;\n // find most frequent listener and print warning\n let topStack;\n let topCount = 0;\n for (const [stack, count] of this._stacks) {\n if (!topStack || topCount < count) {\n topStack = stack;\n topCount = count;\n }\n }\n console.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`);\n console.warn(topStack);\n }\n return () => {\n const count = (this._stacks.get(stack.value) || 0);\n this._stacks.set(stack.value, count - 1);\n };\n }\n}\nclass Stacktrace {\n static create() {\n var _a;\n return new Stacktrace((_a = new Error().stack) !== null && _a !== void 0 ? _a : '');\n }\n constructor(value) {\n this.value = value;\n }\n print() {\n console.warn(this.value.split('\\n').slice(2).join('\\n'));\n }\n}\nclass UniqueContainer {\n constructor(value) {\n this.value = value;\n }\n}\nconst compactionThreshold = 2;\nconst forEachListener = (listeners, fn) => {\n if (listeners instanceof UniqueContainer) {\n fn(listeners);\n }\n else {\n for (let i = 0; i < listeners.length; i++) {\n const l = listeners[i];\n if (l) {\n fn(l);\n }\n }\n }\n};\n/**\n * The Emitter can be used to expose an Event to the public\n * to fire it from the insides.\n * Sample:\n class Document {\n\n private readonly _onDidChange = new Emitter<(value:string)=>any>();\n\n public onDidChange = this._onDidChange.event;\n\n // getter-style\n // get onDidChange(): Event<(value:string)=>any> {\n // \treturn this._onDidChange.event;\n // }\n\n private _doIt() {\n //...\n this._onDidChange.fire(value);\n }\n }\n */\nexport class Emitter {\n constructor(options) {\n var _a, _b, _c, _d, _e;\n this._size = 0;\n this._options = options;\n this._leakageMon = _globalLeakWarningThreshold > 0 || ((_a = this._options) === null || _a === void 0 ? void 0 : _a.leakWarningThreshold) ? new LeakageMonitor((_c = (_b = this._options) === null || _b === void 0 ? void 0 : _b.leakWarningThreshold) !== null && _c !== void 0 ? _c : _globalLeakWarningThreshold) : undefined;\n this._perfMon = ((_d = this._options) === null || _d === void 0 ? void 0 : _d._profName) ? new EventProfiling(this._options._profName) : undefined;\n this._deliveryQueue = (_e = this._options) === null || _e === void 0 ? void 0 : _e.deliveryQueue;\n }\n dispose() {\n var _a, _b, _c, _d;\n if (!this._disposed) {\n this._disposed = true;\n // It is bad to have listeners at the time of disposing an emitter, it is worst to have listeners keep the emitter\n // alive via the reference that's embedded in their disposables. Therefore we loop over all remaining listeners and\n // unset their subscriptions/disposables. Looping and blaming remaining listeners is done on next tick because the\n // the following programming pattern is very popular:\n //\n // const someModel = this._disposables.add(new ModelObject()); // (1) create and register model\n // this._disposables.add(someModel.onDidChange(() => { ... }); // (2) subscribe and register model-event listener\n // ...later...\n // this._disposables.dispose(); disposes (1) then (2): don't warn after (1) but after the \"overall dispose\" is done\n if (((_a = this._deliveryQueue) === null || _a === void 0 ? void 0 : _a.current) === this) {\n this._deliveryQueue.reset();\n }\n if (this._listeners) {\n if (_enableDisposeWithListenerWarning) {\n const listeners = this._listeners;\n queueMicrotask(() => {\n forEachListener(listeners, l => { var _a; return (_a = l.stack) === null || _a === void 0 ? void 0 : _a.print(); });\n });\n }\n this._listeners = undefined;\n this._size = 0;\n }\n (_c = (_b = this._options) === null || _b === void 0 ? void 0 : _b.onDidRemoveLastListener) === null || _c === void 0 ? void 0 : _c.call(_b);\n (_d = this._leakageMon) === null || _d === void 0 ? void 0 : _d.dispose();\n }\n }\n /**\n * For the public to allow to subscribe\n * to events from this Emitter\n */\n get event() {\n var _a;\n (_a = this._event) !== null && _a !== void 0 ? _a : (this._event = (callback, thisArgs, disposables) => {\n var _a, _b, _c, _d, _e;\n if (this._leakageMon && this._size > this._leakageMon.threshold * 3) {\n console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`);\n return Disposable.None;\n }\n if (this._disposed) {\n // todo: should we warn if a listener is added to a disposed emitter? This happens often\n return Disposable.None;\n }\n if (thisArgs) {\n callback = callback.bind(thisArgs);\n }\n const contained = new UniqueContainer(callback);\n let removeMonitor;\n let stack;\n if (this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * 0.2)) {\n // check and record this emitter for potential leakage\n contained.stack = Stacktrace.create();\n removeMonitor = this._leakageMon.check(contained.stack, this._size + 1);\n }\n if (_enableDisposeWithListenerWarning) {\n contained.stack = stack !== null && stack !== void 0 ? stack : Stacktrace.create();\n }\n if (!this._listeners) {\n (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.onWillAddFirstListener) === null || _b === void 0 ? void 0 : _b.call(_a, this);\n this._listeners = contained;\n (_d = (_c = this._options) === null || _c === void 0 ? void 0 : _c.onDidAddFirstListener) === null || _d === void 0 ? void 0 : _d.call(_c, this);\n }\n else if (this._listeners instanceof UniqueContainer) {\n (_e = this._deliveryQueue) !== null && _e !== void 0 ? _e : (this._deliveryQueue = new EventDeliveryQueuePrivate());\n this._listeners = [this._listeners, contained];\n }\n else {\n this._listeners.push(contained);\n }\n this._size++;\n const result = toDisposable(() => { removeMonitor === null || removeMonitor === void 0 ? void 0 : removeMonitor(); this._removeListener(contained); });\n if (disposables instanceof DisposableStore) {\n disposables.add(result);\n }\n else if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n });\n return this._event;\n }\n _removeListener(listener) {\n var _a, _b, _c, _d;\n (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.onWillRemoveListener) === null || _b === void 0 ? void 0 : _b.call(_a, this);\n if (!this._listeners) {\n return; // expected if a listener gets disposed\n }\n if (this._size === 1) {\n this._listeners = undefined;\n (_d = (_c = this._options) === null || _c === void 0 ? void 0 : _c.onDidRemoveLastListener) === null || _d === void 0 ? void 0 : _d.call(_c, this);\n this._size = 0;\n return;\n }\n // size > 1 which requires that listeners be a list:\n const listeners = this._listeners;\n const index = listeners.indexOf(listener);\n if (index === -1) {\n console.log('disposed?', this._disposed);\n console.log('size?', this._size);\n console.log('arr?', JSON.stringify(this._listeners));\n throw new Error('Attempted to dispose unknown listener');\n }\n this._size--;\n listeners[index] = undefined;\n const adjustDeliveryQueue = this._deliveryQueue.current === this;\n if (this._size * compactionThreshold <= listeners.length) {\n let n = 0;\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i]) {\n listeners[n++] = listeners[i];\n }\n else if (adjustDeliveryQueue) {\n this._deliveryQueue.end--;\n if (n < this._deliveryQueue.i) {\n this._deliveryQueue.i--;\n }\n }\n }\n listeners.length = n;\n }\n }\n _deliver(listener, value) {\n var _a;\n if (!listener) {\n return;\n }\n const errorHandler = ((_a = this._options) === null || _a === void 0 ? void 0 : _a.onListenerError) || onUnexpectedError;\n if (!errorHandler) {\n listener.value(value);\n return;\n }\n try {\n listener.value(value);\n }\n catch (e) {\n errorHandler(e);\n }\n }\n /** Delivers items in the queue. Assumes the queue is ready to go. */\n _deliverQueue(dq) {\n const listeners = dq.current._listeners;\n while (dq.i < dq.end) {\n // important: dq.i is incremented before calling deliver() because it might reenter deliverQueue()\n this._deliver(listeners[dq.i++], dq.value);\n }\n dq.reset();\n }\n /**\n * To be kept private to fire an event to\n * subscribers\n */\n fire(event) {\n var _a, _b, _c, _d;\n if ((_a = this._deliveryQueue) === null || _a === void 0 ? void 0 : _a.current) {\n this._deliverQueue(this._deliveryQueue);\n (_b = this._perfMon) === null || _b === void 0 ? void 0 : _b.stop(); // last fire() will have starting perfmon, stop it before starting the next dispatch\n }\n (_c = this._perfMon) === null || _c === void 0 ? void 0 : _c.start(this._size);\n if (!this._listeners) {\n // no-op\n }\n else if (this._listeners instanceof UniqueContainer) {\n this._deliver(this._listeners, event);\n }\n else {\n const dq = this._deliveryQueue;\n dq.enqueue(this, event, this._listeners.length);\n this._deliverQueue(dq);\n }\n (_d = this._perfMon) === null || _d === void 0 ? void 0 : _d.stop();\n }\n hasListeners() {\n return this._size > 0;\n }\n}\nexport const createEventDeliveryQueue = () => new EventDeliveryQueuePrivate();\nclass EventDeliveryQueuePrivate {\n constructor() {\n /**\n * Index in current's listener list.\n */\n this.i = -1;\n /**\n * The last index in the listener's list to deliver.\n */\n this.end = 0;\n }\n enqueue(emitter, value, end) {\n this.i = 0;\n this.end = end;\n this.current = emitter;\n this.value = value;\n }\n reset() {\n this.i = this.end; // force any current emission loop to stop, mainly for during dispose\n this.current = undefined;\n this.value = undefined;\n }\n}\nexport class PauseableEmitter extends Emitter {\n constructor(options) {\n super(options);\n this._isPaused = 0;\n this._eventQueue = new LinkedList();\n this._mergeFn = options === null || options === void 0 ? void 0 : options.merge;\n }\n pause() {\n this._isPaused++;\n }\n resume() {\n if (this._isPaused !== 0 && --this._isPaused === 0) {\n if (this._mergeFn) {\n // use the merge function to create a single composite\n // event. make a copy in case firing pauses this emitter\n if (this._eventQueue.size > 0) {\n const events = Array.from(this._eventQueue);\n this._eventQueue.clear();\n super.fire(this._mergeFn(events));\n }\n }\n else {\n // no merging, fire each event individually and test\n // that this emitter isn't paused halfway through\n while (!this._isPaused && this._eventQueue.size !== 0) {\n super.fire(this._eventQueue.shift());\n }\n }\n }\n }\n fire(event) {\n if (this._size) {\n if (this._isPaused !== 0) {\n this._eventQueue.push(event);\n }\n else {\n super.fire(event);\n }\n }\n }\n}\nexport class DebounceEmitter extends PauseableEmitter {\n constructor(options) {\n var _a;\n super(options);\n this._delay = (_a = options.delay) !== null && _a !== void 0 ? _a : 100;\n }\n fire(event) {\n if (!this._handle) {\n this.pause();\n this._handle = setTimeout(() => {\n this._handle = undefined;\n this.resume();\n }, this._delay);\n }\n super.fire(event);\n }\n}\n/**\n * An emitter which queue all events and then process them at the\n * end of the event loop.\n */\nexport class MicrotaskEmitter extends Emitter {\n constructor(options) {\n super(options);\n this._queuedEvents = [];\n this._mergeFn = options === null || options === void 0 ? void 0 : options.merge;\n }\n fire(event) {\n if (!this.hasListeners()) {\n return;\n }\n this._queuedEvents.push(event);\n if (this._queuedEvents.length === 1) {\n queueMicrotask(() => {\n if (this._mergeFn) {\n super.fire(this._mergeFn(this._queuedEvents));\n }\n else {\n this._queuedEvents.forEach(e => super.fire(e));\n }\n this._queuedEvents = [];\n });\n }\n }\n}\n/**\n * An event emitter that multiplexes many events into a single event.\n *\n * @example Listen to the `onData` event of all `Thing`s, dynamically adding and removing `Thing`s\n * to the multiplexer as needed.\n *\n * ```typescript\n * const anythingDataMultiplexer = new EventMultiplexer<{ data: string }>();\n *\n * const thingListeners = DisposableMap();\n *\n * thingService.onDidAddThing(thing => {\n * thingListeners.set(thing, anythingDataMultiplexer.add(thing.onData);\n * });\n * thingService.onDidRemoveThing(thing => {\n * thingListeners.deleteAndDispose(thing);\n * });\n *\n * anythingDataMultiplexer.event(e => {\n * console.log('Something fired data ' + e.data)\n * });\n * ```\n */\nexport class EventMultiplexer {\n constructor() {\n this.hasListeners = false;\n this.events = [];\n this.emitter = new Emitter({\n onWillAddFirstListener: () => this.onFirstListenerAdd(),\n onDidRemoveLastListener: () => this.onLastListenerRemove()\n });\n }\n get event() {\n return this.emitter.event;\n }\n add(event) {\n const e = { event: event, listener: null };\n this.events.push(e);\n if (this.hasListeners) {\n this.hook(e);\n }\n const dispose = () => {\n if (this.hasListeners) {\n this.unhook(e);\n }\n const idx = this.events.indexOf(e);\n this.events.splice(idx, 1);\n };\n return toDisposable(createSingleCallFunction(dispose));\n }\n onFirstListenerAdd() {\n this.hasListeners = true;\n this.events.forEach(e => this.hook(e));\n }\n onLastListenerRemove() {\n this.hasListeners = false;\n this.events.forEach(e => this.unhook(e));\n }\n hook(e) {\n e.listener = e.event(r => this.emitter.fire(r));\n }\n unhook(e) {\n if (e.listener) {\n e.listener.dispose();\n }\n e.listener = null;\n }\n dispose() {\n this.emitter.dispose();\n }\n}\n/**\n * The EventBufferer is useful in situations in which you want\n * to delay firing your events during some code.\n * You can wrap that code and be sure that the event will not\n * be fired during that wrap.\n *\n * ```\n * const emitter: Emitter;\n * const delayer = new EventDelayer();\n * const delayedEvent = delayer.wrapEvent(emitter.event);\n *\n * delayedEvent(console.log);\n *\n * delayer.bufferEvents(() => {\n * emitter.fire(); // event will not be fired yet\n * });\n *\n * // event will only be fired at this point\n * ```\n */\nexport class EventBufferer {\n constructor() {\n this.buffers = [];\n }\n wrapEvent(event) {\n return (listener, thisArgs, disposables) => {\n return event(i => {\n const buffer = this.buffers[this.buffers.length - 1];\n if (buffer) {\n buffer.push(() => listener.call(thisArgs, i));\n }\n else {\n listener.call(thisArgs, i);\n }\n }, undefined, disposables);\n };\n }\n bufferEvents(fn) {\n const buffer = [];\n this.buffers.push(buffer);\n const r = fn();\n this.buffers.pop();\n buffer.forEach(flush => flush());\n return r;\n }\n}\n/**\n * A Relay is an event forwarder which functions as a replugabble event pipe.\n * Once created, you can connect an input event to it and it will simply forward\n * events from that input event through its own `event` property. The `input`\n * can be changed at any point in time.\n */\nexport class Relay {\n constructor() {\n this.listening = false;\n this.inputEvent = Event.None;\n this.inputEventListener = Disposable.None;\n this.emitter = new Emitter({\n onDidAddFirstListener: () => {\n this.listening = true;\n this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);\n },\n onDidRemoveLastListener: () => {\n this.listening = false;\n this.inputEventListener.dispose();\n }\n });\n this.event = this.emitter.event;\n }\n set input(event) {\n this.inputEvent = event;\n if (this.listening) {\n this.inputEventListener.dispose();\n this.inputEventListener = event(this.emitter.fire, this.emitter);\n }\n }\n dispose() {\n this.inputEventListener.dispose();\n this.emitter.dispose();\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Emitter, Event } from './event.js';\nconst shortcutEvent = Object.freeze(function (callback, context) {\n const handle = setTimeout(callback.bind(context), 0);\n return { dispose() { clearTimeout(handle); } };\n});\nexport var CancellationToken;\n(function (CancellationToken) {\n function isCancellationToken(thing) {\n if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) {\n return true;\n }\n if (thing instanceof MutableToken) {\n return true;\n }\n if (!thing || typeof thing !== 'object') {\n return false;\n }\n return typeof thing.isCancellationRequested === 'boolean'\n && typeof thing.onCancellationRequested === 'function';\n }\n CancellationToken.isCancellationToken = isCancellationToken;\n CancellationToken.None = Object.freeze({\n isCancellationRequested: false,\n onCancellationRequested: Event.None\n });\n CancellationToken.Cancelled = Object.freeze({\n isCancellationRequested: true,\n onCancellationRequested: shortcutEvent\n });\n})(CancellationToken || (CancellationToken = {}));\nclass MutableToken {\n constructor() {\n this._isCancelled = false;\n this._emitter = null;\n }\n cancel() {\n if (!this._isCancelled) {\n this._isCancelled = true;\n if (this._emitter) {\n this._emitter.fire(undefined);\n this.dispose();\n }\n }\n }\n get isCancellationRequested() {\n return this._isCancelled;\n }\n get onCancellationRequested() {\n if (this._isCancelled) {\n return shortcutEvent;\n }\n if (!this._emitter) {\n this._emitter = new Emitter();\n }\n return this._emitter.event;\n }\n dispose() {\n if (this._emitter) {\n this._emitter.dispose();\n this._emitter = null;\n }\n }\n}\nexport class CancellationTokenSource {\n constructor(parent) {\n this._token = undefined;\n this._parentListener = undefined;\n this._parentListener = parent && parent.onCancellationRequested(this.cancel, this);\n }\n get token() {\n if (!this._token) {\n // be lazy and create the token only when\n // actually needed\n this._token = new MutableToken();\n }\n return this._token;\n }\n cancel() {\n if (!this._token) {\n // save an object by returning the default\n // cancelled token when cancellation happens\n // before someone asks for the token\n this._token = CancellationToken.Cancelled;\n }\n else if (this._token instanceof MutableToken) {\n // actually cancel\n this._token.cancel();\n }\n }\n dispose(cancel = false) {\n var _a;\n if (cancel) {\n this.cancel();\n }\n (_a = this._parentListener) === null || _a === void 0 ? void 0 : _a.dispose();\n if (!this._token) {\n // ensure to initialize with an empty token if we had none\n this._token = CancellationToken.None;\n }\n else if (this._token instanceof MutableToken) {\n // actually dispose\n this._token.dispose();\n }\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nclass KeyCodeStrMap {\n constructor() {\n this._keyCodeToStr = [];\n this._strToKeyCode = Object.create(null);\n }\n define(keyCode, str) {\n this._keyCodeToStr[keyCode] = str;\n this._strToKeyCode[str.toLowerCase()] = keyCode;\n }\n keyCodeToStr(keyCode) {\n return this._keyCodeToStr[keyCode];\n }\n strToKeyCode(str) {\n return this._strToKeyCode[str.toLowerCase()] || 0 /* KeyCode.Unknown */;\n }\n}\nconst uiMap = new KeyCodeStrMap();\nconst userSettingsUSMap = new KeyCodeStrMap();\nconst userSettingsGeneralMap = new KeyCodeStrMap();\nexport const EVENT_KEY_CODE_MAP = new Array(230);\nexport const NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE = {};\nconst scanCodeIntToStr = [];\nconst scanCodeStrToInt = Object.create(null);\nconst scanCodeLowerCaseStrToInt = Object.create(null);\n/**\n * -1 if a ScanCode => KeyCode mapping depends on kb layout.\n */\nexport const IMMUTABLE_CODE_TO_KEY_CODE = [];\n/**\n * -1 if a KeyCode => ScanCode mapping depends on kb layout.\n */\nexport const IMMUTABLE_KEY_CODE_TO_CODE = [];\nfor (let i = 0; i <= 193 /* ScanCode.MAX_VALUE */; i++) {\n IMMUTABLE_CODE_TO_KEY_CODE[i] = -1 /* KeyCode.DependsOnKbLayout */;\n}\nfor (let i = 0; i <= 132 /* KeyCode.MAX_VALUE */; i++) {\n IMMUTABLE_KEY_CODE_TO_CODE[i] = -1 /* ScanCode.DependsOnKbLayout */;\n}\n(function () {\n // See https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\n // See https://github.com/microsoft/node-native-keymap/blob/88c0b0e5/deps/chromium/keyboard_codes_win.h\n const empty = '';\n const mappings = [\n // immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel\n [1, 0 /* ScanCode.None */, 'None', 0 /* KeyCode.Unknown */, 'unknown', 0, 'VK_UNKNOWN', empty, empty],\n [1, 1 /* ScanCode.Hyper */, 'Hyper', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 2 /* ScanCode.Super */, 'Super', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 3 /* ScanCode.Fn */, 'Fn', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 4 /* ScanCode.FnLock */, 'FnLock', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 5 /* ScanCode.Suspend */, 'Suspend', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 6 /* ScanCode.Resume */, 'Resume', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 7 /* ScanCode.Turbo */, 'Turbo', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 8 /* ScanCode.Sleep */, 'Sleep', 0 /* KeyCode.Unknown */, empty, 0, 'VK_SLEEP', empty, empty],\n [1, 9 /* ScanCode.WakeUp */, 'WakeUp', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [0, 10 /* ScanCode.KeyA */, 'KeyA', 31 /* KeyCode.KeyA */, 'A', 65, 'VK_A', empty, empty],\n [0, 11 /* ScanCode.KeyB */, 'KeyB', 32 /* KeyCode.KeyB */, 'B', 66, 'VK_B', empty, empty],\n [0, 12 /* ScanCode.KeyC */, 'KeyC', 33 /* KeyCode.KeyC */, 'C', 67, 'VK_C', empty, empty],\n [0, 13 /* ScanCode.KeyD */, 'KeyD', 34 /* KeyCode.KeyD */, 'D', 68, 'VK_D', empty, empty],\n [0, 14 /* ScanCode.KeyE */, 'KeyE', 35 /* KeyCode.KeyE */, 'E', 69, 'VK_E', empty, empty],\n [0, 15 /* ScanCode.KeyF */, 'KeyF', 36 /* KeyCode.KeyF */, 'F', 70, 'VK_F', empty, empty],\n [0, 16 /* ScanCode.KeyG */, 'KeyG', 37 /* KeyCode.KeyG */, 'G', 71, 'VK_G', empty, empty],\n [0, 17 /* ScanCode.KeyH */, 'KeyH', 38 /* KeyCode.KeyH */, 'H', 72, 'VK_H', empty, empty],\n [0, 18 /* ScanCode.KeyI */, 'KeyI', 39 /* KeyCode.KeyI */, 'I', 73, 'VK_I', empty, empty],\n [0, 19 /* ScanCode.KeyJ */, 'KeyJ', 40 /* KeyCode.KeyJ */, 'J', 74, 'VK_J', empty, empty],\n [0, 20 /* ScanCode.KeyK */, 'KeyK', 41 /* KeyCode.KeyK */, 'K', 75, 'VK_K', empty, empty],\n [0, 21 /* ScanCode.KeyL */, 'KeyL', 42 /* KeyCode.KeyL */, 'L', 76, 'VK_L', empty, empty],\n [0, 22 /* ScanCode.KeyM */, 'KeyM', 43 /* KeyCode.KeyM */, 'M', 77, 'VK_M', empty, empty],\n [0, 23 /* ScanCode.KeyN */, 'KeyN', 44 /* KeyCode.KeyN */, 'N', 78, 'VK_N', empty, empty],\n [0, 24 /* ScanCode.KeyO */, 'KeyO', 45 /* KeyCode.KeyO */, 'O', 79, 'VK_O', empty, empty],\n [0, 25 /* ScanCode.KeyP */, 'KeyP', 46 /* KeyCode.KeyP */, 'P', 80, 'VK_P', empty, empty],\n [0, 26 /* ScanCode.KeyQ */, 'KeyQ', 47 /* KeyCode.KeyQ */, 'Q', 81, 'VK_Q', empty, empty],\n [0, 27 /* ScanCode.KeyR */, 'KeyR', 48 /* KeyCode.KeyR */, 'R', 82, 'VK_R', empty, empty],\n [0, 28 /* ScanCode.KeyS */, 'KeyS', 49 /* KeyCode.KeyS */, 'S', 83, 'VK_S', empty, empty],\n [0, 29 /* ScanCode.KeyT */, 'KeyT', 50 /* KeyCode.KeyT */, 'T', 84, 'VK_T', empty, empty],\n [0, 30 /* ScanCode.KeyU */, 'KeyU', 51 /* KeyCode.KeyU */, 'U', 85, 'VK_U', empty, empty],\n [0, 31 /* ScanCode.KeyV */, 'KeyV', 52 /* KeyCode.KeyV */, 'V', 86, 'VK_V', empty, empty],\n [0, 32 /* ScanCode.KeyW */, 'KeyW', 53 /* KeyCode.KeyW */, 'W', 87, 'VK_W', empty, empty],\n [0, 33 /* ScanCode.KeyX */, 'KeyX', 54 /* KeyCode.KeyX */, 'X', 88, 'VK_X', empty, empty],\n [0, 34 /* ScanCode.KeyY */, 'KeyY', 55 /* KeyCode.KeyY */, 'Y', 89, 'VK_Y', empty, empty],\n [0, 35 /* ScanCode.KeyZ */, 'KeyZ', 56 /* KeyCode.KeyZ */, 'Z', 90, 'VK_Z', empty, empty],\n [0, 36 /* ScanCode.Digit1 */, 'Digit1', 22 /* KeyCode.Digit1 */, '1', 49, 'VK_1', empty, empty],\n [0, 37 /* ScanCode.Digit2 */, 'Digit2', 23 /* KeyCode.Digit2 */, '2', 50, 'VK_2', empty, empty],\n [0, 38 /* ScanCode.Digit3 */, 'Digit3', 24 /* KeyCode.Digit3 */, '3', 51, 'VK_3', empty, empty],\n [0, 39 /* ScanCode.Digit4 */, 'Digit4', 25 /* KeyCode.Digit4 */, '4', 52, 'VK_4', empty, empty],\n [0, 40 /* ScanCode.Digit5 */, 'Digit5', 26 /* KeyCode.Digit5 */, '5', 53, 'VK_5', empty, empty],\n [0, 41 /* ScanCode.Digit6 */, 'Digit6', 27 /* KeyCode.Digit6 */, '6', 54, 'VK_6', empty, empty],\n [0, 42 /* ScanCode.Digit7 */, 'Digit7', 28 /* KeyCode.Digit7 */, '7', 55, 'VK_7', empty, empty],\n [0, 43 /* ScanCode.Digit8 */, 'Digit8', 29 /* KeyCode.Digit8 */, '8', 56, 'VK_8', empty, empty],\n [0, 44 /* ScanCode.Digit9 */, 'Digit9', 30 /* KeyCode.Digit9 */, '9', 57, 'VK_9', empty, empty],\n [0, 45 /* ScanCode.Digit0 */, 'Digit0', 21 /* KeyCode.Digit0 */, '0', 48, 'VK_0', empty, empty],\n [1, 46 /* ScanCode.Enter */, 'Enter', 3 /* KeyCode.Enter */, 'Enter', 13, 'VK_RETURN', empty, empty],\n [1, 47 /* ScanCode.Escape */, 'Escape', 9 /* KeyCode.Escape */, 'Escape', 27, 'VK_ESCAPE', empty, empty],\n [1, 48 /* ScanCode.Backspace */, 'Backspace', 1 /* KeyCode.Backspace */, 'Backspace', 8, 'VK_BACK', empty, empty],\n [1, 49 /* ScanCode.Tab */, 'Tab', 2 /* KeyCode.Tab */, 'Tab', 9, 'VK_TAB', empty, empty],\n [1, 50 /* ScanCode.Space */, 'Space', 10 /* KeyCode.Space */, 'Space', 32, 'VK_SPACE', empty, empty],\n [0, 51 /* ScanCode.Minus */, 'Minus', 88 /* KeyCode.Minus */, '-', 189, 'VK_OEM_MINUS', '-', 'OEM_MINUS'],\n [0, 52 /* ScanCode.Equal */, 'Equal', 86 /* KeyCode.Equal */, '=', 187, 'VK_OEM_PLUS', '=', 'OEM_PLUS'],\n [0, 53 /* ScanCode.BracketLeft */, 'BracketLeft', 92 /* KeyCode.BracketLeft */, '[', 219, 'VK_OEM_4', '[', 'OEM_4'],\n [0, 54 /* ScanCode.BracketRight */, 'BracketRight', 94 /* KeyCode.BracketRight */, ']', 221, 'VK_OEM_6', ']', 'OEM_6'],\n [0, 55 /* ScanCode.Backslash */, 'Backslash', 93 /* KeyCode.Backslash */, '\\\\', 220, 'VK_OEM_5', '\\\\', 'OEM_5'],\n [0, 56 /* ScanCode.IntlHash */, 'IntlHash', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty], // has been dropped from the w3c spec\n [0, 57 /* ScanCode.Semicolon */, 'Semicolon', 85 /* KeyCode.Semicolon */, ';', 186, 'VK_OEM_1', ';', 'OEM_1'],\n [0, 58 /* ScanCode.Quote */, 'Quote', 95 /* KeyCode.Quote */, '\\'', 222, 'VK_OEM_7', '\\'', 'OEM_7'],\n [0, 59 /* ScanCode.Backquote */, 'Backquote', 91 /* KeyCode.Backquote */, '`', 192, 'VK_OEM_3', '`', 'OEM_3'],\n [0, 60 /* ScanCode.Comma */, 'Comma', 87 /* KeyCode.Comma */, ',', 188, 'VK_OEM_COMMA', ',', 'OEM_COMMA'],\n [0, 61 /* ScanCode.Period */, 'Period', 89 /* KeyCode.Period */, '.', 190, 'VK_OEM_PERIOD', '.', 'OEM_PERIOD'],\n [0, 62 /* ScanCode.Slash */, 'Slash', 90 /* KeyCode.Slash */, '/', 191, 'VK_OEM_2', '/', 'OEM_2'],\n [1, 63 /* ScanCode.CapsLock */, 'CapsLock', 8 /* KeyCode.CapsLock */, 'CapsLock', 20, 'VK_CAPITAL', empty, empty],\n [1, 64 /* ScanCode.F1 */, 'F1', 59 /* KeyCode.F1 */, 'F1', 112, 'VK_F1', empty, empty],\n [1, 65 /* ScanCode.F2 */, 'F2', 60 /* KeyCode.F2 */, 'F2', 113, 'VK_F2', empty, empty],\n [1, 66 /* ScanCode.F3 */, 'F3', 61 /* KeyCode.F3 */, 'F3', 114, 'VK_F3', empty, empty],\n [1, 67 /* ScanCode.F4 */, 'F4', 62 /* KeyCode.F4 */, 'F4', 115, 'VK_F4', empty, empty],\n [1, 68 /* ScanCode.F5 */, 'F5', 63 /* KeyCode.F5 */, 'F5', 116, 'VK_F5', empty, empty],\n [1, 69 /* ScanCode.F6 */, 'F6', 64 /* KeyCode.F6 */, 'F6', 117, 'VK_F6', empty, empty],\n [1, 70 /* ScanCode.F7 */, 'F7', 65 /* KeyCode.F7 */, 'F7', 118, 'VK_F7', empty, empty],\n [1, 71 /* ScanCode.F8 */, 'F8', 66 /* KeyCode.F8 */, 'F8', 119, 'VK_F8', empty, empty],\n [1, 72 /* ScanCode.F9 */, 'F9', 67 /* KeyCode.F9 */, 'F9', 120, 'VK_F9', empty, empty],\n [1, 73 /* ScanCode.F10 */, 'F10', 68 /* KeyCode.F10 */, 'F10', 121, 'VK_F10', empty, empty],\n [1, 74 /* ScanCode.F11 */, 'F11', 69 /* KeyCode.F11 */, 'F11', 122, 'VK_F11', empty, empty],\n [1, 75 /* ScanCode.F12 */, 'F12', 70 /* KeyCode.F12 */, 'F12', 123, 'VK_F12', empty, empty],\n [1, 76 /* ScanCode.PrintScreen */, 'PrintScreen', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 77 /* ScanCode.ScrollLock */, 'ScrollLock', 84 /* KeyCode.ScrollLock */, 'ScrollLock', 145, 'VK_SCROLL', empty, empty],\n [1, 78 /* ScanCode.Pause */, 'Pause', 7 /* KeyCode.PauseBreak */, 'PauseBreak', 19, 'VK_PAUSE', empty, empty],\n [1, 79 /* ScanCode.Insert */, 'Insert', 19 /* KeyCode.Insert */, 'Insert', 45, 'VK_INSERT', empty, empty],\n [1, 80 /* ScanCode.Home */, 'Home', 14 /* KeyCode.Home */, 'Home', 36, 'VK_HOME', empty, empty],\n [1, 81 /* ScanCode.PageUp */, 'PageUp', 11 /* KeyCode.PageUp */, 'PageUp', 33, 'VK_PRIOR', empty, empty],\n [1, 82 /* ScanCode.Delete */, 'Delete', 20 /* KeyCode.Delete */, 'Delete', 46, 'VK_DELETE', empty, empty],\n [1, 83 /* ScanCode.End */, 'End', 13 /* KeyCode.End */, 'End', 35, 'VK_END', empty, empty],\n [1, 84 /* ScanCode.PageDown */, 'PageDown', 12 /* KeyCode.PageDown */, 'PageDown', 34, 'VK_NEXT', empty, empty],\n [1, 85 /* ScanCode.ArrowRight */, 'ArrowRight', 17 /* KeyCode.RightArrow */, 'RightArrow', 39, 'VK_RIGHT', 'Right', empty],\n [1, 86 /* ScanCode.ArrowLeft */, 'ArrowLeft', 15 /* KeyCode.LeftArrow */, 'LeftArrow', 37, 'VK_LEFT', 'Left', empty],\n [1, 87 /* ScanCode.ArrowDown */, 'ArrowDown', 18 /* KeyCode.DownArrow */, 'DownArrow', 40, 'VK_DOWN', 'Down', empty],\n [1, 88 /* ScanCode.ArrowUp */, 'ArrowUp', 16 /* KeyCode.UpArrow */, 'UpArrow', 38, 'VK_UP', 'Up', empty],\n [1, 89 /* ScanCode.NumLock */, 'NumLock', 83 /* KeyCode.NumLock */, 'NumLock', 144, 'VK_NUMLOCK', empty, empty],\n [1, 90 /* ScanCode.NumpadDivide */, 'NumpadDivide', 113 /* KeyCode.NumpadDivide */, 'NumPad_Divide', 111, 'VK_DIVIDE', empty, empty],\n [1, 91 /* ScanCode.NumpadMultiply */, 'NumpadMultiply', 108 /* KeyCode.NumpadMultiply */, 'NumPad_Multiply', 106, 'VK_MULTIPLY', empty, empty],\n [1, 92 /* ScanCode.NumpadSubtract */, 'NumpadSubtract', 111 /* KeyCode.NumpadSubtract */, 'NumPad_Subtract', 109, 'VK_SUBTRACT', empty, empty],\n [1, 93 /* ScanCode.NumpadAdd */, 'NumpadAdd', 109 /* KeyCode.NumpadAdd */, 'NumPad_Add', 107, 'VK_ADD', empty, empty],\n [1, 94 /* ScanCode.NumpadEnter */, 'NumpadEnter', 3 /* KeyCode.Enter */, empty, 0, empty, empty, empty],\n [1, 95 /* ScanCode.Numpad1 */, 'Numpad1', 99 /* KeyCode.Numpad1 */, 'NumPad1', 97, 'VK_NUMPAD1', empty, empty],\n [1, 96 /* ScanCode.Numpad2 */, 'Numpad2', 100 /* KeyCode.Numpad2 */, 'NumPad2', 98, 'VK_NUMPAD2', empty, empty],\n [1, 97 /* ScanCode.Numpad3 */, 'Numpad3', 101 /* KeyCode.Numpad3 */, 'NumPad3', 99, 'VK_NUMPAD3', empty, empty],\n [1, 98 /* ScanCode.Numpad4 */, 'Numpad4', 102 /* KeyCode.Numpad4 */, 'NumPad4', 100, 'VK_NUMPAD4', empty, empty],\n [1, 99 /* ScanCode.Numpad5 */, 'Numpad5', 103 /* KeyCode.Numpad5 */, 'NumPad5', 101, 'VK_NUMPAD5', empty, empty],\n [1, 100 /* ScanCode.Numpad6 */, 'Numpad6', 104 /* KeyCode.Numpad6 */, 'NumPad6', 102, 'VK_NUMPAD6', empty, empty],\n [1, 101 /* ScanCode.Numpad7 */, 'Numpad7', 105 /* KeyCode.Numpad7 */, 'NumPad7', 103, 'VK_NUMPAD7', empty, empty],\n [1, 102 /* ScanCode.Numpad8 */, 'Numpad8', 106 /* KeyCode.Numpad8 */, 'NumPad8', 104, 'VK_NUMPAD8', empty, empty],\n [1, 103 /* ScanCode.Numpad9 */, 'Numpad9', 107 /* KeyCode.Numpad9 */, 'NumPad9', 105, 'VK_NUMPAD9', empty, empty],\n [1, 104 /* ScanCode.Numpad0 */, 'Numpad0', 98 /* KeyCode.Numpad0 */, 'NumPad0', 96, 'VK_NUMPAD0', empty, empty],\n [1, 105 /* ScanCode.NumpadDecimal */, 'NumpadDecimal', 112 /* KeyCode.NumpadDecimal */, 'NumPad_Decimal', 110, 'VK_DECIMAL', empty, empty],\n [0, 106 /* ScanCode.IntlBackslash */, 'IntlBackslash', 97 /* KeyCode.IntlBackslash */, 'OEM_102', 226, 'VK_OEM_102', empty, empty],\n [1, 107 /* ScanCode.ContextMenu */, 'ContextMenu', 58 /* KeyCode.ContextMenu */, 'ContextMenu', 93, empty, empty, empty],\n [1, 108 /* ScanCode.Power */, 'Power', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 109 /* ScanCode.NumpadEqual */, 'NumpadEqual', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 110 /* ScanCode.F13 */, 'F13', 71 /* KeyCode.F13 */, 'F13', 124, 'VK_F13', empty, empty],\n [1, 111 /* ScanCode.F14 */, 'F14', 72 /* KeyCode.F14 */, 'F14', 125, 'VK_F14', empty, empty],\n [1, 112 /* ScanCode.F15 */, 'F15', 73 /* KeyCode.F15 */, 'F15', 126, 'VK_F15', empty, empty],\n [1, 113 /* ScanCode.F16 */, 'F16', 74 /* KeyCode.F16 */, 'F16', 127, 'VK_F16', empty, empty],\n [1, 114 /* ScanCode.F17 */, 'F17', 75 /* KeyCode.F17 */, 'F17', 128, 'VK_F17', empty, empty],\n [1, 115 /* ScanCode.F18 */, 'F18', 76 /* KeyCode.F18 */, 'F18', 129, 'VK_F18', empty, empty],\n [1, 116 /* ScanCode.F19 */, 'F19', 77 /* KeyCode.F19 */, 'F19', 130, 'VK_F19', empty, empty],\n [1, 117 /* ScanCode.F20 */, 'F20', 78 /* KeyCode.F20 */, 'F20', 131, 'VK_F20', empty, empty],\n [1, 118 /* ScanCode.F21 */, 'F21', 79 /* KeyCode.F21 */, 'F21', 132, 'VK_F21', empty, empty],\n [1, 119 /* ScanCode.F22 */, 'F22', 80 /* KeyCode.F22 */, 'F22', 133, 'VK_F22', empty, empty],\n [1, 120 /* ScanCode.F23 */, 'F23', 81 /* KeyCode.F23 */, 'F23', 134, 'VK_F23', empty, empty],\n [1, 121 /* ScanCode.F24 */, 'F24', 82 /* KeyCode.F24 */, 'F24', 135, 'VK_F24', empty, empty],\n [1, 122 /* ScanCode.Open */, 'Open', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 123 /* ScanCode.Help */, 'Help', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 124 /* ScanCode.Select */, 'Select', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 125 /* ScanCode.Again */, 'Again', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 126 /* ScanCode.Undo */, 'Undo', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 127 /* ScanCode.Cut */, 'Cut', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 128 /* ScanCode.Copy */, 'Copy', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 129 /* ScanCode.Paste */, 'Paste', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 130 /* ScanCode.Find */, 'Find', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 131 /* ScanCode.AudioVolumeMute */, 'AudioVolumeMute', 117 /* KeyCode.AudioVolumeMute */, 'AudioVolumeMute', 173, 'VK_VOLUME_MUTE', empty, empty],\n [1, 132 /* ScanCode.AudioVolumeUp */, 'AudioVolumeUp', 118 /* KeyCode.AudioVolumeUp */, 'AudioVolumeUp', 175, 'VK_VOLUME_UP', empty, empty],\n [1, 133 /* ScanCode.AudioVolumeDown */, 'AudioVolumeDown', 119 /* KeyCode.AudioVolumeDown */, 'AudioVolumeDown', 174, 'VK_VOLUME_DOWN', empty, empty],\n [1, 134 /* ScanCode.NumpadComma */, 'NumpadComma', 110 /* KeyCode.NUMPAD_SEPARATOR */, 'NumPad_Separator', 108, 'VK_SEPARATOR', empty, empty],\n [0, 135 /* ScanCode.IntlRo */, 'IntlRo', 115 /* KeyCode.ABNT_C1 */, 'ABNT_C1', 193, 'VK_ABNT_C1', empty, empty],\n [1, 136 /* ScanCode.KanaMode */, 'KanaMode', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [0, 137 /* ScanCode.IntlYen */, 'IntlYen', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 138 /* ScanCode.Convert */, 'Convert', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 139 /* ScanCode.NonConvert */, 'NonConvert', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 140 /* ScanCode.Lang1 */, 'Lang1', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 141 /* ScanCode.Lang2 */, 'Lang2', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 142 /* ScanCode.Lang3 */, 'Lang3', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 143 /* ScanCode.Lang4 */, 'Lang4', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 144 /* ScanCode.Lang5 */, 'Lang5', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 145 /* ScanCode.Abort */, 'Abort', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 146 /* ScanCode.Props */, 'Props', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 147 /* ScanCode.NumpadParenLeft */, 'NumpadParenLeft', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 148 /* ScanCode.NumpadParenRight */, 'NumpadParenRight', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 149 /* ScanCode.NumpadBackspace */, 'NumpadBackspace', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 150 /* ScanCode.NumpadMemoryStore */, 'NumpadMemoryStore', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 151 /* ScanCode.NumpadMemoryRecall */, 'NumpadMemoryRecall', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 152 /* ScanCode.NumpadMemoryClear */, 'NumpadMemoryClear', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 153 /* ScanCode.NumpadMemoryAdd */, 'NumpadMemoryAdd', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 154 /* ScanCode.NumpadMemorySubtract */, 'NumpadMemorySubtract', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 155 /* ScanCode.NumpadClear */, 'NumpadClear', 131 /* KeyCode.Clear */, 'Clear', 12, 'VK_CLEAR', empty, empty],\n [1, 156 /* ScanCode.NumpadClearEntry */, 'NumpadClearEntry', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 0 /* ScanCode.None */, empty, 5 /* KeyCode.Ctrl */, 'Ctrl', 17, 'VK_CONTROL', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 4 /* KeyCode.Shift */, 'Shift', 16, 'VK_SHIFT', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 6 /* KeyCode.Alt */, 'Alt', 18, 'VK_MENU', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 57 /* KeyCode.Meta */, 'Meta', 91, 'VK_COMMAND', empty, empty],\n [1, 157 /* ScanCode.ControlLeft */, 'ControlLeft', 5 /* KeyCode.Ctrl */, empty, 0, 'VK_LCONTROL', empty, empty],\n [1, 158 /* ScanCode.ShiftLeft */, 'ShiftLeft', 4 /* KeyCode.Shift */, empty, 0, 'VK_LSHIFT', empty, empty],\n [1, 159 /* ScanCode.AltLeft */, 'AltLeft', 6 /* KeyCode.Alt */, empty, 0, 'VK_LMENU', empty, empty],\n [1, 160 /* ScanCode.MetaLeft */, 'MetaLeft', 57 /* KeyCode.Meta */, empty, 0, 'VK_LWIN', empty, empty],\n [1, 161 /* ScanCode.ControlRight */, 'ControlRight', 5 /* KeyCode.Ctrl */, empty, 0, 'VK_RCONTROL', empty, empty],\n [1, 162 /* ScanCode.ShiftRight */, 'ShiftRight', 4 /* KeyCode.Shift */, empty, 0, 'VK_RSHIFT', empty, empty],\n [1, 163 /* ScanCode.AltRight */, 'AltRight', 6 /* KeyCode.Alt */, empty, 0, 'VK_RMENU', empty, empty],\n [1, 164 /* ScanCode.MetaRight */, 'MetaRight', 57 /* KeyCode.Meta */, empty, 0, 'VK_RWIN', empty, empty],\n [1, 165 /* ScanCode.BrightnessUp */, 'BrightnessUp', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 166 /* ScanCode.BrightnessDown */, 'BrightnessDown', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 167 /* ScanCode.MediaPlay */, 'MediaPlay', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 168 /* ScanCode.MediaRecord */, 'MediaRecord', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 169 /* ScanCode.MediaFastForward */, 'MediaFastForward', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 170 /* ScanCode.MediaRewind */, 'MediaRewind', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 171 /* ScanCode.MediaTrackNext */, 'MediaTrackNext', 124 /* KeyCode.MediaTrackNext */, 'MediaTrackNext', 176, 'VK_MEDIA_NEXT_TRACK', empty, empty],\n [1, 172 /* ScanCode.MediaTrackPrevious */, 'MediaTrackPrevious', 125 /* KeyCode.MediaTrackPrevious */, 'MediaTrackPrevious', 177, 'VK_MEDIA_PREV_TRACK', empty, empty],\n [1, 173 /* ScanCode.MediaStop */, 'MediaStop', 126 /* KeyCode.MediaStop */, 'MediaStop', 178, 'VK_MEDIA_STOP', empty, empty],\n [1, 174 /* ScanCode.Eject */, 'Eject', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 175 /* ScanCode.MediaPlayPause */, 'MediaPlayPause', 127 /* KeyCode.MediaPlayPause */, 'MediaPlayPause', 179, 'VK_MEDIA_PLAY_PAUSE', empty, empty],\n [1, 176 /* ScanCode.MediaSelect */, 'MediaSelect', 128 /* KeyCode.LaunchMediaPlayer */, 'LaunchMediaPlayer', 181, 'VK_MEDIA_LAUNCH_MEDIA_SELECT', empty, empty],\n [1, 177 /* ScanCode.LaunchMail */, 'LaunchMail', 129 /* KeyCode.LaunchMail */, 'LaunchMail', 180, 'VK_MEDIA_LAUNCH_MAIL', empty, empty],\n [1, 178 /* ScanCode.LaunchApp2 */, 'LaunchApp2', 130 /* KeyCode.LaunchApp2 */, 'LaunchApp2', 183, 'VK_MEDIA_LAUNCH_APP2', empty, empty],\n [1, 179 /* ScanCode.LaunchApp1 */, 'LaunchApp1', 0 /* KeyCode.Unknown */, empty, 0, 'VK_MEDIA_LAUNCH_APP1', empty, empty],\n [1, 180 /* ScanCode.SelectTask */, 'SelectTask', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 181 /* ScanCode.LaunchScreenSaver */, 'LaunchScreenSaver', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 182 /* ScanCode.BrowserSearch */, 'BrowserSearch', 120 /* KeyCode.BrowserSearch */, 'BrowserSearch', 170, 'VK_BROWSER_SEARCH', empty, empty],\n [1, 183 /* ScanCode.BrowserHome */, 'BrowserHome', 121 /* KeyCode.BrowserHome */, 'BrowserHome', 172, 'VK_BROWSER_HOME', empty, empty],\n [1, 184 /* ScanCode.BrowserBack */, 'BrowserBack', 122 /* KeyCode.BrowserBack */, 'BrowserBack', 166, 'VK_BROWSER_BACK', empty, empty],\n [1, 185 /* ScanCode.BrowserForward */, 'BrowserForward', 123 /* KeyCode.BrowserForward */, 'BrowserForward', 167, 'VK_BROWSER_FORWARD', empty, empty],\n [1, 186 /* ScanCode.BrowserStop */, 'BrowserStop', 0 /* KeyCode.Unknown */, empty, 0, 'VK_BROWSER_STOP', empty, empty],\n [1, 187 /* ScanCode.BrowserRefresh */, 'BrowserRefresh', 0 /* KeyCode.Unknown */, empty, 0, 'VK_BROWSER_REFRESH', empty, empty],\n [1, 188 /* ScanCode.BrowserFavorites */, 'BrowserFavorites', 0 /* KeyCode.Unknown */, empty, 0, 'VK_BROWSER_FAVORITES', empty, empty],\n [1, 189 /* ScanCode.ZoomToggle */, 'ZoomToggle', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 190 /* ScanCode.MailReply */, 'MailReply', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 191 /* ScanCode.MailForward */, 'MailForward', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n [1, 192 /* ScanCode.MailSend */, 'MailSend', 0 /* KeyCode.Unknown */, empty, 0, empty, empty, empty],\n // See https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html\n // If an Input Method Editor is processing key input and the event is keydown, return 229.\n [1, 0 /* ScanCode.None */, empty, 114 /* KeyCode.KEY_IN_COMPOSITION */, 'KeyInComposition', 229, empty, empty, empty],\n [1, 0 /* ScanCode.None */, empty, 116 /* KeyCode.ABNT_C2 */, 'ABNT_C2', 194, 'VK_ABNT_C2', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 96 /* KeyCode.OEM_8 */, 'OEM_8', 223, 'VK_OEM_8', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_KANA', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_HANGUL', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_JUNJA', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_FINAL', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_HANJA', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_KANJI', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_CONVERT', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_NONCONVERT', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_ACCEPT', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_MODECHANGE', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_SELECT', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_PRINT', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_EXECUTE', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_SNAPSHOT', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_HELP', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_APPS', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_PROCESSKEY', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_PACKET', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_DBE_SBCSCHAR', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_DBE_DBCSCHAR', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_ATTN', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_CRSEL', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_EXSEL', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_EREOF', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_PLAY', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_ZOOM', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_NONAME', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_PA1', empty, empty],\n [1, 0 /* ScanCode.None */, empty, 0 /* KeyCode.Unknown */, empty, 0, 'VK_OEM_CLEAR', empty, empty],\n ];\n const seenKeyCode = [];\n const seenScanCode = [];\n for (const mapping of mappings) {\n const [immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel] = mapping;\n if (!seenScanCode[scanCode]) {\n seenScanCode[scanCode] = true;\n scanCodeIntToStr[scanCode] = scanCodeStr;\n scanCodeStrToInt[scanCodeStr] = scanCode;\n scanCodeLowerCaseStrToInt[scanCodeStr.toLowerCase()] = scanCode;\n if (immutable) {\n IMMUTABLE_CODE_TO_KEY_CODE[scanCode] = keyCode;\n if ((keyCode !== 0 /* KeyCode.Unknown */)\n && (keyCode !== 3 /* KeyCode.Enter */)\n && (keyCode !== 5 /* KeyCode.Ctrl */)\n && (keyCode !== 4 /* KeyCode.Shift */)\n && (keyCode !== 6 /* KeyCode.Alt */)\n && (keyCode !== 57 /* KeyCode.Meta */)) {\n IMMUTABLE_KEY_CODE_TO_CODE[keyCode] = scanCode;\n }\n }\n }\n if (!seenKeyCode[keyCode]) {\n seenKeyCode[keyCode] = true;\n if (!keyCodeStr) {\n throw new Error(`String representation missing for key code ${keyCode} around scan code ${scanCodeStr}`);\n }\n uiMap.define(keyCode, keyCodeStr);\n userSettingsUSMap.define(keyCode, usUserSettingsLabel || keyCodeStr);\n userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel || usUserSettingsLabel || keyCodeStr);\n }\n if (eventKeyCode) {\n EVENT_KEY_CODE_MAP[eventKeyCode] = keyCode;\n }\n if (vkey) {\n NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE[vkey] = keyCode;\n }\n }\n // Manually added due to the exclusion above (due to duplication with NumpadEnter)\n IMMUTABLE_KEY_CODE_TO_CODE[3 /* KeyCode.Enter */] = 46 /* ScanCode.Enter */;\n})();\nexport var KeyCodeUtils;\n(function (KeyCodeUtils) {\n function toString(keyCode) {\n return uiMap.keyCodeToStr(keyCode);\n }\n KeyCodeUtils.toString = toString;\n function fromString(key) {\n return uiMap.strToKeyCode(key);\n }\n KeyCodeUtils.fromString = fromString;\n function toUserSettingsUS(keyCode) {\n return userSettingsUSMap.keyCodeToStr(keyCode);\n }\n KeyCodeUtils.toUserSettingsUS = toUserSettingsUS;\n function toUserSettingsGeneral(keyCode) {\n return userSettingsGeneralMap.keyCodeToStr(keyCode);\n }\n KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral;\n function fromUserSettings(key) {\n return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key);\n }\n KeyCodeUtils.fromUserSettings = fromUserSettings;\n function toElectronAccelerator(keyCode) {\n if (keyCode >= 98 /* KeyCode.Numpad0 */ && keyCode <= 113 /* KeyCode.NumpadDivide */) {\n // [Electron Accelerators] Electron is able to parse numpad keys, but unfortunately it\n // renders them just as regular keys in menus. For example, num0 is rendered as \"0\",\n // numdiv is rendered as \"/\", numsub is rendered as \"-\".\n //\n // This can lead to incredible confusion, as it makes numpad based keybindings indistinguishable\n // from keybindings based on regular keys.\n //\n // We therefore need to fall back to custom rendering for numpad keys.\n return null;\n }\n switch (keyCode) {\n case 16 /* KeyCode.UpArrow */:\n return 'Up';\n case 18 /* KeyCode.DownArrow */:\n return 'Down';\n case 15 /* KeyCode.LeftArrow */:\n return 'Left';\n case 17 /* KeyCode.RightArrow */:\n return 'Right';\n }\n return uiMap.keyCodeToStr(keyCode);\n }\n KeyCodeUtils.toElectronAccelerator = toElectronAccelerator;\n})(KeyCodeUtils || (KeyCodeUtils = {}));\nexport function KeyChord(firstPart, secondPart) {\n const chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0;\n return (firstPart | chordPart) >>> 0;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { isMacintosh, isWindows } from './platform.js';\nlet safeProcess;\n// Native sandbox environment\nconst vscodeGlobal = globalThis.vscode;\nif (typeof vscodeGlobal !== 'undefined' && typeof vscodeGlobal.process !== 'undefined') {\n const sandboxProcess = vscodeGlobal.process;\n safeProcess = {\n get platform() { return sandboxProcess.platform; },\n get arch() { return sandboxProcess.arch; },\n get env() { return sandboxProcess.env; },\n cwd() { return sandboxProcess.cwd(); }\n };\n}\n// Native node.js environment\nelse if (typeof process !== 'undefined') {\n safeProcess = {\n get platform() { return process.platform; },\n get arch() { return process.arch; },\n get env() { return process.env; },\n cwd() { return process.env['VSCODE_CWD'] || process.cwd(); }\n };\n}\n// Web environment\nelse {\n safeProcess = {\n // Supported\n get platform() { return isWindows ? 'win32' : isMacintosh ? 'darwin' : 'linux'; },\n get arch() { return undefined; /* arch is undefined in web */ },\n // Unsupported\n get env() { return {}; },\n cwd() { return '/'; }\n };\n}\n/**\n * Provides safe access to the `cwd` property in node.js, sandboxed or web\n * environments.\n *\n * Note: in web, this property is hardcoded to be `/`.\n *\n * @skipMangle\n */\nexport const cwd = safeProcess.cwd;\n/**\n * Provides safe access to the `env` property in node.js, sandboxed or web\n * environments.\n *\n * Note: in web, this property is hardcoded to be `{}`.\n */\nexport const env = safeProcess.env;\n/**\n * Provides safe access to the `platform` property in node.js, sandboxed or web\n * environments.\n */\nexport const platform = safeProcess.platform;\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// NOTE: VSCode's copy of nodejs path library to be usable in common (non-node) namespace\n// Copied from: https://github.com/nodejs/node/blob/v16.14.2/lib/path.js\n/**\n * Copyright Joyent, Inc. and other Node contributors.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to permit\n * persons to whom the Software is furnished to do so, subject to the\n * following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n * USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nimport * as process from './process.js';\nconst CHAR_UPPERCASE_A = 65; /* A */\nconst CHAR_LOWERCASE_A = 97; /* a */\nconst CHAR_UPPERCASE_Z = 90; /* Z */\nconst CHAR_LOWERCASE_Z = 122; /* z */\nconst CHAR_DOT = 46; /* . */\nconst CHAR_FORWARD_SLASH = 47; /* / */\nconst CHAR_BACKWARD_SLASH = 92; /* \\ */\nconst CHAR_COLON = 58; /* : */\nconst CHAR_QUESTION_MARK = 63; /* ? */\nclass ErrorInvalidArgType extends Error {\n constructor(name, expected, actual) {\n // determiner: 'must be' or 'must not be'\n let determiner;\n if (typeof expected === 'string' && expected.indexOf('not ') === 0) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n }\n else {\n determiner = 'must be';\n }\n const type = name.indexOf('.') !== -1 ? 'property' : 'argument';\n let msg = `The \"${name}\" ${type} ${determiner} of type ${expected}`;\n msg += `. Received type ${typeof actual}`;\n super(msg);\n this.code = 'ERR_INVALID_ARG_TYPE';\n }\n}\nfunction validateObject(pathObject, name) {\n if (pathObject === null || typeof pathObject !== 'object') {\n throw new ErrorInvalidArgType(name, 'Object', pathObject);\n }\n}\nfunction validateString(value, name) {\n if (typeof value !== 'string') {\n throw new ErrorInvalidArgType(name, 'string', value);\n }\n}\nconst platformIsWin32 = (process.platform === 'win32');\nfunction isPathSeparator(code) {\n return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n}\nfunction isPosixPathSeparator(code) {\n return code === CHAR_FORWARD_SLASH;\n}\nfunction isWindowsDeviceRoot(code) {\n return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||\n (code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);\n}\n// Resolves . and .. elements in a path with directory names\nfunction normalizeString(path, allowAboveRoot, separator, isPathSeparator) {\n let res = '';\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let code = 0;\n for (let i = 0; i <= path.length; ++i) {\n if (i < path.length) {\n code = path.charCodeAt(i);\n }\n else if (isPathSeparator(code)) {\n break;\n }\n else {\n code = CHAR_FORWARD_SLASH;\n }\n if (isPathSeparator(code)) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n }\n else if (dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 ||\n res.charCodeAt(res.length - 1) !== CHAR_DOT ||\n res.charCodeAt(res.length - 2) !== CHAR_DOT) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(separator);\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n }\n else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n else if (res.length !== 0) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n res += res.length > 0 ? `${separator}..` : '..';\n lastSegmentLength = 2;\n }\n }\n else {\n if (res.length > 0) {\n res += `${separator}${path.slice(lastSlash + 1, i)}`;\n }\n else {\n res = path.slice(lastSlash + 1, i);\n }\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n }\n else if (code === CHAR_DOT && dots !== -1) {\n ++dots;\n }\n else {\n dots = -1;\n }\n }\n return res;\n}\nfunction _format(sep, pathObject) {\n validateObject(pathObject, 'pathObject');\n const dir = pathObject.dir || pathObject.root;\n const base = pathObject.base ||\n `${pathObject.name || ''}${pathObject.ext || ''}`;\n if (!dir) {\n return base;\n }\n return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep}${base}`;\n}\nexport const win32 = {\n // path.resolve([from ...], to)\n resolve(...pathSegments) {\n let resolvedDevice = '';\n let resolvedTail = '';\n let resolvedAbsolute = false;\n for (let i = pathSegments.length - 1; i >= -1; i--) {\n let path;\n if (i >= 0) {\n path = pathSegments[i];\n validateString(path, 'path');\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n }\n else if (resolvedDevice.length === 0) {\n path = process.cwd();\n }\n else {\n // Windows has the concept of drive-specific current working\n // directories. If we've resolved a drive letter but not yet an\n // absolute path, get cwd for that drive, or the process cwd if\n // the drive cwd is not available. We're sure the device is not\n // a UNC path at this points, because UNC paths are always absolute.\n path = process.env[`=${resolvedDevice}`] || process.cwd();\n // Verify that a cwd was found and that it actually points\n // to our drive. If not, default to the drive's root.\n if (path === undefined ||\n (path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&\n path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {\n path = `${resolvedDevice}\\\\`;\n }\n }\n const len = path.length;\n let rootEnd = 0;\n let device = '';\n let isAbsolute = false;\n const code = path.charCodeAt(0);\n // Try to match a root\n if (len === 1) {\n if (isPathSeparator(code)) {\n // `path` contains just a path separator\n rootEnd = 1;\n isAbsolute = true;\n }\n }\n else if (isPathSeparator(code)) {\n // Possible UNC root\n // If we started with a separator, we know we at least have an\n // absolute path of some kind (UNC or otherwise)\n isAbsolute = true;\n if (isPathSeparator(path.charCodeAt(1))) {\n // Matched double path separator at beginning\n let j = 2;\n let last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n const firstPart = path.slice(last, j);\n // Matched!\n last = j;\n // Match 1 or more path separators\n while (j < len && isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j === len || j !== last) {\n // We matched a UNC root\n device = `\\\\\\\\${firstPart}\\\\${path.slice(last, j)}`;\n rootEnd = j;\n }\n }\n }\n }\n else {\n rootEnd = 1;\n }\n }\n else if (isWindowsDeviceRoot(code) &&\n path.charCodeAt(1) === CHAR_COLON) {\n // Possible device root\n device = path.slice(0, 2);\n rootEnd = 2;\n if (len > 2 && isPathSeparator(path.charCodeAt(2))) {\n // Treat separator following drive name as an absolute path\n // indicator\n isAbsolute = true;\n rootEnd = 3;\n }\n }\n if (device.length > 0) {\n if (resolvedDevice.length > 0) {\n if (device.toLowerCase() !== resolvedDevice.toLowerCase()) {\n // This path points to another device so it is not applicable\n continue;\n }\n }\n else {\n resolvedDevice = device;\n }\n }\n if (resolvedAbsolute) {\n if (resolvedDevice.length > 0) {\n break;\n }\n }\n else {\n resolvedTail = `${path.slice(rootEnd)}\\\\${resolvedTail}`;\n resolvedAbsolute = isAbsolute;\n if (isAbsolute && resolvedDevice.length > 0) {\n break;\n }\n }\n }\n // At this point the path should be resolved to a full absolute path,\n // but handle relative paths to be safe (might happen when process.cwd()\n // fails)\n // Normalize the tail path\n resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\\\', isPathSeparator);\n return resolvedAbsolute ?\n `${resolvedDevice}\\\\${resolvedTail}` :\n `${resolvedDevice}${resolvedTail}` || '.';\n },\n normalize(path) {\n validateString(path, 'path');\n const len = path.length;\n if (len === 0) {\n return '.';\n }\n let rootEnd = 0;\n let device;\n let isAbsolute = false;\n const code = path.charCodeAt(0);\n // Try to match a root\n if (len === 1) {\n // `path` contains just a single char, exit early to avoid\n // unnecessary work\n return isPosixPathSeparator(code) ? '\\\\' : path;\n }\n if (isPathSeparator(code)) {\n // Possible UNC root\n // If we started with a separator, we know we at least have an absolute\n // path of some kind (UNC or otherwise)\n isAbsolute = true;\n if (isPathSeparator(path.charCodeAt(1))) {\n // Matched double path separator at beginning\n let j = 2;\n let last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n const firstPart = path.slice(last, j);\n // Matched!\n last = j;\n // Match 1 or more path separators\n while (j < len && isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j === len) {\n // We matched a UNC root only\n // Return the normalized version of the UNC root since there\n // is nothing left to process\n return `\\\\\\\\${firstPart}\\\\${path.slice(last)}\\\\`;\n }\n if (j !== last) {\n // We matched a UNC root with leftovers\n device = `\\\\\\\\${firstPart}\\\\${path.slice(last, j)}`;\n rootEnd = j;\n }\n }\n }\n }\n else {\n rootEnd = 1;\n }\n }\n else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n // Possible device root\n device = path.slice(0, 2);\n rootEnd = 2;\n if (len > 2 && isPathSeparator(path.charCodeAt(2))) {\n // Treat separator following drive name as an absolute path\n // indicator\n isAbsolute = true;\n rootEnd = 3;\n }\n }\n let tail = rootEnd < len ?\n normalizeString(path.slice(rootEnd), !isAbsolute, '\\\\', isPathSeparator) :\n '';\n if (tail.length === 0 && !isAbsolute) {\n tail = '.';\n }\n if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {\n tail += '\\\\';\n }\n if (device === undefined) {\n return isAbsolute ? `\\\\${tail}` : tail;\n }\n return isAbsolute ? `${device}\\\\${tail}` : `${device}${tail}`;\n },\n isAbsolute(path) {\n validateString(path, 'path');\n const len = path.length;\n if (len === 0) {\n return false;\n }\n const code = path.charCodeAt(0);\n return isPathSeparator(code) ||\n // Possible device root\n (len > 2 &&\n isWindowsDeviceRoot(code) &&\n path.charCodeAt(1) === CHAR_COLON &&\n isPathSeparator(path.charCodeAt(2)));\n },\n join(...paths) {\n if (paths.length === 0) {\n return '.';\n }\n let joined;\n let firstPart;\n for (let i = 0; i < paths.length; ++i) {\n const arg = paths[i];\n validateString(arg, 'path');\n if (arg.length > 0) {\n if (joined === undefined) {\n joined = firstPart = arg;\n }\n else {\n joined += `\\\\${arg}`;\n }\n }\n }\n if (joined === undefined) {\n return '.';\n }\n // Make sure that the joined path doesn't start with two slashes, because\n // normalize() will mistake it for a UNC path then.\n //\n // This step is skipped when it is very clear that the user actually\n // intended to point at a UNC path. This is assumed when the first\n // non-empty string arguments starts with exactly two slashes followed by\n // at least one more non-slash character.\n //\n // Note that for normalize() to treat a path as a UNC path it needs to\n // have at least 2 components, so we don't filter for that here.\n // This means that the user can use join to construct UNC paths from\n // a server name and a share name; for example:\n // path.join('//server', 'share') -> '\\\\\\\\server\\\\share\\\\')\n let needsReplace = true;\n let slashCount = 0;\n if (typeof firstPart === 'string' && isPathSeparator(firstPart.charCodeAt(0))) {\n ++slashCount;\n const firstLen = firstPart.length;\n if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) {\n ++slashCount;\n if (firstLen > 2) {\n if (isPathSeparator(firstPart.charCodeAt(2))) {\n ++slashCount;\n }\n else {\n // We matched a UNC path in the first part\n needsReplace = false;\n }\n }\n }\n }\n if (needsReplace) {\n // Find any more consecutive slashes we need to replace\n while (slashCount < joined.length &&\n isPathSeparator(joined.charCodeAt(slashCount))) {\n slashCount++;\n }\n // Replace the slashes if needed\n if (slashCount >= 2) {\n joined = `\\\\${joined.slice(slashCount)}`;\n }\n }\n return win32.normalize(joined);\n },\n // It will solve the relative path from `from` to `to`, for instance:\n // from = 'C:\\\\orandea\\\\test\\\\aaa'\n // to = 'C:\\\\orandea\\\\impl\\\\bbb'\n // The output of the function should be: '..\\\\..\\\\impl\\\\bbb'\n relative(from, to) {\n validateString(from, 'from');\n validateString(to, 'to');\n if (from === to) {\n return '';\n }\n const fromOrig = win32.resolve(from);\n const toOrig = win32.resolve(to);\n if (fromOrig === toOrig) {\n return '';\n }\n from = fromOrig.toLowerCase();\n to = toOrig.toLowerCase();\n if (from === to) {\n return '';\n }\n // Trim any leading backslashes\n let fromStart = 0;\n while (fromStart < from.length &&\n from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) {\n fromStart++;\n }\n // Trim trailing backslashes (applicable to UNC paths only)\n let fromEnd = from.length;\n while (fromEnd - 1 > fromStart &&\n from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) {\n fromEnd--;\n }\n const fromLen = fromEnd - fromStart;\n // Trim any leading backslashes\n let toStart = 0;\n while (toStart < to.length &&\n to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\n toStart++;\n }\n // Trim trailing backslashes (applicable to UNC paths only)\n let toEnd = to.length;\n while (toEnd - 1 > toStart &&\n to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) {\n toEnd--;\n }\n const toLen = toEnd - toStart;\n // Compare paths to find the longest common path from root\n const length = fromLen < toLen ? fromLen : toLen;\n let lastCommonSep = -1;\n let i = 0;\n for (; i < length; i++) {\n const fromCode = from.charCodeAt(fromStart + i);\n if (fromCode !== to.charCodeAt(toStart + i)) {\n break;\n }\n else if (fromCode === CHAR_BACKWARD_SLASH) {\n lastCommonSep = i;\n }\n }\n // We found a mismatch before the first common path separator was seen, so\n // return the original `to`.\n if (i !== length) {\n if (lastCommonSep === -1) {\n return toOrig;\n }\n }\n else {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo\\\\bar\\\\baz'\n return toOrig.slice(toStart + i + 1);\n }\n if (i === 2) {\n // We get here if `from` is the device root.\n // For example: from='C:\\\\'; to='C:\\\\foo'\n return toOrig.slice(toStart + i);\n }\n }\n if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\foo'\n lastCommonSep = i;\n }\n else if (i === 2) {\n // We get here if `to` is the device root.\n // For example: from='C:\\\\foo\\\\bar'; to='C:\\\\'\n lastCommonSep = 3;\n }\n }\n if (lastCommonSep === -1) {\n lastCommonSep = 0;\n }\n }\n let out = '';\n // Generate the relative path based on the path difference between `to` and\n // `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {\n out += out.length === 0 ? '..' : '\\\\..';\n }\n }\n toStart += lastCommonSep;\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0) {\n return `${out}${toOrig.slice(toStart, toEnd)}`;\n }\n if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\n ++toStart;\n }\n return toOrig.slice(toStart, toEnd);\n },\n toNamespacedPath(path) {\n // Note: this will *probably* throw somewhere.\n if (typeof path !== 'string' || path.length === 0) {\n return path;\n }\n const resolvedPath = win32.resolve(path);\n if (resolvedPath.length <= 2) {\n return path;\n }\n if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {\n // Possible UNC root\n if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {\n const code = resolvedPath.charCodeAt(2);\n if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {\n // Matched non-long UNC root, convert the path to a long UNC path\n return `\\\\\\\\?\\\\UNC\\\\${resolvedPath.slice(2)}`;\n }\n }\n }\n else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) &&\n resolvedPath.charCodeAt(1) === CHAR_COLON &&\n resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {\n // Matched device root, convert the path to a long UNC path\n return `\\\\\\\\?\\\\${resolvedPath}`;\n }\n return path;\n },\n dirname(path) {\n validateString(path, 'path');\n const len = path.length;\n if (len === 0) {\n return '.';\n }\n let rootEnd = -1;\n let offset = 0;\n const code = path.charCodeAt(0);\n if (len === 1) {\n // `path` contains just a path separator, exit early to avoid\n // unnecessary work or a dot.\n return isPathSeparator(code) ? path : '.';\n }\n // Try to match a root\n if (isPathSeparator(code)) {\n // Possible UNC root\n rootEnd = offset = 1;\n if (isPathSeparator(path.charCodeAt(1))) {\n // Matched double path separator at beginning\n let j = 2;\n let last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more path separators\n while (j < len && isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j === len) {\n // We matched a UNC root only\n return path;\n }\n if (j !== last) {\n // We matched a UNC root with leftovers\n // Offset by 1 to include the separator after the UNC root to\n // treat it as a \"normal root\" on top of a (UNC) root\n rootEnd = offset = j + 1;\n }\n }\n }\n }\n // Possible device root\n }\n else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2;\n offset = rootEnd;\n }\n let end = -1;\n let matchedSlash = true;\n for (let i = len - 1; i >= offset; --i) {\n if (isPathSeparator(path.charCodeAt(i))) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n }\n else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n if (end === -1) {\n if (rootEnd === -1) {\n return '.';\n }\n end = rootEnd;\n }\n return path.slice(0, end);\n },\n basename(path, ext) {\n if (ext !== undefined) {\n validateString(ext, 'ext');\n }\n validateString(path, 'path');\n let start = 0;\n let end = -1;\n let matchedSlash = true;\n let i;\n // Check for a drive letter prefix so as not to mistake the following\n // path separator as an extra separator at the end of the path that can be\n // disregarded\n if (path.length >= 2 &&\n isWindowsDeviceRoot(path.charCodeAt(0)) &&\n path.charCodeAt(1) === CHAR_COLON) {\n start = 2;\n }\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext === path) {\n return '';\n }\n let extIdx = ext.length - 1;\n let firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= start; --i) {\n const code = path.charCodeAt(i);\n if (isPathSeparator(code)) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n }\n else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n }\n else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n if (start === end) {\n end = firstNonSlashEnd;\n }\n else if (end === -1) {\n end = path.length;\n }\n return path.slice(start, end);\n }\n for (i = path.length - 1; i >= start; --i) {\n if (isPathSeparator(path.charCodeAt(i))) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n }\n else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n if (end === -1) {\n return '';\n }\n return path.slice(start, end);\n },\n extname(path) {\n validateString(path, 'path');\n let start = 0;\n let startDot = -1;\n let startPart = 0;\n let end = -1;\n let matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n let preDotState = 0;\n // Check for a drive letter prefix so as not to mistake the following\n // path separator as an extra separator at the end of the path that can be\n // disregarded\n if (path.length >= 2 &&\n path.charCodeAt(1) === CHAR_COLON &&\n isWindowsDeviceRoot(path.charCodeAt(0))) {\n start = startPart = 2;\n }\n for (let i = path.length - 1; i >= start; --i) {\n const code = path.charCodeAt(i);\n if (isPathSeparator(code)) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === CHAR_DOT) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) {\n startDot = i;\n }\n else if (preDotState !== 1) {\n preDotState = 1;\n }\n }\n else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (startDot === -1 ||\n end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n (preDotState === 1 &&\n startDot === end - 1 &&\n startDot === startPart + 1)) {\n return '';\n }\n return path.slice(startDot, end);\n },\n format: _format.bind(null, '\\\\'),\n parse(path) {\n validateString(path, 'path');\n const ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0) {\n return ret;\n }\n const len = path.length;\n let rootEnd = 0;\n let code = path.charCodeAt(0);\n if (len === 1) {\n if (isPathSeparator(code)) {\n // `path` contains just a path separator, exit early to avoid\n // unnecessary work\n ret.root = ret.dir = path;\n return ret;\n }\n ret.base = ret.name = path;\n return ret;\n }\n // Try to match a root\n if (isPathSeparator(code)) {\n // Possible UNC root\n rootEnd = 1;\n if (isPathSeparator(path.charCodeAt(1))) {\n // Matched double path separator at beginning\n let j = 2;\n let last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more path separators\n while (j < len && isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j < len && j !== last) {\n // Matched!\n last = j;\n // Match 1 or more non-path separators\n while (j < len && !isPathSeparator(path.charCodeAt(j))) {\n j++;\n }\n if (j === len) {\n // We matched a UNC root only\n rootEnd = j;\n }\n else if (j !== last) {\n // We matched a UNC root with leftovers\n rootEnd = j + 1;\n }\n }\n }\n }\n }\n else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n // Possible device root\n if (len <= 2) {\n // `path` contains just a drive root, exit early to avoid\n // unnecessary work\n ret.root = ret.dir = path;\n return ret;\n }\n rootEnd = 2;\n if (isPathSeparator(path.charCodeAt(2))) {\n if (len === 3) {\n // `path` contains just a drive root, exit early to avoid\n // unnecessary work\n ret.root = ret.dir = path;\n return ret;\n }\n rootEnd = 3;\n }\n }\n if (rootEnd > 0) {\n ret.root = path.slice(0, rootEnd);\n }\n let startDot = -1;\n let startPart = rootEnd;\n let end = -1;\n let matchedSlash = true;\n let i = path.length - 1;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n let preDotState = 0;\n // Get non-dir info\n for (; i >= rootEnd; --i) {\n code = path.charCodeAt(i);\n if (isPathSeparator(code)) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === CHAR_DOT) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) {\n startDot = i;\n }\n else if (preDotState !== 1) {\n preDotState = 1;\n }\n }\n else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (end !== -1) {\n if (startDot === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n (preDotState === 1 &&\n startDot === end - 1 &&\n startDot === startPart + 1)) {\n ret.base = ret.name = path.slice(startPart, end);\n }\n else {\n ret.name = path.slice(startPart, startDot);\n ret.base = path.slice(startPart, end);\n ret.ext = path.slice(startDot, end);\n }\n }\n // If the directory is the root, use the entire root as the `dir` including\n // the trailing slash if any (`C:\\abc` -> `C:\\`). Otherwise, strip out the\n // trailing slash (`C:\\abc\\def` -> `C:\\abc`).\n if (startPart > 0 && startPart !== rootEnd) {\n ret.dir = path.slice(0, startPart - 1);\n }\n else {\n ret.dir = ret.root;\n }\n return ret;\n },\n sep: '\\\\',\n delimiter: ';',\n win32: null,\n posix: null\n};\nconst posixCwd = (() => {\n if (platformIsWin32) {\n // Converts Windows' backslash path separators to POSIX forward slashes\n // and truncates any drive indicator\n const regexp = /\\\\/g;\n return () => {\n const cwd = process.cwd().replace(regexp, '/');\n return cwd.slice(cwd.indexOf('/'));\n };\n }\n // We're already on POSIX, no need for any transformations\n return () => process.cwd();\n})();\nexport const posix = {\n // path.resolve([from ...], to)\n resolve(...pathSegments) {\n let resolvedPath = '';\n let resolvedAbsolute = false;\n for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n const path = i >= 0 ? pathSegments[i] : posixCwd();\n validateString(path, 'path');\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n resolvedPath = `${path}/${resolvedPath}`;\n resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n // Normalize the path\n resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, '/', isPosixPathSeparator);\n if (resolvedAbsolute) {\n return `/${resolvedPath}`;\n }\n return resolvedPath.length > 0 ? resolvedPath : '.';\n },\n normalize(path) {\n validateString(path, 'path');\n if (path.length === 0) {\n return '.';\n }\n const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH;\n // Normalize the path\n path = normalizeString(path, !isAbsolute, '/', isPosixPathSeparator);\n if (path.length === 0) {\n if (isAbsolute) {\n return '/';\n }\n return trailingSeparator ? './' : '.';\n }\n if (trailingSeparator) {\n path += '/';\n }\n return isAbsolute ? `/${path}` : path;\n },\n isAbsolute(path) {\n validateString(path, 'path');\n return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n },\n join(...paths) {\n if (paths.length === 0) {\n return '.';\n }\n let joined;\n for (let i = 0; i < paths.length; ++i) {\n const arg = paths[i];\n validateString(arg, 'path');\n if (arg.length > 0) {\n if (joined === undefined) {\n joined = arg;\n }\n else {\n joined += `/${arg}`;\n }\n }\n }\n if (joined === undefined) {\n return '.';\n }\n return posix.normalize(joined);\n },\n relative(from, to) {\n validateString(from, 'from');\n validateString(to, 'to');\n if (from === to) {\n return '';\n }\n // Trim leading forward slashes.\n from = posix.resolve(from);\n to = posix.resolve(to);\n if (from === to) {\n return '';\n }\n const fromStart = 1;\n const fromEnd = from.length;\n const fromLen = fromEnd - fromStart;\n const toStart = 1;\n const toLen = to.length - toStart;\n // Compare paths to find the longest common path from root\n const length = (fromLen < toLen ? fromLen : toLen);\n let lastCommonSep = -1;\n let i = 0;\n for (; i < length; i++) {\n const fromCode = from.charCodeAt(fromStart + i);\n if (fromCode !== to.charCodeAt(toStart + i)) {\n break;\n }\n else if (fromCode === CHAR_FORWARD_SLASH) {\n lastCommonSep = i;\n }\n }\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='/foo/bar'; to='/foo/bar/baz'\n return to.slice(toStart + i + 1);\n }\n if (i === 0) {\n // We get here if `from` is the root\n // For example: from='/'; to='/foo'\n return to.slice(toStart + i);\n }\n }\n else if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='/foo/bar/baz'; to='/foo/bar'\n lastCommonSep = i;\n }\n else if (i === 0) {\n // We get here if `to` is the root.\n // For example: from='/foo/bar'; to='/'\n lastCommonSep = 0;\n }\n }\n }\n let out = '';\n // Generate the relative path based on the path difference between `to`\n // and `from`.\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n out += out.length === 0 ? '..' : '/..';\n }\n }\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts.\n return `${out}${to.slice(toStart + lastCommonSep)}`;\n },\n toNamespacedPath(path) {\n // Non-op on posix systems\n return path;\n },\n dirname(path) {\n validateString(path, 'path');\n if (path.length === 0) {\n return '.';\n }\n const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n let end = -1;\n let matchedSlash = true;\n for (let i = path.length - 1; i >= 1; --i) {\n if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n }\n else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n if (end === -1) {\n return hasRoot ? '/' : '.';\n }\n if (hasRoot && end === 1) {\n return '//';\n }\n return path.slice(0, end);\n },\n basename(path, ext) {\n if (ext !== undefined) {\n validateString(ext, 'ext');\n }\n validateString(path, 'path');\n let start = 0;\n let end = -1;\n let matchedSlash = true;\n let i;\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext === path) {\n return '';\n }\n let extIdx = ext.length - 1;\n let firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= 0; --i) {\n const code = path.charCodeAt(i);\n if (code === CHAR_FORWARD_SLASH) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n }\n else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n }\n else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n if (start === end) {\n end = firstNonSlashEnd;\n }\n else if (end === -1) {\n end = path.length;\n }\n return path.slice(start, end);\n }\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n }\n else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n if (end === -1) {\n return '';\n }\n return path.slice(start, end);\n },\n extname(path) {\n validateString(path, 'path');\n let startDot = -1;\n let startPart = 0;\n let end = -1;\n let matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n let preDotState = 0;\n for (let i = path.length - 1; i >= 0; --i) {\n const code = path.charCodeAt(i);\n if (code === CHAR_FORWARD_SLASH) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === CHAR_DOT) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) {\n startDot = i;\n }\n else if (preDotState !== 1) {\n preDotState = 1;\n }\n }\n else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (startDot === -1 ||\n end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n (preDotState === 1 &&\n startDot === end - 1 &&\n startDot === startPart + 1)) {\n return '';\n }\n return path.slice(startDot, end);\n },\n format: _format.bind(null, '/'),\n parse(path) {\n validateString(path, 'path');\n const ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0) {\n return ret;\n }\n const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;\n let start;\n if (isAbsolute) {\n ret.root = '/';\n start = 1;\n }\n else {\n start = 0;\n }\n let startDot = -1;\n let startPart = 0;\n let end = -1;\n let matchedSlash = true;\n let i = path.length - 1;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n let preDotState = 0;\n // Get non-dir info\n for (; i >= start; --i) {\n const code = path.charCodeAt(i);\n if (code === CHAR_FORWARD_SLASH) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === CHAR_DOT) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) {\n startDot = i;\n }\n else if (preDotState !== 1) {\n preDotState = 1;\n }\n }\n else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (end !== -1) {\n const start = startPart === 0 && isAbsolute ? 1 : startPart;\n if (startDot === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n (preDotState === 1 &&\n startDot === end - 1 &&\n startDot === startPart + 1)) {\n ret.base = ret.name = path.slice(start, end);\n }\n else {\n ret.name = path.slice(start, startDot);\n ret.base = path.slice(start, end);\n ret.ext = path.slice(startDot, end);\n }\n }\n if (startPart > 0) {\n ret.dir = path.slice(0, startPart - 1);\n }\n else if (isAbsolute) {\n ret.dir = '/';\n }\n return ret;\n },\n sep: '/',\n delimiter: ':',\n win32: null,\n posix: null\n};\nposix.win32 = win32.win32 = win32;\nposix.posix = win32.posix = posix;\nexport const normalize = (platformIsWin32 ? win32.normalize : posix.normalize);\nexport const resolve = (platformIsWin32 ? win32.resolve : posix.resolve);\nexport const relative = (platformIsWin32 ? win32.relative : posix.relative);\nexport const dirname = (platformIsWin32 ? win32.dirname : posix.dirname);\nexport const basename = (platformIsWin32 ? win32.basename : posix.basename);\nexport const extname = (platformIsWin32 ? win32.extname : posix.extname);\nexport const sep = (platformIsWin32 ? win32.sep : posix.sep);\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as paths from './path.js';\nimport { isWindows } from './platform.js';\nconst _schemePattern = /^\\w[\\w\\d+.-]*$/;\nconst _singleSlashStart = /^\\//;\nconst _doubleSlashStart = /^\\/\\//;\nfunction _validateUri(ret, _strict) {\n // scheme, must be set\n if (!ret.scheme && _strict) {\n throw new Error(`[UriError]: Scheme is missing: {scheme: \"\", authority: \"${ret.authority}\", path: \"${ret.path}\", query: \"${ret.query}\", fragment: \"${ret.fragment}\"}`);\n }\n // scheme, https://tools.ietf.org/html/rfc3986#section-3.1\n // ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n if (ret.scheme && !_schemePattern.test(ret.scheme)) {\n throw new Error('[UriError]: Scheme contains illegal characters.');\n }\n // path, http://tools.ietf.org/html/rfc3986#section-3.3\n // If a URI contains an authority component, then the path component\n // must either be empty or begin with a slash (\"/\") character. If a URI\n // does not contain an authority component, then the path cannot begin\n // with two slash characters (\"//\").\n if (ret.path) {\n if (ret.authority) {\n if (!_singleSlashStart.test(ret.path)) {\n throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character');\n }\n }\n else {\n if (_doubleSlashStart.test(ret.path)) {\n throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")');\n }\n }\n }\n}\n// for a while we allowed uris *without* schemes and this is the migration\n// for them, e.g. an uri without scheme and without strict-mode warns and falls\n// back to the file-scheme. that should cause the least carnage and still be a\n// clear warning\nfunction _schemeFix(scheme, _strict) {\n if (!scheme && !_strict) {\n return 'file';\n }\n return scheme;\n}\n// implements a bit of https://tools.ietf.org/html/rfc3986#section-5\nfunction _referenceResolution(scheme, path) {\n // the slash-character is our 'default base' as we don't\n // support constructing URIs relative to other URIs. This\n // also means that we alter and potentially break paths.\n // see https://tools.ietf.org/html/rfc3986#section-5.1.4\n switch (scheme) {\n case 'https':\n case 'http':\n case 'file':\n if (!path) {\n path = _slash;\n }\n else if (path[0] !== _slash) {\n path = _slash + path;\n }\n break;\n }\n return path;\n}\nconst _empty = '';\nconst _slash = '/';\nconst _regexp = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;\n/**\n * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.\n * This class is a simple parser which creates the basic component parts\n * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation\n * and encoding.\n *\n * ```txt\n * foo://example.com:8042/over/there?name=ferret#nose\n * \\_/ \\______________/\\_________/ \\_________/ \\__/\n * | | | | |\n * scheme authority path query fragment\n * | _____________________|__\n * / \\ / \\\n * urn:example:animal:ferret:nose\n * ```\n */\nexport class URI {\n static isUri(thing) {\n if (thing instanceof URI) {\n return true;\n }\n if (!thing) {\n return false;\n }\n return typeof thing.authority === 'string'\n && typeof thing.fragment === 'string'\n && typeof thing.path === 'string'\n && typeof thing.query === 'string'\n && typeof thing.scheme === 'string'\n && typeof thing.fsPath === 'string'\n && typeof thing.with === 'function'\n && typeof thing.toString === 'function';\n }\n /**\n * @internal\n */\n constructor(schemeOrData, authority, path, query, fragment, _strict = false) {\n if (typeof schemeOrData === 'object') {\n this.scheme = schemeOrData.scheme || _empty;\n this.authority = schemeOrData.authority || _empty;\n this.path = schemeOrData.path || _empty;\n this.query = schemeOrData.query || _empty;\n this.fragment = schemeOrData.fragment || _empty;\n // no validation because it's this URI\n // that creates uri components.\n // _validateUri(this);\n }\n else {\n this.scheme = _schemeFix(schemeOrData, _strict);\n this.authority = authority || _empty;\n this.path = _referenceResolution(this.scheme, path || _empty);\n this.query = query || _empty;\n this.fragment = fragment || _empty;\n _validateUri(this, _strict);\n }\n }\n // ---- filesystem path -----------------------\n /**\n * Returns a string representing the corresponding file system path of this URI.\n * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the\n * platform specific path separator.\n *\n * * Will *not* validate the path for invalid characters and semantics.\n * * Will *not* look at the scheme of this URI.\n * * The result shall *not* be used for display purposes but for accessing a file on disk.\n *\n *\n * The *difference* to `URI#path` is the use of the platform specific separator and the handling\n * of UNC paths. See the below sample of a file-uri with an authority (UNC path).\n *\n * ```ts\n const u = URI.parse('file://server/c$/folder/file.txt')\n u.authority === 'server'\n u.path === '/shares/c$/file.txt'\n u.fsPath === '\\\\server\\c$\\folder\\file.txt'\n ```\n *\n * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,\n * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working\n * with URIs that represent files on disk (`file` scheme).\n */\n get fsPath() {\n // if (this.scheme !== 'file') {\n // \tconsole.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);\n // }\n return uriToFsPath(this, false);\n }\n // ---- modify to new -------------------------\n with(change) {\n if (!change) {\n return this;\n }\n let { scheme, authority, path, query, fragment } = change;\n if (scheme === undefined) {\n scheme = this.scheme;\n }\n else if (scheme === null) {\n scheme = _empty;\n }\n if (authority === undefined) {\n authority = this.authority;\n }\n else if (authority === null) {\n authority = _empty;\n }\n if (path === undefined) {\n path = this.path;\n }\n else if (path === null) {\n path = _empty;\n }\n if (query === undefined) {\n query = this.query;\n }\n else if (query === null) {\n query = _empty;\n }\n if (fragment === undefined) {\n fragment = this.fragment;\n }\n else if (fragment === null) {\n fragment = _empty;\n }\n if (scheme === this.scheme\n && authority === this.authority\n && path === this.path\n && query === this.query\n && fragment === this.fragment) {\n return this;\n }\n return new Uri(scheme, authority, path, query, fragment);\n }\n // ---- parse & validate ------------------------\n /**\n * Creates a new URI from a string, e.g. `http://www.example.com/some/path`,\n * `file:///usr/home`, or `scheme:with/path`.\n *\n * @param value A string which represents an URI (see `URI#toString`).\n */\n static parse(value, _strict = false) {\n const match = _regexp.exec(value);\n if (!match) {\n return new Uri(_empty, _empty, _empty, _empty, _empty);\n }\n return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);\n }\n /**\n * Creates a new URI from a file system path, e.g. `c:\\my\\files`,\n * `/usr/home`, or `\\\\server\\share\\some\\path`.\n *\n * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument\n * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**\n * `URI.parse('file://' + path)` because the path might contain characters that are\n * interpreted (# and ?). See the following sample:\n * ```ts\n const good = URI.file('/coding/c#/project1');\n good.scheme === 'file';\n good.path === '/coding/c#/project1';\n good.fragment === '';\n const bad = URI.parse('file://' + '/coding/c#/project1');\n bad.scheme === 'file';\n bad.path === '/coding/c'; // path is now broken\n bad.fragment === '/project1';\n ```\n *\n * @param path A file system path (see `URI#fsPath`)\n */\n static file(path) {\n let authority = _empty;\n // normalize to fwd-slashes on windows,\n // on other systems bwd-slashes are valid\n // filename character, eg /f\\oo/ba\\r.txt\n if (isWindows) {\n path = path.replace(/\\\\/g, _slash);\n }\n // check for authority as used in UNC shares\n // or use the path as given\n if (path[0] === _slash && path[1] === _slash) {\n const idx = path.indexOf(_slash, 2);\n if (idx === -1) {\n authority = path.substring(2);\n path = _slash;\n }\n else {\n authority = path.substring(2, idx);\n path = path.substring(idx) || _slash;\n }\n }\n return new Uri('file', authority, path, _empty, _empty);\n }\n /**\n * Creates new URI from uri components.\n *\n * Unless `strict` is `true` the scheme is defaults to be `file`. This function performs\n * validation and should be used for untrusted uri components retrieved from storage,\n * user input, command arguments etc\n */\n static from(components, strict) {\n const result = new Uri(components.scheme, components.authority, components.path, components.query, components.fragment, strict);\n return result;\n }\n /**\n * Join a URI path with path fragments and normalizes the resulting path.\n *\n * @param uri The input URI.\n * @param pathFragment The path fragment to add to the URI path.\n * @returns The resulting URI.\n */\n static joinPath(uri, ...pathFragment) {\n if (!uri.path) {\n throw new Error(`[UriError]: cannot call joinPath on URI without path`);\n }\n let newPath;\n if (isWindows && uri.scheme === 'file') {\n newPath = URI.file(paths.win32.join(uriToFsPath(uri, true), ...pathFragment)).path;\n }\n else {\n newPath = paths.posix.join(uri.path, ...pathFragment);\n }\n return uri.with({ path: newPath });\n }\n // ---- printing/externalize ---------------------------\n /**\n * Creates a string representation for this URI. It's guaranteed that calling\n * `URI.parse` with the result of this function creates an URI which is equal\n * to this URI.\n *\n * * The result shall *not* be used for display purposes but for externalization or transport.\n * * The result will be encoded using the percentage encoding and encoding happens mostly\n * ignore the scheme-specific encoding rules.\n *\n * @param skipEncoding Do not encode the result, default is `false`\n */\n toString(skipEncoding = false) {\n return _asFormatted(this, skipEncoding);\n }\n toJSON() {\n return this;\n }\n static revive(data) {\n var _a, _b;\n if (!data) {\n return data;\n }\n else if (data instanceof URI) {\n return data;\n }\n else {\n const result = new Uri(data);\n result._formatted = (_a = data.external) !== null && _a !== void 0 ? _a : null;\n result._fsPath = data._sep === _pathSepMarker ? (_b = data.fsPath) !== null && _b !== void 0 ? _b : null : null;\n return result;\n }\n }\n}\nconst _pathSepMarker = isWindows ? 1 : undefined;\n// This class exists so that URI is compatible with vscode.Uri (API).\nclass Uri extends URI {\n constructor() {\n super(...arguments);\n this._formatted = null;\n this._fsPath = null;\n }\n get fsPath() {\n if (!this._fsPath) {\n this._fsPath = uriToFsPath(this, false);\n }\n return this._fsPath;\n }\n toString(skipEncoding = false) {\n if (!skipEncoding) {\n if (!this._formatted) {\n this._formatted = _asFormatted(this, false);\n }\n return this._formatted;\n }\n else {\n // we don't cache that\n return _asFormatted(this, true);\n }\n }\n toJSON() {\n const res = {\n $mid: 1 /* MarshalledId.Uri */\n };\n // cached state\n if (this._fsPath) {\n res.fsPath = this._fsPath;\n res._sep = _pathSepMarker;\n }\n if (this._formatted) {\n res.external = this._formatted;\n }\n //--- uri components\n if (this.path) {\n res.path = this.path;\n }\n // TODO\n // this isn't correct and can violate the UriComponents contract but\n // this is part of the vscode.Uri API and we shouldn't change how that\n // works anymore\n if (this.scheme) {\n res.scheme = this.scheme;\n }\n if (this.authority) {\n res.authority = this.authority;\n }\n if (this.query) {\n res.query = this.query;\n }\n if (this.fragment) {\n res.fragment = this.fragment;\n }\n return res;\n }\n}\n// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2\nconst encodeTable = {\n [58 /* CharCode.Colon */]: '%3A', // gen-delims\n [47 /* CharCode.Slash */]: '%2F',\n [63 /* CharCode.QuestionMark */]: '%3F',\n [35 /* CharCode.Hash */]: '%23',\n [91 /* CharCode.OpenSquareBracket */]: '%5B',\n [93 /* CharCode.CloseSquareBracket */]: '%5D',\n [64 /* CharCode.AtSign */]: '%40',\n [33 /* CharCode.ExclamationMark */]: '%21', // sub-delims\n [36 /* CharCode.DollarSign */]: '%24',\n [38 /* CharCode.Ampersand */]: '%26',\n [39 /* CharCode.SingleQuote */]: '%27',\n [40 /* CharCode.OpenParen */]: '%28',\n [41 /* CharCode.CloseParen */]: '%29',\n [42 /* CharCode.Asterisk */]: '%2A',\n [43 /* CharCode.Plus */]: '%2B',\n [44 /* CharCode.Comma */]: '%2C',\n [59 /* CharCode.Semicolon */]: '%3B',\n [61 /* CharCode.Equals */]: '%3D',\n [32 /* CharCode.Space */]: '%20',\n};\nfunction encodeURIComponentFast(uriComponent, isPath, isAuthority) {\n let res = undefined;\n let nativeEncodePos = -1;\n for (let pos = 0; pos < uriComponent.length; pos++) {\n const code = uriComponent.charCodeAt(pos);\n // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3\n if ((code >= 97 /* CharCode.a */ && code <= 122 /* CharCode.z */)\n || (code >= 65 /* CharCode.A */ && code <= 90 /* CharCode.Z */)\n || (code >= 48 /* CharCode.Digit0 */ && code <= 57 /* CharCode.Digit9 */)\n || code === 45 /* CharCode.Dash */\n || code === 46 /* CharCode.Period */\n || code === 95 /* CharCode.Underline */\n || code === 126 /* CharCode.Tilde */\n || (isPath && code === 47 /* CharCode.Slash */)\n || (isAuthority && code === 91 /* CharCode.OpenSquareBracket */)\n || (isAuthority && code === 93 /* CharCode.CloseSquareBracket */)\n || (isAuthority && code === 58 /* CharCode.Colon */)) {\n // check if we are delaying native encode\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n nativeEncodePos = -1;\n }\n // check if we write into a new string (by default we try to return the param)\n if (res !== undefined) {\n res += uriComponent.charAt(pos);\n }\n }\n else {\n // encoding needed, we need to allocate a new string\n if (res === undefined) {\n res = uriComponent.substr(0, pos);\n }\n // check with default table first\n const escaped = encodeTable[code];\n if (escaped !== undefined) {\n // check if we are delaying native encode\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n nativeEncodePos = -1;\n }\n // append escaped variant to result\n res += escaped;\n }\n else if (nativeEncodePos === -1) {\n // use native encode only when needed\n nativeEncodePos = pos;\n }\n }\n }\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos));\n }\n return res !== undefined ? res : uriComponent;\n}\nfunction encodeURIComponentMinimal(path) {\n let res = undefined;\n for (let pos = 0; pos < path.length; pos++) {\n const code = path.charCodeAt(pos);\n if (code === 35 /* CharCode.Hash */ || code === 63 /* CharCode.QuestionMark */) {\n if (res === undefined) {\n res = path.substr(0, pos);\n }\n res += encodeTable[code];\n }\n else {\n if (res !== undefined) {\n res += path[pos];\n }\n }\n }\n return res !== undefined ? res : path;\n}\n/**\n * Compute `fsPath` for the given uri\n */\nexport function uriToFsPath(uri, keepDriveLetterCasing) {\n let value;\n if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\n // unc path: file://shares/c$/far/boo\n value = `//${uri.authority}${uri.path}`;\n }\n else if (uri.path.charCodeAt(0) === 47 /* CharCode.Slash */\n && (uri.path.charCodeAt(1) >= 65 /* CharCode.A */ && uri.path.charCodeAt(1) <= 90 /* CharCode.Z */ || uri.path.charCodeAt(1) >= 97 /* CharCode.a */ && uri.path.charCodeAt(1) <= 122 /* CharCode.z */)\n && uri.path.charCodeAt(2) === 58 /* CharCode.Colon */) {\n if (!keepDriveLetterCasing) {\n // windows drive letter: file:///c:/far/boo\n value = uri.path[1].toLowerCase() + uri.path.substr(2);\n }\n else {\n value = uri.path.substr(1);\n }\n }\n else {\n // other path\n value = uri.path;\n }\n if (isWindows) {\n value = value.replace(/\\//g, '\\\\');\n }\n return value;\n}\n/**\n * Create the external version of a uri\n */\nfunction _asFormatted(uri, skipEncoding) {\n const encoder = !skipEncoding\n ? encodeURIComponentFast\n : encodeURIComponentMinimal;\n let res = '';\n let { scheme, authority, path, query, fragment } = uri;\n if (scheme) {\n res += scheme;\n res += ':';\n }\n if (authority || scheme === 'file') {\n res += _slash;\n res += _slash;\n }\n if (authority) {\n let idx = authority.indexOf('@');\n if (idx !== -1) {\n // @\n const userinfo = authority.substr(0, idx);\n authority = authority.substr(idx + 1);\n idx = userinfo.lastIndexOf(':');\n if (idx === -1) {\n res += encoder(userinfo, false, false);\n }\n else {\n // :@\n res += encoder(userinfo.substr(0, idx), false, false);\n res += ':';\n res += encoder(userinfo.substr(idx + 1), false, true);\n }\n res += '@';\n }\n authority = authority.toLowerCase();\n idx = authority.lastIndexOf(':');\n if (idx === -1) {\n res += encoder(authority, false, true);\n }\n else {\n // :\n res += encoder(authority.substr(0, idx), false, true);\n res += authority.substr(idx);\n }\n }\n if (path) {\n // lower-case windows drive letters in /C:/fff or C:/fff\n if (path.length >= 3 && path.charCodeAt(0) === 47 /* CharCode.Slash */ && path.charCodeAt(2) === 58 /* CharCode.Colon */) {\n const code = path.charCodeAt(1);\n if (code >= 65 /* CharCode.A */ && code <= 90 /* CharCode.Z */) {\n path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; // \"/c:\".length === 3\n }\n }\n else if (path.length >= 2 && path.charCodeAt(1) === 58 /* CharCode.Colon */) {\n const code = path.charCodeAt(0);\n if (code >= 65 /* CharCode.A */ && code <= 90 /* CharCode.Z */) {\n path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; // \"/c:\".length === 3\n }\n }\n // encode the rest of the path\n res += encoder(path, true, false);\n }\n if (query) {\n res += '?';\n res += encoder(query, false, false);\n }\n if (fragment) {\n res += '#';\n res += !skipEncoding ? encodeURIComponentFast(fragment, false, false) : fragment;\n }\n return res;\n}\n// --- decode\nfunction decodeURIComponentGraceful(str) {\n try {\n return decodeURIComponent(str);\n }\n catch (_a) {\n if (str.length > 3) {\n return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));\n }\n else {\n return str;\n }\n }\n}\nconst _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;\nfunction percentDecode(str) {\n if (!str.match(_rEncodedAsHex)) {\n return str;\n }\n return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match));\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * A position in the editor.\n */\nexport class Position {\n constructor(lineNumber, column) {\n this.lineNumber = lineNumber;\n this.column = column;\n }\n /**\n * Create a new position from this position.\n *\n * @param newLineNumber new line number\n * @param newColumn new column\n */\n with(newLineNumber = this.lineNumber, newColumn = this.column) {\n if (newLineNumber === this.lineNumber && newColumn === this.column) {\n return this;\n }\n else {\n return new Position(newLineNumber, newColumn);\n }\n }\n /**\n * Derive a new position from this position.\n *\n * @param deltaLineNumber line number delta\n * @param deltaColumn column delta\n */\n delta(deltaLineNumber = 0, deltaColumn = 0) {\n return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn);\n }\n /**\n * Test if this position equals other position\n */\n equals(other) {\n return Position.equals(this, other);\n }\n /**\n * Test if position `a` equals position `b`\n */\n static equals(a, b) {\n if (!a && !b) {\n return true;\n }\n return (!!a &&\n !!b &&\n a.lineNumber === b.lineNumber &&\n a.column === b.column);\n }\n /**\n * Test if this position is before other position.\n * If the two positions are equal, the result will be false.\n */\n isBefore(other) {\n return Position.isBefore(this, other);\n }\n /**\n * Test if position `a` is before position `b`.\n * If the two positions are equal, the result will be false.\n */\n static isBefore(a, b) {\n if (a.lineNumber < b.lineNumber) {\n return true;\n }\n if (b.lineNumber < a.lineNumber) {\n return false;\n }\n return a.column < b.column;\n }\n /**\n * Test if this position is before other position.\n * If the two positions are equal, the result will be true.\n */\n isBeforeOrEqual(other) {\n return Position.isBeforeOrEqual(this, other);\n }\n /**\n * Test if position `a` is before position `b`.\n * If the two positions are equal, the result will be true.\n */\n static isBeforeOrEqual(a, b) {\n if (a.lineNumber < b.lineNumber) {\n return true;\n }\n if (b.lineNumber < a.lineNumber) {\n return false;\n }\n return a.column <= b.column;\n }\n /**\n * A function that compares positions, useful for sorting\n */\n static compare(a, b) {\n const aLineNumber = a.lineNumber | 0;\n const bLineNumber = b.lineNumber | 0;\n if (aLineNumber === bLineNumber) {\n const aColumn = a.column | 0;\n const bColumn = b.column | 0;\n return aColumn - bColumn;\n }\n return aLineNumber - bLineNumber;\n }\n /**\n * Clone this position.\n */\n clone() {\n return new Position(this.lineNumber, this.column);\n }\n /**\n * Convert to a human-readable representation.\n */\n toString() {\n return '(' + this.lineNumber + ',' + this.column + ')';\n }\n // ---\n /**\n * Create a `Position` from an `IPosition`.\n */\n static lift(pos) {\n return new Position(pos.lineNumber, pos.column);\n }\n /**\n * Test if `obj` is an `IPosition`.\n */\n static isIPosition(obj) {\n return (obj\n && (typeof obj.lineNumber === 'number')\n && (typeof obj.column === 'number'));\n }\n toJSON() {\n return {\n lineNumber: this.lineNumber,\n column: this.column\n };\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Position } from './position.js';\n/**\n * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)\n */\nexport class Range {\n constructor(startLineNumber, startColumn, endLineNumber, endColumn) {\n if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) {\n this.startLineNumber = endLineNumber;\n this.startColumn = endColumn;\n this.endLineNumber = startLineNumber;\n this.endColumn = startColumn;\n }\n else {\n this.startLineNumber = startLineNumber;\n this.startColumn = startColumn;\n this.endLineNumber = endLineNumber;\n this.endColumn = endColumn;\n }\n }\n /**\n * Test if this range is empty.\n */\n isEmpty() {\n return Range.isEmpty(this);\n }\n /**\n * Test if `range` is empty.\n */\n static isEmpty(range) {\n return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn);\n }\n /**\n * Test if position is in this range. If the position is at the edges, will return true.\n */\n containsPosition(position) {\n return Range.containsPosition(this, position);\n }\n /**\n * Test if `position` is in `range`. If the position is at the edges, will return true.\n */\n static containsPosition(range, position) {\n if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {\n return false;\n }\n if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) {\n return false;\n }\n if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) {\n return false;\n }\n return true;\n }\n /**\n * Test if `position` is in `range`. If the position is at the edges, will return false.\n * @internal\n */\n static strictContainsPosition(range, position) {\n if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {\n return false;\n }\n if (position.lineNumber === range.startLineNumber && position.column <= range.startColumn) {\n return false;\n }\n if (position.lineNumber === range.endLineNumber && position.column >= range.endColumn) {\n return false;\n }\n return true;\n }\n /**\n * Test if range is in this range. If the range is equal to this range, will return true.\n */\n containsRange(range) {\n return Range.containsRange(this, range);\n }\n /**\n * Test if `otherRange` is in `range`. If the ranges are equal, will return true.\n */\n static containsRange(range, otherRange) {\n if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {\n return false;\n }\n if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {\n return false;\n }\n if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) {\n return false;\n }\n if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) {\n return false;\n }\n return true;\n }\n /**\n * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true.\n */\n strictContainsRange(range) {\n return Range.strictContainsRange(this, range);\n }\n /**\n * Test if `otherRange` is strictly in `range` (must start after, and end before). If the ranges are equal, will return false.\n */\n static strictContainsRange(range, otherRange) {\n if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {\n return false;\n }\n if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {\n return false;\n }\n if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) {\n return false;\n }\n if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) {\n return false;\n }\n return true;\n }\n /**\n * A reunion of the two ranges.\n * The smallest position will be used as the start point, and the largest one as the end point.\n */\n plusRange(range) {\n return Range.plusRange(this, range);\n }\n /**\n * A reunion of the two ranges.\n * The smallest position will be used as the start point, and the largest one as the end point.\n */\n static plusRange(a, b) {\n let startLineNumber;\n let startColumn;\n let endLineNumber;\n let endColumn;\n if (b.startLineNumber < a.startLineNumber) {\n startLineNumber = b.startLineNumber;\n startColumn = b.startColumn;\n }\n else if (b.startLineNumber === a.startLineNumber) {\n startLineNumber = b.startLineNumber;\n startColumn = Math.min(b.startColumn, a.startColumn);\n }\n else {\n startLineNumber = a.startLineNumber;\n startColumn = a.startColumn;\n }\n if (b.endLineNumber > a.endLineNumber) {\n endLineNumber = b.endLineNumber;\n endColumn = b.endColumn;\n }\n else if (b.endLineNumber === a.endLineNumber) {\n endLineNumber = b.endLineNumber;\n endColumn = Math.max(b.endColumn, a.endColumn);\n }\n else {\n endLineNumber = a.endLineNumber;\n endColumn = a.endColumn;\n }\n return new Range(startLineNumber, startColumn, endLineNumber, endColumn);\n }\n /**\n * A intersection of the two ranges.\n */\n intersectRanges(range) {\n return Range.intersectRanges(this, range);\n }\n /**\n * A intersection of the two ranges.\n */\n static intersectRanges(a, b) {\n let resultStartLineNumber = a.startLineNumber;\n let resultStartColumn = a.startColumn;\n let resultEndLineNumber = a.endLineNumber;\n let resultEndColumn = a.endColumn;\n const otherStartLineNumber = b.startLineNumber;\n const otherStartColumn = b.startColumn;\n const otherEndLineNumber = b.endLineNumber;\n const otherEndColumn = b.endColumn;\n if (resultStartLineNumber < otherStartLineNumber) {\n resultStartLineNumber = otherStartLineNumber;\n resultStartColumn = otherStartColumn;\n }\n else if (resultStartLineNumber === otherStartLineNumber) {\n resultStartColumn = Math.max(resultStartColumn, otherStartColumn);\n }\n if (resultEndLineNumber > otherEndLineNumber) {\n resultEndLineNumber = otherEndLineNumber;\n resultEndColumn = otherEndColumn;\n }\n else if (resultEndLineNumber === otherEndLineNumber) {\n resultEndColumn = Math.min(resultEndColumn, otherEndColumn);\n }\n // Check if selection is now empty\n if (resultStartLineNumber > resultEndLineNumber) {\n return null;\n }\n if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) {\n return null;\n }\n return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn);\n }\n /**\n * Test if this range equals other.\n */\n equalsRange(other) {\n return Range.equalsRange(this, other);\n }\n /**\n * Test if range `a` equals `b`.\n */\n static equalsRange(a, b) {\n if (!a && !b) {\n return true;\n }\n return (!!a &&\n !!b &&\n a.startLineNumber === b.startLineNumber &&\n a.startColumn === b.startColumn &&\n a.endLineNumber === b.endLineNumber &&\n a.endColumn === b.endColumn);\n }\n /**\n * Return the end position (which will be after or equal to the start position)\n */\n getEndPosition() {\n return Range.getEndPosition(this);\n }\n /**\n * Return the end position (which will be after or equal to the start position)\n */\n static getEndPosition(range) {\n return new Position(range.endLineNumber, range.endColumn);\n }\n /**\n * Return the start position (which will be before or equal to the end position)\n */\n getStartPosition() {\n return Range.getStartPosition(this);\n }\n /**\n * Return the start position (which will be before or equal to the end position)\n */\n static getStartPosition(range) {\n return new Position(range.startLineNumber, range.startColumn);\n }\n /**\n * Transform to a user presentable string representation.\n */\n toString() {\n return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']';\n }\n /**\n * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.\n */\n setEndPosition(endLineNumber, endColumn) {\n return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\n }\n /**\n * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.\n */\n setStartPosition(startLineNumber, startColumn) {\n return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\n }\n /**\n * Create a new empty range using this range's start position.\n */\n collapseToStart() {\n return Range.collapseToStart(this);\n }\n /**\n * Create a new empty range using this range's start position.\n */\n static collapseToStart(range) {\n return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn);\n }\n /**\n * Create a new empty range using this range's end position.\n */\n collapseToEnd() {\n return Range.collapseToEnd(this);\n }\n /**\n * Create a new empty range using this range's end position.\n */\n static collapseToEnd(range) {\n return new Range(range.endLineNumber, range.endColumn, range.endLineNumber, range.endColumn);\n }\n /**\n * Moves the range by the given amount of lines.\n */\n delta(lineCount) {\n return new Range(this.startLineNumber + lineCount, this.startColumn, this.endLineNumber + lineCount, this.endColumn);\n }\n // ---\n static fromPositions(start, end = start) {\n return new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n }\n static lift(range) {\n if (!range) {\n return null;\n }\n return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\n }\n /**\n * Test if `obj` is an `IRange`.\n */\n static isIRange(obj) {\n return (obj\n && (typeof obj.startLineNumber === 'number')\n && (typeof obj.startColumn === 'number')\n && (typeof obj.endLineNumber === 'number')\n && (typeof obj.endColumn === 'number'));\n }\n /**\n * Test if the two ranges are touching in any way.\n */\n static areIntersectingOrTouching(a, b) {\n // Check if `a` is before `b`\n if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) {\n return false;\n }\n // Check if `b` is before `a`\n if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) {\n return false;\n }\n // These ranges must intersect\n return true;\n }\n /**\n * Test if the two ranges are intersecting. If the ranges are touching it returns true.\n */\n static areIntersecting(a, b) {\n // Check if `a` is before `b`\n if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) {\n return false;\n }\n // Check if `b` is before `a`\n if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) {\n return false;\n }\n // These ranges must intersect\n return true;\n }\n /**\n * A function that compares ranges, useful for sorting ranges\n * It will first compare ranges on the startPosition and then on the endPosition\n */\n static compareRangesUsingStarts(a, b) {\n if (a && b) {\n const aStartLineNumber = a.startLineNumber | 0;\n const bStartLineNumber = b.startLineNumber | 0;\n if (aStartLineNumber === bStartLineNumber) {\n const aStartColumn = a.startColumn | 0;\n const bStartColumn = b.startColumn | 0;\n if (aStartColumn === bStartColumn) {\n const aEndLineNumber = a.endLineNumber | 0;\n const bEndLineNumber = b.endLineNumber | 0;\n if (aEndLineNumber === bEndLineNumber) {\n const aEndColumn = a.endColumn | 0;\n const bEndColumn = b.endColumn | 0;\n return aEndColumn - bEndColumn;\n }\n return aEndLineNumber - bEndLineNumber;\n }\n return aStartColumn - bStartColumn;\n }\n return aStartLineNumber - bStartLineNumber;\n }\n const aExists = (a ? 1 : 0);\n const bExists = (b ? 1 : 0);\n return aExists - bExists;\n }\n /**\n * A function that compares ranges, useful for sorting ranges\n * It will first compare ranges on the endPosition and then on the startPosition\n */\n static compareRangesUsingEnds(a, b) {\n if (a.endLineNumber === b.endLineNumber) {\n if (a.endColumn === b.endColumn) {\n if (a.startLineNumber === b.startLineNumber) {\n return a.startColumn - b.startColumn;\n }\n return a.startLineNumber - b.startLineNumber;\n }\n return a.endColumn - b.endColumn;\n }\n return a.endLineNumber - b.endLineNumber;\n }\n /**\n * Test if the range spans multiple lines.\n */\n static spansMultipleLines(range) {\n return range.endLineNumber > range.startLineNumber;\n }\n toJSON() {\n return this;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Position } from './position.js';\nimport { Range } from './range.js';\n/**\n * A selection in the editor.\n * The selection is a range that has an orientation.\n */\nexport class Selection extends Range {\n constructor(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) {\n super(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn);\n this.selectionStartLineNumber = selectionStartLineNumber;\n this.selectionStartColumn = selectionStartColumn;\n this.positionLineNumber = positionLineNumber;\n this.positionColumn = positionColumn;\n }\n /**\n * Transform to a human-readable representation.\n */\n toString() {\n return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']';\n }\n /**\n * Test if equals other selection.\n */\n equalsSelection(other) {\n return (Selection.selectionsEqual(this, other));\n }\n /**\n * Test if the two selections are equal.\n */\n static selectionsEqual(a, b) {\n return (a.selectionStartLineNumber === b.selectionStartLineNumber &&\n a.selectionStartColumn === b.selectionStartColumn &&\n a.positionLineNumber === b.positionLineNumber &&\n a.positionColumn === b.positionColumn);\n }\n /**\n * Get directions (LTR or RTL).\n */\n getDirection() {\n if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) {\n return 0 /* SelectionDirection.LTR */;\n }\n return 1 /* SelectionDirection.RTL */;\n }\n /**\n * Create a new selection with a different `positionLineNumber` and `positionColumn`.\n */\n setEndPosition(endLineNumber, endColumn) {\n if (this.getDirection() === 0 /* SelectionDirection.LTR */) {\n return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\n }\n return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn);\n }\n /**\n * Get the position at `positionLineNumber` and `positionColumn`.\n */\n getPosition() {\n return new Position(this.positionLineNumber, this.positionColumn);\n }\n /**\n * Get the position at the start of the selection.\n */\n getSelectionStart() {\n return new Position(this.selectionStartLineNumber, this.selectionStartColumn);\n }\n /**\n * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.\n */\n setStartPosition(startLineNumber, startColumn) {\n if (this.getDirection() === 0 /* SelectionDirection.LTR */) {\n return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\n }\n return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn);\n }\n // ----\n /**\n * Create a `Selection` from one or two positions\n */\n static fromPositions(start, end = start) {\n return new Selection(start.lineNumber, start.column, end.lineNumber, end.column);\n }\n /**\n * Creates a `Selection` from a range, given a direction.\n */\n static fromRange(range, direction) {\n if (direction === 0 /* SelectionDirection.LTR */) {\n return new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\n }\n else {\n return new Selection(range.endLineNumber, range.endColumn, range.startLineNumber, range.startColumn);\n }\n }\n /**\n * Create a `Selection` from an `ISelection`.\n */\n static liftSelection(sel) {\n return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn);\n }\n /**\n * `a` equals `b`.\n */\n static selectionsArrEqual(a, b) {\n if (a && !b || !a && b) {\n return false;\n }\n if (!a && !b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0, len = a.length; i < len; i++) {\n if (!this.selectionsEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n /**\n * Test if `obj` is an `ISelection`.\n */\n static isISelection(obj) {\n return (obj\n && (typeof obj.selectionStartLineNumber === 'number')\n && (typeof obj.selectionStartColumn === 'number')\n && (typeof obj.positionLineNumber === 'number')\n && (typeof obj.positionColumn === 'number'));\n }\n /**\n * Create with a direction.\n */\n static createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, direction) {\n if (direction === 0 /* SelectionDirection.LTR */) {\n return new Selection(startLineNumber, startColumn, endLineNumber, endColumn);\n }\n return new Selection(endLineNumber, endColumn, startLineNumber, startColumn);\n }\n}\n", "import { isString } from './types.js';\nconst _codiconFontCharacters = Object.create(null);\nfunction register(id, fontCharacter) {\n if (isString(fontCharacter)) {\n const val = _codiconFontCharacters[fontCharacter];\n if (val === undefined) {\n throw new Error(`${id} references an unknown codicon: ${fontCharacter}`);\n }\n fontCharacter = val;\n }\n _codiconFontCharacters[id] = fontCharacter;\n return { id };\n}\n/**\n * Only to be used by the iconRegistry.\n */\nexport function getCodiconFontCharacters() {\n return _codiconFontCharacters;\n}\n/**\n * The Codicon library is a set of default icons that are built-in in VS Code.\n *\n * In the product (outside of base) Codicons should only be used as defaults. In order to have all icons in VS Code\n * themeable, component should define new, UI component specific icons using `iconRegistry.registerIcon`.\n * In that call a Codicon can be named as default.\n */\nexport const Codicon = {\n // built-in icons, with image name\n add: register('add', 0xea60),\n plus: register('plus', 0xea60),\n gistNew: register('gist-new', 0xea60),\n repoCreate: register('repo-create', 0xea60),\n lightbulb: register('lightbulb', 0xea61),\n lightBulb: register('light-bulb', 0xea61),\n repo: register('repo', 0xea62),\n repoDelete: register('repo-delete', 0xea62),\n gistFork: register('gist-fork', 0xea63),\n repoForked: register('repo-forked', 0xea63),\n gitPullRequest: register('git-pull-request', 0xea64),\n gitPullRequestAbandoned: register('git-pull-request-abandoned', 0xea64),\n recordKeys: register('record-keys', 0xea65),\n keyboard: register('keyboard', 0xea65),\n tag: register('tag', 0xea66),\n tagAdd: register('tag-add', 0xea66),\n tagRemove: register('tag-remove', 0xea66),\n gitPullRequestLabel: register('git-pull-request-label', 0xea66),\n person: register('person', 0xea67),\n personFollow: register('person-follow', 0xea67),\n personOutline: register('person-outline', 0xea67),\n personFilled: register('person-filled', 0xea67),\n gitBranch: register('git-branch', 0xea68),\n gitBranchCreate: register('git-branch-create', 0xea68),\n gitBranchDelete: register('git-branch-delete', 0xea68),\n sourceControl: register('source-control', 0xea68),\n mirror: register('mirror', 0xea69),\n mirrorPublic: register('mirror-public', 0xea69),\n star: register('star', 0xea6a),\n starAdd: register('star-add', 0xea6a),\n starDelete: register('star-delete', 0xea6a),\n starEmpty: register('star-empty', 0xea6a),\n comment: register('comment', 0xea6b),\n commentAdd: register('comment-add', 0xea6b),\n alert: register('alert', 0xea6c),\n warning: register('warning', 0xea6c),\n search: register('search', 0xea6d),\n searchSave: register('search-save', 0xea6d),\n logOut: register('log-out', 0xea6e),\n signOut: register('sign-out', 0xea6e),\n logIn: register('log-in', 0xea6f),\n signIn: register('sign-in', 0xea6f),\n eye: register('eye', 0xea70),\n eyeUnwatch: register('eye-unwatch', 0xea70),\n eyeWatch: register('eye-watch', 0xea70),\n circleFilled: register('circle-filled', 0xea71),\n primitiveDot: register('primitive-dot', 0xea71),\n closeDirty: register('close-dirty', 0xea71),\n debugBreakpoint: register('debug-breakpoint', 0xea71),\n debugBreakpointDisabled: register('debug-breakpoint-disabled', 0xea71),\n debugBreakpointPending: register('debug-breakpoint-pending', 0xebd9),\n debugHint: register('debug-hint', 0xea71),\n primitiveSquare: register('primitive-square', 0xea72),\n edit: register('edit', 0xea73),\n pencil: register('pencil', 0xea73),\n info: register('info', 0xea74),\n issueOpened: register('issue-opened', 0xea74),\n gistPrivate: register('gist-private', 0xea75),\n gitForkPrivate: register('git-fork-private', 0xea75),\n lock: register('lock', 0xea75),\n mirrorPrivate: register('mirror-private', 0xea75),\n close: register('close', 0xea76),\n removeClose: register('remove-close', 0xea76),\n x: register('x', 0xea76),\n repoSync: register('repo-sync', 0xea77),\n sync: register('sync', 0xea77),\n clone: register('clone', 0xea78),\n desktopDownload: register('desktop-download', 0xea78),\n beaker: register('beaker', 0xea79),\n microscope: register('microscope', 0xea79),\n vm: register('vm', 0xea7a),\n deviceDesktop: register('device-desktop', 0xea7a),\n file: register('file', 0xea7b),\n fileText: register('file-text', 0xea7b),\n more: register('more', 0xea7c),\n ellipsis: register('ellipsis', 0xea7c),\n kebabHorizontal: register('kebab-horizontal', 0xea7c),\n mailReply: register('mail-reply', 0xea7d),\n reply: register('reply', 0xea7d),\n organization: register('organization', 0xea7e),\n organizationFilled: register('organization-filled', 0xea7e),\n organizationOutline: register('organization-outline', 0xea7e),\n newFile: register('new-file', 0xea7f),\n fileAdd: register('file-add', 0xea7f),\n newFolder: register('new-folder', 0xea80),\n fileDirectoryCreate: register('file-directory-create', 0xea80),\n trash: register('trash', 0xea81),\n trashcan: register('trashcan', 0xea81),\n history: register('history', 0xea82),\n clock: register('clock', 0xea82),\n folder: register('folder', 0xea83),\n fileDirectory: register('file-directory', 0xea83),\n symbolFolder: register('symbol-folder', 0xea83),\n logoGithub: register('logo-github', 0xea84),\n markGithub: register('mark-github', 0xea84),\n github: register('github', 0xea84),\n terminal: register('terminal', 0xea85),\n console: register('console', 0xea85),\n repl: register('repl', 0xea85),\n zap: register('zap', 0xea86),\n symbolEvent: register('symbol-event', 0xea86),\n error: register('error', 0xea87),\n stop: register('stop', 0xea87),\n variable: register('variable', 0xea88),\n symbolVariable: register('symbol-variable', 0xea88),\n array: register('array', 0xea8a),\n symbolArray: register('symbol-array', 0xea8a),\n symbolModule: register('symbol-module', 0xea8b),\n symbolPackage: register('symbol-package', 0xea8b),\n symbolNamespace: register('symbol-namespace', 0xea8b),\n symbolObject: register('symbol-object', 0xea8b),\n symbolMethod: register('symbol-method', 0xea8c),\n symbolFunction: register('symbol-function', 0xea8c),\n symbolConstructor: register('symbol-constructor', 0xea8c),\n symbolBoolean: register('symbol-boolean', 0xea8f),\n symbolNull: register('symbol-null', 0xea8f),\n symbolNumeric: register('symbol-numeric', 0xea90),\n symbolNumber: register('symbol-number', 0xea90),\n symbolStructure: register('symbol-structure', 0xea91),\n symbolStruct: register('symbol-struct', 0xea91),\n symbolParameter: register('symbol-parameter', 0xea92),\n symbolTypeParameter: register('symbol-type-parameter', 0xea92),\n symbolKey: register('symbol-key', 0xea93),\n symbolText: register('symbol-text', 0xea93),\n symbolReference: register('symbol-reference', 0xea94),\n goToFile: register('go-to-file', 0xea94),\n symbolEnum: register('symbol-enum', 0xea95),\n symbolValue: register('symbol-value', 0xea95),\n symbolRuler: register('symbol-ruler', 0xea96),\n symbolUnit: register('symbol-unit', 0xea96),\n activateBreakpoints: register('activate-breakpoints', 0xea97),\n archive: register('archive', 0xea98),\n arrowBoth: register('arrow-both', 0xea99),\n arrowDown: register('arrow-down', 0xea9a),\n arrowLeft: register('arrow-left', 0xea9b),\n arrowRight: register('arrow-right', 0xea9c),\n arrowSmallDown: register('arrow-small-down', 0xea9d),\n arrowSmallLeft: register('arrow-small-left', 0xea9e),\n arrowSmallRight: register('arrow-small-right', 0xea9f),\n arrowSmallUp: register('arrow-small-up', 0xeaa0),\n arrowUp: register('arrow-up', 0xeaa1),\n bell: register('bell', 0xeaa2),\n bold: register('bold', 0xeaa3),\n book: register('book', 0xeaa4),\n bookmark: register('bookmark', 0xeaa5),\n debugBreakpointConditionalUnverified: register('debug-breakpoint-conditional-unverified', 0xeaa6),\n debugBreakpointConditional: register('debug-breakpoint-conditional', 0xeaa7),\n debugBreakpointConditionalDisabled: register('debug-breakpoint-conditional-disabled', 0xeaa7),\n debugBreakpointDataUnverified: register('debug-breakpoint-data-unverified', 0xeaa8),\n debugBreakpointData: register('debug-breakpoint-data', 0xeaa9),\n debugBreakpointDataDisabled: register('debug-breakpoint-data-disabled', 0xeaa9),\n debugBreakpointLogUnverified: register('debug-breakpoint-log-unverified', 0xeaaa),\n debugBreakpointLog: register('debug-breakpoint-log', 0xeaab),\n debugBreakpointLogDisabled: register('debug-breakpoint-log-disabled', 0xeaab),\n briefcase: register('briefcase', 0xeaac),\n broadcast: register('broadcast', 0xeaad),\n browser: register('browser', 0xeaae),\n bug: register('bug', 0xeaaf),\n calendar: register('calendar', 0xeab0),\n caseSensitive: register('case-sensitive', 0xeab1),\n check: register('check', 0xeab2),\n checklist: register('checklist', 0xeab3),\n chevronDown: register('chevron-down', 0xeab4),\n dropDownButton: register('drop-down-button', 0xeab4),\n chevronLeft: register('chevron-left', 0xeab5),\n chevronRight: register('chevron-right', 0xeab6),\n chevronUp: register('chevron-up', 0xeab7),\n chromeClose: register('chrome-close', 0xeab8),\n chromeMaximize: register('chrome-maximize', 0xeab9),\n chromeMinimize: register('chrome-minimize', 0xeaba),\n chromeRestore: register('chrome-restore', 0xeabb),\n circle: register('circle', 0xeabc),\n circleOutline: register('circle-outline', 0xeabc),\n debugBreakpointUnverified: register('debug-breakpoint-unverified', 0xeabc),\n circleSlash: register('circle-slash', 0xeabd),\n circuitBoard: register('circuit-board', 0xeabe),\n clearAll: register('clear-all', 0xeabf),\n clippy: register('clippy', 0xeac0),\n closeAll: register('close-all', 0xeac1),\n cloudDownload: register('cloud-download', 0xeac2),\n cloudUpload: register('cloud-upload', 0xeac3),\n code: register('code', 0xeac4),\n collapseAll: register('collapse-all', 0xeac5),\n colorMode: register('color-mode', 0xeac6),\n commentDiscussion: register('comment-discussion', 0xeac7),\n compareChanges: register('compare-changes', 0xeafd),\n creditCard: register('credit-card', 0xeac9),\n dash: register('dash', 0xeacc),\n dashboard: register('dashboard', 0xeacd),\n database: register('database', 0xeace),\n debugContinue: register('debug-continue', 0xeacf),\n debugDisconnect: register('debug-disconnect', 0xead0),\n debugPause: register('debug-pause', 0xead1),\n debugRestart: register('debug-restart', 0xead2),\n debugStart: register('debug-start', 0xead3),\n debugStepInto: register('debug-step-into', 0xead4),\n debugStepOut: register('debug-step-out', 0xead5),\n debugStepOver: register('debug-step-over', 0xead6),\n debugStop: register('debug-stop', 0xead7),\n debug: register('debug', 0xead8),\n deviceCameraVideo: register('device-camera-video', 0xead9),\n deviceCamera: register('device-camera', 0xeada),\n deviceMobile: register('device-mobile', 0xeadb),\n diffAdded: register('diff-added', 0xeadc),\n diffIgnored: register('diff-ignored', 0xeadd),\n diffModified: register('diff-modified', 0xeade),\n diffRemoved: register('diff-removed', 0xeadf),\n diffRenamed: register('diff-renamed', 0xeae0),\n diff: register('diff', 0xeae1),\n discard: register('discard', 0xeae2),\n editorLayout: register('editor-layout', 0xeae3),\n emptyWindow: register('empty-window', 0xeae4),\n exclude: register('exclude', 0xeae5),\n extensions: register('extensions', 0xeae6),\n eyeClosed: register('eye-closed', 0xeae7),\n fileBinary: register('file-binary', 0xeae8),\n fileCode: register('file-code', 0xeae9),\n fileMedia: register('file-media', 0xeaea),\n filePdf: register('file-pdf', 0xeaeb),\n fileSubmodule: register('file-submodule', 0xeaec),\n fileSymlinkDirectory: register('file-symlink-directory', 0xeaed),\n fileSymlinkFile: register('file-symlink-file', 0xeaee),\n fileZip: register('file-zip', 0xeaef),\n files: register('files', 0xeaf0),\n filter: register('filter', 0xeaf1),\n flame: register('flame', 0xeaf2),\n foldDown: register('fold-down', 0xeaf3),\n foldUp: register('fold-up', 0xeaf4),\n fold: register('fold', 0xeaf5),\n folderActive: register('folder-active', 0xeaf6),\n folderOpened: register('folder-opened', 0xeaf7),\n gear: register('gear', 0xeaf8),\n gift: register('gift', 0xeaf9),\n gistSecret: register('gist-secret', 0xeafa),\n gist: register('gist', 0xeafb),\n gitCommit: register('git-commit', 0xeafc),\n gitCompare: register('git-compare', 0xeafd),\n gitMerge: register('git-merge', 0xeafe),\n githubAction: register('github-action', 0xeaff),\n githubAlt: register('github-alt', 0xeb00),\n globe: register('globe', 0xeb01),\n grabber: register('grabber', 0xeb02),\n graph: register('graph', 0xeb03),\n gripper: register('gripper', 0xeb04),\n heart: register('heart', 0xeb05),\n home: register('home', 0xeb06),\n horizontalRule: register('horizontal-rule', 0xeb07),\n hubot: register('hubot', 0xeb08),\n inbox: register('inbox', 0xeb09),\n issueClosed: register('issue-closed', 0xeba4),\n issueReopened: register('issue-reopened', 0xeb0b),\n issues: register('issues', 0xeb0c),\n italic: register('italic', 0xeb0d),\n jersey: register('jersey', 0xeb0e),\n json: register('json', 0xeb0f),\n bracket: register('bracket', 0xeb0f),\n kebabVertical: register('kebab-vertical', 0xeb10),\n key: register('key', 0xeb11),\n law: register('law', 0xeb12),\n lightbulbAutofix: register('lightbulb-autofix', 0xeb13),\n linkExternal: register('link-external', 0xeb14),\n link: register('link', 0xeb15),\n listOrdered: register('list-ordered', 0xeb16),\n listUnordered: register('list-unordered', 0xeb17),\n liveShare: register('live-share', 0xeb18),\n loading: register('loading', 0xeb19),\n location: register('location', 0xeb1a),\n mailRead: register('mail-read', 0xeb1b),\n mail: register('mail', 0xeb1c),\n markdown: register('markdown', 0xeb1d),\n megaphone: register('megaphone', 0xeb1e),\n mention: register('mention', 0xeb1f),\n milestone: register('milestone', 0xeb20),\n gitPullRequestMilestone: register('git-pull-request-milestone', 0xeb20),\n mortarBoard: register('mortar-board', 0xeb21),\n move: register('move', 0xeb22),\n multipleWindows: register('multiple-windows', 0xeb23),\n mute: register('mute', 0xeb24),\n noNewline: register('no-newline', 0xeb25),\n note: register('note', 0xeb26),\n octoface: register('octoface', 0xeb27),\n openPreview: register('open-preview', 0xeb28),\n package: register('package', 0xeb29),\n paintcan: register('paintcan', 0xeb2a),\n pin: register('pin', 0xeb2b),\n play: register('play', 0xeb2c),\n run: register('run', 0xeb2c),\n plug: register('plug', 0xeb2d),\n preserveCase: register('preserve-case', 0xeb2e),\n preview: register('preview', 0xeb2f),\n project: register('project', 0xeb30),\n pulse: register('pulse', 0xeb31),\n question: register('question', 0xeb32),\n quote: register('quote', 0xeb33),\n radioTower: register('radio-tower', 0xeb34),\n reactions: register('reactions', 0xeb35),\n references: register('references', 0xeb36),\n refresh: register('refresh', 0xeb37),\n regex: register('regex', 0xeb38),\n remoteExplorer: register('remote-explorer', 0xeb39),\n remote: register('remote', 0xeb3a),\n remove: register('remove', 0xeb3b),\n replaceAll: register('replace-all', 0xeb3c),\n replace: register('replace', 0xeb3d),\n repoClone: register('repo-clone', 0xeb3e),\n repoForcePush: register('repo-force-push', 0xeb3f),\n repoPull: register('repo-pull', 0xeb40),\n repoPush: register('repo-push', 0xeb41),\n report: register('report', 0xeb42),\n requestChanges: register('request-changes', 0xeb43),\n rocket: register('rocket', 0xeb44),\n rootFolderOpened: register('root-folder-opened', 0xeb45),\n rootFolder: register('root-folder', 0xeb46),\n rss: register('rss', 0xeb47),\n ruby: register('ruby', 0xeb48),\n saveAll: register('save-all', 0xeb49),\n saveAs: register('save-as', 0xeb4a),\n save: register('save', 0xeb4b),\n screenFull: register('screen-full', 0xeb4c),\n screenNormal: register('screen-normal', 0xeb4d),\n searchStop: register('search-stop', 0xeb4e),\n server: register('server', 0xeb50),\n settingsGear: register('settings-gear', 0xeb51),\n settings: register('settings', 0xeb52),\n shield: register('shield', 0xeb53),\n smiley: register('smiley', 0xeb54),\n sortPrecedence: register('sort-precedence', 0xeb55),\n splitHorizontal: register('split-horizontal', 0xeb56),\n splitVertical: register('split-vertical', 0xeb57),\n squirrel: register('squirrel', 0xeb58),\n starFull: register('star-full', 0xeb59),\n starHalf: register('star-half', 0xeb5a),\n symbolClass: register('symbol-class', 0xeb5b),\n symbolColor: register('symbol-color', 0xeb5c),\n symbolCustomColor: register('symbol-customcolor', 0xeb5c),\n symbolConstant: register('symbol-constant', 0xeb5d),\n symbolEnumMember: register('symbol-enum-member', 0xeb5e),\n symbolField: register('symbol-field', 0xeb5f),\n symbolFile: register('symbol-file', 0xeb60),\n symbolInterface: register('symbol-interface', 0xeb61),\n symbolKeyword: register('symbol-keyword', 0xeb62),\n symbolMisc: register('symbol-misc', 0xeb63),\n symbolOperator: register('symbol-operator', 0xeb64),\n symbolProperty: register('symbol-property', 0xeb65),\n wrench: register('wrench', 0xeb65),\n wrenchSubaction: register('wrench-subaction', 0xeb65),\n symbolSnippet: register('symbol-snippet', 0xeb66),\n tasklist: register('tasklist', 0xeb67),\n telescope: register('telescope', 0xeb68),\n textSize: register('text-size', 0xeb69),\n threeBars: register('three-bars', 0xeb6a),\n thumbsdown: register('thumbsdown', 0xeb6b),\n thumbsup: register('thumbsup', 0xeb6c),\n tools: register('tools', 0xeb6d),\n triangleDown: register('triangle-down', 0xeb6e),\n triangleLeft: register('triangle-left', 0xeb6f),\n triangleRight: register('triangle-right', 0xeb70),\n triangleUp: register('triangle-up', 0xeb71),\n twitter: register('twitter', 0xeb72),\n unfold: register('unfold', 0xeb73),\n unlock: register('unlock', 0xeb74),\n unmute: register('unmute', 0xeb75),\n unverified: register('unverified', 0xeb76),\n verified: register('verified', 0xeb77),\n versions: register('versions', 0xeb78),\n vmActive: register('vm-active', 0xeb79),\n vmOutline: register('vm-outline', 0xeb7a),\n vmRunning: register('vm-running', 0xeb7b),\n watch: register('watch', 0xeb7c),\n whitespace: register('whitespace', 0xeb7d),\n wholeWord: register('whole-word', 0xeb7e),\n window: register('window', 0xeb7f),\n wordWrap: register('word-wrap', 0xeb80),\n zoomIn: register('zoom-in', 0xeb81),\n zoomOut: register('zoom-out', 0xeb82),\n listFilter: register('list-filter', 0xeb83),\n listFlat: register('list-flat', 0xeb84),\n listSelection: register('list-selection', 0xeb85),\n selection: register('selection', 0xeb85),\n listTree: register('list-tree', 0xeb86),\n debugBreakpointFunctionUnverified: register('debug-breakpoint-function-unverified', 0xeb87),\n debugBreakpointFunction: register('debug-breakpoint-function', 0xeb88),\n debugBreakpointFunctionDisabled: register('debug-breakpoint-function-disabled', 0xeb88),\n debugStackframeActive: register('debug-stackframe-active', 0xeb89),\n circleSmallFilled: register('circle-small-filled', 0xeb8a),\n debugStackframeDot: register('debug-stackframe-dot', 0xeb8a),\n debugStackframe: register('debug-stackframe', 0xeb8b),\n debugStackframeFocused: register('debug-stackframe-focused', 0xeb8b),\n debugBreakpointUnsupported: register('debug-breakpoint-unsupported', 0xeb8c),\n symbolString: register('symbol-string', 0xeb8d),\n debugReverseContinue: register('debug-reverse-continue', 0xeb8e),\n debugStepBack: register('debug-step-back', 0xeb8f),\n debugRestartFrame: register('debug-restart-frame', 0xeb90),\n callIncoming: register('call-incoming', 0xeb92),\n callOutgoing: register('call-outgoing', 0xeb93),\n menu: register('menu', 0xeb94),\n expandAll: register('expand-all', 0xeb95),\n feedback: register('feedback', 0xeb96),\n gitPullRequestReviewer: register('git-pull-request-reviewer', 0xeb96),\n groupByRefType: register('group-by-ref-type', 0xeb97),\n ungroupByRefType: register('ungroup-by-ref-type', 0xeb98),\n account: register('account', 0xeb99),\n gitPullRequestAssignee: register('git-pull-request-assignee', 0xeb99),\n bellDot: register('bell-dot', 0xeb9a),\n debugConsole: register('debug-console', 0xeb9b),\n library: register('library', 0xeb9c),\n output: register('output', 0xeb9d),\n runAll: register('run-all', 0xeb9e),\n syncIgnored: register('sync-ignored', 0xeb9f),\n pinned: register('pinned', 0xeba0),\n githubInverted: register('github-inverted', 0xeba1),\n debugAlt: register('debug-alt', 0xeb91),\n serverProcess: register('server-process', 0xeba2),\n serverEnvironment: register('server-environment', 0xeba3),\n pass: register('pass', 0xeba4),\n stopCircle: register('stop-circle', 0xeba5),\n playCircle: register('play-circle', 0xeba6),\n record: register('record', 0xeba7),\n debugAltSmall: register('debug-alt-small', 0xeba8),\n vmConnect: register('vm-connect', 0xeba9),\n cloud: register('cloud', 0xebaa),\n merge: register('merge', 0xebab),\n exportIcon: register('export', 0xebac),\n graphLeft: register('graph-left', 0xebad),\n magnet: register('magnet', 0xebae),\n notebook: register('notebook', 0xebaf),\n redo: register('redo', 0xebb0),\n checkAll: register('check-all', 0xebb1),\n pinnedDirty: register('pinned-dirty', 0xebb2),\n passFilled: register('pass-filled', 0xebb3),\n circleLargeFilled: register('circle-large-filled', 0xebb4),\n circleLarge: register('circle-large', 0xebb5),\n circleLargeOutline: register('circle-large-outline', 0xebb5),\n combine: register('combine', 0xebb6),\n gather: register('gather', 0xebb6),\n table: register('table', 0xebb7),\n variableGroup: register('variable-group', 0xebb8),\n typeHierarchy: register('type-hierarchy', 0xebb9),\n typeHierarchySub: register('type-hierarchy-sub', 0xebba),\n typeHierarchySuper: register('type-hierarchy-super', 0xebbb),\n gitPullRequestCreate: register('git-pull-request-create', 0xebbc),\n runAbove: register('run-above', 0xebbd),\n runBelow: register('run-below', 0xebbe),\n notebookTemplate: register('notebook-template', 0xebbf),\n debugRerun: register('debug-rerun', 0xebc0),\n workspaceTrusted: register('workspace-trusted', 0xebc1),\n workspaceUntrusted: register('workspace-untrusted', 0xebc2),\n workspaceUnspecified: register('workspace-unspecified', 0xebc3),\n terminalCmd: register('terminal-cmd', 0xebc4),\n terminalDebian: register('terminal-debian', 0xebc5),\n terminalLinux: register('terminal-linux', 0xebc6),\n terminalPowershell: register('terminal-powershell', 0xebc7),\n terminalTmux: register('terminal-tmux', 0xebc8),\n terminalUbuntu: register('terminal-ubuntu', 0xebc9),\n terminalBash: register('terminal-bash', 0xebca),\n arrowSwap: register('arrow-swap', 0xebcb),\n copy: register('copy', 0xebcc),\n personAdd: register('person-add', 0xebcd),\n filterFilled: register('filter-filled', 0xebce),\n wand: register('wand', 0xebcf),\n debugLineByLine: register('debug-line-by-line', 0xebd0),\n inspect: register('inspect', 0xebd1),\n layers: register('layers', 0xebd2),\n layersDot: register('layers-dot', 0xebd3),\n layersActive: register('layers-active', 0xebd4),\n compass: register('compass', 0xebd5),\n compassDot: register('compass-dot', 0xebd6),\n compassActive: register('compass-active', 0xebd7),\n azure: register('azure', 0xebd8),\n issueDraft: register('issue-draft', 0xebd9),\n gitPullRequestClosed: register('git-pull-request-closed', 0xebda),\n gitPullRequestDraft: register('git-pull-request-draft', 0xebdb),\n debugAll: register('debug-all', 0xebdc),\n debugCoverage: register('debug-coverage', 0xebdd),\n runErrors: register('run-errors', 0xebde),\n folderLibrary: register('folder-library', 0xebdf),\n debugContinueSmall: register('debug-continue-small', 0xebe0),\n beakerStop: register('beaker-stop', 0xebe1),\n graphLine: register('graph-line', 0xebe2),\n graphScatter: register('graph-scatter', 0xebe3),\n pieChart: register('pie-chart', 0xebe4),\n bracketDot: register('bracket-dot', 0xebe5),\n bracketError: register('bracket-error', 0xebe6),\n lockSmall: register('lock-small', 0xebe7),\n azureDevops: register('azure-devops', 0xebe8),\n verifiedFilled: register('verified-filled', 0xebe9),\n newLine: register('newline', 0xebea),\n layout: register('layout', 0xebeb),\n layoutActivitybarLeft: register('layout-activitybar-left', 0xebec),\n layoutActivitybarRight: register('layout-activitybar-right', 0xebed),\n layoutPanelLeft: register('layout-panel-left', 0xebee),\n layoutPanelCenter: register('layout-panel-center', 0xebef),\n layoutPanelJustify: register('layout-panel-justify', 0xebf0),\n layoutPanelRight: register('layout-panel-right', 0xebf1),\n layoutPanel: register('layout-panel', 0xebf2),\n layoutSidebarLeft: register('layout-sidebar-left', 0xebf3),\n layoutSidebarRight: register('layout-sidebar-right', 0xebf4),\n layoutStatusbar: register('layout-statusbar', 0xebf5),\n layoutMenubar: register('layout-menubar', 0xebf6),\n layoutCentered: register('layout-centered', 0xebf7),\n layoutSidebarRightOff: register('layout-sidebar-right-off', 0xec00),\n layoutPanelOff: register('layout-panel-off', 0xec01),\n layoutSidebarLeftOff: register('layout-sidebar-left-off', 0xec02),\n target: register('target', 0xebf8),\n indent: register('indent', 0xebf9),\n recordSmall: register('record-small', 0xebfa),\n errorSmall: register('error-small', 0xebfb),\n arrowCircleDown: register('arrow-circle-down', 0xebfc),\n arrowCircleLeft: register('arrow-circle-left', 0xebfd),\n arrowCircleRight: register('arrow-circle-right', 0xebfe),\n arrowCircleUp: register('arrow-circle-up', 0xebff),\n heartFilled: register('heart-filled', 0xec04),\n map: register('map', 0xec05),\n mapFilled: register('map-filled', 0xec06),\n circleSmall: register('circle-small', 0xec07),\n bellSlash: register('bell-slash', 0xec08),\n bellSlashDot: register('bell-slash-dot', 0xec09),\n commentUnresolved: register('comment-unresolved', 0xec0a),\n gitPullRequestGoToChanges: register('git-pull-request-go-to-changes', 0xec0b),\n gitPullRequestNewChanges: register('git-pull-request-new-changes', 0xec0c),\n searchFuzzy: register('search-fuzzy', 0xec0d),\n commentDraft: register('comment-draft', 0xec0e),\n send: register('send', 0xec0f),\n sparkle: register('sparkle', 0xec10),\n insert: register('insert', 0xec11),\n mic: register('mic', 0xec12),\n thumbsDownFilled: register('thumbsdown-filled', 0xec13),\n thumbsUpFilled: register('thumbsup-filled', 0xec14),\n coffee: register('coffee', 0xec15),\n snake: register('snake', 0xec16),\n game: register('game', 0xec17),\n vr: register('vr', 0xec18),\n chip: register('chip', 0xec19),\n piano: register('piano', 0xec1a),\n music: register('music', 0xec1b),\n micFilled: register('mic-filled', 0xec1c),\n gitFetch: register('git-fetch', 0xec1d),\n copilot: register('copilot', 0xec1e),\n lightbulbSparkle: register('lightbulb-sparkle', 0xec1f),\n lightbulbSparkleAutofix: register('lightbulb-sparkle-autofix', 0xec1f),\n robot: register('robot', 0xec20),\n sparkleFilled: register('sparkle-filled', 0xec21),\n diffSingle: register('diff-single', 0xec22),\n diffMultiple: register('diff-multiple', 0xec23),\n surroundWith: register('surround-with', 0xec24),\n gitStash: register('git-stash', 0xec26),\n gitStashApply: register('git-stash-apply', 0xec27),\n gitStashPop: register('git-stash-pop', 0xec28),\n // derived icons, that could become separate icons\n dialogError: register('dialog-error', 'error'),\n dialogWarning: register('dialog-warning', 'warning'),\n dialogInfo: register('dialog-info', 'info'),\n dialogClose: register('dialog-close', 'close'),\n treeItemExpanded: register('tree-item-expanded', 'chevron-down'), // collapsed is done with rotation\n treeFilterOnTypeOn: register('tree-filter-on-type-on', 'list-filter'),\n treeFilterOnTypeOff: register('tree-filter-on-type-off', 'list-selection'),\n treeFilterClear: register('tree-filter-clear', 'close'),\n treeItemLoading: register('tree-item-loading', 'loading'),\n menuSelection: register('menu-selection', 'check'),\n menuSubmenu: register('menu-submenu', 'chevron-right'),\n menuBarMore: register('menubar-more', 'more'),\n scrollbarButtonLeft: register('scrollbar-button-left', 'triangle-left'),\n scrollbarButtonRight: register('scrollbar-button-right', 'triangle-right'),\n scrollbarButtonUp: register('scrollbar-button-up', 'triangle-up'),\n scrollbarButtonDown: register('scrollbar-button-down', 'triangle-down'),\n toolBarMore: register('toolbar-more', 'more'),\n quickInputBack: register('quick-input-back', 'arrow-left')\n};\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Emitter } from '../../base/common/event.js';\nimport { Disposable, toDisposable } from '../../base/common/lifecycle.js';\nexport class TokenizationRegistry {\n constructor() {\n this._tokenizationSupports = new Map();\n this._factories = new Map();\n this._onDidChange = new Emitter();\n this.onDidChange = this._onDidChange.event;\n this._colorMap = null;\n }\n handleChange(languageIds) {\n this._onDidChange.fire({\n changedLanguages: languageIds,\n changedColorMap: false\n });\n }\n register(languageId, support) {\n this._tokenizationSupports.set(languageId, support);\n this.handleChange([languageId]);\n return toDisposable(() => {\n if (this._tokenizationSupports.get(languageId) !== support) {\n return;\n }\n this._tokenizationSupports.delete(languageId);\n this.handleChange([languageId]);\n });\n }\n get(languageId) {\n return this._tokenizationSupports.get(languageId) || null;\n }\n registerFactory(languageId, factory) {\n var _a;\n (_a = this._factories.get(languageId)) === null || _a === void 0 ? void 0 : _a.dispose();\n const myData = new TokenizationSupportFactoryData(this, languageId, factory);\n this._factories.set(languageId, myData);\n return toDisposable(() => {\n const v = this._factories.get(languageId);\n if (!v || v !== myData) {\n return;\n }\n this._factories.delete(languageId);\n v.dispose();\n });\n }\n async getOrCreate(languageId) {\n // check first if the support is already set\n const tokenizationSupport = this.get(languageId);\n if (tokenizationSupport) {\n return tokenizationSupport;\n }\n const factory = this._factories.get(languageId);\n if (!factory || factory.isResolved) {\n // no factory or factory.resolve already finished\n return null;\n }\n await factory.resolve();\n return this.get(languageId);\n }\n isResolved(languageId) {\n const tokenizationSupport = this.get(languageId);\n if (tokenizationSupport) {\n return true;\n }\n const factory = this._factories.get(languageId);\n if (!factory || factory.isResolved) {\n return true;\n }\n return false;\n }\n setColorMap(colorMap) {\n this._colorMap = colorMap;\n this._onDidChange.fire({\n changedLanguages: Array.from(this._tokenizationSupports.keys()),\n changedColorMap: true\n });\n }\n getColorMap() {\n return this._colorMap;\n }\n getDefaultBackground() {\n if (this._colorMap && this._colorMap.length > 2 /* ColorId.DefaultBackground */) {\n return this._colorMap[2 /* ColorId.DefaultBackground */];\n }\n return null;\n }\n}\nclass TokenizationSupportFactoryData extends Disposable {\n get isResolved() {\n return this._isResolved;\n }\n constructor(_registry, _languageId, _factory) {\n super();\n this._registry = _registry;\n this._languageId = _languageId;\n this._factory = _factory;\n this._isDisposed = false;\n this._resolvePromise = null;\n this._isResolved = false;\n }\n dispose() {\n this._isDisposed = true;\n super.dispose();\n }\n async resolve() {\n if (!this._resolvePromise) {\n this._resolvePromise = this._create();\n }\n return this._resolvePromise;\n }\n async _create() {\n const value = await this._factory.tokenizationSupport;\n this._isResolved = true;\n if (value && !this._isDisposed) {\n this._register(this._registry.register(this._languageId, value));\n }\n }\n}\n", "import { Codicon } from '../../base/common/codicons.js';\nimport { URI } from '../../base/common/uri.js';\nimport { Range } from './core/range.js';\nimport { TokenizationRegistry as TokenizationRegistryImpl } from './tokenizationRegistry.js';\nimport { localize } from '../../nls.js';\nexport class Token {\n constructor(offset, type, language) {\n this.offset = offset;\n this.type = type;\n this.language = language;\n this._tokenBrand = undefined;\n }\n toString() {\n return '(' + this.offset + ', ' + this.type + ')';\n }\n}\n/**\n * @internal\n */\nexport class TokenizationResult {\n constructor(tokens, endState) {\n this.tokens = tokens;\n this.endState = endState;\n this._tokenizationResultBrand = undefined;\n }\n}\n/**\n * @internal\n */\nexport class EncodedTokenizationResult {\n constructor(\n /**\n * The tokens in binary format. Each token occupies two array indices. For token i:\n * - at offset 2*i => startIndex\n * - at offset 2*i + 1 => metadata\n *\n */\n tokens, endState) {\n this.tokens = tokens;\n this.endState = endState;\n this._encodedTokenizationResultBrand = undefined;\n }\n}\n/**\n * @internal\n */\nexport var CompletionItemKinds;\n(function (CompletionItemKinds) {\n const byKind = new Map();\n byKind.set(0 /* CompletionItemKind.Method */, Codicon.symbolMethod);\n byKind.set(1 /* CompletionItemKind.Function */, Codicon.symbolFunction);\n byKind.set(2 /* CompletionItemKind.Constructor */, Codicon.symbolConstructor);\n byKind.set(3 /* CompletionItemKind.Field */, Codicon.symbolField);\n byKind.set(4 /* CompletionItemKind.Variable */, Codicon.symbolVariable);\n byKind.set(5 /* CompletionItemKind.Class */, Codicon.symbolClass);\n byKind.set(6 /* CompletionItemKind.Struct */, Codicon.symbolStruct);\n byKind.set(7 /* CompletionItemKind.Interface */, Codicon.symbolInterface);\n byKind.set(8 /* CompletionItemKind.Module */, Codicon.symbolModule);\n byKind.set(9 /* CompletionItemKind.Property */, Codicon.symbolProperty);\n byKind.set(10 /* CompletionItemKind.Event */, Codicon.symbolEvent);\n byKind.set(11 /* CompletionItemKind.Operator */, Codicon.symbolOperator);\n byKind.set(12 /* CompletionItemKind.Unit */, Codicon.symbolUnit);\n byKind.set(13 /* CompletionItemKind.Value */, Codicon.symbolValue);\n byKind.set(15 /* CompletionItemKind.Enum */, Codicon.symbolEnum);\n byKind.set(14 /* CompletionItemKind.Constant */, Codicon.symbolConstant);\n byKind.set(15 /* CompletionItemKind.Enum */, Codicon.symbolEnum);\n byKind.set(16 /* CompletionItemKind.EnumMember */, Codicon.symbolEnumMember);\n byKind.set(17 /* CompletionItemKind.Keyword */, Codicon.symbolKeyword);\n byKind.set(27 /* CompletionItemKind.Snippet */, Codicon.symbolSnippet);\n byKind.set(18 /* CompletionItemKind.Text */, Codicon.symbolText);\n byKind.set(19 /* CompletionItemKind.Color */, Codicon.symbolColor);\n byKind.set(20 /* CompletionItemKind.File */, Codicon.symbolFile);\n byKind.set(21 /* CompletionItemKind.Reference */, Codicon.symbolReference);\n byKind.set(22 /* CompletionItemKind.Customcolor */, Codicon.symbolCustomColor);\n byKind.set(23 /* CompletionItemKind.Folder */, Codicon.symbolFolder);\n byKind.set(24 /* CompletionItemKind.TypeParameter */, Codicon.symbolTypeParameter);\n byKind.set(25 /* CompletionItemKind.User */, Codicon.account);\n byKind.set(26 /* CompletionItemKind.Issue */, Codicon.issues);\n /**\n * @internal\n */\n function toIcon(kind) {\n let codicon = byKind.get(kind);\n if (!codicon) {\n console.info('No codicon found for CompletionItemKind ' + kind);\n codicon = Codicon.symbolProperty;\n }\n return codicon;\n }\n CompletionItemKinds.toIcon = toIcon;\n const data = new Map();\n data.set('method', 0 /* CompletionItemKind.Method */);\n data.set('function', 1 /* CompletionItemKind.Function */);\n data.set('constructor', 2 /* CompletionItemKind.Constructor */);\n data.set('field', 3 /* CompletionItemKind.Field */);\n data.set('variable', 4 /* CompletionItemKind.Variable */);\n data.set('class', 5 /* CompletionItemKind.Class */);\n data.set('struct', 6 /* CompletionItemKind.Struct */);\n data.set('interface', 7 /* CompletionItemKind.Interface */);\n data.set('module', 8 /* CompletionItemKind.Module */);\n data.set('property', 9 /* CompletionItemKind.Property */);\n data.set('event', 10 /* CompletionItemKind.Event */);\n data.set('operator', 11 /* CompletionItemKind.Operator */);\n data.set('unit', 12 /* CompletionItemKind.Unit */);\n data.set('value', 13 /* CompletionItemKind.Value */);\n data.set('constant', 14 /* CompletionItemKind.Constant */);\n data.set('enum', 15 /* CompletionItemKind.Enum */);\n data.set('enum-member', 16 /* CompletionItemKind.EnumMember */);\n data.set('enumMember', 16 /* CompletionItemKind.EnumMember */);\n data.set('keyword', 17 /* CompletionItemKind.Keyword */);\n data.set('snippet', 27 /* CompletionItemKind.Snippet */);\n data.set('text', 18 /* CompletionItemKind.Text */);\n data.set('color', 19 /* CompletionItemKind.Color */);\n data.set('file', 20 /* CompletionItemKind.File */);\n data.set('reference', 21 /* CompletionItemKind.Reference */);\n data.set('customcolor', 22 /* CompletionItemKind.Customcolor */);\n data.set('folder', 23 /* CompletionItemKind.Folder */);\n data.set('type-parameter', 24 /* CompletionItemKind.TypeParameter */);\n data.set('typeParameter', 24 /* CompletionItemKind.TypeParameter */);\n data.set('account', 25 /* CompletionItemKind.User */);\n data.set('issue', 26 /* CompletionItemKind.Issue */);\n /**\n * @internal\n */\n function fromString(value, strict) {\n let res = data.get(value);\n if (typeof res === 'undefined' && !strict) {\n res = 9 /* CompletionItemKind.Property */;\n }\n return res;\n }\n CompletionItemKinds.fromString = fromString;\n})(CompletionItemKinds || (CompletionItemKinds = {}));\n/**\n * How an {@link InlineCompletionsProvider inline completion provider} was triggered.\n */\nexport var InlineCompletionTriggerKind;\n(function (InlineCompletionTriggerKind) {\n /**\n * Completion was triggered automatically while editing.\n * It is sufficient to return a single completion item in this case.\n */\n InlineCompletionTriggerKind[InlineCompletionTriggerKind[\"Automatic\"] = 0] = \"Automatic\";\n /**\n * Completion was triggered explicitly by a user gesture.\n * Return multiple completion items to enable cycling through them.\n */\n InlineCompletionTriggerKind[InlineCompletionTriggerKind[\"Explicit\"] = 1] = \"Explicit\";\n})(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));\nexport class SelectedSuggestionInfo {\n constructor(range, text, completionKind, isSnippetText) {\n this.range = range;\n this.text = text;\n this.completionKind = completionKind;\n this.isSnippetText = isSnippetText;\n }\n equals(other) {\n return Range.lift(this.range).equalsRange(other.range)\n && this.text === other.text\n && this.completionKind === other.completionKind\n && this.isSnippetText === other.isSnippetText;\n }\n}\nexport var SignatureHelpTriggerKind;\n(function (SignatureHelpTriggerKind) {\n SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"Invoke\"] = 1] = \"Invoke\";\n SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"TriggerCharacter\"] = 2] = \"TriggerCharacter\";\n SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"ContentChange\"] = 3] = \"ContentChange\";\n})(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {}));\n/**\n * A document highlight kind.\n */\nexport var DocumentHighlightKind;\n(function (DocumentHighlightKind) {\n /**\n * A textual occurrence.\n */\n DocumentHighlightKind[DocumentHighlightKind[\"Text\"] = 0] = \"Text\";\n /**\n * Read-access of a symbol, like reading a variable.\n */\n DocumentHighlightKind[DocumentHighlightKind[\"Read\"] = 1] = \"Read\";\n /**\n * Write-access of a symbol, like writing to a variable.\n */\n DocumentHighlightKind[DocumentHighlightKind[\"Write\"] = 2] = \"Write\";\n})(DocumentHighlightKind || (DocumentHighlightKind = {}));\n/**\n * @internal\n */\nexport function isLocationLink(thing) {\n return thing\n && URI.isUri(thing.uri)\n && Range.isIRange(thing.range)\n && (Range.isIRange(thing.originSelectionRange) || Range.isIRange(thing.targetSelectionRange));\n}\n/**\n * @internal\n */\nexport const symbolKindNames = {\n [17 /* SymbolKind.Array */]: localize('Array', \"array\"),\n [16 /* SymbolKind.Boolean */]: localize('Boolean', \"boolean\"),\n [4 /* SymbolKind.Class */]: localize('Class', \"class\"),\n [13 /* SymbolKind.Constant */]: localize('Constant', \"constant\"),\n [8 /* SymbolKind.Constructor */]: localize('Constructor', \"constructor\"),\n [9 /* SymbolKind.Enum */]: localize('Enum', \"enumeration\"),\n [21 /* SymbolKind.EnumMember */]: localize('EnumMember', \"enumeration member\"),\n [23 /* SymbolKind.Event */]: localize('Event', \"event\"),\n [7 /* SymbolKind.Field */]: localize('Field', \"field\"),\n [0 /* SymbolKind.File */]: localize('File', \"file\"),\n [11 /* SymbolKind.Function */]: localize('Function', \"function\"),\n [10 /* SymbolKind.Interface */]: localize('Interface', \"interface\"),\n [19 /* SymbolKind.Key */]: localize('Key', \"key\"),\n [5 /* SymbolKind.Method */]: localize('Method', \"method\"),\n [1 /* SymbolKind.Module */]: localize('Module', \"module\"),\n [2 /* SymbolKind.Namespace */]: localize('Namespace', \"namespace\"),\n [20 /* SymbolKind.Null */]: localize('Null', \"null\"),\n [15 /* SymbolKind.Number */]: localize('Number', \"number\"),\n [18 /* SymbolKind.Object */]: localize('Object', \"object\"),\n [24 /* SymbolKind.Operator */]: localize('Operator', \"operator\"),\n [3 /* SymbolKind.Package */]: localize('Package', \"package\"),\n [6 /* SymbolKind.Property */]: localize('Property', \"property\"),\n [14 /* SymbolKind.String */]: localize('String', \"string\"),\n [22 /* SymbolKind.Struct */]: localize('Struct', \"struct\"),\n [25 /* SymbolKind.TypeParameter */]: localize('TypeParameter', \"type parameter\"),\n [12 /* SymbolKind.Variable */]: localize('Variable', \"variable\"),\n};\n/**\n * @internal\n */\nexport function getAriaLabelForSymbol(symbolName, kind) {\n return localize('symbolAriaLabel', '{0} ({1})', symbolName, symbolKindNames[kind]);\n}\n/**\n * @internal\n */\nexport var SymbolKinds;\n(function (SymbolKinds) {\n const byKind = new Map();\n byKind.set(0 /* SymbolKind.File */, Codicon.symbolFile);\n byKind.set(1 /* SymbolKind.Module */, Codicon.symbolModule);\n byKind.set(2 /* SymbolKind.Namespace */, Codicon.symbolNamespace);\n byKind.set(3 /* SymbolKind.Package */, Codicon.symbolPackage);\n byKind.set(4 /* SymbolKind.Class */, Codicon.symbolClass);\n byKind.set(5 /* SymbolKind.Method */, Codicon.symbolMethod);\n byKind.set(6 /* SymbolKind.Property */, Codicon.symbolProperty);\n byKind.set(7 /* SymbolKind.Field */, Codicon.symbolField);\n byKind.set(8 /* SymbolKind.Constructor */, Codicon.symbolConstructor);\n byKind.set(9 /* SymbolKind.Enum */, Codicon.symbolEnum);\n byKind.set(10 /* SymbolKind.Interface */, Codicon.symbolInterface);\n byKind.set(11 /* SymbolKind.Function */, Codicon.symbolFunction);\n byKind.set(12 /* SymbolKind.Variable */, Codicon.symbolVariable);\n byKind.set(13 /* SymbolKind.Constant */, Codicon.symbolConstant);\n byKind.set(14 /* SymbolKind.String */, Codicon.symbolString);\n byKind.set(15 /* SymbolKind.Number */, Codicon.symbolNumber);\n byKind.set(16 /* SymbolKind.Boolean */, Codicon.symbolBoolean);\n byKind.set(17 /* SymbolKind.Array */, Codicon.symbolArray);\n byKind.set(18 /* SymbolKind.Object */, Codicon.symbolObject);\n byKind.set(19 /* SymbolKind.Key */, Codicon.symbolKey);\n byKind.set(20 /* SymbolKind.Null */, Codicon.symbolNull);\n byKind.set(21 /* SymbolKind.EnumMember */, Codicon.symbolEnumMember);\n byKind.set(22 /* SymbolKind.Struct */, Codicon.symbolStruct);\n byKind.set(23 /* SymbolKind.Event */, Codicon.symbolEvent);\n byKind.set(24 /* SymbolKind.Operator */, Codicon.symbolOperator);\n byKind.set(25 /* SymbolKind.TypeParameter */, Codicon.symbolTypeParameter);\n /**\n * @internal\n */\n function toIcon(kind) {\n let icon = byKind.get(kind);\n if (!icon) {\n console.info('No codicon found for SymbolKind ' + kind);\n icon = Codicon.symbolProperty;\n }\n return icon;\n }\n SymbolKinds.toIcon = toIcon;\n})(SymbolKinds || (SymbolKinds = {}));\n/** @internal */\nexport class TextEdit {\n}\nexport class FoldingRangeKind {\n /**\n * Returns a {@link FoldingRangeKind} for the given value.\n *\n * @param value of the kind.\n */\n static fromValue(value) {\n switch (value) {\n case 'comment': return FoldingRangeKind.Comment;\n case 'imports': return FoldingRangeKind.Imports;\n case 'region': return FoldingRangeKind.Region;\n }\n return new FoldingRangeKind(value);\n }\n /**\n * Creates a new {@link FoldingRangeKind}.\n *\n * @param value of the kind.\n */\n constructor(value) {\n this.value = value;\n }\n}\n/**\n * Kind for folding range representing a comment. The value of the kind is 'comment'.\n */\nFoldingRangeKind.Comment = new FoldingRangeKind('comment');\n/**\n * Kind for folding range representing a import. The value of the kind is 'imports'.\n */\nFoldingRangeKind.Imports = new FoldingRangeKind('imports');\n/**\n * Kind for folding range representing regions (for example marked by `#region`, `#endregion`).\n * The value of the kind is 'region'.\n */\nFoldingRangeKind.Region = new FoldingRangeKind('region');\n/**\n * @internal\n */\nexport var Command;\n(function (Command) {\n /**\n * @internal\n */\n function is(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n return typeof obj.id === 'string' &&\n typeof obj.title === 'string';\n }\n Command.is = is;\n})(Command || (Command = {}));\nexport var InlayHintKind;\n(function (InlayHintKind) {\n InlayHintKind[InlayHintKind[\"Type\"] = 1] = \"Type\";\n InlayHintKind[InlayHintKind[\"Parameter\"] = 2] = \"Parameter\";\n})(InlayHintKind || (InlayHintKind = {}));\n/**\n * @internal\n */\nexport class LazyTokenizationSupport {\n constructor(createSupport) {\n this.createSupport = createSupport;\n this._tokenizationSupport = null;\n }\n dispose() {\n if (this._tokenizationSupport) {\n this._tokenizationSupport.then((support) => {\n if (support) {\n support.dispose();\n }\n });\n }\n }\n get tokenizationSupport() {\n if (!this._tokenizationSupport) {\n this._tokenizationSupport = this.createSupport();\n }\n return this._tokenizationSupport;\n }\n}\n/**\n * @internal\n */\nexport const TokenizationRegistry = new TokenizationRegistryImpl();\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.\nexport var AccessibilitySupport;\n(function (AccessibilitySupport) {\n /**\n * This should be the browser case where it is not known if a screen reader is attached or no.\n */\n AccessibilitySupport[AccessibilitySupport[\"Unknown\"] = 0] = \"Unknown\";\n AccessibilitySupport[AccessibilitySupport[\"Disabled\"] = 1] = \"Disabled\";\n AccessibilitySupport[AccessibilitySupport[\"Enabled\"] = 2] = \"Enabled\";\n})(AccessibilitySupport || (AccessibilitySupport = {}));\nexport var CodeActionTriggerType;\n(function (CodeActionTriggerType) {\n CodeActionTriggerType[CodeActionTriggerType[\"Invoke\"] = 1] = \"Invoke\";\n CodeActionTriggerType[CodeActionTriggerType[\"Auto\"] = 2] = \"Auto\";\n})(CodeActionTriggerType || (CodeActionTriggerType = {}));\nexport var CompletionItemInsertTextRule;\n(function (CompletionItemInsertTextRule) {\n CompletionItemInsertTextRule[CompletionItemInsertTextRule[\"None\"] = 0] = \"None\";\n /**\n * Adjust whitespace/indentation of multiline insert texts to\n * match the current line indentation.\n */\n CompletionItemInsertTextRule[CompletionItemInsertTextRule[\"KeepWhitespace\"] = 1] = \"KeepWhitespace\";\n /**\n * `insertText` is a snippet.\n */\n CompletionItemInsertTextRule[CompletionItemInsertTextRule[\"InsertAsSnippet\"] = 4] = \"InsertAsSnippet\";\n})(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {}));\nexport var CompletionItemKind;\n(function (CompletionItemKind) {\n CompletionItemKind[CompletionItemKind[\"Method\"] = 0] = \"Method\";\n CompletionItemKind[CompletionItemKind[\"Function\"] = 1] = \"Function\";\n CompletionItemKind[CompletionItemKind[\"Constructor\"] = 2] = \"Constructor\";\n CompletionItemKind[CompletionItemKind[\"Field\"] = 3] = \"Field\";\n CompletionItemKind[CompletionItemKind[\"Variable\"] = 4] = \"Variable\";\n CompletionItemKind[CompletionItemKind[\"Class\"] = 5] = \"Class\";\n CompletionItemKind[CompletionItemKind[\"Struct\"] = 6] = \"Struct\";\n CompletionItemKind[CompletionItemKind[\"Interface\"] = 7] = \"Interface\";\n CompletionItemKind[CompletionItemKind[\"Module\"] = 8] = \"Module\";\n CompletionItemKind[CompletionItemKind[\"Property\"] = 9] = \"Property\";\n CompletionItemKind[CompletionItemKind[\"Event\"] = 10] = \"Event\";\n CompletionItemKind[CompletionItemKind[\"Operator\"] = 11] = \"Operator\";\n CompletionItemKind[CompletionItemKind[\"Unit\"] = 12] = \"Unit\";\n CompletionItemKind[CompletionItemKind[\"Value\"] = 13] = \"Value\";\n CompletionItemKind[CompletionItemKind[\"Constant\"] = 14] = \"Constant\";\n CompletionItemKind[CompletionItemKind[\"Enum\"] = 15] = \"Enum\";\n CompletionItemKind[CompletionItemKind[\"EnumMember\"] = 16] = \"EnumMember\";\n CompletionItemKind[CompletionItemKind[\"Keyword\"] = 17] = \"Keyword\";\n CompletionItemKind[CompletionItemKind[\"Text\"] = 18] = \"Text\";\n CompletionItemKind[CompletionItemKind[\"Color\"] = 19] = \"Color\";\n CompletionItemKind[CompletionItemKind[\"File\"] = 20] = \"File\";\n CompletionItemKind[CompletionItemKind[\"Reference\"] = 21] = \"Reference\";\n CompletionItemKind[CompletionItemKind[\"Customcolor\"] = 22] = \"Customcolor\";\n CompletionItemKind[CompletionItemKind[\"Folder\"] = 23] = \"Folder\";\n CompletionItemKind[CompletionItemKind[\"TypeParameter\"] = 24] = \"TypeParameter\";\n CompletionItemKind[CompletionItemKind[\"User\"] = 25] = \"User\";\n CompletionItemKind[CompletionItemKind[\"Issue\"] = 26] = \"Issue\";\n CompletionItemKind[CompletionItemKind[\"Snippet\"] = 27] = \"Snippet\";\n})(CompletionItemKind || (CompletionItemKind = {}));\nexport var CompletionItemTag;\n(function (CompletionItemTag) {\n CompletionItemTag[CompletionItemTag[\"Deprecated\"] = 1] = \"Deprecated\";\n})(CompletionItemTag || (CompletionItemTag = {}));\n/**\n * How a suggest provider was triggered.\n */\nexport var CompletionTriggerKind;\n(function (CompletionTriggerKind) {\n CompletionTriggerKind[CompletionTriggerKind[\"Invoke\"] = 0] = \"Invoke\";\n CompletionTriggerKind[CompletionTriggerKind[\"TriggerCharacter\"] = 1] = \"TriggerCharacter\";\n CompletionTriggerKind[CompletionTriggerKind[\"TriggerForIncompleteCompletions\"] = 2] = \"TriggerForIncompleteCompletions\";\n})(CompletionTriggerKind || (CompletionTriggerKind = {}));\n/**\n * A positioning preference for rendering content widgets.\n */\nexport var ContentWidgetPositionPreference;\n(function (ContentWidgetPositionPreference) {\n /**\n * Place the content widget exactly at a position\n */\n ContentWidgetPositionPreference[ContentWidgetPositionPreference[\"EXACT\"] = 0] = \"EXACT\";\n /**\n * Place the content widget above a position\n */\n ContentWidgetPositionPreference[ContentWidgetPositionPreference[\"ABOVE\"] = 1] = \"ABOVE\";\n /**\n * Place the content widget below a position\n */\n ContentWidgetPositionPreference[ContentWidgetPositionPreference[\"BELOW\"] = 2] = \"BELOW\";\n})(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {}));\n/**\n * Describes the reason the cursor has changed its position.\n */\nexport var CursorChangeReason;\n(function (CursorChangeReason) {\n /**\n * Unknown or not set.\n */\n CursorChangeReason[CursorChangeReason[\"NotSet\"] = 0] = \"NotSet\";\n /**\n * A `model.setValue()` was called.\n */\n CursorChangeReason[CursorChangeReason[\"ContentFlush\"] = 1] = \"ContentFlush\";\n /**\n * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers.\n */\n CursorChangeReason[CursorChangeReason[\"RecoverFromMarkers\"] = 2] = \"RecoverFromMarkers\";\n /**\n * There was an explicit user gesture.\n */\n CursorChangeReason[CursorChangeReason[\"Explicit\"] = 3] = \"Explicit\";\n /**\n * There was a Paste.\n */\n CursorChangeReason[CursorChangeReason[\"Paste\"] = 4] = \"Paste\";\n /**\n * There was an Undo.\n */\n CursorChangeReason[CursorChangeReason[\"Undo\"] = 5] = \"Undo\";\n /**\n * There was a Redo.\n */\n CursorChangeReason[CursorChangeReason[\"Redo\"] = 6] = \"Redo\";\n})(CursorChangeReason || (CursorChangeReason = {}));\n/**\n * The default end of line to use when instantiating models.\n */\nexport var DefaultEndOfLine;\n(function (DefaultEndOfLine) {\n /**\n * Use line feed (\\n) as the end of line character.\n */\n DefaultEndOfLine[DefaultEndOfLine[\"LF\"] = 1] = \"LF\";\n /**\n * Use carriage return and line feed (\\r\\n) as the end of line character.\n */\n DefaultEndOfLine[DefaultEndOfLine[\"CRLF\"] = 2] = \"CRLF\";\n})(DefaultEndOfLine || (DefaultEndOfLine = {}));\n/**\n * A document highlight kind.\n */\nexport var DocumentHighlightKind;\n(function (DocumentHighlightKind) {\n /**\n * A textual occurrence.\n */\n DocumentHighlightKind[DocumentHighlightKind[\"Text\"] = 0] = \"Text\";\n /**\n * Read-access of a symbol, like reading a variable.\n */\n DocumentHighlightKind[DocumentHighlightKind[\"Read\"] = 1] = \"Read\";\n /**\n * Write-access of a symbol, like writing to a variable.\n */\n DocumentHighlightKind[DocumentHighlightKind[\"Write\"] = 2] = \"Write\";\n})(DocumentHighlightKind || (DocumentHighlightKind = {}));\n/**\n * Configuration options for auto indentation in the editor\n */\nexport var EditorAutoIndentStrategy;\n(function (EditorAutoIndentStrategy) {\n EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"None\"] = 0] = \"None\";\n EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Keep\"] = 1] = \"Keep\";\n EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Brackets\"] = 2] = \"Brackets\";\n EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Advanced\"] = 3] = \"Advanced\";\n EditorAutoIndentStrategy[EditorAutoIndentStrategy[\"Full\"] = 4] = \"Full\";\n})(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {}));\nexport var EditorOption;\n(function (EditorOption) {\n EditorOption[EditorOption[\"acceptSuggestionOnCommitCharacter\"] = 0] = \"acceptSuggestionOnCommitCharacter\";\n EditorOption[EditorOption[\"acceptSuggestionOnEnter\"] = 1] = \"acceptSuggestionOnEnter\";\n EditorOption[EditorOption[\"accessibilitySupport\"] = 2] = \"accessibilitySupport\";\n EditorOption[EditorOption[\"accessibilityPageSize\"] = 3] = \"accessibilityPageSize\";\n EditorOption[EditorOption[\"ariaLabel\"] = 4] = \"ariaLabel\";\n EditorOption[EditorOption[\"ariaRequired\"] = 5] = \"ariaRequired\";\n EditorOption[EditorOption[\"autoClosingBrackets\"] = 6] = \"autoClosingBrackets\";\n EditorOption[EditorOption[\"autoClosingComments\"] = 7] = \"autoClosingComments\";\n EditorOption[EditorOption[\"screenReaderAnnounceInlineSuggestion\"] = 8] = \"screenReaderAnnounceInlineSuggestion\";\n EditorOption[EditorOption[\"autoClosingDelete\"] = 9] = \"autoClosingDelete\";\n EditorOption[EditorOption[\"autoClosingOvertype\"] = 10] = \"autoClosingOvertype\";\n EditorOption[EditorOption[\"autoClosingQuotes\"] = 11] = \"autoClosingQuotes\";\n EditorOption[EditorOption[\"autoIndent\"] = 12] = \"autoIndent\";\n EditorOption[EditorOption[\"automaticLayout\"] = 13] = \"automaticLayout\";\n EditorOption[EditorOption[\"autoSurround\"] = 14] = \"autoSurround\";\n EditorOption[EditorOption[\"bracketPairColorization\"] = 15] = \"bracketPairColorization\";\n EditorOption[EditorOption[\"guides\"] = 16] = \"guides\";\n EditorOption[EditorOption[\"codeLens\"] = 17] = \"codeLens\";\n EditorOption[EditorOption[\"codeLensFontFamily\"] = 18] = \"codeLensFontFamily\";\n EditorOption[EditorOption[\"codeLensFontSize\"] = 19] = \"codeLensFontSize\";\n EditorOption[EditorOption[\"colorDecorators\"] = 20] = \"colorDecorators\";\n EditorOption[EditorOption[\"colorDecoratorsLimit\"] = 21] = \"colorDecoratorsLimit\";\n EditorOption[EditorOption[\"columnSelection\"] = 22] = \"columnSelection\";\n EditorOption[EditorOption[\"comments\"] = 23] = \"comments\";\n EditorOption[EditorOption[\"contextmenu\"] = 24] = \"contextmenu\";\n EditorOption[EditorOption[\"copyWithSyntaxHighlighting\"] = 25] = \"copyWithSyntaxHighlighting\";\n EditorOption[EditorOption[\"cursorBlinking\"] = 26] = \"cursorBlinking\";\n EditorOption[EditorOption[\"cursorSmoothCaretAnimation\"] = 27] = \"cursorSmoothCaretAnimation\";\n EditorOption[EditorOption[\"cursorStyle\"] = 28] = \"cursorStyle\";\n EditorOption[EditorOption[\"cursorSurroundingLines\"] = 29] = \"cursorSurroundingLines\";\n EditorOption[EditorOption[\"cursorSurroundingLinesStyle\"] = 30] = \"cursorSurroundingLinesStyle\";\n EditorOption[EditorOption[\"cursorWidth\"] = 31] = \"cursorWidth\";\n EditorOption[EditorOption[\"disableLayerHinting\"] = 32] = \"disableLayerHinting\";\n EditorOption[EditorOption[\"disableMonospaceOptimizations\"] = 33] = \"disableMonospaceOptimizations\";\n EditorOption[EditorOption[\"domReadOnly\"] = 34] = \"domReadOnly\";\n EditorOption[EditorOption[\"dragAndDrop\"] = 35] = \"dragAndDrop\";\n EditorOption[EditorOption[\"dropIntoEditor\"] = 36] = \"dropIntoEditor\";\n EditorOption[EditorOption[\"emptySelectionClipboard\"] = 37] = \"emptySelectionClipboard\";\n EditorOption[EditorOption[\"experimentalWhitespaceRendering\"] = 38] = \"experimentalWhitespaceRendering\";\n EditorOption[EditorOption[\"extraEditorClassName\"] = 39] = \"extraEditorClassName\";\n EditorOption[EditorOption[\"fastScrollSensitivity\"] = 40] = \"fastScrollSensitivity\";\n EditorOption[EditorOption[\"find\"] = 41] = \"find\";\n EditorOption[EditorOption[\"fixedOverflowWidgets\"] = 42] = \"fixedOverflowWidgets\";\n EditorOption[EditorOption[\"folding\"] = 43] = \"folding\";\n EditorOption[EditorOption[\"foldingStrategy\"] = 44] = \"foldingStrategy\";\n EditorOption[EditorOption[\"foldingHighlight\"] = 45] = \"foldingHighlight\";\n EditorOption[EditorOption[\"foldingImportsByDefault\"] = 46] = \"foldingImportsByDefault\";\n EditorOption[EditorOption[\"foldingMaximumRegions\"] = 47] = \"foldingMaximumRegions\";\n EditorOption[EditorOption[\"unfoldOnClickAfterEndOfLine\"] = 48] = \"unfoldOnClickAfterEndOfLine\";\n EditorOption[EditorOption[\"fontFamily\"] = 49] = \"fontFamily\";\n EditorOption[EditorOption[\"fontInfo\"] = 50] = \"fontInfo\";\n EditorOption[EditorOption[\"fontLigatures\"] = 51] = \"fontLigatures\";\n EditorOption[EditorOption[\"fontSize\"] = 52] = \"fontSize\";\n EditorOption[EditorOption[\"fontWeight\"] = 53] = \"fontWeight\";\n EditorOption[EditorOption[\"fontVariations\"] = 54] = \"fontVariations\";\n EditorOption[EditorOption[\"formatOnPaste\"] = 55] = \"formatOnPaste\";\n EditorOption[EditorOption[\"formatOnType\"] = 56] = \"formatOnType\";\n EditorOption[EditorOption[\"glyphMargin\"] = 57] = \"glyphMargin\";\n EditorOption[EditorOption[\"gotoLocation\"] = 58] = \"gotoLocation\";\n EditorOption[EditorOption[\"hideCursorInOverviewRuler\"] = 59] = \"hideCursorInOverviewRuler\";\n EditorOption[EditorOption[\"hover\"] = 60] = \"hover\";\n EditorOption[EditorOption[\"inDiffEditor\"] = 61] = \"inDiffEditor\";\n EditorOption[EditorOption[\"inlineSuggest\"] = 62] = \"inlineSuggest\";\n EditorOption[EditorOption[\"letterSpacing\"] = 63] = \"letterSpacing\";\n EditorOption[EditorOption[\"lightbulb\"] = 64] = \"lightbulb\";\n EditorOption[EditorOption[\"lineDecorationsWidth\"] = 65] = \"lineDecorationsWidth\";\n EditorOption[EditorOption[\"lineHeight\"] = 66] = \"lineHeight\";\n EditorOption[EditorOption[\"lineNumbers\"] = 67] = \"lineNumbers\";\n EditorOption[EditorOption[\"lineNumbersMinChars\"] = 68] = \"lineNumbersMinChars\";\n EditorOption[EditorOption[\"linkedEditing\"] = 69] = \"linkedEditing\";\n EditorOption[EditorOption[\"links\"] = 70] = \"links\";\n EditorOption[EditorOption[\"matchBrackets\"] = 71] = \"matchBrackets\";\n EditorOption[EditorOption[\"minimap\"] = 72] = \"minimap\";\n EditorOption[EditorOption[\"mouseStyle\"] = 73] = \"mouseStyle\";\n EditorOption[EditorOption[\"mouseWheelScrollSensitivity\"] = 74] = \"mouseWheelScrollSensitivity\";\n EditorOption[EditorOption[\"mouseWheelZoom\"] = 75] = \"mouseWheelZoom\";\n EditorOption[EditorOption[\"multiCursorMergeOverlapping\"] = 76] = \"multiCursorMergeOverlapping\";\n EditorOption[EditorOption[\"multiCursorModifier\"] = 77] = \"multiCursorModifier\";\n EditorOption[EditorOption[\"multiCursorPaste\"] = 78] = \"multiCursorPaste\";\n EditorOption[EditorOption[\"multiCursorLimit\"] = 79] = \"multiCursorLimit\";\n EditorOption[EditorOption[\"occurrencesHighlight\"] = 80] = \"occurrencesHighlight\";\n EditorOption[EditorOption[\"overviewRulerBorder\"] = 81] = \"overviewRulerBorder\";\n EditorOption[EditorOption[\"overviewRulerLanes\"] = 82] = \"overviewRulerLanes\";\n EditorOption[EditorOption[\"padding\"] = 83] = \"padding\";\n EditorOption[EditorOption[\"pasteAs\"] = 84] = \"pasteAs\";\n EditorOption[EditorOption[\"parameterHints\"] = 85] = \"parameterHints\";\n EditorOption[EditorOption[\"peekWidgetDefaultFocus\"] = 86] = \"peekWidgetDefaultFocus\";\n EditorOption[EditorOption[\"definitionLinkOpensInPeek\"] = 87] = \"definitionLinkOpensInPeek\";\n EditorOption[EditorOption[\"quickSuggestions\"] = 88] = \"quickSuggestions\";\n EditorOption[EditorOption[\"quickSuggestionsDelay\"] = 89] = \"quickSuggestionsDelay\";\n EditorOption[EditorOption[\"readOnly\"] = 90] = \"readOnly\";\n EditorOption[EditorOption[\"readOnlyMessage\"] = 91] = \"readOnlyMessage\";\n EditorOption[EditorOption[\"renameOnType\"] = 92] = \"renameOnType\";\n EditorOption[EditorOption[\"renderControlCharacters\"] = 93] = \"renderControlCharacters\";\n EditorOption[EditorOption[\"renderFinalNewline\"] = 94] = \"renderFinalNewline\";\n EditorOption[EditorOption[\"renderLineHighlight\"] = 95] = \"renderLineHighlight\";\n EditorOption[EditorOption[\"renderLineHighlightOnlyWhenFocus\"] = 96] = \"renderLineHighlightOnlyWhenFocus\";\n EditorOption[EditorOption[\"renderValidationDecorations\"] = 97] = \"renderValidationDecorations\";\n EditorOption[EditorOption[\"renderWhitespace\"] = 98] = \"renderWhitespace\";\n EditorOption[EditorOption[\"revealHorizontalRightPadding\"] = 99] = \"revealHorizontalRightPadding\";\n EditorOption[EditorOption[\"roundedSelection\"] = 100] = \"roundedSelection\";\n EditorOption[EditorOption[\"rulers\"] = 101] = \"rulers\";\n EditorOption[EditorOption[\"scrollbar\"] = 102] = \"scrollbar\";\n EditorOption[EditorOption[\"scrollBeyondLastColumn\"] = 103] = \"scrollBeyondLastColumn\";\n EditorOption[EditorOption[\"scrollBeyondLastLine\"] = 104] = \"scrollBeyondLastLine\";\n EditorOption[EditorOption[\"scrollPredominantAxis\"] = 105] = \"scrollPredominantAxis\";\n EditorOption[EditorOption[\"selectionClipboard\"] = 106] = \"selectionClipboard\";\n EditorOption[EditorOption[\"selectionHighlight\"] = 107] = \"selectionHighlight\";\n EditorOption[EditorOption[\"selectOnLineNumbers\"] = 108] = \"selectOnLineNumbers\";\n EditorOption[EditorOption[\"showFoldingControls\"] = 109] = \"showFoldingControls\";\n EditorOption[EditorOption[\"showUnused\"] = 110] = \"showUnused\";\n EditorOption[EditorOption[\"snippetSuggestions\"] = 111] = \"snippetSuggestions\";\n EditorOption[EditorOption[\"smartSelect\"] = 112] = \"smartSelect\";\n EditorOption[EditorOption[\"smoothScrolling\"] = 113] = \"smoothScrolling\";\n EditorOption[EditorOption[\"stickyScroll\"] = 114] = \"stickyScroll\";\n EditorOption[EditorOption[\"stickyTabStops\"] = 115] = \"stickyTabStops\";\n EditorOption[EditorOption[\"stopRenderingLineAfter\"] = 116] = \"stopRenderingLineAfter\";\n EditorOption[EditorOption[\"suggest\"] = 117] = \"suggest\";\n EditorOption[EditorOption[\"suggestFontSize\"] = 118] = \"suggestFontSize\";\n EditorOption[EditorOption[\"suggestLineHeight\"] = 119] = \"suggestLineHeight\";\n EditorOption[EditorOption[\"suggestOnTriggerCharacters\"] = 120] = \"suggestOnTriggerCharacters\";\n EditorOption[EditorOption[\"suggestSelection\"] = 121] = \"suggestSelection\";\n EditorOption[EditorOption[\"tabCompletion\"] = 122] = \"tabCompletion\";\n EditorOption[EditorOption[\"tabIndex\"] = 123] = \"tabIndex\";\n EditorOption[EditorOption[\"unicodeHighlighting\"] = 124] = \"unicodeHighlighting\";\n EditorOption[EditorOption[\"unusualLineTerminators\"] = 125] = \"unusualLineTerminators\";\n EditorOption[EditorOption[\"useShadowDOM\"] = 126] = \"useShadowDOM\";\n EditorOption[EditorOption[\"useTabStops\"] = 127] = \"useTabStops\";\n EditorOption[EditorOption[\"wordBreak\"] = 128] = \"wordBreak\";\n EditorOption[EditorOption[\"wordSeparators\"] = 129] = \"wordSeparators\";\n EditorOption[EditorOption[\"wordWrap\"] = 130] = \"wordWrap\";\n EditorOption[EditorOption[\"wordWrapBreakAfterCharacters\"] = 131] = \"wordWrapBreakAfterCharacters\";\n EditorOption[EditorOption[\"wordWrapBreakBeforeCharacters\"] = 132] = \"wordWrapBreakBeforeCharacters\";\n EditorOption[EditorOption[\"wordWrapColumn\"] = 133] = \"wordWrapColumn\";\n EditorOption[EditorOption[\"wordWrapOverride1\"] = 134] = \"wordWrapOverride1\";\n EditorOption[EditorOption[\"wordWrapOverride2\"] = 135] = \"wordWrapOverride2\";\n EditorOption[EditorOption[\"wrappingIndent\"] = 136] = \"wrappingIndent\";\n EditorOption[EditorOption[\"wrappingStrategy\"] = 137] = \"wrappingStrategy\";\n EditorOption[EditorOption[\"showDeprecated\"] = 138] = \"showDeprecated\";\n EditorOption[EditorOption[\"inlayHints\"] = 139] = \"inlayHints\";\n EditorOption[EditorOption[\"editorClassName\"] = 140] = \"editorClassName\";\n EditorOption[EditorOption[\"pixelRatio\"] = 141] = \"pixelRatio\";\n EditorOption[EditorOption[\"tabFocusMode\"] = 142] = \"tabFocusMode\";\n EditorOption[EditorOption[\"layoutInfo\"] = 143] = \"layoutInfo\";\n EditorOption[EditorOption[\"wrappingInfo\"] = 144] = \"wrappingInfo\";\n EditorOption[EditorOption[\"defaultColorDecorators\"] = 145] = \"defaultColorDecorators\";\n EditorOption[EditorOption[\"colorDecoratorsActivatedOn\"] = 146] = \"colorDecoratorsActivatedOn\";\n EditorOption[EditorOption[\"inlineCompletionsAccessibilityVerbose\"] = 147] = \"inlineCompletionsAccessibilityVerbose\";\n})(EditorOption || (EditorOption = {}));\n/**\n * End of line character preference.\n */\nexport var EndOfLinePreference;\n(function (EndOfLinePreference) {\n /**\n * Use the end of line character identified in the text buffer.\n */\n EndOfLinePreference[EndOfLinePreference[\"TextDefined\"] = 0] = \"TextDefined\";\n /**\n * Use line feed (\\n) as the end of line character.\n */\n EndOfLinePreference[EndOfLinePreference[\"LF\"] = 1] = \"LF\";\n /**\n * Use carriage return and line feed (\\r\\n) as the end of line character.\n */\n EndOfLinePreference[EndOfLinePreference[\"CRLF\"] = 2] = \"CRLF\";\n})(EndOfLinePreference || (EndOfLinePreference = {}));\n/**\n * End of line character preference.\n */\nexport var EndOfLineSequence;\n(function (EndOfLineSequence) {\n /**\n * Use line feed (\\n) as the end of line character.\n */\n EndOfLineSequence[EndOfLineSequence[\"LF\"] = 0] = \"LF\";\n /**\n * Use carriage return and line feed (\\r\\n) as the end of line character.\n */\n EndOfLineSequence[EndOfLineSequence[\"CRLF\"] = 1] = \"CRLF\";\n})(EndOfLineSequence || (EndOfLineSequence = {}));\n/**\n * Vertical Lane in the glyph margin of the editor.\n */\nexport var GlyphMarginLane;\n(function (GlyphMarginLane) {\n GlyphMarginLane[GlyphMarginLane[\"Left\"] = 1] = \"Left\";\n GlyphMarginLane[GlyphMarginLane[\"Center\"] = 2] = \"Center\";\n GlyphMarginLane[GlyphMarginLane[\"Right\"] = 3] = \"Right\";\n})(GlyphMarginLane || (GlyphMarginLane = {}));\n/**\n * Describes what to do with the indentation when pressing Enter.\n */\nexport var IndentAction;\n(function (IndentAction) {\n /**\n * Insert new line and copy the previous line's indentation.\n */\n IndentAction[IndentAction[\"None\"] = 0] = \"None\";\n /**\n * Insert new line and indent once (relative to the previous line's indentation).\n */\n IndentAction[IndentAction[\"Indent\"] = 1] = \"Indent\";\n /**\n * Insert two new lines:\n * - the first one indented which will hold the cursor\n * - the second one at the same indentation level\n */\n IndentAction[IndentAction[\"IndentOutdent\"] = 2] = \"IndentOutdent\";\n /**\n * Insert new line and outdent once (relative to the previous line's indentation).\n */\n IndentAction[IndentAction[\"Outdent\"] = 3] = \"Outdent\";\n})(IndentAction || (IndentAction = {}));\nexport var InjectedTextCursorStops;\n(function (InjectedTextCursorStops) {\n InjectedTextCursorStops[InjectedTextCursorStops[\"Both\"] = 0] = \"Both\";\n InjectedTextCursorStops[InjectedTextCursorStops[\"Right\"] = 1] = \"Right\";\n InjectedTextCursorStops[InjectedTextCursorStops[\"Left\"] = 2] = \"Left\";\n InjectedTextCursorStops[InjectedTextCursorStops[\"None\"] = 3] = \"None\";\n})(InjectedTextCursorStops || (InjectedTextCursorStops = {}));\nexport var InlayHintKind;\n(function (InlayHintKind) {\n InlayHintKind[InlayHintKind[\"Type\"] = 1] = \"Type\";\n InlayHintKind[InlayHintKind[\"Parameter\"] = 2] = \"Parameter\";\n})(InlayHintKind || (InlayHintKind = {}));\n/**\n * How an {@link InlineCompletionsProvider inline completion provider} was triggered.\n */\nexport var InlineCompletionTriggerKind;\n(function (InlineCompletionTriggerKind) {\n /**\n * Completion was triggered automatically while editing.\n * It is sufficient to return a single completion item in this case.\n */\n InlineCompletionTriggerKind[InlineCompletionTriggerKind[\"Automatic\"] = 0] = \"Automatic\";\n /**\n * Completion was triggered explicitly by a user gesture.\n * Return multiple completion items to enable cycling through them.\n */\n InlineCompletionTriggerKind[InlineCompletionTriggerKind[\"Explicit\"] = 1] = \"Explicit\";\n})(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));\n/**\n * Virtual Key Codes, the value does not hold any inherent meaning.\n * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\n * But these are \"more general\", as they should work across browsers & OS`s.\n */\nexport var KeyCode;\n(function (KeyCode) {\n KeyCode[KeyCode[\"DependsOnKbLayout\"] = -1] = \"DependsOnKbLayout\";\n /**\n * Placed first to cover the 0 value of the enum.\n */\n KeyCode[KeyCode[\"Unknown\"] = 0] = \"Unknown\";\n KeyCode[KeyCode[\"Backspace\"] = 1] = \"Backspace\";\n KeyCode[KeyCode[\"Tab\"] = 2] = \"Tab\";\n KeyCode[KeyCode[\"Enter\"] = 3] = \"Enter\";\n KeyCode[KeyCode[\"Shift\"] = 4] = \"Shift\";\n KeyCode[KeyCode[\"Ctrl\"] = 5] = \"Ctrl\";\n KeyCode[KeyCode[\"Alt\"] = 6] = \"Alt\";\n KeyCode[KeyCode[\"PauseBreak\"] = 7] = \"PauseBreak\";\n KeyCode[KeyCode[\"CapsLock\"] = 8] = \"CapsLock\";\n KeyCode[KeyCode[\"Escape\"] = 9] = \"Escape\";\n KeyCode[KeyCode[\"Space\"] = 10] = \"Space\";\n KeyCode[KeyCode[\"PageUp\"] = 11] = \"PageUp\";\n KeyCode[KeyCode[\"PageDown\"] = 12] = \"PageDown\";\n KeyCode[KeyCode[\"End\"] = 13] = \"End\";\n KeyCode[KeyCode[\"Home\"] = 14] = \"Home\";\n KeyCode[KeyCode[\"LeftArrow\"] = 15] = \"LeftArrow\";\n KeyCode[KeyCode[\"UpArrow\"] = 16] = \"UpArrow\";\n KeyCode[KeyCode[\"RightArrow\"] = 17] = \"RightArrow\";\n KeyCode[KeyCode[\"DownArrow\"] = 18] = \"DownArrow\";\n KeyCode[KeyCode[\"Insert\"] = 19] = \"Insert\";\n KeyCode[KeyCode[\"Delete\"] = 20] = \"Delete\";\n KeyCode[KeyCode[\"Digit0\"] = 21] = \"Digit0\";\n KeyCode[KeyCode[\"Digit1\"] = 22] = \"Digit1\";\n KeyCode[KeyCode[\"Digit2\"] = 23] = \"Digit2\";\n KeyCode[KeyCode[\"Digit3\"] = 24] = \"Digit3\";\n KeyCode[KeyCode[\"Digit4\"] = 25] = \"Digit4\";\n KeyCode[KeyCode[\"Digit5\"] = 26] = \"Digit5\";\n KeyCode[KeyCode[\"Digit6\"] = 27] = \"Digit6\";\n KeyCode[KeyCode[\"Digit7\"] = 28] = \"Digit7\";\n KeyCode[KeyCode[\"Digit8\"] = 29] = \"Digit8\";\n KeyCode[KeyCode[\"Digit9\"] = 30] = \"Digit9\";\n KeyCode[KeyCode[\"KeyA\"] = 31] = \"KeyA\";\n KeyCode[KeyCode[\"KeyB\"] = 32] = \"KeyB\";\n KeyCode[KeyCode[\"KeyC\"] = 33] = \"KeyC\";\n KeyCode[KeyCode[\"KeyD\"] = 34] = \"KeyD\";\n KeyCode[KeyCode[\"KeyE\"] = 35] = \"KeyE\";\n KeyCode[KeyCode[\"KeyF\"] = 36] = \"KeyF\";\n KeyCode[KeyCode[\"KeyG\"] = 37] = \"KeyG\";\n KeyCode[KeyCode[\"KeyH\"] = 38] = \"KeyH\";\n KeyCode[KeyCode[\"KeyI\"] = 39] = \"KeyI\";\n KeyCode[KeyCode[\"KeyJ\"] = 40] = \"KeyJ\";\n KeyCode[KeyCode[\"KeyK\"] = 41] = \"KeyK\";\n KeyCode[KeyCode[\"KeyL\"] = 42] = \"KeyL\";\n KeyCode[KeyCode[\"KeyM\"] = 43] = \"KeyM\";\n KeyCode[KeyCode[\"KeyN\"] = 44] = \"KeyN\";\n KeyCode[KeyCode[\"KeyO\"] = 45] = \"KeyO\";\n KeyCode[KeyCode[\"KeyP\"] = 46] = \"KeyP\";\n KeyCode[KeyCode[\"KeyQ\"] = 47] = \"KeyQ\";\n KeyCode[KeyCode[\"KeyR\"] = 48] = \"KeyR\";\n KeyCode[KeyCode[\"KeyS\"] = 49] = \"KeyS\";\n KeyCode[KeyCode[\"KeyT\"] = 50] = \"KeyT\";\n KeyCode[KeyCode[\"KeyU\"] = 51] = \"KeyU\";\n KeyCode[KeyCode[\"KeyV\"] = 52] = \"KeyV\";\n KeyCode[KeyCode[\"KeyW\"] = 53] = \"KeyW\";\n KeyCode[KeyCode[\"KeyX\"] = 54] = \"KeyX\";\n KeyCode[KeyCode[\"KeyY\"] = 55] = \"KeyY\";\n KeyCode[KeyCode[\"KeyZ\"] = 56] = \"KeyZ\";\n KeyCode[KeyCode[\"Meta\"] = 57] = \"Meta\";\n KeyCode[KeyCode[\"ContextMenu\"] = 58] = \"ContextMenu\";\n KeyCode[KeyCode[\"F1\"] = 59] = \"F1\";\n KeyCode[KeyCode[\"F2\"] = 60] = \"F2\";\n KeyCode[KeyCode[\"F3\"] = 61] = \"F3\";\n KeyCode[KeyCode[\"F4\"] = 62] = \"F4\";\n KeyCode[KeyCode[\"F5\"] = 63] = \"F5\";\n KeyCode[KeyCode[\"F6\"] = 64] = \"F6\";\n KeyCode[KeyCode[\"F7\"] = 65] = \"F7\";\n KeyCode[KeyCode[\"F8\"] = 66] = \"F8\";\n KeyCode[KeyCode[\"F9\"] = 67] = \"F9\";\n KeyCode[KeyCode[\"F10\"] = 68] = \"F10\";\n KeyCode[KeyCode[\"F11\"] = 69] = \"F11\";\n KeyCode[KeyCode[\"F12\"] = 70] = \"F12\";\n KeyCode[KeyCode[\"F13\"] = 71] = \"F13\";\n KeyCode[KeyCode[\"F14\"] = 72] = \"F14\";\n KeyCode[KeyCode[\"F15\"] = 73] = \"F15\";\n KeyCode[KeyCode[\"F16\"] = 74] = \"F16\";\n KeyCode[KeyCode[\"F17\"] = 75] = \"F17\";\n KeyCode[KeyCode[\"F18\"] = 76] = \"F18\";\n KeyCode[KeyCode[\"F19\"] = 77] = \"F19\";\n KeyCode[KeyCode[\"F20\"] = 78] = \"F20\";\n KeyCode[KeyCode[\"F21\"] = 79] = \"F21\";\n KeyCode[KeyCode[\"F22\"] = 80] = \"F22\";\n KeyCode[KeyCode[\"F23\"] = 81] = \"F23\";\n KeyCode[KeyCode[\"F24\"] = 82] = \"F24\";\n KeyCode[KeyCode[\"NumLock\"] = 83] = \"NumLock\";\n KeyCode[KeyCode[\"ScrollLock\"] = 84] = \"ScrollLock\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the ';:' key\n */\n KeyCode[KeyCode[\"Semicolon\"] = 85] = \"Semicolon\";\n /**\n * For any country/region, the '+' key\n * For the US standard keyboard, the '=+' key\n */\n KeyCode[KeyCode[\"Equal\"] = 86] = \"Equal\";\n /**\n * For any country/region, the ',' key\n * For the US standard keyboard, the ',<' key\n */\n KeyCode[KeyCode[\"Comma\"] = 87] = \"Comma\";\n /**\n * For any country/region, the '-' key\n * For the US standard keyboard, the '-_' key\n */\n KeyCode[KeyCode[\"Minus\"] = 88] = \"Minus\";\n /**\n * For any country/region, the '.' key\n * For the US standard keyboard, the '.>' key\n */\n KeyCode[KeyCode[\"Period\"] = 89] = \"Period\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the '/?' key\n */\n KeyCode[KeyCode[\"Slash\"] = 90] = \"Slash\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the '`~' key\n */\n KeyCode[KeyCode[\"Backquote\"] = 91] = \"Backquote\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the '[{' key\n */\n KeyCode[KeyCode[\"BracketLeft\"] = 92] = \"BracketLeft\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the '\\|' key\n */\n KeyCode[KeyCode[\"Backslash\"] = 93] = \"Backslash\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the ']}' key\n */\n KeyCode[KeyCode[\"BracketRight\"] = 94] = \"BracketRight\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n * For the US standard keyboard, the ''\"' key\n */\n KeyCode[KeyCode[\"Quote\"] = 95] = \"Quote\";\n /**\n * Used for miscellaneous characters; it can vary by keyboard.\n */\n KeyCode[KeyCode[\"OEM_8\"] = 96] = \"OEM_8\";\n /**\n * Either the angle bracket key or the backslash key on the RT 102-key keyboard.\n */\n KeyCode[KeyCode[\"IntlBackslash\"] = 97] = \"IntlBackslash\";\n KeyCode[KeyCode[\"Numpad0\"] = 98] = \"Numpad0\";\n KeyCode[KeyCode[\"Numpad1\"] = 99] = \"Numpad1\";\n KeyCode[KeyCode[\"Numpad2\"] = 100] = \"Numpad2\";\n KeyCode[KeyCode[\"Numpad3\"] = 101] = \"Numpad3\";\n KeyCode[KeyCode[\"Numpad4\"] = 102] = \"Numpad4\";\n KeyCode[KeyCode[\"Numpad5\"] = 103] = \"Numpad5\";\n KeyCode[KeyCode[\"Numpad6\"] = 104] = \"Numpad6\";\n KeyCode[KeyCode[\"Numpad7\"] = 105] = \"Numpad7\";\n KeyCode[KeyCode[\"Numpad8\"] = 106] = \"Numpad8\";\n KeyCode[KeyCode[\"Numpad9\"] = 107] = \"Numpad9\";\n KeyCode[KeyCode[\"NumpadMultiply\"] = 108] = \"NumpadMultiply\";\n KeyCode[KeyCode[\"NumpadAdd\"] = 109] = \"NumpadAdd\";\n KeyCode[KeyCode[\"NUMPAD_SEPARATOR\"] = 110] = \"NUMPAD_SEPARATOR\";\n KeyCode[KeyCode[\"NumpadSubtract\"] = 111] = \"NumpadSubtract\";\n KeyCode[KeyCode[\"NumpadDecimal\"] = 112] = \"NumpadDecimal\";\n KeyCode[KeyCode[\"NumpadDivide\"] = 113] = \"NumpadDivide\";\n /**\n * Cover all key codes when IME is processing input.\n */\n KeyCode[KeyCode[\"KEY_IN_COMPOSITION\"] = 114] = \"KEY_IN_COMPOSITION\";\n KeyCode[KeyCode[\"ABNT_C1\"] = 115] = \"ABNT_C1\";\n KeyCode[KeyCode[\"ABNT_C2\"] = 116] = \"ABNT_C2\";\n KeyCode[KeyCode[\"AudioVolumeMute\"] = 117] = \"AudioVolumeMute\";\n KeyCode[KeyCode[\"AudioVolumeUp\"] = 118] = \"AudioVolumeUp\";\n KeyCode[KeyCode[\"AudioVolumeDown\"] = 119] = \"AudioVolumeDown\";\n KeyCode[KeyCode[\"BrowserSearch\"] = 120] = \"BrowserSearch\";\n KeyCode[KeyCode[\"BrowserHome\"] = 121] = \"BrowserHome\";\n KeyCode[KeyCode[\"BrowserBack\"] = 122] = \"BrowserBack\";\n KeyCode[KeyCode[\"BrowserForward\"] = 123] = \"BrowserForward\";\n KeyCode[KeyCode[\"MediaTrackNext\"] = 124] = \"MediaTrackNext\";\n KeyCode[KeyCode[\"MediaTrackPrevious\"] = 125] = \"MediaTrackPrevious\";\n KeyCode[KeyCode[\"MediaStop\"] = 126] = \"MediaStop\";\n KeyCode[KeyCode[\"MediaPlayPause\"] = 127] = \"MediaPlayPause\";\n KeyCode[KeyCode[\"LaunchMediaPlayer\"] = 128] = \"LaunchMediaPlayer\";\n KeyCode[KeyCode[\"LaunchMail\"] = 129] = \"LaunchMail\";\n KeyCode[KeyCode[\"LaunchApp2\"] = 130] = \"LaunchApp2\";\n /**\n * VK_CLEAR, 0x0C, CLEAR key\n */\n KeyCode[KeyCode[\"Clear\"] = 131] = \"Clear\";\n /**\n * Placed last to cover the length of the enum.\n * Please do not depend on this value!\n */\n KeyCode[KeyCode[\"MAX_VALUE\"] = 132] = \"MAX_VALUE\";\n})(KeyCode || (KeyCode = {}));\nexport var MarkerSeverity;\n(function (MarkerSeverity) {\n MarkerSeverity[MarkerSeverity[\"Hint\"] = 1] = \"Hint\";\n MarkerSeverity[MarkerSeverity[\"Info\"] = 2] = \"Info\";\n MarkerSeverity[MarkerSeverity[\"Warning\"] = 4] = \"Warning\";\n MarkerSeverity[MarkerSeverity[\"Error\"] = 8] = \"Error\";\n})(MarkerSeverity || (MarkerSeverity = {}));\nexport var MarkerTag;\n(function (MarkerTag) {\n MarkerTag[MarkerTag[\"Unnecessary\"] = 1] = \"Unnecessary\";\n MarkerTag[MarkerTag[\"Deprecated\"] = 2] = \"Deprecated\";\n})(MarkerTag || (MarkerTag = {}));\n/**\n * Position in the minimap to render the decoration.\n */\nexport var MinimapPosition;\n(function (MinimapPosition) {\n MinimapPosition[MinimapPosition[\"Inline\"] = 1] = \"Inline\";\n MinimapPosition[MinimapPosition[\"Gutter\"] = 2] = \"Gutter\";\n})(MinimapPosition || (MinimapPosition = {}));\n/**\n * Type of hit element with the mouse in the editor.\n */\nexport var MouseTargetType;\n(function (MouseTargetType) {\n /**\n * Mouse is on top of an unknown element.\n */\n MouseTargetType[MouseTargetType[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /**\n * Mouse is on top of the textarea used for input.\n */\n MouseTargetType[MouseTargetType[\"TEXTAREA\"] = 1] = \"TEXTAREA\";\n /**\n * Mouse is on top of the glyph margin\n */\n MouseTargetType[MouseTargetType[\"GUTTER_GLYPH_MARGIN\"] = 2] = \"GUTTER_GLYPH_MARGIN\";\n /**\n * Mouse is on top of the line numbers\n */\n MouseTargetType[MouseTargetType[\"GUTTER_LINE_NUMBERS\"] = 3] = \"GUTTER_LINE_NUMBERS\";\n /**\n * Mouse is on top of the line decorations\n */\n MouseTargetType[MouseTargetType[\"GUTTER_LINE_DECORATIONS\"] = 4] = \"GUTTER_LINE_DECORATIONS\";\n /**\n * Mouse is on top of the whitespace left in the gutter by a view zone.\n */\n MouseTargetType[MouseTargetType[\"GUTTER_VIEW_ZONE\"] = 5] = \"GUTTER_VIEW_ZONE\";\n /**\n * Mouse is on top of text in the content.\n */\n MouseTargetType[MouseTargetType[\"CONTENT_TEXT\"] = 6] = \"CONTENT_TEXT\";\n /**\n * Mouse is on top of empty space in the content (e.g. after line text or below last line)\n */\n MouseTargetType[MouseTargetType[\"CONTENT_EMPTY\"] = 7] = \"CONTENT_EMPTY\";\n /**\n * Mouse is on top of a view zone in the content.\n */\n MouseTargetType[MouseTargetType[\"CONTENT_VIEW_ZONE\"] = 8] = \"CONTENT_VIEW_ZONE\";\n /**\n * Mouse is on top of a content widget.\n */\n MouseTargetType[MouseTargetType[\"CONTENT_WIDGET\"] = 9] = \"CONTENT_WIDGET\";\n /**\n * Mouse is on top of the decorations overview ruler.\n */\n MouseTargetType[MouseTargetType[\"OVERVIEW_RULER\"] = 10] = \"OVERVIEW_RULER\";\n /**\n * Mouse is on top of a scrollbar.\n */\n MouseTargetType[MouseTargetType[\"SCROLLBAR\"] = 11] = \"SCROLLBAR\";\n /**\n * Mouse is on top of an overlay widget.\n */\n MouseTargetType[MouseTargetType[\"OVERLAY_WIDGET\"] = 12] = \"OVERLAY_WIDGET\";\n /**\n * Mouse is outside of the editor.\n */\n MouseTargetType[MouseTargetType[\"OUTSIDE_EDITOR\"] = 13] = \"OUTSIDE_EDITOR\";\n})(MouseTargetType || (MouseTargetType = {}));\n/**\n * A positioning preference for rendering overlay widgets.\n */\nexport var OverlayWidgetPositionPreference;\n(function (OverlayWidgetPositionPreference) {\n /**\n * Position the overlay widget in the top right corner\n */\n OverlayWidgetPositionPreference[OverlayWidgetPositionPreference[\"TOP_RIGHT_CORNER\"] = 0] = \"TOP_RIGHT_CORNER\";\n /**\n * Position the overlay widget in the bottom right corner\n */\n OverlayWidgetPositionPreference[OverlayWidgetPositionPreference[\"BOTTOM_RIGHT_CORNER\"] = 1] = \"BOTTOM_RIGHT_CORNER\";\n /**\n * Position the overlay widget in the top center\n */\n OverlayWidgetPositionPreference[OverlayWidgetPositionPreference[\"TOP_CENTER\"] = 2] = \"TOP_CENTER\";\n})(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {}));\n/**\n * Vertical Lane in the overview ruler of the editor.\n */\nexport var OverviewRulerLane;\n(function (OverviewRulerLane) {\n OverviewRulerLane[OverviewRulerLane[\"Left\"] = 1] = \"Left\";\n OverviewRulerLane[OverviewRulerLane[\"Center\"] = 2] = \"Center\";\n OverviewRulerLane[OverviewRulerLane[\"Right\"] = 4] = \"Right\";\n OverviewRulerLane[OverviewRulerLane[\"Full\"] = 7] = \"Full\";\n})(OverviewRulerLane || (OverviewRulerLane = {}));\nexport var PositionAffinity;\n(function (PositionAffinity) {\n /**\n * Prefers the left most position.\n */\n PositionAffinity[PositionAffinity[\"Left\"] = 0] = \"Left\";\n /**\n * Prefers the right most position.\n */\n PositionAffinity[PositionAffinity[\"Right\"] = 1] = \"Right\";\n /**\n * No preference.\n */\n PositionAffinity[PositionAffinity[\"None\"] = 2] = \"None\";\n /**\n * If the given position is on injected text, prefers the position left of it.\n */\n PositionAffinity[PositionAffinity[\"LeftOfInjectedText\"] = 3] = \"LeftOfInjectedText\";\n /**\n * If the given position is on injected text, prefers the position right of it.\n */\n PositionAffinity[PositionAffinity[\"RightOfInjectedText\"] = 4] = \"RightOfInjectedText\";\n})(PositionAffinity || (PositionAffinity = {}));\nexport var RenderLineNumbersType;\n(function (RenderLineNumbersType) {\n RenderLineNumbersType[RenderLineNumbersType[\"Off\"] = 0] = \"Off\";\n RenderLineNumbersType[RenderLineNumbersType[\"On\"] = 1] = \"On\";\n RenderLineNumbersType[RenderLineNumbersType[\"Relative\"] = 2] = \"Relative\";\n RenderLineNumbersType[RenderLineNumbersType[\"Interval\"] = 3] = \"Interval\";\n RenderLineNumbersType[RenderLineNumbersType[\"Custom\"] = 4] = \"Custom\";\n})(RenderLineNumbersType || (RenderLineNumbersType = {}));\nexport var RenderMinimap;\n(function (RenderMinimap) {\n RenderMinimap[RenderMinimap[\"None\"] = 0] = \"None\";\n RenderMinimap[RenderMinimap[\"Text\"] = 1] = \"Text\";\n RenderMinimap[RenderMinimap[\"Blocks\"] = 2] = \"Blocks\";\n})(RenderMinimap || (RenderMinimap = {}));\nexport var ScrollType;\n(function (ScrollType) {\n ScrollType[ScrollType[\"Smooth\"] = 0] = \"Smooth\";\n ScrollType[ScrollType[\"Immediate\"] = 1] = \"Immediate\";\n})(ScrollType || (ScrollType = {}));\nexport var ScrollbarVisibility;\n(function (ScrollbarVisibility) {\n ScrollbarVisibility[ScrollbarVisibility[\"Auto\"] = 1] = \"Auto\";\n ScrollbarVisibility[ScrollbarVisibility[\"Hidden\"] = 2] = \"Hidden\";\n ScrollbarVisibility[ScrollbarVisibility[\"Visible\"] = 3] = \"Visible\";\n})(ScrollbarVisibility || (ScrollbarVisibility = {}));\n/**\n * The direction of a selection.\n */\nexport var SelectionDirection;\n(function (SelectionDirection) {\n /**\n * The selection starts above where it ends.\n */\n SelectionDirection[SelectionDirection[\"LTR\"] = 0] = \"LTR\";\n /**\n * The selection starts below where it ends.\n */\n SelectionDirection[SelectionDirection[\"RTL\"] = 1] = \"RTL\";\n})(SelectionDirection || (SelectionDirection = {}));\nexport var ShowLightbulbIconMode;\n(function (ShowLightbulbIconMode) {\n ShowLightbulbIconMode[\"Off\"] = \"off\";\n ShowLightbulbIconMode[\"OnCode\"] = \"onCode\";\n ShowLightbulbIconMode[\"On\"] = \"on\";\n})(ShowLightbulbIconMode || (ShowLightbulbIconMode = {}));\nexport var SignatureHelpTriggerKind;\n(function (SignatureHelpTriggerKind) {\n SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"Invoke\"] = 1] = \"Invoke\";\n SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"TriggerCharacter\"] = 2] = \"TriggerCharacter\";\n SignatureHelpTriggerKind[SignatureHelpTriggerKind[\"ContentChange\"] = 3] = \"ContentChange\";\n})(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {}));\n/**\n * A symbol kind.\n */\nexport var SymbolKind;\n(function (SymbolKind) {\n SymbolKind[SymbolKind[\"File\"] = 0] = \"File\";\n SymbolKind[SymbolKind[\"Module\"] = 1] = \"Module\";\n SymbolKind[SymbolKind[\"Namespace\"] = 2] = \"Namespace\";\n SymbolKind[SymbolKind[\"Package\"] = 3] = \"Package\";\n SymbolKind[SymbolKind[\"Class\"] = 4] = \"Class\";\n SymbolKind[SymbolKind[\"Method\"] = 5] = \"Method\";\n SymbolKind[SymbolKind[\"Property\"] = 6] = \"Property\";\n SymbolKind[SymbolKind[\"Field\"] = 7] = \"Field\";\n SymbolKind[SymbolKind[\"Constructor\"] = 8] = \"Constructor\";\n SymbolKind[SymbolKind[\"Enum\"] = 9] = \"Enum\";\n SymbolKind[SymbolKind[\"Interface\"] = 10] = \"Interface\";\n SymbolKind[SymbolKind[\"Function\"] = 11] = \"Function\";\n SymbolKind[SymbolKind[\"Variable\"] = 12] = \"Variable\";\n SymbolKind[SymbolKind[\"Constant\"] = 13] = \"Constant\";\n SymbolKind[SymbolKind[\"String\"] = 14] = \"String\";\n SymbolKind[SymbolKind[\"Number\"] = 15] = \"Number\";\n SymbolKind[SymbolKind[\"Boolean\"] = 16] = \"Boolean\";\n SymbolKind[SymbolKind[\"Array\"] = 17] = \"Array\";\n SymbolKind[SymbolKind[\"Object\"] = 18] = \"Object\";\n SymbolKind[SymbolKind[\"Key\"] = 19] = \"Key\";\n SymbolKind[SymbolKind[\"Null\"] = 20] = \"Null\";\n SymbolKind[SymbolKind[\"EnumMember\"] = 21] = \"EnumMember\";\n SymbolKind[SymbolKind[\"Struct\"] = 22] = \"Struct\";\n SymbolKind[SymbolKind[\"Event\"] = 23] = \"Event\";\n SymbolKind[SymbolKind[\"Operator\"] = 24] = \"Operator\";\n SymbolKind[SymbolKind[\"TypeParameter\"] = 25] = \"TypeParameter\";\n})(SymbolKind || (SymbolKind = {}));\nexport var SymbolTag;\n(function (SymbolTag) {\n SymbolTag[SymbolTag[\"Deprecated\"] = 1] = \"Deprecated\";\n})(SymbolTag || (SymbolTag = {}));\n/**\n * The kind of animation in which the editor's cursor should be rendered.\n */\nexport var TextEditorCursorBlinkingStyle;\n(function (TextEditorCursorBlinkingStyle) {\n /**\n * Hidden\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Hidden\"] = 0] = \"Hidden\";\n /**\n * Blinking\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Blink\"] = 1] = \"Blink\";\n /**\n * Blinking with smooth fading\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Smooth\"] = 2] = \"Smooth\";\n /**\n * Blinking with prolonged filled state and smooth fading\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Phase\"] = 3] = \"Phase\";\n /**\n * Expand collapse animation on the y axis\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Expand\"] = 4] = \"Expand\";\n /**\n * No-Blinking\n */\n TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle[\"Solid\"] = 5] = \"Solid\";\n})(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {}));\n/**\n * The style in which the editor's cursor should be rendered.\n */\nexport var TextEditorCursorStyle;\n(function (TextEditorCursorStyle) {\n /**\n * As a vertical line (sitting between two characters).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"Line\"] = 1] = \"Line\";\n /**\n * As a block (sitting on top of a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"Block\"] = 2] = \"Block\";\n /**\n * As a horizontal line (sitting under a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"Underline\"] = 3] = \"Underline\";\n /**\n * As a thin vertical line (sitting between two characters).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"LineThin\"] = 4] = \"LineThin\";\n /**\n * As an outlined block (sitting on top of a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"BlockOutline\"] = 5] = \"BlockOutline\";\n /**\n * As a thin horizontal line (sitting under a character).\n */\n TextEditorCursorStyle[TextEditorCursorStyle[\"UnderlineThin\"] = 6] = \"UnderlineThin\";\n})(TextEditorCursorStyle || (TextEditorCursorStyle = {}));\n/**\n * Describes the behavior of decorations when typing/editing near their edges.\n * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior`\n */\nexport var TrackedRangeStickiness;\n(function (TrackedRangeStickiness) {\n TrackedRangeStickiness[TrackedRangeStickiness[\"AlwaysGrowsWhenTypingAtEdges\"] = 0] = \"AlwaysGrowsWhenTypingAtEdges\";\n TrackedRangeStickiness[TrackedRangeStickiness[\"NeverGrowsWhenTypingAtEdges\"] = 1] = \"NeverGrowsWhenTypingAtEdges\";\n TrackedRangeStickiness[TrackedRangeStickiness[\"GrowsOnlyWhenTypingBefore\"] = 2] = \"GrowsOnlyWhenTypingBefore\";\n TrackedRangeStickiness[TrackedRangeStickiness[\"GrowsOnlyWhenTypingAfter\"] = 3] = \"GrowsOnlyWhenTypingAfter\";\n})(TrackedRangeStickiness || (TrackedRangeStickiness = {}));\n/**\n * Describes how to indent wrapped lines.\n */\nexport var WrappingIndent;\n(function (WrappingIndent) {\n /**\n * No indentation => wrapped lines begin at column 1.\n */\n WrappingIndent[WrappingIndent[\"None\"] = 0] = \"None\";\n /**\n * Same => wrapped lines get the same indentation as the parent.\n */\n WrappingIndent[WrappingIndent[\"Same\"] = 1] = \"Same\";\n /**\n * Indent => wrapped lines get +1 indentation toward the parent.\n */\n WrappingIndent[WrappingIndent[\"Indent\"] = 2] = \"Indent\";\n /**\n * DeepIndent => wrapped lines get +2 indentation toward the parent.\n */\n WrappingIndent[WrappingIndent[\"DeepIndent\"] = 3] = \"DeepIndent\";\n})(WrappingIndent || (WrappingIndent = {}));\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { CancellationTokenSource } from '../../../base/common/cancellation.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { KeyChord } from '../../../base/common/keyCodes.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { Position } from '../core/position.js';\nimport { Range } from '../core/range.js';\nimport { Selection } from '../core/selection.js';\nimport { Token } from '../languages.js';\nimport * as standaloneEnums from '../standalone/standaloneEnums.js';\nexport class KeyMod {\n static chord(firstPart, secondPart) {\n return KeyChord(firstPart, secondPart);\n }\n}\nKeyMod.CtrlCmd = 2048 /* ConstKeyMod.CtrlCmd */;\nKeyMod.Shift = 1024 /* ConstKeyMod.Shift */;\nKeyMod.Alt = 512 /* ConstKeyMod.Alt */;\nKeyMod.WinCtrl = 256 /* ConstKeyMod.WinCtrl */;\nexport function createMonacoBaseAPI() {\n return {\n editor: undefined, // undefined override expected here\n languages: undefined, // undefined override expected here\n CancellationTokenSource: CancellationTokenSource,\n Emitter: Emitter,\n KeyCode: standaloneEnums.KeyCode,\n KeyMod: KeyMod,\n Position: Position,\n Range: Range,\n Selection: Selection,\n SelectionDirection: standaloneEnums.SelectionDirection,\n MarkerSeverity: standaloneEnums.MarkerSeverity,\n MarkerTag: standaloneEnums.MarkerTag,\n Uri: URI,\n Token: Token\n };\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport function ensureCodeWindow(targetWindow, fallbackWindowId) {\n const codeWindow = targetWindow;\n if (typeof codeWindow.vscodeWindowId !== 'number') {\n Object.defineProperty(codeWindow, 'vscodeWindowId', {\n get: () => fallbackWindowId\n });\n }\n}\n// eslint-disable-next-line no-restricted-globals\nexport const mainWindow = window;\n/**\n * @deprecated to support multi-window scenarios, use `DOM.mainWindow`\n * if you target the main global window or use helpers such as `DOM.getWindow()`\n * or `DOM.getActiveWindow()` to obtain the correct window for the context you are in.\n */\nexport const $window = mainWindow;\n", "/**\n * Uses a LRU cache to make a given parametrized function cached.\n * Caches just the last value.\n * The key must be JSON serializable.\n*/\nexport class LRUCachedFunction {\n constructor(fn) {\n this.fn = fn;\n this.lastCache = undefined;\n this.lastArgKey = undefined;\n }\n get(arg) {\n const key = JSON.stringify(arg);\n if (this.lastArgKey !== key) {\n this.lastArgKey = key;\n this.lastCache = this.fn(arg);\n }\n return this.lastCache;\n }\n}\n/**\n * Uses an unbounded cache (referential equality) to memoize the results of the given function.\n*/\nexport class CachedFunction {\n get cachedValues() {\n return this._map;\n }\n constructor(fn) {\n this.fn = fn;\n this._map = new Map();\n }\n get(arg) {\n if (this._map.has(arg)) {\n return this._map.get(arg);\n }\n const value = this.fn(arg);\n this._map.set(arg, value);\n return value;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class Lazy {\n constructor(executor) {\n this.executor = executor;\n this._didRun = false;\n }\n /**\n * Get the wrapped value.\n *\n * This will force evaluation of the lazy value if it has not been resolved yet. Lazy values are only\n * resolved once. `getValue` will re-throw exceptions that are hit while resolving the value\n */\n get value() {\n if (!this._didRun) {\n try {\n this._value = this.executor();\n }\n catch (err) {\n this._error = err;\n }\n finally {\n this._didRun = true;\n }\n }\n if (this._error) {\n throw this._error;\n }\n return this._value;\n }\n /**\n * Get the wrapped value without forcing evaluation.\n */\n get rawValue() { return this._value; }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar _a;\nimport { LRUCachedFunction } from './cache.js';\nimport { Lazy } from './lazy.js';\nexport function isFalsyOrWhitespace(str) {\n if (!str || typeof str !== 'string') {\n return true;\n }\n return str.trim().length === 0;\n}\nconst _formatRegexp = /{(\\d+)}/g;\n/**\n * Helper to produce a string with a variable number of arguments. Insert variable segments\n * into the string using the {n} notation where N is the index of the argument following the string.\n * @param value string to which formatting is applied\n * @param args replacements for {n}-entries\n */\nexport function format(value, ...args) {\n if (args.length === 0) {\n return value;\n }\n return value.replace(_formatRegexp, function (match, group) {\n const idx = parseInt(group, 10);\n return isNaN(idx) || idx < 0 || idx >= args.length ?\n match :\n args[idx];\n });\n}\n/**\n * Encodes the given value so that it can be used as literal value in html attributes.\n *\n * In other words, computes `$val`, such that `attr` in `
` has the runtime value `value`.\n * This prevents XSS injection.\n */\nexport function htmlAttributeEncodeValue(value) {\n return value.replace(/[<>\"'&]/g, ch => {\n switch (ch) {\n case '<': return '<';\n case '>': return '>';\n case '\"': return '"';\n case '\\'': return ''';\n case '&': return '&';\n }\n return ch;\n });\n}\n/**\n * Converts HTML characters inside the string to use entities instead. Makes the string safe from\n * being used e.g. in HTMLElement.innerHTML.\n */\nexport function escape(html) {\n return html.replace(/[<>&]/g, function (match) {\n switch (match) {\n case '<': return '<';\n case '>': return '>';\n case '&': return '&';\n default: return match;\n }\n });\n}\n/**\n * Escapes regular expression characters in a given string\n */\nexport function escapeRegExpCharacters(value) {\n return value.replace(/[\\\\\\{\\}\\*\\+\\?\\|\\^\\$\\.\\[\\]\\(\\)]/g, '\\\\$&');\n}\n/**\n * Removes all occurrences of needle from the beginning and end of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim (default is a blank)\n */\nexport function trim(haystack, needle = ' ') {\n const trimmed = ltrim(haystack, needle);\n return rtrim(trimmed, needle);\n}\n/**\n * Removes all occurrences of needle from the beginning of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim\n */\nexport function ltrim(haystack, needle) {\n if (!haystack || !needle) {\n return haystack;\n }\n const needleLen = needle.length;\n if (needleLen === 0 || haystack.length === 0) {\n return haystack;\n }\n let offset = 0;\n while (haystack.indexOf(needle, offset) === offset) {\n offset = offset + needleLen;\n }\n return haystack.substring(offset);\n}\n/**\n * Removes all occurrences of needle from the end of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim\n */\nexport function rtrim(haystack, needle) {\n if (!haystack || !needle) {\n return haystack;\n }\n const needleLen = needle.length, haystackLen = haystack.length;\n if (needleLen === 0 || haystackLen === 0) {\n return haystack;\n }\n let offset = haystackLen, idx = -1;\n while (true) {\n idx = haystack.lastIndexOf(needle, offset - 1);\n if (idx === -1 || idx + needleLen !== offset) {\n break;\n }\n if (idx === 0) {\n return '';\n }\n offset = idx;\n }\n return haystack.substring(0, offset);\n}\nexport function convertSimple2RegExpPattern(pattern) {\n return pattern.replace(/[\\-\\\\\\{\\}\\+\\?\\|\\^\\$\\.\\,\\[\\]\\(\\)\\#\\s]/g, '\\\\$&').replace(/[\\*]/g, '.*');\n}\nexport function stripWildcards(pattern) {\n return pattern.replace(/\\*/g, '');\n}\nexport function createRegExp(searchString, isRegex, options = {}) {\n if (!searchString) {\n throw new Error('Cannot create regex from empty string');\n }\n if (!isRegex) {\n searchString = escapeRegExpCharacters(searchString);\n }\n if (options.wholeWord) {\n if (!/\\B/.test(searchString.charAt(0))) {\n searchString = '\\\\b' + searchString;\n }\n if (!/\\B/.test(searchString.charAt(searchString.length - 1))) {\n searchString = searchString + '\\\\b';\n }\n }\n let modifiers = '';\n if (options.global) {\n modifiers += 'g';\n }\n if (!options.matchCase) {\n modifiers += 'i';\n }\n if (options.multiline) {\n modifiers += 'm';\n }\n if (options.unicode) {\n modifiers += 'u';\n }\n return new RegExp(searchString, modifiers);\n}\nexport function regExpLeadsToEndlessLoop(regexp) {\n // Exit early if it's one of these special cases which are meant to match\n // against an empty string\n if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\\\s*$') {\n return false;\n }\n // We check against an empty string. If the regular expression doesn't advance\n // (e.g. ends in an endless loop) it will match an empty string.\n const match = regexp.exec('');\n return !!(match && regexp.lastIndex === 0);\n}\nexport function splitLines(str) {\n return str.split(/\\r\\n|\\r|\\n/);\n}\n/**\n * Returns first index of the string that is not whitespace.\n * If string is empty or contains only whitespaces, returns -1\n */\nexport function firstNonWhitespaceIndex(str) {\n for (let i = 0, len = str.length; i < len; i++) {\n const chCode = str.charCodeAt(i);\n if (chCode !== 32 /* CharCode.Space */ && chCode !== 9 /* CharCode.Tab */) {\n return i;\n }\n }\n return -1;\n}\n/**\n * Returns the leading whitespace of the string.\n * If the string contains only whitespaces, returns entire string\n */\nexport function getLeadingWhitespace(str, start = 0, end = str.length) {\n for (let i = start; i < end; i++) {\n const chCode = str.charCodeAt(i);\n if (chCode !== 32 /* CharCode.Space */ && chCode !== 9 /* CharCode.Tab */) {\n return str.substring(start, i);\n }\n }\n return str.substring(start, end);\n}\n/**\n * Returns last index of the string that is not whitespace.\n * If string is empty or contains only whitespaces, returns -1\n */\nexport function lastNonWhitespaceIndex(str, startIndex = str.length - 1) {\n for (let i = startIndex; i >= 0; i--) {\n const chCode = str.charCodeAt(i);\n if (chCode !== 32 /* CharCode.Space */ && chCode !== 9 /* CharCode.Tab */) {\n return i;\n }\n }\n return -1;\n}\nexport function compare(a, b) {\n if (a < b) {\n return -1;\n }\n else if (a > b) {\n return 1;\n }\n else {\n return 0;\n }\n}\nexport function compareSubstring(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) {\n for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {\n const codeA = a.charCodeAt(aStart);\n const codeB = b.charCodeAt(bStart);\n if (codeA < codeB) {\n return -1;\n }\n else if (codeA > codeB) {\n return 1;\n }\n }\n const aLen = aEnd - aStart;\n const bLen = bEnd - bStart;\n if (aLen < bLen) {\n return -1;\n }\n else if (aLen > bLen) {\n return 1;\n }\n return 0;\n}\nexport function compareIgnoreCase(a, b) {\n return compareSubstringIgnoreCase(a, b, 0, a.length, 0, b.length);\n}\nexport function compareSubstringIgnoreCase(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) {\n for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {\n let codeA = a.charCodeAt(aStart);\n let codeB = b.charCodeAt(bStart);\n if (codeA === codeB) {\n // equal\n continue;\n }\n if (codeA >= 128 || codeB >= 128) {\n // not ASCII letters -> fallback to lower-casing strings\n return compareSubstring(a.toLowerCase(), b.toLowerCase(), aStart, aEnd, bStart, bEnd);\n }\n // mapper lower-case ascii letter onto upper-case varinats\n // [97-122] (lower ascii) --> [65-90] (upper ascii)\n if (isLowerAsciiLetter(codeA)) {\n codeA -= 32;\n }\n if (isLowerAsciiLetter(codeB)) {\n codeB -= 32;\n }\n // compare both code points\n const diff = codeA - codeB;\n if (diff === 0) {\n continue;\n }\n return diff;\n }\n const aLen = aEnd - aStart;\n const bLen = bEnd - bStart;\n if (aLen < bLen) {\n return -1;\n }\n else if (aLen > bLen) {\n return 1;\n }\n return 0;\n}\nexport function isAsciiDigit(code) {\n return code >= 48 /* CharCode.Digit0 */ && code <= 57 /* CharCode.Digit9 */;\n}\nexport function isLowerAsciiLetter(code) {\n return code >= 97 /* CharCode.a */ && code <= 122 /* CharCode.z */;\n}\nexport function isUpperAsciiLetter(code) {\n return code >= 65 /* CharCode.A */ && code <= 90 /* CharCode.Z */;\n}\nexport function equalsIgnoreCase(a, b) {\n return a.length === b.length && compareSubstringIgnoreCase(a, b) === 0;\n}\nexport function startsWithIgnoreCase(str, candidate) {\n const candidateLength = candidate.length;\n if (candidate.length > str.length) {\n return false;\n }\n return compareSubstringIgnoreCase(str, candidate, 0, candidateLength) === 0;\n}\n/**\n * @returns the length of the common prefix of the two strings.\n */\nexport function commonPrefixLength(a, b) {\n const len = Math.min(a.length, b.length);\n let i;\n for (i = 0; i < len; i++) {\n if (a.charCodeAt(i) !== b.charCodeAt(i)) {\n return i;\n }\n }\n return len;\n}\n/**\n * @returns the length of the common suffix of the two strings.\n */\nexport function commonSuffixLength(a, b) {\n const len = Math.min(a.length, b.length);\n let i;\n const aLastIndex = a.length - 1;\n const bLastIndex = b.length - 1;\n for (i = 0; i < len; i++) {\n if (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) {\n return i;\n }\n }\n return len;\n}\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nexport function isHighSurrogate(charCode) {\n return (0xD800 <= charCode && charCode <= 0xDBFF);\n}\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nexport function isLowSurrogate(charCode) {\n return (0xDC00 <= charCode && charCode <= 0xDFFF);\n}\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nexport function computeCodePoint(highSurrogate, lowSurrogate) {\n return ((highSurrogate - 0xD800) << 10) + (lowSurrogate - 0xDC00) + 0x10000;\n}\n/**\n * get the code point that begins at offset `offset`\n */\nexport function getNextCodePoint(str, len, offset) {\n const charCode = str.charCodeAt(offset);\n if (isHighSurrogate(charCode) && offset + 1 < len) {\n const nextCharCode = str.charCodeAt(offset + 1);\n if (isLowSurrogate(nextCharCode)) {\n return computeCodePoint(charCode, nextCharCode);\n }\n }\n return charCode;\n}\n/**\n * get the code point that ends right before offset `offset`\n */\nfunction getPrevCodePoint(str, offset) {\n const charCode = str.charCodeAt(offset - 1);\n if (isLowSurrogate(charCode) && offset > 1) {\n const prevCharCode = str.charCodeAt(offset - 2);\n if (isHighSurrogate(prevCharCode)) {\n return computeCodePoint(prevCharCode, charCode);\n }\n }\n return charCode;\n}\nexport class CodePointIterator {\n get offset() {\n return this._offset;\n }\n constructor(str, offset = 0) {\n this._str = str;\n this._len = str.length;\n this._offset = offset;\n }\n setOffset(offset) {\n this._offset = offset;\n }\n prevCodePoint() {\n const codePoint = getPrevCodePoint(this._str, this._offset);\n this._offset -= (codePoint >= 65536 /* Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\n return codePoint;\n }\n nextCodePoint() {\n const codePoint = getNextCodePoint(this._str, this._len, this._offset);\n this._offset += (codePoint >= 65536 /* Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\n return codePoint;\n }\n eol() {\n return (this._offset >= this._len);\n }\n}\nexport class GraphemeIterator {\n get offset() {\n return this._iterator.offset;\n }\n constructor(str, offset = 0) {\n this._iterator = new CodePointIterator(str, offset);\n }\n nextGraphemeLength() {\n const graphemeBreakTree = GraphemeBreakTree.getInstance();\n const iterator = this._iterator;\n const initialOffset = iterator.offset;\n let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.nextCodePoint());\n while (!iterator.eol()) {\n const offset = iterator.offset;\n const nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.nextCodePoint());\n if (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) {\n // move iterator back\n iterator.setOffset(offset);\n break;\n }\n graphemeBreakType = nextGraphemeBreakType;\n }\n return (iterator.offset - initialOffset);\n }\n prevGraphemeLength() {\n const graphemeBreakTree = GraphemeBreakTree.getInstance();\n const iterator = this._iterator;\n const initialOffset = iterator.offset;\n let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.prevCodePoint());\n while (iterator.offset > 0) {\n const offset = iterator.offset;\n const prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.prevCodePoint());\n if (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) {\n // move iterator back\n iterator.setOffset(offset);\n break;\n }\n graphemeBreakType = prevGraphemeBreakType;\n }\n return (initialOffset - iterator.offset);\n }\n eol() {\n return this._iterator.eol();\n }\n}\nexport function nextCharLength(str, initialOffset) {\n const iterator = new GraphemeIterator(str, initialOffset);\n return iterator.nextGraphemeLength();\n}\nexport function prevCharLength(str, initialOffset) {\n const iterator = new GraphemeIterator(str, initialOffset);\n return iterator.prevGraphemeLength();\n}\nexport function getCharContainingOffset(str, offset) {\n if (offset > 0 && isLowSurrogate(str.charCodeAt(offset))) {\n offset--;\n }\n const endOffset = offset + nextCharLength(str, offset);\n const startOffset = endOffset - prevCharLength(str, endOffset);\n return [startOffset, endOffset];\n}\nlet CONTAINS_RTL = undefined;\nfunction makeContainsRtl() {\n // Generated using https://github.com/alexdima/unicode-utils/blob/main/rtl-test.js\n return /(?:[\\u05BE\\u05C0\\u05C3\\u05C6\\u05D0-\\u05F4\\u0608\\u060B\\u060D\\u061B-\\u064A\\u066D-\\u066F\\u0671-\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1-\\u07EA\\u07F4\\u07F5\\u07FA\\u07FE-\\u0815\\u081A\\u0824\\u0828\\u0830-\\u0858\\u085E-\\u088E\\u08A0-\\u08C9\\u200F\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFD3D\\uFD50-\\uFDC7\\uFDF0-\\uFDFC\\uFE70-\\uFEFC]|\\uD802[\\uDC00-\\uDD1B\\uDD20-\\uDE00\\uDE10-\\uDE35\\uDE40-\\uDEE4\\uDEEB-\\uDF35\\uDF40-\\uDFFF]|\\uD803[\\uDC00-\\uDD23\\uDE80-\\uDEA9\\uDEAD-\\uDF45\\uDF51-\\uDF81\\uDF86-\\uDFF6]|\\uD83A[\\uDC00-\\uDCCF\\uDD00-\\uDD43\\uDD4B-\\uDFFF]|\\uD83B[\\uDC00-\\uDEBB])/;\n}\n/**\n * Returns true if `str` contains any Unicode character that is classified as \"R\" or \"AL\".\n */\nexport function containsRTL(str) {\n if (!CONTAINS_RTL) {\n CONTAINS_RTL = makeContainsRtl();\n }\n return CONTAINS_RTL.test(str);\n}\nconst IS_BASIC_ASCII = /^[\\t\\n\\r\\x20-\\x7E]*$/;\n/**\n * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \\n, \\r, \\t\n */\nexport function isBasicASCII(str) {\n return IS_BASIC_ASCII.test(str);\n}\nexport const UNUSUAL_LINE_TERMINATORS = /[\\u2028\\u2029]/; // LINE SEPARATOR (LS) or PARAGRAPH SEPARATOR (PS)\n/**\n * Returns true if `str` contains unusual line terminators, like LS or PS\n */\nexport function containsUnusualLineTerminators(str) {\n return UNUSUAL_LINE_TERMINATORS.test(str);\n}\nexport function isFullWidthCharacter(charCode) {\n // Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns\n // http://jrgraphix.net/research/unicode_blocks.php\n // 2E80 - 2EFF CJK Radicals Supplement\n // 2F00 - 2FDF Kangxi Radicals\n // 2FF0 - 2FFF Ideographic Description Characters\n // 3000 - 303F CJK Symbols and Punctuation\n // 3040 - 309F Hiragana\n // 30A0 - 30FF Katakana\n // 3100 - 312F Bopomofo\n // 3130 - 318F Hangul Compatibility Jamo\n // 3190 - 319F Kanbun\n // 31A0 - 31BF Bopomofo Extended\n // 31F0 - 31FF Katakana Phonetic Extensions\n // 3200 - 32FF Enclosed CJK Letters and Months\n // 3300 - 33FF CJK Compatibility\n // 3400 - 4DBF CJK Unified Ideographs Extension A\n // 4DC0 - 4DFF Yijing Hexagram Symbols\n // 4E00 - 9FFF CJK Unified Ideographs\n // A000 - A48F Yi Syllables\n // A490 - A4CF Yi Radicals\n // AC00 - D7AF Hangul Syllables\n // [IGNORE] D800 - DB7F High Surrogates\n // [IGNORE] DB80 - DBFF High Private Use Surrogates\n // [IGNORE] DC00 - DFFF Low Surrogates\n // [IGNORE] E000 - F8FF Private Use Area\n // F900 - FAFF CJK Compatibility Ideographs\n // [IGNORE] FB00 - FB4F Alphabetic Presentation Forms\n // [IGNORE] FB50 - FDFF Arabic Presentation Forms-A\n // [IGNORE] FE00 - FE0F Variation Selectors\n // [IGNORE] FE20 - FE2F Combining Half Marks\n // [IGNORE] FE30 - FE4F CJK Compatibility Forms\n // [IGNORE] FE50 - FE6F Small Form Variants\n // [IGNORE] FE70 - FEFF Arabic Presentation Forms-B\n // FF00 - FFEF Halfwidth and Fullwidth Forms\n // [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms]\n // of which FF01 - FF5E fullwidth ASCII of 21 to 7E\n // [IGNORE] and FF65 - FFDC halfwidth of Katakana and Hangul\n // [IGNORE] FFF0 - FFFF Specials\n return ((charCode >= 0x2E80 && charCode <= 0xD7AF)\n || (charCode >= 0xF900 && charCode <= 0xFAFF)\n || (charCode >= 0xFF01 && charCode <= 0xFF5E));\n}\n/**\n * A fast function (therefore imprecise) to check if code points are emojis.\n * Generated using https://github.com/alexdima/unicode-utils/blob/main/emoji-test.js\n */\nexport function isEmojiImprecise(x) {\n return ((x >= 0x1F1E6 && x <= 0x1F1FF) || (x === 8986) || (x === 8987) || (x === 9200)\n || (x === 9203) || (x >= 9728 && x <= 10175) || (x === 11088) || (x === 11093)\n || (x >= 127744 && x <= 128591) || (x >= 128640 && x <= 128764)\n || (x >= 128992 && x <= 129008) || (x >= 129280 && x <= 129535)\n || (x >= 129648 && x <= 129782));\n}\n// -- UTF-8 BOM\nexport const UTF8_BOM_CHARACTER = String.fromCharCode(65279 /* CharCode.UTF8_BOM */);\nexport function startsWithUTF8BOM(str) {\n return !!(str && str.length > 0 && str.charCodeAt(0) === 65279 /* CharCode.UTF8_BOM */);\n}\nexport function containsUppercaseCharacter(target, ignoreEscapedChars = false) {\n if (!target) {\n return false;\n }\n if (ignoreEscapedChars) {\n target = target.replace(/\\\\./g, '');\n }\n return target.toLowerCase() !== target;\n}\n/**\n * Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc.\n */\nexport function singleLetterHash(n) {\n const LETTERS_CNT = (90 /* CharCode.Z */ - 65 /* CharCode.A */ + 1);\n n = n % (2 * LETTERS_CNT);\n if (n < LETTERS_CNT) {\n return String.fromCharCode(97 /* CharCode.a */ + n);\n }\n return String.fromCharCode(65 /* CharCode.A */ + n - LETTERS_CNT);\n}\nfunction breakBetweenGraphemeBreakType(breakTypeA, breakTypeB) {\n // http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules\n // !!! Let's make the common case a bit faster\n if (breakTypeA === 0 /* GraphemeBreakType.Other */) {\n // see https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest-13.0.0d10.html#table\n return (breakTypeB !== 5 /* GraphemeBreakType.Extend */ && breakTypeB !== 7 /* GraphemeBreakType.SpacingMark */);\n }\n // Do not break between a CR and LF. Otherwise, break before and after controls.\n // GB3 CR \u00D7 LF\n // GB4 (Control | CR | LF) \u00F7\n // GB5 \u00F7 (Control | CR | LF)\n if (breakTypeA === 2 /* GraphemeBreakType.CR */) {\n if (breakTypeB === 3 /* GraphemeBreakType.LF */) {\n return false; // GB3\n }\n }\n if (breakTypeA === 4 /* GraphemeBreakType.Control */ || breakTypeA === 2 /* GraphemeBreakType.CR */ || breakTypeA === 3 /* GraphemeBreakType.LF */) {\n return true; // GB4\n }\n if (breakTypeB === 4 /* GraphemeBreakType.Control */ || breakTypeB === 2 /* GraphemeBreakType.CR */ || breakTypeB === 3 /* GraphemeBreakType.LF */) {\n return true; // GB5\n }\n // Do not break Hangul syllable sequences.\n // GB6 L \u00D7 (L | V | LV | LVT)\n // GB7 (LV | V) \u00D7 (V | T)\n // GB8 (LVT | T) \u00D7 T\n if (breakTypeA === 8 /* GraphemeBreakType.L */) {\n if (breakTypeB === 8 /* GraphemeBreakType.L */ || breakTypeB === 9 /* GraphemeBreakType.V */ || breakTypeB === 11 /* GraphemeBreakType.LV */ || breakTypeB === 12 /* GraphemeBreakType.LVT */) {\n return false; // GB6\n }\n }\n if (breakTypeA === 11 /* GraphemeBreakType.LV */ || breakTypeA === 9 /* GraphemeBreakType.V */) {\n if (breakTypeB === 9 /* GraphemeBreakType.V */ || breakTypeB === 10 /* GraphemeBreakType.T */) {\n return false; // GB7\n }\n }\n if (breakTypeA === 12 /* GraphemeBreakType.LVT */ || breakTypeA === 10 /* GraphemeBreakType.T */) {\n if (breakTypeB === 10 /* GraphemeBreakType.T */) {\n return false; // GB8\n }\n }\n // Do not break before extending characters or ZWJ.\n // GB9 \u00D7 (Extend | ZWJ)\n if (breakTypeB === 5 /* GraphemeBreakType.Extend */ || breakTypeB === 13 /* GraphemeBreakType.ZWJ */) {\n return false; // GB9\n }\n // The GB9a and GB9b rules only apply to extended grapheme clusters:\n // Do not break before SpacingMarks, or after Prepend characters.\n // GB9a \u00D7 SpacingMark\n // GB9b Prepend \u00D7\n if (breakTypeB === 7 /* GraphemeBreakType.SpacingMark */) {\n return false; // GB9a\n }\n if (breakTypeA === 1 /* GraphemeBreakType.Prepend */) {\n return false; // GB9b\n }\n // Do not break within emoji modifier sequences or emoji zwj sequences.\n // GB11 \\p{Extended_Pictographic} Extend* ZWJ \u00D7 \\p{Extended_Pictographic}\n if (breakTypeA === 13 /* GraphemeBreakType.ZWJ */ && breakTypeB === 14 /* GraphemeBreakType.Extended_Pictographic */) {\n // Note: we are not implementing the rule entirely here to avoid introducing states\n return false; // GB11\n }\n // GB12 sot (RI RI)* RI \u00D7 RI\n // GB13 [^RI] (RI RI)* RI \u00D7 RI\n if (breakTypeA === 6 /* GraphemeBreakType.Regional_Indicator */ && breakTypeB === 6 /* GraphemeBreakType.Regional_Indicator */) {\n // Note: we are not implementing the rule entirely here to avoid introducing states\n return false; // GB12 & GB13\n }\n // GB999 Any \u00F7 Any\n return true;\n}\nclass GraphemeBreakTree {\n static getInstance() {\n if (!GraphemeBreakTree._INSTANCE) {\n GraphemeBreakTree._INSTANCE = new GraphemeBreakTree();\n }\n return GraphemeBreakTree._INSTANCE;\n }\n constructor() {\n this._data = getGraphemeBreakRawData();\n }\n getGraphemeBreakType(codePoint) {\n // !!! Let's make 7bit ASCII a bit faster: 0..31\n if (codePoint < 32) {\n if (codePoint === 10 /* CharCode.LineFeed */) {\n return 3 /* GraphemeBreakType.LF */;\n }\n if (codePoint === 13 /* CharCode.CarriageReturn */) {\n return 2 /* GraphemeBreakType.CR */;\n }\n return 4 /* GraphemeBreakType.Control */;\n }\n // !!! Let's make 7bit ASCII a bit faster: 32..126\n if (codePoint < 127) {\n return 0 /* GraphemeBreakType.Other */;\n }\n const data = this._data;\n const nodeCount = data.length / 3;\n let nodeIndex = 1;\n while (nodeIndex <= nodeCount) {\n if (codePoint < data[3 * nodeIndex]) {\n // go left\n nodeIndex = 2 * nodeIndex;\n }\n else if (codePoint > data[3 * nodeIndex + 1]) {\n // go right\n nodeIndex = 2 * nodeIndex + 1;\n }\n else {\n // hit\n return data[3 * nodeIndex + 2];\n }\n }\n return 0 /* GraphemeBreakType.Other */;\n }\n}\nGraphemeBreakTree._INSTANCE = null;\nfunction getGraphemeBreakRawData() {\n // generated using https://github.com/alexdima/unicode-utils/blob/main/grapheme-break.js\n return JSON.parse('[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]');\n}\n//#endregion\n/**\n * Computes the offset after performing a left delete on the given string,\n * while considering unicode grapheme/emoji rules.\n*/\nexport function getLeftDeleteOffset(offset, str) {\n if (offset === 0) {\n return 0;\n }\n // Try to delete emoji part.\n const emojiOffset = getOffsetBeforeLastEmojiComponent(offset, str);\n if (emojiOffset !== undefined) {\n return emojiOffset;\n }\n // Otherwise, just skip a single code point.\n const iterator = new CodePointIterator(str, offset);\n iterator.prevCodePoint();\n return iterator.offset;\n}\nfunction getOffsetBeforeLastEmojiComponent(initialOffset, str) {\n // See https://www.unicode.org/reports/tr51/tr51-14.html#EBNF_and_Regex for the\n // structure of emojis.\n const iterator = new CodePointIterator(str, initialOffset);\n let codePoint = iterator.prevCodePoint();\n // Skip modifiers\n while ((isEmojiModifier(codePoint) || codePoint === 65039 /* CodePoint.emojiVariantSelector */ || codePoint === 8419 /* CodePoint.enclosingKeyCap */)) {\n if (iterator.offset === 0) {\n // Cannot skip modifier, no preceding emoji base.\n return undefined;\n }\n codePoint = iterator.prevCodePoint();\n }\n // Expect base emoji\n if (!isEmojiImprecise(codePoint)) {\n // Unexpected code point, not a valid emoji.\n return undefined;\n }\n let resultOffset = iterator.offset;\n if (resultOffset > 0) {\n // Skip optional ZWJ code points that combine multiple emojis.\n // In theory, we should check if that ZWJ actually combines multiple emojis\n // to prevent deleting ZWJs in situations we didn't account for.\n const optionalZwjCodePoint = iterator.prevCodePoint();\n if (optionalZwjCodePoint === 8205 /* CodePoint.zwj */) {\n resultOffset = iterator.offset;\n }\n }\n return resultOffset;\n}\nfunction isEmojiModifier(codePoint) {\n return 0x1F3FB <= codePoint && codePoint <= 0x1F3FF;\n}\nexport const noBreakWhitespace = '\\xa0';\nexport class AmbiguousCharacters {\n static getInstance(locales) {\n return _a.cache.get(Array.from(locales));\n }\n static getLocales() {\n return _a._locales.value;\n }\n constructor(confusableDictionary) {\n this.confusableDictionary = confusableDictionary;\n }\n isAmbiguous(codePoint) {\n return this.confusableDictionary.has(codePoint);\n }\n /**\n * Returns the non basic ASCII code point that the given code point can be confused,\n * or undefined if such code point does note exist.\n */\n getPrimaryConfusable(codePoint) {\n return this.confusableDictionary.get(codePoint);\n }\n getConfusableCodePoints() {\n return new Set(this.confusableDictionary.keys());\n }\n}\n_a = AmbiguousCharacters;\nAmbiguousCharacters.ambiguousCharacterData = new Lazy(() => {\n // Generated using https://github.com/hediet/vscode-unicode-data\n // Stored as key1, value1, key2, value2, ...\n return JSON.parse('{\\\"_common\\\":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],\\\"_default\\\":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"cs\\\":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"de\\\":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"es\\\":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"fr\\\":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"it\\\":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"ja\\\":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],\\\"ko\\\":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"pl\\\":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"pt-BR\\\":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"qps-ploc\\\":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"ru\\\":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"tr\\\":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],\\\"zh-hans\\\":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],\\\"zh-hant\\\":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}');\n});\nAmbiguousCharacters.cache = new LRUCachedFunction((locales) => {\n function arrayToMap(arr) {\n const result = new Map();\n for (let i = 0; i < arr.length; i += 2) {\n result.set(arr[i], arr[i + 1]);\n }\n return result;\n }\n function mergeMaps(map1, map2) {\n const result = new Map(map1);\n for (const [key, value] of map2) {\n result.set(key, value);\n }\n return result;\n }\n function intersectMaps(map1, map2) {\n if (!map1) {\n return map2;\n }\n const result = new Map();\n for (const [key, value] of map1) {\n if (map2.has(key)) {\n result.set(key, value);\n }\n }\n return result;\n }\n const data = _a.ambiguousCharacterData.value;\n let filteredLocales = locales.filter((l) => !l.startsWith('_') && l in data);\n if (filteredLocales.length === 0) {\n filteredLocales = ['_default'];\n }\n let languageSpecificMap = undefined;\n for (const locale of filteredLocales) {\n const map = arrayToMap(data[locale]);\n languageSpecificMap = intersectMaps(languageSpecificMap, map);\n }\n const commonMap = arrayToMap(data['_common']);\n const map = mergeMaps(commonMap, languageSpecificMap);\n return new _a(map);\n});\nAmbiguousCharacters._locales = new Lazy(() => Object.keys(_a.ambiguousCharacterData.value).filter((k) => !k.startsWith('_')));\nexport class InvisibleCharacters {\n static getRawData() {\n // Generated using https://github.com/hediet/vscode-unicode-data\n return JSON.parse('[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]');\n }\n static getData() {\n if (!this._data) {\n this._data = new Set(InvisibleCharacters.getRawData());\n }\n return this._data;\n }\n static isInvisibleCharacter(codePoint) {\n return InvisibleCharacters.getData().has(codePoint);\n }\n static get codePoints() {\n return InvisibleCharacters.getData();\n }\n}\nInvisibleCharacters._data = undefined;\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n\n/* Default standalone editor fonts */\n.monaco-editor {\n\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t--monaco-monospace-font: \"SF Mono\", Monaco, Menlo, Consolas, \"Ubuntu Mono\", \"Liberation Mono\", \"DejaVu Sans Mono\", \"Courier New\", monospace;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label {\n\tstroke-width: 1.2px;\n}\n\n.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,\n.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,\n.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label {\n\tstroke-width: 1.2px;\n}\n\n.monaco-hover p {\n\tmargin: 0;\n}\n\n/* See https://github.com/microsoft/monaco-editor/issues/2168#issuecomment-780078600 */\n.monaco-aria-container {\n\tposition: absolute !important;\n\ttop: 0; /* avoid being placed underneath a sibling element */\n\theight: 1px;\n\twidth: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n}\n\n.monaco-editor, .monaco-diff-editor .synthetic-focus,\n.monaco-editor, .monaco-diff-editor [tabindex=\"0\"]:focus,\n.monaco-editor, .monaco-diff-editor [tabindex=\"-1\"]:focus,\n.monaco-editor, .monaco-diff-editor button:focus,\n.monaco-editor, .monaco-diff-editor input[type=button]:focus,\n.monaco-editor, .monaco-diff-editor input[type=checkbox]:focus,\n.monaco-editor, .monaco-diff-editor input[type=search]:focus,\n.monaco-editor, .monaco-diff-editor input[type=text]:focus,\n.monaco-editor, .monaco-diff-editor select:focus,\n.monaco-editor, .monaco-diff-editor textarea:focus {\n\toutline-width: 1px;\n\toutline-style: solid;\n\toutline-offset: -1px;\n\toutline-color: var(--vscode-focusBorder);\n\topacity: 1\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { $window, mainWindow } from './window.js';\nimport { Emitter } from '../common/event.js';\nimport { Disposable, markAsSingleton } from '../common/lifecycle.js';\nclass WindowManager {\n constructor() {\n // --- Zoom Factor\n this.mapWindowIdToZoomFactor = new Map();\n }\n getZoomFactor(targetWindow) {\n var _a;\n return (_a = this.mapWindowIdToZoomFactor.get(this.getWindowId(targetWindow))) !== null && _a !== void 0 ? _a : 1;\n }\n getWindowId(targetWindow) {\n return targetWindow.vscodeWindowId;\n }\n}\nWindowManager.INSTANCE = new WindowManager();\n/**\n * See https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio#monitoring_screen_resolution_or_zoom_level_changes\n */\nclass DevicePixelRatioMonitor extends Disposable {\n constructor() {\n super();\n this._onDidChange = this._register(new Emitter());\n this.onDidChange = this._onDidChange.event;\n this._listener = () => this._handleChange(true);\n this._mediaQueryList = null;\n this._handleChange(false);\n }\n _handleChange(fireEvent) {\n var _a;\n (_a = this._mediaQueryList) === null || _a === void 0 ? void 0 : _a.removeEventListener('change', this._listener);\n this._mediaQueryList = $window.matchMedia(`(resolution: ${$window.devicePixelRatio}dppx)`);\n this._mediaQueryList.addEventListener('change', this._listener);\n if (fireEvent) {\n this._onDidChange.fire();\n }\n }\n}\nclass PixelRatioImpl extends Disposable {\n get value() {\n return this._value;\n }\n constructor() {\n super();\n this._onDidChange = this._register(new Emitter());\n this.onDidChange = this._onDidChange.event;\n this._value = this._getPixelRatio();\n const dprMonitor = this._register(new DevicePixelRatioMonitor());\n this._register(dprMonitor.onDidChange(() => {\n this._value = this._getPixelRatio();\n this._onDidChange.fire(this._value);\n }));\n }\n _getPixelRatio() {\n const ctx = document.createElement('canvas').getContext('2d');\n const dpr = $window.devicePixelRatio || 1;\n const bsr = ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1;\n return dpr / bsr;\n }\n}\nclass PixelRatioFacade {\n constructor() {\n this._pixelRatioMonitor = null;\n }\n _getOrCreatePixelRatioMonitor() {\n if (!this._pixelRatioMonitor) {\n this._pixelRatioMonitor = markAsSingleton(new PixelRatioImpl());\n }\n return this._pixelRatioMonitor;\n }\n /**\n * Get the current value.\n */\n get value() {\n return this._getOrCreatePixelRatioMonitor().value;\n }\n /**\n * Listen for changes.\n */\n get onDidChange() {\n return this._getOrCreatePixelRatioMonitor().onDidChange;\n }\n}\nexport function addMatchMediaChangeListener(targetWindow, query, callback) {\n if (typeof query === 'string') {\n query = targetWindow.matchMedia(query);\n }\n query.addEventListener('change', callback);\n}\n/**\n * Returns the pixel ratio.\n *\n * This is useful for rendering elements at native screen resolution or for being used as\n * a cache key when storing font measurements. Fonts might render differently depending on resolution\n * and any measurements need to be discarded for example when a window is moved from a monitor to another.\n */\nexport const PixelRatio = new PixelRatioFacade();\n/** The zoom scale for an index, e.g. 1, 1.2, 1.4 */\nexport function getZoomFactor(targetWindow) {\n return WindowManager.INSTANCE.getZoomFactor(targetWindow);\n}\nconst userAgent = navigator.userAgent;\nexport const isFirefox = (userAgent.indexOf('Firefox') >= 0);\nexport const isWebKit = (userAgent.indexOf('AppleWebKit') >= 0);\nexport const isChrome = (userAgent.indexOf('Chrome') >= 0);\nexport const isSafari = (!isChrome && (userAgent.indexOf('Safari') >= 0));\nexport const isWebkitWebView = (!isChrome && !isSafari && isWebKit);\nexport const isElectron = (userAgent.indexOf('Electron/') >= 0);\nexport const isAndroid = (userAgent.indexOf('Android') >= 0);\nlet standalone = false;\nif (typeof mainWindow.matchMedia === 'function') {\n const standaloneMatchMedia = mainWindow.matchMedia('(display-mode: standalone) or (display-mode: window-controls-overlay)');\n const fullScreenMatchMedia = mainWindow.matchMedia('(display-mode: fullscreen)');\n standalone = standaloneMatchMedia.matches;\n addMatchMediaChangeListener(mainWindow, standaloneMatchMedia, ({ matches }) => {\n // entering fullscreen would change standaloneMatchMedia.matches to false\n // if standalone is true (running as PWA) and entering fullscreen, skip this change\n if (standalone && fullScreenMatchMedia.matches) {\n return;\n }\n // otherwise update standalone (browser to PWA or PWA to browser)\n standalone = matches;\n });\n}\nexport function isStandalone() {\n return standalone;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class FastDomNode {\n constructor(domNode) {\n this.domNode = domNode;\n this._maxWidth = '';\n this._width = '';\n this._height = '';\n this._top = '';\n this._left = '';\n this._bottom = '';\n this._right = '';\n this._paddingLeft = '';\n this._fontFamily = '';\n this._fontWeight = '';\n this._fontSize = '';\n this._fontStyle = '';\n this._fontFeatureSettings = '';\n this._fontVariationSettings = '';\n this._textDecoration = '';\n this._lineHeight = '';\n this._letterSpacing = '';\n this._className = '';\n this._display = '';\n this._position = '';\n this._visibility = '';\n this._color = '';\n this._backgroundColor = '';\n this._layerHint = false;\n this._contain = 'none';\n this._boxShadow = '';\n }\n setMaxWidth(_maxWidth) {\n const maxWidth = numberAsPixels(_maxWidth);\n if (this._maxWidth === maxWidth) {\n return;\n }\n this._maxWidth = maxWidth;\n this.domNode.style.maxWidth = this._maxWidth;\n }\n setWidth(_width) {\n const width = numberAsPixels(_width);\n if (this._width === width) {\n return;\n }\n this._width = width;\n this.domNode.style.width = this._width;\n }\n setHeight(_height) {\n const height = numberAsPixels(_height);\n if (this._height === height) {\n return;\n }\n this._height = height;\n this.domNode.style.height = this._height;\n }\n setTop(_top) {\n const top = numberAsPixels(_top);\n if (this._top === top) {\n return;\n }\n this._top = top;\n this.domNode.style.top = this._top;\n }\n setLeft(_left) {\n const left = numberAsPixels(_left);\n if (this._left === left) {\n return;\n }\n this._left = left;\n this.domNode.style.left = this._left;\n }\n setBottom(_bottom) {\n const bottom = numberAsPixels(_bottom);\n if (this._bottom === bottom) {\n return;\n }\n this._bottom = bottom;\n this.domNode.style.bottom = this._bottom;\n }\n setRight(_right) {\n const right = numberAsPixels(_right);\n if (this._right === right) {\n return;\n }\n this._right = right;\n this.domNode.style.right = this._right;\n }\n setPaddingLeft(_paddingLeft) {\n const paddingLeft = numberAsPixels(_paddingLeft);\n if (this._paddingLeft === paddingLeft) {\n return;\n }\n this._paddingLeft = paddingLeft;\n this.domNode.style.paddingLeft = this._paddingLeft;\n }\n setFontFamily(fontFamily) {\n if (this._fontFamily === fontFamily) {\n return;\n }\n this._fontFamily = fontFamily;\n this.domNode.style.fontFamily = this._fontFamily;\n }\n setFontWeight(fontWeight) {\n if (this._fontWeight === fontWeight) {\n return;\n }\n this._fontWeight = fontWeight;\n this.domNode.style.fontWeight = this._fontWeight;\n }\n setFontSize(_fontSize) {\n const fontSize = numberAsPixels(_fontSize);\n if (this._fontSize === fontSize) {\n return;\n }\n this._fontSize = fontSize;\n this.domNode.style.fontSize = this._fontSize;\n }\n setFontStyle(fontStyle) {\n if (this._fontStyle === fontStyle) {\n return;\n }\n this._fontStyle = fontStyle;\n this.domNode.style.fontStyle = this._fontStyle;\n }\n setFontFeatureSettings(fontFeatureSettings) {\n if (this._fontFeatureSettings === fontFeatureSettings) {\n return;\n }\n this._fontFeatureSettings = fontFeatureSettings;\n this.domNode.style.fontFeatureSettings = this._fontFeatureSettings;\n }\n setFontVariationSettings(fontVariationSettings) {\n if (this._fontVariationSettings === fontVariationSettings) {\n return;\n }\n this._fontVariationSettings = fontVariationSettings;\n this.domNode.style.fontVariationSettings = this._fontVariationSettings;\n }\n setTextDecoration(textDecoration) {\n if (this._textDecoration === textDecoration) {\n return;\n }\n this._textDecoration = textDecoration;\n this.domNode.style.textDecoration = this._textDecoration;\n }\n setLineHeight(_lineHeight) {\n const lineHeight = numberAsPixels(_lineHeight);\n if (this._lineHeight === lineHeight) {\n return;\n }\n this._lineHeight = lineHeight;\n this.domNode.style.lineHeight = this._lineHeight;\n }\n setLetterSpacing(_letterSpacing) {\n const letterSpacing = numberAsPixels(_letterSpacing);\n if (this._letterSpacing === letterSpacing) {\n return;\n }\n this._letterSpacing = letterSpacing;\n this.domNode.style.letterSpacing = this._letterSpacing;\n }\n setClassName(className) {\n if (this._className === className) {\n return;\n }\n this._className = className;\n this.domNode.className = this._className;\n }\n toggleClassName(className, shouldHaveIt) {\n this.domNode.classList.toggle(className, shouldHaveIt);\n this._className = this.domNode.className;\n }\n setDisplay(display) {\n if (this._display === display) {\n return;\n }\n this._display = display;\n this.domNode.style.display = this._display;\n }\n setPosition(position) {\n if (this._position === position) {\n return;\n }\n this._position = position;\n this.domNode.style.position = this._position;\n }\n setVisibility(visibility) {\n if (this._visibility === visibility) {\n return;\n }\n this._visibility = visibility;\n this.domNode.style.visibility = this._visibility;\n }\n setColor(color) {\n if (this._color === color) {\n return;\n }\n this._color = color;\n this.domNode.style.color = this._color;\n }\n setBackgroundColor(backgroundColor) {\n if (this._backgroundColor === backgroundColor) {\n return;\n }\n this._backgroundColor = backgroundColor;\n this.domNode.style.backgroundColor = this._backgroundColor;\n }\n setLayerHinting(layerHint) {\n if (this._layerHint === layerHint) {\n return;\n }\n this._layerHint = layerHint;\n this.domNode.style.transform = this._layerHint ? 'translate3d(0px, 0px, 0px)' : '';\n }\n setBoxShadow(boxShadow) {\n if (this._boxShadow === boxShadow) {\n return;\n }\n this._boxShadow = boxShadow;\n this.domNode.style.boxShadow = boxShadow;\n }\n setContain(contain) {\n if (this._contain === contain) {\n return;\n }\n this._contain = contain;\n this.domNode.style.contain = this._contain;\n }\n setAttribute(name, value) {\n this.domNode.setAttribute(name, value);\n }\n removeAttribute(name) {\n this.domNode.removeAttribute(name);\n }\n appendChild(child) {\n this.domNode.appendChild(child.domNode);\n }\n removeChild(child) {\n this.domNode.removeChild(child.domNode);\n }\n}\nfunction numberAsPixels(value) {\n return (typeof value === 'number' ? `${value}px` : value);\n}\nexport function createFastDomNode(domNode) {\n return new FastDomNode(domNode);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { FastDomNode } from '../../../base/browser/fastDomNode.js';\nexport function applyFontInfo(domNode, fontInfo) {\n if (domNode instanceof FastDomNode) {\n domNode.setFontFamily(fontInfo.getMassagedFontFamily());\n domNode.setFontWeight(fontInfo.fontWeight);\n domNode.setFontSize(fontInfo.fontSize);\n domNode.setFontFeatureSettings(fontInfo.fontFeatureSettings);\n domNode.setFontVariationSettings(fontInfo.fontVariationSettings);\n domNode.setLineHeight(fontInfo.lineHeight);\n domNode.setLetterSpacing(fontInfo.letterSpacing);\n }\n else {\n domNode.style.fontFamily = fontInfo.getMassagedFontFamily();\n domNode.style.fontWeight = fontInfo.fontWeight;\n domNode.style.fontSize = fontInfo.fontSize + 'px';\n domNode.style.fontFeatureSettings = fontInfo.fontFeatureSettings;\n domNode.style.fontVariationSettings = fontInfo.fontVariationSettings;\n domNode.style.lineHeight = fontInfo.lineHeight + 'px';\n domNode.style.letterSpacing = fontInfo.letterSpacing + 'px';\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { $window } from '../../../base/browser/window.js';\nimport { applyFontInfo } from './domFontInfo.js';\nexport class CharWidthRequest {\n constructor(chr, type) {\n this.chr = chr;\n this.type = type;\n this.width = 0;\n }\n fulfill(width) {\n this.width = width;\n }\n}\nclass DomCharWidthReader {\n constructor(bareFontInfo, requests) {\n this._bareFontInfo = bareFontInfo;\n this._requests = requests;\n this._container = null;\n this._testElements = null;\n }\n read() {\n // Create a test container with all these test elements\n this._createDomElements();\n // Add the container to the DOM\n $window.document.body.appendChild(this._container);\n // Read character widths\n this._readFromDomElements();\n // Remove the container from the DOM\n $window.document.body.removeChild(this._container);\n this._container = null;\n this._testElements = null;\n }\n _createDomElements() {\n const container = document.createElement('div');\n container.style.position = 'absolute';\n container.style.top = '-50000px';\n container.style.width = '50000px';\n const regularDomNode = document.createElement('div');\n applyFontInfo(regularDomNode, this._bareFontInfo);\n container.appendChild(regularDomNode);\n const boldDomNode = document.createElement('div');\n applyFontInfo(boldDomNode, this._bareFontInfo);\n boldDomNode.style.fontWeight = 'bold';\n container.appendChild(boldDomNode);\n const italicDomNode = document.createElement('div');\n applyFontInfo(italicDomNode, this._bareFontInfo);\n italicDomNode.style.fontStyle = 'italic';\n container.appendChild(italicDomNode);\n const testElements = [];\n for (const request of this._requests) {\n let parent;\n if (request.type === 0 /* CharWidthRequestType.Regular */) {\n parent = regularDomNode;\n }\n if (request.type === 2 /* CharWidthRequestType.Bold */) {\n parent = boldDomNode;\n }\n if (request.type === 1 /* CharWidthRequestType.Italic */) {\n parent = italicDomNode;\n }\n parent.appendChild(document.createElement('br'));\n const testElement = document.createElement('span');\n DomCharWidthReader._render(testElement, request);\n parent.appendChild(testElement);\n testElements.push(testElement);\n }\n this._container = container;\n this._testElements = testElements;\n }\n static _render(testElement, request) {\n if (request.chr === ' ') {\n let htmlString = '\\u00a0';\n // Repeat character 256 (2^8) times\n for (let i = 0; i < 8; i++) {\n htmlString += htmlString;\n }\n testElement.innerText = htmlString;\n }\n else {\n let testString = request.chr;\n // Repeat character 256 (2^8) times\n for (let i = 0; i < 8; i++) {\n testString += testString;\n }\n testElement.textContent = testString;\n }\n }\n _readFromDomElements() {\n for (let i = 0, len = this._requests.length; i < len; i++) {\n const request = this._requests[i];\n const testElement = this._testElements[i];\n request.fulfill(testElement.offsetWidth / 256);\n }\n }\n}\nexport function readCharWidths(bareFontInfo, requests) {\n const reader = new DomCharWidthReader(bareFontInfo, requests);\n reader.read();\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Emitter } from '../../../base/common/event.js';\nexport const EditorZoom = new class {\n constructor() {\n this._zoomLevel = 0;\n this._onDidChangeZoomLevel = new Emitter();\n this.onDidChangeZoomLevel = this._onDidChangeZoomLevel.event;\n }\n getZoomLevel() {\n return this._zoomLevel;\n }\n setZoomLevel(zoomLevel) {\n zoomLevel = Math.min(Math.max(-5, zoomLevel), 20);\n if (this._zoomLevel === zoomLevel) {\n return;\n }\n this._zoomLevel = zoomLevel;\n this._onDidChangeZoomLevel.fire(this._zoomLevel);\n }\n};\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as platform from '../../../base/common/platform.js';\nimport { EditorFontVariations, EDITOR_FONT_DEFAULTS } from './editorOptions.js';\nimport { EditorZoom } from './editorZoom.js';\n/**\n * Determined from empirical observations.\n * @internal\n */\nconst GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;\n/**\n * @internal\n */\nconst MINIMUM_LINE_HEIGHT = 8;\nexport class BareFontInfo {\n /**\n * @internal\n */\n static createFromValidatedSettings(options, pixelRatio, ignoreEditorZoom) {\n const fontFamily = options.get(49 /* EditorOption.fontFamily */);\n const fontWeight = options.get(53 /* EditorOption.fontWeight */);\n const fontSize = options.get(52 /* EditorOption.fontSize */);\n const fontFeatureSettings = options.get(51 /* EditorOption.fontLigatures */);\n const fontVariationSettings = options.get(54 /* EditorOption.fontVariations */);\n const lineHeight = options.get(66 /* EditorOption.lineHeight */);\n const letterSpacing = options.get(63 /* EditorOption.letterSpacing */);\n return BareFontInfo._create(fontFamily, fontWeight, fontSize, fontFeatureSettings, fontVariationSettings, lineHeight, letterSpacing, pixelRatio, ignoreEditorZoom);\n }\n /**\n * @internal\n */\n static _create(fontFamily, fontWeight, fontSize, fontFeatureSettings, fontVariationSettings, lineHeight, letterSpacing, pixelRatio, ignoreEditorZoom) {\n if (lineHeight === 0) {\n lineHeight = GOLDEN_LINE_HEIGHT_RATIO * fontSize;\n }\n else if (lineHeight < MINIMUM_LINE_HEIGHT) {\n // Values too small to be line heights in pixels are in ems.\n lineHeight = lineHeight * fontSize;\n }\n // Enforce integer, minimum constraints\n lineHeight = Math.round(lineHeight);\n if (lineHeight < MINIMUM_LINE_HEIGHT) {\n lineHeight = MINIMUM_LINE_HEIGHT;\n }\n const editorZoomLevelMultiplier = 1 + (ignoreEditorZoom ? 0 : EditorZoom.getZoomLevel() * 0.1);\n fontSize *= editorZoomLevelMultiplier;\n lineHeight *= editorZoomLevelMultiplier;\n if (fontVariationSettings === EditorFontVariations.TRANSLATE) {\n if (fontWeight === 'normal' || fontWeight === 'bold') {\n fontVariationSettings = EditorFontVariations.OFF;\n }\n else {\n const fontWeightAsNumber = parseInt(fontWeight, 10);\n fontVariationSettings = `'wght' ${fontWeightAsNumber}`;\n fontWeight = 'normal';\n }\n }\n return new BareFontInfo({\n pixelRatio: pixelRatio,\n fontFamily: fontFamily,\n fontWeight: fontWeight,\n fontSize: fontSize,\n fontFeatureSettings: fontFeatureSettings,\n fontVariationSettings,\n lineHeight: lineHeight,\n letterSpacing: letterSpacing\n });\n }\n /**\n * @internal\n */\n constructor(opts) {\n this._bareFontInfoBrand = undefined;\n this.pixelRatio = opts.pixelRatio;\n this.fontFamily = String(opts.fontFamily);\n this.fontWeight = String(opts.fontWeight);\n this.fontSize = opts.fontSize;\n this.fontFeatureSettings = opts.fontFeatureSettings;\n this.fontVariationSettings = opts.fontVariationSettings;\n this.lineHeight = opts.lineHeight | 0;\n this.letterSpacing = opts.letterSpacing;\n }\n /**\n * @internal\n */\n getId() {\n return `${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`;\n }\n /**\n * @internal\n */\n getMassagedFontFamily() {\n const fallbackFontFamily = EDITOR_FONT_DEFAULTS.fontFamily;\n const fontFamily = BareFontInfo._wrapInQuotes(this.fontFamily);\n if (fallbackFontFamily && this.fontFamily !== fallbackFontFamily) {\n return `${fontFamily}, ${fallbackFontFamily}`;\n }\n return fontFamily;\n }\n static _wrapInQuotes(fontFamily) {\n if (/[,\"']/.test(fontFamily)) {\n // Looks like the font family might be already escaped\n return fontFamily;\n }\n if (/[+ ]/.test(fontFamily)) {\n // Wrap a font family using + or with quotes\n return `\"${fontFamily}\"`;\n }\n return fontFamily;\n }\n}\n// change this whenever `FontInfo` members are changed\nexport const SERIALIZED_FONT_INFO_VERSION = 2;\nexport class FontInfo extends BareFontInfo {\n /**\n * @internal\n */\n constructor(opts, isTrusted) {\n super(opts);\n this._editorStylingBrand = undefined;\n this.version = SERIALIZED_FONT_INFO_VERSION;\n this.isTrusted = isTrusted;\n this.isMonospace = opts.isMonospace;\n this.typicalHalfwidthCharacterWidth = opts.typicalHalfwidthCharacterWidth;\n this.typicalFullwidthCharacterWidth = opts.typicalFullwidthCharacterWidth;\n this.canUseHalfwidthRightwardsArrow = opts.canUseHalfwidthRightwardsArrow;\n this.spaceWidth = opts.spaceWidth;\n this.middotWidth = opts.middotWidth;\n this.wsmiddotWidth = opts.wsmiddotWidth;\n this.maxDigitWidth = opts.maxDigitWidth;\n }\n /**\n * @internal\n */\n equals(other) {\n return (this.fontFamily === other.fontFamily\n && this.fontWeight === other.fontWeight\n && this.fontSize === other.fontSize\n && this.fontFeatureSettings === other.fontFeatureSettings\n && this.fontVariationSettings === other.fontVariationSettings\n && this.lineHeight === other.lineHeight\n && this.letterSpacing === other.letterSpacing\n && this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth\n && this.typicalFullwidthCharacterWidth === other.typicalFullwidthCharacterWidth\n && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow\n && this.spaceWidth === other.spaceWidth\n && this.middotWidth === other.middotWidth\n && this.wsmiddotWidth === other.wsmiddotWidth\n && this.maxDigitWidth === other.maxDigitWidth);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as browser from '../../../base/browser/browser.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { Disposable } from '../../../base/common/lifecycle.js';\nimport { CharWidthRequest, readCharWidths } from './charWidthReader.js';\nimport { EditorFontLigatures } from '../../common/config/editorOptions.js';\nimport { FontInfo } from '../../common/config/fontInfo.js';\nexport class FontMeasurementsImpl extends Disposable {\n constructor() {\n super();\n this._onDidChange = this._register(new Emitter());\n this.onDidChange = this._onDidChange.event;\n this._cache = new FontMeasurementsCache();\n this._evictUntrustedReadingsTimeout = -1;\n }\n dispose() {\n if (this._evictUntrustedReadingsTimeout !== -1) {\n clearTimeout(this._evictUntrustedReadingsTimeout);\n this._evictUntrustedReadingsTimeout = -1;\n }\n super.dispose();\n }\n /**\n * Clear all cached font information and trigger a change event.\n */\n clearAllFontInfos() {\n this._cache = new FontMeasurementsCache();\n this._onDidChange.fire();\n }\n _writeToCache(item, value) {\n this._cache.put(item, value);\n if (!value.isTrusted && this._evictUntrustedReadingsTimeout === -1) {\n // Try reading again after some time\n this._evictUntrustedReadingsTimeout = mainWindow.setTimeout(() => {\n this._evictUntrustedReadingsTimeout = -1;\n this._evictUntrustedReadings();\n }, 5000);\n }\n }\n _evictUntrustedReadings() {\n const values = this._cache.getValues();\n let somethingRemoved = false;\n for (const item of values) {\n if (!item.isTrusted) {\n somethingRemoved = true;\n this._cache.remove(item);\n }\n }\n if (somethingRemoved) {\n this._onDidChange.fire();\n }\n }\n /**\n * Read font information.\n */\n readFontInfo(bareFontInfo) {\n if (!this._cache.has(bareFontInfo)) {\n let readConfig = this._actualReadFontInfo(bareFontInfo);\n if (readConfig.typicalHalfwidthCharacterWidth <= 2 || readConfig.typicalFullwidthCharacterWidth <= 2 || readConfig.spaceWidth <= 2 || readConfig.maxDigitWidth <= 2) {\n // Hey, it's Bug 14341 ... we couldn't read\n readConfig = new FontInfo({\n pixelRatio: browser.PixelRatio.value,\n fontFamily: readConfig.fontFamily,\n fontWeight: readConfig.fontWeight,\n fontSize: readConfig.fontSize,\n fontFeatureSettings: readConfig.fontFeatureSettings,\n fontVariationSettings: readConfig.fontVariationSettings,\n lineHeight: readConfig.lineHeight,\n letterSpacing: readConfig.letterSpacing,\n isMonospace: readConfig.isMonospace,\n typicalHalfwidthCharacterWidth: Math.max(readConfig.typicalHalfwidthCharacterWidth, 5),\n typicalFullwidthCharacterWidth: Math.max(readConfig.typicalFullwidthCharacterWidth, 5),\n canUseHalfwidthRightwardsArrow: readConfig.canUseHalfwidthRightwardsArrow,\n spaceWidth: Math.max(readConfig.spaceWidth, 5),\n middotWidth: Math.max(readConfig.middotWidth, 5),\n wsmiddotWidth: Math.max(readConfig.wsmiddotWidth, 5),\n maxDigitWidth: Math.max(readConfig.maxDigitWidth, 5),\n }, false);\n }\n this._writeToCache(bareFontInfo, readConfig);\n }\n return this._cache.get(bareFontInfo);\n }\n _createRequest(chr, type, all, monospace) {\n const result = new CharWidthRequest(chr, type);\n all.push(result);\n monospace === null || monospace === void 0 ? void 0 : monospace.push(result);\n return result;\n }\n _actualReadFontInfo(bareFontInfo) {\n const all = [];\n const monospace = [];\n const typicalHalfwidthCharacter = this._createRequest('n', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const typicalFullwidthCharacter = this._createRequest('\\uff4d', 0 /* CharWidthRequestType.Regular */, all, null);\n const space = this._createRequest(' ', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const digit0 = this._createRequest('0', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const digit1 = this._createRequest('1', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const digit2 = this._createRequest('2', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const digit3 = this._createRequest('3', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const digit4 = this._createRequest('4', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const digit5 = this._createRequest('5', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const digit6 = this._createRequest('6', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const digit7 = this._createRequest('7', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const digit8 = this._createRequest('8', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const digit9 = this._createRequest('9', 0 /* CharWidthRequestType.Regular */, all, monospace);\n // monospace test: used for whitespace rendering\n const rightwardsArrow = this._createRequest('\u2192', 0 /* CharWidthRequestType.Regular */, all, monospace);\n const halfwidthRightwardsArrow = this._createRequest('\uFFEB', 0 /* CharWidthRequestType.Regular */, all, null);\n // U+00B7 - MIDDLE DOT\n const middot = this._createRequest('\u00B7', 0 /* CharWidthRequestType.Regular */, all, monospace);\n // U+2E31 - WORD SEPARATOR MIDDLE DOT\n const wsmiddotWidth = this._createRequest(String.fromCharCode(0x2E31), 0 /* CharWidthRequestType.Regular */, all, null);\n // monospace test: some characters\n const monospaceTestChars = '|/-_ilm%';\n for (let i = 0, len = monospaceTestChars.length; i < len; i++) {\n this._createRequest(monospaceTestChars.charAt(i), 0 /* CharWidthRequestType.Regular */, all, monospace);\n this._createRequest(monospaceTestChars.charAt(i), 1 /* CharWidthRequestType.Italic */, all, monospace);\n this._createRequest(monospaceTestChars.charAt(i), 2 /* CharWidthRequestType.Bold */, all, monospace);\n }\n readCharWidths(bareFontInfo, all);\n const maxDigitWidth = Math.max(digit0.width, digit1.width, digit2.width, digit3.width, digit4.width, digit5.width, digit6.width, digit7.width, digit8.width, digit9.width);\n let isMonospace = (bareFontInfo.fontFeatureSettings === EditorFontLigatures.OFF);\n const referenceWidth = monospace[0].width;\n for (let i = 1, len = monospace.length; isMonospace && i < len; i++) {\n const diff = referenceWidth - monospace[i].width;\n if (diff < -0.001 || diff > 0.001) {\n isMonospace = false;\n break;\n }\n }\n let canUseHalfwidthRightwardsArrow = true;\n if (isMonospace && halfwidthRightwardsArrow.width !== referenceWidth) {\n // using a halfwidth rightwards arrow would break monospace...\n canUseHalfwidthRightwardsArrow = false;\n }\n if (halfwidthRightwardsArrow.width > rightwardsArrow.width) {\n // using a halfwidth rightwards arrow would paint a larger arrow than a regular rightwards arrow\n canUseHalfwidthRightwardsArrow = false;\n }\n return new FontInfo({\n pixelRatio: browser.PixelRatio.value,\n fontFamily: bareFontInfo.fontFamily,\n fontWeight: bareFontInfo.fontWeight,\n fontSize: bareFontInfo.fontSize,\n fontFeatureSettings: bareFontInfo.fontFeatureSettings,\n fontVariationSettings: bareFontInfo.fontVariationSettings,\n lineHeight: bareFontInfo.lineHeight,\n letterSpacing: bareFontInfo.letterSpacing,\n isMonospace: isMonospace,\n typicalHalfwidthCharacterWidth: typicalHalfwidthCharacter.width,\n typicalFullwidthCharacterWidth: typicalFullwidthCharacter.width,\n canUseHalfwidthRightwardsArrow: canUseHalfwidthRightwardsArrow,\n spaceWidth: space.width,\n middotWidth: middot.width,\n wsmiddotWidth: wsmiddotWidth.width,\n maxDigitWidth: maxDigitWidth\n }, true);\n }\n}\nclass FontMeasurementsCache {\n constructor() {\n this._keys = Object.create(null);\n this._values = Object.create(null);\n }\n has(item) {\n const itemId = item.getId();\n return !!this._values[itemId];\n }\n get(item) {\n const itemId = item.getId();\n return this._values[itemId];\n }\n put(item, value) {\n const itemId = item.getId();\n this._keys[itemId] = item;\n this._values[itemId] = value;\n }\n remove(item) {\n const itemId = item.getId();\n delete this._keys[itemId];\n delete this._values[itemId];\n }\n getValues() {\n return Object.keys(this._keys).map(id => this._values[id]);\n }\n}\nexport const FontMeasurements = new FontMeasurementsImpl();\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// ------ internal util\nexport var _util;\n(function (_util) {\n _util.serviceIds = new Map();\n _util.DI_TARGET = '$di$target';\n _util.DI_DEPENDENCIES = '$di$dependencies';\n function getServiceDependencies(ctor) {\n return ctor[_util.DI_DEPENDENCIES] || [];\n }\n _util.getServiceDependencies = getServiceDependencies;\n})(_util || (_util = {}));\nexport const IInstantiationService = createDecorator('instantiationService');\nfunction storeServiceDependency(id, target, index) {\n if (target[_util.DI_TARGET] === target) {\n target[_util.DI_DEPENDENCIES].push({ id, index });\n }\n else {\n target[_util.DI_DEPENDENCIES] = [{ id, index }];\n target[_util.DI_TARGET] = target;\n }\n}\n/**\n * The *only* valid way to create a {{ServiceIdentifier}}.\n */\nexport function createDecorator(serviceId) {\n if (_util.serviceIds.has(serviceId)) {\n return _util.serviceIds.get(serviceId);\n }\n const id = function (target, key, index) {\n if (arguments.length !== 3) {\n throw new Error('@IServiceName-decorator can only be used to decorate a parameter');\n }\n storeServiceDependency(id, target, index);\n };\n id.toString = () => serviceId;\n _util.serviceIds.set(serviceId, id);\n return id;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nexport const ICodeEditorService = createDecorator('codeEditorService');\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nexport const IModelService = createDecorator('modelService');\n", "import { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nexport const ITextModelService = createDecorator('textModelService');\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Emitter } from './event.js';\nimport { Disposable } from './lifecycle.js';\nimport * as nls from '../../nls.js';\nexport class Action extends Disposable {\n constructor(id, label = '', cssClass = '', enabled = true, actionCallback) {\n super();\n this._onDidChange = this._register(new Emitter());\n this.onDidChange = this._onDidChange.event;\n this._enabled = true;\n this._id = id;\n this._label = label;\n this._cssClass = cssClass;\n this._enabled = enabled;\n this._actionCallback = actionCallback;\n }\n get id() {\n return this._id;\n }\n get label() {\n return this._label;\n }\n set label(value) {\n this._setLabel(value);\n }\n _setLabel(value) {\n if (this._label !== value) {\n this._label = value;\n this._onDidChange.fire({ label: value });\n }\n }\n get tooltip() {\n return this._tooltip || '';\n }\n set tooltip(value) {\n this._setTooltip(value);\n }\n _setTooltip(value) {\n if (this._tooltip !== value) {\n this._tooltip = value;\n this._onDidChange.fire({ tooltip: value });\n }\n }\n get class() {\n return this._cssClass;\n }\n set class(value) {\n this._setClass(value);\n }\n _setClass(value) {\n if (this._cssClass !== value) {\n this._cssClass = value;\n this._onDidChange.fire({ class: value });\n }\n }\n get enabled() {\n return this._enabled;\n }\n set enabled(value) {\n this._setEnabled(value);\n }\n _setEnabled(value) {\n if (this._enabled !== value) {\n this._enabled = value;\n this._onDidChange.fire({ enabled: value });\n }\n }\n get checked() {\n return this._checked;\n }\n set checked(value) {\n this._setChecked(value);\n }\n _setChecked(value) {\n if (this._checked !== value) {\n this._checked = value;\n this._onDidChange.fire({ checked: value });\n }\n }\n async run(event, data) {\n if (this._actionCallback) {\n await this._actionCallback(event);\n }\n }\n}\nexport class ActionRunner extends Disposable {\n constructor() {\n super(...arguments);\n this._onWillRun = this._register(new Emitter());\n this.onWillRun = this._onWillRun.event;\n this._onDidRun = this._register(new Emitter());\n this.onDidRun = this._onDidRun.event;\n }\n async run(action, context) {\n if (!action.enabled) {\n return;\n }\n this._onWillRun.fire({ action });\n let error = undefined;\n try {\n await this.runAction(action, context);\n }\n catch (e) {\n error = e;\n }\n this._onDidRun.fire({ action, error });\n }\n async runAction(action, context) {\n await action.run(context);\n }\n}\nexport class Separator {\n constructor() {\n this.id = Separator.ID;\n this.label = '';\n this.tooltip = '';\n this.class = 'separator';\n this.enabled = false;\n this.checked = false;\n }\n /**\n * Joins all non-empty lists of actions with separators.\n */\n static join(...actionLists) {\n let out = [];\n for (const list of actionLists) {\n if (!list.length) {\n // skip\n }\n else if (out.length) {\n out = [...out, new Separator(), ...list];\n }\n else {\n out = list;\n }\n }\n return out;\n }\n async run() { }\n}\nSeparator.ID = 'vs.actions.separator';\nexport class SubmenuAction {\n get actions() { return this._actions; }\n constructor(id, label, actions, cssClass) {\n this.tooltip = '';\n this.enabled = true;\n this.checked = undefined;\n this.id = id;\n this.label = label;\n this.class = cssClass;\n this._actions = actions;\n }\n async run() { }\n}\nexport class EmptySubmenuAction extends Action {\n constructor() {\n super(EmptySubmenuAction.ID, nls.localize('submenu.empty', '(empty)'), undefined, false);\n }\n}\nEmptySubmenuAction.ID = 'vs.actions.empty';\nexport function toAction(props) {\n var _a, _b;\n return {\n id: props.id,\n label: props.label,\n class: props.class,\n enabled: (_a = props.enabled) !== null && _a !== void 0 ? _a : true,\n checked: (_b = props.checked) !== null && _b !== void 0 ? _b : false,\n run: async (...args) => props.run(...args),\n tooltip: props.label\n };\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Codicon } from './codicons.js';\nexport var ThemeColor;\n(function (ThemeColor) {\n function isThemeColor(obj) {\n return obj && typeof obj === 'object' && typeof obj.id === 'string';\n }\n ThemeColor.isThemeColor = isThemeColor;\n})(ThemeColor || (ThemeColor = {}));\nexport var ThemeIcon;\n(function (ThemeIcon) {\n ThemeIcon.iconNameSegment = '[A-Za-z0-9]+';\n ThemeIcon.iconNameExpression = '[A-Za-z0-9-]+';\n ThemeIcon.iconModifierExpression = '~[A-Za-z]+';\n ThemeIcon.iconNameCharacter = '[A-Za-z0-9~-]';\n const ThemeIconIdRegex = new RegExp(`^(${ThemeIcon.iconNameExpression})(${ThemeIcon.iconModifierExpression})?$`);\n function asClassNameArray(icon) {\n const match = ThemeIconIdRegex.exec(icon.id);\n if (!match) {\n return asClassNameArray(Codicon.error);\n }\n const [, id, modifier] = match;\n const classNames = ['codicon', 'codicon-' + id];\n if (modifier) {\n classNames.push('codicon-modifier-' + modifier.substring(1));\n }\n return classNames;\n }\n ThemeIcon.asClassNameArray = asClassNameArray;\n function asClassName(icon) {\n return asClassNameArray(icon).join(' ');\n }\n ThemeIcon.asClassName = asClassName;\n function asCSSSelector(icon) {\n return '.' + asClassNameArray(icon).join('.');\n }\n ThemeIcon.asCSSSelector = asCSSSelector;\n function isThemeIcon(obj) {\n return obj && typeof obj === 'object' && typeof obj.id === 'string' && (typeof obj.color === 'undefined' || ThemeColor.isThemeColor(obj.color));\n }\n ThemeIcon.isThemeIcon = isThemeIcon;\n const _regexFromString = new RegExp(`^\\\\$\\\\((${ThemeIcon.iconNameExpression}(?:${ThemeIcon.iconModifierExpression})?)\\\\)$`);\n function fromString(str) {\n const match = _regexFromString.exec(str);\n if (!match) {\n return undefined;\n }\n const [, name] = match;\n return { id: name };\n }\n ThemeIcon.fromString = fromString;\n function fromId(id) {\n return { id };\n }\n ThemeIcon.fromId = fromId;\n function modify(icon, modifier) {\n let id = icon.id;\n const tildeIndex = id.lastIndexOf('~');\n if (tildeIndex !== -1) {\n id = id.substring(0, tildeIndex);\n }\n if (modifier) {\n id = `${id}~${modifier}`;\n }\n return { id };\n }\n ThemeIcon.modify = modify;\n function getModifier(icon) {\n const tildeIndex = icon.id.lastIndexOf('~');\n if (tildeIndex !== -1) {\n return icon.id.substring(tildeIndex + 1);\n }\n return undefined;\n }\n ThemeIcon.getModifier = getModifier;\n function isEqual(ti1, ti2) {\n var _a, _b;\n return ti1.id === ti2.id && ((_a = ti1.color) === null || _a === void 0 ? void 0 : _a.id) === ((_b = ti2.color) === null || _b === void 0 ? void 0 : _b.id);\n }\n ThemeIcon.isEqual = isEqual;\n})(ThemeIcon || (ThemeIcon = {}));\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Emitter } from '../../../base/common/event.js';\nimport { Iterable } from '../../../base/common/iterator.js';\nimport { toDisposable } from '../../../base/common/lifecycle.js';\nimport { LinkedList } from '../../../base/common/linkedList.js';\nimport { validateConstraints } from '../../../base/common/types.js';\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\nexport const ICommandService = createDecorator('commandService');\nexport const CommandsRegistry = new class {\n constructor() {\n this._commands = new Map();\n this._onDidRegisterCommand = new Emitter();\n this.onDidRegisterCommand = this._onDidRegisterCommand.event;\n }\n registerCommand(idOrCommand, handler) {\n if (!idOrCommand) {\n throw new Error(`invalid command`);\n }\n if (typeof idOrCommand === 'string') {\n if (!handler) {\n throw new Error(`invalid command`);\n }\n return this.registerCommand({ id: idOrCommand, handler });\n }\n // add argument validation if rich command metadata is provided\n if (idOrCommand.metadata && Array.isArray(idOrCommand.metadata.args)) {\n const constraints = [];\n for (const arg of idOrCommand.metadata.args) {\n constraints.push(arg.constraint);\n }\n const actualHandler = idOrCommand.handler;\n idOrCommand.handler = function (accessor, ...args) {\n validateConstraints(args, constraints);\n return actualHandler(accessor, ...args);\n };\n }\n // find a place to store the command\n const { id } = idOrCommand;\n let commands = this._commands.get(id);\n if (!commands) {\n commands = new LinkedList();\n this._commands.set(id, commands);\n }\n const removeFn = commands.unshift(idOrCommand);\n const ret = toDisposable(() => {\n removeFn();\n const command = this._commands.get(id);\n if (command === null || command === void 0 ? void 0 : command.isEmpty()) {\n this._commands.delete(id);\n }\n });\n // tell the world about this command\n this._onDidRegisterCommand.fire(id);\n return ret;\n }\n registerCommandAlias(oldId, newId) {\n return CommandsRegistry.registerCommand(oldId, (accessor, ...args) => accessor.get(ICommandService).executeCommand(newId, ...args));\n }\n getCommand(id) {\n const list = this._commands.get(id);\n if (!list || list.isEmpty()) {\n return undefined;\n }\n return Iterable.first(list);\n }\n getCommands() {\n const result = new Map();\n for (const key of this._commands.keys()) {\n const command = this.getCommand(key);\n if (command) {\n result.set(key, command);\n }\n }\n return result;\n }\n};\nCommandsRegistry.registerCommand('noop', () => { });\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { illegalState } from '../../../base/common/errors.js';\nimport { localize } from '../../../nls.js';\nfunction hintDidYouMean(...meant) {\n switch (meant.length) {\n case 1:\n return localize('contextkey.scanner.hint.didYouMean1', \"Did you mean {0}?\", meant[0]);\n case 2:\n return localize('contextkey.scanner.hint.didYouMean2', \"Did you mean {0} or {1}?\", meant[0], meant[1]);\n case 3:\n return localize('contextkey.scanner.hint.didYouMean3', \"Did you mean {0}, {1} or {2}?\", meant[0], meant[1], meant[2]);\n default: // we just don't expect that many\n return undefined;\n }\n}\nconst hintDidYouForgetToOpenOrCloseQuote = localize('contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote', \"Did you forget to open or close the quote?\");\nconst hintDidYouForgetToEscapeSlash = localize('contextkey.scanner.hint.didYouForgetToEscapeSlash', \"Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\\\\\/\\'.\");\n/**\n * A simple scanner for context keys.\n *\n * Example:\n *\n * ```ts\n * const scanner = new Scanner().reset('resourceFileName =~ /docker/ && !config.docker.enabled');\n * const tokens = [...scanner];\n * if (scanner.errorTokens.length > 0) {\n * scanner.errorTokens.forEach(err => console.error(`Unexpected token at ${err.offset}: ${err.lexeme}\\nHint: ${err.additional}`));\n * } else {\n * // process tokens\n * }\n * ```\n */\nexport class Scanner {\n constructor() {\n this._input = '';\n this._start = 0;\n this._current = 0;\n this._tokens = [];\n this._errors = [];\n // u - unicode, y - sticky // TODO@ulugbekna: we accept double quotes as part of the string rather than as a delimiter (to preserve old parser's behavior)\n this.stringRe = /[a-zA-Z0-9_<>\\-\\./\\\\:\\*\\?\\+\\[\\]\\^,#@;\"%\\$\\p{L}-]+/uy;\n }\n static getLexeme(token) {\n switch (token.type) {\n case 0 /* TokenType.LParen */:\n return '(';\n case 1 /* TokenType.RParen */:\n return ')';\n case 2 /* TokenType.Neg */:\n return '!';\n case 3 /* TokenType.Eq */:\n return token.isTripleEq ? '===' : '==';\n case 4 /* TokenType.NotEq */:\n return token.isTripleEq ? '!==' : '!=';\n case 5 /* TokenType.Lt */:\n return '<';\n case 6 /* TokenType.LtEq */:\n return '<=';\n case 7 /* TokenType.Gt */:\n return '>=';\n case 8 /* TokenType.GtEq */:\n return '>=';\n case 9 /* TokenType.RegexOp */:\n return '=~';\n case 10 /* TokenType.RegexStr */:\n return token.lexeme;\n case 11 /* TokenType.True */:\n return 'true';\n case 12 /* TokenType.False */:\n return 'false';\n case 13 /* TokenType.In */:\n return 'in';\n case 14 /* TokenType.Not */:\n return 'not';\n case 15 /* TokenType.And */:\n return '&&';\n case 16 /* TokenType.Or */:\n return '||';\n case 17 /* TokenType.Str */:\n return token.lexeme;\n case 18 /* TokenType.QuotedStr */:\n return token.lexeme;\n case 19 /* TokenType.Error */:\n return token.lexeme;\n case 20 /* TokenType.EOF */:\n return 'EOF';\n default:\n throw illegalState(`unhandled token type: ${JSON.stringify(token)}; have you forgotten to add a case?`);\n }\n }\n reset(value) {\n this._input = value;\n this._start = 0;\n this._current = 0;\n this._tokens = [];\n this._errors = [];\n return this;\n }\n scan() {\n while (!this._isAtEnd()) {\n this._start = this._current;\n const ch = this._advance();\n switch (ch) {\n case 40 /* CharCode.OpenParen */:\n this._addToken(0 /* TokenType.LParen */);\n break;\n case 41 /* CharCode.CloseParen */:\n this._addToken(1 /* TokenType.RParen */);\n break;\n case 33 /* CharCode.ExclamationMark */:\n if (this._match(61 /* CharCode.Equals */)) {\n const isTripleEq = this._match(61 /* CharCode.Equals */); // eat last `=` if `!==`\n this._tokens.push({ type: 4 /* TokenType.NotEq */, offset: this._start, isTripleEq });\n }\n else {\n this._addToken(2 /* TokenType.Neg */);\n }\n break;\n case 39 /* CharCode.SingleQuote */:\n this._quotedString();\n break;\n case 47 /* CharCode.Slash */:\n this._regex();\n break;\n case 61 /* CharCode.Equals */:\n if (this._match(61 /* CharCode.Equals */)) { // support `==`\n const isTripleEq = this._match(61 /* CharCode.Equals */); // eat last `=` if `===`\n this._tokens.push({ type: 3 /* TokenType.Eq */, offset: this._start, isTripleEq });\n }\n else if (this._match(126 /* CharCode.Tilde */)) {\n this._addToken(9 /* TokenType.RegexOp */);\n }\n else {\n this._error(hintDidYouMean('==', '=~'));\n }\n break;\n case 60 /* CharCode.LessThan */:\n this._addToken(this._match(61 /* CharCode.Equals */) ? 6 /* TokenType.LtEq */ : 5 /* TokenType.Lt */);\n break;\n case 62 /* CharCode.GreaterThan */:\n this._addToken(this._match(61 /* CharCode.Equals */) ? 8 /* TokenType.GtEq */ : 7 /* TokenType.Gt */);\n break;\n case 38 /* CharCode.Ampersand */:\n if (this._match(38 /* CharCode.Ampersand */)) {\n this._addToken(15 /* TokenType.And */);\n }\n else {\n this._error(hintDidYouMean('&&'));\n }\n break;\n case 124 /* CharCode.Pipe */:\n if (this._match(124 /* CharCode.Pipe */)) {\n this._addToken(16 /* TokenType.Or */);\n }\n else {\n this._error(hintDidYouMean('||'));\n }\n break;\n // TODO@ulugbekna: 1) rewrite using a regex 2) reconsider what characters are considered whitespace, including unicode, nbsp, etc.\n case 32 /* CharCode.Space */:\n case 13 /* CharCode.CarriageReturn */:\n case 9 /* CharCode.Tab */:\n case 10 /* CharCode.LineFeed */:\n case 160 /* CharCode.NoBreakSpace */: //  \n break;\n default:\n this._string();\n }\n }\n this._start = this._current;\n this._addToken(20 /* TokenType.EOF */);\n return Array.from(this._tokens);\n }\n _match(expected) {\n if (this._isAtEnd()) {\n return false;\n }\n if (this._input.charCodeAt(this._current) !== expected) {\n return false;\n }\n this._current++;\n return true;\n }\n _advance() {\n return this._input.charCodeAt(this._current++);\n }\n _peek() {\n return this._isAtEnd() ? 0 /* CharCode.Null */ : this._input.charCodeAt(this._current);\n }\n _addToken(type) {\n this._tokens.push({ type, offset: this._start });\n }\n _error(additional) {\n const offset = this._start;\n const lexeme = this._input.substring(this._start, this._current);\n const errToken = { type: 19 /* TokenType.Error */, offset: this._start, lexeme };\n this._errors.push({ offset, lexeme, additionalInfo: additional });\n this._tokens.push(errToken);\n }\n _string() {\n this.stringRe.lastIndex = this._start;\n const match = this.stringRe.exec(this._input);\n if (match) {\n this._current = this._start + match[0].length;\n const lexeme = this._input.substring(this._start, this._current);\n const keyword = Scanner._keywords.get(lexeme);\n if (keyword) {\n this._addToken(keyword);\n }\n else {\n this._tokens.push({ type: 17 /* TokenType.Str */, lexeme, offset: this._start });\n }\n }\n }\n // captures the lexeme without the leading and trailing '\n _quotedString() {\n while (this._peek() !== 39 /* CharCode.SingleQuote */ && !this._isAtEnd()) { // TODO@ulugbekna: add support for escaping ' ?\n this._advance();\n }\n if (this._isAtEnd()) {\n this._error(hintDidYouForgetToOpenOrCloseQuote);\n return;\n }\n // consume the closing '\n this._advance();\n this._tokens.push({ type: 18 /* TokenType.QuotedStr */, lexeme: this._input.substring(this._start + 1, this._current - 1), offset: this._start + 1 });\n }\n /*\n * Lexing a regex expression: /.../[igsmyu]*\n * Based on https://github.com/microsoft/TypeScript/blob/9247ef115e617805983740ba795d7a8164babf89/src/compiler/scanner.ts#L2129-L2181\n *\n * Note that we want slashes within a regex to be escaped, e.g., /file:\\\\/\\\\/\\\\// should match `file:///`\n */\n _regex() {\n let p = this._current;\n let inEscape = false;\n let inCharacterClass = false;\n while (true) {\n if (p >= this._input.length) {\n this._current = p;\n this._error(hintDidYouForgetToEscapeSlash);\n return;\n }\n const ch = this._input.charCodeAt(p);\n if (inEscape) { // parsing an escape character\n inEscape = false;\n }\n else if (ch === 47 /* CharCode.Slash */ && !inCharacterClass) { // end of regex\n p++;\n break;\n }\n else if (ch === 91 /* CharCode.OpenSquareBracket */) {\n inCharacterClass = true;\n }\n else if (ch === 92 /* CharCode.Backslash */) {\n inEscape = true;\n }\n else if (ch === 93 /* CharCode.CloseSquareBracket */) {\n inCharacterClass = false;\n }\n p++;\n }\n // Consume flags // TODO@ulugbekna: use regex instead\n while (p < this._input.length && Scanner._regexFlags.has(this._input.charCodeAt(p))) {\n p++;\n }\n this._current = p;\n const lexeme = this._input.substring(this._start, this._current);\n this._tokens.push({ type: 10 /* TokenType.RegexStr */, lexeme, offset: this._start });\n }\n _isAtEnd() {\n return this._current >= this._input.length;\n }\n}\nScanner._regexFlags = new Set(['i', 'g', 's', 'm', 'y', 'u'].map(ch => ch.charCodeAt(0)));\nScanner._keywords = new Map([\n ['not', 14 /* TokenType.Not */],\n ['in', 13 /* TokenType.In */],\n ['false', 12 /* TokenType.False */],\n ['true', 11 /* TokenType.True */],\n]);\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { isChrome, isEdge, isFirefox, isLinux, isMacintosh, isSafari, isWeb, isWindows } from '../../../base/common/platform.js';\nimport { isFalsyOrWhitespace } from '../../../base/common/strings.js';\nimport { Scanner } from './scanner.js';\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\nimport { localize } from '../../../nls.js';\nconst CONSTANT_VALUES = new Map();\nCONSTANT_VALUES.set('false', false);\nCONSTANT_VALUES.set('true', true);\nCONSTANT_VALUES.set('isMac', isMacintosh);\nCONSTANT_VALUES.set('isLinux', isLinux);\nCONSTANT_VALUES.set('isWindows', isWindows);\nCONSTANT_VALUES.set('isWeb', isWeb);\nCONSTANT_VALUES.set('isMacNative', isMacintosh && !isWeb);\nCONSTANT_VALUES.set('isEdge', isEdge);\nCONSTANT_VALUES.set('isFirefox', isFirefox);\nCONSTANT_VALUES.set('isChrome', isChrome);\nCONSTANT_VALUES.set('isSafari', isSafari);\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst defaultConfig = {\n regexParsingWithErrorRecovery: true\n};\nconst errorEmptyString = localize('contextkey.parser.error.emptyString', \"Empty context key expression\");\nconst hintEmptyString = localize('contextkey.parser.error.emptyString.hint', \"Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively.\");\nconst errorNoInAfterNot = localize('contextkey.parser.error.noInAfterNot', \"'in' after 'not'.\");\nconst errorClosingParenthesis = localize('contextkey.parser.error.closingParenthesis', \"closing parenthesis ')'\");\nconst errorUnexpectedToken = localize('contextkey.parser.error.unexpectedToken', \"Unexpected token\");\nconst hintUnexpectedToken = localize('contextkey.parser.error.unexpectedToken.hint', \"Did you forget to put && or || before the token?\");\nconst errorUnexpectedEOF = localize('contextkey.parser.error.unexpectedEOF', \"Unexpected end of expression\");\nconst hintUnexpectedEOF = localize('contextkey.parser.error.unexpectedEOF.hint', \"Did you forget to put a context key?\");\n/**\n * A parser for context key expressions.\n *\n * Example:\n * ```ts\n * const parser = new Parser();\n * const expr = parser.parse('foo == \"bar\" && baz == true');\n *\n * if (expr === undefined) {\n * \t// there were lexing or parsing errors\n * \t// process lexing errors with `parser.lexingErrors`\n * // process parsing errors with `parser.parsingErrors`\n * } else {\n * \t// expr is a valid expression\n * }\n * ```\n */\nexport class Parser {\n constructor(_config = defaultConfig) {\n this._config = _config;\n // lifetime note: `_scanner` lives as long as the parser does, i.e., is not reset between calls to `parse`\n this._scanner = new Scanner();\n // lifetime note: `_tokens`, `_current`, and `_parsingErrors` must be reset between calls to `parse`\n this._tokens = [];\n this._current = 0; // invariant: 0 <= this._current < this._tokens.length ; any incrementation of this value must first call `_isAtEnd`\n this._parsingErrors = [];\n this._flagsGYRe = /g|y/g;\n }\n /**\n * Parse a context key expression.\n *\n * @param input the expression to parse\n * @returns the parsed expression or `undefined` if there's an error - call `lexingErrors` and `parsingErrors` to see the errors\n */\n parse(input) {\n if (input === '') {\n this._parsingErrors.push({ message: errorEmptyString, offset: 0, lexeme: '', additionalInfo: hintEmptyString });\n return undefined;\n }\n this._tokens = this._scanner.reset(input).scan();\n // @ulugbekna: we do not stop parsing if there are lexing errors to be able to reconstruct regexes with unescaped slashes; TODO@ulugbekna: make this respect config option for recovery\n this._current = 0;\n this._parsingErrors = [];\n try {\n const expr = this._expr();\n if (!this._isAtEnd()) {\n const peek = this._peek();\n const additionalInfo = peek.type === 17 /* TokenType.Str */ ? hintUnexpectedToken : undefined;\n this._parsingErrors.push({ message: errorUnexpectedToken, offset: peek.offset, lexeme: Scanner.getLexeme(peek), additionalInfo });\n throw Parser._parseError;\n }\n return expr;\n }\n catch (e) {\n if (!(e === Parser._parseError)) {\n throw e;\n }\n return undefined;\n }\n }\n _expr() {\n return this._or();\n }\n _or() {\n const expr = [this._and()];\n while (this._matchOne(16 /* TokenType.Or */)) {\n const right = this._and();\n expr.push(right);\n }\n return expr.length === 1 ? expr[0] : ContextKeyExpr.or(...expr);\n }\n _and() {\n const expr = [this._term()];\n while (this._matchOne(15 /* TokenType.And */)) {\n const right = this._term();\n expr.push(right);\n }\n return expr.length === 1 ? expr[0] : ContextKeyExpr.and(...expr);\n }\n _term() {\n if (this._matchOne(2 /* TokenType.Neg */)) {\n const peek = this._peek();\n switch (peek.type) {\n case 11 /* TokenType.True */:\n this._advance();\n return ContextKeyFalseExpr.INSTANCE;\n case 12 /* TokenType.False */:\n this._advance();\n return ContextKeyTrueExpr.INSTANCE;\n case 0 /* TokenType.LParen */: {\n this._advance();\n const expr = this._expr();\n this._consume(1 /* TokenType.RParen */, errorClosingParenthesis);\n return expr === null || expr === void 0 ? void 0 : expr.negate();\n }\n case 17 /* TokenType.Str */:\n this._advance();\n return ContextKeyNotExpr.create(peek.lexeme);\n default:\n throw this._errExpectedButGot(`KEY | true | false | '(' expression ')'`, peek);\n }\n }\n return this._primary();\n }\n _primary() {\n const peek = this._peek();\n switch (peek.type) {\n case 11 /* TokenType.True */:\n this._advance();\n return ContextKeyExpr.true();\n case 12 /* TokenType.False */:\n this._advance();\n return ContextKeyExpr.false();\n case 0 /* TokenType.LParen */: {\n this._advance();\n const expr = this._expr();\n this._consume(1 /* TokenType.RParen */, errorClosingParenthesis);\n return expr;\n }\n case 17 /* TokenType.Str */: {\n // KEY\n const key = peek.lexeme;\n this._advance();\n // =~ regex\n if (this._matchOne(9 /* TokenType.RegexOp */)) {\n // @ulugbekna: we need to reconstruct the regex from the tokens because some extensions use unescaped slashes in regexes\n const expr = this._peek();\n if (!this._config.regexParsingWithErrorRecovery) {\n this._advance();\n if (expr.type !== 10 /* TokenType.RegexStr */) {\n throw this._errExpectedButGot(`REGEX`, expr);\n }\n const regexLexeme = expr.lexeme;\n const closingSlashIndex = regexLexeme.lastIndexOf('/');\n const flags = closingSlashIndex === regexLexeme.length - 1 ? undefined : this._removeFlagsGY(regexLexeme.substring(closingSlashIndex + 1));\n let regexp;\n try {\n regexp = new RegExp(regexLexeme.substring(1, closingSlashIndex), flags);\n }\n catch (e) {\n throw this._errExpectedButGot(`REGEX`, expr);\n }\n return ContextKeyRegexExpr.create(key, regexp);\n }\n switch (expr.type) {\n case 10 /* TokenType.RegexStr */:\n case 19 /* TokenType.Error */: { // also handle an ErrorToken in case of smth such as /(/file)/\n const lexemeReconstruction = [expr.lexeme]; // /REGEX/ or /REGEX/FLAGS\n this._advance();\n let followingToken = this._peek();\n let parenBalance = 0;\n for (let i = 0; i < expr.lexeme.length; i++) {\n if (expr.lexeme.charCodeAt(i) === 40 /* CharCode.OpenParen */) {\n parenBalance++;\n }\n else if (expr.lexeme.charCodeAt(i) === 41 /* CharCode.CloseParen */) {\n parenBalance--;\n }\n }\n while (!this._isAtEnd() && followingToken.type !== 15 /* TokenType.And */ && followingToken.type !== 16 /* TokenType.Or */) {\n switch (followingToken.type) {\n case 0 /* TokenType.LParen */:\n parenBalance++;\n break;\n case 1 /* TokenType.RParen */:\n parenBalance--;\n break;\n case 10 /* TokenType.RegexStr */:\n case 18 /* TokenType.QuotedStr */:\n for (let i = 0; i < followingToken.lexeme.length; i++) {\n if (followingToken.lexeme.charCodeAt(i) === 40 /* CharCode.OpenParen */) {\n parenBalance++;\n }\n else if (expr.lexeme.charCodeAt(i) === 41 /* CharCode.CloseParen */) {\n parenBalance--;\n }\n }\n }\n if (parenBalance < 0) {\n break;\n }\n lexemeReconstruction.push(Scanner.getLexeme(followingToken));\n this._advance();\n followingToken = this._peek();\n }\n const regexLexeme = lexemeReconstruction.join('');\n const closingSlashIndex = regexLexeme.lastIndexOf('/');\n const flags = closingSlashIndex === regexLexeme.length - 1 ? undefined : this._removeFlagsGY(regexLexeme.substring(closingSlashIndex + 1));\n let regexp;\n try {\n regexp = new RegExp(regexLexeme.substring(1, closingSlashIndex), flags);\n }\n catch (e) {\n throw this._errExpectedButGot(`REGEX`, expr);\n }\n return ContextKeyExpr.regex(key, regexp);\n }\n case 18 /* TokenType.QuotedStr */: {\n const serializedValue = expr.lexeme;\n this._advance();\n // replicate old regex parsing behavior\n let regex = null;\n if (!isFalsyOrWhitespace(serializedValue)) {\n const start = serializedValue.indexOf('/');\n const end = serializedValue.lastIndexOf('/');\n if (start !== end && start >= 0) {\n const value = serializedValue.slice(start + 1, end);\n const caseIgnoreFlag = serializedValue[end + 1] === 'i' ? 'i' : '';\n try {\n regex = new RegExp(value, caseIgnoreFlag);\n }\n catch (_e) {\n throw this._errExpectedButGot(`REGEX`, expr);\n }\n }\n }\n if (regex === null) {\n throw this._errExpectedButGot('REGEX', expr);\n }\n return ContextKeyRegexExpr.create(key, regex);\n }\n default:\n throw this._errExpectedButGot('REGEX', this._peek());\n }\n }\n // [ 'not' 'in' value ]\n if (this._matchOne(14 /* TokenType.Not */)) {\n this._consume(13 /* TokenType.In */, errorNoInAfterNot);\n const right = this._value();\n return ContextKeyExpr.notIn(key, right);\n }\n // [ ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in') value ]\n const maybeOp = this._peek().type;\n switch (maybeOp) {\n case 3 /* TokenType.Eq */: {\n this._advance();\n const right = this._value();\n if (this._previous().type === 18 /* TokenType.QuotedStr */) { // to preserve old parser behavior: \"foo == 'true'\" is preserved as \"foo == 'true'\", but \"foo == true\" is optimized as \"foo\"\n return ContextKeyExpr.equals(key, right);\n }\n switch (right) {\n case 'true':\n return ContextKeyExpr.has(key);\n case 'false':\n return ContextKeyExpr.not(key);\n default:\n return ContextKeyExpr.equals(key, right);\n }\n }\n case 4 /* TokenType.NotEq */: {\n this._advance();\n const right = this._value();\n if (this._previous().type === 18 /* TokenType.QuotedStr */) { // same as above with \"foo != 'true'\"\n return ContextKeyExpr.notEquals(key, right);\n }\n switch (right) {\n case 'true':\n return ContextKeyExpr.not(key);\n case 'false':\n return ContextKeyExpr.has(key);\n default:\n return ContextKeyExpr.notEquals(key, right);\n }\n }\n // TODO: ContextKeyExpr.smaller(key, right) accepts only `number` as `right` AND during eval of this node, we just eval to `false` if `right` is not a number\n // consequently, package.json linter should _warn_ the user if they're passing undesired things to ops\n case 5 /* TokenType.Lt */:\n this._advance();\n return ContextKeySmallerExpr.create(key, this._value());\n case 6 /* TokenType.LtEq */:\n this._advance();\n return ContextKeySmallerEqualsExpr.create(key, this._value());\n case 7 /* TokenType.Gt */:\n this._advance();\n return ContextKeyGreaterExpr.create(key, this._value());\n case 8 /* TokenType.GtEq */:\n this._advance();\n return ContextKeyGreaterEqualsExpr.create(key, this._value());\n case 13 /* TokenType.In */:\n this._advance();\n return ContextKeyExpr.in(key, this._value());\n default:\n return ContextKeyExpr.has(key);\n }\n }\n case 20 /* TokenType.EOF */:\n this._parsingErrors.push({ message: errorUnexpectedEOF, offset: peek.offset, lexeme: '', additionalInfo: hintUnexpectedEOF });\n throw Parser._parseError;\n default:\n throw this._errExpectedButGot(`true | false | KEY \\n\\t| KEY '=~' REGEX \\n\\t| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`, this._peek());\n }\n }\n _value() {\n const token = this._peek();\n switch (token.type) {\n case 17 /* TokenType.Str */:\n case 18 /* TokenType.QuotedStr */:\n this._advance();\n return token.lexeme;\n case 11 /* TokenType.True */:\n this._advance();\n return 'true';\n case 12 /* TokenType.False */:\n this._advance();\n return 'false';\n case 13 /* TokenType.In */: // we support `in` as a value, e.g., \"when\": \"languageId == in\" - exists in existing extensions\n this._advance();\n return 'in';\n default:\n // this allows \"when\": \"foo == \" which's used by existing extensions\n // we do not call `_advance` on purpose - we don't want to eat unintended tokens\n return '';\n }\n }\n _removeFlagsGY(flags) {\n return flags.replaceAll(this._flagsGYRe, '');\n }\n // careful: this can throw if current token is the initial one (ie index = 0)\n _previous() {\n return this._tokens[this._current - 1];\n }\n _matchOne(token) {\n if (this._check(token)) {\n this._advance();\n return true;\n }\n return false;\n }\n _advance() {\n if (!this._isAtEnd()) {\n this._current++;\n }\n return this._previous();\n }\n _consume(type, message) {\n if (this._check(type)) {\n return this._advance();\n }\n throw this._errExpectedButGot(message, this._peek());\n }\n _errExpectedButGot(expected, got, additionalInfo) {\n const message = localize('contextkey.parser.error.expectedButGot', \"Expected: {0}\\nReceived: '{1}'.\", expected, Scanner.getLexeme(got));\n const offset = got.offset;\n const lexeme = Scanner.getLexeme(got);\n this._parsingErrors.push({ message, offset, lexeme, additionalInfo });\n return Parser._parseError;\n }\n _check(type) {\n return this._peek().type === type;\n }\n _peek() {\n return this._tokens[this._current];\n }\n _isAtEnd() {\n return this._peek().type === 20 /* TokenType.EOF */;\n }\n}\n// Note: this doesn't produce an exact syntax tree but a normalized one\n// ContextKeyExpression's that we use as AST nodes do not expose constructors that do not normalize\nParser._parseError = new Error();\nexport class ContextKeyExpr {\n static false() {\n return ContextKeyFalseExpr.INSTANCE;\n }\n static true() {\n return ContextKeyTrueExpr.INSTANCE;\n }\n static has(key) {\n return ContextKeyDefinedExpr.create(key);\n }\n static equals(key, value) {\n return ContextKeyEqualsExpr.create(key, value);\n }\n static notEquals(key, value) {\n return ContextKeyNotEqualsExpr.create(key, value);\n }\n static regex(key, value) {\n return ContextKeyRegexExpr.create(key, value);\n }\n static in(key, value) {\n return ContextKeyInExpr.create(key, value);\n }\n static notIn(key, value) {\n return ContextKeyNotInExpr.create(key, value);\n }\n static not(key) {\n return ContextKeyNotExpr.create(key);\n }\n static and(...expr) {\n return ContextKeyAndExpr.create(expr, null, true);\n }\n static or(...expr) {\n return ContextKeyOrExpr.create(expr, null, true);\n }\n static deserialize(serialized) {\n if (serialized === undefined || serialized === null) { // an empty string needs to be handled by the parser to get a corresponding parsing error reported\n return undefined;\n }\n const expr = this._parser.parse(serialized);\n return expr;\n }\n}\nContextKeyExpr._parser = new Parser({ regexParsingWithErrorRecovery: false });\nexport function expressionsAreEqualWithConstantSubstitution(a, b) {\n const aExpr = a ? a.substituteConstants() : undefined;\n const bExpr = b ? b.substituteConstants() : undefined;\n if (!aExpr && !bExpr) {\n return true;\n }\n if (!aExpr || !bExpr) {\n return false;\n }\n return aExpr.equals(bExpr);\n}\nfunction cmp(a, b) {\n return a.cmp(b);\n}\nexport class ContextKeyFalseExpr {\n constructor() {\n this.type = 0 /* ContextKeyExprType.False */;\n }\n cmp(other) {\n return this.type - other.type;\n }\n equals(other) {\n return (other.type === this.type);\n }\n substituteConstants() {\n return this;\n }\n evaluate(context) {\n return false;\n }\n serialize() {\n return 'false';\n }\n keys() {\n return [];\n }\n negate() {\n return ContextKeyTrueExpr.INSTANCE;\n }\n}\nContextKeyFalseExpr.INSTANCE = new ContextKeyFalseExpr();\nexport class ContextKeyTrueExpr {\n constructor() {\n this.type = 1 /* ContextKeyExprType.True */;\n }\n cmp(other) {\n return this.type - other.type;\n }\n equals(other) {\n return (other.type === this.type);\n }\n substituteConstants() {\n return this;\n }\n evaluate(context) {\n return true;\n }\n serialize() {\n return 'true';\n }\n keys() {\n return [];\n }\n negate() {\n return ContextKeyFalseExpr.INSTANCE;\n }\n}\nContextKeyTrueExpr.INSTANCE = new ContextKeyTrueExpr();\nexport class ContextKeyDefinedExpr {\n static create(key, negated = null) {\n const constantValue = CONSTANT_VALUES.get(key);\n if (typeof constantValue === 'boolean') {\n return constantValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE;\n }\n return new ContextKeyDefinedExpr(key, negated);\n }\n constructor(key, negated) {\n this.key = key;\n this.negated = negated;\n this.type = 2 /* ContextKeyExprType.Defined */;\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n return cmp1(this.key, other.key);\n }\n equals(other) {\n if (other.type === this.type) {\n return (this.key === other.key);\n }\n return false;\n }\n substituteConstants() {\n const constantValue = CONSTANT_VALUES.get(this.key);\n if (typeof constantValue === 'boolean') {\n return constantValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE;\n }\n return this;\n }\n evaluate(context) {\n return (!!context.getValue(this.key));\n }\n serialize() {\n return this.key;\n }\n keys() {\n return [this.key];\n }\n negate() {\n if (!this.negated) {\n this.negated = ContextKeyNotExpr.create(this.key, this);\n }\n return this.negated;\n }\n}\nexport class ContextKeyEqualsExpr {\n static create(key, value, negated = null) {\n if (typeof value === 'boolean') {\n return (value ? ContextKeyDefinedExpr.create(key, negated) : ContextKeyNotExpr.create(key, negated));\n }\n const constantValue = CONSTANT_VALUES.get(key);\n if (typeof constantValue === 'boolean') {\n const trueValue = constantValue ? 'true' : 'false';\n return (value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE);\n }\n return new ContextKeyEqualsExpr(key, value, negated);\n }\n constructor(key, value, negated) {\n this.key = key;\n this.value = value;\n this.negated = negated;\n this.type = 4 /* ContextKeyExprType.Equals */;\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n return cmp2(this.key, this.value, other.key, other.value);\n }\n equals(other) {\n if (other.type === this.type) {\n return (this.key === other.key && this.value === other.value);\n }\n return false;\n }\n substituteConstants() {\n const constantValue = CONSTANT_VALUES.get(this.key);\n if (typeof constantValue === 'boolean') {\n const trueValue = constantValue ? 'true' : 'false';\n return (this.value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE);\n }\n return this;\n }\n evaluate(context) {\n // Intentional ==\n // eslint-disable-next-line eqeqeq\n return (context.getValue(this.key) == this.value);\n }\n serialize() {\n return `${this.key} == '${this.value}'`;\n }\n keys() {\n return [this.key];\n }\n negate() {\n if (!this.negated) {\n this.negated = ContextKeyNotEqualsExpr.create(this.key, this.value, this);\n }\n return this.negated;\n }\n}\nexport class ContextKeyInExpr {\n static create(key, valueKey) {\n return new ContextKeyInExpr(key, valueKey);\n }\n constructor(key, valueKey) {\n this.key = key;\n this.valueKey = valueKey;\n this.type = 10 /* ContextKeyExprType.In */;\n this.negated = null;\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n return cmp2(this.key, this.valueKey, other.key, other.valueKey);\n }\n equals(other) {\n if (other.type === this.type) {\n return (this.key === other.key && this.valueKey === other.valueKey);\n }\n return false;\n }\n substituteConstants() {\n return this;\n }\n evaluate(context) {\n const source = context.getValue(this.valueKey);\n const item = context.getValue(this.key);\n if (Array.isArray(source)) {\n return source.includes(item);\n }\n if (typeof item === 'string' && typeof source === 'object' && source !== null) {\n return hasOwnProperty.call(source, item);\n }\n return false;\n }\n serialize() {\n return `${this.key} in '${this.valueKey}'`;\n }\n keys() {\n return [this.key, this.valueKey];\n }\n negate() {\n if (!this.negated) {\n this.negated = ContextKeyNotInExpr.create(this.key, this.valueKey);\n }\n return this.negated;\n }\n}\nexport class ContextKeyNotInExpr {\n static create(key, valueKey) {\n return new ContextKeyNotInExpr(key, valueKey);\n }\n constructor(key, valueKey) {\n this.key = key;\n this.valueKey = valueKey;\n this.type = 11 /* ContextKeyExprType.NotIn */;\n this._negated = ContextKeyInExpr.create(key, valueKey);\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n return this._negated.cmp(other._negated);\n }\n equals(other) {\n if (other.type === this.type) {\n return this._negated.equals(other._negated);\n }\n return false;\n }\n substituteConstants() {\n return this;\n }\n evaluate(context) {\n return !this._negated.evaluate(context);\n }\n serialize() {\n return `${this.key} not in '${this.valueKey}'`;\n }\n keys() {\n return this._negated.keys();\n }\n negate() {\n return this._negated;\n }\n}\nexport class ContextKeyNotEqualsExpr {\n static create(key, value, negated = null) {\n if (typeof value === 'boolean') {\n if (value) {\n return ContextKeyNotExpr.create(key, negated);\n }\n return ContextKeyDefinedExpr.create(key, negated);\n }\n const constantValue = CONSTANT_VALUES.get(key);\n if (typeof constantValue === 'boolean') {\n const falseValue = constantValue ? 'true' : 'false';\n return (value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);\n }\n return new ContextKeyNotEqualsExpr(key, value, negated);\n }\n constructor(key, value, negated) {\n this.key = key;\n this.value = value;\n this.negated = negated;\n this.type = 5 /* ContextKeyExprType.NotEquals */;\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n return cmp2(this.key, this.value, other.key, other.value);\n }\n equals(other) {\n if (other.type === this.type) {\n return (this.key === other.key && this.value === other.value);\n }\n return false;\n }\n substituteConstants() {\n const constantValue = CONSTANT_VALUES.get(this.key);\n if (typeof constantValue === 'boolean') {\n const falseValue = constantValue ? 'true' : 'false';\n return (this.value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);\n }\n return this;\n }\n evaluate(context) {\n // Intentional !=\n // eslint-disable-next-line eqeqeq\n return (context.getValue(this.key) != this.value);\n }\n serialize() {\n return `${this.key} != '${this.value}'`;\n }\n keys() {\n return [this.key];\n }\n negate() {\n if (!this.negated) {\n this.negated = ContextKeyEqualsExpr.create(this.key, this.value, this);\n }\n return this.negated;\n }\n}\nexport class ContextKeyNotExpr {\n static create(key, negated = null) {\n const constantValue = CONSTANT_VALUES.get(key);\n if (typeof constantValue === 'boolean') {\n return (constantValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);\n }\n return new ContextKeyNotExpr(key, negated);\n }\n constructor(key, negated) {\n this.key = key;\n this.negated = negated;\n this.type = 3 /* ContextKeyExprType.Not */;\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n return cmp1(this.key, other.key);\n }\n equals(other) {\n if (other.type === this.type) {\n return (this.key === other.key);\n }\n return false;\n }\n substituteConstants() {\n const constantValue = CONSTANT_VALUES.get(this.key);\n if (typeof constantValue === 'boolean') {\n return (constantValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);\n }\n return this;\n }\n evaluate(context) {\n return (!context.getValue(this.key));\n }\n serialize() {\n return `!${this.key}`;\n }\n keys() {\n return [this.key];\n }\n negate() {\n if (!this.negated) {\n this.negated = ContextKeyDefinedExpr.create(this.key, this);\n }\n return this.negated;\n }\n}\nfunction withFloatOrStr(value, callback) {\n if (typeof value === 'string') {\n const n = parseFloat(value);\n if (!isNaN(n)) {\n value = n;\n }\n }\n if (typeof value === 'string' || typeof value === 'number') {\n return callback(value);\n }\n return ContextKeyFalseExpr.INSTANCE;\n}\nexport class ContextKeyGreaterExpr {\n static create(key, _value, negated = null) {\n return withFloatOrStr(_value, (value) => new ContextKeyGreaterExpr(key, value, negated));\n }\n constructor(key, value, negated) {\n this.key = key;\n this.value = value;\n this.negated = negated;\n this.type = 12 /* ContextKeyExprType.Greater */;\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n return cmp2(this.key, this.value, other.key, other.value);\n }\n equals(other) {\n if (other.type === this.type) {\n return (this.key === other.key && this.value === other.value);\n }\n return false;\n }\n substituteConstants() {\n return this;\n }\n evaluate(context) {\n if (typeof this.value === 'string') {\n return false;\n }\n return (parseFloat(context.getValue(this.key)) > this.value);\n }\n serialize() {\n return `${this.key} > ${this.value}`;\n }\n keys() {\n return [this.key];\n }\n negate() {\n if (!this.negated) {\n this.negated = ContextKeySmallerEqualsExpr.create(this.key, this.value, this);\n }\n return this.negated;\n }\n}\nexport class ContextKeyGreaterEqualsExpr {\n static create(key, _value, negated = null) {\n return withFloatOrStr(_value, (value) => new ContextKeyGreaterEqualsExpr(key, value, negated));\n }\n constructor(key, value, negated) {\n this.key = key;\n this.value = value;\n this.negated = negated;\n this.type = 13 /* ContextKeyExprType.GreaterEquals */;\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n return cmp2(this.key, this.value, other.key, other.value);\n }\n equals(other) {\n if (other.type === this.type) {\n return (this.key === other.key && this.value === other.value);\n }\n return false;\n }\n substituteConstants() {\n return this;\n }\n evaluate(context) {\n if (typeof this.value === 'string') {\n return false;\n }\n return (parseFloat(context.getValue(this.key)) >= this.value);\n }\n serialize() {\n return `${this.key} >= ${this.value}`;\n }\n keys() {\n return [this.key];\n }\n negate() {\n if (!this.negated) {\n this.negated = ContextKeySmallerExpr.create(this.key, this.value, this);\n }\n return this.negated;\n }\n}\nexport class ContextKeySmallerExpr {\n static create(key, _value, negated = null) {\n return withFloatOrStr(_value, (value) => new ContextKeySmallerExpr(key, value, negated));\n }\n constructor(key, value, negated) {\n this.key = key;\n this.value = value;\n this.negated = negated;\n this.type = 14 /* ContextKeyExprType.Smaller */;\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n return cmp2(this.key, this.value, other.key, other.value);\n }\n equals(other) {\n if (other.type === this.type) {\n return (this.key === other.key && this.value === other.value);\n }\n return false;\n }\n substituteConstants() {\n return this;\n }\n evaluate(context) {\n if (typeof this.value === 'string') {\n return false;\n }\n return (parseFloat(context.getValue(this.key)) < this.value);\n }\n serialize() {\n return `${this.key} < ${this.value}`;\n }\n keys() {\n return [this.key];\n }\n negate() {\n if (!this.negated) {\n this.negated = ContextKeyGreaterEqualsExpr.create(this.key, this.value, this);\n }\n return this.negated;\n }\n}\nexport class ContextKeySmallerEqualsExpr {\n static create(key, _value, negated = null) {\n return withFloatOrStr(_value, (value) => new ContextKeySmallerEqualsExpr(key, value, negated));\n }\n constructor(key, value, negated) {\n this.key = key;\n this.value = value;\n this.negated = negated;\n this.type = 15 /* ContextKeyExprType.SmallerEquals */;\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n return cmp2(this.key, this.value, other.key, other.value);\n }\n equals(other) {\n if (other.type === this.type) {\n return (this.key === other.key && this.value === other.value);\n }\n return false;\n }\n substituteConstants() {\n return this;\n }\n evaluate(context) {\n if (typeof this.value === 'string') {\n return false;\n }\n return (parseFloat(context.getValue(this.key)) <= this.value);\n }\n serialize() {\n return `${this.key} <= ${this.value}`;\n }\n keys() {\n return [this.key];\n }\n negate() {\n if (!this.negated) {\n this.negated = ContextKeyGreaterExpr.create(this.key, this.value, this);\n }\n return this.negated;\n }\n}\nexport class ContextKeyRegexExpr {\n static create(key, regexp) {\n return new ContextKeyRegexExpr(key, regexp);\n }\n constructor(key, regexp) {\n this.key = key;\n this.regexp = regexp;\n this.type = 7 /* ContextKeyExprType.Regex */;\n this.negated = null;\n //\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n if (this.key < other.key) {\n return -1;\n }\n if (this.key > other.key) {\n return 1;\n }\n const thisSource = this.regexp ? this.regexp.source : '';\n const otherSource = other.regexp ? other.regexp.source : '';\n if (thisSource < otherSource) {\n return -1;\n }\n if (thisSource > otherSource) {\n return 1;\n }\n return 0;\n }\n equals(other) {\n if (other.type === this.type) {\n const thisSource = this.regexp ? this.regexp.source : '';\n const otherSource = other.regexp ? other.regexp.source : '';\n return (this.key === other.key && thisSource === otherSource);\n }\n return false;\n }\n substituteConstants() {\n return this;\n }\n evaluate(context) {\n const value = context.getValue(this.key);\n return this.regexp ? this.regexp.test(value) : false;\n }\n serialize() {\n const value = this.regexp\n ? `/${this.regexp.source}/${this.regexp.flags}`\n : '/invalid/';\n return `${this.key} =~ ${value}`;\n }\n keys() {\n return [this.key];\n }\n negate() {\n if (!this.negated) {\n this.negated = ContextKeyNotRegexExpr.create(this);\n }\n return this.negated;\n }\n}\nexport class ContextKeyNotRegexExpr {\n static create(actual) {\n return new ContextKeyNotRegexExpr(actual);\n }\n constructor(_actual) {\n this._actual = _actual;\n this.type = 8 /* ContextKeyExprType.NotRegex */;\n //\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n return this._actual.cmp(other._actual);\n }\n equals(other) {\n if (other.type === this.type) {\n return this._actual.equals(other._actual);\n }\n return false;\n }\n substituteConstants() {\n return this;\n }\n evaluate(context) {\n return !this._actual.evaluate(context);\n }\n serialize() {\n return `!(${this._actual.serialize()})`;\n }\n keys() {\n return this._actual.keys();\n }\n negate() {\n return this._actual;\n }\n}\n/**\n * @returns the same instance if nothing changed.\n */\nfunction eliminateConstantsInArray(arr) {\n // Allocate array only if there is a difference\n let newArr = null;\n for (let i = 0, len = arr.length; i < len; i++) {\n const newExpr = arr[i].substituteConstants();\n if (arr[i] !== newExpr) {\n // something has changed!\n // allocate array on first difference\n if (newArr === null) {\n newArr = [];\n for (let j = 0; j < i; j++) {\n newArr[j] = arr[j];\n }\n }\n }\n if (newArr !== null) {\n newArr[i] = newExpr;\n }\n }\n if (newArr === null) {\n return arr;\n }\n return newArr;\n}\nexport class ContextKeyAndExpr {\n static create(_expr, negated, extraRedundantCheck) {\n return ContextKeyAndExpr._normalizeArr(_expr, negated, extraRedundantCheck);\n }\n constructor(expr, negated) {\n this.expr = expr;\n this.negated = negated;\n this.type = 6 /* ContextKeyExprType.And */;\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n if (this.expr.length < other.expr.length) {\n return -1;\n }\n if (this.expr.length > other.expr.length) {\n return 1;\n }\n for (let i = 0, len = this.expr.length; i < len; i++) {\n const r = cmp(this.expr[i], other.expr[i]);\n if (r !== 0) {\n return r;\n }\n }\n return 0;\n }\n equals(other) {\n if (other.type === this.type) {\n if (this.expr.length !== other.expr.length) {\n return false;\n }\n for (let i = 0, len = this.expr.length; i < len; i++) {\n if (!this.expr[i].equals(other.expr[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n substituteConstants() {\n const exprArr = eliminateConstantsInArray(this.expr);\n if (exprArr === this.expr) {\n // no change\n return this;\n }\n return ContextKeyAndExpr.create(exprArr, this.negated, false);\n }\n evaluate(context) {\n for (let i = 0, len = this.expr.length; i < len; i++) {\n if (!this.expr[i].evaluate(context)) {\n return false;\n }\n }\n return true;\n }\n static _normalizeArr(arr, negated, extraRedundantCheck) {\n const expr = [];\n let hasTrue = false;\n for (const e of arr) {\n if (!e) {\n continue;\n }\n if (e.type === 1 /* ContextKeyExprType.True */) {\n // anything && true ==> anything\n hasTrue = true;\n continue;\n }\n if (e.type === 0 /* ContextKeyExprType.False */) {\n // anything && false ==> false\n return ContextKeyFalseExpr.INSTANCE;\n }\n if (e.type === 6 /* ContextKeyExprType.And */) {\n expr.push(...e.expr);\n continue;\n }\n expr.push(e);\n }\n if (expr.length === 0 && hasTrue) {\n return ContextKeyTrueExpr.INSTANCE;\n }\n if (expr.length === 0) {\n return undefined;\n }\n if (expr.length === 1) {\n return expr[0];\n }\n expr.sort(cmp);\n // eliminate duplicate terms\n for (let i = 1; i < expr.length; i++) {\n if (expr[i - 1].equals(expr[i])) {\n expr.splice(i, 1);\n i--;\n }\n }\n if (expr.length === 1) {\n return expr[0];\n }\n // We must distribute any OR expression because we don't support parens\n // OR extensions will be at the end (due to sorting rules)\n while (expr.length > 1) {\n const lastElement = expr[expr.length - 1];\n if (lastElement.type !== 9 /* ContextKeyExprType.Or */) {\n break;\n }\n // pop the last element\n expr.pop();\n // pop the second to last element\n const secondToLastElement = expr.pop();\n const isFinished = (expr.length === 0);\n // distribute `lastElement` over `secondToLastElement`\n const resultElement = ContextKeyOrExpr.create(lastElement.expr.map(el => ContextKeyAndExpr.create([el, secondToLastElement], null, extraRedundantCheck)), null, isFinished);\n if (resultElement) {\n expr.push(resultElement);\n expr.sort(cmp);\n }\n }\n if (expr.length === 1) {\n return expr[0];\n }\n // resolve false AND expressions\n if (extraRedundantCheck) {\n for (let i = 0; i < expr.length; i++) {\n for (let j = i + 1; j < expr.length; j++) {\n if (expr[i].negate().equals(expr[j])) {\n // A && !A case\n return ContextKeyFalseExpr.INSTANCE;\n }\n }\n }\n if (expr.length === 1) {\n return expr[0];\n }\n }\n return new ContextKeyAndExpr(expr, negated);\n }\n serialize() {\n return this.expr.map(e => e.serialize()).join(' && ');\n }\n keys() {\n const result = [];\n for (const expr of this.expr) {\n result.push(...expr.keys());\n }\n return result;\n }\n negate() {\n if (!this.negated) {\n const result = [];\n for (const expr of this.expr) {\n result.push(expr.negate());\n }\n this.negated = ContextKeyOrExpr.create(result, this, true);\n }\n return this.negated;\n }\n}\nexport class ContextKeyOrExpr {\n static create(_expr, negated, extraRedundantCheck) {\n return ContextKeyOrExpr._normalizeArr(_expr, negated, extraRedundantCheck);\n }\n constructor(expr, negated) {\n this.expr = expr;\n this.negated = negated;\n this.type = 9 /* ContextKeyExprType.Or */;\n }\n cmp(other) {\n if (other.type !== this.type) {\n return this.type - other.type;\n }\n if (this.expr.length < other.expr.length) {\n return -1;\n }\n if (this.expr.length > other.expr.length) {\n return 1;\n }\n for (let i = 0, len = this.expr.length; i < len; i++) {\n const r = cmp(this.expr[i], other.expr[i]);\n if (r !== 0) {\n return r;\n }\n }\n return 0;\n }\n equals(other) {\n if (other.type === this.type) {\n if (this.expr.length !== other.expr.length) {\n return false;\n }\n for (let i = 0, len = this.expr.length; i < len; i++) {\n if (!this.expr[i].equals(other.expr[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n substituteConstants() {\n const exprArr = eliminateConstantsInArray(this.expr);\n if (exprArr === this.expr) {\n // no change\n return this;\n }\n return ContextKeyOrExpr.create(exprArr, this.negated, false);\n }\n evaluate(context) {\n for (let i = 0, len = this.expr.length; i < len; i++) {\n if (this.expr[i].evaluate(context)) {\n return true;\n }\n }\n return false;\n }\n static _normalizeArr(arr, negated, extraRedundantCheck) {\n let expr = [];\n let hasFalse = false;\n if (arr) {\n for (let i = 0, len = arr.length; i < len; i++) {\n const e = arr[i];\n if (!e) {\n continue;\n }\n if (e.type === 0 /* ContextKeyExprType.False */) {\n // anything || false ==> anything\n hasFalse = true;\n continue;\n }\n if (e.type === 1 /* ContextKeyExprType.True */) {\n // anything || true ==> true\n return ContextKeyTrueExpr.INSTANCE;\n }\n if (e.type === 9 /* ContextKeyExprType.Or */) {\n expr = expr.concat(e.expr);\n continue;\n }\n expr.push(e);\n }\n if (expr.length === 0 && hasFalse) {\n return ContextKeyFalseExpr.INSTANCE;\n }\n expr.sort(cmp);\n }\n if (expr.length === 0) {\n return undefined;\n }\n if (expr.length === 1) {\n return expr[0];\n }\n // eliminate duplicate terms\n for (let i = 1; i < expr.length; i++) {\n if (expr[i - 1].equals(expr[i])) {\n expr.splice(i, 1);\n i--;\n }\n }\n if (expr.length === 1) {\n return expr[0];\n }\n // resolve true OR expressions\n if (extraRedundantCheck) {\n for (let i = 0; i < expr.length; i++) {\n for (let j = i + 1; j < expr.length; j++) {\n if (expr[i].negate().equals(expr[j])) {\n // A || !A case\n return ContextKeyTrueExpr.INSTANCE;\n }\n }\n }\n if (expr.length === 1) {\n return expr[0];\n }\n }\n return new ContextKeyOrExpr(expr, negated);\n }\n serialize() {\n return this.expr.map(e => e.serialize()).join(' || ');\n }\n keys() {\n const result = [];\n for (const expr of this.expr) {\n result.push(...expr.keys());\n }\n return result;\n }\n negate() {\n if (!this.negated) {\n const result = [];\n for (const expr of this.expr) {\n result.push(expr.negate());\n }\n // We don't support parens, so here we distribute the AND over the OR terminals\n // We always take the first 2 AND pairs and distribute them\n while (result.length > 1) {\n const LEFT = result.shift();\n const RIGHT = result.shift();\n const all = [];\n for (const left of getTerminals(LEFT)) {\n for (const right of getTerminals(RIGHT)) {\n all.push(ContextKeyAndExpr.create([left, right], null, false));\n }\n }\n result.unshift(ContextKeyOrExpr.create(all, null, false));\n }\n this.negated = ContextKeyOrExpr.create(result, this, true);\n }\n return this.negated;\n }\n}\nexport class RawContextKey extends ContextKeyDefinedExpr {\n static all() {\n return RawContextKey._info.values();\n }\n constructor(key, defaultValue, metaOrHide) {\n super(key, null);\n this._defaultValue = defaultValue;\n // collect all context keys into a central place\n if (typeof metaOrHide === 'object') {\n RawContextKey._info.push({ ...metaOrHide, key });\n }\n else if (metaOrHide !== true) {\n RawContextKey._info.push({ key, description: metaOrHide, type: defaultValue !== null && defaultValue !== undefined ? typeof defaultValue : undefined });\n }\n }\n bindTo(target) {\n return target.createKey(this.key, this._defaultValue);\n }\n getValue(target) {\n return target.getContextKeyValue(this.key);\n }\n toNegated() {\n return this.negate();\n }\n isEqualTo(value) {\n return ContextKeyEqualsExpr.create(this.key, value);\n }\n}\nRawContextKey._info = [];\nexport const IContextKeyService = createDecorator('contextKeyService');\nfunction cmp1(key1, key2) {\n if (key1 < key2) {\n return -1;\n }\n if (key1 > key2) {\n return 1;\n }\n return 0;\n}\nfunction cmp2(key1, value1, key2, value2) {\n if (key1 < key2) {\n return -1;\n }\n if (key1 > key2) {\n return 1;\n }\n if (value1 < value2) {\n return -1;\n }\n if (value1 > value2) {\n return 1;\n }\n return 0;\n}\n/**\n * Returns true if it is provable `p` implies `q`.\n */\nexport function implies(p, q) {\n if (p.type === 0 /* ContextKeyExprType.False */ || q.type === 1 /* ContextKeyExprType.True */) {\n // false implies anything\n // anything implies true\n return true;\n }\n if (p.type === 9 /* ContextKeyExprType.Or */) {\n if (q.type === 9 /* ContextKeyExprType.Or */) {\n // `a || b || c` can only imply something like `a || b || c || d`\n return allElementsIncluded(p.expr, q.expr);\n }\n return false;\n }\n if (q.type === 9 /* ContextKeyExprType.Or */) {\n for (const element of q.expr) {\n if (implies(p, element)) {\n return true;\n }\n }\n return false;\n }\n if (p.type === 6 /* ContextKeyExprType.And */) {\n if (q.type === 6 /* ContextKeyExprType.And */) {\n // `a && b && c` implies `a && c`\n return allElementsIncluded(q.expr, p.expr);\n }\n for (const element of p.expr) {\n if (implies(element, q)) {\n return true;\n }\n }\n return false;\n }\n return p.equals(q);\n}\n/**\n * Returns true if all elements in `p` are also present in `q`.\n * The two arrays are assumed to be sorted\n */\nfunction allElementsIncluded(p, q) {\n let pIndex = 0;\n let qIndex = 0;\n while (pIndex < p.length && qIndex < q.length) {\n const cmp = p[pIndex].cmp(q[qIndex]);\n if (cmp < 0) {\n // an element from `p` is missing from `q`\n return false;\n }\n else if (cmp === 0) {\n pIndex++;\n qIndex++;\n }\n else {\n qIndex++;\n }\n }\n return (pIndex === p.length);\n}\nfunction getTerminals(node) {\n if (node.type === 9 /* ContextKeyExprType.Or */) {\n return node.expr;\n }\n return [node];\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { illegalArgument } from './errors.js';\nexport function decodeKeybinding(keybinding, OS) {\n if (typeof keybinding === 'number') {\n if (keybinding === 0) {\n return null;\n }\n const firstChord = (keybinding & 0x0000FFFF) >>> 0;\n const secondChord = (keybinding & 0xFFFF0000) >>> 16;\n if (secondChord !== 0) {\n return new Keybinding([\n createSimpleKeybinding(firstChord, OS),\n createSimpleKeybinding(secondChord, OS)\n ]);\n }\n return new Keybinding([createSimpleKeybinding(firstChord, OS)]);\n }\n else {\n const chords = [];\n for (let i = 0; i < keybinding.length; i++) {\n chords.push(createSimpleKeybinding(keybinding[i], OS));\n }\n return new Keybinding(chords);\n }\n}\nexport function createSimpleKeybinding(keybinding, OS) {\n const ctrlCmd = (keybinding & 2048 /* BinaryKeybindingsMask.CtrlCmd */ ? true : false);\n const winCtrl = (keybinding & 256 /* BinaryKeybindingsMask.WinCtrl */ ? true : false);\n const ctrlKey = (OS === 2 /* OperatingSystem.Macintosh */ ? winCtrl : ctrlCmd);\n const shiftKey = (keybinding & 1024 /* BinaryKeybindingsMask.Shift */ ? true : false);\n const altKey = (keybinding & 512 /* BinaryKeybindingsMask.Alt */ ? true : false);\n const metaKey = (OS === 2 /* OperatingSystem.Macintosh */ ? ctrlCmd : winCtrl);\n const keyCode = (keybinding & 255 /* BinaryKeybindingsMask.KeyCode */);\n return new KeyCodeChord(ctrlKey, shiftKey, altKey, metaKey, keyCode);\n}\n/**\n * Represents a chord which uses the `keyCode` field of keyboard events.\n * A chord is a combination of keys pressed simultaneously.\n */\nexport class KeyCodeChord {\n constructor(ctrlKey, shiftKey, altKey, metaKey, keyCode) {\n this.ctrlKey = ctrlKey;\n this.shiftKey = shiftKey;\n this.altKey = altKey;\n this.metaKey = metaKey;\n this.keyCode = keyCode;\n }\n equals(other) {\n return (other instanceof KeyCodeChord\n && this.ctrlKey === other.ctrlKey\n && this.shiftKey === other.shiftKey\n && this.altKey === other.altKey\n && this.metaKey === other.metaKey\n && this.keyCode === other.keyCode);\n }\n isModifierKey() {\n return (this.keyCode === 0 /* KeyCode.Unknown */\n || this.keyCode === 5 /* KeyCode.Ctrl */\n || this.keyCode === 57 /* KeyCode.Meta */\n || this.keyCode === 6 /* KeyCode.Alt */\n || this.keyCode === 4 /* KeyCode.Shift */);\n }\n /**\n * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n */\n isDuplicateModifierCase() {\n return ((this.ctrlKey && this.keyCode === 5 /* KeyCode.Ctrl */)\n || (this.shiftKey && this.keyCode === 4 /* KeyCode.Shift */)\n || (this.altKey && this.keyCode === 6 /* KeyCode.Alt */)\n || (this.metaKey && this.keyCode === 57 /* KeyCode.Meta */));\n }\n}\n/**\n * Represents a chord which uses the `code` field of keyboard events.\n * A chord is a combination of keys pressed simultaneously.\n */\nexport class ScanCodeChord {\n constructor(ctrlKey, shiftKey, altKey, metaKey, scanCode) {\n this.ctrlKey = ctrlKey;\n this.shiftKey = shiftKey;\n this.altKey = altKey;\n this.metaKey = metaKey;\n this.scanCode = scanCode;\n }\n /**\n * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n */\n isDuplicateModifierCase() {\n return ((this.ctrlKey && (this.scanCode === 157 /* ScanCode.ControlLeft */ || this.scanCode === 161 /* ScanCode.ControlRight */))\n || (this.shiftKey && (this.scanCode === 158 /* ScanCode.ShiftLeft */ || this.scanCode === 162 /* ScanCode.ShiftRight */))\n || (this.altKey && (this.scanCode === 159 /* ScanCode.AltLeft */ || this.scanCode === 163 /* ScanCode.AltRight */))\n || (this.metaKey && (this.scanCode === 160 /* ScanCode.MetaLeft */ || this.scanCode === 164 /* ScanCode.MetaRight */)));\n }\n}\n/**\n * A keybinding is a sequence of chords.\n */\nexport class Keybinding {\n constructor(chords) {\n if (chords.length === 0) {\n throw illegalArgument(`chords`);\n }\n this.chords = chords;\n }\n}\nexport class ResolvedChord {\n constructor(ctrlKey, shiftKey, altKey, metaKey, keyLabel, keyAriaLabel) {\n this.ctrlKey = ctrlKey;\n this.shiftKey = shiftKey;\n this.altKey = altKey;\n this.metaKey = metaKey;\n this.keyLabel = keyLabel;\n this.keyAriaLabel = keyAriaLabel;\n }\n}\n/**\n * A resolved keybinding. Consists of one or multiple chords.\n */\nexport class ResolvedKeybinding {\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { BugIndicatingError, onUnexpectedError } from './errors.js';\n/**\n * Throws an error with the provided message if the provided value does not evaluate to a true Javascript value.\n *\n * @deprecated Use `assert(...)` instead.\n * This method is usually used like this:\n * ```ts\n * import * as assert from 'vs/base/common/assert';\n * assert.ok(...);\n * ```\n *\n * However, `assert` in that example is a user chosen name.\n * There is no tooling for generating such an import statement.\n * Thus, the `assert(...)` function should be used instead.\n */\nexport function ok(value, message) {\n if (!value) {\n throw new Error(message ? `Assertion failed (${message})` : 'Assertion Failed');\n }\n}\nexport function assertNever(value, message = 'Unreachable') {\n throw new Error(message);\n}\nexport function softAssert(condition) {\n if (!condition) {\n onUnexpectedError(new BugIndicatingError('Assertion Failed'));\n }\n}\n/**\n * condition must be side-effect free!\n */\nexport function assertFn(condition) {\n if (!condition()) {\n // eslint-disable-next-line no-debugger\n debugger;\n // Reevaluate `condition` again to make debugging easier\n condition();\n onUnexpectedError(new BugIndicatingError('Assertion Failed'));\n }\n}\nexport function checkAdjacentItems(items, predicate) {\n let i = 0;\n while (i < items.length - 1) {\n const a = items[i];\n const b = items[i + 1];\n if (!predicate(a, b)) {\n return false;\n }\n i++;\n }\n return true;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as Assert from '../../../base/common/assert.js';\nimport * as Types from '../../../base/common/types.js';\nclass RegistryImpl {\n constructor() {\n this.data = new Map();\n }\n add(id, data) {\n Assert.ok(Types.isString(id));\n Assert.ok(Types.isObject(data));\n Assert.ok(!this.data.has(id), 'There is already an extension with this id');\n this.data.set(id, data);\n }\n as(id) {\n return this.data.get(id) || null;\n }\n}\nexport const Registry = new RegistryImpl();\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { decodeKeybinding } from '../../../base/common/keybindings.js';\nimport { OS } from '../../../base/common/platform.js';\nimport { CommandsRegistry } from '../../commands/common/commands.js';\nimport { Registry } from '../../registry/common/platform.js';\nimport { combinedDisposable, DisposableStore, toDisposable } from '../../../base/common/lifecycle.js';\nimport { LinkedList } from '../../../base/common/linkedList.js';\n/**\n * Stores all built-in and extension-provided keybindings (but not ones that user defines themselves)\n */\nclass KeybindingsRegistryImpl {\n constructor() {\n this._coreKeybindings = new LinkedList();\n this._extensionKeybindings = [];\n this._cachedMergedKeybindings = null;\n }\n /**\n * Take current platform into account and reduce to primary & secondary.\n */\n static bindToCurrentPlatform(kb) {\n if (OS === 1 /* OperatingSystem.Windows */) {\n if (kb && kb.win) {\n return kb.win;\n }\n }\n else if (OS === 2 /* OperatingSystem.Macintosh */) {\n if (kb && kb.mac) {\n return kb.mac;\n }\n }\n else {\n if (kb && kb.linux) {\n return kb.linux;\n }\n }\n return kb;\n }\n registerKeybindingRule(rule) {\n const actualKb = KeybindingsRegistryImpl.bindToCurrentPlatform(rule);\n const result = new DisposableStore();\n if (actualKb && actualKb.primary) {\n const kk = decodeKeybinding(actualKb.primary, OS);\n if (kk) {\n result.add(this._registerDefaultKeybinding(kk, rule.id, rule.args, rule.weight, 0, rule.when));\n }\n }\n if (actualKb && Array.isArray(actualKb.secondary)) {\n for (let i = 0, len = actualKb.secondary.length; i < len; i++) {\n const k = actualKb.secondary[i];\n const kk = decodeKeybinding(k, OS);\n if (kk) {\n result.add(this._registerDefaultKeybinding(kk, rule.id, rule.args, rule.weight, -i - 1, rule.when));\n }\n }\n }\n return result;\n }\n registerCommandAndKeybindingRule(desc) {\n return combinedDisposable(this.registerKeybindingRule(desc), CommandsRegistry.registerCommand(desc));\n }\n _registerDefaultKeybinding(keybinding, commandId, commandArgs, weight1, weight2, when) {\n const remove = this._coreKeybindings.push({\n keybinding: keybinding,\n command: commandId,\n commandArgs: commandArgs,\n when: when,\n weight1: weight1,\n weight2: weight2,\n extensionId: null,\n isBuiltinExtension: false\n });\n this._cachedMergedKeybindings = null;\n return toDisposable(() => {\n remove();\n this._cachedMergedKeybindings = null;\n });\n }\n getDefaultKeybindings() {\n if (!this._cachedMergedKeybindings) {\n this._cachedMergedKeybindings = Array.from(this._coreKeybindings).concat(this._extensionKeybindings);\n this._cachedMergedKeybindings.sort(sorter);\n }\n return this._cachedMergedKeybindings.slice(0);\n }\n}\nexport const KeybindingsRegistry = new KeybindingsRegistryImpl();\n// Define extension point ids\nexport const Extensions = {\n EditorModes: 'platform.keybindingsRegistry'\n};\nRegistry.add(Extensions.EditorModes, KeybindingsRegistry);\nfunction sorter(a, b) {\n if (a.weight1 !== b.weight1) {\n return a.weight1 - b.weight1;\n }\n if (a.command && b.command) {\n if (a.command < b.command) {\n return -1;\n }\n if (a.command > b.command) {\n return 1;\n }\n }\n return a.weight2 - b.weight2;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar MenuItemAction_1;\nimport { SubmenuAction } from '../../../base/common/actions.js';\nimport { ThemeIcon } from '../../../base/common/themables.js';\nimport { MicrotaskEmitter } from '../../../base/common/event.js';\nimport { DisposableStore, toDisposable } from '../../../base/common/lifecycle.js';\nimport { LinkedList } from '../../../base/common/linkedList.js';\nimport { CommandsRegistry, ICommandService } from '../../commands/common/commands.js';\nimport { ContextKeyExpr, IContextKeyService } from '../../contextkey/common/contextkey.js';\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\nimport { KeybindingsRegistry } from '../../keybinding/common/keybindingsRegistry.js';\nexport function isIMenuItem(item) {\n return item.command !== undefined;\n}\nexport function isISubmenuItem(item) {\n return item.submenu !== undefined;\n}\nexport class MenuId {\n /**\n * Create a new `MenuId` with the unique identifier. Will throw if a menu\n * with the identifier already exists, use `MenuId.for(ident)` or a unique\n * identifier\n */\n constructor(identifier) {\n if (MenuId._instances.has(identifier)) {\n throw new TypeError(`MenuId with identifier '${identifier}' already exists. Use MenuId.for(ident) or a unique identifier`);\n }\n MenuId._instances.set(identifier, this);\n this.id = identifier;\n }\n}\nMenuId._instances = new Map();\nMenuId.CommandPalette = new MenuId('CommandPalette');\nMenuId.DebugBreakpointsContext = new MenuId('DebugBreakpointsContext');\nMenuId.DebugCallStackContext = new MenuId('DebugCallStackContext');\nMenuId.DebugConsoleContext = new MenuId('DebugConsoleContext');\nMenuId.DebugVariablesContext = new MenuId('DebugVariablesContext');\nMenuId.DebugHoverContext = new MenuId('DebugHoverContext');\nMenuId.DebugWatchContext = new MenuId('DebugWatchContext');\nMenuId.DebugToolBar = new MenuId('DebugToolBar');\nMenuId.DebugToolBarStop = new MenuId('DebugToolBarStop');\nMenuId.EditorContext = new MenuId('EditorContext');\nMenuId.SimpleEditorContext = new MenuId('SimpleEditorContext');\nMenuId.EditorContent = new MenuId('EditorContent');\nMenuId.EditorLineNumberContext = new MenuId('EditorLineNumberContext');\nMenuId.EditorContextCopy = new MenuId('EditorContextCopy');\nMenuId.EditorContextPeek = new MenuId('EditorContextPeek');\nMenuId.EditorContextShare = new MenuId('EditorContextShare');\nMenuId.EditorTitle = new MenuId('EditorTitle');\nMenuId.EditorTitleRun = new MenuId('EditorTitleRun');\nMenuId.EditorTitleContext = new MenuId('EditorTitleContext');\nMenuId.EditorTitleContextShare = new MenuId('EditorTitleContextShare');\nMenuId.EmptyEditorGroup = new MenuId('EmptyEditorGroup');\nMenuId.EmptyEditorGroupContext = new MenuId('EmptyEditorGroupContext');\nMenuId.EditorTabsBarContext = new MenuId('EditorTabsBarContext');\nMenuId.EditorTabsBarShowTabsSubmenu = new MenuId('EditorTabsBarShowTabsSubmenu');\nMenuId.EditorTabsBarShowTabsZenModeSubmenu = new MenuId('EditorTabsBarShowTabsZenModeSubmenu');\nMenuId.EditorActionsPositionSubmenu = new MenuId('EditorActionsPositionSubmenu');\nMenuId.ExplorerContext = new MenuId('ExplorerContext');\nMenuId.ExplorerContextShare = new MenuId('ExplorerContextShare');\nMenuId.ExtensionContext = new MenuId('ExtensionContext');\nMenuId.GlobalActivity = new MenuId('GlobalActivity');\nMenuId.CommandCenter = new MenuId('CommandCenter');\nMenuId.CommandCenterCenter = new MenuId('CommandCenterCenter');\nMenuId.LayoutControlMenuSubmenu = new MenuId('LayoutControlMenuSubmenu');\nMenuId.LayoutControlMenu = new MenuId('LayoutControlMenu');\nMenuId.MenubarMainMenu = new MenuId('MenubarMainMenu');\nMenuId.MenubarAppearanceMenu = new MenuId('MenubarAppearanceMenu');\nMenuId.MenubarDebugMenu = new MenuId('MenubarDebugMenu');\nMenuId.MenubarEditMenu = new MenuId('MenubarEditMenu');\nMenuId.MenubarCopy = new MenuId('MenubarCopy');\nMenuId.MenubarFileMenu = new MenuId('MenubarFileMenu');\nMenuId.MenubarGoMenu = new MenuId('MenubarGoMenu');\nMenuId.MenubarHelpMenu = new MenuId('MenubarHelpMenu');\nMenuId.MenubarLayoutMenu = new MenuId('MenubarLayoutMenu');\nMenuId.MenubarNewBreakpointMenu = new MenuId('MenubarNewBreakpointMenu');\nMenuId.PanelAlignmentMenu = new MenuId('PanelAlignmentMenu');\nMenuId.PanelPositionMenu = new MenuId('PanelPositionMenu');\nMenuId.ActivityBarPositionMenu = new MenuId('ActivityBarPositionMenu');\nMenuId.MenubarPreferencesMenu = new MenuId('MenubarPreferencesMenu');\nMenuId.MenubarRecentMenu = new MenuId('MenubarRecentMenu');\nMenuId.MenubarSelectionMenu = new MenuId('MenubarSelectionMenu');\nMenuId.MenubarShare = new MenuId('MenubarShare');\nMenuId.MenubarSwitchEditorMenu = new MenuId('MenubarSwitchEditorMenu');\nMenuId.MenubarSwitchGroupMenu = new MenuId('MenubarSwitchGroupMenu');\nMenuId.MenubarTerminalMenu = new MenuId('MenubarTerminalMenu');\nMenuId.MenubarViewMenu = new MenuId('MenubarViewMenu');\nMenuId.MenubarHomeMenu = new MenuId('MenubarHomeMenu');\nMenuId.OpenEditorsContext = new MenuId('OpenEditorsContext');\nMenuId.OpenEditorsContextShare = new MenuId('OpenEditorsContextShare');\nMenuId.ProblemsPanelContext = new MenuId('ProblemsPanelContext');\nMenuId.SCMInputBox = new MenuId('SCMInputBox');\nMenuId.SCMIncomingChanges = new MenuId('SCMIncomingChanges');\nMenuId.SCMOutgoingChanges = new MenuId('SCMOutgoingChanges');\nMenuId.SCMIncomingChangesAllChangesContext = new MenuId('SCMIncomingChangesAllChangesContext');\nMenuId.SCMIncomingChangesHistoryItemContext = new MenuId('SCMIncomingChangesHistoryItemContext');\nMenuId.SCMOutgoingChangesAllChangesContext = new MenuId('SCMOutgoingChangesAllChangesContext');\nMenuId.SCMOutgoingChangesHistoryItemContext = new MenuId('SCMOutgoingChangesHistoryItemContext');\nMenuId.SCMChangeContext = new MenuId('SCMChangeContext');\nMenuId.SCMResourceContext = new MenuId('SCMResourceContext');\nMenuId.SCMResourceContextShare = new MenuId('SCMResourceContextShare');\nMenuId.SCMResourceFolderContext = new MenuId('SCMResourceFolderContext');\nMenuId.SCMResourceGroupContext = new MenuId('SCMResourceGroupContext');\nMenuId.SCMSourceControl = new MenuId('SCMSourceControl');\nMenuId.SCMSourceControlInline = new MenuId('SCMSourceControlInline');\nMenuId.SCMTitle = new MenuId('SCMTitle');\nMenuId.SearchContext = new MenuId('SearchContext');\nMenuId.SearchActionMenu = new MenuId('SearchActionContext');\nMenuId.StatusBarWindowIndicatorMenu = new MenuId('StatusBarWindowIndicatorMenu');\nMenuId.StatusBarRemoteIndicatorMenu = new MenuId('StatusBarRemoteIndicatorMenu');\nMenuId.StickyScrollContext = new MenuId('StickyScrollContext');\nMenuId.TestItem = new MenuId('TestItem');\nMenuId.TestItemGutter = new MenuId('TestItemGutter');\nMenuId.TestMessageContext = new MenuId('TestMessageContext');\nMenuId.TestMessageContent = new MenuId('TestMessageContent');\nMenuId.TestPeekElement = new MenuId('TestPeekElement');\nMenuId.TestPeekTitle = new MenuId('TestPeekTitle');\nMenuId.TouchBarContext = new MenuId('TouchBarContext');\nMenuId.TitleBarContext = new MenuId('TitleBarContext');\nMenuId.TitleBarTitleContext = new MenuId('TitleBarTitleContext');\nMenuId.TunnelContext = new MenuId('TunnelContext');\nMenuId.TunnelPrivacy = new MenuId('TunnelPrivacy');\nMenuId.TunnelProtocol = new MenuId('TunnelProtocol');\nMenuId.TunnelPortInline = new MenuId('TunnelInline');\nMenuId.TunnelTitle = new MenuId('TunnelTitle');\nMenuId.TunnelLocalAddressInline = new MenuId('TunnelLocalAddressInline');\nMenuId.TunnelOriginInline = new MenuId('TunnelOriginInline');\nMenuId.ViewItemContext = new MenuId('ViewItemContext');\nMenuId.ViewContainerTitle = new MenuId('ViewContainerTitle');\nMenuId.ViewContainerTitleContext = new MenuId('ViewContainerTitleContext');\nMenuId.ViewTitle = new MenuId('ViewTitle');\nMenuId.ViewTitleContext = new MenuId('ViewTitleContext');\nMenuId.CommentEditorActions = new MenuId('CommentEditorActions');\nMenuId.CommentThreadTitle = new MenuId('CommentThreadTitle');\nMenuId.CommentThreadActions = new MenuId('CommentThreadActions');\nMenuId.CommentThreadAdditionalActions = new MenuId('CommentThreadAdditionalActions');\nMenuId.CommentThreadTitleContext = new MenuId('CommentThreadTitleContext');\nMenuId.CommentThreadCommentContext = new MenuId('CommentThreadCommentContext');\nMenuId.CommentTitle = new MenuId('CommentTitle');\nMenuId.CommentActions = new MenuId('CommentActions');\nMenuId.InteractiveToolbar = new MenuId('InteractiveToolbar');\nMenuId.InteractiveCellTitle = new MenuId('InteractiveCellTitle');\nMenuId.InteractiveCellDelete = new MenuId('InteractiveCellDelete');\nMenuId.InteractiveCellExecute = new MenuId('InteractiveCellExecute');\nMenuId.InteractiveInputExecute = new MenuId('InteractiveInputExecute');\nMenuId.NotebookToolbar = new MenuId('NotebookToolbar');\nMenuId.NotebookStickyScrollContext = new MenuId('NotebookStickyScrollContext');\nMenuId.NotebookCellTitle = new MenuId('NotebookCellTitle');\nMenuId.NotebookCellDelete = new MenuId('NotebookCellDelete');\nMenuId.NotebookCellInsert = new MenuId('NotebookCellInsert');\nMenuId.NotebookCellBetween = new MenuId('NotebookCellBetween');\nMenuId.NotebookCellListTop = new MenuId('NotebookCellTop');\nMenuId.NotebookCellExecute = new MenuId('NotebookCellExecute');\nMenuId.NotebookCellExecutePrimary = new MenuId('NotebookCellExecutePrimary');\nMenuId.NotebookDiffCellInputTitle = new MenuId('NotebookDiffCellInputTitle');\nMenuId.NotebookDiffCellMetadataTitle = new MenuId('NotebookDiffCellMetadataTitle');\nMenuId.NotebookDiffCellOutputsTitle = new MenuId('NotebookDiffCellOutputsTitle');\nMenuId.NotebookOutputToolbar = new MenuId('NotebookOutputToolbar');\nMenuId.NotebookEditorLayoutConfigure = new MenuId('NotebookEditorLayoutConfigure');\nMenuId.NotebookKernelSource = new MenuId('NotebookKernelSource');\nMenuId.BulkEditTitle = new MenuId('BulkEditTitle');\nMenuId.BulkEditContext = new MenuId('BulkEditContext');\nMenuId.TimelineItemContext = new MenuId('TimelineItemContext');\nMenuId.TimelineTitle = new MenuId('TimelineTitle');\nMenuId.TimelineTitleContext = new MenuId('TimelineTitleContext');\nMenuId.TimelineFilterSubMenu = new MenuId('TimelineFilterSubMenu');\nMenuId.AccountsContext = new MenuId('AccountsContext');\nMenuId.SidebarTitle = new MenuId('SidebarTitle');\nMenuId.PanelTitle = new MenuId('PanelTitle');\nMenuId.AuxiliaryBarTitle = new MenuId('AuxiliaryBarTitle');\nMenuId.TerminalInstanceContext = new MenuId('TerminalInstanceContext');\nMenuId.TerminalEditorInstanceContext = new MenuId('TerminalEditorInstanceContext');\nMenuId.TerminalNewDropdownContext = new MenuId('TerminalNewDropdownContext');\nMenuId.TerminalTabContext = new MenuId('TerminalTabContext');\nMenuId.TerminalTabEmptyAreaContext = new MenuId('TerminalTabEmptyAreaContext');\nMenuId.TerminalStickyScrollContext = new MenuId('TerminalStickyScrollContext');\nMenuId.WebviewContext = new MenuId('WebviewContext');\nMenuId.InlineCompletionsActions = new MenuId('InlineCompletionsActions');\nMenuId.NewFile = new MenuId('NewFile');\nMenuId.MergeInput1Toolbar = new MenuId('MergeToolbar1Toolbar');\nMenuId.MergeInput2Toolbar = new MenuId('MergeToolbar2Toolbar');\nMenuId.MergeBaseToolbar = new MenuId('MergeBaseToolbar');\nMenuId.MergeInputResultToolbar = new MenuId('MergeToolbarResultToolbar');\nMenuId.InlineSuggestionToolbar = new MenuId('InlineSuggestionToolbar');\nMenuId.ChatContext = new MenuId('ChatContext');\nMenuId.ChatCodeBlock = new MenuId('ChatCodeblock');\nMenuId.ChatMessageTitle = new MenuId('ChatMessageTitle');\nMenuId.ChatExecute = new MenuId('ChatExecute');\nMenuId.ChatInputSide = new MenuId('ChatInputSide');\nMenuId.AccessibleView = new MenuId('AccessibleView');\nMenuId.MultiDiffEditorFileToolbar = new MenuId('MultiDiffEditorFileToolbar');\nexport const IMenuService = createDecorator('menuService');\nclass MenuRegistryChangeEvent {\n static for(id) {\n let value = this._all.get(id);\n if (!value) {\n value = new MenuRegistryChangeEvent(id);\n this._all.set(id, value);\n }\n return value;\n }\n static merge(events) {\n const ids = new Set();\n for (const item of events) {\n if (item instanceof MenuRegistryChangeEvent) {\n ids.add(item.id);\n }\n }\n return ids;\n }\n constructor(id) {\n this.id = id;\n this.has = candidate => candidate === id;\n }\n}\nMenuRegistryChangeEvent._all = new Map();\nexport const MenuRegistry = new class {\n constructor() {\n this._commands = new Map();\n this._menuItems = new Map();\n this._onDidChangeMenu = new MicrotaskEmitter({\n merge: MenuRegistryChangeEvent.merge\n });\n this.onDidChangeMenu = this._onDidChangeMenu.event;\n }\n addCommand(command) {\n this._commands.set(command.id, command);\n this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(MenuId.CommandPalette));\n return toDisposable(() => {\n if (this._commands.delete(command.id)) {\n this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(MenuId.CommandPalette));\n }\n });\n }\n getCommand(id) {\n return this._commands.get(id);\n }\n getCommands() {\n const map = new Map();\n this._commands.forEach((value, key) => map.set(key, value));\n return map;\n }\n appendMenuItem(id, item) {\n let list = this._menuItems.get(id);\n if (!list) {\n list = new LinkedList();\n this._menuItems.set(id, list);\n }\n const rm = list.push(item);\n this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(id));\n return toDisposable(() => {\n rm();\n this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(id));\n });\n }\n appendMenuItems(items) {\n const result = new DisposableStore();\n for (const { id, item } of items) {\n result.add(this.appendMenuItem(id, item));\n }\n return result;\n }\n getMenuItems(id) {\n let result;\n if (this._menuItems.has(id)) {\n result = [...this._menuItems.get(id)];\n }\n else {\n result = [];\n }\n if (id === MenuId.CommandPalette) {\n // CommandPalette is special because it shows\n // all commands by default\n this._appendImplicitItems(result);\n }\n return result;\n }\n _appendImplicitItems(result) {\n const set = new Set();\n for (const item of result) {\n if (isIMenuItem(item)) {\n set.add(item.command.id);\n if (item.alt) {\n set.add(item.alt.id);\n }\n }\n }\n this._commands.forEach((command, id) => {\n if (!set.has(id)) {\n result.push({ command });\n }\n });\n }\n};\nexport class SubmenuItemAction extends SubmenuAction {\n constructor(item, hideActions, actions) {\n super(`submenuitem.${item.submenu.id}`, typeof item.title === 'string' ? item.title : item.title.value, actions, 'submenu');\n this.item = item;\n this.hideActions = hideActions;\n }\n}\n// implements IAction, does NOT extend Action, so that no one\n// subscribes to events of Action or modified properties\nlet MenuItemAction = MenuItemAction_1 = class MenuItemAction {\n static label(action, options) {\n return (options === null || options === void 0 ? void 0 : options.renderShortTitle) && action.shortTitle\n ? (typeof action.shortTitle === 'string' ? action.shortTitle : action.shortTitle.value)\n : (typeof action.title === 'string' ? action.title : action.title.value);\n }\n constructor(item, alt, options, hideActions, contextKeyService, _commandService) {\n var _a, _b;\n this.hideActions = hideActions;\n this._commandService = _commandService;\n this.id = item.id;\n this.label = MenuItemAction_1.label(item, options);\n this.tooltip = (_b = (typeof item.tooltip === 'string' ? item.tooltip : (_a = item.tooltip) === null || _a === void 0 ? void 0 : _a.value)) !== null && _b !== void 0 ? _b : '';\n this.enabled = !item.precondition || contextKeyService.contextMatchesRules(item.precondition);\n this.checked = undefined;\n let icon;\n if (item.toggled) {\n const toggled = (item.toggled.condition ? item.toggled : { condition: item.toggled });\n this.checked = contextKeyService.contextMatchesRules(toggled.condition);\n if (this.checked && toggled.tooltip) {\n this.tooltip = typeof toggled.tooltip === 'string' ? toggled.tooltip : toggled.tooltip.value;\n }\n if (this.checked && ThemeIcon.isThemeIcon(toggled.icon)) {\n icon = toggled.icon;\n }\n if (this.checked && toggled.title) {\n this.label = typeof toggled.title === 'string' ? toggled.title : toggled.title.value;\n }\n }\n if (!icon) {\n icon = ThemeIcon.isThemeIcon(item.icon) ? item.icon : undefined;\n }\n this.item = item;\n this.alt = alt ? new MenuItemAction_1(alt, undefined, options, hideActions, contextKeyService, _commandService) : undefined;\n this._options = options;\n this.class = icon && ThemeIcon.asClassName(icon);\n }\n run(...args) {\n var _a, _b;\n let runArgs = [];\n if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.arg) {\n runArgs = [...runArgs, this._options.arg];\n }\n if ((_b = this._options) === null || _b === void 0 ? void 0 : _b.shouldForwardArgs) {\n runArgs = [...runArgs, ...args];\n }\n return this._commandService.executeCommand(this.id, ...runArgs);\n }\n};\nMenuItemAction = MenuItemAction_1 = __decorate([\n __param(4, IContextKeyService),\n __param(5, ICommandService)\n], MenuItemAction);\nexport { MenuItemAction };\nexport class Action2 {\n constructor(desc) {\n this.desc = desc;\n }\n}\nexport function registerAction2(ctor) {\n const disposables = new DisposableStore();\n const action = new ctor();\n const { f1, menu, keybinding, ...command } = action.desc;\n if (CommandsRegistry.getCommand(command.id)) {\n throw new Error(`Cannot register two commands with the same id: ${command.id}`);\n }\n // command\n disposables.add(CommandsRegistry.registerCommand({\n id: command.id,\n handler: (accessor, ...args) => action.run(accessor, ...args),\n metadata: command.metadata,\n }));\n // menu\n if (Array.isArray(menu)) {\n for (const item of menu) {\n disposables.add(MenuRegistry.appendMenuItem(item.id, { command: { ...command, precondition: item.precondition === null ? undefined : command.precondition }, ...item }));\n }\n }\n else if (menu) {\n disposables.add(MenuRegistry.appendMenuItem(menu.id, { command: { ...command, precondition: menu.precondition === null ? undefined : command.precondition }, ...menu }));\n }\n if (f1) {\n disposables.add(MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command, when: command.precondition }));\n disposables.add(MenuRegistry.addCommand(command));\n }\n // keybinding\n if (Array.isArray(keybinding)) {\n for (const item of keybinding) {\n disposables.add(KeybindingsRegistry.registerKeybindingRule({\n ...item,\n id: command.id,\n when: command.precondition ? ContextKeyExpr.and(command.precondition, item.when) : item.when\n }));\n }\n }\n else if (keybinding) {\n disposables.add(KeybindingsRegistry.registerKeybindingRule({\n ...keybinding,\n id: command.id,\n when: command.precondition ? ContextKeyExpr.and(command.precondition, keybinding.when) : keybinding.when\n }));\n }\n return disposables;\n}\n//#endregion\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\nexport const ITelemetryService = createDecorator('telemetryService');\n", "import { Emitter } from '../../../base/common/event.js';\nimport { Disposable } from '../../../base/common/lifecycle.js';\nimport { RawContextKey } from '../../contextkey/common/contextkey.js';\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\nexport const ILogService = createDecorator('logService');\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[LogLevel[\"Off\"] = 0] = \"Off\";\n LogLevel[LogLevel[\"Trace\"] = 1] = \"Trace\";\n LogLevel[LogLevel[\"Debug\"] = 2] = \"Debug\";\n LogLevel[LogLevel[\"Info\"] = 3] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 4] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 5] = \"Error\";\n})(LogLevel || (LogLevel = {}));\nexport const DEFAULT_LOG_LEVEL = LogLevel.Info;\nexport class AbstractLogger extends Disposable {\n constructor() {\n super(...arguments);\n this.level = DEFAULT_LOG_LEVEL;\n this._onDidChangeLogLevel = this._register(new Emitter());\n this.onDidChangeLogLevel = this._onDidChangeLogLevel.event;\n }\n setLevel(level) {\n if (this.level !== level) {\n this.level = level;\n this._onDidChangeLogLevel.fire(this.level);\n }\n }\n getLevel() {\n return this.level;\n }\n checkLogLevel(level) {\n return this.level !== LogLevel.Off && this.level <= level;\n }\n}\nexport class ConsoleLogger extends AbstractLogger {\n constructor(logLevel = DEFAULT_LOG_LEVEL, useColors = true) {\n super();\n this.useColors = useColors;\n this.setLevel(logLevel);\n }\n trace(message, ...args) {\n if (this.checkLogLevel(LogLevel.Trace)) {\n if (this.useColors) {\n console.log('%cTRACE', 'color: #888', message, ...args);\n }\n else {\n console.log(message, ...args);\n }\n }\n }\n debug(message, ...args) {\n if (this.checkLogLevel(LogLevel.Debug)) {\n if (this.useColors) {\n console.log('%cDEBUG', 'background: #eee; color: #888', message, ...args);\n }\n else {\n console.log(message, ...args);\n }\n }\n }\n info(message, ...args) {\n if (this.checkLogLevel(LogLevel.Info)) {\n if (this.useColors) {\n console.log('%c INFO', 'color: #33f', message, ...args);\n }\n else {\n console.log(message, ...args);\n }\n }\n }\n warn(message, ...args) {\n if (this.checkLogLevel(LogLevel.Warning)) {\n if (this.useColors) {\n console.log('%c WARN', 'color: #993', message, ...args);\n }\n else {\n console.log(message, ...args);\n }\n }\n }\n error(message, ...args) {\n if (this.checkLogLevel(LogLevel.Error)) {\n if (this.useColors) {\n console.log('%c ERR', 'color: #f33', message, ...args);\n }\n else {\n console.error(message, ...args);\n }\n }\n }\n}\nexport class MultiplexLogger extends AbstractLogger {\n constructor(loggers) {\n super();\n this.loggers = loggers;\n if (loggers.length) {\n this.setLevel(loggers[0].getLevel());\n }\n }\n setLevel(level) {\n for (const logger of this.loggers) {\n logger.setLevel(level);\n }\n super.setLevel(level);\n }\n trace(message, ...args) {\n for (const logger of this.loggers) {\n logger.trace(message, ...args);\n }\n }\n debug(message, ...args) {\n for (const logger of this.loggers) {\n logger.debug(message, ...args);\n }\n }\n info(message, ...args) {\n for (const logger of this.loggers) {\n logger.info(message, ...args);\n }\n }\n warn(message, ...args) {\n for (const logger of this.loggers) {\n logger.warn(message, ...args);\n }\n }\n error(message, ...args) {\n for (const logger of this.loggers) {\n logger.error(message, ...args);\n }\n }\n dispose() {\n for (const logger of this.loggers) {\n logger.dispose();\n }\n super.dispose();\n }\n}\nexport function LogLevelToString(logLevel) {\n switch (logLevel) {\n case LogLevel.Trace: return 'trace';\n case LogLevel.Debug: return 'debug';\n case LogLevel.Info: return 'info';\n case LogLevel.Warning: return 'warn';\n case LogLevel.Error: return 'error';\n case LogLevel.Off: return 'off';\n }\n}\n// Contexts\nexport const CONTEXT_LOG_LEVEL = new RawContextKey('logLevel', LogLevelToString(LogLevel.Info));\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as browser from './browser.js';\nimport { mainWindow } from './window.js';\nimport * as platform from '../common/platform.js';\n/**\n * Browser feature we can support in current platform, browser and environment.\n */\nexport const BrowserFeatures = {\n clipboard: {\n writeText: (platform.isNative\n || (document.queryCommandSupported && document.queryCommandSupported('copy'))\n || !!(navigator && navigator.clipboard && navigator.clipboard.writeText)),\n readText: (platform.isNative\n || !!(navigator && navigator.clipboard && navigator.clipboard.readText))\n },\n keyboard: (() => {\n if (platform.isNative || browser.isStandalone()) {\n return 0 /* KeyboardSupport.Always */;\n }\n if (navigator.keyboard || browser.isSafari) {\n return 1 /* KeyboardSupport.FullScreen */;\n }\n return 2 /* KeyboardSupport.None */;\n })(),\n // 'ontouchstart' in window always evaluates to true with typescript's modern typings. This causes `window` to be\n // `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast\n touch: 'ontouchstart' in mainWindow || navigator.maxTouchPoints > 0,\n pointerEvents: mainWindow.PointerEvent && ('ontouchstart' in mainWindow || navigator.maxTouchPoints > 0)\n};\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as browser from './browser.js';\nimport { EVENT_KEY_CODE_MAP, KeyCodeUtils } from '../common/keyCodes.js';\nimport { KeyCodeChord } from '../common/keybindings.js';\nimport * as platform from '../common/platform.js';\nfunction extractKeyCode(e) {\n if (e.charCode) {\n // \"keypress\" events mostly\n const char = String.fromCharCode(e.charCode).toUpperCase();\n return KeyCodeUtils.fromString(char);\n }\n const keyCode = e.keyCode;\n // browser quirks\n if (keyCode === 3) {\n return 7 /* KeyCode.PauseBreak */;\n }\n else if (browser.isFirefox) {\n switch (keyCode) {\n case 59: return 85 /* KeyCode.Semicolon */;\n case 60:\n if (platform.isLinux) {\n return 97 /* KeyCode.IntlBackslash */;\n }\n break;\n case 61: return 86 /* KeyCode.Equal */;\n // based on: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#numpad_keys\n case 107: return 109 /* KeyCode.NumpadAdd */;\n case 109: return 111 /* KeyCode.NumpadSubtract */;\n case 173: return 88 /* KeyCode.Minus */;\n case 224:\n if (platform.isMacintosh) {\n return 57 /* KeyCode.Meta */;\n }\n break;\n }\n }\n else if (browser.isWebKit) {\n if (platform.isMacintosh && keyCode === 93) {\n // the two meta keys in the Mac have different key codes (91 and 93)\n return 57 /* KeyCode.Meta */;\n }\n else if (!platform.isMacintosh && keyCode === 92) {\n return 57 /* KeyCode.Meta */;\n }\n }\n // cross browser keycodes:\n return EVENT_KEY_CODE_MAP[keyCode] || 0 /* KeyCode.Unknown */;\n}\nconst ctrlKeyMod = (platform.isMacintosh ? 256 /* KeyMod.WinCtrl */ : 2048 /* KeyMod.CtrlCmd */);\nconst altKeyMod = 512 /* KeyMod.Alt */;\nconst shiftKeyMod = 1024 /* KeyMod.Shift */;\nconst metaKeyMod = (platform.isMacintosh ? 2048 /* KeyMod.CtrlCmd */ : 256 /* KeyMod.WinCtrl */);\nexport class StandardKeyboardEvent {\n constructor(source) {\n this._standardKeyboardEventBrand = true;\n const e = source;\n this.browserEvent = e;\n this.target = e.target;\n this.ctrlKey = e.ctrlKey;\n this.shiftKey = e.shiftKey;\n this.altKey = e.altKey;\n this.metaKey = e.metaKey;\n this.altGraphKey = e.getModifierState('AltGraph');\n this.keyCode = extractKeyCode(e);\n this.code = e.code;\n // console.info(e.type + \": keyCode: \" + e.keyCode + \", which: \" + e.which + \", charCode: \" + e.charCode + \", detail: \" + e.detail + \" ====> \" + this.keyCode + ' -- ' + KeyCode[this.keyCode]);\n this.ctrlKey = this.ctrlKey || this.keyCode === 5 /* KeyCode.Ctrl */;\n this.altKey = this.altKey || this.keyCode === 6 /* KeyCode.Alt */;\n this.shiftKey = this.shiftKey || this.keyCode === 4 /* KeyCode.Shift */;\n this.metaKey = this.metaKey || this.keyCode === 57 /* KeyCode.Meta */;\n this._asKeybinding = this._computeKeybinding();\n this._asKeyCodeChord = this._computeKeyCodeChord();\n // console.log(`code: ${e.code}, keyCode: ${e.keyCode}, key: ${e.key}`);\n }\n preventDefault() {\n if (this.browserEvent && this.browserEvent.preventDefault) {\n this.browserEvent.preventDefault();\n }\n }\n stopPropagation() {\n if (this.browserEvent && this.browserEvent.stopPropagation) {\n this.browserEvent.stopPropagation();\n }\n }\n toKeyCodeChord() {\n return this._asKeyCodeChord;\n }\n equals(other) {\n return this._asKeybinding === other;\n }\n _computeKeybinding() {\n let key = 0 /* KeyCode.Unknown */;\n if (this.keyCode !== 5 /* KeyCode.Ctrl */ && this.keyCode !== 4 /* KeyCode.Shift */ && this.keyCode !== 6 /* KeyCode.Alt */ && this.keyCode !== 57 /* KeyCode.Meta */) {\n key = this.keyCode;\n }\n let result = 0;\n if (this.ctrlKey) {\n result |= ctrlKeyMod;\n }\n if (this.altKey) {\n result |= altKeyMod;\n }\n if (this.shiftKey) {\n result |= shiftKeyMod;\n }\n if (this.metaKey) {\n result |= metaKeyMod;\n }\n result |= key;\n return result;\n }\n _computeKeyCodeChord() {\n let key = 0 /* KeyCode.Unknown */;\n if (this.keyCode !== 5 /* KeyCode.Ctrl */ && this.keyCode !== 4 /* KeyCode.Shift */ && this.keyCode !== 6 /* KeyCode.Alt */ && this.keyCode !== 57 /* KeyCode.Meta */) {\n key = this.keyCode;\n }\n return new KeyCodeChord(this.ctrlKey, this.shiftKey, this.altKey, this.metaKey, key);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nconst sameOriginWindowChainCache = new WeakMap();\nfunction getParentWindowIfSameOrigin(w) {\n if (!w.parent || w.parent === w) {\n return null;\n }\n // Cannot really tell if we have access to the parent window unless we try to access something in it\n try {\n const location = w.location;\n const parentLocation = w.parent.location;\n if (location.origin !== 'null' && parentLocation.origin !== 'null' && location.origin !== parentLocation.origin) {\n return null;\n }\n }\n catch (e) {\n return null;\n }\n return w.parent;\n}\nexport class IframeUtils {\n /**\n * Returns a chain of embedded windows with the same origin (which can be accessed programmatically).\n * Having a chain of length 1 might mean that the current execution environment is running outside of an iframe or inside an iframe embedded in a window with a different origin.\n */\n static getSameOriginWindowChain(targetWindow) {\n let windowChainCache = sameOriginWindowChainCache.get(targetWindow);\n if (!windowChainCache) {\n windowChainCache = [];\n sameOriginWindowChainCache.set(targetWindow, windowChainCache);\n let w = targetWindow;\n let parent;\n do {\n parent = getParentWindowIfSameOrigin(w);\n if (parent) {\n windowChainCache.push({\n window: new WeakRef(w),\n iframeElement: w.frameElement || null\n });\n }\n else {\n windowChainCache.push({\n window: new WeakRef(w),\n iframeElement: null\n });\n }\n w = parent;\n } while (w);\n }\n return windowChainCache.slice(0);\n }\n /**\n * Returns the position of `childWindow` relative to `ancestorWindow`\n */\n static getPositionOfChildWindowRelativeToAncestorWindow(childWindow, ancestorWindow) {\n var _a, _b;\n if (!ancestorWindow || childWindow === ancestorWindow) {\n return {\n top: 0,\n left: 0\n };\n }\n let top = 0, left = 0;\n const windowChain = this.getSameOriginWindowChain(childWindow);\n for (const windowChainEl of windowChain) {\n const windowInChain = windowChainEl.window.deref();\n top += (_a = windowInChain === null || windowInChain === void 0 ? void 0 : windowInChain.scrollY) !== null && _a !== void 0 ? _a : 0;\n left += (_b = windowInChain === null || windowInChain === void 0 ? void 0 : windowInChain.scrollX) !== null && _b !== void 0 ? _b : 0;\n if (windowInChain === ancestorWindow) {\n break;\n }\n if (!windowChainEl.iframeElement) {\n break;\n }\n const boundingRect = windowChainEl.iframeElement.getBoundingClientRect();\n top += boundingRect.top;\n left += boundingRect.left;\n }\n return {\n top: top,\n left: left\n };\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as browser from './browser.js';\nimport { IframeUtils } from './iframe.js';\nimport * as platform from '../common/platform.js';\nexport class StandardMouseEvent {\n constructor(targetWindow, e) {\n this.timestamp = Date.now();\n this.browserEvent = e;\n this.leftButton = e.button === 0;\n this.middleButton = e.button === 1;\n this.rightButton = e.button === 2;\n this.buttons = e.buttons;\n this.target = e.target;\n this.detail = e.detail || 1;\n if (e.type === 'dblclick') {\n this.detail = 2;\n }\n this.ctrlKey = e.ctrlKey;\n this.shiftKey = e.shiftKey;\n this.altKey = e.altKey;\n this.metaKey = e.metaKey;\n if (typeof e.pageX === 'number') {\n this.posx = e.pageX;\n this.posy = e.pageY;\n }\n else {\n // Probably hit by MSGestureEvent\n this.posx = e.clientX + this.target.ownerDocument.body.scrollLeft + this.target.ownerDocument.documentElement.scrollLeft;\n this.posy = e.clientY + this.target.ownerDocument.body.scrollTop + this.target.ownerDocument.documentElement.scrollTop;\n }\n // Find the position of the iframe this code is executing in relative to the iframe where the event was captured.\n const iframeOffsets = IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(targetWindow, e.view);\n this.posx -= iframeOffsets.left;\n this.posy -= iframeOffsets.top;\n }\n preventDefault() {\n this.browserEvent.preventDefault();\n }\n stopPropagation() {\n this.browserEvent.stopPropagation();\n }\n}\nexport class StandardWheelEvent {\n constructor(e, deltaX = 0, deltaY = 0) {\n var _a;\n this.browserEvent = e || null;\n this.target = e ? (e.target || e.targetNode || e.srcElement) : null;\n this.deltaY = deltaY;\n this.deltaX = deltaX;\n if (e) {\n // Old (deprecated) wheel events\n const e1 = e;\n const e2 = e;\n const devicePixelRatio = ((_a = e.view) === null || _a === void 0 ? void 0 : _a.devicePixelRatio) || 1;\n // vertical delta scroll\n if (typeof e1.wheelDeltaY !== 'undefined') {\n if (browser.isChrome) {\n // Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n this.deltaY = e1.wheelDeltaY / (120 * devicePixelRatio);\n }\n else {\n this.deltaY = e1.wheelDeltaY / 120;\n }\n }\n else if (typeof e2.VERTICAL_AXIS !== 'undefined' && e2.axis === e2.VERTICAL_AXIS) {\n this.deltaY = -e2.detail / 3;\n }\n else if (e.type === 'wheel') {\n // Modern wheel event\n // https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n const ev = e;\n if (ev.deltaMode === ev.DOM_DELTA_LINE) {\n // the deltas are expressed in lines\n if (browser.isFirefox && !platform.isMacintosh) {\n this.deltaY = -e.deltaY / 3;\n }\n else {\n this.deltaY = -e.deltaY;\n }\n }\n else {\n this.deltaY = -e.deltaY / 40;\n }\n }\n // horizontal delta scroll\n if (typeof e1.wheelDeltaX !== 'undefined') {\n if (browser.isSafari && platform.isWindows) {\n this.deltaX = -(e1.wheelDeltaX / 120);\n }\n else if (browser.isChrome) {\n // Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n this.deltaX = e1.wheelDeltaX / (120 * devicePixelRatio);\n }\n else {\n this.deltaX = e1.wheelDeltaX / 120;\n }\n }\n else if (typeof e2.HORIZONTAL_AXIS !== 'undefined' && e2.axis === e2.HORIZONTAL_AXIS) {\n this.deltaX = -e.detail / 3;\n }\n else if (e.type === 'wheel') {\n // Modern wheel event\n // https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n const ev = e;\n if (ev.deltaMode === ev.DOM_DELTA_LINE) {\n // the deltas are expressed in lines\n if (browser.isFirefox && !platform.isMacintosh) {\n this.deltaX = -e.deltaX / 3;\n }\n else {\n this.deltaX = -e.deltaX;\n }\n }\n else {\n this.deltaX = -e.deltaX / 40;\n }\n }\n // Assume a vertical scroll if nothing else worked\n if (this.deltaY === 0 && this.deltaX === 0 && e.wheelDelta) {\n if (browser.isChrome) {\n // Refs https://github.com/microsoft/vscode/issues/146403#issuecomment-1854538928\n this.deltaY = e.wheelDelta / (120 * devicePixelRatio);\n }\n else {\n this.deltaY = e.wheelDelta / 120;\n }\n }\n }\n }\n preventDefault() {\n var _a;\n (_a = this.browserEvent) === null || _a === void 0 ? void 0 : _a.preventDefault();\n }\n stopPropagation() {\n var _a;\n (_a = this.browserEvent) === null || _a === void 0 ? void 0 : _a.stopPropagation();\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Can be passed into the Delayed to defer using a microtask\n * */\nexport const MicrotaskDelay = Symbol('MicrotaskDelay');\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { CancellationTokenSource } from './cancellation.js';\nimport { CancellationError } from './errors.js';\nimport { Emitter, Event } from './event.js';\nimport { toDisposable } from './lifecycle.js';\nimport { setTimeout0 } from './platform.js';\nimport { MicrotaskDelay } from './symbols.js';\nexport function isThenable(obj) {\n return !!obj && typeof obj.then === 'function';\n}\nexport function createCancelablePromise(callback) {\n const source = new CancellationTokenSource();\n const thenable = callback(source.token);\n const promise = new Promise((resolve, reject) => {\n const subscription = source.token.onCancellationRequested(() => {\n subscription.dispose();\n reject(new CancellationError());\n });\n Promise.resolve(thenable).then(value => {\n subscription.dispose();\n source.dispose();\n resolve(value);\n }, err => {\n subscription.dispose();\n source.dispose();\n reject(err);\n });\n });\n return new class {\n cancel() {\n source.cancel();\n source.dispose();\n }\n then(resolve, reject) {\n return promise.then(resolve, reject);\n }\n catch(reject) {\n return this.then(undefined, reject);\n }\n finally(onfinally) {\n return promise.finally(onfinally);\n }\n };\n}\nexport function raceCancellation(promise, token, defaultValue) {\n return new Promise((resolve, reject) => {\n const ref = token.onCancellationRequested(() => {\n ref.dispose();\n resolve(defaultValue);\n });\n promise.then(resolve, reject).finally(() => ref.dispose());\n });\n}\n/**\n * A helper to prevent accumulation of sequential async tasks.\n *\n * Imagine a mail man with the sole task of delivering letters. As soon as\n * a letter submitted for delivery, he drives to the destination, delivers it\n * and returns to his base. Imagine that during the trip, N more letters were submitted.\n * When the mail man returns, he picks those N letters and delivers them all in a\n * single trip. Even though N+1 submissions occurred, only 2 deliveries were made.\n *\n * The throttler implements this via the queue() method, by providing it a task\n * factory. Following the example:\n *\n * \t\tconst throttler = new Throttler();\n * \t\tconst letters = [];\n *\n * \t\tfunction deliver() {\n * \t\t\tconst lettersToDeliver = letters;\n * \t\t\tletters = [];\n * \t\t\treturn makeTheTrip(lettersToDeliver);\n * \t\t}\n *\n * \t\tfunction onLetterReceived(l) {\n * \t\t\tletters.push(l);\n * \t\t\tthrottler.queue(deliver);\n * \t\t}\n */\nexport class Throttler {\n constructor() {\n this.isDisposed = false;\n this.activePromise = null;\n this.queuedPromise = null;\n this.queuedPromiseFactory = null;\n }\n queue(promiseFactory) {\n if (this.isDisposed) {\n return Promise.reject(new Error('Throttler is disposed'));\n }\n if (this.activePromise) {\n this.queuedPromiseFactory = promiseFactory;\n if (!this.queuedPromise) {\n const onComplete = () => {\n this.queuedPromise = null;\n if (this.isDisposed) {\n return;\n }\n const result = this.queue(this.queuedPromiseFactory);\n this.queuedPromiseFactory = null;\n return result;\n };\n this.queuedPromise = new Promise(resolve => {\n this.activePromise.then(onComplete, onComplete).then(resolve);\n });\n }\n return new Promise((resolve, reject) => {\n this.queuedPromise.then(resolve, reject);\n });\n }\n this.activePromise = promiseFactory();\n return new Promise((resolve, reject) => {\n this.activePromise.then((result) => {\n this.activePromise = null;\n resolve(result);\n }, (err) => {\n this.activePromise = null;\n reject(err);\n });\n });\n }\n dispose() {\n this.isDisposed = true;\n }\n}\nconst timeoutDeferred = (timeout, fn) => {\n let scheduled = true;\n const handle = setTimeout(() => {\n scheduled = false;\n fn();\n }, timeout);\n return {\n isTriggered: () => scheduled,\n dispose: () => {\n clearTimeout(handle);\n scheduled = false;\n },\n };\n};\nconst microtaskDeferred = (fn) => {\n let scheduled = true;\n queueMicrotask(() => {\n if (scheduled) {\n scheduled = false;\n fn();\n }\n });\n return {\n isTriggered: () => scheduled,\n dispose: () => { scheduled = false; },\n };\n};\n/**\n * A helper to delay (debounce) execution of a task that is being requested often.\n *\n * Following the throttler, now imagine the mail man wants to optimize the number of\n * trips proactively. The trip itself can be long, so he decides not to make the trip\n * as soon as a letter is submitted. Instead he waits a while, in case more\n * letters are submitted. After said waiting period, if no letters were submitted, he\n * decides to make the trip. Imagine that N more letters were submitted after the first\n * one, all within a short period of time between each other. Even though N+1\n * submissions occurred, only 1 delivery was made.\n *\n * The delayer offers this behavior via the trigger() method, into which both the task\n * to be executed and the waiting period (delay) must be passed in as arguments. Following\n * the example:\n *\n * \t\tconst delayer = new Delayer(WAITING_PERIOD);\n * \t\tconst letters = [];\n *\n * \t\tfunction letterReceived(l) {\n * \t\t\tletters.push(l);\n * \t\t\tdelayer.trigger(() => { return makeTheTrip(); });\n * \t\t}\n */\nexport class Delayer {\n constructor(defaultDelay) {\n this.defaultDelay = defaultDelay;\n this.deferred = null;\n this.completionPromise = null;\n this.doResolve = null;\n this.doReject = null;\n this.task = null;\n }\n trigger(task, delay = this.defaultDelay) {\n this.task = task;\n this.cancelTimeout();\n if (!this.completionPromise) {\n this.completionPromise = new Promise((resolve, reject) => {\n this.doResolve = resolve;\n this.doReject = reject;\n }).then(() => {\n this.completionPromise = null;\n this.doResolve = null;\n if (this.task) {\n const task = this.task;\n this.task = null;\n return task();\n }\n return undefined;\n });\n }\n const fn = () => {\n var _a;\n this.deferred = null;\n (_a = this.doResolve) === null || _a === void 0 ? void 0 : _a.call(this, null);\n };\n this.deferred = delay === MicrotaskDelay ? microtaskDeferred(fn) : timeoutDeferred(delay, fn);\n return this.completionPromise;\n }\n isTriggered() {\n var _a;\n return !!((_a = this.deferred) === null || _a === void 0 ? void 0 : _a.isTriggered());\n }\n cancel() {\n var _a;\n this.cancelTimeout();\n if (this.completionPromise) {\n (_a = this.doReject) === null || _a === void 0 ? void 0 : _a.call(this, new CancellationError());\n this.completionPromise = null;\n }\n }\n cancelTimeout() {\n var _a;\n (_a = this.deferred) === null || _a === void 0 ? void 0 : _a.dispose();\n this.deferred = null;\n }\n dispose() {\n this.cancel();\n }\n}\n/**\n * A helper to delay execution of a task that is being requested often, while\n * preventing accumulation of consecutive executions, while the task runs.\n *\n * The mail man is clever and waits for a certain amount of time, before going\n * out to deliver letters. While the mail man is going out, more letters arrive\n * and can only be delivered once he is back. Once he is back the mail man will\n * do one more trip to deliver the letters that have accumulated while he was out.\n */\nexport class ThrottledDelayer {\n constructor(defaultDelay) {\n this.delayer = new Delayer(defaultDelay);\n this.throttler = new Throttler();\n }\n trigger(promiseFactory, delay) {\n return this.delayer.trigger(() => this.throttler.queue(promiseFactory), delay);\n }\n cancel() {\n this.delayer.cancel();\n }\n dispose() {\n this.delayer.dispose();\n this.throttler.dispose();\n }\n}\nexport function timeout(millis, token) {\n if (!token) {\n return createCancelablePromise(token => timeout(millis, token));\n }\n return new Promise((resolve, reject) => {\n const handle = setTimeout(() => {\n disposable.dispose();\n resolve();\n }, millis);\n const disposable = token.onCancellationRequested(() => {\n clearTimeout(handle);\n disposable.dispose();\n reject(new CancellationError());\n });\n });\n}\n/**\n * Creates a timeout that can be disposed using its returned value.\n * @param handler The timeout handler.\n * @param timeout An optional timeout in milliseconds.\n * @param store An optional {@link DisposableStore} that will have the timeout disposable managed automatically.\n *\n * @example\n * const store = new DisposableStore;\n * // Call the timeout after 1000ms at which point it will be automatically\n * // evicted from the store.\n * const timeoutDisposable = disposableTimeout(() => {}, 1000, store);\n *\n * if (foo) {\n * // Cancel the timeout and evict it from store.\n * timeoutDisposable.dispose();\n * }\n */\nexport function disposableTimeout(handler, timeout = 0, store) {\n const timer = setTimeout(() => {\n handler();\n if (store) {\n disposable.dispose();\n }\n }, timeout);\n const disposable = toDisposable(() => {\n clearTimeout(timer);\n store === null || store === void 0 ? void 0 : store.deleteAndLeak(disposable);\n });\n store === null || store === void 0 ? void 0 : store.add(disposable);\n return disposable;\n}\nexport function first(promiseFactories, shouldStop = t => !!t, defaultValue = null) {\n let index = 0;\n const len = promiseFactories.length;\n const loop = () => {\n if (index >= len) {\n return Promise.resolve(defaultValue);\n }\n const factory = promiseFactories[index++];\n const promise = Promise.resolve(factory());\n return promise.then(result => {\n if (shouldStop(result)) {\n return Promise.resolve(result);\n }\n return loop();\n });\n };\n return loop();\n}\nexport class TimeoutTimer {\n constructor(runner, timeout) {\n this._token = -1;\n if (typeof runner === 'function' && typeof timeout === 'number') {\n this.setIfNotSet(runner, timeout);\n }\n }\n dispose() {\n this.cancel();\n }\n cancel() {\n if (this._token !== -1) {\n clearTimeout(this._token);\n this._token = -1;\n }\n }\n cancelAndSet(runner, timeout) {\n this.cancel();\n this._token = setTimeout(() => {\n this._token = -1;\n runner();\n }, timeout);\n }\n setIfNotSet(runner, timeout) {\n if (this._token !== -1) {\n // timer is already set\n return;\n }\n this._token = setTimeout(() => {\n this._token = -1;\n runner();\n }, timeout);\n }\n}\nexport class IntervalTimer {\n constructor() {\n this.disposable = undefined;\n }\n cancel() {\n var _a;\n (_a = this.disposable) === null || _a === void 0 ? void 0 : _a.dispose();\n this.disposable = undefined;\n }\n cancelAndSet(runner, interval, context = globalThis) {\n this.cancel();\n const handle = context.setInterval(() => {\n runner();\n }, interval);\n this.disposable = toDisposable(() => {\n context.clearInterval(handle);\n this.disposable = undefined;\n });\n }\n dispose() {\n this.cancel();\n }\n}\nexport class RunOnceScheduler {\n constructor(runner, delay) {\n this.timeoutToken = -1;\n this.runner = runner;\n this.timeout = delay;\n this.timeoutHandler = this.onTimeout.bind(this);\n }\n /**\n * Dispose RunOnceScheduler\n */\n dispose() {\n this.cancel();\n this.runner = null;\n }\n /**\n * Cancel current scheduled runner (if any).\n */\n cancel() {\n if (this.isScheduled()) {\n clearTimeout(this.timeoutToken);\n this.timeoutToken = -1;\n }\n }\n /**\n * Cancel previous runner (if any) & schedule a new runner.\n */\n schedule(delay = this.timeout) {\n this.cancel();\n this.timeoutToken = setTimeout(this.timeoutHandler, delay);\n }\n get delay() {\n return this.timeout;\n }\n set delay(value) {\n this.timeout = value;\n }\n /**\n * Returns true if scheduled.\n */\n isScheduled() {\n return this.timeoutToken !== -1;\n }\n onTimeout() {\n this.timeoutToken = -1;\n if (this.runner) {\n this.doRun();\n }\n }\n doRun() {\n var _a;\n (_a = this.runner) === null || _a === void 0 ? void 0 : _a.call(this);\n }\n}\n/**\n * Execute the callback the next time the browser is idle, returning an\n * {@link IDisposable} that will cancel the callback when disposed. This wraps\n * [requestIdleCallback] so it will fallback to [setTimeout] if the environment\n * doesn't support it.\n *\n * @param callback The callback to run when idle, this includes an\n * [IdleDeadline] that provides the time alloted for the idle callback by the\n * browser. Not respecting this deadline will result in a degraded user\n * experience.\n * @param timeout A timeout at which point to queue no longer wait for an idle\n * callback but queue it on the regular event loop (like setTimeout). Typically\n * this should not be used.\n *\n * [IdleDeadline]: https://developer.mozilla.org/en-US/docs/Web/API/IdleDeadline\n * [requestIdleCallback]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback\n * [setTimeout]: https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout\n *\n * **Note** that there is `dom.ts#runWhenWindowIdle` which is better suited when running inside a browser\n * context\n */\nexport let runWhenGlobalIdle;\nexport let _runWhenIdle;\n(function () {\n if (typeof globalThis.requestIdleCallback !== 'function' || typeof globalThis.cancelIdleCallback !== 'function') {\n _runWhenIdle = (_targetWindow, runner) => {\n setTimeout0(() => {\n if (disposed) {\n return;\n }\n const end = Date.now() + 15; // one frame at 64fps\n const deadline = {\n didTimeout: true,\n timeRemaining() {\n return Math.max(0, end - Date.now());\n }\n };\n runner(Object.freeze(deadline));\n });\n let disposed = false;\n return {\n dispose() {\n if (disposed) {\n return;\n }\n disposed = true;\n }\n };\n };\n }\n else {\n _runWhenIdle = (targetWindow, runner, timeout) => {\n const handle = targetWindow.requestIdleCallback(runner, typeof timeout === 'number' ? { timeout } : undefined);\n let disposed = false;\n return {\n dispose() {\n if (disposed) {\n return;\n }\n disposed = true;\n targetWindow.cancelIdleCallback(handle);\n }\n };\n };\n }\n runWhenGlobalIdle = (runner) => _runWhenIdle(globalThis, runner);\n})();\nexport class AbstractIdleValue {\n constructor(targetWindow, executor) {\n this._didRun = false;\n this._executor = () => {\n try {\n this._value = executor();\n }\n catch (err) {\n this._error = err;\n }\n finally {\n this._didRun = true;\n }\n };\n this._handle = _runWhenIdle(targetWindow, () => this._executor());\n }\n dispose() {\n this._handle.dispose();\n }\n get value() {\n if (!this._didRun) {\n this._handle.dispose();\n this._executor();\n }\n if (this._error) {\n throw this._error;\n }\n return this._value;\n }\n get isInitialized() {\n return this._didRun;\n }\n}\n/**\n * An `IdleValue` that always uses the current window (which might be throttled or inactive)\n *\n * **Note** that there is `dom.ts#WindowIdleValue` which is better suited when running inside a browser\n * context\n */\nexport class GlobalIdleValue extends AbstractIdleValue {\n constructor(executor) {\n super(globalThis, executor);\n }\n}\n/**\n * Creates a promise whose resolution or rejection can be controlled imperatively.\n */\nexport class DeferredPromise {\n get isRejected() {\n var _a;\n return ((_a = this.outcome) === null || _a === void 0 ? void 0 : _a.outcome) === 1 /* DeferredOutcome.Rejected */;\n }\n get isSettled() {\n return !!this.outcome;\n }\n constructor() {\n this.p = new Promise((c, e) => {\n this.completeCallback = c;\n this.errorCallback = e;\n });\n }\n complete(value) {\n return new Promise(resolve => {\n this.completeCallback(value);\n this.outcome = { outcome: 0 /* DeferredOutcome.Resolved */, value };\n resolve();\n });\n }\n error(err) {\n return new Promise(resolve => {\n this.errorCallback(err);\n this.outcome = { outcome: 1 /* DeferredOutcome.Rejected */, value: err };\n resolve();\n });\n }\n cancel() {\n return this.error(new CancellationError());\n }\n}\n//#endregion\n//#region Promises\nexport var Promises;\n(function (Promises) {\n /**\n * A drop-in replacement for `Promise.all` with the only difference\n * that the method awaits every promise to either fulfill or reject.\n *\n * Similar to `Promise.all`, only the first error will be returned\n * if any.\n */\n async function settled(promises) {\n let firstError = undefined;\n const result = await Promise.all(promises.map(promise => promise.then(value => value, error => {\n if (!firstError) {\n firstError = error;\n }\n return undefined; // do not rethrow so that other promises can settle\n })));\n if (typeof firstError !== 'undefined') {\n throw firstError;\n }\n return result; // cast is needed and protected by the `throw` above\n }\n Promises.settled = settled;\n /**\n * A helper to create a new `Promise` with a body that is a promise\n * itself. By default, an error that raises from the async body will\n * end up as a unhandled rejection, so this utility properly awaits the\n * body and rejects the promise as a normal promise does without async\n * body.\n *\n * This method should only be used in rare cases where otherwise `async`\n * cannot be used (e.g. when callbacks are involved that require this).\n */\n function withAsyncBody(bodyFn) {\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, reject) => {\n try {\n await bodyFn(resolve, reject);\n }\n catch (error) {\n reject(error);\n }\n });\n }\n Promises.withAsyncBody = withAsyncBody;\n})(Promises || (Promises = {}));\n/**\n * A rich implementation for an `AsyncIterable`.\n */\nexport class AsyncIterableObject {\n static fromArray(items) {\n return new AsyncIterableObject((writer) => {\n writer.emitMany(items);\n });\n }\n static fromPromise(promise) {\n return new AsyncIterableObject(async (emitter) => {\n emitter.emitMany(await promise);\n });\n }\n static fromPromises(promises) {\n return new AsyncIterableObject(async (emitter) => {\n await Promise.all(promises.map(async (p) => emitter.emitOne(await p)));\n });\n }\n static merge(iterables) {\n return new AsyncIterableObject(async (emitter) => {\n await Promise.all(iterables.map(async (iterable) => {\n for await (const item of iterable) {\n emitter.emitOne(item);\n }\n }));\n });\n }\n constructor(executor) {\n this._state = 0 /* AsyncIterableSourceState.Initial */;\n this._results = [];\n this._error = null;\n this._onStateChanged = new Emitter();\n queueMicrotask(async () => {\n const writer = {\n emitOne: (item) => this.emitOne(item),\n emitMany: (items) => this.emitMany(items),\n reject: (error) => this.reject(error)\n };\n try {\n await Promise.resolve(executor(writer));\n this.resolve();\n }\n catch (err) {\n this.reject(err);\n }\n finally {\n writer.emitOne = undefined;\n writer.emitMany = undefined;\n writer.reject = undefined;\n }\n });\n }\n [Symbol.asyncIterator]() {\n let i = 0;\n return {\n next: async () => {\n do {\n if (this._state === 2 /* AsyncIterableSourceState.DoneError */) {\n throw this._error;\n }\n if (i < this._results.length) {\n return { done: false, value: this._results[i++] };\n }\n if (this._state === 1 /* AsyncIterableSourceState.DoneOK */) {\n return { done: true, value: undefined };\n }\n await Event.toPromise(this._onStateChanged.event);\n } while (true);\n }\n };\n }\n static map(iterable, mapFn) {\n return new AsyncIterableObject(async (emitter) => {\n for await (const item of iterable) {\n emitter.emitOne(mapFn(item));\n }\n });\n }\n map(mapFn) {\n return AsyncIterableObject.map(this, mapFn);\n }\n static filter(iterable, filterFn) {\n return new AsyncIterableObject(async (emitter) => {\n for await (const item of iterable) {\n if (filterFn(item)) {\n emitter.emitOne(item);\n }\n }\n });\n }\n filter(filterFn) {\n return AsyncIterableObject.filter(this, filterFn);\n }\n static coalesce(iterable) {\n return AsyncIterableObject.filter(iterable, item => !!item);\n }\n coalesce() {\n return AsyncIterableObject.coalesce(this);\n }\n static async toPromise(iterable) {\n const result = [];\n for await (const item of iterable) {\n result.push(item);\n }\n return result;\n }\n toPromise() {\n return AsyncIterableObject.toPromise(this);\n }\n /**\n * The value will be appended at the end.\n *\n * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.\n */\n emitOne(value) {\n if (this._state !== 0 /* AsyncIterableSourceState.Initial */) {\n return;\n }\n // it is important to add new values at the end,\n // as we may have iterators already running on the array\n this._results.push(value);\n this._onStateChanged.fire();\n }\n /**\n * The values will be appended at the end.\n *\n * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.\n */\n emitMany(values) {\n if (this._state !== 0 /* AsyncIterableSourceState.Initial */) {\n return;\n }\n // it is important to add new values at the end,\n // as we may have iterators already running on the array\n this._results = this._results.concat(values);\n this._onStateChanged.fire();\n }\n /**\n * Calling `resolve()` will mark the result array as complete.\n *\n * **NOTE** `resolve()` must be called, otherwise all consumers of this iterable will hang indefinitely, similar to a non-resolved promise.\n * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.\n */\n resolve() {\n if (this._state !== 0 /* AsyncIterableSourceState.Initial */) {\n return;\n }\n this._state = 1 /* AsyncIterableSourceState.DoneOK */;\n this._onStateChanged.fire();\n }\n /**\n * Writing an error will permanently invalidate this iterable.\n * The current users will receive an error thrown, as will all future users.\n *\n * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.\n */\n reject(error) {\n if (this._state !== 0 /* AsyncIterableSourceState.Initial */) {\n return;\n }\n this._state = 2 /* AsyncIterableSourceState.DoneError */;\n this._error = error;\n this._onStateChanged.fire();\n }\n}\nAsyncIterableObject.EMPTY = AsyncIterableObject.fromArray([]);\nexport class CancelableAsyncIterableObject extends AsyncIterableObject {\n constructor(_source, executor) {\n super(executor);\n this._source = _source;\n }\n cancel() {\n this._source.cancel();\n }\n}\nexport function createCancelableAsyncIterable(callback) {\n const source = new CancellationTokenSource();\n const innerIterable = callback(source.token);\n return new CancelableAsyncIterableObject(source, async (emitter) => {\n const subscription = source.token.onCancellationRequested(() => {\n subscription.dispose();\n source.dispose();\n emitter.reject(new CancellationError());\n });\n try {\n for await (const item of innerIterable) {\n if (source.token.isCancellationRequested) {\n // canceled in the meantime\n return;\n }\n emitter.emitOne(item);\n }\n subscription.dispose();\n source.dispose();\n }\n catch (err) {\n subscription.dispose();\n source.dispose();\n emitter.reject(err);\n }\n });\n}\n//#endregion\n", "/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */\n\nconst {\n\tentries,\n\tsetPrototypeOf,\n\tisFrozen,\n\tgetPrototypeOf,\n\tgetOwnPropertyDescriptor\n} = Object;\nlet {\n\tfreeze,\n\tseal,\n\tcreate\n} = Object; // eslint-disable-line import/no-mutable-exports\n\nlet {\n\tapply,\n\tconstruct\n} = typeof Reflect !== 'undefined' && Reflect;\n\nif (!apply) {\n\tapply = function apply(fun, thisValue, args) {\n\t\treturn fun.apply(thisValue, args);\n\t};\n}\n\nif (!freeze) {\n\tfreeze = function freeze(x) {\n\t\treturn x;\n\t};\n}\n\nif (!seal) {\n\tseal = function seal(x) {\n\t\treturn x;\n\t};\n}\n\nif (!construct) {\n\tconstruct = function construct(Func, args) {\n\t\treturn new Func(...args);\n\t};\n}\n\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\nfunction unapply(func) {\n\treturn function (thisArg) {\n\t\tfor (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t\t\targs[_key - 1] = arguments[_key];\n\t\t}\n\n\t\treturn apply(func, thisArg, args);\n\t};\n}\nfunction unconstruct(func) {\n\treturn function () {\n\t\tfor (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n\t\t\targs[_key2] = arguments[_key2];\n\t\t}\n\n\t\treturn construct(func, args);\n\t};\n}\n/* Add properties to a lookup table */\n\nfunction addToSet(set, array, transformCaseFunc) {\n\tvar _transformCaseFunc;\n\n\ttransformCaseFunc = (_transformCaseFunc = transformCaseFunc) !== null && _transformCaseFunc !== void 0 ? _transformCaseFunc : stringToLowerCase;\n\n\tif (setPrototypeOf) {\n\t\t// Make 'in' and truthy checks like Boolean(set.constructor)\n\t\t// independent of any properties defined on Object.prototype.\n\t\t// Prevent prototype setters from intercepting set as a this value.\n\t\tsetPrototypeOf(set, null);\n\t}\n\n\tlet l = array.length;\n\n\twhile (l--) {\n\t\tlet element = array[l];\n\n\t\tif (typeof element === 'string') {\n\t\t\tconst lcElement = transformCaseFunc(element);\n\n\t\t\tif (lcElement !== element) {\n\t\t\t\t// Config presets (e.g. tags.js, attrs.js) are immutable.\n\t\t\t\tif (!isFrozen(array)) {\n\t\t\t\t\tarray[l] = lcElement;\n\t\t\t\t}\n\n\t\t\t\telement = lcElement;\n\t\t\t}\n\t\t}\n\n\t\tset[element] = true;\n\t}\n\n\treturn set;\n}\n/* Shallow clone an object */\n\nfunction clone(object) {\n\tconst newObject = create(null);\n\n\tfor (const [property, value] of entries(object)) {\n\t\tnewObject[property] = value;\n\t}\n\n\treturn newObject;\n}\n/* This method automatically checks if the prop is function\n * or getter and behaves accordingly. */\n\nfunction lookupGetter(object, prop) {\n\twhile (object !== null) {\n\t\tconst desc = getOwnPropertyDescriptor(object, prop);\n\n\t\tif (desc) {\n\t\t\tif (desc.get) {\n\t\t\t\treturn unapply(desc.get);\n\t\t\t}\n\n\t\t\tif (typeof desc.value === 'function') {\n\t\t\t\treturn unapply(desc.value);\n\t\t\t}\n\t\t}\n\n\t\tobject = getPrototypeOf(object);\n\t}\n\n\tfunction fallbackValue(element) {\n\t\tconsole.warn('fallback value for', element);\n\t\treturn null;\n\t}\n\n\treturn fallbackValue;\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); // SVG\n\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); // List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\n\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']); // Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\n\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\nconst MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n\nconst ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\n\nvar EXPRESSIONS = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tMUSTACHE_EXPR: MUSTACHE_EXPR,\n\tERB_EXPR: ERB_EXPR,\n\tTMPLIT_EXPR: TMPLIT_EXPR,\n\tDATA_ATTR: DATA_ATTR,\n\tARIA_ATTR: ARIA_ATTR,\n\tIS_ALLOWED_URI: IS_ALLOWED_URI,\n\tIS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n\tATTR_WHITESPACE: ATTR_WHITESPACE,\n\tDOCTYPE_NAME: DOCTYPE_NAME\n});\n\nconst getGlobal = () => typeof window === 'undefined' ? null : window;\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\n\n\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n\tif (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n\t\treturn null;\n\t} // Allow the callers to control the unique policy name\n\t// by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n\t// Policy creation with duplicate names throws in Trusted Types.\n\n\n\tlet suffix = null;\n\tconst ATTR_NAME = 'data-tt-policy-suffix';\n\n\tif (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n\t\tsuffix = purifyHostElement.getAttribute(ATTR_NAME);\n\t}\n\n\tconst policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n\ttry {\n\t\treturn trustedTypes.createPolicy(policyName, {\n\t\t\tcreateHTML(html) {\n\t\t\t\treturn html;\n\t\t\t},\n\n\t\t\tcreateScriptURL(scriptUrl) {\n\t\t\t\treturn scriptUrl;\n\t\t\t}\n\n\t\t});\n\t} catch (_) {\n\t\t// Policy creation failed (most likely another DOMPurify script has\n\t\t// already run). Skip creating the policy, as this will only cause errors\n\t\t// if TT are enforced.\n\t\tconsole.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n\t\treturn null;\n\t}\n};\n\nfunction createDOMPurify() {\n\tlet window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n\n\tconst DOMPurify = root => createDOMPurify(root);\n\t/**\n\t * Version label, exposed for easier checks\n\t * if DOMPurify is up to date or not\n\t */\n\n\n\tDOMPurify.version = '3.0.5';\n\t/**\n\t * Array of elements that DOMPurify removed during sanitation.\n\t * Empty if nothing was removed.\n\t */\n\n\tDOMPurify.removed = [];\n\n\tif (!window || !window.document || window.document.nodeType !== 9) {\n\t\t// Not running in a browser, provide a factory function\n\t\t// so that you can pass your own Window\n\t\tDOMPurify.isSupported = false;\n\t\treturn DOMPurify;\n\t}\n\n\tconst originalDocument = window.document;\n\tconst currentScript = originalDocument.currentScript;\n\tlet {\n\t\tdocument\n\t} = window;\n\tconst {\n\t\tDocumentFragment,\n\t\tHTMLTemplateElement,\n\t\tNode,\n\t\tElement,\n\t\tNodeFilter,\n\t\tNamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n\t\tHTMLFormElement,\n\t\tDOMParser,\n\t\ttrustedTypes\n\t} = window;\n\tconst ElementPrototype = Element.prototype;\n\tconst cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n\tconst getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n\tconst getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n\tconst getParentNode = lookupGetter(ElementPrototype, 'parentNode'); // As per issue #47, the web-components registry is inherited by a\n\t// new document created via createHTMLDocument. As per the spec\n\t// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n\t// a new empty registry is used when creating a template contents owner\n\t// document, so we use that as our parent document to ensure nothing\n\t// is inherited.\n\n\tif (typeof HTMLTemplateElement === 'function') {\n\t\tconst template = document.createElement('template');\n\n\t\tif (template.content && template.content.ownerDocument) {\n\t\t\tdocument = template.content.ownerDocument;\n\t\t}\n\t}\n\n\tlet trustedTypesPolicy;\n\tlet emptyHTML = '';\n\tconst {\n\t\timplementation,\n\t\tcreateNodeIterator,\n\t\tcreateDocumentFragment,\n\t\tgetElementsByTagName\n\t} = document;\n\tconst {\n\t\timportNode\n\t} = originalDocument;\n\tlet hooks = {};\n\t/**\n\t * Expose whether this browser supports running the full DOMPurify.\n\t */\n\n\tDOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n\tconst {\n\t\tMUSTACHE_EXPR,\n\t\tERB_EXPR,\n\t\tTMPLIT_EXPR,\n\t\tDATA_ATTR,\n\t\tARIA_ATTR,\n\t\tIS_SCRIPT_OR_DATA,\n\t\tATTR_WHITESPACE\n\t} = EXPRESSIONS;\n\tlet {\n\t\tIS_ALLOWED_URI: IS_ALLOWED_URI$1\n\t} = EXPRESSIONS;\n\t/**\n\t * We consider the elements and attributes below to be safe. Ideally\n\t * don't add any new ones but feel free to remove unwanted ones.\n\t */\n\n\t/* allowed element names */\n\n\tlet ALLOWED_TAGS = null;\n\tconst DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\t/* Allowed attribute names */\n\n\tlet ALLOWED_ATTR = null;\n\tconst DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\t/*\n\t * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n\t * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n\t * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n\t * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n\t */\n\n\tlet CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, {\n\t\ttagNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tattributeNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tallowCustomizedBuiltInElements: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: false\n\t\t}\n\t}));\n\t/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n\n\tlet FORBID_TAGS = null;\n\t/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n\n\tlet FORBID_ATTR = null;\n\t/* Decide if ARIA attributes are okay */\n\n\tlet ALLOW_ARIA_ATTR = true;\n\t/* Decide if custom data attributes are okay */\n\n\tlet ALLOW_DATA_ATTR = true;\n\t/* Decide if unknown protocols are okay */\n\n\tlet ALLOW_UNKNOWN_PROTOCOLS = false;\n\t/* Decide if self-closing tags in attributes are allowed.\n\t * Usually removed due to a mXSS issue in jQuery 3.0 */\n\n\tlet ALLOW_SELF_CLOSE_IN_ATTR = true;\n\t/* Output should be safe for common template engines.\n\t * This means, DOMPurify removes data attributes, mustaches and ERB\n\t */\n\n\tlet SAFE_FOR_TEMPLATES = false;\n\t/* Decide if document with ... should be returned */\n\n\tlet WHOLE_DOCUMENT = false;\n\t/* Track whether config is already set on this instance of DOMPurify. */\n\n\tlet SET_CONFIG = false;\n\t/* Decide if all elements (e.g. style, script) must be children of\n\t * document.body. By default, browsers might move them to document.head */\n\n\tlet FORCE_BODY = false;\n\t/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n\t * string (or a TrustedHTML object if Trusted Types are supported).\n\t * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n\t */\n\n\tlet RETURN_DOM = false;\n\t/* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n\t * string (or a TrustedHTML object if Trusted Types are supported) */\n\n\tlet RETURN_DOM_FRAGMENT = false;\n\t/* Try to return a Trusted Type object instead of a string, return a string in\n\t * case Trusted Types are not supported */\n\n\tlet RETURN_TRUSTED_TYPE = false;\n\t/* Output should be free from DOM clobbering attacks?\n\t * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n\t */\n\n\tlet SANITIZE_DOM = true;\n\t/* Achieve full DOM Clobbering protection by isolating the namespace of named\n\t * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n\t *\n\t * HTML/DOM spec rules that enable DOM Clobbering:\n\t * - Named Access on Window (\u00A77.3.3)\n\t * - DOM Tree Accessors (\u00A73.1.5)\n\t * - Form Element Parent-Child Relations (\u00A74.10.3)\n\t * - Iframe srcdoc / Nested WindowProxies (\u00A74.8.5)\n\t * - HTMLCollection (\u00A74.2.10.2)\n\t *\n\t * Namespace isolation is implemented by prefixing `id` and `name` attributes\n\t * with a constant string, i.e., `user-content-`\n\t */\n\n\tlet SANITIZE_NAMED_PROPS = false;\n\tconst SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\t/* Keep element content when removing element? */\n\n\tlet KEEP_CONTENT = true;\n\t/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n\t * of importing it into a new Document and returning a sanitized copy */\n\n\tlet IN_PLACE = false;\n\t/* Allow usage of profiles like html, svg and mathMl */\n\n\tlet USE_PROFILES = {};\n\t/* Tags to ignore content of when KEEP_CONTENT is true */\n\n\tlet FORBID_CONTENTS = null;\n\tconst DEFAULT_FORBID_CONTENTS = addToSet({}, ['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']);\n\t/* Tags that are safe for data: URIs */\n\n\tlet DATA_URI_TAGS = null;\n\tconst DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\t/* Attributes safe for values like \"javascript:\" */\n\n\tlet URI_SAFE_ATTRIBUTES = null;\n\tconst DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n\tconst MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\tconst SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n\tconst HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n\t/* Document namespace */\n\n\tlet NAMESPACE = HTML_NAMESPACE;\n\tlet IS_EMPTY_INPUT = false;\n\t/* Allowed XHTML+XML namespaces */\n\n\tlet ALLOWED_NAMESPACES = null;\n\tconst DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\t/* Parsing of strict XHTML documents */\n\n\tlet PARSER_MEDIA_TYPE;\n\tconst SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n\tconst DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n\tlet transformCaseFunc;\n\t/* Keep a reference to config to pass to hooks */\n\n\tlet CONFIG = null;\n\t/* Ideally, do not touch anything below this line */\n\n\t/* ______________________________________________ */\n\n\tconst formElement = document.createElement('form');\n\n\tconst isRegexOrFunction = function isRegexOrFunction(testValue) {\n\t\treturn testValue instanceof RegExp || testValue instanceof Function;\n\t};\n\t/**\n\t * _parseConfig\n\t *\n\t * @param {Object} cfg optional config literal\n\t */\n\t// eslint-disable-next-line complexity\n\n\n\tconst _parseConfig = function _parseConfig(cfg) {\n\t\tif (CONFIG && CONFIG === cfg) {\n\t\t\treturn;\n\t\t}\n\t\t/* Shield configuration object from tampering */\n\n\n\t\tif (!cfg || typeof cfg !== 'object') {\n\t\t\tcfg = {};\n\t\t}\n\t\t/* Shield configuration object from prototype pollution */\n\n\n\t\tcfg = clone(cfg);\n\t\tPARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes\n\t\t\tSUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE; // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n\n\t\ttransformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\t\t/* Set configuration parameters */\n\n\t\tALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n\t\tALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n\t\tALLOWED_NAMESPACES = 'ALLOWED_NAMESPACES' in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n\t\tURI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), // eslint-disable-line indent\n\t\t\tcfg.ADD_URI_SAFE_ATTR, // eslint-disable-line indent\n\t\t\ttransformCaseFunc // eslint-disable-line indent\n\t\t) // eslint-disable-line indent\n\t\t\t: DEFAULT_URI_SAFE_ATTRIBUTES;\n\t\tDATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), // eslint-disable-line indent\n\t\t\tcfg.ADD_DATA_URI_TAGS, // eslint-disable-line indent\n\t\t\ttransformCaseFunc // eslint-disable-line indent\n\t\t) // eslint-disable-line indent\n\t\t\t: DEFAULT_DATA_URI_TAGS;\n\t\tFORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n\t\tFORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n\t\tFORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n\t\tUSE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n\t\tALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n\n\t\tALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n\n\t\tALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n\n\t\tALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n\n\t\tSAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n\n\t\tWHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n\n\t\tRETURN_DOM = cfg.RETURN_DOM || false; // Default false\n\n\t\tRETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n\n\t\tRETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n\n\t\tFORCE_BODY = cfg.FORCE_BODY || false; // Default false\n\n\t\tSANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n\n\t\tSANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n\n\t\tKEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n\n\t\tIN_PLACE = cfg.IN_PLACE || false; // Default false\n\n\t\tIS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n\t\tNAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n\t\tCUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n\n\t\tif (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n\t\t\tCUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n\t\t}\n\n\t\tif (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n\t\t\tCUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n\t\t}\n\n\t\tif (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n\t\t\tCUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n\t\t}\n\n\t\tif (SAFE_FOR_TEMPLATES) {\n\t\t\tALLOW_DATA_ATTR = false;\n\t\t}\n\n\t\tif (RETURN_DOM_FRAGMENT) {\n\t\t\tRETURN_DOM = true;\n\t\t}\n\t\t/* Parse profile info */\n\n\n\t\tif (USE_PROFILES) {\n\t\t\tALLOWED_TAGS = addToSet({}, [...text]);\n\t\t\tALLOWED_ATTR = [];\n\n\t\t\tif (USE_PROFILES.html === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, html$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, html);\n\t\t\t}\n\n\t\t\tif (USE_PROFILES.svg === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svg$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\n\t\t\tif (USE_PROFILES.svgFilters === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svgFilters);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\n\t\t\tif (USE_PROFILES.mathMl === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, mathMl$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, mathMl);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t}\n\t\t/* Merge configuration parameters */\n\n\n\t\tif (cfg.ADD_TAGS) {\n\t\t\tif (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n\t\t\t\tALLOWED_TAGS = clone(ALLOWED_TAGS);\n\t\t\t}\n\n\t\t\taddToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n\t\t}\n\n\t\tif (cfg.ADD_ATTR) {\n\t\t\tif (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n\t\t\t\tALLOWED_ATTR = clone(ALLOWED_ATTR);\n\t\t\t}\n\n\t\t\taddToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n\t\t}\n\n\t\tif (cfg.ADD_URI_SAFE_ATTR) {\n\t\t\taddToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n\t\t}\n\n\t\tif (cfg.FORBID_CONTENTS) {\n\t\t\tif (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n\t\t\t\tFORBID_CONTENTS = clone(FORBID_CONTENTS);\n\t\t\t}\n\n\t\t\taddToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n\t\t}\n\t\t/* Add #text in case KEEP_CONTENT is set to true */\n\n\n\t\tif (KEEP_CONTENT) {\n\t\t\tALLOWED_TAGS['#text'] = true;\n\t\t}\n\t\t/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n\n\n\t\tif (WHOLE_DOCUMENT) {\n\t\t\taddToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n\t\t}\n\t\t/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n\n\n\t\tif (ALLOWED_TAGS.table) {\n\t\t\taddToSet(ALLOWED_TAGS, ['tbody']);\n\t\t\tdelete FORBID_TAGS.tbody;\n\t\t}\n\n\t\tif (cfg.TRUSTED_TYPES_POLICY) {\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n\t\t\t\tthrow typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n\t\t\t}\n\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n\t\t\t\tthrow typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n\t\t\t} // Overwrite existing TrustedTypes policy.\n\n\n\t\t\ttrustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; // Sign local variables required by `sanitize`.\n\n\t\t\temptyHTML = trustedTypesPolicy.createHTML('');\n\t\t} else {\n\t\t\t// Uninitialized policy, attempt to initialize the internal dompurify policy.\n\t\t\tif (trustedTypesPolicy === undefined) {\n\t\t\t\ttrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n\t\t\t} // If creating the internal policy succeeded sign internal variables.\n\n\n\t\t\tif (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n\t\t\t\temptyHTML = trustedTypesPolicy.createHTML('');\n\t\t\t}\n\t\t} // Prevent further manipulation of configuration.\n\t\t// Not available in IE8, Safari 5, etc.\n\n\n\t\tif (freeze) {\n\t\t\tfreeze(cfg);\n\t\t}\n\n\t\tCONFIG = cfg;\n\t};\n\n\tconst MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n\tconst HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']); // Certain elements are allowed in both SVG and HTML\n\t// namespace. We need to specify them explicitly\n\t// so that they don't get erroneously deleted from\n\t// HTML namespace.\n\n\tconst COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\t/* Keep track of all possible SVG and MathML tags\n\t * so that we can perform the namespace checks\n\t * correctly. */\n\n\tconst ALL_SVG_TAGS = addToSet({}, svg$1);\n\taddToSet(ALL_SVG_TAGS, svgFilters);\n\taddToSet(ALL_SVG_TAGS, svgDisallowed);\n\tconst ALL_MATHML_TAGS = addToSet({}, mathMl$1);\n\taddToSet(ALL_MATHML_TAGS, mathMlDisallowed);\n\t/**\n\t *\n\t *\n\t * @param {Element} element a DOM element whose namespace is being checked\n\t * @returns {boolean} Return false if the element has a\n\t * namespace that a spec-compliant parser would never\n\t * return. Return true otherwise.\n\t */\n\n\tconst _checkValidNamespace = function _checkValidNamespace(element) {\n\t\tlet parent = getParentNode(element); // In JSDOM, if we're inside shadow DOM, then parentNode\n\t\t// can be null. We just simulate parent in this case.\n\n\t\tif (!parent || !parent.tagName) {\n\t\t\tparent = {\n\t\t\t\tnamespaceURI: NAMESPACE,\n\t\t\t\ttagName: 'template'\n\t\t\t};\n\t\t}\n\n\t\tconst tagName = stringToLowerCase(element.tagName);\n\t\tconst parentTagName = stringToLowerCase(parent.tagName);\n\n\t\tif (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (element.namespaceURI === SVG_NAMESPACE) {\n\t\t\t// The only way to switch from HTML namespace to SVG\n\t\t\t// is via . If it happens via any other tag, then\n\t\t\t// it should be killed.\n\t\t\tif (parent.namespaceURI === HTML_NAMESPACE) {\n\t\t\t\treturn tagName === 'svg';\n\t\t\t} // The only way to switch from MathML to SVG is via`\n\t\t\t// svg if parent is either or MathML\n\t\t\t// text integration points.\n\n\n\t\t\tif (parent.namespaceURI === MATHML_NAMESPACE) {\n\t\t\t\treturn tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n\t\t\t} // We only allow elements that are defined in SVG\n\t\t\t// spec. All others are disallowed in SVG namespace.\n\n\n\t\t\treturn Boolean(ALL_SVG_TAGS[tagName]);\n\t\t}\n\n\t\tif (element.namespaceURI === MATHML_NAMESPACE) {\n\t\t\t// The only way to switch from HTML namespace to MathML\n\t\t\t// is via . If it happens via any other tag, then\n\t\t\t// it should be killed.\n\t\t\tif (parent.namespaceURI === HTML_NAMESPACE) {\n\t\t\t\treturn tagName === 'math';\n\t\t\t} // The only way to switch from SVG to MathML is via\n\t\t\t// and HTML integration points\n\n\n\t\t\tif (parent.namespaceURI === SVG_NAMESPACE) {\n\t\t\t\treturn tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n\t\t\t} // We only allow elements that are defined in MathML\n\t\t\t// spec. All others are disallowed in MathML namespace.\n\n\n\t\t\treturn Boolean(ALL_MATHML_TAGS[tagName]);\n\t\t}\n\n\t\tif (element.namespaceURI === HTML_NAMESPACE) {\n\t\t\t// The only way to switch from SVG to HTML is via\n\t\t\t// HTML integration points, and from MathML to HTML\n\t\t\t// is via MathML text integration points\n\t\t\tif (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n\t\t\t\treturn false;\n\t\t\t} // We disallow tags that are specific for MathML\n\t\t\t// or SVG and should never appear in HTML namespace\n\n\n\t\t\treturn !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n\t\t} // For XHTML and XML documents that support custom namespaces\n\n\n\t\tif (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n\t\t\treturn true;\n\t\t} // The code should never reach this place (this means\n\t\t// that the element somehow got namespace that is not\n\t\t// HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n\t\t// Return false just in case.\n\n\n\t\treturn false;\n\t};\n\t/**\n\t * _forceRemove\n\t *\n\t * @param {Node} node a DOM node\n\t */\n\n\n\tconst _forceRemove = function _forceRemove(node) {\n\t\tarrayPush(DOMPurify.removed, {\n\t\t\telement: node\n\t\t});\n\n\t\ttry {\n\t\t\t// eslint-disable-next-line unicorn/prefer-dom-node-remove\n\t\t\tnode.parentNode.removeChild(node);\n\t\t} catch (_) {\n\t\t\tnode.remove();\n\t\t}\n\t};\n\t/**\n\t * _removeAttribute\n\t *\n\t * @param {String} name an Attribute name\n\t * @param {Node} node a DOM node\n\t */\n\n\n\tconst _removeAttribute = function _removeAttribute(name, node) {\n\t\ttry {\n\t\t\tarrayPush(DOMPurify.removed, {\n\t\t\t\tattribute: node.getAttributeNode(name),\n\t\t\t\tfrom: node\n\t\t\t});\n\t\t} catch (_) {\n\t\t\tarrayPush(DOMPurify.removed, {\n\t\t\t\tattribute: null,\n\t\t\t\tfrom: node\n\t\t\t});\n\t\t}\n\n\t\tnode.removeAttribute(name); // We void attribute values for unremovable \"is\"\" attributes\n\n\t\tif (name === 'is' && !ALLOWED_ATTR[name]) {\n\t\t\tif (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n\t\t\t\ttry {\n\t\t\t\t\t_forceRemove(node);\n\t\t\t\t} catch (_) { }\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tnode.setAttribute(name, '');\n\t\t\t\t} catch (_) { }\n\t\t\t}\n\t\t}\n\t};\n\t/**\n\t * _initDocument\n\t *\n\t * @param {String} dirty a string of dirty markup\n\t * @return {Document} a DOM, filled with the dirty markup\n\t */\n\n\n\tconst _initDocument = function _initDocument(dirty) {\n\t\t/* Create a HTML document */\n\t\tlet doc;\n\t\tlet leadingWhitespace;\n\n\t\tif (FORCE_BODY) {\n\t\t\tdirty = '' + dirty;\n\t\t} else {\n\t\t\t/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n\t\t\tconst matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n\t\t\tleadingWhitespace = matches && matches[0];\n\t\t}\n\n\t\tif (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n\t\t\t// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n\t\t\tdirty = '' + dirty + '';\n\t\t}\n\n\t\tconst dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n\t\t/*\n\t\t * Use the DOMParser API by default, fallback later if needs be\n\t\t * DOMParser not work for svg when has multiple root element.\n\t\t */\n\n\t\tif (NAMESPACE === HTML_NAMESPACE) {\n\t\t\ttry {\n\t\t\t\tdoc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n\t\t\t} catch (_) { }\n\t\t}\n\t\t/* Use createHTMLDocument in case DOMParser is not available */\n\n\n\t\tif (!doc || !doc.documentElement) {\n\t\t\tdoc = implementation.createDocument(NAMESPACE, 'template', null);\n\n\t\t\ttry {\n\t\t\t\tdoc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n\t\t\t} catch (_) {// Syntax error if dirtyPayload is invalid xml\n\t\t\t}\n\t\t}\n\n\t\tconst body = doc.body || doc.documentElement;\n\n\t\tif (dirty && leadingWhitespace) {\n\t\t\tbody.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n\t\t}\n\t\t/* Work on whole document or just its body */\n\n\n\t\tif (NAMESPACE === HTML_NAMESPACE) {\n\t\t\treturn getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n\t\t}\n\n\t\treturn WHOLE_DOCUMENT ? doc.documentElement : body;\n\t};\n\t/**\n\t * _createIterator\n\t *\n\t * @param {Document} root document/fragment to create iterator for\n\t * @return {Iterator} iterator instance\n\t */\n\n\n\tconst _createIterator = function _createIterator(root) {\n\t\treturn createNodeIterator.call(root.ownerDocument || root, root, // eslint-disable-next-line no-bitwise\n\t\t\tNodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);\n\t};\n\t/**\n\t * _isClobbered\n\t *\n\t * @param {Node} elm element to check for clobbering attacks\n\t * @return {Boolean} true if clobbered, false if safe\n\t */\n\n\n\tconst _isClobbered = function _isClobbered(elm) {\n\t\treturn elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n\t};\n\t/**\n\t * _isNode\n\t *\n\t * @param {Node} obj object to check whether it's a DOM node\n\t * @return {Boolean} true is object is a DOM node\n\t */\n\n\n\tconst _isNode = function _isNode(object) {\n\t\treturn typeof Node === 'object' ? object instanceof Node : object && typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';\n\t};\n\t/**\n\t * _executeHook\n\t * Execute user configurable hooks\n\t *\n\t * @param {String} entryPoint Name of the hook's entry point\n\t * @param {Node} currentNode node to work on with the hook\n\t * @param {Object} data additional hook parameters\n\t */\n\n\n\tconst _executeHook = function _executeHook(entryPoint, currentNode, data) {\n\t\tif (!hooks[entryPoint]) {\n\t\t\treturn;\n\t\t}\n\n\t\tarrayForEach(hooks[entryPoint], hook => {\n\t\t\thook.call(DOMPurify, currentNode, data, CONFIG);\n\t\t});\n\t};\n\t/**\n\t * _sanitizeElements\n\t *\n\t * @protect nodeName\n\t * @protect textContent\n\t * @protect removeChild\n\t *\n\t * @param {Node} currentNode to check for permission to exist\n\t * @return {Boolean} true if node was killed, false if left alive\n\t */\n\n\n\tconst _sanitizeElements = function _sanitizeElements(currentNode) {\n\t\tlet content;\n\t\t/* Execute a hook if present */\n\n\t\t_executeHook('beforeSanitizeElements', currentNode, null);\n\t\t/* Check if element is clobbered or can clobber */\n\n\n\t\tif (_isClobbered(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\n\t\t\treturn true;\n\t\t}\n\t\t/* Now let's check the element's type and name */\n\n\n\t\tconst tagName = transformCaseFunc(currentNode.nodeName);\n\t\t/* Execute a hook if present */\n\n\t\t_executeHook('uponSanitizeElement', currentNode, {\n\t\t\ttagName,\n\t\t\tallowedTags: ALLOWED_TAGS\n\t\t});\n\t\t/* Detect mXSS attempts abusing namespace confusion */\n\n\n\t\tif (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n\t\t\t_forceRemove(currentNode);\n\n\t\t\treturn true;\n\t\t}\n\t\t/* Remove element if anything forbids its presence */\n\n\n\t\tif (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n\t\t\t/* Check if we have a custom element to handle */\n\t\t\tif (!FORBID_TAGS[tagName] && _basicCustomElementTest(tagName)) {\n\t\t\t\tif (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;\n\t\t\t\tif (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) return false;\n\t\t\t}\n\t\t\t/* Keep content except for bad-listed elements */\n\n\n\t\t\tif (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n\t\t\t\tconst parentNode = getParentNode(currentNode) || currentNode.parentNode;\n\t\t\t\tconst childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n\n\t\t\t\tif (childNodes && parentNode) {\n\t\t\t\t\tconst childCount = childNodes.length;\n\n\t\t\t\t\tfor (let i = childCount - 1; i >= 0; --i) {\n\t\t\t\t\t\tparentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_forceRemove(currentNode);\n\n\t\t\treturn true;\n\t\t}\n\t\t/* Check whether element has a valid namespace */\n\n\n\t\tif (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\n\t\t\treturn true;\n\t\t}\n\t\t/* Make sure that older browsers don't get fallback-tag mXSS */\n\n\n\t\tif ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n\t\t\t_forceRemove(currentNode);\n\n\t\t\treturn true;\n\t\t}\n\t\t/* Sanitize element content to be template-safe */\n\n\n\t\tif (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n\t\t\t/* Get the element's text content */\n\t\t\tcontent = currentNode.textContent;\n\t\t\tcontent = stringReplace(content, MUSTACHE_EXPR, ' ');\n\t\t\tcontent = stringReplace(content, ERB_EXPR, ' ');\n\t\t\tcontent = stringReplace(content, TMPLIT_EXPR, ' ');\n\n\t\t\tif (currentNode.textContent !== content) {\n\t\t\t\tarrayPush(DOMPurify.removed, {\n\t\t\t\t\telement: currentNode.cloneNode()\n\t\t\t\t});\n\t\t\t\tcurrentNode.textContent = content;\n\t\t\t}\n\t\t}\n\t\t/* Execute a hook if present */\n\n\n\t\t_executeHook('afterSanitizeElements', currentNode, null);\n\n\t\treturn false;\n\t};\n\t/**\n\t * _isValidAttribute\n\t *\n\t * @param {string} lcTag Lowercase tag name of containing element.\n\t * @param {string} lcName Lowercase attribute name.\n\t * @param {string} value Attribute value.\n\t * @return {Boolean} Returns true if `value` is valid, otherwise false.\n\t */\n\t// eslint-disable-next-line complexity\n\n\n\tconst _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n\t\t/* Make sure attribute cannot clobber */\n\t\tif (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n\t\t\treturn false;\n\t\t}\n\t\t/* Allow valid data-* attributes: At least one character after \"-\"\n\t\t\t\t(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n\t\t\t\tXML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n\t\t\t\tWe don't need to check the value; it's always URI safe. */\n\n\n\t\tif (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)); else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)); else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n\t\t\tif ( // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n\t\t\t\t// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n\t\t\t\t// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n\t\t\t\t_basicCustomElementTest(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || // Alternative, second condition checks if it's an `is`-attribute, AND\n\t\t\t\t// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n\t\t\t\tlcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))); else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t/* Check value is safe. First, is attr inert? If so, is safe */\n\n\t\t} else if (URI_SAFE_ATTRIBUTES[lcName]); else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))); else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]); else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))); else if (value) {\n\t\t\treturn false;\n\t\t} else;\n\n\t\treturn true;\n\t};\n\t/**\n\t * _basicCustomElementCheck\n\t * checks if at least one dash is included in tagName, and it's not the first char\n\t * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n\t * @param {string} tagName name of the tag of the node to sanitize\n\t */\n\n\n\tconst _basicCustomElementTest = function _basicCustomElementTest(tagName) {\n\t\treturn tagName.indexOf('-') > 0;\n\t};\n\t/**\n\t * _sanitizeAttributes\n\t *\n\t * @protect attributes\n\t * @protect nodeName\n\t * @protect removeAttribute\n\t * @protect setAttribute\n\t *\n\t * @param {Node} currentNode to sanitize\n\t */\n\n\n\tconst _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n\t\tlet attr;\n\t\tlet value;\n\t\tlet lcName;\n\t\tlet l;\n\t\t/* Execute a hook if present */\n\n\t\t_executeHook('beforeSanitizeAttributes', currentNode, null);\n\n\t\tconst {\n\t\t\tattributes\n\t\t} = currentNode;\n\t\t/* Check if we have attributes; if not we might have a text node */\n\n\t\tif (!attributes) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst hookEvent = {\n\t\t\tattrName: '',\n\t\t\tattrValue: '',\n\t\t\tkeepAttr: true,\n\t\t\tallowedAttributes: ALLOWED_ATTR\n\t\t};\n\t\tl = attributes.length;\n\t\t/* Go backwards over all attributes; safely remove bad ones */\n\n\t\twhile (l--) {\n\t\t\tattr = attributes[l];\n\t\t\tconst {\n\t\t\t\tname,\n\t\t\t\tnamespaceURI\n\t\t\t} = attr;\n\t\t\tvalue = name === 'value' ? attr.value : stringTrim(attr.value);\n\t\t\tlcName = transformCaseFunc(name);\n\t\t\t/* Execute a hook if present */\n\n\t\t\thookEvent.attrName = lcName;\n\t\t\thookEvent.attrValue = value;\n\t\t\thookEvent.keepAttr = true;\n\t\t\thookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n\n\t\t\t_executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n\n\t\t\tvalue = hookEvent.attrValue;\n\t\t\t/* Did the hooks approve of the attribute? */\n\n\t\t\tif (hookEvent.forceKeepAttr) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t/* Remove attribute */\n\n\n\t\t\t_removeAttribute(name, currentNode);\n\t\t\t/* Did the hooks approve of the attribute? */\n\n\n\t\t\tif (!hookEvent.keepAttr) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t/* Work around a security issue in jQuery 3.0 */\n\n\n\t\t\tif (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n\t\t\t\t_removeAttribute(name, currentNode);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t/* Sanitize attribute content to be template-safe */\n\n\n\t\t\tif (SAFE_FOR_TEMPLATES) {\n\t\t\t\tvalue = stringReplace(value, MUSTACHE_EXPR, ' ');\n\t\t\t\tvalue = stringReplace(value, ERB_EXPR, ' ');\n\t\t\t\tvalue = stringReplace(value, TMPLIT_EXPR, ' ');\n\t\t\t}\n\t\t\t/* Is `value` valid for this attribute? */\n\n\n\t\t\tconst lcTag = transformCaseFunc(currentNode.nodeName);\n\n\t\t\tif (!_isValidAttribute(lcTag, lcName, value)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t/* Full DOM Clobbering protection via namespace isolation,\n\t\t\t * Prefix id and name attributes with `user-content-`\n\t\t\t */\n\n\n\t\t\tif (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n\t\t\t\t// Remove the attribute with this value\n\t\t\t\t_removeAttribute(name, currentNode); // Prefix the value and later re-create the attribute with the sanitized value\n\n\n\t\t\t\tvalue = SANITIZE_NAMED_PROPS_PREFIX + value;\n\t\t\t}\n\t\t\t/* Handle attributes that require Trusted Types */\n\n\n\t\t\tif (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n\t\t\t\tif (namespaceURI); else {\n\t\t\t\t\tswitch (trustedTypes.getAttributeType(lcTag, lcName)) {\n\t\t\t\t\t\tcase 'TrustedHTML':\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue = trustedTypesPolicy.createHTML(value);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcase 'TrustedScriptURL':\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue = trustedTypesPolicy.createScriptURL(value);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* Handle invalid data-* attribute set by try-catching it */\n\n\n\t\t\ttry {\n\t\t\t\tif (namespaceURI) {\n\t\t\t\t\tcurrentNode.setAttributeNS(namespaceURI, name, value);\n\t\t\t\t} else {\n\t\t\t\t\t/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n\t\t\t\t\tcurrentNode.setAttribute(name, value);\n\t\t\t\t}\n\n\t\t\t\tarrayPop(DOMPurify.removed);\n\t\t\t} catch (_) { }\n\t\t}\n\t\t/* Execute a hook if present */\n\n\n\t\t_executeHook('afterSanitizeAttributes', currentNode, null);\n\t};\n\t/**\n\t * _sanitizeShadowDOM\n\t *\n\t * @param {DocumentFragment} fragment to iterate over recursively\n\t */\n\n\n\tconst _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n\t\tlet shadowNode;\n\n\t\tconst shadowIterator = _createIterator(fragment);\n\t\t/* Execute a hook if present */\n\n\n\t\t_executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n\t\twhile (shadowNode = shadowIterator.nextNode()) {\n\t\t\t/* Execute a hook if present */\n\t\t\t_executeHook('uponSanitizeShadowNode', shadowNode, null);\n\t\t\t/* Sanitize tags and elements */\n\n\n\t\t\tif (_sanitizeElements(shadowNode)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t/* Deep shadow DOM detected */\n\n\n\t\t\tif (shadowNode.content instanceof DocumentFragment) {\n\t\t\t\t_sanitizeShadowDOM(shadowNode.content);\n\t\t\t}\n\t\t\t/* Check attributes, sanitize if necessary */\n\n\n\t\t\t_sanitizeAttributes(shadowNode);\n\t\t}\n\t\t/* Execute a hook if present */\n\n\n\t\t_executeHook('afterSanitizeShadowDOM', fragment, null);\n\t};\n\t/**\n\t * Sanitize\n\t * Public method providing core sanitation functionality\n\t *\n\t * @param {String|Node} dirty string or DOM node\n\t * @param {Object} configuration object\n\t */\n\t// eslint-disable-next-line complexity\n\n\n\tDOMPurify.sanitize = function (dirty) {\n\t\tlet cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t\tlet body;\n\t\tlet importedNode;\n\t\tlet currentNode;\n\t\tlet returnNode;\n\t\t/* Make sure we have a string to sanitize.\n\t\t\tDO NOT return early, as this will return the wrong type if\n\t\t\tthe user has requested a DOM object rather than a string */\n\n\t\tIS_EMPTY_INPUT = !dirty;\n\n\t\tif (IS_EMPTY_INPUT) {\n\t\t\tdirty = '';\n\t\t}\n\t\t/* Stringify, in case dirty is an object */\n\n\n\t\tif (typeof dirty !== 'string' && !_isNode(dirty)) {\n\t\t\tif (typeof dirty.toString === 'function') {\n\t\t\t\tdirty = dirty.toString();\n\n\t\t\t\tif (typeof dirty !== 'string') {\n\t\t\t\t\tthrow typeErrorCreate('dirty is not a string, aborting');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow typeErrorCreate('toString is not a function');\n\t\t\t}\n\t\t}\n\t\t/* Return dirty HTML if DOMPurify cannot run */\n\n\n\t\tif (!DOMPurify.isSupported) {\n\t\t\treturn dirty;\n\t\t}\n\t\t/* Assign config vars */\n\n\n\t\tif (!SET_CONFIG) {\n\t\t\t_parseConfig(cfg);\n\t\t}\n\t\t/* Clean up removed elements */\n\n\n\t\tDOMPurify.removed = [];\n\t\t/* Check if dirty is correctly typed for IN_PLACE */\n\n\t\tif (typeof dirty === 'string') {\n\t\t\tIN_PLACE = false;\n\t\t}\n\n\t\tif (IN_PLACE) {\n\t\t\t/* Do some early pre-sanitization to avoid unsafe root nodes */\n\t\t\tif (dirty.nodeName) {\n\t\t\t\tconst tagName = transformCaseFunc(dirty.nodeName);\n\n\t\t\t\tif (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n\t\t\t\t\tthrow typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (dirty instanceof Node) {\n\t\t\t/* If dirty is a DOM element, append to an empty document to avoid\n\t\t\t\t elements being stripped by the parser */\n\t\t\tbody = _initDocument('');\n\t\t\timportedNode = body.ownerDocument.importNode(dirty, true);\n\n\t\t\tif (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n\t\t\t\t/* Node is already a body, use as is */\n\t\t\t\tbody = importedNode;\n\t\t\t} else if (importedNode.nodeName === 'HTML') {\n\t\t\t\tbody = importedNode;\n\t\t\t} else {\n\t\t\t\t// eslint-disable-next-line unicorn/prefer-dom-node-append\n\t\t\t\tbody.appendChild(importedNode);\n\t\t\t}\n\t\t} else {\n\t\t\t/* Exit directly if we have nothing to do */\n\t\t\tif (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes\n\t\t\t\tdirty.indexOf('<') === -1) {\n\t\t\t\treturn trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n\t\t\t}\n\t\t\t/* Initialize the document to work on */\n\n\n\t\t\tbody = _initDocument(dirty);\n\t\t\t/* Check we have a DOM node from the data */\n\n\t\t\tif (!body) {\n\t\t\t\treturn RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n\t\t\t}\n\t\t}\n\t\t/* Remove first element node (ours) if FORCE_BODY is set */\n\n\n\t\tif (body && FORCE_BODY) {\n\t\t\t_forceRemove(body.firstChild);\n\t\t}\n\t\t/* Get node iterator */\n\n\n\t\tconst nodeIterator = _createIterator(IN_PLACE ? dirty : body);\n\t\t/* Now start iterating over the created document */\n\n\n\t\twhile (currentNode = nodeIterator.nextNode()) {\n\t\t\t/* Sanitize tags and elements */\n\t\t\tif (_sanitizeElements(currentNode)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t/* Shadow DOM detected, sanitize it */\n\n\n\t\t\tif (currentNode.content instanceof DocumentFragment) {\n\t\t\t\t_sanitizeShadowDOM(currentNode.content);\n\t\t\t}\n\t\t\t/* Check attributes, sanitize if necessary */\n\n\n\t\t\t_sanitizeAttributes(currentNode);\n\t\t}\n\t\t/* If we sanitized `dirty` in-place, return it. */\n\n\n\t\tif (IN_PLACE) {\n\t\t\treturn dirty;\n\t\t}\n\t\t/* Return sanitized string or DOM */\n\n\n\t\tif (RETURN_DOM) {\n\t\t\tif (RETURN_DOM_FRAGMENT) {\n\t\t\t\treturnNode = createDocumentFragment.call(body.ownerDocument);\n\n\t\t\t\twhile (body.firstChild) {\n\t\t\t\t\t// eslint-disable-next-line unicorn/prefer-dom-node-append\n\t\t\t\t\treturnNode.appendChild(body.firstChild);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturnNode = body;\n\t\t\t}\n\n\t\t\tif (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n\t\t\t\t/*\n\t\t\t\t\tAdoptNode() is not used because internal state is not reset\n\t\t\t\t\t(e.g. the past names map of a HTMLFormElement), this is safe\n\t\t\t\t\tin theory but we would rather not risk another attack vector.\n\t\t\t\t\tThe state that is cloned by importNode() is explicitly defined\n\t\t\t\t\tby the specs.\n\t\t\t\t*/\n\t\t\t\treturnNode = importNode.call(originalDocument, returnNode, true);\n\t\t\t}\n\n\t\t\treturn returnNode;\n\t\t}\n\n\t\tlet serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\t\t/* Serialize doctype if allowed */\n\n\t\tif (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n\t\t\tserializedHTML = '\\n' + serializedHTML;\n\t\t}\n\t\t/* Sanitize final string template-safe */\n\n\n\t\tif (SAFE_FOR_TEMPLATES) {\n\t\t\tserializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR, ' ');\n\t\t\tserializedHTML = stringReplace(serializedHTML, ERB_EXPR, ' ');\n\t\t\tserializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR, ' ');\n\t\t}\n\n\t\treturn trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n\t};\n\t/**\n\t * Public method to set the configuration once\n\t * setConfig\n\t *\n\t * @param {Object} cfg configuration object\n\t */\n\n\n\tDOMPurify.setConfig = function (cfg) {\n\t\t_parseConfig(cfg);\n\n\t\tSET_CONFIG = true;\n\t};\n\t/**\n\t * Public method to remove the configuration\n\t * clearConfig\n\t *\n\t */\n\n\n\tDOMPurify.clearConfig = function () {\n\t\tCONFIG = null;\n\t\tSET_CONFIG = false;\n\t};\n\t/**\n\t * Public method to check if an attribute value is valid.\n\t * Uses last set config, if any. Otherwise, uses config defaults.\n\t * isValidAttribute\n\t *\n\t * @param {string} tag Tag name of containing element.\n\t * @param {string} attr Attribute name.\n\t * @param {string} value Attribute value.\n\t * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n\t */\n\n\n\tDOMPurify.isValidAttribute = function (tag, attr, value) {\n\t\t/* Initialize shared config vars if necessary. */\n\t\tif (!CONFIG) {\n\t\t\t_parseConfig({});\n\t\t}\n\n\t\tconst lcTag = transformCaseFunc(tag);\n\t\tconst lcName = transformCaseFunc(attr);\n\t\treturn _isValidAttribute(lcTag, lcName, value);\n\t};\n\t/**\n\t * AddHook\n\t * Public method to add DOMPurify hooks\n\t *\n\t * @param {String} entryPoint entry point for the hook to add\n\t * @param {Function} hookFunction function to execute\n\t */\n\n\n\tDOMPurify.addHook = function (entryPoint, hookFunction) {\n\t\tif (typeof hookFunction !== 'function') {\n\t\t\treturn;\n\t\t}\n\n\t\thooks[entryPoint] = hooks[entryPoint] || [];\n\t\tarrayPush(hooks[entryPoint], hookFunction);\n\t};\n\t/**\n\t * RemoveHook\n\t * Public method to remove a DOMPurify hook at a given entryPoint\n\t * (pops it from the stack of hooks if more are present)\n\t *\n\t * @param {String} entryPoint entry point for the hook to remove\n\t * @return {Function} removed(popped) hook\n\t */\n\n\n\tDOMPurify.removeHook = function (entryPoint) {\n\t\tif (hooks[entryPoint]) {\n\t\t\treturn arrayPop(hooks[entryPoint]);\n\t\t}\n\t};\n\t/**\n\t * RemoveHooks\n\t * Public method to remove all DOMPurify hooks at a given entryPoint\n\t *\n\t * @param {String} entryPoint entry point for the hooks to remove\n\t */\n\n\n\tDOMPurify.removeHooks = function (entryPoint) {\n\t\tif (hooks[entryPoint]) {\n\t\t\thooks[entryPoint] = [];\n\t\t}\n\t};\n\t/**\n\t * RemoveAllHooks\n\t * Public method to remove all DOMPurify hooks\n\t *\n\t */\n\n\n\tDOMPurify.removeAllHooks = function () {\n\t\thooks = {};\n\t};\n\n\treturn DOMPurify;\n}\n\nvar purify = createDOMPurify();\n\n// ESM-comment-begin\n// define(function () { return purify; });\n// ESM-comment-end\n\n// ESM-uncomment-begin\nexport default purify;\nexport const version = purify.version;\nexport const isSupported = purify.isSupported;\nexport const sanitize = purify.sanitize;\nexport const setConfig = purify.setConfig;\nexport const clearConfig = purify.clearConfig;\nexport const isValidAttribute = purify.isValidAttribute;\nexport const addHook = purify.addHook;\nexport const removeHook = purify.removeHook;\nexport const removeHooks = purify.removeHooks;\nexport const removeAllHooks = purify.removeAllHooks;\n// ESM-uncomment-end\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as errors from './errors.js';\nimport * as platform from './platform.js';\nimport { equalsIgnoreCase, startsWithIgnoreCase } from './strings.js';\nimport { URI } from './uri.js';\nexport var Schemas;\n(function (Schemas) {\n /**\n * A schema that is used for models that exist in memory\n * only and that have no correspondence on a server or such.\n */\n Schemas.inMemory = 'inmemory';\n /**\n * A schema that is used for setting files\n */\n Schemas.vscode = 'vscode';\n /**\n * A schema that is used for internal private files\n */\n Schemas.internal = 'private';\n /**\n * A walk-through document.\n */\n Schemas.walkThrough = 'walkThrough';\n /**\n * An embedded code snippet.\n */\n Schemas.walkThroughSnippet = 'walkThroughSnippet';\n Schemas.http = 'http';\n Schemas.https = 'https';\n Schemas.file = 'file';\n Schemas.mailto = 'mailto';\n Schemas.untitled = 'untitled';\n Schemas.data = 'data';\n Schemas.command = 'command';\n Schemas.vscodeRemote = 'vscode-remote';\n Schemas.vscodeRemoteResource = 'vscode-remote-resource';\n Schemas.vscodeManagedRemoteResource = 'vscode-managed-remote-resource';\n Schemas.vscodeUserData = 'vscode-userdata';\n Schemas.vscodeCustomEditor = 'vscode-custom-editor';\n Schemas.vscodeNotebookCell = 'vscode-notebook-cell';\n Schemas.vscodeNotebookCellMetadata = 'vscode-notebook-cell-metadata';\n Schemas.vscodeNotebookCellOutput = 'vscode-notebook-cell-output';\n Schemas.vscodeInteractiveInput = 'vscode-interactive-input';\n Schemas.vscodeSettings = 'vscode-settings';\n Schemas.vscodeWorkspaceTrust = 'vscode-workspace-trust';\n Schemas.vscodeTerminal = 'vscode-terminal';\n Schemas.vscodeChatSesssion = 'vscode-chat-editor';\n /**\n * Scheme used internally for webviews that aren't linked to a resource (i.e. not custom editors)\n */\n Schemas.webviewPanel = 'webview-panel';\n /**\n * Scheme used for loading the wrapper html and script in webviews.\n */\n Schemas.vscodeWebview = 'vscode-webview';\n /**\n * Scheme used for extension pages\n */\n Schemas.extension = 'extension';\n /**\n * Scheme used as a replacement of `file` scheme to load\n * files with our custom protocol handler (desktop only).\n */\n Schemas.vscodeFileResource = 'vscode-file';\n /**\n * Scheme used for temporary resources\n */\n Schemas.tmp = 'tmp';\n /**\n * Scheme used vs live share\n */\n Schemas.vsls = 'vsls';\n /**\n * Scheme used for the Source Control commit input's text document\n */\n Schemas.vscodeSourceControl = 'vscode-scm';\n})(Schemas || (Schemas = {}));\nexport function matchesScheme(target, scheme) {\n if (URI.isUri(target)) {\n return equalsIgnoreCase(target.scheme, scheme);\n }\n else {\n return startsWithIgnoreCase(target, scheme + ':');\n }\n}\nexport function matchesSomeScheme(target, ...schemes) {\n return schemes.some(scheme => matchesScheme(target, scheme));\n}\nexport const connectionTokenQueryName = 'tkn';\nclass RemoteAuthoritiesImpl {\n constructor() {\n this._hosts = Object.create(null);\n this._ports = Object.create(null);\n this._connectionTokens = Object.create(null);\n this._preferredWebSchema = 'http';\n this._delegate = null;\n this._remoteResourcesPath = `/${Schemas.vscodeRemoteResource}`;\n }\n setPreferredWebSchema(schema) {\n this._preferredWebSchema = schema;\n }\n rewrite(uri) {\n if (this._delegate) {\n try {\n return this._delegate(uri);\n }\n catch (err) {\n errors.onUnexpectedError(err);\n return uri;\n }\n }\n const authority = uri.authority;\n let host = this._hosts[authority];\n if (host && host.indexOf(':') !== -1 && host.indexOf('[') === -1) {\n host = `[${host}]`;\n }\n const port = this._ports[authority];\n const connectionToken = this._connectionTokens[authority];\n let query = `path=${encodeURIComponent(uri.path)}`;\n if (typeof connectionToken === 'string') {\n query += `&${connectionTokenQueryName}=${encodeURIComponent(connectionToken)}`;\n }\n return URI.from({\n scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,\n authority: `${host}:${port}`,\n path: this._remoteResourcesPath,\n query\n });\n }\n}\nexport const RemoteAuthorities = new RemoteAuthoritiesImpl();\nexport const VSCODE_AUTHORITY = 'vscode-app';\nclass FileAccessImpl {\n /**\n * Returns a URI to use in contexts where the browser is responsible\n * for loading (e.g. fetch()) or when used within the DOM.\n *\n * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.\n */\n uriToBrowserUri(uri) {\n // Handle remote URIs via `RemoteAuthorities`\n if (uri.scheme === Schemas.vscodeRemote) {\n return RemoteAuthorities.rewrite(uri);\n }\n // Convert to `vscode-file` resource..\n if (\n // ...only ever for `file` resources\n uri.scheme === Schemas.file &&\n (\n // ...and we run in native environments\n platform.isNative ||\n // ...or web worker extensions on desktop\n (platform.webWorkerOrigin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`))) {\n return uri.with({\n scheme: Schemas.vscodeFileResource,\n // We need to provide an authority here so that it can serve\n // as origin for network and loading matters in chromium.\n // If the URI is not coming with an authority already, we\n // add our own\n authority: uri.authority || FileAccessImpl.FALLBACK_AUTHORITY,\n query: null,\n fragment: null\n });\n }\n return uri;\n }\n}\nFileAccessImpl.FALLBACK_AUTHORITY = VSCODE_AUTHORITY;\nexport const FileAccess = new FileAccessImpl();\nexport var COI;\n(function (COI) {\n const coiHeaders = new Map([\n ['1', { 'Cross-Origin-Opener-Policy': 'same-origin' }],\n ['2', { 'Cross-Origin-Embedder-Policy': 'require-corp' }],\n ['3', { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': 'require-corp' }],\n ]);\n COI.CoopAndCoep = Object.freeze(coiHeaders.get('3'));\n const coiSearchParamName = 'vscode-coi';\n /**\n * Extract desired headers from `vscode-coi` invocation\n */\n function getHeadersFromQuery(url) {\n let params;\n if (typeof url === 'string') {\n params = new URL(url).searchParams;\n }\n else if (url instanceof URL) {\n params = url.searchParams;\n }\n else if (URI.isUri(url)) {\n params = new URL(url.toString(true)).searchParams;\n }\n const value = params === null || params === void 0 ? void 0 : params.get(coiSearchParamName);\n if (!value) {\n return undefined;\n }\n return coiHeaders.get(value);\n }\n COI.getHeadersFromQuery = getHeadersFromQuery;\n /**\n * Add the `vscode-coi` query attribute based on wanting `COOP` and `COEP`. Will be a noop when `crossOriginIsolated`\n * isn't enabled the current context\n */\n function addSearchParam(urlOrSearch, coop, coep) {\n if (!globalThis.crossOriginIsolated) {\n // depends on the current context being COI\n return;\n }\n const value = coop && coep ? '3' : coep ? '2' : '1';\n if (urlOrSearch instanceof URLSearchParams) {\n urlOrSearch.set(coiSearchParamName, value);\n }\n else {\n urlOrSearch[coiSearchParamName] = value;\n }\n }\n COI.addSearchParam = addSearchParam;\n})(COI || (COI = {}));\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as strings from './strings.js';\n/**\n * Return a hash value for an object.\n */\nexport function hash(obj) {\n return doHash(obj, 0);\n}\nexport function doHash(obj, hashVal) {\n switch (typeof obj) {\n case 'object':\n if (obj === null) {\n return numberHash(349, hashVal);\n }\n else if (Array.isArray(obj)) {\n return arrayHash(obj, hashVal);\n }\n return objectHash(obj, hashVal);\n case 'string':\n return stringHash(obj, hashVal);\n case 'boolean':\n return booleanHash(obj, hashVal);\n case 'number':\n return numberHash(obj, hashVal);\n case 'undefined':\n return numberHash(937, hashVal);\n default:\n return numberHash(617, hashVal);\n }\n}\nexport function numberHash(val, initialHashVal) {\n return (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32\n}\nfunction booleanHash(b, initialHashVal) {\n return numberHash(b ? 433 : 863, initialHashVal);\n}\nexport function stringHash(s, hashVal) {\n hashVal = numberHash(149417, hashVal);\n for (let i = 0, length = s.length; i < length; i++) {\n hashVal = numberHash(s.charCodeAt(i), hashVal);\n }\n return hashVal;\n}\nfunction arrayHash(arr, initialHashVal) {\n initialHashVal = numberHash(104579, initialHashVal);\n return arr.reduce((hashVal, item) => doHash(item, hashVal), initialHashVal);\n}\nfunction objectHash(obj, initialHashVal) {\n initialHashVal = numberHash(181387, initialHashVal);\n return Object.keys(obj).sort().reduce((hashVal, key) => {\n hashVal = stringHash(key, hashVal);\n return doHash(obj[key], hashVal);\n }, initialHashVal);\n}\nfunction leftRotate(value, bits, totalBits = 32) {\n // delta + bits = totalBits\n const delta = totalBits - bits;\n // All ones, expect `delta` zeros aligned to the right\n const mask = ~((1 << delta) - 1);\n // Join (value left-shifted `bits` bits) with (masked value right-shifted `delta` bits)\n return ((value << bits) | ((mask & value) >>> delta)) >>> 0;\n}\nfunction fill(dest, index = 0, count = dest.byteLength, value = 0) {\n for (let i = 0; i < count; i++) {\n dest[index + i] = value;\n }\n}\nfunction leftPad(value, length, char = '0') {\n while (value.length < length) {\n value = char + value;\n }\n return value;\n}\nexport function toHexString(bufferOrValue, bitsize = 32) {\n if (bufferOrValue instanceof ArrayBuffer) {\n return Array.from(new Uint8Array(bufferOrValue)).map(b => b.toString(16).padStart(2, '0')).join('');\n }\n return leftPad((bufferOrValue >>> 0).toString(16), bitsize / 4);\n}\n/**\n * A SHA1 implementation that works with strings and does not allocate.\n */\nexport class StringSHA1 {\n constructor() {\n this._h0 = 0x67452301;\n this._h1 = 0xEFCDAB89;\n this._h2 = 0x98BADCFE;\n this._h3 = 0x10325476;\n this._h4 = 0xC3D2E1F0;\n this._buff = new Uint8Array(64 /* SHA1Constant.BLOCK_SIZE */ + 3 /* to fit any utf-8 */);\n this._buffDV = new DataView(this._buff.buffer);\n this._buffLen = 0;\n this._totalLen = 0;\n this._leftoverHighSurrogate = 0;\n this._finished = false;\n }\n update(str) {\n const strLen = str.length;\n if (strLen === 0) {\n return;\n }\n const buff = this._buff;\n let buffLen = this._buffLen;\n let leftoverHighSurrogate = this._leftoverHighSurrogate;\n let charCode;\n let offset;\n if (leftoverHighSurrogate !== 0) {\n charCode = leftoverHighSurrogate;\n offset = -1;\n leftoverHighSurrogate = 0;\n }\n else {\n charCode = str.charCodeAt(0);\n offset = 0;\n }\n while (true) {\n let codePoint = charCode;\n if (strings.isHighSurrogate(charCode)) {\n if (offset + 1 < strLen) {\n const nextCharCode = str.charCodeAt(offset + 1);\n if (strings.isLowSurrogate(nextCharCode)) {\n offset++;\n codePoint = strings.computeCodePoint(charCode, nextCharCode);\n }\n else {\n // illegal => unicode replacement character\n codePoint = 65533 /* SHA1Constant.UNICODE_REPLACEMENT */;\n }\n }\n else {\n // last character is a surrogate pair\n leftoverHighSurrogate = charCode;\n break;\n }\n }\n else if (strings.isLowSurrogate(charCode)) {\n // illegal => unicode replacement character\n codePoint = 65533 /* SHA1Constant.UNICODE_REPLACEMENT */;\n }\n buffLen = this._push(buff, buffLen, codePoint);\n offset++;\n if (offset < strLen) {\n charCode = str.charCodeAt(offset);\n }\n else {\n break;\n }\n }\n this._buffLen = buffLen;\n this._leftoverHighSurrogate = leftoverHighSurrogate;\n }\n _push(buff, buffLen, codePoint) {\n if (codePoint < 0x0080) {\n buff[buffLen++] = codePoint;\n }\n else if (codePoint < 0x0800) {\n buff[buffLen++] = 0b11000000 | ((codePoint & 0b00000000000000000000011111000000) >>> 6);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\n }\n else if (codePoint < 0x10000) {\n buff[buffLen++] = 0b11100000 | ((codePoint & 0b00000000000000001111000000000000) >>> 12);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\n }\n else {\n buff[buffLen++] = 0b11110000 | ((codePoint & 0b00000000000111000000000000000000) >>> 18);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000111111000000000000) >>> 12);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6);\n buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0);\n }\n if (buffLen >= 64 /* SHA1Constant.BLOCK_SIZE */) {\n this._step();\n buffLen -= 64 /* SHA1Constant.BLOCK_SIZE */;\n this._totalLen += 64 /* SHA1Constant.BLOCK_SIZE */;\n // take last 3 in case of UTF8 overflow\n buff[0] = buff[64 /* SHA1Constant.BLOCK_SIZE */ + 0];\n buff[1] = buff[64 /* SHA1Constant.BLOCK_SIZE */ + 1];\n buff[2] = buff[64 /* SHA1Constant.BLOCK_SIZE */ + 2];\n }\n return buffLen;\n }\n digest() {\n if (!this._finished) {\n this._finished = true;\n if (this._leftoverHighSurrogate) {\n // illegal => unicode replacement character\n this._leftoverHighSurrogate = 0;\n this._buffLen = this._push(this._buff, this._buffLen, 65533 /* SHA1Constant.UNICODE_REPLACEMENT */);\n }\n this._totalLen += this._buffLen;\n this._wrapUp();\n }\n return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4);\n }\n _wrapUp() {\n this._buff[this._buffLen++] = 0x80;\n fill(this._buff, this._buffLen);\n if (this._buffLen > 56) {\n this._step();\n fill(this._buff);\n }\n // this will fit because the mantissa can cover up to 52 bits\n const ml = 8 * this._totalLen;\n this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false);\n this._buffDV.setUint32(60, ml % 4294967296, false);\n this._step();\n }\n _step() {\n const bigBlock32 = StringSHA1._bigBlock32;\n const data = this._buffDV;\n for (let j = 0; j < 64 /* 16*4 */; j += 4) {\n bigBlock32.setUint32(j, data.getUint32(j, false), false);\n }\n for (let j = 64; j < 320 /* 80*4 */; j += 4) {\n bigBlock32.setUint32(j, leftRotate((bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false)), 1), false);\n }\n let a = this._h0;\n let b = this._h1;\n let c = this._h2;\n let d = this._h3;\n let e = this._h4;\n let f, k;\n let temp;\n for (let j = 0; j < 80; j++) {\n if (j < 20) {\n f = (b & c) | ((~b) & d);\n k = 0x5A827999;\n }\n else if (j < 40) {\n f = b ^ c ^ d;\n k = 0x6ED9EBA1;\n }\n else if (j < 60) {\n f = (b & c) | (b & d) | (c & d);\n k = 0x8F1BBCDC;\n }\n else {\n f = b ^ c ^ d;\n k = 0xCA62C1D6;\n }\n temp = (leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false)) & 0xffffffff;\n e = d;\n d = c;\n c = leftRotate(b, 30);\n b = a;\n a = temp;\n }\n this._h0 = (this._h0 + a) & 0xffffffff;\n this._h1 = (this._h1 + b) & 0xffffffff;\n this._h2 = (this._h2 + c) & 0xffffffff;\n this._h3 = (this._h3 + d) & 0xffffffff;\n this._h4 = (this._h4 + e) & 0xffffffff;\n }\n}\nStringSHA1._bigBlock32 = new DataView(new ArrayBuffer(320)); // 80 * 4 = 320\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as browser from './browser.js';\nimport { BrowserFeatures } from './canIUse.js';\nimport { StandardKeyboardEvent } from './keyboardEvent.js';\nimport { StandardMouseEvent } from './mouseEvent.js';\nimport { AbstractIdleValue, IntervalTimer, _runWhenIdle } from '../common/async.js';\nimport { onUnexpectedError } from '../common/errors.js';\nimport * as event from '../common/event.js';\nimport * as dompurify from './dompurify/dompurify.js';\nimport { Disposable, DisposableStore, toDisposable } from '../common/lifecycle.js';\nimport { FileAccess, RemoteAuthorities } from '../common/network.js';\nimport * as platform from '../common/platform.js';\nimport { hash } from '../common/hash.js';\nimport { ensureCodeWindow, mainWindow } from './window.js';\n//# region Multi-Window Support Utilities\nexport const { registerWindow, getWindow, getDocument, getWindows, getWindowsCount, getWindowId, getWindowById, hasWindow, onDidRegisterWindow, onWillUnregisterWindow, onDidUnregisterWindow } = (function () {\n const windows = new Map();\n ensureCodeWindow(mainWindow, 1);\n windows.set(mainWindow.vscodeWindowId, { window: mainWindow, disposables: new DisposableStore() });\n const onDidRegisterWindow = new event.Emitter();\n const onDidUnregisterWindow = new event.Emitter();\n const onWillUnregisterWindow = new event.Emitter();\n return {\n onDidRegisterWindow: onDidRegisterWindow.event,\n onWillUnregisterWindow: onWillUnregisterWindow.event,\n onDidUnregisterWindow: onDidUnregisterWindow.event,\n registerWindow(window) {\n if (windows.has(window.vscodeWindowId)) {\n return Disposable.None;\n }\n const disposables = new DisposableStore();\n const registeredWindow = {\n window,\n disposables: disposables.add(new DisposableStore())\n };\n windows.set(window.vscodeWindowId, registeredWindow);\n disposables.add(toDisposable(() => {\n windows.delete(window.vscodeWindowId);\n onDidUnregisterWindow.fire(window);\n }));\n disposables.add(addDisposableListener(window, EventType.BEFORE_UNLOAD, () => {\n onWillUnregisterWindow.fire(window);\n }));\n onDidRegisterWindow.fire(registeredWindow);\n return disposables;\n },\n getWindows() {\n return windows.values();\n },\n getWindowsCount() {\n return windows.size;\n },\n getWindowId(targetWindow) {\n return targetWindow.vscodeWindowId;\n },\n hasWindow(windowId) {\n return windows.has(windowId);\n },\n getWindowById(windowId) {\n return windows.get(windowId);\n },\n getWindow(e) {\n var _a;\n const candidateNode = e;\n if ((_a = candidateNode === null || candidateNode === void 0 ? void 0 : candidateNode.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) {\n return candidateNode.ownerDocument.defaultView.window;\n }\n const candidateEvent = e;\n if (candidateEvent === null || candidateEvent === void 0 ? void 0 : candidateEvent.view) {\n return candidateEvent.view.window;\n }\n return mainWindow;\n },\n getDocument(e) {\n const candidateNode = e;\n return getWindow(candidateNode).document;\n }\n };\n})();\n//#endregion\nexport function clearNode(node) {\n while (node.firstChild) {\n node.firstChild.remove();\n }\n}\nclass DomListener {\n constructor(node, type, handler, options) {\n this._node = node;\n this._type = type;\n this._handler = handler;\n this._options = (options || false);\n this._node.addEventListener(this._type, this._handler, this._options);\n }\n dispose() {\n if (!this._handler) {\n // Already disposed\n return;\n }\n this._node.removeEventListener(this._type, this._handler, this._options);\n // Prevent leakers from holding on to the dom or handler func\n this._node = null;\n this._handler = null;\n }\n}\nexport function addDisposableListener(node, type, handler, useCaptureOrOptions) {\n return new DomListener(node, type, handler, useCaptureOrOptions);\n}\nfunction _wrapAsStandardMouseEvent(targetWindow, handler) {\n return function (e) {\n return handler(new StandardMouseEvent(targetWindow, e));\n };\n}\nfunction _wrapAsStandardKeyboardEvent(handler) {\n return function (e) {\n return handler(new StandardKeyboardEvent(e));\n };\n}\nexport const addStandardDisposableListener = function addStandardDisposableListener(node, type, handler, useCapture) {\n let wrapHandler = handler;\n if (type === 'click' || type === 'mousedown') {\n wrapHandler = _wrapAsStandardMouseEvent(getWindow(node), handler);\n }\n else if (type === 'keydown' || type === 'keypress' || type === 'keyup') {\n wrapHandler = _wrapAsStandardKeyboardEvent(handler);\n }\n return addDisposableListener(node, type, wrapHandler, useCapture);\n};\nexport const addStandardDisposableGenericMouseDownListener = function addStandardDisposableListener(node, handler, useCapture) {\n const wrapHandler = _wrapAsStandardMouseEvent(getWindow(node), handler);\n return addDisposableGenericMouseDownListener(node, wrapHandler, useCapture);\n};\nexport const addStandardDisposableGenericMouseUpListener = function addStandardDisposableListener(node, handler, useCapture) {\n const wrapHandler = _wrapAsStandardMouseEvent(getWindow(node), handler);\n return addDisposableGenericMouseUpListener(node, wrapHandler, useCapture);\n};\nexport function addDisposableGenericMouseDownListener(node, handler, useCapture) {\n return addDisposableListener(node, platform.isIOS && BrowserFeatures.pointerEvents ? EventType.POINTER_DOWN : EventType.MOUSE_DOWN, handler, useCapture);\n}\nexport function addDisposableGenericMouseUpListener(node, handler, useCapture) {\n return addDisposableListener(node, platform.isIOS && BrowserFeatures.pointerEvents ? EventType.POINTER_UP : EventType.MOUSE_UP, handler, useCapture);\n}\n/**\n * Execute the callback the next time the browser is idle, returning an\n * {@link IDisposable} that will cancel the callback when disposed. This wraps\n * [requestIdleCallback] so it will fallback to [setTimeout] if the environment\n * doesn't support it.\n *\n * @param targetWindow The window for which to run the idle callback\n * @param callback The callback to run when idle, this includes an\n * [IdleDeadline] that provides the time alloted for the idle callback by the\n * browser. Not respecting this deadline will result in a degraded user\n * experience.\n * @param timeout A timeout at which point to queue no longer wait for an idle\n * callback but queue it on the regular event loop (like setTimeout). Typically\n * this should not be used.\n *\n * [IdleDeadline]: https://developer.mozilla.org/en-US/docs/Web/API/IdleDeadline\n * [requestIdleCallback]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback\n * [setTimeout]: https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout\n */\nexport function runWhenWindowIdle(targetWindow, callback, timeout) {\n return _runWhenIdle(targetWindow, callback, timeout);\n}\n/**\n * An implementation of the \"idle-until-urgent\"-strategy as introduced\n * here: https://philipwalton.com/articles/idle-until-urgent/\n */\nexport class WindowIdleValue extends AbstractIdleValue {\n constructor(targetWindow, executor) {\n super(targetWindow, executor);\n }\n}\n/**\n * Schedule a callback to be run at the next animation frame.\n * This allows multiple parties to register callbacks that should run at the next animation frame.\n * If currently in an animation frame, `runner` will be executed immediately.\n * @return token that can be used to cancel the scheduled runner (only if `runner` was not executed immediately).\n */\nexport let runAtThisOrScheduleAtNextAnimationFrame;\n/**\n * Schedule a callback to be run at the next animation frame.\n * This allows multiple parties to register callbacks that should run at the next animation frame.\n * If currently in an animation frame, `runner` will be executed at the next animation frame.\n * @return token that can be used to cancel the scheduled runner.\n */\nexport let scheduleAtNextAnimationFrame;\nexport class WindowIntervalTimer extends IntervalTimer {\n /**\n *\n * @param node The optional node from which the target window is determined\n */\n constructor(node) {\n super();\n this.defaultTarget = node && getWindow(node);\n }\n cancelAndSet(runner, interval, targetWindow) {\n return super.cancelAndSet(runner, interval, targetWindow !== null && targetWindow !== void 0 ? targetWindow : this.defaultTarget);\n }\n}\nclass AnimationFrameQueueItem {\n constructor(runner, priority = 0) {\n this._runner = runner;\n this.priority = priority;\n this._canceled = false;\n }\n dispose() {\n this._canceled = true;\n }\n execute() {\n if (this._canceled) {\n return;\n }\n try {\n this._runner();\n }\n catch (e) {\n onUnexpectedError(e);\n }\n }\n // Sort by priority (largest to lowest)\n static sort(a, b) {\n return b.priority - a.priority;\n }\n}\n(function () {\n /**\n * The runners scheduled at the next animation frame\n */\n const NEXT_QUEUE = new Map();\n /**\n * The runners scheduled at the current animation frame\n */\n const CURRENT_QUEUE = new Map();\n /**\n * A flag to keep track if the native requestAnimationFrame was already called\n */\n const animFrameRequested = new Map();\n /**\n * A flag to indicate if currently handling a native requestAnimationFrame callback\n */\n const inAnimationFrameRunner = new Map();\n const animationFrameRunner = (targetWindowId) => {\n var _a;\n animFrameRequested.set(targetWindowId, false);\n const currentQueue = (_a = NEXT_QUEUE.get(targetWindowId)) !== null && _a !== void 0 ? _a : [];\n CURRENT_QUEUE.set(targetWindowId, currentQueue);\n NEXT_QUEUE.set(targetWindowId, []);\n inAnimationFrameRunner.set(targetWindowId, true);\n while (currentQueue.length > 0) {\n currentQueue.sort(AnimationFrameQueueItem.sort);\n const top = currentQueue.shift();\n top.execute();\n }\n inAnimationFrameRunner.set(targetWindowId, false);\n };\n scheduleAtNextAnimationFrame = (targetWindow, runner, priority = 0) => {\n const targetWindowId = getWindowId(targetWindow);\n const item = new AnimationFrameQueueItem(runner, priority);\n let nextQueue = NEXT_QUEUE.get(targetWindowId);\n if (!nextQueue) {\n nextQueue = [];\n NEXT_QUEUE.set(targetWindowId, nextQueue);\n }\n nextQueue.push(item);\n if (!animFrameRequested.get(targetWindowId)) {\n animFrameRequested.set(targetWindowId, true);\n targetWindow.requestAnimationFrame(() => animationFrameRunner(targetWindowId));\n }\n return item;\n };\n runAtThisOrScheduleAtNextAnimationFrame = (targetWindow, runner, priority) => {\n const targetWindowId = getWindowId(targetWindow);\n if (inAnimationFrameRunner.get(targetWindowId)) {\n const item = new AnimationFrameQueueItem(runner, priority);\n let currentQueue = CURRENT_QUEUE.get(targetWindowId);\n if (!currentQueue) {\n currentQueue = [];\n CURRENT_QUEUE.set(targetWindowId, currentQueue);\n }\n currentQueue.push(item);\n return item;\n }\n else {\n return scheduleAtNextAnimationFrame(targetWindow, runner, priority);\n }\n };\n})();\nexport function getComputedStyle(el) {\n return getWindow(el).getComputedStyle(el, null);\n}\nexport function getClientArea(element, fallback) {\n const elWindow = getWindow(element);\n const elDocument = elWindow.document;\n // Try with DOM clientWidth / clientHeight\n if (element !== elDocument.body) {\n return new Dimension(element.clientWidth, element.clientHeight);\n }\n // If visual view port exits and it's on mobile, it should be used instead of window innerWidth / innerHeight, or document.body.clientWidth / document.body.clientHeight\n if (platform.isIOS && (elWindow === null || elWindow === void 0 ? void 0 : elWindow.visualViewport)) {\n return new Dimension(elWindow.visualViewport.width, elWindow.visualViewport.height);\n }\n // Try innerWidth / innerHeight\n if ((elWindow === null || elWindow === void 0 ? void 0 : elWindow.innerWidth) && elWindow.innerHeight) {\n return new Dimension(elWindow.innerWidth, elWindow.innerHeight);\n }\n // Try with document.body.clientWidth / document.body.clientHeight\n if (elDocument.body && elDocument.body.clientWidth && elDocument.body.clientHeight) {\n return new Dimension(elDocument.body.clientWidth, elDocument.body.clientHeight);\n }\n // Try with document.documentElement.clientWidth / document.documentElement.clientHeight\n if (elDocument.documentElement && elDocument.documentElement.clientWidth && elDocument.documentElement.clientHeight) {\n return new Dimension(elDocument.documentElement.clientWidth, elDocument.documentElement.clientHeight);\n }\n if (fallback) {\n return getClientArea(fallback);\n }\n throw new Error('Unable to figure out browser width and height');\n}\nclass SizeUtils {\n // Adapted from WinJS\n // Converts a CSS positioning string for the specified element to pixels.\n static convertToPixels(element, value) {\n return parseFloat(value) || 0;\n }\n static getDimension(element, cssPropertyName, jsPropertyName) {\n const computedStyle = getComputedStyle(element);\n const value = computedStyle ? computedStyle.getPropertyValue(cssPropertyName) : '0';\n return SizeUtils.convertToPixels(element, value);\n }\n static getBorderLeftWidth(element) {\n return SizeUtils.getDimension(element, 'border-left-width', 'borderLeftWidth');\n }\n static getBorderRightWidth(element) {\n return SizeUtils.getDimension(element, 'border-right-width', 'borderRightWidth');\n }\n static getBorderTopWidth(element) {\n return SizeUtils.getDimension(element, 'border-top-width', 'borderTopWidth');\n }\n static getBorderBottomWidth(element) {\n return SizeUtils.getDimension(element, 'border-bottom-width', 'borderBottomWidth');\n }\n static getPaddingLeft(element) {\n return SizeUtils.getDimension(element, 'padding-left', 'paddingLeft');\n }\n static getPaddingRight(element) {\n return SizeUtils.getDimension(element, 'padding-right', 'paddingRight');\n }\n static getPaddingTop(element) {\n return SizeUtils.getDimension(element, 'padding-top', 'paddingTop');\n }\n static getPaddingBottom(element) {\n return SizeUtils.getDimension(element, 'padding-bottom', 'paddingBottom');\n }\n static getMarginLeft(element) {\n return SizeUtils.getDimension(element, 'margin-left', 'marginLeft');\n }\n static getMarginTop(element) {\n return SizeUtils.getDimension(element, 'margin-top', 'marginTop');\n }\n static getMarginRight(element) {\n return SizeUtils.getDimension(element, 'margin-right', 'marginRight');\n }\n static getMarginBottom(element) {\n return SizeUtils.getDimension(element, 'margin-bottom', 'marginBottom');\n }\n}\nexport class Dimension {\n constructor(width, height) {\n this.width = width;\n this.height = height;\n }\n with(width = this.width, height = this.height) {\n if (width !== this.width || height !== this.height) {\n return new Dimension(width, height);\n }\n else {\n return this;\n }\n }\n static is(obj) {\n return typeof obj === 'object' && typeof obj.height === 'number' && typeof obj.width === 'number';\n }\n static lift(obj) {\n if (obj instanceof Dimension) {\n return obj;\n }\n else {\n return new Dimension(obj.width, obj.height);\n }\n }\n static equals(a, b) {\n if (a === b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n return a.width === b.width && a.height === b.height;\n }\n}\nDimension.None = new Dimension(0, 0);\nexport function getTopLeftOffset(element) {\n // Adapted from WinJS.Utilities.getPosition\n // and added borders to the mix\n let offsetParent = element.offsetParent;\n let top = element.offsetTop;\n let left = element.offsetLeft;\n while ((element = element.parentNode) !== null\n && element !== element.ownerDocument.body\n && element !== element.ownerDocument.documentElement) {\n top -= element.scrollTop;\n const c = isShadowRoot(element) ? null : getComputedStyle(element);\n if (c) {\n left -= c.direction !== 'rtl' ? element.scrollLeft : -element.scrollLeft;\n }\n if (element === offsetParent) {\n left += SizeUtils.getBorderLeftWidth(element);\n top += SizeUtils.getBorderTopWidth(element);\n top += element.offsetTop;\n left += element.offsetLeft;\n offsetParent = element.offsetParent;\n }\n }\n return {\n left: left,\n top: top\n };\n}\nexport function size(element, width, height) {\n if (typeof width === 'number') {\n element.style.width = `${width}px`;\n }\n if (typeof height === 'number') {\n element.style.height = `${height}px`;\n }\n}\n/**\n * Returns the position of a dom node relative to the entire page.\n */\nexport function getDomNodePagePosition(domNode) {\n const bb = domNode.getBoundingClientRect();\n const window = getWindow(domNode);\n return {\n left: bb.left + window.scrollX,\n top: bb.top + window.scrollY,\n width: bb.width,\n height: bb.height\n };\n}\n/**\n * Returns the effective zoom on a given element before window zoom level is applied\n */\nexport function getDomNodeZoomLevel(domNode) {\n let testElement = domNode;\n let zoom = 1.0;\n do {\n const elementZoomLevel = getComputedStyle(testElement).zoom;\n if (elementZoomLevel !== null && elementZoomLevel !== undefined && elementZoomLevel !== '1') {\n zoom *= elementZoomLevel;\n }\n testElement = testElement.parentElement;\n } while (testElement !== null && testElement !== testElement.ownerDocument.documentElement);\n return zoom;\n}\n// Adapted from WinJS\n// Gets the width of the element, including margins.\nexport function getTotalWidth(element) {\n const margin = SizeUtils.getMarginLeft(element) + SizeUtils.getMarginRight(element);\n return element.offsetWidth + margin;\n}\nexport function getContentWidth(element) {\n const border = SizeUtils.getBorderLeftWidth(element) + SizeUtils.getBorderRightWidth(element);\n const padding = SizeUtils.getPaddingLeft(element) + SizeUtils.getPaddingRight(element);\n return element.offsetWidth - border - padding;\n}\n// Adapted from WinJS\n// Gets the height of the content of the specified element. The content height does not include borders or padding.\nexport function getContentHeight(element) {\n const border = SizeUtils.getBorderTopWidth(element) + SizeUtils.getBorderBottomWidth(element);\n const padding = SizeUtils.getPaddingTop(element) + SizeUtils.getPaddingBottom(element);\n return element.offsetHeight - border - padding;\n}\n// Adapted from WinJS\n// Gets the height of the element, including its margins.\nexport function getTotalHeight(element) {\n const margin = SizeUtils.getMarginTop(element) + SizeUtils.getMarginBottom(element);\n return element.offsetHeight + margin;\n}\n// ----------------------------------------------------------------------------------------\nexport function isAncestor(testChild, testAncestor) {\n return Boolean(testAncestor === null || testAncestor === void 0 ? void 0 : testAncestor.contains(testChild));\n}\nexport function findParentWithClass(node, clazz, stopAtClazzOrNode) {\n while (node && node.nodeType === node.ELEMENT_NODE) {\n if (node.classList.contains(clazz)) {\n return node;\n }\n if (stopAtClazzOrNode) {\n if (typeof stopAtClazzOrNode === 'string') {\n if (node.classList.contains(stopAtClazzOrNode)) {\n return null;\n }\n }\n else {\n if (node === stopAtClazzOrNode) {\n return null;\n }\n }\n }\n node = node.parentNode;\n }\n return null;\n}\nexport function hasParentWithClass(node, clazz, stopAtClazzOrNode) {\n return !!findParentWithClass(node, clazz, stopAtClazzOrNode);\n}\nexport function isShadowRoot(node) {\n return (node && !!node.host && !!node.mode);\n}\nexport function isInShadowDOM(domNode) {\n return !!getShadowRoot(domNode);\n}\nexport function getShadowRoot(domNode) {\n var _a;\n while (domNode.parentNode) {\n if (domNode === ((_a = domNode.ownerDocument) === null || _a === void 0 ? void 0 : _a.body)) {\n // reached the body\n return null;\n }\n domNode = domNode.parentNode;\n }\n return isShadowRoot(domNode) ? domNode : null;\n}\n/**\n * Returns the active element across all child windows\n * based on document focus. Falls back to the main\n * window if no window has focus.\n */\nexport function getActiveElement() {\n let result = getActiveDocument().activeElement;\n while (result === null || result === void 0 ? void 0 : result.shadowRoot) {\n result = result.shadowRoot.activeElement;\n }\n return result;\n}\n/**\n * Returns true if the focused window active element matches\n * the provided element. Falls back to the main window if no\n * window has focus.\n */\nexport function isActiveElement(element) {\n return getActiveElement() === element;\n}\n/**\n * Returns true if the focused window active element is contained in\n * `ancestor`. Falls back to the main window if no window has focus.\n */\nexport function isAncestorOfActiveElement(ancestor) {\n return isAncestor(getActiveElement(), ancestor);\n}\n/**\n * Returns the active document across main and child windows.\n * Prefers the window with focus, otherwise falls back to\n * the main windows document.\n */\nexport function getActiveDocument() {\n var _a;\n if (getWindowsCount() <= 1) {\n return mainWindow.document;\n }\n const documents = Array.from(getWindows()).map(({ window }) => window.document);\n return (_a = documents.find(doc => doc.hasFocus())) !== null && _a !== void 0 ? _a : mainWindow.document;\n}\n/**\n * Returns the active window across main and child windows.\n * Prefers the window with focus, otherwise falls back to\n * the main window.\n */\nexport function getActiveWindow() {\n var _a, _b;\n const document = getActiveDocument();\n return ((_b = (_a = document.defaultView) === null || _a === void 0 ? void 0 : _a.window) !== null && _b !== void 0 ? _b : mainWindow);\n}\nconst globalStylesheets = new Map();\n/**\n * A version of createStyleSheet which has a unified API to initialize/set the style content.\n */\nexport function createStyleSheet2() {\n return new WrappedStyleElement();\n}\nclass WrappedStyleElement {\n constructor() {\n this._currentCssStyle = '';\n this._styleSheet = undefined;\n }\n setStyle(cssStyle) {\n if (cssStyle === this._currentCssStyle) {\n return;\n }\n this._currentCssStyle = cssStyle;\n if (!this._styleSheet) {\n this._styleSheet = createStyleSheet(mainWindow.document.head, (s) => s.innerText = cssStyle);\n }\n else {\n this._styleSheet.innerText = cssStyle;\n }\n }\n dispose() {\n if (this._styleSheet) {\n clearNode(this._styleSheet);\n this._styleSheet = undefined;\n }\n }\n}\nexport function createStyleSheet(container = mainWindow.document.head, beforeAppend, disposableStore) {\n const style = document.createElement('style');\n style.type = 'text/css';\n style.media = 'screen';\n beforeAppend === null || beforeAppend === void 0 ? void 0 : beforeAppend(style);\n container.appendChild(style);\n if (disposableStore) {\n disposableStore.add(toDisposable(() => container.removeChild(style)));\n }\n // With as container, the stylesheet becomes global and is tracked\n // to support auxiliary windows to clone the stylesheet.\n if (container === mainWindow.document.head) {\n const globalStylesheetClones = new Set();\n globalStylesheets.set(style, globalStylesheetClones);\n for (const { window: targetWindow, disposables } of getWindows()) {\n if (targetWindow === mainWindow) {\n continue; // main window is already tracked\n }\n const cloneDisposable = disposables.add(cloneGlobalStyleSheet(style, globalStylesheetClones, targetWindow));\n disposableStore === null || disposableStore === void 0 ? void 0 : disposableStore.add(cloneDisposable);\n }\n }\n return style;\n}\nfunction cloneGlobalStyleSheet(globalStylesheet, globalStylesheetClones, targetWindow) {\n var _a, _b;\n const disposables = new DisposableStore();\n const clone = globalStylesheet.cloneNode(true);\n targetWindow.document.head.appendChild(clone);\n disposables.add(toDisposable(() => targetWindow.document.head.removeChild(clone)));\n for (const rule of getDynamicStyleSheetRules(globalStylesheet)) {\n (_a = clone.sheet) === null || _a === void 0 ? void 0 : _a.insertRule(rule.cssText, (_b = clone.sheet) === null || _b === void 0 ? void 0 : _b.cssRules.length);\n }\n disposables.add(sharedMutationObserver.observe(globalStylesheet, disposables, { childList: true })(() => {\n clone.textContent = globalStylesheet.textContent;\n }));\n globalStylesheetClones.add(clone);\n disposables.add(toDisposable(() => globalStylesheetClones.delete(clone)));\n return disposables;\n}\nexport const sharedMutationObserver = new class {\n constructor() {\n this.mutationObservers = new Map();\n }\n observe(target, disposables, options) {\n let mutationObserversPerTarget = this.mutationObservers.get(target);\n if (!mutationObserversPerTarget) {\n mutationObserversPerTarget = new Map();\n this.mutationObservers.set(target, mutationObserversPerTarget);\n }\n const optionsHash = hash(options);\n let mutationObserverPerOptions = mutationObserversPerTarget.get(optionsHash);\n if (!mutationObserverPerOptions) {\n const onDidMutate = new event.Emitter();\n const observer = new MutationObserver(mutations => onDidMutate.fire(mutations));\n observer.observe(target, options);\n const resolvedMutationObserverPerOptions = mutationObserverPerOptions = {\n users: 1,\n observer,\n onDidMutate: onDidMutate.event\n };\n disposables.add(toDisposable(() => {\n resolvedMutationObserverPerOptions.users -= 1;\n if (resolvedMutationObserverPerOptions.users === 0) {\n onDidMutate.dispose();\n observer.disconnect();\n mutationObserversPerTarget === null || mutationObserversPerTarget === void 0 ? void 0 : mutationObserversPerTarget.delete(optionsHash);\n if ((mutationObserversPerTarget === null || mutationObserversPerTarget === void 0 ? void 0 : mutationObserversPerTarget.size) === 0) {\n this.mutationObservers.delete(target);\n }\n }\n }));\n mutationObserversPerTarget.set(optionsHash, mutationObserverPerOptions);\n }\n else {\n mutationObserverPerOptions.users += 1;\n }\n return mutationObserverPerOptions.onDidMutate;\n }\n};\nlet _sharedStyleSheet = null;\nfunction getSharedStyleSheet() {\n if (!_sharedStyleSheet) {\n _sharedStyleSheet = createStyleSheet();\n }\n return _sharedStyleSheet;\n}\nfunction getDynamicStyleSheetRules(style) {\n var _a, _b;\n if ((_a = style === null || style === void 0 ? void 0 : style.sheet) === null || _a === void 0 ? void 0 : _a.rules) {\n // Chrome, IE\n return style.sheet.rules;\n }\n if ((_b = style === null || style === void 0 ? void 0 : style.sheet) === null || _b === void 0 ? void 0 : _b.cssRules) {\n // FF\n return style.sheet.cssRules;\n }\n return [];\n}\nexport function createCSSRule(selector, cssText, style = getSharedStyleSheet()) {\n var _a, _b;\n if (!style || !cssText) {\n return;\n }\n (_a = style.sheet) === null || _a === void 0 ? void 0 : _a.insertRule(`${selector} {${cssText}}`, 0);\n // Apply rule also to all cloned global stylesheets\n for (const clonedGlobalStylesheet of (_b = globalStylesheets.get(style)) !== null && _b !== void 0 ? _b : []) {\n createCSSRule(selector, cssText, clonedGlobalStylesheet);\n }\n}\nexport function removeCSSRulesContainingSelector(ruleName, style = getSharedStyleSheet()) {\n var _a, _b;\n if (!style) {\n return;\n }\n const rules = getDynamicStyleSheetRules(style);\n const toDelete = [];\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n if (isCSSStyleRule(rule) && rule.selectorText.indexOf(ruleName) !== -1) {\n toDelete.push(i);\n }\n }\n for (let i = toDelete.length - 1; i >= 0; i--) {\n (_a = style.sheet) === null || _a === void 0 ? void 0 : _a.deleteRule(toDelete[i]);\n }\n // Remove rules also from all cloned global stylesheets\n for (const clonedGlobalStylesheet of (_b = globalStylesheets.get(style)) !== null && _b !== void 0 ? _b : []) {\n removeCSSRulesContainingSelector(ruleName, clonedGlobalStylesheet);\n }\n}\nfunction isCSSStyleRule(rule) {\n return typeof rule.selectorText === 'string';\n}\nexport function isMouseEvent(e) {\n // eslint-disable-next-line no-restricted-syntax\n return e instanceof MouseEvent || e instanceof getWindow(e).MouseEvent;\n}\nexport function isKeyboardEvent(e) {\n // eslint-disable-next-line no-restricted-syntax\n return e instanceof KeyboardEvent || e instanceof getWindow(e).KeyboardEvent;\n}\nexport const EventType = {\n // Mouse\n CLICK: 'click',\n AUXCLICK: 'auxclick',\n DBLCLICK: 'dblclick',\n MOUSE_UP: 'mouseup',\n MOUSE_DOWN: 'mousedown',\n MOUSE_OVER: 'mouseover',\n MOUSE_MOVE: 'mousemove',\n MOUSE_OUT: 'mouseout',\n MOUSE_ENTER: 'mouseenter',\n MOUSE_LEAVE: 'mouseleave',\n MOUSE_WHEEL: 'wheel',\n POINTER_UP: 'pointerup',\n POINTER_DOWN: 'pointerdown',\n POINTER_MOVE: 'pointermove',\n POINTER_LEAVE: 'pointerleave',\n CONTEXT_MENU: 'contextmenu',\n WHEEL: 'wheel',\n // Keyboard\n KEY_DOWN: 'keydown',\n KEY_PRESS: 'keypress',\n KEY_UP: 'keyup',\n // HTML Document\n LOAD: 'load',\n BEFORE_UNLOAD: 'beforeunload',\n UNLOAD: 'unload',\n PAGE_SHOW: 'pageshow',\n PAGE_HIDE: 'pagehide',\n PASTE: 'paste',\n ABORT: 'abort',\n ERROR: 'error',\n RESIZE: 'resize',\n SCROLL: 'scroll',\n FULLSCREEN_CHANGE: 'fullscreenchange',\n WK_FULLSCREEN_CHANGE: 'webkitfullscreenchange',\n // Form\n SELECT: 'select',\n CHANGE: 'change',\n SUBMIT: 'submit',\n RESET: 'reset',\n FOCUS: 'focus',\n FOCUS_IN: 'focusin',\n FOCUS_OUT: 'focusout',\n BLUR: 'blur',\n INPUT: 'input',\n // Local Storage\n STORAGE: 'storage',\n // Drag\n DRAG_START: 'dragstart',\n DRAG: 'drag',\n DRAG_ENTER: 'dragenter',\n DRAG_LEAVE: 'dragleave',\n DRAG_OVER: 'dragover',\n DROP: 'drop',\n DRAG_END: 'dragend',\n // Animation\n ANIMATION_START: browser.isWebKit ? 'webkitAnimationStart' : 'animationstart',\n ANIMATION_END: browser.isWebKit ? 'webkitAnimationEnd' : 'animationend',\n ANIMATION_ITERATION: browser.isWebKit ? 'webkitAnimationIteration' : 'animationiteration'\n};\nexport function isEventLike(obj) {\n const candidate = obj;\n return !!(candidate && typeof candidate.preventDefault === 'function' && typeof candidate.stopPropagation === 'function');\n}\nexport const EventHelper = {\n stop: (e, cancelBubble) => {\n e.preventDefault();\n if (cancelBubble) {\n e.stopPropagation();\n }\n return e;\n }\n};\nexport function saveParentsScrollTop(node) {\n const r = [];\n for (let i = 0; node && node.nodeType === node.ELEMENT_NODE; i++) {\n r[i] = node.scrollTop;\n node = node.parentNode;\n }\n return r;\n}\nexport function restoreParentsScrollTop(node, state) {\n for (let i = 0; node && node.nodeType === node.ELEMENT_NODE; i++) {\n if (node.scrollTop !== state[i]) {\n node.scrollTop = state[i];\n }\n node = node.parentNode;\n }\n}\nclass FocusTracker extends Disposable {\n static hasFocusWithin(element) {\n if (element instanceof HTMLElement) {\n const shadowRoot = getShadowRoot(element);\n const activeElement = (shadowRoot ? shadowRoot.activeElement : element.ownerDocument.activeElement);\n return isAncestor(activeElement, element);\n }\n else {\n const window = element;\n return isAncestor(window.document.activeElement, window.document);\n }\n }\n constructor(element) {\n super();\n this._onDidFocus = this._register(new event.Emitter());\n this.onDidFocus = this._onDidFocus.event;\n this._onDidBlur = this._register(new event.Emitter());\n this.onDidBlur = this._onDidBlur.event;\n let hasFocus = FocusTracker.hasFocusWithin(element);\n let loosingFocus = false;\n const onFocus = () => {\n loosingFocus = false;\n if (!hasFocus) {\n hasFocus = true;\n this._onDidFocus.fire();\n }\n };\n const onBlur = () => {\n if (hasFocus) {\n loosingFocus = true;\n (element instanceof HTMLElement ? getWindow(element) : element).setTimeout(() => {\n if (loosingFocus) {\n loosingFocus = false;\n hasFocus = false;\n this._onDidBlur.fire();\n }\n }, 0);\n }\n };\n this._refreshStateHandler = () => {\n const currentNodeHasFocus = FocusTracker.hasFocusWithin(element);\n if (currentNodeHasFocus !== hasFocus) {\n if (hasFocus) {\n onBlur();\n }\n else {\n onFocus();\n }\n }\n };\n this._register(addDisposableListener(element, EventType.FOCUS, onFocus, true));\n this._register(addDisposableListener(element, EventType.BLUR, onBlur, true));\n if (element instanceof HTMLElement) {\n this._register(addDisposableListener(element, EventType.FOCUS_IN, () => this._refreshStateHandler()));\n this._register(addDisposableListener(element, EventType.FOCUS_OUT, () => this._refreshStateHandler()));\n }\n }\n}\n/**\n * Creates a new `IFocusTracker` instance that tracks focus changes on the given `element` and its descendants.\n *\n * @param element The `HTMLElement` or `Window` to track focus changes on.\n * @returns An `IFocusTracker` instance.\n */\nexport function trackFocus(element) {\n return new FocusTracker(element);\n}\nexport function after(sibling, child) {\n sibling.after(child);\n return child;\n}\nexport function append(parent, ...children) {\n parent.append(...children);\n if (children.length === 1 && typeof children[0] !== 'string') {\n return children[0];\n }\n}\nexport function prepend(parent, child) {\n parent.insertBefore(child, parent.firstChild);\n return child;\n}\n/**\n * Removes all children from `parent` and appends `children`\n */\nexport function reset(parent, ...children) {\n parent.innerText = '';\n append(parent, ...children);\n}\nconst SELECTOR_REGEX = /([\\w\\-]+)?(#([\\w\\-]+))?((\\.([\\w\\-]+))*)/;\nexport var Namespace;\n(function (Namespace) {\n Namespace[\"HTML\"] = \"http://www.w3.org/1999/xhtml\";\n Namespace[\"SVG\"] = \"http://www.w3.org/2000/svg\";\n})(Namespace || (Namespace = {}));\nfunction _$(namespace, description, attrs, ...children) {\n const match = SELECTOR_REGEX.exec(description);\n if (!match) {\n throw new Error('Bad use of emmet');\n }\n const tagName = match[1] || 'div';\n let result;\n if (namespace !== Namespace.HTML) {\n result = document.createElementNS(namespace, tagName);\n }\n else {\n result = document.createElement(tagName);\n }\n if (match[3]) {\n result.id = match[3];\n }\n if (match[4]) {\n result.className = match[4].replace(/\\./g, ' ').trim();\n }\n if (attrs) {\n Object.entries(attrs).forEach(([name, value]) => {\n if (typeof value === 'undefined') {\n return;\n }\n if (/^on\\w+$/.test(name)) {\n result[name] = value;\n }\n else if (name === 'selected') {\n if (value) {\n result.setAttribute(name, 'true');\n }\n }\n else {\n result.setAttribute(name, value);\n }\n });\n }\n result.append(...children);\n return result;\n}\nexport function $(description, attrs, ...children) {\n return _$(Namespace.HTML, description, attrs, ...children);\n}\n$.SVG = function (description, attrs, ...children) {\n return _$(Namespace.SVG, description, attrs, ...children);\n};\nexport function setVisibility(visible, ...elements) {\n if (visible) {\n show(...elements);\n }\n else {\n hide(...elements);\n }\n}\nexport function show(...elements) {\n for (const element of elements) {\n element.style.display = '';\n element.removeAttribute('aria-hidden');\n }\n}\nexport function hide(...elements) {\n for (const element of elements) {\n element.style.display = 'none';\n element.setAttribute('aria-hidden', 'true');\n }\n}\n/**\n * Find a value usable for a dom node size such that the likelihood that it would be\n * displayed with constant screen pixels size is as high as possible.\n *\n * e.g. We would desire for the cursors to be 2px (CSS px) wide. Under a devicePixelRatio\n * of 1.25, the cursor will be 2.5 screen pixels wide. Depending on how the dom node aligns/\"snaps\"\n * with the screen pixels, it will sometimes be rendered with 2 screen pixels, and sometimes with 3 screen pixels.\n */\nexport function computeScreenAwareSize(window, cssPx) {\n const screenPx = window.devicePixelRatio * cssPx;\n return Math.max(1, Math.floor(screenPx)) / window.devicePixelRatio;\n}\n/**\n * Open safely a new window. This is the best way to do so, but you cannot tell\n * if the window was opened or if it was blocked by the browser's popup blocker.\n * If you want to tell if the browser blocked the new window, use {@link windowOpenWithSuccess}.\n *\n * See https://github.com/microsoft/monaco-editor/issues/601\n * To protect against malicious code in the linked site, particularly phishing attempts,\n * the window.opener should be set to null to prevent the linked site from having access\n * to change the location of the current page.\n * See https://mathiasbynens.github.io/rel-noopener/\n */\nexport function windowOpenNoOpener(url) {\n // By using 'noopener' in the `windowFeatures` argument, the newly created window will\n // not be able to use `window.opener` to reach back to the current page.\n // See https://stackoverflow.com/a/46958731\n // See https://developer.mozilla.org/en-US/docs/Web/API/Window/open#noopener\n // However, this also doesn't allow us to realize if the browser blocked\n // the creation of the window.\n mainWindow.open(url, '_blank', 'noopener');\n}\nexport function animate(targetWindow, fn) {\n const step = () => {\n fn();\n stepDisposable = scheduleAtNextAnimationFrame(targetWindow, step);\n };\n let stepDisposable = scheduleAtNextAnimationFrame(targetWindow, step);\n return toDisposable(() => stepDisposable.dispose());\n}\nRemoteAuthorities.setPreferredWebSchema(/^https:/.test(mainWindow.location.href) ? 'https' : 'http');\n/**\n * returns url('...')\n */\nexport function asCSSUrl(uri) {\n if (!uri) {\n return `url('')`;\n }\n return `url('${FileAccess.uriToBrowserUri(uri).toString(true).replace(/'/g, '%27')}')`;\n}\nexport function asCSSPropertyValue(value) {\n return `'${value.replace(/'/g, '%27')}'`;\n}\nexport function asCssValueWithDefault(cssPropertyValue, dflt) {\n if (cssPropertyValue !== undefined) {\n const variableMatch = cssPropertyValue.match(/^\\s*var\\((.+)\\)$/);\n if (variableMatch) {\n const varArguments = variableMatch[1].split(',', 2);\n if (varArguments.length === 2) {\n dflt = asCssValueWithDefault(varArguments[1].trim(), dflt);\n }\n return `var(${varArguments[0]}, ${dflt})`;\n }\n return cssPropertyValue;\n }\n return dflt;\n}\n// -- sanitize and trusted html\n/**\n * Hooks dompurify using `afterSanitizeAttributes` to check that all `href` and `src`\n * attributes are valid.\n */\nexport function hookDomPurifyHrefAndSrcSanitizer(allowedProtocols, allowDataImages = false) {\n // https://github.com/cure53/DOMPurify/blob/main/demos/hooks-scheme-allowlist.html\n // build an anchor to map URLs to\n const anchor = document.createElement('a');\n dompurify.addHook('afterSanitizeAttributes', (node) => {\n // check all href/src attributes for validity\n for (const attr of ['href', 'src']) {\n if (node.hasAttribute(attr)) {\n const attrValue = node.getAttribute(attr);\n if (attr === 'href' && attrValue.startsWith('#')) {\n // Allow fragment links\n continue;\n }\n anchor.href = attrValue;\n if (!allowedProtocols.includes(anchor.protocol.replace(/:$/, ''))) {\n if (allowDataImages && attr === 'src' && anchor.href.startsWith('data:')) {\n continue;\n }\n node.removeAttribute(attr);\n }\n }\n }\n });\n return toDisposable(() => {\n dompurify.removeHook('afterSanitizeAttributes');\n });\n}\n/**\n * List of safe, non-input html tags.\n */\nexport const basicMarkupHtmlTags = Object.freeze([\n 'a',\n 'abbr',\n 'b',\n 'bdo',\n 'blockquote',\n 'br',\n 'caption',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'figcaption',\n 'figure',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'hr',\n 'i',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'li',\n 'mark',\n 'ol',\n 'p',\n 'pre',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 'samp',\n 'small',\n 'small',\n 'source',\n 'span',\n 'strike',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'video',\n 'wbr',\n]);\nconst defaultDomPurifyConfig = Object.freeze({\n ALLOWED_TAGS: ['a', 'button', 'blockquote', 'code', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'input', 'label', 'li', 'p', 'pre', 'select', 'small', 'span', 'strong', 'textarea', 'ul', 'ol'],\n ALLOWED_ATTR: ['href', 'data-href', 'data-command', 'target', 'title', 'name', 'src', 'alt', 'class', 'id', 'role', 'tabindex', 'style', 'data-code', 'width', 'height', 'align', 'x-dispatch', 'required', 'checked', 'placeholder', 'type', 'start'],\n RETURN_DOM: false,\n RETURN_DOM_FRAGMENT: false,\n RETURN_TRUSTED_TYPE: true\n});\nexport class ModifierKeyEmitter extends event.Emitter {\n constructor() {\n super();\n this._subscriptions = new DisposableStore();\n this._keyStatus = {\n altKey: false,\n shiftKey: false,\n ctrlKey: false,\n metaKey: false\n };\n this._subscriptions.add(event.Event.runAndSubscribe(onDidRegisterWindow, ({ window, disposables }) => this.registerListeners(window, disposables), { window: mainWindow, disposables: this._subscriptions }));\n }\n registerListeners(window, disposables) {\n disposables.add(addDisposableListener(window, 'keydown', e => {\n if (e.defaultPrevented) {\n return;\n }\n const event = new StandardKeyboardEvent(e);\n // If Alt-key keydown event is repeated, ignore it #112347\n // Only known to be necessary for Alt-Key at the moment #115810\n if (event.keyCode === 6 /* KeyCode.Alt */ && e.repeat) {\n return;\n }\n if (e.altKey && !this._keyStatus.altKey) {\n this._keyStatus.lastKeyPressed = 'alt';\n }\n else if (e.ctrlKey && !this._keyStatus.ctrlKey) {\n this._keyStatus.lastKeyPressed = 'ctrl';\n }\n else if (e.metaKey && !this._keyStatus.metaKey) {\n this._keyStatus.lastKeyPressed = 'meta';\n }\n else if (e.shiftKey && !this._keyStatus.shiftKey) {\n this._keyStatus.lastKeyPressed = 'shift';\n }\n else if (event.keyCode !== 6 /* KeyCode.Alt */) {\n this._keyStatus.lastKeyPressed = undefined;\n }\n else {\n return;\n }\n this._keyStatus.altKey = e.altKey;\n this._keyStatus.ctrlKey = e.ctrlKey;\n this._keyStatus.metaKey = e.metaKey;\n this._keyStatus.shiftKey = e.shiftKey;\n if (this._keyStatus.lastKeyPressed) {\n this._keyStatus.event = e;\n this.fire(this._keyStatus);\n }\n }, true));\n disposables.add(addDisposableListener(window, 'keyup', e => {\n if (e.defaultPrevented) {\n return;\n }\n if (!e.altKey && this._keyStatus.altKey) {\n this._keyStatus.lastKeyReleased = 'alt';\n }\n else if (!e.ctrlKey && this._keyStatus.ctrlKey) {\n this._keyStatus.lastKeyReleased = 'ctrl';\n }\n else if (!e.metaKey && this._keyStatus.metaKey) {\n this._keyStatus.lastKeyReleased = 'meta';\n }\n else if (!e.shiftKey && this._keyStatus.shiftKey) {\n this._keyStatus.lastKeyReleased = 'shift';\n }\n else {\n this._keyStatus.lastKeyReleased = undefined;\n }\n if (this._keyStatus.lastKeyPressed !== this._keyStatus.lastKeyReleased) {\n this._keyStatus.lastKeyPressed = undefined;\n }\n this._keyStatus.altKey = e.altKey;\n this._keyStatus.ctrlKey = e.ctrlKey;\n this._keyStatus.metaKey = e.metaKey;\n this._keyStatus.shiftKey = e.shiftKey;\n if (this._keyStatus.lastKeyReleased) {\n this._keyStatus.event = e;\n this.fire(this._keyStatus);\n }\n }, true));\n disposables.add(addDisposableListener(window.document.body, 'mousedown', () => {\n this._keyStatus.lastKeyPressed = undefined;\n }, true));\n disposables.add(addDisposableListener(window.document.body, 'mouseup', () => {\n this._keyStatus.lastKeyPressed = undefined;\n }, true));\n disposables.add(addDisposableListener(window.document.body, 'mousemove', e => {\n if (e.buttons) {\n this._keyStatus.lastKeyPressed = undefined;\n }\n }, true));\n disposables.add(addDisposableListener(window, 'blur', () => {\n this.resetKeyStatus();\n }));\n }\n get keyStatus() {\n return this._keyStatus;\n }\n /**\n * Allows to explicitly reset the key status based on more knowledge (#109062)\n */\n resetKeyStatus() {\n this.doResetKeyStatus();\n this.fire(this._keyStatus);\n }\n doResetKeyStatus() {\n this._keyStatus = {\n altKey: false,\n shiftKey: false,\n ctrlKey: false,\n metaKey: false\n };\n }\n static getInstance() {\n if (!ModifierKeyEmitter.instance) {\n ModifierKeyEmitter.instance = new ModifierKeyEmitter();\n }\n return ModifierKeyEmitter.instance;\n }\n dispose() {\n super.dispose();\n this._subscriptions.dispose();\n }\n}\nexport class DragAndDropObserver extends Disposable {\n constructor(element, callbacks) {\n super();\n this.element = element;\n this.callbacks = callbacks;\n // A helper to fix issues with repeated DRAG_ENTER / DRAG_LEAVE\n // calls see https://github.com/microsoft/vscode/issues/14470\n // when the element has child elements where the events are fired\n // repeadedly.\n this.counter = 0;\n // Allows to measure the duration of the drag operation.\n this.dragStartTime = 0;\n this.registerListeners();\n }\n registerListeners() {\n if (this.callbacks.onDragStart) {\n this._register(addDisposableListener(this.element, EventType.DRAG_START, (e) => {\n var _a, _b;\n (_b = (_a = this.callbacks).onDragStart) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n }));\n }\n if (this.callbacks.onDrag) {\n this._register(addDisposableListener(this.element, EventType.DRAG, (e) => {\n var _a, _b;\n (_b = (_a = this.callbacks).onDrag) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n }));\n }\n this._register(addDisposableListener(this.element, EventType.DRAG_ENTER, (e) => {\n var _a, _b;\n this.counter++;\n this.dragStartTime = e.timeStamp;\n (_b = (_a = this.callbacks).onDragEnter) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n }));\n this._register(addDisposableListener(this.element, EventType.DRAG_OVER, (e) => {\n var _a, _b;\n e.preventDefault(); // needed so that the drop event fires (https://stackoverflow.com/questions/21339924/drop-event-not-firing-in-chrome)\n (_b = (_a = this.callbacks).onDragOver) === null || _b === void 0 ? void 0 : _b.call(_a, e, e.timeStamp - this.dragStartTime);\n }));\n this._register(addDisposableListener(this.element, EventType.DRAG_LEAVE, (e) => {\n var _a, _b;\n this.counter--;\n if (this.counter === 0) {\n this.dragStartTime = 0;\n (_b = (_a = this.callbacks).onDragLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n }\n }));\n this._register(addDisposableListener(this.element, EventType.DRAG_END, (e) => {\n var _a, _b;\n this.counter = 0;\n this.dragStartTime = 0;\n (_b = (_a = this.callbacks).onDragEnd) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n }));\n this._register(addDisposableListener(this.element, EventType.DROP, (e) => {\n var _a, _b;\n this.counter = 0;\n this.dragStartTime = 0;\n (_b = (_a = this.callbacks).onDrop) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n }));\n }\n}\nconst H_REGEX = /(?[\\w\\-]+)?(?:#(?[\\w\\-]+))?(?(?:\\.(?:[\\w\\-]+))*)(?:@(?(?:[\\w\\_])+))?/;\nexport function h(tag, ...args) {\n let attributes;\n let children;\n if (Array.isArray(args[0])) {\n attributes = {};\n children = args[0];\n }\n else {\n attributes = args[0] || {};\n children = args[1];\n }\n const match = H_REGEX.exec(tag);\n if (!match || !match.groups) {\n throw new Error('Bad use of h');\n }\n const tagName = match.groups['tag'] || 'div';\n const el = document.createElement(tagName);\n if (match.groups['id']) {\n el.id = match.groups['id'];\n }\n const classNames = [];\n if (match.groups['class']) {\n for (const className of match.groups['class'].split('.')) {\n if (className !== '') {\n classNames.push(className);\n }\n }\n }\n if (attributes.className !== undefined) {\n for (const className of attributes.className.split('.')) {\n if (className !== '') {\n classNames.push(className);\n }\n }\n }\n if (classNames.length > 0) {\n el.className = classNames.join(' ');\n }\n const result = {};\n if (match.groups['name']) {\n result[match.groups['name']] = el;\n }\n if (children) {\n for (const c of children) {\n if (c instanceof HTMLElement) {\n el.appendChild(c);\n }\n else if (typeof c === 'string') {\n el.append(c);\n }\n else if ('root' in c) {\n Object.assign(result, c);\n el.appendChild(c.root);\n }\n }\n }\n for (const [key, value] of Object.entries(attributes)) {\n if (key === 'className') {\n continue;\n }\n else if (key === 'style') {\n for (const [cssKey, cssValue] of Object.entries(value)) {\n el.style.setProperty(camelCaseToHyphenCase(cssKey), typeof cssValue === 'number' ? cssValue + 'px' : '' + cssValue);\n }\n }\n else if (key === 'tabIndex') {\n el.tabIndex = value;\n }\n else {\n el.setAttribute(camelCaseToHyphenCase(key), value.toString());\n }\n }\n result['root'] = el;\n return result;\n}\nfunction camelCaseToHyphenCase(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as nls from '../../nls.js';\nimport { URI } from '../../base/common/uri.js';\nimport { ICodeEditorService } from './services/codeEditorService.js';\nimport { Position } from '../common/core/position.js';\nimport { IModelService } from '../common/services/model.js';\nimport { ITextModelService } from '../common/services/resolverService.js';\nimport { MenuId, MenuRegistry, Action2 } from '../../platform/actions/common/actions.js';\nimport { CommandsRegistry } from '../../platform/commands/common/commands.js';\nimport { ContextKeyExpr, IContextKeyService } from '../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../platform/instantiation/common/instantiation.js';\nimport { KeybindingsRegistry } from '../../platform/keybinding/common/keybindingsRegistry.js';\nimport { Registry } from '../../platform/registry/common/platform.js';\nimport { ITelemetryService } from '../../platform/telemetry/common/telemetry.js';\nimport { assertType } from '../../base/common/types.js';\nimport { ILogService } from '../../platform/log/common/log.js';\nimport { getActiveElement } from '../../base/browser/dom.js';\nexport class Command {\n constructor(opts) {\n this.id = opts.id;\n this.precondition = opts.precondition;\n this._kbOpts = opts.kbOpts;\n this._menuOpts = opts.menuOpts;\n this.metadata = opts.metadata;\n }\n register() {\n if (Array.isArray(this._menuOpts)) {\n this._menuOpts.forEach(this._registerMenuItem, this);\n }\n else if (this._menuOpts) {\n this._registerMenuItem(this._menuOpts);\n }\n if (this._kbOpts) {\n const kbOptsArr = Array.isArray(this._kbOpts) ? this._kbOpts : [this._kbOpts];\n for (const kbOpts of kbOptsArr) {\n let kbWhen = kbOpts.kbExpr;\n if (this.precondition) {\n if (kbWhen) {\n kbWhen = ContextKeyExpr.and(kbWhen, this.precondition);\n }\n else {\n kbWhen = this.precondition;\n }\n }\n const desc = {\n id: this.id,\n weight: kbOpts.weight,\n args: kbOpts.args,\n when: kbWhen,\n primary: kbOpts.primary,\n secondary: kbOpts.secondary,\n win: kbOpts.win,\n linux: kbOpts.linux,\n mac: kbOpts.mac,\n };\n KeybindingsRegistry.registerKeybindingRule(desc);\n }\n }\n CommandsRegistry.registerCommand({\n id: this.id,\n handler: (accessor, args) => this.runCommand(accessor, args),\n metadata: this.metadata\n });\n }\n _registerMenuItem(item) {\n MenuRegistry.appendMenuItem(item.menuId, {\n group: item.group,\n command: {\n id: this.id,\n title: item.title,\n icon: item.icon,\n precondition: this.precondition\n },\n when: item.when,\n order: item.order\n });\n }\n}\nexport class MultiCommand extends Command {\n constructor() {\n super(...arguments);\n this._implementations = [];\n }\n /**\n * A higher priority gets to be looked at first\n */\n addImplementation(priority, name, implementation, when) {\n this._implementations.push({ priority, name, implementation, when });\n this._implementations.sort((a, b) => b.priority - a.priority);\n return {\n dispose: () => {\n for (let i = 0; i < this._implementations.length; i++) {\n if (this._implementations[i].implementation === implementation) {\n this._implementations.splice(i, 1);\n return;\n }\n }\n }\n };\n }\n runCommand(accessor, args) {\n const logService = accessor.get(ILogService);\n const contextKeyService = accessor.get(IContextKeyService);\n logService.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);\n for (const impl of this._implementations) {\n if (impl.when) {\n const context = contextKeyService.getContext(getActiveElement());\n const value = impl.when.evaluate(context);\n if (!value) {\n continue;\n }\n }\n const result = impl.implementation(accessor, args);\n if (result) {\n logService.trace(`Command '${this.id}' was handled by '${impl.name}'.`);\n if (typeof result === 'boolean') {\n return;\n }\n return result;\n }\n }\n logService.trace(`The Command '${this.id}' was not handled by any implementation.`);\n }\n}\n//#endregion\n/**\n * A command that delegates to another command's implementation.\n *\n * This lets different commands be registered but share the same implementation\n */\nexport class ProxyCommand extends Command {\n constructor(command, opts) {\n super(opts);\n this.command = command;\n }\n runCommand(accessor, args) {\n return this.command.runCommand(accessor, args);\n }\n}\nexport class EditorCommand extends Command {\n /**\n * Create a command class that is bound to a certain editor contribution.\n */\n static bindToContribution(controllerGetter) {\n return class EditorControllerCommandImpl extends EditorCommand {\n constructor(opts) {\n super(opts);\n this._callback = opts.handler;\n }\n runEditorCommand(accessor, editor, args) {\n const controller = controllerGetter(editor);\n if (controller) {\n this._callback(controller, args);\n }\n }\n };\n }\n static runEditorCommand(accessor, args, precondition, runner) {\n const codeEditorService = accessor.get(ICodeEditorService);\n // Find the editor with text focus or active\n const editor = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor();\n if (!editor) {\n // well, at least we tried...\n return;\n }\n return editor.invokeWithinContext((editorAccessor) => {\n const kbService = editorAccessor.get(IContextKeyService);\n if (!kbService.contextMatchesRules(precondition !== null && precondition !== void 0 ? precondition : undefined)) {\n // precondition does not hold\n return;\n }\n return runner(editorAccessor, editor, args);\n });\n }\n runCommand(accessor, args) {\n return EditorCommand.runEditorCommand(accessor, args, this.precondition, (accessor, editor, args) => this.runEditorCommand(accessor, editor, args));\n }\n}\nexport class EditorAction extends EditorCommand {\n static convertOptions(opts) {\n let menuOpts;\n if (Array.isArray(opts.menuOpts)) {\n menuOpts = opts.menuOpts;\n }\n else if (opts.menuOpts) {\n menuOpts = [opts.menuOpts];\n }\n else {\n menuOpts = [];\n }\n function withDefaults(item) {\n if (!item.menuId) {\n item.menuId = MenuId.EditorContext;\n }\n if (!item.title) {\n item.title = opts.label;\n }\n item.when = ContextKeyExpr.and(opts.precondition, item.when);\n return item;\n }\n if (Array.isArray(opts.contextMenuOpts)) {\n menuOpts.push(...opts.contextMenuOpts.map(withDefaults));\n }\n else if (opts.contextMenuOpts) {\n menuOpts.push(withDefaults(opts.contextMenuOpts));\n }\n opts.menuOpts = menuOpts;\n return opts;\n }\n constructor(opts) {\n super(EditorAction.convertOptions(opts));\n this.label = opts.label;\n this.alias = opts.alias;\n }\n runEditorCommand(accessor, editor, args) {\n this.reportTelemetry(accessor, editor);\n return this.run(accessor, editor, args || {});\n }\n reportTelemetry(accessor, editor) {\n accessor.get(ITelemetryService).publicLog2('editorActionInvoked', { name: this.label, id: this.id });\n }\n}\nexport class MultiEditorAction extends EditorAction {\n constructor() {\n super(...arguments);\n this._implementations = [];\n }\n /**\n * A higher priority gets to be looked at first\n */\n addImplementation(priority, implementation) {\n this._implementations.push([priority, implementation]);\n this._implementations.sort((a, b) => b[0] - a[0]);\n return {\n dispose: () => {\n for (let i = 0; i < this._implementations.length; i++) {\n if (this._implementations[i][1] === implementation) {\n this._implementations.splice(i, 1);\n return;\n }\n }\n }\n };\n }\n run(accessor, editor, args) {\n for (const impl of this._implementations) {\n const result = impl[1](accessor, editor, args);\n if (result) {\n if (typeof result === 'boolean') {\n return;\n }\n return result;\n }\n }\n }\n}\n//#endregion EditorAction\n//#region EditorAction2\nexport class EditorAction2 extends Action2 {\n run(accessor, ...args) {\n // Find the editor with text focus or active\n const codeEditorService = accessor.get(ICodeEditorService);\n const editor = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor();\n if (!editor) {\n // well, at least we tried...\n return;\n }\n // precondition does hold\n return editor.invokeWithinContext((editorAccessor) => {\n var _a, _b;\n const kbService = editorAccessor.get(IContextKeyService);\n const logService = editorAccessor.get(ILogService);\n const enabled = kbService.contextMatchesRules((_a = this.desc.precondition) !== null && _a !== void 0 ? _a : undefined);\n if (!enabled) {\n logService.debug(`[EditorAction2] NOT running command because its precondition is FALSE`, this.desc.id, (_b = this.desc.precondition) === null || _b === void 0 ? void 0 : _b.serialize());\n return;\n }\n return this.runEditorCommand(editorAccessor, editor, ...args);\n });\n }\n}\n//#endregion\n// --- Registration of commands and actions\nexport function registerModelAndPositionCommand(id, handler) {\n CommandsRegistry.registerCommand(id, function (accessor, ...args) {\n const instaService = accessor.get(IInstantiationService);\n const [resource, position] = args;\n assertType(URI.isUri(resource));\n assertType(Position.isIPosition(position));\n const model = accessor.get(IModelService).getModel(resource);\n if (model) {\n const editorPosition = Position.lift(position);\n return instaService.invokeFunction(handler, model, editorPosition, ...args.slice(2));\n }\n return accessor.get(ITextModelService).createModelReference(resource).then(reference => {\n return new Promise((resolve, reject) => {\n try {\n const result = instaService.invokeFunction(handler, reference.object.textEditorModel, Position.lift(position), args.slice(2));\n resolve(result);\n }\n catch (err) {\n reject(err);\n }\n }).finally(() => {\n reference.dispose();\n });\n });\n });\n}\nexport function registerEditorCommand(editorCommand) {\n EditorContributionRegistry.INSTANCE.registerEditorCommand(editorCommand);\n return editorCommand;\n}\nexport function registerEditorAction(ctor) {\n const action = new ctor();\n EditorContributionRegistry.INSTANCE.registerEditorAction(action);\n return action;\n}\nexport function registerMultiEditorAction(action) {\n EditorContributionRegistry.INSTANCE.registerEditorAction(action);\n return action;\n}\nexport function registerInstantiatedEditorAction(editorAction) {\n EditorContributionRegistry.INSTANCE.registerEditorAction(editorAction);\n}\n/**\n * Registers an editor contribution. Editor contributions have a lifecycle which is bound\n * to a specific code editor instance.\n */\nexport function registerEditorContribution(id, ctor, instantiation) {\n EditorContributionRegistry.INSTANCE.registerEditorContribution(id, ctor, instantiation);\n}\nexport var EditorExtensionsRegistry;\n(function (EditorExtensionsRegistry) {\n function getEditorCommand(commandId) {\n return EditorContributionRegistry.INSTANCE.getEditorCommand(commandId);\n }\n EditorExtensionsRegistry.getEditorCommand = getEditorCommand;\n function getEditorActions() {\n return EditorContributionRegistry.INSTANCE.getEditorActions();\n }\n EditorExtensionsRegistry.getEditorActions = getEditorActions;\n function getEditorContributions() {\n return EditorContributionRegistry.INSTANCE.getEditorContributions();\n }\n EditorExtensionsRegistry.getEditorContributions = getEditorContributions;\n function getSomeEditorContributions(ids) {\n return EditorContributionRegistry.INSTANCE.getEditorContributions().filter(c => ids.indexOf(c.id) >= 0);\n }\n EditorExtensionsRegistry.getSomeEditorContributions = getSomeEditorContributions;\n function getDiffEditorContributions() {\n return EditorContributionRegistry.INSTANCE.getDiffEditorContributions();\n }\n EditorExtensionsRegistry.getDiffEditorContributions = getDiffEditorContributions;\n})(EditorExtensionsRegistry || (EditorExtensionsRegistry = {}));\n// Editor extension points\nconst Extensions = {\n EditorCommonContributions: 'editor.contributions'\n};\nclass EditorContributionRegistry {\n constructor() {\n this.editorContributions = [];\n this.diffEditorContributions = [];\n this.editorActions = [];\n this.editorCommands = Object.create(null);\n }\n registerEditorContribution(id, ctor, instantiation) {\n this.editorContributions.push({ id, ctor: ctor, instantiation });\n }\n getEditorContributions() {\n return this.editorContributions.slice(0);\n }\n getDiffEditorContributions() {\n return this.diffEditorContributions.slice(0);\n }\n registerEditorAction(action) {\n action.register();\n this.editorActions.push(action);\n }\n getEditorActions() {\n return this.editorActions;\n }\n registerEditorCommand(editorCommand) {\n editorCommand.register();\n this.editorCommands[editorCommand.id] = editorCommand;\n }\n getEditorCommand(commandId) {\n return (this.editorCommands[commandId] || null);\n }\n}\nEditorContributionRegistry.INSTANCE = new EditorContributionRegistry();\nRegistry.add(Extensions.EditorCommonContributions, EditorContributionRegistry.INSTANCE);\nfunction registerCommand(command) {\n command.register();\n return command;\n}\nexport const UndoCommand = registerCommand(new MultiCommand({\n id: 'undo',\n precondition: undefined,\n kbOpts: {\n weight: 0 /* KeybindingWeight.EditorCore */,\n primary: 2048 /* KeyMod.CtrlCmd */ | 56 /* KeyCode.KeyZ */\n },\n menuOpts: [{\n menuId: MenuId.MenubarEditMenu,\n group: '1_do',\n title: nls.localize({ key: 'miUndo', comment: ['&& denotes a mnemonic'] }, \"&&Undo\"),\n order: 1\n }, {\n menuId: MenuId.CommandPalette,\n group: '',\n title: nls.localize('undo', \"Undo\"),\n order: 1\n }]\n}));\nregisterCommand(new ProxyCommand(UndoCommand, { id: 'default:undo', precondition: undefined }));\nexport const RedoCommand = registerCommand(new MultiCommand({\n id: 'redo',\n precondition: undefined,\n kbOpts: {\n weight: 0 /* KeybindingWeight.EditorCore */,\n primary: 2048 /* KeyMod.CtrlCmd */ | 55 /* KeyCode.KeyY */,\n secondary: [2048 /* KeyMod.CtrlCmd */ | 1024 /* KeyMod.Shift */ | 56 /* KeyCode.KeyZ */],\n mac: { primary: 2048 /* KeyMod.CtrlCmd */ | 1024 /* KeyMod.Shift */ | 56 /* KeyCode.KeyZ */ }\n },\n menuOpts: [{\n menuId: MenuId.MenubarEditMenu,\n group: '1_do',\n title: nls.localize({ key: 'miRedo', comment: ['&& denotes a mnemonic'] }, \"&&Redo\"),\n order: 2\n }, {\n menuId: MenuId.CommandPalette,\n group: '',\n title: nls.localize('redo', \"Redo\"),\n order: 1\n }]\n}));\nregisterCommand(new ProxyCommand(RedoCommand, { id: 'default:redo', precondition: undefined }));\nexport const SelectAllCommand = registerCommand(new MultiCommand({\n id: 'editor.action.selectAll',\n precondition: undefined,\n kbOpts: {\n weight: 0 /* KeybindingWeight.EditorCore */,\n kbExpr: null,\n primary: 2048 /* KeyMod.CtrlCmd */ | 31 /* KeyCode.KeyA */\n },\n menuOpts: [{\n menuId: MenuId.MenubarSelectionMenu,\n group: '1_basic',\n title: nls.localize({ key: 'miSelectAll', comment: ['&& denotes a mnemonic'] }, \"&&Select All\"),\n order: 1\n }, {\n menuId: MenuId.CommandPalette,\n group: '',\n title: nls.localize('selectAll', \"Select All\"),\n order: 1\n }]\n}));\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { transformErrorForSerialization } from '../errors.js';\nimport { Emitter } from '../event.js';\nimport { Disposable } from '../lifecycle.js';\nimport { getAllMethodNames } from '../objects.js';\nimport { isWeb } from '../platform.js';\nimport * as strings from '../strings.js';\nconst INITIALIZE = '$initialize';\nlet webWorkerWarningLogged = false;\nexport function logOnceWebWorkerWarning(err) {\n if (!isWeb) {\n // running tests\n return;\n }\n if (!webWorkerWarningLogged) {\n webWorkerWarningLogged = true;\n 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');\n }\n console.warn(err.message);\n}\nclass RequestMessage {\n constructor(vsWorker, req, method, args) {\n this.vsWorker = vsWorker;\n this.req = req;\n this.method = method;\n this.args = args;\n this.type = 0 /* MessageType.Request */;\n }\n}\nclass ReplyMessage {\n constructor(vsWorker, seq, res, err) {\n this.vsWorker = vsWorker;\n this.seq = seq;\n this.res = res;\n this.err = err;\n this.type = 1 /* MessageType.Reply */;\n }\n}\nclass SubscribeEventMessage {\n constructor(vsWorker, req, eventName, arg) {\n this.vsWorker = vsWorker;\n this.req = req;\n this.eventName = eventName;\n this.arg = arg;\n this.type = 2 /* MessageType.SubscribeEvent */;\n }\n}\nclass EventMessage {\n constructor(vsWorker, req, event) {\n this.vsWorker = vsWorker;\n this.req = req;\n this.event = event;\n this.type = 3 /* MessageType.Event */;\n }\n}\nclass UnsubscribeEventMessage {\n constructor(vsWorker, req) {\n this.vsWorker = vsWorker;\n this.req = req;\n this.type = 4 /* MessageType.UnsubscribeEvent */;\n }\n}\nclass SimpleWorkerProtocol {\n constructor(handler) {\n this._workerId = -1;\n this._handler = handler;\n this._lastSentReq = 0;\n this._pendingReplies = Object.create(null);\n this._pendingEmitters = new Map();\n this._pendingEvents = new Map();\n }\n setWorkerId(workerId) {\n this._workerId = workerId;\n }\n sendMessage(method, args) {\n const req = String(++this._lastSentReq);\n return new Promise((resolve, reject) => {\n this._pendingReplies[req] = {\n resolve: resolve,\n reject: reject\n };\n this._send(new RequestMessage(this._workerId, req, method, args));\n });\n }\n listen(eventName, arg) {\n let req = null;\n const emitter = new Emitter({\n onWillAddFirstListener: () => {\n req = String(++this._lastSentReq);\n this._pendingEmitters.set(req, emitter);\n this._send(new SubscribeEventMessage(this._workerId, req, eventName, arg));\n },\n onDidRemoveLastListener: () => {\n this._pendingEmitters.delete(req);\n this._send(new UnsubscribeEventMessage(this._workerId, req));\n req = null;\n }\n });\n return emitter.event;\n }\n handleMessage(message) {\n if (!message || !message.vsWorker) {\n return;\n }\n if (this._workerId !== -1 && message.vsWorker !== this._workerId) {\n return;\n }\n this._handleMessage(message);\n }\n _handleMessage(msg) {\n switch (msg.type) {\n case 1 /* MessageType.Reply */:\n return this._handleReplyMessage(msg);\n case 0 /* MessageType.Request */:\n return this._handleRequestMessage(msg);\n case 2 /* MessageType.SubscribeEvent */:\n return this._handleSubscribeEventMessage(msg);\n case 3 /* MessageType.Event */:\n return this._handleEventMessage(msg);\n case 4 /* MessageType.UnsubscribeEvent */:\n return this._handleUnsubscribeEventMessage(msg);\n }\n }\n _handleReplyMessage(replyMessage) {\n if (!this._pendingReplies[replyMessage.seq]) {\n console.warn('Got reply to unknown seq');\n return;\n }\n const reply = this._pendingReplies[replyMessage.seq];\n delete this._pendingReplies[replyMessage.seq];\n if (replyMessage.err) {\n let err = replyMessage.err;\n if (replyMessage.err.$isError) {\n err = new Error();\n err.name = replyMessage.err.name;\n err.message = replyMessage.err.message;\n err.stack = replyMessage.err.stack;\n }\n reply.reject(err);\n return;\n }\n reply.resolve(replyMessage.res);\n }\n _handleRequestMessage(requestMessage) {\n const req = requestMessage.req;\n const result = this._handler.handleMessage(requestMessage.method, requestMessage.args);\n result.then((r) => {\n this._send(new ReplyMessage(this._workerId, req, r, undefined));\n }, (e) => {\n if (e.detail instanceof Error) {\n // Loading errors have a detail property that points to the actual error\n e.detail = transformErrorForSerialization(e.detail);\n }\n this._send(new ReplyMessage(this._workerId, req, undefined, transformErrorForSerialization(e)));\n });\n }\n _handleSubscribeEventMessage(msg) {\n const req = msg.req;\n const disposable = this._handler.handleEvent(msg.eventName, msg.arg)((event) => {\n this._send(new EventMessage(this._workerId, req, event));\n });\n this._pendingEvents.set(req, disposable);\n }\n _handleEventMessage(msg) {\n if (!this._pendingEmitters.has(msg.req)) {\n console.warn('Got event for unknown req');\n return;\n }\n this._pendingEmitters.get(msg.req).fire(msg.event);\n }\n _handleUnsubscribeEventMessage(msg) {\n if (!this._pendingEvents.has(msg.req)) {\n console.warn('Got unsubscribe for unknown req');\n return;\n }\n this._pendingEvents.get(msg.req).dispose();\n this._pendingEvents.delete(msg.req);\n }\n _send(msg) {\n const transfer = [];\n if (msg.type === 0 /* MessageType.Request */) {\n for (let i = 0; i < msg.args.length; i++) {\n if (msg.args[i] instanceof ArrayBuffer) {\n transfer.push(msg.args[i]);\n }\n }\n }\n else if (msg.type === 1 /* MessageType.Reply */) {\n if (msg.res instanceof ArrayBuffer) {\n transfer.push(msg.res);\n }\n }\n this._handler.sendMessage(msg, transfer);\n }\n}\n/**\n * Main thread side\n */\nexport class SimpleWorkerClient extends Disposable {\n constructor(workerFactory, moduleId, host) {\n super();\n let lazyProxyReject = null;\n this._worker = this._register(workerFactory.create('vs/base/common/worker/simpleWorker', (msg) => {\n this._protocol.handleMessage(msg);\n }, (err) => {\n // in Firefox, web workers fail lazily :(\n // we will reject the proxy\n lazyProxyReject === null || lazyProxyReject === void 0 ? void 0 : lazyProxyReject(err);\n }));\n this._protocol = new SimpleWorkerProtocol({\n sendMessage: (msg, transfer) => {\n this._worker.postMessage(msg, transfer);\n },\n handleMessage: (method, args) => {\n if (typeof host[method] !== 'function') {\n return Promise.reject(new Error('Missing method ' + method + ' on main thread host.'));\n }\n try {\n return Promise.resolve(host[method].apply(host, args));\n }\n catch (e) {\n return Promise.reject(e);\n }\n },\n handleEvent: (eventName, arg) => {\n if (propertyIsDynamicEvent(eventName)) {\n const event = host[eventName].call(host, arg);\n if (typeof event !== 'function') {\n throw new Error(`Missing dynamic event ${eventName} on main thread host.`);\n }\n return event;\n }\n if (propertyIsEvent(eventName)) {\n const event = host[eventName];\n if (typeof event !== 'function') {\n throw new Error(`Missing event ${eventName} on main thread host.`);\n }\n return event;\n }\n throw new Error(`Malformed event name ${eventName}`);\n }\n });\n this._protocol.setWorkerId(this._worker.getId());\n // Gather loader configuration\n let loaderConfiguration = null;\n const globalRequire = globalThis.require;\n if (typeof globalRequire !== 'undefined' && typeof globalRequire.getConfig === 'function') {\n // Get the configuration from the Monaco AMD Loader\n loaderConfiguration = globalRequire.getConfig();\n }\n else if (typeof globalThis.requirejs !== 'undefined') {\n // Get the configuration from requirejs\n loaderConfiguration = globalThis.requirejs.s.contexts._.config;\n }\n const hostMethods = getAllMethodNames(host);\n // Send initialize message\n this._onModuleLoaded = this._protocol.sendMessage(INITIALIZE, [\n this._worker.getId(),\n JSON.parse(JSON.stringify(loaderConfiguration)),\n moduleId,\n hostMethods,\n ]);\n // Create proxy to loaded code\n const proxyMethodRequest = (method, args) => {\n return this._request(method, args);\n };\n const proxyListen = (eventName, arg) => {\n return this._protocol.listen(eventName, arg);\n };\n this._lazyProxy = new Promise((resolve, reject) => {\n lazyProxyReject = reject;\n this._onModuleLoaded.then((availableMethods) => {\n resolve(createProxyObject(availableMethods, proxyMethodRequest, proxyListen));\n }, (e) => {\n reject(e);\n this._onError('Worker failed to load ' + moduleId, e);\n });\n });\n }\n getProxyObject() {\n return this._lazyProxy;\n }\n _request(method, args) {\n return new Promise((resolve, reject) => {\n this._onModuleLoaded.then(() => {\n this._protocol.sendMessage(method, args).then(resolve, reject);\n }, reject);\n });\n }\n _onError(message, error) {\n console.error(message);\n console.info(error);\n }\n}\nfunction propertyIsEvent(name) {\n // Assume a property is an event if it has a form of \"onSomething\"\n return name[0] === 'o' && name[1] === 'n' && strings.isUpperAsciiLetter(name.charCodeAt(2));\n}\nfunction propertyIsDynamicEvent(name) {\n // Assume a property is a dynamic event (a method that returns an event) if it has a form of \"onDynamicSomething\"\n return /^onDynamic/.test(name) && strings.isUpperAsciiLetter(name.charCodeAt(9));\n}\nfunction createProxyObject(methodNames, invoke, proxyListen) {\n const createProxyMethod = (method) => {\n return function () {\n const args = Array.prototype.slice.call(arguments, 0);\n return invoke(method, args);\n };\n };\n const createProxyDynamicEvent = (eventName) => {\n return function (arg) {\n return proxyListen(eventName, arg);\n };\n };\n const result = {};\n for (const methodName of methodNames) {\n if (propertyIsDynamicEvent(methodName)) {\n result[methodName] = createProxyDynamicEvent(methodName);\n continue;\n }\n if (propertyIsEvent(methodName)) {\n result[methodName] = proxyListen(methodName, undefined);\n continue;\n }\n result[methodName] = createProxyMethod(methodName);\n }\n return result;\n}\n/**\n * Worker side\n */\nexport class SimpleWorkerServer {\n constructor(postMessage, requestHandlerFactory) {\n this._requestHandlerFactory = requestHandlerFactory;\n this._requestHandler = null;\n this._protocol = new SimpleWorkerProtocol({\n sendMessage: (msg, transfer) => {\n postMessage(msg, transfer);\n },\n handleMessage: (method, args) => this._handleMessage(method, args),\n handleEvent: (eventName, arg) => this._handleEvent(eventName, arg)\n });\n }\n onmessage(msg) {\n this._protocol.handleMessage(msg);\n }\n _handleMessage(method, args) {\n if (method === INITIALIZE) {\n return this.initialize(args[0], args[1], args[2], args[3]);\n }\n if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') {\n return Promise.reject(new Error('Missing requestHandler or method: ' + method));\n }\n try {\n return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args));\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n _handleEvent(eventName, arg) {\n if (!this._requestHandler) {\n throw new Error(`Missing requestHandler`);\n }\n if (propertyIsDynamicEvent(eventName)) {\n const event = this._requestHandler[eventName].call(this._requestHandler, arg);\n if (typeof event !== 'function') {\n throw new Error(`Missing dynamic event ${eventName} on request handler.`);\n }\n return event;\n }\n if (propertyIsEvent(eventName)) {\n const event = this._requestHandler[eventName];\n if (typeof event !== 'function') {\n throw new Error(`Missing event ${eventName} on request handler.`);\n }\n return event;\n }\n throw new Error(`Malformed event name ${eventName}`);\n }\n initialize(workerId, loaderConfig, moduleId, hostMethods) {\n this._protocol.setWorkerId(workerId);\n const proxyMethodRequest = (method, args) => {\n return this._protocol.sendMessage(method, args);\n };\n const proxyListen = (eventName, arg) => {\n return this._protocol.listen(eventName, arg);\n };\n const hostProxy = createProxyObject(hostMethods, proxyMethodRequest, proxyListen);\n if (this._requestHandlerFactory) {\n // static request handler\n this._requestHandler = this._requestHandlerFactory(hostProxy);\n return Promise.resolve(getAllMethodNames(this._requestHandler));\n }\n if (loaderConfig) {\n // Remove 'baseUrl', handling it is beyond scope for now\n if (typeof loaderConfig.baseUrl !== 'undefined') {\n delete loaderConfig['baseUrl'];\n }\n if (typeof loaderConfig.paths !== 'undefined') {\n if (typeof loaderConfig.paths.vs !== 'undefined') {\n delete loaderConfig.paths['vs'];\n }\n }\n if (typeof loaderConfig.trustedTypesPolicy !== 'undefined') {\n // don't use, it has been destroyed during serialize\n delete loaderConfig['trustedTypesPolicy'];\n }\n // Since this is in a web worker, enable catching errors\n loaderConfig.catchError = true;\n globalThis.require.config(loaderConfig);\n }\n return new Promise((resolve, reject) => {\n // Use the global require to be sure to get the global config\n // ESM-comment-begin\n // \t\t\tconst req = (globalThis.require || require);\n // ESM-comment-end\n // ESM-uncomment-begin\n const req = globalThis.require;\n // ESM-uncomment-end\n req([moduleId], (module) => {\n this._requestHandler = module.create(hostProxy);\n if (!this._requestHandler) {\n reject(new Error(`No RequestHandler!`));\n return;\n }\n resolve(getAllMethodNames(this._requestHandler));\n }, reject);\n });\n }\n}\n/**\n * Called on the worker side\n * @skipMangle\n */\nexport function create(postMessage) {\n return new SimpleWorkerServer(postMessage, null);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { mainWindow } from './window.js';\nimport { onUnexpectedError } from '../common/errors.js';\nexport function createTrustedTypesPolicy(policyName, policyOptions) {\n var _a;\n const monacoEnvironment = globalThis.MonacoEnvironment;\n if (monacoEnvironment === null || monacoEnvironment === void 0 ? void 0 : monacoEnvironment.createTrustedTypesPolicy) {\n try {\n return monacoEnvironment.createTrustedTypesPolicy(policyName, policyOptions);\n }\n catch (err) {\n onUnexpectedError(err);\n return undefined;\n }\n }\n try {\n return (_a = mainWindow.trustedTypes) === null || _a === void 0 ? void 0 : _a.createPolicy(policyName, policyOptions);\n }\n catch (err) {\n onUnexpectedError(err);\n return undefined;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { createTrustedTypesPolicy } from './trustedTypes.js';\nimport { onUnexpectedError } from '../common/errors.js';\nimport { logOnceWebWorkerWarning } from '../common/worker/simpleWorker.js';\nimport { Disposable, toDisposable } from '../common/lifecycle.js';\nconst ttPolicy = createTrustedTypesPolicy('defaultWorkerFactory', { createScriptURL: value => value });\nfunction getWorker(label) {\n const monacoEnvironment = globalThis.MonacoEnvironment;\n if (monacoEnvironment) {\n if (typeof monacoEnvironment.getWorker === 'function') {\n return monacoEnvironment.getWorker('workerMain.js', label);\n }\n if (typeof monacoEnvironment.getWorkerUrl === 'function') {\n const workerUrl = monacoEnvironment.getWorkerUrl('workerMain.js', label);\n return new Worker(ttPolicy ? ttPolicy.createScriptURL(workerUrl) : workerUrl, { name: label });\n }\n }\n // ESM-comment-begin\n // \tif (typeof require === 'function') {\n // \t\t// check if the JS lives on a different origin\n // \t\tconst workerMain = require.toUrl('vs/base/worker/workerMain.js'); // explicitly using require.toUrl(), see https://github.com/microsoft/vscode/issues/107440#issuecomment-698982321\n // \t\tconst workerUrl = getWorkerBootstrapUrl(workerMain, label);\n // \t\treturn new Worker(ttPolicy ? ttPolicy.createScriptURL(workerUrl) as unknown as string : workerUrl, { name: label });\n // \t}\n // ESM-comment-end\n throw new Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`);\n}\n// ESM-comment-begin\n// export function getWorkerBootstrapUrl(scriptPath: string, label: string): string {\n// \tif (/^((http:)|(https:)|(file:))/.test(scriptPath) && scriptPath.substring(0, globalThis.origin.length) !== globalThis.origin) {\n// \t\t// this is the cross-origin case\n// \t\t// i.e. the webpage is running at a different origin than where the scripts are loaded from\n// \t\tconst myPath = 'vs/base/worker/defaultWorkerFactory.js';\n// \t\tconst workerBaseUrl = require.toUrl(myPath).slice(0, -myPath.length); // explicitly using require.toUrl(), see https://github.com/microsoft/vscode/issues/107440#issuecomment-698982321\n// \t\tconst js = `/*${label}*/globalThis.MonacoEnvironment={baseUrl: '${workerBaseUrl}'};const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });importScripts(ttPolicy?.createScriptURL('${scriptPath}') ?? '${scriptPath}');/*${label}*/`;\n// \t\tconst blob = new Blob([js], { type: 'application/javascript' });\n// \t\treturn URL.createObjectURL(blob);\n// \t}\n// \n// \tconst start = scriptPath.lastIndexOf('?');\n// \tconst end = scriptPath.lastIndexOf('#', start);\n// \tconst params = start > 0\n// \t\t? new URLSearchParams(scriptPath.substring(start + 1, ~end ? end : undefined))\n// \t\t: new URLSearchParams();\n// \n// \tCOI.addSearchParam(params, true, true);\n// \tconst search = params.toString();\n// \n// \tif (!search) {\n// \t\treturn `${scriptPath}#${label}`;\n// \t} else {\n// \t\treturn `${scriptPath}?${params.toString()}#${label}`;\n// \t}\n// }\n// ESM-comment-end\nfunction isPromiseLike(obj) {\n if (typeof obj.then === 'function') {\n return true;\n }\n return false;\n}\n/**\n * A worker that uses HTML5 web workers so that is has\n * its own global scope and its own thread.\n */\nclass WebWorker extends Disposable {\n constructor(moduleId, id, label, onMessageCallback, onErrorCallback) {\n super();\n this.id = id;\n this.label = label;\n const workerOrPromise = getWorker(label);\n if (isPromiseLike(workerOrPromise)) {\n this.worker = workerOrPromise;\n }\n else {\n this.worker = Promise.resolve(workerOrPromise);\n }\n this.postMessage(moduleId, []);\n this.worker.then((w) => {\n w.onmessage = function (ev) {\n onMessageCallback(ev.data);\n };\n w.onmessageerror = onErrorCallback;\n if (typeof w.addEventListener === 'function') {\n w.addEventListener('error', onErrorCallback);\n }\n });\n this._register(toDisposable(() => {\n var _a;\n (_a = this.worker) === null || _a === void 0 ? void 0 : _a.then(w => {\n w.onmessage = null;\n w.onmessageerror = null;\n w.removeEventListener('error', onErrorCallback);\n w.terminate();\n });\n this.worker = null;\n }));\n }\n getId() {\n return this.id;\n }\n postMessage(message, transfer) {\n var _a;\n (_a = this.worker) === null || _a === void 0 ? void 0 : _a.then(w => {\n try {\n w.postMessage(message, transfer);\n }\n catch (err) {\n onUnexpectedError(err);\n onUnexpectedError(new Error(`FAILED to post message to '${this.label}'-worker`, { cause: err }));\n }\n });\n }\n}\nexport class DefaultWorkerFactory {\n constructor(label) {\n this._label = label;\n this._webWorkerFailedBeforeError = false;\n }\n create(moduleId, onMessageCallback, onErrorCallback) {\n const workerId = (++DefaultWorkerFactory.LAST_WORKER_ID);\n if (this._webWorkerFailedBeforeError) {\n throw this._webWorkerFailedBeforeError;\n }\n return new WebWorker(moduleId, workerId, this._label || 'anonymous' + workerId, onMessageCallback, (err) => {\n logOnceWebWorkerWarning(err);\n this._webWorkerFailedBeforeError = err;\n onErrorCallback(err);\n });\n }\n}\nDefaultWorkerFactory.LAST_WORKER_ID = 0;\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Describes what to do with the indentation when pressing Enter.\n */\nexport var IndentAction;\n(function (IndentAction) {\n /**\n * Insert new line and copy the previous line's indentation.\n */\n IndentAction[IndentAction[\"None\"] = 0] = \"None\";\n /**\n * Insert new line and indent once (relative to the previous line's indentation).\n */\n IndentAction[IndentAction[\"Indent\"] = 1] = \"Indent\";\n /**\n * Insert two new lines:\n * - the first one indented which will hold the cursor\n * - the second one at the same indentation level\n */\n IndentAction[IndentAction[\"IndentOutdent\"] = 2] = \"IndentOutdent\";\n /**\n * Insert new line and outdent once (relative to the previous line's indentation).\n */\n IndentAction[IndentAction[\"Outdent\"] = 3] = \"Outdent\";\n})(IndentAction || (IndentAction = {}));\n/**\n * @internal\n */\nexport class StandardAutoClosingPairConditional {\n constructor(source) {\n this._neutralCharacter = null;\n this._neutralCharacterSearched = false;\n this.open = source.open;\n this.close = source.close;\n // initially allowed in all tokens\n this._inString = true;\n this._inComment = true;\n this._inRegEx = true;\n if (Array.isArray(source.notIn)) {\n for (let i = 0, len = source.notIn.length; i < len; i++) {\n const notIn = source.notIn[i];\n switch (notIn) {\n case 'string':\n this._inString = false;\n break;\n case 'comment':\n this._inComment = false;\n break;\n case 'regex':\n this._inRegEx = false;\n break;\n }\n }\n }\n }\n isOK(standardToken) {\n switch (standardToken) {\n case 0 /* StandardTokenType.Other */:\n return true;\n case 1 /* StandardTokenType.Comment */:\n return this._inComment;\n case 2 /* StandardTokenType.String */:\n return this._inString;\n case 3 /* StandardTokenType.RegEx */:\n return this._inRegEx;\n }\n }\n shouldAutoClose(context, column) {\n // Always complete on empty line\n if (context.getTokenCount() === 0) {\n return true;\n }\n const tokenIndex = context.findTokenIndexAtOffset(column - 2);\n const standardTokenType = context.getStandardTokenType(tokenIndex);\n return this.isOK(standardTokenType);\n }\n _findNeutralCharacterInRange(fromCharCode, toCharCode) {\n for (let charCode = fromCharCode; charCode <= toCharCode; charCode++) {\n const character = String.fromCharCode(charCode);\n if (!this.open.includes(character) && !this.close.includes(character)) {\n return character;\n }\n }\n return null;\n }\n /**\n * Find a character in the range [0-9a-zA-Z] that does not appear in the open or close\n */\n findNeutralCharacter() {\n if (!this._neutralCharacterSearched) {\n this._neutralCharacterSearched = true;\n if (!this._neutralCharacter) {\n this._neutralCharacter = this._findNeutralCharacterInRange(48 /* CharCode.Digit0 */, 57 /* CharCode.Digit9 */);\n }\n if (!this._neutralCharacter) {\n this._neutralCharacter = this._findNeutralCharacterInRange(97 /* CharCode.a */, 122 /* CharCode.z */);\n }\n if (!this._neutralCharacter) {\n this._neutralCharacter = this._findNeutralCharacterInRange(65 /* CharCode.A */, 90 /* CharCode.Z */);\n }\n }\n return this._neutralCharacter;\n }\n}\n/**\n * @internal\n */\nexport class AutoClosingPairs {\n constructor(autoClosingPairs) {\n this.autoClosingPairsOpenByStart = new Map();\n this.autoClosingPairsOpenByEnd = new Map();\n this.autoClosingPairsCloseByStart = new Map();\n this.autoClosingPairsCloseByEnd = new Map();\n this.autoClosingPairsCloseSingleChar = new Map();\n for (const pair of autoClosingPairs) {\n appendEntry(this.autoClosingPairsOpenByStart, pair.open.charAt(0), pair);\n appendEntry(this.autoClosingPairsOpenByEnd, pair.open.charAt(pair.open.length - 1), pair);\n appendEntry(this.autoClosingPairsCloseByStart, pair.close.charAt(0), pair);\n appendEntry(this.autoClosingPairsCloseByEnd, pair.close.charAt(pair.close.length - 1), pair);\n if (pair.close.length === 1 && pair.open.length === 1) {\n appendEntry(this.autoClosingPairsCloseSingleChar, pair.close, pair);\n }\n }\n }\n}\nfunction appendEntry(target, key, value) {\n if (target.has(key)) {\n target.get(key).push(value);\n }\n else {\n target.set(key, [value]);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport function createScopedLineTokens(context, offset) {\n const tokenCount = context.getCount();\n const tokenIndex = context.findTokenIndexAtOffset(offset);\n const desiredLanguageId = context.getLanguageId(tokenIndex);\n let lastTokenIndex = tokenIndex;\n while (lastTokenIndex + 1 < tokenCount && context.getLanguageId(lastTokenIndex + 1) === desiredLanguageId) {\n lastTokenIndex++;\n }\n let firstTokenIndex = tokenIndex;\n while (firstTokenIndex > 0 && context.getLanguageId(firstTokenIndex - 1) === desiredLanguageId) {\n firstTokenIndex--;\n }\n return new ScopedLineTokens(context, desiredLanguageId, firstTokenIndex, lastTokenIndex + 1, context.getStartOffset(firstTokenIndex), context.getEndOffset(lastTokenIndex));\n}\nexport class ScopedLineTokens {\n constructor(actual, languageId, firstTokenIndex, lastTokenIndex, firstCharOffset, lastCharOffset) {\n this._scopedLineTokensBrand = undefined;\n this._actual = actual;\n this.languageId = languageId;\n this._firstTokenIndex = firstTokenIndex;\n this._lastTokenIndex = lastTokenIndex;\n this.firstCharOffset = firstCharOffset;\n this._lastCharOffset = lastCharOffset;\n }\n getLineContent() {\n const actualLineContent = this._actual.getLineContent();\n return actualLineContent.substring(this.firstCharOffset, this._lastCharOffset);\n }\n getActualLineContentBefore(offset) {\n const actualLineContent = this._actual.getLineContent();\n return actualLineContent.substring(0, this.firstCharOffset + offset);\n }\n getTokenCount() {\n return this._lastTokenIndex - this._firstTokenIndex;\n }\n findTokenIndexAtOffset(offset) {\n return this._actual.findTokenIndexAtOffset(offset + this.firstCharOffset) - this._firstTokenIndex;\n }\n getStandardTokenType(tokenIndex) {\n return this._actual.getStandardTokenType(tokenIndex + this._firstTokenIndex);\n }\n}\nexport function ignoreBracketsInToken(standardTokenType) {\n return (standardTokenType & 3 /* IgnoreBracketsInTokens.value */) !== 0;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { StandardAutoClosingPairConditional } from '../languageConfiguration.js';\nexport class CharacterPairSupport {\n constructor(config) {\n if (config.autoClosingPairs) {\n this._autoClosingPairs = config.autoClosingPairs.map(el => new StandardAutoClosingPairConditional(el));\n }\n else if (config.brackets) {\n this._autoClosingPairs = config.brackets.map(b => new StandardAutoClosingPairConditional({ open: b[0], close: b[1] }));\n }\n else {\n this._autoClosingPairs = [];\n }\n if (config.__electricCharacterSupport && config.__electricCharacterSupport.docComment) {\n const docComment = config.__electricCharacterSupport.docComment;\n // IDocComment is legacy, only partially supported\n this._autoClosingPairs.push(new StandardAutoClosingPairConditional({ open: docComment.open, close: docComment.close || '' }));\n }\n this._autoCloseBeforeForQuotes = typeof config.autoCloseBefore === 'string' ? config.autoCloseBefore : CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES;\n this._autoCloseBeforeForBrackets = typeof config.autoCloseBefore === 'string' ? config.autoCloseBefore : CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS;\n this._surroundingPairs = config.surroundingPairs || this._autoClosingPairs;\n }\n getAutoClosingPairs() {\n return this._autoClosingPairs;\n }\n getAutoCloseBeforeSet(forQuotes) {\n return (forQuotes ? this._autoCloseBeforeForQuotes : this._autoCloseBeforeForBrackets);\n }\n getSurroundingPairs() {\n return this._surroundingPairs;\n }\n}\nCharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES = ';:.,=}])> \\n\\t';\nCharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS = '\\'\"`;:.,=}])> \\n\\t';\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Lazy } from './lazy.js';\nconst hasBuffer = (typeof Buffer !== 'undefined');\nconst indexOfTable = new Lazy(() => new Uint8Array(256));\nlet textDecoder;\nexport class VSBuffer {\n /**\n * When running in a nodejs context, if `actual` is not a nodejs Buffer, the backing store for\n * the returned `VSBuffer` instance might use a nodejs Buffer allocated from node's Buffer pool,\n * which is not transferrable.\n */\n static wrap(actual) {\n if (hasBuffer && !(Buffer.isBuffer(actual))) {\n // https://nodejs.org/dist/latest-v10.x/docs/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length\n // Create a zero-copy Buffer wrapper around the ArrayBuffer pointed to by the Uint8Array\n actual = Buffer.from(actual.buffer, actual.byteOffset, actual.byteLength);\n }\n return new VSBuffer(actual);\n }\n constructor(buffer) {\n this.buffer = buffer;\n this.byteLength = this.buffer.byteLength;\n }\n toString() {\n if (hasBuffer) {\n return this.buffer.toString();\n }\n else {\n if (!textDecoder) {\n textDecoder = new TextDecoder();\n }\n return textDecoder.decode(this.buffer);\n }\n }\n}\nexport function readUInt16LE(source, offset) {\n return (((source[offset + 0] << 0) >>> 0) |\n ((source[offset + 1] << 8) >>> 0));\n}\nexport function writeUInt16LE(destination, value, offset) {\n destination[offset + 0] = (value & 0b11111111);\n value = value >>> 8;\n destination[offset + 1] = (value & 0b11111111);\n}\nexport function readUInt32BE(source, offset) {\n return (source[offset] * 2 ** 24\n + source[offset + 1] * 2 ** 16\n + source[offset + 2] * 2 ** 8\n + source[offset + 3]);\n}\nexport function writeUInt32BE(destination, value, offset) {\n destination[offset + 3] = value;\n value = value >>> 8;\n destination[offset + 2] = value;\n value = value >>> 8;\n destination[offset + 1] = value;\n value = value >>> 8;\n destination[offset] = value;\n}\nexport function readUInt8(source, offset) {\n return source[offset];\n}\nexport function writeUInt8(destination, value, offset) {\n destination[offset] = value;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as strings from '../../../base/common/strings.js';\nimport * as platform from '../../../base/common/platform.js';\nimport * as buffer from '../../../base/common/buffer.js';\nlet _utf16LE_TextDecoder;\nfunction getUTF16LE_TextDecoder() {\n if (!_utf16LE_TextDecoder) {\n _utf16LE_TextDecoder = new TextDecoder('UTF-16LE');\n }\n return _utf16LE_TextDecoder;\n}\nlet _utf16BE_TextDecoder;\nfunction getUTF16BE_TextDecoder() {\n if (!_utf16BE_TextDecoder) {\n _utf16BE_TextDecoder = new TextDecoder('UTF-16BE');\n }\n return _utf16BE_TextDecoder;\n}\nlet _platformTextDecoder;\nexport function getPlatformTextDecoder() {\n if (!_platformTextDecoder) {\n _platformTextDecoder = platform.isLittleEndian() ? getUTF16LE_TextDecoder() : getUTF16BE_TextDecoder();\n }\n return _platformTextDecoder;\n}\nexport function decodeUTF16LE(source, offset, len) {\n const view = new Uint16Array(source.buffer, offset, len);\n if (len > 0 && (view[0] === 0xFEFF || view[0] === 0xFFFE)) {\n // UTF16 sometimes starts with a BOM https://de.wikipedia.org/wiki/Byte_Order_Mark\n // It looks like TextDecoder.decode will eat up a leading BOM (0xFEFF or 0xFFFE)\n // We don't want that behavior because we know the string is UTF16LE and the BOM should be maintained\n // So we use the manual decoder\n return compatDecodeUTF16LE(source, offset, len);\n }\n return getUTF16LE_TextDecoder().decode(view);\n}\nfunction compatDecodeUTF16LE(source, offset, len) {\n const result = [];\n let resultLen = 0;\n for (let i = 0; i < len; i++) {\n const charCode = buffer.readUInt16LE(source, offset);\n offset += 2;\n result[resultLen++] = String.fromCharCode(charCode);\n }\n return result.join('');\n}\nexport class StringBuilder {\n constructor(capacity) {\n this._capacity = capacity | 0;\n this._buffer = new Uint16Array(this._capacity);\n this._completedStrings = null;\n this._bufferLength = 0;\n }\n reset() {\n this._completedStrings = null;\n this._bufferLength = 0;\n }\n build() {\n if (this._completedStrings !== null) {\n this._flushBuffer();\n return this._completedStrings.join('');\n }\n return this._buildBuffer();\n }\n _buildBuffer() {\n if (this._bufferLength === 0) {\n return '';\n }\n const view = new Uint16Array(this._buffer.buffer, 0, this._bufferLength);\n return getPlatformTextDecoder().decode(view);\n }\n _flushBuffer() {\n const bufferString = this._buildBuffer();\n this._bufferLength = 0;\n if (this._completedStrings === null) {\n this._completedStrings = [bufferString];\n }\n else {\n this._completedStrings[this._completedStrings.length] = bufferString;\n }\n }\n /**\n * Append a char code (<2^16)\n */\n appendCharCode(charCode) {\n const remainingSpace = this._capacity - this._bufferLength;\n if (remainingSpace <= 1) {\n if (remainingSpace === 0 || strings.isHighSurrogate(charCode)) {\n this._flushBuffer();\n }\n }\n this._buffer[this._bufferLength++] = charCode;\n }\n /**\n * Append an ASCII char code (<2^8)\n */\n appendASCIICharCode(charCode) {\n if (this._bufferLength === this._capacity) {\n // buffer is full\n this._flushBuffer();\n }\n this._buffer[this._bufferLength++] = charCode;\n }\n appendString(str) {\n const strLen = str.length;\n if (this._bufferLength + strLen >= this._capacity) {\n // This string does not fit in the remaining buffer space\n this._flushBuffer();\n this._completedStrings[this._completedStrings.length] = str;\n return;\n }\n for (let i = 0; i < strLen; i++) {\n this._buffer[this._bufferLength++] = str.charCodeAt(i);\n }\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as strings from '../../../../base/common/strings.js';\nimport * as stringBuilder from '../../core/stringBuilder.js';\nimport { Range } from '../../core/range.js';\n/**\n * Represents a grouping of colliding bracket pairs.\n *\n * Most of the times this contains a single bracket pair,\n * but sometimes this contains multiple bracket pairs in cases\n * where the same string appears as a closing bracket for multiple\n * bracket pairs, or the same string appears an opening bracket for\n * multiple bracket pairs.\n *\n * e.g. of a group containing a single pair:\n * open: ['{'], close: ['}']\n *\n * e.g. of a group containing multiple pairs:\n * open: ['if', 'for'], close: ['end', 'end']\n */\nexport class RichEditBracket {\n constructor(languageId, index, open, close, forwardRegex, reversedRegex) {\n this._richEditBracketBrand = undefined;\n this.languageId = languageId;\n this.index = index;\n this.open = open;\n this.close = close;\n this.forwardRegex = forwardRegex;\n this.reversedRegex = reversedRegex;\n this._openSet = RichEditBracket._toSet(this.open);\n this._closeSet = RichEditBracket._toSet(this.close);\n }\n /**\n * Check if the provided `text` is an open bracket in this group.\n */\n isOpen(text) {\n return this._openSet.has(text);\n }\n /**\n * Check if the provided `text` is a close bracket in this group.\n */\n isClose(text) {\n return this._closeSet.has(text);\n }\n static _toSet(arr) {\n const result = new Set();\n for (const element of arr) {\n result.add(element);\n }\n return result;\n }\n}\n/**\n * Groups together brackets that have equal open or close sequences.\n *\n * For example, if the following brackets are defined:\n * ['IF','END']\n * ['for','end']\n * ['{','}']\n *\n * Then the grouped brackets would be:\n * { open: ['if', 'for'], close: ['end', 'end'] }\n * { open: ['{'], close: ['}'] }\n *\n */\nfunction groupFuzzyBrackets(brackets) {\n const N = brackets.length;\n brackets = brackets.map(b => [b[0].toLowerCase(), b[1].toLowerCase()]);\n const group = [];\n for (let i = 0; i < N; i++) {\n group[i] = i;\n }\n const areOverlapping = (a, b) => {\n const [aOpen, aClose] = a;\n const [bOpen, bClose] = b;\n return (aOpen === bOpen || aOpen === bClose || aClose === bOpen || aClose === bClose);\n };\n const mergeGroups = (g1, g2) => {\n const newG = Math.min(g1, g2);\n const oldG = Math.max(g1, g2);\n for (let i = 0; i < N; i++) {\n if (group[i] === oldG) {\n group[i] = newG;\n }\n }\n };\n // group together brackets that have the same open or the same close sequence\n for (let i = 0; i < N; i++) {\n const a = brackets[i];\n for (let j = i + 1; j < N; j++) {\n const b = brackets[j];\n if (areOverlapping(a, b)) {\n mergeGroups(group[i], group[j]);\n }\n }\n }\n const result = [];\n for (let g = 0; g < N; g++) {\n const currentOpen = [];\n const currentClose = [];\n for (let i = 0; i < N; i++) {\n if (group[i] === g) {\n const [open, close] = brackets[i];\n currentOpen.push(open);\n currentClose.push(close);\n }\n }\n if (currentOpen.length > 0) {\n result.push({\n open: currentOpen,\n close: currentClose\n });\n }\n }\n return result;\n}\nexport class RichEditBrackets {\n constructor(languageId, _brackets) {\n this._richEditBracketsBrand = undefined;\n const brackets = groupFuzzyBrackets(_brackets);\n this.brackets = brackets.map((b, index) => {\n return new RichEditBracket(languageId, index, b.open, b.close, getRegexForBracketPair(b.open, b.close, brackets, index), getReversedRegexForBracketPair(b.open, b.close, brackets, index));\n });\n this.forwardRegex = getRegexForBrackets(this.brackets);\n this.reversedRegex = getReversedRegexForBrackets(this.brackets);\n this.textIsBracket = {};\n this.textIsOpenBracket = {};\n this.maxBracketLength = 0;\n for (const bracket of this.brackets) {\n for (const open of bracket.open) {\n this.textIsBracket[open] = bracket;\n this.textIsOpenBracket[open] = true;\n this.maxBracketLength = Math.max(this.maxBracketLength, open.length);\n }\n for (const close of bracket.close) {\n this.textIsBracket[close] = bracket;\n this.textIsOpenBracket[close] = false;\n this.maxBracketLength = Math.max(this.maxBracketLength, close.length);\n }\n }\n }\n}\nfunction collectSuperstrings(str, brackets, currentIndex, dest) {\n for (let i = 0, len = brackets.length; i < len; i++) {\n if (i === currentIndex) {\n continue;\n }\n const bracket = brackets[i];\n for (const open of bracket.open) {\n if (open.indexOf(str) >= 0) {\n dest.push(open);\n }\n }\n for (const close of bracket.close) {\n if (close.indexOf(str) >= 0) {\n dest.push(close);\n }\n }\n }\n}\nfunction lengthcmp(a, b) {\n return a.length - b.length;\n}\nfunction unique(arr) {\n if (arr.length <= 1) {\n return arr;\n }\n const result = [];\n const seen = new Set();\n for (const element of arr) {\n if (seen.has(element)) {\n continue;\n }\n result.push(element);\n seen.add(element);\n }\n return result;\n}\n/**\n * Create a regular expression that can be used to search forward in a piece of text\n * for a group of bracket pairs. But this regex must be built in a way in which\n * it is aware of the other bracket pairs defined for the language.\n *\n * For example, if a language contains the following bracket pairs:\n * ['begin', 'end']\n * ['if', 'end if']\n * The two bracket pairs do not collide because no open or close brackets are equal.\n * So the function getRegexForBracketPair is called twice, once with\n * the ['begin'], ['end'] group consisting of one bracket pair, and once with\n * the ['if'], ['end if'] group consiting of the other bracket pair.\n *\n * But there could be a situation where an occurrence of 'end if' is mistaken\n * for an occurrence of 'end'.\n *\n * Therefore, for the bracket pair ['begin', 'end'], the regex will also\n * target 'end if'. The regex will be something like:\n * /(\\bend if\\b)|(\\bend\\b)|(\\bif\\b)/\n *\n * The regex also searches for \"superstrings\" (other brackets that might be mistaken with the current bracket).\n *\n */\nfunction getRegexForBracketPair(open, close, brackets, currentIndex) {\n // search in all brackets for other brackets that are a superstring of these brackets\n let pieces = [];\n pieces = pieces.concat(open);\n pieces = pieces.concat(close);\n for (let i = 0, len = pieces.length; i < len; i++) {\n collectSuperstrings(pieces[i], brackets, currentIndex, pieces);\n }\n pieces = unique(pieces);\n pieces.sort(lengthcmp);\n pieces.reverse();\n return createBracketOrRegExp(pieces);\n}\n/**\n * Matching a regular expression in JS can only be done \"forwards\". So JS offers natively only\n * methods to find the first match of a regex in a string. But sometimes, it is useful to\n * find the last match of a regex in a string. For such a situation, a nice solution is to\n * simply reverse the string and then search for a reversed regex.\n *\n * This function also has the fine details of `getRegexForBracketPair`. For the same example\n * given above, the regex produced here would look like:\n * /(\\bfi dne\\b)|(\\bdne\\b)|(\\bfi\\b)/\n */\nfunction getReversedRegexForBracketPair(open, close, brackets, currentIndex) {\n // search in all brackets for other brackets that are a superstring of these brackets\n let pieces = [];\n pieces = pieces.concat(open);\n pieces = pieces.concat(close);\n for (let i = 0, len = pieces.length; i < len; i++) {\n collectSuperstrings(pieces[i], brackets, currentIndex, pieces);\n }\n pieces = unique(pieces);\n pieces.sort(lengthcmp);\n pieces.reverse();\n return createBracketOrRegExp(pieces.map(toReversedString));\n}\n/**\n * Creates a regular expression that targets all bracket pairs.\n *\n * e.g. for the bracket pairs:\n * ['{','}']\n * ['begin,'end']\n * ['for','end']\n * the regex would look like:\n * /(\\{)|(\\})|(\\bbegin\\b)|(\\bend\\b)|(\\bfor\\b)/\n */\nfunction getRegexForBrackets(brackets) {\n let pieces = [];\n for (const bracket of brackets) {\n for (const open of bracket.open) {\n pieces.push(open);\n }\n for (const close of bracket.close) {\n pieces.push(close);\n }\n }\n pieces = unique(pieces);\n return createBracketOrRegExp(pieces);\n}\n/**\n * Matching a regular expression in JS can only be done \"forwards\". So JS offers natively only\n * methods to find the first match of a regex in a string. But sometimes, it is useful to\n * find the last match of a regex in a string. For such a situation, a nice solution is to\n * simply reverse the string and then search for a reversed regex.\n *\n * e.g. for the bracket pairs:\n * ['{','}']\n * ['begin,'end']\n * ['for','end']\n * the regex would look like:\n * /(\\{)|(\\})|(\\bnigeb\\b)|(\\bdne\\b)|(\\brof\\b)/\n */\nfunction getReversedRegexForBrackets(brackets) {\n let pieces = [];\n for (const bracket of brackets) {\n for (const open of bracket.open) {\n pieces.push(open);\n }\n for (const close of bracket.close) {\n pieces.push(close);\n }\n }\n pieces = unique(pieces);\n return createBracketOrRegExp(pieces.map(toReversedString));\n}\nfunction prepareBracketForRegExp(str) {\n // This bracket pair uses letters like e.g. \"begin\" - \"end\"\n const insertWordBoundaries = (/^[\\w ]+$/.test(str));\n str = strings.escapeRegExpCharacters(str);\n return (insertWordBoundaries ? `\\\\b${str}\\\\b` : str);\n}\nfunction createBracketOrRegExp(pieces) {\n const regexStr = `(${pieces.map(prepareBracketForRegExp).join(')|(')})`;\n return strings.createRegExp(regexStr, true);\n}\nconst toReversedString = (function () {\n function reverse(str) {\n // create a Uint16Array and then use a TextDecoder to create a string\n const arr = new Uint16Array(str.length);\n let offset = 0;\n for (let i = str.length - 1; i >= 0; i--) {\n arr[offset++] = str.charCodeAt(i);\n }\n return stringBuilder.getPlatformTextDecoder().decode(arr);\n }\n let lastInput = null;\n let lastOutput = null;\n return function toReversedString(str) {\n if (lastInput !== str) {\n lastInput = str;\n lastOutput = reverse(lastInput);\n }\n return lastOutput;\n };\n})();\nexport class BracketsUtils {\n static _findPrevBracketInText(reversedBracketRegex, lineNumber, reversedText, offset) {\n const m = reversedText.match(reversedBracketRegex);\n if (!m) {\n return null;\n }\n const matchOffset = reversedText.length - (m.index || 0);\n const matchLength = m[0].length;\n const absoluteMatchOffset = offset + matchOffset;\n return new Range(lineNumber, absoluteMatchOffset - matchLength + 1, lineNumber, absoluteMatchOffset + 1);\n }\n static findPrevBracketInRange(reversedBracketRegex, lineNumber, lineText, startOffset, endOffset) {\n // Because JS does not support backwards regex search, we search forwards in a reversed string with a reversed regex ;)\n const reversedLineText = toReversedString(lineText);\n const reversedSubstr = reversedLineText.substring(lineText.length - endOffset, lineText.length - startOffset);\n return this._findPrevBracketInText(reversedBracketRegex, lineNumber, reversedSubstr, startOffset);\n }\n static findNextBracketInText(bracketRegex, lineNumber, text, offset) {\n const m = text.match(bracketRegex);\n if (!m) {\n return null;\n }\n const matchOffset = m.index || 0;\n const matchLength = m[0].length;\n if (matchLength === 0) {\n return null;\n }\n const absoluteMatchOffset = offset + matchOffset;\n return new Range(lineNumber, absoluteMatchOffset + 1, lineNumber, absoluteMatchOffset + 1 + matchLength);\n }\n static findNextBracketInRange(bracketRegex, lineNumber, lineText, startOffset, endOffset) {\n const substr = lineText.substring(startOffset, endOffset);\n return this.findNextBracketInText(bracketRegex, lineNumber, substr, startOffset);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { distinct } from '../../../../base/common/arrays.js';\nimport { ignoreBracketsInToken } from '../supports.js';\nimport { BracketsUtils } from './richEditBrackets.js';\nexport class BracketElectricCharacterSupport {\n constructor(richEditBrackets) {\n this._richEditBrackets = richEditBrackets;\n }\n getElectricCharacters() {\n const result = [];\n if (this._richEditBrackets) {\n for (const bracket of this._richEditBrackets.brackets) {\n for (const close of bracket.close) {\n const lastChar = close.charAt(close.length - 1);\n result.push(lastChar);\n }\n }\n }\n return distinct(result);\n }\n onElectricCharacter(character, context, column) {\n if (!this._richEditBrackets || this._richEditBrackets.brackets.length === 0) {\n return null;\n }\n const tokenIndex = context.findTokenIndexAtOffset(column - 1);\n if (ignoreBracketsInToken(context.getStandardTokenType(tokenIndex))) {\n return null;\n }\n const reversedBracketRegex = this._richEditBrackets.reversedRegex;\n const text = context.getLineContent().substring(0, column - 1) + character;\n const r = BracketsUtils.findPrevBracketInRange(reversedBracketRegex, 1, text, 0, text.length);\n if (!r) {\n return null;\n }\n const bracketText = text.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase();\n const isOpen = this._richEditBrackets.textIsOpenBracket[bracketText];\n if (isOpen) {\n return null;\n }\n const textBeforeBracket = context.getActualLineContentBefore(r.startColumn - 1);\n if (!/^\\s*$/.test(textBeforeBracket)) {\n // There is other text on the line before the bracket\n return null;\n }\n return {\n matchOpenBracket: bracketText\n };\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nfunction resetGlobalRegex(reg) {\n if (reg.global) {\n reg.lastIndex = 0;\n }\n return true;\n}\nexport class IndentRulesSupport {\n constructor(indentationRules) {\n this._indentationRules = indentationRules;\n }\n shouldIncrease(text) {\n if (this._indentationRules) {\n if (this._indentationRules.increaseIndentPattern && resetGlobalRegex(this._indentationRules.increaseIndentPattern) && this._indentationRules.increaseIndentPattern.test(text)) {\n return true;\n }\n // if (this._indentationRules.indentNextLinePattern && this._indentationRules.indentNextLinePattern.test(text)) {\n // \treturn true;\n // }\n }\n return false;\n }\n shouldDecrease(text) {\n if (this._indentationRules && this._indentationRules.decreaseIndentPattern && resetGlobalRegex(this._indentationRules.decreaseIndentPattern) && this._indentationRules.decreaseIndentPattern.test(text)) {\n return true;\n }\n return false;\n }\n shouldIndentNextLine(text) {\n if (this._indentationRules && this._indentationRules.indentNextLinePattern && resetGlobalRegex(this._indentationRules.indentNextLinePattern) && this._indentationRules.indentNextLinePattern.test(text)) {\n return true;\n }\n return false;\n }\n shouldIgnore(text) {\n // the text matches `unIndentedLinePattern`\n if (this._indentationRules && this._indentationRules.unIndentedLinePattern && resetGlobalRegex(this._indentationRules.unIndentedLinePattern) && this._indentationRules.unIndentedLinePattern.test(text)) {\n return true;\n }\n return false;\n }\n getIndentMetadata(text) {\n let ret = 0;\n if (this.shouldIncrease(text)) {\n ret += 1 /* IndentConsts.INCREASE_MASK */;\n }\n if (this.shouldDecrease(text)) {\n ret += 2 /* IndentConsts.DECREASE_MASK */;\n }\n if (this.shouldIndentNextLine(text)) {\n ret += 4 /* IndentConsts.INDENT_NEXTLINE_MASK */;\n }\n if (this.shouldIgnore(text)) {\n ret += 8 /* IndentConsts.UNINDENT_MASK */;\n }\n return ret;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport * as strings from '../../../../base/common/strings.js';\nimport { IndentAction } from '../languageConfiguration.js';\nexport class OnEnterSupport {\n constructor(opts) {\n opts = opts || {};\n opts.brackets = opts.brackets || [\n ['(', ')'],\n ['{', '}'],\n ['[', ']']\n ];\n this._brackets = [];\n opts.brackets.forEach((bracket) => {\n const openRegExp = OnEnterSupport._createOpenBracketRegExp(bracket[0]);\n const closeRegExp = OnEnterSupport._createCloseBracketRegExp(bracket[1]);\n if (openRegExp && closeRegExp) {\n this._brackets.push({\n open: bracket[0],\n openRegExp: openRegExp,\n close: bracket[1],\n closeRegExp: closeRegExp,\n });\n }\n });\n this._regExpRules = opts.onEnterRules || [];\n }\n onEnter(autoIndent, previousLineText, beforeEnterText, afterEnterText) {\n // (1): `regExpRules`\n if (autoIndent >= 3 /* EditorAutoIndentStrategy.Advanced */) {\n for (let i = 0, len = this._regExpRules.length; i < len; i++) {\n const rule = this._regExpRules[i];\n const regResult = [{\n reg: rule.beforeText,\n text: beforeEnterText\n }, {\n reg: rule.afterText,\n text: afterEnterText\n }, {\n reg: rule.previousLineText,\n text: previousLineText\n }].every((obj) => {\n if (!obj.reg) {\n return true;\n }\n obj.reg.lastIndex = 0; // To disable the effect of the \"g\" flag.\n return obj.reg.test(obj.text);\n });\n if (regResult) {\n return rule.action;\n }\n }\n }\n // (2): Special indent-outdent\n if (autoIndent >= 2 /* EditorAutoIndentStrategy.Brackets */) {\n if (beforeEnterText.length > 0 && afterEnterText.length > 0) {\n for (let i = 0, len = this._brackets.length; i < len; i++) {\n const bracket = this._brackets[i];\n if (bracket.openRegExp.test(beforeEnterText) && bracket.closeRegExp.test(afterEnterText)) {\n return { indentAction: IndentAction.IndentOutdent };\n }\n }\n }\n }\n // (4): Open bracket based logic\n if (autoIndent >= 2 /* EditorAutoIndentStrategy.Brackets */) {\n if (beforeEnterText.length > 0) {\n for (let i = 0, len = this._brackets.length; i < len; i++) {\n const bracket = this._brackets[i];\n if (bracket.openRegExp.test(beforeEnterText)) {\n return { indentAction: IndentAction.Indent };\n }\n }\n }\n }\n return null;\n }\n static _createOpenBracketRegExp(bracket) {\n let str = strings.escapeRegExpCharacters(bracket);\n if (!/\\B/.test(str.charAt(0))) {\n str = '\\\\b' + str;\n }\n str += '\\\\s*$';\n return OnEnterSupport._safeRegExp(str);\n }\n static _createCloseBracketRegExp(bracket) {\n let str = strings.escapeRegExpCharacters(bracket);\n if (!/\\B/.test(str.charAt(str.length - 1))) {\n str = str + '\\\\b';\n }\n str = '^\\\\s*' + str;\n return OnEnterSupport._safeRegExp(str);\n }\n static _safeRegExp(def) {\n try {\n return new RegExp(def);\n }\n catch (err) {\n onUnexpectedError(err);\n return null;\n }\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\nexport const IConfigurationService = createDecorator('configurationService');\nexport function toValuesTree(properties, conflictReporter) {\n const root = Object.create(null);\n for (const key in properties) {\n addToValueTree(root, key, properties[key], conflictReporter);\n }\n return root;\n}\nexport function addToValueTree(settingsTreeRoot, key, value, conflictReporter) {\n const segments = key.split('.');\n const last = segments.pop();\n let curr = settingsTreeRoot;\n for (let i = 0; i < segments.length; i++) {\n const s = segments[i];\n let obj = curr[s];\n switch (typeof obj) {\n case 'undefined':\n obj = curr[s] = Object.create(null);\n break;\n case 'object':\n break;\n default:\n conflictReporter(`Ignoring ${key} as ${segments.slice(0, i + 1).join('.')} is ${JSON.stringify(obj)}`);\n return;\n }\n curr = obj;\n }\n if (typeof curr === 'object' && curr !== null) {\n try {\n curr[last] = value; // workaround https://github.com/microsoft/vscode/issues/13606\n }\n catch (e) {\n conflictReporter(`Ignoring ${key} as ${segments.join('.')} is ${JSON.stringify(curr)}`);\n }\n }\n else {\n conflictReporter(`Ignoring ${key} as ${segments.join('.')} is ${JSON.stringify(curr)}`);\n }\n}\nexport function removeFromValueTree(valueTree, key) {\n const segments = key.split('.');\n doRemoveFromValueTree(valueTree, segments);\n}\nfunction doRemoveFromValueTree(valueTree, segments) {\n const first = segments.shift();\n if (segments.length === 0) {\n // Reached last segment\n delete valueTree[first];\n return;\n }\n if (Object.keys(valueTree).indexOf(first) !== -1) {\n const value = valueTree[first];\n if (typeof value === 'object' && !Array.isArray(value)) {\n doRemoveFromValueTree(value, segments);\n if (Object.keys(value).length === 0) {\n delete valueTree[first];\n }\n }\n }\n}\n/**\n * A helper function to get the configuration value with a specific settings path (e.g. config.some.setting)\n */\nexport function getConfigurationValue(config, settingPath, defaultValue) {\n function accessSetting(config, path) {\n let current = config;\n for (const component of path) {\n if (typeof current !== 'object' || current === null) {\n return undefined;\n }\n current = current[component];\n }\n return current;\n }\n const path = settingPath.split('.');\n const result = accessSetting(config, path);\n return typeof result === 'undefined' ? defaultValue : result;\n}\nexport function getLanguageTagSettingPlainKey(settingKey) {\n return settingKey.replace(/[\\[\\]]/g, '');\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nexport const ILanguageService = createDecorator('languageService');\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class SyncDescriptor {\n constructor(ctor, staticArguments = [], supportsDelayedInstantiation = false) {\n this.ctor = ctor;\n this.staticArguments = staticArguments;\n this.supportsDelayedInstantiation = supportsDelayedInstantiation;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { SyncDescriptor } from './descriptors.js';\nconst _registry = [];\nexport function registerSingleton(id, ctorOrDescriptor, supportsDelayedInstantiation) {\n if (!(ctorOrDescriptor instanceof SyncDescriptor)) {\n ctorOrDescriptor = new SyncDescriptor(ctorOrDescriptor, [], Boolean(supportsDelayedInstantiation));\n }\n _registry.push([id, ctorOrDescriptor]);\n}\nexport function getSingletonServiceDescriptors() {\n return _registry;\n}\n", "export const Mimes = Object.freeze({\n text: 'text/plain',\n binary: 'application/octet-stream',\n unknown: 'application/unknown',\n markdown: 'text/markdown',\n latex: 'text/latex',\n uriList: 'text/uri-list',\n});\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Emitter } from '../../../base/common/event.js';\nimport * as platform from '../../registry/common/platform.js';\nexport const Extensions = {\n JSONContribution: 'base.contributions.json'\n};\nfunction normalizeId(id) {\n if (id.length > 0 && id.charAt(id.length - 1) === '#') {\n return id.substring(0, id.length - 1);\n }\n return id;\n}\nclass JSONContributionRegistry {\n constructor() {\n this._onDidChangeSchema = new Emitter();\n this.schemasById = {};\n }\n registerSchema(uri, unresolvedSchemaContent) {\n this.schemasById[normalizeId(uri)] = unresolvedSchemaContent;\n this._onDidChangeSchema.fire(uri);\n }\n notifySchemaChanged(uri) {\n this._onDidChangeSchema.fire(uri);\n }\n}\nconst jsonContributionRegistry = new JSONContributionRegistry();\nplatform.Registry.add(Extensions.JSONContribution, jsonContributionRegistry);\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { distinct } from '../../../base/common/arrays.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport * as types from '../../../base/common/types.js';\nimport * as nls from '../../../nls.js';\nimport { getLanguageTagSettingPlainKey } from './configuration.js';\nimport { Extensions as JSONExtensions } from '../../jsonschemas/common/jsonContributionRegistry.js';\nimport { Registry } from '../../registry/common/platform.js';\nexport const Extensions = {\n Configuration: 'base.contributions.configuration'\n};\nexport const allSettings = { properties: {}, patternProperties: {} };\nexport const applicationSettings = { properties: {}, patternProperties: {} };\nexport const machineSettings = { properties: {}, patternProperties: {} };\nexport const machineOverridableSettings = { properties: {}, patternProperties: {} };\nexport const windowSettings = { properties: {}, patternProperties: {} };\nexport const resourceSettings = { properties: {}, patternProperties: {} };\nexport const resourceLanguageSettingsSchemaId = 'vscode://schemas/settings/resourceLanguage';\nconst contributionRegistry = Registry.as(JSONExtensions.JSONContribution);\nclass ConfigurationRegistry {\n constructor() {\n this.overrideIdentifiers = new Set();\n this._onDidSchemaChange = new Emitter();\n this._onDidUpdateConfiguration = new Emitter();\n this.configurationDefaultsOverrides = new Map();\n this.defaultLanguageConfigurationOverridesNode = {\n id: 'defaultOverrides',\n title: nls.localize('defaultLanguageConfigurationOverrides.title', \"Default Language Configuration Overrides\"),\n properties: {}\n };\n this.configurationContributors = [this.defaultLanguageConfigurationOverridesNode];\n this.resourceLanguageSettingsSchema = {\n properties: {},\n patternProperties: {},\n additionalProperties: true,\n allowTrailingCommas: true,\n allowComments: true\n };\n this.configurationProperties = {};\n this.policyConfigurations = new Map();\n this.excludedConfigurationProperties = {};\n contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);\n this.registerOverridePropertyPatternKey();\n }\n registerConfiguration(configuration, validate = true) {\n this.registerConfigurations([configuration], validate);\n }\n registerConfigurations(configurations, validate = true) {\n const properties = new Set();\n this.doRegisterConfigurations(configurations, validate, properties);\n contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);\n this._onDidSchemaChange.fire();\n this._onDidUpdateConfiguration.fire({ properties });\n }\n registerDefaultConfigurations(configurationDefaults) {\n const properties = new Set();\n this.doRegisterDefaultConfigurations(configurationDefaults, properties);\n this._onDidSchemaChange.fire();\n this._onDidUpdateConfiguration.fire({ properties, defaultsOverrides: true });\n }\n doRegisterDefaultConfigurations(configurationDefaults, bucket) {\n var _a;\n const overrideIdentifiers = [];\n for (const { overrides, source } of configurationDefaults) {\n for (const key in overrides) {\n bucket.add(key);\n if (OVERRIDE_PROPERTY_REGEX.test(key)) {\n const configurationDefaultOverride = this.configurationDefaultsOverrides.get(key);\n const valuesSources = (_a = configurationDefaultOverride === null || configurationDefaultOverride === void 0 ? void 0 : configurationDefaultOverride.valuesSources) !== null && _a !== void 0 ? _a : new Map();\n if (source) {\n for (const configuration of Object.keys(overrides[key])) {\n valuesSources.set(configuration, source);\n }\n }\n const defaultValue = { ...((configurationDefaultOverride === null || configurationDefaultOverride === void 0 ? void 0 : configurationDefaultOverride.value) || {}), ...overrides[key] };\n this.configurationDefaultsOverrides.set(key, { source, value: defaultValue, valuesSources });\n const plainKey = getLanguageTagSettingPlainKey(key);\n const property = {\n type: 'object',\n default: defaultValue,\n description: nls.localize('defaultLanguageConfiguration.description', \"Configure settings to be overridden for the {0} language.\", plainKey),\n $ref: resourceLanguageSettingsSchemaId,\n defaultDefaultValue: defaultValue,\n source: types.isString(source) ? undefined : source,\n defaultValueSource: source\n };\n overrideIdentifiers.push(...overrideIdentifiersFromKey(key));\n this.configurationProperties[key] = property;\n this.defaultLanguageConfigurationOverridesNode.properties[key] = property;\n }\n else {\n this.configurationDefaultsOverrides.set(key, { value: overrides[key], source });\n const property = this.configurationProperties[key];\n if (property) {\n this.updatePropertyDefaultValue(key, property);\n this.updateSchema(key, property);\n }\n }\n }\n }\n this.doRegisterOverrideIdentifiers(overrideIdentifiers);\n }\n registerOverrideIdentifiers(overrideIdentifiers) {\n this.doRegisterOverrideIdentifiers(overrideIdentifiers);\n this._onDidSchemaChange.fire();\n }\n doRegisterOverrideIdentifiers(overrideIdentifiers) {\n for (const overrideIdentifier of overrideIdentifiers) {\n this.overrideIdentifiers.add(overrideIdentifier);\n }\n this.updateOverridePropertyPatternKey();\n }\n doRegisterConfigurations(configurations, validate, bucket) {\n configurations.forEach(configuration => {\n this.validateAndRegisterProperties(configuration, validate, configuration.extensionInfo, configuration.restrictedProperties, undefined, bucket);\n this.configurationContributors.push(configuration);\n this.registerJSONConfiguration(configuration);\n });\n }\n validateAndRegisterProperties(configuration, validate = true, extensionInfo, restrictedProperties, scope = 3 /* ConfigurationScope.WINDOW */, bucket) {\n var _a;\n scope = types.isUndefinedOrNull(configuration.scope) ? scope : configuration.scope;\n const properties = configuration.properties;\n if (properties) {\n for (const key in properties) {\n const property = properties[key];\n if (validate && validateProperty(key, property)) {\n delete properties[key];\n continue;\n }\n property.source = extensionInfo;\n // update default value\n property.defaultDefaultValue = properties[key].default;\n this.updatePropertyDefaultValue(key, property);\n // update scope\n if (OVERRIDE_PROPERTY_REGEX.test(key)) {\n property.scope = undefined; // No scope for overridable properties `[${identifier}]`\n }\n else {\n property.scope = types.isUndefinedOrNull(property.scope) ? scope : property.scope;\n property.restricted = types.isUndefinedOrNull(property.restricted) ? !!(restrictedProperties === null || restrictedProperties === void 0 ? void 0 : restrictedProperties.includes(key)) : property.restricted;\n }\n // Add to properties maps\n // Property is included by default if 'included' is unspecified\n if (properties[key].hasOwnProperty('included') && !properties[key].included) {\n this.excludedConfigurationProperties[key] = properties[key];\n delete properties[key];\n continue;\n }\n else {\n this.configurationProperties[key] = properties[key];\n if ((_a = properties[key].policy) === null || _a === void 0 ? void 0 : _a.name) {\n this.policyConfigurations.set(properties[key].policy.name, key);\n }\n }\n if (!properties[key].deprecationMessage && properties[key].markdownDeprecationMessage) {\n // If not set, default deprecationMessage to the markdown source\n properties[key].deprecationMessage = properties[key].markdownDeprecationMessage;\n }\n bucket.add(key);\n }\n }\n const subNodes = configuration.allOf;\n if (subNodes) {\n for (const node of subNodes) {\n this.validateAndRegisterProperties(node, validate, extensionInfo, restrictedProperties, scope, bucket);\n }\n }\n }\n getConfigurationProperties() {\n return this.configurationProperties;\n }\n getPolicyConfigurations() {\n return this.policyConfigurations;\n }\n registerJSONConfiguration(configuration) {\n const register = (configuration) => {\n const properties = configuration.properties;\n if (properties) {\n for (const key in properties) {\n this.updateSchema(key, properties[key]);\n }\n }\n const subNodes = configuration.allOf;\n subNodes === null || subNodes === void 0 ? void 0 : subNodes.forEach(register);\n };\n register(configuration);\n }\n updateSchema(key, property) {\n allSettings.properties[key] = property;\n switch (property.scope) {\n case 1 /* ConfigurationScope.APPLICATION */:\n applicationSettings.properties[key] = property;\n break;\n case 2 /* ConfigurationScope.MACHINE */:\n machineSettings.properties[key] = property;\n break;\n case 6 /* ConfigurationScope.MACHINE_OVERRIDABLE */:\n machineOverridableSettings.properties[key] = property;\n break;\n case 3 /* ConfigurationScope.WINDOW */:\n windowSettings.properties[key] = property;\n break;\n case 4 /* ConfigurationScope.RESOURCE */:\n resourceSettings.properties[key] = property;\n break;\n case 5 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */:\n resourceSettings.properties[key] = property;\n this.resourceLanguageSettingsSchema.properties[key] = property;\n break;\n }\n }\n updateOverridePropertyPatternKey() {\n for (const overrideIdentifier of this.overrideIdentifiers.values()) {\n const overrideIdentifierProperty = `[${overrideIdentifier}]`;\n const resourceLanguagePropertiesSchema = {\n type: 'object',\n description: nls.localize('overrideSettings.defaultDescription', \"Configure editor settings to be overridden for a language.\"),\n errorMessage: nls.localize('overrideSettings.errorMessage', \"This setting does not support per-language configuration.\"),\n $ref: resourceLanguageSettingsSchemaId,\n };\n this.updatePropertyDefaultValue(overrideIdentifierProperty, resourceLanguagePropertiesSchema);\n allSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n applicationSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n machineSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n machineOverridableSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n windowSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n resourceSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n }\n }\n registerOverridePropertyPatternKey() {\n const resourceLanguagePropertiesSchema = {\n type: 'object',\n description: nls.localize('overrideSettings.defaultDescription', \"Configure editor settings to be overridden for a language.\"),\n errorMessage: nls.localize('overrideSettings.errorMessage', \"This setting does not support per-language configuration.\"),\n $ref: resourceLanguageSettingsSchemaId,\n };\n allSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n applicationSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n machineSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n machineOverridableSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n windowSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n resourceSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n this._onDidSchemaChange.fire();\n }\n updatePropertyDefaultValue(key, property) {\n const configurationdefaultOverride = this.configurationDefaultsOverrides.get(key);\n let defaultValue = configurationdefaultOverride === null || configurationdefaultOverride === void 0 ? void 0 : configurationdefaultOverride.value;\n let defaultSource = configurationdefaultOverride === null || configurationdefaultOverride === void 0 ? void 0 : configurationdefaultOverride.source;\n if (types.isUndefined(defaultValue)) {\n defaultValue = property.defaultDefaultValue;\n defaultSource = undefined;\n }\n if (types.isUndefined(defaultValue)) {\n defaultValue = getDefaultValue(property.type);\n }\n property.default = defaultValue;\n property.defaultValueSource = defaultSource;\n }\n}\nconst OVERRIDE_IDENTIFIER_PATTERN = `\\\\[([^\\\\]]+)\\\\]`;\nconst OVERRIDE_IDENTIFIER_REGEX = new RegExp(OVERRIDE_IDENTIFIER_PATTERN, 'g');\nexport const OVERRIDE_PROPERTY_PATTERN = `^(${OVERRIDE_IDENTIFIER_PATTERN})+$`;\nexport const OVERRIDE_PROPERTY_REGEX = new RegExp(OVERRIDE_PROPERTY_PATTERN);\nexport function overrideIdentifiersFromKey(key) {\n const identifiers = [];\n if (OVERRIDE_PROPERTY_REGEX.test(key)) {\n let matches = OVERRIDE_IDENTIFIER_REGEX.exec(key);\n while (matches === null || matches === void 0 ? void 0 : matches.length) {\n const identifier = matches[1].trim();\n if (identifier) {\n identifiers.push(identifier);\n }\n matches = OVERRIDE_IDENTIFIER_REGEX.exec(key);\n }\n }\n return distinct(identifiers);\n}\nexport function getDefaultValue(type) {\n const t = Array.isArray(type) ? type[0] : type;\n switch (t) {\n case 'boolean':\n return false;\n case 'integer':\n case 'number':\n return 0;\n case 'string':\n return '';\n case 'array':\n return [];\n case 'object':\n return {};\n default:\n return null;\n }\n}\nconst configurationRegistry = new ConfigurationRegistry();\nRegistry.add(Extensions.Configuration, configurationRegistry);\nexport function validateProperty(property, schema) {\n var _a, _b, _c, _d;\n if (!property.trim()) {\n return nls.localize('config.property.empty', \"Cannot register an empty property\");\n }\n if (OVERRIDE_PROPERTY_REGEX.test(property)) {\n return nls.localize('config.property.languageDefault', \"Cannot register '{0}'. This matches property pattern '\\\\\\\\[.*\\\\\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.\", property);\n }\n if (configurationRegistry.getConfigurationProperties()[property] !== undefined) {\n return nls.localize('config.property.duplicate', \"Cannot register '{0}'. This property is already registered.\", property);\n }\n if (((_a = schema.policy) === null || _a === void 0 ? void 0 : _a.name) && configurationRegistry.getPolicyConfigurations().get((_b = schema.policy) === null || _b === void 0 ? void 0 : _b.name) !== undefined) {\n return nls.localize('config.policy.duplicate', \"Cannot register '{0}'. The associated policy {1} is already registered with {2}.\", property, (_c = schema.policy) === null || _c === void 0 ? void 0 : _c.name, configurationRegistry.getPolicyConfigurations().get((_d = schema.policy) === null || _d === void 0 ? void 0 : _d.name));\n }\n return null;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as nls from '../../../nls.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { Registry } from '../../../platform/registry/common/platform.js';\nimport { Mimes } from '../../../base/common/mime.js';\nimport { Extensions as ConfigurationExtensions } from '../../../platform/configuration/common/configurationRegistry.js';\n// Define extension point ids\nexport const Extensions = {\n ModesRegistry: 'editor.modesRegistry'\n};\nexport class EditorModesRegistry {\n constructor() {\n this._onDidChangeLanguages = new Emitter();\n this.onDidChangeLanguages = this._onDidChangeLanguages.event;\n this._languages = [];\n }\n registerLanguage(def) {\n this._languages.push(def);\n this._onDidChangeLanguages.fire(undefined);\n return {\n dispose: () => {\n for (let i = 0, len = this._languages.length; i < len; i++) {\n if (this._languages[i] === def) {\n this._languages.splice(i, 1);\n return;\n }\n }\n }\n };\n }\n getLanguages() {\n return this._languages;\n }\n}\nexport const ModesRegistry = new EditorModesRegistry();\nRegistry.add(Extensions.ModesRegistry, ModesRegistry);\nexport const PLAINTEXT_LANGUAGE_ID = 'plaintext';\nexport const PLAINTEXT_EXTENSION = '.txt';\nModesRegistry.registerLanguage({\n id: PLAINTEXT_LANGUAGE_ID,\n extensions: [PLAINTEXT_EXTENSION],\n aliases: [nls.localize('plainText.alias', \"Plain Text\"), 'text'],\n mimetypes: [Mimes.text]\n});\nRegistry.as(ConfigurationExtensions.Configuration)\n .registerDefaultConfigurations([{\n overrides: {\n '[plaintext]': {\n 'editor.unicodeHighlight.ambiguousCharacters': false,\n 'editor.unicodeHighlight.invisibleCharacters': false\n }\n }\n }]);\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { CachedFunction } from '../../../../base/common/cache.js';\n/**\n * Captures all bracket related configurations for a single language.\n * Immutable.\n*/\nexport class LanguageBracketsConfiguration {\n constructor(languageId, config) {\n this.languageId = languageId;\n const bracketPairs = config.brackets ? filterValidBrackets(config.brackets) : [];\n const openingBracketInfos = new CachedFunction((bracket) => {\n const closing = new Set();\n return {\n info: new OpeningBracketKind(this, bracket, closing),\n closing,\n };\n });\n const closingBracketInfos = new CachedFunction((bracket) => {\n const opening = new Set();\n const openingColorized = new Set();\n return {\n info: new ClosingBracketKind(this, bracket, opening, openingColorized),\n opening,\n openingColorized,\n };\n });\n for (const [open, close] of bracketPairs) {\n const opening = openingBracketInfos.get(open);\n const closing = closingBracketInfos.get(close);\n opening.closing.add(closing.info);\n closing.opening.add(opening.info);\n }\n // Treat colorized brackets as brackets, and mark them as colorized.\n const colorizedBracketPairs = config.colorizedBracketPairs\n ? filterValidBrackets(config.colorizedBracketPairs)\n // If not configured: Take all brackets except `<` ... `>`\n // Many languages set < ... > as bracket pair, even though they also use it as comparison operator.\n // This leads to problems when colorizing this bracket, so we exclude it if not explicitly configured otherwise.\n // https://github.com/microsoft/vscode/issues/132476\n : bracketPairs.filter((p) => !(p[0] === '<' && p[1] === '>'));\n for (const [open, close] of colorizedBracketPairs) {\n const opening = openingBracketInfos.get(open);\n const closing = closingBracketInfos.get(close);\n opening.closing.add(closing.info);\n closing.openingColorized.add(opening.info);\n closing.opening.add(opening.info);\n }\n this._openingBrackets = new Map([...openingBracketInfos.cachedValues].map(([k, v]) => [k, v.info]));\n this._closingBrackets = new Map([...closingBracketInfos.cachedValues].map(([k, v]) => [k, v.info]));\n }\n /**\n * No two brackets have the same bracket text.\n */\n get openingBrackets() {\n return [...this._openingBrackets.values()];\n }\n /**\n * No two brackets have the same bracket text.\n */\n get closingBrackets() {\n return [...this._closingBrackets.values()];\n }\n getOpeningBracketInfo(bracketText) {\n return this._openingBrackets.get(bracketText);\n }\n getClosingBracketInfo(bracketText) {\n return this._closingBrackets.get(bracketText);\n }\n getBracketInfo(bracketText) {\n return this.getOpeningBracketInfo(bracketText) || this.getClosingBracketInfo(bracketText);\n }\n}\nfunction filterValidBrackets(bracketPairs) {\n return bracketPairs.filter(([open, close]) => open !== '' && close !== '');\n}\nexport class BracketKindBase {\n constructor(config, bracketText) {\n this.config = config;\n this.bracketText = bracketText;\n }\n get languageId() {\n return this.config.languageId;\n }\n}\nexport class OpeningBracketKind extends BracketKindBase {\n constructor(config, bracketText, openedBrackets) {\n super(config, bracketText);\n this.openedBrackets = openedBrackets;\n this.isOpeningBracket = true;\n }\n}\nexport class ClosingBracketKind extends BracketKindBase {\n constructor(config, bracketText, \n /**\n * Non empty array of all opening brackets this bracket closes.\n */\n openingBrackets, openingColorizedBrackets) {\n super(config, bracketText);\n this.openingBrackets = openingBrackets;\n this.openingColorizedBrackets = openingColorizedBrackets;\n this.isOpeningBracket = false;\n }\n /**\n * Checks if this bracket closes the given other bracket.\n * If the bracket infos come from different configurations, this method will return false.\n */\n closes(other) {\n if (other['config'] !== this.config) {\n return false;\n }\n return this.openingBrackets.has(other);\n }\n closesColorized(other) {\n if (other['config'] !== this.config) {\n return false;\n }\n return this.openingColorizedBrackets.has(other);\n }\n getOpeningBrackets() {\n return [...this.openingBrackets];\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport { Emitter } from '../../../base/common/event.js';\nimport { Disposable, toDisposable } from '../../../base/common/lifecycle.js';\nimport * as strings from '../../../base/common/strings.js';\nimport { DEFAULT_WORD_REGEXP, ensureValidWordDefinition } from '../core/wordHelper.js';\nimport { AutoClosingPairs } from './languageConfiguration.js';\nimport { createScopedLineTokens } from './supports.js';\nimport { CharacterPairSupport } from './supports/characterPair.js';\nimport { BracketElectricCharacterSupport } from './supports/electricCharacter.js';\nimport { IndentRulesSupport } from './supports/indentRules.js';\nimport { OnEnterSupport } from './supports/onEnter.js';\nimport { RichEditBrackets } from './supports/richEditBrackets.js';\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nimport { IConfigurationService } from '../../../platform/configuration/common/configuration.js';\nimport { ILanguageService } from './language.js';\nimport { registerSingleton } from '../../../platform/instantiation/common/extensions.js';\nimport { PLAINTEXT_LANGUAGE_ID } from './modesRegistry.js';\nimport { LanguageBracketsConfiguration } from './supports/languageBracketsConfiguration.js';\nexport class LanguageConfigurationServiceChangeEvent {\n constructor(languageId) {\n this.languageId = languageId;\n }\n affects(languageId) {\n return !this.languageId ? true : this.languageId === languageId;\n }\n}\nexport const ILanguageConfigurationService = createDecorator('languageConfigurationService');\nlet LanguageConfigurationService = class LanguageConfigurationService extends Disposable {\n constructor(configurationService, languageService) {\n super();\n this.configurationService = configurationService;\n this.languageService = languageService;\n this._registry = this._register(new LanguageConfigurationRegistry());\n this.onDidChangeEmitter = this._register(new Emitter());\n this.onDidChange = this.onDidChangeEmitter.event;\n this.configurations = new Map();\n const languageConfigKeys = new Set(Object.values(customizedLanguageConfigKeys));\n this._register(this.configurationService.onDidChangeConfiguration((e) => {\n const globalConfigChanged = e.change.keys.some((k) => languageConfigKeys.has(k));\n const localConfigChanged = e.change.overrides\n .filter(([overrideLangName, keys]) => keys.some((k) => languageConfigKeys.has(k)))\n .map(([overrideLangName]) => overrideLangName);\n if (globalConfigChanged) {\n this.configurations.clear();\n this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(undefined));\n }\n else {\n for (const languageId of localConfigChanged) {\n if (this.languageService.isRegisteredLanguageId(languageId)) {\n this.configurations.delete(languageId);\n this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(languageId));\n }\n }\n }\n }));\n this._register(this._registry.onDidChange((e) => {\n this.configurations.delete(e.languageId);\n this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(e.languageId));\n }));\n }\n register(languageId, configuration, priority) {\n return this._registry.register(languageId, configuration, priority);\n }\n getLanguageConfiguration(languageId) {\n let result = this.configurations.get(languageId);\n if (!result) {\n result = computeConfig(languageId, this._registry, this.configurationService, this.languageService);\n this.configurations.set(languageId, result);\n }\n return result;\n }\n};\nLanguageConfigurationService = __decorate([\n __param(0, IConfigurationService),\n __param(1, ILanguageService)\n], LanguageConfigurationService);\nexport { LanguageConfigurationService };\nfunction computeConfig(languageId, registry, configurationService, languageService) {\n let languageConfig = registry.getLanguageConfiguration(languageId);\n if (!languageConfig) {\n if (!languageService.isRegisteredLanguageId(languageId)) {\n // this happens for the null language, which can be returned by monarch.\n // Instead of throwing an error, we just return a default config.\n return new ResolvedLanguageConfiguration(languageId, {});\n }\n languageConfig = new ResolvedLanguageConfiguration(languageId, {});\n }\n const customizedConfig = getCustomizedLanguageConfig(languageConfig.languageId, configurationService);\n const data = combineLanguageConfigurations([languageConfig.underlyingConfig, customizedConfig]);\n const config = new ResolvedLanguageConfiguration(languageConfig.languageId, data);\n return config;\n}\nconst customizedLanguageConfigKeys = {\n brackets: 'editor.language.brackets',\n colorizedBracketPairs: 'editor.language.colorizedBracketPairs'\n};\nfunction getCustomizedLanguageConfig(languageId, configurationService) {\n const brackets = configurationService.getValue(customizedLanguageConfigKeys.brackets, {\n overrideIdentifier: languageId,\n });\n const colorizedBracketPairs = configurationService.getValue(customizedLanguageConfigKeys.colorizedBracketPairs, {\n overrideIdentifier: languageId,\n });\n return {\n brackets: validateBracketPairs(brackets),\n colorizedBracketPairs: validateBracketPairs(colorizedBracketPairs),\n };\n}\nfunction validateBracketPairs(data) {\n if (!Array.isArray(data)) {\n return undefined;\n }\n return data.map(pair => {\n if (!Array.isArray(pair) || pair.length !== 2) {\n return undefined;\n }\n return [pair[0], pair[1]];\n }).filter((p) => !!p);\n}\nexport function getIndentationAtPosition(model, lineNumber, column) {\n const lineText = model.getLineContent(lineNumber);\n let indentation = strings.getLeadingWhitespace(lineText);\n if (indentation.length > column - 1) {\n indentation = indentation.substring(0, column - 1);\n }\n return indentation;\n}\nexport function getScopedLineTokens(model, lineNumber, columnNumber) {\n model.tokenization.forceTokenization(lineNumber);\n const lineTokens = model.tokenization.getLineTokens(lineNumber);\n const column = (typeof columnNumber === 'undefined' ? model.getLineMaxColumn(lineNumber) - 1 : columnNumber - 1);\n return createScopedLineTokens(lineTokens, column);\n}\nclass ComposedLanguageConfiguration {\n constructor(languageId) {\n this.languageId = languageId;\n this._resolved = null;\n this._entries = [];\n this._order = 0;\n this._resolved = null;\n }\n register(configuration, priority) {\n const entry = new LanguageConfigurationContribution(configuration, priority, ++this._order);\n this._entries.push(entry);\n this._resolved = null;\n return toDisposable(() => {\n for (let i = 0; i < this._entries.length; i++) {\n if (this._entries[i] === entry) {\n this._entries.splice(i, 1);\n this._resolved = null;\n break;\n }\n }\n });\n }\n getResolvedConfiguration() {\n if (!this._resolved) {\n const config = this._resolve();\n if (config) {\n this._resolved = new ResolvedLanguageConfiguration(this.languageId, config);\n }\n }\n return this._resolved;\n }\n _resolve() {\n if (this._entries.length === 0) {\n return null;\n }\n this._entries.sort(LanguageConfigurationContribution.cmp);\n return combineLanguageConfigurations(this._entries.map(e => e.configuration));\n }\n}\nfunction combineLanguageConfigurations(configs) {\n let result = {\n comments: undefined,\n brackets: undefined,\n wordPattern: undefined,\n indentationRules: undefined,\n onEnterRules: undefined,\n autoClosingPairs: undefined,\n surroundingPairs: undefined,\n autoCloseBefore: undefined,\n folding: undefined,\n colorizedBracketPairs: undefined,\n __electricCharacterSupport: undefined,\n };\n for (const entry of configs) {\n result = {\n comments: entry.comments || result.comments,\n brackets: entry.brackets || result.brackets,\n wordPattern: entry.wordPattern || result.wordPattern,\n indentationRules: entry.indentationRules || result.indentationRules,\n onEnterRules: entry.onEnterRules || result.onEnterRules,\n autoClosingPairs: entry.autoClosingPairs || result.autoClosingPairs,\n surroundingPairs: entry.surroundingPairs || result.surroundingPairs,\n autoCloseBefore: entry.autoCloseBefore || result.autoCloseBefore,\n folding: entry.folding || result.folding,\n colorizedBracketPairs: entry.colorizedBracketPairs || result.colorizedBracketPairs,\n __electricCharacterSupport: entry.__electricCharacterSupport || result.__electricCharacterSupport,\n };\n }\n return result;\n}\nclass LanguageConfigurationContribution {\n constructor(configuration, priority, order) {\n this.configuration = configuration;\n this.priority = priority;\n this.order = order;\n }\n static cmp(a, b) {\n if (a.priority === b.priority) {\n // higher order last\n return a.order - b.order;\n }\n // higher priority last\n return a.priority - b.priority;\n }\n}\nexport class LanguageConfigurationChangeEvent {\n constructor(languageId) {\n this.languageId = languageId;\n }\n}\nexport class LanguageConfigurationRegistry extends Disposable {\n constructor() {\n super();\n this._entries = new Map();\n this._onDidChange = this._register(new Emitter());\n this.onDidChange = this._onDidChange.event;\n this._register(this.register(PLAINTEXT_LANGUAGE_ID, {\n brackets: [\n ['(', ')'],\n ['[', ']'],\n ['{', '}'],\n ],\n surroundingPairs: [\n { open: '{', close: '}' },\n { open: '[', close: ']' },\n { open: '(', close: ')' },\n { open: '<', close: '>' },\n { open: '\\\"', close: '\\\"' },\n { open: '\\'', close: '\\'' },\n { open: '`', close: '`' },\n ],\n colorizedBracketPairs: [],\n folding: {\n offSide: true\n }\n }, 0));\n }\n /**\n * @param priority Use a higher number for higher priority\n */\n register(languageId, configuration, priority = 0) {\n let entries = this._entries.get(languageId);\n if (!entries) {\n entries = new ComposedLanguageConfiguration(languageId);\n this._entries.set(languageId, entries);\n }\n const disposable = entries.register(configuration, priority);\n this._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId));\n return toDisposable(() => {\n disposable.dispose();\n this._onDidChange.fire(new LanguageConfigurationChangeEvent(languageId));\n });\n }\n getLanguageConfiguration(languageId) {\n const entries = this._entries.get(languageId);\n return (entries === null || entries === void 0 ? void 0 : entries.getResolvedConfiguration()) || null;\n }\n}\n/**\n * Immutable.\n*/\nexport class ResolvedLanguageConfiguration {\n constructor(languageId, underlyingConfig) {\n this.languageId = languageId;\n this.underlyingConfig = underlyingConfig;\n this._brackets = null;\n this._electricCharacter = null;\n this._onEnterSupport =\n this.underlyingConfig.brackets ||\n this.underlyingConfig.indentationRules ||\n this.underlyingConfig.onEnterRules\n ? new OnEnterSupport(this.underlyingConfig)\n : null;\n this.comments = ResolvedLanguageConfiguration._handleComments(this.underlyingConfig);\n this.characterPair = new CharacterPairSupport(this.underlyingConfig);\n this.wordDefinition = this.underlyingConfig.wordPattern || DEFAULT_WORD_REGEXP;\n this.indentationRules = this.underlyingConfig.indentationRules;\n if (this.underlyingConfig.indentationRules) {\n this.indentRulesSupport = new IndentRulesSupport(this.underlyingConfig.indentationRules);\n }\n else {\n this.indentRulesSupport = null;\n }\n this.foldingRules = this.underlyingConfig.folding || {};\n this.bracketsNew = new LanguageBracketsConfiguration(languageId, this.underlyingConfig);\n }\n getWordDefinition() {\n return ensureValidWordDefinition(this.wordDefinition);\n }\n get brackets() {\n if (!this._brackets && this.underlyingConfig.brackets) {\n this._brackets = new RichEditBrackets(this.languageId, this.underlyingConfig.brackets);\n }\n return this._brackets;\n }\n get electricCharacter() {\n if (!this._electricCharacter) {\n this._electricCharacter = new BracketElectricCharacterSupport(this.brackets);\n }\n return this._electricCharacter;\n }\n onEnter(autoIndent, previousLineText, beforeEnterText, afterEnterText) {\n if (!this._onEnterSupport) {\n return null;\n }\n return this._onEnterSupport.onEnter(autoIndent, previousLineText, beforeEnterText, afterEnterText);\n }\n getAutoClosingPairs() {\n return new AutoClosingPairs(this.characterPair.getAutoClosingPairs());\n }\n getAutoCloseBeforeSet(forQuotes) {\n return this.characterPair.getAutoCloseBeforeSet(forQuotes);\n }\n getSurroundingPairs() {\n return this.characterPair.getSurroundingPairs();\n }\n static _handleComments(conf) {\n const commentRule = conf.comments;\n if (!commentRule) {\n return null;\n }\n // comment configuration\n const comments = {};\n if (commentRule.lineComment) {\n comments.lineCommentToken = commentRule.lineComment;\n }\n if (commentRule.blockComment) {\n const [blockStart, blockEnd] = commentRule.blockComment;\n comments.blockCommentStartToken = blockStart;\n comments.blockCommentEndToken = blockEnd;\n }\n return comments;\n }\n}\nregisterSingleton(ILanguageConfigurationService, LanguageConfigurationService, 1 /* InstantiationType.Delayed */);\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Represents information about a specific difference between two sequences.\n */\nexport class DiffChange {\n /**\n * Constructs a new DiffChange with the given sequence information\n * and content.\n */\n constructor(originalStart, originalLength, modifiedStart, modifiedLength) {\n //Debug.Assert(originalLength > 0 || modifiedLength > 0, \"originalLength and modifiedLength cannot both be <= 0\");\n this.originalStart = originalStart;\n this.originalLength = originalLength;\n this.modifiedStart = modifiedStart;\n this.modifiedLength = modifiedLength;\n }\n /**\n * The end point (exclusive) of the change in the original sequence.\n */\n getOriginalEnd() {\n return this.originalStart + this.originalLength;\n }\n /**\n * The end point (exclusive) of the change in the modified sequence.\n */\n getModifiedEnd() {\n return this.modifiedStart + this.modifiedLength;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { DiffChange } from './diffChange.js';\nimport { stringHash } from '../hash.js';\nexport class StringDiffSequence {\n constructor(source) {\n this.source = source;\n }\n getElements() {\n const source = this.source;\n const characters = new Int32Array(source.length);\n for (let i = 0, len = source.length; i < len; i++) {\n characters[i] = source.charCodeAt(i);\n }\n return characters;\n }\n}\nexport function stringDiff(original, modified, pretty) {\n return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes;\n}\n//\n// The code below has been ported from a C# implementation in VS\n//\nclass Debug {\n static Assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n }\n}\nclass MyArray {\n /**\n * Copies a range of elements from an Array starting at the specified source index and pastes\n * them to another Array starting at the specified destination index. The length and the indexes\n * are specified as 64-bit integers.\n * sourceArray:\n *\t\tThe Array that contains the data to copy.\n * sourceIndex:\n *\t\tA 64-bit integer that represents the index in the sourceArray at which copying begins.\n * destinationArray:\n *\t\tThe Array that receives the data.\n * destinationIndex:\n *\t\tA 64-bit integer that represents the index in the destinationArray at which storing begins.\n * length:\n *\t\tA 64-bit integer that represents the number of elements to copy.\n */\n static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {\n for (let i = 0; i < length; i++) {\n destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];\n }\n }\n static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {\n for (let i = 0; i < length; i++) {\n destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];\n }\n }\n}\n/**\n * A utility class which helps to create the set of DiffChanges from\n * a difference operation. This class accepts original DiffElements and\n * modified DiffElements that are involved in a particular change. The\n * MarkNextChange() method can be called to mark the separation between\n * distinct changes. At the end, the Changes property can be called to retrieve\n * the constructed changes.\n */\nclass DiffChangeHelper {\n /**\n * Constructs a new DiffChangeHelper for the given DiffSequences.\n */\n constructor() {\n this.m_changes = [];\n this.m_originalStart = 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */;\n this.m_modifiedStart = 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */;\n this.m_originalCount = 0;\n this.m_modifiedCount = 0;\n }\n /**\n * Marks the beginning of the next change in the set of differences.\n */\n MarkNextChange() {\n // Only add to the list if there is something to add\n if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n // Add the new change to our list\n this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount));\n }\n // Reset for the next change\n this.m_originalCount = 0;\n this.m_modifiedCount = 0;\n this.m_originalStart = 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */;\n this.m_modifiedStart = 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */;\n }\n /**\n * Adds the original element at the given position to the elements\n * affected by the current change. The modified index gives context\n * to the change position with respect to the original sequence.\n * @param originalIndex The index of the original element to add.\n * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence.\n */\n AddOriginalElement(originalIndex, modifiedIndex) {\n // The 'true' start index is the smallest of the ones we've seen\n this.m_originalStart = Math.min(this.m_originalStart, originalIndex);\n this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\n this.m_originalCount++;\n }\n /**\n * Adds the modified element at the given position to the elements\n * affected by the current change. The original index gives context\n * to the change position with respect to the modified sequence.\n * @param originalIndex The index of the original element that provides corresponding position in the original sequence.\n * @param modifiedIndex The index of the modified element to add.\n */\n AddModifiedElement(originalIndex, modifiedIndex) {\n // The 'true' start index is the smallest of the ones we've seen\n this.m_originalStart = Math.min(this.m_originalStart, originalIndex);\n this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\n this.m_modifiedCount++;\n }\n /**\n * Retrieves all of the changes marked by the class.\n */\n getChanges() {\n if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n // Finish up on whatever is left\n this.MarkNextChange();\n }\n return this.m_changes;\n }\n /**\n * Retrieves all of the changes marked by the class in the reverse order\n */\n getReverseChanges() {\n if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n // Finish up on whatever is left\n this.MarkNextChange();\n }\n this.m_changes.reverse();\n return this.m_changes;\n }\n}\n/**\n * An implementation of the difference algorithm described in\n * \"An O(ND) Difference Algorithm and its variations\" by Eugene W. Myers\n */\nexport class LcsDiff {\n /**\n * Constructs the DiffFinder\n */\n constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) {\n this.ContinueProcessingPredicate = continueProcessingPredicate;\n this._originalSequence = originalSequence;\n this._modifiedSequence = modifiedSequence;\n const [originalStringElements, originalElementsOrHash, originalHasStrings] = LcsDiff._getElements(originalSequence);\n const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = LcsDiff._getElements(modifiedSequence);\n this._hasStrings = (originalHasStrings && modifiedHasStrings);\n this._originalStringElements = originalStringElements;\n this._originalElementsOrHash = originalElementsOrHash;\n this._modifiedStringElements = modifiedStringElements;\n this._modifiedElementsOrHash = modifiedElementsOrHash;\n this.m_forwardHistory = [];\n this.m_reverseHistory = [];\n }\n static _isStringArray(arr) {\n return (arr.length > 0 && typeof arr[0] === 'string');\n }\n static _getElements(sequence) {\n const elements = sequence.getElements();\n if (LcsDiff._isStringArray(elements)) {\n const hashes = new Int32Array(elements.length);\n for (let i = 0, len = elements.length; i < len; i++) {\n hashes[i] = stringHash(elements[i], 0);\n }\n return [elements, hashes, true];\n }\n if (elements instanceof Int32Array) {\n return [[], elements, false];\n }\n return [[], new Int32Array(elements), false];\n }\n ElementsAreEqual(originalIndex, newIndex) {\n if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) {\n return false;\n }\n return (this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true);\n }\n ElementsAreStrictEqual(originalIndex, newIndex) {\n if (!this.ElementsAreEqual(originalIndex, newIndex)) {\n return false;\n }\n const originalElement = LcsDiff._getStrictElement(this._originalSequence, originalIndex);\n const modifiedElement = LcsDiff._getStrictElement(this._modifiedSequence, newIndex);\n return (originalElement === modifiedElement);\n }\n static _getStrictElement(sequence, index) {\n if (typeof sequence.getStrictElement === 'function') {\n return sequence.getStrictElement(index);\n }\n return null;\n }\n OriginalElementsAreEqual(index1, index2) {\n if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) {\n return false;\n }\n return (this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true);\n }\n ModifiedElementsAreEqual(index1, index2) {\n if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) {\n return false;\n }\n return (this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true);\n }\n ComputeDiff(pretty) {\n return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty);\n }\n /**\n * Computes the differences between the original and modified input\n * sequences on the bounded range.\n * @returns An array of the differences between the two input sequences.\n */\n _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) {\n const quitEarlyArr = [false];\n let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr);\n if (pretty) {\n // We have to clean up the computed diff to be more intuitive\n // but it turns out this cannot be done correctly until the entire set\n // of diffs have been computed\n changes = this.PrettifyChanges(changes);\n }\n return {\n quitEarly: quitEarlyArr[0],\n changes: changes\n };\n }\n /**\n * Private helper method which computes the differences on the bounded range\n * recursively.\n * @returns An array of the differences between the two input sequences.\n */\n ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) {\n quitEarlyArr[0] = false;\n // Find the start of the differences\n while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) {\n originalStart++;\n modifiedStart++;\n }\n // Find the end of the differences\n while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) {\n originalEnd--;\n modifiedEnd--;\n }\n // In the special case where we either have all insertions or all deletions or the sequences are identical\n if (originalStart > originalEnd || modifiedStart > modifiedEnd) {\n let changes;\n if (modifiedStart <= modifiedEnd) {\n Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\n // All insertions\n changes = [\n new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1)\n ];\n }\n else if (originalStart <= originalEnd) {\n Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\n // All deletions\n changes = [\n new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0)\n ];\n }\n else {\n Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\n Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\n // Identical sequences - No differences\n changes = [];\n }\n return changes;\n }\n // This problem can be solved using the Divide-And-Conquer technique.\n const midOriginalArr = [0];\n const midModifiedArr = [0];\n const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);\n const midOriginal = midOriginalArr[0];\n const midModified = midModifiedArr[0];\n if (result !== null) {\n // Result is not-null when there was enough memory to compute the changes while\n // searching for the recursion point\n return result;\n }\n else if (!quitEarlyArr[0]) {\n // We can break the problem down recursively by finding the changes in the\n // First Half: (originalStart, modifiedStart) to (midOriginal, midModified)\n // Second Half: (midOriginal + 1, minModified + 1) to (originalEnd, modifiedEnd)\n // NOTE: ComputeDiff() is inclusive, therefore the second range starts on the next point\n const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr);\n let rightChanges = [];\n if (!quitEarlyArr[0]) {\n rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr);\n }\n else {\n // We didn't have time to finish the first half, so we don't have time to compute this half.\n // Consider the entire rest of the sequence different.\n rightChanges = [\n new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1)\n ];\n }\n return this.ConcatenateChanges(leftChanges, rightChanges);\n }\n // If we hit here, we quit early, and so can't return anything meaningful\n return [\n new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)\n ];\n }\n WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) {\n let forwardChanges = null;\n let reverseChanges = null;\n // First, walk backward through the forward diagonals history\n let changeHelper = new DiffChangeHelper();\n let diagonalMin = diagonalForwardStart;\n let diagonalMax = diagonalForwardEnd;\n let diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset;\n let lastOriginalIndex = -1073741824 /* Constants.MIN_SAFE_SMALL_INTEGER */;\n let historyIndex = this.m_forwardHistory.length - 1;\n do {\n // Get the diagonal index from the relative diagonal number\n const diagonal = diagonalRelative + diagonalForwardBase;\n // Figure out where we came from\n if (diagonal === diagonalMin || (diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\n // Vertical line (the element is an insert)\n originalIndex = forwardPoints[diagonal + 1];\n modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\n if (originalIndex < lastOriginalIndex) {\n changeHelper.MarkNextChange();\n }\n lastOriginalIndex = originalIndex;\n changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex);\n diagonalRelative = (diagonal + 1) - diagonalForwardBase; //Setup for the next iteration\n }\n else {\n // Horizontal line (the element is a deletion)\n originalIndex = forwardPoints[diagonal - 1] + 1;\n modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\n if (originalIndex < lastOriginalIndex) {\n changeHelper.MarkNextChange();\n }\n lastOriginalIndex = originalIndex - 1;\n changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1);\n diagonalRelative = (diagonal - 1) - diagonalForwardBase; //Setup for the next iteration\n }\n if (historyIndex >= 0) {\n forwardPoints = this.m_forwardHistory[historyIndex];\n diagonalForwardBase = forwardPoints[0]; //We stored this in the first spot\n diagonalMin = 1;\n diagonalMax = forwardPoints.length - 1;\n }\n } while (--historyIndex >= -1);\n // Ironically, we get the forward changes as the reverse of the\n // order we added them since we technically added them backwards\n forwardChanges = changeHelper.getReverseChanges();\n if (quitEarlyArr[0]) {\n // TODO: Calculate a partial from the reverse diagonals.\n // For now, just assume everything after the midOriginal/midModified point is a diff\n let originalStartPoint = midOriginalArr[0] + 1;\n let modifiedStartPoint = midModifiedArr[0] + 1;\n if (forwardChanges !== null && forwardChanges.length > 0) {\n const lastForwardChange = forwardChanges[forwardChanges.length - 1];\n originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd());\n modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd());\n }\n reverseChanges = [\n new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1)\n ];\n }\n else {\n // Now walk backward through the reverse diagonals history\n changeHelper = new DiffChangeHelper();\n diagonalMin = diagonalReverseStart;\n diagonalMax = diagonalReverseEnd;\n diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset;\n lastOriginalIndex = 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */;\n historyIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;\n do {\n // Get the diagonal index from the relative diagonal number\n const diagonal = diagonalRelative + diagonalReverseBase;\n // Figure out where we came from\n if (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\n // Horizontal line (the element is a deletion))\n originalIndex = reversePoints[diagonal + 1] - 1;\n modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\n if (originalIndex > lastOriginalIndex) {\n changeHelper.MarkNextChange();\n }\n lastOriginalIndex = originalIndex + 1;\n changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);\n diagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration\n }\n else {\n // Vertical line (the element is an insertion)\n originalIndex = reversePoints[diagonal - 1];\n modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\n if (originalIndex > lastOriginalIndex) {\n changeHelper.MarkNextChange();\n }\n lastOriginalIndex = originalIndex;\n changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1);\n diagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration\n }\n if (historyIndex >= 0) {\n reversePoints = this.m_reverseHistory[historyIndex];\n diagonalReverseBase = reversePoints[0]; //We stored this in the first spot\n diagonalMin = 1;\n diagonalMax = reversePoints.length - 1;\n }\n } while (--historyIndex >= -1);\n // There are cases where the reverse history will find diffs that\n // are correct, but not intuitive, so we need shift them.\n reverseChanges = changeHelper.getChanges();\n }\n return this.ConcatenateChanges(forwardChanges, reverseChanges);\n }\n /**\n * Given the range to compute the diff on, this method finds the point:\n * (midOriginal, midModified)\n * that exists in the middle of the LCS of the two sequences and\n * is the point at which the LCS problem may be broken down recursively.\n * This method will try to keep the LCS trace in memory. If the LCS recursion\n * point is calculated and the full trace is available in memory, then this method\n * will return the change list.\n * @param originalStart The start bound of the original sequence range\n * @param originalEnd The end bound of the original sequence range\n * @param modifiedStart The start bound of the modified sequence range\n * @param modifiedEnd The end bound of the modified sequence range\n * @param midOriginal The middle point of the original sequence range\n * @param midModified The middle point of the modified sequence range\n * @returns The diff changes, if available, otherwise null\n */\n ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) {\n let originalIndex = 0, modifiedIndex = 0;\n let diagonalForwardStart = 0, diagonalForwardEnd = 0;\n let diagonalReverseStart = 0, diagonalReverseEnd = 0;\n // To traverse the edit graph and produce the proper LCS, our actual\n // start position is just outside the given boundary\n originalStart--;\n modifiedStart--;\n // We set these up to make the compiler happy, but they will\n // be replaced before we return with the actual recursion point\n midOriginalArr[0] = 0;\n midModifiedArr[0] = 0;\n // Clear out the history\n this.m_forwardHistory = [];\n this.m_reverseHistory = [];\n // Each cell in the two arrays corresponds to a diagonal in the edit graph.\n // The integer value in the cell represents the originalIndex of the furthest\n // reaching point found so far that ends in that diagonal.\n // The modifiedIndex can be computed mathematically from the originalIndex and the diagonal number.\n const maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart);\n const numDiagonals = maxDifferences + 1;\n const forwardPoints = new Int32Array(numDiagonals);\n const reversePoints = new Int32Array(numDiagonals);\n // diagonalForwardBase: Index into forwardPoints of the diagonal which passes through (originalStart, modifiedStart)\n // diagonalReverseBase: Index into reversePoints of the diagonal which passes through (originalEnd, modifiedEnd)\n const diagonalForwardBase = (modifiedEnd - modifiedStart);\n const diagonalReverseBase = (originalEnd - originalStart);\n // diagonalForwardOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\n // diagonal number (relative to diagonalForwardBase)\n // diagonalReverseOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\n // diagonal number (relative to diagonalReverseBase)\n const diagonalForwardOffset = (originalStart - modifiedStart);\n const diagonalReverseOffset = (originalEnd - modifiedEnd);\n // delta: The difference between the end diagonal and the start diagonal. This is used to relate diagonal numbers\n // relative to the start diagonal with diagonal numbers relative to the end diagonal.\n // The Even/Oddn-ness of this delta is important for determining when we should check for overlap\n const delta = diagonalReverseBase - diagonalForwardBase;\n const deltaIsEven = (delta % 2 === 0);\n // Here we set up the start and end points as the furthest points found so far\n // in both the forward and reverse directions, respectively\n forwardPoints[diagonalForwardBase] = originalStart;\n reversePoints[diagonalReverseBase] = originalEnd;\n // Remember if we quit early, and thus need to do a best-effort result instead of a real result.\n quitEarlyArr[0] = false;\n // A couple of points:\n // --With this method, we iterate on the number of differences between the two sequences.\n // The more differences there actually are, the longer this will take.\n // --Also, as the number of differences increases, we have to search on diagonals further\n // away from the reference diagonal (which is diagonalForwardBase for forward, diagonalReverseBase for reverse).\n // --We extend on even diagonals (relative to the reference diagonal) only when numDifferences\n // is even and odd diagonals only when numDifferences is odd.\n for (let numDifferences = 1; numDifferences <= (maxDifferences / 2) + 1; numDifferences++) {\n let furthestOriginalIndex = 0;\n let furthestModifiedIndex = 0;\n // Run the algorithm in the forward direction\n diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\n diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\n for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) {\n // STEP 1: We extend the furthest reaching point in the present diagonal\n // by looking at the diagonals above and below and picking the one whose point\n // is further away from the start point (originalStart, modifiedStart)\n if (diagonal === diagonalForwardStart || (diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\n originalIndex = forwardPoints[diagonal + 1];\n }\n else {\n originalIndex = forwardPoints[diagonal - 1] + 1;\n }\n modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset;\n // Save the current originalIndex so we can test for false overlap in step 3\n const tempOriginalIndex = originalIndex;\n // STEP 2: We can continue to extend the furthest reaching point in the present diagonal\n // so long as the elements are equal.\n while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) {\n originalIndex++;\n modifiedIndex++;\n }\n forwardPoints[diagonal] = originalIndex;\n if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) {\n furthestOriginalIndex = originalIndex;\n furthestModifiedIndex = modifiedIndex;\n }\n // STEP 3: If delta is odd (overlap first happens on forward when delta is odd)\n // and diagonal is in the range of reverse diagonals computed for numDifferences-1\n // (the previous iteration; we haven't computed reverse diagonals for numDifferences yet)\n // then check for overlap.\n if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= (numDifferences - 1)) {\n if (originalIndex >= reversePoints[diagonal]) {\n midOriginalArr[0] = originalIndex;\n midModifiedArr[0] = modifiedIndex;\n if (tempOriginalIndex <= reversePoints[diagonal] && 1447 /* LocalConstants.MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* LocalConstants.MaxDifferencesHistory */ + 1)) {\n // BINGO! We overlapped, and we have the full trace in memory!\n return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\n }\n else {\n // Either false overlap, or we didn't have enough memory for the full trace\n // Just return the recursion point\n return null;\n }\n }\n }\n }\n // Check to see if we should be quitting early, before moving on to the next iteration.\n const matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;\n if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) {\n // We can't finish, so skip ahead to generating a result from what we have.\n quitEarlyArr[0] = true;\n // Use the furthest distance we got in the forward direction.\n midOriginalArr[0] = furthestOriginalIndex;\n midModifiedArr[0] = furthestModifiedIndex;\n if (matchLengthOfLongest > 0 && 1447 /* LocalConstants.MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* LocalConstants.MaxDifferencesHistory */ + 1)) {\n // Enough of the history is in memory to walk it backwards\n return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\n }\n else {\n // We didn't actually remember enough of the history.\n //Since we are quitting the diff early, we need to shift back the originalStart and modified start\n //back into the boundary limits since we decremented their value above beyond the boundary limit.\n originalStart++;\n modifiedStart++;\n return [\n new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)\n ];\n }\n }\n // Run the algorithm in the reverse direction\n diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\n diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\n for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) {\n // STEP 1: We extend the furthest reaching point in the present diagonal\n // by looking at the diagonals above and below and picking the one whose point\n // is further away from the start point (originalEnd, modifiedEnd)\n if (diagonal === diagonalReverseStart || (diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\n originalIndex = reversePoints[diagonal + 1] - 1;\n }\n else {\n originalIndex = reversePoints[diagonal - 1];\n }\n modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset;\n // Save the current originalIndex so we can test for false overlap\n const tempOriginalIndex = originalIndex;\n // STEP 2: We can continue to extend the furthest reaching point in the present diagonal\n // as long as the elements are equal.\n while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) {\n originalIndex--;\n modifiedIndex--;\n }\n reversePoints[diagonal] = originalIndex;\n // STEP 4: If delta is even (overlap first happens on reverse when delta is even)\n // and diagonal is in the range of forward diagonals computed for numDifferences\n // then check for overlap.\n if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) {\n if (originalIndex <= forwardPoints[diagonal]) {\n midOriginalArr[0] = originalIndex;\n midModifiedArr[0] = modifiedIndex;\n if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 /* LocalConstants.MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* LocalConstants.MaxDifferencesHistory */ + 1)) {\n // BINGO! We overlapped, and we have the full trace in memory!\n return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\n }\n else {\n // Either false overlap, or we didn't have enough memory for the full trace\n // Just return the recursion point\n return null;\n }\n }\n }\n }\n // Save current vectors to history before the next iteration\n if (numDifferences <= 1447 /* LocalConstants.MaxDifferencesHistory */) {\n // We are allocating space for one extra int, which we fill with\n // the index of the diagonal base index\n let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2);\n temp[0] = diagonalForwardBase - diagonalForwardStart + 1;\n MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);\n this.m_forwardHistory.push(temp);\n temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2);\n temp[0] = diagonalReverseBase - diagonalReverseStart + 1;\n MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1);\n this.m_reverseHistory.push(temp);\n }\n }\n // If we got here, then we have the full trace in history. We just have to convert it to a change list\n // NOTE: This part is a bit messy\n return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);\n }\n /**\n * Shifts the given changes to provide a more intuitive diff.\n * While the first element in a diff matches the first element after the diff,\n * we shift the diff down.\n *\n * @param changes The list of changes to shift\n * @returns The shifted changes\n */\n PrettifyChanges(changes) {\n // Shift all the changes down first\n for (let i = 0; i < changes.length; i++) {\n const change = changes[i];\n const originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this._originalElementsOrHash.length;\n const modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length;\n const checkOriginal = change.originalLength > 0;\n const checkModified = change.modifiedLength > 0;\n while (change.originalStart + change.originalLength < originalStop\n && change.modifiedStart + change.modifiedLength < modifiedStop\n && (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength))\n && (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) {\n const startStrictEqual = this.ElementsAreStrictEqual(change.originalStart, change.modifiedStart);\n const endStrictEqual = this.ElementsAreStrictEqual(change.originalStart + change.originalLength, change.modifiedStart + change.modifiedLength);\n if (endStrictEqual && !startStrictEqual) {\n // moving the change down would create an equal change, but the elements are not strict equal\n break;\n }\n change.originalStart++;\n change.modifiedStart++;\n }\n const mergedChangeArr = [null];\n if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) {\n changes[i] = mergedChangeArr[0];\n changes.splice(i + 1, 1);\n i--;\n continue;\n }\n }\n // Shift changes back up until we hit empty or whitespace-only lines\n for (let i = changes.length - 1; i >= 0; i--) {\n const change = changes[i];\n let originalStop = 0;\n let modifiedStop = 0;\n if (i > 0) {\n const prevChange = changes[i - 1];\n originalStop = prevChange.originalStart + prevChange.originalLength;\n modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;\n }\n const checkOriginal = change.originalLength > 0;\n const checkModified = change.modifiedLength > 0;\n let bestDelta = 0;\n let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength);\n for (let delta = 1;; delta++) {\n const originalStart = change.originalStart - delta;\n const modifiedStart = change.modifiedStart - delta;\n if (originalStart < originalStop || modifiedStart < modifiedStop) {\n break;\n }\n if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) {\n break;\n }\n if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) {\n break;\n }\n const touchingPreviousChange = (originalStart === originalStop && modifiedStart === modifiedStop);\n const score = ((touchingPreviousChange ? 5 : 0)\n + this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength));\n if (score > bestScore) {\n bestScore = score;\n bestDelta = delta;\n }\n }\n change.originalStart -= bestDelta;\n change.modifiedStart -= bestDelta;\n const mergedChangeArr = [null];\n if (i > 0 && this.ChangesOverlap(changes[i - 1], changes[i], mergedChangeArr)) {\n changes[i - 1] = mergedChangeArr[0];\n changes.splice(i, 1);\n i++;\n continue;\n }\n }\n // There could be multiple longest common substrings.\n // Give preference to the ones containing longer lines\n if (this._hasStrings) {\n for (let i = 1, len = changes.length; i < len; i++) {\n const aChange = changes[i - 1];\n const bChange = changes[i];\n const matchedLength = bChange.originalStart - aChange.originalStart - aChange.originalLength;\n const aOriginalStart = aChange.originalStart;\n const bOriginalEnd = bChange.originalStart + bChange.originalLength;\n const abOriginalLength = bOriginalEnd - aOriginalStart;\n const aModifiedStart = aChange.modifiedStart;\n const bModifiedEnd = bChange.modifiedStart + bChange.modifiedLength;\n const abModifiedLength = bModifiedEnd - aModifiedStart;\n // Avoid wasting a lot of time with these searches\n if (matchedLength < 5 && abOriginalLength < 20 && abModifiedLength < 20) {\n const t = this._findBetterContiguousSequence(aOriginalStart, abOriginalLength, aModifiedStart, abModifiedLength, matchedLength);\n if (t) {\n const [originalMatchStart, modifiedMatchStart] = t;\n if (originalMatchStart !== aChange.originalStart + aChange.originalLength || modifiedMatchStart !== aChange.modifiedStart + aChange.modifiedLength) {\n // switch to another sequence that has a better score\n aChange.originalLength = originalMatchStart - aChange.originalStart;\n aChange.modifiedLength = modifiedMatchStart - aChange.modifiedStart;\n bChange.originalStart = originalMatchStart + matchedLength;\n bChange.modifiedStart = modifiedMatchStart + matchedLength;\n bChange.originalLength = bOriginalEnd - bChange.originalStart;\n bChange.modifiedLength = bModifiedEnd - bChange.modifiedStart;\n }\n }\n }\n }\n }\n return changes;\n }\n _findBetterContiguousSequence(originalStart, originalLength, modifiedStart, modifiedLength, desiredLength) {\n if (originalLength < desiredLength || modifiedLength < desiredLength) {\n return null;\n }\n const originalMax = originalStart + originalLength - desiredLength + 1;\n const modifiedMax = modifiedStart + modifiedLength - desiredLength + 1;\n let bestScore = 0;\n let bestOriginalStart = 0;\n let bestModifiedStart = 0;\n for (let i = originalStart; i < originalMax; i++) {\n for (let j = modifiedStart; j < modifiedMax; j++) {\n const score = this._contiguousSequenceScore(i, j, desiredLength);\n if (score > 0 && score > bestScore) {\n bestScore = score;\n bestOriginalStart = i;\n bestModifiedStart = j;\n }\n }\n }\n if (bestScore > 0) {\n return [bestOriginalStart, bestModifiedStart];\n }\n return null;\n }\n _contiguousSequenceScore(originalStart, modifiedStart, length) {\n let score = 0;\n for (let l = 0; l < length; l++) {\n if (!this.ElementsAreEqual(originalStart + l, modifiedStart + l)) {\n return 0;\n }\n score += this._originalStringElements[originalStart + l].length;\n }\n return score;\n }\n _OriginalIsBoundary(index) {\n if (index <= 0 || index >= this._originalElementsOrHash.length - 1) {\n return true;\n }\n return (this._hasStrings && /^\\s*$/.test(this._originalStringElements[index]));\n }\n _OriginalRegionIsBoundary(originalStart, originalLength) {\n if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) {\n return true;\n }\n if (originalLength > 0) {\n const originalEnd = originalStart + originalLength;\n if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) {\n return true;\n }\n }\n return false;\n }\n _ModifiedIsBoundary(index) {\n if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) {\n return true;\n }\n return (this._hasStrings && /^\\s*$/.test(this._modifiedStringElements[index]));\n }\n _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) {\n if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) {\n return true;\n }\n if (modifiedLength > 0) {\n const modifiedEnd = modifiedStart + modifiedLength;\n if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) {\n return true;\n }\n }\n return false;\n }\n _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) {\n const originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0);\n const modifiedScore = (this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0);\n return (originalScore + modifiedScore);\n }\n /**\n * Concatenates the two input DiffChange lists and returns the resulting\n * list.\n * @param The left changes\n * @param The right changes\n * @returns The concatenated list\n */\n ConcatenateChanges(left, right) {\n const mergedChangeArr = [];\n if (left.length === 0 || right.length === 0) {\n return (right.length > 0) ? right : left;\n }\n else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) {\n // Since we break the problem down recursively, it is possible that we\n // might recurse in the middle of a change thereby splitting it into\n // two changes. Here in the combining stage, we detect and fuse those\n // changes back together\n const result = new Array(left.length + right.length - 1);\n MyArray.Copy(left, 0, result, 0, left.length - 1);\n result[left.length - 1] = mergedChangeArr[0];\n MyArray.Copy(right, 1, result, left.length, right.length - 1);\n return result;\n }\n else {\n const result = new Array(left.length + right.length);\n MyArray.Copy(left, 0, result, 0, left.length);\n MyArray.Copy(right, 0, result, left.length, right.length);\n return result;\n }\n }\n /**\n * Returns true if the two changes overlap and can be merged into a single\n * change\n * @param left The left change\n * @param right The right change\n * @param mergedChange The merged change if the two overlap, null otherwise\n * @returns True if the two changes overlap\n */\n ChangesOverlap(left, right, mergedChangeArr) {\n Debug.Assert(left.originalStart <= right.originalStart, 'Left change is not less than or equal to right change');\n Debug.Assert(left.modifiedStart <= right.modifiedStart, 'Left change is not less than or equal to right change');\n if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\n const originalStart = left.originalStart;\n let originalLength = left.originalLength;\n const modifiedStart = left.modifiedStart;\n let modifiedLength = left.modifiedLength;\n if (left.originalStart + left.originalLength >= right.originalStart) {\n originalLength = right.originalStart + right.originalLength - left.originalStart;\n }\n if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\n modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart;\n }\n mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength);\n return true;\n }\n else {\n mergedChangeArr[0] = null;\n return false;\n }\n }\n /**\n * Helper method used to clip a diagonal index to the range of valid\n * diagonals. This also decides whether or not the diagonal index,\n * if it exceeds the boundary, should be clipped to the boundary or clipped\n * one inside the boundary depending on the Even/Odd status of the boundary\n * and numDifferences.\n * @param diagonal The index of the diagonal to clip.\n * @param numDifferences The current number of differences being iterated upon.\n * @param diagonalBaseIndex The base reference diagonal.\n * @param numDiagonals The total number of diagonals.\n * @returns The clipped diagonal index.\n */\n ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) {\n if (diagonal >= 0 && diagonal < numDiagonals) {\n // Nothing to clip, its in range\n return diagonal;\n }\n // diagonalsBelow: The number of diagonals below the reference diagonal\n // diagonalsAbove: The number of diagonals above the reference diagonal\n const diagonalsBelow = diagonalBaseIndex;\n const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;\n const diffEven = (numDifferences % 2 === 0);\n if (diagonal < 0) {\n const lowerBoundEven = (diagonalsBelow % 2 === 0);\n return (diffEven === lowerBoundEven) ? 0 : 1;\n }\n else {\n const upperBoundEven = (diagonalsAbove % 2 === 0);\n return (diffEven === upperBoundEven) ? numDiagonals - 1 : numDiagonals - 2;\n }\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport function toUint8(v) {\n if (v < 0) {\n return 0;\n }\n if (v > 255 /* Constants.MAX_UINT_8 */) {\n return 255 /* Constants.MAX_UINT_8 */;\n }\n return v | 0;\n}\nexport function toUint32(v) {\n if (v < 0) {\n return 0;\n }\n if (v > 4294967295 /* Constants.MAX_UINT_32 */) {\n return 4294967295 /* Constants.MAX_UINT_32 */;\n }\n return v | 0;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { arrayInsert } from '../../../base/common/arrays.js';\nimport { toUint32 } from '../../../base/common/uint.js';\nexport class PrefixSumComputer {\n constructor(values) {\n this.values = values;\n this.prefixSum = new Uint32Array(values.length);\n this.prefixSumValidIndex = new Int32Array(1);\n this.prefixSumValidIndex[0] = -1;\n }\n insertValues(insertIndex, insertValues) {\n insertIndex = toUint32(insertIndex);\n const oldValues = this.values;\n const oldPrefixSum = this.prefixSum;\n const insertValuesLen = insertValues.length;\n if (insertValuesLen === 0) {\n return false;\n }\n this.values = new Uint32Array(oldValues.length + insertValuesLen);\n this.values.set(oldValues.subarray(0, insertIndex), 0);\n this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen);\n this.values.set(insertValues, insertIndex);\n if (insertIndex - 1 < this.prefixSumValidIndex[0]) {\n this.prefixSumValidIndex[0] = insertIndex - 1;\n }\n this.prefixSum = new Uint32Array(this.values.length);\n if (this.prefixSumValidIndex[0] >= 0) {\n this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\n }\n return true;\n }\n setValue(index, value) {\n index = toUint32(index);\n value = toUint32(value);\n if (this.values[index] === value) {\n return false;\n }\n this.values[index] = value;\n if (index - 1 < this.prefixSumValidIndex[0]) {\n this.prefixSumValidIndex[0] = index - 1;\n }\n return true;\n }\n removeValues(startIndex, count) {\n startIndex = toUint32(startIndex);\n count = toUint32(count);\n const oldValues = this.values;\n const oldPrefixSum = this.prefixSum;\n if (startIndex >= oldValues.length) {\n return false;\n }\n const maxCount = oldValues.length - startIndex;\n if (count >= maxCount) {\n count = maxCount;\n }\n if (count === 0) {\n return false;\n }\n this.values = new Uint32Array(oldValues.length - count);\n this.values.set(oldValues.subarray(0, startIndex), 0);\n this.values.set(oldValues.subarray(startIndex + count), startIndex);\n this.prefixSum = new Uint32Array(this.values.length);\n if (startIndex - 1 < this.prefixSumValidIndex[0]) {\n this.prefixSumValidIndex[0] = startIndex - 1;\n }\n if (this.prefixSumValidIndex[0] >= 0) {\n this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\n }\n return true;\n }\n getTotalSum() {\n if (this.values.length === 0) {\n return 0;\n }\n return this._getPrefixSum(this.values.length - 1);\n }\n /**\n * Returns the sum of the first `index + 1` many items.\n * @returns `SUM(0 <= j <= index, values[j])`.\n */\n getPrefixSum(index) {\n if (index < 0) {\n return 0;\n }\n index = toUint32(index);\n return this._getPrefixSum(index);\n }\n _getPrefixSum(index) {\n if (index <= this.prefixSumValidIndex[0]) {\n return this.prefixSum[index];\n }\n let startIndex = this.prefixSumValidIndex[0] + 1;\n if (startIndex === 0) {\n this.prefixSum[0] = this.values[0];\n startIndex++;\n }\n if (index >= this.values.length) {\n index = this.values.length - 1;\n }\n for (let i = startIndex; i <= index; i++) {\n this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i];\n }\n this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index);\n return this.prefixSum[index];\n }\n getIndexOf(sum) {\n sum = Math.floor(sum);\n // Compute all sums (to get a fully valid prefixSum)\n this.getTotalSum();\n let low = 0;\n let high = this.values.length - 1;\n let mid = 0;\n let midStop = 0;\n let midStart = 0;\n while (low <= high) {\n mid = low + ((high - low) / 2) | 0;\n midStop = this.prefixSum[mid];\n midStart = midStop - this.values[mid];\n if (sum < midStart) {\n high = mid - 1;\n }\n else if (sum >= midStop) {\n low = mid + 1;\n }\n else {\n break;\n }\n }\n return new PrefixSumIndexOfResult(mid, sum - midStart);\n }\n}\n/**\n * {@link getIndexOf} has an amortized runtime complexity of O(1).\n *\n * ({@link PrefixSumComputer.getIndexOf} is just O(log n))\n*/\nexport class ConstantTimePrefixSumComputer {\n constructor(values) {\n this._values = values;\n this._isValid = false;\n this._validEndIndex = -1;\n this._prefixSum = [];\n this._indexBySum = [];\n }\n /**\n * @returns SUM(0 <= j < values.length, values[j])\n */\n getTotalSum() {\n this._ensureValid();\n return this._indexBySum.length;\n }\n /**\n * Returns the sum of the first `count` many items.\n * @returns `SUM(0 <= j < count, values[j])`.\n */\n getPrefixSum(count) {\n this._ensureValid();\n if (count === 0) {\n return 0;\n }\n return this._prefixSum[count - 1];\n }\n /**\n * @returns `result`, such that `getPrefixSum(result.index) + result.remainder = sum`\n */\n getIndexOf(sum) {\n this._ensureValid();\n const idx = this._indexBySum[sum];\n const viewLinesAbove = idx > 0 ? this._prefixSum[idx - 1] : 0;\n return new PrefixSumIndexOfResult(idx, sum - viewLinesAbove);\n }\n removeValues(start, deleteCount) {\n this._values.splice(start, deleteCount);\n this._invalidate(start);\n }\n insertValues(insertIndex, insertArr) {\n this._values = arrayInsert(this._values, insertIndex, insertArr);\n this._invalidate(insertIndex);\n }\n _invalidate(index) {\n this._isValid = false;\n this._validEndIndex = Math.min(this._validEndIndex, index - 1);\n }\n _ensureValid() {\n if (this._isValid) {\n return;\n }\n for (let i = this._validEndIndex + 1, len = this._values.length; i < len; i++) {\n const value = this._values[i];\n const sumAbove = i > 0 ? this._prefixSum[i - 1] : 0;\n this._prefixSum[i] = sumAbove + value;\n for (let j = 0; j < value; j++) {\n this._indexBySum[sumAbove + j] = i;\n }\n }\n // trim things\n this._prefixSum.length = this._values.length;\n this._indexBySum.length = this._prefixSum[this._prefixSum.length - 1];\n // mark as valid\n this._isValid = true;\n this._validEndIndex = this._values.length - 1;\n }\n setValue(index, value) {\n if (this._values[index] === value) {\n // no change\n return;\n }\n this._values[index] = value;\n this._invalidate(index);\n }\n}\nexport class PrefixSumIndexOfResult {\n constructor(index, remainder) {\n this.index = index;\n this.remainder = remainder;\n this._prefixSumIndexOfResultBrand = undefined;\n this.index = index;\n this.remainder = remainder;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { splitLines } from '../../../base/common/strings.js';\nimport { Position } from '../core/position.js';\nimport { PrefixSumComputer } from './prefixSumComputer.js';\nexport class MirrorTextModel {\n constructor(uri, lines, eol, versionId) {\n this._uri = uri;\n this._lines = lines;\n this._eol = eol;\n this._versionId = versionId;\n this._lineStarts = null;\n this._cachedTextValue = null;\n }\n dispose() {\n this._lines.length = 0;\n }\n get version() {\n return this._versionId;\n }\n getText() {\n if (this._cachedTextValue === null) {\n this._cachedTextValue = this._lines.join(this._eol);\n }\n return this._cachedTextValue;\n }\n onEvents(e) {\n if (e.eol && e.eol !== this._eol) {\n this._eol = e.eol;\n this._lineStarts = null;\n }\n // Update my lines\n const changes = e.changes;\n for (const change of changes) {\n this._acceptDeleteRange(change.range);\n this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text);\n }\n this._versionId = e.versionId;\n this._cachedTextValue = null;\n }\n _ensureLineStarts() {\n if (!this._lineStarts) {\n const eolLength = this._eol.length;\n const linesLength = this._lines.length;\n const lineStartValues = new Uint32Array(linesLength);\n for (let i = 0; i < linesLength; i++) {\n lineStartValues[i] = this._lines[i].length + eolLength;\n }\n this._lineStarts = new PrefixSumComputer(lineStartValues);\n }\n }\n /**\n * All changes to a line's text go through this method\n */\n _setLineText(lineIndex, newValue) {\n this._lines[lineIndex] = newValue;\n if (this._lineStarts) {\n // update prefix sum\n this._lineStarts.setValue(lineIndex, this._lines[lineIndex].length + this._eol.length);\n }\n }\n _acceptDeleteRange(range) {\n if (range.startLineNumber === range.endLineNumber) {\n if (range.startColumn === range.endColumn) {\n // Nothing to delete\n return;\n }\n // Delete text on the affected line\n this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\n + this._lines[range.startLineNumber - 1].substring(range.endColumn - 1));\n return;\n }\n // Take remaining text on last line and append it to remaining text on first line\n this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\n + this._lines[range.endLineNumber - 1].substring(range.endColumn - 1));\n // Delete middle lines\n this._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber);\n if (this._lineStarts) {\n // update prefix sum\n this._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber);\n }\n }\n _acceptInsertText(position, insertText) {\n if (insertText.length === 0) {\n // Nothing to insert\n return;\n }\n const insertLines = splitLines(insertText);\n if (insertLines.length === 1) {\n // Inserting text on one line\n this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1)\n + insertLines[0]\n + this._lines[position.lineNumber - 1].substring(position.column - 1));\n return;\n }\n // Append overflowing text from first line to the end of text to insert\n insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1);\n // Delete overflowing text from first line and insert text on first line\n this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1)\n + insertLines[0]);\n // Insert new lines & store lengths\n const newLengths = new Uint32Array(insertLines.length - 1);\n for (let i = 1; i < insertLines.length; i++) {\n this._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]);\n newLengths[i - 1] = insertLines[i].length + this._eol.length;\n }\n if (this._lineStarts) {\n // update prefix sum\n this._lineStarts.insertValues(position.lineNumber, newLengths);\n }\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { toUint8 } from '../../../base/common/uint.js';\n/**\n * A fast character classifier that uses a compact array for ASCII values.\n */\nexport class CharacterClassifier {\n constructor(_defaultValue) {\n const defaultValue = toUint8(_defaultValue);\n this._defaultValue = defaultValue;\n this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue);\n this._map = new Map();\n }\n static _createAsciiMap(defaultValue) {\n const asciiMap = new Uint8Array(256);\n asciiMap.fill(defaultValue);\n return asciiMap;\n }\n set(charCode, _value) {\n const value = toUint8(_value);\n if (charCode >= 0 && charCode < 256) {\n this._asciiMap[charCode] = value;\n }\n else {\n this._map.set(charCode, value);\n }\n }\n get(charCode) {\n if (charCode >= 0 && charCode < 256) {\n return this._asciiMap[charCode];\n }\n else {\n return (this._map.get(charCode) || this._defaultValue);\n }\n }\n clear() {\n this._asciiMap.fill(this._defaultValue);\n this._map.clear();\n }\n}\nexport class CharacterSet {\n constructor() {\n this._actual = new CharacterClassifier(0 /* Boolean.False */);\n }\n add(charCode) {\n this._actual.set(charCode, 1 /* Boolean.True */);\n }\n has(charCode) {\n return (this._actual.get(charCode) === 1 /* Boolean.True */);\n }\n clear() {\n return this._actual.clear();\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { CharacterClassifier } from '../core/characterClassifier.js';\nclass Uint8Matrix {\n constructor(rows, cols, defaultValue) {\n const data = new Uint8Array(rows * cols);\n for (let i = 0, len = rows * cols; i < len; i++) {\n data[i] = defaultValue;\n }\n this._data = data;\n this.rows = rows;\n this.cols = cols;\n }\n get(row, col) {\n return this._data[row * this.cols + col];\n }\n set(row, col, value) {\n this._data[row * this.cols + col] = value;\n }\n}\nexport class StateMachine {\n constructor(edges) {\n let maxCharCode = 0;\n let maxState = 0 /* State.Invalid */;\n for (let i = 0, len = edges.length; i < len; i++) {\n const [from, chCode, to] = edges[i];\n if (chCode > maxCharCode) {\n maxCharCode = chCode;\n }\n if (from > maxState) {\n maxState = from;\n }\n if (to > maxState) {\n maxState = to;\n }\n }\n maxCharCode++;\n maxState++;\n const states = new Uint8Matrix(maxState, maxCharCode, 0 /* State.Invalid */);\n for (let i = 0, len = edges.length; i < len; i++) {\n const [from, chCode, to] = edges[i];\n states.set(from, chCode, to);\n }\n this._states = states;\n this._maxCharCode = maxCharCode;\n }\n nextState(currentState, chCode) {\n if (chCode < 0 || chCode >= this._maxCharCode) {\n return 0 /* State.Invalid */;\n }\n return this._states.get(currentState, chCode);\n }\n}\n// State machine for http:// or https:// or file://\nlet _stateMachine = null;\nfunction getStateMachine() {\n if (_stateMachine === null) {\n _stateMachine = new StateMachine([\n [1 /* State.Start */, 104 /* CharCode.h */, 2 /* State.H */],\n [1 /* State.Start */, 72 /* CharCode.H */, 2 /* State.H */],\n [1 /* State.Start */, 102 /* CharCode.f */, 6 /* State.F */],\n [1 /* State.Start */, 70 /* CharCode.F */, 6 /* State.F */],\n [2 /* State.H */, 116 /* CharCode.t */, 3 /* State.HT */],\n [2 /* State.H */, 84 /* CharCode.T */, 3 /* State.HT */],\n [3 /* State.HT */, 116 /* CharCode.t */, 4 /* State.HTT */],\n [3 /* State.HT */, 84 /* CharCode.T */, 4 /* State.HTT */],\n [4 /* State.HTT */, 112 /* CharCode.p */, 5 /* State.HTTP */],\n [4 /* State.HTT */, 80 /* CharCode.P */, 5 /* State.HTTP */],\n [5 /* State.HTTP */, 115 /* CharCode.s */, 9 /* State.BeforeColon */],\n [5 /* State.HTTP */, 83 /* CharCode.S */, 9 /* State.BeforeColon */],\n [5 /* State.HTTP */, 58 /* CharCode.Colon */, 10 /* State.AfterColon */],\n [6 /* State.F */, 105 /* CharCode.i */, 7 /* State.FI */],\n [6 /* State.F */, 73 /* CharCode.I */, 7 /* State.FI */],\n [7 /* State.FI */, 108 /* CharCode.l */, 8 /* State.FIL */],\n [7 /* State.FI */, 76 /* CharCode.L */, 8 /* State.FIL */],\n [8 /* State.FIL */, 101 /* CharCode.e */, 9 /* State.BeforeColon */],\n [8 /* State.FIL */, 69 /* CharCode.E */, 9 /* State.BeforeColon */],\n [9 /* State.BeforeColon */, 58 /* CharCode.Colon */, 10 /* State.AfterColon */],\n [10 /* State.AfterColon */, 47 /* CharCode.Slash */, 11 /* State.AlmostThere */],\n [11 /* State.AlmostThere */, 47 /* CharCode.Slash */, 12 /* State.End */],\n ]);\n }\n return _stateMachine;\n}\nlet _classifier = null;\nfunction getClassifier() {\n if (_classifier === null) {\n _classifier = new CharacterClassifier(0 /* CharacterClass.None */);\n // allow-any-unicode-next-line\n const FORCE_TERMINATION_CHARACTERS = ' \\t<>\\'\\\"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026';\n for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) {\n _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* CharacterClass.ForceTermination */);\n }\n const CANNOT_END_WITH_CHARACTERS = '.,;:';\n for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) {\n _classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), 2 /* CharacterClass.CannotEndIn */);\n }\n }\n return _classifier;\n}\nexport class LinkComputer {\n static _createLink(classifier, line, lineNumber, linkBeginIndex, linkEndIndex) {\n // Do not allow to end link in certain characters...\n let lastIncludedCharIndex = linkEndIndex - 1;\n do {\n const chCode = line.charCodeAt(lastIncludedCharIndex);\n const chClass = classifier.get(chCode);\n if (chClass !== 2 /* CharacterClass.CannotEndIn */) {\n break;\n }\n lastIncludedCharIndex--;\n } while (lastIncludedCharIndex > linkBeginIndex);\n // Handle links enclosed in parens, square brackets and curlys.\n if (linkBeginIndex > 0) {\n const charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1);\n const lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex);\n if ((charCodeBeforeLink === 40 /* CharCode.OpenParen */ && lastCharCodeInLink === 41 /* CharCode.CloseParen */)\n || (charCodeBeforeLink === 91 /* CharCode.OpenSquareBracket */ && lastCharCodeInLink === 93 /* CharCode.CloseSquareBracket */)\n || (charCodeBeforeLink === 123 /* CharCode.OpenCurlyBrace */ && lastCharCodeInLink === 125 /* CharCode.CloseCurlyBrace */)) {\n // Do not end in ) if ( is before the link start\n // Do not end in ] if [ is before the link start\n // Do not end in } if { is before the link start\n lastIncludedCharIndex--;\n }\n }\n return {\n range: {\n startLineNumber: lineNumber,\n startColumn: linkBeginIndex + 1,\n endLineNumber: lineNumber,\n endColumn: lastIncludedCharIndex + 2\n },\n url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1)\n };\n }\n static computeLinks(model, stateMachine = getStateMachine()) {\n const classifier = getClassifier();\n const result = [];\n for (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) {\n const line = model.getLineContent(i);\n const len = line.length;\n let j = 0;\n let linkBeginIndex = 0;\n let linkBeginChCode = 0;\n let state = 1 /* State.Start */;\n let hasOpenParens = false;\n let hasOpenSquareBracket = false;\n let inSquareBrackets = false;\n let hasOpenCurlyBracket = false;\n while (j < len) {\n let resetStateMachine = false;\n const chCode = line.charCodeAt(j);\n if (state === 13 /* State.Accept */) {\n let chClass;\n switch (chCode) {\n case 40 /* CharCode.OpenParen */:\n hasOpenParens = true;\n chClass = 0 /* CharacterClass.None */;\n break;\n case 41 /* CharCode.CloseParen */:\n chClass = (hasOpenParens ? 0 /* CharacterClass.None */ : 1 /* CharacterClass.ForceTermination */);\n break;\n case 91 /* CharCode.OpenSquareBracket */:\n inSquareBrackets = true;\n hasOpenSquareBracket = true;\n chClass = 0 /* CharacterClass.None */;\n break;\n case 93 /* CharCode.CloseSquareBracket */:\n inSquareBrackets = false;\n chClass = (hasOpenSquareBracket ? 0 /* CharacterClass.None */ : 1 /* CharacterClass.ForceTermination */);\n break;\n case 123 /* CharCode.OpenCurlyBrace */:\n hasOpenCurlyBracket = true;\n chClass = 0 /* CharacterClass.None */;\n break;\n case 125 /* CharCode.CloseCurlyBrace */:\n chClass = (hasOpenCurlyBracket ? 0 /* CharacterClass.None */ : 1 /* CharacterClass.ForceTermination */);\n break;\n // The following three rules make it that ' or \" or ` are allowed inside links\n // only if the link is wrapped by some other quote character\n case 39 /* CharCode.SingleQuote */:\n case 34 /* CharCode.DoubleQuote */:\n case 96 /* CharCode.BackTick */:\n if (linkBeginChCode === chCode) {\n chClass = 1 /* CharacterClass.ForceTermination */;\n }\n else if (linkBeginChCode === 39 /* CharCode.SingleQuote */ || linkBeginChCode === 34 /* CharCode.DoubleQuote */ || linkBeginChCode === 96 /* CharCode.BackTick */) {\n chClass = 0 /* CharacterClass.None */;\n }\n else {\n chClass = 1 /* CharacterClass.ForceTermination */;\n }\n break;\n case 42 /* CharCode.Asterisk */:\n // `*` terminates a link if the link began with `*`\n chClass = (linkBeginChCode === 42 /* CharCode.Asterisk */) ? 1 /* CharacterClass.ForceTermination */ : 0 /* CharacterClass.None */;\n break;\n case 124 /* CharCode.Pipe */:\n // `|` terminates a link if the link began with `|`\n chClass = (linkBeginChCode === 124 /* CharCode.Pipe */) ? 1 /* CharacterClass.ForceTermination */ : 0 /* CharacterClass.None */;\n break;\n case 32 /* CharCode.Space */:\n // ` ` allow space in between [ and ]\n chClass = (inSquareBrackets ? 0 /* CharacterClass.None */ : 1 /* CharacterClass.ForceTermination */);\n break;\n default:\n chClass = classifier.get(chCode);\n }\n // Check if character terminates link\n if (chClass === 1 /* CharacterClass.ForceTermination */) {\n result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, j));\n resetStateMachine = true;\n }\n }\n else if (state === 12 /* State.End */) {\n let chClass;\n if (chCode === 91 /* CharCode.OpenSquareBracket */) {\n // Allow for the authority part to contain ipv6 addresses which contain [ and ]\n hasOpenSquareBracket = true;\n chClass = 0 /* CharacterClass.None */;\n }\n else {\n chClass = classifier.get(chCode);\n }\n // Check if character terminates link\n if (chClass === 1 /* CharacterClass.ForceTermination */) {\n resetStateMachine = true;\n }\n else {\n state = 13 /* State.Accept */;\n }\n }\n else {\n state = stateMachine.nextState(state, chCode);\n if (state === 0 /* State.Invalid */) {\n resetStateMachine = true;\n }\n }\n if (resetStateMachine) {\n state = 1 /* State.Start */;\n hasOpenParens = false;\n hasOpenSquareBracket = false;\n hasOpenCurlyBracket = false;\n // Record where the link started\n linkBeginIndex = j + 1;\n linkBeginChCode = chCode;\n }\n j++;\n }\n if (state === 13 /* State.Accept */) {\n result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, len));\n }\n }\n return result;\n }\n}\n/**\n * Returns an array of all links contains in the provided\n * document. *Note* that this operation is computational\n * expensive and should not run in the UI thread.\n */\nexport function computeLinks(model) {\n if (!model || typeof model.getLineCount !== 'function' || typeof model.getLineContent !== 'function') {\n // Unknown caller!\n return [];\n }\n return LinkComputer.computeLinks(model);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class BasicInplaceReplace {\n constructor() {\n this._defaultValueSet = [\n ['true', 'false'],\n ['True', 'False'],\n ['Private', 'Public', 'Friend', 'ReadOnly', 'Partial', 'Protected', 'WriteOnly'],\n ['public', 'protected', 'private'],\n ];\n }\n navigateValueSet(range1, text1, range2, text2, up) {\n if (range1 && text1) {\n const result = this.doNavigateValueSet(text1, up);\n if (result) {\n return {\n range: range1,\n value: result\n };\n }\n }\n if (range2 && text2) {\n const result = this.doNavigateValueSet(text2, up);\n if (result) {\n return {\n range: range2,\n value: result\n };\n }\n }\n return null;\n }\n doNavigateValueSet(text, up) {\n const numberResult = this.numberReplace(text, up);\n if (numberResult !== null) {\n return numberResult;\n }\n return this.textReplace(text, up);\n }\n numberReplace(value, up) {\n const precision = Math.pow(10, value.length - (value.lastIndexOf('.') + 1));\n let n1 = Number(value);\n const n2 = parseFloat(value);\n if (!isNaN(n1) && !isNaN(n2) && n1 === n2) {\n if (n1 === 0 && !up) {\n return null; // don't do negative\n //\t\t\t} else if(n1 === 9 && up) {\n //\t\t\t\treturn null; // don't insert 10 into a number\n }\n else {\n n1 = Math.floor(n1 * precision);\n n1 += up ? precision : -precision;\n return String(n1 / precision);\n }\n }\n return null;\n }\n textReplace(value, up) {\n return this.valueSetsReplace(this._defaultValueSet, value, up);\n }\n valueSetsReplace(valueSets, value, up) {\n let result = null;\n for (let i = 0, len = valueSets.length; result === null && i < len; i++) {\n result = this.valueSetReplace(valueSets[i], value, up);\n }\n return result;\n }\n valueSetReplace(valueSet, value, up) {\n let idx = valueSet.indexOf(value);\n if (idx >= 0) {\n idx += up ? +1 : -1;\n if (idx < 0) {\n idx = valueSet.length - 1;\n }\n else {\n idx %= valueSet.length;\n }\n return valueSet[idx];\n }\n return null;\n }\n}\nBasicInplaceReplace.INSTANCE = new BasicInplaceReplace();\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { CharacterClassifier } from './characterClassifier.js';\nexport class WordCharacterClassifier extends CharacterClassifier {\n constructor(wordSeparators) {\n super(0 /* WordCharacterClass.Regular */);\n for (let i = 0, len = wordSeparators.length; i < len; i++) {\n this.set(wordSeparators.charCodeAt(i), 2 /* WordCharacterClass.WordSeparator */);\n }\n this.set(32 /* CharCode.Space */, 1 /* WordCharacterClass.Whitespace */);\n this.set(9 /* CharCode.Tab */, 1 /* WordCharacterClass.Whitespace */);\n }\n}\nfunction once(computeFn) {\n const cache = {}; // TODO@Alex unbounded cache\n return (input) => {\n if (!cache.hasOwnProperty(input)) {\n cache[input] = computeFn(input);\n }\n return cache[input];\n };\n}\nexport const getMapForWordSeparators = once((input) => new WordCharacterClassifier(input));\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { equals } from '../../base/common/objects.js';\n/**\n * Vertical Lane in the overview ruler of the editor.\n */\nexport var OverviewRulerLane;\n(function (OverviewRulerLane) {\n OverviewRulerLane[OverviewRulerLane[\"Left\"] = 1] = \"Left\";\n OverviewRulerLane[OverviewRulerLane[\"Center\"] = 2] = \"Center\";\n OverviewRulerLane[OverviewRulerLane[\"Right\"] = 4] = \"Right\";\n OverviewRulerLane[OverviewRulerLane[\"Full\"] = 7] = \"Full\";\n})(OverviewRulerLane || (OverviewRulerLane = {}));\n/**\n * Vertical Lane in the glyph margin of the editor.\n */\nexport var GlyphMarginLane;\n(function (GlyphMarginLane) {\n GlyphMarginLane[GlyphMarginLane[\"Left\"] = 1] = \"Left\";\n GlyphMarginLane[GlyphMarginLane[\"Center\"] = 2] = \"Center\";\n GlyphMarginLane[GlyphMarginLane[\"Right\"] = 3] = \"Right\";\n})(GlyphMarginLane || (GlyphMarginLane = {}));\n/**\n * Position in the minimap to render the decoration.\n */\nexport var MinimapPosition;\n(function (MinimapPosition) {\n MinimapPosition[MinimapPosition[\"Inline\"] = 1] = \"Inline\";\n MinimapPosition[MinimapPosition[\"Gutter\"] = 2] = \"Gutter\";\n})(MinimapPosition || (MinimapPosition = {}));\nexport var InjectedTextCursorStops;\n(function (InjectedTextCursorStops) {\n InjectedTextCursorStops[InjectedTextCursorStops[\"Both\"] = 0] = \"Both\";\n InjectedTextCursorStops[InjectedTextCursorStops[\"Right\"] = 1] = \"Right\";\n InjectedTextCursorStops[InjectedTextCursorStops[\"Left\"] = 2] = \"Left\";\n InjectedTextCursorStops[InjectedTextCursorStops[\"None\"] = 3] = \"None\";\n})(InjectedTextCursorStops || (InjectedTextCursorStops = {}));\nexport class TextModelResolvedOptions {\n get originalIndentSize() {\n return this._indentSizeIsTabSize ? 'tabSize' : this.indentSize;\n }\n /**\n * @internal\n */\n constructor(src) {\n this._textModelResolvedOptionsBrand = undefined;\n this.tabSize = Math.max(1, src.tabSize | 0);\n if (src.indentSize === 'tabSize') {\n this.indentSize = this.tabSize;\n this._indentSizeIsTabSize = true;\n }\n else {\n this.indentSize = Math.max(1, src.indentSize | 0);\n this._indentSizeIsTabSize = false;\n }\n this.insertSpaces = Boolean(src.insertSpaces);\n this.defaultEOL = src.defaultEOL | 0;\n this.trimAutoWhitespace = Boolean(src.trimAutoWhitespace);\n this.bracketPairColorizationOptions = src.bracketPairColorizationOptions;\n }\n /**\n * @internal\n */\n equals(other) {\n return (this.tabSize === other.tabSize\n && this._indentSizeIsTabSize === other._indentSizeIsTabSize\n && this.indentSize === other.indentSize\n && this.insertSpaces === other.insertSpaces\n && this.defaultEOL === other.defaultEOL\n && this.trimAutoWhitespace === other.trimAutoWhitespace\n && equals(this.bracketPairColorizationOptions, other.bracketPairColorizationOptions));\n }\n /**\n * @internal\n */\n createChangeEvent(newOpts) {\n return {\n tabSize: this.tabSize !== newOpts.tabSize,\n indentSize: this.indentSize !== newOpts.indentSize,\n insertSpaces: this.insertSpaces !== newOpts.insertSpaces,\n trimAutoWhitespace: this.trimAutoWhitespace !== newOpts.trimAutoWhitespace,\n };\n }\n}\nexport class FindMatch {\n /**\n * @internal\n */\n constructor(range, matches) {\n this._findMatchBrand = undefined;\n this.range = range;\n this.matches = matches;\n }\n}\n/**\n * @internal\n */\nexport function isITextSnapshot(obj) {\n return (obj && typeof obj.read === 'function');\n}\n/**\n * @internal\n */\nexport class ValidAnnotatedEditOperation {\n constructor(identifier, range, text, forceMoveMarkers, isAutoWhitespaceEdit, _isTracked) {\n this.identifier = identifier;\n this.range = range;\n this.text = text;\n this.forceMoveMarkers = forceMoveMarkers;\n this.isAutoWhitespaceEdit = isAutoWhitespaceEdit;\n this._isTracked = _isTracked;\n }\n}\n/**\n * @internal\n */\nexport class SearchData {\n constructor(regex, wordSeparators, simpleSearch) {\n this.regex = regex;\n this.wordSeparators = wordSeparators;\n this.simpleSearch = simpleSearch;\n }\n}\n/**\n * @internal\n */\nexport class ApplyEditsResult {\n constructor(reverseEdits, changes, trimAutoWhitespaceLineNumbers) {\n this.reverseEdits = reverseEdits;\n this.changes = changes;\n this.trimAutoWhitespaceLineNumbers = trimAutoWhitespaceLineNumbers;\n }\n}\n/**\n * @internal\n */\nexport function shouldSynchronizeModel(model) {\n return (!model.isTooLargeForSyncing() && !model.isForSimpleWidget);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as strings from '../../../base/common/strings.js';\nimport { getMapForWordSeparators } from '../core/wordCharacterClassifier.js';\nimport { Position } from '../core/position.js';\nimport { Range } from '../core/range.js';\nimport { FindMatch, SearchData } from '../model.js';\nconst LIMIT_FIND_COUNT = 999;\nexport class SearchParams {\n constructor(searchString, isRegex, matchCase, wordSeparators) {\n this.searchString = searchString;\n this.isRegex = isRegex;\n this.matchCase = matchCase;\n this.wordSeparators = wordSeparators;\n }\n parseSearchRequest() {\n if (this.searchString === '') {\n return null;\n }\n // Try to create a RegExp out of the params\n let multiline;\n if (this.isRegex) {\n multiline = isMultilineRegexSource(this.searchString);\n }\n else {\n multiline = (this.searchString.indexOf('\\n') >= 0);\n }\n let regex = null;\n try {\n regex = strings.createRegExp(this.searchString, this.isRegex, {\n matchCase: this.matchCase,\n wholeWord: false,\n multiline: multiline,\n global: true,\n unicode: true\n });\n }\n catch (err) {\n return null;\n }\n if (!regex) {\n return null;\n }\n let canUseSimpleSearch = (!this.isRegex && !multiline);\n if (canUseSimpleSearch && this.searchString.toLowerCase() !== this.searchString.toUpperCase()) {\n // casing might make a difference\n canUseSimpleSearch = this.matchCase;\n }\n return new SearchData(regex, this.wordSeparators ? getMapForWordSeparators(this.wordSeparators) : null, canUseSimpleSearch ? this.searchString : null);\n }\n}\nexport function isMultilineRegexSource(searchString) {\n if (!searchString || searchString.length === 0) {\n return false;\n }\n for (let i = 0, len = searchString.length; i < len; i++) {\n const chCode = searchString.charCodeAt(i);\n if (chCode === 10 /* CharCode.LineFeed */) {\n return true;\n }\n if (chCode === 92 /* CharCode.Backslash */) {\n // move to next char\n i++;\n if (i >= len) {\n // string ends with a \\\n break;\n }\n const nextChCode = searchString.charCodeAt(i);\n if (nextChCode === 110 /* CharCode.n */ || nextChCode === 114 /* CharCode.r */ || nextChCode === 87 /* CharCode.W */) {\n return true;\n }\n }\n }\n return false;\n}\nexport function createFindMatch(range, rawMatches, captureMatches) {\n if (!captureMatches) {\n return new FindMatch(range, null);\n }\n const matches = [];\n for (let i = 0, len = rawMatches.length; i < len; i++) {\n matches[i] = rawMatches[i];\n }\n return new FindMatch(range, matches);\n}\nclass LineFeedCounter {\n constructor(text) {\n const lineFeedsOffsets = [];\n let lineFeedsOffsetsLen = 0;\n for (let i = 0, textLen = text.length; i < textLen; i++) {\n if (text.charCodeAt(i) === 10 /* CharCode.LineFeed */) {\n lineFeedsOffsets[lineFeedsOffsetsLen++] = i;\n }\n }\n this._lineFeedsOffsets = lineFeedsOffsets;\n }\n findLineFeedCountBeforeOffset(offset) {\n const lineFeedsOffsets = this._lineFeedsOffsets;\n let min = 0;\n let max = lineFeedsOffsets.length - 1;\n if (max === -1) {\n // no line feeds\n return 0;\n }\n if (offset <= lineFeedsOffsets[0]) {\n // before first line feed\n return 0;\n }\n while (min < max) {\n const mid = min + ((max - min) / 2 >> 0);\n if (lineFeedsOffsets[mid] >= offset) {\n max = mid - 1;\n }\n else {\n if (lineFeedsOffsets[mid + 1] >= offset) {\n // bingo!\n min = mid;\n max = mid;\n }\n else {\n min = mid + 1;\n }\n }\n }\n return min + 1;\n }\n}\nexport class TextModelSearch {\n static findMatches(model, searchParams, searchRange, captureMatches, limitResultCount) {\n const searchData = searchParams.parseSearchRequest();\n if (!searchData) {\n return [];\n }\n if (searchData.regex.multiline) {\n return this._doFindMatchesMultiline(model, searchRange, new Searcher(searchData.wordSeparators, searchData.regex), captureMatches, limitResultCount);\n }\n return this._doFindMatchesLineByLine(model, searchRange, searchData, captureMatches, limitResultCount);\n }\n /**\n * Multiline search always executes on the lines concatenated with \\n.\n * We must therefore compensate for the count of \\n in case the model is CRLF\n */\n static _getMultilineMatchRange(model, deltaOffset, text, lfCounter, matchIndex, match0) {\n let startOffset;\n let lineFeedCountBeforeMatch = 0;\n if (lfCounter) {\n lineFeedCountBeforeMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex);\n startOffset = deltaOffset + matchIndex + lineFeedCountBeforeMatch /* add as many \\r as there were \\n */;\n }\n else {\n startOffset = deltaOffset + matchIndex;\n }\n let endOffset;\n if (lfCounter) {\n const lineFeedCountBeforeEndOfMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex + match0.length);\n const lineFeedCountInMatch = lineFeedCountBeforeEndOfMatch - lineFeedCountBeforeMatch;\n endOffset = startOffset + match0.length + lineFeedCountInMatch /* add as many \\r as there were \\n */;\n }\n else {\n endOffset = startOffset + match0.length;\n }\n const startPosition = model.getPositionAt(startOffset);\n const endPosition = model.getPositionAt(endOffset);\n return new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column);\n }\n static _doFindMatchesMultiline(model, searchRange, searcher, captureMatches, limitResultCount) {\n const deltaOffset = model.getOffsetAt(searchRange.getStartPosition());\n // We always execute multiline search over the lines joined with \\n\n // This makes it that \\n will match the EOL for both CRLF and LF models\n // We compensate for offset errors in `_getMultilineMatchRange`\n const text = model.getValueInRange(searchRange, 1 /* EndOfLinePreference.LF */);\n const lfCounter = (model.getEOL() === '\\r\\n' ? new LineFeedCounter(text) : null);\n const result = [];\n let counter = 0;\n let m;\n searcher.reset(0);\n while ((m = searcher.next(text))) {\n result[counter++] = createFindMatch(this._getMultilineMatchRange(model, deltaOffset, text, lfCounter, m.index, m[0]), m, captureMatches);\n if (counter >= limitResultCount) {\n return result;\n }\n }\n return result;\n }\n static _doFindMatchesLineByLine(model, searchRange, searchData, captureMatches, limitResultCount) {\n const result = [];\n let resultLen = 0;\n // Early case for a search range that starts & stops on the same line number\n if (searchRange.startLineNumber === searchRange.endLineNumber) {\n const text = model.getLineContent(searchRange.startLineNumber).substring(searchRange.startColumn - 1, searchRange.endColumn - 1);\n resultLen = this._findMatchesInLine(searchData, text, searchRange.startLineNumber, searchRange.startColumn - 1, resultLen, result, captureMatches, limitResultCount);\n return result;\n }\n // Collect results from first line\n const text = model.getLineContent(searchRange.startLineNumber).substring(searchRange.startColumn - 1);\n resultLen = this._findMatchesInLine(searchData, text, searchRange.startLineNumber, searchRange.startColumn - 1, resultLen, result, captureMatches, limitResultCount);\n // Collect results from middle lines\n for (let lineNumber = searchRange.startLineNumber + 1; lineNumber < searchRange.endLineNumber && resultLen < limitResultCount; lineNumber++) {\n resultLen = this._findMatchesInLine(searchData, model.getLineContent(lineNumber), lineNumber, 0, resultLen, result, captureMatches, limitResultCount);\n }\n // Collect results from last line\n if (resultLen < limitResultCount) {\n const text = model.getLineContent(searchRange.endLineNumber).substring(0, searchRange.endColumn - 1);\n resultLen = this._findMatchesInLine(searchData, text, searchRange.endLineNumber, 0, resultLen, result, captureMatches, limitResultCount);\n }\n return result;\n }\n static _findMatchesInLine(searchData, text, lineNumber, deltaOffset, resultLen, result, captureMatches, limitResultCount) {\n const wordSeparators = searchData.wordSeparators;\n if (!captureMatches && searchData.simpleSearch) {\n const searchString = searchData.simpleSearch;\n const searchStringLen = searchString.length;\n const textLength = text.length;\n let lastMatchIndex = -searchStringLen;\n while ((lastMatchIndex = text.indexOf(searchString, lastMatchIndex + searchStringLen)) !== -1) {\n if (!wordSeparators || isValidMatch(wordSeparators, text, textLength, lastMatchIndex, searchStringLen)) {\n result[resultLen++] = new FindMatch(new Range(lineNumber, lastMatchIndex + 1 + deltaOffset, lineNumber, lastMatchIndex + 1 + searchStringLen + deltaOffset), null);\n if (resultLen >= limitResultCount) {\n return resultLen;\n }\n }\n }\n return resultLen;\n }\n const searcher = new Searcher(searchData.wordSeparators, searchData.regex);\n let m;\n // Reset regex to search from the beginning\n searcher.reset(0);\n do {\n m = searcher.next(text);\n if (m) {\n result[resultLen++] = createFindMatch(new Range(lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset), m, captureMatches);\n if (resultLen >= limitResultCount) {\n return resultLen;\n }\n }\n } while (m);\n return resultLen;\n }\n static findNextMatch(model, searchParams, searchStart, captureMatches) {\n const searchData = searchParams.parseSearchRequest();\n if (!searchData) {\n return null;\n }\n const searcher = new Searcher(searchData.wordSeparators, searchData.regex);\n if (searchData.regex.multiline) {\n return this._doFindNextMatchMultiline(model, searchStart, searcher, captureMatches);\n }\n return this._doFindNextMatchLineByLine(model, searchStart, searcher, captureMatches);\n }\n static _doFindNextMatchMultiline(model, searchStart, searcher, captureMatches) {\n const searchTextStart = new Position(searchStart.lineNumber, 1);\n const deltaOffset = model.getOffsetAt(searchTextStart);\n const lineCount = model.getLineCount();\n // We always execute multiline search over the lines joined with \\n\n // This makes it that \\n will match the EOL for both CRLF and LF models\n // We compensate for offset errors in `_getMultilineMatchRange`\n const text = model.getValueInRange(new Range(searchTextStart.lineNumber, searchTextStart.column, lineCount, model.getLineMaxColumn(lineCount)), 1 /* EndOfLinePreference.LF */);\n const lfCounter = (model.getEOL() === '\\r\\n' ? new LineFeedCounter(text) : null);\n searcher.reset(searchStart.column - 1);\n const m = searcher.next(text);\n if (m) {\n return createFindMatch(this._getMultilineMatchRange(model, deltaOffset, text, lfCounter, m.index, m[0]), m, captureMatches);\n }\n if (searchStart.lineNumber !== 1 || searchStart.column !== 1) {\n // Try again from the top\n return this._doFindNextMatchMultiline(model, new Position(1, 1), searcher, captureMatches);\n }\n return null;\n }\n static _doFindNextMatchLineByLine(model, searchStart, searcher, captureMatches) {\n const lineCount = model.getLineCount();\n const startLineNumber = searchStart.lineNumber;\n // Look in first line\n const text = model.getLineContent(startLineNumber);\n const r = this._findFirstMatchInLine(searcher, text, startLineNumber, searchStart.column, captureMatches);\n if (r) {\n return r;\n }\n for (let i = 1; i <= lineCount; i++) {\n const lineIndex = (startLineNumber + i - 1) % lineCount;\n const text = model.getLineContent(lineIndex + 1);\n const r = this._findFirstMatchInLine(searcher, text, lineIndex + 1, 1, captureMatches);\n if (r) {\n return r;\n }\n }\n return null;\n }\n static _findFirstMatchInLine(searcher, text, lineNumber, fromColumn, captureMatches) {\n // Set regex to search from column\n searcher.reset(fromColumn - 1);\n const m = searcher.next(text);\n if (m) {\n return createFindMatch(new Range(lineNumber, m.index + 1, lineNumber, m.index + 1 + m[0].length), m, captureMatches);\n }\n return null;\n }\n static findPreviousMatch(model, searchParams, searchStart, captureMatches) {\n const searchData = searchParams.parseSearchRequest();\n if (!searchData) {\n return null;\n }\n const searcher = new Searcher(searchData.wordSeparators, searchData.regex);\n if (searchData.regex.multiline) {\n return this._doFindPreviousMatchMultiline(model, searchStart, searcher, captureMatches);\n }\n return this._doFindPreviousMatchLineByLine(model, searchStart, searcher, captureMatches);\n }\n static _doFindPreviousMatchMultiline(model, searchStart, searcher, captureMatches) {\n const matches = this._doFindMatchesMultiline(model, new Range(1, 1, searchStart.lineNumber, searchStart.column), searcher, captureMatches, 10 * LIMIT_FIND_COUNT);\n if (matches.length > 0) {\n return matches[matches.length - 1];\n }\n const lineCount = model.getLineCount();\n if (searchStart.lineNumber !== lineCount || searchStart.column !== model.getLineMaxColumn(lineCount)) {\n // Try again with all content\n return this._doFindPreviousMatchMultiline(model, new Position(lineCount, model.getLineMaxColumn(lineCount)), searcher, captureMatches);\n }\n return null;\n }\n static _doFindPreviousMatchLineByLine(model, searchStart, searcher, captureMatches) {\n const lineCount = model.getLineCount();\n const startLineNumber = searchStart.lineNumber;\n // Look in first line\n const text = model.getLineContent(startLineNumber).substring(0, searchStart.column - 1);\n const r = this._findLastMatchInLine(searcher, text, startLineNumber, captureMatches);\n if (r) {\n return r;\n }\n for (let i = 1; i <= lineCount; i++) {\n const lineIndex = (lineCount + startLineNumber - i - 1) % lineCount;\n const text = model.getLineContent(lineIndex + 1);\n const r = this._findLastMatchInLine(searcher, text, lineIndex + 1, captureMatches);\n if (r) {\n return r;\n }\n }\n return null;\n }\n static _findLastMatchInLine(searcher, text, lineNumber, captureMatches) {\n let bestResult = null;\n let m;\n searcher.reset(0);\n while ((m = searcher.next(text))) {\n bestResult = createFindMatch(new Range(lineNumber, m.index + 1, lineNumber, m.index + 1 + m[0].length), m, captureMatches);\n }\n return bestResult;\n }\n}\nfunction leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) {\n if (matchStartIndex === 0) {\n // Match starts at start of string\n return true;\n }\n const charBefore = text.charCodeAt(matchStartIndex - 1);\n if (wordSeparators.get(charBefore) !== 0 /* WordCharacterClass.Regular */) {\n // The character before the match is a word separator\n return true;\n }\n if (charBefore === 13 /* CharCode.CarriageReturn */ || charBefore === 10 /* CharCode.LineFeed */) {\n // The character before the match is line break or carriage return.\n return true;\n }\n if (matchLength > 0) {\n const firstCharInMatch = text.charCodeAt(matchStartIndex);\n if (wordSeparators.get(firstCharInMatch) !== 0 /* WordCharacterClass.Regular */) {\n // The first character inside the match is a word separator\n return true;\n }\n }\n return false;\n}\nfunction rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) {\n if (matchStartIndex + matchLength === textLength) {\n // Match ends at end of string\n return true;\n }\n const charAfter = text.charCodeAt(matchStartIndex + matchLength);\n if (wordSeparators.get(charAfter) !== 0 /* WordCharacterClass.Regular */) {\n // The character after the match is a word separator\n return true;\n }\n if (charAfter === 13 /* CharCode.CarriageReturn */ || charAfter === 10 /* CharCode.LineFeed */) {\n // The character after the match is line break or carriage return.\n return true;\n }\n if (matchLength > 0) {\n const lastCharInMatch = text.charCodeAt(matchStartIndex + matchLength - 1);\n if (wordSeparators.get(lastCharInMatch) !== 0 /* WordCharacterClass.Regular */) {\n // The last character in the match is a word separator\n return true;\n }\n }\n return false;\n}\nexport function isValidMatch(wordSeparators, text, textLength, matchStartIndex, matchLength) {\n return (leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength)\n && rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength));\n}\nexport class Searcher {\n constructor(wordSeparators, searchRegex) {\n this._wordSeparators = wordSeparators;\n this._searchRegex = searchRegex;\n this._prevMatchStartIndex = -1;\n this._prevMatchLength = 0;\n }\n reset(lastIndex) {\n this._searchRegex.lastIndex = lastIndex;\n this._prevMatchStartIndex = -1;\n this._prevMatchLength = 0;\n }\n next(text) {\n const textLength = text.length;\n let m;\n do {\n if (this._prevMatchStartIndex + this._prevMatchLength === textLength) {\n // Reached the end of the line\n return null;\n }\n m = this._searchRegex.exec(text);\n if (!m) {\n return null;\n }\n const matchStartIndex = m.index;\n const matchLength = m[0].length;\n if (matchStartIndex === this._prevMatchStartIndex && matchLength === this._prevMatchLength) {\n if (matchLength === 0) {\n // the search result is an empty string and won't advance `regex.lastIndex`, so `regex.exec` will stuck here\n // we attempt to recover from that by advancing by two if surrogate pair found and by one otherwise\n if (strings.getNextCodePoint(text, textLength, this._searchRegex.lastIndex) > 0xFFFF) {\n this._searchRegex.lastIndex += 2;\n }\n else {\n this._searchRegex.lastIndex += 1;\n }\n continue;\n }\n // Exit early if the regex matches the same range twice\n return null;\n }\n this._prevMatchStartIndex = matchStartIndex;\n this._prevMatchLength = matchLength;\n if (!this._wordSeparators || isValidMatch(this._wordSeparators, text, textLength, matchStartIndex, matchLength)) {\n return m;\n }\n } while (m);\n return null;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Range } from '../core/range.js';\nimport { Searcher } from '../model/textModelSearch.js';\nimport * as strings from '../../../base/common/strings.js';\nimport { assertNever } from '../../../base/common/assert.js';\nimport { DEFAULT_WORD_REGEXP, getWordAtText } from '../core/wordHelper.js';\nexport class UnicodeTextModelHighlighter {\n static computeUnicodeHighlights(model, options, range) {\n const startLine = range ? range.startLineNumber : 1;\n const endLine = range ? range.endLineNumber : model.getLineCount();\n const codePointHighlighter = new CodePointHighlighter(options);\n const candidates = codePointHighlighter.getCandidateCodePoints();\n let regex;\n if (candidates === 'allNonBasicAscii') {\n regex = new RegExp('[^\\\\t\\\\n\\\\r\\\\x20-\\\\x7E]', 'g');\n }\n else {\n regex = new RegExp(`${buildRegExpCharClassExpr(Array.from(candidates))}`, 'g');\n }\n const searcher = new Searcher(null, regex);\n const ranges = [];\n let hasMore = false;\n let m;\n let ambiguousCharacterCount = 0;\n let invisibleCharacterCount = 0;\n let nonBasicAsciiCharacterCount = 0;\n forLoop: for (let lineNumber = startLine, lineCount = endLine; lineNumber <= lineCount; lineNumber++) {\n const lineContent = model.getLineContent(lineNumber);\n const lineLength = lineContent.length;\n // Reset regex to search from the beginning\n searcher.reset(0);\n do {\n m = searcher.next(lineContent);\n if (m) {\n let startIndex = m.index;\n let endIndex = m.index + m[0].length;\n // Extend range to entire code point\n if (startIndex > 0) {\n const charCodeBefore = lineContent.charCodeAt(startIndex - 1);\n if (strings.isHighSurrogate(charCodeBefore)) {\n startIndex--;\n }\n }\n if (endIndex + 1 < lineLength) {\n const charCodeBefore = lineContent.charCodeAt(endIndex - 1);\n if (strings.isHighSurrogate(charCodeBefore)) {\n endIndex++;\n }\n }\n const str = lineContent.substring(startIndex, endIndex);\n let word = getWordAtText(startIndex + 1, DEFAULT_WORD_REGEXP, lineContent, 0);\n if (word && word.endColumn <= startIndex + 1) {\n // The word does not include the problematic character, ignore the word\n word = null;\n }\n const highlightReason = codePointHighlighter.shouldHighlightNonBasicASCII(str, word ? word.word : null);\n if (highlightReason !== 0 /* SimpleHighlightReason.None */) {\n if (highlightReason === 3 /* SimpleHighlightReason.Ambiguous */) {\n ambiguousCharacterCount++;\n }\n else if (highlightReason === 2 /* SimpleHighlightReason.Invisible */) {\n invisibleCharacterCount++;\n }\n else if (highlightReason === 1 /* SimpleHighlightReason.NonBasicASCII */) {\n nonBasicAsciiCharacterCount++;\n }\n else {\n assertNever(highlightReason);\n }\n const MAX_RESULT_LENGTH = 1000;\n if (ranges.length >= MAX_RESULT_LENGTH) {\n hasMore = true;\n break forLoop;\n }\n ranges.push(new Range(lineNumber, startIndex + 1, lineNumber, endIndex + 1));\n }\n }\n } while (m);\n }\n return {\n ranges,\n hasMore,\n ambiguousCharacterCount,\n invisibleCharacterCount,\n nonBasicAsciiCharacterCount\n };\n }\n static computeUnicodeHighlightReason(char, options) {\n const codePointHighlighter = new CodePointHighlighter(options);\n const reason = codePointHighlighter.shouldHighlightNonBasicASCII(char, null);\n switch (reason) {\n case 0 /* SimpleHighlightReason.None */:\n return null;\n case 2 /* SimpleHighlightReason.Invisible */:\n return { kind: 1 /* UnicodeHighlighterReasonKind.Invisible */ };\n case 3 /* SimpleHighlightReason.Ambiguous */: {\n const codePoint = char.codePointAt(0);\n const primaryConfusable = codePointHighlighter.ambiguousCharacters.getPrimaryConfusable(codePoint);\n const notAmbiguousInLocales = strings.AmbiguousCharacters.getLocales().filter((l) => !strings.AmbiguousCharacters.getInstance(new Set([...options.allowedLocales, l])).isAmbiguous(codePoint));\n return { kind: 0 /* UnicodeHighlighterReasonKind.Ambiguous */, confusableWith: String.fromCodePoint(primaryConfusable), notAmbiguousInLocales };\n }\n case 1 /* SimpleHighlightReason.NonBasicASCII */:\n return { kind: 2 /* UnicodeHighlighterReasonKind.NonBasicAscii */ };\n }\n }\n}\nfunction buildRegExpCharClassExpr(codePoints, flags) {\n const src = `[${strings.escapeRegExpCharacters(codePoints.map((i) => String.fromCodePoint(i)).join(''))}]`;\n return src;\n}\nclass CodePointHighlighter {\n constructor(options) {\n this.options = options;\n this.allowedCodePoints = new Set(options.allowedCodePoints);\n this.ambiguousCharacters = strings.AmbiguousCharacters.getInstance(new Set(options.allowedLocales));\n }\n getCandidateCodePoints() {\n if (this.options.nonBasicASCII) {\n return 'allNonBasicAscii';\n }\n const set = new Set();\n if (this.options.invisibleCharacters) {\n for (const cp of strings.InvisibleCharacters.codePoints) {\n if (!isAllowedInvisibleCharacter(String.fromCodePoint(cp))) {\n set.add(cp);\n }\n }\n }\n if (this.options.ambiguousCharacters) {\n for (const cp of this.ambiguousCharacters.getConfusableCodePoints()) {\n set.add(cp);\n }\n }\n for (const cp of this.allowedCodePoints) {\n set.delete(cp);\n }\n return set;\n }\n shouldHighlightNonBasicASCII(character, wordContext) {\n const codePoint = character.codePointAt(0);\n if (this.allowedCodePoints.has(codePoint)) {\n return 0 /* SimpleHighlightReason.None */;\n }\n if (this.options.nonBasicASCII) {\n return 1 /* SimpleHighlightReason.NonBasicASCII */;\n }\n let hasBasicASCIICharacters = false;\n let hasNonConfusableNonBasicAsciiCharacter = false;\n if (wordContext) {\n for (const char of wordContext) {\n const codePoint = char.codePointAt(0);\n const isBasicASCII = strings.isBasicASCII(char);\n hasBasicASCIICharacters = hasBasicASCIICharacters || isBasicASCII;\n if (!isBasicASCII &&\n !this.ambiguousCharacters.isAmbiguous(codePoint) &&\n !strings.InvisibleCharacters.isInvisibleCharacter(codePoint)) {\n hasNonConfusableNonBasicAsciiCharacter = true;\n }\n }\n }\n if (\n /* Don't allow mixing weird looking characters with ASCII */ !hasBasicASCIICharacters &&\n /* Is there an obviously weird looking character? */ hasNonConfusableNonBasicAsciiCharacter) {\n return 0 /* SimpleHighlightReason.None */;\n }\n if (this.options.invisibleCharacters) {\n // TODO check for emojis\n if (!isAllowedInvisibleCharacter(character) && strings.InvisibleCharacters.isInvisibleCharacter(codePoint)) {\n return 2 /* SimpleHighlightReason.Invisible */;\n }\n }\n if (this.options.ambiguousCharacters) {\n if (this.ambiguousCharacters.isAmbiguous(codePoint)) {\n return 3 /* SimpleHighlightReason.Ambiguous */;\n }\n }\n return 0 /* SimpleHighlightReason.None */;\n }\n}\nfunction isAllowedInvisibleCharacter(character) {\n return character === ' ' || character === '\\n' || character === '\\t';\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class LinesDiff {\n constructor(changes, \n /**\n * Sorted by original line ranges.\n * The original line ranges and the modified line ranges must be disjoint (but can be touching).\n */\n moves, \n /**\n * Indicates if the time out was reached.\n * In that case, the diffs might be an approximation and the user should be asked to rerun the diff with more time.\n */\n hitTimeout) {\n this.changes = changes;\n this.moves = moves;\n this.hitTimeout = hitTimeout;\n }\n}\nexport class MovedText {\n constructor(lineRangeMapping, changes) {\n this.lineRangeMapping = lineRangeMapping;\n this.changes = changes;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { BugIndicatingError } from '../../../base/common/errors.js';\n/**\n * A range of offsets (0-based).\n*/\nexport class OffsetRange {\n static addRange(range, sortedRanges) {\n let i = 0;\n while (i < sortedRanges.length && sortedRanges[i].endExclusive < range.start) {\n i++;\n }\n let j = i;\n while (j < sortedRanges.length && sortedRanges[j].start <= range.endExclusive) {\n j++;\n }\n if (i === j) {\n sortedRanges.splice(i, 0, range);\n }\n else {\n const start = Math.min(range.start, sortedRanges[i].start);\n const end = Math.max(range.endExclusive, sortedRanges[j - 1].endExclusive);\n sortedRanges.splice(i, j - i, new OffsetRange(start, end));\n }\n }\n static ofLength(length) {\n return new OffsetRange(0, length);\n }\n static ofStartAndLength(start, length) {\n return new OffsetRange(start, start + length);\n }\n constructor(start, endExclusive) {\n this.start = start;\n this.endExclusive = endExclusive;\n if (start > endExclusive) {\n throw new BugIndicatingError(`Invalid range: ${this.toString()}`);\n }\n }\n get isEmpty() {\n return this.start === this.endExclusive;\n }\n delta(offset) {\n return new OffsetRange(this.start + offset, this.endExclusive + offset);\n }\n deltaStart(offset) {\n return new OffsetRange(this.start + offset, this.endExclusive);\n }\n deltaEnd(offset) {\n return new OffsetRange(this.start, this.endExclusive + offset);\n }\n get length() {\n return this.endExclusive - this.start;\n }\n toString() {\n return `[${this.start}, ${this.endExclusive})`;\n }\n contains(offset) {\n return this.start <= offset && offset < this.endExclusive;\n }\n /**\n * for all numbers n: range1.contains(n) or range2.contains(n) => range1.join(range2).contains(n)\n * The joined range is the smallest range that contains both ranges.\n */\n join(other) {\n return new OffsetRange(Math.min(this.start, other.start), Math.max(this.endExclusive, other.endExclusive));\n }\n /**\n * for all numbers n: range1.contains(n) and range2.contains(n) <=> range1.intersect(range2).contains(n)\n *\n * The resulting range is empty if the ranges do not intersect, but touch.\n * If the ranges don't even touch, the result is undefined.\n */\n intersect(other) {\n const start = Math.max(this.start, other.start);\n const end = Math.min(this.endExclusive, other.endExclusive);\n if (start <= end) {\n return new OffsetRange(start, end);\n }\n return undefined;\n }\n intersects(other) {\n const start = Math.max(this.start, other.start);\n const end = Math.min(this.endExclusive, other.endExclusive);\n return start < end;\n }\n isBefore(other) {\n return this.endExclusive <= other.start;\n }\n isAfter(other) {\n return this.start >= other.endExclusive;\n }\n slice(arr) {\n return arr.slice(this.start, this.endExclusive);\n }\n /**\n * Returns the given value if it is contained in this instance, otherwise the closest value that is contained.\n * The range must not be empty.\n */\n clip(value) {\n if (this.isEmpty) {\n throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`);\n }\n return Math.max(this.start, Math.min(this.endExclusive - 1, value));\n }\n /**\n * Returns `r := value + k * length` such that `r` is contained in this range.\n * The range must not be empty.\n *\n * E.g. `[5, 10).clipCyclic(10) === 5`, `[5, 10).clipCyclic(11) === 6` and `[5, 10).clipCyclic(4) === 9`.\n */\n clipCyclic(value) {\n if (this.isEmpty) {\n throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`);\n }\n if (value < this.start) {\n return this.endExclusive - ((this.start - value) % this.length);\n }\n if (value >= this.endExclusive) {\n return this.start + ((value - this.start) % this.length);\n }\n return value;\n }\n forEach(f) {\n for (let i = this.start; i < this.endExclusive; i++) {\n f(i);\n }\n }\n}\nexport class OffsetRangeSet {\n constructor() {\n this._sortedRanges = [];\n }\n addRange(range) {\n let i = 0;\n while (i < this._sortedRanges.length && this._sortedRanges[i].endExclusive < range.start) {\n i++;\n }\n let j = i;\n while (j < this._sortedRanges.length && this._sortedRanges[j].start <= range.endExclusive) {\n j++;\n }\n if (i === j) {\n this._sortedRanges.splice(i, 0, range);\n }\n else {\n const start = Math.min(range.start, this._sortedRanges[i].start);\n const end = Math.max(range.endExclusive, this._sortedRanges[j - 1].endExclusive);\n this._sortedRanges.splice(i, j - i, new OffsetRange(start, end));\n }\n }\n toString() {\n return this._sortedRanges.map(r => r.toString()).join(', ');\n }\n /**\n * Returns of there is a value that is contained in this instance and the given range.\n */\n intersectsStrict(other) {\n // TODO use binary search\n let i = 0;\n while (i < this._sortedRanges.length && this._sortedRanges[i].endExclusive <= other.start) {\n i++;\n }\n return i < this._sortedRanges.length && this._sortedRanges[i].start < other.endExclusive;\n }\n intersectWithRange(other) {\n // TODO use binary search + slice\n const result = new OffsetRangeSet();\n for (const range of this._sortedRanges) {\n const intersection = range.intersect(other);\n if (intersection) {\n result.addRange(intersection);\n }\n }\n return result;\n }\n intersectWithRangeLength(other) {\n return this.intersectWithRange(other).length;\n }\n get length() {\n return this._sortedRanges.reduce((prev, cur) => prev + cur.length, 0);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport function findLast(array, predicate, fromIdx) {\n const idx = findLastIdx(array, predicate);\n if (idx === -1) {\n return undefined;\n }\n return array[idx];\n}\nexport function findLastIdx(array, predicate, fromIndex = array.length - 1) {\n for (let i = fromIndex; i >= 0; i--) {\n const element = array[i];\n if (predicate(element)) {\n return i;\n }\n }\n return -1;\n}\n/**\n * Finds the last item where predicate is true using binary search.\n * `predicate` must be monotonous, i.e. `arr.map(predicate)` must be like `[true, ..., true, false, ..., false]`!\n *\n * @returns `undefined` if no item matches, otherwise the last item that matches the predicate.\n */\nexport function findLastMonotonous(array, predicate) {\n const idx = findLastIdxMonotonous(array, predicate);\n return idx === -1 ? undefined : array[idx];\n}\n/**\n * Finds the last item where predicate is true using binary search.\n * `predicate` must be monotonous, i.e. `arr.map(predicate)` must be like `[true, ..., true, false, ..., false]`!\n *\n * @returns `startIdx - 1` if predicate is false for all items, otherwise the index of the last item that matches the predicate.\n */\nexport function findLastIdxMonotonous(array, predicate, startIdx = 0, endIdxEx = array.length) {\n let i = startIdx;\n let j = endIdxEx;\n while (i < j) {\n const k = Math.floor((i + j) / 2);\n if (predicate(array[k])) {\n i = k + 1;\n }\n else {\n j = k;\n }\n }\n return i - 1;\n}\n/**\n * Finds the first item where predicate is true using binary search.\n * `predicate` must be monotonous, i.e. `arr.map(predicate)` must be like `[false, ..., false, true, ..., true]`!\n *\n * @returns `undefined` if no item matches, otherwise the first item that matches the predicate.\n */\nexport function findFirstMonotonous(array, predicate) {\n const idx = findFirstIdxMonotonousOrArrLen(array, predicate);\n return idx === array.length ? undefined : array[idx];\n}\n/**\n * Finds the first item where predicate is true using binary search.\n * `predicate` must be monotonous, i.e. `arr.map(predicate)` must be like `[false, ..., false, true, ..., true]`!\n *\n * @returns `endIdxEx` if predicate is false for all items, otherwise the index of the first item that matches the predicate.\n */\nexport function findFirstIdxMonotonousOrArrLen(array, predicate, startIdx = 0, endIdxEx = array.length) {\n let i = startIdx;\n let j = endIdxEx;\n while (i < j) {\n const k = Math.floor((i + j) / 2);\n if (predicate(array[k])) {\n j = k;\n }\n else {\n i = k + 1;\n }\n }\n return i;\n}\n/**\n * Use this when\n * * You have a sorted array\n * * You query this array with a monotonous predicate to find the last item that has a certain property.\n * * You query this array multiple times with monotonous predicates that get weaker and weaker.\n */\nexport class MonotonousArray {\n constructor(_array) {\n this._array = _array;\n this._findLastMonotonousLastIdx = 0;\n }\n /**\n * The predicate must be monotonous, i.e. `arr.map(predicate)` must be like `[true, ..., true, false, ..., false]`!\n * For subsequent calls, current predicate must be weaker than (or equal to) the previous predicate, i.e. more entries must be `true`.\n */\n findLastMonotonous(predicate) {\n if (MonotonousArray.assertInvariants) {\n if (this._prevFindLastPredicate) {\n for (const item of this._array) {\n if (this._prevFindLastPredicate(item) && !predicate(item)) {\n throw new Error('MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.');\n }\n }\n }\n this._prevFindLastPredicate = predicate;\n }\n const idx = findLastIdxMonotonous(this._array, predicate, this._findLastMonotonousLastIdx);\n this._findLastMonotonousLastIdx = idx + 1;\n return idx === -1 ? undefined : this._array[idx];\n }\n}\nMonotonousArray.assertInvariants = false;\n/**\n * Returns the first item that is equal to or greater than every other item.\n*/\nexport function findFirstMaxBy(array, comparator) {\n if (array.length === 0) {\n return undefined;\n }\n let max = array[0];\n for (let i = 1; i < array.length; i++) {\n const item = array[i];\n if (comparator(item, max) > 0) {\n max = item;\n }\n }\n return max;\n}\n/**\n * Returns the last item that is equal to or greater than every other item.\n*/\nexport function findLastMaxBy(array, comparator) {\n if (array.length === 0) {\n return undefined;\n }\n let max = array[0];\n for (let i = 1; i < array.length; i++) {\n const item = array[i];\n if (comparator(item, max) >= 0) {\n max = item;\n }\n }\n return max;\n}\n/**\n * Returns the first item that is equal to or less than every other item.\n*/\nexport function findFirstMinBy(array, comparator) {\n return findFirstMaxBy(array, (a, b) => -comparator(a, b));\n}\nexport function findMaxIdxBy(array, comparator) {\n if (array.length === 0) {\n return -1;\n }\n let maxIdx = 0;\n for (let i = 1; i < array.length; i++) {\n const item = array[i];\n if (comparator(item, array[maxIdx]) > 0) {\n maxIdx = i;\n }\n }\n return maxIdx;\n}\n/**\n * Returns the first mapped value of the array which is not undefined.\n */\nexport function mapFindFirst(items, mapFn) {\n for (const value of items) {\n const mapped = mapFn(value);\n if (mapped !== undefined) {\n return mapped;\n }\n }\n return undefined;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { BugIndicatingError } from '../../../base/common/errors.js';\nimport { OffsetRange } from './offsetRange.js';\nimport { Range } from './range.js';\nimport { findFirstIdxMonotonousOrArrLen, findLastIdxMonotonous, findLastMonotonous } from '../../../base/common/arraysFind.js';\n/**\n * A range of lines (1-based).\n */\nexport class LineRange {\n static fromRangeInclusive(range) {\n return new LineRange(range.startLineNumber, range.endLineNumber + 1);\n }\n /**\n * @param lineRanges An array of sorted line ranges.\n */\n static joinMany(lineRanges) {\n if (lineRanges.length === 0) {\n return [];\n }\n let result = new LineRangeSet(lineRanges[0].slice());\n for (let i = 1; i < lineRanges.length; i++) {\n result = result.getUnion(new LineRangeSet(lineRanges[i].slice()));\n }\n return result.ranges;\n }\n static ofLength(startLineNumber, length) {\n return new LineRange(startLineNumber, startLineNumber + length);\n }\n /**\n * @internal\n */\n static deserialize(lineRange) {\n return new LineRange(lineRange[0], lineRange[1]);\n }\n constructor(startLineNumber, endLineNumberExclusive) {\n if (startLineNumber > endLineNumberExclusive) {\n throw new BugIndicatingError(`startLineNumber ${startLineNumber} cannot be after endLineNumberExclusive ${endLineNumberExclusive}`);\n }\n this.startLineNumber = startLineNumber;\n this.endLineNumberExclusive = endLineNumberExclusive;\n }\n /**\n * Indicates if this line range contains the given line number.\n */\n contains(lineNumber) {\n return this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive;\n }\n /**\n * Indicates if this line range is empty.\n */\n get isEmpty() {\n return this.startLineNumber === this.endLineNumberExclusive;\n }\n /**\n * Moves this line range by the given offset of line numbers.\n */\n delta(offset) {\n return new LineRange(this.startLineNumber + offset, this.endLineNumberExclusive + offset);\n }\n deltaLength(offset) {\n return new LineRange(this.startLineNumber, this.endLineNumberExclusive + offset);\n }\n /**\n * The number of lines this line range spans.\n */\n get length() {\n return this.endLineNumberExclusive - this.startLineNumber;\n }\n /**\n * Creates a line range that combines this and the given line range.\n */\n join(other) {\n return new LineRange(Math.min(this.startLineNumber, other.startLineNumber), Math.max(this.endLineNumberExclusive, other.endLineNumberExclusive));\n }\n toString() {\n return `[${this.startLineNumber},${this.endLineNumberExclusive})`;\n }\n /**\n * The resulting range is empty if the ranges do not intersect, but touch.\n * If the ranges don't even touch, the result is undefined.\n */\n intersect(other) {\n const startLineNumber = Math.max(this.startLineNumber, other.startLineNumber);\n const endLineNumberExclusive = Math.min(this.endLineNumberExclusive, other.endLineNumberExclusive);\n if (startLineNumber <= endLineNumberExclusive) {\n return new LineRange(startLineNumber, endLineNumberExclusive);\n }\n return undefined;\n }\n intersectsStrict(other) {\n return this.startLineNumber < other.endLineNumberExclusive && other.startLineNumber < this.endLineNumberExclusive;\n }\n overlapOrTouch(other) {\n return this.startLineNumber <= other.endLineNumberExclusive && other.startLineNumber <= this.endLineNumberExclusive;\n }\n equals(b) {\n return this.startLineNumber === b.startLineNumber && this.endLineNumberExclusive === b.endLineNumberExclusive;\n }\n toInclusiveRange() {\n if (this.isEmpty) {\n return null;\n }\n return new Range(this.startLineNumber, 1, this.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER);\n }\n toExclusiveRange() {\n return new Range(this.startLineNumber, 1, this.endLineNumberExclusive, 1);\n }\n mapToLineArray(f) {\n const result = [];\n for (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {\n result.push(f(lineNumber));\n }\n return result;\n }\n forEach(f) {\n for (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {\n f(lineNumber);\n }\n }\n /**\n * @internal\n */\n serialize() {\n return [this.startLineNumber, this.endLineNumberExclusive];\n }\n includes(lineNumber) {\n return this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive;\n }\n /**\n * Converts this 1-based line range to a 0-based offset range (subtracts 1!).\n * @internal\n */\n toOffsetRange() {\n return new OffsetRange(this.startLineNumber - 1, this.endLineNumberExclusive - 1);\n }\n}\nexport class LineRangeSet {\n constructor(\n /**\n * Sorted by start line number.\n * No two line ranges are touching or intersecting.\n */\n _normalizedRanges = []) {\n this._normalizedRanges = _normalizedRanges;\n }\n get ranges() {\n return this._normalizedRanges;\n }\n addRange(range) {\n if (range.length === 0) {\n return;\n }\n // Idea: Find joinRange such that:\n // replaceRange = _normalizedRanges.replaceRange(joinRange, range.joinAll(joinRange.map(idx => this._normalizedRanges[idx])))\n // idx of first element that touches range or that is after range\n const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);\n // idx of element after { last element that touches range or that is before range }\n const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;\n if (joinRangeStartIdx === joinRangeEndIdxExclusive) {\n // If there is no element that touches range, then joinRangeStartIdx === joinRangeEndIdxExclusive and that value is the index of the element after range\n this._normalizedRanges.splice(joinRangeStartIdx, 0, range);\n }\n else if (joinRangeStartIdx === joinRangeEndIdxExclusive - 1) {\n // Else, there is an element that touches range and in this case it is both the first and last element. Thus we can replace it\n const joinRange = this._normalizedRanges[joinRangeStartIdx];\n this._normalizedRanges[joinRangeStartIdx] = joinRange.join(range);\n }\n else {\n // First and last element are different - we need to replace the entire range\n const joinRange = this._normalizedRanges[joinRangeStartIdx].join(this._normalizedRanges[joinRangeEndIdxExclusive - 1]).join(range);\n this._normalizedRanges.splice(joinRangeStartIdx, joinRangeEndIdxExclusive - joinRangeStartIdx, joinRange);\n }\n }\n contains(lineNumber) {\n const rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, r => r.startLineNumber <= lineNumber);\n return !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > lineNumber;\n }\n intersects(range) {\n const rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, r => r.startLineNumber < range.endLineNumberExclusive);\n return !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > range.startLineNumber;\n }\n getUnion(other) {\n if (this._normalizedRanges.length === 0) {\n return other;\n }\n if (other._normalizedRanges.length === 0) {\n return this;\n }\n const result = [];\n let i1 = 0;\n let i2 = 0;\n let current = null;\n while (i1 < this._normalizedRanges.length || i2 < other._normalizedRanges.length) {\n let next = null;\n if (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {\n const lineRange1 = this._normalizedRanges[i1];\n const lineRange2 = other._normalizedRanges[i2];\n if (lineRange1.startLineNumber < lineRange2.startLineNumber) {\n next = lineRange1;\n i1++;\n }\n else {\n next = lineRange2;\n i2++;\n }\n }\n else if (i1 < this._normalizedRanges.length) {\n next = this._normalizedRanges[i1];\n i1++;\n }\n else {\n next = other._normalizedRanges[i2];\n i2++;\n }\n if (current === null) {\n current = next;\n }\n else {\n if (current.endLineNumberExclusive >= next.startLineNumber) {\n // merge\n current = new LineRange(current.startLineNumber, Math.max(current.endLineNumberExclusive, next.endLineNumberExclusive));\n }\n else {\n // push\n result.push(current);\n current = next;\n }\n }\n }\n if (current !== null) {\n result.push(current);\n }\n return new LineRangeSet(result);\n }\n /**\n * Subtracts all ranges in this set from `range` and returns the result.\n */\n subtractFrom(range) {\n // idx of first element that touches range or that is after range\n const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, r => r.endLineNumberExclusive >= range.startLineNumber);\n // idx of element after { last element that touches range or that is before range }\n const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, r => r.startLineNumber <= range.endLineNumberExclusive) + 1;\n if (joinRangeStartIdx === joinRangeEndIdxExclusive) {\n return new LineRangeSet([range]);\n }\n const result = [];\n let startLineNumber = range.startLineNumber;\n for (let i = joinRangeStartIdx; i < joinRangeEndIdxExclusive; i++) {\n const r = this._normalizedRanges[i];\n if (r.startLineNumber > startLineNumber) {\n result.push(new LineRange(startLineNumber, r.startLineNumber));\n }\n startLineNumber = r.endLineNumberExclusive;\n }\n if (startLineNumber < range.endLineNumberExclusive) {\n result.push(new LineRange(startLineNumber, range.endLineNumberExclusive));\n }\n return new LineRangeSet(result);\n }\n toString() {\n return this._normalizedRanges.map(r => r.toString()).join(', ');\n }\n getIntersection(other) {\n const result = [];\n let i1 = 0;\n let i2 = 0;\n while (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {\n const r1 = this._normalizedRanges[i1];\n const r2 = other._normalizedRanges[i2];\n const i = r1.intersect(r2);\n if (i && !i.isEmpty) {\n result.push(i);\n }\n if (r1.endLineNumberExclusive < r2.endLineNumberExclusive) {\n i1++;\n }\n else {\n i2++;\n }\n }\n return new LineRangeSet(result);\n }\n getWithDelta(value) {\n return new LineRangeSet(this._normalizedRanges.map(r => r.delta(value)));\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { LineRange } from '../core/lineRange.js';\n/**\n * Maps a line range in the original text model to a line range in the modified text model.\n */\nexport class LineRangeMapping {\n static inverse(mapping, originalLineCount, modifiedLineCount) {\n const result = [];\n let lastOriginalEndLineNumber = 1;\n let lastModifiedEndLineNumber = 1;\n for (const m of mapping) {\n const r = new LineRangeMapping(new LineRange(lastOriginalEndLineNumber, m.original.startLineNumber), new LineRange(lastModifiedEndLineNumber, m.modified.startLineNumber));\n if (!r.modified.isEmpty) {\n result.push(r);\n }\n lastOriginalEndLineNumber = m.original.endLineNumberExclusive;\n lastModifiedEndLineNumber = m.modified.endLineNumberExclusive;\n }\n const r = new LineRangeMapping(new LineRange(lastOriginalEndLineNumber, originalLineCount + 1), new LineRange(lastModifiedEndLineNumber, modifiedLineCount + 1));\n if (!r.modified.isEmpty) {\n result.push(r);\n }\n return result;\n }\n static clip(mapping, originalRange, modifiedRange) {\n const result = [];\n for (const m of mapping) {\n const original = m.original.intersect(originalRange);\n const modified = m.modified.intersect(modifiedRange);\n if (original && !original.isEmpty && modified && !modified.isEmpty) {\n result.push(new LineRangeMapping(original, modified));\n }\n }\n return result;\n }\n constructor(originalRange, modifiedRange) {\n this.original = originalRange;\n this.modified = modifiedRange;\n }\n toString() {\n return `{${this.original.toString()}->${this.modified.toString()}}`;\n }\n flip() {\n return new LineRangeMapping(this.modified, this.original);\n }\n join(other) {\n return new LineRangeMapping(this.original.join(other.original), this.modified.join(other.modified));\n }\n}\n/**\n * Maps a line range in the original text model to a line range in the modified text model.\n * Also contains inner range mappings.\n */\nexport class DetailedLineRangeMapping extends LineRangeMapping {\n constructor(originalRange, modifiedRange, innerChanges) {\n super(originalRange, modifiedRange);\n this.innerChanges = innerChanges;\n }\n flip() {\n var _a;\n return new DetailedLineRangeMapping(this.modified, this.original, (_a = this.innerChanges) === null || _a === void 0 ? void 0 : _a.map(c => c.flip()));\n }\n}\n/**\n * Maps a range in the original text model to a range in the modified text model.\n */\nexport class RangeMapping {\n constructor(originalRange, modifiedRange) {\n this.originalRange = originalRange;\n this.modifiedRange = modifiedRange;\n }\n toString() {\n return `{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`;\n }\n flip() {\n return new RangeMapping(this.modifiedRange, this.originalRange);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { LcsDiff } from '../../../base/common/diff/diff.js';\nimport { LinesDiff } from './linesDiffComputer.js';\nimport { RangeMapping, DetailedLineRangeMapping } from './rangeMapping.js';\nimport * as strings from '../../../base/common/strings.js';\nimport { Range } from '../core/range.js';\nimport { assertFn, checkAdjacentItems } from '../../../base/common/assert.js';\nimport { LineRange } from '../core/lineRange.js';\nconst MINIMUM_MATCHING_CHARACTER_LENGTH = 3;\nexport class LegacyLinesDiffComputer {\n computeDiff(originalLines, modifiedLines, options) {\n var _a;\n const diffComputer = new DiffComputer(originalLines, modifiedLines, {\n maxComputationTime: options.maxComputationTimeMs,\n shouldIgnoreTrimWhitespace: options.ignoreTrimWhitespace,\n shouldComputeCharChanges: true,\n shouldMakePrettyDiff: true,\n shouldPostProcessCharChanges: true,\n });\n const result = diffComputer.computeDiff();\n const changes = [];\n let lastChange = null;\n for (const c of result.changes) {\n let originalRange;\n if (c.originalEndLineNumber === 0) {\n // Insertion\n originalRange = new LineRange(c.originalStartLineNumber + 1, c.originalStartLineNumber + 1);\n }\n else {\n originalRange = new LineRange(c.originalStartLineNumber, c.originalEndLineNumber + 1);\n }\n let modifiedRange;\n if (c.modifiedEndLineNumber === 0) {\n // Deletion\n modifiedRange = new LineRange(c.modifiedStartLineNumber + 1, c.modifiedStartLineNumber + 1);\n }\n else {\n modifiedRange = new LineRange(c.modifiedStartLineNumber, c.modifiedEndLineNumber + 1);\n }\n let change = new DetailedLineRangeMapping(originalRange, modifiedRange, (_a = c.charChanges) === null || _a === void 0 ? void 0 : _a.map(c => new RangeMapping(new Range(c.originalStartLineNumber, c.originalStartColumn, c.originalEndLineNumber, c.originalEndColumn), new Range(c.modifiedStartLineNumber, c.modifiedStartColumn, c.modifiedEndLineNumber, c.modifiedEndColumn))));\n if (lastChange) {\n if (lastChange.modified.endLineNumberExclusive === change.modified.startLineNumber\n || lastChange.original.endLineNumberExclusive === change.original.startLineNumber) {\n // join touching diffs. Probably moving diffs up/down in the algorithm causes touching diffs.\n change = new DetailedLineRangeMapping(lastChange.original.join(change.original), lastChange.modified.join(change.modified), lastChange.innerChanges && change.innerChanges ?\n lastChange.innerChanges.concat(change.innerChanges) : undefined);\n changes.pop();\n }\n }\n changes.push(change);\n lastChange = change;\n }\n assertFn(() => {\n return checkAdjacentItems(changes, (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive &&\n // There has to be an unchanged line in between (otherwise both diffs should have been joined)\n m1.original.endLineNumberExclusive < m2.original.startLineNumber &&\n m1.modified.endLineNumberExclusive < m2.modified.startLineNumber);\n });\n return new LinesDiff(changes, [], result.quitEarly);\n }\n}\nfunction computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) {\n const diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);\n return diffAlgo.ComputeDiff(pretty);\n}\nclass LineSequence {\n constructor(lines) {\n const startColumns = [];\n const endColumns = [];\n for (let i = 0, length = lines.length; i < length; i++) {\n startColumns[i] = getFirstNonBlankColumn(lines[i], 1);\n endColumns[i] = getLastNonBlankColumn(lines[i], 1);\n }\n this.lines = lines;\n this._startColumns = startColumns;\n this._endColumns = endColumns;\n }\n getElements() {\n const elements = [];\n for (let i = 0, len = this.lines.length; i < len; i++) {\n elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);\n }\n return elements;\n }\n getStrictElement(index) {\n return this.lines[index];\n }\n getStartLineNumber(i) {\n return i + 1;\n }\n getEndLineNumber(i) {\n return i + 1;\n }\n createCharSequence(shouldIgnoreTrimWhitespace, startIndex, endIndex) {\n const charCodes = [];\n const lineNumbers = [];\n const columns = [];\n let len = 0;\n for (let index = startIndex; index <= endIndex; index++) {\n const lineContent = this.lines[index];\n const startColumn = (shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1);\n const endColumn = (shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1);\n for (let col = startColumn; col < endColumn; col++) {\n charCodes[len] = lineContent.charCodeAt(col - 1);\n lineNumbers[len] = index + 1;\n columns[len] = col;\n len++;\n }\n if (!shouldIgnoreTrimWhitespace && index < endIndex) {\n // Add \\n if trim whitespace is not ignored\n charCodes[len] = 10 /* CharCode.LineFeed */;\n lineNumbers[len] = index + 1;\n columns[len] = lineContent.length + 1;\n len++;\n }\n }\n return new CharSequence(charCodes, lineNumbers, columns);\n }\n}\nclass CharSequence {\n constructor(charCodes, lineNumbers, columns) {\n this._charCodes = charCodes;\n this._lineNumbers = lineNumbers;\n this._columns = columns;\n }\n toString() {\n return ('[' + this._charCodes.map((s, idx) => (s === 10 /* CharCode.LineFeed */ ? '\\\\n' : String.fromCharCode(s)) + `-(${this._lineNumbers[idx]},${this._columns[idx]})`).join(', ') + ']');\n }\n _assertIndex(index, arr) {\n if (index < 0 || index >= arr.length) {\n throw new Error(`Illegal index`);\n }\n }\n getElements() {\n return this._charCodes;\n }\n getStartLineNumber(i) {\n if (i > 0 && i === this._lineNumbers.length) {\n // the start line number of the element after the last element\n // is the end line number of the last element\n return this.getEndLineNumber(i - 1);\n }\n this._assertIndex(i, this._lineNumbers);\n return this._lineNumbers[i];\n }\n getEndLineNumber(i) {\n if (i === -1) {\n // the end line number of the element before the first element\n // is the start line number of the first element\n return this.getStartLineNumber(i + 1);\n }\n this._assertIndex(i, this._lineNumbers);\n if (this._charCodes[i] === 10 /* CharCode.LineFeed */) {\n return this._lineNumbers[i] + 1;\n }\n return this._lineNumbers[i];\n }\n getStartColumn(i) {\n if (i > 0 && i === this._columns.length) {\n // the start column of the element after the last element\n // is the end column of the last element\n return this.getEndColumn(i - 1);\n }\n this._assertIndex(i, this._columns);\n return this._columns[i];\n }\n getEndColumn(i) {\n if (i === -1) {\n // the end column of the element before the first element\n // is the start column of the first element\n return this.getStartColumn(i + 1);\n }\n this._assertIndex(i, this._columns);\n if (this._charCodes[i] === 10 /* CharCode.LineFeed */) {\n return 1;\n }\n return this._columns[i] + 1;\n }\n}\nclass CharChange {\n constructor(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) {\n this.originalStartLineNumber = originalStartLineNumber;\n this.originalStartColumn = originalStartColumn;\n this.originalEndLineNumber = originalEndLineNumber;\n this.originalEndColumn = originalEndColumn;\n this.modifiedStartLineNumber = modifiedStartLineNumber;\n this.modifiedStartColumn = modifiedStartColumn;\n this.modifiedEndLineNumber = modifiedEndLineNumber;\n this.modifiedEndColumn = modifiedEndColumn;\n }\n static createFromDiffChange(diffChange, originalCharSequence, modifiedCharSequence) {\n const originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart);\n const originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart);\n const originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\n const originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1);\n const modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart);\n const modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart);\n const modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n const modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n return new CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn);\n }\n}\nfunction postProcessCharChanges(rawChanges) {\n if (rawChanges.length <= 1) {\n return rawChanges;\n }\n const result = [rawChanges[0]];\n let prevChange = result[0];\n for (let i = 1, len = rawChanges.length; i < len; i++) {\n const currChange = rawChanges[i];\n const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength);\n const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength);\n // Both of the above should be equal, but the continueProcessingPredicate may prevent this from being true\n const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength);\n if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) {\n // Merge the current change into the previous one\n prevChange.originalLength = (currChange.originalStart + currChange.originalLength) - prevChange.originalStart;\n prevChange.modifiedLength = (currChange.modifiedStart + currChange.modifiedLength) - prevChange.modifiedStart;\n }\n else {\n // Add the current change\n result.push(currChange);\n prevChange = currChange;\n }\n }\n return result;\n}\nclass LineChange {\n constructor(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) {\n this.originalStartLineNumber = originalStartLineNumber;\n this.originalEndLineNumber = originalEndLineNumber;\n this.modifiedStartLineNumber = modifiedStartLineNumber;\n this.modifiedEndLineNumber = modifiedEndLineNumber;\n this.charChanges = charChanges;\n }\n static createFromDiffResult(shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) {\n let originalStartLineNumber;\n let originalEndLineNumber;\n let modifiedStartLineNumber;\n let modifiedEndLineNumber;\n let charChanges = undefined;\n if (diffChange.originalLength === 0) {\n originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1;\n originalEndLineNumber = 0;\n }\n else {\n originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart);\n originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\n }\n if (diffChange.modifiedLength === 0) {\n modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1;\n modifiedEndLineNumber = 0;\n }\n else {\n modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart);\n modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n }\n if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) {\n // Compute character changes for diff chunks of at most 20 lines...\n const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);\n const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);\n if (originalCharSequence.getElements().length > 0 && modifiedCharSequence.getElements().length > 0) {\n let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes;\n if (shouldPostProcessCharChanges) {\n rawChanges = postProcessCharChanges(rawChanges);\n }\n charChanges = [];\n for (let i = 0, length = rawChanges.length; i < length; i++) {\n charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence));\n }\n }\n }\n return new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges);\n }\n}\nexport class DiffComputer {\n constructor(originalLines, modifiedLines, opts) {\n this.shouldComputeCharChanges = opts.shouldComputeCharChanges;\n this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges;\n this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace;\n this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff;\n this.originalLines = originalLines;\n this.modifiedLines = modifiedLines;\n this.original = new LineSequence(originalLines);\n this.modified = new LineSequence(modifiedLines);\n this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime);\n this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5000)); // never run after 5s for character changes...\n }\n computeDiff() {\n if (this.original.lines.length === 1 && this.original.lines[0].length === 0) {\n // empty original => fast path\n if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {\n return {\n quitEarly: false,\n changes: []\n };\n }\n return {\n quitEarly: false,\n changes: [{\n originalStartLineNumber: 1,\n originalEndLineNumber: 1,\n modifiedStartLineNumber: 1,\n modifiedEndLineNumber: this.modified.lines.length,\n charChanges: undefined\n }]\n };\n }\n if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {\n // empty modified => fast path\n return {\n quitEarly: false,\n changes: [{\n originalStartLineNumber: 1,\n originalEndLineNumber: this.original.lines.length,\n modifiedStartLineNumber: 1,\n modifiedEndLineNumber: 1,\n charChanges: undefined\n }]\n };\n }\n const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff);\n const rawChanges = diffResult.changes;\n const quitEarly = diffResult.quitEarly;\n // The diff is always computed with ignoring trim whitespace\n // This ensures we get the prettiest diff\n if (this.shouldIgnoreTrimWhitespace) {\n const lineChanges = [];\n for (let i = 0, length = rawChanges.length; i < length; i++) {\n lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));\n }\n return {\n quitEarly: quitEarly,\n changes: lineChanges\n };\n }\n // Need to post-process and introduce changes where the trim whitespace is different\n // Note that we are looping starting at -1 to also cover the lines before the first change\n const result = [];\n let originalLineIndex = 0;\n let modifiedLineIndex = 0;\n for (let i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) {\n const nextChange = (i + 1 < len ? rawChanges[i + 1] : null);\n const originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length);\n const modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length);\n while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {\n const originalLine = this.originalLines[originalLineIndex];\n const modifiedLine = this.modifiedLines[modifiedLineIndex];\n if (originalLine !== modifiedLine) {\n // These lines differ only in trim whitespace\n // Check the leading whitespace\n {\n let originalStartColumn = getFirstNonBlankColumn(originalLine, 1);\n let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1);\n while (originalStartColumn > 1 && modifiedStartColumn > 1) {\n const originalChar = originalLine.charCodeAt(originalStartColumn - 2);\n const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2);\n if (originalChar !== modifiedChar) {\n break;\n }\n originalStartColumn--;\n modifiedStartColumn--;\n }\n if (originalStartColumn > 1 || modifiedStartColumn > 1) {\n this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn);\n }\n }\n // Check the trailing whitespace\n {\n let originalEndColumn = getLastNonBlankColumn(originalLine, 1);\n let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1);\n const originalMaxColumn = originalLine.length + 1;\n const modifiedMaxColumn = modifiedLine.length + 1;\n while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) {\n const originalChar = originalLine.charCodeAt(originalEndColumn - 1);\n const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1);\n if (originalChar !== modifiedChar) {\n break;\n }\n originalEndColumn++;\n modifiedEndColumn++;\n }\n if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) {\n this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn);\n }\n }\n }\n originalLineIndex++;\n modifiedLineIndex++;\n }\n if (nextChange) {\n // Emit the actual change\n result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));\n originalLineIndex += nextChange.originalLength;\n modifiedLineIndex += nextChange.modifiedLength;\n }\n }\n return {\n quitEarly: quitEarly,\n changes: result\n };\n }\n _pushTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {\n if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) {\n // Merged into previous\n return;\n }\n let charChanges = undefined;\n if (this.shouldComputeCharChanges) {\n charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)];\n }\n result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges));\n }\n _mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {\n const len = result.length;\n if (len === 0) {\n return false;\n }\n const prevChange = result[len - 1];\n if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) {\n // Don't merge with inserts/deletes\n return false;\n }\n if (prevChange.originalEndLineNumber === originalLineNumber && prevChange.modifiedEndLineNumber === modifiedLineNumber) {\n if (this.shouldComputeCharChanges && prevChange.charChanges) {\n prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn));\n }\n return true;\n }\n if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) {\n prevChange.originalEndLineNumber = originalLineNumber;\n prevChange.modifiedEndLineNumber = modifiedLineNumber;\n if (this.shouldComputeCharChanges && prevChange.charChanges) {\n prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn));\n }\n return true;\n }\n return false;\n }\n}\nfunction getFirstNonBlankColumn(txt, defaultValue) {\n const r = strings.firstNonWhitespaceIndex(txt);\n if (r === -1) {\n return defaultValue;\n }\n return r + 1;\n}\nfunction getLastNonBlankColumn(txt, defaultValue) {\n const r = strings.lastNonWhitespaceIndex(txt);\n if (r === -1) {\n return defaultValue;\n }\n return r + 2;\n}\nfunction createContinueProcessingPredicate(maximumRuntime) {\n if (maximumRuntime === 0) {\n return () => true;\n }\n const startTime = Date.now();\n return () => {\n return Date.now() - startTime < maximumRuntime;\n };\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { forEachAdjacent } from '../../../../../base/common/arrays.js';\nimport { BugIndicatingError } from '../../../../../base/common/errors.js';\nimport { OffsetRange } from '../../../core/offsetRange.js';\nexport class DiffAlgorithmResult {\n static trivial(seq1, seq2) {\n return new DiffAlgorithmResult([new SequenceDiff(OffsetRange.ofLength(seq1.length), OffsetRange.ofLength(seq2.length))], false);\n }\n static trivialTimedOut(seq1, seq2) {\n return new DiffAlgorithmResult([new SequenceDiff(OffsetRange.ofLength(seq1.length), OffsetRange.ofLength(seq2.length))], true);\n }\n constructor(diffs, \n /**\n * Indicates if the time out was reached.\n * In that case, the diffs might be an approximation and the user should be asked to rerun the diff with more time.\n */\n hitTimeout) {\n this.diffs = diffs;\n this.hitTimeout = hitTimeout;\n }\n}\nexport class SequenceDiff {\n static invert(sequenceDiffs, doc1Length) {\n const result = [];\n forEachAdjacent(sequenceDiffs, (a, b) => {\n result.push(SequenceDiff.fromOffsetPairs(a ? a.getEndExclusives() : OffsetPair.zero, b ? b.getStarts() : new OffsetPair(doc1Length, (a ? a.seq2Range.endExclusive - a.seq1Range.endExclusive : 0) + doc1Length)));\n });\n return result;\n }\n static fromOffsetPairs(start, endExclusive) {\n return new SequenceDiff(new OffsetRange(start.offset1, endExclusive.offset1), new OffsetRange(start.offset2, endExclusive.offset2));\n }\n constructor(seq1Range, seq2Range) {\n this.seq1Range = seq1Range;\n this.seq2Range = seq2Range;\n }\n swap() {\n return new SequenceDiff(this.seq2Range, this.seq1Range);\n }\n toString() {\n return `${this.seq1Range} <-> ${this.seq2Range}`;\n }\n join(other) {\n return new SequenceDiff(this.seq1Range.join(other.seq1Range), this.seq2Range.join(other.seq2Range));\n }\n delta(offset) {\n if (offset === 0) {\n return this;\n }\n return new SequenceDiff(this.seq1Range.delta(offset), this.seq2Range.delta(offset));\n }\n deltaStart(offset) {\n if (offset === 0) {\n return this;\n }\n return new SequenceDiff(this.seq1Range.deltaStart(offset), this.seq2Range.deltaStart(offset));\n }\n deltaEnd(offset) {\n if (offset === 0) {\n return this;\n }\n return new SequenceDiff(this.seq1Range.deltaEnd(offset), this.seq2Range.deltaEnd(offset));\n }\n intersect(other) {\n const i1 = this.seq1Range.intersect(other.seq1Range);\n const i2 = this.seq2Range.intersect(other.seq2Range);\n if (!i1 || !i2) {\n return undefined;\n }\n return new SequenceDiff(i1, i2);\n }\n getStarts() {\n return new OffsetPair(this.seq1Range.start, this.seq2Range.start);\n }\n getEndExclusives() {\n return new OffsetPair(this.seq1Range.endExclusive, this.seq2Range.endExclusive);\n }\n}\nexport class OffsetPair {\n constructor(offset1, offset2) {\n this.offset1 = offset1;\n this.offset2 = offset2;\n }\n toString() {\n return `${this.offset1} <-> ${this.offset2}`;\n }\n delta(offset) {\n if (offset === 0) {\n return this;\n }\n return new OffsetPair(this.offset1 + offset, this.offset2 + offset);\n }\n equals(other) {\n return this.offset1 === other.offset1 && this.offset2 === other.offset2;\n }\n}\nOffsetPair.zero = new OffsetPair(0, 0);\nOffsetPair.max = new OffsetPair(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);\nexport class InfiniteTimeout {\n isValid() {\n return true;\n }\n}\nInfiniteTimeout.instance = new InfiniteTimeout();\nexport class DateTimeout {\n constructor(timeout) {\n this.timeout = timeout;\n this.startTime = Date.now();\n this.valid = true;\n if (timeout <= 0) {\n throw new BugIndicatingError('timeout must be positive');\n }\n }\n // Recommendation: Set a log-point `{this.disable()}` in the body\n isValid() {\n const valid = Date.now() - this.startTime < this.timeout;\n if (!valid && this.valid) {\n this.valid = false; // timeout reached\n // eslint-disable-next-line no-debugger\n debugger; // WARNING: Most likely debugging caused the timeout. Call `this.disable()` to continue without timing out.\n }\n return this.valid;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class Array2D {\n constructor(width, height) {\n this.width = width;\n this.height = height;\n this.array = [];\n this.array = new Array(width * height);\n }\n get(x, y) {\n return this.array[x + y * this.width];\n }\n set(x, y, value) {\n this.array[x + y * this.width] = value;\n }\n}\nexport function isSpace(charCode) {\n return charCode === 32 /* CharCode.Space */ || charCode === 9 /* CharCode.Tab */;\n}\nexport class LineRangeFragment {\n static getKey(chr) {\n let key = this.chrKeys.get(chr);\n if (key === undefined) {\n key = this.chrKeys.size;\n this.chrKeys.set(chr, key);\n }\n return key;\n }\n constructor(range, lines, source) {\n this.range = range;\n this.lines = lines;\n this.source = source;\n this.histogram = [];\n let counter = 0;\n for (let i = range.startLineNumber - 1; i < range.endLineNumberExclusive - 1; i++) {\n const line = lines[i];\n for (let j = 0; j < line.length; j++) {\n counter++;\n const chr = line[j];\n const key = LineRangeFragment.getKey(chr);\n this.histogram[key] = (this.histogram[key] || 0) + 1;\n }\n counter++;\n const key = LineRangeFragment.getKey('\\n');\n this.histogram[key] = (this.histogram[key] || 0) + 1;\n }\n this.totalCount = counter;\n }\n computeSimilarity(other) {\n var _a, _b;\n let sumDifferences = 0;\n const maxLength = Math.max(this.histogram.length, other.histogram.length);\n for (let i = 0; i < maxLength; i++) {\n sumDifferences += Math.abs(((_a = this.histogram[i]) !== null && _a !== void 0 ? _a : 0) - ((_b = other.histogram[i]) !== null && _b !== void 0 ? _b : 0));\n }\n return 1 - (sumDifferences / (this.totalCount + other.totalCount));\n }\n}\nLineRangeFragment.chrKeys = new Map();\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { OffsetRange } from '../../../core/offsetRange.js';\nimport { SequenceDiff, InfiniteTimeout, DiffAlgorithmResult } from './diffAlgorithm.js';\nimport { Array2D } from '../utils.js';\n/**\n * A O(MN) diffing algorithm that supports a score function.\n * The algorithm can be improved by processing the 2d array diagonally.\n*/\nexport class DynamicProgrammingDiffing {\n compute(sequence1, sequence2, timeout = InfiniteTimeout.instance, equalityScore) {\n if (sequence1.length === 0 || sequence2.length === 0) {\n return DiffAlgorithmResult.trivial(sequence1, sequence2);\n }\n /**\n * lcsLengths.get(i, j): Length of the longest common subsequence of sequence1.substring(0, i + 1) and sequence2.substring(0, j + 1).\n */\n const lcsLengths = new Array2D(sequence1.length, sequence2.length);\n const directions = new Array2D(sequence1.length, sequence2.length);\n const lengths = new Array2D(sequence1.length, sequence2.length);\n // ==== Initializing lcsLengths ====\n for (let s1 = 0; s1 < sequence1.length; s1++) {\n for (let s2 = 0; s2 < sequence2.length; s2++) {\n if (!timeout.isValid()) {\n return DiffAlgorithmResult.trivialTimedOut(sequence1, sequence2);\n }\n const horizontalLen = s1 === 0 ? 0 : lcsLengths.get(s1 - 1, s2);\n const verticalLen = s2 === 0 ? 0 : lcsLengths.get(s1, s2 - 1);\n let extendedSeqScore;\n if (sequence1.getElement(s1) === sequence2.getElement(s2)) {\n if (s1 === 0 || s2 === 0) {\n extendedSeqScore = 0;\n }\n else {\n extendedSeqScore = lcsLengths.get(s1 - 1, s2 - 1);\n }\n if (s1 > 0 && s2 > 0 && directions.get(s1 - 1, s2 - 1) === 3) {\n // Prefer consecutive diagonals\n extendedSeqScore += lengths.get(s1 - 1, s2 - 1);\n }\n extendedSeqScore += (equalityScore ? equalityScore(s1, s2) : 1);\n }\n else {\n extendedSeqScore = -1;\n }\n const newValue = Math.max(horizontalLen, verticalLen, extendedSeqScore);\n if (newValue === extendedSeqScore) {\n // Prefer diagonals\n const prevLen = s1 > 0 && s2 > 0 ? lengths.get(s1 - 1, s2 - 1) : 0;\n lengths.set(s1, s2, prevLen + 1);\n directions.set(s1, s2, 3);\n }\n else if (newValue === horizontalLen) {\n lengths.set(s1, s2, 0);\n directions.set(s1, s2, 1);\n }\n else if (newValue === verticalLen) {\n lengths.set(s1, s2, 0);\n directions.set(s1, s2, 2);\n }\n lcsLengths.set(s1, s2, newValue);\n }\n }\n // ==== Backtracking ====\n const result = [];\n let lastAligningPosS1 = sequence1.length;\n let lastAligningPosS2 = sequence2.length;\n function reportDecreasingAligningPositions(s1, s2) {\n if (s1 + 1 !== lastAligningPosS1 || s2 + 1 !== lastAligningPosS2) {\n result.push(new SequenceDiff(new OffsetRange(s1 + 1, lastAligningPosS1), new OffsetRange(s2 + 1, lastAligningPosS2)));\n }\n lastAligningPosS1 = s1;\n lastAligningPosS2 = s2;\n }\n let s1 = sequence1.length - 1;\n let s2 = sequence2.length - 1;\n while (s1 >= 0 && s2 >= 0) {\n if (directions.get(s1, s2) === 3) {\n reportDecreasingAligningPositions(s1, s2);\n s1--;\n s2--;\n }\n else {\n if (directions.get(s1, s2) === 1) {\n s1--;\n }\n else {\n s2--;\n }\n }\n }\n reportDecreasingAligningPositions(-1, -1);\n result.reverse();\n return new DiffAlgorithmResult(result, false);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { OffsetRange } from '../../../core/offsetRange.js';\nimport { DiffAlgorithmResult, InfiniteTimeout, SequenceDiff } from './diffAlgorithm.js';\n/**\n * An O(ND) diff algorithm that has a quadratic space worst-case complexity.\n*/\nexport class MyersDiffAlgorithm {\n compute(seq1, seq2, timeout = InfiniteTimeout.instance) {\n // These are common special cases.\n // The early return improves performance dramatically.\n if (seq1.length === 0 || seq2.length === 0) {\n return DiffAlgorithmResult.trivial(seq1, seq2);\n }\n const seqX = seq1; // Text on the x axis\n const seqY = seq2; // Text on the y axis\n function getXAfterSnake(x, y) {\n while (x < seqX.length && y < seqY.length && seqX.getElement(x) === seqY.getElement(y)) {\n x++;\n y++;\n }\n return x;\n }\n let d = 0;\n // V[k]: X value of longest d-line that ends in diagonal k.\n // d-line: path from (0,0) to (x,y) that uses exactly d non-diagonals.\n // diagonal k: Set of points (x,y) with x-y = k.\n // k=1 -> (1,0),(2,1)\n const V = new FastInt32Array();\n V.set(0, getXAfterSnake(0, 0));\n const paths = new FastArrayNegativeIndices();\n paths.set(0, V.get(0) === 0 ? null : new SnakePath(null, 0, 0, V.get(0)));\n let k = 0;\n loop: while (true) {\n d++;\n if (!timeout.isValid()) {\n return DiffAlgorithmResult.trivialTimedOut(seqX, seqY);\n }\n // The paper has `for (k = -d; k <= d; k += 2)`, but we can ignore diagonals that cannot influence the result.\n const lowerBound = -Math.min(d, seqY.length + (d % 2));\n const upperBound = Math.min(d, seqX.length + (d % 2));\n for (k = lowerBound; k <= upperBound; k += 2) {\n let step = 0;\n // We can use the X values of (d-1)-lines to compute X value of the longest d-lines.\n const maxXofDLineTop = k === upperBound ? -1 : V.get(k + 1); // We take a vertical non-diagonal (add a symbol in seqX)\n const maxXofDLineLeft = k === lowerBound ? -1 : V.get(k - 1) + 1; // We take a horizontal non-diagonal (+1 x) (delete a symbol in seqX)\n step++;\n const x = Math.min(Math.max(maxXofDLineTop, maxXofDLineLeft), seqX.length);\n const y = x - k;\n step++;\n if (x > seqX.length || y > seqY.length) {\n // This diagonal is irrelevant for the result.\n // TODO: Don't pay the cost for this in the next iteration.\n continue;\n }\n const newMaxX = getXAfterSnake(x, y);\n V.set(k, newMaxX);\n const lastPath = x === maxXofDLineTop ? paths.get(k + 1) : paths.get(k - 1);\n paths.set(k, newMaxX !== x ? new SnakePath(lastPath, x, y, newMaxX - x) : lastPath);\n if (V.get(k) === seqX.length && V.get(k) - k === seqY.length) {\n break loop;\n }\n }\n }\n let path = paths.get(k);\n const result = [];\n let lastAligningPosS1 = seqX.length;\n let lastAligningPosS2 = seqY.length;\n while (true) {\n const endX = path ? path.x + path.length : 0;\n const endY = path ? path.y + path.length : 0;\n if (endX !== lastAligningPosS1 || endY !== lastAligningPosS2) {\n result.push(new SequenceDiff(new OffsetRange(endX, lastAligningPosS1), new OffsetRange(endY, lastAligningPosS2)));\n }\n if (!path) {\n break;\n }\n lastAligningPosS1 = path.x;\n lastAligningPosS2 = path.y;\n path = path.prev;\n }\n result.reverse();\n return new DiffAlgorithmResult(result, false);\n }\n}\nclass SnakePath {\n constructor(prev, x, y, length) {\n this.prev = prev;\n this.x = x;\n this.y = y;\n this.length = length;\n }\n}\n/**\n * An array that supports fast negative indices.\n*/\nclass FastInt32Array {\n constructor() {\n this.positiveArr = new Int32Array(10);\n this.negativeArr = new Int32Array(10);\n }\n get(idx) {\n if (idx < 0) {\n idx = -idx - 1;\n return this.negativeArr[idx];\n }\n else {\n return this.positiveArr[idx];\n }\n }\n set(idx, value) {\n if (idx < 0) {\n idx = -idx - 1;\n if (idx >= this.negativeArr.length) {\n const arr = this.negativeArr;\n this.negativeArr = new Int32Array(arr.length * 2);\n this.negativeArr.set(arr);\n }\n this.negativeArr[idx] = value;\n }\n else {\n if (idx >= this.positiveArr.length) {\n const arr = this.positiveArr;\n this.positiveArr = new Int32Array(arr.length * 2);\n this.positiveArr.set(arr);\n }\n this.positiveArr[idx] = value;\n }\n }\n}\n/**\n * An array that supports fast negative indices.\n*/\nclass FastArrayNegativeIndices {\n constructor() {\n this.positiveArr = [];\n this.negativeArr = [];\n }\n get(idx) {\n if (idx < 0) {\n idx = -idx - 1;\n return this.negativeArr[idx];\n }\n else {\n return this.positiveArr[idx];\n }\n }\n set(idx, value) {\n if (idx < 0) {\n idx = -idx - 1;\n this.negativeArr[idx] = value;\n }\n else {\n this.positiveArr[idx] = value;\n }\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar _a, _b;\nclass ResourceMapEntry {\n constructor(uri, value) {\n this.uri = uri;\n this.value = value;\n }\n}\nfunction isEntries(arg) {\n return Array.isArray(arg);\n}\nexport class ResourceMap {\n constructor(arg, toKey) {\n this[_a] = 'ResourceMap';\n if (arg instanceof ResourceMap) {\n this.map = new Map(arg.map);\n this.toKey = toKey !== null && toKey !== void 0 ? toKey : ResourceMap.defaultToKey;\n }\n else if (isEntries(arg)) {\n this.map = new Map();\n this.toKey = toKey !== null && toKey !== void 0 ? toKey : ResourceMap.defaultToKey;\n for (const [resource, value] of arg) {\n this.set(resource, value);\n }\n }\n else {\n this.map = new Map();\n this.toKey = arg !== null && arg !== void 0 ? arg : ResourceMap.defaultToKey;\n }\n }\n set(resource, value) {\n this.map.set(this.toKey(resource), new ResourceMapEntry(resource, value));\n return this;\n }\n get(resource) {\n var _c;\n return (_c = this.map.get(this.toKey(resource))) === null || _c === void 0 ? void 0 : _c.value;\n }\n has(resource) {\n return this.map.has(this.toKey(resource));\n }\n get size() {\n return this.map.size;\n }\n clear() {\n this.map.clear();\n }\n delete(resource) {\n return this.map.delete(this.toKey(resource));\n }\n forEach(clb, thisArg) {\n if (typeof thisArg !== 'undefined') {\n clb = clb.bind(thisArg);\n }\n for (const [_, entry] of this.map) {\n clb(entry.value, entry.uri, this);\n }\n }\n *values() {\n for (const entry of this.map.values()) {\n yield entry.value;\n }\n }\n *keys() {\n for (const entry of this.map.values()) {\n yield entry.uri;\n }\n }\n *entries() {\n for (const entry of this.map.values()) {\n yield [entry.uri, entry.value];\n }\n }\n *[(_a = Symbol.toStringTag, Symbol.iterator)]() {\n for (const [, entry] of this.map) {\n yield [entry.uri, entry.value];\n }\n }\n}\nResourceMap.defaultToKey = (resource) => resource.toString();\nexport class LinkedMap {\n constructor() {\n this[_b] = 'LinkedMap';\n this._map = new Map();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state = 0;\n }\n clear() {\n this._map.clear();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state++;\n }\n isEmpty() {\n return !this._head && !this._tail;\n }\n get size() {\n return this._size;\n }\n get first() {\n var _c;\n return (_c = this._head) === null || _c === void 0 ? void 0 : _c.value;\n }\n get last() {\n var _c;\n return (_c = this._tail) === null || _c === void 0 ? void 0 : _c.value;\n }\n has(key) {\n return this._map.has(key);\n }\n get(key, touch = 0 /* Touch.None */) {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n if (touch !== 0 /* Touch.None */) {\n this.touch(item, touch);\n }\n return item.value;\n }\n set(key, value, touch = 0 /* Touch.None */) {\n let item = this._map.get(key);\n if (item) {\n item.value = value;\n if (touch !== 0 /* Touch.None */) {\n this.touch(item, touch);\n }\n }\n else {\n item = { key, value, next: undefined, previous: undefined };\n switch (touch) {\n case 0 /* Touch.None */:\n this.addItemLast(item);\n break;\n case 1 /* Touch.AsOld */:\n this.addItemFirst(item);\n break;\n case 2 /* Touch.AsNew */:\n this.addItemLast(item);\n break;\n default:\n this.addItemLast(item);\n break;\n }\n this._map.set(key, item);\n this._size++;\n }\n return this;\n }\n delete(key) {\n return !!this.remove(key);\n }\n remove(key) {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n this._map.delete(key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n shift() {\n if (!this._head && !this._tail) {\n return undefined;\n }\n if (!this._head || !this._tail) {\n throw new Error('Invalid list');\n }\n const item = this._head;\n this._map.delete(item.key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n forEach(callbackfn, thisArg) {\n const state = this._state;\n let current = this._head;\n while (current) {\n if (thisArg) {\n callbackfn.bind(thisArg)(current.value, current.key, this);\n }\n else {\n callbackfn(current.value, current.key, this);\n }\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n current = current.next;\n }\n }\n keys() {\n const map = this;\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]() {\n return iterator;\n },\n next() {\n if (map._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.key, done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n values() {\n const map = this;\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]() {\n return iterator;\n },\n next() {\n if (map._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.value, done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n entries() {\n const map = this;\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]() {\n return iterator;\n },\n next() {\n if (map._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: [current.key, current.value], done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n [(_b = Symbol.toStringTag, Symbol.iterator)]() {\n return this.entries();\n }\n trimOld(newSize) {\n if (newSize >= this.size) {\n return;\n }\n if (newSize === 0) {\n this.clear();\n return;\n }\n let current = this._head;\n let currentSize = this.size;\n while (current && currentSize > newSize) {\n this._map.delete(current.key);\n current = current.next;\n currentSize--;\n }\n this._head = current;\n this._size = currentSize;\n if (current) {\n current.previous = undefined;\n }\n this._state++;\n }\n addItemFirst(item) {\n // First time Insert\n if (!this._head && !this._tail) {\n this._tail = item;\n }\n else if (!this._head) {\n throw new Error('Invalid list');\n }\n else {\n item.next = this._head;\n this._head.previous = item;\n }\n this._head = item;\n this._state++;\n }\n addItemLast(item) {\n // First time Insert\n if (!this._head && !this._tail) {\n this._head = item;\n }\n else if (!this._tail) {\n throw new Error('Invalid list');\n }\n else {\n item.previous = this._tail;\n this._tail.next = item;\n }\n this._tail = item;\n this._state++;\n }\n removeItem(item) {\n if (item === this._head && item === this._tail) {\n this._head = undefined;\n this._tail = undefined;\n }\n else if (item === this._head) {\n // This can only happen if size === 1 which is handled\n // by the case above.\n if (!item.next) {\n throw new Error('Invalid list');\n }\n item.next.previous = undefined;\n this._head = item.next;\n }\n else if (item === this._tail) {\n // This can only happen if size === 1 which is handled\n // by the case above.\n if (!item.previous) {\n throw new Error('Invalid list');\n }\n item.previous.next = undefined;\n this._tail = item.previous;\n }\n else {\n const next = item.next;\n const previous = item.previous;\n if (!next || !previous) {\n throw new Error('Invalid list');\n }\n next.previous = previous;\n previous.next = next;\n }\n item.next = undefined;\n item.previous = undefined;\n this._state++;\n }\n touch(item, touch) {\n if (!this._head || !this._tail) {\n throw new Error('Invalid list');\n }\n if ((touch !== 1 /* Touch.AsOld */ && touch !== 2 /* Touch.AsNew */)) {\n return;\n }\n if (touch === 1 /* Touch.AsOld */) {\n if (item === this._head) {\n return;\n }\n const next = item.next;\n const previous = item.previous;\n // Unlink the item\n if (item === this._tail) {\n // previous must be defined since item was not head but is tail\n // So there are more than on item in the map\n previous.next = undefined;\n this._tail = previous;\n }\n else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next.previous = previous;\n previous.next = next;\n }\n // Insert the node at head\n item.previous = undefined;\n item.next = this._head;\n this._head.previous = item;\n this._head = item;\n this._state++;\n }\n else if (touch === 2 /* Touch.AsNew */) {\n if (item === this._tail) {\n return;\n }\n const next = item.next;\n const previous = item.previous;\n // Unlink the item.\n if (item === this._head) {\n // next must be defined since item was not tail but is head\n // So there are more than on item in the map\n next.previous = undefined;\n this._head = next;\n }\n else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next.previous = previous;\n previous.next = next;\n }\n item.next = undefined;\n item.previous = this._tail;\n this._tail.next = item;\n this._tail = item;\n this._state++;\n }\n }\n toJSON() {\n const data = [];\n this.forEach((value, key) => {\n data.push([key, value]);\n });\n return data;\n }\n fromJSON(data) {\n this.clear();\n for (const [key, value] of data) {\n this.set(key, value);\n }\n }\n}\nexport class LRUCache extends LinkedMap {\n constructor(limit, ratio = 1) {\n super();\n this._limit = limit;\n this._ratio = Math.min(Math.max(0, ratio), 1);\n }\n get limit() {\n return this._limit;\n }\n set limit(limit) {\n this._limit = limit;\n this.checkTrim();\n }\n get(key, touch = 2 /* Touch.AsNew */) {\n return super.get(key, touch);\n }\n peek(key) {\n return super.get(key, 0 /* Touch.None */);\n }\n set(key, value) {\n super.set(key, value, 2 /* Touch.AsNew */);\n this.checkTrim();\n return this;\n }\n checkTrim() {\n if (this.size > this._limit) {\n this.trimOld(Math.round(this._limit * this._ratio));\n }\n }\n}\n/**\n * A map that allows access both by keys and values.\n * **NOTE**: values need to be unique.\n */\nexport class BidirectionalMap {\n constructor(entries) {\n this._m1 = new Map();\n this._m2 = new Map();\n if (entries) {\n for (const [key, value] of entries) {\n this.set(key, value);\n }\n }\n }\n clear() {\n this._m1.clear();\n this._m2.clear();\n }\n set(key, value) {\n this._m1.set(key, value);\n this._m2.set(value, key);\n }\n get(key) {\n return this._m1.get(key);\n }\n getKey(value) {\n return this._m2.get(value);\n }\n delete(key) {\n const value = this._m1.get(key);\n if (value === undefined) {\n return false;\n }\n this._m1.delete(key);\n this._m2.delete(value);\n return true;\n }\n keys() {\n return this._m1.keys();\n }\n values() {\n return this._m1.values();\n }\n}\nexport class SetMap {\n constructor() {\n this.map = new Map();\n }\n add(key, value) {\n let values = this.map.get(key);\n if (!values) {\n values = new Set();\n this.map.set(key, values);\n }\n values.add(value);\n }\n delete(key, value) {\n const values = this.map.get(key);\n if (!values) {\n return;\n }\n values.delete(value);\n if (values.size === 0) {\n this.map.delete(key);\n }\n }\n forEach(key, fn) {\n const values = this.map.get(key);\n if (!values) {\n return;\n }\n values.forEach(fn);\n }\n get(key) {\n const values = this.map.get(key);\n if (!values) {\n return new Set();\n }\n return values;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { findLastIdxMonotonous, findLastMonotonous, findFirstMonotonous } from '../../../../base/common/arraysFind.js';\nimport { OffsetRange } from '../../core/offsetRange.js';\nimport { Position } from '../../core/position.js';\nimport { Range } from '../../core/range.js';\nimport { isSpace } from './utils.js';\nexport class LinesSliceCharSequence {\n constructor(lines, lineRange, considerWhitespaceChanges) {\n // This slice has to have lineRange.length many \\n! (otherwise diffing against an empty slice will be problematic)\n // (Unless it covers the entire document, in that case the other slice also has to cover the entire document ands it's okay)\n this.lines = lines;\n this.considerWhitespaceChanges = considerWhitespaceChanges;\n this.elements = [];\n this.firstCharOffsetByLine = [];\n // To account for trimming\n this.additionalOffsetByLine = [];\n // If the slice covers the end, but does not start at the beginning, we include just the \\n of the previous line.\n let trimFirstLineFully = false;\n if (lineRange.start > 0 && lineRange.endExclusive >= lines.length) {\n lineRange = new OffsetRange(lineRange.start - 1, lineRange.endExclusive);\n trimFirstLineFully = true;\n }\n this.lineRange = lineRange;\n this.firstCharOffsetByLine[0] = 0;\n for (let i = this.lineRange.start; i < this.lineRange.endExclusive; i++) {\n let line = lines[i];\n let offset = 0;\n if (trimFirstLineFully) {\n offset = line.length;\n line = '';\n trimFirstLineFully = false;\n }\n else if (!considerWhitespaceChanges) {\n const trimmedStartLine = line.trimStart();\n offset = line.length - trimmedStartLine.length;\n line = trimmedStartLine.trimEnd();\n }\n this.additionalOffsetByLine.push(offset);\n for (let i = 0; i < line.length; i++) {\n this.elements.push(line.charCodeAt(i));\n }\n // Don't add an \\n that does not exist in the document.\n if (i < lines.length - 1) {\n this.elements.push('\\n'.charCodeAt(0));\n this.firstCharOffsetByLine[i - this.lineRange.start + 1] = this.elements.length;\n }\n }\n // To account for the last line\n this.additionalOffsetByLine.push(0);\n }\n toString() {\n return `Slice: \"${this.text}\"`;\n }\n get text() {\n return this.getText(new OffsetRange(0, this.length));\n }\n getText(range) {\n return this.elements.slice(range.start, range.endExclusive).map(e => String.fromCharCode(e)).join('');\n }\n getElement(offset) {\n return this.elements[offset];\n }\n get length() {\n return this.elements.length;\n }\n getBoundaryScore(length) {\n // a b c , d e f\n // 11 0 0 12 15 6 13 0 0 11\n const prevCategory = getCategory(length > 0 ? this.elements[length - 1] : -1);\n const nextCategory = getCategory(length < this.elements.length ? this.elements[length] : -1);\n if (prevCategory === 7 /* CharBoundaryCategory.LineBreakCR */ && nextCategory === 8 /* CharBoundaryCategory.LineBreakLF */) {\n // don't break between \\r and \\n\n return 0;\n }\n if (prevCategory === 8 /* CharBoundaryCategory.LineBreakLF */) {\n // prefer the linebreak before the change\n return 150;\n }\n let score = 0;\n if (prevCategory !== nextCategory) {\n score += 10;\n if (prevCategory === 0 /* CharBoundaryCategory.WordLower */ && nextCategory === 1 /* CharBoundaryCategory.WordUpper */) {\n score += 1;\n }\n }\n score += getCategoryBoundaryScore(prevCategory);\n score += getCategoryBoundaryScore(nextCategory);\n return score;\n }\n translateOffset(offset) {\n // find smallest i, so that lineBreakOffsets[i] <= offset using binary search\n if (this.lineRange.isEmpty) {\n return new Position(this.lineRange.start + 1, 1);\n }\n const i = findLastIdxMonotonous(this.firstCharOffsetByLine, (value) => value <= offset);\n return new Position(this.lineRange.start + i + 1, offset - this.firstCharOffsetByLine[i] + this.additionalOffsetByLine[i] + 1);\n }\n translateRange(range) {\n return Range.fromPositions(this.translateOffset(range.start), this.translateOffset(range.endExclusive));\n }\n /**\n * Finds the word that contains the character at the given offset\n */\n findWordContaining(offset) {\n if (offset < 0 || offset >= this.elements.length) {\n return undefined;\n }\n if (!isWordChar(this.elements[offset])) {\n return undefined;\n }\n // find start\n let start = offset;\n while (start > 0 && isWordChar(this.elements[start - 1])) {\n start--;\n }\n // find end\n let end = offset;\n while (end < this.elements.length && isWordChar(this.elements[end])) {\n end++;\n }\n return new OffsetRange(start, end);\n }\n countLinesIn(range) {\n return this.translateOffset(range.endExclusive).lineNumber - this.translateOffset(range.start).lineNumber;\n }\n isStronglyEqual(offset1, offset2) {\n return this.elements[offset1] === this.elements[offset2];\n }\n extendToFullLines(range) {\n var _a, _b;\n const start = (_a = findLastMonotonous(this.firstCharOffsetByLine, x => x <= range.start)) !== null && _a !== void 0 ? _a : 0;\n const end = (_b = findFirstMonotonous(this.firstCharOffsetByLine, x => range.endExclusive <= x)) !== null && _b !== void 0 ? _b : this.elements.length;\n return new OffsetRange(start, end);\n }\n}\nfunction isWordChar(charCode) {\n return charCode >= 97 /* CharCode.a */ && charCode <= 122 /* CharCode.z */\n || charCode >= 65 /* CharCode.A */ && charCode <= 90 /* CharCode.Z */\n || charCode >= 48 /* CharCode.Digit0 */ && charCode <= 57 /* CharCode.Digit9 */;\n}\nconst score = {\n [0 /* CharBoundaryCategory.WordLower */]: 0,\n [1 /* CharBoundaryCategory.WordUpper */]: 0,\n [2 /* CharBoundaryCategory.WordNumber */]: 0,\n [3 /* CharBoundaryCategory.End */]: 10,\n [4 /* CharBoundaryCategory.Other */]: 2,\n [5 /* CharBoundaryCategory.Separator */]: 30,\n [6 /* CharBoundaryCategory.Space */]: 3,\n [7 /* CharBoundaryCategory.LineBreakCR */]: 10,\n [8 /* CharBoundaryCategory.LineBreakLF */]: 10,\n};\nfunction getCategoryBoundaryScore(category) {\n return score[category];\n}\nfunction getCategory(charCode) {\n if (charCode === 10 /* CharCode.LineFeed */) {\n return 8 /* CharBoundaryCategory.LineBreakLF */;\n }\n else if (charCode === 13 /* CharCode.CarriageReturn */) {\n return 7 /* CharBoundaryCategory.LineBreakCR */;\n }\n else if (isSpace(charCode)) {\n return 6 /* CharBoundaryCategory.Space */;\n }\n else if (charCode >= 97 /* CharCode.a */ && charCode <= 122 /* CharCode.z */) {\n return 0 /* CharBoundaryCategory.WordLower */;\n }\n else if (charCode >= 65 /* CharCode.A */ && charCode <= 90 /* CharCode.Z */) {\n return 1 /* CharBoundaryCategory.WordUpper */;\n }\n else if (charCode >= 48 /* CharCode.Digit0 */ && charCode <= 57 /* CharCode.Digit9 */) {\n return 2 /* CharBoundaryCategory.WordNumber */;\n }\n else if (charCode === -1) {\n return 3 /* CharBoundaryCategory.End */;\n }\n else if (charCode === 44 /* CharCode.Comma */ || charCode === 59 /* CharCode.Semicolon */) {\n return 5 /* CharBoundaryCategory.Separator */;\n }\n else {\n return 4 /* CharBoundaryCategory.Other */;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { SequenceDiff } from './algorithms/diffAlgorithm.js';\nimport { LineRangeMapping } from '../rangeMapping.js';\nimport { pushMany, compareBy, numberComparator, reverseOrder } from '../../../../base/common/arrays.js';\nimport { MonotonousArray, findLastMonotonous } from '../../../../base/common/arraysFind.js';\nimport { SetMap } from '../../../../base/common/map.js';\nimport { LineRange, LineRangeSet } from '../../core/lineRange.js';\nimport { OffsetRange } from '../../core/offsetRange.js';\nimport { LinesSliceCharSequence } from './linesSliceCharSequence.js';\nimport { LineRangeFragment, isSpace } from './utils.js';\nimport { MyersDiffAlgorithm } from './algorithms/myersDiffAlgorithm.js';\nexport function computeMovedLines(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout) {\n let { moves, excludedChanges } = computeMovesFromSimpleDeletionsToSimpleInsertions(changes, originalLines, modifiedLines, timeout);\n if (!timeout.isValid()) {\n return [];\n }\n const filteredChanges = changes.filter(c => !excludedChanges.has(c));\n const unchangedMoves = computeUnchangedMoves(filteredChanges, hashedOriginalLines, hashedModifiedLines, originalLines, modifiedLines, timeout);\n pushMany(moves, unchangedMoves);\n moves = joinCloseConsecutiveMoves(moves);\n // Ignore too short moves\n moves = moves.filter(current => {\n const lines = current.original.toOffsetRange().slice(originalLines).map(l => l.trim());\n const originalText = lines.join('\\n');\n return originalText.length >= 15 && countWhere(lines, l => l.length >= 2) >= 2;\n });\n moves = removeMovesInSameDiff(changes, moves);\n return moves;\n}\nfunction countWhere(arr, predicate) {\n let count = 0;\n for (const t of arr) {\n if (predicate(t)) {\n count++;\n }\n }\n return count;\n}\nfunction computeMovesFromSimpleDeletionsToSimpleInsertions(changes, originalLines, modifiedLines, timeout) {\n const moves = [];\n const deletions = changes\n .filter(c => c.modified.isEmpty && c.original.length >= 3)\n .map(d => new LineRangeFragment(d.original, originalLines, d));\n const insertions = new Set(changes\n .filter(c => c.original.isEmpty && c.modified.length >= 3)\n .map(d => new LineRangeFragment(d.modified, modifiedLines, d)));\n const excludedChanges = new Set();\n for (const deletion of deletions) {\n let highestSimilarity = -1;\n let best;\n for (const insertion of insertions) {\n const similarity = deletion.computeSimilarity(insertion);\n if (similarity > highestSimilarity) {\n highestSimilarity = similarity;\n best = insertion;\n }\n }\n if (highestSimilarity > 0.90 && best) {\n insertions.delete(best);\n moves.push(new LineRangeMapping(deletion.range, best.range));\n excludedChanges.add(deletion.source);\n excludedChanges.add(best.source);\n }\n if (!timeout.isValid()) {\n return { moves, excludedChanges };\n }\n }\n return { moves, excludedChanges };\n}\nfunction computeUnchangedMoves(changes, hashedOriginalLines, hashedModifiedLines, originalLines, modifiedLines, timeout) {\n const moves = [];\n const original3LineHashes = new SetMap();\n for (const change of changes) {\n for (let i = change.original.startLineNumber; i < change.original.endLineNumberExclusive - 2; i++) {\n const key = `${hashedOriginalLines[i - 1]}:${hashedOriginalLines[i + 1 - 1]}:${hashedOriginalLines[i + 2 - 1]}`;\n original3LineHashes.add(key, { range: new LineRange(i, i + 3) });\n }\n }\n const possibleMappings = [];\n changes.sort(compareBy(c => c.modified.startLineNumber, numberComparator));\n for (const change of changes) {\n let lastMappings = [];\n for (let i = change.modified.startLineNumber; i < change.modified.endLineNumberExclusive - 2; i++) {\n const key = `${hashedModifiedLines[i - 1]}:${hashedModifiedLines[i + 1 - 1]}:${hashedModifiedLines[i + 2 - 1]}`;\n const currentModifiedRange = new LineRange(i, i + 3);\n const nextMappings = [];\n original3LineHashes.forEach(key, ({ range }) => {\n for (const lastMapping of lastMappings) {\n // does this match extend some last match?\n if (lastMapping.originalLineRange.endLineNumberExclusive + 1 === range.endLineNumberExclusive &&\n lastMapping.modifiedLineRange.endLineNumberExclusive + 1 === currentModifiedRange.endLineNumberExclusive) {\n lastMapping.originalLineRange = new LineRange(lastMapping.originalLineRange.startLineNumber, range.endLineNumberExclusive);\n lastMapping.modifiedLineRange = new LineRange(lastMapping.modifiedLineRange.startLineNumber, currentModifiedRange.endLineNumberExclusive);\n nextMappings.push(lastMapping);\n return;\n }\n }\n const mapping = {\n modifiedLineRange: currentModifiedRange,\n originalLineRange: range,\n };\n possibleMappings.push(mapping);\n nextMappings.push(mapping);\n });\n lastMappings = nextMappings;\n }\n if (!timeout.isValid()) {\n return [];\n }\n }\n possibleMappings.sort(reverseOrder(compareBy(m => m.modifiedLineRange.length, numberComparator)));\n const modifiedSet = new LineRangeSet();\n const originalSet = new LineRangeSet();\n for (const mapping of possibleMappings) {\n const diffOrigToMod = mapping.modifiedLineRange.startLineNumber - mapping.originalLineRange.startLineNumber;\n const modifiedSections = modifiedSet.subtractFrom(mapping.modifiedLineRange);\n const originalTranslatedSections = originalSet.subtractFrom(mapping.originalLineRange).getWithDelta(diffOrigToMod);\n const modifiedIntersectedSections = modifiedSections.getIntersection(originalTranslatedSections);\n for (const s of modifiedIntersectedSections.ranges) {\n if (s.length < 3) {\n continue;\n }\n const modifiedLineRange = s;\n const originalLineRange = s.delta(-diffOrigToMod);\n moves.push(new LineRangeMapping(originalLineRange, modifiedLineRange));\n modifiedSet.addRange(modifiedLineRange);\n originalSet.addRange(originalLineRange);\n }\n }\n moves.sort(compareBy(m => m.original.startLineNumber, numberComparator));\n const monotonousChanges = new MonotonousArray(changes);\n for (let i = 0; i < moves.length; i++) {\n const move = moves[i];\n const firstTouchingChangeOrig = monotonousChanges.findLastMonotonous(c => c.original.startLineNumber <= move.original.startLineNumber);\n const firstTouchingChangeMod = findLastMonotonous(changes, c => c.modified.startLineNumber <= move.modified.startLineNumber);\n const linesAbove = Math.max(move.original.startLineNumber - firstTouchingChangeOrig.original.startLineNumber, move.modified.startLineNumber - firstTouchingChangeMod.modified.startLineNumber);\n const lastTouchingChangeOrig = monotonousChanges.findLastMonotonous(c => c.original.startLineNumber < move.original.endLineNumberExclusive);\n const lastTouchingChangeMod = findLastMonotonous(changes, c => c.modified.startLineNumber < move.modified.endLineNumberExclusive);\n const linesBelow = Math.max(lastTouchingChangeOrig.original.endLineNumberExclusive - move.original.endLineNumberExclusive, lastTouchingChangeMod.modified.endLineNumberExclusive - move.modified.endLineNumberExclusive);\n let extendToTop;\n for (extendToTop = 0; extendToTop < linesAbove; extendToTop++) {\n const origLine = move.original.startLineNumber - extendToTop - 1;\n const modLine = move.modified.startLineNumber - extendToTop - 1;\n if (origLine > originalLines.length || modLine > modifiedLines.length) {\n break;\n }\n if (modifiedSet.contains(modLine) || originalSet.contains(origLine)) {\n break;\n }\n if (!areLinesSimilar(originalLines[origLine - 1], modifiedLines[modLine - 1], timeout)) {\n break;\n }\n }\n if (extendToTop > 0) {\n originalSet.addRange(new LineRange(move.original.startLineNumber - extendToTop, move.original.startLineNumber));\n modifiedSet.addRange(new LineRange(move.modified.startLineNumber - extendToTop, move.modified.startLineNumber));\n }\n let extendToBottom;\n for (extendToBottom = 0; extendToBottom < linesBelow; extendToBottom++) {\n const origLine = move.original.endLineNumberExclusive + extendToBottom;\n const modLine = move.modified.endLineNumberExclusive + extendToBottom;\n if (origLine > originalLines.length || modLine > modifiedLines.length) {\n break;\n }\n if (modifiedSet.contains(modLine) || originalSet.contains(origLine)) {\n break;\n }\n if (!areLinesSimilar(originalLines[origLine - 1], modifiedLines[modLine - 1], timeout)) {\n break;\n }\n }\n if (extendToBottom > 0) {\n originalSet.addRange(new LineRange(move.original.endLineNumberExclusive, move.original.endLineNumberExclusive + extendToBottom));\n modifiedSet.addRange(new LineRange(move.modified.endLineNumberExclusive, move.modified.endLineNumberExclusive + extendToBottom));\n }\n if (extendToTop > 0 || extendToBottom > 0) {\n moves[i] = new LineRangeMapping(new LineRange(move.original.startLineNumber - extendToTop, move.original.endLineNumberExclusive + extendToBottom), new LineRange(move.modified.startLineNumber - extendToTop, move.modified.endLineNumberExclusive + extendToBottom));\n }\n }\n return moves;\n}\nfunction areLinesSimilar(line1, line2, timeout) {\n if (line1.trim() === line2.trim()) {\n return true;\n }\n if (line1.length > 300 && line2.length > 300) {\n return false;\n }\n const myersDiffingAlgorithm = new MyersDiffAlgorithm();\n const result = myersDiffingAlgorithm.compute(new LinesSliceCharSequence([line1], new OffsetRange(0, 1), false), new LinesSliceCharSequence([line2], new OffsetRange(0, 1), false), timeout);\n let commonNonSpaceCharCount = 0;\n const inverted = SequenceDiff.invert(result.diffs, line1.length);\n for (const seq of inverted) {\n seq.seq1Range.forEach(idx => {\n if (!isSpace(line1.charCodeAt(idx))) {\n commonNonSpaceCharCount++;\n }\n });\n }\n function countNonWsChars(str) {\n let count = 0;\n for (let i = 0; i < line1.length; i++) {\n if (!isSpace(str.charCodeAt(i))) {\n count++;\n }\n }\n return count;\n }\n const longerLineLength = countNonWsChars(line1.length > line2.length ? line1 : line2);\n const r = commonNonSpaceCharCount / longerLineLength > 0.6 && longerLineLength > 10;\n return r;\n}\nfunction joinCloseConsecutiveMoves(moves) {\n if (moves.length === 0) {\n return moves;\n }\n moves.sort(compareBy(m => m.original.startLineNumber, numberComparator));\n const result = [moves[0]];\n for (let i = 1; i < moves.length; i++) {\n const last = result[result.length - 1];\n const current = moves[i];\n const originalDist = current.original.startLineNumber - last.original.endLineNumberExclusive;\n const modifiedDist = current.modified.startLineNumber - last.modified.endLineNumberExclusive;\n const currentMoveAfterLast = originalDist >= 0 && modifiedDist >= 0;\n if (currentMoveAfterLast && originalDist + modifiedDist <= 2) {\n result[result.length - 1] = last.join(current);\n continue;\n }\n result.push(current);\n }\n return result;\n}\nfunction removeMovesInSameDiff(changes, moves) {\n const changesMonotonous = new MonotonousArray(changes);\n moves = moves.filter(m => {\n const diffBeforeEndOfMoveOriginal = changesMonotonous.findLastMonotonous(c => c.original.startLineNumber < m.original.endLineNumberExclusive)\n || new LineRangeMapping(new LineRange(1, 1), new LineRange(1, 1));\n const diffBeforeEndOfMoveModified = findLastMonotonous(changes, c => c.modified.startLineNumber < m.modified.endLineNumberExclusive);\n const differentDiffs = diffBeforeEndOfMoveOriginal !== diffBeforeEndOfMoveModified;\n return differentDiffs;\n });\n return moves;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { forEachWithNeighbors } from '../../../../base/common/arrays.js';\nimport { OffsetRange } from '../../core/offsetRange.js';\nimport { OffsetPair, SequenceDiff } from './algorithms/diffAlgorithm.js';\nexport function optimizeSequenceDiffs(sequence1, sequence2, sequenceDiffs) {\n let result = sequenceDiffs;\n result = joinSequenceDiffsByShifting(sequence1, sequence2, result);\n // Sometimes, calling this function twice improves the result.\n // Uncomment the second invocation and run the tests to see the difference.\n result = joinSequenceDiffsByShifting(sequence1, sequence2, result);\n result = shiftSequenceDiffs(sequence1, sequence2, result);\n return result;\n}\n/**\n * This function fixes issues like this:\n * ```\n * import { Baz, Bar } from \"foo\";\n * ```\n * <->\n * ```\n * import { Baz, Bar, Foo } from \"foo\";\n * ```\n * Computed diff: [ {Add \",\" after Bar}, {Add \"Foo \" after space} }\n * Improved diff: [{Add \", Foo\" after Bar}]\n */\nfunction joinSequenceDiffsByShifting(sequence1, sequence2, sequenceDiffs) {\n if (sequenceDiffs.length === 0) {\n return sequenceDiffs;\n }\n const result = [];\n result.push(sequenceDiffs[0]);\n // First move them all to the left as much as possible and join them if possible\n for (let i = 1; i < sequenceDiffs.length; i++) {\n const prevResult = result[result.length - 1];\n let cur = sequenceDiffs[i];\n if (cur.seq1Range.isEmpty || cur.seq2Range.isEmpty) {\n const length = cur.seq1Range.start - prevResult.seq1Range.endExclusive;\n let d;\n for (d = 1; d <= length; d++) {\n if (sequence1.getElement(cur.seq1Range.start - d) !== sequence1.getElement(cur.seq1Range.endExclusive - d) ||\n sequence2.getElement(cur.seq2Range.start - d) !== sequence2.getElement(cur.seq2Range.endExclusive - d)) {\n break;\n }\n }\n d--;\n if (d === length) {\n // Merge previous and current diff\n result[result.length - 1] = new SequenceDiff(new OffsetRange(prevResult.seq1Range.start, cur.seq1Range.endExclusive - length), new OffsetRange(prevResult.seq2Range.start, cur.seq2Range.endExclusive - length));\n continue;\n }\n cur = cur.delta(-d);\n }\n result.push(cur);\n }\n const result2 = [];\n // Then move them all to the right and join them again if possible\n for (let i = 0; i < result.length - 1; i++) {\n const nextResult = result[i + 1];\n let cur = result[i];\n if (cur.seq1Range.isEmpty || cur.seq2Range.isEmpty) {\n const length = nextResult.seq1Range.start - cur.seq1Range.endExclusive;\n let d;\n for (d = 0; d < length; d++) {\n if (!sequence1.isStronglyEqual(cur.seq1Range.start + d, cur.seq1Range.endExclusive + d) ||\n !sequence2.isStronglyEqual(cur.seq2Range.start + d, cur.seq2Range.endExclusive + d)) {\n break;\n }\n }\n if (d === length) {\n // Merge previous and current diff, write to result!\n result[i + 1] = new SequenceDiff(new OffsetRange(cur.seq1Range.start + length, nextResult.seq1Range.endExclusive), new OffsetRange(cur.seq2Range.start + length, nextResult.seq2Range.endExclusive));\n continue;\n }\n if (d > 0) {\n cur = cur.delta(d);\n }\n }\n result2.push(cur);\n }\n if (result.length > 0) {\n result2.push(result[result.length - 1]);\n }\n return result2;\n}\n// align character level diffs at whitespace characters\n// import { IBar } from \"foo\";\n// import { I[Arr, I]Bar } from \"foo\";\n// ->\n// import { [IArr, ]IBar } from \"foo\";\n// import { ITransaction, observableValue, transaction } from 'vs/base/common/observable';\n// import { ITransaction, observable[FromEvent, observable]Value, transaction } from 'vs/base/common/observable';\n// ->\n// import { ITransaction, [observableFromEvent, ]observableValue, transaction } from 'vs/base/common/observable';\n// collectBrackets(level + 1, levelPerBracketType);\n// collectBrackets(level + 1, levelPerBracket[ + 1, levelPerBracket]Type);\n// ->\n// collectBrackets(level + 1, [levelPerBracket + 1, ]levelPerBracketType);\nfunction shiftSequenceDiffs(sequence1, sequence2, sequenceDiffs) {\n if (!sequence1.getBoundaryScore || !sequence2.getBoundaryScore) {\n return sequenceDiffs;\n }\n for (let i = 0; i < sequenceDiffs.length; i++) {\n const prevDiff = (i > 0 ? sequenceDiffs[i - 1] : undefined);\n const diff = sequenceDiffs[i];\n const nextDiff = (i + 1 < sequenceDiffs.length ? sequenceDiffs[i + 1] : undefined);\n const seq1ValidRange = new OffsetRange(prevDiff ? prevDiff.seq1Range.endExclusive + 1 : 0, nextDiff ? nextDiff.seq1Range.start - 1 : sequence1.length);\n const seq2ValidRange = new OffsetRange(prevDiff ? prevDiff.seq2Range.endExclusive + 1 : 0, nextDiff ? nextDiff.seq2Range.start - 1 : sequence2.length);\n if (diff.seq1Range.isEmpty) {\n sequenceDiffs[i] = shiftDiffToBetterPosition(diff, sequence1, sequence2, seq1ValidRange, seq2ValidRange);\n }\n else if (diff.seq2Range.isEmpty) {\n sequenceDiffs[i] = shiftDiffToBetterPosition(diff.swap(), sequence2, sequence1, seq2ValidRange, seq1ValidRange).swap();\n }\n }\n return sequenceDiffs;\n}\nfunction shiftDiffToBetterPosition(diff, sequence1, sequence2, seq1ValidRange, seq2ValidRange) {\n const maxShiftLimit = 100; // To prevent performance issues\n // don't touch previous or next!\n let deltaBefore = 1;\n while (diff.seq1Range.start - deltaBefore >= seq1ValidRange.start &&\n diff.seq2Range.start - deltaBefore >= seq2ValidRange.start &&\n sequence2.isStronglyEqual(diff.seq2Range.start - deltaBefore, diff.seq2Range.endExclusive - deltaBefore) && deltaBefore < maxShiftLimit) {\n deltaBefore++;\n }\n deltaBefore--;\n let deltaAfter = 0;\n while (diff.seq1Range.start + deltaAfter < seq1ValidRange.endExclusive &&\n diff.seq2Range.endExclusive + deltaAfter < seq2ValidRange.endExclusive &&\n sequence2.isStronglyEqual(diff.seq2Range.start + deltaAfter, diff.seq2Range.endExclusive + deltaAfter) && deltaAfter < maxShiftLimit) {\n deltaAfter++;\n }\n if (deltaBefore === 0 && deltaAfter === 0) {\n return diff;\n }\n // Visualize `[sequence1.text, diff.seq1Range.start + deltaAfter]`\n // and `[sequence2.text, diff.seq2Range.start + deltaAfter, diff.seq2Range.endExclusive + deltaAfter]`\n let bestDelta = 0;\n let bestScore = -1;\n // find best scored delta\n for (let delta = -deltaBefore; delta <= deltaAfter; delta++) {\n const seq2OffsetStart = diff.seq2Range.start + delta;\n const seq2OffsetEndExclusive = diff.seq2Range.endExclusive + delta;\n const seq1Offset = diff.seq1Range.start + delta;\n const score = sequence1.getBoundaryScore(seq1Offset) + sequence2.getBoundaryScore(seq2OffsetStart) + sequence2.getBoundaryScore(seq2OffsetEndExclusive);\n if (score > bestScore) {\n bestScore = score;\n bestDelta = delta;\n }\n }\n return diff.delta(bestDelta);\n}\nexport function removeShortMatches(sequence1, sequence2, sequenceDiffs) {\n const result = [];\n for (const s of sequenceDiffs) {\n const last = result[result.length - 1];\n if (!last) {\n result.push(s);\n continue;\n }\n if (s.seq1Range.start - last.seq1Range.endExclusive <= 2 || s.seq2Range.start - last.seq2Range.endExclusive <= 2) {\n result[result.length - 1] = new SequenceDiff(last.seq1Range.join(s.seq1Range), last.seq2Range.join(s.seq2Range));\n }\n else {\n result.push(s);\n }\n }\n return result;\n}\nexport function extendDiffsToEntireWordIfAppropriate(sequence1, sequence2, sequenceDiffs) {\n const equalMappings = SequenceDiff.invert(sequenceDiffs, sequence1.length);\n const additional = [];\n let lastPoint = new OffsetPair(0, 0);\n function scanWord(pair, equalMapping) {\n if (pair.offset1 < lastPoint.offset1 || pair.offset2 < lastPoint.offset2) {\n return;\n }\n const w1 = sequence1.findWordContaining(pair.offset1);\n const w2 = sequence2.findWordContaining(pair.offset2);\n if (!w1 || !w2) {\n return;\n }\n let w = new SequenceDiff(w1, w2);\n const equalPart = w.intersect(equalMapping);\n let equalChars1 = equalPart.seq1Range.length;\n let equalChars2 = equalPart.seq2Range.length;\n // The words do not touch previous equals mappings, as we would have processed them already.\n // But they might touch the next ones.\n while (equalMappings.length > 0) {\n const next = equalMappings[0];\n const intersects = next.seq1Range.intersects(w1) || next.seq2Range.intersects(w2);\n if (!intersects) {\n break;\n }\n const v1 = sequence1.findWordContaining(next.seq1Range.start);\n const v2 = sequence2.findWordContaining(next.seq2Range.start);\n // Because there is an intersection, we know that the words are not empty.\n const v = new SequenceDiff(v1, v2);\n const equalPart = v.intersect(next);\n equalChars1 += equalPart.seq1Range.length;\n equalChars2 += equalPart.seq2Range.length;\n w = w.join(v);\n if (w.seq1Range.endExclusive >= next.seq1Range.endExclusive) {\n // The word extends beyond the next equal mapping.\n equalMappings.shift();\n }\n else {\n break;\n }\n }\n if (equalChars1 + equalChars2 < (w.seq1Range.length + w.seq2Range.length) * 2 / 3) {\n additional.push(w);\n }\n lastPoint = w.getEndExclusives();\n }\n while (equalMappings.length > 0) {\n const next = equalMappings.shift();\n if (next.seq1Range.isEmpty) {\n continue;\n }\n scanWord(next.getStarts(), next);\n // The equal parts are not empty, so -1 gives us a character that is equal in both parts.\n scanWord(next.getEndExclusives().delta(-1), next);\n }\n const merged = mergeSequenceDiffs(sequenceDiffs, additional);\n return merged;\n}\nfunction mergeSequenceDiffs(sequenceDiffs1, sequenceDiffs2) {\n const result = [];\n while (sequenceDiffs1.length > 0 || sequenceDiffs2.length > 0) {\n const sd1 = sequenceDiffs1[0];\n const sd2 = sequenceDiffs2[0];\n let next;\n if (sd1 && (!sd2 || sd1.seq1Range.start < sd2.seq1Range.start)) {\n next = sequenceDiffs1.shift();\n }\n else {\n next = sequenceDiffs2.shift();\n }\n if (result.length > 0 && result[result.length - 1].seq1Range.endExclusive >= next.seq1Range.start) {\n result[result.length - 1] = result[result.length - 1].join(next);\n }\n else {\n result.push(next);\n }\n }\n return result;\n}\nexport function removeVeryShortMatchingLinesBetweenDiffs(sequence1, _sequence2, sequenceDiffs) {\n let diffs = sequenceDiffs;\n if (diffs.length === 0) {\n return diffs;\n }\n let counter = 0;\n let shouldRepeat;\n do {\n shouldRepeat = false;\n const result = [\n diffs[0]\n ];\n for (let i = 1; i < diffs.length; i++) {\n const cur = diffs[i];\n const lastResult = result[result.length - 1];\n function shouldJoinDiffs(before, after) {\n const unchangedRange = new OffsetRange(lastResult.seq1Range.endExclusive, cur.seq1Range.start);\n const unchangedText = sequence1.getText(unchangedRange);\n const unchangedTextWithoutWs = unchangedText.replace(/\\s/g, '');\n if (unchangedTextWithoutWs.length <= 4\n && (before.seq1Range.length + before.seq2Range.length > 5 || after.seq1Range.length + after.seq2Range.length > 5)) {\n return true;\n }\n return false;\n }\n const shouldJoin = shouldJoinDiffs(lastResult, cur);\n if (shouldJoin) {\n shouldRepeat = true;\n result[result.length - 1] = result[result.length - 1].join(cur);\n }\n else {\n result.push(cur);\n }\n }\n diffs = result;\n } while (counter++ < 10 && shouldRepeat);\n return diffs;\n}\nexport function removeVeryShortMatchingTextBetweenLongDiffs(sequence1, sequence2, sequenceDiffs) {\n let diffs = sequenceDiffs;\n if (diffs.length === 0) {\n return diffs;\n }\n let counter = 0;\n let shouldRepeat;\n do {\n shouldRepeat = false;\n const result = [\n diffs[0]\n ];\n for (let i = 1; i < diffs.length; i++) {\n const cur = diffs[i];\n const lastResult = result[result.length - 1];\n function shouldJoinDiffs(before, after) {\n const unchangedRange = new OffsetRange(lastResult.seq1Range.endExclusive, cur.seq1Range.start);\n const unchangedLineCount = sequence1.countLinesIn(unchangedRange);\n if (unchangedLineCount > 5 || unchangedRange.length > 500) {\n return false;\n }\n const unchangedText = sequence1.getText(unchangedRange).trim();\n if (unchangedText.length > 20 || unchangedText.split(/\\r\\n|\\r|\\n/).length > 1) {\n return false;\n }\n const beforeLineCount1 = sequence1.countLinesIn(before.seq1Range);\n const beforeSeq1Length = before.seq1Range.length;\n const beforeLineCount2 = sequence2.countLinesIn(before.seq2Range);\n const beforeSeq2Length = before.seq2Range.length;\n const afterLineCount1 = sequence1.countLinesIn(after.seq1Range);\n const afterSeq1Length = after.seq1Range.length;\n const afterLineCount2 = sequence2.countLinesIn(after.seq2Range);\n const afterSeq2Length = after.seq2Range.length;\n // TODO: Maybe a neural net can be used to derive the result from these numbers\n const max = 2 * 40 + 50;\n function cap(v) {\n return Math.min(v, max);\n }\n if (Math.pow(Math.pow(cap(beforeLineCount1 * 40 + beforeSeq1Length), 1.5) + Math.pow(cap(beforeLineCount2 * 40 + beforeSeq2Length), 1.5), 1.5)\n + Math.pow(Math.pow(cap(afterLineCount1 * 40 + afterSeq1Length), 1.5) + Math.pow(cap(afterLineCount2 * 40 + afterSeq2Length), 1.5), 1.5) > ((max ** 1.5) ** 1.5) * 1.3) {\n return true;\n }\n return false;\n }\n const shouldJoin = shouldJoinDiffs(lastResult, cur);\n if (shouldJoin) {\n shouldRepeat = true;\n result[result.length - 1] = result[result.length - 1].join(cur);\n }\n else {\n result.push(cur);\n }\n }\n diffs = result;\n } while (counter++ < 10 && shouldRepeat);\n const newDiffs = [];\n // Remove short suffixes/prefixes\n forEachWithNeighbors(diffs, (prev, cur, next) => {\n let newDiff = cur;\n function shouldMarkAsChanged(text) {\n return text.length > 0 && text.trim().length <= 3 && cur.seq1Range.length + cur.seq2Range.length > 100;\n }\n const fullRange1 = sequence1.extendToFullLines(cur.seq1Range);\n const prefix = sequence1.getText(new OffsetRange(fullRange1.start, cur.seq1Range.start));\n if (shouldMarkAsChanged(prefix)) {\n newDiff = newDiff.deltaStart(-prefix.length);\n }\n const suffix = sequence1.getText(new OffsetRange(cur.seq1Range.endExclusive, fullRange1.endExclusive));\n if (shouldMarkAsChanged(suffix)) {\n newDiff = newDiff.deltaEnd(suffix.length);\n }\n const availableSpace = SequenceDiff.fromOffsetPairs(prev ? prev.getEndExclusives() : OffsetPair.zero, next ? next.getStarts() : OffsetPair.max);\n const result = newDiff.intersect(availableSpace);\n if (newDiffs.length > 0 && result.getStarts().equals(newDiffs[newDiffs.length - 1].getEndExclusives())) {\n newDiffs[newDiffs.length - 1] = newDiffs[newDiffs.length - 1].join(result);\n }\n else {\n newDiffs.push(result);\n }\n });\n return newDiffs;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class LineSequence {\n constructor(trimmedHash, lines) {\n this.trimmedHash = trimmedHash;\n this.lines = lines;\n }\n getElement(offset) {\n return this.trimmedHash[offset];\n }\n get length() {\n return this.trimmedHash.length;\n }\n getBoundaryScore(length) {\n const indentationBefore = length === 0 ? 0 : getIndentation(this.lines[length - 1]);\n const indentationAfter = length === this.lines.length ? 0 : getIndentation(this.lines[length]);\n return 1000 - (indentationBefore + indentationAfter);\n }\n getText(range) {\n return this.lines.slice(range.start, range.endExclusive).join('\\n');\n }\n isStronglyEqual(offset1, offset2) {\n return this.lines[offset1] === this.lines[offset2];\n }\n}\nfunction getIndentation(str) {\n let i = 0;\n while (i < str.length && (str.charCodeAt(i) === 32 /* CharCode.Space */ || str.charCodeAt(i) === 9 /* CharCode.Tab */)) {\n i++;\n }\n return i;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { equals, groupAdjacentBy } from '../../../../base/common/arrays.js';\nimport { assertFn, checkAdjacentItems } from '../../../../base/common/assert.js';\nimport { LineRange } from '../../core/lineRange.js';\nimport { OffsetRange } from '../../core/offsetRange.js';\nimport { Range } from '../../core/range.js';\nimport { DateTimeout, InfiniteTimeout, SequenceDiff } from './algorithms/diffAlgorithm.js';\nimport { DynamicProgrammingDiffing } from './algorithms/dynamicProgrammingDiffing.js';\nimport { MyersDiffAlgorithm } from './algorithms/myersDiffAlgorithm.js';\nimport { computeMovedLines } from './computeMovedLines.js';\nimport { extendDiffsToEntireWordIfAppropriate, optimizeSequenceDiffs, removeVeryShortMatchingLinesBetweenDiffs, removeVeryShortMatchingTextBetweenLongDiffs, removeShortMatches } from './heuristicSequenceOptimizations.js';\nimport { LinesDiff, MovedText } from '../linesDiffComputer.js';\nimport { DetailedLineRangeMapping, RangeMapping } from '../rangeMapping.js';\nimport { LinesSliceCharSequence } from './linesSliceCharSequence.js';\nimport { LineSequence } from './lineSequence.js';\nexport class DefaultLinesDiffComputer {\n constructor() {\n this.dynamicProgrammingDiffing = new DynamicProgrammingDiffing();\n this.myersDiffingAlgorithm = new MyersDiffAlgorithm();\n }\n computeDiff(originalLines, modifiedLines, options) {\n if (originalLines.length <= 1 && equals(originalLines, modifiedLines, (a, b) => a === b)) {\n return new LinesDiff([], [], false);\n }\n if (originalLines.length === 1 && originalLines[0].length === 0 || modifiedLines.length === 1 && modifiedLines[0].length === 0) {\n return new LinesDiff([\n new DetailedLineRangeMapping(new LineRange(1, originalLines.length + 1), new LineRange(1, modifiedLines.length + 1), [\n new RangeMapping(new Range(1, 1, originalLines.length, originalLines[0].length + 1), new Range(1, 1, modifiedLines.length, modifiedLines[0].length + 1))\n ])\n ], [], false);\n }\n const timeout = options.maxComputationTimeMs === 0 ? InfiniteTimeout.instance : new DateTimeout(options.maxComputationTimeMs);\n const considerWhitespaceChanges = !options.ignoreTrimWhitespace;\n const perfectHashes = new Map();\n function getOrCreateHash(text) {\n let hash = perfectHashes.get(text);\n if (hash === undefined) {\n hash = perfectHashes.size;\n perfectHashes.set(text, hash);\n }\n return hash;\n }\n const originalLinesHashes = originalLines.map((l) => getOrCreateHash(l.trim()));\n const modifiedLinesHashes = modifiedLines.map((l) => getOrCreateHash(l.trim()));\n const sequence1 = new LineSequence(originalLinesHashes, originalLines);\n const sequence2 = new LineSequence(modifiedLinesHashes, modifiedLines);\n const lineAlignmentResult = (() => {\n if (sequence1.length + sequence2.length < 1700) {\n // Use the improved algorithm for small files\n return this.dynamicProgrammingDiffing.compute(sequence1, sequence2, timeout, (offset1, offset2) => originalLines[offset1] === modifiedLines[offset2]\n ? modifiedLines[offset2].length === 0\n ? 0.1\n : 1 + Math.log(1 + modifiedLines[offset2].length)\n : 0.99);\n }\n return this.myersDiffingAlgorithm.compute(sequence1, sequence2);\n })();\n let lineAlignments = lineAlignmentResult.diffs;\n let hitTimeout = lineAlignmentResult.hitTimeout;\n lineAlignments = optimizeSequenceDiffs(sequence1, sequence2, lineAlignments);\n lineAlignments = removeVeryShortMatchingLinesBetweenDiffs(sequence1, sequence2, lineAlignments);\n const alignments = [];\n const scanForWhitespaceChanges = (equalLinesCount) => {\n if (!considerWhitespaceChanges) {\n return;\n }\n for (let i = 0; i < equalLinesCount; i++) {\n const seq1Offset = seq1LastStart + i;\n const seq2Offset = seq2LastStart + i;\n if (originalLines[seq1Offset] !== modifiedLines[seq2Offset]) {\n // This is because of whitespace changes, diff these lines\n const characterDiffs = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(new OffsetRange(seq1Offset, seq1Offset + 1), new OffsetRange(seq2Offset, seq2Offset + 1)), timeout, considerWhitespaceChanges);\n for (const a of characterDiffs.mappings) {\n alignments.push(a);\n }\n if (characterDiffs.hitTimeout) {\n hitTimeout = true;\n }\n }\n }\n };\n let seq1LastStart = 0;\n let seq2LastStart = 0;\n for (const diff of lineAlignments) {\n assertFn(() => diff.seq1Range.start - seq1LastStart === diff.seq2Range.start - seq2LastStart);\n const equalLinesCount = diff.seq1Range.start - seq1LastStart;\n scanForWhitespaceChanges(equalLinesCount);\n seq1LastStart = diff.seq1Range.endExclusive;\n seq2LastStart = diff.seq2Range.endExclusive;\n const characterDiffs = this.refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges);\n if (characterDiffs.hitTimeout) {\n hitTimeout = true;\n }\n for (const a of characterDiffs.mappings) {\n alignments.push(a);\n }\n }\n scanForWhitespaceChanges(originalLines.length - seq1LastStart);\n const changes = lineRangeMappingFromRangeMappings(alignments, originalLines, modifiedLines);\n let moves = [];\n if (options.computeMoves) {\n moves = this.computeMoves(changes, originalLines, modifiedLines, originalLinesHashes, modifiedLinesHashes, timeout, considerWhitespaceChanges);\n }\n // Make sure all ranges are valid\n assertFn(() => {\n function validatePosition(pos, lines) {\n if (pos.lineNumber < 1 || pos.lineNumber > lines.length) {\n return false;\n }\n const line = lines[pos.lineNumber - 1];\n if (pos.column < 1 || pos.column > line.length + 1) {\n return false;\n }\n return true;\n }\n function validateRange(range, lines) {\n if (range.startLineNumber < 1 || range.startLineNumber > lines.length + 1) {\n return false;\n }\n if (range.endLineNumberExclusive < 1 || range.endLineNumberExclusive > lines.length + 1) {\n return false;\n }\n return true;\n }\n for (const c of changes) {\n if (!c.innerChanges) {\n return false;\n }\n for (const ic of c.innerChanges) {\n const valid = validatePosition(ic.modifiedRange.getStartPosition(), modifiedLines) && validatePosition(ic.modifiedRange.getEndPosition(), modifiedLines) &&\n validatePosition(ic.originalRange.getStartPosition(), originalLines) && validatePosition(ic.originalRange.getEndPosition(), originalLines);\n if (!valid) {\n return false;\n }\n }\n if (!validateRange(c.modified, modifiedLines) || !validateRange(c.original, originalLines)) {\n return false;\n }\n }\n return true;\n });\n return new LinesDiff(changes, moves, hitTimeout);\n }\n computeMoves(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout, considerWhitespaceChanges) {\n const moves = computeMovedLines(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout);\n const movesWithDiffs = moves.map(m => {\n const moveChanges = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(m.original.toOffsetRange(), m.modified.toOffsetRange()), timeout, considerWhitespaceChanges);\n const mappings = lineRangeMappingFromRangeMappings(moveChanges.mappings, originalLines, modifiedLines, true);\n return new MovedText(m, mappings);\n });\n return movesWithDiffs;\n }\n refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges) {\n const slice1 = new LinesSliceCharSequence(originalLines, diff.seq1Range, considerWhitespaceChanges);\n const slice2 = new LinesSliceCharSequence(modifiedLines, diff.seq2Range, considerWhitespaceChanges);\n const diffResult = slice1.length + slice2.length < 500\n ? this.dynamicProgrammingDiffing.compute(slice1, slice2, timeout)\n : this.myersDiffingAlgorithm.compute(slice1, slice2, timeout);\n let diffs = diffResult.diffs;\n diffs = optimizeSequenceDiffs(slice1, slice2, diffs);\n diffs = extendDiffsToEntireWordIfAppropriate(slice1, slice2, diffs);\n diffs = removeShortMatches(slice1, slice2, diffs);\n diffs = removeVeryShortMatchingTextBetweenLongDiffs(slice1, slice2, diffs);\n const result = diffs.map((d) => new RangeMapping(slice1.translateRange(d.seq1Range), slice2.translateRange(d.seq2Range)));\n // Assert: result applied on original should be the same as diff applied to original\n return {\n mappings: result,\n hitTimeout: diffResult.hitTimeout,\n };\n }\n}\nexport function lineRangeMappingFromRangeMappings(alignments, originalLines, modifiedLines, dontAssertStartLine = false) {\n const changes = [];\n for (const g of groupAdjacentBy(alignments.map(a => getLineRangeMapping(a, originalLines, modifiedLines)), (a1, a2) => a1.original.overlapOrTouch(a2.original)\n || a1.modified.overlapOrTouch(a2.modified))) {\n const first = g[0];\n const last = g[g.length - 1];\n changes.push(new DetailedLineRangeMapping(first.original.join(last.original), first.modified.join(last.modified), g.map(a => a.innerChanges[0])));\n }\n assertFn(() => {\n if (!dontAssertStartLine) {\n if (changes.length > 0 && changes[0].original.startLineNumber !== changes[0].modified.startLineNumber) {\n return false;\n }\n }\n return checkAdjacentItems(changes, (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive &&\n // There has to be an unchanged line in between (otherwise both diffs should have been joined)\n m1.original.endLineNumberExclusive < m2.original.startLineNumber &&\n m1.modified.endLineNumberExclusive < m2.modified.startLineNumber);\n });\n return changes;\n}\nexport function getLineRangeMapping(rangeMapping, originalLines, modifiedLines) {\n let lineStartDelta = 0;\n let lineEndDelta = 0;\n // rangeMapping describes the edit that replaces `rangeMapping.originalRange` with `newText := getText(modifiedLines, rangeMapping.modifiedRange)`.\n // original: ]xxx \\n <- this line is not modified\n // modified: ]xx \\n\n if (rangeMapping.modifiedRange.endColumn === 1 && rangeMapping.originalRange.endColumn === 1\n && rangeMapping.originalRange.startLineNumber + lineStartDelta <= rangeMapping.originalRange.endLineNumber\n && rangeMapping.modifiedRange.startLineNumber + lineStartDelta <= rangeMapping.modifiedRange.endLineNumber) {\n // We can only do this if the range is not empty yet\n lineEndDelta = -1;\n }\n // original: xxx[ \\n <- this line is not modified\n // modified: xxx[ \\n\n if (rangeMapping.modifiedRange.startColumn - 1 >= modifiedLines[rangeMapping.modifiedRange.startLineNumber - 1].length\n && rangeMapping.originalRange.startColumn - 1 >= originalLines[rangeMapping.originalRange.startLineNumber - 1].length\n && rangeMapping.originalRange.startLineNumber <= rangeMapping.originalRange.endLineNumber + lineEndDelta\n && rangeMapping.modifiedRange.startLineNumber <= rangeMapping.modifiedRange.endLineNumber + lineEndDelta) {\n // We can only do this if the range is not empty yet\n lineStartDelta = 1;\n }\n const originalLineRange = new LineRange(rangeMapping.originalRange.startLineNumber + lineStartDelta, rangeMapping.originalRange.endLineNumber + 1 + lineEndDelta);\n const modifiedLineRange = new LineRange(rangeMapping.modifiedRange.startLineNumber + lineStartDelta, rangeMapping.modifiedRange.endLineNumber + 1 + lineEndDelta);\n return new DetailedLineRangeMapping(originalLineRange, modifiedLineRange, [rangeMapping]);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { LegacyLinesDiffComputer } from './legacyLinesDiffComputer.js';\nimport { DefaultLinesDiffComputer } from './defaultLinesDiffComputer/defaultLinesDiffComputer.js';\nexport const linesDiffComputers = {\n getLegacy: () => new LegacyLinesDiffComputer(),\n getDefault: () => new DefaultLinesDiffComputer(),\n};\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nfunction roundFloat(number, decimalPoints) {\n const decimal = Math.pow(10, decimalPoints);\n return Math.round(number * decimal) / decimal;\n}\nexport class RGBA {\n constructor(r, g, b, a = 1) {\n this._rgbaBrand = undefined;\n this.r = Math.min(255, Math.max(0, r)) | 0;\n this.g = Math.min(255, Math.max(0, g)) | 0;\n this.b = Math.min(255, Math.max(0, b)) | 0;\n this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);\n }\n static equals(a, b) {\n return a.r === b.r && a.g === b.g && a.b === b.b && a.a === b.a;\n }\n}\nexport class HSLA {\n constructor(h, s, l, a) {\n this._hslaBrand = undefined;\n this.h = Math.max(Math.min(360, h), 0) | 0;\n this.s = roundFloat(Math.max(Math.min(1, s), 0), 3);\n this.l = roundFloat(Math.max(Math.min(1, l), 0), 3);\n this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);\n }\n static equals(a, b) {\n return a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a;\n }\n /**\n * Converts an RGB color value to HSL. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n * Assumes r, g, and b are contained in the set [0, 255] and\n * returns h in the set [0, 360], s, and l in the set [0, 1].\n */\n static fromRGBA(rgba) {\n const r = rgba.r / 255;\n const g = rgba.g / 255;\n const b = rgba.b / 255;\n const a = rgba.a;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h = 0;\n let s = 0;\n const l = (min + max) / 2;\n const chroma = max - min;\n if (chroma > 0) {\n s = Math.min((l <= 0.5 ? chroma / (2 * l) : chroma / (2 - (2 * l))), 1);\n switch (max) {\n case r:\n h = (g - b) / chroma + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / chroma + 2;\n break;\n case b:\n h = (r - g) / chroma + 4;\n break;\n }\n h *= 60;\n h = Math.round(h);\n }\n return new HSLA(h, s, l, a);\n }\n static _hue2rgb(p, q, t) {\n if (t < 0) {\n t += 1;\n }\n if (t > 1) {\n t -= 1;\n }\n if (t < 1 / 6) {\n return p + (q - p) * 6 * t;\n }\n if (t < 1 / 2) {\n return q;\n }\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n return p;\n }\n /**\n * Converts an HSL color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\n * Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n */\n static toRGBA(hsla) {\n const h = hsla.h / 360;\n const { s, l, a } = hsla;\n let r, g, b;\n if (s === 0) {\n r = g = b = l; // achromatic\n }\n else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = HSLA._hue2rgb(p, q, h + 1 / 3);\n g = HSLA._hue2rgb(p, q, h);\n b = HSLA._hue2rgb(p, q, h - 1 / 3);\n }\n return new RGBA(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a);\n }\n}\nexport class HSVA {\n constructor(h, s, v, a) {\n this._hsvaBrand = undefined;\n this.h = Math.max(Math.min(360, h), 0) | 0;\n this.s = roundFloat(Math.max(Math.min(1, s), 0), 3);\n this.v = roundFloat(Math.max(Math.min(1, v), 0), 3);\n this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);\n }\n static equals(a, b) {\n return a.h === b.h && a.s === b.s && a.v === b.v && a.a === b.a;\n }\n // from http://www.rapidtables.com/convert/color/rgb-to-hsv.htm\n static fromRGBA(rgba) {\n const r = rgba.r / 255;\n const g = rgba.g / 255;\n const b = rgba.b / 255;\n const cmax = Math.max(r, g, b);\n const cmin = Math.min(r, g, b);\n const delta = cmax - cmin;\n const s = cmax === 0 ? 0 : (delta / cmax);\n let m;\n if (delta === 0) {\n m = 0;\n }\n else if (cmax === r) {\n m = ((((g - b) / delta) % 6) + 6) % 6;\n }\n else if (cmax === g) {\n m = ((b - r) / delta) + 2;\n }\n else {\n m = ((r - g) / delta) + 4;\n }\n return new HSVA(Math.round(m * 60), s, cmax, rgba.a);\n }\n // from http://www.rapidtables.com/convert/color/hsv-to-rgb.htm\n static toRGBA(hsva) {\n const { h, s, v, a } = hsva;\n const c = v * s;\n const x = c * (1 - Math.abs((h / 60) % 2 - 1));\n const m = v - c;\n let [r, g, b] = [0, 0, 0];\n if (h < 60) {\n r = c;\n g = x;\n }\n else if (h < 120) {\n r = x;\n g = c;\n }\n else if (h < 180) {\n g = c;\n b = x;\n }\n else if (h < 240) {\n g = x;\n b = c;\n }\n else if (h < 300) {\n r = x;\n b = c;\n }\n else if (h <= 360) {\n r = c;\n b = x;\n }\n r = Math.round((r + m) * 255);\n g = Math.round((g + m) * 255);\n b = Math.round((b + m) * 255);\n return new RGBA(r, g, b, a);\n }\n}\nexport class Color {\n static fromHex(hex) {\n return Color.Format.CSS.parseHex(hex) || Color.red;\n }\n static equals(a, b) {\n if (!a && !b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n return a.equals(b);\n }\n get hsla() {\n if (this._hsla) {\n return this._hsla;\n }\n else {\n return HSLA.fromRGBA(this.rgba);\n }\n }\n get hsva() {\n if (this._hsva) {\n return this._hsva;\n }\n return HSVA.fromRGBA(this.rgba);\n }\n constructor(arg) {\n if (!arg) {\n throw new Error('Color needs a value');\n }\n else if (arg instanceof RGBA) {\n this.rgba = arg;\n }\n else if (arg instanceof HSLA) {\n this._hsla = arg;\n this.rgba = HSLA.toRGBA(arg);\n }\n else if (arg instanceof HSVA) {\n this._hsva = arg;\n this.rgba = HSVA.toRGBA(arg);\n }\n else {\n throw new Error('Invalid color ctor argument');\n }\n }\n equals(other) {\n return !!other && RGBA.equals(this.rgba, other.rgba) && HSLA.equals(this.hsla, other.hsla) && HSVA.equals(this.hsva, other.hsva);\n }\n /**\n * http://www.w3.org/TR/WCAG20/#relativeluminancedef\n * Returns the number in the set [0, 1]. O => Darkest Black. 1 => Lightest white.\n */\n getRelativeLuminance() {\n const R = Color._relativeLuminanceForComponent(this.rgba.r);\n const G = Color._relativeLuminanceForComponent(this.rgba.g);\n const B = Color._relativeLuminanceForComponent(this.rgba.b);\n const luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B;\n return roundFloat(luminance, 4);\n }\n static _relativeLuminanceForComponent(color) {\n const c = color / 255;\n return (c <= 0.03928) ? c / 12.92 : Math.pow(((c + 0.055) / 1.055), 2.4);\n }\n /**\n *\thttp://24ways.org/2010/calculating-color-contrast\n * Return 'true' if lighter color otherwise 'false'\n */\n isLighter() {\n const yiq = (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1000;\n return yiq >= 128;\n }\n isLighterThan(another) {\n const lum1 = this.getRelativeLuminance();\n const lum2 = another.getRelativeLuminance();\n return lum1 > lum2;\n }\n isDarkerThan(another) {\n const lum1 = this.getRelativeLuminance();\n const lum2 = another.getRelativeLuminance();\n return lum1 < lum2;\n }\n lighten(factor) {\n return new Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * factor, this.hsla.a));\n }\n darken(factor) {\n return new Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * factor, this.hsla.a));\n }\n transparent(factor) {\n const { r, g, b, a } = this.rgba;\n return new Color(new RGBA(r, g, b, a * factor));\n }\n isTransparent() {\n return this.rgba.a === 0;\n }\n isOpaque() {\n return this.rgba.a === 1;\n }\n opposite() {\n return new Color(new RGBA(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a));\n }\n makeOpaque(opaqueBackground) {\n if (this.isOpaque() || opaqueBackground.rgba.a !== 1) {\n // only allow to blend onto a non-opaque color onto a opaque color\n return this;\n }\n const { r, g, b, a } = this.rgba;\n // https://stackoverflow.com/questions/12228548/finding-equivalent-color-with-opacity\n return new Color(new RGBA(opaqueBackground.rgba.r - a * (opaqueBackground.rgba.r - r), opaqueBackground.rgba.g - a * (opaqueBackground.rgba.g - g), opaqueBackground.rgba.b - a * (opaqueBackground.rgba.b - b), 1));\n }\n toString() {\n if (!this._toString) {\n this._toString = Color.Format.CSS.format(this);\n }\n return this._toString;\n }\n static getLighterColor(of, relative, factor) {\n if (of.isLighterThan(relative)) {\n return of;\n }\n factor = factor ? factor : 0.5;\n const lum1 = of.getRelativeLuminance();\n const lum2 = relative.getRelativeLuminance();\n factor = factor * (lum2 - lum1) / lum2;\n return of.lighten(factor);\n }\n static getDarkerColor(of, relative, factor) {\n if (of.isDarkerThan(relative)) {\n return of;\n }\n factor = factor ? factor : 0.5;\n const lum1 = of.getRelativeLuminance();\n const lum2 = relative.getRelativeLuminance();\n factor = factor * (lum1 - lum2) / lum1;\n return of.darken(factor);\n }\n}\nColor.white = new Color(new RGBA(255, 255, 255, 1));\nColor.black = new Color(new RGBA(0, 0, 0, 1));\nColor.red = new Color(new RGBA(255, 0, 0, 1));\nColor.blue = new Color(new RGBA(0, 0, 255, 1));\nColor.green = new Color(new RGBA(0, 255, 0, 1));\nColor.cyan = new Color(new RGBA(0, 255, 255, 1));\nColor.lightgrey = new Color(new RGBA(211, 211, 211, 1));\nColor.transparent = new Color(new RGBA(0, 0, 0, 0));\n(function (Color) {\n let Format;\n (function (Format) {\n let CSS;\n (function (CSS) {\n function formatRGB(color) {\n if (color.rgba.a === 1) {\n return `rgb(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b})`;\n }\n return Color.Format.CSS.formatRGBA(color);\n }\n CSS.formatRGB = formatRGB;\n function formatRGBA(color) {\n return `rgba(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b}, ${+(color.rgba.a).toFixed(2)})`;\n }\n CSS.formatRGBA = formatRGBA;\n function formatHSL(color) {\n if (color.hsla.a === 1) {\n return `hsl(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%)`;\n }\n return Color.Format.CSS.formatHSLA(color);\n }\n CSS.formatHSL = formatHSL;\n function formatHSLA(color) {\n return `hsla(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%, ${color.hsla.a.toFixed(2)})`;\n }\n CSS.formatHSLA = formatHSLA;\n function _toTwoDigitHex(n) {\n const r = n.toString(16);\n return r.length !== 2 ? '0' + r : r;\n }\n /**\n * Formats the color as #RRGGBB\n */\n function formatHex(color) {\n return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}`;\n }\n CSS.formatHex = formatHex;\n /**\n * Formats the color as #RRGGBBAA\n * If 'compact' is set, colors without transparancy will be printed as #RRGGBB\n */\n function formatHexA(color, compact = false) {\n if (compact && color.rgba.a === 1) {\n return Color.Format.CSS.formatHex(color);\n }\n return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}${_toTwoDigitHex(Math.round(color.rgba.a * 255))}`;\n }\n CSS.formatHexA = formatHexA;\n /**\n * The default format will use HEX if opaque and RGBA otherwise.\n */\n function format(color) {\n if (color.isOpaque()) {\n return Color.Format.CSS.formatHex(color);\n }\n return Color.Format.CSS.formatRGBA(color);\n }\n CSS.format = format;\n /**\n * Converts an Hex color value to a Color.\n * returns r, g, and b are contained in the set [0, 255]\n * @param hex string (#RGB, #RGBA, #RRGGBB or #RRGGBBAA).\n */\n function parseHex(hex) {\n const length = hex.length;\n if (length === 0) {\n // Invalid color\n return null;\n }\n if (hex.charCodeAt(0) !== 35 /* CharCode.Hash */) {\n // Does not begin with a #\n return null;\n }\n if (length === 7) {\n // #RRGGBB format\n const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));\n const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));\n const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));\n return new Color(new RGBA(r, g, b, 1));\n }\n if (length === 9) {\n // #RRGGBBAA format\n const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));\n const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));\n const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));\n const a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8));\n return new Color(new RGBA(r, g, b, a / 255));\n }\n if (length === 4) {\n // #RGB format\n const r = _parseHexDigit(hex.charCodeAt(1));\n const g = _parseHexDigit(hex.charCodeAt(2));\n const b = _parseHexDigit(hex.charCodeAt(3));\n return new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b));\n }\n if (length === 5) {\n // #RGBA format\n const r = _parseHexDigit(hex.charCodeAt(1));\n const g = _parseHexDigit(hex.charCodeAt(2));\n const b = _parseHexDigit(hex.charCodeAt(3));\n const a = _parseHexDigit(hex.charCodeAt(4));\n return new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b, (16 * a + a) / 255));\n }\n // Invalid color\n return null;\n }\n CSS.parseHex = parseHex;\n function _parseHexDigit(charCode) {\n switch (charCode) {\n case 48 /* CharCode.Digit0 */: return 0;\n case 49 /* CharCode.Digit1 */: return 1;\n case 50 /* CharCode.Digit2 */: return 2;\n case 51 /* CharCode.Digit3 */: return 3;\n case 52 /* CharCode.Digit4 */: return 4;\n case 53 /* CharCode.Digit5 */: return 5;\n case 54 /* CharCode.Digit6 */: return 6;\n case 55 /* CharCode.Digit7 */: return 7;\n case 56 /* CharCode.Digit8 */: return 8;\n case 57 /* CharCode.Digit9 */: return 9;\n case 97 /* CharCode.a */: return 10;\n case 65 /* CharCode.A */: return 10;\n case 98 /* CharCode.b */: return 11;\n case 66 /* CharCode.B */: return 11;\n case 99 /* CharCode.c */: return 12;\n case 67 /* CharCode.C */: return 12;\n case 100 /* CharCode.d */: return 13;\n case 68 /* CharCode.D */: return 13;\n case 101 /* CharCode.e */: return 14;\n case 69 /* CharCode.E */: return 14;\n case 102 /* CharCode.f */: return 15;\n case 70 /* CharCode.F */: return 15;\n }\n return 0;\n }\n })(CSS = Format.CSS || (Format.CSS = {}));\n })(Format = Color.Format || (Color.Format = {}));\n})(Color || (Color = {}));\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Color, HSLA } from '../../../base/common/color.js';\nfunction _parseCaptureGroups(captureGroups) {\n const values = [];\n for (const captureGroup of captureGroups) {\n const parsedNumber = Number(captureGroup);\n if (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\\s/g, '') !== '') {\n values.push(parsedNumber);\n }\n }\n return values;\n}\nfunction _toIColor(r, g, b, a) {\n return {\n red: r / 255,\n blue: b / 255,\n green: g / 255,\n alpha: a\n };\n}\nfunction _findRange(model, match) {\n const index = match.index;\n const length = match[0].length;\n if (!index) {\n return;\n }\n const startPosition = model.positionAt(index);\n const range = {\n startLineNumber: startPosition.lineNumber,\n startColumn: startPosition.column,\n endLineNumber: startPosition.lineNumber,\n endColumn: startPosition.column + length\n };\n return range;\n}\nfunction _findHexColorInformation(range, hexValue) {\n if (!range) {\n return;\n }\n const parsedHexColor = Color.Format.CSS.parseHex(hexValue);\n if (!parsedHexColor) {\n return;\n }\n return {\n range: range,\n color: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a)\n };\n}\nfunction _findRGBColorInformation(range, matches, isAlpha) {\n if (!range || matches.length !== 1) {\n return;\n }\n const match = matches[0];\n const captureGroups = match.values();\n const parsedRegex = _parseCaptureGroups(captureGroups);\n return {\n range: range,\n color: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1)\n };\n}\nfunction _findHSLColorInformation(range, matches, isAlpha) {\n if (!range || matches.length !== 1) {\n return;\n }\n const match = matches[0];\n const captureGroups = match.values();\n const parsedRegex = _parseCaptureGroups(captureGroups);\n const colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));\n return {\n range: range,\n color: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)\n };\n}\nfunction _findMatches(model, regex) {\n if (typeof model === 'string') {\n return [...model.matchAll(regex)];\n }\n else {\n return model.findMatches(regex);\n }\n}\nfunction computeColors(model) {\n const result = [];\n // Early validation for RGB and HSL\n const initialValidationRegex = /\\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/gm;\n const initialValidationMatches = _findMatches(model, initialValidationRegex);\n // Potential colors have been found, validate the parameters\n if (initialValidationMatches.length > 0) {\n for (const initialMatch of initialValidationMatches) {\n const initialCaptureGroups = initialMatch.filter(captureGroup => captureGroup !== undefined);\n const colorScheme = initialCaptureGroups[1];\n const colorParameters = initialCaptureGroups[2];\n if (!colorParameters) {\n continue;\n }\n let colorInformation;\n if (colorScheme === 'rgb') {\n const regexParameters = /^\\(\\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;\n colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n }\n else if (colorScheme === 'rgba') {\n const regexParameters = /^\\(\\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;\n colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n }\n else if (colorScheme === 'hsl') {\n const regexParameters = /^\\(\\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\\s*,\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*,\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*\\)$/gm;\n colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);\n }\n else if (colorScheme === 'hsla') {\n const regexParameters = /^\\(\\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\\s*,\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*,\\s*(100|\\d{1,2}[.]\\d*|\\d{1,2})%\\s*,\\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\\s*\\)$/gm;\n colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);\n }\n else if (colorScheme === '#') {\n colorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters);\n }\n if (colorInformation) {\n result.push(colorInformation);\n }\n }\n }\n return result;\n}\n/**\n * Returns an array of all default document colors in the provided document\n */\nexport function computeDefaultDocumentColors(model) {\n if (!model || typeof model.getValue !== 'function' || typeof model.positionAt !== 'function') {\n // Unknown caller!\n return [];\n }\n return computeColors(model);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { stringDiff } from '../../../base/common/diff/diff.js';\nimport { URI } from '../../../base/common/uri.js';\nimport { Position } from '../core/position.js';\nimport { Range } from '../core/range.js';\nimport { MirrorTextModel as BaseMirrorModel } from '../model/mirrorTextModel.js';\nimport { ensureValidWordDefinition, getWordAtText } from '../core/wordHelper.js';\nimport { computeLinks } from '../languages/linkComputer.js';\nimport { BasicInplaceReplace } from '../languages/supports/inplaceReplaceSupport.js';\nimport { createMonacoBaseAPI } from './editorBaseApi.js';\nimport { StopWatch } from '../../../base/common/stopwatch.js';\nimport { UnicodeTextModelHighlighter } from './unicodeTextModelHighlighter.js';\nimport { linesDiffComputers } from '../diff/linesDiffComputers.js';\nimport { createProxyObject, getAllMethodNames } from '../../../base/common/objects.js';\nimport { computeDefaultDocumentColors } from '../languages/defaultDocumentColorsComputer.js';\n/**\n * @internal\n */\nclass MirrorModel extends BaseMirrorModel {\n get uri() {\n return this._uri;\n }\n get eol() {\n return this._eol;\n }\n getValue() {\n return this.getText();\n }\n findMatches(regex) {\n const matches = [];\n for (let i = 0; i < this._lines.length; i++) {\n const line = this._lines[i];\n const offsetToAdd = this.offsetAt(new Position(i + 1, 1));\n const iteratorOverMatches = line.matchAll(regex);\n for (const match of iteratorOverMatches) {\n if (match.index || match.index === 0) {\n match.index = match.index + offsetToAdd;\n }\n matches.push(match);\n }\n }\n return matches;\n }\n getLinesContent() {\n return this._lines.slice(0);\n }\n getLineCount() {\n return this._lines.length;\n }\n getLineContent(lineNumber) {\n return this._lines[lineNumber - 1];\n }\n getWordAtPosition(position, wordDefinition) {\n const wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0);\n if (wordAtText) {\n return new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn);\n }\n return null;\n }\n words(wordDefinition) {\n const lines = this._lines;\n const wordenize = this._wordenize.bind(this);\n let lineNumber = 0;\n let lineText = '';\n let wordRangesIdx = 0;\n let wordRanges = [];\n return {\n *[Symbol.iterator]() {\n while (true) {\n if (wordRangesIdx < wordRanges.length) {\n const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end);\n wordRangesIdx += 1;\n yield value;\n }\n else {\n if (lineNumber < lines.length) {\n lineText = lines[lineNumber];\n wordRanges = wordenize(lineText, wordDefinition);\n wordRangesIdx = 0;\n lineNumber += 1;\n }\n else {\n break;\n }\n }\n }\n }\n };\n }\n getLineWords(lineNumber, wordDefinition) {\n const content = this._lines[lineNumber - 1];\n const ranges = this._wordenize(content, wordDefinition);\n const words = [];\n for (const range of ranges) {\n words.push({\n word: content.substring(range.start, range.end),\n startColumn: range.start + 1,\n endColumn: range.end + 1\n });\n }\n return words;\n }\n _wordenize(content, wordDefinition) {\n const result = [];\n let match;\n wordDefinition.lastIndex = 0; // reset lastIndex just to be sure\n while (match = wordDefinition.exec(content)) {\n if (match[0].length === 0) {\n // it did match the empty string\n break;\n }\n result.push({ start: match.index, end: match.index + match[0].length });\n }\n return result;\n }\n getValueInRange(range) {\n range = this._validateRange(range);\n if (range.startLineNumber === range.endLineNumber) {\n return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1);\n }\n const lineEnding = this._eol;\n const startLineIndex = range.startLineNumber - 1;\n const endLineIndex = range.endLineNumber - 1;\n const resultLines = [];\n resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1));\n for (let i = startLineIndex + 1; i < endLineIndex; i++) {\n resultLines.push(this._lines[i]);\n }\n resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1));\n return resultLines.join(lineEnding);\n }\n offsetAt(position) {\n position = this._validatePosition(position);\n this._ensureLineStarts();\n return this._lineStarts.getPrefixSum(position.lineNumber - 2) + (position.column - 1);\n }\n positionAt(offset) {\n offset = Math.floor(offset);\n offset = Math.max(0, offset);\n this._ensureLineStarts();\n const out = this._lineStarts.getIndexOf(offset);\n const lineLength = this._lines[out.index].length;\n // Ensure we return a valid position\n return {\n lineNumber: 1 + out.index,\n column: 1 + Math.min(out.remainder, lineLength)\n };\n }\n _validateRange(range) {\n const start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn });\n const end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn });\n if (start.lineNumber !== range.startLineNumber\n || start.column !== range.startColumn\n || end.lineNumber !== range.endLineNumber\n || end.column !== range.endColumn) {\n return {\n startLineNumber: start.lineNumber,\n startColumn: start.column,\n endLineNumber: end.lineNumber,\n endColumn: end.column\n };\n }\n return range;\n }\n _validatePosition(position) {\n if (!Position.isIPosition(position)) {\n throw new Error('bad position');\n }\n let { lineNumber, column } = position;\n let hasChanged = false;\n if (lineNumber < 1) {\n lineNumber = 1;\n column = 1;\n hasChanged = true;\n }\n else if (lineNumber > this._lines.length) {\n lineNumber = this._lines.length;\n column = this._lines[lineNumber - 1].length + 1;\n hasChanged = true;\n }\n else {\n const maxCharacter = this._lines[lineNumber - 1].length + 1;\n if (column < 1) {\n column = 1;\n hasChanged = true;\n }\n else if (column > maxCharacter) {\n column = maxCharacter;\n hasChanged = true;\n }\n }\n if (!hasChanged) {\n return position;\n }\n else {\n return { lineNumber, column };\n }\n }\n}\n/**\n * @internal\n */\nexport class EditorSimpleWorker {\n constructor(host, foreignModuleFactory) {\n this._host = host;\n this._models = Object.create(null);\n this._foreignModuleFactory = foreignModuleFactory;\n this._foreignModule = null;\n }\n dispose() {\n this._models = Object.create(null);\n }\n _getModel(uri) {\n return this._models[uri];\n }\n _getModels() {\n const all = [];\n Object.keys(this._models).forEach((key) => all.push(this._models[key]));\n return all;\n }\n acceptNewModel(data) {\n this._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId);\n }\n acceptModelChanged(strURL, e) {\n if (!this._models[strURL]) {\n return;\n }\n const model = this._models[strURL];\n model.onEvents(e);\n }\n acceptRemovedModel(strURL) {\n if (!this._models[strURL]) {\n return;\n }\n delete this._models[strURL];\n }\n async computeUnicodeHighlights(url, options, range) {\n const model = this._getModel(url);\n if (!model) {\n return { ranges: [], hasMore: false, ambiguousCharacterCount: 0, invisibleCharacterCount: 0, nonBasicAsciiCharacterCount: 0 };\n }\n return UnicodeTextModelHighlighter.computeUnicodeHighlights(model, options, range);\n }\n // ---- BEGIN diff --------------------------------------------------------------------------\n async computeDiff(originalUrl, modifiedUrl, options, algorithm) {\n const original = this._getModel(originalUrl);\n const modified = this._getModel(modifiedUrl);\n if (!original || !modified) {\n return null;\n }\n const result = EditorSimpleWorker.computeDiff(original, modified, options, algorithm);\n return result;\n }\n static computeDiff(originalTextModel, modifiedTextModel, options, algorithm) {\n const diffAlgorithm = algorithm === 'advanced' ? linesDiffComputers.getDefault() : linesDiffComputers.getLegacy();\n const originalLines = originalTextModel.getLinesContent();\n const modifiedLines = modifiedTextModel.getLinesContent();\n const result = diffAlgorithm.computeDiff(originalLines, modifiedLines, options);\n const identical = (result.changes.length > 0 ? false : this._modelsAreIdentical(originalTextModel, modifiedTextModel));\n function getLineChanges(changes) {\n return changes.map(m => {\n var _a;\n return ([m.original.startLineNumber, m.original.endLineNumberExclusive, m.modified.startLineNumber, m.modified.endLineNumberExclusive, (_a = m.innerChanges) === null || _a === void 0 ? void 0 : _a.map(m => [\n m.originalRange.startLineNumber,\n m.originalRange.startColumn,\n m.originalRange.endLineNumber,\n m.originalRange.endColumn,\n m.modifiedRange.startLineNumber,\n m.modifiedRange.startColumn,\n m.modifiedRange.endLineNumber,\n m.modifiedRange.endColumn,\n ])]);\n });\n }\n return {\n identical,\n quitEarly: result.hitTimeout,\n changes: getLineChanges(result.changes),\n moves: result.moves.map(m => ([\n m.lineRangeMapping.original.startLineNumber,\n m.lineRangeMapping.original.endLineNumberExclusive,\n m.lineRangeMapping.modified.startLineNumber,\n m.lineRangeMapping.modified.endLineNumberExclusive,\n getLineChanges(m.changes)\n ])),\n };\n }\n static _modelsAreIdentical(original, modified) {\n const originalLineCount = original.getLineCount();\n const modifiedLineCount = modified.getLineCount();\n if (originalLineCount !== modifiedLineCount) {\n return false;\n }\n for (let line = 1; line <= originalLineCount; line++) {\n const originalLine = original.getLineContent(line);\n const modifiedLine = modified.getLineContent(line);\n if (originalLine !== modifiedLine) {\n return false;\n }\n }\n return true;\n }\n async computeMoreMinimalEdits(modelUrl, edits, pretty) {\n const model = this._getModel(modelUrl);\n if (!model) {\n return edits;\n }\n const result = [];\n let lastEol = undefined;\n edits = edits.slice(0).sort((a, b) => {\n if (a.range && b.range) {\n return Range.compareRangesUsingStarts(a.range, b.range);\n }\n // eol only changes should go to the end\n const aRng = a.range ? 0 : 1;\n const bRng = b.range ? 0 : 1;\n return aRng - bRng;\n });\n // merge adjacent edits\n let writeIndex = 0;\n for (let readIndex = 1; readIndex < edits.length; readIndex++) {\n if (Range.getEndPosition(edits[writeIndex].range).equals(Range.getStartPosition(edits[readIndex].range))) {\n edits[writeIndex].range = Range.fromPositions(Range.getStartPosition(edits[writeIndex].range), Range.getEndPosition(edits[readIndex].range));\n edits[writeIndex].text += edits[readIndex].text;\n }\n else {\n writeIndex++;\n edits[writeIndex] = edits[readIndex];\n }\n }\n edits.length = writeIndex + 1;\n for (let { range, text, eol } of edits) {\n if (typeof eol === 'number') {\n lastEol = eol;\n }\n if (Range.isEmpty(range) && !text) {\n // empty change\n continue;\n }\n const original = model.getValueInRange(range);\n text = text.replace(/\\r\\n|\\n|\\r/g, model.eol);\n if (original === text) {\n // noop\n continue;\n }\n // make sure diff won't take too long\n if (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) {\n result.push({ range, text });\n continue;\n }\n // compute diff between original and edit.text\n const changes = stringDiff(original, text, pretty);\n const editOffset = model.offsetAt(Range.lift(range).getStartPosition());\n for (const change of changes) {\n const start = model.positionAt(editOffset + change.originalStart);\n const end = model.positionAt(editOffset + change.originalStart + change.originalLength);\n const newEdit = {\n text: text.substr(change.modifiedStart, change.modifiedLength),\n range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column }\n };\n if (model.getValueInRange(newEdit.range) !== newEdit.text) {\n result.push(newEdit);\n }\n }\n }\n if (typeof lastEol === 'number') {\n result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } });\n }\n return result;\n }\n // ---- END minimal edits ---------------------------------------------------------------\n async computeLinks(modelUrl) {\n const model = this._getModel(modelUrl);\n if (!model) {\n return null;\n }\n return computeLinks(model);\n }\n // --- BEGIN default document colors -----------------------------------------------------------\n async computeDefaultDocumentColors(modelUrl) {\n const model = this._getModel(modelUrl);\n if (!model) {\n return null;\n }\n return computeDefaultDocumentColors(model);\n }\n async textualSuggest(modelUrls, leadingWord, wordDef, wordDefFlags) {\n const sw = new StopWatch();\n const wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n const seen = new Set();\n outer: for (const url of modelUrls) {\n const model = this._getModel(url);\n if (!model) {\n continue;\n }\n for (const word of model.words(wordDefRegExp)) {\n if (word === leadingWord || !isNaN(Number(word))) {\n continue;\n }\n seen.add(word);\n if (seen.size > EditorSimpleWorker._suggestionsLimit) {\n break outer;\n }\n }\n }\n return { words: Array.from(seen), duration: sw.elapsed() };\n }\n // ---- END suggest --------------------------------------------------------------------------\n //#region -- word ranges --\n async computeWordRanges(modelUrl, range, wordDef, wordDefFlags) {\n const model = this._getModel(modelUrl);\n if (!model) {\n return Object.create(null);\n }\n const wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n const result = Object.create(null);\n for (let line = range.startLineNumber; line < range.endLineNumber; line++) {\n const words = model.getLineWords(line, wordDefRegExp);\n for (const word of words) {\n if (!isNaN(Number(word.word))) {\n continue;\n }\n let array = result[word.word];\n if (!array) {\n array = [];\n result[word.word] = array;\n }\n array.push({\n startLineNumber: line,\n startColumn: word.startColumn,\n endLineNumber: line,\n endColumn: word.endColumn\n });\n }\n }\n return result;\n }\n //#endregion\n async navigateValueSet(modelUrl, range, up, wordDef, wordDefFlags) {\n const model = this._getModel(modelUrl);\n if (!model) {\n return null;\n }\n const wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n if (range.startColumn === range.endColumn) {\n range = {\n startLineNumber: range.startLineNumber,\n startColumn: range.startColumn,\n endLineNumber: range.endLineNumber,\n endColumn: range.endColumn + 1\n };\n }\n const selectionText = model.getValueInRange(range);\n const wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp);\n if (!wordRange) {\n return null;\n }\n const word = model.getValueInRange(wordRange);\n const result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up);\n return result;\n }\n // ---- BEGIN foreign module support --------------------------------------------------------------------------\n loadForeignModule(moduleId, createData, foreignHostMethods) {\n const proxyMethodRequest = (method, args) => {\n return this._host.fhr(method, args);\n };\n const foreignHost = createProxyObject(foreignHostMethods, proxyMethodRequest);\n const ctx = {\n host: foreignHost,\n getMirrorModels: () => {\n return this._getModels();\n }\n };\n if (this._foreignModuleFactory) {\n this._foreignModule = this._foreignModuleFactory(ctx, createData);\n // static foreing module\n return Promise.resolve(getAllMethodNames(this._foreignModule));\n }\n // ESM-comment-begin\n // \t\treturn new Promise((resolve, reject) => {\n // \t\t\trequire([moduleId], (foreignModule: { create: IForeignModuleFactory }) => {\n // \t\t\t\tthis._foreignModule = foreignModule.create(ctx, createData);\n // \n // \t\t\t\tresolve(getAllMethodNames(this._foreignModule));\n // \n // \t\t\t}, reject);\n // \t\t});\n // ESM-comment-end\n // ESM-uncomment-begin\n return Promise.reject(new Error(`Unexpected usage`));\n // ESM-uncomment-end\n }\n // foreign method request\n fmr(method, args) {\n if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') {\n return Promise.reject(new Error('Missing requestHandler or method: ' + method));\n }\n try {\n return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args));\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n}\n// ---- END diff --------------------------------------------------------------------------\n// ---- BEGIN minimal edits ---------------------------------------------------------------\nEditorSimpleWorker._diffLimit = 100000;\n// ---- BEGIN suggest --------------------------------------------------------------------------\nEditorSimpleWorker._suggestionsLimit = 10000;\n/**\n * Called on the worker side\n * @internal\n */\nexport function create(host) {\n return new EditorSimpleWorker(host, null);\n}\nif (typeof importScripts === 'function') {\n // Running in a web worker\n globalThis.monaco = createMonacoBaseAPI();\n}\n", "import { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nexport const ITextResourceConfigurationService = createDecorator('textResourceConfigurationService');\nexport const ITextResourcePropertiesService = createDecorator('textResourcePropertiesService');\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nexport const ILanguageFeaturesService = createDecorator('ILanguageFeaturesService');\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport { IntervalTimer, timeout } from '../../../base/common/async.js';\nimport { Disposable, dispose, toDisposable, DisposableStore } from '../../../base/common/lifecycle.js';\nimport { SimpleWorkerClient, logOnceWebWorkerWarning } from '../../../base/common/worker/simpleWorker.js';\nimport { DefaultWorkerFactory } from '../../../base/browser/defaultWorkerFactory.js';\nimport { Range } from '../../common/core/range.js';\nimport { ILanguageConfigurationService } from '../../common/languages/languageConfigurationRegistry.js';\nimport { EditorSimpleWorker } from '../../common/services/editorSimpleWorker.js';\nimport { IModelService } from '../../common/services/model.js';\nimport { ITextResourceConfigurationService } from '../../common/services/textResourceConfiguration.js';\nimport { isNonEmptyArray } from '../../../base/common/arrays.js';\nimport { ILogService } from '../../../platform/log/common/log.js';\nimport { StopWatch } from '../../../base/common/stopwatch.js';\nimport { canceled } from '../../../base/common/errors.js';\nimport { ILanguageFeaturesService } from '../../common/services/languageFeatures.js';\nimport { MovedText } from '../../common/diff/linesDiffComputer.js';\nimport { DetailedLineRangeMapping, RangeMapping, LineRangeMapping } from '../../common/diff/rangeMapping.js';\nimport { LineRange } from '../../common/core/lineRange.js';\nimport { $window } from '../../../base/browser/window.js';\nimport { WindowIntervalTimer } from '../../../base/browser/dom.js';\n/**\n * Stop syncing a model to the worker if it was not needed for 1 min.\n */\nconst STOP_SYNC_MODEL_DELTA_TIME_MS = 60 * 1000;\n/**\n * Stop the worker if it was not needed for 5 min.\n */\nconst STOP_WORKER_DELTA_TIME_MS = 5 * 60 * 1000;\nfunction canSyncModel(modelService, resource) {\n const model = modelService.getModel(resource);\n if (!model) {\n return false;\n }\n if (model.isTooLargeForSyncing()) {\n return false;\n }\n return true;\n}\nlet EditorWorkerService = class EditorWorkerService extends Disposable {\n constructor(modelService, configurationService, logService, languageConfigurationService, languageFeaturesService) {\n super();\n this._modelService = modelService;\n this._workerManager = this._register(new WorkerManager(this._modelService, languageConfigurationService));\n this._logService = logService;\n // register default link-provider and default completions-provider\n this._register(languageFeaturesService.linkProvider.register({ language: '*', hasAccessToAllModels: true }, {\n provideLinks: (model, token) => {\n if (!canSyncModel(this._modelService, model.uri)) {\n return Promise.resolve({ links: [] }); // File too large\n }\n return this._workerManager.withWorker().then(client => client.computeLinks(model.uri)).then(links => {\n return links && { links };\n });\n }\n }));\n this._register(languageFeaturesService.completionProvider.register('*', new WordBasedCompletionItemProvider(this._workerManager, configurationService, this._modelService, languageConfigurationService)));\n }\n dispose() {\n super.dispose();\n }\n canComputeUnicodeHighlights(uri) {\n return canSyncModel(this._modelService, uri);\n }\n computedUnicodeHighlights(uri, options, range) {\n return this._workerManager.withWorker().then(client => client.computedUnicodeHighlights(uri, options, range));\n }\n async computeDiff(original, modified, options, algorithm) {\n const result = await this._workerManager.withWorker().then(client => client.computeDiff(original, modified, options, algorithm));\n if (!result) {\n return null;\n }\n // Convert from space efficient JSON data to rich objects.\n const diff = {\n identical: result.identical,\n quitEarly: result.quitEarly,\n changes: toLineRangeMappings(result.changes),\n moves: result.moves.map(m => new MovedText(new LineRangeMapping(new LineRange(m[0], m[1]), new LineRange(m[2], m[3])), toLineRangeMappings(m[4])))\n };\n return diff;\n function toLineRangeMappings(changes) {\n return changes.map((c) => {\n var _a;\n return new DetailedLineRangeMapping(new LineRange(c[0], c[1]), new LineRange(c[2], c[3]), (_a = c[4]) === null || _a === void 0 ? void 0 : _a.map((c) => new RangeMapping(new Range(c[0], c[1], c[2], c[3]), new Range(c[4], c[5], c[6], c[7]))));\n });\n }\n }\n computeMoreMinimalEdits(resource, edits, pretty = false) {\n if (isNonEmptyArray(edits)) {\n if (!canSyncModel(this._modelService, resource)) {\n return Promise.resolve(edits); // File too large\n }\n const sw = StopWatch.create();\n const result = this._workerManager.withWorker().then(client => client.computeMoreMinimalEdits(resource, edits, pretty));\n result.finally(() => this._logService.trace('FORMAT#computeMoreMinimalEdits', resource.toString(true), sw.elapsed()));\n return Promise.race([result, timeout(1000).then(() => edits)]);\n }\n else {\n return Promise.resolve(undefined);\n }\n }\n canNavigateValueSet(resource) {\n return (canSyncModel(this._modelService, resource));\n }\n navigateValueSet(resource, range, up) {\n return this._workerManager.withWorker().then(client => client.navigateValueSet(resource, range, up));\n }\n canComputeWordRanges(resource) {\n return canSyncModel(this._modelService, resource);\n }\n computeWordRanges(resource, range) {\n return this._workerManager.withWorker().then(client => client.computeWordRanges(resource, range));\n }\n};\nEditorWorkerService = __decorate([\n __param(0, IModelService),\n __param(1, ITextResourceConfigurationService),\n __param(2, ILogService),\n __param(3, ILanguageConfigurationService),\n __param(4, ILanguageFeaturesService)\n], EditorWorkerService);\nexport { EditorWorkerService };\nclass WordBasedCompletionItemProvider {\n constructor(workerManager, configurationService, modelService, languageConfigurationService) {\n this.languageConfigurationService = languageConfigurationService;\n this._debugDisplayName = 'wordbasedCompletions';\n this._workerManager = workerManager;\n this._configurationService = configurationService;\n this._modelService = modelService;\n }\n async provideCompletionItems(model, position) {\n const config = this._configurationService.getValue(model.uri, position, 'editor');\n if (config.wordBasedSuggestions === 'off') {\n return undefined;\n }\n const models = [];\n if (config.wordBasedSuggestions === 'currentDocument') {\n // only current file and only if not too large\n if (canSyncModel(this._modelService, model.uri)) {\n models.push(model.uri);\n }\n }\n else {\n // either all files or files of same language\n for (const candidate of this._modelService.getModels()) {\n if (!canSyncModel(this._modelService, candidate.uri)) {\n continue;\n }\n if (candidate === model) {\n models.unshift(candidate.uri);\n }\n else if (config.wordBasedSuggestions === 'allDocuments' || candidate.getLanguageId() === model.getLanguageId()) {\n models.push(candidate.uri);\n }\n }\n }\n if (models.length === 0) {\n return undefined; // File too large, no other files\n }\n const wordDefRegExp = this.languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition();\n const word = model.getWordAtPosition(position);\n const replace = !word ? Range.fromPositions(position) : new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn);\n const insert = replace.setEndPosition(position.lineNumber, position.column);\n const client = await this._workerManager.withWorker();\n const data = await client.textualSuggest(models, word === null || word === void 0 ? void 0 : word.word, wordDefRegExp);\n if (!data) {\n return undefined;\n }\n return {\n duration: data.duration,\n suggestions: data.words.map((word) => {\n return {\n kind: 18 /* languages.CompletionItemKind.Text */,\n label: word,\n insertText: word,\n range: { insert, replace }\n };\n }),\n };\n }\n}\nclass WorkerManager extends Disposable {\n constructor(modelService, languageConfigurationService) {\n super();\n this.languageConfigurationService = languageConfigurationService;\n this._modelService = modelService;\n this._editorWorkerClient = null;\n this._lastWorkerUsedTime = (new Date()).getTime();\n const stopWorkerInterval = this._register(new WindowIntervalTimer());\n stopWorkerInterval.cancelAndSet(() => this._checkStopIdleWorker(), Math.round(STOP_WORKER_DELTA_TIME_MS / 2), $window);\n this._register(this._modelService.onModelRemoved(_ => this._checkStopEmptyWorker()));\n }\n dispose() {\n if (this._editorWorkerClient) {\n this._editorWorkerClient.dispose();\n this._editorWorkerClient = null;\n }\n super.dispose();\n }\n /**\n * Check if the model service has no more models and stop the worker if that is the case.\n */\n _checkStopEmptyWorker() {\n if (!this._editorWorkerClient) {\n return;\n }\n const models = this._modelService.getModels();\n if (models.length === 0) {\n // There are no more models => nothing possible for me to do\n this._editorWorkerClient.dispose();\n this._editorWorkerClient = null;\n }\n }\n /**\n * Check if the worker has been idle for a while and then stop it.\n */\n _checkStopIdleWorker() {\n if (!this._editorWorkerClient) {\n return;\n }\n const timeSinceLastWorkerUsedTime = (new Date()).getTime() - this._lastWorkerUsedTime;\n if (timeSinceLastWorkerUsedTime > STOP_WORKER_DELTA_TIME_MS) {\n this._editorWorkerClient.dispose();\n this._editorWorkerClient = null;\n }\n }\n withWorker() {\n this._lastWorkerUsedTime = (new Date()).getTime();\n if (!this._editorWorkerClient) {\n this._editorWorkerClient = new EditorWorkerClient(this._modelService, false, 'editorWorkerService', this.languageConfigurationService);\n }\n return Promise.resolve(this._editorWorkerClient);\n }\n}\nclass EditorModelManager extends Disposable {\n constructor(proxy, modelService, keepIdleModels) {\n super();\n this._syncedModels = Object.create(null);\n this._syncedModelsLastUsedTime = Object.create(null);\n this._proxy = proxy;\n this._modelService = modelService;\n if (!keepIdleModels) {\n const timer = new IntervalTimer();\n timer.cancelAndSet(() => this._checkStopModelSync(), Math.round(STOP_SYNC_MODEL_DELTA_TIME_MS / 2));\n this._register(timer);\n }\n }\n dispose() {\n for (const modelUrl in this._syncedModels) {\n dispose(this._syncedModels[modelUrl]);\n }\n this._syncedModels = Object.create(null);\n this._syncedModelsLastUsedTime = Object.create(null);\n super.dispose();\n }\n ensureSyncedResources(resources, forceLargeModels) {\n for (const resource of resources) {\n const resourceStr = resource.toString();\n if (!this._syncedModels[resourceStr]) {\n this._beginModelSync(resource, forceLargeModels);\n }\n if (this._syncedModels[resourceStr]) {\n this._syncedModelsLastUsedTime[resourceStr] = (new Date()).getTime();\n }\n }\n }\n _checkStopModelSync() {\n const currentTime = (new Date()).getTime();\n const toRemove = [];\n for (const modelUrl in this._syncedModelsLastUsedTime) {\n const elapsedTime = currentTime - this._syncedModelsLastUsedTime[modelUrl];\n if (elapsedTime > STOP_SYNC_MODEL_DELTA_TIME_MS) {\n toRemove.push(modelUrl);\n }\n }\n for (const e of toRemove) {\n this._stopModelSync(e);\n }\n }\n _beginModelSync(resource, forceLargeModels) {\n const model = this._modelService.getModel(resource);\n if (!model) {\n return;\n }\n if (!forceLargeModels && model.isTooLargeForSyncing()) {\n return;\n }\n const modelUrl = resource.toString();\n this._proxy.acceptNewModel({\n url: model.uri.toString(),\n lines: model.getLinesContent(),\n EOL: model.getEOL(),\n versionId: model.getVersionId()\n });\n const toDispose = new DisposableStore();\n toDispose.add(model.onDidChangeContent((e) => {\n this._proxy.acceptModelChanged(modelUrl.toString(), e);\n }));\n toDispose.add(model.onWillDispose(() => {\n this._stopModelSync(modelUrl);\n }));\n toDispose.add(toDisposable(() => {\n this._proxy.acceptRemovedModel(modelUrl);\n }));\n this._syncedModels[modelUrl] = toDispose;\n }\n _stopModelSync(modelUrl) {\n const toDispose = this._syncedModels[modelUrl];\n delete this._syncedModels[modelUrl];\n delete this._syncedModelsLastUsedTime[modelUrl];\n dispose(toDispose);\n }\n}\nclass SynchronousWorkerClient {\n constructor(instance) {\n this._instance = instance;\n this._proxyObj = Promise.resolve(this._instance);\n }\n dispose() {\n this._instance.dispose();\n }\n getProxyObject() {\n return this._proxyObj;\n }\n}\nexport class EditorWorkerHost {\n constructor(workerClient) {\n this._workerClient = workerClient;\n }\n // foreign host request\n fhr(method, args) {\n return this._workerClient.fhr(method, args);\n }\n}\nexport class EditorWorkerClient extends Disposable {\n constructor(modelService, keepIdleModels, label, languageConfigurationService) {\n super();\n this.languageConfigurationService = languageConfigurationService;\n this._disposed = false;\n this._modelService = modelService;\n this._keepIdleModels = keepIdleModels;\n this._workerFactory = new DefaultWorkerFactory(label);\n this._worker = null;\n this._modelManager = null;\n }\n // foreign host request\n fhr(method, args) {\n throw new Error(`Not implemented!`);\n }\n _getOrCreateWorker() {\n if (!this._worker) {\n try {\n this._worker = this._register(new SimpleWorkerClient(this._workerFactory, 'vs/editor/common/services/editorSimpleWorker', new EditorWorkerHost(this)));\n }\n catch (err) {\n logOnceWebWorkerWarning(err);\n this._worker = new SynchronousWorkerClient(new EditorSimpleWorker(new EditorWorkerHost(this), null));\n }\n }\n return this._worker;\n }\n _getProxy() {\n return this._getOrCreateWorker().getProxyObject().then(undefined, (err) => {\n logOnceWebWorkerWarning(err);\n this._worker = new SynchronousWorkerClient(new EditorSimpleWorker(new EditorWorkerHost(this), null));\n return this._getOrCreateWorker().getProxyObject();\n });\n }\n _getOrCreateModelManager(proxy) {\n if (!this._modelManager) {\n this._modelManager = this._register(new EditorModelManager(proxy, this._modelService, this._keepIdleModels));\n }\n return this._modelManager;\n }\n async _withSyncedResources(resources, forceLargeModels = false) {\n if (this._disposed) {\n return Promise.reject(canceled());\n }\n return this._getProxy().then((proxy) => {\n this._getOrCreateModelManager(proxy).ensureSyncedResources(resources, forceLargeModels);\n return proxy;\n });\n }\n computedUnicodeHighlights(uri, options, range) {\n return this._withSyncedResources([uri]).then(proxy => {\n return proxy.computeUnicodeHighlights(uri.toString(), options, range);\n });\n }\n computeDiff(original, modified, options, algorithm) {\n return this._withSyncedResources([original, modified], /* forceLargeModels */ true).then(proxy => {\n return proxy.computeDiff(original.toString(), modified.toString(), options, algorithm);\n });\n }\n computeMoreMinimalEdits(resource, edits, pretty) {\n return this._withSyncedResources([resource]).then(proxy => {\n return proxy.computeMoreMinimalEdits(resource.toString(), edits, pretty);\n });\n }\n computeLinks(resource) {\n return this._withSyncedResources([resource]).then(proxy => {\n return proxy.computeLinks(resource.toString());\n });\n }\n computeDefaultDocumentColors(resource) {\n return this._withSyncedResources([resource]).then(proxy => {\n return proxy.computeDefaultDocumentColors(resource.toString());\n });\n }\n async textualSuggest(resources, leadingWord, wordDefRegExp) {\n const proxy = await this._withSyncedResources(resources);\n const wordDef = wordDefRegExp.source;\n const wordDefFlags = wordDefRegExp.flags;\n return proxy.textualSuggest(resources.map(r => r.toString()), leadingWord, wordDef, wordDefFlags);\n }\n computeWordRanges(resource, range) {\n return this._withSyncedResources([resource]).then(proxy => {\n const model = this._modelService.getModel(resource);\n if (!model) {\n return Promise.resolve(null);\n }\n const wordDefRegExp = this.languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition();\n const wordDef = wordDefRegExp.source;\n const wordDefFlags = wordDefRegExp.flags;\n return proxy.computeWordRanges(resource.toString(), range, wordDef, wordDefFlags);\n });\n }\n navigateValueSet(resource, range, up) {\n return this._withSyncedResources([resource]).then(proxy => {\n const model = this._modelService.getModel(resource);\n if (!model) {\n return null;\n }\n const wordDefRegExp = this.languageConfigurationService.getLanguageConfiguration(model.getLanguageId()).getWordDefinition();\n const wordDef = wordDefRegExp.source;\n const wordDefFlags = wordDefRegExp.flags;\n return proxy.navigateValueSet(resource.toString(), range, up, wordDef, wordDefFlags);\n });\n }\n dispose() {\n super.dispose();\n this._disposed = true;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getAllMethodNames } from '../../../base/common/objects.js';\nimport { EditorWorkerClient } from './editorWorkerService.js';\n/**\n * Create a new web worker that has model syncing capabilities built in.\n * Specify an AMD module to load that will `create` an object that will be proxied.\n */\nexport function createWebWorker(modelService, languageConfigurationService, opts) {\n return new MonacoWebWorkerImpl(modelService, languageConfigurationService, opts);\n}\nclass MonacoWebWorkerImpl extends EditorWorkerClient {\n constructor(modelService, languageConfigurationService, opts) {\n super(modelService, opts.keepIdleModels || false, opts.label, languageConfigurationService);\n this._foreignModuleId = opts.moduleId;\n this._foreignModuleCreateData = opts.createData || null;\n this._foreignModuleHost = opts.host || null;\n this._foreignProxy = null;\n }\n // foreign host request\n fhr(method, args) {\n if (!this._foreignModuleHost || typeof this._foreignModuleHost[method] !== 'function') {\n return Promise.reject(new Error('Missing method ' + method + ' or missing main thread foreign host.'));\n }\n try {\n return Promise.resolve(this._foreignModuleHost[method].apply(this._foreignModuleHost, args));\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n _getForeignProxy() {\n if (!this._foreignProxy) {\n this._foreignProxy = this._getProxy().then((proxy) => {\n const foreignHostMethods = this._foreignModuleHost ? getAllMethodNames(this._foreignModuleHost) : [];\n return proxy.loadForeignModule(this._foreignModuleId, this._foreignModuleCreateData, foreignHostMethods).then((foreignMethods) => {\n this._foreignModuleCreateData = null;\n const proxyMethodRequest = (method, args) => {\n return proxy.fmr(method, args);\n };\n const createProxyMethod = (method, proxyMethodRequest) => {\n return function () {\n const args = Array.prototype.slice.call(arguments, 0);\n return proxyMethodRequest(method, args);\n };\n };\n const foreignProxy = {};\n for (const foreignMethod of foreignMethods) {\n foreignProxy[foreignMethod] = createProxyMethod(foreignMethod, proxyMethodRequest);\n }\n return foreignProxy;\n });\n });\n }\n return this._foreignProxy;\n }\n getProxy() {\n return this._getForeignProxy();\n }\n withSyncedResources(resources) {\n return this._withSyncedResources(resources).then(_ => this.getProxy());\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * The type of the `IEditor`.\n */\nexport const EditorType = {\n ICodeEditor: 'vs.editor.ICodeEditor',\n IDiffEditor: 'vs.editor.IDiffEditor'\n};\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Token, TokenizationResult, EncodedTokenizationResult } from '../languages.js';\nexport const NullState = new class {\n clone() {\n return this;\n }\n equals(other) {\n return (this === other);\n }\n};\nexport function nullTokenize(languageId, state) {\n return new TokenizationResult([new Token(0, '', languageId)], state);\n}\nexport function nullTokenizeEncoded(languageId, state) {\n const tokens = new Uint32Array(2);\n tokens[0] = 0;\n tokens[1] = ((languageId << 0 /* MetadataConsts.LANGUAGEID_OFFSET */)\n | (0 /* StandardTokenType.Other */ << 8 /* MetadataConsts.TOKEN_TYPE_OFFSET */)\n | (0 /* FontStyle.None */ << 11 /* MetadataConsts.FONT_STYLE_OFFSET */)\n | (1 /* ColorId.DefaultForeground */ << 15 /* MetadataConsts.FOREGROUND_OFFSET */)\n | (2 /* ColorId.DefaultBackground */ << 24 /* MetadataConsts.BACKGROUND_OFFSET */)) >>> 0;\n return new EncodedTokenizationResult(tokens, state === null ? NullState : state);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n */\nexport class TokenMetadata {\n static getLanguageId(metadata) {\n return (metadata & 255 /* MetadataConsts.LANGUAGEID_MASK */) >>> 0 /* MetadataConsts.LANGUAGEID_OFFSET */;\n }\n static getTokenType(metadata) {\n return (metadata & 768 /* MetadataConsts.TOKEN_TYPE_MASK */) >>> 8 /* MetadataConsts.TOKEN_TYPE_OFFSET */;\n }\n static containsBalancedBrackets(metadata) {\n return (metadata & 1024 /* MetadataConsts.BALANCED_BRACKETS_MASK */) !== 0;\n }\n static getFontStyle(metadata) {\n return (metadata & 30720 /* MetadataConsts.FONT_STYLE_MASK */) >>> 11 /* MetadataConsts.FONT_STYLE_OFFSET */;\n }\n static getForeground(metadata) {\n return (metadata & 16744448 /* MetadataConsts.FOREGROUND_MASK */) >>> 15 /* MetadataConsts.FOREGROUND_OFFSET */;\n }\n static getBackground(metadata) {\n return (metadata & 4278190080 /* MetadataConsts.BACKGROUND_MASK */) >>> 24 /* MetadataConsts.BACKGROUND_OFFSET */;\n }\n static getClassNameFromMetadata(metadata) {\n const foreground = this.getForeground(metadata);\n let className = 'mtk' + foreground;\n const fontStyle = this.getFontStyle(metadata);\n if (fontStyle & 1 /* FontStyle.Italic */) {\n className += ' mtki';\n }\n if (fontStyle & 2 /* FontStyle.Bold */) {\n className += ' mtkb';\n }\n if (fontStyle & 4 /* FontStyle.Underline */) {\n className += ' mtku';\n }\n if (fontStyle & 8 /* FontStyle.Strikethrough */) {\n className += ' mtks';\n }\n return className;\n }\n static getInlineStyleFromMetadata(metadata, colorMap) {\n const foreground = this.getForeground(metadata);\n const fontStyle = this.getFontStyle(metadata);\n let result = `color: ${colorMap[foreground]};`;\n if (fontStyle & 1 /* FontStyle.Italic */) {\n result += 'font-style: italic;';\n }\n if (fontStyle & 2 /* FontStyle.Bold */) {\n result += 'font-weight: bold;';\n }\n let textDecoration = '';\n if (fontStyle & 4 /* FontStyle.Underline */) {\n textDecoration += ' underline';\n }\n if (fontStyle & 8 /* FontStyle.Strikethrough */) {\n textDecoration += ' line-through';\n }\n if (textDecoration) {\n result += `text-decoration:${textDecoration};`;\n }\n return result;\n }\n static getPresentationFromMetadata(metadata) {\n const foreground = this.getForeground(metadata);\n const fontStyle = this.getFontStyle(metadata);\n return {\n foreground: foreground,\n italic: Boolean(fontStyle & 1 /* FontStyle.Italic */),\n bold: Boolean(fontStyle & 2 /* FontStyle.Bold */),\n underline: Boolean(fontStyle & 4 /* FontStyle.Underline */),\n strikethrough: Boolean(fontStyle & 8 /* FontStyle.Strikethrough */),\n };\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { TokenMetadata } from '../encodedTokenAttributes.js';\nexport class LineTokens {\n static createEmpty(lineContent, decoder) {\n const defaultMetadata = LineTokens.defaultTokenMetadata;\n const tokens = new Uint32Array(2);\n tokens[0] = lineContent.length;\n tokens[1] = defaultMetadata;\n return new LineTokens(tokens, lineContent, decoder);\n }\n constructor(tokens, text, decoder) {\n this._lineTokensBrand = undefined;\n this._tokens = tokens;\n this._tokensCount = (this._tokens.length >>> 1);\n this._text = text;\n this._languageIdCodec = decoder;\n }\n equals(other) {\n if (other instanceof LineTokens) {\n return this.slicedEquals(other, 0, this._tokensCount);\n }\n return false;\n }\n slicedEquals(other, sliceFromTokenIndex, sliceTokenCount) {\n if (this._text !== other._text) {\n return false;\n }\n if (this._tokensCount !== other._tokensCount) {\n return false;\n }\n const from = (sliceFromTokenIndex << 1);\n const to = from + (sliceTokenCount << 1);\n for (let i = from; i < to; i++) {\n if (this._tokens[i] !== other._tokens[i]) {\n return false;\n }\n }\n return true;\n }\n getLineContent() {\n return this._text;\n }\n getCount() {\n return this._tokensCount;\n }\n getStartOffset(tokenIndex) {\n if (tokenIndex > 0) {\n return this._tokens[(tokenIndex - 1) << 1];\n }\n return 0;\n }\n getMetadata(tokenIndex) {\n const metadata = this._tokens[(tokenIndex << 1) + 1];\n return metadata;\n }\n getLanguageId(tokenIndex) {\n const metadata = this._tokens[(tokenIndex << 1) + 1];\n const languageId = TokenMetadata.getLanguageId(metadata);\n return this._languageIdCodec.decodeLanguageId(languageId);\n }\n getStandardTokenType(tokenIndex) {\n const metadata = this._tokens[(tokenIndex << 1) + 1];\n return TokenMetadata.getTokenType(metadata);\n }\n getForeground(tokenIndex) {\n const metadata = this._tokens[(tokenIndex << 1) + 1];\n return TokenMetadata.getForeground(metadata);\n }\n getClassName(tokenIndex) {\n const metadata = this._tokens[(tokenIndex << 1) + 1];\n return TokenMetadata.getClassNameFromMetadata(metadata);\n }\n getInlineStyle(tokenIndex, colorMap) {\n const metadata = this._tokens[(tokenIndex << 1) + 1];\n return TokenMetadata.getInlineStyleFromMetadata(metadata, colorMap);\n }\n getPresentation(tokenIndex) {\n const metadata = this._tokens[(tokenIndex << 1) + 1];\n return TokenMetadata.getPresentationFromMetadata(metadata);\n }\n getEndOffset(tokenIndex) {\n return this._tokens[tokenIndex << 1];\n }\n /**\n * Find the token containing offset `offset`.\n * @param offset The search offset\n * @return The index of the token containing the offset.\n */\n findTokenIndexAtOffset(offset) {\n return LineTokens.findIndexInTokensArray(this._tokens, offset);\n }\n inflate() {\n return this;\n }\n sliceAndInflate(startOffset, endOffset, deltaOffset) {\n return new SliceLineTokens(this, startOffset, endOffset, deltaOffset);\n }\n static convertToEndOffset(tokens, lineTextLength) {\n const tokenCount = (tokens.length >>> 1);\n const lastTokenIndex = tokenCount - 1;\n for (let tokenIndex = 0; tokenIndex < lastTokenIndex; tokenIndex++) {\n tokens[tokenIndex << 1] = tokens[(tokenIndex + 1) << 1];\n }\n tokens[lastTokenIndex << 1] = lineTextLength;\n }\n static findIndexInTokensArray(tokens, desiredIndex) {\n if (tokens.length <= 2) {\n return 0;\n }\n let low = 0;\n let high = (tokens.length >>> 1) - 1;\n while (low < high) {\n const mid = low + Math.floor((high - low) / 2);\n const endOffset = tokens[(mid << 1)];\n if (endOffset === desiredIndex) {\n return mid + 1;\n }\n else if (endOffset < desiredIndex) {\n low = mid + 1;\n }\n else if (endOffset > desiredIndex) {\n high = mid;\n }\n }\n return low;\n }\n /**\n * @pure\n * @param insertTokens Must be sorted by offset.\n */\n withInserted(insertTokens) {\n if (insertTokens.length === 0) {\n return this;\n }\n let nextOriginalTokenIdx = 0;\n let nextInsertTokenIdx = 0;\n let text = '';\n const newTokens = new Array();\n let originalEndOffset = 0;\n while (true) {\n const nextOriginalTokenEndOffset = nextOriginalTokenIdx < this._tokensCount ? this._tokens[nextOriginalTokenIdx << 1] : -1;\n const nextInsertToken = nextInsertTokenIdx < insertTokens.length ? insertTokens[nextInsertTokenIdx] : null;\n if (nextOriginalTokenEndOffset !== -1 && (nextInsertToken === null || nextOriginalTokenEndOffset <= nextInsertToken.offset)) {\n // original token ends before next insert token\n text += this._text.substring(originalEndOffset, nextOriginalTokenEndOffset);\n const metadata = this._tokens[(nextOriginalTokenIdx << 1) + 1];\n newTokens.push(text.length, metadata);\n nextOriginalTokenIdx++;\n originalEndOffset = nextOriginalTokenEndOffset;\n }\n else if (nextInsertToken) {\n if (nextInsertToken.offset > originalEndOffset) {\n // insert token is in the middle of the next token.\n text += this._text.substring(originalEndOffset, nextInsertToken.offset);\n const metadata = this._tokens[(nextOriginalTokenIdx << 1) + 1];\n newTokens.push(text.length, metadata);\n originalEndOffset = nextInsertToken.offset;\n }\n text += nextInsertToken.text;\n newTokens.push(text.length, nextInsertToken.tokenMetadata);\n nextInsertTokenIdx++;\n }\n else {\n break;\n }\n }\n return new LineTokens(new Uint32Array(newTokens), text, this._languageIdCodec);\n }\n}\nLineTokens.defaultTokenMetadata = ((0 /* FontStyle.None */ << 11 /* MetadataConsts.FONT_STYLE_OFFSET */)\n | (1 /* ColorId.DefaultForeground */ << 15 /* MetadataConsts.FOREGROUND_OFFSET */)\n | (2 /* ColorId.DefaultBackground */ << 24 /* MetadataConsts.BACKGROUND_OFFSET */)) >>> 0;\nclass SliceLineTokens {\n constructor(source, startOffset, endOffset, deltaOffset) {\n this._source = source;\n this._startOffset = startOffset;\n this._endOffset = endOffset;\n this._deltaOffset = deltaOffset;\n this._firstTokenIndex = source.findTokenIndexAtOffset(startOffset);\n this._tokensCount = 0;\n for (let i = this._firstTokenIndex, len = source.getCount(); i < len; i++) {\n const tokenStartOffset = source.getStartOffset(i);\n if (tokenStartOffset >= endOffset) {\n break;\n }\n this._tokensCount++;\n }\n }\n getMetadata(tokenIndex) {\n return this._source.getMetadata(this._firstTokenIndex + tokenIndex);\n }\n getLanguageId(tokenIndex) {\n return this._source.getLanguageId(this._firstTokenIndex + tokenIndex);\n }\n getLineContent() {\n return this._source.getLineContent().substring(this._startOffset, this._endOffset);\n }\n equals(other) {\n if (other instanceof SliceLineTokens) {\n return (this._startOffset === other._startOffset\n && this._endOffset === other._endOffset\n && this._deltaOffset === other._deltaOffset\n && this._source.slicedEquals(other._source, this._firstTokenIndex, this._tokensCount));\n }\n return false;\n }\n getCount() {\n return this._tokensCount;\n }\n getForeground(tokenIndex) {\n return this._source.getForeground(this._firstTokenIndex + tokenIndex);\n }\n getEndOffset(tokenIndex) {\n const tokenEndOffset = this._source.getEndOffset(this._firstTokenIndex + tokenIndex);\n return Math.min(this._endOffset, tokenEndOffset) - this._startOffset + this._deltaOffset;\n }\n getClassName(tokenIndex) {\n return this._source.getClassName(this._firstTokenIndex + tokenIndex);\n }\n getInlineStyle(tokenIndex, colorMap) {\n return this._source.getInlineStyle(this._firstTokenIndex + tokenIndex, colorMap);\n }\n getPresentation(tokenIndex) {\n return this._source.getPresentation(this._firstTokenIndex + tokenIndex);\n }\n findTokenIndexAtOffset(offset) {\n return this._source.findTokenIndexAtOffset(offset + this._startOffset - this._deltaOffset) - this._firstTokenIndex;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as strings from '../../../base/common/strings.js';\nexport class LineDecoration {\n constructor(startColumn, endColumn, className, type) {\n this.startColumn = startColumn;\n this.endColumn = endColumn;\n this.className = className;\n this.type = type;\n this._lineDecorationBrand = undefined;\n }\n static _equals(a, b) {\n return (a.startColumn === b.startColumn\n && a.endColumn === b.endColumn\n && a.className === b.className\n && a.type === b.type);\n }\n static equalsArr(a, b) {\n const aLen = a.length;\n const bLen = b.length;\n if (aLen !== bLen) {\n return false;\n }\n for (let i = 0; i < aLen; i++) {\n if (!LineDecoration._equals(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n static extractWrapped(arr, startOffset, endOffset) {\n if (arr.length === 0) {\n return arr;\n }\n const startColumn = startOffset + 1;\n const endColumn = endOffset + 1;\n const lineLength = endOffset - startOffset;\n const r = [];\n let rLength = 0;\n for (const dec of arr) {\n if (dec.endColumn <= startColumn || dec.startColumn >= endColumn) {\n continue;\n }\n r[rLength++] = new LineDecoration(Math.max(1, dec.startColumn - startColumn + 1), Math.min(lineLength + 1, dec.endColumn - startColumn + 1), dec.className, dec.type);\n }\n return r;\n }\n static filter(lineDecorations, lineNumber, minLineColumn, maxLineColumn) {\n if (lineDecorations.length === 0) {\n return [];\n }\n const result = [];\n let resultLen = 0;\n for (let i = 0, len = lineDecorations.length; i < len; i++) {\n const d = lineDecorations[i];\n const range = d.range;\n if (range.endLineNumber < lineNumber || range.startLineNumber > lineNumber) {\n // Ignore decorations that sit outside this line\n continue;\n }\n if (range.isEmpty() && (d.type === 0 /* InlineDecorationType.Regular */ || d.type === 3 /* InlineDecorationType.RegularAffectingLetterSpacing */)) {\n // Ignore empty range decorations\n continue;\n }\n const startColumn = (range.startLineNumber === lineNumber ? range.startColumn : minLineColumn);\n const endColumn = (range.endLineNumber === lineNumber ? range.endColumn : maxLineColumn);\n result[resultLen++] = new LineDecoration(startColumn, endColumn, d.inlineClassName, d.type);\n }\n return result;\n }\n static _typeCompare(a, b) {\n const ORDER = [2, 0, 1, 3];\n return ORDER[a] - ORDER[b];\n }\n static compare(a, b) {\n if (a.startColumn !== b.startColumn) {\n return a.startColumn - b.startColumn;\n }\n if (a.endColumn !== b.endColumn) {\n return a.endColumn - b.endColumn;\n }\n const typeCmp = LineDecoration._typeCompare(a.type, b.type);\n if (typeCmp !== 0) {\n return typeCmp;\n }\n if (a.className !== b.className) {\n return a.className < b.className ? -1 : 1;\n }\n return 0;\n }\n}\nexport class DecorationSegment {\n constructor(startOffset, endOffset, className, metadata) {\n this.startOffset = startOffset;\n this.endOffset = endOffset;\n this.className = className;\n this.metadata = metadata;\n }\n}\nclass Stack {\n constructor() {\n this.stopOffsets = [];\n this.classNames = [];\n this.metadata = [];\n this.count = 0;\n }\n static _metadata(metadata) {\n let result = 0;\n for (let i = 0, len = metadata.length; i < len; i++) {\n result |= metadata[i];\n }\n return result;\n }\n consumeLowerThan(maxStopOffset, nextStartOffset, result) {\n while (this.count > 0 && this.stopOffsets[0] < maxStopOffset) {\n let i = 0;\n // Take all equal stopping offsets\n while (i + 1 < this.count && this.stopOffsets[i] === this.stopOffsets[i + 1]) {\n i++;\n }\n // Basically we are consuming the first i + 1 elements of the stack\n result.push(new DecorationSegment(nextStartOffset, this.stopOffsets[i], this.classNames.join(' '), Stack._metadata(this.metadata)));\n nextStartOffset = this.stopOffsets[i] + 1;\n // Consume them\n this.stopOffsets.splice(0, i + 1);\n this.classNames.splice(0, i + 1);\n this.metadata.splice(0, i + 1);\n this.count -= (i + 1);\n }\n if (this.count > 0 && nextStartOffset < maxStopOffset) {\n result.push(new DecorationSegment(nextStartOffset, maxStopOffset - 1, this.classNames.join(' '), Stack._metadata(this.metadata)));\n nextStartOffset = maxStopOffset;\n }\n return nextStartOffset;\n }\n insert(stopOffset, className, metadata) {\n if (this.count === 0 || this.stopOffsets[this.count - 1] <= stopOffset) {\n // Insert at the end\n this.stopOffsets.push(stopOffset);\n this.classNames.push(className);\n this.metadata.push(metadata);\n }\n else {\n // Find the insertion position for `stopOffset`\n for (let i = 0; i < this.count; i++) {\n if (this.stopOffsets[i] >= stopOffset) {\n this.stopOffsets.splice(i, 0, stopOffset);\n this.classNames.splice(i, 0, className);\n this.metadata.splice(i, 0, metadata);\n break;\n }\n }\n }\n this.count++;\n return;\n }\n}\nexport class LineDecorationsNormalizer {\n /**\n * Normalize line decorations. Overlapping decorations will generate multiple segments\n */\n static normalize(lineContent, lineDecorations) {\n if (lineDecorations.length === 0) {\n return [];\n }\n const result = [];\n const stack = new Stack();\n let nextStartOffset = 0;\n for (let i = 0, len = lineDecorations.length; i < len; i++) {\n const d = lineDecorations[i];\n let startColumn = d.startColumn;\n let endColumn = d.endColumn;\n const className = d.className;\n const metadata = (d.type === 1 /* InlineDecorationType.Before */\n ? 2 /* LinePartMetadata.PSEUDO_BEFORE */\n : d.type === 2 /* InlineDecorationType.After */\n ? 4 /* LinePartMetadata.PSEUDO_AFTER */\n : 0);\n // If the position would end up in the middle of a high-low surrogate pair, we move it to before the pair\n if (startColumn > 1) {\n const charCodeBefore = lineContent.charCodeAt(startColumn - 2);\n if (strings.isHighSurrogate(charCodeBefore)) {\n startColumn--;\n }\n }\n if (endColumn > 1) {\n const charCodeBefore = lineContent.charCodeAt(endColumn - 2);\n if (strings.isHighSurrogate(charCodeBefore)) {\n endColumn--;\n }\n }\n const currentStartOffset = startColumn - 1;\n const currentEndOffset = endColumn - 2;\n nextStartOffset = stack.consumeLowerThan(currentStartOffset, nextStartOffset, result);\n if (stack.count === 0) {\n nextStartOffset = currentStartOffset;\n }\n stack.insert(currentEndOffset, className, metadata);\n }\n stack.consumeLowerThan(1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */, nextStartOffset, result);\n return result;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class LinePart {\n constructor(\n /**\n * last char index of this token (not inclusive).\n */\n endIndex, type, metadata, containsRTL) {\n this.endIndex = endIndex;\n this.type = type;\n this.metadata = metadata;\n this.containsRTL = containsRTL;\n this._linePartBrand = undefined;\n }\n isWhitespace() {\n return (this.metadata & 1 /* LinePartMetadata.IS_WHITESPACE_MASK */ ? true : false);\n }\n isPseudoAfter() {\n return (this.metadata & 4 /* LinePartMetadata.PSEUDO_AFTER_MASK */ ? true : false);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as nls from '../../../nls.js';\nimport * as strings from '../../../base/common/strings.js';\nimport { StringBuilder } from '../core/stringBuilder.js';\nimport { LineDecoration, LineDecorationsNormalizer } from './lineDecorations.js';\nimport { LinePart } from './linePart.js';\nexport class LineRange {\n constructor(startIndex, endIndex) {\n this.startOffset = startIndex;\n this.endOffset = endIndex;\n }\n equals(otherLineRange) {\n return this.startOffset === otherLineRange.startOffset\n && this.endOffset === otherLineRange.endOffset;\n }\n}\nexport class RenderLineInput {\n constructor(useMonospaceOptimizations, canUseHalfwidthRightwardsArrow, lineContent, continuesWithWrappedLine, isBasicASCII, containsRTL, fauxIndentLength, lineTokens, lineDecorations, tabSize, startVisibleColumn, spaceWidth, middotWidth, wsmiddotWidth, stopRenderingLineAfter, renderWhitespace, renderControlCharacters, fontLigatures, selectionsOnLine) {\n this.useMonospaceOptimizations = useMonospaceOptimizations;\n this.canUseHalfwidthRightwardsArrow = canUseHalfwidthRightwardsArrow;\n this.lineContent = lineContent;\n this.continuesWithWrappedLine = continuesWithWrappedLine;\n this.isBasicASCII = isBasicASCII;\n this.containsRTL = containsRTL;\n this.fauxIndentLength = fauxIndentLength;\n this.lineTokens = lineTokens;\n this.lineDecorations = lineDecorations.sort(LineDecoration.compare);\n this.tabSize = tabSize;\n this.startVisibleColumn = startVisibleColumn;\n this.spaceWidth = spaceWidth;\n this.stopRenderingLineAfter = stopRenderingLineAfter;\n this.renderWhitespace = (renderWhitespace === 'all'\n ? 4 /* RenderWhitespace.All */\n : renderWhitespace === 'boundary'\n ? 1 /* RenderWhitespace.Boundary */\n : renderWhitespace === 'selection'\n ? 2 /* RenderWhitespace.Selection */\n : renderWhitespace === 'trailing'\n ? 3 /* RenderWhitespace.Trailing */\n : 0 /* RenderWhitespace.None */);\n this.renderControlCharacters = renderControlCharacters;\n this.fontLigatures = fontLigatures;\n this.selectionsOnLine = selectionsOnLine && selectionsOnLine.sort((a, b) => a.startOffset < b.startOffset ? -1 : 1);\n const wsmiddotDiff = Math.abs(wsmiddotWidth - spaceWidth);\n const middotDiff = Math.abs(middotWidth - spaceWidth);\n if (wsmiddotDiff < middotDiff) {\n this.renderSpaceWidth = wsmiddotWidth;\n this.renderSpaceCharCode = 0x2E31; // U+2E31 - WORD SEPARATOR MIDDLE DOT\n }\n else {\n this.renderSpaceWidth = middotWidth;\n this.renderSpaceCharCode = 0xB7; // U+00B7 - MIDDLE DOT\n }\n }\n sameSelection(otherSelections) {\n if (this.selectionsOnLine === null) {\n return otherSelections === null;\n }\n if (otherSelections === null) {\n return false;\n }\n if (otherSelections.length !== this.selectionsOnLine.length) {\n return false;\n }\n for (let i = 0; i < this.selectionsOnLine.length; i++) {\n if (!this.selectionsOnLine[i].equals(otherSelections[i])) {\n return false;\n }\n }\n return true;\n }\n equals(other) {\n return (this.useMonospaceOptimizations === other.useMonospaceOptimizations\n && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow\n && this.lineContent === other.lineContent\n && this.continuesWithWrappedLine === other.continuesWithWrappedLine\n && this.isBasicASCII === other.isBasicASCII\n && this.containsRTL === other.containsRTL\n && this.fauxIndentLength === other.fauxIndentLength\n && this.tabSize === other.tabSize\n && this.startVisibleColumn === other.startVisibleColumn\n && this.spaceWidth === other.spaceWidth\n && this.renderSpaceWidth === other.renderSpaceWidth\n && this.renderSpaceCharCode === other.renderSpaceCharCode\n && this.stopRenderingLineAfter === other.stopRenderingLineAfter\n && this.renderWhitespace === other.renderWhitespace\n && this.renderControlCharacters === other.renderControlCharacters\n && this.fontLigatures === other.fontLigatures\n && LineDecoration.equalsArr(this.lineDecorations, other.lineDecorations)\n && this.lineTokens.equals(other.lineTokens)\n && this.sameSelection(other.selectionsOnLine));\n }\n}\nexport class DomPosition {\n constructor(partIndex, charIndex) {\n this.partIndex = partIndex;\n this.charIndex = charIndex;\n }\n}\n/**\n * Provides a both direction mapping between a line's character and its rendered position.\n */\nexport class CharacterMapping {\n static getPartIndex(partData) {\n return (partData & 4294901760 /* CharacterMappingConstants.PART_INDEX_MASK */) >>> 16 /* CharacterMappingConstants.PART_INDEX_OFFSET */;\n }\n static getCharIndex(partData) {\n return (partData & 65535 /* CharacterMappingConstants.CHAR_INDEX_MASK */) >>> 0 /* CharacterMappingConstants.CHAR_INDEX_OFFSET */;\n }\n constructor(length, partCount) {\n this.length = length;\n this._data = new Uint32Array(this.length);\n this._horizontalOffset = new Uint32Array(this.length);\n }\n setColumnInfo(column, partIndex, charIndex, horizontalOffset) {\n const partData = ((partIndex << 16 /* CharacterMappingConstants.PART_INDEX_OFFSET */)\n | (charIndex << 0 /* CharacterMappingConstants.CHAR_INDEX_OFFSET */)) >>> 0;\n this._data[column - 1] = partData;\n this._horizontalOffset[column - 1] = horizontalOffset;\n }\n getHorizontalOffset(column) {\n if (this._horizontalOffset.length === 0) {\n // No characters on this line\n return 0;\n }\n return this._horizontalOffset[column - 1];\n }\n charOffsetToPartData(charOffset) {\n if (this.length === 0) {\n return 0;\n }\n if (charOffset < 0) {\n return this._data[0];\n }\n if (charOffset >= this.length) {\n return this._data[this.length - 1];\n }\n return this._data[charOffset];\n }\n getDomPosition(column) {\n const partData = this.charOffsetToPartData(column - 1);\n const partIndex = CharacterMapping.getPartIndex(partData);\n const charIndex = CharacterMapping.getCharIndex(partData);\n return new DomPosition(partIndex, charIndex);\n }\n getColumn(domPosition, partLength) {\n const charOffset = this.partDataToCharOffset(domPosition.partIndex, partLength, domPosition.charIndex);\n return charOffset + 1;\n }\n partDataToCharOffset(partIndex, partLength, charIndex) {\n if (this.length === 0) {\n return 0;\n }\n const searchEntry = ((partIndex << 16 /* CharacterMappingConstants.PART_INDEX_OFFSET */)\n | (charIndex << 0 /* CharacterMappingConstants.CHAR_INDEX_OFFSET */)) >>> 0;\n let min = 0;\n let max = this.length - 1;\n while (min + 1 < max) {\n const mid = ((min + max) >>> 1);\n const midEntry = this._data[mid];\n if (midEntry === searchEntry) {\n return mid;\n }\n else if (midEntry > searchEntry) {\n max = mid;\n }\n else {\n min = mid;\n }\n }\n if (min === max) {\n return min;\n }\n const minEntry = this._data[min];\n const maxEntry = this._data[max];\n if (minEntry === searchEntry) {\n return min;\n }\n if (maxEntry === searchEntry) {\n return max;\n }\n const minPartIndex = CharacterMapping.getPartIndex(minEntry);\n const minCharIndex = CharacterMapping.getCharIndex(minEntry);\n const maxPartIndex = CharacterMapping.getPartIndex(maxEntry);\n let maxCharIndex;\n if (minPartIndex !== maxPartIndex) {\n // sitting between parts\n maxCharIndex = partLength;\n }\n else {\n maxCharIndex = CharacterMapping.getCharIndex(maxEntry);\n }\n const minEntryDistance = charIndex - minCharIndex;\n const maxEntryDistance = maxCharIndex - charIndex;\n if (minEntryDistance <= maxEntryDistance) {\n return min;\n }\n return max;\n }\n}\nexport class RenderLineOutput {\n constructor(characterMapping, containsRTL, containsForeignElements) {\n this._renderLineOutputBrand = undefined;\n this.characterMapping = characterMapping;\n this.containsRTL = containsRTL;\n this.containsForeignElements = containsForeignElements;\n }\n}\nexport function renderViewLine(input, sb) {\n if (input.lineContent.length === 0) {\n if (input.lineDecorations.length > 0) {\n // This line is empty, but it contains inline decorations\n sb.appendString(``);\n let beforeCount = 0;\n let afterCount = 0;\n let containsForeignElements = 0 /* ForeignElementType.None */;\n for (const lineDecoration of input.lineDecorations) {\n if (lineDecoration.type === 1 /* InlineDecorationType.Before */ || lineDecoration.type === 2 /* InlineDecorationType.After */) {\n sb.appendString(``);\n if (lineDecoration.type === 1 /* InlineDecorationType.Before */) {\n containsForeignElements |= 1 /* ForeignElementType.Before */;\n beforeCount++;\n }\n if (lineDecoration.type === 2 /* InlineDecorationType.After */) {\n containsForeignElements |= 2 /* ForeignElementType.After */;\n afterCount++;\n }\n }\n }\n sb.appendString(``);\n const characterMapping = new CharacterMapping(1, beforeCount + afterCount);\n characterMapping.setColumnInfo(1, beforeCount, 0, 0);\n return new RenderLineOutput(characterMapping, false, containsForeignElements);\n }\n // completely empty line\n sb.appendString('');\n return new RenderLineOutput(new CharacterMapping(0, 0), false, 0 /* ForeignElementType.None */);\n }\n return _renderLine(resolveRenderLineInput(input), sb);\n}\nexport class RenderLineOutput2 {\n constructor(characterMapping, html, containsRTL, containsForeignElements) {\n this.characterMapping = characterMapping;\n this.html = html;\n this.containsRTL = containsRTL;\n this.containsForeignElements = containsForeignElements;\n }\n}\nexport function renderViewLine2(input) {\n const sb = new StringBuilder(10000);\n const out = renderViewLine(input, sb);\n return new RenderLineOutput2(out.characterMapping, sb.build(), out.containsRTL, out.containsForeignElements);\n}\nclass ResolvedRenderLineInput {\n constructor(fontIsMonospace, canUseHalfwidthRightwardsArrow, lineContent, len, isOverflowing, overflowingCharCount, parts, containsForeignElements, fauxIndentLength, tabSize, startVisibleColumn, containsRTL, spaceWidth, renderSpaceCharCode, renderWhitespace, renderControlCharacters) {\n this.fontIsMonospace = fontIsMonospace;\n this.canUseHalfwidthRightwardsArrow = canUseHalfwidthRightwardsArrow;\n this.lineContent = lineContent;\n this.len = len;\n this.isOverflowing = isOverflowing;\n this.overflowingCharCount = overflowingCharCount;\n this.parts = parts;\n this.containsForeignElements = containsForeignElements;\n this.fauxIndentLength = fauxIndentLength;\n this.tabSize = tabSize;\n this.startVisibleColumn = startVisibleColumn;\n this.containsRTL = containsRTL;\n this.spaceWidth = spaceWidth;\n this.renderSpaceCharCode = renderSpaceCharCode;\n this.renderWhitespace = renderWhitespace;\n this.renderControlCharacters = renderControlCharacters;\n //\n }\n}\nfunction resolveRenderLineInput(input) {\n const lineContent = input.lineContent;\n let isOverflowing;\n let overflowingCharCount;\n let len;\n if (input.stopRenderingLineAfter !== -1 && input.stopRenderingLineAfter < lineContent.length) {\n isOverflowing = true;\n overflowingCharCount = lineContent.length - input.stopRenderingLineAfter;\n len = input.stopRenderingLineAfter;\n }\n else {\n isOverflowing = false;\n overflowingCharCount = 0;\n len = lineContent.length;\n }\n let tokens = transformAndRemoveOverflowing(lineContent, input.containsRTL, input.lineTokens, input.fauxIndentLength, len);\n if (input.renderControlCharacters && !input.isBasicASCII) {\n // Calling `extractControlCharacters` before adding (possibly empty) line parts\n // for inline decorations. `extractControlCharacters` removes empty line parts.\n tokens = extractControlCharacters(lineContent, tokens);\n }\n if (input.renderWhitespace === 4 /* RenderWhitespace.All */ ||\n input.renderWhitespace === 1 /* RenderWhitespace.Boundary */ ||\n (input.renderWhitespace === 2 /* RenderWhitespace.Selection */ && !!input.selectionsOnLine) ||\n (input.renderWhitespace === 3 /* RenderWhitespace.Trailing */ && !input.continuesWithWrappedLine)) {\n tokens = _applyRenderWhitespace(input, lineContent, len, tokens);\n }\n let containsForeignElements = 0 /* ForeignElementType.None */;\n if (input.lineDecorations.length > 0) {\n for (let i = 0, len = input.lineDecorations.length; i < len; i++) {\n const lineDecoration = input.lineDecorations[i];\n if (lineDecoration.type === 3 /* InlineDecorationType.RegularAffectingLetterSpacing */) {\n // Pretend there are foreign elements... although not 100% accurate.\n containsForeignElements |= 1 /* ForeignElementType.Before */;\n }\n else if (lineDecoration.type === 1 /* InlineDecorationType.Before */) {\n containsForeignElements |= 1 /* ForeignElementType.Before */;\n }\n else if (lineDecoration.type === 2 /* InlineDecorationType.After */) {\n containsForeignElements |= 2 /* ForeignElementType.After */;\n }\n }\n tokens = _applyInlineDecorations(lineContent, len, tokens, input.lineDecorations);\n }\n if (!input.containsRTL) {\n // We can never split RTL text, as it ruins the rendering\n tokens = splitLargeTokens(lineContent, tokens, !input.isBasicASCII || input.fontLigatures);\n }\n return new ResolvedRenderLineInput(input.useMonospaceOptimizations, input.canUseHalfwidthRightwardsArrow, lineContent, len, isOverflowing, overflowingCharCount, tokens, containsForeignElements, input.fauxIndentLength, input.tabSize, input.startVisibleColumn, input.containsRTL, input.spaceWidth, input.renderSpaceCharCode, input.renderWhitespace, input.renderControlCharacters);\n}\n/**\n * In the rendering phase, characters are always looped until token.endIndex.\n * Ensure that all tokens end before `len` and the last one ends precisely at `len`.\n */\nfunction transformAndRemoveOverflowing(lineContent, lineContainsRTL, tokens, fauxIndentLength, len) {\n const result = [];\n let resultLen = 0;\n // The faux indent part of the line should have no token type\n if (fauxIndentLength > 0) {\n result[resultLen++] = new LinePart(fauxIndentLength, '', 0, false);\n }\n let startOffset = fauxIndentLength;\n for (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {\n const endIndex = tokens.getEndOffset(tokenIndex);\n if (endIndex <= fauxIndentLength) {\n // The faux indent part of the line should have no token type\n continue;\n }\n const type = tokens.getClassName(tokenIndex);\n if (endIndex >= len) {\n const tokenContainsRTL = (lineContainsRTL ? strings.containsRTL(lineContent.substring(startOffset, len)) : false);\n result[resultLen++] = new LinePart(len, type, 0, tokenContainsRTL);\n break;\n }\n const tokenContainsRTL = (lineContainsRTL ? strings.containsRTL(lineContent.substring(startOffset, endIndex)) : false);\n result[resultLen++] = new LinePart(endIndex, type, 0, tokenContainsRTL);\n startOffset = endIndex;\n }\n return result;\n}\n/**\n * See https://github.com/microsoft/vscode/issues/6885.\n * It appears that having very large spans causes very slow reading of character positions.\n * So here we try to avoid that.\n */\nfunction splitLargeTokens(lineContent, tokens, onlyAtSpaces) {\n let lastTokenEndIndex = 0;\n const result = [];\n let resultLen = 0;\n if (onlyAtSpaces) {\n // Split only at spaces => we need to walk each character\n for (let i = 0, len = tokens.length; i < len; i++) {\n const token = tokens[i];\n const tokenEndIndex = token.endIndex;\n if (lastTokenEndIndex + 50 /* Constants.LongToken */ < tokenEndIndex) {\n const tokenType = token.type;\n const tokenMetadata = token.metadata;\n const tokenContainsRTL = token.containsRTL;\n let lastSpaceOffset = -1;\n let currTokenStart = lastTokenEndIndex;\n for (let j = lastTokenEndIndex; j < tokenEndIndex; j++) {\n if (lineContent.charCodeAt(j) === 32 /* CharCode.Space */) {\n lastSpaceOffset = j;\n }\n if (lastSpaceOffset !== -1 && j - currTokenStart >= 50 /* Constants.LongToken */) {\n // Split at `lastSpaceOffset` + 1\n result[resultLen++] = new LinePart(lastSpaceOffset + 1, tokenType, tokenMetadata, tokenContainsRTL);\n currTokenStart = lastSpaceOffset + 1;\n lastSpaceOffset = -1;\n }\n }\n if (currTokenStart !== tokenEndIndex) {\n result[resultLen++] = new LinePart(tokenEndIndex, tokenType, tokenMetadata, tokenContainsRTL);\n }\n }\n else {\n result[resultLen++] = token;\n }\n lastTokenEndIndex = tokenEndIndex;\n }\n }\n else {\n // Split anywhere => we don't need to walk each character\n for (let i = 0, len = tokens.length; i < len; i++) {\n const token = tokens[i];\n const tokenEndIndex = token.endIndex;\n const diff = (tokenEndIndex - lastTokenEndIndex);\n if (diff > 50 /* Constants.LongToken */) {\n const tokenType = token.type;\n const tokenMetadata = token.metadata;\n const tokenContainsRTL = token.containsRTL;\n const piecesCount = Math.ceil(diff / 50 /* Constants.LongToken */);\n for (let j = 1; j < piecesCount; j++) {\n const pieceEndIndex = lastTokenEndIndex + (j * 50 /* Constants.LongToken */);\n result[resultLen++] = new LinePart(pieceEndIndex, tokenType, tokenMetadata, tokenContainsRTL);\n }\n result[resultLen++] = new LinePart(tokenEndIndex, tokenType, tokenMetadata, tokenContainsRTL);\n }\n else {\n result[resultLen++] = token;\n }\n lastTokenEndIndex = tokenEndIndex;\n }\n }\n return result;\n}\nfunction isControlCharacter(charCode) {\n if (charCode < 32) {\n return (charCode !== 9 /* CharCode.Tab */);\n }\n if (charCode === 127) {\n // DEL\n return true;\n }\n if ((charCode >= 0x202A && charCode <= 0x202E)\n || (charCode >= 0x2066 && charCode <= 0x2069)\n || (charCode >= 0x200E && charCode <= 0x200F)\n || charCode === 0x061C) {\n // Unicode Directional Formatting Characters\n // LRE\tU+202A\tLEFT-TO-RIGHT EMBEDDING\n // RLE\tU+202B\tRIGHT-TO-LEFT EMBEDDING\n // PDF\tU+202C\tPOP DIRECTIONAL FORMATTING\n // LRO\tU+202D\tLEFT-TO-RIGHT OVERRIDE\n // RLO\tU+202E\tRIGHT-TO-LEFT OVERRIDE\n // LRI\tU+2066\tLEFT-TO-RIGHT ISOLATE\n // RLI\tU+2067\tRIGHT-TO-LEFT ISOLATE\n // FSI\tU+2068\tFIRST STRONG ISOLATE\n // PDI\tU+2069\tPOP DIRECTIONAL ISOLATE\n // LRM\tU+200E\tLEFT-TO-RIGHT MARK\n // RLM\tU+200F\tRIGHT-TO-LEFT MARK\n // ALM\tU+061C\tARABIC LETTER MARK\n return true;\n }\n return false;\n}\nfunction extractControlCharacters(lineContent, tokens) {\n const result = [];\n let lastLinePart = new LinePart(0, '', 0, false);\n let charOffset = 0;\n for (const token of tokens) {\n const tokenEndIndex = token.endIndex;\n for (; charOffset < tokenEndIndex; charOffset++) {\n const charCode = lineContent.charCodeAt(charOffset);\n if (isControlCharacter(charCode)) {\n if (charOffset > lastLinePart.endIndex) {\n // emit previous part if it has text\n lastLinePart = new LinePart(charOffset, token.type, token.metadata, token.containsRTL);\n result.push(lastLinePart);\n }\n lastLinePart = new LinePart(charOffset + 1, 'mtkcontrol', token.metadata, false);\n result.push(lastLinePart);\n }\n }\n if (charOffset > lastLinePart.endIndex) {\n // emit previous part if it has text\n lastLinePart = new LinePart(tokenEndIndex, token.type, token.metadata, token.containsRTL);\n result.push(lastLinePart);\n }\n }\n return result;\n}\n/**\n * Whitespace is rendered by \"replacing\" tokens with a special-purpose `mtkw` type that is later recognized in the rendering phase.\n * Moreover, a token is created for every visual indent because on some fonts the glyphs used for rendering whitespace (→ or ·) do not have the same width as  .\n * The rendering phase will generate `style=\"width:...\"` for these tokens.\n */\nfunction _applyRenderWhitespace(input, lineContent, len, tokens) {\n const continuesWithWrappedLine = input.continuesWithWrappedLine;\n const fauxIndentLength = input.fauxIndentLength;\n const tabSize = input.tabSize;\n const startVisibleColumn = input.startVisibleColumn;\n const useMonospaceOptimizations = input.useMonospaceOptimizations;\n const selections = input.selectionsOnLine;\n const onlyBoundary = (input.renderWhitespace === 1 /* RenderWhitespace.Boundary */);\n const onlyTrailing = (input.renderWhitespace === 3 /* RenderWhitespace.Trailing */);\n const generateLinePartForEachWhitespace = (input.renderSpaceWidth !== input.spaceWidth);\n const result = [];\n let resultLen = 0;\n let tokenIndex = 0;\n let tokenType = tokens[tokenIndex].type;\n let tokenContainsRTL = tokens[tokenIndex].containsRTL;\n let tokenEndIndex = tokens[tokenIndex].endIndex;\n const tokensLength = tokens.length;\n let lineIsEmptyOrWhitespace = false;\n let firstNonWhitespaceIndex = strings.firstNonWhitespaceIndex(lineContent);\n let lastNonWhitespaceIndex;\n if (firstNonWhitespaceIndex === -1) {\n lineIsEmptyOrWhitespace = true;\n firstNonWhitespaceIndex = len;\n lastNonWhitespaceIndex = len;\n }\n else {\n lastNonWhitespaceIndex = strings.lastNonWhitespaceIndex(lineContent);\n }\n let wasInWhitespace = false;\n let currentSelectionIndex = 0;\n let currentSelection = selections && selections[currentSelectionIndex];\n let tmpIndent = startVisibleColumn % tabSize;\n for (let charIndex = fauxIndentLength; charIndex < len; charIndex++) {\n const chCode = lineContent.charCodeAt(charIndex);\n if (currentSelection && charIndex >= currentSelection.endOffset) {\n currentSelectionIndex++;\n currentSelection = selections && selections[currentSelectionIndex];\n }\n let isInWhitespace;\n if (charIndex < firstNonWhitespaceIndex || charIndex > lastNonWhitespaceIndex) {\n // in leading or trailing whitespace\n isInWhitespace = true;\n }\n else if (chCode === 9 /* CharCode.Tab */) {\n // a tab character is rendered both in all and boundary cases\n isInWhitespace = true;\n }\n else if (chCode === 32 /* CharCode.Space */) {\n // hit a space character\n if (onlyBoundary) {\n // rendering only boundary whitespace\n if (wasInWhitespace) {\n isInWhitespace = true;\n }\n else {\n const nextChCode = (charIndex + 1 < len ? lineContent.charCodeAt(charIndex + 1) : 0 /* CharCode.Null */);\n isInWhitespace = (nextChCode === 32 /* CharCode.Space */ || nextChCode === 9 /* CharCode.Tab */);\n }\n }\n else {\n isInWhitespace = true;\n }\n }\n else {\n isInWhitespace = false;\n }\n // If rendering whitespace on selection, check that the charIndex falls within a selection\n if (isInWhitespace && selections) {\n isInWhitespace = !!currentSelection && currentSelection.startOffset <= charIndex && currentSelection.endOffset > charIndex;\n }\n // If rendering only trailing whitespace, check that the charIndex points to trailing whitespace.\n if (isInWhitespace && onlyTrailing) {\n isInWhitespace = lineIsEmptyOrWhitespace || charIndex > lastNonWhitespaceIndex;\n }\n if (isInWhitespace && tokenContainsRTL) {\n // If the token contains RTL text, breaking it up into multiple line parts\n // to render whitespace might affect the browser's bidi layout.\n //\n // We render whitespace in such tokens only if the whitespace\n // is the leading or the trailing whitespace of the line,\n // which doesn't affect the browser's bidi layout.\n if (charIndex >= firstNonWhitespaceIndex && charIndex <= lastNonWhitespaceIndex) {\n isInWhitespace = false;\n }\n }\n if (wasInWhitespace) {\n // was in whitespace token\n if (!isInWhitespace || (!useMonospaceOptimizations && tmpIndent >= tabSize)) {\n // leaving whitespace token or entering a new indent\n if (generateLinePartForEachWhitespace) {\n const lastEndIndex = (resultLen > 0 ? result[resultLen - 1].endIndex : fauxIndentLength);\n for (let i = lastEndIndex + 1; i <= charIndex; i++) {\n result[resultLen++] = new LinePart(i, 'mtkw', 1 /* LinePartMetadata.IS_WHITESPACE */, false);\n }\n }\n else {\n result[resultLen++] = new LinePart(charIndex, 'mtkw', 1 /* LinePartMetadata.IS_WHITESPACE */, false);\n }\n tmpIndent = tmpIndent % tabSize;\n }\n }\n else {\n // was in regular token\n if (charIndex === tokenEndIndex || (isInWhitespace && charIndex > fauxIndentLength)) {\n result[resultLen++] = new LinePart(charIndex, tokenType, 0, tokenContainsRTL);\n tmpIndent = tmpIndent % tabSize;\n }\n }\n if (chCode === 9 /* CharCode.Tab */) {\n tmpIndent = tabSize;\n }\n else if (strings.isFullWidthCharacter(chCode)) {\n tmpIndent += 2;\n }\n else {\n tmpIndent++;\n }\n wasInWhitespace = isInWhitespace;\n while (charIndex === tokenEndIndex) {\n tokenIndex++;\n if (tokenIndex < tokensLength) {\n tokenType = tokens[tokenIndex].type;\n tokenContainsRTL = tokens[tokenIndex].containsRTL;\n tokenEndIndex = tokens[tokenIndex].endIndex;\n }\n else {\n break;\n }\n }\n }\n let generateWhitespace = false;\n if (wasInWhitespace) {\n // was in whitespace token\n if (continuesWithWrappedLine && onlyBoundary) {\n const lastCharCode = (len > 0 ? lineContent.charCodeAt(len - 1) : 0 /* CharCode.Null */);\n const prevCharCode = (len > 1 ? lineContent.charCodeAt(len - 2) : 0 /* CharCode.Null */);\n const isSingleTrailingSpace = (lastCharCode === 32 /* CharCode.Space */ && (prevCharCode !== 32 /* CharCode.Space */ && prevCharCode !== 9 /* CharCode.Tab */));\n if (!isSingleTrailingSpace) {\n generateWhitespace = true;\n }\n }\n else {\n generateWhitespace = true;\n }\n }\n if (generateWhitespace) {\n if (generateLinePartForEachWhitespace) {\n const lastEndIndex = (resultLen > 0 ? result[resultLen - 1].endIndex : fauxIndentLength);\n for (let i = lastEndIndex + 1; i <= len; i++) {\n result[resultLen++] = new LinePart(i, 'mtkw', 1 /* LinePartMetadata.IS_WHITESPACE */, false);\n }\n }\n else {\n result[resultLen++] = new LinePart(len, 'mtkw', 1 /* LinePartMetadata.IS_WHITESPACE */, false);\n }\n }\n else {\n result[resultLen++] = new LinePart(len, tokenType, 0, tokenContainsRTL);\n }\n return result;\n}\n/**\n * Inline decorations are \"merged\" on top of tokens.\n * Special care must be taken when multiple inline decorations are at play and they overlap.\n */\nfunction _applyInlineDecorations(lineContent, len, tokens, _lineDecorations) {\n _lineDecorations.sort(LineDecoration.compare);\n const lineDecorations = LineDecorationsNormalizer.normalize(lineContent, _lineDecorations);\n const lineDecorationsLen = lineDecorations.length;\n let lineDecorationIndex = 0;\n const result = [];\n let resultLen = 0;\n let lastResultEndIndex = 0;\n for (let tokenIndex = 0, len = tokens.length; tokenIndex < len; tokenIndex++) {\n const token = tokens[tokenIndex];\n const tokenEndIndex = token.endIndex;\n const tokenType = token.type;\n const tokenMetadata = token.metadata;\n const tokenContainsRTL = token.containsRTL;\n while (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset < tokenEndIndex) {\n const lineDecoration = lineDecorations[lineDecorationIndex];\n if (lineDecoration.startOffset > lastResultEndIndex) {\n lastResultEndIndex = lineDecoration.startOffset;\n result[resultLen++] = new LinePart(lastResultEndIndex, tokenType, tokenMetadata, tokenContainsRTL);\n }\n if (lineDecoration.endOffset + 1 <= tokenEndIndex) {\n // This line decoration ends before this token ends\n lastResultEndIndex = lineDecoration.endOffset + 1;\n result[resultLen++] = new LinePart(lastResultEndIndex, tokenType + ' ' + lineDecoration.className, tokenMetadata | lineDecoration.metadata, tokenContainsRTL);\n lineDecorationIndex++;\n }\n else {\n // This line decoration continues on to the next token\n lastResultEndIndex = tokenEndIndex;\n result[resultLen++] = new LinePart(lastResultEndIndex, tokenType + ' ' + lineDecoration.className, tokenMetadata | lineDecoration.metadata, tokenContainsRTL);\n break;\n }\n }\n if (tokenEndIndex > lastResultEndIndex) {\n lastResultEndIndex = tokenEndIndex;\n result[resultLen++] = new LinePart(lastResultEndIndex, tokenType, tokenMetadata, tokenContainsRTL);\n }\n }\n const lastTokenEndIndex = tokens[tokens.length - 1].endIndex;\n if (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {\n while (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {\n const lineDecoration = lineDecorations[lineDecorationIndex];\n result[resultLen++] = new LinePart(lastResultEndIndex, lineDecoration.className, lineDecoration.metadata, false);\n lineDecorationIndex++;\n }\n }\n return result;\n}\n/**\n * This function is on purpose not split up into multiple functions to allow runtime type inference (i.e. performance reasons).\n * Notice how all the needed data is fully resolved and passed in (i.e. no other calls).\n */\nfunction _renderLine(input, sb) {\n const fontIsMonospace = input.fontIsMonospace;\n const canUseHalfwidthRightwardsArrow = input.canUseHalfwidthRightwardsArrow;\n const containsForeignElements = input.containsForeignElements;\n const lineContent = input.lineContent;\n const len = input.len;\n const isOverflowing = input.isOverflowing;\n const overflowingCharCount = input.overflowingCharCount;\n const parts = input.parts;\n const fauxIndentLength = input.fauxIndentLength;\n const tabSize = input.tabSize;\n const startVisibleColumn = input.startVisibleColumn;\n const containsRTL = input.containsRTL;\n const spaceWidth = input.spaceWidth;\n const renderSpaceCharCode = input.renderSpaceCharCode;\n const renderWhitespace = input.renderWhitespace;\n const renderControlCharacters = input.renderControlCharacters;\n const characterMapping = new CharacterMapping(len + 1, parts.length);\n let lastCharacterMappingDefined = false;\n let charIndex = 0;\n let visibleColumn = startVisibleColumn;\n let charOffsetInPart = 0; // the character offset in the current part\n let charHorizontalOffset = 0; // the character horizontal position in terms of chars relative to line start\n let partDisplacement = 0;\n if (containsRTL) {\n sb.appendString('');\n }\n else {\n sb.appendString('');\n }\n for (let partIndex = 0, tokensLen = parts.length; partIndex < tokensLen; partIndex++) {\n const part = parts[partIndex];\n const partEndIndex = part.endIndex;\n const partType = part.type;\n const partContainsRTL = part.containsRTL;\n const partRendersWhitespace = (renderWhitespace !== 0 /* RenderWhitespace.None */ && part.isWhitespace());\n const partRendersWhitespaceWithWidth = partRendersWhitespace && !fontIsMonospace && (partType === 'mtkw' /*only whitespace*/ || !containsForeignElements);\n const partIsEmptyAndHasPseudoAfter = (charIndex === partEndIndex && part.isPseudoAfter());\n charOffsetInPart = 0;\n sb.appendString('= fauxIndentLength) {\n _visibleColumn += charWidth;\n }\n }\n }\n if (partRendersWhitespaceWithWidth) {\n sb.appendString(' style=\"width:');\n sb.appendString(String(spaceWidth * partWidth));\n sb.appendString('px\"');\n }\n sb.appendASCIICharCode(62 /* CharCode.GreaterThan */);\n for (; charIndex < partEndIndex; charIndex++) {\n characterMapping.setColumnInfo(charIndex + 1, partIndex - partDisplacement, charOffsetInPart, charHorizontalOffset);\n partDisplacement = 0;\n const charCode = lineContent.charCodeAt(charIndex);\n let producedCharacters;\n let charWidth;\n if (charCode === 9 /* CharCode.Tab */) {\n producedCharacters = (tabSize - (visibleColumn % tabSize)) | 0;\n charWidth = producedCharacters;\n if (!canUseHalfwidthRightwardsArrow || charWidth > 1) {\n sb.appendCharCode(0x2192); // RIGHTWARDS ARROW\n }\n else {\n sb.appendCharCode(0xFFEB); // HALFWIDTH RIGHTWARDS ARROW\n }\n for (let space = 2; space <= charWidth; space++) {\n sb.appendCharCode(0xA0); //  \n }\n }\n else { // must be CharCode.Space\n producedCharacters = 2;\n charWidth = 1;\n sb.appendCharCode(renderSpaceCharCode); // · or word separator middle dot\n sb.appendCharCode(0x200C); // ZERO WIDTH NON-JOINER\n }\n charOffsetInPart += producedCharacters;\n charHorizontalOffset += charWidth;\n if (charIndex >= fauxIndentLength) {\n visibleColumn += charWidth;\n }\n }\n }\n else {\n sb.appendASCIICharCode(62 /* CharCode.GreaterThan */);\n for (; charIndex < partEndIndex; charIndex++) {\n characterMapping.setColumnInfo(charIndex + 1, partIndex - partDisplacement, charOffsetInPart, charHorizontalOffset);\n partDisplacement = 0;\n const charCode = lineContent.charCodeAt(charIndex);\n let producedCharacters = 1;\n let charWidth = 1;\n switch (charCode) {\n case 9 /* CharCode.Tab */:\n producedCharacters = (tabSize - (visibleColumn % tabSize));\n charWidth = producedCharacters;\n for (let space = 1; space <= producedCharacters; space++) {\n sb.appendCharCode(0xA0); //  \n }\n break;\n case 32 /* CharCode.Space */:\n sb.appendCharCode(0xA0); //  \n break;\n case 60 /* CharCode.LessThan */:\n sb.appendString('<');\n break;\n case 62 /* CharCode.GreaterThan */:\n sb.appendString('>');\n break;\n case 38 /* CharCode.Ampersand */:\n sb.appendString('&');\n break;\n case 0 /* CharCode.Null */:\n if (renderControlCharacters) {\n // See https://unicode-table.com/en/blocks/control-pictures/\n sb.appendCharCode(9216);\n }\n else {\n sb.appendString('�');\n }\n break;\n case 65279 /* CharCode.UTF8_BOM */:\n case 8232 /* CharCode.LINE_SEPARATOR */:\n case 8233 /* CharCode.PARAGRAPH_SEPARATOR */:\n case 133 /* CharCode.NEXT_LINE */:\n sb.appendCharCode(0xFFFD);\n break;\n default:\n if (strings.isFullWidthCharacter(charCode)) {\n charWidth++;\n }\n // See https://unicode-table.com/en/blocks/control-pictures/\n if (renderControlCharacters && charCode < 32) {\n sb.appendCharCode(9216 + charCode);\n }\n else if (renderControlCharacters && charCode === 127) {\n // DEL\n sb.appendCharCode(9249);\n }\n else if (renderControlCharacters && isControlCharacter(charCode)) {\n sb.appendString('[U+');\n sb.appendString(to4CharHex(charCode));\n sb.appendString(']');\n producedCharacters = 8;\n charWidth = producedCharacters;\n }\n else {\n sb.appendCharCode(charCode);\n }\n }\n charOffsetInPart += producedCharacters;\n charHorizontalOffset += charWidth;\n if (charIndex >= fauxIndentLength) {\n visibleColumn += charWidth;\n }\n }\n }\n if (partIsEmptyAndHasPseudoAfter) {\n partDisplacement++;\n }\n else {\n partDisplacement = 0;\n }\n if (charIndex >= len && !lastCharacterMappingDefined && part.isPseudoAfter()) {\n lastCharacterMappingDefined = true;\n characterMapping.setColumnInfo(charIndex + 1, partIndex, charOffsetInPart, charHorizontalOffset);\n }\n sb.appendString('');\n }\n if (!lastCharacterMappingDefined) {\n // When getting client rects for the last character, we will position the\n // text range at the end of the span, insteaf of at the beginning of next span\n characterMapping.setColumnInfo(len + 1, parts.length - 1, charOffsetInPart, charHorizontalOffset);\n }\n if (isOverflowing) {\n sb.appendString('');\n sb.appendString(nls.localize('showMore', \"Show more ({0})\", renderOverflowingCharCount(overflowingCharCount)));\n sb.appendString('');\n }\n sb.appendString('');\n return new RenderLineOutput(characterMapping, containsRTL, containsForeignElements);\n}\nfunction to4CharHex(n) {\n return n.toString(16).toUpperCase().padStart(4, '0');\n}\nfunction renderOverflowingCharCount(n) {\n if (n < 1024) {\n return nls.localize('overflow.chars', \"{0} chars\", n);\n }\n if (n < 1024 * 1024) {\n return `${(n / 1024).toFixed(1)} KB`;\n }\n return `${(n / 1024 / 1024).toFixed(1)} MB`;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as arrays from '../../base/common/arrays.js';\nimport * as strings from '../../base/common/strings.js';\nimport { Range } from './core/range.js';\nexport class Viewport {\n constructor(top, left, width, height) {\n this._viewportBrand = undefined;\n this.top = top | 0;\n this.left = left | 0;\n this.width = width | 0;\n this.height = height | 0;\n }\n}\nexport class MinimapLinesRenderingData {\n constructor(tabSize, data) {\n this.tabSize = tabSize;\n this.data = data;\n }\n}\nexport class ViewLineData {\n constructor(content, continuesWithWrappedLine, minColumn, maxColumn, startVisibleColumn, tokens, inlineDecorations) {\n this._viewLineDataBrand = undefined;\n this.content = content;\n this.continuesWithWrappedLine = continuesWithWrappedLine;\n this.minColumn = minColumn;\n this.maxColumn = maxColumn;\n this.startVisibleColumn = startVisibleColumn;\n this.tokens = tokens;\n this.inlineDecorations = inlineDecorations;\n }\n}\nexport class ViewLineRenderingData {\n constructor(minColumn, maxColumn, content, continuesWithWrappedLine, mightContainRTL, mightContainNonBasicASCII, tokens, inlineDecorations, tabSize, startVisibleColumn) {\n this.minColumn = minColumn;\n this.maxColumn = maxColumn;\n this.content = content;\n this.continuesWithWrappedLine = continuesWithWrappedLine;\n this.isBasicASCII = ViewLineRenderingData.isBasicASCII(content, mightContainNonBasicASCII);\n this.containsRTL = ViewLineRenderingData.containsRTL(content, this.isBasicASCII, mightContainRTL);\n this.tokens = tokens;\n this.inlineDecorations = inlineDecorations;\n this.tabSize = tabSize;\n this.startVisibleColumn = startVisibleColumn;\n }\n static isBasicASCII(lineContent, mightContainNonBasicASCII) {\n if (mightContainNonBasicASCII) {\n return strings.isBasicASCII(lineContent);\n }\n return true;\n }\n static containsRTL(lineContent, isBasicASCII, mightContainRTL) {\n if (!isBasicASCII && mightContainRTL) {\n return strings.containsRTL(lineContent);\n }\n return false;\n }\n}\nexport class InlineDecoration {\n constructor(range, inlineClassName, type) {\n this.range = range;\n this.inlineClassName = inlineClassName;\n this.type = type;\n }\n}\nexport class SingleLineInlineDecoration {\n constructor(startOffset, endOffset, inlineClassName, inlineClassNameAffectsLetterSpacing) {\n this.startOffset = startOffset;\n this.endOffset = endOffset;\n this.inlineClassName = inlineClassName;\n this.inlineClassNameAffectsLetterSpacing = inlineClassNameAffectsLetterSpacing;\n }\n toInlineDecoration(lineNumber) {\n return new InlineDecoration(new Range(lineNumber, this.startOffset + 1, lineNumber, this.endOffset + 1), this.inlineClassName, this.inlineClassNameAffectsLetterSpacing ? 3 /* InlineDecorationType.RegularAffectingLetterSpacing */ : 0 /* InlineDecorationType.Regular */);\n }\n}\nexport class ViewModelDecoration {\n constructor(range, options) {\n this._viewModelDecorationBrand = undefined;\n this.range = range;\n this.options = options;\n }\n}\nexport class OverviewRulerDecorationsGroup {\n constructor(color, zIndex, \n /**\n * Decorations are encoded in a number array using the following scheme:\n * - 3*i = lane\n * - 3*i+1 = startLineNumber\n * - 3*i+2 = endLineNumber\n */\n data) {\n this.color = color;\n this.zIndex = zIndex;\n this.data = data;\n }\n static compareByRenderingProps(a, b) {\n if (a.zIndex === b.zIndex) {\n if (a.color < b.color) {\n return -1;\n }\n if (a.color > b.color) {\n return 1;\n }\n return 0;\n }\n return a.zIndex - b.zIndex;\n }\n static equals(a, b) {\n return (a.color === b.color\n && a.zIndex === b.zIndex\n && arrays.equals(a.data, b.data));\n }\n static equalsArr(a, b) {\n return arrays.equals(a, b, OverviewRulerDecorationsGroup.equals);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport function isFuzzyActionArr(what) {\n return (Array.isArray(what));\n}\nexport function isFuzzyAction(what) {\n return !isFuzzyActionArr(what);\n}\nexport function isString(what) {\n return (typeof what === 'string');\n}\nexport function isIAction(what) {\n return !isString(what);\n}\n// Small helper functions\n/**\n * Is a string null, undefined, or empty?\n */\nexport function empty(s) {\n return (s ? false : true);\n}\n/**\n * Puts a string to lower case if 'ignoreCase' is set.\n */\nexport function fixCase(lexer, str) {\n return (lexer.ignoreCase && str ? str.toLowerCase() : str);\n}\n/**\n * Ensures there are no bad characters in a CSS token class.\n */\nexport function sanitize(s) {\n return s.replace(/[&<>'\"_]/g, '-'); // used on all output token CSS classes\n}\n// Logging\n/**\n * Logs a message.\n */\nexport function log(lexer, msg) {\n console.log(`${lexer.languageId}: ${msg}`);\n}\n// Throwing errors\nexport function createError(lexer, msg) {\n return new Error(`${lexer.languageId}: ${msg}`);\n}\n// Helper functions for rule finding and substitution\n/**\n * substituteMatches is used on lexer strings and can substitutes predefined patterns:\n * \t\t$$ => $\n * \t\t$# => id\n * \t\t$n => matched entry n\n * \t\t@attr => contents of lexer[attr]\n *\n * See documentation for more info\n */\nexport function substituteMatches(lexer, str, id, matches, state) {\n const re = /\\$((\\$)|(#)|(\\d\\d?)|[sS](\\d\\d?)|@(\\w+))/g;\n let stateMatches = null;\n return str.replace(re, function (full, sub, dollar, hash, n, s, attr, ofs, total) {\n if (!empty(dollar)) {\n return '$'; // $$\n }\n if (!empty(hash)) {\n return fixCase(lexer, id); // default $#\n }\n if (!empty(n) && n < matches.length) {\n return fixCase(lexer, matches[n]); // $n\n }\n if (!empty(attr) && lexer && typeof (lexer[attr]) === 'string') {\n return lexer[attr]; //@attribute\n }\n if (stateMatches === null) { // split state on demand\n stateMatches = state.split('.');\n stateMatches.unshift(state);\n }\n if (!empty(s) && s < stateMatches.length) {\n return fixCase(lexer, stateMatches[s]); //$Sn\n }\n return '';\n });\n}\n/**\n * Find the tokenizer rules for a specific state (i.e. next action)\n */\nexport function findRules(lexer, inState) {\n let state = inState;\n while (state && state.length > 0) {\n const rules = lexer.tokenizer[state];\n if (rules) {\n return rules;\n }\n const idx = state.lastIndexOf('.');\n if (idx < 0) {\n state = null; // no further parent\n }\n else {\n state = state.substr(0, idx);\n }\n }\n return null;\n}\n/**\n * Is a certain state defined? In contrast to 'findRules' this works on a ILexerMin.\n * This is used during compilation where we may know the defined states\n * but not yet whether the corresponding rules are correct.\n */\nexport function stateExists(lexer, inState) {\n let state = inState;\n while (state && state.length > 0) {\n const exist = lexer.stateNames[state];\n if (exist) {\n return true;\n }\n const idx = state.lastIndexOf('.');\n if (idx < 0) {\n state = null; // no further parent\n }\n else {\n state = state.substr(0, idx);\n }\n }\n return false;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar MonarchTokenizer_1;\n/**\n * Create a syntax highighter with a fully declarative JSON style lexer description\n * using regular expressions.\n */\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport * as languages from '../../../common/languages.js';\nimport { NullState, nullTokenizeEncoded, nullTokenize } from '../../../common/languages/nullTokenize.js';\nimport * as monarchCommon from './monarchCommon.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nconst CACHE_STACK_DEPTH = 5;\n/**\n * Reuse the same stack elements up to a certain depth.\n */\nclass MonarchStackElementFactory {\n static create(parent, state) {\n return this._INSTANCE.create(parent, state);\n }\n constructor(maxCacheDepth) {\n this._maxCacheDepth = maxCacheDepth;\n this._entries = Object.create(null);\n }\n create(parent, state) {\n if (parent !== null && parent.depth >= this._maxCacheDepth) {\n // no caching above a certain depth\n return new MonarchStackElement(parent, state);\n }\n let stackElementId = MonarchStackElement.getStackElementId(parent);\n if (stackElementId.length > 0) {\n stackElementId += '|';\n }\n stackElementId += state;\n let result = this._entries[stackElementId];\n if (result) {\n return result;\n }\n result = new MonarchStackElement(parent, state);\n this._entries[stackElementId] = result;\n return result;\n }\n}\nMonarchStackElementFactory._INSTANCE = new MonarchStackElementFactory(CACHE_STACK_DEPTH);\nclass MonarchStackElement {\n constructor(parent, state) {\n this.parent = parent;\n this.state = state;\n this.depth = (this.parent ? this.parent.depth : 0) + 1;\n }\n static getStackElementId(element) {\n let result = '';\n while (element !== null) {\n if (result.length > 0) {\n result += '|';\n }\n result += element.state;\n element = element.parent;\n }\n return result;\n }\n static _equals(a, b) {\n while (a !== null && b !== null) {\n if (a === b) {\n return true;\n }\n if (a.state !== b.state) {\n return false;\n }\n a = a.parent;\n b = b.parent;\n }\n if (a === null && b === null) {\n return true;\n }\n return false;\n }\n equals(other) {\n return MonarchStackElement._equals(this, other);\n }\n push(state) {\n return MonarchStackElementFactory.create(this, state);\n }\n pop() {\n return this.parent;\n }\n popall() {\n let result = this;\n while (result.parent) {\n result = result.parent;\n }\n return result;\n }\n switchTo(state) {\n return MonarchStackElementFactory.create(this.parent, state);\n }\n}\nclass EmbeddedLanguageData {\n constructor(languageId, state) {\n this.languageId = languageId;\n this.state = state;\n }\n equals(other) {\n return (this.languageId === other.languageId\n && this.state.equals(other.state));\n }\n clone() {\n const stateClone = this.state.clone();\n // save an object\n if (stateClone === this.state) {\n return this;\n }\n return new EmbeddedLanguageData(this.languageId, this.state);\n }\n}\n/**\n * Reuse the same line states up to a certain depth.\n */\nclass MonarchLineStateFactory {\n static create(stack, embeddedLanguageData) {\n return this._INSTANCE.create(stack, embeddedLanguageData);\n }\n constructor(maxCacheDepth) {\n this._maxCacheDepth = maxCacheDepth;\n this._entries = Object.create(null);\n }\n create(stack, embeddedLanguageData) {\n if (embeddedLanguageData !== null) {\n // no caching when embedding\n return new MonarchLineState(stack, embeddedLanguageData);\n }\n if (stack !== null && stack.depth >= this._maxCacheDepth) {\n // no caching above a certain depth\n return new MonarchLineState(stack, embeddedLanguageData);\n }\n const stackElementId = MonarchStackElement.getStackElementId(stack);\n let result = this._entries[stackElementId];\n if (result) {\n return result;\n }\n result = new MonarchLineState(stack, null);\n this._entries[stackElementId] = result;\n return result;\n }\n}\nMonarchLineStateFactory._INSTANCE = new MonarchLineStateFactory(CACHE_STACK_DEPTH);\nclass MonarchLineState {\n constructor(stack, embeddedLanguageData) {\n this.stack = stack;\n this.embeddedLanguageData = embeddedLanguageData;\n }\n clone() {\n const embeddedlanguageDataClone = this.embeddedLanguageData ? this.embeddedLanguageData.clone() : null;\n // save an object\n if (embeddedlanguageDataClone === this.embeddedLanguageData) {\n return this;\n }\n return MonarchLineStateFactory.create(this.stack, this.embeddedLanguageData);\n }\n equals(other) {\n if (!(other instanceof MonarchLineState)) {\n return false;\n }\n if (!this.stack.equals(other.stack)) {\n return false;\n }\n if (this.embeddedLanguageData === null && other.embeddedLanguageData === null) {\n return true;\n }\n if (this.embeddedLanguageData === null || other.embeddedLanguageData === null) {\n return false;\n }\n return this.embeddedLanguageData.equals(other.embeddedLanguageData);\n }\n}\nclass MonarchClassicTokensCollector {\n constructor() {\n this._tokens = [];\n this._languageId = null;\n this._lastTokenType = null;\n this._lastTokenLanguage = null;\n }\n enterLanguage(languageId) {\n this._languageId = languageId;\n }\n emit(startOffset, type) {\n if (this._lastTokenType === type && this._lastTokenLanguage === this._languageId) {\n return;\n }\n this._lastTokenType = type;\n this._lastTokenLanguage = this._languageId;\n this._tokens.push(new languages.Token(startOffset, type, this._languageId));\n }\n nestedLanguageTokenize(embeddedLanguageLine, hasEOL, embeddedLanguageData, offsetDelta) {\n const nestedLanguageId = embeddedLanguageData.languageId;\n const embeddedModeState = embeddedLanguageData.state;\n const nestedLanguageTokenizationSupport = languages.TokenizationRegistry.get(nestedLanguageId);\n if (!nestedLanguageTokenizationSupport) {\n this.enterLanguage(nestedLanguageId);\n this.emit(offsetDelta, '');\n return embeddedModeState;\n }\n const nestedResult = nestedLanguageTokenizationSupport.tokenize(embeddedLanguageLine, hasEOL, embeddedModeState);\n if (offsetDelta !== 0) {\n for (const token of nestedResult.tokens) {\n this._tokens.push(new languages.Token(token.offset + offsetDelta, token.type, token.language));\n }\n }\n else {\n this._tokens = this._tokens.concat(nestedResult.tokens);\n }\n this._lastTokenType = null;\n this._lastTokenLanguage = null;\n this._languageId = null;\n return nestedResult.endState;\n }\n finalize(endState) {\n return new languages.TokenizationResult(this._tokens, endState);\n }\n}\nclass MonarchModernTokensCollector {\n constructor(languageService, theme) {\n this._languageService = languageService;\n this._theme = theme;\n this._prependTokens = null;\n this._tokens = [];\n this._currentLanguageId = 0 /* LanguageId.Null */;\n this._lastTokenMetadata = 0;\n }\n enterLanguage(languageId) {\n this._currentLanguageId = this._languageService.languageIdCodec.encodeLanguageId(languageId);\n }\n emit(startOffset, type) {\n const metadata = this._theme.match(this._currentLanguageId, type) | 1024 /* MetadataConsts.BALANCED_BRACKETS_MASK */;\n if (this._lastTokenMetadata === metadata) {\n return;\n }\n this._lastTokenMetadata = metadata;\n this._tokens.push(startOffset);\n this._tokens.push(metadata);\n }\n static _merge(a, b, c) {\n const aLen = (a !== null ? a.length : 0);\n const bLen = b.length;\n const cLen = (c !== null ? c.length : 0);\n if (aLen === 0 && bLen === 0 && cLen === 0) {\n return new Uint32Array(0);\n }\n if (aLen === 0 && bLen === 0) {\n return c;\n }\n if (bLen === 0 && cLen === 0) {\n return a;\n }\n const result = new Uint32Array(aLen + bLen + cLen);\n if (a !== null) {\n result.set(a);\n }\n for (let i = 0; i < bLen; i++) {\n result[aLen + i] = b[i];\n }\n if (c !== null) {\n result.set(c, aLen + bLen);\n }\n return result;\n }\n nestedLanguageTokenize(embeddedLanguageLine, hasEOL, embeddedLanguageData, offsetDelta) {\n const nestedLanguageId = embeddedLanguageData.languageId;\n const embeddedModeState = embeddedLanguageData.state;\n const nestedLanguageTokenizationSupport = languages.TokenizationRegistry.get(nestedLanguageId);\n if (!nestedLanguageTokenizationSupport) {\n this.enterLanguage(nestedLanguageId);\n this.emit(offsetDelta, '');\n return embeddedModeState;\n }\n const nestedResult = nestedLanguageTokenizationSupport.tokenizeEncoded(embeddedLanguageLine, hasEOL, embeddedModeState);\n if (offsetDelta !== 0) {\n for (let i = 0, len = nestedResult.tokens.length; i < len; i += 2) {\n nestedResult.tokens[i] += offsetDelta;\n }\n }\n this._prependTokens = MonarchModernTokensCollector._merge(this._prependTokens, this._tokens, nestedResult.tokens);\n this._tokens = [];\n this._currentLanguageId = 0;\n this._lastTokenMetadata = 0;\n return nestedResult.endState;\n }\n finalize(endState) {\n return new languages.EncodedTokenizationResult(MonarchModernTokensCollector._merge(this._prependTokens, this._tokens, null), endState);\n }\n}\nlet MonarchTokenizer = MonarchTokenizer_1 = class MonarchTokenizer extends Disposable {\n constructor(languageService, standaloneThemeService, languageId, lexer, _configurationService) {\n super();\n this._configurationService = _configurationService;\n this._languageService = languageService;\n this._standaloneThemeService = standaloneThemeService;\n this._languageId = languageId;\n this._lexer = lexer;\n this._embeddedLanguages = Object.create(null);\n this.embeddedLoaded = Promise.resolve(undefined);\n // Set up listening for embedded modes\n let emitting = false;\n this._register(languages.TokenizationRegistry.onDidChange((e) => {\n if (emitting) {\n return;\n }\n let isOneOfMyEmbeddedModes = false;\n for (let i = 0, len = e.changedLanguages.length; i < len; i++) {\n const language = e.changedLanguages[i];\n if (this._embeddedLanguages[language]) {\n isOneOfMyEmbeddedModes = true;\n break;\n }\n }\n if (isOneOfMyEmbeddedModes) {\n emitting = true;\n languages.TokenizationRegistry.handleChange([this._languageId]);\n emitting = false;\n }\n }));\n this._maxTokenizationLineLength = this._configurationService.getValue('editor.maxTokenizationLineLength', {\n overrideIdentifier: this._languageId\n });\n this._register(this._configurationService.onDidChangeConfiguration(e => {\n if (e.affectsConfiguration('editor.maxTokenizationLineLength')) {\n this._maxTokenizationLineLength = this._configurationService.getValue('editor.maxTokenizationLineLength', {\n overrideIdentifier: this._languageId\n });\n }\n }));\n }\n getLoadStatus() {\n const promises = [];\n for (const nestedLanguageId in this._embeddedLanguages) {\n const tokenizationSupport = languages.TokenizationRegistry.get(nestedLanguageId);\n if (tokenizationSupport) {\n // The nested language is already loaded\n if (tokenizationSupport instanceof MonarchTokenizer_1) {\n const nestedModeStatus = tokenizationSupport.getLoadStatus();\n if (nestedModeStatus.loaded === false) {\n promises.push(nestedModeStatus.promise);\n }\n }\n continue;\n }\n if (!languages.TokenizationRegistry.isResolved(nestedLanguageId)) {\n // The nested language is in the process of being loaded\n promises.push(languages.TokenizationRegistry.getOrCreate(nestedLanguageId));\n }\n }\n if (promises.length === 0) {\n return {\n loaded: true\n };\n }\n return {\n loaded: false,\n promise: Promise.all(promises).then(_ => undefined)\n };\n }\n getInitialState() {\n const rootState = MonarchStackElementFactory.create(null, this._lexer.start);\n return MonarchLineStateFactory.create(rootState, null);\n }\n tokenize(line, hasEOL, lineState) {\n if (line.length >= this._maxTokenizationLineLength) {\n return nullTokenize(this._languageId, lineState);\n }\n const tokensCollector = new MonarchClassicTokensCollector();\n const endLineState = this._tokenize(line, hasEOL, lineState, tokensCollector);\n return tokensCollector.finalize(endLineState);\n }\n tokenizeEncoded(line, hasEOL, lineState) {\n if (line.length >= this._maxTokenizationLineLength) {\n return nullTokenizeEncoded(this._languageService.languageIdCodec.encodeLanguageId(this._languageId), lineState);\n }\n const tokensCollector = new MonarchModernTokensCollector(this._languageService, this._standaloneThemeService.getColorTheme().tokenTheme);\n const endLineState = this._tokenize(line, hasEOL, lineState, tokensCollector);\n return tokensCollector.finalize(endLineState);\n }\n _tokenize(line, hasEOL, lineState, collector) {\n if (lineState.embeddedLanguageData) {\n return this._nestedTokenize(line, hasEOL, lineState, 0, collector);\n }\n else {\n return this._myTokenize(line, hasEOL, lineState, 0, collector);\n }\n }\n _findLeavingNestedLanguageOffset(line, state) {\n let rules = this._lexer.tokenizer[state.stack.state];\n if (!rules) {\n rules = monarchCommon.findRules(this._lexer, state.stack.state); // do parent matching\n if (!rules) {\n throw monarchCommon.createError(this._lexer, 'tokenizer state is not defined: ' + state.stack.state);\n }\n }\n let popOffset = -1;\n let hasEmbeddedPopRule = false;\n for (const rule of rules) {\n if (!monarchCommon.isIAction(rule.action) || rule.action.nextEmbedded !== '@pop') {\n continue;\n }\n hasEmbeddedPopRule = true;\n let regex = rule.regex;\n const regexSource = rule.regex.source;\n if (regexSource.substr(0, 4) === '^(?:' && regexSource.substr(regexSource.length - 1, 1) === ')') {\n const flags = (regex.ignoreCase ? 'i' : '') + (regex.unicode ? 'u' : '');\n regex = new RegExp(regexSource.substr(4, regexSource.length - 5), flags);\n }\n const result = line.search(regex);\n if (result === -1 || (result !== 0 && rule.matchOnlyAtLineStart)) {\n continue;\n }\n if (popOffset === -1 || result < popOffset) {\n popOffset = result;\n }\n }\n if (!hasEmbeddedPopRule) {\n throw monarchCommon.createError(this._lexer, 'no rule containing nextEmbedded: \"@pop\" in tokenizer embedded state: ' + state.stack.state);\n }\n return popOffset;\n }\n _nestedTokenize(line, hasEOL, lineState, offsetDelta, tokensCollector) {\n const popOffset = this._findLeavingNestedLanguageOffset(line, lineState);\n if (popOffset === -1) {\n // tokenization will not leave nested language\n const nestedEndState = tokensCollector.nestedLanguageTokenize(line, hasEOL, lineState.embeddedLanguageData, offsetDelta);\n return MonarchLineStateFactory.create(lineState.stack, new EmbeddedLanguageData(lineState.embeddedLanguageData.languageId, nestedEndState));\n }\n const nestedLanguageLine = line.substring(0, popOffset);\n if (nestedLanguageLine.length > 0) {\n // tokenize with the nested language\n tokensCollector.nestedLanguageTokenize(nestedLanguageLine, false, lineState.embeddedLanguageData, offsetDelta);\n }\n const restOfTheLine = line.substring(popOffset);\n return this._myTokenize(restOfTheLine, hasEOL, lineState, offsetDelta + popOffset, tokensCollector);\n }\n _safeRuleName(rule) {\n if (rule) {\n return rule.name;\n }\n return '(unknown)';\n }\n _myTokenize(lineWithoutLF, hasEOL, lineState, offsetDelta, tokensCollector) {\n tokensCollector.enterLanguage(this._languageId);\n const lineWithoutLFLength = lineWithoutLF.length;\n const line = (hasEOL && this._lexer.includeLF ? lineWithoutLF + '\\n' : lineWithoutLF);\n const lineLength = line.length;\n let embeddedLanguageData = lineState.embeddedLanguageData;\n let stack = lineState.stack;\n let pos = 0;\n let groupMatching = null;\n // See https://github.com/microsoft/monaco-editor/issues/1235\n // Evaluate rules at least once for an empty line\n let forceEvaluation = true;\n while (forceEvaluation || pos < lineLength) {\n const pos0 = pos;\n const stackLen0 = stack.depth;\n const groupLen0 = groupMatching ? groupMatching.groups.length : 0;\n const state = stack.state;\n let matches = null;\n let matched = null;\n let action = null;\n let rule = null;\n let enteringEmbeddedLanguage = null;\n // check if we need to process group matches first\n if (groupMatching) {\n matches = groupMatching.matches;\n const groupEntry = groupMatching.groups.shift();\n matched = groupEntry.matched;\n action = groupEntry.action;\n rule = groupMatching.rule;\n // cleanup if necessary\n if (groupMatching.groups.length === 0) {\n groupMatching = null;\n }\n }\n else {\n // otherwise we match on the token stream\n if (!forceEvaluation && pos >= lineLength) {\n // nothing to do\n break;\n }\n forceEvaluation = false;\n // get the rules for this state\n let rules = this._lexer.tokenizer[state];\n if (!rules) {\n rules = monarchCommon.findRules(this._lexer, state); // do parent matching\n if (!rules) {\n throw monarchCommon.createError(this._lexer, 'tokenizer state is not defined: ' + state);\n }\n }\n // try each rule until we match\n const restOfLine = line.substr(pos);\n for (const rule of rules) {\n if (pos === 0 || !rule.matchOnlyAtLineStart) {\n matches = restOfLine.match(rule.regex);\n if (matches) {\n matched = matches[0];\n action = rule.action;\n break;\n }\n }\n }\n }\n // We matched 'rule' with 'matches' and 'action'\n if (!matches) {\n matches = [''];\n matched = '';\n }\n if (!action) {\n // bad: we didn't match anything, and there is no action to take\n // we need to advance the stream or we get progress trouble\n if (pos < lineLength) {\n matches = [line.charAt(pos)];\n matched = matches[0];\n }\n action = this._lexer.defaultToken;\n }\n if (matched === null) {\n // should never happen, needed for strict null checking\n break;\n }\n // advance stream\n pos += matched.length;\n // maybe call action function (used for 'cases')\n while (monarchCommon.isFuzzyAction(action) && monarchCommon.isIAction(action) && action.test) {\n action = action.test(matched, matches, state, pos === lineLength);\n }\n let result = null;\n // set the result: either a string or an array of actions\n if (typeof action === 'string' || Array.isArray(action)) {\n result = action;\n }\n else if (action.group) {\n result = action.group;\n }\n else if (action.token !== null && action.token !== undefined) {\n // do $n replacements?\n if (action.tokenSubst) {\n result = monarchCommon.substituteMatches(this._lexer, action.token, matched, matches, state);\n }\n else {\n result = action.token;\n }\n // enter embedded language?\n if (action.nextEmbedded) {\n if (action.nextEmbedded === '@pop') {\n if (!embeddedLanguageData) {\n throw monarchCommon.createError(this._lexer, 'cannot pop embedded language if not inside one');\n }\n embeddedLanguageData = null;\n }\n else if (embeddedLanguageData) {\n throw monarchCommon.createError(this._lexer, 'cannot enter embedded language from within an embedded language');\n }\n else {\n enteringEmbeddedLanguage = monarchCommon.substituteMatches(this._lexer, action.nextEmbedded, matched, matches, state);\n }\n }\n // state transformations\n if (action.goBack) { // back up the stream..\n pos = Math.max(0, pos - action.goBack);\n }\n if (action.switchTo && typeof action.switchTo === 'string') {\n let nextState = monarchCommon.substituteMatches(this._lexer, action.switchTo, matched, matches, state); // switch state without a push...\n if (nextState[0] === '@') {\n nextState = nextState.substr(1); // peel off starting '@'\n }\n if (!monarchCommon.findRules(this._lexer, nextState)) {\n throw monarchCommon.createError(this._lexer, 'trying to switch to a state \\'' + nextState + '\\' that is undefined in rule: ' + this._safeRuleName(rule));\n }\n else {\n stack = stack.switchTo(nextState);\n }\n }\n else if (action.transform && typeof action.transform === 'function') {\n throw monarchCommon.createError(this._lexer, 'action.transform not supported');\n }\n else if (action.next) {\n if (action.next === '@push') {\n if (stack.depth >= this._lexer.maxStack) {\n throw monarchCommon.createError(this._lexer, 'maximum tokenizer stack size reached: [' +\n stack.state + ',' + stack.parent.state + ',...]');\n }\n else {\n stack = stack.push(state);\n }\n }\n else if (action.next === '@pop') {\n if (stack.depth <= 1) {\n throw monarchCommon.createError(this._lexer, 'trying to pop an empty stack in rule: ' + this._safeRuleName(rule));\n }\n else {\n stack = stack.pop();\n }\n }\n else if (action.next === '@popall') {\n stack = stack.popall();\n }\n else {\n let nextState = monarchCommon.substituteMatches(this._lexer, action.next, matched, matches, state);\n if (nextState[0] === '@') {\n nextState = nextState.substr(1); // peel off starting '@'\n }\n if (!monarchCommon.findRules(this._lexer, nextState)) {\n throw monarchCommon.createError(this._lexer, 'trying to set a next state \\'' + nextState + '\\' that is undefined in rule: ' + this._safeRuleName(rule));\n }\n else {\n stack = stack.push(nextState);\n }\n }\n }\n if (action.log && typeof (action.log) === 'string') {\n monarchCommon.log(this._lexer, this._lexer.languageId + ': ' + monarchCommon.substituteMatches(this._lexer, action.log, matched, matches, state));\n }\n }\n // check result\n if (result === null) {\n throw monarchCommon.createError(this._lexer, 'lexer rule has no well-defined action in rule: ' + this._safeRuleName(rule));\n }\n const computeNewStateForEmbeddedLanguage = (enteringEmbeddedLanguage) => {\n // support language names, mime types, and language ids\n const languageId = (this._languageService.getLanguageIdByLanguageName(enteringEmbeddedLanguage)\n || this._languageService.getLanguageIdByMimeType(enteringEmbeddedLanguage)\n || enteringEmbeddedLanguage);\n const embeddedLanguageData = this._getNestedEmbeddedLanguageData(languageId);\n if (pos < lineLength) {\n // there is content from the embedded language on this line\n const restOfLine = lineWithoutLF.substr(pos);\n return this._nestedTokenize(restOfLine, hasEOL, MonarchLineStateFactory.create(stack, embeddedLanguageData), offsetDelta + pos, tokensCollector);\n }\n else {\n return MonarchLineStateFactory.create(stack, embeddedLanguageData);\n }\n };\n // is the result a group match?\n if (Array.isArray(result)) {\n if (groupMatching && groupMatching.groups.length > 0) {\n throw monarchCommon.createError(this._lexer, 'groups cannot be nested: ' + this._safeRuleName(rule));\n }\n if (matches.length !== result.length + 1) {\n throw monarchCommon.createError(this._lexer, 'matched number of groups does not match the number of actions in rule: ' + this._safeRuleName(rule));\n }\n let totalLen = 0;\n for (let i = 1; i < matches.length; i++) {\n totalLen += matches[i].length;\n }\n if (totalLen !== matched.length) {\n throw monarchCommon.createError(this._lexer, 'with groups, all characters should be matched in consecutive groups in rule: ' + this._safeRuleName(rule));\n }\n groupMatching = {\n rule: rule,\n matches: matches,\n groups: []\n };\n for (let i = 0; i < result.length; i++) {\n groupMatching.groups[i] = {\n action: result[i],\n matched: matches[i + 1]\n };\n }\n pos -= matched.length;\n // call recursively to initiate first result match\n continue;\n }\n else {\n // regular result\n // check for '@rematch'\n if (result === '@rematch') {\n pos -= matched.length;\n matched = ''; // better set the next state too..\n matches = null;\n result = '';\n // Even though `@rematch` was specified, if `nextEmbedded` also specified,\n // a state transition should occur.\n if (enteringEmbeddedLanguage !== null) {\n return computeNewStateForEmbeddedLanguage(enteringEmbeddedLanguage);\n }\n }\n // check progress\n if (matched.length === 0) {\n if (lineLength === 0 || stackLen0 !== stack.depth || state !== stack.state || (!groupMatching ? 0 : groupMatching.groups.length) !== groupLen0) {\n continue;\n }\n else {\n throw monarchCommon.createError(this._lexer, 'no progress in tokenizer in rule: ' + this._safeRuleName(rule));\n }\n }\n // return the result (and check for brace matching)\n // todo: for efficiency we could pre-sanitize tokenPostfix and substitutions\n let tokenType = null;\n if (monarchCommon.isString(result) && result.indexOf('@brackets') === 0) {\n const rest = result.substr('@brackets'.length);\n const bracket = findBracket(this._lexer, matched);\n if (!bracket) {\n throw monarchCommon.createError(this._lexer, '@brackets token returned but no bracket defined as: ' + matched);\n }\n tokenType = monarchCommon.sanitize(bracket.token + rest);\n }\n else {\n const token = (result === '' ? '' : result + this._lexer.tokenPostfix);\n tokenType = monarchCommon.sanitize(token);\n }\n if (pos0 < lineWithoutLFLength) {\n tokensCollector.emit(pos0 + offsetDelta, tokenType);\n }\n }\n if (enteringEmbeddedLanguage !== null) {\n return computeNewStateForEmbeddedLanguage(enteringEmbeddedLanguage);\n }\n }\n return MonarchLineStateFactory.create(stack, embeddedLanguageData);\n }\n _getNestedEmbeddedLanguageData(languageId) {\n if (!this._languageService.isRegisteredLanguageId(languageId)) {\n return new EmbeddedLanguageData(languageId, NullState);\n }\n if (languageId !== this._languageId) {\n // Fire language loading event\n this._languageService.requestBasicLanguageFeatures(languageId);\n languages.TokenizationRegistry.getOrCreate(languageId);\n this._embeddedLanguages[languageId] = true;\n }\n const tokenizationSupport = languages.TokenizationRegistry.get(languageId);\n if (tokenizationSupport) {\n return new EmbeddedLanguageData(languageId, tokenizationSupport.getInitialState());\n }\n return new EmbeddedLanguageData(languageId, NullState);\n }\n};\nMonarchTokenizer = MonarchTokenizer_1 = __decorate([\n __param(4, IConfigurationService)\n], MonarchTokenizer);\nexport { MonarchTokenizer };\n/**\n * Searches for a bracket in the 'brackets' attribute that matches the input.\n */\nfunction findBracket(lexer, matched) {\n if (!matched) {\n return null;\n }\n matched = monarchCommon.fixCase(lexer, matched);\n const brackets = lexer.brackets;\n for (const bracket of brackets) {\n if (bracket.open === matched) {\n return { token: bracket.token, bracketType: 1 /* monarchCommon.MonarchBracket.Open */ };\n }\n else if (bracket.close === matched) {\n return { token: bracket.token, bracketType: -1 /* monarchCommon.MonarchBracket.Close */ };\n }\n }\n return null;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { createTrustedTypesPolicy } from '../../../base/browser/trustedTypes.js';\nimport * as strings from '../../../base/common/strings.js';\nimport { TokenizationRegistry } from '../../common/languages.js';\nimport { LineTokens } from '../../common/tokens/lineTokens.js';\nimport { RenderLineInput, renderViewLine2 as renderViewLine } from '../../common/viewLayout/viewLineRenderer.js';\nimport { ViewLineRenderingData } from '../../common/viewModel.js';\nimport { MonarchTokenizer } from '../common/monarch/monarchLexer.js';\nconst ttPolicy = createTrustedTypesPolicy('standaloneColorizer', { createHTML: value => value });\nexport class Colorizer {\n static colorizeElement(themeService, languageService, domNode, options) {\n options = options || {};\n const theme = options.theme || 'vs';\n const mimeType = options.mimeType || domNode.getAttribute('lang') || domNode.getAttribute('data-lang');\n if (!mimeType) {\n console.error('Mode not detected');\n return Promise.resolve();\n }\n const languageId = languageService.getLanguageIdByMimeType(mimeType) || mimeType;\n themeService.setTheme(theme);\n const text = domNode.firstChild ? domNode.firstChild.nodeValue : '';\n domNode.className += ' ' + theme;\n const render = (str) => {\n var _a;\n const trustedhtml = (_a = ttPolicy === null || ttPolicy === void 0 ? void 0 : ttPolicy.createHTML(str)) !== null && _a !== void 0 ? _a : str;\n domNode.innerHTML = trustedhtml;\n };\n return this.colorize(languageService, text || '', languageId, options).then(render, (err) => console.error(err));\n }\n static async colorize(languageService, text, languageId, options) {\n const languageIdCodec = languageService.languageIdCodec;\n let tabSize = 4;\n if (options && typeof options.tabSize === 'number') {\n tabSize = options.tabSize;\n }\n if (strings.startsWithUTF8BOM(text)) {\n text = text.substr(1);\n }\n const lines = strings.splitLines(text);\n if (!languageService.isRegisteredLanguageId(languageId)) {\n return _fakeColorize(lines, tabSize, languageIdCodec);\n }\n const tokenizationSupport = await TokenizationRegistry.getOrCreate(languageId);\n if (tokenizationSupport) {\n return _colorize(lines, tabSize, tokenizationSupport, languageIdCodec);\n }\n return _fakeColorize(lines, tabSize, languageIdCodec);\n }\n static colorizeLine(line, mightContainNonBasicASCII, mightContainRTL, tokens, tabSize = 4) {\n const isBasicASCII = ViewLineRenderingData.isBasicASCII(line, mightContainNonBasicASCII);\n const containsRTL = ViewLineRenderingData.containsRTL(line, isBasicASCII, mightContainRTL);\n const renderResult = renderViewLine(new RenderLineInput(false, true, line, false, isBasicASCII, containsRTL, 0, tokens, [], tabSize, 0, 0, 0, 0, -1, 'none', false, false, null));\n return renderResult.html;\n }\n static colorizeModelLine(model, lineNumber, tabSize = 4) {\n const content = model.getLineContent(lineNumber);\n model.tokenization.forceTokenization(lineNumber);\n const tokens = model.tokenization.getLineTokens(lineNumber);\n const inflatedTokens = tokens.inflate();\n return this.colorizeLine(content, model.mightContainNonBasicASCII(), model.mightContainRTL(), inflatedTokens, tabSize);\n }\n}\nfunction _colorize(lines, tabSize, tokenizationSupport, languageIdCodec) {\n return new Promise((c, e) => {\n const execute = () => {\n const result = _actualColorize(lines, tabSize, tokenizationSupport, languageIdCodec);\n if (tokenizationSupport instanceof MonarchTokenizer) {\n const status = tokenizationSupport.getLoadStatus();\n if (status.loaded === false) {\n status.promise.then(execute, e);\n return;\n }\n }\n c(result);\n };\n execute();\n });\n}\nfunction _fakeColorize(lines, tabSize, languageIdCodec) {\n let html = [];\n const defaultMetadata = ((0 /* FontStyle.None */ << 11 /* MetadataConsts.FONT_STYLE_OFFSET */)\n | (1 /* ColorId.DefaultForeground */ << 15 /* MetadataConsts.FOREGROUND_OFFSET */)\n | (2 /* ColorId.DefaultBackground */ << 24 /* MetadataConsts.BACKGROUND_OFFSET */)) >>> 0;\n const tokens = new Uint32Array(2);\n tokens[0] = 0;\n tokens[1] = defaultMetadata;\n for (let i = 0, length = lines.length; i < length; i++) {\n const line = lines[i];\n tokens[0] = line.length;\n const lineTokens = new LineTokens(tokens, line, languageIdCodec);\n const isBasicASCII = ViewLineRenderingData.isBasicASCII(line, /* check for basic ASCII */ true);\n const containsRTL = ViewLineRenderingData.containsRTL(line, isBasicASCII, /* check for RTL */ true);\n const renderResult = renderViewLine(new RenderLineInput(false, true, line, false, isBasicASCII, containsRTL, 0, lineTokens, [], tabSize, 0, 0, 0, 0, -1, 'none', false, false, null));\n html = html.concat(renderResult.html);\n html.push('
');\n }\n return html.join('');\n}\nfunction _actualColorize(lines, tabSize, tokenizationSupport, languageIdCodec) {\n let html = [];\n let state = tokenizationSupport.getInitialState();\n for (let i = 0, length = lines.length; i < length; i++) {\n const line = lines[i];\n const tokenizeResult = tokenizationSupport.tokenizeEncoded(line, true, state);\n LineTokens.convertToEndOffset(tokenizeResult.tokens, line.length);\n const lineTokens = new LineTokens(tokenizeResult.tokens, line, languageIdCodec);\n const isBasicASCII = ViewLineRenderingData.isBasicASCII(line, /* check for basic ASCII */ true);\n const containsRTL = ViewLineRenderingData.containsRTL(line, isBasicASCII, /* check for RTL */ true);\n const renderResult = renderViewLine(new RenderLineInput(false, true, line, false, isBasicASCII, containsRTL, 0, lineTokens.inflate(), [], tabSize, 0, 0, 0, 0, -1, 'none', false, false, null));\n html = html.concat(renderResult.html);\n html.push('
');\n state = tokenizeResult.endState;\n }\n return html.join('');\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n.monaco-aria-container {\n\tposition: absolute; /* try to hide from window but not from screen readers */\n\tleft:-999em;\n}", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as dom from '../../dom.js';\nimport './aria.css';\n// Use a max length since we are inserting the whole msg in the DOM and that can cause browsers to freeze for long messages #94233\nconst MAX_MESSAGE_LENGTH = 20000;\nlet ariaContainer;\nlet alertContainer;\nlet alertContainer2;\nlet statusContainer;\nlet statusContainer2;\nexport function setARIAContainer(parent) {\n ariaContainer = document.createElement('div');\n ariaContainer.className = 'monaco-aria-container';\n const createAlertContainer = () => {\n const element = document.createElement('div');\n element.className = 'monaco-alert';\n element.setAttribute('role', 'alert');\n element.setAttribute('aria-atomic', 'true');\n ariaContainer.appendChild(element);\n return element;\n };\n alertContainer = createAlertContainer();\n alertContainer2 = createAlertContainer();\n const createStatusContainer = () => {\n const element = document.createElement('div');\n element.className = 'monaco-status';\n element.setAttribute('aria-live', 'polite');\n element.setAttribute('aria-atomic', 'true');\n ariaContainer.appendChild(element);\n return element;\n };\n statusContainer = createStatusContainer();\n statusContainer2 = createStatusContainer();\n parent.appendChild(ariaContainer);\n}\n/**\n * Given the provided message, will make sure that it is read as alert to screen readers.\n */\nexport function alert(msg) {\n if (!ariaContainer) {\n return;\n }\n // Use alternate containers such that duplicated messages get read out by screen readers #99466\n if (alertContainer.textContent !== msg) {\n dom.clearNode(alertContainer2);\n insertMessage(alertContainer, msg);\n }\n else {\n dom.clearNode(alertContainer);\n insertMessage(alertContainer2, msg);\n }\n}\n/**\n * Given the provided message, will make sure that it is read as status to screen readers.\n */\nexport function status(msg) {\n if (!ariaContainer) {\n return;\n }\n if (statusContainer.textContent !== msg) {\n dom.clearNode(statusContainer2);\n insertMessage(statusContainer, msg);\n }\n else {\n dom.clearNode(statusContainer);\n insertMessage(statusContainer2, msg);\n }\n}\nfunction insertMessage(target, msg) {\n dom.clearNode(target);\n if (msg.length > MAX_MESSAGE_LENGTH) {\n msg = msg.substr(0, MAX_MESSAGE_LENGTH);\n }\n target.textContent = msg;\n // See https://www.paciellogroup.com/blog/2012/06/html5-accessibility-chops-aria-rolealert-browser-support/\n target.style.visibility = 'hidden';\n target.style.visibility = 'visible';\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { createDecorator } from '../../../platform/instantiation/common/instantiation.js';\nexport const IMarkerDecorationsService = createDecorator('markerDecorationsService');\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport { IMarkerDecorationsService } from '../../common/services/markerDecorations.js';\nimport { registerEditorContribution } from '../editorExtensions.js';\nlet MarkerDecorationsContribution = class MarkerDecorationsContribution {\n constructor(_editor, _markerDecorationsService) {\n // Doesn't do anything, just requires `IMarkerDecorationsService` to make sure it gets instantiated\n }\n dispose() {\n }\n};\nMarkerDecorationsContribution.ID = 'editor.contrib.markerDecorations';\nMarkerDecorationsContribution = __decorate([\n __param(1, IMarkerDecorationsService)\n], MarkerDecorationsContribution);\nexport { MarkerDecorationsContribution };\nregisterEditorContribution(MarkerDecorationsContribution.ID, MarkerDecorationsContribution, 0 /* EditorContributionInstantiation.Eager */); // eager because it instantiates IMarkerDecorationsService which is responsible for rendering squiggles\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* -------------------- IE10 remove auto clear button -------------------- */\n\n::-ms-clear {\n\tdisplay: none;\n}\n\n/* All widgets */\n/* I am not a big fan of this rule */\n.monaco-editor .editor-widget input {\n\tcolor: inherit;\n}\n\n/* -------------------- Editor -------------------- */\n\n.monaco-editor {\n\tposition: relative;\n\toverflow: visible;\n\t-webkit-text-size-adjust: 100%;\n\tcolor: var(--vscode-editor-foreground);\n\tbackground-color: var(--vscode-editor-background);\n}\n.monaco-editor-background {\n\tbackground-color: var(--vscode-editor-background);\n}\n.monaco-editor .rangeHighlight {\n\tbackground-color: var(--vscode-editor-rangeHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-rangeHighlightBorder);\n}\n.monaco-editor.hc-black .rangeHighlight, .monaco-editor.hc-light .rangeHighlight {\n\tborder-style: dotted;\n}\n.monaco-editor .symbolHighlight {\n\tbackground-color: var(--vscode-editor-symbolHighlightBackground);\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--vscode-editor-symbolHighlightBorder);\n}\n.monaco-editor.hc-black .symbolHighlight, .monaco-editor.hc-light .symbolHighlight {\n\tborder-style: dotted;\n}\n\n/* -------------------- Misc -------------------- */\n\n.monaco-editor .overflow-guard {\n\tposition: relative;\n\toverflow: hidden;\n}\n\n.monaco-editor .view-overlays {\n\tposition: absolute;\n\ttop: 0;\n}\n\n/*\n.monaco-editor .auto-closed-character {\n\topacity: 0.3;\n}\n*/\n\n\n.monaco-editor .squiggly-error {\n\tborder-bottom: 4px double var(--vscode-editorError-border);\n}\n.monaco-editor .squiggly-error::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorError-background);\n}\n.monaco-editor .squiggly-warning {\n\tborder-bottom: 4px double var(--vscode-editorWarning-border);\n}\n.monaco-editor .squiggly-warning::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorWarning-background);\n}\n.monaco-editor .squiggly-info {\n\tborder-bottom: 4px double var(--vscode-editorInfo-border);\n}\n.monaco-editor .squiggly-info::before {\n\tdisplay: block;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tbackground: var(--vscode-editorInfo-background);\n}\n.monaco-editor .squiggly-hint {\n\tborder-bottom: 2px dotted var(--vscode-editorHint-border);\n}\n.monaco-editor.showUnused .squiggly-unnecessary {\n\tborder-bottom: 2px dashed var(--vscode-editorUnnecessaryCode-border);\n}\n.monaco-editor.showDeprecated .squiggly-inline-deprecated {\n\ttext-decoration: line-through;\n\ttext-decoration-color: var(--vscode-editor-foreground, inherit);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Disposable } from '../../../base/common/lifecycle.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { getWindow, scheduleAtNextAnimationFrame } from '../../../base/browser/dom.js';\nexport class ElementSizeObserver extends Disposable {\n constructor(referenceDomElement, dimension) {\n super();\n this._onDidChange = this._register(new Emitter());\n this.onDidChange = this._onDidChange.event;\n this._referenceDomElement = referenceDomElement;\n this._width = -1;\n this._height = -1;\n this._resizeObserver = null;\n this.measureReferenceDomElement(false, dimension);\n }\n dispose() {\n this.stopObserving();\n super.dispose();\n }\n getWidth() {\n return this._width;\n }\n getHeight() {\n return this._height;\n }\n startObserving() {\n if (!this._resizeObserver && this._referenceDomElement) {\n // We want to react to the resize observer only once per animation frame\n // The first time the resize observer fires, we will react to it immediately.\n // Otherwise we will postpone to the next animation frame.\n // We'll use `observeContentRect` to store the content rect we received.\n let observedDimenstion = null;\n const observeNow = () => {\n if (observedDimenstion) {\n this.observe({ width: observedDimenstion.width, height: observedDimenstion.height });\n }\n else {\n this.observe();\n }\n };\n let shouldObserve = false;\n let alreadyObservedThisAnimationFrame = false;\n const update = () => {\n if (shouldObserve && !alreadyObservedThisAnimationFrame) {\n try {\n shouldObserve = false;\n alreadyObservedThisAnimationFrame = true;\n observeNow();\n }\n finally {\n scheduleAtNextAnimationFrame(getWindow(this._referenceDomElement), () => {\n alreadyObservedThisAnimationFrame = false;\n update();\n });\n }\n }\n };\n this._resizeObserver = new ResizeObserver((entries) => {\n if (entries && entries[0] && entries[0].contentRect) {\n observedDimenstion = { width: entries[0].contentRect.width, height: entries[0].contentRect.height };\n }\n else {\n observedDimenstion = null;\n }\n shouldObserve = true;\n update();\n });\n this._resizeObserver.observe(this._referenceDomElement);\n }\n }\n stopObserving() {\n if (this._resizeObserver) {\n this._resizeObserver.disconnect();\n this._resizeObserver = null;\n }\n }\n observe(dimension) {\n this.measureReferenceDomElement(true, dimension);\n }\n measureReferenceDomElement(emitEvent, dimension) {\n let observedWidth = 0;\n let observedHeight = 0;\n if (dimension) {\n observedWidth = dimension.width;\n observedHeight = dimension.height;\n }\n else if (this._referenceDomElement) {\n observedWidth = this._referenceDomElement.clientWidth;\n observedHeight = this._referenceDomElement.clientHeight;\n }\n observedWidth = Math.max(5, observedWidth);\n observedHeight = Math.max(5, observedHeight);\n if (this._width !== observedWidth || this._height !== observedHeight) {\n this._width = observedWidth;\n this._height = observedHeight;\n if (emitEvent) {\n this._onDidChange.fire();\n }\n }\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class EditorSettingMigration {\n constructor(key, migrate) {\n this.key = key;\n this.migrate = migrate;\n }\n apply(options) {\n const value = EditorSettingMigration._read(options, this.key);\n const read = (key) => EditorSettingMigration._read(options, key);\n const write = (key, value) => EditorSettingMigration._write(options, key, value);\n this.migrate(value, read, write);\n }\n static _read(source, key) {\n if (typeof source === 'undefined') {\n return undefined;\n }\n const firstDotIndex = key.indexOf('.');\n if (firstDotIndex >= 0) {\n const firstSegment = key.substring(0, firstDotIndex);\n return this._read(source[firstSegment], key.substring(firstDotIndex + 1));\n }\n return source[key];\n }\n static _write(target, key, value) {\n const firstDotIndex = key.indexOf('.');\n if (firstDotIndex >= 0) {\n const firstSegment = key.substring(0, firstDotIndex);\n target[firstSegment] = target[firstSegment] || {};\n this._write(target[firstSegment], key.substring(firstDotIndex + 1), value);\n return;\n }\n target[key] = value;\n }\n}\nEditorSettingMigration.items = [];\nfunction registerEditorSettingMigration(key, migrate) {\n EditorSettingMigration.items.push(new EditorSettingMigration(key, migrate));\n}\nfunction registerSimpleEditorSettingMigration(key, values) {\n registerEditorSettingMigration(key, (value, read, write) => {\n if (typeof value !== 'undefined') {\n for (const [oldValue, newValue] of values) {\n if (value === oldValue) {\n write(key, newValue);\n return;\n }\n }\n }\n });\n}\n/**\n * Compatibility with old options\n */\nexport function migrateOptions(options) {\n EditorSettingMigration.items.forEach(migration => migration.apply(options));\n}\nregisterSimpleEditorSettingMigration('wordWrap', [[true, 'on'], [false, 'off']]);\nregisterSimpleEditorSettingMigration('lineNumbers', [[true, 'on'], [false, 'off']]);\nregisterSimpleEditorSettingMigration('cursorBlinking', [['visible', 'solid']]);\nregisterSimpleEditorSettingMigration('renderWhitespace', [[true, 'boundary'], [false, 'none']]);\nregisterSimpleEditorSettingMigration('renderLineHighlight', [[true, 'line'], [false, 'none']]);\nregisterSimpleEditorSettingMigration('acceptSuggestionOnEnter', [[true, 'on'], [false, 'off']]);\nregisterSimpleEditorSettingMigration('tabCompletion', [[false, 'off'], [true, 'onlySnippets']]);\nregisterSimpleEditorSettingMigration('hover', [[true, { enabled: true }], [false, { enabled: false }]]);\nregisterSimpleEditorSettingMigration('parameterHints', [[true, { enabled: true }], [false, { enabled: false }]]);\nregisterSimpleEditorSettingMigration('autoIndent', [[false, 'advanced'], [true, 'full']]);\nregisterSimpleEditorSettingMigration('matchBrackets', [[true, 'always'], [false, 'never']]);\nregisterSimpleEditorSettingMigration('renderFinalNewline', [[true, 'on'], [false, 'off']]);\nregisterSimpleEditorSettingMigration('cursorSmoothCaretAnimation', [[true, 'on'], [false, 'off']]);\nregisterSimpleEditorSettingMigration('occurrencesHighlight', [[true, 'singleFile'], [false, 'off']]);\nregisterSimpleEditorSettingMigration('wordBasedSuggestions', [[true, 'matchingDocuments'], [false, 'off']]);\nregisterEditorSettingMigration('autoClosingBrackets', (value, read, write) => {\n if (value === false) {\n write('autoClosingBrackets', 'never');\n if (typeof read('autoClosingQuotes') === 'undefined') {\n write('autoClosingQuotes', 'never');\n }\n if (typeof read('autoSurround') === 'undefined') {\n write('autoSurround', 'never');\n }\n }\n});\nregisterEditorSettingMigration('renderIndentGuides', (value, read, write) => {\n if (typeof value !== 'undefined') {\n write('renderIndentGuides', undefined);\n if (typeof read('guides.indentation') === 'undefined') {\n write('guides.indentation', !!value);\n }\n }\n});\nregisterEditorSettingMigration('highlightActiveIndentGuide', (value, read, write) => {\n if (typeof value !== 'undefined') {\n write('highlightActiveIndentGuide', undefined);\n if (typeof read('guides.highlightActiveIndentation') === 'undefined') {\n write('guides.highlightActiveIndentation', !!value);\n }\n }\n});\nconst suggestFilteredTypesMapping = {\n method: 'showMethods',\n function: 'showFunctions',\n constructor: 'showConstructors',\n deprecated: 'showDeprecated',\n field: 'showFields',\n variable: 'showVariables',\n class: 'showClasses',\n struct: 'showStructs',\n interface: 'showInterfaces',\n module: 'showModules',\n property: 'showProperties',\n event: 'showEvents',\n operator: 'showOperators',\n unit: 'showUnits',\n value: 'showValues',\n constant: 'showConstants',\n enum: 'showEnums',\n enumMember: 'showEnumMembers',\n keyword: 'showKeywords',\n text: 'showWords',\n color: 'showColors',\n file: 'showFiles',\n reference: 'showReferences',\n folder: 'showFolders',\n typeParameter: 'showTypeParameters',\n snippet: 'showSnippets',\n};\nregisterEditorSettingMigration('suggest.filteredTypes', (value, read, write) => {\n if (value && typeof value === 'object') {\n for (const entry of Object.entries(suggestFilteredTypesMapping)) {\n const v = value[entry[0]];\n if (v === false) {\n if (typeof read(`suggest.${entry[1]}`) === 'undefined') {\n write(`suggest.${entry[1]}`, false);\n }\n }\n }\n write('suggest.filteredTypes', undefined);\n }\n});\nregisterEditorSettingMigration('quickSuggestions', (input, read, write) => {\n if (typeof input === 'boolean') {\n const value = input ? 'on' : 'off';\n const newValue = { comments: value, strings: value, other: value };\n write('quickSuggestions', newValue);\n }\n});\n// Sticky Scroll\nregisterEditorSettingMigration('experimental.stickyScroll.enabled', (value, read, write) => {\n if (typeof value === 'boolean') {\n write('experimental.stickyScroll.enabled', undefined);\n if (typeof read('stickyScroll.enabled') === 'undefined') {\n write('stickyScroll.enabled', value);\n }\n }\n});\nregisterEditorSettingMigration('experimental.stickyScroll.maxLineCount', (value, read, write) => {\n if (typeof value === 'number') {\n write('experimental.stickyScroll.maxLineCount', undefined);\n if (typeof read('stickyScroll.maxLineCount') === 'undefined') {\n write('stickyScroll.maxLineCount', value);\n }\n }\n});\n// Code Actions on Save\nregisterEditorSettingMigration('codeActionsOnSave', (value, read, write) => {\n if (value && typeof value === 'object') {\n let toBeModified = false;\n const newValue = {};\n for (const entry of Object.entries(value)) {\n if (typeof entry[1] === 'boolean') {\n toBeModified = true;\n newValue[entry[0]] = entry[1] ? 'explicit' : 'never';\n }\n else {\n newValue[entry[0]] = entry[1];\n }\n }\n if (toBeModified) {\n write(`codeActionsOnSave`, newValue);\n }\n }\n});\n// Migrate Quick Fix Settings\nregisterEditorSettingMigration('codeActionWidget.includeNearbyQuickfixes', (value, read, write) => {\n if (typeof value === 'boolean') {\n write('codeActionWidget.includeNearbyQuickfixes', undefined);\n if (typeof read('codeActionWidget.includeNearbyQuickFixes') === 'undefined') {\n write('codeActionWidget.includeNearbyQuickFixes', value);\n }\n }\n});\n// Migrate the lightbulb settings\nregisterEditorSettingMigration('lightbulb.enabled', (value, read, write) => {\n if (typeof value === 'boolean') {\n write('lightbulb.enabled', value ? undefined : 'off');\n }\n});\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Emitter } from '../../../base/common/event.js';\nclass TabFocusImpl {\n constructor() {\n this._tabFocus = false;\n this._onDidChangeTabFocus = new Emitter();\n this.onDidChangeTabFocus = this._onDidChangeTabFocus.event;\n }\n getTabFocusMode() {\n return this._tabFocus;\n }\n setTabFocusMode(tabFocusMode) {\n this._tabFocus = tabFocusMode;\n this._onDidChangeTabFocus.fire(this._tabFocus);\n }\n}\n/**\n * Control what pressing Tab does.\n * If it is false, pressing Tab or Shift-Tab will be handled by the editor.\n * If it is true, pressing Tab or Shift-Tab will move the browser focus.\n * Defaults to false.\n */\nexport const TabFocus = new TabFocusImpl();\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { RawContextKey } from '../../contextkey/common/contextkey.js';\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\nexport const IAccessibilityService = createDecorator('accessibilityService');\nexport const CONTEXT_ACCESSIBILITY_MODE_ENABLED = new RawContextKey('accessibilityModeEnabled', false);\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport * as browser from '../../../base/browser/browser.js';\nimport * as arrays from '../../../base/common/arrays.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { Disposable } from '../../../base/common/lifecycle.js';\nimport * as objects from '../../../base/common/objects.js';\nimport * as platform from '../../../base/common/platform.js';\nimport { ElementSizeObserver } from './elementSizeObserver.js';\nimport { FontMeasurements } from './fontMeasurements.js';\nimport { migrateOptions } from './migrateOptions.js';\nimport { TabFocus } from './tabFocus.js';\nimport { ComputeOptionsMemory, ConfigurationChangedEvent, editorOptionsRegistry } from '../../common/config/editorOptions.js';\nimport { EditorZoom } from '../../common/config/editorZoom.js';\nimport { BareFontInfo } from '../../common/config/fontInfo.js';\nimport { IAccessibilityService } from '../../../platform/accessibility/common/accessibility.js';\nlet EditorConfiguration = class EditorConfiguration extends Disposable {\n constructor(isSimpleWidget, options, container, _accessibilityService) {\n super();\n this._accessibilityService = _accessibilityService;\n this._onDidChange = this._register(new Emitter());\n this.onDidChange = this._onDidChange.event;\n this._onDidChangeFast = this._register(new Emitter());\n this.onDidChangeFast = this._onDidChangeFast.event;\n this._isDominatedByLongLines = false;\n this._viewLineCount = 1;\n this._lineNumbersDigitCount = 1;\n this._reservedHeight = 0;\n this._glyphMarginDecorationLaneCount = 1;\n this._computeOptionsMemory = new ComputeOptionsMemory();\n this.isSimpleWidget = isSimpleWidget;\n this._containerObserver = this._register(new ElementSizeObserver(container, options.dimension));\n this._rawOptions = deepCloneAndMigrateOptions(options);\n this._validatedOptions = EditorOptionsUtil.validateOptions(this._rawOptions);\n this.options = this._computeOptions();\n if (this.options.get(13 /* EditorOption.automaticLayout */)) {\n this._containerObserver.startObserving();\n }\n this._register(EditorZoom.onDidChangeZoomLevel(() => this._recomputeOptions()));\n this._register(TabFocus.onDidChangeTabFocus(() => this._recomputeOptions()));\n this._register(this._containerObserver.onDidChange(() => this._recomputeOptions()));\n this._register(FontMeasurements.onDidChange(() => this._recomputeOptions()));\n this._register(browser.PixelRatio.onDidChange(() => this._recomputeOptions()));\n this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(() => this._recomputeOptions()));\n }\n _recomputeOptions() {\n const newOptions = this._computeOptions();\n const changeEvent = EditorOptionsUtil.checkEquals(this.options, newOptions);\n if (changeEvent === null) {\n // nothing changed!\n return;\n }\n this.options = newOptions;\n this._onDidChangeFast.fire(changeEvent);\n this._onDidChange.fire(changeEvent);\n }\n _computeOptions() {\n const partialEnv = this._readEnvConfiguration();\n const bareFontInfo = BareFontInfo.createFromValidatedSettings(this._validatedOptions, partialEnv.pixelRatio, this.isSimpleWidget);\n const fontInfo = this._readFontInfo(bareFontInfo);\n const env = {\n memory: this._computeOptionsMemory,\n outerWidth: partialEnv.outerWidth,\n outerHeight: partialEnv.outerHeight - this._reservedHeight,\n fontInfo: fontInfo,\n extraEditorClassName: partialEnv.extraEditorClassName,\n isDominatedByLongLines: this._isDominatedByLongLines,\n viewLineCount: this._viewLineCount,\n lineNumbersDigitCount: this._lineNumbersDigitCount,\n emptySelectionClipboard: partialEnv.emptySelectionClipboard,\n pixelRatio: partialEnv.pixelRatio,\n tabFocusMode: TabFocus.getTabFocusMode(),\n accessibilitySupport: partialEnv.accessibilitySupport,\n glyphMarginDecorationLaneCount: this._glyphMarginDecorationLaneCount\n };\n return EditorOptionsUtil.computeOptions(this._validatedOptions, env);\n }\n _readEnvConfiguration() {\n return {\n extraEditorClassName: getExtraEditorClassName(),\n outerWidth: this._containerObserver.getWidth(),\n outerHeight: this._containerObserver.getHeight(),\n emptySelectionClipboard: browser.isWebKit || browser.isFirefox,\n pixelRatio: browser.PixelRatio.value,\n accessibilitySupport: (this._accessibilityService.isScreenReaderOptimized()\n ? 2 /* AccessibilitySupport.Enabled */\n : this._accessibilityService.getAccessibilitySupport())\n };\n }\n _readFontInfo(bareFontInfo) {\n return FontMeasurements.readFontInfo(bareFontInfo);\n }\n getRawOptions() {\n return this._rawOptions;\n }\n updateOptions(_newOptions) {\n const newOptions = deepCloneAndMigrateOptions(_newOptions);\n const didChange = EditorOptionsUtil.applyUpdate(this._rawOptions, newOptions);\n if (!didChange) {\n return;\n }\n this._validatedOptions = EditorOptionsUtil.validateOptions(this._rawOptions);\n this._recomputeOptions();\n }\n observeContainer(dimension) {\n this._containerObserver.observe(dimension);\n }\n setIsDominatedByLongLines(isDominatedByLongLines) {\n if (this._isDominatedByLongLines === isDominatedByLongLines) {\n return;\n }\n this._isDominatedByLongLines = isDominatedByLongLines;\n this._recomputeOptions();\n }\n setModelLineCount(modelLineCount) {\n const lineNumbersDigitCount = digitCount(modelLineCount);\n if (this._lineNumbersDigitCount === lineNumbersDigitCount) {\n return;\n }\n this._lineNumbersDigitCount = lineNumbersDigitCount;\n this._recomputeOptions();\n }\n setViewLineCount(viewLineCount) {\n if (this._viewLineCount === viewLineCount) {\n return;\n }\n this._viewLineCount = viewLineCount;\n this._recomputeOptions();\n }\n setReservedHeight(reservedHeight) {\n if (this._reservedHeight === reservedHeight) {\n return;\n }\n this._reservedHeight = reservedHeight;\n this._recomputeOptions();\n }\n setGlyphMarginDecorationLaneCount(decorationLaneCount) {\n if (this._glyphMarginDecorationLaneCount === decorationLaneCount) {\n return;\n }\n this._glyphMarginDecorationLaneCount = decorationLaneCount;\n this._recomputeOptions();\n }\n};\nEditorConfiguration = __decorate([\n __param(3, IAccessibilityService)\n], EditorConfiguration);\nexport { EditorConfiguration };\nfunction digitCount(n) {\n let r = 0;\n while (n) {\n n = Math.floor(n / 10);\n r++;\n }\n return r ? r : 1;\n}\nfunction getExtraEditorClassName() {\n let extra = '';\n if (!browser.isSafari && !browser.isWebkitWebView) {\n // Use user-select: none in all browsers except Safari and native macOS WebView\n extra += 'no-user-select ';\n }\n if (browser.isSafari) {\n // See https://github.com/microsoft/vscode/issues/108822\n extra += 'no-minimap-shadow ';\n extra += 'enable-user-select ';\n }\n if (platform.isMacintosh) {\n extra += 'mac ';\n }\n return extra;\n}\nclass ValidatedEditorOptions {\n constructor() {\n this._values = [];\n }\n _read(option) {\n return this._values[option];\n }\n get(id) {\n return this._values[id];\n }\n _write(option, value) {\n this._values[option] = value;\n }\n}\nexport class ComputedEditorOptions {\n constructor() {\n this._values = [];\n }\n _read(id) {\n if (id >= this._values.length) {\n throw new Error('Cannot read uninitialized value');\n }\n return this._values[id];\n }\n get(id) {\n return this._read(id);\n }\n _write(id, value) {\n this._values[id] = value;\n }\n}\nclass EditorOptionsUtil {\n static validateOptions(options) {\n const result = new ValidatedEditorOptions();\n for (const editorOption of editorOptionsRegistry) {\n const value = (editorOption.name === '_never_' ? undefined : options[editorOption.name]);\n result._write(editorOption.id, editorOption.validate(value));\n }\n return result;\n }\n static computeOptions(options, env) {\n const result = new ComputedEditorOptions();\n for (const editorOption of editorOptionsRegistry) {\n result._write(editorOption.id, editorOption.compute(env, result, options._read(editorOption.id)));\n }\n return result;\n }\n static _deepEquals(a, b) {\n if (typeof a !== 'object' || typeof b !== 'object' || !a || !b) {\n return a === b;\n }\n if (Array.isArray(a) || Array.isArray(b)) {\n return (Array.isArray(a) && Array.isArray(b) ? arrays.equals(a, b) : false);\n }\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (const key in a) {\n if (!EditorOptionsUtil._deepEquals(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n static checkEquals(a, b) {\n const result = [];\n let somethingChanged = false;\n for (const editorOption of editorOptionsRegistry) {\n const changed = !EditorOptionsUtil._deepEquals(a._read(editorOption.id), b._read(editorOption.id));\n result[editorOption.id] = changed;\n if (changed) {\n somethingChanged = true;\n }\n }\n return (somethingChanged ? new ConfigurationChangedEvent(result) : null);\n }\n /**\n * Returns true if something changed.\n * Modifies `options`.\n */\n static applyUpdate(options, update) {\n let changed = false;\n for (const editorOption of editorOptionsRegistry) {\n if (update.hasOwnProperty(editorOption.name)) {\n const result = editorOption.applyUpdate(options[editorOption.name], update[editorOption.name]);\n options[editorOption.name] = result.newValue;\n changed = changed || result.didChange;\n }\n }\n return changed;\n }\n}\nfunction deepCloneAndMigrateOptions(_options) {\n const options = objects.deepClone(_options);\n migrateOptions(options);\n return options;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport var inputLatency;\n(function (inputLatency) {\n const totalKeydownTime = { total: 0, min: Number.MAX_VALUE, max: 0 };\n const totalInputTime = { ...totalKeydownTime };\n const totalRenderTime = { ...totalKeydownTime };\n const totalInputLatencyTime = { ...totalKeydownTime };\n let measurementsCount = 0;\n const state = {\n keydown: 0 /* EventPhase.Before */,\n input: 0 /* EventPhase.Before */,\n render: 0 /* EventPhase.Before */,\n };\n /**\n * Record the start of the keydown event.\n */\n function onKeyDown() {\n /** Direct Check C. See explanation in {@link recordIfFinished} */\n recordIfFinished();\n performance.mark('inputlatency/start');\n performance.mark('keydown/start');\n state.keydown = 1 /* EventPhase.InProgress */;\n queueMicrotask(markKeyDownEnd);\n }\n inputLatency.onKeyDown = onKeyDown;\n /**\n * Mark the end of the keydown event.\n */\n function markKeyDownEnd() {\n if (state.keydown === 1 /* EventPhase.InProgress */) {\n performance.mark('keydown/end');\n state.keydown = 2 /* EventPhase.Finished */;\n }\n }\n /**\n * Record the start of the beforeinput event.\n */\n function onBeforeInput() {\n performance.mark('input/start');\n state.input = 1 /* EventPhase.InProgress */;\n /** Schedule Task A. See explanation in {@link recordIfFinished} */\n scheduleRecordIfFinishedTask();\n }\n inputLatency.onBeforeInput = onBeforeInput;\n /**\n * Record the start of the input event.\n */\n function onInput() {\n if (state.input === 0 /* EventPhase.Before */) {\n // it looks like we didn't receive a `beforeinput`\n onBeforeInput();\n }\n queueMicrotask(markInputEnd);\n }\n inputLatency.onInput = onInput;\n function markInputEnd() {\n if (state.input === 1 /* EventPhase.InProgress */) {\n performance.mark('input/end');\n state.input = 2 /* EventPhase.Finished */;\n }\n }\n /**\n * Record the start of the keyup event.\n */\n function onKeyUp() {\n /** Direct Check D. See explanation in {@link recordIfFinished} */\n recordIfFinished();\n }\n inputLatency.onKeyUp = onKeyUp;\n /**\n * Record the start of the selectionchange event.\n */\n function onSelectionChange() {\n /** Direct Check E. See explanation in {@link recordIfFinished} */\n recordIfFinished();\n }\n inputLatency.onSelectionChange = onSelectionChange;\n /**\n * Record the start of the animation frame performing the rendering.\n */\n function onRenderStart() {\n // Render may be triggered during input, but we only measure the following animation frame\n if (state.keydown === 2 /* EventPhase.Finished */ && state.input === 2 /* EventPhase.Finished */ && state.render === 0 /* EventPhase.Before */) {\n // Only measure the first render after keyboard input\n performance.mark('render/start');\n state.render = 1 /* EventPhase.InProgress */;\n queueMicrotask(markRenderEnd);\n /** Schedule Task B. See explanation in {@link recordIfFinished} */\n scheduleRecordIfFinishedTask();\n }\n }\n inputLatency.onRenderStart = onRenderStart;\n /**\n * Mark the end of the animation frame performing the rendering.\n */\n function markRenderEnd() {\n if (state.render === 1 /* EventPhase.InProgress */) {\n performance.mark('render/end');\n state.render = 2 /* EventPhase.Finished */;\n }\n }\n function scheduleRecordIfFinishedTask() {\n // Here we can safely assume that the `setTimeout` will not be\n // artificially delayed by 4ms because we schedule it from\n // event handlers\n setTimeout(recordIfFinished);\n }\n /**\n * Record the input latency sample if input handling and rendering are finished.\n *\n * The challenge here is that we want to record the latency in such a way that it includes\n * also the layout and painting work the browser does during the animation frame task.\n *\n * Simply scheduling a new task (via `setTimeout`) from the animation frame task would\n * schedule the new task at the end of the task queue (after other code that uses `setTimeout`),\n * so we need to use multiple strategies to make sure our task runs before others:\n *\n * We schedule tasks (A and B):\n * - we schedule a task A (via a `setTimeout` call) when the input starts in `markInputStart`.\n * If the animation frame task is scheduled quickly by the browser, then task A has a very good\n * chance of being the very first task after the animation frame and thus will record the input latency.\n * - however, if the animation frame task is scheduled a bit later, then task A might execute\n * before the animation frame task. We therefore schedule another task B from `markRenderStart`.\n *\n * We do direct checks in browser event handlers (C, D, E):\n * - if the browser has multiple keydown events queued up, they will be scheduled before the `setTimeout` tasks,\n * so we do a direct check in the keydown event handler (C).\n * - depending on timing, sometimes the animation frame is scheduled even before the `keyup` event, so we\n * do a direct check there too (E).\n * - the browser oftentimes emits a `selectionchange` event after an `input`, so we do a direct check there (D).\n */\n function recordIfFinished() {\n if (state.keydown === 2 /* EventPhase.Finished */ && state.input === 2 /* EventPhase.Finished */ && state.render === 2 /* EventPhase.Finished */) {\n performance.mark('inputlatency/end');\n performance.measure('keydown', 'keydown/start', 'keydown/end');\n performance.measure('input', 'input/start', 'input/end');\n performance.measure('render', 'render/start', 'render/end');\n performance.measure('inputlatency', 'inputlatency/start', 'inputlatency/end');\n addMeasure('keydown', totalKeydownTime);\n addMeasure('input', totalInputTime);\n addMeasure('render', totalRenderTime);\n addMeasure('inputlatency', totalInputLatencyTime);\n // console.info(\n // \t`input latency=${performance.getEntriesByName('inputlatency')[0].duration.toFixed(1)} [` +\n // \t`keydown=${performance.getEntriesByName('keydown')[0].duration.toFixed(1)}, ` +\n // \t`input=${performance.getEntriesByName('input')[0].duration.toFixed(1)}, ` +\n // \t`render=${performance.getEntriesByName('render')[0].duration.toFixed(1)}` +\n // \t`]`\n // );\n measurementsCount++;\n reset();\n }\n }\n function addMeasure(entryName, cumulativeMeasurement) {\n const duration = performance.getEntriesByName(entryName)[0].duration;\n cumulativeMeasurement.total += duration;\n cumulativeMeasurement.min = Math.min(cumulativeMeasurement.min, duration);\n cumulativeMeasurement.max = Math.max(cumulativeMeasurement.max, duration);\n }\n /**\n * Clear the current sample.\n */\n function reset() {\n performance.clearMarks('keydown/start');\n performance.clearMarks('keydown/end');\n performance.clearMarks('input/start');\n performance.clearMarks('input/end');\n performance.clearMarks('render/start');\n performance.clearMarks('render/end');\n performance.clearMarks('inputlatency/start');\n performance.clearMarks('inputlatency/end');\n performance.clearMeasures('keydown');\n performance.clearMeasures('input');\n performance.clearMeasures('render');\n performance.clearMeasures('inputlatency');\n state.keydown = 0 /* EventPhase.Before */;\n state.input = 0 /* EventPhase.Before */;\n state.render = 0 /* EventPhase.Before */;\n }\n /**\n * Gets all input latency samples and clears the internal buffers to start recording a new set\n * of samples.\n */\n function getAndClearMeasurements() {\n if (measurementsCount === 0) {\n return undefined;\n }\n // Assemble the result\n const result = {\n keydown: cumulativeToFinalMeasurement(totalKeydownTime),\n input: cumulativeToFinalMeasurement(totalInputTime),\n render: cumulativeToFinalMeasurement(totalRenderTime),\n total: cumulativeToFinalMeasurement(totalInputLatencyTime),\n sampleCount: measurementsCount\n };\n // Clear the cumulative measurements\n clearCumulativeMeasurement(totalKeydownTime);\n clearCumulativeMeasurement(totalInputTime);\n clearCumulativeMeasurement(totalRenderTime);\n clearCumulativeMeasurement(totalInputLatencyTime);\n measurementsCount = 0;\n return result;\n }\n inputLatency.getAndClearMeasurements = getAndClearMeasurements;\n function cumulativeToFinalMeasurement(cumulative) {\n return {\n average: cumulative.total / measurementsCount,\n max: cumulative.max,\n min: cumulative.min,\n };\n }\n function clearCumulativeMeasurement(cumulative) {\n cumulative.total = 0;\n cumulative.min = Number.MAX_VALUE;\n cumulative.max = 0;\n }\n})(inputLatency || (inputLatency = {}));\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as dom from './dom.js';\nimport { DisposableStore, toDisposable } from '../common/lifecycle.js';\nexport class GlobalPointerMoveMonitor {\n constructor() {\n this._hooks = new DisposableStore();\n this._pointerMoveCallback = null;\n this._onStopCallback = null;\n }\n dispose() {\n this.stopMonitoring(false);\n this._hooks.dispose();\n }\n stopMonitoring(invokeStopCallback, browserEvent) {\n if (!this.isMonitoring()) {\n // Not monitoring\n return;\n }\n // Unhook\n this._hooks.clear();\n this._pointerMoveCallback = null;\n const onStopCallback = this._onStopCallback;\n this._onStopCallback = null;\n if (invokeStopCallback && onStopCallback) {\n onStopCallback(browserEvent);\n }\n }\n isMonitoring() {\n return !!this._pointerMoveCallback;\n }\n startMonitoring(initialElement, pointerId, initialButtons, pointerMoveCallback, onStopCallback) {\n if (this.isMonitoring()) {\n this.stopMonitoring(false);\n }\n this._pointerMoveCallback = pointerMoveCallback;\n this._onStopCallback = onStopCallback;\n let eventSource = initialElement;\n try {\n initialElement.setPointerCapture(pointerId);\n this._hooks.add(toDisposable(() => {\n try {\n initialElement.releasePointerCapture(pointerId);\n }\n catch (err) {\n // See https://github.com/microsoft/vscode/issues/161731\n //\n // `releasePointerCapture` sometimes fails when being invoked with the exception:\n // DOMException: Failed to execute 'releasePointerCapture' on 'Element':\n // No active pointer with the given id is found.\n //\n // There's no need to do anything in case of failure\n }\n }));\n }\n catch (err) {\n // See https://github.com/microsoft/vscode/issues/144584\n // See https://github.com/microsoft/vscode/issues/146947\n // `setPointerCapture` sometimes fails when being invoked\n // from a `mousedown` listener on macOS and Windows\n // and it always fails on Linux with the exception:\n // DOMException: Failed to execute 'setPointerCapture' on 'Element':\n // No active pointer with the given id is found.\n // In case of failure, we bind the listeners on the window\n eventSource = dom.getWindow(initialElement);\n }\n this._hooks.add(dom.addDisposableListener(eventSource, dom.EventType.POINTER_MOVE, (e) => {\n if (e.buttons !== initialButtons) {\n // Buttons state has changed in the meantime\n this.stopMonitoring(true);\n return;\n }\n e.preventDefault();\n this._pointerMoveCallback(e);\n }));\n this._hooks.add(dom.addDisposableListener(eventSource, dom.EventType.POINTER_UP, (e) => this.stopMonitoring(true)));\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { assertNever } from '../../../base/common/assert.js';\nimport { RunOnceScheduler } from '../../../base/common/async.js';\nimport { Color, RGBA } from '../../../base/common/color.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport * as nls from '../../../nls.js';\nimport { Extensions as JSONExtensions } from '../../jsonschemas/common/jsonContributionRegistry.js';\nimport * as platform from '../../registry/common/platform.js';\n/**\n * Returns the css variable name for the given color identifier. Dots (`.`) are replaced with hyphens (`-`) and\n * everything is prefixed with `--vscode-`.\n *\n * @sample `editorSuggestWidget.background` is `--vscode-editorSuggestWidget-background`.\n */\nexport function asCssVariableName(colorIdent) {\n return `--vscode-${colorIdent.replace(/\\./g, '-')}`;\n}\nexport function asCssVariable(color) {\n return `var(${asCssVariableName(color)})`;\n}\nexport function asCssVariableWithDefault(color, defaultCssValue) {\n return `var(${asCssVariableName(color)}, ${defaultCssValue})`;\n}\n// color registry\nexport const Extensions = {\n ColorContribution: 'base.contributions.colors'\n};\nclass ColorRegistry {\n constructor() {\n this._onDidChangeSchema = new Emitter();\n this.onDidChangeSchema = this._onDidChangeSchema.event;\n this.colorSchema = { type: 'object', properties: {} };\n this.colorReferenceSchema = { type: 'string', enum: [], enumDescriptions: [] };\n this.colorsById = {};\n }\n registerColor(id, defaults, description, needsTransparency = false, deprecationMessage) {\n const colorContribution = { id, description, defaults, needsTransparency, deprecationMessage };\n this.colorsById[id] = colorContribution;\n const propertySchema = { type: 'string', description, format: 'color-hex', defaultSnippets: [{ body: '${1:#ff0000}' }] };\n if (deprecationMessage) {\n propertySchema.deprecationMessage = deprecationMessage;\n }\n if (needsTransparency) {\n propertySchema.pattern = '^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$';\n propertySchema.patternErrorMessage = 'This color must be transparent or it will obscure content';\n }\n this.colorSchema.properties[id] = propertySchema;\n this.colorReferenceSchema.enum.push(id);\n this.colorReferenceSchema.enumDescriptions.push(description);\n this._onDidChangeSchema.fire();\n return id;\n }\n getColors() {\n return Object.keys(this.colorsById).map(id => this.colorsById[id]);\n }\n resolveDefaultColor(id, theme) {\n const colorDesc = this.colorsById[id];\n if (colorDesc && colorDesc.defaults) {\n const colorValue = colorDesc.defaults[theme.type];\n return resolveColorValue(colorValue, theme);\n }\n return undefined;\n }\n getColorSchema() {\n return this.colorSchema;\n }\n toString() {\n const sorter = (a, b) => {\n const cat1 = a.indexOf('.') === -1 ? 0 : 1;\n const cat2 = b.indexOf('.') === -1 ? 0 : 1;\n if (cat1 !== cat2) {\n return cat1 - cat2;\n }\n return a.localeCompare(b);\n };\n return Object.keys(this.colorsById).sort(sorter).map(k => `- \\`${k}\\`: ${this.colorsById[k].description}`).join('\\n');\n }\n}\nconst colorRegistry = new ColorRegistry();\nplatform.Registry.add(Extensions.ColorContribution, colorRegistry);\nexport function registerColor(id, defaults, description, needsTransparency, deprecationMessage) {\n return colorRegistry.registerColor(id, defaults, description, needsTransparency, deprecationMessage);\n}\n// ----- base colors\nexport const foreground = registerColor('foreground', { dark: '#CCCCCC', light: '#616161', hcDark: '#FFFFFF', hcLight: '#292929' }, nls.localize('foreground', \"Overall foreground color. This color is only used if not overridden by a component.\"));\nexport const disabledForeground = registerColor('disabledForeground', { dark: '#CCCCCC80', light: '#61616180', hcDark: '#A5A5A5', hcLight: '#7F7F7F' }, nls.localize('disabledForeground', \"Overall foreground for disabled elements. This color is only used if not overridden by a component.\"));\nexport const errorForeground = registerColor('errorForeground', { dark: '#F48771', light: '#A1260D', hcDark: '#F48771', hcLight: '#B5200D' }, nls.localize('errorForeground', \"Overall foreground color for error messages. This color is only used if not overridden by a component.\"));\nexport const descriptionForeground = registerColor('descriptionForeground', { light: '#717171', dark: transparent(foreground, 0.7), hcDark: transparent(foreground, 0.7), hcLight: transparent(foreground, 0.7) }, nls.localize('descriptionForeground', \"Foreground color for description text providing additional information, for example for a label.\"));\nexport const iconForeground = registerColor('icon.foreground', { dark: '#C5C5C5', light: '#424242', hcDark: '#FFFFFF', hcLight: '#292929' }, nls.localize('iconForeground', \"The default color for icons in the workbench.\"));\nexport const focusBorder = registerColor('focusBorder', { dark: '#007FD4', light: '#0090F1', hcDark: '#F38518', hcLight: '#006BBD' }, nls.localize('focusBorder', \"Overall border color for focused elements. This color is only used if not overridden by a component.\"));\nexport const contrastBorder = registerColor('contrastBorder', { light: null, dark: null, hcDark: '#6FC3DF', hcLight: '#0F4A85' }, nls.localize('contrastBorder', \"An extra border around elements to separate them from others for greater contrast.\"));\nexport const activeContrastBorder = registerColor('contrastActiveBorder', { light: null, dark: null, hcDark: focusBorder, hcLight: focusBorder }, nls.localize('activeContrastBorder', \"An extra border around active elements to separate them from others for greater contrast.\"));\nexport const selectionBackground = registerColor('selection.background', { light: null, dark: null, hcDark: null, hcLight: null }, nls.localize('selectionBackground', \"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.\"));\n// ------ text colors\nexport const textSeparatorForeground = registerColor('textSeparator.foreground', { light: '#0000002e', dark: '#ffffff2e', hcDark: Color.black, hcLight: '#292929' }, nls.localize('textSeparatorForeground', \"Color for text separators.\"));\nexport const textLinkForeground = registerColor('textLink.foreground', { light: '#006AB1', dark: '#3794FF', hcDark: '#3794FF', hcLight: '#0F4A85' }, nls.localize('textLinkForeground', \"Foreground color for links in text.\"));\nexport const textLinkActiveForeground = registerColor('textLink.activeForeground', { light: '#006AB1', dark: '#3794FF', hcDark: '#3794FF', hcLight: '#0F4A85' }, nls.localize('textLinkActiveForeground', \"Foreground color for links in text when clicked on and on mouse hover.\"));\nexport const textPreformatForeground = registerColor('textPreformat.foreground', { light: '#A31515', dark: '#D7BA7D', hcDark: '#000000', hcLight: '#FFFFFF' }, nls.localize('textPreformatForeground', \"Foreground color for preformatted text segments.\"));\nexport const textPreformatBackground = registerColor('textPreformat.background', { light: '#0000001A', dark: '#FFFFFF1A', hcDark: '#FFFFFF', hcLight: '#09345f' }, nls.localize('textPreformatBackground', \"Background color for preformatted text segments.\"));\nexport const textBlockQuoteBackground = registerColor('textBlockQuote.background', { light: '#f2f2f2', dark: '#222222', hcDark: null, hcLight: '#F2F2F2' }, nls.localize('textBlockQuoteBackground', \"Background color for block quotes in text.\"));\nexport const textBlockQuoteBorder = registerColor('textBlockQuote.border', { light: '#007acc80', dark: '#007acc80', hcDark: Color.white, hcLight: '#292929' }, nls.localize('textBlockQuoteBorder', \"Border color for block quotes in text.\"));\nexport const textCodeBlockBackground = registerColor('textCodeBlock.background', { light: '#dcdcdc66', dark: '#0a0a0a66', hcDark: Color.black, hcLight: '#F2F2F2' }, nls.localize('textCodeBlockBackground', \"Background color for code blocks in text.\"));\n// ----- widgets\nexport const widgetShadow = registerColor('widget.shadow', { dark: transparent(Color.black, .36), light: transparent(Color.black, .16), hcDark: null, hcLight: null }, nls.localize('widgetShadow', 'Shadow color of widgets such as find/replace inside the editor.'));\nexport const widgetBorder = registerColor('widget.border', { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('widgetBorder', 'Border color of widgets such as find/replace inside the editor.'));\nexport const inputBackground = registerColor('input.background', { dark: '#3C3C3C', light: Color.white, hcDark: Color.black, hcLight: Color.white }, nls.localize('inputBoxBackground', \"Input box background.\"));\nexport const inputForeground = registerColor('input.foreground', { dark: foreground, light: foreground, hcDark: foreground, hcLight: foreground }, nls.localize('inputBoxForeground', \"Input box foreground.\"));\nexport const inputBorder = registerColor('input.border', { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('inputBoxBorder', \"Input box border.\"));\nexport const inputActiveOptionBorder = registerColor('inputOption.activeBorder', { dark: '#007ACC', light: '#007ACC', hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('inputBoxActiveOptionBorder', \"Border color of activated options in input fields.\"));\nexport const inputActiveOptionHoverBackground = registerColor('inputOption.hoverBackground', { dark: '#5a5d5e80', light: '#b8b8b850', hcDark: null, hcLight: null }, nls.localize('inputOption.hoverBackground', \"Background color of activated options in input fields.\"));\nexport const inputActiveOptionBackground = registerColor('inputOption.activeBackground', { dark: transparent(focusBorder, 0.4), light: transparent(focusBorder, 0.2), hcDark: Color.transparent, hcLight: Color.transparent }, nls.localize('inputOption.activeBackground', \"Background hover color of options in input fields.\"));\nexport const inputActiveOptionForeground = registerColor('inputOption.activeForeground', { dark: Color.white, light: Color.black, hcDark: foreground, hcLight: foreground }, nls.localize('inputOption.activeForeground', \"Foreground color of activated options in input fields.\"));\nexport const inputPlaceholderForeground = registerColor('input.placeholderForeground', { light: transparent(foreground, 0.5), dark: transparent(foreground, 0.5), hcDark: transparent(foreground, 0.7), hcLight: transparent(foreground, 0.7) }, nls.localize('inputPlaceholderForeground', \"Input box foreground color for placeholder text.\"));\nexport const inputValidationInfoBackground = registerColor('inputValidation.infoBackground', { dark: '#063B49', light: '#D6ECF2', hcDark: Color.black, hcLight: Color.white }, nls.localize('inputValidationInfoBackground', \"Input validation background color for information severity.\"));\nexport const inputValidationInfoForeground = registerColor('inputValidation.infoForeground', { dark: null, light: null, hcDark: null, hcLight: foreground }, nls.localize('inputValidationInfoForeground', \"Input validation foreground color for information severity.\"));\nexport const inputValidationInfoBorder = registerColor('inputValidation.infoBorder', { dark: '#007acc', light: '#007acc', hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('inputValidationInfoBorder', \"Input validation border color for information severity.\"));\nexport const inputValidationWarningBackground = registerColor('inputValidation.warningBackground', { dark: '#352A05', light: '#F6F5D2', hcDark: Color.black, hcLight: Color.white }, nls.localize('inputValidationWarningBackground', \"Input validation background color for warning severity.\"));\nexport const inputValidationWarningForeground = registerColor('inputValidation.warningForeground', { dark: null, light: null, hcDark: null, hcLight: foreground }, nls.localize('inputValidationWarningForeground', \"Input validation foreground color for warning severity.\"));\nexport const inputValidationWarningBorder = registerColor('inputValidation.warningBorder', { dark: '#B89500', light: '#B89500', hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('inputValidationWarningBorder', \"Input validation border color for warning severity.\"));\nexport const inputValidationErrorBackground = registerColor('inputValidation.errorBackground', { dark: '#5A1D1D', light: '#F2DEDE', hcDark: Color.black, hcLight: Color.white }, nls.localize('inputValidationErrorBackground', \"Input validation background color for error severity.\"));\nexport const inputValidationErrorForeground = registerColor('inputValidation.errorForeground', { dark: null, light: null, hcDark: null, hcLight: foreground }, nls.localize('inputValidationErrorForeground', \"Input validation foreground color for error severity.\"));\nexport const inputValidationErrorBorder = registerColor('inputValidation.errorBorder', { dark: '#BE1100', light: '#BE1100', hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('inputValidationErrorBorder', \"Input validation border color for error severity.\"));\nexport const selectBackground = registerColor('dropdown.background', { dark: '#3C3C3C', light: Color.white, hcDark: Color.black, hcLight: Color.white }, nls.localize('dropdownBackground', \"Dropdown background.\"));\nexport const selectListBackground = registerColor('dropdown.listBackground', { dark: null, light: null, hcDark: Color.black, hcLight: Color.white }, nls.localize('dropdownListBackground', \"Dropdown list background.\"));\nexport const selectForeground = registerColor('dropdown.foreground', { dark: '#F0F0F0', light: foreground, hcDark: Color.white, hcLight: foreground }, nls.localize('dropdownForeground', \"Dropdown foreground.\"));\nexport const selectBorder = registerColor('dropdown.border', { dark: selectBackground, light: '#CECECE', hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('dropdownBorder', \"Dropdown border.\"));\nexport const buttonForeground = registerColor('button.foreground', { dark: Color.white, light: Color.white, hcDark: Color.white, hcLight: Color.white }, nls.localize('buttonForeground', \"Button foreground color.\"));\nexport const buttonSeparator = registerColor('button.separator', { dark: transparent(buttonForeground, .4), light: transparent(buttonForeground, .4), hcDark: transparent(buttonForeground, .4), hcLight: transparent(buttonForeground, .4) }, nls.localize('buttonSeparator', \"Button separator color.\"));\nexport const buttonBackground = registerColor('button.background', { dark: '#0E639C', light: '#007ACC', hcDark: null, hcLight: '#0F4A85' }, nls.localize('buttonBackground', \"Button background color.\"));\nexport const buttonHoverBackground = registerColor('button.hoverBackground', { dark: lighten(buttonBackground, 0.2), light: darken(buttonBackground, 0.2), hcDark: buttonBackground, hcLight: buttonBackground }, nls.localize('buttonHoverBackground', \"Button background color when hovering.\"));\nexport const buttonBorder = registerColor('button.border', { dark: contrastBorder, light: contrastBorder, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('buttonBorder', \"Button border color.\"));\nexport const buttonSecondaryForeground = registerColor('button.secondaryForeground', { dark: Color.white, light: Color.white, hcDark: Color.white, hcLight: foreground }, nls.localize('buttonSecondaryForeground', \"Secondary button foreground color.\"));\nexport const buttonSecondaryBackground = registerColor('button.secondaryBackground', { dark: '#3A3D41', light: '#5F6A79', hcDark: null, hcLight: Color.white }, nls.localize('buttonSecondaryBackground', \"Secondary button background color.\"));\nexport const buttonSecondaryHoverBackground = registerColor('button.secondaryHoverBackground', { dark: lighten(buttonSecondaryBackground, 0.2), light: darken(buttonSecondaryBackground, 0.2), hcDark: null, hcLight: null }, nls.localize('buttonSecondaryHoverBackground', \"Secondary button background color when hovering.\"));\nexport const badgeBackground = registerColor('badge.background', { dark: '#4D4D4D', light: '#C4C4C4', hcDark: Color.black, hcLight: '#0F4A85' }, nls.localize('badgeBackground', \"Badge background color. Badges are small information labels, e.g. for search results count.\"));\nexport const badgeForeground = registerColor('badge.foreground', { dark: Color.white, light: '#333', hcDark: Color.white, hcLight: Color.white }, nls.localize('badgeForeground', \"Badge foreground color. Badges are small information labels, e.g. for search results count.\"));\nexport const scrollbarShadow = registerColor('scrollbar.shadow', { dark: '#000000', light: '#DDDDDD', hcDark: null, hcLight: null }, nls.localize('scrollbarShadow', \"Scrollbar shadow to indicate that the view is scrolled.\"));\nexport const scrollbarSliderBackground = registerColor('scrollbarSlider.background', { dark: Color.fromHex('#797979').transparent(0.4), light: Color.fromHex('#646464').transparent(0.4), hcDark: transparent(contrastBorder, 0.6), hcLight: transparent(contrastBorder, 0.4) }, nls.localize('scrollbarSliderBackground', \"Scrollbar slider background color.\"));\nexport const scrollbarSliderHoverBackground = registerColor('scrollbarSlider.hoverBackground', { dark: Color.fromHex('#646464').transparent(0.7), light: Color.fromHex('#646464').transparent(0.7), hcDark: transparent(contrastBorder, 0.8), hcLight: transparent(contrastBorder, 0.8) }, nls.localize('scrollbarSliderHoverBackground', \"Scrollbar slider background color when hovering.\"));\nexport const scrollbarSliderActiveBackground = registerColor('scrollbarSlider.activeBackground', { dark: Color.fromHex('#BFBFBF').transparent(0.4), light: Color.fromHex('#000000').transparent(0.6), hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('scrollbarSliderActiveBackground', \"Scrollbar slider background color when clicked on.\"));\nexport const progressBarBackground = registerColor('progressBar.background', { dark: Color.fromHex('#0E70C0'), light: Color.fromHex('#0E70C0'), hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('progressBarBackground', \"Background color of the progress bar that can show for long running operations.\"));\nexport const editorErrorBackground = registerColor('editorError.background', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('editorError.background', 'Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorErrorForeground = registerColor('editorError.foreground', { dark: '#F14C4C', light: '#E51400', hcDark: '#F48771', hcLight: '#B5200D' }, nls.localize('editorError.foreground', 'Foreground color of error squigglies in the editor.'));\nexport const editorErrorBorder = registerColor('editorError.border', { dark: null, light: null, hcDark: Color.fromHex('#E47777').transparent(0.8), hcLight: '#B5200D' }, nls.localize('errorBorder', 'If set, color of double underlines for errors in the editor.'));\nexport const editorWarningBackground = registerColor('editorWarning.background', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('editorWarning.background', 'Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#CCA700', light: '#BF8803', hcDark: '#FFD370', hcLight: '#895503' }, nls.localize('editorWarning.foreground', 'Foreground color of warning squigglies in the editor.'));\nexport const editorWarningBorder = registerColor('editorWarning.border', { dark: null, light: null, hcDark: Color.fromHex('#FFCC00').transparent(0.8), hcLight: Color.fromHex('#FFCC00').transparent(0.8) }, nls.localize('warningBorder', 'If set, color of double underlines for warnings in the editor.'));\nexport const editorInfoBackground = registerColor('editorInfo.background', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('editorInfo.background', 'Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorInfoForeground = registerColor('editorInfo.foreground', { dark: '#3794FF', light: '#1a85ff', hcDark: '#3794FF', hcLight: '#1a85ff' }, nls.localize('editorInfo.foreground', 'Foreground color of info squigglies in the editor.'));\nexport const editorInfoBorder = registerColor('editorInfo.border', { dark: null, light: null, hcDark: Color.fromHex('#3794FF').transparent(0.8), hcLight: '#292929' }, nls.localize('infoBorder', 'If set, color of double underlines for infos in the editor.'));\nexport const editorHintForeground = registerColor('editorHint.foreground', { dark: Color.fromHex('#eeeeee').transparent(0.7), light: '#6c6c6c', hcDark: null, hcLight: null }, nls.localize('editorHint.foreground', 'Foreground color of hint squigglies in the editor.'));\nexport const editorHintBorder = registerColor('editorHint.border', { dark: null, light: null, hcDark: Color.fromHex('#eeeeee').transparent(0.8), hcLight: '#292929' }, nls.localize('hintBorder', 'If set, color of double underlines for hints in the editor.'));\nexport const sashHoverBorder = registerColor('sash.hoverBorder', { dark: focusBorder, light: focusBorder, hcDark: focusBorder, hcLight: focusBorder }, nls.localize('sashActiveBorder', \"Border color of active sashes.\"));\n/**\n * Editor background color.\n */\nexport const editorBackground = registerColor('editor.background', { light: '#ffffff', dark: '#1E1E1E', hcDark: Color.black, hcLight: Color.white }, nls.localize('editorBackground', \"Editor background color.\"));\n/**\n * Editor foreground color.\n */\nexport const editorForeground = registerColor('editor.foreground', { light: '#333333', dark: '#BBBBBB', hcDark: Color.white, hcLight: foreground }, nls.localize('editorForeground', \"Editor default foreground color.\"));\n/**\n * Sticky scroll\n */\nexport const editorStickyScrollBackground = registerColor('editorStickyScroll.background', { light: editorBackground, dark: editorBackground, hcDark: editorBackground, hcLight: editorBackground }, nls.localize('editorStickyScrollBackground', \"Background color of sticky scroll in the editor\"));\nexport const editorStickyScrollHoverBackground = registerColor('editorStickyScrollHover.background', { dark: '#2A2D2E', light: '#F0F0F0', hcDark: null, hcLight: Color.fromHex('#0F4A85').transparent(0.1) }, nls.localize('editorStickyScrollHoverBackground', \"Background color of sticky scroll on hover in the editor\"));\nexport const editorStickyScrollBorder = registerColor('editorStickyScroll.border', { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('editorStickyScrollBorder', \"Border color of sticky scroll in the editor\"));\nexport const editorStickyScrollShadow = registerColor('editorStickyScroll.shadow', { dark: scrollbarShadow, light: scrollbarShadow, hcDark: scrollbarShadow, hcLight: scrollbarShadow }, nls.localize('editorStickyScrollShadow', \" Shadow color of sticky scroll in the editor\"));\n/**\n * Editor widgets\n */\nexport const editorWidgetBackground = registerColor('editorWidget.background', { dark: '#252526', light: '#F3F3F3', hcDark: '#0C141F', hcLight: Color.white }, nls.localize('editorWidgetBackground', 'Background color of editor widgets, such as find/replace.'));\nexport const editorWidgetForeground = registerColor('editorWidget.foreground', { dark: foreground, light: foreground, hcDark: foreground, hcLight: foreground }, nls.localize('editorWidgetForeground', 'Foreground color of editor widgets, such as find/replace.'));\nexport const editorWidgetBorder = registerColor('editorWidget.border', { dark: '#454545', light: '#C8C8C8', hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('editorWidgetBorder', 'Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.'));\nexport const editorWidgetResizeBorder = registerColor('editorWidget.resizeBorder', { light: null, dark: null, hcDark: null, hcLight: null }, nls.localize('editorWidgetResizeBorder', \"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.\"));\n/**\n * Quick pick widget\n */\nexport const quickInputBackground = registerColor('quickInput.background', { dark: editorWidgetBackground, light: editorWidgetBackground, hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, nls.localize('pickerBackground', \"Quick picker background color. The quick picker widget is the container for pickers like the command palette.\"));\nexport const quickInputForeground = registerColor('quickInput.foreground', { dark: editorWidgetForeground, light: editorWidgetForeground, hcDark: editorWidgetForeground, hcLight: editorWidgetForeground }, nls.localize('pickerForeground', \"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.\"));\nexport const quickInputTitleBackground = registerColor('quickInputTitle.background', { dark: new Color(new RGBA(255, 255, 255, 0.105)), light: new Color(new RGBA(0, 0, 0, 0.06)), hcDark: '#000000', hcLight: Color.white }, nls.localize('pickerTitleBackground', \"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.\"));\nexport const pickerGroupForeground = registerColor('pickerGroup.foreground', { dark: '#3794FF', light: '#0066BF', hcDark: Color.white, hcLight: '#0F4A85' }, nls.localize('pickerGroupForeground', \"Quick picker color for grouping labels.\"));\nexport const pickerGroupBorder = registerColor('pickerGroup.border', { dark: '#3F3F46', light: '#CCCEDB', hcDark: Color.white, hcLight: '#0F4A85' }, nls.localize('pickerGroupBorder', \"Quick picker color for grouping borders.\"));\n/**\n * Keybinding label\n */\nexport const keybindingLabelBackground = registerColor('keybindingLabel.background', { dark: new Color(new RGBA(128, 128, 128, 0.17)), light: new Color(new RGBA(221, 221, 221, 0.4)), hcDark: Color.transparent, hcLight: Color.transparent }, nls.localize('keybindingLabelBackground', \"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.\"));\nexport const keybindingLabelForeground = registerColor('keybindingLabel.foreground', { dark: Color.fromHex('#CCCCCC'), light: Color.fromHex('#555555'), hcDark: Color.white, hcLight: foreground }, nls.localize('keybindingLabelForeground', \"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.\"));\nexport const keybindingLabelBorder = registerColor('keybindingLabel.border', { dark: new Color(new RGBA(51, 51, 51, 0.6)), light: new Color(new RGBA(204, 204, 204, 0.4)), hcDark: new Color(new RGBA(111, 195, 223)), hcLight: contrastBorder }, nls.localize('keybindingLabelBorder', \"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.\"));\nexport const keybindingLabelBottomBorder = registerColor('keybindingLabel.bottomBorder', { dark: new Color(new RGBA(68, 68, 68, 0.6)), light: new Color(new RGBA(187, 187, 187, 0.4)), hcDark: new Color(new RGBA(111, 195, 223)), hcLight: foreground }, nls.localize('keybindingLabelBottomBorder', \"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.\"));\n/**\n * Editor selection colors.\n */\nexport const editorSelectionBackground = registerColor('editor.selectionBackground', { light: '#ADD6FF', dark: '#264F78', hcDark: '#f3f518', hcLight: '#0F4A85' }, nls.localize('editorSelectionBackground', \"Color of the editor selection.\"));\nexport const editorSelectionForeground = registerColor('editor.selectionForeground', { light: null, dark: null, hcDark: '#000000', hcLight: Color.white }, nls.localize('editorSelectionForeground', \"Color of the selected text for high contrast.\"));\nexport const editorInactiveSelection = registerColor('editor.inactiveSelectionBackground', { light: transparent(editorSelectionBackground, 0.5), dark: transparent(editorSelectionBackground, 0.5), hcDark: transparent(editorSelectionBackground, 0.7), hcLight: transparent(editorSelectionBackground, 0.5) }, nls.localize('editorInactiveSelection', \"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations.\"), true);\nexport const editorSelectionHighlight = registerColor('editor.selectionHighlightBackground', { light: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), dark: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), hcDark: null, hcLight: null }, nls.localize('editorSelectionHighlight', 'Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorSelectionHighlightBorder = registerColor('editor.selectionHighlightBorder', { light: null, dark: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize('editorSelectionHighlightBorder', \"Border color for regions with the same content as the selection.\"));\n/**\n * Editor find match colors.\n */\nexport const editorFindMatch = registerColor('editor.findMatchBackground', { light: '#A8AC94', dark: '#515C6A', hcDark: null, hcLight: null }, nls.localize('editorFindMatch', \"Color of the current search match.\"));\nexport const editorFindMatchHighlight = registerColor('editor.findMatchHighlightBackground', { light: '#EA5C0055', dark: '#EA5C0055', hcDark: null, hcLight: null }, nls.localize('findMatchHighlight', \"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations.\"), true);\nexport const editorFindRangeHighlight = registerColor('editor.findRangeHighlightBackground', { dark: '#3a3d4166', light: '#b4b4b44d', hcDark: null, hcLight: null }, nls.localize('findRangeHighlight', \"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.\"), true);\nexport const editorFindMatchBorder = registerColor('editor.findMatchBorder', { light: null, dark: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize('editorFindMatchBorder', \"Border color of the current search match.\"));\nexport const editorFindMatchHighlightBorder = registerColor('editor.findMatchHighlightBorder', { light: null, dark: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize('findMatchHighlightBorder', \"Border color of the other search matches.\"));\nexport const editorFindRangeHighlightBorder = registerColor('editor.findRangeHighlightBorder', { dark: null, light: null, hcDark: transparent(activeContrastBorder, 0.4), hcLight: transparent(activeContrastBorder, 0.4) }, nls.localize('findRangeHighlightBorder', \"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations.\"), true);\n/**\n * Search Editor query match colors.\n *\n * Distinct from normal editor find match to allow for better differentiation\n */\nexport const searchEditorFindMatch = registerColor('searchEditor.findMatchBackground', { light: transparent(editorFindMatchHighlight, 0.66), dark: transparent(editorFindMatchHighlight, 0.66), hcDark: editorFindMatchHighlight, hcLight: editorFindMatchHighlight }, nls.localize('searchEditor.queryMatch', \"Color of the Search Editor query matches.\"));\nexport const searchEditorFindMatchBorder = registerColor('searchEditor.findMatchBorder', { light: transparent(editorFindMatchHighlightBorder, 0.66), dark: transparent(editorFindMatchHighlightBorder, 0.66), hcDark: editorFindMatchHighlightBorder, hcLight: editorFindMatchHighlightBorder }, nls.localize('searchEditor.editorFindMatchBorder', \"Border color of the Search Editor query matches.\"));\n/**\n * Search Viewlet colors.\n */\nexport const searchResultsInfoForeground = registerColor('search.resultsInfoForeground', { light: foreground, dark: transparent(foreground, 0.65), hcDark: foreground, hcLight: foreground }, nls.localize('search.resultsInfoForeground', \"Color of the text in the search viewlet's completion message.\"));\n/**\n * Editor hover\n */\nexport const editorHoverHighlight = registerColor('editor.hoverHighlightBackground', { light: '#ADD6FF26', dark: '#264f7840', hcDark: '#ADD6FF26', hcLight: null }, nls.localize('hoverHighlight', 'Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const editorHoverBackground = registerColor('editorHoverWidget.background', { light: editorWidgetBackground, dark: editorWidgetBackground, hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, nls.localize('hoverBackground', 'Background color of the editor hover.'));\nexport const editorHoverForeground = registerColor('editorHoverWidget.foreground', { light: editorWidgetForeground, dark: editorWidgetForeground, hcDark: editorWidgetForeground, hcLight: editorWidgetForeground }, nls.localize('hoverForeground', 'Foreground color of the editor hover.'));\nexport const editorHoverBorder = registerColor('editorHoverWidget.border', { light: editorWidgetBorder, dark: editorWidgetBorder, hcDark: editorWidgetBorder, hcLight: editorWidgetBorder }, nls.localize('hoverBorder', 'Border color of the editor hover.'));\nexport const editorHoverStatusBarBackground = registerColor('editorHoverWidget.statusBarBackground', { dark: lighten(editorHoverBackground, 0.2), light: darken(editorHoverBackground, 0.05), hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, nls.localize('statusBarBackground', \"Background color of the editor hover status bar.\"));\n/**\n * Editor link colors\n */\nexport const editorActiveLinkForeground = registerColor('editorLink.activeForeground', { dark: '#4E94CE', light: Color.blue, hcDark: Color.cyan, hcLight: '#292929' }, nls.localize('activeLinkForeground', 'Color of active links.'));\n/**\n * Inline hints\n */\nexport const editorInlayHintForeground = registerColor('editorInlayHint.foreground', { dark: '#969696', light: '#969696', hcDark: Color.white, hcLight: Color.black }, nls.localize('editorInlayHintForeground', 'Foreground color of inline hints'));\nexport const editorInlayHintBackground = registerColor('editorInlayHint.background', { dark: transparent(badgeBackground, .10), light: transparent(badgeBackground, .10), hcDark: transparent(Color.white, .10), hcLight: transparent(badgeBackground, .10) }, nls.localize('editorInlayHintBackground', 'Background color of inline hints'));\nexport const editorInlayHintTypeForeground = registerColor('editorInlayHint.typeForeground', { dark: editorInlayHintForeground, light: editorInlayHintForeground, hcDark: editorInlayHintForeground, hcLight: editorInlayHintForeground }, nls.localize('editorInlayHintForegroundTypes', 'Foreground color of inline hints for types'));\nexport const editorInlayHintTypeBackground = registerColor('editorInlayHint.typeBackground', { dark: editorInlayHintBackground, light: editorInlayHintBackground, hcDark: editorInlayHintBackground, hcLight: editorInlayHintBackground }, nls.localize('editorInlayHintBackgroundTypes', 'Background color of inline hints for types'));\nexport const editorInlayHintParameterForeground = registerColor('editorInlayHint.parameterForeground', { dark: editorInlayHintForeground, light: editorInlayHintForeground, hcDark: editorInlayHintForeground, hcLight: editorInlayHintForeground }, nls.localize('editorInlayHintForegroundParameter', 'Foreground color of inline hints for parameters'));\nexport const editorInlayHintParameterBackground = registerColor('editorInlayHint.parameterBackground', { dark: editorInlayHintBackground, light: editorInlayHintBackground, hcDark: editorInlayHintBackground, hcLight: editorInlayHintBackground }, nls.localize('editorInlayHintBackgroundParameter', 'Background color of inline hints for parameters'));\n/**\n * Editor lightbulb icon colors\n */\nexport const editorLightBulbForeground = registerColor('editorLightBulb.foreground', { dark: '#FFCC00', light: '#DDB100', hcDark: '#FFCC00', hcLight: '#007ACC' }, nls.localize('editorLightBulbForeground', \"The color used for the lightbulb actions icon.\"));\nexport const editorLightBulbAutoFixForeground = registerColor('editorLightBulbAutoFix.foreground', { dark: '#75BEFF', light: '#007ACC', hcDark: '#75BEFF', hcLight: '#007ACC' }, nls.localize('editorLightBulbAutoFixForeground', \"The color used for the lightbulb auto fix actions icon.\"));\nexport const editorLightBulbAiForeground = registerColor('editorLightBulbAi.foreground', { dark: editorLightBulbForeground, light: editorLightBulbForeground, hcDark: editorLightBulbForeground, hcLight: editorLightBulbForeground }, nls.localize('editorLightBulbAiForeground', \"The color used for the lightbulb AI icon.\"));\n/**\n * Diff Editor Colors\n */\nexport const defaultInsertColor = new Color(new RGBA(155, 185, 85, .2));\nexport const defaultRemoveColor = new Color(new RGBA(255, 0, 0, .2));\nexport const diffInserted = registerColor('diffEditor.insertedTextBackground', { dark: '#9ccc2c33', light: '#9ccc2c40', hcDark: null, hcLight: null }, nls.localize('diffEditorInserted', 'Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const diffRemoved = registerColor('diffEditor.removedTextBackground', { dark: '#ff000033', light: '#ff000033', hcDark: null, hcLight: null }, nls.localize('diffEditorRemoved', 'Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const diffInsertedLine = registerColor('diffEditor.insertedLineBackground', { dark: defaultInsertColor, light: defaultInsertColor, hcDark: null, hcLight: null }, nls.localize('diffEditorInsertedLines', 'Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const diffRemovedLine = registerColor('diffEditor.removedLineBackground', { dark: defaultRemoveColor, light: defaultRemoveColor, hcDark: null, hcLight: null }, nls.localize('diffEditorRemovedLines', 'Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const diffInsertedLineGutter = registerColor('diffEditorGutter.insertedLineBackground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('diffEditorInsertedLineGutter', 'Background color for the margin where lines got inserted.'));\nexport const diffRemovedLineGutter = registerColor('diffEditorGutter.removedLineBackground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('diffEditorRemovedLineGutter', 'Background color for the margin where lines got removed.'));\nexport const diffOverviewRulerInserted = registerColor('diffEditorOverview.insertedForeground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('diffEditorOverviewInserted', 'Diff overview ruler foreground for inserted content.'));\nexport const diffOverviewRulerRemoved = registerColor('diffEditorOverview.removedForeground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('diffEditorOverviewRemoved', 'Diff overview ruler foreground for removed content.'));\nexport const diffInsertedOutline = registerColor('diffEditor.insertedTextBorder', { dark: null, light: null, hcDark: '#33ff2eff', hcLight: '#374E06' }, nls.localize('diffEditorInsertedOutline', 'Outline color for the text that got inserted.'));\nexport const diffRemovedOutline = registerColor('diffEditor.removedTextBorder', { dark: null, light: null, hcDark: '#FF008F', hcLight: '#AD0707' }, nls.localize('diffEditorRemovedOutline', 'Outline color for text that got removed.'));\nexport const diffBorder = registerColor('diffEditor.border', { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('diffEditorBorder', 'Border color between the two text editors.'));\nexport const diffDiagonalFill = registerColor('diffEditor.diagonalFill', { dark: '#cccccc33', light: '#22222233', hcDark: null, hcLight: null }, nls.localize('diffDiagonalFill', \"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.\"));\nexport const diffUnchangedRegionBackground = registerColor('diffEditor.unchangedRegionBackground', { dark: 'sideBar.background', light: 'sideBar.background', hcDark: 'sideBar.background', hcLight: 'sideBar.background' }, nls.localize('diffEditor.unchangedRegionBackground', \"The background color of unchanged blocks in the diff editor.\"));\nexport const diffUnchangedRegionForeground = registerColor('diffEditor.unchangedRegionForeground', { dark: 'foreground', light: 'foreground', hcDark: 'foreground', hcLight: 'foreground' }, nls.localize('diffEditor.unchangedRegionForeground', \"The foreground color of unchanged blocks in the diff editor.\"));\nexport const diffUnchangedTextBackground = registerColor('diffEditor.unchangedCodeBackground', { dark: '#74747429', light: '#b8b8b829', hcDark: null, hcLight: null }, nls.localize('diffEditor.unchangedCodeBackground', \"The background color of unchanged code in the diff editor.\"));\n/**\n * List and tree colors\n */\nexport const listFocusBackground = registerColor('list.focusBackground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('listFocusBackground', \"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listFocusForeground = registerColor('list.focusForeground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('listFocusForeground', \"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listFocusOutline = registerColor('list.focusOutline', { dark: focusBorder, light: focusBorder, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize('listFocusOutline', \"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listFocusAndSelectionOutline = registerColor('list.focusAndSelectionOutline', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('listFocusAndSelectionOutline', \"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listActiveSelectionBackground = registerColor('list.activeSelectionBackground', { dark: '#04395E', light: '#0060C0', hcDark: null, hcLight: Color.fromHex('#0F4A85').transparent(0.1) }, nls.localize('listActiveSelectionBackground', \"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listActiveSelectionForeground = registerColor('list.activeSelectionForeground', { dark: Color.white, light: Color.white, hcDark: null, hcLight: null }, nls.localize('listActiveSelectionForeground', \"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listActiveSelectionIconForeground = registerColor('list.activeSelectionIconForeground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('listActiveSelectionIconForeground', \"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listInactiveSelectionBackground = registerColor('list.inactiveSelectionBackground', { dark: '#37373D', light: '#E4E6F1', hcDark: null, hcLight: Color.fromHex('#0F4A85').transparent(0.1) }, nls.localize('listInactiveSelectionBackground', \"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listInactiveSelectionForeground = registerColor('list.inactiveSelectionForeground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('listInactiveSelectionForeground', \"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listInactiveSelectionIconForeground = registerColor('list.inactiveSelectionIconForeground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('listInactiveSelectionIconForeground', \"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listInactiveFocusBackground = registerColor('list.inactiveFocusBackground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('listInactiveFocusBackground', \"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listInactiveFocusOutline = registerColor('list.inactiveFocusOutline', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('listInactiveFocusOutline', \"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.\"));\nexport const listHoverBackground = registerColor('list.hoverBackground', { dark: '#2A2D2E', light: '#F0F0F0', hcDark: Color.white.transparent(0.1), hcLight: Color.fromHex('#0F4A85').transparent(0.1) }, nls.localize('listHoverBackground', \"List/Tree background when hovering over items using the mouse.\"));\nexport const listHoverForeground = registerColor('list.hoverForeground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('listHoverForeground', \"List/Tree foreground when hovering over items using the mouse.\"));\nexport const listDropOverBackground = registerColor('list.dropBackground', { dark: '#062F4A', light: '#D6EBFF', hcDark: null, hcLight: null }, nls.localize('listDropBackground', \"List/Tree drag and drop background when moving items over other items when using the mouse.\"));\nexport const listDropBetweenBackground = registerColor('list.dropBetweenBackground', { dark: iconForeground, light: iconForeground, hcDark: null, hcLight: null }, nls.localize('listDropBetweenBackground', \"List/Tree drag and drop border color when moving items between items when using the mouse.\"));\nexport const listHighlightForeground = registerColor('list.highlightForeground', { dark: '#2AAAFF', light: '#0066BF', hcDark: focusBorder, hcLight: focusBorder }, nls.localize('highlight', 'List/Tree foreground color of the match highlights when searching inside the list/tree.'));\nexport const listFocusHighlightForeground = registerColor('list.focusHighlightForeground', { dark: listHighlightForeground, light: ifDefinedThenElse(listActiveSelectionBackground, listHighlightForeground, '#BBE7FF'), hcDark: listHighlightForeground, hcLight: listHighlightForeground }, nls.localize('listFocusHighlightForeground', 'List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.'));\nexport const listInvalidItemForeground = registerColor('list.invalidItemForeground', { dark: '#B89500', light: '#B89500', hcDark: '#B89500', hcLight: '#B5200D' }, nls.localize('invalidItemForeground', 'List/Tree foreground color for invalid items, for example an unresolved root in explorer.'));\nexport const listErrorForeground = registerColor('list.errorForeground', { dark: '#F88070', light: '#B01011', hcDark: null, hcLight: null }, nls.localize('listErrorForeground', 'Foreground color of list items containing errors.'));\nexport const listWarningForeground = registerColor('list.warningForeground', { dark: '#CCA700', light: '#855F00', hcDark: null, hcLight: null }, nls.localize('listWarningForeground', 'Foreground color of list items containing warnings.'));\nexport const listFilterWidgetBackground = registerColor('listFilterWidget.background', { light: darken(editorWidgetBackground, 0), dark: lighten(editorWidgetBackground, 0), hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, nls.localize('listFilterWidgetBackground', 'Background color of the type filter widget in lists and trees.'));\nexport const listFilterWidgetOutline = registerColor('listFilterWidget.outline', { dark: Color.transparent, light: Color.transparent, hcDark: '#f38518', hcLight: '#007ACC' }, nls.localize('listFilterWidgetOutline', 'Outline color of the type filter widget in lists and trees.'));\nexport const listFilterWidgetNoMatchesOutline = registerColor('listFilterWidget.noMatchesOutline', { dark: '#BE1100', light: '#BE1100', hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('listFilterWidgetNoMatchesOutline', 'Outline color of the type filter widget in lists and trees, when there are no matches.'));\nexport const listFilterWidgetShadow = registerColor('listFilterWidget.shadow', { dark: widgetShadow, light: widgetShadow, hcDark: widgetShadow, hcLight: widgetShadow }, nls.localize('listFilterWidgetShadow', 'Shadow color of the type filter widget in lists and trees.'));\nexport const listFilterMatchHighlight = registerColor('list.filterMatchBackground', { dark: editorFindMatchHighlight, light: editorFindMatchHighlight, hcDark: null, hcLight: null }, nls.localize('listFilterMatchHighlight', 'Background color of the filtered match.'));\nexport const listFilterMatchHighlightBorder = registerColor('list.filterMatchBorder', { dark: editorFindMatchHighlightBorder, light: editorFindMatchHighlightBorder, hcDark: contrastBorder, hcLight: activeContrastBorder }, nls.localize('listFilterMatchHighlightBorder', 'Border color of the filtered match.'));\nexport const treeIndentGuidesStroke = registerColor('tree.indentGuidesStroke', { dark: '#585858', light: '#a9a9a9', hcDark: '#a9a9a9', hcLight: '#a5a5a5' }, nls.localize('treeIndentGuidesStroke', \"Tree stroke color for the indentation guides.\"));\nexport const treeInactiveIndentGuidesStroke = registerColor('tree.inactiveIndentGuidesStroke', { dark: transparent(treeIndentGuidesStroke, 0.4), light: transparent(treeIndentGuidesStroke, 0.4), hcDark: transparent(treeIndentGuidesStroke, 0.4), hcLight: transparent(treeIndentGuidesStroke, 0.4) }, nls.localize('treeInactiveIndentGuidesStroke', \"Tree stroke color for the indentation guides that are not active.\"));\nexport const tableColumnsBorder = registerColor('tree.tableColumnsBorder', { dark: '#CCCCCC20', light: '#61616120', hcDark: null, hcLight: null }, nls.localize('tableColumnsBorder', \"Table border color between columns.\"));\nexport const tableOddRowsBackgroundColor = registerColor('tree.tableOddRowsBackground', { dark: transparent(foreground, 0.04), light: transparent(foreground, 0.04), hcDark: null, hcLight: null }, nls.localize('tableOddRowsBackgroundColor', \"Background color for odd table rows.\"));\nexport const listDeemphasizedForeground = registerColor('list.deemphasizedForeground', { dark: '#8C8C8C', light: '#8E8E90', hcDark: '#A7A8A9', hcLight: '#666666' }, nls.localize('listDeemphasizedForeground', \"List/Tree foreground color for items that are deemphasized. \"));\n/**\n * Checkboxes\n */\nexport const checkboxBackground = registerColor('checkbox.background', { dark: selectBackground, light: selectBackground, hcDark: selectBackground, hcLight: selectBackground }, nls.localize('checkbox.background', \"Background color of checkbox widget.\"));\nexport const checkboxSelectBackground = registerColor('checkbox.selectBackground', { dark: editorWidgetBackground, light: editorWidgetBackground, hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, nls.localize('checkbox.select.background', \"Background color of checkbox widget when the element it's in is selected.\"));\nexport const checkboxForeground = registerColor('checkbox.foreground', { dark: selectForeground, light: selectForeground, hcDark: selectForeground, hcLight: selectForeground }, nls.localize('checkbox.foreground', \"Foreground color of checkbox widget.\"));\nexport const checkboxBorder = registerColor('checkbox.border', { dark: selectBorder, light: selectBorder, hcDark: selectBorder, hcLight: selectBorder }, nls.localize('checkbox.border', \"Border color of checkbox widget.\"));\nexport const checkboxSelectBorder = registerColor('checkbox.selectBorder', { dark: iconForeground, light: iconForeground, hcDark: iconForeground, hcLight: iconForeground }, nls.localize('checkbox.select.border', \"Border color of checkbox widget when the element it's in is selected.\"));\n/**\n * Quick pick widget (dependent on List and tree colors)\n */\nexport const _deprecatedQuickInputListFocusBackground = registerColor('quickInput.list.focusBackground', { dark: null, light: null, hcDark: null, hcLight: null }, '', undefined, nls.localize('quickInput.list.focusBackground deprecation', \"Please use quickInputList.focusBackground instead\"));\nexport const quickInputListFocusForeground = registerColor('quickInputList.focusForeground', { dark: listActiveSelectionForeground, light: listActiveSelectionForeground, hcDark: listActiveSelectionForeground, hcLight: listActiveSelectionForeground }, nls.localize('quickInput.listFocusForeground', \"Quick picker foreground color for the focused item.\"));\nexport const quickInputListFocusIconForeground = registerColor('quickInputList.focusIconForeground', { dark: listActiveSelectionIconForeground, light: listActiveSelectionIconForeground, hcDark: listActiveSelectionIconForeground, hcLight: listActiveSelectionIconForeground }, nls.localize('quickInput.listFocusIconForeground', \"Quick picker icon foreground color for the focused item.\"));\nexport const quickInputListFocusBackground = registerColor('quickInputList.focusBackground', { dark: oneOf(_deprecatedQuickInputListFocusBackground, listActiveSelectionBackground), light: oneOf(_deprecatedQuickInputListFocusBackground, listActiveSelectionBackground), hcDark: null, hcLight: null }, nls.localize('quickInput.listFocusBackground', \"Quick picker background color for the focused item.\"));\n/**\n * Menu colors\n */\nexport const menuBorder = registerColor('menu.border', { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('menuBorder', \"Border color of menus.\"));\nexport const menuForeground = registerColor('menu.foreground', { dark: selectForeground, light: selectForeground, hcDark: selectForeground, hcLight: selectForeground }, nls.localize('menuForeground', \"Foreground color of menu items.\"));\nexport const menuBackground = registerColor('menu.background', { dark: selectBackground, light: selectBackground, hcDark: selectBackground, hcLight: selectBackground }, nls.localize('menuBackground', \"Background color of menu items.\"));\nexport const menuSelectionForeground = registerColor('menu.selectionForeground', { dark: listActiveSelectionForeground, light: listActiveSelectionForeground, hcDark: listActiveSelectionForeground, hcLight: listActiveSelectionForeground }, nls.localize('menuSelectionForeground', \"Foreground color of the selected menu item in menus.\"));\nexport const menuSelectionBackground = registerColor('menu.selectionBackground', { dark: listActiveSelectionBackground, light: listActiveSelectionBackground, hcDark: listActiveSelectionBackground, hcLight: listActiveSelectionBackground }, nls.localize('menuSelectionBackground', \"Background color of the selected menu item in menus.\"));\nexport const menuSelectionBorder = registerColor('menu.selectionBorder', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize('menuSelectionBorder', \"Border color of the selected menu item in menus.\"));\nexport const menuSeparatorBackground = registerColor('menu.separatorBackground', { dark: '#606060', light: '#D4D4D4', hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('menuSeparatorBackground', \"Color of a separator menu item in menus.\"));\n/**\n * Toolbar colors\n */\nexport const toolbarHoverBackground = registerColor('toolbar.hoverBackground', { dark: '#5a5d5e50', light: '#b8b8b850', hcDark: null, hcLight: null }, nls.localize('toolbarHoverBackground', \"Toolbar background when hovering over actions using the mouse\"));\nexport const toolbarHoverOutline = registerColor('toolbar.hoverOutline', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize('toolbarHoverOutline', \"Toolbar outline when hovering over actions using the mouse\"));\nexport const toolbarActiveBackground = registerColor('toolbar.activeBackground', { dark: lighten(toolbarHoverBackground, 0.1), light: darken(toolbarHoverBackground, 0.1), hcDark: null, hcLight: null }, nls.localize('toolbarActiveBackground', \"Toolbar background when holding the mouse over actions\"));\n/**\n * Snippet placeholder colors\n */\nexport const snippetTabstopHighlightBackground = registerColor('editor.snippetTabstopHighlightBackground', { dark: new Color(new RGBA(124, 124, 124, 0.3)), light: new Color(new RGBA(10, 50, 100, 0.2)), hcDark: new Color(new RGBA(124, 124, 124, 0.3)), hcLight: new Color(new RGBA(10, 50, 100, 0.2)) }, nls.localize('snippetTabstopHighlightBackground', \"Highlight background color of a snippet tabstop.\"));\nexport const snippetTabstopHighlightBorder = registerColor('editor.snippetTabstopHighlightBorder', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('snippetTabstopHighlightBorder', \"Highlight border color of a snippet tabstop.\"));\nexport const snippetFinalTabstopHighlightBackground = registerColor('editor.snippetFinalTabstopHighlightBackground', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('snippetFinalTabstopHighlightBackground', \"Highlight background color of the final tabstop of a snippet.\"));\nexport const snippetFinalTabstopHighlightBorder = registerColor('editor.snippetFinalTabstopHighlightBorder', { dark: '#525252', light: new Color(new RGBA(10, 50, 100, 0.5)), hcDark: '#525252', hcLight: '#292929' }, nls.localize('snippetFinalTabstopHighlightBorder', \"Highlight border color of the final tabstop of a snippet.\"));\n/**\n * Breadcrumb colors\n */\nexport const breadcrumbsForeground = registerColor('breadcrumb.foreground', { light: transparent(foreground, 0.8), dark: transparent(foreground, 0.8), hcDark: transparent(foreground, 0.8), hcLight: transparent(foreground, 0.8) }, nls.localize('breadcrumbsFocusForeground', \"Color of focused breadcrumb items.\"));\nexport const breadcrumbsBackground = registerColor('breadcrumb.background', { light: editorBackground, dark: editorBackground, hcDark: editorBackground, hcLight: editorBackground }, nls.localize('breadcrumbsBackground', \"Background color of breadcrumb items.\"));\nexport const breadcrumbsFocusForeground = registerColor('breadcrumb.focusForeground', { light: darken(foreground, 0.2), dark: lighten(foreground, 0.1), hcDark: lighten(foreground, 0.1), hcLight: lighten(foreground, 0.1) }, nls.localize('breadcrumbsFocusForeground', \"Color of focused breadcrumb items.\"));\nexport const breadcrumbsActiveSelectionForeground = registerColor('breadcrumb.activeSelectionForeground', { light: darken(foreground, 0.2), dark: lighten(foreground, 0.1), hcDark: lighten(foreground, 0.1), hcLight: lighten(foreground, 0.1) }, nls.localize('breadcrumbsSelectedForeground', \"Color of selected breadcrumb items.\"));\nexport const breadcrumbsPickerBackground = registerColor('breadcrumbPicker.background', { light: editorWidgetBackground, dark: editorWidgetBackground, hcDark: editorWidgetBackground, hcLight: editorWidgetBackground }, nls.localize('breadcrumbsSelectedBackground', \"Background color of breadcrumb item picker.\"));\n/**\n * Merge-conflict colors\n */\nconst headerTransparency = 0.5;\nconst currentBaseColor = Color.fromHex('#40C8AE').transparent(headerTransparency);\nconst incomingBaseColor = Color.fromHex('#40A6FF').transparent(headerTransparency);\nconst commonBaseColor = Color.fromHex('#606060').transparent(0.4);\nconst contentTransparency = 0.4;\nconst rulerTransparency = 1;\nexport const mergeCurrentHeaderBackground = registerColor('merge.currentHeaderBackground', { dark: currentBaseColor, light: currentBaseColor, hcDark: null, hcLight: null }, nls.localize('mergeCurrentHeaderBackground', 'Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const mergeCurrentContentBackground = registerColor('merge.currentContentBackground', { dark: transparent(mergeCurrentHeaderBackground, contentTransparency), light: transparent(mergeCurrentHeaderBackground, contentTransparency), hcDark: transparent(mergeCurrentHeaderBackground, contentTransparency), hcLight: transparent(mergeCurrentHeaderBackground, contentTransparency) }, nls.localize('mergeCurrentContentBackground', 'Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const mergeIncomingHeaderBackground = registerColor('merge.incomingHeaderBackground', { dark: incomingBaseColor, light: incomingBaseColor, hcDark: null, hcLight: null }, nls.localize('mergeIncomingHeaderBackground', 'Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const mergeIncomingContentBackground = registerColor('merge.incomingContentBackground', { dark: transparent(mergeIncomingHeaderBackground, contentTransparency), light: transparent(mergeIncomingHeaderBackground, contentTransparency), hcDark: transparent(mergeIncomingHeaderBackground, contentTransparency), hcLight: transparent(mergeIncomingHeaderBackground, contentTransparency) }, nls.localize('mergeIncomingContentBackground', 'Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const mergeCommonHeaderBackground = registerColor('merge.commonHeaderBackground', { dark: commonBaseColor, light: commonBaseColor, hcDark: null, hcLight: null }, nls.localize('mergeCommonHeaderBackground', 'Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const mergeCommonContentBackground = registerColor('merge.commonContentBackground', { dark: transparent(mergeCommonHeaderBackground, contentTransparency), light: transparent(mergeCommonHeaderBackground, contentTransparency), hcDark: transparent(mergeCommonHeaderBackground, contentTransparency), hcLight: transparent(mergeCommonHeaderBackground, contentTransparency) }, nls.localize('mergeCommonContentBackground', 'Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const mergeBorder = registerColor('merge.border', { dark: null, light: null, hcDark: '#C3DF6F', hcLight: '#007ACC' }, nls.localize('mergeBorder', 'Border color on headers and the splitter in inline merge-conflicts.'));\nexport const overviewRulerCurrentContentForeground = registerColor('editorOverviewRuler.currentContentForeground', { dark: transparent(mergeCurrentHeaderBackground, rulerTransparency), light: transparent(mergeCurrentHeaderBackground, rulerTransparency), hcDark: mergeBorder, hcLight: mergeBorder }, nls.localize('overviewRulerCurrentContentForeground', 'Current overview ruler foreground for inline merge-conflicts.'));\nexport const overviewRulerIncomingContentForeground = registerColor('editorOverviewRuler.incomingContentForeground', { dark: transparent(mergeIncomingHeaderBackground, rulerTransparency), light: transparent(mergeIncomingHeaderBackground, rulerTransparency), hcDark: mergeBorder, hcLight: mergeBorder }, nls.localize('overviewRulerIncomingContentForeground', 'Incoming overview ruler foreground for inline merge-conflicts.'));\nexport const overviewRulerCommonContentForeground = registerColor('editorOverviewRuler.commonContentForeground', { dark: transparent(mergeCommonHeaderBackground, rulerTransparency), light: transparent(mergeCommonHeaderBackground, rulerTransparency), hcDark: mergeBorder, hcLight: mergeBorder }, nls.localize('overviewRulerCommonContentForeground', 'Common ancestor overview ruler foreground for inline merge-conflicts.'));\nexport const overviewRulerFindMatchForeground = registerColor('editorOverviewRuler.findMatchForeground', { dark: '#d186167e', light: '#d186167e', hcDark: '#AB5A00', hcLight: '' }, nls.localize('overviewRulerFindMatchForeground', 'Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const overviewRulerSelectionHighlightForeground = registerColor('editorOverviewRuler.selectionHighlightForeground', { dark: '#A0A0A0CC', light: '#A0A0A0CC', hcDark: '#A0A0A0CC', hcLight: '#A0A0A0CC' }, nls.localize('overviewRulerSelectionHighlightForeground', 'Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations.'), true);\nexport const minimapFindMatch = registerColor('minimap.findMatchHighlight', { light: '#d18616', dark: '#d18616', hcDark: '#AB5A00', hcLight: '#0F4A85' }, nls.localize('minimapFindMatchHighlight', 'Minimap marker color for find matches.'), true);\nexport const minimapSelectionOccurrenceHighlight = registerColor('minimap.selectionOccurrenceHighlight', { light: '#c9c9c9', dark: '#676767', hcDark: '#ffffff', hcLight: '#0F4A85' }, nls.localize('minimapSelectionOccurrenceHighlight', 'Minimap marker color for repeating editor selections.'), true);\nexport const minimapSelection = registerColor('minimap.selectionHighlight', { light: '#ADD6FF', dark: '#264F78', hcDark: '#ffffff', hcLight: '#0F4A85' }, nls.localize('minimapSelectionHighlight', 'Minimap marker color for the editor selection.'), true);\nexport const minimapInfo = registerColor('minimap.infoHighlight', { dark: editorInfoForeground, light: editorInfoForeground, hcDark: editorInfoBorder, hcLight: editorInfoBorder }, nls.localize('minimapInfo', 'Minimap marker color for infos.'));\nexport const minimapWarning = registerColor('minimap.warningHighlight', { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningBorder, hcLight: editorWarningBorder }, nls.localize('overviewRuleWarning', 'Minimap marker color for warnings.'));\nexport const minimapError = registerColor('minimap.errorHighlight', { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hcDark: new Color(new RGBA(255, 50, 50, 1)), hcLight: '#B5200D' }, nls.localize('minimapError', 'Minimap marker color for errors.'));\nexport const minimapBackground = registerColor('minimap.background', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('minimapBackground', \"Minimap background color.\"));\nexport const minimapForegroundOpacity = registerColor('minimap.foregroundOpacity', { dark: Color.fromHex('#000f'), light: Color.fromHex('#000f'), hcDark: Color.fromHex('#000f'), hcLight: Color.fromHex('#000f') }, nls.localize('minimapForegroundOpacity', 'Opacity of foreground elements rendered in the minimap. For example, \"#000000c0\" will render the elements with 75% opacity.'));\nexport const minimapSliderBackground = registerColor('minimapSlider.background', { light: transparent(scrollbarSliderBackground, 0.5), dark: transparent(scrollbarSliderBackground, 0.5), hcDark: transparent(scrollbarSliderBackground, 0.5), hcLight: transparent(scrollbarSliderBackground, 0.5) }, nls.localize('minimapSliderBackground', \"Minimap slider background color.\"));\nexport const minimapSliderHoverBackground = registerColor('minimapSlider.hoverBackground', { light: transparent(scrollbarSliderHoverBackground, 0.5), dark: transparent(scrollbarSliderHoverBackground, 0.5), hcDark: transparent(scrollbarSliderHoverBackground, 0.5), hcLight: transparent(scrollbarSliderHoverBackground, 0.5) }, nls.localize('minimapSliderHoverBackground', \"Minimap slider background color when hovering.\"));\nexport const minimapSliderActiveBackground = registerColor('minimapSlider.activeBackground', { light: transparent(scrollbarSliderActiveBackground, 0.5), dark: transparent(scrollbarSliderActiveBackground, 0.5), hcDark: transparent(scrollbarSliderActiveBackground, 0.5), hcLight: transparent(scrollbarSliderActiveBackground, 0.5) }, nls.localize('minimapSliderActiveBackground', \"Minimap slider background color when clicked on.\"));\nexport const problemsErrorIconForeground = registerColor('problemsErrorIcon.foreground', { dark: editorErrorForeground, light: editorErrorForeground, hcDark: editorErrorForeground, hcLight: editorErrorForeground }, nls.localize('problemsErrorIconForeground', \"The color used for the problems error icon.\"));\nexport const problemsWarningIconForeground = registerColor('problemsWarningIcon.foreground', { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningForeground, hcLight: editorWarningForeground }, nls.localize('problemsWarningIconForeground', \"The color used for the problems warning icon.\"));\nexport const problemsInfoIconForeground = registerColor('problemsInfoIcon.foreground', { dark: editorInfoForeground, light: editorInfoForeground, hcDark: editorInfoForeground, hcLight: editorInfoForeground }, nls.localize('problemsInfoIconForeground', \"The color used for the problems info icon.\"));\n/**\n * Chart colors\n */\nexport const chartsForeground = registerColor('charts.foreground', { dark: foreground, light: foreground, hcDark: foreground, hcLight: foreground }, nls.localize('chartsForeground', \"The foreground color used in charts.\"));\nexport const chartsLines = registerColor('charts.lines', { dark: transparent(foreground, .5), light: transparent(foreground, .5), hcDark: transparent(foreground, .5), hcLight: transparent(foreground, .5) }, nls.localize('chartsLines', \"The color used for horizontal lines in charts.\"));\nexport const chartsRed = registerColor('charts.red', { dark: editorErrorForeground, light: editorErrorForeground, hcDark: editorErrorForeground, hcLight: editorErrorForeground }, nls.localize('chartsRed', \"The red color used in chart visualizations.\"));\nexport const chartsBlue = registerColor('charts.blue', { dark: editorInfoForeground, light: editorInfoForeground, hcDark: editorInfoForeground, hcLight: editorInfoForeground }, nls.localize('chartsBlue', \"The blue color used in chart visualizations.\"));\nexport const chartsYellow = registerColor('charts.yellow', { dark: editorWarningForeground, light: editorWarningForeground, hcDark: editorWarningForeground, hcLight: editorWarningForeground }, nls.localize('chartsYellow', \"The yellow color used in chart visualizations.\"));\nexport const chartsOrange = registerColor('charts.orange', { dark: minimapFindMatch, light: minimapFindMatch, hcDark: minimapFindMatch, hcLight: minimapFindMatch }, nls.localize('chartsOrange', \"The orange color used in chart visualizations.\"));\nexport const chartsGreen = registerColor('charts.green', { dark: '#89D185', light: '#388A34', hcDark: '#89D185', hcLight: '#374e06' }, nls.localize('chartsGreen', \"The green color used in chart visualizations.\"));\nexport const chartsPurple = registerColor('charts.purple', { dark: '#B180D7', light: '#652D90', hcDark: '#B180D7', hcLight: '#652D90' }, nls.localize('chartsPurple', \"The purple color used in chart visualizations.\"));\n// ----- color functions\nexport function executeTransform(transform, theme) {\n var _a, _b, _c, _d;\n switch (transform.op) {\n case 0 /* ColorTransformType.Darken */:\n return (_a = resolveColorValue(transform.value, theme)) === null || _a === void 0 ? void 0 : _a.darken(transform.factor);\n case 1 /* ColorTransformType.Lighten */:\n return (_b = resolveColorValue(transform.value, theme)) === null || _b === void 0 ? void 0 : _b.lighten(transform.factor);\n case 2 /* ColorTransformType.Transparent */:\n return (_c = resolveColorValue(transform.value, theme)) === null || _c === void 0 ? void 0 : _c.transparent(transform.factor);\n case 3 /* ColorTransformType.Opaque */: {\n const backgroundColor = resolveColorValue(transform.background, theme);\n if (!backgroundColor) {\n return resolveColorValue(transform.value, theme);\n }\n return (_d = resolveColorValue(transform.value, theme)) === null || _d === void 0 ? void 0 : _d.makeOpaque(backgroundColor);\n }\n case 4 /* ColorTransformType.OneOf */:\n for (const candidate of transform.values) {\n const color = resolveColorValue(candidate, theme);\n if (color) {\n return color;\n }\n }\n return undefined;\n case 6 /* ColorTransformType.IfDefinedThenElse */:\n return resolveColorValue(theme.defines(transform.if) ? transform.then : transform.else, theme);\n case 5 /* ColorTransformType.LessProminent */: {\n const from = resolveColorValue(transform.value, theme);\n if (!from) {\n return undefined;\n }\n const backgroundColor = resolveColorValue(transform.background, theme);\n if (!backgroundColor) {\n return from.transparent(transform.factor * transform.transparency);\n }\n return from.isDarkerThan(backgroundColor)\n ? Color.getLighterColor(from, backgroundColor, transform.factor).transparent(transform.transparency)\n : Color.getDarkerColor(from, backgroundColor, transform.factor).transparent(transform.transparency);\n }\n default:\n throw assertNever(transform);\n }\n}\nexport function darken(colorValue, factor) {\n return { op: 0 /* ColorTransformType.Darken */, value: colorValue, factor };\n}\nexport function lighten(colorValue, factor) {\n return { op: 1 /* ColorTransformType.Lighten */, value: colorValue, factor };\n}\nexport function transparent(colorValue, factor) {\n return { op: 2 /* ColorTransformType.Transparent */, value: colorValue, factor };\n}\nexport function oneOf(...colorValues) {\n return { op: 4 /* ColorTransformType.OneOf */, values: colorValues };\n}\nexport function ifDefinedThenElse(ifArg, thenArg, elseArg) {\n return { op: 6 /* ColorTransformType.IfDefinedThenElse */, if: ifArg, then: thenArg, else: elseArg };\n}\nfunction lessProminent(colorValue, backgroundColorValue, factor, transparency) {\n return { op: 5 /* ColorTransformType.LessProminent */, value: colorValue, background: backgroundColorValue, factor, transparency };\n}\n// ----- implementation\n/**\n * @param colorValue Resolve a color value in the context of a theme\n */\nexport function resolveColorValue(colorValue, theme) {\n if (colorValue === null) {\n return undefined;\n }\n else if (typeof colorValue === 'string') {\n if (colorValue[0] === '#') {\n return Color.fromHex(colorValue);\n }\n return theme.getColor(colorValue);\n }\n else if (colorValue instanceof Color) {\n return colorValue;\n }\n else if (typeof colorValue === 'object') {\n return executeTransform(colorValue, theme);\n }\n return undefined;\n}\nexport const workbenchColorsSchemaId = 'vscode://schemas/workbench-colors';\nconst schemaRegistry = platform.Registry.as(JSONExtensions.JSONContribution);\nschemaRegistry.registerSchema(workbenchColorsSchemaId, colorRegistry.getColorSchema());\nconst delayer = new RunOnceScheduler(() => schemaRegistry.notifySchemaChanged(workbenchColorsSchemaId), 200);\ncolorRegistry.onDidChangeSchema(() => {\n if (!delayer.isScheduled()) {\n delayer.schedule();\n }\n});\n// setTimeout(_ => console.log(colorRegistry.toString()), 5000);\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as dom from '../../base/browser/dom.js';\nimport { GlobalPointerMoveMonitor } from '../../base/browser/globalPointerMoveMonitor.js';\nimport { StandardMouseEvent } from '../../base/browser/mouseEvent.js';\nimport { RunOnceScheduler } from '../../base/common/async.js';\nimport { Disposable, DisposableStore } from '../../base/common/lifecycle.js';\nimport { asCssVariable } from '../../platform/theme/common/colorRegistry.js';\n/**\n * Coordinates relative to the whole document (e.g. mouse event's pageX and pageY)\n */\nexport class PageCoordinates {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n this._pageCoordinatesBrand = undefined;\n }\n toClientCoordinates(targetWindow) {\n return new ClientCoordinates(this.x - targetWindow.scrollX, this.y - targetWindow.scrollY);\n }\n}\n/**\n * Coordinates within the application's client area (i.e. origin is document's scroll position).\n *\n * For example, clicking in the top-left corner of the client area will\n * always result in a mouse event with a client.x value of 0, regardless\n * of whether the page is scrolled horizontally.\n */\nexport class ClientCoordinates {\n constructor(clientX, clientY) {\n this.clientX = clientX;\n this.clientY = clientY;\n this._clientCoordinatesBrand = undefined;\n }\n toPageCoordinates(targetWindow) {\n return new PageCoordinates(this.clientX + targetWindow.scrollX, this.clientY + targetWindow.scrollY);\n }\n}\n/**\n * The position of the editor in the page.\n */\nexport class EditorPagePosition {\n constructor(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this._editorPagePositionBrand = undefined;\n }\n}\n/**\n * Coordinates relative to the the (top;left) of the editor that can be used safely with other internal editor metrics.\n * **NOTE**: This position is obtained by taking page coordinates and transforming them relative to the\n * editor's (top;left) position in a way in which scale transformations are taken into account.\n * **NOTE**: These coordinates could be negative if the mouse position is outside the editor.\n */\nexport class CoordinatesRelativeToEditor {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n this._positionRelativeToEditorBrand = undefined;\n }\n}\nexport function createEditorPagePosition(editorViewDomNode) {\n const editorPos = dom.getDomNodePagePosition(editorViewDomNode);\n return new EditorPagePosition(editorPos.left, editorPos.top, editorPos.width, editorPos.height);\n}\nexport function createCoordinatesRelativeToEditor(editorViewDomNode, editorPagePosition, pos) {\n // The editor's page position is read from the DOM using getBoundingClientRect().\n //\n // getBoundingClientRect() returns the actual dimensions, while offsetWidth and offsetHeight\n // reflect the unscaled size. We can use this difference to detect a transform:scale()\n // and we will apply the transformation in inverse to get mouse coordinates that make sense inside the editor.\n //\n // This could be expanded to cover rotation as well maybe by walking the DOM up from `editorViewDomNode`\n // and computing the effective transformation matrix using getComputedStyle(element).transform.\n //\n const scaleX = editorPagePosition.width / editorViewDomNode.offsetWidth;\n const scaleY = editorPagePosition.height / editorViewDomNode.offsetHeight;\n // Adjust mouse offsets if editor appears to be scaled via transforms\n const relativeX = (pos.x - editorPagePosition.x) / scaleX;\n const relativeY = (pos.y - editorPagePosition.y) / scaleY;\n return new CoordinatesRelativeToEditor(relativeX, relativeY);\n}\nexport class EditorMouseEvent extends StandardMouseEvent {\n constructor(e, isFromPointerCapture, editorViewDomNode) {\n super(dom.getWindow(editorViewDomNode), e);\n this._editorMouseEventBrand = undefined;\n this.isFromPointerCapture = isFromPointerCapture;\n this.pos = new PageCoordinates(this.posx, this.posy);\n this.editorPos = createEditorPagePosition(editorViewDomNode);\n this.relativePos = createCoordinatesRelativeToEditor(editorViewDomNode, this.editorPos, this.pos);\n }\n}\nexport class EditorMouseEventFactory {\n constructor(editorViewDomNode) {\n this._editorViewDomNode = editorViewDomNode;\n }\n _create(e) {\n return new EditorMouseEvent(e, false, this._editorViewDomNode);\n }\n onContextMenu(target, callback) {\n return dom.addDisposableListener(target, 'contextmenu', (e) => {\n callback(this._create(e));\n });\n }\n onMouseUp(target, callback) {\n return dom.addDisposableListener(target, 'mouseup', (e) => {\n callback(this._create(e));\n });\n }\n onMouseDown(target, callback) {\n return dom.addDisposableListener(target, dom.EventType.MOUSE_DOWN, (e) => {\n callback(this._create(e));\n });\n }\n onPointerDown(target, callback) {\n return dom.addDisposableListener(target, dom.EventType.POINTER_DOWN, (e) => {\n callback(this._create(e), e.pointerId);\n });\n }\n onMouseLeave(target, callback) {\n return dom.addDisposableListener(target, dom.EventType.MOUSE_LEAVE, (e) => {\n callback(this._create(e));\n });\n }\n onMouseMove(target, callback) {\n return dom.addDisposableListener(target, 'mousemove', (e) => callback(this._create(e)));\n }\n}\nexport class EditorPointerEventFactory {\n constructor(editorViewDomNode) {\n this._editorViewDomNode = editorViewDomNode;\n }\n _create(e) {\n return new EditorMouseEvent(e, false, this._editorViewDomNode);\n }\n onPointerUp(target, callback) {\n return dom.addDisposableListener(target, 'pointerup', (e) => {\n callback(this._create(e));\n });\n }\n onPointerDown(target, callback) {\n return dom.addDisposableListener(target, dom.EventType.POINTER_DOWN, (e) => {\n callback(this._create(e), e.pointerId);\n });\n }\n onPointerLeave(target, callback) {\n return dom.addDisposableListener(target, dom.EventType.POINTER_LEAVE, (e) => {\n callback(this._create(e));\n });\n }\n onPointerMove(target, callback) {\n return dom.addDisposableListener(target, 'pointermove', (e) => callback(this._create(e)));\n }\n}\nexport class GlobalEditorPointerMoveMonitor extends Disposable {\n constructor(editorViewDomNode) {\n super();\n this._editorViewDomNode = editorViewDomNode;\n this._globalPointerMoveMonitor = this._register(new GlobalPointerMoveMonitor());\n this._keydownListener = null;\n }\n startMonitoring(initialElement, pointerId, initialButtons, pointerMoveCallback, onStopCallback) {\n // Add a <> keydown event listener that will cancel the monitoring\n // if something other than a modifier key is pressed\n this._keydownListener = dom.addStandardDisposableListener(initialElement.ownerDocument, 'keydown', (e) => {\n const chord = e.toKeyCodeChord();\n if (chord.isModifierKey()) {\n // Allow modifier keys\n return;\n }\n this._globalPointerMoveMonitor.stopMonitoring(true, e.browserEvent);\n }, true);\n this._globalPointerMoveMonitor.startMonitoring(initialElement, pointerId, initialButtons, (e) => {\n pointerMoveCallback(new EditorMouseEvent(e, true, this._editorViewDomNode));\n }, (e) => {\n this._keydownListener.dispose();\n onStopCallback(e);\n });\n }\n stopMonitoring() {\n this._globalPointerMoveMonitor.stopMonitoring(true);\n }\n}\n/**\n * A helper to create dynamic css rules, bound to a class name.\n * Rules are reused.\n * Reference counting and delayed garbage collection ensure that no rules leak.\n*/\nexport class DynamicCssRules {\n constructor(_editor) {\n this._editor = _editor;\n this._instanceId = ++DynamicCssRules._idPool;\n this._counter = 0;\n this._rules = new Map();\n // We delay garbage collection so that hanging rules can be reused.\n this._garbageCollectionScheduler = new RunOnceScheduler(() => this.garbageCollect(), 1000);\n }\n createClassNameRef(options) {\n const rule = this.getOrCreateRule(options);\n rule.increaseRefCount();\n return {\n className: rule.className,\n dispose: () => {\n rule.decreaseRefCount();\n this._garbageCollectionScheduler.schedule();\n }\n };\n }\n getOrCreateRule(properties) {\n const key = this.computeUniqueKey(properties);\n let existingRule = this._rules.get(key);\n if (!existingRule) {\n const counter = this._counter++;\n existingRule = new RefCountedCssRule(key, `dyn-rule-${this._instanceId}-${counter}`, dom.isInShadowDOM(this._editor.getContainerDomNode())\n ? this._editor.getContainerDomNode()\n : undefined, properties);\n this._rules.set(key, existingRule);\n }\n return existingRule;\n }\n computeUniqueKey(properties) {\n return JSON.stringify(properties);\n }\n garbageCollect() {\n for (const rule of this._rules.values()) {\n if (!rule.hasReferences()) {\n this._rules.delete(rule.key);\n rule.dispose();\n }\n }\n }\n}\nDynamicCssRules._idPool = 0;\nclass RefCountedCssRule {\n constructor(key, className, _containerElement, properties) {\n this.key = key;\n this.className = className;\n this.properties = properties;\n this._referenceCount = 0;\n this._styleElementDisposables = new DisposableStore();\n this._styleElement = dom.createStyleSheet(_containerElement, undefined, this._styleElementDisposables);\n this._styleElement.textContent = this.getCssText(this.className, this.properties);\n }\n getCssText(className, properties) {\n let str = `.${className} {`;\n for (const prop in properties) {\n const value = properties[prop];\n let cssValue;\n if (typeof value === 'object') {\n cssValue = asCssVariable(value.id);\n }\n else {\n cssValue = value;\n }\n const cssPropName = camelToDashes(prop);\n str += `\\n\\t${cssPropName}: ${cssValue};`;\n }\n str += `\\n}`;\n return str;\n }\n dispose() {\n this._styleElementDisposables.dispose();\n this._styleElement = undefined;\n }\n increaseRefCount() {\n this._referenceCount++;\n }\n decreaseRefCount() {\n this._referenceCount--;\n }\n hasReferences() {\n return this._referenceCount > 0;\n }\n}\nfunction camelToDashes(str) {\n return str.replace(/(^[A-Z])/, ([first]) => first.toLowerCase())\n .replace(/([A-Z])/g, ([letter]) => `-${letter.toLowerCase()}`);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Disposable } from '../../base/common/lifecycle.js';\nexport class ViewEventHandler extends Disposable {\n constructor() {\n super();\n this._shouldRender = true;\n }\n shouldRender() {\n return this._shouldRender;\n }\n forceShouldRender() {\n this._shouldRender = true;\n }\n setShouldRender() {\n this._shouldRender = true;\n }\n onDidRender() {\n this._shouldRender = false;\n }\n // --- begin event handlers\n onCompositionStart(e) {\n return false;\n }\n onCompositionEnd(e) {\n return false;\n }\n onConfigurationChanged(e) {\n return false;\n }\n onCursorStateChanged(e) {\n return false;\n }\n onDecorationsChanged(e) {\n return false;\n }\n onFlushed(e) {\n return false;\n }\n onFocusChanged(e) {\n return false;\n }\n onLanguageConfigurationChanged(e) {\n return false;\n }\n onLineMappingChanged(e) {\n return false;\n }\n onLinesChanged(e) {\n return false;\n }\n onLinesDeleted(e) {\n return false;\n }\n onLinesInserted(e) {\n return false;\n }\n onRevealRangeRequest(e) {\n return false;\n }\n onScrollChanged(e) {\n return false;\n }\n onThemeChanged(e) {\n return false;\n }\n onTokensChanged(e) {\n return false;\n }\n onTokensColorsChanged(e) {\n return false;\n }\n onZonesChanged(e) {\n return false;\n }\n // --- end event handlers\n handleEvents(events) {\n let shouldRender = false;\n for (let i = 0, len = events.length; i < len; i++) {\n const e = events[i];\n switch (e.type) {\n case 0 /* viewEvents.ViewEventType.ViewCompositionStart */:\n if (this.onCompositionStart(e)) {\n shouldRender = true;\n }\n break;\n case 1 /* viewEvents.ViewEventType.ViewCompositionEnd */:\n if (this.onCompositionEnd(e)) {\n shouldRender = true;\n }\n break;\n case 2 /* viewEvents.ViewEventType.ViewConfigurationChanged */:\n if (this.onConfigurationChanged(e)) {\n shouldRender = true;\n }\n break;\n case 3 /* viewEvents.ViewEventType.ViewCursorStateChanged */:\n if (this.onCursorStateChanged(e)) {\n shouldRender = true;\n }\n break;\n case 4 /* viewEvents.ViewEventType.ViewDecorationsChanged */:\n if (this.onDecorationsChanged(e)) {\n shouldRender = true;\n }\n break;\n case 5 /* viewEvents.ViewEventType.ViewFlushed */:\n if (this.onFlushed(e)) {\n shouldRender = true;\n }\n break;\n case 6 /* viewEvents.ViewEventType.ViewFocusChanged */:\n if (this.onFocusChanged(e)) {\n shouldRender = true;\n }\n break;\n case 7 /* viewEvents.ViewEventType.ViewLanguageConfigurationChanged */:\n if (this.onLanguageConfigurationChanged(e)) {\n shouldRender = true;\n }\n break;\n case 8 /* viewEvents.ViewEventType.ViewLineMappingChanged */:\n if (this.onLineMappingChanged(e)) {\n shouldRender = true;\n }\n break;\n case 9 /* viewEvents.ViewEventType.ViewLinesChanged */:\n if (this.onLinesChanged(e)) {\n shouldRender = true;\n }\n break;\n case 10 /* viewEvents.ViewEventType.ViewLinesDeleted */:\n if (this.onLinesDeleted(e)) {\n shouldRender = true;\n }\n break;\n case 11 /* viewEvents.ViewEventType.ViewLinesInserted */:\n if (this.onLinesInserted(e)) {\n shouldRender = true;\n }\n break;\n case 12 /* viewEvents.ViewEventType.ViewRevealRangeRequest */:\n if (this.onRevealRangeRequest(e)) {\n shouldRender = true;\n }\n break;\n case 13 /* viewEvents.ViewEventType.ViewScrollChanged */:\n if (this.onScrollChanged(e)) {\n shouldRender = true;\n }\n break;\n case 15 /* viewEvents.ViewEventType.ViewTokensChanged */:\n if (this.onTokensChanged(e)) {\n shouldRender = true;\n }\n break;\n case 14 /* viewEvents.ViewEventType.ViewThemeChanged */:\n if (this.onThemeChanged(e)) {\n shouldRender = true;\n }\n break;\n case 16 /* viewEvents.ViewEventType.ViewTokensColorsChanged */:\n if (this.onTokensColorsChanged(e)) {\n shouldRender = true;\n }\n break;\n case 17 /* viewEvents.ViewEventType.ViewZonesChanged */:\n if (this.onZonesChanged(e)) {\n shouldRender = true;\n }\n break;\n default:\n console.info('View received unknown event: ');\n console.info(e);\n }\n }\n if (shouldRender) {\n this._shouldRender = true;\n }\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { ViewEventHandler } from '../../common/viewEventHandler.js';\nexport class ViewPart extends ViewEventHandler {\n constructor(context) {\n super();\n this._context = context;\n this._context.addEventHandler(this);\n }\n dispose() {\n this._context.removeEventHandler(this);\n super.dispose();\n }\n}\nexport class PartFingerprints {\n static write(target, partId) {\n target.setAttribute('data-mprt', String(partId));\n }\n static read(target) {\n const r = target.getAttribute('data-mprt');\n if (r === null) {\n return 0 /* PartFingerprint.None */;\n }\n return parseInt(r, 10);\n }\n static collect(child, stopAt) {\n const result = [];\n let resultLen = 0;\n while (child && child !== child.ownerDocument.body) {\n if (child === stopAt) {\n break;\n }\n if (child.nodeType === child.ELEMENT_NODE) {\n result[resultLen++] = this.read(child);\n }\n child = child.parentElement;\n }\n const r = new Uint8Array(resultLen);\n for (let i = 0; i < resultLen; i++) {\n r[i] = result[resultLen - i - 1];\n }\n return r;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport class RestrictedRenderingContext {\n constructor(viewLayout, viewportData) {\n this._restrictedRenderingContextBrand = undefined;\n this._viewLayout = viewLayout;\n this.viewportData = viewportData;\n this.scrollWidth = this._viewLayout.getScrollWidth();\n this.scrollHeight = this._viewLayout.getScrollHeight();\n this.visibleRange = this.viewportData.visibleRange;\n this.bigNumbersDelta = this.viewportData.bigNumbersDelta;\n const vInfo = this._viewLayout.getCurrentViewport();\n this.scrollTop = vInfo.top;\n this.scrollLeft = vInfo.left;\n this.viewportWidth = vInfo.width;\n this.viewportHeight = vInfo.height;\n }\n getScrolledTopFromAbsoluteTop(absoluteTop) {\n return absoluteTop - this.scrollTop;\n }\n getVerticalOffsetForLineNumber(lineNumber, includeViewZones) {\n return this._viewLayout.getVerticalOffsetForLineNumber(lineNumber, includeViewZones);\n }\n getVerticalOffsetAfterLineNumber(lineNumber, includeViewZones) {\n return this._viewLayout.getVerticalOffsetAfterLineNumber(lineNumber, includeViewZones);\n }\n getDecorationsInViewport() {\n return this.viewportData.getDecorationsInViewport();\n }\n}\nexport class RenderingContext extends RestrictedRenderingContext {\n constructor(viewLayout, viewportData, viewLines) {\n super(viewLayout, viewportData);\n this._renderingContextBrand = undefined;\n this._viewLines = viewLines;\n }\n linesVisibleRangesForRange(range, includeNewLines) {\n return this._viewLines.linesVisibleRangesForRange(range, includeNewLines);\n }\n visibleRangeForPosition(position) {\n return this._viewLines.visibleRangeForPosition(position);\n }\n}\nexport class LineVisibleRanges {\n constructor(outsideRenderedLine, lineNumber, ranges, \n /**\n * Indicates if the requested range does not end in this line, but continues on the next line.\n */\n continuesOnNextLine) {\n this.outsideRenderedLine = outsideRenderedLine;\n this.lineNumber = lineNumber;\n this.ranges = ranges;\n this.continuesOnNextLine = continuesOnNextLine;\n }\n}\nexport class HorizontalRange {\n static from(ranges) {\n const result = new Array(ranges.length);\n for (let i = 0, len = ranges.length; i < len; i++) {\n const range = ranges[i];\n result[i] = new HorizontalRange(range.left, range.width);\n }\n return result;\n }\n constructor(left, width) {\n this._horizontalRangeBrand = undefined;\n this.left = Math.round(left);\n this.width = Math.round(width);\n }\n toString() {\n return `[${this.left},${this.width}]`;\n }\n}\nexport class FloatHorizontalRange {\n constructor(left, width) {\n this._floatHorizontalRangeBrand = undefined;\n this.left = left;\n this.width = width;\n }\n toString() {\n return `[${this.left},${this.width}]`;\n }\n static compare(a, b) {\n return a.left - b.left;\n }\n}\nexport class HorizontalPosition {\n constructor(outsideRenderedLine, left) {\n this.outsideRenderedLine = outsideRenderedLine;\n this.originalLeft = left;\n this.left = Math.round(this.originalLeft);\n }\n}\nexport class VisibleRanges {\n constructor(outsideRenderedLine, ranges) {\n this.outsideRenderedLine = outsideRenderedLine;\n this.ranges = ranges;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { FloatHorizontalRange } from '../../view/renderingContext.js';\nexport class RangeUtil {\n static _createRange() {\n if (!this._handyReadyRange) {\n this._handyReadyRange = document.createRange();\n }\n return this._handyReadyRange;\n }\n static _detachRange(range, endNode) {\n // Move range out of the span node, IE doesn't like having many ranges in\n // the same spot and will act badly for lines containing dashes ('-')\n range.selectNodeContents(endNode);\n }\n static _readClientRects(startElement, startOffset, endElement, endOffset, endNode) {\n const range = this._createRange();\n try {\n range.setStart(startElement, startOffset);\n range.setEnd(endElement, endOffset);\n return range.getClientRects();\n }\n catch (e) {\n // This is life ...\n return null;\n }\n finally {\n this._detachRange(range, endNode);\n }\n }\n static _mergeAdjacentRanges(ranges) {\n if (ranges.length === 1) {\n // There is nothing to merge\n return ranges;\n }\n ranges.sort(FloatHorizontalRange.compare);\n const result = [];\n let resultLen = 0;\n let prev = ranges[0];\n for (let i = 1, len = ranges.length; i < len; i++) {\n const range = ranges[i];\n if (prev.left + prev.width + 0.9 /* account for browser's rounding errors*/ >= range.left) {\n prev.width = Math.max(prev.width, range.left + range.width - prev.left);\n }\n else {\n result[resultLen++] = prev;\n prev = range;\n }\n }\n result[resultLen++] = prev;\n return result;\n }\n static _createHorizontalRangesFromClientRects(clientRects, clientRectDeltaLeft, clientRectScale) {\n if (!clientRects || clientRects.length === 0) {\n return null;\n }\n // We go through FloatHorizontalRange because it has been observed in bi-di text\n // that the clientRects are not coming in sorted from the browser\n const result = [];\n for (let i = 0, len = clientRects.length; i < len; i++) {\n const clientRect = clientRects[i];\n result[i] = new FloatHorizontalRange(Math.max(0, (clientRect.left - clientRectDeltaLeft) / clientRectScale), clientRect.width / clientRectScale);\n }\n return this._mergeAdjacentRanges(result);\n }\n static readHorizontalRanges(domNode, startChildIndex, startOffset, endChildIndex, endOffset, context) {\n // Panic check\n const min = 0;\n const max = domNode.children.length - 1;\n if (min > max) {\n return null;\n }\n startChildIndex = Math.min(max, Math.max(min, startChildIndex));\n endChildIndex = Math.min(max, Math.max(min, endChildIndex));\n if (startChildIndex === endChildIndex && startOffset === endOffset && startOffset === 0 && !domNode.children[startChildIndex].firstChild) {\n // We must find the position at the beginning of a \n // To cover cases of empty s, avoid using a range and use the 's bounding box\n const clientRects = domNode.children[startChildIndex].getClientRects();\n context.markDidDomLayout();\n return this._createHorizontalRangesFromClientRects(clientRects, context.clientRectDeltaLeft, context.clientRectScale);\n }\n // If crossing over to a span only to select offset 0, then use the previous span's maximum offset\n // Chrome is buggy and doesn't handle 0 offsets well sometimes.\n if (startChildIndex !== endChildIndex) {\n if (endChildIndex > 0 && endOffset === 0) {\n endChildIndex--;\n endOffset = 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */;\n }\n }\n let startElement = domNode.children[startChildIndex].firstChild;\n let endElement = domNode.children[endChildIndex].firstChild;\n if (!startElement || !endElement) {\n // When having an empty (without any text content), try to move to the previous \n if (!startElement && startOffset === 0 && startChildIndex > 0) {\n startElement = domNode.children[startChildIndex - 1].firstChild;\n startOffset = 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */;\n }\n if (!endElement && endOffset === 0 && endChildIndex > 0) {\n endElement = domNode.children[endChildIndex - 1].firstChild;\n endOffset = 1073741824 /* Constants.MAX_SAFE_SMALL_INTEGER */;\n }\n }\n if (!startElement || !endElement) {\n return null;\n }\n startOffset = Math.min(startElement.textContent.length, Math.max(0, startOffset));\n endOffset = Math.min(endElement.textContent.length, Math.max(0, endOffset));\n const clientRects = this._readClientRects(startElement, startOffset, endElement, endOffset, context.endNode);\n context.markDidDomLayout();\n return this._createHorizontalRangesFromClientRects(clientRects, context.clientRectDeltaLeft, context.clientRectScale);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Color scheme used by the OS and by color themes.\n */\nexport var ColorScheme;\n(function (ColorScheme) {\n ColorScheme[\"DARK\"] = \"dark\";\n ColorScheme[\"LIGHT\"] = \"light\";\n ColorScheme[\"HIGH_CONTRAST_DARK\"] = \"hcDark\";\n ColorScheme[\"HIGH_CONTRAST_LIGHT\"] = \"hcLight\";\n})(ColorScheme || (ColorScheme = {}));\nexport function isHighContrast(scheme) {\n return scheme === ColorScheme.HIGH_CONTRAST_DARK || scheme === ColorScheme.HIGH_CONTRAST_LIGHT;\n}\nexport function isDark(scheme) {\n return scheme === ColorScheme.DARK || scheme === ColorScheme.HIGH_CONTRAST_DARK;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as browser from '../../../../base/browser/browser.js';\nimport { createFastDomNode } from '../../../../base/browser/fastDomNode.js';\nimport * as platform from '../../../../base/common/platform.js';\nimport { RangeUtil } from './rangeUtil.js';\nimport { FloatHorizontalRange, VisibleRanges } from '../../view/renderingContext.js';\nimport { LineDecoration } from '../../../common/viewLayout/lineDecorations.js';\nimport { RenderLineInput, renderViewLine, LineRange, DomPosition } from '../../../common/viewLayout/viewLineRenderer.js';\nimport { isHighContrast } from '../../../../platform/theme/common/theme.js';\nimport { EditorFontLigatures } from '../../../common/config/editorOptions.js';\nconst canUseFastRenderedViewLine = (function () {\n if (platform.isNative) {\n // In VSCode we know very well when the zoom level changes\n return true;\n }\n if (platform.isLinux || browser.isFirefox || browser.isSafari) {\n // On Linux, it appears that zooming affects char widths (in pixels), which is unexpected.\n // --\n // Even though we read character widths correctly, having read them at a specific zoom level\n // does not mean they are the same at the current zoom level.\n // --\n // This could be improved if we ever figure out how to get an event when browsers zoom,\n // but until then we have to stick with reading client rects.\n // --\n // The same has been observed with Firefox on Windows7\n // --\n // The same has been oversved with Safari\n return false;\n }\n return true;\n})();\nlet monospaceAssumptionsAreValid = true;\nexport class ViewLineOptions {\n constructor(config, themeType) {\n this.themeType = themeType;\n const options = config.options;\n const fontInfo = options.get(50 /* EditorOption.fontInfo */);\n const experimentalWhitespaceRendering = options.get(38 /* EditorOption.experimentalWhitespaceRendering */);\n if (experimentalWhitespaceRendering === 'off') {\n this.renderWhitespace = options.get(98 /* EditorOption.renderWhitespace */);\n }\n else {\n // whitespace is rendered in a different layer\n this.renderWhitespace = 'none';\n }\n this.renderControlCharacters = options.get(93 /* EditorOption.renderControlCharacters */);\n this.spaceWidth = fontInfo.spaceWidth;\n this.middotWidth = fontInfo.middotWidth;\n this.wsmiddotWidth = fontInfo.wsmiddotWidth;\n this.useMonospaceOptimizations = (fontInfo.isMonospace\n && !options.get(33 /* EditorOption.disableMonospaceOptimizations */));\n this.canUseHalfwidthRightwardsArrow = fontInfo.canUseHalfwidthRightwardsArrow;\n this.lineHeight = options.get(66 /* EditorOption.lineHeight */);\n this.stopRenderingLineAfter = options.get(116 /* EditorOption.stopRenderingLineAfter */);\n this.fontLigatures = options.get(51 /* EditorOption.fontLigatures */);\n }\n equals(other) {\n return (this.themeType === other.themeType\n && this.renderWhitespace === other.renderWhitespace\n && this.renderControlCharacters === other.renderControlCharacters\n && this.spaceWidth === other.spaceWidth\n && this.middotWidth === other.middotWidth\n && this.wsmiddotWidth === other.wsmiddotWidth\n && this.useMonospaceOptimizations === other.useMonospaceOptimizations\n && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow\n && this.lineHeight === other.lineHeight\n && this.stopRenderingLineAfter === other.stopRenderingLineAfter\n && this.fontLigatures === other.fontLigatures);\n }\n}\nexport class ViewLine {\n constructor(options) {\n this._options = options;\n this._isMaybeInvalid = true;\n this._renderedViewLine = null;\n }\n // --- begin IVisibleLineData\n getDomNode() {\n if (this._renderedViewLine && this._renderedViewLine.domNode) {\n return this._renderedViewLine.domNode.domNode;\n }\n return null;\n }\n setDomNode(domNode) {\n if (this._renderedViewLine) {\n this._renderedViewLine.domNode = createFastDomNode(domNode);\n }\n else {\n throw new Error('I have no rendered view line to set the dom node to...');\n }\n }\n onContentChanged() {\n this._isMaybeInvalid = true;\n }\n onTokensChanged() {\n this._isMaybeInvalid = true;\n }\n onDecorationsChanged() {\n this._isMaybeInvalid = true;\n }\n onOptionsChanged(newOptions) {\n this._isMaybeInvalid = true;\n this._options = newOptions;\n }\n onSelectionChanged() {\n if (isHighContrast(this._options.themeType) || this._options.renderWhitespace === 'selection') {\n this._isMaybeInvalid = true;\n return true;\n }\n return false;\n }\n renderLine(lineNumber, deltaTop, viewportData, sb) {\n if (this._isMaybeInvalid === false) {\n // it appears that nothing relevant has changed\n return false;\n }\n this._isMaybeInvalid = false;\n const lineData = viewportData.getViewLineRenderingData(lineNumber);\n const options = this._options;\n const actualInlineDecorations = LineDecoration.filter(lineData.inlineDecorations, lineNumber, lineData.minColumn, lineData.maxColumn);\n // Only send selection information when needed for rendering whitespace\n let selectionsOnLine = null;\n if (isHighContrast(options.themeType) || this._options.renderWhitespace === 'selection') {\n const selections = viewportData.selections;\n for (const selection of selections) {\n if (selection.endLineNumber < lineNumber || selection.startLineNumber > lineNumber) {\n // Selection does not intersect line\n continue;\n }\n const startColumn = (selection.startLineNumber === lineNumber ? selection.startColumn : lineData.minColumn);\n const endColumn = (selection.endLineNumber === lineNumber ? selection.endColumn : lineData.maxColumn);\n if (startColumn < endColumn) {\n if (isHighContrast(options.themeType)) {\n actualInlineDecorations.push(new LineDecoration(startColumn, endColumn, 'inline-selected-text', 0 /* InlineDecorationType.Regular */));\n }\n if (this._options.renderWhitespace === 'selection') {\n if (!selectionsOnLine) {\n selectionsOnLine = [];\n }\n selectionsOnLine.push(new LineRange(startColumn - 1, endColumn - 1));\n }\n }\n }\n }\n const renderLineInput = new RenderLineInput(options.useMonospaceOptimizations, options.canUseHalfwidthRightwardsArrow, lineData.content, lineData.continuesWithWrappedLine, lineData.isBasicASCII, lineData.containsRTL, lineData.minColumn - 1, lineData.tokens, actualInlineDecorations, lineData.tabSize, lineData.startVisibleColumn, options.spaceWidth, options.middotWidth, options.wsmiddotWidth, options.stopRenderingLineAfter, options.renderWhitespace, options.renderControlCharacters, options.fontLigatures !== EditorFontLigatures.OFF, selectionsOnLine);\n if (this._renderedViewLine && this._renderedViewLine.input.equals(renderLineInput)) {\n // no need to do anything, we have the same render input\n return false;\n }\n sb.appendString('
');\n const output = renderViewLine(renderLineInput, sb);\n sb.appendString('
');\n let renderedViewLine = null;\n if (monospaceAssumptionsAreValid && canUseFastRenderedViewLine && lineData.isBasicASCII && options.useMonospaceOptimizations && output.containsForeignElements === 0 /* ForeignElementType.None */) {\n renderedViewLine = new FastRenderedViewLine(this._renderedViewLine ? this._renderedViewLine.domNode : null, renderLineInput, output.characterMapping);\n }\n if (!renderedViewLine) {\n renderedViewLine = createRenderedLine(this._renderedViewLine ? this._renderedViewLine.domNode : null, renderLineInput, output.characterMapping, output.containsRTL, output.containsForeignElements);\n }\n this._renderedViewLine = renderedViewLine;\n return true;\n }\n layoutLine(lineNumber, deltaTop) {\n if (this._renderedViewLine && this._renderedViewLine.domNode) {\n this._renderedViewLine.domNode.setTop(deltaTop);\n this._renderedViewLine.domNode.setHeight(this._options.lineHeight);\n }\n }\n // --- end IVisibleLineData\n getWidth(context) {\n if (!this._renderedViewLine) {\n return 0;\n }\n return this._renderedViewLine.getWidth(context);\n }\n getWidthIsFast() {\n if (!this._renderedViewLine) {\n return true;\n }\n return this._renderedViewLine.getWidthIsFast();\n }\n needsMonospaceFontCheck() {\n if (!this._renderedViewLine) {\n return false;\n }\n return (this._renderedViewLine instanceof FastRenderedViewLine);\n }\n monospaceAssumptionsAreValid() {\n if (!this._renderedViewLine) {\n return monospaceAssumptionsAreValid;\n }\n if (this._renderedViewLine instanceof FastRenderedViewLine) {\n return this._renderedViewLine.monospaceAssumptionsAreValid();\n }\n return monospaceAssumptionsAreValid;\n }\n onMonospaceAssumptionsInvalidated() {\n if (this._renderedViewLine && this._renderedViewLine instanceof FastRenderedViewLine) {\n this._renderedViewLine = this._renderedViewLine.toSlowRenderedLine();\n }\n }\n getVisibleRangesForRange(lineNumber, startColumn, endColumn, context) {\n if (!this._renderedViewLine) {\n return null;\n }\n startColumn = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, startColumn));\n endColumn = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, endColumn));\n const stopRenderingLineAfter = this._renderedViewLine.input.stopRenderingLineAfter;\n if (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter + 1 && endColumn > stopRenderingLineAfter + 1) {\n // This range is obviously not visible\n return new VisibleRanges(true, [new FloatHorizontalRange(this.getWidth(context), 0)]);\n }\n if (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter + 1) {\n startColumn = stopRenderingLineAfter + 1;\n }\n if (stopRenderingLineAfter !== -1 && endColumn > stopRenderingLineAfter + 1) {\n endColumn = stopRenderingLineAfter + 1;\n }\n const horizontalRanges = this._renderedViewLine.getVisibleRangesForRange(lineNumber, startColumn, endColumn, context);\n if (horizontalRanges && horizontalRanges.length > 0) {\n return new VisibleRanges(false, horizontalRanges);\n }\n return null;\n }\n getColumnOfNodeOffset(spanNode, offset) {\n if (!this._renderedViewLine) {\n return 1;\n }\n return this._renderedViewLine.getColumnOfNodeOffset(spanNode, offset);\n }\n}\nViewLine.CLASS_NAME = 'view-line';\n/**\n * A rendered line which is guaranteed to contain only regular ASCII and is rendered with a monospace font.\n */\nclass FastRenderedViewLine {\n constructor(domNode, renderLineInput, characterMapping) {\n this._cachedWidth = -1;\n this.domNode = domNode;\n this.input = renderLineInput;\n const keyColumnCount = Math.floor(renderLineInput.lineContent.length / 300 /* Constants.MaxMonospaceDistance */);\n if (keyColumnCount > 0) {\n this._keyColumnPixelOffsetCache = new Float32Array(keyColumnCount);\n for (let i = 0; i < keyColumnCount; i++) {\n this._keyColumnPixelOffsetCache[i] = -1;\n }\n }\n else {\n this._keyColumnPixelOffsetCache = null;\n }\n this._characterMapping = characterMapping;\n this._charWidth = renderLineInput.spaceWidth;\n }\n getWidth(context) {\n if (!this.domNode || this.input.lineContent.length < 300 /* Constants.MaxMonospaceDistance */) {\n const horizontalOffset = this._characterMapping.getHorizontalOffset(this._characterMapping.length);\n return Math.round(this._charWidth * horizontalOffset);\n }\n if (this._cachedWidth === -1) {\n this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth;\n context === null || context === void 0 ? void 0 : context.markDidDomLayout();\n }\n return this._cachedWidth;\n }\n getWidthIsFast() {\n return (this.input.lineContent.length < 300 /* Constants.MaxMonospaceDistance */) || this._cachedWidth !== -1;\n }\n monospaceAssumptionsAreValid() {\n if (!this.domNode) {\n return monospaceAssumptionsAreValid;\n }\n if (this.input.lineContent.length < 300 /* Constants.MaxMonospaceDistance */) {\n const expectedWidth = this.getWidth(null);\n const actualWidth = this.domNode.domNode.firstChild.offsetWidth;\n if (Math.abs(expectedWidth - actualWidth) >= 2) {\n // more than 2px off\n console.warn(`monospace assumptions have been violated, therefore disabling monospace optimizations!`);\n monospaceAssumptionsAreValid = false;\n }\n }\n return monospaceAssumptionsAreValid;\n }\n toSlowRenderedLine() {\n return createRenderedLine(this.domNode, this.input, this._characterMapping, false, 0 /* ForeignElementType.None */);\n }\n getVisibleRangesForRange(lineNumber, startColumn, endColumn, context) {\n const startPosition = this._getColumnPixelOffset(lineNumber, startColumn, context);\n const endPosition = this._getColumnPixelOffset(lineNumber, endColumn, context);\n return [new FloatHorizontalRange(startPosition, endPosition - startPosition)];\n }\n _getColumnPixelOffset(lineNumber, column, context) {\n if (column <= 300 /* Constants.MaxMonospaceDistance */) {\n const horizontalOffset = this._characterMapping.getHorizontalOffset(column);\n return this._charWidth * horizontalOffset;\n }\n const keyColumnOrdinal = Math.floor((column - 1) / 300 /* Constants.MaxMonospaceDistance */) - 1;\n const keyColumn = (keyColumnOrdinal + 1) * 300 /* Constants.MaxMonospaceDistance */ + 1;\n let keyColumnPixelOffset = -1;\n if (this._keyColumnPixelOffsetCache) {\n keyColumnPixelOffset = this._keyColumnPixelOffsetCache[keyColumnOrdinal];\n if (keyColumnPixelOffset === -1) {\n keyColumnPixelOffset = this._actualReadPixelOffset(lineNumber, keyColumn, context);\n this._keyColumnPixelOffsetCache[keyColumnOrdinal] = keyColumnPixelOffset;\n }\n }\n if (keyColumnPixelOffset === -1) {\n // Could not read actual key column pixel offset\n const horizontalOffset = this._characterMapping.getHorizontalOffset(column);\n return this._charWidth * horizontalOffset;\n }\n const keyColumnHorizontalOffset = this._characterMapping.getHorizontalOffset(keyColumn);\n const horizontalOffset = this._characterMapping.getHorizontalOffset(column);\n return keyColumnPixelOffset + this._charWidth * (horizontalOffset - keyColumnHorizontalOffset);\n }\n _getReadingTarget(myDomNode) {\n return myDomNode.domNode.firstChild;\n }\n _actualReadPixelOffset(lineNumber, column, context) {\n if (!this.domNode) {\n return -1;\n }\n const domPosition = this._characterMapping.getDomPosition(column);\n const r = RangeUtil.readHorizontalRanges(this._getReadingTarget(this.domNode), domPosition.partIndex, domPosition.charIndex, domPosition.partIndex, domPosition.charIndex, context);\n if (!r || r.length === 0) {\n return -1;\n }\n return r[0].left;\n }\n getColumnOfNodeOffset(spanNode, offset) {\n return getColumnOfNodeOffset(this._characterMapping, spanNode, offset);\n }\n}\n/**\n * Every time we render a line, we save what we have rendered in an instance of this class.\n */\nclass RenderedViewLine {\n constructor(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements) {\n this.domNode = domNode;\n this.input = renderLineInput;\n this._characterMapping = characterMapping;\n this._isWhitespaceOnly = /^\\s*$/.test(renderLineInput.lineContent);\n this._containsForeignElements = containsForeignElements;\n this._cachedWidth = -1;\n this._pixelOffsetCache = null;\n if (!containsRTL || this._characterMapping.length === 0 /* the line is empty */) {\n this._pixelOffsetCache = new Float32Array(Math.max(2, this._characterMapping.length + 1));\n for (let column = 0, len = this._characterMapping.length; column <= len; column++) {\n this._pixelOffsetCache[column] = -1;\n }\n }\n }\n // --- Reading from the DOM methods\n _getReadingTarget(myDomNode) {\n return myDomNode.domNode.firstChild;\n }\n /**\n * Width of the line in pixels\n */\n getWidth(context) {\n if (!this.domNode) {\n return 0;\n }\n if (this._cachedWidth === -1) {\n this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth;\n context === null || context === void 0 ? void 0 : context.markDidDomLayout();\n }\n return this._cachedWidth;\n }\n getWidthIsFast() {\n if (this._cachedWidth === -1) {\n return false;\n }\n return true;\n }\n /**\n * Visible ranges for a model range\n */\n getVisibleRangesForRange(lineNumber, startColumn, endColumn, context) {\n if (!this.domNode) {\n return null;\n }\n if (this._pixelOffsetCache !== null) {\n // the text is LTR\n const startOffset = this._readPixelOffset(this.domNode, lineNumber, startColumn, context);\n if (startOffset === -1) {\n return null;\n }\n const endOffset = this._readPixelOffset(this.domNode, lineNumber, endColumn, context);\n if (endOffset === -1) {\n return null;\n }\n return [new FloatHorizontalRange(startOffset, endOffset - startOffset)];\n }\n return this._readVisibleRangesForRange(this.domNode, lineNumber, startColumn, endColumn, context);\n }\n _readVisibleRangesForRange(domNode, lineNumber, startColumn, endColumn, context) {\n if (startColumn === endColumn) {\n const pixelOffset = this._readPixelOffset(domNode, lineNumber, startColumn, context);\n if (pixelOffset === -1) {\n return null;\n }\n else {\n return [new FloatHorizontalRange(pixelOffset, 0)];\n }\n }\n else {\n return this._readRawVisibleRangesForRange(domNode, startColumn, endColumn, context);\n }\n }\n _readPixelOffset(domNode, lineNumber, column, context) {\n if (this._characterMapping.length === 0) {\n // This line has no content\n if (this._containsForeignElements === 0 /* ForeignElementType.None */) {\n // We can assume the line is really empty\n return 0;\n }\n if (this._containsForeignElements === 2 /* ForeignElementType.After */) {\n // We have foreign elements after the (empty) line\n return 0;\n }\n if (this._containsForeignElements === 1 /* ForeignElementType.Before */) {\n // We have foreign elements before the (empty) line\n return this.getWidth(context);\n }\n // We have foreign elements before & after the (empty) line\n const readingTarget = this._getReadingTarget(domNode);\n if (readingTarget.firstChild) {\n context.markDidDomLayout();\n return readingTarget.firstChild.offsetWidth;\n }\n else {\n return 0;\n }\n }\n if (this._pixelOffsetCache !== null) {\n // the text is LTR\n const cachedPixelOffset = this._pixelOffsetCache[column];\n if (cachedPixelOffset !== -1) {\n return cachedPixelOffset;\n }\n const result = this._actualReadPixelOffset(domNode, lineNumber, column, context);\n this._pixelOffsetCache[column] = result;\n return result;\n }\n return this._actualReadPixelOffset(domNode, lineNumber, column, context);\n }\n _actualReadPixelOffset(domNode, lineNumber, column, context) {\n if (this._characterMapping.length === 0) {\n // This line has no content\n const r = RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), 0, 0, 0, 0, context);\n if (!r || r.length === 0) {\n return -1;\n }\n return r[0].left;\n }\n if (column === this._characterMapping.length && this._isWhitespaceOnly && this._containsForeignElements === 0 /* ForeignElementType.None */) {\n // This branch helps in the case of whitespace only lines which have a width set\n return this.getWidth(context);\n }\n const domPosition = this._characterMapping.getDomPosition(column);\n const r = RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), domPosition.partIndex, domPosition.charIndex, domPosition.partIndex, domPosition.charIndex, context);\n if (!r || r.length === 0) {\n return -1;\n }\n const result = r[0].left;\n if (this.input.isBasicASCII) {\n const horizontalOffset = this._characterMapping.getHorizontalOffset(column);\n const expectedResult = Math.round(this.input.spaceWidth * horizontalOffset);\n if (Math.abs(expectedResult - result) <= 1) {\n return expectedResult;\n }\n }\n return result;\n }\n _readRawVisibleRangesForRange(domNode, startColumn, endColumn, context) {\n if (startColumn === 1 && endColumn === this._characterMapping.length) {\n // This branch helps IE with bidi text & gives a performance boost to other browsers when reading visible ranges for an entire line\n return [new FloatHorizontalRange(0, this.getWidth(context))];\n }\n const startDomPosition = this._characterMapping.getDomPosition(startColumn);\n const endDomPosition = this._characterMapping.getDomPosition(endColumn);\n return RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), startDomPosition.partIndex, startDomPosition.charIndex, endDomPosition.partIndex, endDomPosition.charIndex, context);\n }\n /**\n * Returns the column for the text found at a specific offset inside a rendered dom node\n */\n getColumnOfNodeOffset(spanNode, offset) {\n return getColumnOfNodeOffset(this._characterMapping, spanNode, offset);\n }\n}\nclass WebKitRenderedViewLine extends RenderedViewLine {\n _readVisibleRangesForRange(domNode, lineNumber, startColumn, endColumn, context) {\n const output = super._readVisibleRangesForRange(domNode, lineNumber, startColumn, endColumn, context);\n if (!output || output.length === 0 || startColumn === endColumn || (startColumn === 1 && endColumn === this._characterMapping.length)) {\n return output;\n }\n // WebKit is buggy and returns an expanded range (to contain words in some cases)\n // The last client rect is enlarged (I think)\n if (!this.input.containsRTL) {\n // This is an attempt to patch things up\n // Find position of last column\n const endPixelOffset = this._readPixelOffset(domNode, lineNumber, endColumn, context);\n if (endPixelOffset !== -1) {\n const lastRange = output[output.length - 1];\n if (lastRange.left < endPixelOffset) {\n // Trim down the width of the last visible range to not go after the last column's position\n lastRange.width = endPixelOffset - lastRange.left;\n }\n }\n }\n return output;\n }\n}\nconst createRenderedLine = (function () {\n if (browser.isWebKit) {\n return createWebKitRenderedLine;\n }\n return createNormalRenderedLine;\n})();\nfunction createWebKitRenderedLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements) {\n return new WebKitRenderedViewLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements);\n}\nfunction createNormalRenderedLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements) {\n return new RenderedViewLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements);\n}\nexport function getColumnOfNodeOffset(characterMapping, spanNode, offset) {\n const spanNodeTextContentLength = spanNode.textContent.length;\n let spanIndex = -1;\n while (spanNode) {\n spanNode = spanNode.previousSibling;\n spanIndex++;\n }\n return characterMapping.getColumn(new DomPosition(spanIndex, offset), spanNodeTextContentLength);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as strings from '../../../base/common/strings.js';\n/**\n * A column in a position is the gap between two adjacent characters. The methods here\n * work with a concept called \"visible column\". A visible column is a very rough approximation\n * of the horizontal screen position of a column. For example, using a tab size of 4:\n * ```txt\n * |||T|ext\n * | | | \\---- column = 4, visible column = 9\n * | | \\------ column = 3, visible column = 8\n * | \\------------ column = 2, visible column = 4\n * \\------------------ column = 1, visible column = 0\n * ```\n *\n * **NOTE**: Visual columns do not work well for RTL text or variable-width fonts or characters.\n *\n * **NOTE**: These methods work and make sense both on the model and on the view model.\n */\nexport class CursorColumns {\n static _nextVisibleColumn(codePoint, visibleColumn, tabSize) {\n if (codePoint === 9 /* CharCode.Tab */) {\n return CursorColumns.nextRenderTabStop(visibleColumn, tabSize);\n }\n if (strings.isFullWidthCharacter(codePoint) || strings.isEmojiImprecise(codePoint)) {\n return visibleColumn + 2;\n }\n return visibleColumn + 1;\n }\n /**\n * Returns a visible column from a column.\n * @see {@link CursorColumns}\n */\n static visibleColumnFromColumn(lineContent, column, tabSize) {\n const textLen = Math.min(column - 1, lineContent.length);\n const text = lineContent.substring(0, textLen);\n const iterator = new strings.GraphemeIterator(text);\n let result = 0;\n while (!iterator.eol()) {\n const codePoint = strings.getNextCodePoint(text, textLen, iterator.offset);\n iterator.nextGraphemeLength();\n result = this._nextVisibleColumn(codePoint, result, tabSize);\n }\n return result;\n }\n /**\n * Returns a column from a visible column.\n * @see {@link CursorColumns}\n */\n static columnFromVisibleColumn(lineContent, visibleColumn, tabSize) {\n if (visibleColumn <= 0) {\n return 1;\n }\n const lineContentLength = lineContent.length;\n const iterator = new strings.GraphemeIterator(lineContent);\n let beforeVisibleColumn = 0;\n let beforeColumn = 1;\n while (!iterator.eol()) {\n const codePoint = strings.getNextCodePoint(lineContent, lineContentLength, iterator.offset);\n iterator.nextGraphemeLength();\n const afterVisibleColumn = this._nextVisibleColumn(codePoint, beforeVisibleColumn, tabSize);\n const afterColumn = iterator.offset + 1;\n if (afterVisibleColumn >= visibleColumn) {\n const beforeDelta = visibleColumn - beforeVisibleColumn;\n const afterDelta = afterVisibleColumn - visibleColumn;\n if (afterDelta < beforeDelta) {\n return afterColumn;\n }\n else {\n return beforeColumn;\n }\n }\n beforeVisibleColumn = afterVisibleColumn;\n beforeColumn = afterColumn;\n }\n // walked the entire string\n return lineContentLength + 1;\n }\n /**\n * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)\n * @see {@link CursorColumns}\n */\n static nextRenderTabStop(visibleColumn, tabSize) {\n return visibleColumn + tabSize - visibleColumn % tabSize;\n }\n /**\n * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)\n * @see {@link CursorColumns}\n */\n static nextIndentTabStop(visibleColumn, indentSize) {\n return visibleColumn + indentSize - visibleColumn % indentSize;\n }\n /**\n * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)\n * @see {@link CursorColumns}\n */\n static prevRenderTabStop(column, tabSize) {\n return Math.max(0, column - 1 - (column - 1) % tabSize);\n }\n /**\n * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)\n * @see {@link CursorColumns}\n */\n static prevIndentTabStop(column, indentSize) {\n return Math.max(0, column - 1 - (column - 1) % indentSize);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { CursorColumns } from '../core/cursorColumns.js';\nexport class AtomicTabMoveOperations {\n /**\n * Get the visible column at the position. If we get to a non-whitespace character first\n * or past the end of string then return -1.\n *\n * **Note** `position` and the return value are 0-based.\n */\n static whitespaceVisibleColumn(lineContent, position, tabSize) {\n const lineLength = lineContent.length;\n let visibleColumn = 0;\n let prevTabStopPosition = -1;\n let prevTabStopVisibleColumn = -1;\n for (let i = 0; i < lineLength; i++) {\n if (i === position) {\n return [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn];\n }\n if (visibleColumn % tabSize === 0) {\n prevTabStopPosition = i;\n prevTabStopVisibleColumn = visibleColumn;\n }\n const chCode = lineContent.charCodeAt(i);\n switch (chCode) {\n case 32 /* CharCode.Space */:\n visibleColumn += 1;\n break;\n case 9 /* CharCode.Tab */:\n // Skip to the next multiple of tabSize.\n visibleColumn = CursorColumns.nextRenderTabStop(visibleColumn, tabSize);\n break;\n default:\n return [-1, -1, -1];\n }\n }\n if (position === lineLength) {\n return [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn];\n }\n return [-1, -1, -1];\n }\n /**\n * Return the position that should result from a move left, right or to the\n * nearest tab, if atomic tabs are enabled. Left and right are used for the\n * arrow key movements, nearest is used for mouse selection. It returns\n * -1 if atomic tabs are not relevant and you should fall back to normal\n * behaviour.\n *\n * **Note**: `position` and the return value are 0-based.\n */\n static atomicPosition(lineContent, position, tabSize, direction) {\n const lineLength = lineContent.length;\n // Get the 0-based visible column corresponding to the position, or return\n // -1 if it is not in the initial whitespace.\n const [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn] = AtomicTabMoveOperations.whitespaceVisibleColumn(lineContent, position, tabSize);\n if (visibleColumn === -1) {\n return -1;\n }\n // Is the output left or right of the current position. The case for nearest\n // where it is the same as the current position is handled in the switch.\n let left;\n switch (direction) {\n case 0 /* Direction.Left */:\n left = true;\n break;\n case 1 /* Direction.Right */:\n left = false;\n break;\n case 2 /* Direction.Nearest */:\n // The code below assumes the output position is either left or right\n // of the input position. If it is the same, return immediately.\n if (visibleColumn % tabSize === 0) {\n return position;\n }\n // Go to the nearest indentation.\n left = visibleColumn % tabSize <= (tabSize / 2);\n break;\n }\n // If going left, we can just use the info about the last tab stop position and\n // last tab stop visible column that we computed in the first walk over the whitespace.\n if (left) {\n if (prevTabStopPosition === -1) {\n return -1;\n }\n // If the direction is left, we need to keep scanning right to ensure\n // that targetVisibleColumn + tabSize is before non-whitespace.\n // This is so that when we press left at the end of a partial\n // indentation it only goes one character. For example ' foo' with\n // tabSize 4, should jump from position 6 to position 5, not 4.\n let currentVisibleColumn = prevTabStopVisibleColumn;\n for (let i = prevTabStopPosition; i < lineLength; ++i) {\n if (currentVisibleColumn === prevTabStopVisibleColumn + tabSize) {\n // It is a full indentation.\n return prevTabStopPosition;\n }\n const chCode = lineContent.charCodeAt(i);\n switch (chCode) {\n case 32 /* CharCode.Space */:\n currentVisibleColumn += 1;\n break;\n case 9 /* CharCode.Tab */:\n currentVisibleColumn = CursorColumns.nextRenderTabStop(currentVisibleColumn, tabSize);\n break;\n default:\n return -1;\n }\n }\n if (currentVisibleColumn === prevTabStopVisibleColumn + tabSize) {\n return prevTabStopPosition;\n }\n // It must have been a partial indentation.\n return -1;\n }\n // We are going right.\n const targetVisibleColumn = CursorColumns.nextRenderTabStop(visibleColumn, tabSize);\n // We can just continue from where whitespaceVisibleColumn got to.\n let currentVisibleColumn = visibleColumn;\n for (let i = position; i < lineLength; i++) {\n if (currentVisibleColumn === targetVisibleColumn) {\n return i;\n }\n const chCode = lineContent.charCodeAt(i);\n switch (chCode) {\n case 32 /* CharCode.Space */:\n currentVisibleColumn += 1;\n break;\n case 9 /* CharCode.Tab */:\n currentVisibleColumn = CursorColumns.nextRenderTabStop(currentVisibleColumn, tabSize);\n break;\n default:\n return -1;\n }\n }\n // This condition handles when the target column is at the end of the line.\n if (currentVisibleColumn === targetVisibleColumn) {\n return lineLength;\n }\n return -1;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { PageCoordinates } from '../editorDom.js';\nimport { PartFingerprints } from '../view/viewPart.js';\nimport { ViewLine } from '../viewParts/lines/viewLine.js';\nimport { Position } from '../../common/core/position.js';\nimport { Range as EditorRange } from '../../common/core/range.js';\nimport { CursorColumns } from '../../common/core/cursorColumns.js';\nimport * as dom from '../../../base/browser/dom.js';\nimport { AtomicTabMoveOperations } from '../../common/cursor/cursorAtomicMoveOperations.js';\nclass UnknownHitTestResult {\n constructor(hitTarget = null) {\n this.hitTarget = hitTarget;\n this.type = 0 /* HitTestResultType.Unknown */;\n }\n}\nclass ContentHitTestResult {\n constructor(position, spanNode, injectedText) {\n this.position = position;\n this.spanNode = spanNode;\n this.injectedText = injectedText;\n this.type = 1 /* HitTestResultType.Content */;\n }\n}\nvar HitTestResult;\n(function (HitTestResult) {\n function createFromDOMInfo(ctx, spanNode, offset) {\n const position = ctx.getPositionFromDOMInfo(spanNode, offset);\n if (position) {\n return new ContentHitTestResult(position, spanNode, null);\n }\n return new UnknownHitTestResult(spanNode);\n }\n HitTestResult.createFromDOMInfo = createFromDOMInfo;\n})(HitTestResult || (HitTestResult = {}));\nexport class PointerHandlerLastRenderData {\n constructor(lastViewCursorsRenderData, lastTextareaPosition) {\n this.lastViewCursorsRenderData = lastViewCursorsRenderData;\n this.lastTextareaPosition = lastTextareaPosition;\n }\n}\nexport class MouseTarget {\n static _deduceRage(position, range = null) {\n if (!range && position) {\n return new EditorRange(position.lineNumber, position.column, position.lineNumber, position.column);\n }\n return range !== null && range !== void 0 ? range : null;\n }\n static createUnknown(element, mouseColumn, position) {\n return { type: 0 /* MouseTargetType.UNKNOWN */, element, mouseColumn, position, range: this._deduceRage(position) };\n }\n static createTextarea(element, mouseColumn) {\n return { type: 1 /* MouseTargetType.TEXTAREA */, element, mouseColumn, position: null, range: null };\n }\n static createMargin(type, element, mouseColumn, position, range, detail) {\n return { type, element, mouseColumn, position, range, detail };\n }\n static createViewZone(type, element, mouseColumn, position, detail) {\n return { type, element, mouseColumn, position, range: this._deduceRage(position), detail };\n }\n static createContentText(element, mouseColumn, position, range, detail) {\n return { type: 6 /* MouseTargetType.CONTENT_TEXT */, element, mouseColumn, position, range: this._deduceRage(position, range), detail };\n }\n static createContentEmpty(element, mouseColumn, position, detail) {\n return { type: 7 /* MouseTargetType.CONTENT_EMPTY */, element, mouseColumn, position, range: this._deduceRage(position), detail };\n }\n static createContentWidget(element, mouseColumn, detail) {\n return { type: 9 /* MouseTargetType.CONTENT_WIDGET */, element, mouseColumn, position: null, range: null, detail };\n }\n static createScrollbar(element, mouseColumn, position) {\n return { type: 11 /* MouseTargetType.SCROLLBAR */, element, mouseColumn, position, range: this._deduceRage(position) };\n }\n static createOverlayWidget(element, mouseColumn, detail) {\n return { type: 12 /* MouseTargetType.OVERLAY_WIDGET */, element, mouseColumn, position: null, range: null, detail };\n }\n static createOutsideEditor(mouseColumn, position, outsidePosition, outsideDistance) {\n return { type: 13 /* MouseTargetType.OUTSIDE_EDITOR */, element: null, mouseColumn, position, range: this._deduceRage(position), outsidePosition, outsideDistance };\n }\n static _typeToString(type) {\n if (type === 1 /* MouseTargetType.TEXTAREA */) {\n return 'TEXTAREA';\n }\n if (type === 2 /* MouseTargetType.GUTTER_GLYPH_MARGIN */) {\n return 'GUTTER_GLYPH_MARGIN';\n }\n if (type === 3 /* MouseTargetType.GUTTER_LINE_NUMBERS */) {\n return 'GUTTER_LINE_NUMBERS';\n }\n if (type === 4 /* MouseTargetType.GUTTER_LINE_DECORATIONS */) {\n return 'GUTTER_LINE_DECORATIONS';\n }\n if (type === 5 /* MouseTargetType.GUTTER_VIEW_ZONE */) {\n return 'GUTTER_VIEW_ZONE';\n }\n if (type === 6 /* MouseTargetType.CONTENT_TEXT */) {\n return 'CONTENT_TEXT';\n }\n if (type === 7 /* MouseTargetType.CONTENT_EMPTY */) {\n return 'CONTENT_EMPTY';\n }\n if (type === 8 /* MouseTargetType.CONTENT_VIEW_ZONE */) {\n return 'CONTENT_VIEW_ZONE';\n }\n if (type === 9 /* MouseTargetType.CONTENT_WIDGET */) {\n return 'CONTENT_WIDGET';\n }\n if (type === 10 /* MouseTargetType.OVERVIEW_RULER */) {\n return 'OVERVIEW_RULER';\n }\n if (type === 11 /* MouseTargetType.SCROLLBAR */) {\n return 'SCROLLBAR';\n }\n if (type === 12 /* MouseTargetType.OVERLAY_WIDGET */) {\n return 'OVERLAY_WIDGET';\n }\n return 'UNKNOWN';\n }\n static toString(target) {\n return this._typeToString(target.type) + ': ' + target.position + ' - ' + target.range + ' - ' + JSON.stringify(target.detail);\n }\n}\nclass ElementPath {\n static isTextArea(path) {\n return (path.length === 2\n && path[0] === 3 /* PartFingerprint.OverflowGuard */\n && path[1] === 7 /* PartFingerprint.TextArea */);\n }\n static isChildOfViewLines(path) {\n return (path.length >= 4\n && path[0] === 3 /* PartFingerprint.OverflowGuard */\n && path[3] === 8 /* PartFingerprint.ViewLines */);\n }\n static isStrictChildOfViewLines(path) {\n return (path.length > 4\n && path[0] === 3 /* PartFingerprint.OverflowGuard */\n && path[3] === 8 /* PartFingerprint.ViewLines */);\n }\n static isChildOfScrollableElement(path) {\n return (path.length >= 2\n && path[0] === 3 /* PartFingerprint.OverflowGuard */\n && path[1] === 6 /* PartFingerprint.ScrollableElement */);\n }\n static isChildOfMinimap(path) {\n return (path.length >= 2\n && path[0] === 3 /* PartFingerprint.OverflowGuard */\n && path[1] === 9 /* PartFingerprint.Minimap */);\n }\n static isChildOfContentWidgets(path) {\n return (path.length >= 4\n && path[0] === 3 /* PartFingerprint.OverflowGuard */\n && path[3] === 1 /* PartFingerprint.ContentWidgets */);\n }\n static isChildOfOverflowGuard(path) {\n return (path.length >= 1\n && path[0] === 3 /* PartFingerprint.OverflowGuard */);\n }\n static isChildOfOverflowingContentWidgets(path) {\n return (path.length >= 1\n && path[0] === 2 /* PartFingerprint.OverflowingContentWidgets */);\n }\n static isChildOfOverlayWidgets(path) {\n return (path.length >= 2\n && path[0] === 3 /* PartFingerprint.OverflowGuard */\n && path[1] === 4 /* PartFingerprint.OverlayWidgets */);\n }\n static isChildOfOverflowingOverlayWidgets(path) {\n return (path.length >= 1\n && path[0] === 5 /* PartFingerprint.OverflowingOverlayWidgets */);\n }\n}\nexport class HitTestContext {\n constructor(context, viewHelper, lastRenderData) {\n this.viewModel = context.viewModel;\n const options = context.configuration.options;\n this.layoutInfo = options.get(143 /* EditorOption.layoutInfo */);\n this.viewDomNode = viewHelper.viewDomNode;\n this.lineHeight = options.get(66 /* EditorOption.lineHeight */);\n this.stickyTabStops = options.get(115 /* EditorOption.stickyTabStops */);\n this.typicalHalfwidthCharacterWidth = options.get(50 /* EditorOption.fontInfo */).typicalHalfwidthCharacterWidth;\n this.lastRenderData = lastRenderData;\n this._context = context;\n this._viewHelper = viewHelper;\n }\n getZoneAtCoord(mouseVerticalOffset) {\n return HitTestContext.getZoneAtCoord(this._context, mouseVerticalOffset);\n }\n static getZoneAtCoord(context, mouseVerticalOffset) {\n // The target is either a view zone or the empty space after the last view-line\n const viewZoneWhitespace = context.viewLayout.getWhitespaceAtVerticalOffset(mouseVerticalOffset);\n if (viewZoneWhitespace) {\n const viewZoneMiddle = viewZoneWhitespace.verticalOffset + viewZoneWhitespace.height / 2;\n const lineCount = context.viewModel.getLineCount();\n let positionBefore = null;\n let position;\n let positionAfter = null;\n if (viewZoneWhitespace.afterLineNumber !== lineCount) {\n // There are more lines after this view zone\n positionAfter = new Position(viewZoneWhitespace.afterLineNumber + 1, 1);\n }\n if (viewZoneWhitespace.afterLineNumber > 0) {\n // There are more lines above this view zone\n positionBefore = new Position(viewZoneWhitespace.afterLineNumber, context.viewModel.getLineMaxColumn(viewZoneWhitespace.afterLineNumber));\n }\n if (positionAfter === null) {\n position = positionBefore;\n }\n else if (positionBefore === null) {\n position = positionAfter;\n }\n else if (mouseVerticalOffset < viewZoneMiddle) {\n position = positionBefore;\n }\n else {\n position = positionAfter;\n }\n return {\n viewZoneId: viewZoneWhitespace.id,\n afterLineNumber: viewZoneWhitespace.afterLineNumber,\n positionBefore: positionBefore,\n positionAfter: positionAfter,\n position: position\n };\n }\n return null;\n }\n getFullLineRangeAtCoord(mouseVerticalOffset) {\n if (this._context.viewLayout.isAfterLines(mouseVerticalOffset)) {\n // Below the last line\n const lineNumber = this._context.viewModel.getLineCount();\n const maxLineColumn = this._context.viewModel.getLineMaxColumn(lineNumber);\n return {\n range: new EditorRange(lineNumber, maxLineColumn, lineNumber, maxLineColumn),\n isAfterLines: true\n };\n }\n const lineNumber = this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset);\n const maxLineColumn = this._context.viewModel.getLineMaxColumn(lineNumber);\n return {\n range: new EditorRange(lineNumber, 1, lineNumber, maxLineColumn),\n isAfterLines: false\n };\n }\n getLineNumberAtVerticalOffset(mouseVerticalOffset) {\n return this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset);\n }\n isAfterLines(mouseVerticalOffset) {\n return this._context.viewLayout.isAfterLines(mouseVerticalOffset);\n }\n isInTopPadding(mouseVerticalOffset) {\n return this._context.viewLayout.isInTopPadding(mouseVerticalOffset);\n }\n isInBottomPadding(mouseVerticalOffset) {\n return this._context.viewLayout.isInBottomPadding(mouseVerticalOffset);\n }\n getVerticalOffsetForLineNumber(lineNumber) {\n return this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber);\n }\n findAttribute(element, attr) {\n return HitTestContext._findAttribute(element, attr, this._viewHelper.viewDomNode);\n }\n static _findAttribute(element, attr, stopAt) {\n while (element && element !== element.ownerDocument.body) {\n if (element.hasAttribute && element.hasAttribute(attr)) {\n return element.getAttribute(attr);\n }\n if (element === stopAt) {\n return null;\n }\n element = element.parentNode;\n }\n return null;\n }\n getLineWidth(lineNumber) {\n return this._viewHelper.getLineWidth(lineNumber);\n }\n visibleRangeForPosition(lineNumber, column) {\n return this._viewHelper.visibleRangeForPosition(lineNumber, column);\n }\n getPositionFromDOMInfo(spanNode, offset) {\n return this._viewHelper.getPositionFromDOMInfo(spanNode, offset);\n }\n getCurrentScrollTop() {\n return this._context.viewLayout.getCurrentScrollTop();\n }\n getCurrentScrollLeft() {\n return this._context.viewLayout.getCurrentScrollLeft();\n }\n}\nclass BareHitTestRequest {\n constructor(ctx, editorPos, pos, relativePos) {\n this.editorPos = editorPos;\n this.pos = pos;\n this.relativePos = relativePos;\n this.mouseVerticalOffset = Math.max(0, ctx.getCurrentScrollTop() + this.relativePos.y);\n this.mouseContentHorizontalOffset = ctx.getCurrentScrollLeft() + this.relativePos.x - ctx.layoutInfo.contentLeft;\n this.isInMarginArea = (this.relativePos.x < ctx.layoutInfo.contentLeft && this.relativePos.x >= ctx.layoutInfo.glyphMarginLeft);\n this.isInContentArea = !this.isInMarginArea;\n this.mouseColumn = Math.max(0, MouseTargetFactory._getMouseColumn(this.mouseContentHorizontalOffset, ctx.typicalHalfwidthCharacterWidth));\n }\n}\nclass HitTestRequest extends BareHitTestRequest {\n constructor(ctx, editorPos, pos, relativePos, target) {\n super(ctx, editorPos, pos, relativePos);\n this._ctx = ctx;\n if (target) {\n this.target = target;\n this.targetPath = PartFingerprints.collect(target, ctx.viewDomNode);\n }\n else {\n this.target = null;\n this.targetPath = new Uint8Array(0);\n }\n }\n toString() {\n return `pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\\n\\ttarget: ${this.target ? this.target.outerHTML : null}`;\n }\n _getMouseColumn(position = null) {\n if (position && position.column < this._ctx.viewModel.getLineMaxColumn(position.lineNumber)) {\n // Most likely, the line contains foreign decorations...\n return CursorColumns.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(position.lineNumber), position.column, this._ctx.viewModel.model.getOptions().tabSize) + 1;\n }\n return this.mouseColumn;\n }\n fulfillUnknown(position = null) {\n return MouseTarget.createUnknown(this.target, this._getMouseColumn(position), position);\n }\n fulfillTextarea() {\n return MouseTarget.createTextarea(this.target, this._getMouseColumn());\n }\n fulfillMargin(type, position, range, detail) {\n return MouseTarget.createMargin(type, this.target, this._getMouseColumn(position), position, range, detail);\n }\n fulfillViewZone(type, position, detail) {\n return MouseTarget.createViewZone(type, this.target, this._getMouseColumn(position), position, detail);\n }\n fulfillContentText(position, range, detail) {\n return MouseTarget.createContentText(this.target, this._getMouseColumn(position), position, range, detail);\n }\n fulfillContentEmpty(position, detail) {\n return MouseTarget.createContentEmpty(this.target, this._getMouseColumn(position), position, detail);\n }\n fulfillContentWidget(detail) {\n return MouseTarget.createContentWidget(this.target, this._getMouseColumn(), detail);\n }\n fulfillScrollbar(position) {\n return MouseTarget.createScrollbar(this.target, this._getMouseColumn(position), position);\n }\n fulfillOverlayWidget(detail) {\n return MouseTarget.createOverlayWidget(this.target, this._getMouseColumn(), detail);\n }\n withTarget(target) {\n return new HitTestRequest(this._ctx, this.editorPos, this.pos, this.relativePos, target);\n }\n}\nconst EMPTY_CONTENT_AFTER_LINES = { isAfterLines: true };\nfunction createEmptyContentDataInLines(horizontalDistanceToText) {\n return {\n isAfterLines: false,\n horizontalDistanceToText: horizontalDistanceToText\n };\n}\nexport class MouseTargetFactory {\n constructor(context, viewHelper) {\n this._context = context;\n this._viewHelper = viewHelper;\n }\n mouseTargetIsWidget(e) {\n const t = e.target;\n const path = PartFingerprints.collect(t, this._viewHelper.viewDomNode);\n // Is it a content widget?\n if (ElementPath.isChildOfContentWidgets(path) || ElementPath.isChildOfOverflowingContentWidgets(path)) {\n return true;\n }\n // Is it an overlay widget?\n if (ElementPath.isChildOfOverlayWidgets(path) || ElementPath.isChildOfOverflowingOverlayWidgets(path)) {\n return true;\n }\n return false;\n }\n createMouseTarget(lastRenderData, editorPos, pos, relativePos, target) {\n const ctx = new HitTestContext(this._context, this._viewHelper, lastRenderData);\n const request = new HitTestRequest(ctx, editorPos, pos, relativePos, target);\n try {\n const r = MouseTargetFactory._createMouseTarget(ctx, request, false);\n if (r.type === 6 /* MouseTargetType.CONTENT_TEXT */) {\n // Snap to the nearest soft tab boundary if atomic soft tabs are enabled.\n if (ctx.stickyTabStops && r.position !== null) {\n const position = MouseTargetFactory._snapToSoftTabBoundary(r.position, ctx.viewModel);\n const range = EditorRange.fromPositions(position, position).plusRange(r.range);\n return request.fulfillContentText(position, range, r.detail);\n }\n }\n // console.log(MouseTarget.toString(r));\n return r;\n }\n catch (err) {\n // console.log(err);\n return request.fulfillUnknown();\n }\n }\n static _createMouseTarget(ctx, request, domHitTestExecuted) {\n // console.log(`${domHitTestExecuted ? '=>' : ''}CAME IN REQUEST: ${request}`);\n // First ensure the request has a target\n if (request.target === null) {\n if (domHitTestExecuted) {\n // Still no target... and we have already executed hit test...\n return request.fulfillUnknown();\n }\n const hitTestResult = MouseTargetFactory._doHitTest(ctx, request);\n if (hitTestResult.type === 1 /* HitTestResultType.Content */) {\n return MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.spanNode, hitTestResult.position, hitTestResult.injectedText);\n }\n return this._createMouseTarget(ctx, request.withTarget(hitTestResult.hitTarget), true);\n }\n // we know for a fact that request.target is not null\n const resolvedRequest = request;\n let result = null;\n if (!ElementPath.isChildOfOverflowGuard(request.targetPath) && !ElementPath.isChildOfOverflowingContentWidgets(request.targetPath) && !ElementPath.isChildOfOverflowingOverlayWidgets(request.targetPath)) {\n // We only render dom nodes inside the overflow guard or in the overflowing content widgets\n result = result || request.fulfillUnknown();\n }\n result = result || MouseTargetFactory._hitTestContentWidget(ctx, resolvedRequest);\n result = result || MouseTargetFactory._hitTestOverlayWidget(ctx, resolvedRequest);\n result = result || MouseTargetFactory._hitTestMinimap(ctx, resolvedRequest);\n result = result || MouseTargetFactory._hitTestScrollbarSlider(ctx, resolvedRequest);\n result = result || MouseTargetFactory._hitTestViewZone(ctx, resolvedRequest);\n result = result || MouseTargetFactory._hitTestMargin(ctx, resolvedRequest);\n result = result || MouseTargetFactory._hitTestViewCursor(ctx, resolvedRequest);\n result = result || MouseTargetFactory._hitTestTextArea(ctx, resolvedRequest);\n result = result || MouseTargetFactory._hitTestViewLines(ctx, resolvedRequest, domHitTestExecuted);\n result = result || MouseTargetFactory._hitTestScrollbar(ctx, resolvedRequest);\n return (result || request.fulfillUnknown());\n }\n static _hitTestContentWidget(ctx, request) {\n // Is it a content widget?\n if (ElementPath.isChildOfContentWidgets(request.targetPath) || ElementPath.isChildOfOverflowingContentWidgets(request.targetPath)) {\n const widgetId = ctx.findAttribute(request.target, 'widgetId');\n if (widgetId) {\n return request.fulfillContentWidget(widgetId);\n }\n else {\n return request.fulfillUnknown();\n }\n }\n return null;\n }\n static _hitTestOverlayWidget(ctx, request) {\n // Is it an overlay widget?\n if (ElementPath.isChildOfOverlayWidgets(request.targetPath) || ElementPath.isChildOfOverflowingOverlayWidgets(request.targetPath)) {\n const widgetId = ctx.findAttribute(request.target, 'widgetId');\n if (widgetId) {\n return request.fulfillOverlayWidget(widgetId);\n }\n else {\n return request.fulfillUnknown();\n }\n }\n return null;\n }\n static _hitTestViewCursor(ctx, request) {\n if (request.target) {\n // Check if we've hit a painted cursor\n const lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData;\n for (const d of lastViewCursorsRenderData) {\n if (request.target === d.domNode) {\n return request.fulfillContentText(d.position, null, { mightBeForeignElement: false, injectedText: null });\n }\n }\n }\n if (request.isInContentArea) {\n // Edge has a bug when hit-testing the exact position of a cursor,\n // instead of returning the correct dom node, it returns the\n // first or last rendered view line dom node, therefore help it out\n // and first check if we are on top of a cursor\n const lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData;\n const mouseContentHorizontalOffset = request.mouseContentHorizontalOffset;\n const mouseVerticalOffset = request.mouseVerticalOffset;\n for (const d of lastViewCursorsRenderData) {\n if (mouseContentHorizontalOffset < d.contentLeft) {\n // mouse position is to the left of the cursor\n continue;\n }\n if (mouseContentHorizontalOffset > d.contentLeft + d.width) {\n // mouse position is to the right of the cursor\n continue;\n }\n const cursorVerticalOffset = ctx.getVerticalOffsetForLineNumber(d.position.lineNumber);\n if (cursorVerticalOffset <= mouseVerticalOffset\n && mouseVerticalOffset <= cursorVerticalOffset + d.height) {\n return request.fulfillContentText(d.position, null, { mightBeForeignElement: false, injectedText: null });\n }\n }\n }\n return null;\n }\n static _hitTestViewZone(ctx, request) {\n const viewZoneData = ctx.getZoneAtCoord(request.mouseVerticalOffset);\n if (viewZoneData) {\n const mouseTargetType = (request.isInContentArea ? 8 /* MouseTargetType.CONTENT_VIEW_ZONE */ : 5 /* MouseTargetType.GUTTER_VIEW_ZONE */);\n return request.fulfillViewZone(mouseTargetType, viewZoneData.position, viewZoneData);\n }\n return null;\n }\n static _hitTestTextArea(ctx, request) {\n // Is it the textarea?\n if (ElementPath.isTextArea(request.targetPath)) {\n if (ctx.lastRenderData.lastTextareaPosition) {\n return request.fulfillContentText(ctx.lastRenderData.lastTextareaPosition, null, { mightBeForeignElement: false, injectedText: null });\n }\n return request.fulfillTextarea();\n }\n return null;\n }\n static _hitTestMargin(ctx, request) {\n if (request.isInMarginArea) {\n const res = ctx.getFullLineRangeAtCoord(request.mouseVerticalOffset);\n const pos = res.range.getStartPosition();\n let offset = Math.abs(request.relativePos.x);\n const detail = {\n isAfterLines: res.isAfterLines,\n glyphMarginLeft: ctx.layoutInfo.glyphMarginLeft,\n glyphMarginWidth: ctx.layoutInfo.glyphMarginWidth,\n lineNumbersWidth: ctx.layoutInfo.lineNumbersWidth,\n offsetX: offset\n };\n offset -= ctx.layoutInfo.glyphMarginLeft;\n if (offset <= ctx.layoutInfo.glyphMarginWidth) {\n // On the glyph margin\n const modelCoordinate = ctx.viewModel.coordinatesConverter.convertViewPositionToModelPosition(res.range.getStartPosition());\n const lanes = ctx.viewModel.glyphLanes.getLanesAtLine(modelCoordinate.lineNumber);\n detail.glyphMarginLane = lanes[Math.floor(offset / ctx.lineHeight)];\n return request.fulfillMargin(2 /* MouseTargetType.GUTTER_GLYPH_MARGIN */, pos, res.range, detail);\n }\n offset -= ctx.layoutInfo.glyphMarginWidth;\n if (offset <= ctx.layoutInfo.lineNumbersWidth) {\n // On the line numbers\n return request.fulfillMargin(3 /* MouseTargetType.GUTTER_LINE_NUMBERS */, pos, res.range, detail);\n }\n offset -= ctx.layoutInfo.lineNumbersWidth;\n // On the line decorations\n return request.fulfillMargin(4 /* MouseTargetType.GUTTER_LINE_DECORATIONS */, pos, res.range, detail);\n }\n return null;\n }\n static _hitTestViewLines(ctx, request, domHitTestExecuted) {\n if (!ElementPath.isChildOfViewLines(request.targetPath)) {\n return null;\n }\n if (ctx.isInTopPadding(request.mouseVerticalOffset)) {\n return request.fulfillContentEmpty(new Position(1, 1), EMPTY_CONTENT_AFTER_LINES);\n }\n // Check if it is below any lines and any view zones\n if (ctx.isAfterLines(request.mouseVerticalOffset) || ctx.isInBottomPadding(request.mouseVerticalOffset)) {\n // This most likely indicates it happened after the last view-line\n const lineCount = ctx.viewModel.getLineCount();\n const maxLineColumn = ctx.viewModel.getLineMaxColumn(lineCount);\n return request.fulfillContentEmpty(new Position(lineCount, maxLineColumn), EMPTY_CONTENT_AFTER_LINES);\n }\n if (domHitTestExecuted) {\n // Check if we are hitting a view-line (can happen in the case of inline decorations on empty lines)\n // See https://github.com/microsoft/vscode/issues/46942\n if (ElementPath.isStrictChildOfViewLines(request.targetPath)) {\n const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);\n if (ctx.viewModel.getLineLength(lineNumber) === 0) {\n const lineWidth = ctx.getLineWidth(lineNumber);\n const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);\n return request.fulfillContentEmpty(new Position(lineNumber, 1), detail);\n }\n const lineWidth = ctx.getLineWidth(lineNumber);\n if (request.mouseContentHorizontalOffset >= lineWidth) {\n const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);\n const pos = new Position(lineNumber, ctx.viewModel.getLineMaxColumn(lineNumber));\n return request.fulfillContentEmpty(pos, detail);\n }\n }\n // We have already executed hit test...\n return request.fulfillUnknown();\n }\n const hitTestResult = MouseTargetFactory._doHitTest(ctx, request);\n if (hitTestResult.type === 1 /* HitTestResultType.Content */) {\n return MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.spanNode, hitTestResult.position, hitTestResult.injectedText);\n }\n return this._createMouseTarget(ctx, request.withTarget(hitTestResult.hitTarget), true);\n }\n static _hitTestMinimap(ctx, request) {\n if (ElementPath.isChildOfMinimap(request.targetPath)) {\n const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);\n const maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);\n return request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));\n }\n return null;\n }\n static _hitTestScrollbarSlider(ctx, request) {\n if (ElementPath.isChildOfScrollableElement(request.targetPath)) {\n if (request.target && request.target.nodeType === 1) {\n const className = request.target.className;\n if (className && /\\b(slider|scrollbar)\\b/.test(className)) {\n const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);\n const maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);\n return request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));\n }\n }\n }\n return null;\n }\n static _hitTestScrollbar(ctx, request) {\n // Is it the overview ruler?\n // Is it a child of the scrollable element?\n if (ElementPath.isChildOfScrollableElement(request.targetPath)) {\n const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);\n const maxColumn = ctx.viewModel.getLineMaxColumn(possibleLineNumber);\n return request.fulfillScrollbar(new Position(possibleLineNumber, maxColumn));\n }\n return null;\n }\n getMouseColumn(relativePos) {\n const options = this._context.configuration.options;\n const layoutInfo = options.get(143 /* EditorOption.layoutInfo */);\n const mouseContentHorizontalOffset = this._context.viewLayout.getCurrentScrollLeft() + relativePos.x - layoutInfo.contentLeft;\n return MouseTargetFactory._getMouseColumn(mouseContentHorizontalOffset, options.get(50 /* EditorOption.fontInfo */).typicalHalfwidthCharacterWidth);\n }\n static _getMouseColumn(mouseContentHorizontalOffset, typicalHalfwidthCharacterWidth) {\n if (mouseContentHorizontalOffset < 0) {\n return 1;\n }\n const chars = Math.round(mouseContentHorizontalOffset / typicalHalfwidthCharacterWidth);\n return (chars + 1);\n }\n static createMouseTargetFromHitTestPosition(ctx, request, spanNode, pos, injectedText) {\n const lineNumber = pos.lineNumber;\n const column = pos.column;\n const lineWidth = ctx.getLineWidth(lineNumber);\n if (request.mouseContentHorizontalOffset > lineWidth) {\n const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth);\n return request.fulfillContentEmpty(pos, detail);\n }\n const visibleRange = ctx.visibleRangeForPosition(lineNumber, column);\n if (!visibleRange) {\n return request.fulfillUnknown(pos);\n }\n const columnHorizontalOffset = visibleRange.left;\n if (Math.abs(request.mouseContentHorizontalOffset - columnHorizontalOffset) < 1) {\n return request.fulfillContentText(pos, null, { mightBeForeignElement: !!injectedText, injectedText });\n }\n const points = [];\n points.push({ offset: visibleRange.left, column: column });\n if (column > 1) {\n const visibleRange = ctx.visibleRangeForPosition(lineNumber, column - 1);\n if (visibleRange) {\n points.push({ offset: visibleRange.left, column: column - 1 });\n }\n }\n const lineMaxColumn = ctx.viewModel.getLineMaxColumn(lineNumber);\n if (column < lineMaxColumn) {\n const visibleRange = ctx.visibleRangeForPosition(lineNumber, column + 1);\n if (visibleRange) {\n points.push({ offset: visibleRange.left, column: column + 1 });\n }\n }\n points.sort((a, b) => a.offset - b.offset);\n const mouseCoordinates = request.pos.toClientCoordinates(dom.getWindow(ctx.viewDomNode));\n const spanNodeClientRect = spanNode.getBoundingClientRect();\n const mouseIsOverSpanNode = (spanNodeClientRect.left <= mouseCoordinates.clientX && mouseCoordinates.clientX <= spanNodeClientRect.right);\n let rng = null;\n for (let i = 1; i < points.length; i++) {\n const prev = points[i - 1];\n const curr = points[i];\n if (prev.offset <= request.mouseContentHorizontalOffset && request.mouseContentHorizontalOffset <= curr.offset) {\n rng = new EditorRange(lineNumber, prev.column, lineNumber, curr.column);\n // See https://github.com/microsoft/vscode/issues/152819\n // Due to the use of zwj, the browser's hit test result is skewed towards the left\n // Here we try to correct that if the mouse horizontal offset is closer to the right than the left\n const prevDelta = Math.abs(prev.offset - request.mouseContentHorizontalOffset);\n const nextDelta = Math.abs(curr.offset - request.mouseContentHorizontalOffset);\n pos = (prevDelta < nextDelta\n ? new Position(lineNumber, prev.column)\n : new Position(lineNumber, curr.column));\n break;\n }\n }\n return request.fulfillContentText(pos, rng, { mightBeForeignElement: !mouseIsOverSpanNode || !!injectedText, injectedText });\n }\n /**\n * Most probably WebKit browsers and Edge\n */\n static _doHitTestWithCaretRangeFromPoint(ctx, request) {\n // In Chrome, especially on Linux it is possible to click between lines,\n // so try to adjust the `hity` below so that it lands in the center of a line\n const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset);\n const lineStartVerticalOffset = ctx.getVerticalOffsetForLineNumber(lineNumber);\n const lineEndVerticalOffset = lineStartVerticalOffset + ctx.lineHeight;\n const isBelowLastLine = (lineNumber === ctx.viewModel.getLineCount()\n && request.mouseVerticalOffset > lineEndVerticalOffset);\n if (!isBelowLastLine) {\n const lineCenteredVerticalOffset = Math.floor((lineStartVerticalOffset + lineEndVerticalOffset) / 2);\n let adjustedPageY = request.pos.y + (lineCenteredVerticalOffset - request.mouseVerticalOffset);\n if (adjustedPageY <= request.editorPos.y) {\n adjustedPageY = request.editorPos.y + 1;\n }\n if (adjustedPageY >= request.editorPos.y + request.editorPos.height) {\n adjustedPageY = request.editorPos.y + request.editorPos.height - 1;\n }\n const adjustedPage = new PageCoordinates(request.pos.x, adjustedPageY);\n const r = this._actualDoHitTestWithCaretRangeFromPoint(ctx, adjustedPage.toClientCoordinates(dom.getWindow(ctx.viewDomNode)));\n if (r.type === 1 /* HitTestResultType.Content */) {\n return r;\n }\n }\n // Also try to hit test without the adjustment (for the edge cases that we are near the top or bottom)\n return this._actualDoHitTestWithCaretRangeFromPoint(ctx, request.pos.toClientCoordinates(dom.getWindow(ctx.viewDomNode)));\n }\n static _actualDoHitTestWithCaretRangeFromPoint(ctx, coords) {\n const shadowRoot = dom.getShadowRoot(ctx.viewDomNode);\n let range;\n if (shadowRoot) {\n if (typeof shadowRoot.caretRangeFromPoint === 'undefined') {\n range = shadowCaretRangeFromPoint(shadowRoot, coords.clientX, coords.clientY);\n }\n else {\n range = shadowRoot.caretRangeFromPoint(coords.clientX, coords.clientY);\n }\n }\n else {\n range = ctx.viewDomNode.ownerDocument.caretRangeFromPoint(coords.clientX, coords.clientY);\n }\n if (!range || !range.startContainer) {\n return new UnknownHitTestResult();\n }\n // Chrome always hits a TEXT_NODE, while Edge sometimes hits a token span\n const startContainer = range.startContainer;\n if (startContainer.nodeType === startContainer.TEXT_NODE) {\n // startContainer is expected to be the token text\n const parent1 = startContainer.parentNode; // expected to be the token span\n const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line container span\n const parent3 = parent2 ? parent2.parentNode : null; // expected to be the view line div\n const parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? parent3.className : null;\n if (parent3ClassName === ViewLine.CLASS_NAME) {\n return HitTestResult.createFromDOMInfo(ctx, parent1, range.startOffset);\n }\n else {\n return new UnknownHitTestResult(startContainer.parentNode);\n }\n }\n else if (startContainer.nodeType === startContainer.ELEMENT_NODE) {\n // startContainer is expected to be the token span\n const parent1 = startContainer.parentNode; // expected to be the view line container span\n const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line div\n const parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? parent2.className : null;\n if (parent2ClassName === ViewLine.CLASS_NAME) {\n return HitTestResult.createFromDOMInfo(ctx, startContainer, startContainer.textContent.length);\n }\n else {\n return new UnknownHitTestResult(startContainer);\n }\n }\n return new UnknownHitTestResult();\n }\n /**\n * Most probably Gecko\n */\n static _doHitTestWithCaretPositionFromPoint(ctx, coords) {\n const hitResult = ctx.viewDomNode.ownerDocument.caretPositionFromPoint(coords.clientX, coords.clientY);\n if (hitResult.offsetNode.nodeType === hitResult.offsetNode.TEXT_NODE) {\n // offsetNode is expected to be the token text\n const parent1 = hitResult.offsetNode.parentNode; // expected to be the token span\n const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line container span\n const parent3 = parent2 ? parent2.parentNode : null; // expected to be the view line div\n const parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? parent3.className : null;\n if (parent3ClassName === ViewLine.CLASS_NAME) {\n return HitTestResult.createFromDOMInfo(ctx, hitResult.offsetNode.parentNode, hitResult.offset);\n }\n else {\n return new UnknownHitTestResult(hitResult.offsetNode.parentNode);\n }\n }\n // For inline decorations, Gecko sometimes returns the `` of the line and the offset is the `` with the inline decoration\n // Some other times, it returns the `` with the inline decoration\n if (hitResult.offsetNode.nodeType === hitResult.offsetNode.ELEMENT_NODE) {\n const parent1 = hitResult.offsetNode.parentNode;\n const parent1ClassName = parent1 && parent1.nodeType === parent1.ELEMENT_NODE ? parent1.className : null;\n const parent2 = parent1 ? parent1.parentNode : null;\n const parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? parent2.className : null;\n if (parent1ClassName === ViewLine.CLASS_NAME) {\n // it returned the `` of the line and the offset is the `` with the inline decoration\n const tokenSpan = hitResult.offsetNode.childNodes[Math.min(hitResult.offset, hitResult.offsetNode.childNodes.length - 1)];\n if (tokenSpan) {\n return HitTestResult.createFromDOMInfo(ctx, tokenSpan, 0);\n }\n }\n else if (parent2ClassName === ViewLine.CLASS_NAME) {\n // it returned the `` with the inline decoration\n return HitTestResult.createFromDOMInfo(ctx, hitResult.offsetNode, 0);\n }\n }\n return new UnknownHitTestResult(hitResult.offsetNode);\n }\n static _snapToSoftTabBoundary(position, viewModel) {\n const lineContent = viewModel.getLineContent(position.lineNumber);\n const { tabSize } = viewModel.model.getOptions();\n const newPosition = AtomicTabMoveOperations.atomicPosition(lineContent, position.column - 1, tabSize, 2 /* Direction.Nearest */);\n if (newPosition !== -1) {\n return new Position(position.lineNumber, newPosition + 1);\n }\n return position;\n }\n static _doHitTest(ctx, request) {\n let result = new UnknownHitTestResult();\n if (typeof ctx.viewDomNode.ownerDocument.caretRangeFromPoint === 'function') {\n result = this._doHitTestWithCaretRangeFromPoint(ctx, request);\n }\n else if (ctx.viewDomNode.ownerDocument.caretPositionFromPoint) {\n result = this._doHitTestWithCaretPositionFromPoint(ctx, request.pos.toClientCoordinates(dom.getWindow(ctx.viewDomNode)));\n }\n if (result.type === 1 /* HitTestResultType.Content */) {\n const injectedText = ctx.viewModel.getInjectedTextAt(result.position);\n const normalizedPosition = ctx.viewModel.normalizePosition(result.position, 2 /* PositionAffinity.None */);\n if (injectedText || !normalizedPosition.equals(result.position)) {\n result = new ContentHitTestResult(normalizedPosition, result.spanNode, injectedText);\n }\n }\n return result;\n }\n}\nfunction shadowCaretRangeFromPoint(shadowRoot, x, y) {\n const range = document.createRange();\n // Get the element under the point\n let el = shadowRoot.elementFromPoint(x, y);\n if (el !== null) {\n // Get the last child of the element until its firstChild is a text node\n // This assumes that the pointer is on the right of the line, out of the tokens\n // and that we want to get the offset of the last token of the line\n while (el && el.firstChild && el.firstChild.nodeType !== el.firstChild.TEXT_NODE && el.lastChild && el.lastChild.firstChild) {\n el = el.lastChild;\n }\n // Grab its rect\n const rect = el.getBoundingClientRect();\n // And its font (the computed shorthand font property might be empty, see #3217)\n const elWindow = dom.getWindow(el);\n const fontStyle = elWindow.getComputedStyle(el, null).getPropertyValue('font-style');\n const fontVariant = elWindow.getComputedStyle(el, null).getPropertyValue('font-variant');\n const fontWeight = elWindow.getComputedStyle(el, null).getPropertyValue('font-weight');\n const fontSize = elWindow.getComputedStyle(el, null).getPropertyValue('font-size');\n const lineHeight = elWindow.getComputedStyle(el, null).getPropertyValue('line-height');\n const fontFamily = elWindow.getComputedStyle(el, null).getPropertyValue('font-family');\n const font = `${fontStyle} ${fontVariant} ${fontWeight} ${fontSize}/${lineHeight} ${fontFamily}`;\n // And also its txt content\n const text = el.innerText;\n // Position the pixel cursor at the left of the element\n let pixelCursor = rect.left;\n let offset = 0;\n let step;\n // If the point is on the right of the box put the cursor after the last character\n if (x > rect.left + rect.width) {\n offset = text.length;\n }\n else {\n const charWidthReader = CharWidthReader.getInstance();\n // Goes through all the characters of the innerText, and checks if the x of the point\n // belongs to the character.\n for (let i = 0; i < text.length + 1; i++) {\n // The step is half the width of the character\n step = charWidthReader.getCharWidth(text.charAt(i), font) / 2;\n // Move to the center of the character\n pixelCursor += step;\n // If the x of the point is smaller that the position of the cursor, the point is over that character\n if (x < pixelCursor) {\n offset = i;\n break;\n }\n // Move between the current character and the next\n pixelCursor += step;\n }\n }\n // Creates a range with the text node of the element and set the offset found\n range.setStart(el.firstChild, offset);\n range.setEnd(el.firstChild, offset);\n }\n return range;\n}\nclass CharWidthReader {\n static getInstance() {\n if (!CharWidthReader._INSTANCE) {\n CharWidthReader._INSTANCE = new CharWidthReader();\n }\n return CharWidthReader._INSTANCE;\n }\n constructor() {\n this._cache = {};\n this._canvas = document.createElement('canvas');\n }\n getCharWidth(char, font) {\n const cacheKey = char + font;\n if (this._cache[cacheKey]) {\n return this._cache[cacheKey];\n }\n const context = this._canvas.getContext('2d');\n context.font = font;\n const metrics = context.measureText(char);\n const width = metrics.width;\n this._cache[cacheKey] = width;\n return width;\n }\n}\nCharWidthReader._INSTANCE = null;\n", "export function memoize(_target, key, descriptor) {\n let fnKey = null;\n let fn = null;\n if (typeof descriptor.value === 'function') {\n fnKey = 'value';\n fn = descriptor.value;\n if (fn.length !== 0) {\n console.warn('Memoize should only be used in functions with zero parameters');\n }\n }\n else if (typeof descriptor.get === 'function') {\n fnKey = 'get';\n fn = descriptor.get;\n }\n if (!fn) {\n throw new Error('not supported');\n }\n const memoizeKey = `$memoize$${key}`;\n descriptor[fnKey] = function (...args) {\n if (!this.hasOwnProperty(memoizeKey)) {\n Object.defineProperty(this, memoizeKey, {\n configurable: false,\n enumerable: false,\n writable: false,\n value: fn.apply(this, args)\n });\n }\n return this[memoizeKey];\n };\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport * as DomUtils from './dom.js';\nimport { mainWindow } from './window.js';\nimport * as arrays from '../common/arrays.js';\nimport { memoize } from '../common/decorators.js';\nimport { Event as EventUtils } from '../common/event.js';\nimport { Disposable, markAsSingleton, toDisposable } from '../common/lifecycle.js';\nimport { LinkedList } from '../common/linkedList.js';\nexport var EventType;\n(function (EventType) {\n EventType.Tap = '-monaco-gesturetap';\n EventType.Change = '-monaco-gesturechange';\n EventType.Start = '-monaco-gesturestart';\n EventType.End = '-monaco-gesturesend';\n EventType.Contextmenu = '-monaco-gesturecontextmenu';\n})(EventType || (EventType = {}));\nexport class Gesture extends Disposable {\n constructor() {\n super();\n this.dispatched = false;\n this.targets = new LinkedList();\n this.ignoreTargets = new LinkedList();\n this.activeTouches = {};\n this.handle = null;\n this._lastSetTapCountTime = 0;\n this._register(EventUtils.runAndSubscribe(DomUtils.onDidRegisterWindow, ({ window, disposables }) => {\n disposables.add(DomUtils.addDisposableListener(window.document, 'touchstart', (e) => this.onTouchStart(e), { passive: false }));\n disposables.add(DomUtils.addDisposableListener(window.document, 'touchend', (e) => this.onTouchEnd(window, e)));\n disposables.add(DomUtils.addDisposableListener(window.document, 'touchmove', (e) => this.onTouchMove(e), { passive: false }));\n }, { window: mainWindow, disposables: this._store }));\n }\n static addTarget(element) {\n if (!Gesture.isTouchDevice()) {\n return Disposable.None;\n }\n if (!Gesture.INSTANCE) {\n Gesture.INSTANCE = markAsSingleton(new Gesture());\n }\n const remove = Gesture.INSTANCE.targets.push(element);\n return toDisposable(remove);\n }\n static ignoreTarget(element) {\n if (!Gesture.isTouchDevice()) {\n return Disposable.None;\n }\n if (!Gesture.INSTANCE) {\n Gesture.INSTANCE = markAsSingleton(new Gesture());\n }\n const remove = Gesture.INSTANCE.ignoreTargets.push(element);\n return toDisposable(remove);\n }\n static isTouchDevice() {\n // `'ontouchstart' in window` always evaluates to true with typescript's modern typings. This causes `window` to be\n // `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast\n return 'ontouchstart' in mainWindow || navigator.maxTouchPoints > 0;\n }\n dispose() {\n if (this.handle) {\n this.handle.dispose();\n this.handle = null;\n }\n super.dispose();\n }\n onTouchStart(e) {\n const timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based.\n if (this.handle) {\n this.handle.dispose();\n this.handle = null;\n }\n for (let i = 0, len = e.targetTouches.length; i < len; i++) {\n const touch = e.targetTouches.item(i);\n this.activeTouches[touch.identifier] = {\n id: touch.identifier,\n initialTarget: touch.target,\n initialTimeStamp: timestamp,\n initialPageX: touch.pageX,\n initialPageY: touch.pageY,\n rollingTimestamps: [timestamp],\n rollingPageX: [touch.pageX],\n rollingPageY: [touch.pageY]\n };\n const evt = this.newGestureEvent(EventType.Start, touch.target);\n evt.pageX = touch.pageX;\n evt.pageY = touch.pageY;\n this.dispatchEvent(evt);\n }\n if (this.dispatched) {\n e.preventDefault();\n e.stopPropagation();\n this.dispatched = false;\n }\n }\n onTouchEnd(targetWindow, e) {\n const timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based.\n const activeTouchCount = Object.keys(this.activeTouches).length;\n for (let i = 0, len = e.changedTouches.length; i < len; i++) {\n const touch = e.changedTouches.item(i);\n if (!this.activeTouches.hasOwnProperty(String(touch.identifier))) {\n console.warn('move of an UNKNOWN touch', touch);\n continue;\n }\n const data = this.activeTouches[touch.identifier], holdTime = Date.now() - data.initialTimeStamp;\n if (holdTime < Gesture.HOLD_DELAY\n && Math.abs(data.initialPageX - arrays.tail(data.rollingPageX)) < 30\n && Math.abs(data.initialPageY - arrays.tail(data.rollingPageY)) < 30) {\n const evt = this.newGestureEvent(EventType.Tap, data.initialTarget);\n evt.pageX = arrays.tail(data.rollingPageX);\n evt.pageY = arrays.tail(data.rollingPageY);\n this.dispatchEvent(evt);\n }\n else if (holdTime >= Gesture.HOLD_DELAY\n && Math.abs(data.initialPageX - arrays.tail(data.rollingPageX)) < 30\n && Math.abs(data.initialPageY - arrays.tail(data.rollingPageY)) < 30) {\n const evt = this.newGestureEvent(EventType.Contextmenu, data.initialTarget);\n evt.pageX = arrays.tail(data.rollingPageX);\n evt.pageY = arrays.tail(data.rollingPageY);\n this.dispatchEvent(evt);\n }\n else if (activeTouchCount === 1) {\n const finalX = arrays.tail(data.rollingPageX);\n const finalY = arrays.tail(data.rollingPageY);\n const deltaT = arrays.tail(data.rollingTimestamps) - data.rollingTimestamps[0];\n const deltaX = finalX - data.rollingPageX[0];\n const deltaY = finalY - data.rollingPageY[0];\n // We need to get all the dispatch targets on the start of the inertia event\n const dispatchTo = [...this.targets].filter(t => data.initialTarget instanceof Node && t.contains(data.initialTarget));\n this.inertia(targetWindow, dispatchTo, timestamp, // time now\n Math.abs(deltaX) / deltaT, // speed\n deltaX > 0 ? 1 : -1, // x direction\n finalX, // x now\n Math.abs(deltaY) / deltaT, // y speed\n deltaY > 0 ? 1 : -1, // y direction\n finalY // y now\n );\n }\n this.dispatchEvent(this.newGestureEvent(EventType.End, data.initialTarget));\n // forget about this touch\n delete this.activeTouches[touch.identifier];\n }\n if (this.dispatched) {\n e.preventDefault();\n e.stopPropagation();\n this.dispatched = false;\n }\n }\n newGestureEvent(type, initialTarget) {\n const event = document.createEvent('CustomEvent');\n event.initEvent(type, false, true);\n event.initialTarget = initialTarget;\n event.tapCount = 0;\n return event;\n }\n dispatchEvent(event) {\n if (event.type === EventType.Tap) {\n const currentTime = (new Date()).getTime();\n let setTapCount = 0;\n if (currentTime - this._lastSetTapCountTime > Gesture.CLEAR_TAP_COUNT_TIME) {\n setTapCount = 1;\n }\n else {\n setTapCount = 2;\n }\n this._lastSetTapCountTime = currentTime;\n event.tapCount = setTapCount;\n }\n else if (event.type === EventType.Change || event.type === EventType.Contextmenu) {\n // tap is canceled by scrolling or context menu\n this._lastSetTapCountTime = 0;\n }\n if (event.initialTarget instanceof Node) {\n for (const ignoreTarget of this.ignoreTargets) {\n if (ignoreTarget.contains(event.initialTarget)) {\n return;\n }\n }\n for (const target of this.targets) {\n if (target.contains(event.initialTarget)) {\n target.dispatchEvent(event);\n this.dispatched = true;\n }\n }\n }\n }\n inertia(targetWindow, dispatchTo, t1, vX, dirX, x, vY, dirY, y) {\n this.handle = DomUtils.scheduleAtNextAnimationFrame(targetWindow, () => {\n const now = Date.now();\n // velocity: old speed + accel_over_time\n const deltaT = now - t1;\n let delta_pos_x = 0, delta_pos_y = 0;\n let stopped = true;\n vX += Gesture.SCROLL_FRICTION * deltaT;\n vY += Gesture.SCROLL_FRICTION * deltaT;\n if (vX > 0) {\n stopped = false;\n delta_pos_x = dirX * vX * deltaT;\n }\n if (vY > 0) {\n stopped = false;\n delta_pos_y = dirY * vY * deltaT;\n }\n // dispatch translation event\n const evt = this.newGestureEvent(EventType.Change);\n evt.translationX = delta_pos_x;\n evt.translationY = delta_pos_y;\n dispatchTo.forEach(d => d.dispatchEvent(evt));\n if (!stopped) {\n this.inertia(targetWindow, dispatchTo, now, vX, dirX, x + delta_pos_x, vY, dirY, y + delta_pos_y);\n }\n });\n }\n onTouchMove(e) {\n const timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based.\n for (let i = 0, len = e.changedTouches.length; i < len; i++) {\n const touch = e.changedTouches.item(i);\n if (!this.activeTouches.hasOwnProperty(String(touch.identifier))) {\n console.warn('end of an UNKNOWN touch', touch);\n continue;\n }\n const data = this.activeTouches[touch.identifier];\n const evt = this.newGestureEvent(EventType.Change, data.initialTarget);\n evt.translationX = touch.pageX - arrays.tail(data.rollingPageX);\n evt.translationY = touch.pageY - arrays.tail(data.rollingPageY);\n evt.pageX = touch.pageX;\n evt.pageY = touch.pageY;\n this.dispatchEvent(evt);\n // only keep a few data points, to average the final speed\n if (data.rollingPageX.length > 3) {\n data.rollingPageX.shift();\n data.rollingPageY.shift();\n data.rollingTimestamps.shift();\n }\n data.rollingPageX.push(touch.pageX);\n data.rollingPageY.push(touch.pageY);\n data.rollingTimestamps.push(timestamp);\n }\n if (this.dispatched) {\n e.preventDefault();\n e.stopPropagation();\n this.dispatched = false;\n }\n }\n}\nGesture.SCROLL_FRICTION = -0.005;\nGesture.HOLD_DELAY = 700;\nGesture.CLEAR_TAP_COUNT_TIME = 400; // ms\n__decorate([\n memoize\n], Gesture, \"isTouchDevice\", null);\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as dom from '../dom.js';\nimport { StandardKeyboardEvent } from '../keyboardEvent.js';\nimport { StandardMouseEvent } from '../mouseEvent.js';\nimport { Gesture } from '../touch.js';\nimport { Disposable } from '../../common/lifecycle.js';\nexport class Widget extends Disposable {\n onclick(domNode, listener) {\n this._register(dom.addDisposableListener(domNode, dom.EventType.CLICK, (e) => listener(new StandardMouseEvent(dom.getWindow(domNode), e))));\n }\n onmousedown(domNode, listener) {\n this._register(dom.addDisposableListener(domNode, dom.EventType.MOUSE_DOWN, (e) => listener(new StandardMouseEvent(dom.getWindow(domNode), e))));\n }\n onmouseover(domNode, listener) {\n this._register(dom.addDisposableListener(domNode, dom.EventType.MOUSE_OVER, (e) => listener(new StandardMouseEvent(dom.getWindow(domNode), e))));\n }\n onmouseleave(domNode, listener) {\n this._register(dom.addDisposableListener(domNode, dom.EventType.MOUSE_LEAVE, (e) => listener(new StandardMouseEvent(dom.getWindow(domNode), e))));\n }\n onkeydown(domNode, listener) {\n this._register(dom.addDisposableListener(domNode, dom.EventType.KEY_DOWN, (e) => listener(new StandardKeyboardEvent(e))));\n }\n onkeyup(domNode, listener) {\n this._register(dom.addDisposableListener(domNode, dom.EventType.KEY_UP, (e) => listener(new StandardKeyboardEvent(e))));\n }\n oninput(domNode, listener) {\n this._register(dom.addDisposableListener(domNode, dom.EventType.INPUT, listener));\n }\n onblur(domNode, listener) {\n this._register(dom.addDisposableListener(domNode, dom.EventType.BLUR, listener));\n }\n onfocus(domNode, listener) {\n this._register(dom.addDisposableListener(domNode, dom.EventType.FOCUS, listener));\n }\n ignoreGesture(domNode) {\n return Gesture.ignoreTarget(domNode);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { GlobalPointerMoveMonitor } from '../../globalPointerMoveMonitor.js';\nimport { Widget } from '../widget.js';\nimport { TimeoutTimer } from '../../../common/async.js';\nimport { ThemeIcon } from '../../../common/themables.js';\nimport * as dom from '../../dom.js';\n/**\n * The arrow image size.\n */\nexport const ARROW_IMG_SIZE = 11;\nexport class ScrollbarArrow extends Widget {\n constructor(opts) {\n super();\n this._onActivate = opts.onActivate;\n this.bgDomNode = document.createElement('div');\n this.bgDomNode.className = 'arrow-background';\n this.bgDomNode.style.position = 'absolute';\n this.bgDomNode.style.width = opts.bgWidth + 'px';\n this.bgDomNode.style.height = opts.bgHeight + 'px';\n if (typeof opts.top !== 'undefined') {\n this.bgDomNode.style.top = '0px';\n }\n if (typeof opts.left !== 'undefined') {\n this.bgDomNode.style.left = '0px';\n }\n if (typeof opts.bottom !== 'undefined') {\n this.bgDomNode.style.bottom = '0px';\n }\n if (typeof opts.right !== 'undefined') {\n this.bgDomNode.style.right = '0px';\n }\n this.domNode = document.createElement('div');\n this.domNode.className = opts.className;\n this.domNode.classList.add(...ThemeIcon.asClassNameArray(opts.icon));\n this.domNode.style.position = 'absolute';\n this.domNode.style.width = ARROW_IMG_SIZE + 'px';\n this.domNode.style.height = ARROW_IMG_SIZE + 'px';\n if (typeof opts.top !== 'undefined') {\n this.domNode.style.top = opts.top + 'px';\n }\n if (typeof opts.left !== 'undefined') {\n this.domNode.style.left = opts.left + 'px';\n }\n if (typeof opts.bottom !== 'undefined') {\n this.domNode.style.bottom = opts.bottom + 'px';\n }\n if (typeof opts.right !== 'undefined') {\n this.domNode.style.right = opts.right + 'px';\n }\n this._pointerMoveMonitor = this._register(new GlobalPointerMoveMonitor());\n this._register(dom.addStandardDisposableListener(this.bgDomNode, dom.EventType.POINTER_DOWN, (e) => this._arrowPointerDown(e)));\n this._register(dom.addStandardDisposableListener(this.domNode, dom.EventType.POINTER_DOWN, (e) => this._arrowPointerDown(e)));\n this._pointerdownRepeatTimer = this._register(new dom.WindowIntervalTimer());\n this._pointerdownScheduleRepeatTimer = this._register(new TimeoutTimer());\n }\n _arrowPointerDown(e) {\n if (!e.target || !(e.target instanceof Element)) {\n return;\n }\n const scheduleRepeater = () => {\n this._pointerdownRepeatTimer.cancelAndSet(() => this._onActivate(), 1000 / 24, dom.getWindow(e));\n };\n this._onActivate();\n this._pointerdownRepeatTimer.cancel();\n this._pointerdownScheduleRepeatTimer.cancelAndSet(scheduleRepeater, 200);\n this._pointerMoveMonitor.startMonitoring(e.target, e.pointerId, e.buttons, (pointerMoveData) => { }, () => {\n this._pointerdownRepeatTimer.cancel();\n this._pointerdownScheduleRepeatTimer.cancel();\n });\n e.preventDefault();\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { TimeoutTimer } from '../../../common/async.js';\nimport { Disposable } from '../../../common/lifecycle.js';\nexport class ScrollbarVisibilityController extends Disposable {\n constructor(visibility, visibleClassName, invisibleClassName) {\n super();\n this._visibility = visibility;\n this._visibleClassName = visibleClassName;\n this._invisibleClassName = invisibleClassName;\n this._domNode = null;\n this._isVisible = false;\n this._isNeeded = false;\n this._rawShouldBeVisible = false;\n this._shouldBeVisible = false;\n this._revealTimer = this._register(new TimeoutTimer());\n }\n setVisibility(visibility) {\n if (this._visibility !== visibility) {\n this._visibility = visibility;\n this._updateShouldBeVisible();\n }\n }\n // ----------------- Hide / Reveal\n setShouldBeVisible(rawShouldBeVisible) {\n this._rawShouldBeVisible = rawShouldBeVisible;\n this._updateShouldBeVisible();\n }\n _applyVisibilitySetting() {\n if (this._visibility === 2 /* ScrollbarVisibility.Hidden */) {\n return false;\n }\n if (this._visibility === 3 /* ScrollbarVisibility.Visible */) {\n return true;\n }\n return this._rawShouldBeVisible;\n }\n _updateShouldBeVisible() {\n const shouldBeVisible = this._applyVisibilitySetting();\n if (this._shouldBeVisible !== shouldBeVisible) {\n this._shouldBeVisible = shouldBeVisible;\n this.ensureVisibility();\n }\n }\n setIsNeeded(isNeeded) {\n if (this._isNeeded !== isNeeded) {\n this._isNeeded = isNeeded;\n this.ensureVisibility();\n }\n }\n setDomNode(domNode) {\n this._domNode = domNode;\n this._domNode.setClassName(this._invisibleClassName);\n // Now that the flags & the dom node are in a consistent state, ensure the Hidden/Visible configuration\n this.setShouldBeVisible(false);\n }\n ensureVisibility() {\n if (!this._isNeeded) {\n // Nothing to be rendered\n this._hide(false);\n return;\n }\n if (this._shouldBeVisible) {\n this._reveal();\n }\n else {\n this._hide(true);\n }\n }\n _reveal() {\n if (this._isVisible) {\n return;\n }\n this._isVisible = true;\n // The CSS animation doesn't play otherwise\n this._revealTimer.setIfNotSet(() => {\n var _a;\n (_a = this._domNode) === null || _a === void 0 ? void 0 : _a.setClassName(this._visibleClassName);\n }, 0);\n }\n _hide(withFadeAway) {\n var _a;\n this._revealTimer.cancel();\n if (!this._isVisible) {\n return;\n }\n this._isVisible = false;\n (_a = this._domNode) === null || _a === void 0 ? void 0 : _a.setClassName(this._invisibleClassName + (withFadeAway ? ' fade' : ''));\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as dom from '../../dom.js';\nimport { createFastDomNode } from '../../fastDomNode.js';\nimport { GlobalPointerMoveMonitor } from '../../globalPointerMoveMonitor.js';\nimport { ScrollbarArrow } from './scrollbarArrow.js';\nimport { ScrollbarVisibilityController } from './scrollbarVisibilityController.js';\nimport { Widget } from '../widget.js';\nimport * as platform from '../../../common/platform.js';\n/**\n * The orthogonal distance to the slider at which dragging \"resets\". This implements \"snapping\"\n */\nconst POINTER_DRAG_RESET_DISTANCE = 140;\nexport class AbstractScrollbar extends Widget {\n constructor(opts) {\n super();\n this._lazyRender = opts.lazyRender;\n this._host = opts.host;\n this._scrollable = opts.scrollable;\n this._scrollByPage = opts.scrollByPage;\n this._scrollbarState = opts.scrollbarState;\n this._visibilityController = this._register(new ScrollbarVisibilityController(opts.visibility, 'visible scrollbar ' + opts.extraScrollbarClassName, 'invisible scrollbar ' + opts.extraScrollbarClassName));\n this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());\n this._pointerMoveMonitor = this._register(new GlobalPointerMoveMonitor());\n this._shouldRender = true;\n this.domNode = createFastDomNode(document.createElement('div'));\n this.domNode.setAttribute('role', 'presentation');\n this.domNode.setAttribute('aria-hidden', 'true');\n this._visibilityController.setDomNode(this.domNode);\n this.domNode.setPosition('absolute');\n this._register(dom.addDisposableListener(this.domNode.domNode, dom.EventType.POINTER_DOWN, (e) => this._domNodePointerDown(e)));\n }\n // ----------------- creation\n /**\n * Creates the dom node for an arrow & adds it to the container\n */\n _createArrow(opts) {\n const arrow = this._register(new ScrollbarArrow(opts));\n this.domNode.domNode.appendChild(arrow.bgDomNode);\n this.domNode.domNode.appendChild(arrow.domNode);\n }\n /**\n * Creates the slider dom node, adds it to the container & hooks up the events\n */\n _createSlider(top, left, width, height) {\n this.slider = createFastDomNode(document.createElement('div'));\n this.slider.setClassName('slider');\n this.slider.setPosition('absolute');\n this.slider.setTop(top);\n this.slider.setLeft(left);\n if (typeof width === 'number') {\n this.slider.setWidth(width);\n }\n if (typeof height === 'number') {\n this.slider.setHeight(height);\n }\n this.slider.setLayerHinting(true);\n this.slider.setContain('strict');\n this.domNode.domNode.appendChild(this.slider.domNode);\n this._register(dom.addDisposableListener(this.slider.domNode, dom.EventType.POINTER_DOWN, (e) => {\n if (e.button === 0) {\n e.preventDefault();\n this._sliderPointerDown(e);\n }\n }));\n this.onclick(this.slider.domNode, e => {\n if (e.leftButton) {\n e.stopPropagation();\n }\n });\n }\n // ----------------- Update state\n _onElementSize(visibleSize) {\n if (this._scrollbarState.setVisibleSize(visibleSize)) {\n this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());\n this._shouldRender = true;\n if (!this._lazyRender) {\n this.render();\n }\n }\n return this._shouldRender;\n }\n _onElementScrollSize(elementScrollSize) {\n if (this._scrollbarState.setScrollSize(elementScrollSize)) {\n this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());\n this._shouldRender = true;\n if (!this._lazyRender) {\n this.render();\n }\n }\n return this._shouldRender;\n }\n _onElementScrollPosition(elementScrollPosition) {\n if (this._scrollbarState.setScrollPosition(elementScrollPosition)) {\n this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded());\n this._shouldRender = true;\n if (!this._lazyRender) {\n this.render();\n }\n }\n return this._shouldRender;\n }\n // ----------------- rendering\n beginReveal() {\n this._visibilityController.setShouldBeVisible(true);\n }\n beginHide() {\n this._visibilityController.setShouldBeVisible(false);\n }\n render() {\n if (!this._shouldRender) {\n return;\n }\n this._shouldRender = false;\n this._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize());\n this._updateSlider(this._scrollbarState.getSliderSize(), this._scrollbarState.getArrowSize() + this._scrollbarState.getSliderPosition());\n }\n // ----------------- DOM events\n _domNodePointerDown(e) {\n if (e.target !== this.domNode.domNode) {\n return;\n }\n this._onPointerDown(e);\n }\n delegatePointerDown(e) {\n const domTop = this.domNode.domNode.getClientRects()[0].top;\n const sliderStart = domTop + this._scrollbarState.getSliderPosition();\n const sliderStop = domTop + this._scrollbarState.getSliderPosition() + this._scrollbarState.getSliderSize();\n const pointerPos = this._sliderPointerPosition(e);\n if (sliderStart <= pointerPos && pointerPos <= sliderStop) {\n // Act as if it was a pointer down on the slider\n if (e.button === 0) {\n e.preventDefault();\n this._sliderPointerDown(e);\n }\n }\n else {\n // Act as if it was a pointer down on the scrollbar\n this._onPointerDown(e);\n }\n }\n _onPointerDown(e) {\n let offsetX;\n let offsetY;\n if (e.target === this.domNode.domNode && typeof e.offsetX === 'number' && typeof e.offsetY === 'number') {\n offsetX = e.offsetX;\n offsetY = e.offsetY;\n }\n else {\n const domNodePosition = dom.getDomNodePagePosition(this.domNode.domNode);\n offsetX = e.pageX - domNodePosition.left;\n offsetY = e.pageY - domNodePosition.top;\n }\n const offset = this._pointerDownRelativePosition(offsetX, offsetY);\n this._setDesiredScrollPositionNow(this._scrollByPage\n ? this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(offset)\n : this._scrollbarState.getDesiredScrollPositionFromOffset(offset));\n if (e.button === 0) {\n // left button\n e.preventDefault();\n this._sliderPointerDown(e);\n }\n }\n _sliderPointerDown(e) {\n if (!e.target || !(e.target instanceof Element)) {\n return;\n }\n const initialPointerPosition = this._sliderPointerPosition(e);\n const initialPointerOrthogonalPosition = this._sliderOrthogonalPointerPosition(e);\n const initialScrollbarState = this._scrollbarState.clone();\n this.slider.toggleClassName('active', true);\n this._pointerMoveMonitor.startMonitoring(e.target, e.pointerId, e.buttons, (pointerMoveData) => {\n const pointerOrthogonalPosition = this._sliderOrthogonalPointerPosition(pointerMoveData);\n const pointerOrthogonalDelta = Math.abs(pointerOrthogonalPosition - initialPointerOrthogonalPosition);\n if (platform.isWindows && pointerOrthogonalDelta > POINTER_DRAG_RESET_DISTANCE) {\n // The pointer has wondered away from the scrollbar => reset dragging\n this._setDesiredScrollPositionNow(initialScrollbarState.getScrollPosition());\n return;\n }\n const pointerPosition = this._sliderPointerPosition(pointerMoveData);\n const pointerDelta = pointerPosition - initialPointerPosition;\n this._setDesiredScrollPositionNow(initialScrollbarState.getDesiredScrollPositionFromDelta(pointerDelta));\n }, () => {\n this.slider.toggleClassName('active', false);\n this._host.onDragEnd();\n });\n this._host.onDragStart();\n }\n _setDesiredScrollPositionNow(_desiredScrollPosition) {\n const desiredScrollPosition = {};\n this.writeScrollPosition(desiredScrollPosition, _desiredScrollPosition);\n this._scrollable.setScrollPositionNow(desiredScrollPosition);\n }\n updateScrollbarSize(scrollbarSize) {\n this._updateScrollbarSize(scrollbarSize);\n this._scrollbarState.setScrollbarSize(scrollbarSize);\n this._shouldRender = true;\n if (!this._lazyRender) {\n this.render();\n }\n }\n isNeeded() {\n return this._scrollbarState.isNeeded();\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * The minimal size of the slider (such that it can still be clickable) -- it is artificially enlarged.\n */\nconst MINIMUM_SLIDER_SIZE = 20;\nexport class ScrollbarState {\n constructor(arrowSize, scrollbarSize, oppositeScrollbarSize, visibleSize, scrollSize, scrollPosition) {\n this._scrollbarSize = Math.round(scrollbarSize);\n this._oppositeScrollbarSize = Math.round(oppositeScrollbarSize);\n this._arrowSize = Math.round(arrowSize);\n this._visibleSize = visibleSize;\n this._scrollSize = scrollSize;\n this._scrollPosition = scrollPosition;\n this._computedAvailableSize = 0;\n this._computedIsNeeded = false;\n this._computedSliderSize = 0;\n this._computedSliderRatio = 0;\n this._computedSliderPosition = 0;\n this._refreshComputedValues();\n }\n clone() {\n return new ScrollbarState(this._arrowSize, this._scrollbarSize, this._oppositeScrollbarSize, this._visibleSize, this._scrollSize, this._scrollPosition);\n }\n setVisibleSize(visibleSize) {\n const iVisibleSize = Math.round(visibleSize);\n if (this._visibleSize !== iVisibleSize) {\n this._visibleSize = iVisibleSize;\n this._refreshComputedValues();\n return true;\n }\n return false;\n }\n setScrollSize(scrollSize) {\n const iScrollSize = Math.round(scrollSize);\n if (this._scrollSize !== iScrollSize) {\n this._scrollSize = iScrollSize;\n this._refreshComputedValues();\n return true;\n }\n return false;\n }\n setScrollPosition(scrollPosition) {\n const iScrollPosition = Math.round(scrollPosition);\n if (this._scrollPosition !== iScrollPosition) {\n this._scrollPosition = iScrollPosition;\n this._refreshComputedValues();\n return true;\n }\n return false;\n }\n setScrollbarSize(scrollbarSize) {\n this._scrollbarSize = Math.round(scrollbarSize);\n }\n setOppositeScrollbarSize(oppositeScrollbarSize) {\n this._oppositeScrollbarSize = Math.round(oppositeScrollbarSize);\n }\n static _computeValues(oppositeScrollbarSize, arrowSize, visibleSize, scrollSize, scrollPosition) {\n const computedAvailableSize = Math.max(0, visibleSize - oppositeScrollbarSize);\n const computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * arrowSize);\n const computedIsNeeded = (scrollSize > 0 && scrollSize > visibleSize);\n if (!computedIsNeeded) {\n // There is no need for a slider\n return {\n computedAvailableSize: Math.round(computedAvailableSize),\n computedIsNeeded: computedIsNeeded,\n computedSliderSize: Math.round(computedRepresentableSize),\n computedSliderRatio: 0,\n computedSliderPosition: 0,\n };\n }\n // We must artificially increase the size of the slider if needed, since the slider would be too small to grab with the mouse otherwise\n const computedSliderSize = Math.round(Math.max(MINIMUM_SLIDER_SIZE, Math.floor(visibleSize * computedRepresentableSize / scrollSize)));\n // The slider can move from 0 to `computedRepresentableSize` - `computedSliderSize`\n // in the same way `scrollPosition` can move from 0 to `scrollSize` - `visibleSize`.\n const computedSliderRatio = (computedRepresentableSize - computedSliderSize) / (scrollSize - visibleSize);\n const computedSliderPosition = (scrollPosition * computedSliderRatio);\n return {\n computedAvailableSize: Math.round(computedAvailableSize),\n computedIsNeeded: computedIsNeeded,\n computedSliderSize: Math.round(computedSliderSize),\n computedSliderRatio: computedSliderRatio,\n computedSliderPosition: Math.round(computedSliderPosition),\n };\n }\n _refreshComputedValues() {\n const r = ScrollbarState._computeValues(this._oppositeScrollbarSize, this._arrowSize, this._visibleSize, this._scrollSize, this._scrollPosition);\n this._computedAvailableSize = r.computedAvailableSize;\n this._computedIsNeeded = r.computedIsNeeded;\n this._computedSliderSize = r.computedSliderSize;\n this._computedSliderRatio = r.computedSliderRatio;\n this._computedSliderPosition = r.computedSliderPosition;\n }\n getArrowSize() {\n return this._arrowSize;\n }\n getScrollPosition() {\n return this._scrollPosition;\n }\n getRectangleLargeSize() {\n return this._computedAvailableSize;\n }\n getRectangleSmallSize() {\n return this._scrollbarSize;\n }\n isNeeded() {\n return this._computedIsNeeded;\n }\n getSliderSize() {\n return this._computedSliderSize;\n }\n getSliderPosition() {\n return this._computedSliderPosition;\n }\n /**\n * Compute a desired `scrollPosition` such that `offset` ends up in the center of the slider.\n * `offset` is based on the same coordinate system as the `sliderPosition`.\n */\n getDesiredScrollPositionFromOffset(offset) {\n if (!this._computedIsNeeded) {\n // no need for a slider\n return 0;\n }\n const desiredSliderPosition = offset - this._arrowSize - this._computedSliderSize / 2;\n return Math.round(desiredSliderPosition / this._computedSliderRatio);\n }\n /**\n * Compute a desired `scrollPosition` from if offset is before or after the slider position.\n * If offset is before slider, treat as a page up (or left). If after, page down (or right).\n * `offset` and `_computedSliderPosition` are based on the same coordinate system.\n * `_visibleSize` corresponds to a \"page\" of lines in the returned coordinate system.\n */\n getDesiredScrollPositionFromOffsetPaged(offset) {\n if (!this._computedIsNeeded) {\n // no need for a slider\n return 0;\n }\n const correctedOffset = offset - this._arrowSize; // compensate if has arrows\n let desiredScrollPosition = this._scrollPosition;\n if (correctedOffset < this._computedSliderPosition) {\n desiredScrollPosition -= this._visibleSize; // page up/left\n }\n else {\n desiredScrollPosition += this._visibleSize; // page down/right\n }\n return desiredScrollPosition;\n }\n /**\n * Compute a desired `scrollPosition` such that the slider moves by `delta`.\n */\n getDesiredScrollPositionFromDelta(delta) {\n if (!this._computedIsNeeded) {\n // no need for a slider\n return 0;\n }\n const desiredSliderPosition = this._computedSliderPosition + delta;\n return Math.round(desiredSliderPosition / this._computedSliderRatio);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { StandardWheelEvent } from '../../mouseEvent.js';\nimport { AbstractScrollbar } from './abstractScrollbar.js';\nimport { ARROW_IMG_SIZE } from './scrollbarArrow.js';\nimport { ScrollbarState } from './scrollbarState.js';\nimport { Codicon } from '../../../common/codicons.js';\nexport class HorizontalScrollbar extends AbstractScrollbar {\n constructor(scrollable, options, host) {\n const scrollDimensions = scrollable.getScrollDimensions();\n const scrollPosition = scrollable.getCurrentScrollPosition();\n super({\n lazyRender: options.lazyRender,\n host: host,\n scrollbarState: new ScrollbarState((options.horizontalHasArrows ? options.arrowSize : 0), (options.horizontal === 2 /* ScrollbarVisibility.Hidden */ ? 0 : options.horizontalScrollbarSize), (options.vertical === 2 /* ScrollbarVisibility.Hidden */ ? 0 : options.verticalScrollbarSize), scrollDimensions.width, scrollDimensions.scrollWidth, scrollPosition.scrollLeft),\n visibility: options.horizontal,\n extraScrollbarClassName: 'horizontal',\n scrollable: scrollable,\n scrollByPage: options.scrollByPage\n });\n if (options.horizontalHasArrows) {\n const arrowDelta = (options.arrowSize - ARROW_IMG_SIZE) / 2;\n const scrollbarDelta = (options.horizontalScrollbarSize - ARROW_IMG_SIZE) / 2;\n this._createArrow({\n className: 'scra',\n icon: Codicon.scrollbarButtonLeft,\n top: scrollbarDelta,\n left: arrowDelta,\n bottom: undefined,\n right: undefined,\n bgWidth: options.arrowSize,\n bgHeight: options.horizontalScrollbarSize,\n onActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 1, 0)),\n });\n this._createArrow({\n className: 'scra',\n icon: Codicon.scrollbarButtonRight,\n top: scrollbarDelta,\n left: undefined,\n bottom: undefined,\n right: arrowDelta,\n bgWidth: options.arrowSize,\n bgHeight: options.horizontalScrollbarSize,\n onActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, -1, 0)),\n });\n }\n this._createSlider(Math.floor((options.horizontalScrollbarSize - options.horizontalSliderSize) / 2), 0, undefined, options.horizontalSliderSize);\n }\n _updateSlider(sliderSize, sliderPosition) {\n this.slider.setWidth(sliderSize);\n this.slider.setLeft(sliderPosition);\n }\n _renderDomNode(largeSize, smallSize) {\n this.domNode.setWidth(largeSize);\n this.domNode.setHeight(smallSize);\n this.domNode.setLeft(0);\n this.domNode.setBottom(0);\n }\n onDidScroll(e) {\n this._shouldRender = this._onElementScrollSize(e.scrollWidth) || this._shouldRender;\n this._shouldRender = this._onElementScrollPosition(e.scrollLeft) || this._shouldRender;\n this._shouldRender = this._onElementSize(e.width) || this._shouldRender;\n return this._shouldRender;\n }\n _pointerDownRelativePosition(offsetX, offsetY) {\n return offsetX;\n }\n _sliderPointerPosition(e) {\n return e.pageX;\n }\n _sliderOrthogonalPointerPosition(e) {\n return e.pageY;\n }\n _updateScrollbarSize(size) {\n this.slider.setHeight(size);\n }\n writeScrollPosition(target, scrollPosition) {\n target.scrollLeft = scrollPosition;\n }\n updateOptions(options) {\n this.updateScrollbarSize(options.horizontal === 2 /* ScrollbarVisibility.Hidden */ ? 0 : options.horizontalScrollbarSize);\n this._scrollbarState.setOppositeScrollbarSize(options.vertical === 2 /* ScrollbarVisibility.Hidden */ ? 0 : options.verticalScrollbarSize);\n this._visibilityController.setVisibility(options.horizontal);\n this._scrollByPage = options.scrollByPage;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { StandardWheelEvent } from '../../mouseEvent.js';\nimport { AbstractScrollbar } from './abstractScrollbar.js';\nimport { ARROW_IMG_SIZE } from './scrollbarArrow.js';\nimport { ScrollbarState } from './scrollbarState.js';\nimport { Codicon } from '../../../common/codicons.js';\nexport class VerticalScrollbar extends AbstractScrollbar {\n constructor(scrollable, options, host) {\n const scrollDimensions = scrollable.getScrollDimensions();\n const scrollPosition = scrollable.getCurrentScrollPosition();\n super({\n lazyRender: options.lazyRender,\n host: host,\n scrollbarState: new ScrollbarState((options.verticalHasArrows ? options.arrowSize : 0), (options.vertical === 2 /* ScrollbarVisibility.Hidden */ ? 0 : options.verticalScrollbarSize), \n // give priority to vertical scroll bar over horizontal and let it scroll all the way to the bottom\n 0, scrollDimensions.height, scrollDimensions.scrollHeight, scrollPosition.scrollTop),\n visibility: options.vertical,\n extraScrollbarClassName: 'vertical',\n scrollable: scrollable,\n scrollByPage: options.scrollByPage\n });\n if (options.verticalHasArrows) {\n const arrowDelta = (options.arrowSize - ARROW_IMG_SIZE) / 2;\n const scrollbarDelta = (options.verticalScrollbarSize - ARROW_IMG_SIZE) / 2;\n this._createArrow({\n className: 'scra',\n icon: Codicon.scrollbarButtonUp,\n top: arrowDelta,\n left: scrollbarDelta,\n bottom: undefined,\n right: undefined,\n bgWidth: options.verticalScrollbarSize,\n bgHeight: options.arrowSize,\n onActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 0, 1)),\n });\n this._createArrow({\n className: 'scra',\n icon: Codicon.scrollbarButtonDown,\n top: undefined,\n left: scrollbarDelta,\n bottom: arrowDelta,\n right: undefined,\n bgWidth: options.verticalScrollbarSize,\n bgHeight: options.arrowSize,\n onActivate: () => this._host.onMouseWheel(new StandardWheelEvent(null, 0, -1)),\n });\n }\n this._createSlider(0, Math.floor((options.verticalScrollbarSize - options.verticalSliderSize) / 2), options.verticalSliderSize, undefined);\n }\n _updateSlider(sliderSize, sliderPosition) {\n this.slider.setHeight(sliderSize);\n this.slider.setTop(sliderPosition);\n }\n _renderDomNode(largeSize, smallSize) {\n this.domNode.setWidth(smallSize);\n this.domNode.setHeight(largeSize);\n this.domNode.setRight(0);\n this.domNode.setTop(0);\n }\n onDidScroll(e) {\n this._shouldRender = this._onElementScrollSize(e.scrollHeight) || this._shouldRender;\n this._shouldRender = this._onElementScrollPosition(e.scrollTop) || this._shouldRender;\n this._shouldRender = this._onElementSize(e.height) || this._shouldRender;\n return this._shouldRender;\n }\n _pointerDownRelativePosition(offsetX, offsetY) {\n return offsetY;\n }\n _sliderPointerPosition(e) {\n return e.pageY;\n }\n _sliderOrthogonalPointerPosition(e) {\n return e.pageX;\n }\n _updateScrollbarSize(size) {\n this.slider.setWidth(size);\n }\n writeScrollPosition(target, scrollPosition) {\n target.scrollTop = scrollPosition;\n }\n updateOptions(options) {\n this.updateScrollbarSize(options.vertical === 2 /* ScrollbarVisibility.Hidden */ ? 0 : options.verticalScrollbarSize);\n // give priority to vertical scroll bar over horizontal and let it scroll all the way to the bottom\n this._scrollbarState.setOppositeScrollbarSize(0);\n this._visibilityController.setVisibility(options.vertical);\n this._scrollByPage = options.scrollByPage;\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Emitter } from './event.js';\nimport { Disposable } from './lifecycle.js';\nexport class ScrollState {\n constructor(_forceIntegerValues, width, scrollWidth, scrollLeft, height, scrollHeight, scrollTop) {\n this._forceIntegerValues = _forceIntegerValues;\n this._scrollStateBrand = undefined;\n if (this._forceIntegerValues) {\n width = width | 0;\n scrollWidth = scrollWidth | 0;\n scrollLeft = scrollLeft | 0;\n height = height | 0;\n scrollHeight = scrollHeight | 0;\n scrollTop = scrollTop | 0;\n }\n this.rawScrollLeft = scrollLeft; // before validation\n this.rawScrollTop = scrollTop; // before validation\n if (width < 0) {\n width = 0;\n }\n if (scrollLeft + width > scrollWidth) {\n scrollLeft = scrollWidth - width;\n }\n if (scrollLeft < 0) {\n scrollLeft = 0;\n }\n if (height < 0) {\n height = 0;\n }\n if (scrollTop + height > scrollHeight) {\n scrollTop = scrollHeight - height;\n }\n if (scrollTop < 0) {\n scrollTop = 0;\n }\n this.width = width;\n this.scrollWidth = scrollWidth;\n this.scrollLeft = scrollLeft;\n this.height = height;\n this.scrollHeight = scrollHeight;\n this.scrollTop = scrollTop;\n }\n equals(other) {\n return (this.rawScrollLeft === other.rawScrollLeft\n && this.rawScrollTop === other.rawScrollTop\n && this.width === other.width\n && this.scrollWidth === other.scrollWidth\n && this.scrollLeft === other.scrollLeft\n && this.height === other.height\n && this.scrollHeight === other.scrollHeight\n && this.scrollTop === other.scrollTop);\n }\n withScrollDimensions(update, useRawScrollPositions) {\n return new ScrollState(this._forceIntegerValues, (typeof update.width !== 'undefined' ? update.width : this.width), (typeof update.scrollWidth !== 'undefined' ? update.scrollWidth : this.scrollWidth), useRawScrollPositions ? this.rawScrollLeft : this.scrollLeft, (typeof update.height !== 'undefined' ? update.height : this.height), (typeof update.scrollHeight !== 'undefined' ? update.scrollHeight : this.scrollHeight), useRawScrollPositions ? this.rawScrollTop : this.scrollTop);\n }\n withScrollPosition(update) {\n return new ScrollState(this._forceIntegerValues, this.width, this.scrollWidth, (typeof update.scrollLeft !== 'undefined' ? update.scrollLeft : this.rawScrollLeft), this.height, this.scrollHeight, (typeof update.scrollTop !== 'undefined' ? update.scrollTop : this.rawScrollTop));\n }\n createScrollEvent(previous, inSmoothScrolling) {\n const widthChanged = (this.width !== previous.width);\n const scrollWidthChanged = (this.scrollWidth !== previous.scrollWidth);\n const scrollLeftChanged = (this.scrollLeft !== previous.scrollLeft);\n const heightChanged = (this.height !== previous.height);\n const scrollHeightChanged = (this.scrollHeight !== previous.scrollHeight);\n const scrollTopChanged = (this.scrollTop !== previous.scrollTop);\n return {\n inSmoothScrolling: inSmoothScrolling,\n oldWidth: previous.width,\n oldScrollWidth: previous.scrollWidth,\n oldScrollLeft: previous.scrollLeft,\n width: this.width,\n scrollWidth: this.scrollWidth,\n scrollLeft: this.scrollLeft,\n oldHeight: previous.height,\n oldScrollHeight: previous.scrollHeight,\n oldScrollTop: previous.scrollTop,\n height: this.height,\n scrollHeight: this.scrollHeight,\n scrollTop: this.scrollTop,\n widthChanged: widthChanged,\n scrollWidthChanged: scrollWidthChanged,\n scrollLeftChanged: scrollLeftChanged,\n heightChanged: heightChanged,\n scrollHeightChanged: scrollHeightChanged,\n scrollTopChanged: scrollTopChanged,\n };\n }\n}\nexport class Scrollable extends Disposable {\n constructor(options) {\n super();\n this._scrollableBrand = undefined;\n this._onScroll = this._register(new Emitter());\n this.onScroll = this._onScroll.event;\n this._smoothScrollDuration = options.smoothScrollDuration;\n this._scheduleAtNextAnimationFrame = options.scheduleAtNextAnimationFrame;\n this._state = new ScrollState(options.forceIntegerValues, 0, 0, 0, 0, 0, 0);\n this._smoothScrolling = null;\n }\n dispose() {\n if (this._smoothScrolling) {\n this._smoothScrolling.dispose();\n this._smoothScrolling = null;\n }\n super.dispose();\n }\n setSmoothScrollDuration(smoothScrollDuration) {\n this._smoothScrollDuration = smoothScrollDuration;\n }\n validateScrollPosition(scrollPosition) {\n return this._state.withScrollPosition(scrollPosition);\n }\n getScrollDimensions() {\n return this._state;\n }\n setScrollDimensions(dimensions, useRawScrollPositions) {\n var _a;\n const newState = this._state.withScrollDimensions(dimensions, useRawScrollPositions);\n this._setState(newState, Boolean(this._smoothScrolling));\n // Validate outstanding animated scroll position target\n (_a = this._smoothScrolling) === null || _a === void 0 ? void 0 : _a.acceptScrollDimensions(this._state);\n }\n /**\n * Returns the final scroll position that the instance will have once the smooth scroll animation concludes.\n * If no scroll animation is occurring, it will return the current scroll position instead.\n */\n getFutureScrollPosition() {\n if (this._smoothScrolling) {\n return this._smoothScrolling.to;\n }\n return this._state;\n }\n /**\n * Returns the current scroll position.\n * Note: This result might be an intermediate scroll position, as there might be an ongoing smooth scroll animation.\n */\n getCurrentScrollPosition() {\n return this._state;\n }\n setScrollPositionNow(update) {\n // no smooth scrolling requested\n const newState = this._state.withScrollPosition(update);\n // Terminate any outstanding smooth scrolling\n if (this._smoothScrolling) {\n this._smoothScrolling.dispose();\n this._smoothScrolling = null;\n }\n this._setState(newState, false);\n }\n setScrollPositionSmooth(update, reuseAnimation) {\n if (this._smoothScrollDuration === 0) {\n // Smooth scrolling not supported.\n return this.setScrollPositionNow(update);\n }\n if (this._smoothScrolling) {\n // Combine our pending scrollLeft/scrollTop with incoming scrollLeft/scrollTop\n update = {\n scrollLeft: (typeof update.scrollLeft === 'undefined' ? this._smoothScrolling.to.scrollLeft : update.scrollLeft),\n scrollTop: (typeof update.scrollTop === 'undefined' ? this._smoothScrolling.to.scrollTop : update.scrollTop)\n };\n // Validate `update`\n const validTarget = this._state.withScrollPosition(update);\n if (this._smoothScrolling.to.scrollLeft === validTarget.scrollLeft && this._smoothScrolling.to.scrollTop === validTarget.scrollTop) {\n // No need to interrupt or extend the current animation since we're going to the same place\n return;\n }\n let newSmoothScrolling;\n if (reuseAnimation) {\n newSmoothScrolling = new SmoothScrollingOperation(this._smoothScrolling.from, validTarget, this._smoothScrolling.startTime, this._smoothScrolling.duration);\n }\n else {\n newSmoothScrolling = this._smoothScrolling.combine(this._state, validTarget, this._smoothScrollDuration);\n }\n this._smoothScrolling.dispose();\n this._smoothScrolling = newSmoothScrolling;\n }\n else {\n // Validate `update`\n const validTarget = this._state.withScrollPosition(update);\n this._smoothScrolling = SmoothScrollingOperation.start(this._state, validTarget, this._smoothScrollDuration);\n }\n // Begin smooth scrolling animation\n this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {\n if (!this._smoothScrolling) {\n return;\n }\n this._smoothScrolling.animationFrameDisposable = null;\n this._performSmoothScrolling();\n });\n }\n hasPendingScrollAnimation() {\n return Boolean(this._smoothScrolling);\n }\n _performSmoothScrolling() {\n if (!this._smoothScrolling) {\n return;\n }\n const update = this._smoothScrolling.tick();\n const newState = this._state.withScrollPosition(update);\n this._setState(newState, true);\n if (!this._smoothScrolling) {\n // Looks like someone canceled the smooth scrolling\n // from the scroll event handler\n return;\n }\n if (update.isDone) {\n this._smoothScrolling.dispose();\n this._smoothScrolling = null;\n return;\n }\n // Continue smooth scrolling animation\n this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {\n if (!this._smoothScrolling) {\n return;\n }\n this._smoothScrolling.animationFrameDisposable = null;\n this._performSmoothScrolling();\n });\n }\n _setState(newState, inSmoothScrolling) {\n const oldState = this._state;\n if (oldState.equals(newState)) {\n // no change\n return;\n }\n this._state = newState;\n this._onScroll.fire(this._state.createScrollEvent(oldState, inSmoothScrolling));\n }\n}\nexport class SmoothScrollingUpdate {\n constructor(scrollLeft, scrollTop, isDone) {\n this.scrollLeft = scrollLeft;\n this.scrollTop = scrollTop;\n this.isDone = isDone;\n }\n}\nfunction createEaseOutCubic(from, to) {\n const delta = to - from;\n return function (completion) {\n return from + delta * easeOutCubic(completion);\n };\n}\nfunction createComposed(a, b, cut) {\n return function (completion) {\n if (completion < cut) {\n return a(completion / cut);\n }\n return b((completion - cut) / (1 - cut));\n };\n}\nexport class SmoothScrollingOperation {\n constructor(from, to, startTime, duration) {\n this.from = from;\n this.to = to;\n this.duration = duration;\n this.startTime = startTime;\n this.animationFrameDisposable = null;\n this._initAnimations();\n }\n _initAnimations() {\n this.scrollLeft = this._initAnimation(this.from.scrollLeft, this.to.scrollLeft, this.to.width);\n this.scrollTop = this._initAnimation(this.from.scrollTop, this.to.scrollTop, this.to.height);\n }\n _initAnimation(from, to, viewportSize) {\n const delta = Math.abs(from - to);\n if (delta > 2.5 * viewportSize) {\n let stop1, stop2;\n if (from < to) {\n // scroll to 75% of the viewportSize\n stop1 = from + 0.75 * viewportSize;\n stop2 = to - 0.75 * viewportSize;\n }\n else {\n stop1 = from - 0.75 * viewportSize;\n stop2 = to + 0.75 * viewportSize;\n }\n return createComposed(createEaseOutCubic(from, stop1), createEaseOutCubic(stop2, to), 0.33);\n }\n return createEaseOutCubic(from, to);\n }\n dispose() {\n if (this.animationFrameDisposable !== null) {\n this.animationFrameDisposable.dispose();\n this.animationFrameDisposable = null;\n }\n }\n acceptScrollDimensions(state) {\n this.to = state.withScrollPosition(this.to);\n this._initAnimations();\n }\n tick() {\n return this._tick(Date.now());\n }\n _tick(now) {\n const completion = (now - this.startTime) / this.duration;\n if (completion < 1) {\n const newScrollLeft = this.scrollLeft(completion);\n const newScrollTop = this.scrollTop(completion);\n return new SmoothScrollingUpdate(newScrollLeft, newScrollTop, false);\n }\n return new SmoothScrollingUpdate(this.to.scrollLeft, this.to.scrollTop, true);\n }\n combine(from, to, duration) {\n return SmoothScrollingOperation.start(from, to, duration);\n }\n static start(from, to, duration) {\n // +10 / -10 : pretend the animation already started for a quicker response to a scroll request\n duration = duration + 10;\n const startTime = Date.now() - 10;\n return new SmoothScrollingOperation(from, to, startTime, duration);\n }\n}\nfunction easeInCubic(t) {\n return Math.pow(t, 3);\n}\nfunction easeOutCubic(t) {\n return 1 - easeInCubic(1 - t);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/* Arrows */\n.monaco-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.monaco-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n\t/* In front of peek view */\n\tz-index: 11;\n}\n.monaco-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.monaco-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.monaco-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.monaco-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.monaco-scrollable-element > .shadow.top.left {\n\tbox-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;\n}\n\n.monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: var(--vscode-scrollbarSlider-background);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: var(--vscode-scrollbarSlider-hoverBackground);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: var(--vscode-scrollbarSlider-activeBackground);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getZoomFactor, isChrome } from '../../browser.js';\nimport * as dom from '../../dom.js';\nimport { createFastDomNode } from '../../fastDomNode.js';\nimport { StandardWheelEvent } from '../../mouseEvent.js';\nimport { HorizontalScrollbar } from './horizontalScrollbar.js';\nimport { VerticalScrollbar } from './verticalScrollbar.js';\nimport { Widget } from '../widget.js';\nimport { TimeoutTimer } from '../../../common/async.js';\nimport { Emitter } from '../../../common/event.js';\nimport { dispose } from '../../../common/lifecycle.js';\nimport * as platform from '../../../common/platform.js';\nimport { Scrollable } from '../../../common/scrollable.js';\nimport './media/scrollbars.css';\nconst HIDE_TIMEOUT = 500;\nconst SCROLL_WHEEL_SENSITIVITY = 50;\nconst SCROLL_WHEEL_SMOOTH_SCROLL_ENABLED = true;\nclass MouseWheelClassifierItem {\n constructor(timestamp, deltaX, deltaY) {\n this.timestamp = timestamp;\n this.deltaX = deltaX;\n this.deltaY = deltaY;\n this.score = 0;\n }\n}\nexport class MouseWheelClassifier {\n constructor() {\n this._capacity = 5;\n this._memory = [];\n this._front = -1;\n this._rear = -1;\n }\n isPhysicalMouseWheel() {\n if (this._front === -1 && this._rear === -1) {\n // no elements\n return false;\n }\n // 0.5 * last + 0.25 * 2nd last + 0.125 * 3rd last + ...\n let remainingInfluence = 1;\n let score = 0;\n let iteration = 1;\n let index = this._rear;\n do {\n const influence = (index === this._front ? remainingInfluence : Math.pow(2, -iteration));\n remainingInfluence -= influence;\n score += this._memory[index].score * influence;\n if (index === this._front) {\n break;\n }\n index = (this._capacity + index - 1) % this._capacity;\n iteration++;\n } while (true);\n return (score <= 0.5);\n }\n acceptStandardWheelEvent(e) {\n if (isChrome) {\n const targetWindow = dom.getWindow(e.browserEvent);\n const pageZoomFactor = getZoomFactor(targetWindow);\n // On Chrome, the incoming delta events are multiplied with the OS zoom factor.\n // The OS zoom factor can be reverse engineered by using the device pixel ratio and the configured zoom factor into account.\n this.accept(Date.now(), e.deltaX * pageZoomFactor, e.deltaY * pageZoomFactor);\n }\n else {\n this.accept(Date.now(), e.deltaX, e.deltaY);\n }\n }\n accept(timestamp, deltaX, deltaY) {\n const item = new MouseWheelClassifierItem(timestamp, deltaX, deltaY);\n item.score = this._computeScore(item);\n if (this._front === -1 && this._rear === -1) {\n this._memory[0] = item;\n this._front = 0;\n this._rear = 0;\n }\n else {\n this._rear = (this._rear + 1) % this._capacity;\n if (this._rear === this._front) {\n // Drop oldest\n this._front = (this._front + 1) % this._capacity;\n }\n this._memory[this._rear] = item;\n }\n }\n /**\n * A score between 0 and 1 for `item`.\n * - a score towards 0 indicates that the source appears to be a physical mouse wheel\n * - a score towards 1 indicates that the source appears to be a touchpad or magic mouse, etc.\n */\n _computeScore(item) {\n if (Math.abs(item.deltaX) > 0 && Math.abs(item.deltaY) > 0) {\n // both axes exercised => definitely not a physical mouse wheel\n return 1;\n }\n let score = 0.5;\n const prev = (this._front === -1 && this._rear === -1 ? null : this._memory[this._rear]);\n if (prev) {\n // const deltaT = item.timestamp - prev.timestamp;\n // if (deltaT < 1000 / 30) {\n // \t// sooner than X times per second => indicator that this is not a physical mouse wheel\n // \tscore += 0.25;\n // }\n // if (item.deltaX === prev.deltaX && item.deltaY === prev.deltaY) {\n // \t// equal amplitude => indicator that this is a physical mouse wheel\n // \tscore -= 0.25;\n // }\n }\n if (!this._isAlmostInt(item.deltaX) || !this._isAlmostInt(item.deltaY)) {\n // non-integer deltas => indicator that this is not a physical mouse wheel\n score += 0.25;\n }\n return Math.min(Math.max(score, 0), 1);\n }\n _isAlmostInt(value) {\n const delta = Math.abs(Math.round(value) - value);\n return (delta < 0.01);\n }\n}\nMouseWheelClassifier.INSTANCE = new MouseWheelClassifier();\nexport class AbstractScrollableElement extends Widget {\n get options() {\n return this._options;\n }\n constructor(element, options, scrollable) {\n super();\n this._onScroll = this._register(new Emitter());\n this.onScroll = this._onScroll.event;\n this._onWillScroll = this._register(new Emitter());\n element.style.overflow = 'hidden';\n this._options = resolveOptions(options);\n this._scrollable = scrollable;\n this._register(this._scrollable.onScroll((e) => {\n this._onWillScroll.fire(e);\n this._onDidScroll(e);\n this._onScroll.fire(e);\n }));\n const scrollbarHost = {\n onMouseWheel: (mouseWheelEvent) => this._onMouseWheel(mouseWheelEvent),\n onDragStart: () => this._onDragStart(),\n onDragEnd: () => this._onDragEnd(),\n };\n this._verticalScrollbar = this._register(new VerticalScrollbar(this._scrollable, this._options, scrollbarHost));\n this._horizontalScrollbar = this._register(new HorizontalScrollbar(this._scrollable, this._options, scrollbarHost));\n this._domNode = document.createElement('div');\n this._domNode.className = 'monaco-scrollable-element ' + this._options.className;\n this._domNode.setAttribute('role', 'presentation');\n this._domNode.style.position = 'relative';\n this._domNode.style.overflow = 'hidden';\n this._domNode.appendChild(element);\n this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode);\n this._domNode.appendChild(this._verticalScrollbar.domNode.domNode);\n if (this._options.useShadows) {\n this._leftShadowDomNode = createFastDomNode(document.createElement('div'));\n this._leftShadowDomNode.setClassName('shadow');\n this._domNode.appendChild(this._leftShadowDomNode.domNode);\n this._topShadowDomNode = createFastDomNode(document.createElement('div'));\n this._topShadowDomNode.setClassName('shadow');\n this._domNode.appendChild(this._topShadowDomNode.domNode);\n this._topLeftShadowDomNode = createFastDomNode(document.createElement('div'));\n this._topLeftShadowDomNode.setClassName('shadow');\n this._domNode.appendChild(this._topLeftShadowDomNode.domNode);\n }\n else {\n this._leftShadowDomNode = null;\n this._topShadowDomNode = null;\n this._topLeftShadowDomNode = null;\n }\n this._listenOnDomNode = this._options.listenOnDomNode || this._domNode;\n this._mouseWheelToDispose = [];\n this._setListeningToMouseWheel(this._options.handleMouseWheel);\n this.onmouseover(this._listenOnDomNode, (e) => this._onMouseOver(e));\n this.onmouseleave(this._listenOnDomNode, (e) => this._onMouseLeave(e));\n this._hideTimeout = this._register(new TimeoutTimer());\n this._isDragging = false;\n this._mouseIsOver = false;\n this._shouldRender = true;\n this._revealOnScroll = true;\n }\n dispose() {\n this._mouseWheelToDispose = dispose(this._mouseWheelToDispose);\n super.dispose();\n }\n /**\n * Get the generated 'scrollable' dom node\n */\n getDomNode() {\n return this._domNode;\n }\n getOverviewRulerLayoutInfo() {\n return {\n parent: this._domNode,\n insertBefore: this._verticalScrollbar.domNode.domNode,\n };\n }\n /**\n * Delegate a pointer down event to the vertical scrollbar.\n * This is to help with clicking somewhere else and having the scrollbar react.\n */\n delegateVerticalScrollbarPointerDown(browserEvent) {\n this._verticalScrollbar.delegatePointerDown(browserEvent);\n }\n getScrollDimensions() {\n return this._scrollable.getScrollDimensions();\n }\n setScrollDimensions(dimensions) {\n this._scrollable.setScrollDimensions(dimensions, false);\n }\n /**\n * Update the class name of the scrollable element.\n */\n updateClassName(newClassName) {\n this._options.className = newClassName;\n // Defaults are different on Macs\n if (platform.isMacintosh) {\n this._options.className += ' mac';\n }\n this._domNode.className = 'monaco-scrollable-element ' + this._options.className;\n }\n /**\n * Update configuration options for the scrollbar.\n */\n updateOptions(newOptions) {\n if (typeof newOptions.handleMouseWheel !== 'undefined') {\n this._options.handleMouseWheel = newOptions.handleMouseWheel;\n this._setListeningToMouseWheel(this._options.handleMouseWheel);\n }\n if (typeof newOptions.mouseWheelScrollSensitivity !== 'undefined') {\n this._options.mouseWheelScrollSensitivity = newOptions.mouseWheelScrollSensitivity;\n }\n if (typeof newOptions.fastScrollSensitivity !== 'undefined') {\n this._options.fastScrollSensitivity = newOptions.fastScrollSensitivity;\n }\n if (typeof newOptions.scrollPredominantAxis !== 'undefined') {\n this._options.scrollPredominantAxis = newOptions.scrollPredominantAxis;\n }\n if (typeof newOptions.horizontal !== 'undefined') {\n this._options.horizontal = newOptions.horizontal;\n }\n if (typeof newOptions.vertical !== 'undefined') {\n this._options.vertical = newOptions.vertical;\n }\n if (typeof newOptions.horizontalScrollbarSize !== 'undefined') {\n this._options.horizontalScrollbarSize = newOptions.horizontalScrollbarSize;\n }\n if (typeof newOptions.verticalScrollbarSize !== 'undefined') {\n this._options.verticalScrollbarSize = newOptions.verticalScrollbarSize;\n }\n if (typeof newOptions.scrollByPage !== 'undefined') {\n this._options.scrollByPage = newOptions.scrollByPage;\n }\n this._horizontalScrollbar.updateOptions(this._options);\n this._verticalScrollbar.updateOptions(this._options);\n if (!this._options.lazyRender) {\n this._render();\n }\n }\n delegateScrollFromMouseWheelEvent(browserEvent) {\n this._onMouseWheel(new StandardWheelEvent(browserEvent));\n }\n // -------------------- mouse wheel scrolling --------------------\n _setListeningToMouseWheel(shouldListen) {\n const isListening = (this._mouseWheelToDispose.length > 0);\n if (isListening === shouldListen) {\n // No change\n return;\n }\n // Stop listening (if necessary)\n this._mouseWheelToDispose = dispose(this._mouseWheelToDispose);\n // Start listening (if necessary)\n if (shouldListen) {\n const onMouseWheel = (browserEvent) => {\n this._onMouseWheel(new StandardWheelEvent(browserEvent));\n };\n this._mouseWheelToDispose.push(dom.addDisposableListener(this._listenOnDomNode, dom.EventType.MOUSE_WHEEL, onMouseWheel, { passive: false }));\n }\n }\n _onMouseWheel(e) {\n var _a;\n if ((_a = e.browserEvent) === null || _a === void 0 ? void 0 : _a.defaultPrevented) {\n return;\n }\n const classifier = MouseWheelClassifier.INSTANCE;\n if (SCROLL_WHEEL_SMOOTH_SCROLL_ENABLED) {\n classifier.acceptStandardWheelEvent(e);\n }\n // console.log(`${Date.now()}, ${e.deltaY}, ${e.deltaX}`);\n let didScroll = false;\n if (e.deltaY || e.deltaX) {\n let deltaY = e.deltaY * this._options.mouseWheelScrollSensitivity;\n let deltaX = e.deltaX * this._options.mouseWheelScrollSensitivity;\n if (this._options.scrollPredominantAxis) {\n if (this._options.scrollYToX && deltaX + deltaY === 0) {\n // when configured to map Y to X and we both see\n // no dominant axis and X and Y are competing with\n // identical values into opposite directions, we\n // ignore the delta as we cannot make a decision then\n deltaX = deltaY = 0;\n }\n else if (Math.abs(deltaY) >= Math.abs(deltaX)) {\n deltaX = 0;\n }\n else {\n deltaY = 0;\n }\n }\n if (this._options.flipAxes) {\n [deltaY, deltaX] = [deltaX, deltaY];\n }\n // Convert vertical scrolling to horizontal if shift is held, this\n // is handled at a higher level on Mac\n const shiftConvert = !platform.isMacintosh && e.browserEvent && e.browserEvent.shiftKey;\n if ((this._options.scrollYToX || shiftConvert) && !deltaX) {\n deltaX = deltaY;\n deltaY = 0;\n }\n if (e.browserEvent && e.browserEvent.altKey) {\n // fastScrolling\n deltaX = deltaX * this._options.fastScrollSensitivity;\n deltaY = deltaY * this._options.fastScrollSensitivity;\n }\n const futureScrollPosition = this._scrollable.getFutureScrollPosition();\n let desiredScrollPosition = {};\n if (deltaY) {\n const deltaScrollTop = SCROLL_WHEEL_SENSITIVITY * deltaY;\n // Here we convert values such as -0.3 to -1 or 0.3 to 1, otherwise low speed scrolling will never scroll\n const desiredScrollTop = futureScrollPosition.scrollTop - (deltaScrollTop < 0 ? Math.floor(deltaScrollTop) : Math.ceil(deltaScrollTop));\n this._verticalScrollbar.writeScrollPosition(desiredScrollPosition, desiredScrollTop);\n }\n if (deltaX) {\n const deltaScrollLeft = SCROLL_WHEEL_SENSITIVITY * deltaX;\n // Here we convert values such as -0.3 to -1 or 0.3 to 1, otherwise low speed scrolling will never scroll\n const desiredScrollLeft = futureScrollPosition.scrollLeft - (deltaScrollLeft < 0 ? Math.floor(deltaScrollLeft) : Math.ceil(deltaScrollLeft));\n this._horizontalScrollbar.writeScrollPosition(desiredScrollPosition, desiredScrollLeft);\n }\n // Check that we are scrolling towards a location which is valid\n desiredScrollPosition = this._scrollable.validateScrollPosition(desiredScrollPosition);\n if (futureScrollPosition.scrollLeft !== desiredScrollPosition.scrollLeft || futureScrollPosition.scrollTop !== desiredScrollPosition.scrollTop) {\n const canPerformSmoothScroll = (SCROLL_WHEEL_SMOOTH_SCROLL_ENABLED\n && this._options.mouseWheelSmoothScroll\n && classifier.isPhysicalMouseWheel());\n if (canPerformSmoothScroll) {\n this._scrollable.setScrollPositionSmooth(desiredScrollPosition);\n }\n else {\n this._scrollable.setScrollPositionNow(desiredScrollPosition);\n }\n didScroll = true;\n }\n }\n let consumeMouseWheel = didScroll;\n if (!consumeMouseWheel && this._options.alwaysConsumeMouseWheel) {\n consumeMouseWheel = true;\n }\n if (!consumeMouseWheel && this._options.consumeMouseWheelIfScrollbarIsNeeded && (this._verticalScrollbar.isNeeded() || this._horizontalScrollbar.isNeeded())) {\n consumeMouseWheel = true;\n }\n if (consumeMouseWheel) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n _onDidScroll(e) {\n this._shouldRender = this._horizontalScrollbar.onDidScroll(e) || this._shouldRender;\n this._shouldRender = this._verticalScrollbar.onDidScroll(e) || this._shouldRender;\n if (this._options.useShadows) {\n this._shouldRender = true;\n }\n if (this._revealOnScroll) {\n this._reveal();\n }\n if (!this._options.lazyRender) {\n this._render();\n }\n }\n /**\n * Render / mutate the DOM now.\n * Should be used together with the ctor option `lazyRender`.\n */\n renderNow() {\n if (!this._options.lazyRender) {\n throw new Error('Please use `lazyRender` together with `renderNow`!');\n }\n this._render();\n }\n _render() {\n if (!this._shouldRender) {\n return;\n }\n this._shouldRender = false;\n this._horizontalScrollbar.render();\n this._verticalScrollbar.render();\n if (this._options.useShadows) {\n const scrollState = this._scrollable.getCurrentScrollPosition();\n const enableTop = scrollState.scrollTop > 0;\n const enableLeft = scrollState.scrollLeft > 0;\n const leftClassName = (enableLeft ? ' left' : '');\n const topClassName = (enableTop ? ' top' : '');\n const topLeftClassName = (enableLeft || enableTop ? ' top-left-corner' : '');\n this._leftShadowDomNode.setClassName(`shadow${leftClassName}`);\n this._topShadowDomNode.setClassName(`shadow${topClassName}`);\n this._topLeftShadowDomNode.setClassName(`shadow${topLeftClassName}${topClassName}${leftClassName}`);\n }\n }\n // -------------------- fade in / fade out --------------------\n _onDragStart() {\n this._isDragging = true;\n this._reveal();\n }\n _onDragEnd() {\n this._isDragging = false;\n this._hide();\n }\n _onMouseLeave(e) {\n this._mouseIsOver = false;\n this._hide();\n }\n _onMouseOver(e) {\n this._mouseIsOver = true;\n this._reveal();\n }\n _reveal() {\n this._verticalScrollbar.beginReveal();\n this._horizontalScrollbar.beginReveal();\n this._scheduleHide();\n }\n _hide() {\n if (!this._mouseIsOver && !this._isDragging) {\n this._verticalScrollbar.beginHide();\n this._horizontalScrollbar.beginHide();\n }\n }\n _scheduleHide() {\n if (!this._mouseIsOver && !this._isDragging) {\n this._hideTimeout.cancelAndSet(() => this._hide(), HIDE_TIMEOUT);\n }\n }\n}\nexport class ScrollableElement extends AbstractScrollableElement {\n constructor(element, options) {\n options = options || {};\n options.mouseWheelSmoothScroll = false;\n const scrollable = new Scrollable({\n forceIntegerValues: true,\n smoothScrollDuration: 0,\n scheduleAtNextAnimationFrame: (callback) => dom.scheduleAtNextAnimationFrame(dom.getWindow(element), callback)\n });\n super(element, options, scrollable);\n this._register(scrollable);\n }\n setScrollPosition(update) {\n this._scrollable.setScrollPositionNow(update);\n }\n}\nexport class SmoothScrollableElement extends AbstractScrollableElement {\n constructor(element, options, scrollable) {\n super(element, options, scrollable);\n }\n setScrollPosition(update) {\n if (update.reuseAnimation) {\n this._scrollable.setScrollPositionSmooth(update, update.reuseAnimation);\n }\n else {\n this._scrollable.setScrollPositionNow(update);\n }\n }\n getScrollPosition() {\n return this._scrollable.getCurrentScrollPosition();\n }\n}\nexport class DomScrollableElement extends AbstractScrollableElement {\n constructor(element, options) {\n options = options || {};\n options.mouseWheelSmoothScroll = false;\n const scrollable = new Scrollable({\n forceIntegerValues: false, // See https://github.com/microsoft/vscode/issues/139877\n smoothScrollDuration: 0,\n scheduleAtNextAnimationFrame: (callback) => dom.scheduleAtNextAnimationFrame(dom.getWindow(element), callback)\n });\n super(element, options, scrollable);\n this._register(scrollable);\n this._element = element;\n this._register(this.onScroll((e) => {\n if (e.scrollTopChanged) {\n this._element.scrollTop = e.scrollTop;\n }\n if (e.scrollLeftChanged) {\n this._element.scrollLeft = e.scrollLeft;\n }\n }));\n this.scanDomNode();\n }\n setScrollPosition(update) {\n this._scrollable.setScrollPositionNow(update);\n }\n getScrollPosition() {\n return this._scrollable.getCurrentScrollPosition();\n }\n scanDomNode() {\n // width, scrollLeft, scrollWidth, height, scrollTop, scrollHeight\n this.setScrollDimensions({\n width: this._element.clientWidth,\n scrollWidth: this._element.scrollWidth,\n height: this._element.clientHeight,\n scrollHeight: this._element.scrollHeight\n });\n this.setScrollPosition({\n scrollLeft: this._element.scrollLeft,\n scrollTop: this._element.scrollTop,\n });\n }\n}\nfunction resolveOptions(opts) {\n const result = {\n lazyRender: (typeof opts.lazyRender !== 'undefined' ? opts.lazyRender : false),\n className: (typeof opts.className !== 'undefined' ? opts.className : ''),\n useShadows: (typeof opts.useShadows !== 'undefined' ? opts.useShadows : true),\n handleMouseWheel: (typeof opts.handleMouseWheel !== 'undefined' ? opts.handleMouseWheel : true),\n flipAxes: (typeof opts.flipAxes !== 'undefined' ? opts.flipAxes : false),\n consumeMouseWheelIfScrollbarIsNeeded: (typeof opts.consumeMouseWheelIfScrollbarIsNeeded !== 'undefined' ? opts.consumeMouseWheelIfScrollbarIsNeeded : false),\n alwaysConsumeMouseWheel: (typeof opts.alwaysConsumeMouseWheel !== 'undefined' ? opts.alwaysConsumeMouseWheel : false),\n scrollYToX: (typeof opts.scrollYToX !== 'undefined' ? opts.scrollYToX : false),\n mouseWheelScrollSensitivity: (typeof opts.mouseWheelScrollSensitivity !== 'undefined' ? opts.mouseWheelScrollSensitivity : 1),\n fastScrollSensitivity: (typeof opts.fastScrollSensitivity !== 'undefined' ? opts.fastScrollSensitivity : 5),\n scrollPredominantAxis: (typeof opts.scrollPredominantAxis !== 'undefined' ? opts.scrollPredominantAxis : true),\n mouseWheelSmoothScroll: (typeof opts.mouseWheelSmoothScroll !== 'undefined' ? opts.mouseWheelSmoothScroll : true),\n arrowSize: (typeof opts.arrowSize !== 'undefined' ? opts.arrowSize : 11),\n listenOnDomNode: (typeof opts.listenOnDomNode !== 'undefined' ? opts.listenOnDomNode : null),\n horizontal: (typeof opts.horizontal !== 'undefined' ? opts.horizontal : 1 /* ScrollbarVisibility.Auto */),\n horizontalScrollbarSize: (typeof opts.horizontalScrollbarSize !== 'undefined' ? opts.horizontalScrollbarSize : 10),\n horizontalSliderSize: (typeof opts.horizontalSliderSize !== 'undefined' ? opts.horizontalSliderSize : 0),\n horizontalHasArrows: (typeof opts.horizontalHasArrows !== 'undefined' ? opts.horizontalHasArrows : false),\n vertical: (typeof opts.vertical !== 'undefined' ? opts.vertical : 1 /* ScrollbarVisibility.Auto */),\n verticalScrollbarSize: (typeof opts.verticalScrollbarSize !== 'undefined' ? opts.verticalScrollbarSize : 10),\n verticalHasArrows: (typeof opts.verticalHasArrows !== 'undefined' ? opts.verticalHasArrows : false),\n verticalSliderSize: (typeof opts.verticalSliderSize !== 'undefined' ? opts.verticalSliderSize : 0),\n scrollByPage: (typeof opts.scrollByPage !== 'undefined' ? opts.scrollByPage : false)\n };\n result.horizontalSliderSize = (typeof opts.horizontalSliderSize !== 'undefined' ? opts.horizontalSliderSize : result.horizontalScrollbarSize);\n result.verticalSliderSize = (typeof opts.verticalSliderSize !== 'undefined' ? opts.verticalSliderSize : result.verticalScrollbarSize);\n // Defaults are different on Macs\n if (platform.isMacintosh) {\n result.className += ' mac';\n }\n return result;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as dom from '../../../base/browser/dom.js';\nimport { StandardWheelEvent } from '../../../base/browser/mouseEvent.js';\nimport { Disposable } from '../../../base/common/lifecycle.js';\nimport * as platform from '../../../base/common/platform.js';\nimport { HitTestContext, MouseTarget, MouseTargetFactory } from './mouseTarget.js';\nimport { ClientCoordinates, EditorMouseEvent, EditorMouseEventFactory, GlobalEditorPointerMoveMonitor, createEditorPagePosition, createCoordinatesRelativeToEditor, PageCoordinates } from '../editorDom.js';\nimport { EditorZoom } from '../../common/config/editorZoom.js';\nimport { Position } from '../../common/core/position.js';\nimport { Selection } from '../../common/core/selection.js';\nimport { ViewEventHandler } from '../../common/viewEventHandler.js';\nimport { MouseWheelClassifier } from '../../../base/browser/ui/scrollbar/scrollableElement.js';\nexport class MouseHandler extends ViewEventHandler {\n constructor(context, viewController, viewHelper) {\n super();\n this._mouseLeaveMonitor = null;\n this._context = context;\n this.viewController = viewController;\n this.viewHelper = viewHelper;\n this.mouseTargetFactory = new MouseTargetFactory(this._context, viewHelper);\n this._mouseDownOperation = this._register(new MouseDownOperation(this._context, this.viewController, this.viewHelper, this.mouseTargetFactory, (e, testEventTarget) => this._createMouseTarget(e, testEventTarget), (e) => this._getMouseColumn(e)));\n this.lastMouseLeaveTime = -1;\n this._height = this._context.configuration.options.get(143 /* EditorOption.layoutInfo */).height;\n const mouseEvents = new EditorMouseEventFactory(this.viewHelper.viewDomNode);\n this._register(mouseEvents.onContextMenu(this.viewHelper.viewDomNode, (e) => this._onContextMenu(e, true)));\n this._register(mouseEvents.onMouseMove(this.viewHelper.viewDomNode, (e) => {\n this._onMouseMove(e);\n // See https://github.com/microsoft/vscode/issues/138789\n // When moving the mouse really quickly, the browser sometimes forgets to\n // send us a `mouseleave` or `mouseout` event. We therefore install here\n // a global `mousemove` listener to manually recover if the mouse goes outside\n // the editor. As soon as the mouse leaves outside of the editor, we\n // remove this listener\n if (!this._mouseLeaveMonitor) {\n this._mouseLeaveMonitor = dom.addDisposableListener(this.viewHelper.viewDomNode.ownerDocument, 'mousemove', (e) => {\n if (!this.viewHelper.viewDomNode.contains(e.target)) {\n // went outside the editor!\n this._onMouseLeave(new EditorMouseEvent(e, false, this.viewHelper.viewDomNode));\n }\n });\n }\n }));\n this._register(mouseEvents.onMouseUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e)));\n this._register(mouseEvents.onMouseLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e)));\n // `pointerdown` events can't be used to determine if there's a double click, or triple click\n // because their `e.detail` is always 0.\n // We will therefore save the pointer id for the mouse and then reuse it in the `mousedown` event\n // for `element.setPointerCapture`.\n let capturePointerId = 0;\n this._register(mouseEvents.onPointerDown(this.viewHelper.viewDomNode, (e, pointerId) => {\n capturePointerId = pointerId;\n }));\n // The `pointerup` listener registered by `GlobalEditorPointerMoveMonitor` does not get invoked 100% of the times.\n // I speculate that this is because the `pointerup` listener is only registered during the `mousedown` event, and perhaps\n // the `pointerup` event is already queued for dispatching, which makes it that the new listener doesn't get fired.\n // See https://github.com/microsoft/vscode/issues/146486 for repro steps.\n // To compensate for that, we simply register here a `pointerup` listener and just communicate it.\n this._register(dom.addDisposableListener(this.viewHelper.viewDomNode, dom.EventType.POINTER_UP, (e) => {\n this._mouseDownOperation.onPointerUp();\n }));\n this._register(mouseEvents.onMouseDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e, capturePointerId)));\n this._setupMouseWheelZoomListener();\n this._context.addEventHandler(this);\n }\n _setupMouseWheelZoomListener() {\n const classifier = MouseWheelClassifier.INSTANCE;\n let prevMouseWheelTime = 0;\n let gestureStartZoomLevel = EditorZoom.getZoomLevel();\n let gestureHasZoomModifiers = false;\n let gestureAccumulatedDelta = 0;\n const onMouseWheel = (browserEvent) => {\n this.viewController.emitMouseWheel(browserEvent);\n if (!this._context.configuration.options.get(75 /* EditorOption.mouseWheelZoom */)) {\n return;\n }\n const e = new StandardWheelEvent(browserEvent);\n classifier.acceptStandardWheelEvent(e);\n if (classifier.isPhysicalMouseWheel()) {\n if (hasMouseWheelZoomModifiers(browserEvent)) {\n const zoomLevel = EditorZoom.getZoomLevel();\n const delta = e.deltaY > 0 ? 1 : -1;\n EditorZoom.setZoomLevel(zoomLevel + delta);\n e.preventDefault();\n e.stopPropagation();\n }\n }\n else {\n // we consider mousewheel events that occur within 50ms of each other to be part of the same gesture\n // we don't want to consider mouse wheel events where ctrl/cmd is pressed during the inertia phase\n // we also want to accumulate deltaY values from the same gesture and use that to set the zoom level\n if (Date.now() - prevMouseWheelTime > 50) {\n // reset if more than 50ms have passed\n gestureStartZoomLevel = EditorZoom.getZoomLevel();\n gestureHasZoomModifiers = hasMouseWheelZoomModifiers(browserEvent);\n gestureAccumulatedDelta = 0;\n }\n prevMouseWheelTime = Date.now();\n gestureAccumulatedDelta += e.deltaY;\n if (gestureHasZoomModifiers) {\n EditorZoom.setZoomLevel(gestureStartZoomLevel + gestureAccumulatedDelta / 5);\n e.preventDefault();\n e.stopPropagation();\n }\n }\n };\n this._register(dom.addDisposableListener(this.viewHelper.viewDomNode, dom.EventType.MOUSE_WHEEL, onMouseWheel, { capture: true, passive: false }));\n function hasMouseWheelZoomModifiers(browserEvent) {\n return (platform.isMacintosh\n // on macOS we support cmd + two fingers scroll (`metaKey` set)\n // and also the two fingers pinch gesture (`ctrKey` set)\n ? ((browserEvent.metaKey || browserEvent.ctrlKey) && !browserEvent.shiftKey && !browserEvent.altKey)\n : (browserEvent.ctrlKey && !browserEvent.metaKey && !browserEvent.shiftKey && !browserEvent.altKey));\n }\n }\n dispose() {\n this._context.removeEventHandler(this);\n if (this._mouseLeaveMonitor) {\n this._mouseLeaveMonitor.dispose();\n this._mouseLeaveMonitor = null;\n }\n super.dispose();\n }\n // --- begin event handlers\n onConfigurationChanged(e) {\n if (e.hasChanged(143 /* EditorOption.layoutInfo */)) {\n // layout change\n const height = this._context.configuration.options.get(143 /* EditorOption.layoutInfo */).height;\n if (this._height !== height) {\n this._height = height;\n this._mouseDownOperation.onHeightChanged();\n }\n }\n return false;\n }\n onCursorStateChanged(e) {\n this._mouseDownOperation.onCursorStateChanged(e);\n return false;\n }\n onFocusChanged(e) {\n return false;\n }\n // --- end event handlers\n getTargetAtClientPoint(clientX, clientY) {\n const clientPos = new ClientCoordinates(clientX, clientY);\n const pos = clientPos.toPageCoordinates(dom.getWindow(this.viewHelper.viewDomNode));\n const editorPos = createEditorPagePosition(this.viewHelper.viewDomNode);\n if (pos.y < editorPos.y || pos.y > editorPos.y + editorPos.height || pos.x < editorPos.x || pos.x > editorPos.x + editorPos.width) {\n return null;\n }\n const relativePos = createCoordinatesRelativeToEditor(this.viewHelper.viewDomNode, editorPos, pos);\n return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), editorPos, pos, relativePos, null);\n }\n _createMouseTarget(e, testEventTarget) {\n let target = e.target;\n if (!this.viewHelper.viewDomNode.contains(target)) {\n const shadowRoot = dom.getShadowRoot(this.viewHelper.viewDomNode);\n if (shadowRoot) {\n target = shadowRoot.elementsFromPoint(e.posx, e.posy).find((el) => this.viewHelper.viewDomNode.contains(el));\n }\n }\n return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e.editorPos, e.pos, e.relativePos, testEventTarget ? target : null);\n }\n _getMouseColumn(e) {\n return this.mouseTargetFactory.getMouseColumn(e.relativePos);\n }\n _onContextMenu(e, testEventTarget) {\n this.viewController.emitContextMenu({\n event: e,\n target: this._createMouseTarget(e, testEventTarget)\n });\n }\n _onMouseMove(e) {\n const targetIsWidget = this.mouseTargetFactory.mouseTargetIsWidget(e);\n if (!targetIsWidget) {\n e.preventDefault();\n }\n if (this._mouseDownOperation.isActive()) {\n // In selection/drag operation\n return;\n }\n const actualMouseMoveTime = e.timestamp;\n if (actualMouseMoveTime < this.lastMouseLeaveTime) {\n // Due to throttling, this event occurred before the mouse left the editor, therefore ignore it.\n return;\n }\n this.viewController.emitMouseMove({\n event: e,\n target: this._createMouseTarget(e, true)\n });\n }\n _onMouseLeave(e) {\n if (this._mouseLeaveMonitor) {\n this._mouseLeaveMonitor.dispose();\n this._mouseLeaveMonitor = null;\n }\n this.lastMouseLeaveTime = (new Date()).getTime();\n this.viewController.emitMouseLeave({\n event: e,\n target: null\n });\n }\n _onMouseUp(e) {\n this.viewController.emitMouseUp({\n event: e,\n target: this._createMouseTarget(e, true)\n });\n }\n _onMouseDown(e, pointerId) {\n const t = this._createMouseTarget(e, true);\n const targetIsContent = (t.type === 6 /* MouseTargetType.CONTENT_TEXT */ || t.type === 7 /* MouseTargetType.CONTENT_EMPTY */);\n const targetIsGutter = (t.type === 2 /* MouseTargetType.GUTTER_GLYPH_MARGIN */ || t.type === 3 /* MouseTargetType.GUTTER_LINE_NUMBERS */ || t.type === 4 /* MouseTargetType.GUTTER_LINE_DECORATIONS */);\n const targetIsLineNumbers = (t.type === 3 /* MouseTargetType.GUTTER_LINE_NUMBERS */);\n const selectOnLineNumbers = this._context.configuration.options.get(108 /* EditorOption.selectOnLineNumbers */);\n const targetIsViewZone = (t.type === 8 /* MouseTargetType.CONTENT_VIEW_ZONE */ || t.type === 5 /* MouseTargetType.GUTTER_VIEW_ZONE */);\n const targetIsWidget = (t.type === 9 /* MouseTargetType.CONTENT_WIDGET */);\n let shouldHandle = e.leftButton || e.middleButton;\n if (platform.isMacintosh && e.leftButton && e.ctrlKey) {\n shouldHandle = false;\n }\n const focus = () => {\n e.preventDefault();\n this.viewHelper.focusTextArea();\n };\n if (shouldHandle && (targetIsContent || (targetIsLineNumbers && selectOnLineNumbers))) {\n focus();\n this._mouseDownOperation.start(t.type, e, pointerId);\n }\n else if (targetIsGutter) {\n // Do not steal focus\n e.preventDefault();\n }\n else if (targetIsViewZone) {\n const viewZoneData = t.detail;\n if (shouldHandle && this.viewHelper.shouldSuppressMouseDownOnViewZone(viewZoneData.viewZoneId)) {\n focus();\n this._mouseDownOperation.start(t.type, e, pointerId);\n e.preventDefault();\n }\n }\n else if (targetIsWidget && this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)) {\n focus();\n e.preventDefault();\n }\n this.viewController.emitMouseDown({\n event: e,\n target: t\n });\n }\n}\nclass MouseDownOperation extends Disposable {\n constructor(_context, _viewController, _viewHelper, _mouseTargetFactory, createMouseTarget, getMouseColumn) {\n super();\n this._context = _context;\n this._viewController = _viewController;\n this._viewHelper = _viewHelper;\n this._mouseTargetFactory = _mouseTargetFactory;\n this._createMouseTarget = createMouseTarget;\n this._getMouseColumn = getMouseColumn;\n this._mouseMoveMonitor = this._register(new GlobalEditorPointerMoveMonitor(this._viewHelper.viewDomNode));\n this._topBottomDragScrolling = this._register(new TopBottomDragScrolling(this._context, this._viewHelper, this._mouseTargetFactory, (position, inSelectionMode, revealType) => this._dispatchMouse(position, inSelectionMode, revealType)));\n this._mouseState = new MouseDownState();\n this._currentSelection = new Selection(1, 1, 1, 1);\n this._isActive = false;\n this._lastMouseEvent = null;\n }\n dispose() {\n super.dispose();\n }\n isActive() {\n return this._isActive;\n }\n _onMouseDownThenMove(e) {\n this._lastMouseEvent = e;\n this._mouseState.setModifiers(e);\n const position = this._findMousePosition(e, false);\n if (!position) {\n // Ignoring because position is unknown\n return;\n }\n if (this._mouseState.isDragAndDrop) {\n this._viewController.emitMouseDrag({\n event: e,\n target: position\n });\n }\n else {\n if (position.type === 13 /* MouseTargetType.OUTSIDE_EDITOR */ && (position.outsidePosition === 'above' || position.outsidePosition === 'below')) {\n this._topBottomDragScrolling.start(position, e);\n }\n else {\n this._topBottomDragScrolling.stop();\n this._dispatchMouse(position, true, 1 /* NavigationCommandRevealType.Minimal */);\n }\n }\n }\n start(targetType, e, pointerId) {\n this._lastMouseEvent = e;\n this._mouseState.setStartedOnLineNumbers(targetType === 3 /* MouseTargetType.GUTTER_LINE_NUMBERS */);\n this._mouseState.setStartButtons(e);\n this._mouseState.setModifiers(e);\n const position = this._findMousePosition(e, true);\n if (!position || !position.position) {\n // Ignoring because position is unknown\n return;\n }\n this._mouseState.trySetCount(e.detail, position.position);\n // Overwrite the detail of the MouseEvent, as it will be sent out in an event and contributions might rely on it.\n e.detail = this._mouseState.count;\n const options = this._context.configuration.options;\n if (!options.get(90 /* EditorOption.readOnly */)\n && options.get(35 /* EditorOption.dragAndDrop */)\n && !options.get(22 /* EditorOption.columnSelection */)\n && !this._mouseState.altKey // we don't support multiple mouse\n && e.detail < 2 // only single click on a selection can work\n && !this._isActive // the mouse is not down yet\n && !this._currentSelection.isEmpty() // we don't drag single cursor\n && (position.type === 6 /* MouseTargetType.CONTENT_TEXT */) // single click on text\n && position.position && this._currentSelection.containsPosition(position.position) // single click on a selection\n ) {\n this._mouseState.isDragAndDrop = true;\n this._isActive = true;\n this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode, pointerId, e.buttons, (e) => this._onMouseDownThenMove(e), (browserEvent) => {\n const position = this._findMousePosition(this._lastMouseEvent, false);\n if (dom.isKeyboardEvent(browserEvent)) {\n // cancel\n this._viewController.emitMouseDropCanceled();\n }\n else {\n this._viewController.emitMouseDrop({\n event: this._lastMouseEvent,\n target: (position ? this._createMouseTarget(this._lastMouseEvent, true) : null) // Ignoring because position is unknown, e.g., Content View Zone\n });\n }\n this._stop();\n });\n return;\n }\n this._mouseState.isDragAndDrop = false;\n this._dispatchMouse(position, e.shiftKey, 1 /* NavigationCommandRevealType.Minimal */);\n if (!this._isActive) {\n this._isActive = true;\n this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode, pointerId, e.buttons, (e) => this._onMouseDownThenMove(e), () => this._stop());\n }\n }\n _stop() {\n this._isActive = false;\n this._topBottomDragScrolling.stop();\n }\n onHeightChanged() {\n this._mouseMoveMonitor.stopMonitoring();\n }\n onPointerUp() {\n this._mouseMoveMonitor.stopMonitoring();\n }\n onCursorStateChanged(e) {\n this._currentSelection = e.selections[0];\n }\n _getPositionOutsideEditor(e) {\n const editorContent = e.editorPos;\n const model = this._context.viewModel;\n const viewLayout = this._context.viewLayout;\n const mouseColumn = this._getMouseColumn(e);\n if (e.posy < editorContent.y) {\n const outsideDistance = editorContent.y - e.posy;\n const verticalOffset = Math.max(viewLayout.getCurrentScrollTop() - outsideDistance, 0);\n const viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n if (viewZoneData) {\n const newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n if (newPosition) {\n return MouseTarget.createOutsideEditor(mouseColumn, newPosition, 'above', outsideDistance);\n }\n }\n const aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n return MouseTarget.createOutsideEditor(mouseColumn, new Position(aboveLineNumber, 1), 'above', outsideDistance);\n }\n if (e.posy > editorContent.y + editorContent.height) {\n const outsideDistance = e.posy - editorContent.y - editorContent.height;\n const verticalOffset = viewLayout.getCurrentScrollTop() + e.relativePos.y;\n const viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n if (viewZoneData) {\n const newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n if (newPosition) {\n return MouseTarget.createOutsideEditor(mouseColumn, newPosition, 'below', outsideDistance);\n }\n }\n const belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n return MouseTarget.createOutsideEditor(mouseColumn, new Position(belowLineNumber, model.getLineMaxColumn(belowLineNumber)), 'below', outsideDistance);\n }\n const possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getCurrentScrollTop() + e.relativePos.y);\n if (e.posx < editorContent.x) {\n const outsideDistance = editorContent.x - e.posx;\n return MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, 1), 'left', outsideDistance);\n }\n if (e.posx > editorContent.x + editorContent.width) {\n const outsideDistance = e.posx - editorContent.x - editorContent.width;\n return MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, model.getLineMaxColumn(possibleLineNumber)), 'right', outsideDistance);\n }\n return null;\n }\n _findMousePosition(e, testEventTarget) {\n const positionOutsideEditor = this._getPositionOutsideEditor(e);\n if (positionOutsideEditor) {\n return positionOutsideEditor;\n }\n const t = this._createMouseTarget(e, testEventTarget);\n const hintedPosition = t.position;\n if (!hintedPosition) {\n return null;\n }\n if (t.type === 8 /* MouseTargetType.CONTENT_VIEW_ZONE */ || t.type === 5 /* MouseTargetType.GUTTER_VIEW_ZONE */) {\n const newPosition = this._helpPositionJumpOverViewZone(t.detail);\n if (newPosition) {\n return MouseTarget.createViewZone(t.type, t.element, t.mouseColumn, newPosition, t.detail);\n }\n }\n return t;\n }\n _helpPositionJumpOverViewZone(viewZoneData) {\n // Force position on view zones to go above or below depending on where selection started from\n const selectionStart = new Position(this._currentSelection.selectionStartLineNumber, this._currentSelection.selectionStartColumn);\n const positionBefore = viewZoneData.positionBefore;\n const positionAfter = viewZoneData.positionAfter;\n if (positionBefore && positionAfter) {\n if (positionBefore.isBefore(selectionStart)) {\n return positionBefore;\n }\n else {\n return positionAfter;\n }\n }\n return null;\n }\n _dispatchMouse(position, inSelectionMode, revealType) {\n if (!position.position) {\n return;\n }\n this._viewController.dispatchMouse({\n position: position.position,\n mouseColumn: position.mouseColumn,\n startedOnLineNumbers: this._mouseState.startedOnLineNumbers,\n revealType,\n inSelectionMode: inSelectionMode,\n mouseDownCount: this._mouseState.count,\n altKey: this._mouseState.altKey,\n ctrlKey: this._mouseState.ctrlKey,\n metaKey: this._mouseState.metaKey,\n shiftKey: this._mouseState.shiftKey,\n leftButton: this._mouseState.leftButton,\n middleButton: this._mouseState.middleButton,\n onInjectedText: position.type === 6 /* MouseTargetType.CONTENT_TEXT */ && position.detail.injectedText !== null\n });\n }\n}\nclass TopBottomDragScrolling extends Disposable {\n constructor(_context, _viewHelper, _mouseTargetFactory, _dispatchMouse) {\n super();\n this._context = _context;\n this._viewHelper = _viewHelper;\n this._mouseTargetFactory = _mouseTargetFactory;\n this._dispatchMouse = _dispatchMouse;\n this._operation = null;\n }\n dispose() {\n super.dispose();\n this.stop();\n }\n start(position, mouseEvent) {\n if (this._operation) {\n this._operation.setPosition(position, mouseEvent);\n }\n else {\n this._operation = new TopBottomDragScrollingOperation(this._context, this._viewHelper, this._mouseTargetFactory, this._dispatchMouse, position, mouseEvent);\n }\n }\n stop() {\n if (this._operation) {\n this._operation.dispose();\n this._operation = null;\n }\n }\n}\nclass TopBottomDragScrollingOperation extends Disposable {\n constructor(_context, _viewHelper, _mouseTargetFactory, _dispatchMouse, position, mouseEvent) {\n super();\n this._context = _context;\n this._viewHelper = _viewHelper;\n this._mouseTargetFactory = _mouseTargetFactory;\n this._dispatchMouse = _dispatchMouse;\n this._position = position;\n this._mouseEvent = mouseEvent;\n this._lastTime = Date.now();\n this._animationFrameDisposable = dom.scheduleAtNextAnimationFrame(dom.getWindow(mouseEvent.browserEvent), () => this._execute());\n }\n dispose() {\n this._animationFrameDisposable.dispose();\n super.dispose();\n }\n setPosition(position, mouseEvent) {\n this._position = position;\n this._mouseEvent = mouseEvent;\n }\n /**\n * update internal state and return elapsed ms since last time\n */\n _tick() {\n const now = Date.now();\n const elapsed = now - this._lastTime;\n this._lastTime = now;\n return elapsed;\n }\n /**\n * get the number of lines per second to auto-scroll\n */\n _getScrollSpeed() {\n const lineHeight = this._context.configuration.options.get(66 /* EditorOption.lineHeight */);\n const viewportInLines = this._context.configuration.options.get(143 /* EditorOption.layoutInfo */).height / lineHeight;\n const outsideDistanceInLines = this._position.outsideDistance / lineHeight;\n if (outsideDistanceInLines <= 1.5) {\n return Math.max(30, viewportInLines * (1 + outsideDistanceInLines));\n }\n if (outsideDistanceInLines <= 3) {\n return Math.max(60, viewportInLines * (2 + outsideDistanceInLines));\n }\n return Math.max(200, viewportInLines * (7 + outsideDistanceInLines));\n }\n _execute() {\n const lineHeight = this._context.configuration.options.get(66 /* EditorOption.lineHeight */);\n const scrollSpeedInLines = this._getScrollSpeed();\n const elapsed = this._tick();\n const scrollInPixels = scrollSpeedInLines * (elapsed / 1000) * lineHeight;\n const scrollValue = (this._position.outsidePosition === 'above' ? -scrollInPixels : scrollInPixels);\n this._context.viewModel.viewLayout.deltaScrollNow(0, scrollValue);\n this._viewHelper.renderNow();\n const viewportData = this._context.viewLayout.getLinesViewportData();\n const edgeLineNumber = (this._position.outsidePosition === 'above' ? viewportData.startLineNumber : viewportData.endLineNumber);\n // First, try to find a position that matches the horizontal position of the mouse\n let mouseTarget;\n {\n const editorPos = createEditorPagePosition(this._viewHelper.viewDomNode);\n const horizontalScrollbarHeight = this._context.configuration.options.get(143 /* EditorOption.layoutInfo */).horizontalScrollbarHeight;\n const pos = new PageCoordinates(this._mouseEvent.pos.x, editorPos.y + editorPos.height - horizontalScrollbarHeight - 0.1);\n const relativePos = createCoordinatesRelativeToEditor(this._viewHelper.viewDomNode, editorPos, pos);\n mouseTarget = this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(), editorPos, pos, relativePos, null);\n }\n if (!mouseTarget.position || mouseTarget.position.lineNumber !== edgeLineNumber) {\n if (this._position.outsidePosition === 'above') {\n mouseTarget = MouseTarget.createOutsideEditor(this._position.mouseColumn, new Position(edgeLineNumber, 1), 'above', this._position.outsideDistance);\n }\n else {\n mouseTarget = MouseTarget.createOutsideEditor(this._position.mouseColumn, new Position(edgeLineNumber, this._context.viewModel.getLineMaxColumn(edgeLineNumber)), 'below', this._position.outsideDistance);\n }\n }\n this._dispatchMouse(mouseTarget, true, 2 /* NavigationCommandRevealType.None */);\n this._animationFrameDisposable = dom.scheduleAtNextAnimationFrame(dom.getWindow(mouseTarget.element), () => this._execute());\n }\n}\nclass MouseDownState {\n get altKey() { return this._altKey; }\n get ctrlKey() { return this._ctrlKey; }\n get metaKey() { return this._metaKey; }\n get shiftKey() { return this._shiftKey; }\n get leftButton() { return this._leftButton; }\n get middleButton() { return this._middleButton; }\n get startedOnLineNumbers() { return this._startedOnLineNumbers; }\n constructor() {\n this._altKey = false;\n this._ctrlKey = false;\n this._metaKey = false;\n this._shiftKey = false;\n this._leftButton = false;\n this._middleButton = false;\n this._startedOnLineNumbers = false;\n this._lastMouseDownPosition = null;\n this._lastMouseDownPositionEqualCount = 0;\n this._lastMouseDownCount = 0;\n this._lastSetMouseDownCountTime = 0;\n this.isDragAndDrop = false;\n }\n get count() {\n return this._lastMouseDownCount;\n }\n setModifiers(source) {\n this._altKey = source.altKey;\n this._ctrlKey = source.ctrlKey;\n this._metaKey = source.metaKey;\n this._shiftKey = source.shiftKey;\n }\n setStartButtons(source) {\n this._leftButton = source.leftButton;\n this._middleButton = source.middleButton;\n }\n setStartedOnLineNumbers(startedOnLineNumbers) {\n this._startedOnLineNumbers = startedOnLineNumbers;\n }\n trySetCount(setMouseDownCount, newMouseDownPosition) {\n // a. Invalidate multiple clicking if too much time has passed (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n const currentTime = (new Date()).getTime();\n if (currentTime - this._lastSetMouseDownCountTime > MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME) {\n setMouseDownCount = 1;\n }\n this._lastSetMouseDownCountTime = currentTime;\n // b. Ensure that we don't jump from single click to triple click in one go (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n if (setMouseDownCount > this._lastMouseDownCount + 1) {\n setMouseDownCount = this._lastMouseDownCount + 1;\n }\n // c. Invalidate multiple clicking if the logical position is different\n if (this._lastMouseDownPosition && this._lastMouseDownPosition.equals(newMouseDownPosition)) {\n this._lastMouseDownPositionEqualCount++;\n }\n else {\n this._lastMouseDownPositionEqualCount = 1;\n }\n this._lastMouseDownPosition = newMouseDownPosition;\n // Finally set the lastMouseDownCount\n this._lastMouseDownCount = Math.min(setMouseDownCount, this._lastMouseDownPositionEqualCount);\n }\n}\nMouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME = 400; // ms\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Emitter } from '../common/event.js';\nexport class DomEmitter {\n get event() {\n return this.emitter.event;\n }\n constructor(element, type, useCapture) {\n const fn = (e) => this.emitter.fire(e);\n this.emitter = new Emitter({\n onWillAddFirstListener: () => element.addEventListener(type, fn, useCapture),\n onDidRemoveLastListener: () => element.removeEventListener(type, fn, useCapture)\n });\n }\n dispose() {\n this.emitter.dispose();\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as strings from '../../../base/common/strings.js';\nimport { Range } from '../../common/core/range.js';\nexport const _debugComposition = false;\nexport class TextAreaState {\n constructor(value, \n /** the offset where selection starts inside `value` */\n selectionStart, \n /** the offset where selection ends inside `value` */\n selectionEnd, \n /** the editor range in the view coordinate system that matches the selection inside `value` */\n selection, \n /** the visible line count (wrapped, not necessarily matching \\n characters) for the text in `value` before `selectionStart` */\n newlineCountBeforeSelection) {\n this.value = value;\n this.selectionStart = selectionStart;\n this.selectionEnd = selectionEnd;\n this.selection = selection;\n this.newlineCountBeforeSelection = newlineCountBeforeSelection;\n }\n toString() {\n return `[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`;\n }\n static readFromTextArea(textArea, previousState) {\n const value = textArea.getValue();\n const selectionStart = textArea.getSelectionStart();\n const selectionEnd = textArea.getSelectionEnd();\n let newlineCountBeforeSelection = undefined;\n if (previousState) {\n const valueBeforeSelectionStart = value.substring(0, selectionStart);\n const previousValueBeforeSelectionStart = previousState.value.substring(0, previousState.selectionStart);\n if (valueBeforeSelectionStart === previousValueBeforeSelectionStart) {\n newlineCountBeforeSelection = previousState.newlineCountBeforeSelection;\n }\n }\n return new TextAreaState(value, selectionStart, selectionEnd, null, newlineCountBeforeSelection);\n }\n collapseSelection() {\n if (this.selectionStart === this.value.length) {\n return this;\n }\n return new TextAreaState(this.value, this.value.length, this.value.length, null, undefined);\n }\n writeToTextArea(reason, textArea, select) {\n if (_debugComposition) {\n console.log(`writeToTextArea ${reason}: ${this.toString()}`);\n }\n textArea.setValue(reason, this.value);\n if (select) {\n textArea.setSelectionRange(reason, this.selectionStart, this.selectionEnd);\n }\n }\n deduceEditorPosition(offset) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n if (offset <= this.selectionStart) {\n const str = this.value.substring(offset, this.selectionStart);\n return this._finishDeduceEditorPosition((_b = (_a = this.selection) === null || _a === void 0 ? void 0 : _a.getStartPosition()) !== null && _b !== void 0 ? _b : null, str, -1);\n }\n if (offset >= this.selectionEnd) {\n const str = this.value.substring(this.selectionEnd, offset);\n return this._finishDeduceEditorPosition((_d = (_c = this.selection) === null || _c === void 0 ? void 0 : _c.getEndPosition()) !== null && _d !== void 0 ? _d : null, str, 1);\n }\n const str1 = this.value.substring(this.selectionStart, offset);\n if (str1.indexOf(String.fromCharCode(8230)) === -1) {\n return this._finishDeduceEditorPosition((_f = (_e = this.selection) === null || _e === void 0 ? void 0 : _e.getStartPosition()) !== null && _f !== void 0 ? _f : null, str1, 1);\n }\n const str2 = this.value.substring(offset, this.selectionEnd);\n return this._finishDeduceEditorPosition((_h = (_g = this.selection) === null || _g === void 0 ? void 0 : _g.getEndPosition()) !== null && _h !== void 0 ? _h : null, str2, -1);\n }\n _finishDeduceEditorPosition(anchor, deltaText, signum) {\n let lineFeedCnt = 0;\n let lastLineFeedIndex = -1;\n while ((lastLineFeedIndex = deltaText.indexOf('\\n', lastLineFeedIndex + 1)) !== -1) {\n lineFeedCnt++;\n }\n return [anchor, signum * deltaText.length, lineFeedCnt];\n }\n static deduceInput(previousState, currentState, couldBeEmojiInput) {\n if (!previousState) {\n // This is the EMPTY state\n return {\n text: '',\n replacePrevCharCnt: 0,\n replaceNextCharCnt: 0,\n positionDelta: 0\n };\n }\n if (_debugComposition) {\n console.log('------------------------deduceInput');\n console.log(`PREVIOUS STATE: ${previousState.toString()}`);\n console.log(`CURRENT STATE: ${currentState.toString()}`);\n }\n const prefixLength = Math.min(strings.commonPrefixLength(previousState.value, currentState.value), previousState.selectionStart, currentState.selectionStart);\n const suffixLength = Math.min(strings.commonSuffixLength(previousState.value, currentState.value), previousState.value.length - previousState.selectionEnd, currentState.value.length - currentState.selectionEnd);\n const previousValue = previousState.value.substring(prefixLength, previousState.value.length - suffixLength);\n const currentValue = currentState.value.substring(prefixLength, currentState.value.length - suffixLength);\n const previousSelectionStart = previousState.selectionStart - prefixLength;\n const previousSelectionEnd = previousState.selectionEnd - prefixLength;\n const currentSelectionStart = currentState.selectionStart - prefixLength;\n const currentSelectionEnd = currentState.selectionEnd - prefixLength;\n if (_debugComposition) {\n console.log(`AFTER DIFFING PREVIOUS STATE: <${previousValue}>, selectionStart: ${previousSelectionStart}, selectionEnd: ${previousSelectionEnd}`);\n console.log(`AFTER DIFFING CURRENT STATE: <${currentValue}>, selectionStart: ${currentSelectionStart}, selectionEnd: ${currentSelectionEnd}`);\n }\n if (currentSelectionStart === currentSelectionEnd) {\n // no current selection\n const replacePreviousCharacters = (previousState.selectionStart - prefixLength);\n if (_debugComposition) {\n console.log(`REMOVE PREVIOUS: ${replacePreviousCharacters} chars`);\n }\n return {\n text: currentValue,\n replacePrevCharCnt: replacePreviousCharacters,\n replaceNextCharCnt: 0,\n positionDelta: 0\n };\n }\n // there is a current selection => composition case\n const replacePreviousCharacters = previousSelectionEnd - previousSelectionStart;\n return {\n text: currentValue,\n replacePrevCharCnt: replacePreviousCharacters,\n replaceNextCharCnt: 0,\n positionDelta: 0\n };\n }\n static deduceAndroidCompositionInput(previousState, currentState) {\n if (!previousState) {\n // This is the EMPTY state\n return {\n text: '',\n replacePrevCharCnt: 0,\n replaceNextCharCnt: 0,\n positionDelta: 0\n };\n }\n if (_debugComposition) {\n console.log('------------------------deduceAndroidCompositionInput');\n console.log(`PREVIOUS STATE: ${previousState.toString()}`);\n console.log(`CURRENT STATE: ${currentState.toString()}`);\n }\n if (previousState.value === currentState.value) {\n return {\n text: '',\n replacePrevCharCnt: 0,\n replaceNextCharCnt: 0,\n positionDelta: currentState.selectionEnd - previousState.selectionEnd\n };\n }\n const prefixLength = Math.min(strings.commonPrefixLength(previousState.value, currentState.value), previousState.selectionEnd);\n const suffixLength = Math.min(strings.commonSuffixLength(previousState.value, currentState.value), previousState.value.length - previousState.selectionEnd);\n const previousValue = previousState.value.substring(prefixLength, previousState.value.length - suffixLength);\n const currentValue = currentState.value.substring(prefixLength, currentState.value.length - suffixLength);\n const previousSelectionStart = previousState.selectionStart - prefixLength;\n const previousSelectionEnd = previousState.selectionEnd - prefixLength;\n const currentSelectionStart = currentState.selectionStart - prefixLength;\n const currentSelectionEnd = currentState.selectionEnd - prefixLength;\n if (_debugComposition) {\n console.log(`AFTER DIFFING PREVIOUS STATE: <${previousValue}>, selectionStart: ${previousSelectionStart}, selectionEnd: ${previousSelectionEnd}`);\n console.log(`AFTER DIFFING CURRENT STATE: <${currentValue}>, selectionStart: ${currentSelectionStart}, selectionEnd: ${currentSelectionEnd}`);\n }\n return {\n text: currentValue,\n replacePrevCharCnt: previousSelectionEnd,\n replaceNextCharCnt: previousValue.length - previousSelectionEnd,\n positionDelta: currentSelectionEnd - currentValue.length\n };\n }\n}\nTextAreaState.EMPTY = new TextAreaState('', 0, 0, null, undefined);\nexport class PagedScreenReaderStrategy {\n static _getPageOfLine(lineNumber, linesPerPage) {\n return Math.floor((lineNumber - 1) / linesPerPage);\n }\n static _getRangeForPage(page, linesPerPage) {\n const offset = page * linesPerPage;\n const startLineNumber = offset + 1;\n const endLineNumber = offset + linesPerPage;\n return new Range(startLineNumber, 1, endLineNumber + 1, 1);\n }\n static fromEditorSelection(model, selection, linesPerPage, trimLongText) {\n // Chromium handles very poorly text even of a few thousand chars\n // Cut text to avoid stalling the entire UI\n const LIMIT_CHARS = 500;\n const selectionStartPage = PagedScreenReaderStrategy._getPageOfLine(selection.startLineNumber, linesPerPage);\n const selectionStartPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionStartPage, linesPerPage);\n const selectionEndPage = PagedScreenReaderStrategy._getPageOfLine(selection.endLineNumber, linesPerPage);\n const selectionEndPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionEndPage, linesPerPage);\n let pretextRange = selectionStartPageRange.intersectRanges(new Range(1, 1, selection.startLineNumber, selection.startColumn));\n if (trimLongText && model.getValueLengthInRange(pretextRange, 1 /* EndOfLinePreference.LF */) > LIMIT_CHARS) {\n const pretextStart = model.modifyPosition(pretextRange.getEndPosition(), -LIMIT_CHARS);\n pretextRange = Range.fromPositions(pretextStart, pretextRange.getEndPosition());\n }\n const pretext = model.getValueInRange(pretextRange, 1 /* EndOfLinePreference.LF */);\n const lastLine = model.getLineCount();\n const lastLineMaxColumn = model.getLineMaxColumn(lastLine);\n let posttextRange = selectionEndPageRange.intersectRanges(new Range(selection.endLineNumber, selection.endColumn, lastLine, lastLineMaxColumn));\n if (trimLongText && model.getValueLengthInRange(posttextRange, 1 /* EndOfLinePreference.LF */) > LIMIT_CHARS) {\n const posttextEnd = model.modifyPosition(posttextRange.getStartPosition(), LIMIT_CHARS);\n posttextRange = Range.fromPositions(posttextRange.getStartPosition(), posttextEnd);\n }\n const posttext = model.getValueInRange(posttextRange, 1 /* EndOfLinePreference.LF */);\n let text;\n if (selectionStartPage === selectionEndPage || selectionStartPage + 1 === selectionEndPage) {\n // take full selection\n text = model.getValueInRange(selection, 1 /* EndOfLinePreference.LF */);\n }\n else {\n const selectionRange1 = selectionStartPageRange.intersectRanges(selection);\n const selectionRange2 = selectionEndPageRange.intersectRanges(selection);\n text = (model.getValueInRange(selectionRange1, 1 /* EndOfLinePreference.LF */)\n + String.fromCharCode(8230)\n + model.getValueInRange(selectionRange2, 1 /* EndOfLinePreference.LF */));\n }\n if (trimLongText && text.length > 2 * LIMIT_CHARS) {\n text = text.substring(0, LIMIT_CHARS) + String.fromCharCode(8230) + text.substring(text.length - LIMIT_CHARS, text.length);\n }\n return new TextAreaState(pretext + text + posttext, pretext.length, pretext.length + text.length, selection, pretextRange.endLineNumber - pretextRange.startLineNumber);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport * as browser from '../../../base/browser/browser.js';\nimport * as dom from '../../../base/browser/dom.js';\nimport { DomEmitter } from '../../../base/browser/event.js';\nimport { StandardKeyboardEvent } from '../../../base/browser/keyboardEvent.js';\nimport { inputLatency } from '../../../base/browser/performance.js';\nimport { RunOnceScheduler } from '../../../base/common/async.js';\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { Disposable, MutableDisposable } from '../../../base/common/lifecycle.js';\nimport { Mimes } from '../../../base/common/mime.js';\nimport * as strings from '../../../base/common/strings.js';\nimport { TextAreaState, _debugComposition } from './textAreaState.js';\nimport { Selection } from '../../common/core/selection.js';\nimport { IAccessibilityService } from '../../../platform/accessibility/common/accessibility.js';\nimport { ILogService } from '../../../platform/log/common/log.js';\nexport var TextAreaSyntethicEvents;\n(function (TextAreaSyntethicEvents) {\n TextAreaSyntethicEvents.Tap = '-monaco-textarea-synthetic-tap';\n})(TextAreaSyntethicEvents || (TextAreaSyntethicEvents = {}));\nexport const CopyOptions = {\n forceCopyWithSyntaxHighlighting: false\n};\n/**\n * Every time we write to the clipboard, we record a bit of extra metadata here.\n * Every time we read from the cipboard, if the text matches our last written text,\n * we can fetch the previous metadata.\n */\nexport class InMemoryClipboardMetadataManager {\n constructor() {\n this._lastState = null;\n }\n set(lastCopiedValue, data) {\n this._lastState = { lastCopiedValue, data };\n }\n get(pastedText) {\n if (this._lastState && this._lastState.lastCopiedValue === pastedText) {\n // match!\n return this._lastState.data;\n }\n this._lastState = null;\n return null;\n }\n}\nInMemoryClipboardMetadataManager.INSTANCE = new InMemoryClipboardMetadataManager();\nclass CompositionContext {\n constructor() {\n this._lastTypeTextLength = 0;\n }\n handleCompositionUpdate(text) {\n text = text || '';\n const typeInput = {\n text: text,\n replacePrevCharCnt: this._lastTypeTextLength,\n replaceNextCharCnt: 0,\n positionDelta: 0\n };\n this._lastTypeTextLength = text.length;\n return typeInput;\n }\n}\n/**\n * Writes screen reader content to the textarea and is able to analyze its input events to generate:\n * - onCut\n * - onPaste\n * - onType\n *\n * Composition events are generated for presentation purposes (composition input is reflected in onType).\n */\nlet TextAreaInput = class TextAreaInput extends Disposable {\n get textAreaState() {\n return this._textAreaState;\n }\n constructor(_host, _textArea, _OS, _browser, _accessibilityService, _logService) {\n super();\n this._host = _host;\n this._textArea = _textArea;\n this._OS = _OS;\n this._browser = _browser;\n this._accessibilityService = _accessibilityService;\n this._logService = _logService;\n this._onFocus = this._register(new Emitter());\n this.onFocus = this._onFocus.event;\n this._onBlur = this._register(new Emitter());\n this.onBlur = this._onBlur.event;\n this._onKeyDown = this._register(new Emitter());\n this.onKeyDown = this._onKeyDown.event;\n this._onKeyUp = this._register(new Emitter());\n this.onKeyUp = this._onKeyUp.event;\n this._onCut = this._register(new Emitter());\n this.onCut = this._onCut.event;\n this._onPaste = this._register(new Emitter());\n this.onPaste = this._onPaste.event;\n this._onType = this._register(new Emitter());\n this.onType = this._onType.event;\n this._onCompositionStart = this._register(new Emitter());\n this.onCompositionStart = this._onCompositionStart.event;\n this._onCompositionUpdate = this._register(new Emitter());\n this.onCompositionUpdate = this._onCompositionUpdate.event;\n this._onCompositionEnd = this._register(new Emitter());\n this.onCompositionEnd = this._onCompositionEnd.event;\n this._onSelectionChangeRequest = this._register(new Emitter());\n this.onSelectionChangeRequest = this._onSelectionChangeRequest.event;\n this._asyncFocusGainWriteScreenReaderContent = this._register(new MutableDisposable());\n this._asyncTriggerCut = this._register(new RunOnceScheduler(() => this._onCut.fire(), 0));\n this._textAreaState = TextAreaState.EMPTY;\n this._selectionChangeListener = null;\n if (this._accessibilityService.isScreenReaderOptimized()) {\n this.writeNativeTextAreaContent('ctor');\n }\n this._register(Event.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized, () => {\n if (this._accessibilityService.isScreenReaderOptimized() && !this._asyncFocusGainWriteScreenReaderContent.value) {\n this._asyncFocusGainWriteScreenReaderContent.value = this._register(new RunOnceScheduler(() => this.writeNativeTextAreaContent('asyncFocusGain'), 0));\n }\n else {\n this._asyncFocusGainWriteScreenReaderContent.clear();\n }\n }));\n this._hasFocus = false;\n this._currentComposition = null;\n let lastKeyDown = null;\n this._register(this._textArea.onKeyDown((_e) => {\n const e = new StandardKeyboardEvent(_e);\n if (e.keyCode === 114 /* KeyCode.KEY_IN_COMPOSITION */\n || (this._currentComposition && e.keyCode === 1 /* KeyCode.Backspace */)) {\n // Stop propagation for keyDown events if the IME is processing key input\n e.stopPropagation();\n }\n if (e.equals(9 /* KeyCode.Escape */)) {\n // Prevent default always for `Esc`, otherwise it will generate a keypress\n // See https://msdn.microsoft.com/en-us/library/ie/ms536939(v=vs.85).aspx\n e.preventDefault();\n }\n lastKeyDown = e;\n this._onKeyDown.fire(e);\n }));\n this._register(this._textArea.onKeyUp((_e) => {\n const e = new StandardKeyboardEvent(_e);\n this._onKeyUp.fire(e);\n }));\n this._register(this._textArea.onCompositionStart((e) => {\n if (_debugComposition) {\n console.log(`[compositionstart]`, e);\n }\n const currentComposition = new CompositionContext();\n if (this._currentComposition) {\n // simply reset the composition context\n this._currentComposition = currentComposition;\n return;\n }\n this._currentComposition = currentComposition;\n if (this._OS === 2 /* OperatingSystem.Macintosh */\n && lastKeyDown\n && lastKeyDown.equals(114 /* KeyCode.KEY_IN_COMPOSITION */)\n && this._textAreaState.selectionStart === this._textAreaState.selectionEnd\n && this._textAreaState.selectionStart > 0\n && this._textAreaState.value.substr(this._textAreaState.selectionStart - 1, 1) === e.data\n && (lastKeyDown.code === 'ArrowRight' || lastKeyDown.code === 'ArrowLeft')) {\n // Handling long press case on Chromium/Safari macOS + arrow key => pretend the character was selected\n if (_debugComposition) {\n console.log(`[compositionstart] Handling long press case on macOS + arrow key`, e);\n }\n // Pretend the previous character was composed (in order to get it removed by subsequent compositionupdate events)\n currentComposition.handleCompositionUpdate('x');\n this._onCompositionStart.fire({ data: e.data });\n return;\n }\n if (this._browser.isAndroid) {\n // when tapping on the editor, Android enters composition mode to edit the current word\n // so we cannot clear the textarea on Android and we must pretend the current word was selected\n this._onCompositionStart.fire({ data: e.data });\n return;\n }\n this._onCompositionStart.fire({ data: e.data });\n }));\n this._register(this._textArea.onCompositionUpdate((e) => {\n if (_debugComposition) {\n console.log(`[compositionupdate]`, e);\n }\n const currentComposition = this._currentComposition;\n if (!currentComposition) {\n // should not be possible to receive a 'compositionupdate' without a 'compositionstart'\n return;\n }\n if (this._browser.isAndroid) {\n // On Android, the data sent with the composition update event is unusable.\n // For example, if the cursor is in the middle of a word like Mic|osoft\n // and Microsoft is chosen from the keyboard's suggestions, the e.data will contain \"Microsoft\".\n // This is not really usable because it doesn't tell us where the edit began and where it ended.\n const newState = TextAreaState.readFromTextArea(this._textArea, this._textAreaState);\n const typeInput = TextAreaState.deduceAndroidCompositionInput(this._textAreaState, newState);\n this._textAreaState = newState;\n this._onType.fire(typeInput);\n this._onCompositionUpdate.fire(e);\n return;\n }\n const typeInput = currentComposition.handleCompositionUpdate(e.data);\n this._textAreaState = TextAreaState.readFromTextArea(this._textArea, this._textAreaState);\n this._onType.fire(typeInput);\n this._onCompositionUpdate.fire(e);\n }));\n this._register(this._textArea.onCompositionEnd((e) => {\n if (_debugComposition) {\n console.log(`[compositionend]`, e);\n }\n const currentComposition = this._currentComposition;\n if (!currentComposition) {\n // https://github.com/microsoft/monaco-editor/issues/1663\n // On iOS 13.2, Chinese system IME randomly trigger an additional compositionend event with empty data\n return;\n }\n this._currentComposition = null;\n if (this._browser.isAndroid) {\n // On Android, the data sent with the composition update event is unusable.\n // For example, if the cursor is in the middle of a word like Mic|osoft\n // and Microsoft is chosen from the keyboard's suggestions, the e.data will contain \"Microsoft\".\n // This is not really usable because it doesn't tell us where the edit began and where it ended.\n const newState = TextAreaState.readFromTextArea(this._textArea, this._textAreaState);\n const typeInput = TextAreaState.deduceAndroidCompositionInput(this._textAreaState, newState);\n this._textAreaState = newState;\n this._onType.fire(typeInput);\n this._onCompositionEnd.fire();\n return;\n }\n const typeInput = currentComposition.handleCompositionUpdate(e.data);\n this._textAreaState = TextAreaState.readFromTextArea(this._textArea, this._textAreaState);\n this._onType.fire(typeInput);\n this._onCompositionEnd.fire();\n }));\n this._register(this._textArea.onInput((e) => {\n if (_debugComposition) {\n console.log(`[input]`, e);\n }\n // Pretend here we touched the text area, as the `input` event will most likely\n // result in a `selectionchange` event which we want to ignore\n this._textArea.setIgnoreSelectionChangeTime('received input event');\n if (this._currentComposition) {\n return;\n }\n const newState = TextAreaState.readFromTextArea(this._textArea, this._textAreaState);\n const typeInput = TextAreaState.deduceInput(this._textAreaState, newState, /*couldBeEmojiInput*/ this._OS === 2 /* OperatingSystem.Macintosh */);\n if (typeInput.replacePrevCharCnt === 0 && typeInput.text.length === 1) {\n // one character was typed\n if (strings.isHighSurrogate(typeInput.text.charCodeAt(0))\n || typeInput.text.charCodeAt(0) === 0x7f /* Delete */) {\n // Ignore invalid input but keep it around for next time\n return;\n }\n }\n this._textAreaState = newState;\n if (typeInput.text !== ''\n || typeInput.replacePrevCharCnt !== 0\n || typeInput.replaceNextCharCnt !== 0\n || typeInput.positionDelta !== 0) {\n this._onType.fire(typeInput);\n }\n }));\n // --- Clipboard operations\n this._register(this._textArea.onCut((e) => {\n // Pretend here we touched the text area, as the `cut` event will most likely\n // result in a `selectionchange` event which we want to ignore\n this._textArea.setIgnoreSelectionChangeTime('received cut event');\n this._ensureClipboardGetsEditorSelection(e);\n this._asyncTriggerCut.schedule();\n }));\n this._register(this._textArea.onCopy((e) => {\n this._ensureClipboardGetsEditorSelection(e);\n }));\n this._register(this._textArea.onPaste((e) => {\n // Pretend here we touched the text area, as the `paste` event will most likely\n // result in a `selectionchange` event which we want to ignore\n this._textArea.setIgnoreSelectionChangeTime('received paste event');\n e.preventDefault();\n if (!e.clipboardData) {\n return;\n }\n let [text, metadata] = ClipboardEventUtils.getTextData(e.clipboardData);\n if (!text) {\n return;\n }\n // try the in-memory store\n metadata = metadata || InMemoryClipboardMetadataManager.INSTANCE.get(text);\n this._onPaste.fire({\n text: text,\n metadata: metadata\n });\n }));\n this._register(this._textArea.onFocus(() => {\n const hadFocus = this._hasFocus;\n this._setHasFocus(true);\n if (this._accessibilityService.isScreenReaderOptimized() && this._browser.isSafari && !hadFocus && this._hasFocus) {\n // When \"tabbing into\" the textarea, immediately after dispatching the 'focus' event,\n // Safari will always move the selection at offset 0 in the textarea\n if (!this._asyncFocusGainWriteScreenReaderContent.value) {\n this._asyncFocusGainWriteScreenReaderContent.value = new RunOnceScheduler(() => this.writeNativeTextAreaContent('asyncFocusGain'), 0);\n }\n this._asyncFocusGainWriteScreenReaderContent.value.schedule();\n }\n }));\n this._register(this._textArea.onBlur(() => {\n if (this._currentComposition) {\n // See https://github.com/microsoft/vscode/issues/112621\n // where compositionend is not triggered when the editor\n // is taken off-dom during a composition\n // Clear the flag to be able to write to the textarea\n this._currentComposition = null;\n // Clear the textarea to avoid an unwanted cursor type\n this.writeNativeTextAreaContent('blurWithoutCompositionEnd');\n // Fire artificial composition end\n this._onCompositionEnd.fire();\n }\n this._setHasFocus(false);\n }));\n this._register(this._textArea.onSyntheticTap(() => {\n if (this._browser.isAndroid && this._currentComposition) {\n // on Android, tapping does not cancel the current composition, so the\n // textarea is stuck showing the old composition\n // Clear the flag to be able to write to the textarea\n this._currentComposition = null;\n // Clear the textarea to avoid an unwanted cursor type\n this.writeNativeTextAreaContent('tapWithoutCompositionEnd');\n // Fire artificial composition end\n this._onCompositionEnd.fire();\n }\n }));\n }\n _installSelectionChangeListener() {\n // See https://github.com/microsoft/vscode/issues/27216 and https://github.com/microsoft/vscode/issues/98256\n // When using a Braille display, it is possible for users to reposition the\n // system caret. This is reflected in Chrome as a `selectionchange` event.\n //\n // The `selectionchange` event appears to be emitted under numerous other circumstances,\n // so it is quite a challenge to distinguish a `selectionchange` coming in from a user\n // using a Braille display from all the other cases.\n //\n // The problems with the `selectionchange` event are:\n // * the event is emitted when the textarea is focused programmatically -- textarea.focus()\n // * the event is emitted when the selection is changed in the textarea programmatically -- textarea.setSelectionRange(...)\n // * the event is emitted when the value of the textarea is changed programmatically -- textarea.value = '...'\n // * the event is emitted when tabbing into the textarea\n // * the event is emitted asynchronously (sometimes with a delay as high as a few tens of ms)\n // * the event sometimes comes in bursts for a single logical textarea operation\n // `selectionchange` events often come multiple times for a single logical change\n // so throttle multiple `selectionchange` events that burst in a short period of time.\n let previousSelectionChangeEventTime = 0;\n return dom.addDisposableListener(this._textArea.ownerDocument, 'selectionchange', (e) => {\n inputLatency.onSelectionChange();\n if (!this._hasFocus) {\n return;\n }\n if (this._currentComposition) {\n return;\n }\n if (!this._browser.isChrome) {\n // Support only for Chrome until testing happens on other browsers\n return;\n }\n const now = Date.now();\n const delta1 = now - previousSelectionChangeEventTime;\n previousSelectionChangeEventTime = now;\n if (delta1 < 5) {\n // received another `selectionchange` event within 5ms of the previous `selectionchange` event\n // => ignore it\n return;\n }\n const delta2 = now - this._textArea.getIgnoreSelectionChangeTime();\n this._textArea.resetSelectionChangeTime();\n if (delta2 < 100) {\n // received a `selectionchange` event within 100ms since we touched the textarea\n // => ignore it, since we caused it\n return;\n }\n if (!this._textAreaState.selection) {\n // Cannot correlate a position in the textarea with a position in the editor...\n return;\n }\n const newValue = this._textArea.getValue();\n if (this._textAreaState.value !== newValue) {\n // Cannot correlate a position in the textarea with a position in the editor...\n return;\n }\n const newSelectionStart = this._textArea.getSelectionStart();\n const newSelectionEnd = this._textArea.getSelectionEnd();\n if (this._textAreaState.selectionStart === newSelectionStart && this._textAreaState.selectionEnd === newSelectionEnd) {\n // Nothing to do...\n return;\n }\n const _newSelectionStartPosition = this._textAreaState.deduceEditorPosition(newSelectionStart);\n const newSelectionStartPosition = this._host.deduceModelPosition(_newSelectionStartPosition[0], _newSelectionStartPosition[1], _newSelectionStartPosition[2]);\n const _newSelectionEndPosition = this._textAreaState.deduceEditorPosition(newSelectionEnd);\n const newSelectionEndPosition = this._host.deduceModelPosition(_newSelectionEndPosition[0], _newSelectionEndPosition[1], _newSelectionEndPosition[2]);\n const newSelection = new Selection(newSelectionStartPosition.lineNumber, newSelectionStartPosition.column, newSelectionEndPosition.lineNumber, newSelectionEndPosition.column);\n this._onSelectionChangeRequest.fire(newSelection);\n });\n }\n dispose() {\n super.dispose();\n if (this._selectionChangeListener) {\n this._selectionChangeListener.dispose();\n this._selectionChangeListener = null;\n }\n }\n focusTextArea() {\n // Setting this._hasFocus and writing the screen reader content\n // will result in a focus() and setSelectionRange() in the textarea\n this._setHasFocus(true);\n // If the editor is off DOM, focus cannot be really set, so let's double check that we have managed to set the focus\n this.refreshFocusState();\n }\n isFocused() {\n return this._hasFocus;\n }\n refreshFocusState() {\n this._setHasFocus(this._textArea.hasFocus());\n }\n _setHasFocus(newHasFocus) {\n if (this._hasFocus === newHasFocus) {\n // no change\n return;\n }\n this._hasFocus = newHasFocus;\n if (this._selectionChangeListener) {\n this._selectionChangeListener.dispose();\n this._selectionChangeListener = null;\n }\n if (this._hasFocus) {\n this._selectionChangeListener = this._installSelectionChangeListener();\n }\n if (this._hasFocus) {\n this.writeNativeTextAreaContent('focusgain');\n }\n if (this._hasFocus) {\n this._onFocus.fire();\n }\n else {\n this._onBlur.fire();\n }\n }\n _setAndWriteTextAreaState(reason, textAreaState) {\n if (!this._hasFocus) {\n textAreaState = textAreaState.collapseSelection();\n }\n textAreaState.writeToTextArea(reason, this._textArea, this._hasFocus);\n this._textAreaState = textAreaState;\n }\n writeNativeTextAreaContent(reason) {\n if ((!this._accessibilityService.isScreenReaderOptimized() && reason === 'render') || this._currentComposition) {\n // Do not write to the text on render unless a screen reader is being used #192278\n // Do not write to the text area when doing composition\n return;\n }\n this._logService.trace(`writeTextAreaState(reason: ${reason})`);\n this._setAndWriteTextAreaState(reason, this._host.getScreenReaderContent());\n }\n _ensureClipboardGetsEditorSelection(e) {\n const dataToCopy = this._host.getDataToCopy();\n const storedMetadata = {\n version: 1,\n isFromEmptySelection: dataToCopy.isFromEmptySelection,\n multicursorText: dataToCopy.multicursorText,\n mode: dataToCopy.mode\n };\n InMemoryClipboardMetadataManager.INSTANCE.set(\n // When writing \"LINE\\r\\n\" to the clipboard and then pasting,\n // Firefox pastes \"LINE\\n\", so let's work around this quirk\n (this._browser.isFirefox ? dataToCopy.text.replace(/\\r\\n/g, '\\n') : dataToCopy.text), storedMetadata);\n e.preventDefault();\n if (e.clipboardData) {\n ClipboardEventUtils.setTextData(e.clipboardData, dataToCopy.text, dataToCopy.html, storedMetadata);\n }\n }\n};\nTextAreaInput = __decorate([\n __param(4, IAccessibilityService),\n __param(5, ILogService)\n], TextAreaInput);\nexport { TextAreaInput };\nexport const ClipboardEventUtils = {\n getTextData(clipboardData) {\n const text = clipboardData.getData(Mimes.text);\n let metadata = null;\n const rawmetadata = clipboardData.getData('vscode-editor-data');\n if (typeof rawmetadata === 'string') {\n try {\n metadata = JSON.parse(rawmetadata);\n if (metadata.version !== 1) {\n metadata = null;\n }\n }\n catch (err) {\n // no problem!\n }\n }\n if (text.length === 0 && metadata === null && clipboardData.files.length > 0) {\n // no textual data pasted, generate text from file names\n const files = Array.prototype.slice.call(clipboardData.files, 0);\n return [files.map(file => file.name).join('\\n'), null];\n }\n return [text, metadata];\n },\n setTextData(clipboardData, text, html, metadata) {\n clipboardData.setData(Mimes.text, text);\n if (typeof html === 'string') {\n clipboardData.setData('text/html', html);\n }\n clipboardData.setData('vscode-editor-data', JSON.stringify(metadata));\n }\n};\nexport class TextAreaWrapper extends Disposable {\n get ownerDocument() {\n return this._actual.ownerDocument;\n }\n constructor(_actual) {\n super();\n this._actual = _actual;\n this.onKeyDown = this._register(new DomEmitter(this._actual, 'keydown')).event;\n this.onKeyUp = this._register(new DomEmitter(this._actual, 'keyup')).event;\n this.onCompositionStart = this._register(new DomEmitter(this._actual, 'compositionstart')).event;\n this.onCompositionUpdate = this._register(new DomEmitter(this._actual, 'compositionupdate')).event;\n this.onCompositionEnd = this._register(new DomEmitter(this._actual, 'compositionend')).event;\n this.onBeforeInput = this._register(new DomEmitter(this._actual, 'beforeinput')).event;\n this.onInput = this._register(new DomEmitter(this._actual, 'input')).event;\n this.onCut = this._register(new DomEmitter(this._actual, 'cut')).event;\n this.onCopy = this._register(new DomEmitter(this._actual, 'copy')).event;\n this.onPaste = this._register(new DomEmitter(this._actual, 'paste')).event;\n this.onFocus = this._register(new DomEmitter(this._actual, 'focus')).event;\n this.onBlur = this._register(new DomEmitter(this._actual, 'blur')).event;\n this._onSyntheticTap = this._register(new Emitter());\n this.onSyntheticTap = this._onSyntheticTap.event;\n this._ignoreSelectionChangeTime = 0;\n this._register(this.onKeyDown(() => inputLatency.onKeyDown()));\n this._register(this.onBeforeInput(() => inputLatency.onBeforeInput()));\n this._register(this.onInput(() => inputLatency.onInput()));\n this._register(this.onKeyUp(() => inputLatency.onKeyUp()));\n this._register(dom.addDisposableListener(this._actual, TextAreaSyntethicEvents.Tap, () => this._onSyntheticTap.fire()));\n }\n hasFocus() {\n const shadowRoot = dom.getShadowRoot(this._actual);\n if (shadowRoot) {\n return shadowRoot.activeElement === this._actual;\n }\n else if (this._actual.isConnected) {\n return dom.getActiveElement() === this._actual;\n }\n else {\n return false;\n }\n }\n setIgnoreSelectionChangeTime(reason) {\n this._ignoreSelectionChangeTime = Date.now();\n }\n getIgnoreSelectionChangeTime() {\n return this._ignoreSelectionChangeTime;\n }\n resetSelectionChangeTime() {\n this._ignoreSelectionChangeTime = 0;\n }\n getValue() {\n // console.log('current value: ' + this._textArea.value);\n return this._actual.value;\n }\n setValue(reason, value) {\n const textArea = this._actual;\n if (textArea.value === value) {\n // No change\n return;\n }\n // console.log('reason: ' + reason + ', current value: ' + textArea.value + ' => new value: ' + value);\n this.setIgnoreSelectionChangeTime('setValue');\n textArea.value = value;\n }\n getSelectionStart() {\n return this._actual.selectionDirection === 'backward' ? this._actual.selectionEnd : this._actual.selectionStart;\n }\n getSelectionEnd() {\n return this._actual.selectionDirection === 'backward' ? this._actual.selectionStart : this._actual.selectionEnd;\n }\n setSelectionRange(reason, selectionStart, selectionEnd) {\n const textArea = this._actual;\n let activeElement = null;\n const shadowRoot = dom.getShadowRoot(textArea);\n if (shadowRoot) {\n activeElement = shadowRoot.activeElement;\n }\n else {\n activeElement = dom.getActiveElement();\n }\n const activeWindow = dom.getWindow(activeElement);\n const currentIsFocused = (activeElement === textArea);\n const currentSelectionStart = textArea.selectionStart;\n const currentSelectionEnd = textArea.selectionEnd;\n if (currentIsFocused && currentSelectionStart === selectionStart && currentSelectionEnd === selectionEnd) {\n // No change\n // Firefox iframe bug https://github.com/microsoft/monaco-editor/issues/643#issuecomment-367871377\n if (browser.isFirefox && activeWindow.parent !== activeWindow) {\n textArea.focus();\n }\n return;\n }\n // console.log('reason: ' + reason + ', setSelectionRange: ' + selectionStart + ' -> ' + selectionEnd);\n if (currentIsFocused) {\n // No need to focus, only need to change the selection range\n this.setIgnoreSelectionChangeTime('setSelectionRange');\n textArea.setSelectionRange(selectionStart, selectionEnd);\n if (browser.isFirefox && activeWindow.parent !== activeWindow) {\n textArea.focus();\n }\n return;\n }\n // If the focus is outside the textarea, browsers will try really hard to reveal the textarea.\n // Here, we try to undo the browser's desperate reveal.\n try {\n const scrollState = dom.saveParentsScrollTop(textArea);\n this.setIgnoreSelectionChangeTime('setSelectionRange');\n textArea.focus();\n textArea.setSelectionRange(selectionStart, selectionEnd);\n dom.restoreParentsScrollTop(textArea, scrollState);\n }\n catch (e) {\n // Sometimes IE throws when setting selection (e.g. textarea is off-DOM)\n }\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { BrowserFeatures } from '../../../base/browser/canIUse.js';\nimport * as dom from '../../../base/browser/dom.js';\nimport { EventType, Gesture } from '../../../base/browser/touch.js';\nimport { mainWindow } from '../../../base/browser/window.js';\nimport { Disposable } from '../../../base/common/lifecycle.js';\nimport * as platform from '../../../base/common/platform.js';\nimport { MouseHandler } from './mouseHandler.js';\nimport { TextAreaSyntethicEvents } from './textAreaInput.js';\nimport { EditorMouseEvent, EditorPointerEventFactory } from '../editorDom.js';\n/**\n * Currently only tested on iOS 13/ iPadOS.\n */\nexport class PointerEventHandler extends MouseHandler {\n constructor(context, viewController, viewHelper) {\n super(context, viewController, viewHelper);\n this._register(Gesture.addTarget(this.viewHelper.linesContentDomNode));\n this._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Tap, (e) => this.onTap(e)));\n this._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Change, (e) => this.onChange(e)));\n this._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Contextmenu, (e) => this._onContextMenu(new EditorMouseEvent(e, false, this.viewHelper.viewDomNode), false)));\n this._lastPointerType = 'mouse';\n this._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, 'pointerdown', (e) => {\n const pointerType = e.pointerType;\n if (pointerType === 'mouse') {\n this._lastPointerType = 'mouse';\n return;\n }\n else if (pointerType === 'touch') {\n this._lastPointerType = 'touch';\n }\n else {\n this._lastPointerType = 'pen';\n }\n }));\n // PonterEvents\n const pointerEvents = new EditorPointerEventFactory(this.viewHelper.viewDomNode);\n this._register(pointerEvents.onPointerMove(this.viewHelper.viewDomNode, (e) => this._onMouseMove(e)));\n this._register(pointerEvents.onPointerUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e)));\n this._register(pointerEvents.onPointerLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e)));\n this._register(pointerEvents.onPointerDown(this.viewHelper.viewDomNode, (e, pointerId) => this._onMouseDown(e, pointerId)));\n }\n onTap(event) {\n if (!event.initialTarget || !this.viewHelper.linesContentDomNode.contains(event.initialTarget)) {\n return;\n }\n event.preventDefault();\n this.viewHelper.focusTextArea();\n this._dispatchGesture(event, /*inSelectionMode*/ false);\n }\n onChange(event) {\n if (this._lastPointerType === 'touch') {\n this._context.viewModel.viewLayout.deltaScrollNow(-event.translationX, -event.translationY);\n }\n if (this._lastPointerType === 'pen') {\n this._dispatchGesture(event, /*inSelectionMode*/ true);\n }\n }\n _dispatchGesture(event, inSelectionMode) {\n const target = this._createMouseTarget(new EditorMouseEvent(event, false, this.viewHelper.viewDomNode), false);\n if (target.position) {\n this.viewController.dispatchMouse({\n position: target.position,\n mouseColumn: target.position.column,\n startedOnLineNumbers: false,\n revealType: 1 /* NavigationCommandRevealType.Minimal */,\n mouseDownCount: event.tapCount,\n inSelectionMode,\n altKey: false,\n ctrlKey: false,\n metaKey: false,\n shiftKey: false,\n leftButton: false,\n middleButton: false,\n onInjectedText: target.type === 6 /* MouseTargetType.CONTENT_TEXT */ && target.detail.injectedText !== null\n });\n }\n }\n _onMouseDown(e, pointerId) {\n if (e.browserEvent.pointerType === 'touch') {\n return;\n }\n super._onMouseDown(e, pointerId);\n }\n}\nclass TouchHandler extends MouseHandler {\n constructor(context, viewController, viewHelper) {\n super(context, viewController, viewHelper);\n this._register(Gesture.addTarget(this.viewHelper.linesContentDomNode));\n this._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Tap, (e) => this.onTap(e)));\n this._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Change, (e) => this.onChange(e)));\n this._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, EventType.Contextmenu, (e) => this._onContextMenu(new EditorMouseEvent(e, false, this.viewHelper.viewDomNode), false)));\n }\n onTap(event) {\n event.preventDefault();\n this.viewHelper.focusTextArea();\n const target = this._createMouseTarget(new EditorMouseEvent(event, false, this.viewHelper.viewDomNode), false);\n if (target.position) {\n // Send the tap event also to the