From d1587e813bd06c230144a2fc147225a72a541ac6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 May 2024 11:09:54 +0000 Subject: [PATCH] (playground) genome-spy/genome-spy@ad3f36346e1714b5bb9db0d6ff4a068ecfb945a3 --- .../assets/genomespy-favicon-BRuu3xFN.svg | 34 ------------------- .../{index-Cd7qgL2s.js => index-v_Hsdz7i.js} | 4 +-- ...nMode-Bixe832o.js => jsonMode-B0NuPba3.js} | 2 +- playground/index.html | 2 +- 4 files changed, 4 insertions(+), 38 deletions(-) delete mode 100644 playground/assets/genomespy-favicon-BRuu3xFN.svg rename playground/assets/{index-Cd7qgL2s.js => index-v_Hsdz7i.js} (99%) rename playground/assets/{jsonMode-Bixe832o.js => jsonMode-B0NuPba3.js} (99%) diff --git a/playground/assets/genomespy-favicon-BRuu3xFN.svg b/playground/assets/genomespy-favicon-BRuu3xFN.svg deleted file mode 100644 index da3f13f..0000000 --- a/playground/assets/genomespy-favicon-BRuu3xFN.svg +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/playground/assets/index-Cd7qgL2s.js b/playground/assets/index-v_Hsdz7i.js similarity index 99% rename from playground/assets/index-Cd7qgL2s.js rename to playground/assets/index-v_Hsdz7i.js index 3259232..43f6730 100644 --- a/playground/assets/index-Cd7qgL2s.js +++ b/playground/assets/index-v_Hsdz7i.js @@ -3598,12 +3598,12 @@ See the [format documentation](https://vega.github.io/vega-lite/docs/format.html TODO: Write proper documentation with examples. -**Default:** \`1.0\``},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding applied to the view. Accepts either a number representing pixels or an object specifying separate paddings for each edge.\n\nExamples:\n- `padding: 10`\n- `padding: { top: 10, right: 20, bottom: 10, left: 20 }`\n\n**Default value:** `0`"},params:{description:"Dynamic variables that [parameterize](https://genomespy.app/docs/grammar/parameters/) a visualization.",items:{$ref:"#/definitions/Parameter"},type:"array"},resolve:{additionalProperties:!1,description:"Specifies how scales and axes are [resolved](https://genomespy.app/docs/grammar/composition/#scale-and-axis-resolution) in the view hierarchy.",properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},templates:{additionalProperties:{$ref:"#/definitions/ViewSpec"},description:"[Templates](https://genomespy.app/docs/grammar/import/#repeating-with-named-templates) that can be reused within the view specification by importing them with the template key.",type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}],description:"View title. N.B.: Currently, GenomeSpy doesn't do bound calculation, and you need to manually specify proper padding for the view to ensure that the title is visible."},transform:{description:"An array of [transformations](https://genomespy.app/docs/grammar/transform/) applied to the data before visual encoding.",items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground",description:"The background of the view, including fill, stroke, and stroke width."},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"The default visibility of the view. An invisible view is removed from the layout and not rendered. For context, see [toggleable view visibility](https://genomespy.app/docs/sample-collections/visualizing/#toggleable-view-visibility).\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default:** `"container"`'}},required:["mark"],type:"object"},UrlData:{additionalProperties:!1,properties:{format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"},url:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"},{$ref:"#/definitions/ExprRef"}],description:"An URL or an array of URLs from which to load the data set. Use the `format.type` property to ensure the loaded data is correctly parsed."}},required:["url"],type:"object"},UrlGenomeConfig:{additionalProperties:!1,properties:{name:{description:"Name of the genome assembly, e.g., `hg19` or `hg38`.",type:"string"},url:{description:'A URL to a `chrom.sizes` file, which is a tab-separated file with two columns: the sequence name and its size.\n\nYou may want to strip alternative loci, haplotypes, and other non-canonical contigs from the file.\n\nExample: `"https://genomespy.app/data/genomes/hg19/chrom.sizes"`',type:"string"}},required:["name","url"],type:"object"},UrlImport:{additionalProperties:!1,properties:{url:{description:"Imports a specification from the specified URL.",type:"string"}},required:["url"],type:"object"},VConcatSpec:{additionalProperties:!1,properties:{baseUrl:{description:"The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is *unique* in within the view hierarchy.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data",description:"Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Can be used for documentation. The description of the top-level view is shown in the toolbar of the [GenomeSpy App](https://genomespy.app/docs/sample-collections/)."},encoding:{$ref:"#/definitions/Encoding",description:"Specifies how data are [encoded](https://genomespy.app/docs/grammar/mark/#encoding) using the visual channels."},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default value:** `"container"`'},name:{description:"An internal name that can be used for referring the view. For referencing purposes, the name should be unique within the view hierarchy.",type:"string"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding applied to the view. Accepts either a number representing pixels or an object specifying separate paddings for each edge.\n\nExamples:\n- `padding: 10`\n- `padding: { top: 10, right: 20, bottom: 10, left: 20 }`\n\n**Default value:** `0`"},params:{description:"Dynamic variables that [parameterize](https://genomespy.app/docs/grammar/parameters/) a visualization.",items:{$ref:"#/definitions/Parameter"},type:"array"},resolve:{additionalProperties:!1,description:"Specifies how scales and axes are [resolved](https://genomespy.app/docs/grammar/composition/#scale-and-axis-resolution) in the view hierarchy.",properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{description:"The gap between the views, in pixels.",type:"number"},templates:{additionalProperties:{$ref:"#/definitions/ViewSpec"},description:"[Templates](https://genomespy.app/docs/grammar/import/#repeating-with-named-templates) that can be reused within the view specification by importing them with the template key.",type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}],description:"View title. N.B.: Currently, GenomeSpy doesn't do bound calculation, and you need to manually specify proper padding for the view to ensure that the title is visible."},transform:{description:"An array of [transformations](https://genomespy.app/docs/grammar/transform/) applied to the data before visual encoding.",items:{$ref:"#/definitions/TransformParams"},type:"array"},vconcat:{description:"Specifies views that will be concatenated vertically.",items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"The default visibility of the view. An invisible view is removed from the layout and not rendered. For context, see [toggleable view visibility](https://genomespy.app/docs/sample-collections/visualizing/#toggleable-view-visibility).\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default:** `"container"`'}},required:["vconcat"],type:"object"},"ValueDef":{additionalProperties:!1,properties:{title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},required:["value"],type:"object"},"ValueDefWithCondition<(string|null)>":{additionalProperties:!1,minProperties:1,properties:{condition:{anyOf:[{$ref:"#/definitions/Conditional%3CFieldDef%3E"},{$ref:"#/definitions/Conditional%3CDatumDef%3E"},{$ref:"#/definitions/Conditional%3CValueDef%3C(string%7Cnull%7CExprRef)%3E%3E"},{items:{$ref:"#/definitions/Conditional%3CValueDef%3C(string%7Cnull%7CExprRef)%3E%3E"},type:"array"}],description:"A field definition or one or more value definition(s) with a parameter predicate."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"string"},{type:"null"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},type:"object"},"ValueDefWithCondition":{additionalProperties:!1,minProperties:1,properties:{condition:{anyOf:[{$ref:"#/definitions/Conditional%3CFieldDef%3E"},{$ref:"#/definitions/Conditional%3CDatumDef%3E"},{$ref:"#/definitions/Conditional%3CValueDef%3C(number%7CExprRef)%3E%3E"},{items:{$ref:"#/definitions/Conditional%3CValueDef%3C(number%7CExprRef)%3E%3E"},type:"array"}],description:"A field definition or one or more value definition(s) with a parameter predicate."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},type:"object"},VariableParameter:{additionalProperties:!1,properties:{bind:{$ref:"#/definitions/Binding",description:"Binds the parameter to an external input element such as a slider, selection list or radio button group."},expr:{description:"An expression for the value of the parameter. This expression may include other parameters, in which case the parameter will automatically update in response to upstream parameter changes.",type:"string"},name:{description:'A unique name for the variable parameter. Parameter names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or "$", or "_") and may not start with a digit. Reserved keywords that may not be used as parameter names are: "datum".',type:"string"},push:{const:"outer",type:"string"},value:{description:"The [initial value](http://vega.github.io/vega-lite/docs/value.html) of the parameter.\n\n__Default value:__ `undefined`"}},required:["name"],type:"object"},ViewBackground:{additionalProperties:!1,properties:{fill:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The fill color."},fillOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The fill opacity. Value between `0` and `1`."},stroke:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The stroke color"},strokeOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The stroke opacity. Value between `0` and `1`."},strokeWidth:{description:"The stroke width in pixels.",type:"number"}},type:"object"},ViewOpacityDef:{anyOf:[{type:"number"},{$ref:"#/definitions/DynamicOpacity"},{$ref:"#/definitions/ExprRef"}]},ViewSpec:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/VConcatSpec"},{$ref:"#/definitions/HConcatSpec"},{$ref:"#/definitions/ConcatSpec"},{$ref:"#/definitions/SampleSpec"}]},ZoomParams:{additionalProperties:!1,properties:{extent:{anyOf:[{$ref:"#/definitions/ScalarDomain"},{$ref:"#/definitions/ComplexDomain"}],description:"The boundaries that limit the zoom and pan interactions."}},type:"object"}},EB={$ref:_Ne,$schema:bNe,definitions:vNe},yNe="@genome-spy/playground",wNe="0.53.0",CNe="A playground for testing GenomeSpy visualizations",SNe="module",xNe={dev:"vite",build:"vite build",serve:"vite preview"},LNe="Kari Lavikka",DNe="MIT",kNe={"@fortawesome/fontawesome-free":"^6.1.1","@fortawesome/fontawesome-svg-core":"^6.1.1","@fortawesome/free-solid-svg-icons":"^6.1.1","@genome-spy/core":"^0.53.0",lit:"^3.1.2","monaco-editor":"^0.44.0","vega-loader":"^4.4.0"},AB={name:yNe,private:!0,version:wNe,description:CNe,type:SNe,scripts:xNe,author:LNe,license:DNe,dependencies:kNe};/*!----------------------------------------------------------------------------- +**Default:** \`1.0\``},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding applied to the view. Accepts either a number representing pixels or an object specifying separate paddings for each edge.\n\nExamples:\n- `padding: 10`\n- `padding: { top: 10, right: 20, bottom: 10, left: 20 }`\n\n**Default value:** `0`"},params:{description:"Dynamic variables that [parameterize](https://genomespy.app/docs/grammar/parameters/) a visualization.",items:{$ref:"#/definitions/Parameter"},type:"array"},resolve:{additionalProperties:!1,description:"Specifies how scales and axes are [resolved](https://genomespy.app/docs/grammar/composition/#scale-and-axis-resolution) in the view hierarchy.",properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},templates:{additionalProperties:{$ref:"#/definitions/ViewSpec"},description:"[Templates](https://genomespy.app/docs/grammar/import/#repeating-with-named-templates) that can be reused within the view specification by importing them with the template key.",type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}],description:"View title. N.B.: Currently, GenomeSpy doesn't do bound calculation, and you need to manually specify proper padding for the view to ensure that the title is visible."},transform:{description:"An array of [transformations](https://genomespy.app/docs/grammar/transform/) applied to the data before visual encoding.",items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground",description:"The background of the view, including fill, stroke, and stroke width."},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"The default visibility of the view. An invisible view is removed from the layout and not rendered. For context, see [toggleable view visibility](https://genomespy.app/docs/sample-collections/visualizing/#toggleable-view-visibility).\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default:** `"container"`'}},required:["mark"],type:"object"},UrlData:{additionalProperties:!1,properties:{format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"},url:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"},{$ref:"#/definitions/ExprRef"}],description:"An URL or an array of URLs from which to load the data set. Use the `format.type` property to ensure the loaded data is correctly parsed."}},required:["url"],type:"object"},UrlGenomeConfig:{additionalProperties:!1,properties:{name:{description:"Name of the genome assembly, e.g., `hg19` or `hg38`.",type:"string"},url:{description:'A URL to a `chrom.sizes` file, which is a tab-separated file with two columns: the sequence name and its size.\n\nYou may want to strip alternative loci, haplotypes, and other non-canonical contigs from the file.\n\nExample: `"https://genomespy.app/data/genomes/hg19/chrom.sizes"`',type:"string"}},required:["name","url"],type:"object"},UrlImport:{additionalProperties:!1,properties:{url:{description:"Imports a specification from the specified URL.",type:"string"}},required:["url"],type:"object"},VConcatSpec:{additionalProperties:!1,properties:{baseUrl:{description:"The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is *unique* in within the view hierarchy.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data",description:"Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Can be used for documentation. The description of the top-level view is shown in the toolbar of the [GenomeSpy App](https://genomespy.app/docs/sample-collections/)."},encoding:{$ref:"#/definitions/Encoding",description:"Specifies how data are [encoded](https://genomespy.app/docs/grammar/mark/#encoding) using the visual channels."},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default value:** `"container"`'},name:{description:"An internal name that can be used for referring the view. For referencing purposes, the name should be unique within the view hierarchy.",type:"string"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding applied to the view. Accepts either a number representing pixels or an object specifying separate paddings for each edge.\n\nExamples:\n- `padding: 10`\n- `padding: { top: 10, right: 20, bottom: 10, left: 20 }`\n\n**Default value:** `0`"},params:{description:"Dynamic variables that [parameterize](https://genomespy.app/docs/grammar/parameters/) a visualization.",items:{$ref:"#/definitions/Parameter"},type:"array"},resolve:{additionalProperties:!1,description:"Specifies how scales and axes are [resolved](https://genomespy.app/docs/grammar/composition/#scale-and-axis-resolution) in the view hierarchy.",properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{description:"The gap between the views, in pixels.",type:"number"},templates:{additionalProperties:{$ref:"#/definitions/ViewSpec"},description:"[Templates](https://genomespy.app/docs/grammar/import/#repeating-with-named-templates) that can be reused within the view specification by importing them with the template key.",type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}],description:"View title. N.B.: Currently, GenomeSpy doesn't do bound calculation, and you need to manually specify proper padding for the view to ensure that the title is visible."},transform:{description:"An array of [transformations](https://genomespy.app/docs/grammar/transform/) applied to the data before visual encoding.",items:{$ref:"#/definitions/TransformParams"},type:"array"},vconcat:{description:"Specifies views that will be concatenated vertically.",items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"The default visibility of the view. An invisible view is removed from the layout and not rendered. For context, see [toggleable view visibility](https://genomespy.app/docs/sample-collections/visualizing/#toggleable-view-visibility).\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default:** `"container"`'}},required:["vconcat"],type:"object"},"ValueDef":{additionalProperties:!1,properties:{title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},required:["value"],type:"object"},"ValueDefWithCondition<(string|null)>":{additionalProperties:!1,minProperties:1,properties:{condition:{anyOf:[{$ref:"#/definitions/Conditional%3CFieldDef%3E"},{$ref:"#/definitions/Conditional%3CDatumDef%3E"},{$ref:"#/definitions/Conditional%3CValueDef%3C(string%7Cnull%7CExprRef)%3E%3E"},{items:{$ref:"#/definitions/Conditional%3CValueDef%3C(string%7Cnull%7CExprRef)%3E%3E"},type:"array"}],description:"A field definition or one or more value definition(s) with a parameter predicate."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"string"},{type:"null"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},type:"object"},"ValueDefWithCondition":{additionalProperties:!1,minProperties:1,properties:{condition:{anyOf:[{$ref:"#/definitions/Conditional%3CFieldDef%3E"},{$ref:"#/definitions/Conditional%3CDatumDef%3E"},{$ref:"#/definitions/Conditional%3CValueDef%3C(number%7CExprRef)%3E%3E"},{items:{$ref:"#/definitions/Conditional%3CValueDef%3C(number%7CExprRef)%3E%3E"},type:"array"}],description:"A field definition or one or more value definition(s) with a parameter predicate."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},type:"object"},VariableParameter:{additionalProperties:!1,properties:{bind:{$ref:"#/definitions/Binding",description:"Binds the parameter to an external input element such as a slider, selection list or radio button group."},expr:{description:"An expression for the value of the parameter. This expression may include other parameters, in which case the parameter will automatically update in response to upstream parameter changes.",type:"string"},name:{description:'A unique name for the variable parameter. Parameter names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or "$", or "_") and may not start with a digit. Reserved keywords that may not be used as parameter names are: "datum".',type:"string"},push:{const:"outer",type:"string"},value:{description:"The [initial value](http://vega.github.io/vega-lite/docs/value.html) of the parameter.\n\n__Default value:__ `undefined`"}},required:["name"],type:"object"},ViewBackground:{additionalProperties:!1,properties:{fill:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The fill color."},fillOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The fill opacity. Value between `0` and `1`."},stroke:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The stroke color"},strokeOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The stroke opacity. Value between `0` and `1`."},strokeWidth:{description:"The stroke width in pixels.",type:"number"}},type:"object"},ViewOpacityDef:{anyOf:[{type:"number"},{$ref:"#/definitions/DynamicOpacity"},{$ref:"#/definitions/ExprRef"}]},ViewSpec:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/VConcatSpec"},{$ref:"#/definitions/HConcatSpec"},{$ref:"#/definitions/ConcatSpec"},{$ref:"#/definitions/SampleSpec"}]},ZoomParams:{additionalProperties:!1,properties:{extent:{anyOf:[{$ref:"#/definitions/ScalarDomain"},{$ref:"#/definitions/ComplexDomain"}],description:"The boundaries that limit the zoom and pan interactions."}},type:"object"}},EB={$ref:_Ne,$schema:bNe,definitions:vNe},yNe="@genome-spy/playground",wNe="0.53.1",CNe="A playground for testing GenomeSpy visualizations",SNe="module",xNe={dev:"vite",build:"vite build",serve:"vite preview"},LNe="Kari Lavikka",DNe="MIT",kNe={"@fortawesome/fontawesome-free":"^6.1.1","@fortawesome/fontawesome-svg-core":"^6.1.1","@fortawesome/free-solid-svg-icons":"^6.1.1","@genome-spy/core":"^0.53.1",lit:"^3.1.2","monaco-editor":"^0.44.0","vega-loader":"^4.4.0"},AB={name:yNe,private:!0,version:wNe,description:CNe,type:SNe,scripts:xNe,author:LNe,license:DNe,dependencies:kNe};/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var ENe=Object.defineProperty,ANe=Object.getOwnPropertyDescriptor,INe=Object.getOwnPropertyNames,TNe=Object.prototype.hasOwnProperty,NNe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of INe(e))!TNe.call(n,s)&&s!==t&&ENe(n,s,{get:()=>e[s],enumerable:!(i=ANe(e,s))||i.enumerable});return n},RNe=(n,e,t)=>(NNe(n,e,"default"),t),Ey={};RNe(Ey,mNe);var MNe=class{constructor(n,e,t){Ui(this,"_onDidChange",new Ey.Emitter);Ui(this,"_diagnosticsOptions");Ui(this,"_modeConfiguration");Ui(this,"_languageId");this._languageId=n,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},PNe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},ONe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},sY=new MNe("json",PNe,ONe);Ey.languages.json={jsonDefaults:sY};function FNe(){return Ys(()=>import("./jsonMode-Bixe832o.js"),[],import.meta.url)}Ey.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Ey.languages.onLanguage("json",()=>{FNe().then(n=>n.setupMode(sY))});const BNe={0:" ",1:"u",2:"r"},IB=65535,Hr=16777215,TB=4278190080;class jE{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<IB)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new jE(e.length),this._userDefinedStates=new jE(e.length),this._recoveredStates=new jE(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;iHr||r>Hr)throw new Error("startLineNumber or endLineNumber must not exceed "+Hr);for(;e.length>0&&!t(o,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Hr}getEndLineNumber(e){return this._endIndexes[e]&Hr}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s>>24)+((this._endIndexes[e]&TB)>>>16);return t===IB?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(p)?v=>v<_?p[v]:void 0:v=>v<_?p.toFoldRange(v):void 0,o=s(e,e.length),r=s(t,t.length);let a=0,l=0,c=o(0),d=r(0);const u=[];let h,f=0;const g=[];for(;c||d;){let p;if(d&&(!c||c.startLineNumber>=d.startLineNumber))c&&c.startLineNumber===d.startLineNumber?(d.source===1?p=d:(p=c,p.isCollapsed=d.isCollapsed&&c.endLineNumber===d.endLineNumber,p.source=0),c=o(++a)):(p=d,d.isCollapsed&&d.source===0&&(p.source=2)),d=r(++l);else{let _=l,v=d;for(;;){if(!v||v.startLineNumber>c.endLineNumber){p=c;break}if(v.source===1&&v.endLineNumber>c.endLineNumber)break;v=r(++_)}c=o(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=i&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&u.push(h),h=p)}}return g}}class WNe{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class VNe{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new B,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new go(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=l=>{for(;sr&&(r=c),s++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const u=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,u),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(s,o)=>{for(const r of e)if(s=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const s=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&s.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(i=a.source)!==null&&i!==void 0?i:0})}const r=go.sanitizeAndMerge(this._regions,s,o);this.updatePost(go.fromFoldRanges(r))}_getLinesChecksum(e,t){return P0e(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,l=this._regions.length;a0&&!c.containedBy(r[r.length-1]);)r.pop();r.push(c),t(c,r.length)&&i.push(c)}else break}}else for(let r=s,a=this._regions.length;r0)for(const o of i){const r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){const a=n.getRegionsInside(r,(l,c)=>l.isCollapsed!==e&&cr.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);s.push(...r)}n.toggleCollapseState(s)}function HNe(n,e,t){const i=[];for(const s of t){const o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function $Ne(n,e,t,i){const s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function rY(n,e,t){const i=[];for(const r of t){const a=n.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function s5(n,e,t){const i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){const a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function o5(n,e,t){const i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function UNe(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function jNe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function qNe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||vf(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return NB(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!KNe(r,s))&&(s=NB(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function KNe(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function NB(n,e){const t=Kb(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const YNe=5e3,ZNe="indent";class aY{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=ZNe}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(JNe(this.editorModel,i,s,this.foldingRangesLimit))}}let XNe=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Hr||t>Hr)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],s[r]=this._endIndexes[o];return new go(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let l=0;lt){s=l;break}i+=c}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],u=e.getLineContent(d),h=YD(u,o);(h{}};function JNe(n,e,t,i=QNe){const s=n.getOptions().tabSize,o=new XNe(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),u=YD(d,s);let h=a[a.length-1];if(u===-1){e&&(h.endAbove=c);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],o.insertFirst(c,h.line,u),h.line=c,h.indent=u,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>u){do a.pop(),h=a[a.length-1];while(h.indent>u);const g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,u)}h.indent===u?h.endAbove=c:a.push({indent:u,endAbove:c,line:c})}return o.toIndentRanges(n)}const eRe=E("editor.foldBackground",{light:Ce(cd,.3),dark:Ce(cd,.3),hcDark:null,hcLight:null},m("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);E("editorGutter.foldingControlForeground",{dark:ld,light:ld,hcDark:ld,hcLight:ld},m("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const r5=Yi("folding-expanded",se.chevronDown,m("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),a5=Yi("folding-collapsed",se.chevronRight,m("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),lY=Yi("folding-manual-collapsed",a5,m("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),cY=Yi("folding-manual-expanded",r5,m("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),l5={color:sn(eRe),position:Xs.Inline};class Ei{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ei.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ei.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ei.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ei.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ei.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ei.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ei.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ei.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ei.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ei.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ei.MANUALLY_EXPANDED_VISUAL_DECORATION:Ei.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Ei.COLLAPSED_VISUAL_DECORATION=et.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(a5)});Ei.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=et.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:l5,isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(a5)});Ei.MANUALLY_COLLAPSED_VISUAL_DECORATION=et.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(lY)});Ei.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=et.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:l5,isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(lY)});Ei.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Ei.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:l5,isWholeLine:!0});Ei.EXPANDED_VISUAL_DECORATION=et.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ne.asClassName(r5)});Ei.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=et.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(r5)});Ei.MANUALLY_EXPANDED_VISUAL_DECORATION=et.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ne.asClassName(cY)});Ei.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=et.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(cY)});Ei.NO_CONTROLS_EXPANDED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Ei.HIDDEN_RANGE_DECORATION=et.register({description:"folding-hidden-range-decoration",stickiness:1});const tRe={},iRe="syntax";class dY{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=iRe,this.disposables=new pe,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return nRe(this.providers,this.editorModel,e).then(t=>{var i,s;return t?oRe(t,this.foldingRangesLimit):(s=(i=this.fallbackRangeProvider)===null||i===void 0?void 0:i.compute(e))!==null&&s!==void 0?s:null})}dispose(){this.disposables.dispose()}}function nRe(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,tRe,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:r,kind:c.kind})}},bc));return Promise.all(s).then(o=>i)}class sRe{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>Hr||t>Hr)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=l}}const s=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,l=0;a{let l=r.start-a.start;return l===0&&(l=r.rank-a.rank),l}),i=new sRe(e);let s;const o=[];for(const r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var rRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},W0=function(n,e){return function(t,i){e(t,i,n)}},aRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},kg;const zn=new be("foldingEnabled",!1);let Sf=kg=class extends Y{static get(e){return e.getContribution(kg.ID)}static getFoldingRangeProviders(e,t){var i,s;const o=e.foldingRangeProvider.ordered(t);return(s=(i=kg._foldingRangeSelector)===null||i===void 0?void 0:i.call(kg,o,t))!==null&&s!==void 0?s:o}constructor(e,t,i,s,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new pe),this.editor=e,this._foldingLimitReporter=new lRe(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Ei(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=zn.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(109)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(109),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new VNe(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new GNe(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Su(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Li(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)===null||i===void 0||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new aY(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=kg.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new dY(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new vu,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=wc(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(as.Imports.value,!0);d&&(r=Nv.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),l=a?a.map(d=>d.startLineNumber):[];e.update(o,l),r==null||r.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(mt(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,mt)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(s){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(s||a){const l=e.event.altKey;let c=[];if(l){const d=h=>!h.containedBy(r)&&!r.containedBy(h),u=t.getRegionsInside(null,d);for(const h of u)h.isCollapsed&&c.push(h);c.length===0&&(c=u)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const u of t.getRegionsInside(r))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(r)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Sf.ID="editor.contrib.folding";Sf=kg=rRe([W0(1,tt),W0(2,oo),W0(3,Ln),W0(4,yG),W0(5,nt)],Sf);class lRe{constructor(e){this.editor=e,this._onDidChange=new B,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Jn extends Xt{runEditorCommand(e,t,i){const s=e.get(oo),o=Sf.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,s);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function uY(n){if(!qs(n)){if(!xs(n))return!1;const e=n;if(!qs(e.levels)&&!Zd(e.levels)||!qs(e.direction)&&!Ns(e.direction)||!qs(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Zd)))return!1}return!0}class cRe extends Jn{constructor(){super({id:"editor.unfold",label:m("unfoldAction.label","Unfold"),alias:"Unfold",precondition:zn,kbOpts:{kbExpr:H.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: + *-----------------------------------------------------------------------------*/var ENe=Object.defineProperty,ANe=Object.getOwnPropertyDescriptor,INe=Object.getOwnPropertyNames,TNe=Object.prototype.hasOwnProperty,NNe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of INe(e))!TNe.call(n,s)&&s!==t&&ENe(n,s,{get:()=>e[s],enumerable:!(i=ANe(e,s))||i.enumerable});return n},RNe=(n,e,t)=>(NNe(n,e,"default"),t),Ey={};RNe(Ey,mNe);var MNe=class{constructor(n,e,t){Ui(this,"_onDidChange",new Ey.Emitter);Ui(this,"_diagnosticsOptions");Ui(this,"_modeConfiguration");Ui(this,"_languageId");this._languageId=n,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},PNe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},ONe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},sY=new MNe("json",PNe,ONe);Ey.languages.json={jsonDefaults:sY};function FNe(){return Ys(()=>import("./jsonMode-B0NuPba3.js"),[],import.meta.url)}Ey.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Ey.languages.onLanguage("json",()=>{FNe().then(n=>n.setupMode(sY))});const BNe={0:" ",1:"u",2:"r"},IB=65535,Hr=16777215,TB=4278190080;class jE{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<IB)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new jE(e.length),this._userDefinedStates=new jE(e.length),this._recoveredStates=new jE(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;iHr||r>Hr)throw new Error("startLineNumber or endLineNumber must not exceed "+Hr);for(;e.length>0&&!t(o,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Hr}getEndLineNumber(e){return this._endIndexes[e]&Hr}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s>>24)+((this._endIndexes[e]&TB)>>>16);return t===IB?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(p)?v=>v<_?p[v]:void 0:v=>v<_?p.toFoldRange(v):void 0,o=s(e,e.length),r=s(t,t.length);let a=0,l=0,c=o(0),d=r(0);const u=[];let h,f=0;const g=[];for(;c||d;){let p;if(d&&(!c||c.startLineNumber>=d.startLineNumber))c&&c.startLineNumber===d.startLineNumber?(d.source===1?p=d:(p=c,p.isCollapsed=d.isCollapsed&&c.endLineNumber===d.endLineNumber,p.source=0),c=o(++a)):(p=d,d.isCollapsed&&d.source===0&&(p.source=2)),d=r(++l);else{let _=l,v=d;for(;;){if(!v||v.startLineNumber>c.endLineNumber){p=c;break}if(v.source===1&&v.endLineNumber>c.endLineNumber)break;v=r(++_)}c=o(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=i&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&u.push(h),h=p)}}return g}}class WNe{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class VNe{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new B,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new go(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=l=>{for(;sr&&(r=c),s++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const u=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,u),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(s,o)=>{for(const r of e)if(s=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const s=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&s.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(i=a.source)!==null&&i!==void 0?i:0})}const r=go.sanitizeAndMerge(this._regions,s,o);this.updatePost(go.fromFoldRanges(r))}_getLinesChecksum(e,t){return P0e(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,l=this._regions.length;a0&&!c.containedBy(r[r.length-1]);)r.pop();r.push(c),t(c,r.length)&&i.push(c)}else break}}else for(let r=s,a=this._regions.length;r0)for(const o of i){const r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){const a=n.getRegionsInside(r,(l,c)=>l.isCollapsed!==e&&cr.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);s.push(...r)}n.toggleCollapseState(s)}function HNe(n,e,t){const i=[];for(const s of t){const o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function $Ne(n,e,t,i){const s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function rY(n,e,t){const i=[];for(const r of t){const a=n.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function s5(n,e,t){const i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){const a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function o5(n,e,t){const i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function UNe(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function jNe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function qNe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||vf(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return NB(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!KNe(r,s))&&(s=NB(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function KNe(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function NB(n,e){const t=Kb(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const YNe=5e3,ZNe="indent";class aY{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=ZNe}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(JNe(this.editorModel,i,s,this.foldingRangesLimit))}}let XNe=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Hr||t>Hr)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],s[r]=this._endIndexes[o];return new go(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let l=0;lt){s=l;break}i+=c}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],u=e.getLineContent(d),h=YD(u,o);(h{}};function JNe(n,e,t,i=QNe){const s=n.getOptions().tabSize,o=new XNe(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),u=YD(d,s);let h=a[a.length-1];if(u===-1){e&&(h.endAbove=c);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],o.insertFirst(c,h.line,u),h.line=c,h.indent=u,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>u){do a.pop(),h=a[a.length-1];while(h.indent>u);const g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,u)}h.indent===u?h.endAbove=c:a.push({indent:u,endAbove:c,line:c})}return o.toIndentRanges(n)}const eRe=E("editor.foldBackground",{light:Ce(cd,.3),dark:Ce(cd,.3),hcDark:null,hcLight:null},m("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);E("editorGutter.foldingControlForeground",{dark:ld,light:ld,hcDark:ld,hcLight:ld},m("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const r5=Yi("folding-expanded",se.chevronDown,m("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),a5=Yi("folding-collapsed",se.chevronRight,m("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),lY=Yi("folding-manual-collapsed",a5,m("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),cY=Yi("folding-manual-expanded",r5,m("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),l5={color:sn(eRe),position:Xs.Inline};class Ei{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ei.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ei.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ei.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ei.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ei.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ei.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ei.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ei.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ei.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ei.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ei.MANUALLY_EXPANDED_VISUAL_DECORATION:Ei.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Ei.COLLAPSED_VISUAL_DECORATION=et.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(a5)});Ei.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=et.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:l5,isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(a5)});Ei.MANUALLY_COLLAPSED_VISUAL_DECORATION=et.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(lY)});Ei.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=et.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:l5,isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(lY)});Ei.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Ei.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:l5,isWholeLine:!0});Ei.EXPANDED_VISUAL_DECORATION=et.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ne.asClassName(r5)});Ei.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=et.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(r5)});Ei.MANUALLY_EXPANDED_VISUAL_DECORATION=et.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ne.asClassName(cY)});Ei.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=et.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Ne.asClassName(cY)});Ei.NO_CONTROLS_EXPANDED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Ei.HIDDEN_RANGE_DECORATION=et.register({description:"folding-hidden-range-decoration",stickiness:1});const tRe={},iRe="syntax";class dY{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=iRe,this.disposables=new pe,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return nRe(this.providers,this.editorModel,e).then(t=>{var i,s;return t?oRe(t,this.foldingRangesLimit):(s=(i=this.fallbackRangeProvider)===null||i===void 0?void 0:i.compute(e))!==null&&s!==void 0?s:null})}dispose(){this.disposables.dispose()}}function nRe(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,tRe,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:r,kind:c.kind})}},bc));return Promise.all(s).then(o=>i)}class sRe{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>Hr||t>Hr)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=l}}const s=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,l=0;a{let l=r.start-a.start;return l===0&&(l=r.rank-a.rank),l}),i=new sRe(e);let s;const o=[];for(const r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var rRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},W0=function(n,e){return function(t,i){e(t,i,n)}},aRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},kg;const zn=new be("foldingEnabled",!1);let Sf=kg=class extends Y{static get(e){return e.getContribution(kg.ID)}static getFoldingRangeProviders(e,t){var i,s;const o=e.foldingRangeProvider.ordered(t);return(s=(i=kg._foldingRangeSelector)===null||i===void 0?void 0:i.call(kg,o,t))!==null&&s!==void 0?s:o}constructor(e,t,i,s,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new pe),this.editor=e,this._foldingLimitReporter=new lRe(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Ei(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=zn.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(109)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(109),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new VNe(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new GNe(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Su(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Li(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)===null||i===void 0||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new aY(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=kg.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new dY(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new vu,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=wc(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(as.Imports.value,!0);d&&(r=Nv.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),l=a?a.map(d=>d.startLineNumber):[];e.update(o,l),r==null||r.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(mt(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,mt)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(s){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(s||a){const l=e.event.altKey;let c=[];if(l){const d=h=>!h.containedBy(r)&&!r.containedBy(h),u=t.getRegionsInside(null,d);for(const h of u)h.isCollapsed&&c.push(h);c.length===0&&(c=u)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const u of t.getRegionsInside(r))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(r)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Sf.ID="editor.contrib.folding";Sf=kg=rRe([W0(1,tt),W0(2,oo),W0(3,Ln),W0(4,yG),W0(5,nt)],Sf);class lRe{constructor(e){this.editor=e,this._onDidChange=new B,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Jn extends Xt{runEditorCommand(e,t,i){const s=e.get(oo),o=Sf.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,s);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function uY(n){if(!qs(n)){if(!xs(n))return!1;const e=n;if(!qs(e.levels)&&!Zd(e.levels)||!qs(e.direction)&&!Ns(e.direction)||!qs(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Zd)))return!1}return!0}class cRe extends Jn{constructor(){super({id:"editor.unfold",label:m("unfoldAction.label","Unfold"),alias:"Unfold",precondition:zn,kbOpts:{kbExpr:H.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. diff --git a/playground/assets/jsonMode-Bixe832o.js b/playground/assets/jsonMode-B0NuPba3.js similarity index 99% rename from playground/assets/jsonMode-Bixe832o.js rename to playground/assets/jsonMode-B0NuPba3.js index d546bca..062a24a 100644 --- a/playground/assets/jsonMode-Bixe832o.js +++ b/playground/assets/jsonMode-B0NuPba3.js @@ -1,4 +1,4 @@ -var $e=Object.defineProperty;var Ge=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>(Ge(e,typeof n!="symbol"?n+"":n,i),i);import{m as Qe}from"./index-Cd7qgL2s.js";/*!----------------------------------------------------------------------------- +var $e=Object.defineProperty;var Ge=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>(Ge(e,typeof n!="symbol"?n+"":n,i),i);import{m as Qe}from"./index-v_Hsdz7i.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/playground/index.html b/playground/index.html index a9ae458..6af7805 100644 --- a/playground/index.html +++ b/playground/index.html @@ -8,7 +8,7 @@ - +