@malloy-publisher/sdk 0.0.193 → 0.0.195

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";const E=require("react/jsx-runtime"),z=require("@tanstack/react-query"),m=require("axios"),R=require("react"),P="http://localhost/api/v0".replace(/\/+$/,"");class k{constructor(o,a=P,r=m){this.basePath=a,this.axios=r,o&&(this.configuration=o,this.basePath=o.basePath??a)}configuration}class pe extends Error{constructor(o,a){super(a),this.field=o,this.name="RequiredError"}}const g={},V="https://example.com",h=function(l,o,a){if(a==null)throw new pe(o,`Required parameter ${o} was null or undefined when calling ${l}.`)};function q(l,o,a=""){o!=null&&(typeof o=="object"?Array.isArray(o)?o.forEach(r=>q(l,r,a)):Object.keys(o).forEach(r=>q(l,o[r],`${a}${a!==""?".":""}${r}`)):l.has(a)?l.append(a,o):l.set(a,o))}const O=function(l,...o){const a=new URLSearchParams(l.search);q(a,o),l.search=a.toString()},I=function(l,o,a){const r=typeof l!="string";return(r&&a&&a.isJsonMime?a.isJsonMime(o.headers["Content-Type"]):r)?JSON.stringify(l!==void 0?l:{}):l||""},b=function(l){return l.pathname+l.search+l.hash},S=function(l,o,a,r){return(e=o,t=a)=>{const s={...l.options,url:(e.defaults.baseURL?"":r?.basePath??t)+l.url};return e.request(s)}},de={Bigquery:"bigquery",Snowflake:"snowflake",Postgres:"postgres",Gcs:"gcs",S3:"s3",Azure:"azure"},he={ServicePrincipal:"service_principal",SasToken:"sas_token"},me={Error:"error",Warn:"warn",Debug:"debug"},ue={Success:"success",Error:"error"},Pe={Postgres:"postgres",Bigquery:"bigquery",Snowflake:"snowflake",Trino:"trino",Databricks:"databricks",Mysql:"mysql",Duckdb:"duckdb",Motherduck:"motherduck",Ducklake:"ducklake"},ge={Ok:"ok",Failed:"failed"},Ve={Embedded:"embedded",Materialized:"materialized"},Oe={Equal:"equal",In:"in",Like:"like",GreaterThan:"greater_than",LessThan:"less_than"},be={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},Se={Pending:"PENDING",Running:"RUNNING",Success:"SUCCESS",Failed:"FAILED",Cancelled:"CANCELLED"},ye={Markdown:"markdown",Code:"code"},Ie={Markdown:"markdown",Code:"code"},Ae={Initializing:"initializing",Serving:"serving",Draining:"draining"},L=function(l){return{createConnection:async(o,a,r,e={})=>{h("createConnection","projectName",o),h("createConnection","connectionName",a),h("createConnection","connection",r);const t="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"POST",...n,...e},i={},p={};i["Content-Type"]="application/json",O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},c.data=I(r,c,l),{url:b(s),options:c}},deleteConnection:async(o,a,r={})=>{h("deleteConnection","projectName",o),h("deleteConnection","connectionName",a);const e="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))),t=new URL(e,V);let s;l&&(s=l.baseOptions);const n={method:"DELETE",...s,...r},c={};O(t,{});let p=s&&s.headers?s.headers:{};return n.headers={...c,...p,...r.headers},{url:b(t),options:n}},getConnection:async(o,a,r={})=>{h("getConnection","projectName",o),h("getConnection","connectionName",a);const e="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))),t=new URL(e,V);let s;l&&(s=l.baseOptions);const n={method:"GET",...s,...r},c={};O(t,{});let p=s&&s.headers?s.headers:{};return n.headers={...c,...p,...r.headers},{url:b(t),options:n}},getQuerydata:async(o,a,r,e,t={})=>{h("getQuerydata","projectName",o),h("getQuerydata","connectionName",a);const s="/projects/{projectName}/connections/{connectionName}/queryData".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...t},p={},d={};r!==void 0&&(d.sqlStatement=r),e!==void 0&&(d.options=e),O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},{url:b(n),options:i}},getQuerydataInPackage:async(o,a,r,e,t,s={})=>{h("getQuerydataInPackage","projectName",o),h("getQuerydataInPackage","packageName",a),h("getQuerydataInPackage","connectionName",r);const n="/projects/{projectName}/packages/{packageName}/connections/{connectionName}/queryData".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(r))),c=new URL(n,V);let i;l&&(i=l.baseOptions);const p={method:"GET",...i,...s},d={},u={};e!==void 0&&(u.sqlStatement=e),t!==void 0&&(u.options=t),O(c,u);let A=i&&i.headers?i.headers:{};return p.headers={...d,...A,...s.headers},{url:b(c),options:p}},getSqlsource:async(o,a,r,e={})=>{h("getSqlsource","projectName",o),h("getSqlsource","connectionName",a);const t="/projects/{projectName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"GET",...n,...e},i={},p={};r!==void 0&&(p.sqlStatement=r),O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},{url:b(s),options:c}},getSqlsourceInPackage:async(o,a,r,e,t={})=>{h("getSqlsourceInPackage","projectName",o),h("getSqlsourceInPackage","packageName",a),h("getSqlsourceInPackage","connectionName",r);const s="/projects/{projectName}/packages/{packageName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(r))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...t},p={},d={};e!==void 0&&(d.sqlStatement=e),O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},{url:b(n),options:i}},getTable:async(o,a,r,e,t={})=>{h("getTable","projectName",o),h("getTable","connectionName",a),h("getTable","schemaName",r),h("getTable","tablePath",e);const s="/projects/{projectName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))).replace("{schemaName}",encodeURIComponent(String(r))).replace("{tablePath}",encodeURIComponent(String(e))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...t},p={};O(n,{});let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},{url:b(n),options:i}},getTableInPackage:async(o,a,r,e,t,s={})=>{h("getTableInPackage","projectName",o),h("getTableInPackage","packageName",a),h("getTableInPackage","connectionName",r),h("getTableInPackage","schemaName",e),h("getTableInPackage","tablePath",t);const n="/projects/{projectName}/packages/{packageName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(r))).replace("{schemaName}",encodeURIComponent(String(e))).replace("{tablePath}",encodeURIComponent(String(t))),c=new URL(n,V);let i;l&&(i=l.baseOptions);const p={method:"GET",...i,...s},d={};O(c,{});let A=i&&i.headers?i.headers:{};return p.headers={...d,...A,...s.headers},{url:b(c),options:p}},getTemporarytable:async(o,a,r,e={})=>{h("getTemporarytable","projectName",o),h("getTemporarytable","connectionName",a);const t="/projects/{projectName}/connections/{connectionName}/temporaryTable".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"GET",...n,...e},i={},p={};r!==void 0&&(p.sqlStatement=r),O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},{url:b(s),options:c}},getTemporarytableInPackage:async(o,a,r,e,t={})=>{h("getTemporarytableInPackage","projectName",o),h("getTemporarytableInPackage","packageName",a),h("getTemporarytableInPackage","connectionName",r);const s="/projects/{projectName}/packages/{packageName}/connections/{connectionName}/temporaryTable".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(r))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...t},p={},d={};e!==void 0&&(d.sqlStatement=e),O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},{url:b(n),options:i}},listConnections:async(o,a={})=>{h("listConnections","projectName",o);const r="/projects/{projectName}/connections".replace("{projectName}",encodeURIComponent(String(o))),e=new URL(r,V);let t;l&&(t=l.baseOptions);const s={method:"GET",...t,...a},n={};O(e,{});let i=t&&t.headers?t.headers:{};return s.headers={...n,...i,...a.headers},{url:b(e),options:s}},listSchemas:async(o,a,r={})=>{h("listSchemas","projectName",o),h("listSchemas","connectionName",a);const e="/projects/{projectName}/connections/{connectionName}/schemas".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))),t=new URL(e,V);let s;l&&(s=l.baseOptions);const n={method:"GET",...s,...r},c={};O(t,{});let p=s&&s.headers?s.headers:{};return n.headers={...c,...p,...r.headers},{url:b(t),options:n}},listSchemasInPackage:async(o,a,r,e={})=>{h("listSchemasInPackage","projectName",o),h("listSchemasInPackage","packageName",a),h("listSchemasInPackage","connectionName",r);const t="/projects/{projectName}/packages/{packageName}/connections/{connectionName}/schemas".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(r))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"GET",...n,...e},i={};O(s,{});let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},{url:b(s),options:c}},listTables:async(o,a,r,e,t={})=>{h("listTables","projectName",o),h("listTables","connectionName",a),h("listTables","schemaName",r);const s="/projects/{projectName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))).replace("{schemaName}",encodeURIComponent(String(r))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...t},p={},d={};e&&(d.tableNames=e),O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},{url:b(n),options:i}},listTablesInPackage:async(o,a,r,e,t,s={})=>{h("listTablesInPackage","projectName",o),h("listTablesInPackage","packageName",a),h("listTablesInPackage","connectionName",r),h("listTablesInPackage","schemaName",e);const n="/projects/{projectName}/packages/{packageName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(r))).replace("{schemaName}",encodeURIComponent(String(e))),c=new URL(n,V);let i;l&&(i=l.baseOptions);const p={method:"GET",...i,...s},d={},u={};t&&(u.tableNames=t),O(c,u);let A=i&&i.headers?i.headers:{};return p.headers={...d,...A,...s.headers},{url:b(c),options:p}},postQuerydata:async(o,a,r,e,t={})=>{h("postQuerydata","projectName",o),h("postQuerydata","connectionName",a),h("postQuerydata","postQuerydataRequest",r);const s="/projects/{projectName}/connections/{connectionName}/sqlQuery".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...t},p={},d={};e!==void 0&&(d.options=e),p["Content-Type"]="application/json",O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},i.data=I(r,i,l),{url:b(n),options:i}},postQuerydataInPackage:async(o,a,r,e,t,s={})=>{h("postQuerydataInPackage","projectName",o),h("postQuerydataInPackage","packageName",a),h("postQuerydataInPackage","connectionName",r),h("postQuerydataInPackage","postQuerydataRequest",e);const n="/projects/{projectName}/packages/{packageName}/connections/{connectionName}/sqlQuery".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(r))),c=new URL(n,V);let i;l&&(i=l.baseOptions);const p={method:"POST",...i,...s},d={},u={};t!==void 0&&(u.options=t),d["Content-Type"]="application/json",O(c,u);let A=i&&i.headers?i.headers:{};return p.headers={...d,...A,...s.headers},p.data=I(e,p,l),{url:b(c),options:p}},postSqlsource:async(o,a,r,e={})=>{h("postSqlsource","projectName",o),h("postSqlsource","connectionName",a),h("postSqlsource","postSqlsourceRequest",r);const t="/projects/{projectName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"POST",...n,...e},i={},p={};i["Content-Type"]="application/json",O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},c.data=I(r,c,l),{url:b(s),options:c}},postSqlsourceInPackage:async(o,a,r,e,t={})=>{h("postSqlsourceInPackage","projectName",o),h("postSqlsourceInPackage","packageName",a),h("postSqlsourceInPackage","connectionName",r),h("postSqlsourceInPackage","postSqlsourceRequest",e);const s="/projects/{projectName}/packages/{packageName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(r))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...t},p={},d={};p["Content-Type"]="application/json",O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},i.data=I(e,i,l),{url:b(n),options:i}},postTemporarytable:async(o,a,r,e={})=>{h("postTemporarytable","projectName",o),h("postTemporarytable","connectionName",a),h("postTemporarytable","postSqlsourceRequest",r);const t="/projects/{projectName}/connections/{connectionName}/sqlTemporaryTable".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"POST",...n,...e},i={},p={};i["Content-Type"]="application/json",O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},c.data=I(r,c,l),{url:b(s),options:c}},postTemporarytableInPackage:async(o,a,r,e,t={})=>{h("postTemporarytableInPackage","projectName",o),h("postTemporarytableInPackage","packageName",a),h("postTemporarytableInPackage","connectionName",r),h("postTemporarytableInPackage","postSqlsourceRequest",e);const s="/projects/{projectName}/packages/{packageName}/connections/{connectionName}/sqlTemporaryTable".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(r))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...t},p={},d={};p["Content-Type"]="application/json",O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},i.data=I(e,i,l),{url:b(n),options:i}},updateConnection:async(o,a,r,e={})=>{h("updateConnection","projectName",o),h("updateConnection","connectionName",a),h("updateConnection","updateConnectionRequest",r);const t="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(o))).replace("{connectionName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"PATCH",...n,...e},i={},p={};i["Content-Type"]="application/json",O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},c.data=I(r,c,l),{url:b(s),options:c}}}},y=function(l){const o=L(l);return{async createConnection(a,r,e,t){const s=await o.createConnection(a,r,e,t),n=l?.serverIndex??0,c=g["ConnectionsApi.createConnection"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)},async deleteConnection(a,r,e){const t=await o.deleteConnection(a,r,e),s=l?.serverIndex??0,n=g["ConnectionsApi.deleteConnection"]?.[s]?.url;return(c,i)=>S(t,m,P,l)(c,n||i)},async getConnection(a,r,e){const t=await o.getConnection(a,r,e),s=l?.serverIndex??0,n=g["ConnectionsApi.getConnection"]?.[s]?.url;return(c,i)=>S(t,m,P,l)(c,n||i)},async getQuerydata(a,r,e,t,s){const n=await o.getQuerydata(a,r,e,t,s),c=l?.serverIndex??0,i=g["ConnectionsApi.getQuerydata"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async getQuerydataInPackage(a,r,e,t,s,n){const c=await o.getQuerydataInPackage(a,r,e,t,s,n),i=l?.serverIndex??0,p=g["ConnectionsApi.getQuerydataInPackage"]?.[i]?.url;return(d,u)=>S(c,m,P,l)(d,p||u)},async getSqlsource(a,r,e,t){const s=await o.getSqlsource(a,r,e,t),n=l?.serverIndex??0,c=g["ConnectionsApi.getSqlsource"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)},async getSqlsourceInPackage(a,r,e,t,s){const n=await o.getSqlsourceInPackage(a,r,e,t,s),c=l?.serverIndex??0,i=g["ConnectionsApi.getSqlsourceInPackage"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async getTable(a,r,e,t,s){const n=await o.getTable(a,r,e,t,s),c=l?.serverIndex??0,i=g["ConnectionsApi.getTable"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async getTableInPackage(a,r,e,t,s,n){const c=await o.getTableInPackage(a,r,e,t,s,n),i=l?.serverIndex??0,p=g["ConnectionsApi.getTableInPackage"]?.[i]?.url;return(d,u)=>S(c,m,P,l)(d,p||u)},async getTemporarytable(a,r,e,t){const s=await o.getTemporarytable(a,r,e,t),n=l?.serverIndex??0,c=g["ConnectionsApi.getTemporarytable"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)},async getTemporarytableInPackage(a,r,e,t,s){const n=await o.getTemporarytableInPackage(a,r,e,t,s),c=l?.serverIndex??0,i=g["ConnectionsApi.getTemporarytableInPackage"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async listConnections(a,r){const e=await o.listConnections(a,r),t=l?.serverIndex??0,s=g["ConnectionsApi.listConnections"]?.[t]?.url;return(n,c)=>S(e,m,P,l)(n,s||c)},async listSchemas(a,r,e){const t=await o.listSchemas(a,r,e),s=l?.serverIndex??0,n=g["ConnectionsApi.listSchemas"]?.[s]?.url;return(c,i)=>S(t,m,P,l)(c,n||i)},async listSchemasInPackage(a,r,e,t){const s=await o.listSchemasInPackage(a,r,e,t),n=l?.serverIndex??0,c=g["ConnectionsApi.listSchemasInPackage"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)},async listTables(a,r,e,t,s){const n=await o.listTables(a,r,e,t,s),c=l?.serverIndex??0,i=g["ConnectionsApi.listTables"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async listTablesInPackage(a,r,e,t,s,n){const c=await o.listTablesInPackage(a,r,e,t,s,n),i=l?.serverIndex??0,p=g["ConnectionsApi.listTablesInPackage"]?.[i]?.url;return(d,u)=>S(c,m,P,l)(d,p||u)},async postQuerydata(a,r,e,t,s){const n=await o.postQuerydata(a,r,e,t,s),c=l?.serverIndex??0,i=g["ConnectionsApi.postQuerydata"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async postQuerydataInPackage(a,r,e,t,s,n){const c=await o.postQuerydataInPackage(a,r,e,t,s,n),i=l?.serverIndex??0,p=g["ConnectionsApi.postQuerydataInPackage"]?.[i]?.url;return(d,u)=>S(c,m,P,l)(d,p||u)},async postSqlsource(a,r,e,t){const s=await o.postSqlsource(a,r,e,t),n=l?.serverIndex??0,c=g["ConnectionsApi.postSqlsource"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)},async postSqlsourceInPackage(a,r,e,t,s){const n=await o.postSqlsourceInPackage(a,r,e,t,s),c=l?.serverIndex??0,i=g["ConnectionsApi.postSqlsourceInPackage"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async postTemporarytable(a,r,e,t){const s=await o.postTemporarytable(a,r,e,t),n=l?.serverIndex??0,c=g["ConnectionsApi.postTemporarytable"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)},async postTemporarytableInPackage(a,r,e,t,s){const n=await o.postTemporarytableInPackage(a,r,e,t,s),c=l?.serverIndex??0,i=g["ConnectionsApi.postTemporarytableInPackage"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async updateConnection(a,r,e,t){const s=await o.updateConnection(a,r,e,t),n=l?.serverIndex??0,c=g["ConnectionsApi.updateConnection"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)}}},ke=function(l,o,a){const r=y(l);return{createConnection(e,t,s,n){return r.createConnection(e,t,s,n).then(c=>c(a,o))},deleteConnection(e,t,s){return r.deleteConnection(e,t,s).then(n=>n(a,o))},getConnection(e,t,s){return r.getConnection(e,t,s).then(n=>n(a,o))},getQuerydata(e,t,s,n,c){return r.getQuerydata(e,t,s,n,c).then(i=>i(a,o))},getQuerydataInPackage(e,t,s,n,c,i){return r.getQuerydataInPackage(e,t,s,n,c,i).then(p=>p(a,o))},getSqlsource(e,t,s,n){return r.getSqlsource(e,t,s,n).then(c=>c(a,o))},getSqlsourceInPackage(e,t,s,n,c){return r.getSqlsourceInPackage(e,t,s,n,c).then(i=>i(a,o))},getTable(e,t,s,n,c){return r.getTable(e,t,s,n,c).then(i=>i(a,o))},getTableInPackage(e,t,s,n,c,i){return r.getTableInPackage(e,t,s,n,c,i).then(p=>p(a,o))},getTemporarytable(e,t,s,n){return r.getTemporarytable(e,t,s,n).then(c=>c(a,o))},getTemporarytableInPackage(e,t,s,n,c){return r.getTemporarytableInPackage(e,t,s,n,c).then(i=>i(a,o))},listConnections(e,t){return r.listConnections(e,t).then(s=>s(a,o))},listSchemas(e,t,s){return r.listSchemas(e,t,s).then(n=>n(a,o))},listSchemasInPackage(e,t,s,n){return r.listSchemasInPackage(e,t,s,n).then(c=>c(a,o))},listTables(e,t,s,n,c){return r.listTables(e,t,s,n,c).then(i=>i(a,o))},listTablesInPackage(e,t,s,n,c,i){return r.listTablesInPackage(e,t,s,n,c,i).then(p=>p(a,o))},postQuerydata(e,t,s,n,c){return r.postQuerydata(e,t,s,n,c).then(i=>i(a,o))},postQuerydataInPackage(e,t,s,n,c,i){return r.postQuerydataInPackage(e,t,s,n,c,i).then(p=>p(a,o))},postSqlsource(e,t,s,n){return r.postSqlsource(e,t,s,n).then(c=>c(a,o))},postSqlsourceInPackage(e,t,s,n,c){return r.postSqlsourceInPackage(e,t,s,n,c).then(i=>i(a,o))},postTemporarytable(e,t,s,n){return r.postTemporarytable(e,t,s,n).then(c=>c(a,o))},postTemporarytableInPackage(e,t,s,n,c){return r.postTemporarytableInPackage(e,t,s,n,c).then(i=>i(a,o))},updateConnection(e,t,s,n){return r.updateConnection(e,t,s,n).then(c=>c(a,o))}}};class H extends k{createConnection(o,a,r,e){return y(this.configuration).createConnection(o,a,r,e).then(t=>t(this.axios,this.basePath))}deleteConnection(o,a,r){return y(this.configuration).deleteConnection(o,a,r).then(e=>e(this.axios,this.basePath))}getConnection(o,a,r){return y(this.configuration).getConnection(o,a,r).then(e=>e(this.axios,this.basePath))}getQuerydata(o,a,r,e,t){return y(this.configuration).getQuerydata(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}getQuerydataInPackage(o,a,r,e,t,s){return y(this.configuration).getQuerydataInPackage(o,a,r,e,t,s).then(n=>n(this.axios,this.basePath))}getSqlsource(o,a,r,e){return y(this.configuration).getSqlsource(o,a,r,e).then(t=>t(this.axios,this.basePath))}getSqlsourceInPackage(o,a,r,e,t){return y(this.configuration).getSqlsourceInPackage(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}getTable(o,a,r,e,t){return y(this.configuration).getTable(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}getTableInPackage(o,a,r,e,t,s){return y(this.configuration).getTableInPackage(o,a,r,e,t,s).then(n=>n(this.axios,this.basePath))}getTemporarytable(o,a,r,e){return y(this.configuration).getTemporarytable(o,a,r,e).then(t=>t(this.axios,this.basePath))}getTemporarytableInPackage(o,a,r,e,t){return y(this.configuration).getTemporarytableInPackage(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}listConnections(o,a){return y(this.configuration).listConnections(o,a).then(r=>r(this.axios,this.basePath))}listSchemas(o,a,r){return y(this.configuration).listSchemas(o,a,r).then(e=>e(this.axios,this.basePath))}listSchemasInPackage(o,a,r,e){return y(this.configuration).listSchemasInPackage(o,a,r,e).then(t=>t(this.axios,this.basePath))}listTables(o,a,r,e,t){return y(this.configuration).listTables(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}listTablesInPackage(o,a,r,e,t,s){return y(this.configuration).listTablesInPackage(o,a,r,e,t,s).then(n=>n(this.axios,this.basePath))}postQuerydata(o,a,r,e,t){return y(this.configuration).postQuerydata(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}postQuerydataInPackage(o,a,r,e,t,s){return y(this.configuration).postQuerydataInPackage(o,a,r,e,t,s).then(n=>n(this.axios,this.basePath))}postSqlsource(o,a,r,e){return y(this.configuration).postSqlsource(o,a,r,e).then(t=>t(this.axios,this.basePath))}postSqlsourceInPackage(o,a,r,e,t){return y(this.configuration).postSqlsourceInPackage(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}postTemporarytable(o,a,r,e){return y(this.configuration).postTemporarytable(o,a,r,e).then(t=>t(this.axios,this.basePath))}postTemporarytableInPackage(o,a,r,e,t){return y(this.configuration).postTemporarytableInPackage(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}updateConnection(o,a,r,e){return y(this.configuration).updateConnection(o,a,r,e).then(t=>t(this.axios,this.basePath))}}const f=function(l){return{testConnectionConfiguration:async(o,a={})=>{h("testConnectionConfiguration","connection",o);const r="/connections/test",e=new URL(r,V);let t;l&&(t=l.baseOptions);const s={method:"POST",...t,...a},n={},c={};n["Content-Type"]="application/json",O(e,c);let i=t&&t.headers?t.headers:{};return s.headers={...n,...i,...a.headers},s.data=I(o,s,l),{url:b(e),options:s}}}},$=function(l){const o=f(l);return{async testConnectionConfiguration(a,r){const e=await o.testConnectionConfiguration(a,r),t=l?.serverIndex??0,s=g["ConnectionsTestApi.testConnectionConfiguration"]?.[t]?.url;return(n,c)=>S(e,m,P,l)(n,s||c)}}},Ce=function(l,o,a){const r=$(l);return{testConnectionConfiguration(e,t){return r.testConnectionConfiguration(e,t).then(s=>s(a,o))}}};class je extends k{testConnectionConfiguration(o,a){return $(this.configuration).testConnectionConfiguration(o,a).then(r=>r(this.axios,this.basePath))}}const D=function(l){return{listDatabases:async(o,a,r,e={})=>{h("listDatabases","projectName",o),h("listDatabases","packageName",a);const t="/projects/{projectName}/packages/{packageName}/databases".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"GET",...n,...e},i={},p={};r!==void 0&&(p.versionId=r),O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},{url:b(s),options:c}}}},F=function(l){const o=D(l);return{async listDatabases(a,r,e,t){const s=await o.listDatabases(a,r,e,t),n=l?.serverIndex??0,c=g["DatabasesApi.listDatabases"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)}}},xe=function(l,o,a){const r=F(l);return{listDatabases(e,t,s,n){return r.listDatabases(e,t,s,n).then(c=>c(a,o))}}};class W extends k{listDatabases(o,a,r,e){return F(this.configuration).listDatabases(o,a,r,e).then(t=>t(this.axios,this.basePath))}}const G=function(l){return{getManifest:async(o,a,r={})=>{h("getManifest","projectName",o),h("getManifest","packageName",a);const e="/projects/{projectName}/packages/{packageName}/manifest".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))),t=new URL(e,V);let s;l&&(s=l.baseOptions);const n={method:"GET",...s,...r},c={};O(t,{});let p=s&&s.headers?s.headers:{};return n.headers={...c,...p,...r.headers},{url:b(t),options:n}},manifestAction:async(o,a,r,e={})=>{h("manifestAction","projectName",o),h("manifestAction","packageName",a),h("manifestAction","action",r);const t="/projects/{projectName}/packages/{packageName}/manifest".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"POST",...n,...e},i={},p={};r!==void 0&&(p.action=r),O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},{url:b(s),options:c}}}},w=function(l){const o=G(l);return{async getManifest(a,r,e){const t=await o.getManifest(a,r,e),s=l?.serverIndex??0,n=g["ManifestsApi.getManifest"]?.[s]?.url;return(c,i)=>S(t,m,P,l)(c,n||i)},async manifestAction(a,r,e,t){const s=await o.manifestAction(a,r,e,t),n=l?.serverIndex??0,c=g["ManifestsApi.manifestAction"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)}}},Ne=function(l,o,a){const r=w(l);return{getManifest(e,t,s){return r.getManifest(e,t,s).then(n=>n(a,o))},manifestAction(e,t,s,n){return r.manifestAction(e,t,s,n).then(c=>c(a,o))}}};class Re extends k{getManifest(o,a,r){return w(this.configuration).getManifest(o,a,r).then(e=>e(this.axios,this.basePath))}manifestAction(o,a,r,e){return w(this.configuration).manifestAction(o,a,r,e).then(t=>t(this.axios,this.basePath))}}const Ue={Reload:"reload"},_=function(l){return{createMaterialization:async(o,a,r,e={})=>{h("createMaterialization","projectName",o),h("createMaterialization","packageName",a);const t="/projects/{projectName}/packages/{packageName}/materializations".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"POST",...n,...e},i={},p={};i["Content-Type"]="application/json",O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},c.data=I(r,c,l),{url:b(s),options:c}},deleteMaterialization:async(o,a,r,e={})=>{h("deleteMaterialization","projectName",o),h("deleteMaterialization","packageName",a),h("deleteMaterialization","materializationId",r);const t="/projects/{projectName}/packages/{packageName}/materializations/{materializationId}".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{materializationId}",encodeURIComponent(String(r))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"DELETE",...n,...e},i={};O(s,{});let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},{url:b(s),options:c}},getMaterialization:async(o,a,r,e={})=>{h("getMaterialization","projectName",o),h("getMaterialization","packageName",a),h("getMaterialization","materializationId",r);const t="/projects/{projectName}/packages/{packageName}/materializations/{materializationId}".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{materializationId}",encodeURIComponent(String(r))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"GET",...n,...e},i={};O(s,{});let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},{url:b(s),options:c}},listMaterializations:async(o,a,r,e,t={})=>{h("listMaterializations","projectName",o),h("listMaterializations","packageName",a);const s="/projects/{projectName}/packages/{packageName}/materializations".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...t},p={},d={};r!==void 0&&(d.limit=r),e!==void 0&&(d.offset=e),O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},{url:b(n),options:i}},materializationAction:async(o,a,r,e,t={})=>{h("materializationAction","projectName",o),h("materializationAction","packageName",a),h("materializationAction","materializationId",r),h("materializationAction","action",e);const s="/projects/{projectName}/packages/{packageName}/materializations/{materializationId}".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{materializationId}",encodeURIComponent(String(r))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...t},p={},d={};e!==void 0&&(d.action=e),O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},{url:b(n),options:i}}}},j=function(l){const o=_(l);return{async createMaterialization(a,r,e,t){const s=await o.createMaterialization(a,r,e,t),n=l?.serverIndex??0,c=g["MaterializationsApi.createMaterialization"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)},async deleteMaterialization(a,r,e,t){const s=await o.deleteMaterialization(a,r,e,t),n=l?.serverIndex??0,c=g["MaterializationsApi.deleteMaterialization"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)},async getMaterialization(a,r,e,t){const s=await o.getMaterialization(a,r,e,t),n=l?.serverIndex??0,c=g["MaterializationsApi.getMaterialization"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)},async listMaterializations(a,r,e,t,s){const n=await o.listMaterializations(a,r,e,t,s),c=l?.serverIndex??0,i=g["MaterializationsApi.listMaterializations"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async materializationAction(a,r,e,t,s){const n=await o.materializationAction(a,r,e,t,s),c=l?.serverIndex??0,i=g["MaterializationsApi.materializationAction"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)}}},ve=function(l,o,a){const r=j(l);return{createMaterialization(e,t,s,n){return r.createMaterialization(e,t,s,n).then(c=>c(a,o))},deleteMaterialization(e,t,s,n){return r.deleteMaterialization(e,t,s,n).then(c=>c(a,o))},getMaterialization(e,t,s,n){return r.getMaterialization(e,t,s,n).then(c=>c(a,o))},listMaterializations(e,t,s,n,c){return r.listMaterializations(e,t,s,n,c).then(i=>i(a,o))},materializationAction(e,t,s,n,c){return r.materializationAction(e,t,s,n,c).then(i=>i(a,o))}}};class Te extends k{createMaterialization(o,a,r,e){return j(this.configuration).createMaterialization(o,a,r,e).then(t=>t(this.axios,this.basePath))}deleteMaterialization(o,a,r,e){return j(this.configuration).deleteMaterialization(o,a,r,e).then(t=>t(this.axios,this.basePath))}getMaterialization(o,a,r,e){return j(this.configuration).getMaterialization(o,a,r,e).then(t=>t(this.axios,this.basePath))}listMaterializations(o,a,r,e,t){return j(this.configuration).listMaterializations(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}materializationAction(o,a,r,e,t){return j(this.configuration).materializationAction(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}}const Me={Start:"start",Stop:"stop"},J=function(l){return{compileModelSource:async(o,a,r,e,t={})=>{h("compileModelSource","projectName",o),h("compileModelSource","packageName",a),h("compileModelSource","path",r),h("compileModelSource","compileRequest",e);const s="/projects/{projectName}/packages/{packageName}/models/{path}/compile".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{path}",encodeURIComponent(String(r))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...t},p={},d={};p["Content-Type"]="application/json",O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},i.data=I(e,i,l),{url:b(n),options:i}},executeQueryModel:async(o,a,r,e,t={})=>{h("executeQueryModel","projectName",o),h("executeQueryModel","packageName",a),h("executeQueryModel","path",r),h("executeQueryModel","queryRequest",e);const s="/projects/{projectName}/packages/{packageName}/models/{path}/query".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{path}",encodeURIComponent(String(r))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...t},p={},d={};p["Content-Type"]="application/json",O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},i.data=I(e,i,l),{url:b(n),options:i}},getModel:async(o,a,r,e,t={})=>{h("getModel","projectName",o),h("getModel","packageName",a),h("getModel","path",r);const s="/projects/{projectName}/packages/{packageName}/models/{path}".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{path}",encodeURIComponent(String(r))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...t},p={},d={};e!==void 0&&(d.versionId=e),O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},{url:b(n),options:i}},listModels:async(o,a,r,e={})=>{h("listModels","projectName",o),h("listModels","packageName",a);const t="/projects/{projectName}/packages/{packageName}/models".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"GET",...n,...e},i={},p={};r!==void 0&&(p.versionId=r),O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},{url:b(s),options:c}}}},U=function(l){const o=J(l);return{async compileModelSource(a,r,e,t,s){const n=await o.compileModelSource(a,r,e,t,s),c=l?.serverIndex??0,i=g["ModelsApi.compileModelSource"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async executeQueryModel(a,r,e,t,s){const n=await o.executeQueryModel(a,r,e,t,s),c=l?.serverIndex??0,i=g["ModelsApi.executeQueryModel"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async getModel(a,r,e,t,s){const n=await o.getModel(a,r,e,t,s),c=l?.serverIndex??0,i=g["ModelsApi.getModel"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async listModels(a,r,e,t){const s=await o.listModels(a,r,e,t),n=l?.serverIndex??0,c=g["ModelsApi.listModels"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)}}},we=function(l,o,a){const r=U(l);return{compileModelSource(e,t,s,n,c){return r.compileModelSource(e,t,s,n,c).then(i=>i(a,o))},executeQueryModel(e,t,s,n,c){return r.executeQueryModel(e,t,s,n,c).then(i=>i(a,o))},getModel(e,t,s,n,c){return r.getModel(e,t,s,n,c).then(i=>i(a,o))},listModels(e,t,s,n){return r.listModels(e,t,s,n).then(c=>c(a,o))}}};class K extends k{compileModelSource(o,a,r,e,t){return U(this.configuration).compileModelSource(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}executeQueryModel(o,a,r,e,t){return U(this.configuration).executeQueryModel(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}getModel(o,a,r,e,t){return U(this.configuration).getModel(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}listModels(o,a,r,e){return U(this.configuration).listModels(o,a,r,e).then(t=>t(this.axios,this.basePath))}}const Y=function(l){return{executeNotebookCell:async(o,a,r,e,t,s,n,c={})=>{h("executeNotebookCell","projectName",o),h("executeNotebookCell","packageName",a),h("executeNotebookCell","path",r),h("executeNotebookCell","cellIndex",e);const i="/projects/{projectName}/packages/{packageName}/notebooks/{path}/cells/{cellIndex}".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{path}",encodeURIComponent(String(r))).replace("{cellIndex}",encodeURIComponent(String(e))),p=new URL(i,V);let d;l&&(d=l.baseOptions);const u={method:"GET",...d,...c},A={},C={};t!==void 0&&(C.versionId=t),s!==void 0&&(C.filter_params=s),n!==void 0&&(C.bypass_filters=n),O(p,C);let Q=d&&d.headers?d.headers:{};return u.headers={...A,...Q,...c.headers},{url:b(p),options:u}},getNotebook:async(o,a,r,e,t={})=>{h("getNotebook","projectName",o),h("getNotebook","packageName",a),h("getNotebook","path",r);const s="/projects/{projectName}/packages/{packageName}/notebooks/{path}".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))).replace("{path}",encodeURIComponent(String(r))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...t},p={},d={};e!==void 0&&(d.versionId=e),O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},{url:b(n),options:i}},listNotebooks:async(o,a,r,e={})=>{h("listNotebooks","projectName",o),h("listNotebooks","packageName",a);const t="/projects/{projectName}/packages/{packageName}/notebooks".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"GET",...n,...e},i={},p={};r!==void 0&&(p.versionId=r),O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},{url:b(s),options:c}}}},v=function(l){const o=Y(l);return{async executeNotebookCell(a,r,e,t,s,n,c,i){const p=await o.executeNotebookCell(a,r,e,t,s,n,c,i),d=l?.serverIndex??0,u=g["NotebooksApi.executeNotebookCell"]?.[d]?.url;return(A,C)=>S(p,m,P,l)(A,u||C)},async getNotebook(a,r,e,t,s){const n=await o.getNotebook(a,r,e,t,s),c=l?.serverIndex??0,i=g["NotebooksApi.getNotebook"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async listNotebooks(a,r,e,t){const s=await o.listNotebooks(a,r,e,t),n=l?.serverIndex??0,c=g["NotebooksApi.listNotebooks"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)}}},Qe=function(l,o,a){const r=v(l);return{executeNotebookCell(e,t,s,n,c,i,p,d){return r.executeNotebookCell(e,t,s,n,c,i,p,d).then(u=>u(a,o))},getNotebook(e,t,s,n,c){return r.getNotebook(e,t,s,n,c).then(i=>i(a,o))},listNotebooks(e,t,s,n){return r.listNotebooks(e,t,s,n).then(c=>c(a,o))}}};class X extends k{executeNotebookCell(o,a,r,e,t,s,n,c){return v(this.configuration).executeNotebookCell(o,a,r,e,t,s,n,c).then(i=>i(this.axios,this.basePath))}getNotebook(o,a,r,e,t){return v(this.configuration).getNotebook(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}listNotebooks(o,a,r,e){return v(this.configuration).listNotebooks(o,a,r,e).then(t=>t(this.axios,this.basePath))}}const qe={True:"true",False:"false"},Z=function(l){return{createPackage:async(o,a,r,e={})=>{h("createPackage","projectName",o),h("createPackage","_package",a);const t="/projects/{projectName}/packages".replace("{projectName}",encodeURIComponent(String(o))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"POST",...n,...e},i={},p={};r!==void 0&&(p.autoLoadManifest=r),i["Content-Type"]="application/json",O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},c.data=I(a,c,l),{url:b(s),options:c}},deletePackage:async(o,a,r={})=>{h("deletePackage","projectName",o),h("deletePackage","packageName",a);const e="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))),t=new URL(e,V);let s;l&&(s=l.baseOptions);const n={method:"DELETE",...s,...r},c={};O(t,{});let p=s&&s.headers?s.headers:{};return n.headers={...c,...p,...r.headers},{url:b(t),options:n}},getPackage:async(o,a,r,e,t={})=>{h("getPackage","projectName",o),h("getPackage","packageName",a);const s="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))),n=new URL(s,V);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...t},p={},d={};r!==void 0&&(d.versionId=r),e!==void 0&&(d.reload=e),O(n,d);let u=c&&c.headers?c.headers:{};return i.headers={...p,...u,...t.headers},{url:b(n),options:i}},listPackages:async(o,a={})=>{h("listPackages","projectName",o);const r="/projects/{projectName}/packages".replace("{projectName}",encodeURIComponent(String(o))),e=new URL(r,V);let t;l&&(t=l.baseOptions);const s={method:"GET",...t,...a},n={};O(e,{});let i=t&&t.headers?t.headers:{};return s.headers={...n,...i,...a.headers},{url:b(e),options:s}},updatePackage:async(o,a,r,e={})=>{h("updatePackage","projectName",o),h("updatePackage","packageName",a),h("updatePackage","_package",r);const t="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(o))).replace("{packageName}",encodeURIComponent(String(a))),s=new URL(t,V);let n;l&&(n=l.baseOptions);const c={method:"PATCH",...n,...e},i={},p={};i["Content-Type"]="application/json",O(s,p);let d=n&&n.headers?n.headers:{};return c.headers={...i,...d,...e.headers},c.data=I(r,c,l),{url:b(s),options:c}}}},x=function(l){const o=Z(l);return{async createPackage(a,r,e,t){const s=await o.createPackage(a,r,e,t),n=l?.serverIndex??0,c=g["PackagesApi.createPackage"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)},async deletePackage(a,r,e){const t=await o.deletePackage(a,r,e),s=l?.serverIndex??0,n=g["PackagesApi.deletePackage"]?.[s]?.url;return(c,i)=>S(t,m,P,l)(c,n||i)},async getPackage(a,r,e,t,s){const n=await o.getPackage(a,r,e,t,s),c=l?.serverIndex??0,i=g["PackagesApi.getPackage"]?.[c]?.url;return(p,d)=>S(n,m,P,l)(p,i||d)},async listPackages(a,r){const e=await o.listPackages(a,r),t=l?.serverIndex??0,s=g["PackagesApi.listPackages"]?.[t]?.url;return(n,c)=>S(e,m,P,l)(n,s||c)},async updatePackage(a,r,e,t){const s=await o.updatePackage(a,r,e,t),n=l?.serverIndex??0,c=g["PackagesApi.updatePackage"]?.[n]?.url;return(i,p)=>S(s,m,P,l)(i,c||p)}}},$e=function(l,o,a){const r=x(l);return{createPackage(e,t,s,n){return r.createPackage(e,t,s,n).then(c=>c(a,o))},deletePackage(e,t,s){return r.deletePackage(e,t,s).then(n=>n(a,o))},getPackage(e,t,s,n,c){return r.getPackage(e,t,s,n,c).then(i=>i(a,o))},listPackages(e,t){return r.listPackages(e,t).then(s=>s(a,o))},updatePackage(e,t,s,n){return r.updatePackage(e,t,s,n).then(c=>c(a,o))}}};class ee extends k{createPackage(o,a,r,e){return x(this.configuration).createPackage(o,a,r,e).then(t=>t(this.axios,this.basePath))}deletePackage(o,a,r){return x(this.configuration).deletePackage(o,a,r).then(e=>e(this.axios,this.basePath))}getPackage(o,a,r,e,t){return x(this.configuration).getPackage(o,a,r,e,t).then(s=>s(this.axios,this.basePath))}listPackages(o,a){return x(this.configuration).listPackages(o,a).then(r=>r(this.axios,this.basePath))}updatePackage(o,a,r,e){return x(this.configuration).updatePackage(o,a,r,e).then(t=>t(this.axios,this.basePath))}}const ae=function(l){return{createProject:async(o,a={})=>{h("createProject","project",o);const r="/projects",e=new URL(r,V);let t;l&&(t=l.baseOptions);const s={method:"POST",...t,...a},n={},c={};n["Content-Type"]="application/json",O(e,c);let i=t&&t.headers?t.headers:{};return s.headers={...n,...i,...a.headers},s.data=I(o,s,l),{url:b(e),options:s}},deleteProject:async(o,a={})=>{h("deleteProject","projectName",o);const r="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(o))),e=new URL(r,V);let t;l&&(t=l.baseOptions);const s={method:"DELETE",...t,...a},n={};O(e,{});let i=t&&t.headers?t.headers:{};return s.headers={...n,...i,...a.headers},{url:b(e),options:s}},getProject:async(o,a,r={})=>{h("getProject","projectName",o);const e="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(o))),t=new URL(e,V);let s;l&&(s=l.baseOptions);const n={method:"GET",...s,...r},c={},i={};a!==void 0&&(i.reload=a),O(t,i);let p=s&&s.headers?s.headers:{};return n.headers={...c,...p,...r.headers},{url:b(t),options:n}},listProjects:async(o={})=>{const a="/projects",r=new URL(a,V);let e;l&&(e=l.baseOptions);const t={method:"GET",...e,...o},s={};O(r,{});let c=e&&e.headers?e.headers:{};return t.headers={...s,...c,...o.headers},{url:b(r),options:t}},updateProject:async(o,a,r={})=>{h("updateProject","projectName",o),h("updateProject","project",a);const e="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(o))),t=new URL(e,V);let s;l&&(s=l.baseOptions);const n={method:"PATCH",...s,...r},c={},i={};c["Content-Type"]="application/json",O(t,i);let p=s&&s.headers?s.headers:{};return n.headers={...c,...p,...r.headers},n.data=I(a,n,l),{url:b(t),options:n}}}},N=function(l){const o=ae(l);return{async createProject(a,r){const e=await o.createProject(a,r),t=l?.serverIndex??0,s=g["ProjectsApi.createProject"]?.[t]?.url;return(n,c)=>S(e,m,P,l)(n,s||c)},async deleteProject(a,r){const e=await o.deleteProject(a,r),t=l?.serverIndex??0,s=g["ProjectsApi.deleteProject"]?.[t]?.url;return(n,c)=>S(e,m,P,l)(n,s||c)},async getProject(a,r,e){const t=await o.getProject(a,r,e),s=l?.serverIndex??0,n=g["ProjectsApi.getProject"]?.[s]?.url;return(c,i)=>S(t,m,P,l)(c,n||i)},async listProjects(a){const r=await o.listProjects(a),e=l?.serverIndex??0,t=g["ProjectsApi.listProjects"]?.[e]?.url;return(s,n)=>S(r,m,P,l)(s,t||n)},async updateProject(a,r,e){const t=await o.updateProject(a,r,e),s=l?.serverIndex??0,n=g["ProjectsApi.updateProject"]?.[s]?.url;return(c,i)=>S(t,m,P,l)(c,n||i)}}},Fe=function(l,o,a){const r=N(l);return{createProject(e,t){return r.createProject(e,t).then(s=>s(a,o))},deleteProject(e,t){return r.deleteProject(e,t).then(s=>s(a,o))},getProject(e,t,s){return r.getProject(e,t,s).then(n=>n(a,o))},listProjects(e){return r.listProjects(e).then(t=>t(a,o))},updateProject(e,t,s){return r.updateProject(e,t,s).then(n=>n(a,o))}}};class te extends k{createProject(o,a){return N(this.configuration).createProject(o,a).then(r=>r(this.axios,this.basePath))}deleteProject(o,a){return N(this.configuration).deleteProject(o,a).then(r=>r(this.axios,this.basePath))}getProject(o,a,r){return N(this.configuration).getProject(o,a,r).then(e=>e(this.axios,this.basePath))}listProjects(o){return N(this.configuration).listProjects(o).then(a=>a(this.axios,this.basePath))}updateProject(o,a,r){return N(this.configuration).updateProject(o,a,r).then(e=>e(this.axios,this.basePath))}}const re=function(l){return{getStatus:async(o={})=>{const a="/status",r=new URL(a,V);let e;l&&(e=l.baseOptions);const t={method:"GET",...e,...o},s={};O(r,{});let c=e&&e.headers?e.headers:{};return t.headers={...s,...c,...o.headers},{url:b(r),options:t}}}},B=function(l){const o=re(l);return{async getStatus(a){const r=await o.getStatus(a),e=l?.serverIndex??0,t=g["PublisherApi.getStatus"]?.[e]?.url;return(s,n)=>S(r,m,P,l)(s,t||n)}}},Be=function(l,o,a){const r=B(l);return{getStatus(e){return r.getStatus(e).then(t=>t(a,o))}}};class oe extends k{getStatus(o){return B(this.configuration).getStatus(o).then(a=>a(this.axios,this.basePath))}}const se=function(l){return{getWatchStatus:async(o={})=>{const a="/watch-mode/status",r=new URL(a,V);let e;l&&(e=l.baseOptions);const t={method:"GET",...e,...o},s={};O(r,{});let c=e&&e.headers?e.headers:{};return t.headers={...s,...c,...o.headers},{url:b(r),options:t}},startWatching:async(o,a={})=>{h("startWatching","startWatchRequest",o);const r="/watch-mode/start",e=new URL(r,V);let t;l&&(t=l.baseOptions);const s={method:"POST",...t,...a},n={},c={};n["Content-Type"]="application/json",O(e,c);let i=t&&t.headers?t.headers:{};return s.headers={...n,...i,...a.headers},s.data=I(o,s,l),{url:b(e),options:s}},stopWatching:async(o={})=>{const a="/watch-mode/stop",r=new URL(a,V);let e;l&&(e=l.baseOptions);const t={method:"POST",...e,...o},s={};O(r,{});let c=e&&e.headers?e.headers:{};return t.headers={...s,...c,...o.headers},{url:b(r),options:t}}}},T=function(l){const o=se(l);return{async getWatchStatus(a){const r=await o.getWatchStatus(a),e=l?.serverIndex??0,t=g["WatchModeApi.getWatchStatus"]?.[e]?.url;return(s,n)=>S(r,m,P,l)(s,t||n)},async startWatching(a,r){const e=await o.startWatching(a,r),t=l?.serverIndex??0,s=g["WatchModeApi.startWatching"]?.[t]?.url;return(n,c)=>S(e,m,P,l)(n,s||c)},async stopWatching(a){const r=await o.stopWatching(a),e=l?.serverIndex??0,t=g["WatchModeApi.stopWatching"]?.[e]?.url;return(s,n)=>S(r,m,P,l)(s,t||n)}}},Ee=function(l,o,a){const r=T(l);return{getWatchStatus(e){return r.getWatchStatus(e).then(t=>t(a,o))},startWatching(e,t){return r.startWatching(e,t).then(s=>s(a,o))},stopWatching(e){return r.stopWatching(e).then(t=>t(a,o))}}};class ne extends k{getWatchStatus(o){return T(this.configuration).getWatchStatus(o).then(a=>a(this.axios,this.basePath))}startWatching(o,a){return T(this.configuration).startWatching(o,a).then(r=>r(this.axios,this.basePath))}stopWatching(o){return T(this.configuration).stopWatching(o).then(a=>a(this.axios,this.basePath))}}class ce{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(o={}){this.apiKey=o.apiKey,this.username=o.username,this.password=o.password,this.accessToken=o.accessToken,this.basePath=o.basePath,this.serverIndex=o.serverIndex,this.baseOptions={...o.baseOptions,headers:{...o.baseOptions?.headers}},this.formDataCtor=o.formDataCtor}isJsonMime(o){const a=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return o!==null&&(a.test(o)||o.toLowerCase()==="application/json-patch+json")}}const le=new z.QueryClient({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}});m.defaults.baseURL||(m.defaults.baseURL="IfYouAreSeeingThis_baseURL_IsNotSet");const ie=R.createContext(void 0),ze=(l,o)=>{const a=`${window.location.protocol}//${window.location.host}/api/v0`,r=m.create({baseURL:l||a,withCredentials:!0,timeout:6e5});r.interceptors.request.use(async t=>{const s=await o?.();return t.headers.Authorization=s||"",t});const e=new ce({basePath:a});return{models:new K(e,a,r),publisher:new oe(e,a,r),projects:new te(e,a,r),packages:new ee(e,a,r),notebooks:new X(e,a,r),connections:new H(e,a,r),databases:new W(e,a,r),watchMode:new ne(e,a,r)}},Le=({children:l,getAccessToken:o,baseURL:a,mutable:r})=>{const e=R.useMemo(()=>ze(a,o),[a,o]),t=a||`${window.location.protocol}//${window.location.host}/api/v0`,[s,n]=R.useState(r),[c,i]=R.useState(!0);R.useEffect(()=>{let d=!0;return(async()=>{try{const A=await e.publisher.getStatus();if(d){const Q=A.data?.frozenConfig;let M;Q?M=!1:r===void 0?M=!0:M=r,n(M),i(!1)}}catch(A){console.error("Failed to fetch publisher status:",A),d&&(n(r),i(!1))}})(),()=>{d=!1}},[e,r]);const p={server:t,getAccessToken:o,apiClients:e,mutable:s,isLoadingStatus:c};return E.jsx(z.QueryClientProvider,{client:le,children:E.jsx(ie.Provider,{value:p,children:l})})},He=()=>{const l=R.useContext(ie);if(l===void 0)throw new Error("useServer must be used within a ServerProvider");return l};exports.AttachedDatabaseTypeEnum=de;exports.AzureConnectionAuthTypeEnum=he;exports.CompileProblemSeverityEnum=me;exports.CompileResultStatusEnum=ue;exports.Configuration=ce;exports.ConnectionStatusStatusEnum=ge;exports.ConnectionTypeEnum=Pe;exports.ConnectionsApi=H;exports.ConnectionsApiAxiosParamCreator=L;exports.ConnectionsApiFactory=ke;exports.ConnectionsApiFp=y;exports.ConnectionsTestApi=je;exports.ConnectionsTestApiAxiosParamCreator=f;exports.ConnectionsTestApiFactory=Ce;exports.ConnectionsTestApiFp=$;exports.DatabaseTypeEnum=Ve;exports.DatabasesApi=W;exports.DatabasesApiAxiosParamCreator=D;exports.DatabasesApiFactory=xe;exports.DatabasesApiFp=F;exports.ExecuteNotebookCellBypassFiltersEnum=qe;exports.FilterTypeEnum=Oe;exports.LogMessageSeverityEnum=be;exports.ManifestActionActionEnum=Ue;exports.ManifestsApi=Re;exports.ManifestsApiAxiosParamCreator=G;exports.ManifestsApiFactory=Ne;exports.ManifestsApiFp=w;exports.MaterializationActionActionEnum=Me;exports.MaterializationStatusEnum=Se;exports.MaterializationsApi=Te;exports.MaterializationsApiAxiosParamCreator=_;exports.MaterializationsApiFactory=ve;exports.MaterializationsApiFp=j;exports.ModelsApi=K;exports.ModelsApiAxiosParamCreator=J;exports.ModelsApiFactory=we;exports.ModelsApiFp=U;exports.NotebookCellResultTypeEnum=Ie;exports.NotebookCellTypeEnum=ye;exports.NotebooksApi=X;exports.NotebooksApiAxiosParamCreator=Y;exports.NotebooksApiFactory=Qe;exports.NotebooksApiFp=v;exports.PackagesApi=ee;exports.PackagesApiAxiosParamCreator=Z;exports.PackagesApiFactory=$e;exports.PackagesApiFp=x;exports.ProjectsApi=te;exports.ProjectsApiAxiosParamCreator=ae;exports.ProjectsApiFactory=Fe;exports.ProjectsApiFp=N;exports.PublisherApi=oe;exports.PublisherApiAxiosParamCreator=re;exports.PublisherApiFactory=Be;exports.PublisherApiFp=B;exports.ServerProvider=Le;exports.ServerStatusOperationalStateEnum=Ae;exports.WatchModeApi=ne;exports.WatchModeApiAxiosParamCreator=se;exports.WatchModeApiFactory=Ee;exports.WatchModeApiFp=T;exports.globalQueryClient=le;exports.useServer=He;
@@ -58,6 +58,7 @@ const O = function(l, ...o) {
58
58
  Bigquery: "bigquery",
59
59
  Snowflake: "snowflake",
60
60
  Trino: "trino",
61
+ Databricks: "databricks",
61
62
  Mysql: "mysql",
62
63
  Duckdb: "duckdb",
63
64
  Motherduck: "motherduck",
@@ -422,6 +422,12 @@ export interface Connection {
422
422
  * @memberof Connection
423
423
  */
424
424
  'trinoConnection'?: TrinoConnection;
425
+ /**
426
+ *
427
+ * @type {DatabricksConnection}
428
+ * @memberof Connection
429
+ */
430
+ 'databricksConnection'?: DatabricksConnection;
425
431
  /**
426
432
  *
427
433
  * @type {MysqlConnection}
@@ -452,6 +458,7 @@ export declare const ConnectionTypeEnum: {
452
458
  readonly Bigquery: "bigquery";
453
459
  readonly Snowflake: "snowflake";
454
460
  readonly Trino: "trino";
461
+ readonly Databricks: "databricks";
455
462
  readonly Mysql: "mysql";
456
463
  readonly Duckdb: "duckdb";
457
464
  readonly Motherduck: "motherduck";
@@ -594,6 +601,61 @@ export declare const DatabaseTypeEnum: {
594
601
  readonly Materialized: "materialized";
595
602
  };
596
603
  export type DatabaseTypeEnum = typeof DatabaseTypeEnum[keyof typeof DatabaseTypeEnum];
604
+ /**
605
+ * Databricks SQL warehouse connection configuration
606
+ * @export
607
+ * @interface DatabricksConnection
608
+ */
609
+ export interface DatabricksConnection {
610
+ /**
611
+ * Databricks workspace host (e.g. dbc-xxxxxxxx-xxxx.cloud.databricks.com)
612
+ * @type {string}
613
+ * @memberof DatabricksConnection
614
+ */
615
+ 'host'?: string;
616
+ /**
617
+ * SQL warehouse HTTP path (e.g. /sql/1.0/warehouses/<warehouse-id>)
618
+ * @type {string}
619
+ * @memberof DatabricksConnection
620
+ */
621
+ 'path'?: string;
622
+ /**
623
+ * Personal access token for authentication
624
+ * @type {string}
625
+ * @memberof DatabricksConnection
626
+ */
627
+ 'token'?: string;
628
+ /**
629
+ * OAuth M2M client ID (service principal)
630
+ * @type {string}
631
+ * @memberof DatabricksConnection
632
+ */
633
+ 'oauthClientId'?: string;
634
+ /**
635
+ * OAuth M2M client secret (service principal)
636
+ * @type {string}
637
+ * @memberof DatabricksConnection
638
+ */
639
+ 'oauthClientSecret'?: string;
640
+ /**
641
+ * Default Unity Catalog to use for queries
642
+ * @type {string}
643
+ * @memberof DatabricksConnection
644
+ */
645
+ 'defaultCatalog'?: string;
646
+ /**
647
+ * Default schema to use for queries
648
+ * @type {string}
649
+ * @memberof DatabricksConnection
650
+ */
651
+ 'defaultSchema'?: string;
652
+ /**
653
+ * SQL statements to run when the connection is established
654
+ * @type {string}
655
+ * @memberof DatabricksConnection
656
+ */
657
+ 'setupSQL'?: string;
658
+ }
597
659
  /**
598
660
  * DuckDB database connection configuration. Publisher intentionally exposes only data-source intent here. Database files, working directories, filesystem/network policy, extension loading, setup SQL, temp directories, and resource knobs are owned by Publisher so project configs cannot widen deployment policy through low-level DuckDB settings.
599
661
  * @export
@@ -1882,6 +1944,12 @@ export interface UpdateConnectionRequest {
1882
1944
  * @memberof UpdateConnectionRequest
1883
1945
  */
1884
1946
  'trinoConnection'?: TrinoConnection;
1947
+ /**
1948
+ *
1949
+ * @type {DatabricksConnection}
1950
+ * @memberof UpdateConnectionRequest
1951
+ */
1952
+ 'databricksConnection'?: DatabricksConnection;
1885
1953
  /**
1886
1954
  *
1887
1955
  * @type {DucklakeConnection}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../ServerProvider-COmUCxyH.cjs.js");exports.AttachedDatabaseTypeEnum=e.AttachedDatabaseTypeEnum;exports.AzureConnectionAuthTypeEnum=e.AzureConnectionAuthTypeEnum;exports.CompileProblemSeverityEnum=e.CompileProblemSeverityEnum;exports.CompileResultStatusEnum=e.CompileResultStatusEnum;exports.Configuration=e.Configuration;exports.ConnectionStatusStatusEnum=e.ConnectionStatusStatusEnum;exports.ConnectionTypeEnum=e.ConnectionTypeEnum;exports.ConnectionsApi=e.ConnectionsApi;exports.ConnectionsApiAxiosParamCreator=e.ConnectionsApiAxiosParamCreator;exports.ConnectionsApiFactory=e.ConnectionsApiFactory;exports.ConnectionsApiFp=e.ConnectionsApiFp;exports.ConnectionsTestApi=e.ConnectionsTestApi;exports.ConnectionsTestApiAxiosParamCreator=e.ConnectionsTestApiAxiosParamCreator;exports.ConnectionsTestApiFactory=e.ConnectionsTestApiFactory;exports.ConnectionsTestApiFp=e.ConnectionsTestApiFp;exports.DatabaseTypeEnum=e.DatabaseTypeEnum;exports.DatabasesApi=e.DatabasesApi;exports.DatabasesApiAxiosParamCreator=e.DatabasesApiAxiosParamCreator;exports.DatabasesApiFactory=e.DatabasesApiFactory;exports.DatabasesApiFp=e.DatabasesApiFp;exports.ExecuteNotebookCellBypassFiltersEnum=e.ExecuteNotebookCellBypassFiltersEnum;exports.FilterTypeEnum=e.FilterTypeEnum;exports.LogMessageSeverityEnum=e.LogMessageSeverityEnum;exports.ManifestActionActionEnum=e.ManifestActionActionEnum;exports.ManifestsApi=e.ManifestsApi;exports.ManifestsApiAxiosParamCreator=e.ManifestsApiAxiosParamCreator;exports.ManifestsApiFactory=e.ManifestsApiFactory;exports.ManifestsApiFp=e.ManifestsApiFp;exports.MaterializationActionActionEnum=e.MaterializationActionActionEnum;exports.MaterializationStatusEnum=e.MaterializationStatusEnum;exports.MaterializationsApi=e.MaterializationsApi;exports.MaterializationsApiAxiosParamCreator=e.MaterializationsApiAxiosParamCreator;exports.MaterializationsApiFactory=e.MaterializationsApiFactory;exports.MaterializationsApiFp=e.MaterializationsApiFp;exports.ModelsApi=e.ModelsApi;exports.ModelsApiAxiosParamCreator=e.ModelsApiAxiosParamCreator;exports.ModelsApiFactory=e.ModelsApiFactory;exports.ModelsApiFp=e.ModelsApiFp;exports.NotebookCellResultTypeEnum=e.NotebookCellResultTypeEnum;exports.NotebookCellTypeEnum=e.NotebookCellTypeEnum;exports.NotebooksApi=e.NotebooksApi;exports.NotebooksApiAxiosParamCreator=e.NotebooksApiAxiosParamCreator;exports.NotebooksApiFactory=e.NotebooksApiFactory;exports.NotebooksApiFp=e.NotebooksApiFp;exports.PackagesApi=e.PackagesApi;exports.PackagesApiAxiosParamCreator=e.PackagesApiAxiosParamCreator;exports.PackagesApiFactory=e.PackagesApiFactory;exports.PackagesApiFp=e.PackagesApiFp;exports.ProjectsApi=e.ProjectsApi;exports.ProjectsApiAxiosParamCreator=e.ProjectsApiAxiosParamCreator;exports.ProjectsApiFactory=e.ProjectsApiFactory;exports.ProjectsApiFp=e.ProjectsApiFp;exports.PublisherApi=e.PublisherApi;exports.PublisherApiAxiosParamCreator=e.PublisherApiAxiosParamCreator;exports.PublisherApiFactory=e.PublisherApiFactory;exports.PublisherApiFp=e.PublisherApiFp;exports.ServerProvider=e.ServerProvider;exports.ServerStatusOperationalStateEnum=e.ServerStatusOperationalStateEnum;exports.WatchModeApi=e.WatchModeApi;exports.WatchModeApiAxiosParamCreator=e.WatchModeApiAxiosParamCreator;exports.WatchModeApiFactory=e.WatchModeApiFactory;exports.WatchModeApiFp=e.WatchModeApiFp;exports.globalQueryClient=e.globalQueryClient;exports.useServer=e.useServer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../ServerProvider-BMsmCksc.cjs.js");exports.AttachedDatabaseTypeEnum=e.AttachedDatabaseTypeEnum;exports.AzureConnectionAuthTypeEnum=e.AzureConnectionAuthTypeEnum;exports.CompileProblemSeverityEnum=e.CompileProblemSeverityEnum;exports.CompileResultStatusEnum=e.CompileResultStatusEnum;exports.Configuration=e.Configuration;exports.ConnectionStatusStatusEnum=e.ConnectionStatusStatusEnum;exports.ConnectionTypeEnum=e.ConnectionTypeEnum;exports.ConnectionsApi=e.ConnectionsApi;exports.ConnectionsApiAxiosParamCreator=e.ConnectionsApiAxiosParamCreator;exports.ConnectionsApiFactory=e.ConnectionsApiFactory;exports.ConnectionsApiFp=e.ConnectionsApiFp;exports.ConnectionsTestApi=e.ConnectionsTestApi;exports.ConnectionsTestApiAxiosParamCreator=e.ConnectionsTestApiAxiosParamCreator;exports.ConnectionsTestApiFactory=e.ConnectionsTestApiFactory;exports.ConnectionsTestApiFp=e.ConnectionsTestApiFp;exports.DatabaseTypeEnum=e.DatabaseTypeEnum;exports.DatabasesApi=e.DatabasesApi;exports.DatabasesApiAxiosParamCreator=e.DatabasesApiAxiosParamCreator;exports.DatabasesApiFactory=e.DatabasesApiFactory;exports.DatabasesApiFp=e.DatabasesApiFp;exports.ExecuteNotebookCellBypassFiltersEnum=e.ExecuteNotebookCellBypassFiltersEnum;exports.FilterTypeEnum=e.FilterTypeEnum;exports.LogMessageSeverityEnum=e.LogMessageSeverityEnum;exports.ManifestActionActionEnum=e.ManifestActionActionEnum;exports.ManifestsApi=e.ManifestsApi;exports.ManifestsApiAxiosParamCreator=e.ManifestsApiAxiosParamCreator;exports.ManifestsApiFactory=e.ManifestsApiFactory;exports.ManifestsApiFp=e.ManifestsApiFp;exports.MaterializationActionActionEnum=e.MaterializationActionActionEnum;exports.MaterializationStatusEnum=e.MaterializationStatusEnum;exports.MaterializationsApi=e.MaterializationsApi;exports.MaterializationsApiAxiosParamCreator=e.MaterializationsApiAxiosParamCreator;exports.MaterializationsApiFactory=e.MaterializationsApiFactory;exports.MaterializationsApiFp=e.MaterializationsApiFp;exports.ModelsApi=e.ModelsApi;exports.ModelsApiAxiosParamCreator=e.ModelsApiAxiosParamCreator;exports.ModelsApiFactory=e.ModelsApiFactory;exports.ModelsApiFp=e.ModelsApiFp;exports.NotebookCellResultTypeEnum=e.NotebookCellResultTypeEnum;exports.NotebookCellTypeEnum=e.NotebookCellTypeEnum;exports.NotebooksApi=e.NotebooksApi;exports.NotebooksApiAxiosParamCreator=e.NotebooksApiAxiosParamCreator;exports.NotebooksApiFactory=e.NotebooksApiFactory;exports.NotebooksApiFp=e.NotebooksApiFp;exports.PackagesApi=e.PackagesApi;exports.PackagesApiAxiosParamCreator=e.PackagesApiAxiosParamCreator;exports.PackagesApiFactory=e.PackagesApiFactory;exports.PackagesApiFp=e.PackagesApiFp;exports.ProjectsApi=e.ProjectsApi;exports.ProjectsApiAxiosParamCreator=e.ProjectsApiAxiosParamCreator;exports.ProjectsApiFactory=e.ProjectsApiFactory;exports.ProjectsApiFp=e.ProjectsApiFp;exports.PublisherApi=e.PublisherApi;exports.PublisherApiAxiosParamCreator=e.PublisherApiAxiosParamCreator;exports.PublisherApiFactory=e.PublisherApiFactory;exports.PublisherApiFp=e.PublisherApiFp;exports.ServerProvider=e.ServerProvider;exports.ServerStatusOperationalStateEnum=e.ServerStatusOperationalStateEnum;exports.WatchModeApi=e.WatchModeApi;exports.WatchModeApiAxiosParamCreator=e.WatchModeApiAxiosParamCreator;exports.WatchModeApiFactory=e.WatchModeApiFactory;exports.WatchModeApiFp=e.WatchModeApiFp;exports.globalQueryClient=e.globalQueryClient;exports.useServer=e.useServer;
@@ -1,4 +1,4 @@
1
- import { A as e, a as o, C as i, b as t, a9 as r, d as n, c as p, k as A, h as c, j as u, i as l, o as m, l as C, n as P, m as F, D as y, s as M, p as b, r as E, q as x, U as k, F as S, L as T, y as d, x as h, t as g, w as f, v as z, H as N, M as v, G as D, z as j, E as W, B as R, O as B, I as L, K as O, J as Q, e as q, N as w, T as G, P as H, R as I, Q as J, Y as K, V as U, X as V, W as X, a0 as Y, Z, $ as _, _ as $, a4 as aa, a1 as sa, a3 as ea, a2 as oa, S as ia, f as ta, a8 as ra, a5 as na, a7 as pa, a6 as Aa, g as ca, u as ua } from "../ServerProvider-BtpADppi.es.js";
1
+ import { A as e, a as o, C as i, b as t, a9 as r, d as n, c as p, k as A, h as c, j as u, i as l, o as m, l as C, n as P, m as F, D as y, s as M, p as b, r as E, q as x, U as k, F as S, L as T, y as d, x as h, t as g, w as f, v as z, H as N, M as v, G as D, z as j, E as W, B as R, O as B, I as L, K as O, J as Q, e as q, N as w, T as G, P as H, R as I, Q as J, Y as K, V as U, X as V, W as X, a0 as Y, Z, $ as _, _ as $, a4 as aa, a1 as sa, a3 as ea, a2 as oa, S as ia, f as ta, a8 as ra, a5 as na, a7 as pa, a6 as Aa, g as ca, u as ua } from "../ServerProvider-CvZTC0sJ.es.js";
2
2
  export {
3
3
  e as AttachedDatabaseTypeEnum,
4
4
  o as AzureConnectionAuthTypeEnum,
@@ -1,8 +1,8 @@
1
1
  import { HTMLInputTypeAttribute } from 'react';
2
- import { AzureConnection, BigqueryConnection, ConnectionTypeEnum, DucklakeConnection, GCSConnection, MotherDuckConnection, MysqlConnection, PostgresConnection, S3Connection, SnowflakeConnection, TrinoConnection } from '../../client/api';
2
+ import { AzureConnection, BigqueryConnection, ConnectionTypeEnum, DatabricksConnection, DucklakeConnection, GCSConnection, MotherDuckConnection, MysqlConnection, PostgresConnection, S3Connection, SnowflakeConnection, TrinoConnection } from '../../client/api';
3
3
  type ConnectionField = {
4
4
  label: string;
5
- name: keyof (PostgresConnection & BigqueryConnection & SnowflakeConnection & TrinoConnection & MysqlConnection & MotherDuckConnection & S3Connection & GCSConnection & AzureConnection & DucklakeConnection);
5
+ name: keyof (PostgresConnection & BigqueryConnection & SnowflakeConnection & TrinoConnection & DatabricksConnection & MysqlConnection & MotherDuckConnection & S3Connection & GCSConnection & AzureConnection & DucklakeConnection);
6
6
  type: HTMLInputTypeAttribute;
7
7
  required?: boolean;
8
8
  selectOptions?: Array<{
@@ -1,5 +1,5 @@
1
1
  import { createOnigurumaEngine as vt, getDefaultWasmLoader as Pr, loadWasm as Or } from "./engine-oniguruma-C4vnmooL.es.js";
2
- import { w as At, s as wn, f as Mr, a as Fr, b as Br, c as Dt, z as jr, h as Dr, d as Ur } from "./index-CS_MvsQX.es.js";
2
+ import { w as At, s as wn, f as Mr, a as Fr, b as Br, c as Dt, z as jr, h as Dr, d as Ur } from "./index-ClRkROAM.es.js";
3
3
  let V = class extends Error {
4
4
  constructor(e) {
5
5
  super(e), this.name = "ShikiError";
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const me=require("./engine-oniguruma-BkproSVE.cjs.js"),P=require("./index-Bf_GJ4xh.cjs.js");let q=class extends Error{constructor(e){super(e),this.name="ShikiError"}},$e=!1,In=!1;function zr(t=!0,e=!1){$e=t,In=e}function B(t,e=3){if($e&&!(typeof $e=="number"&&e>$e)){if(In)throw new Error(`[SHIKI DEPRECATE]: ${t}`);console.trace(`[SHIKI DEPRECATE]: ${t}`)}}function Vr(t){return Tt(t)}function Tt(t){return Array.isArray(t)?Kr(t):t instanceof RegExp?t:typeof t=="object"?Qr(t):t}function Kr(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=Tt(t[n]);return e}function Qr(t){let e={};for(let n in t)e[n]=Tt(t[n]);return e}function Nn(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function xn(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?xn(t.substring(0,t.length-1)):t.substr(~e+1)}var st=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Re=class{static hasCaptures(t){return t===null?!1:(st.lastIndex=0,st.test(t))}static replaceCaptures(t,e,n){return t.replace(st,(r,s,a,i)=>{let o=n[parseInt(s||a,10)];if(o){let c=e.substring(o.start,o.end);for(;c[0]===".";)c=c.substring(1);switch(i){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return r})}};function Tn(t,e){return t<e?-1:t>e?1:0}function $n(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let s=0;s<n;s++){let a=Tn(t[s],e[s]);if(a!==0)return a}return 0}return n-r}function Qt(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Gn(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Ln=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Oe=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Zr(t),e)}static createFromParsedTheme(t,e){return es(t,e)}_cachedMatchRoot=new Ln(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(s=>Jr(t.parent,s.parentScopes));return r?new Pn(r.fontStyle,r.foreground,r.background):null}},at=class Ge{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new Ge(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new Ge(n,e[r]);return n}push(e){return new Ge(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function Jr(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],s=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],s=!0}for(;t&&!Xr(t.scopeName,r);){if(s)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Xr(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Pn=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Zr(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let s=0,a=e.length;s<a;s++){let i=e[s];if(!i.settings)continue;let o;if(typeof i.scope=="string"){let h=i.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),o=h.split(",")}else Array.isArray(i.scope)?o=i.scope:o=[""];let c=-1;if(typeof i.settings.fontStyle=="string"){c=0;let h=i.settings.fontStyle.split(" ");for(let g=0,f=h.length;g<f;g++)switch(h[g]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof i.settings.foreground=="string"&&Qt(i.settings.foreground)&&(l=i.settings.foreground);let u=null;typeof i.settings.background=="string"&&Qt(i.settings.background)&&(u=i.settings.background);for(let h=0,g=o.length;h<g;h++){let p=o[h].trim().split(" "),b=p[p.length-1],m=null;p.length>1&&(m=p.slice(0,p.length-1),m.reverse()),n[r++]=new Yr(b,m,s,c,l,u)}}return n}var Yr=class{constructor(t,e,n,r,s,a){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=a}},H=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(H||{});function es(t,e){t.sort((c,l)=>{let u=Tn(c.scope,l.scope);return u!==0||(u=$n(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,r="#000000",s="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(r=c.foreground),c.background!==null&&(s=c.background)}let a=new ts(e),i=new Pn(n,a.getId(r),a.getId(s)),o=new rs(new Ct(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];o.insert(0,u.scope,u.parentScopes,u.fontStyle,a.getId(u.foreground),a.getId(u.background))}return new Oe(a,i,o)}var ts=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},ns=Object.freeze([]),Ct=class On{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,s,a){this.scopeDepth=e,this.parentScopes=n||ns,this.fontStyle=r,this.foreground=s,this.background=a}clone(){return new On(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,s=e.length;r<s;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},rs=class _t{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=n.parentScopes.length);){const a=n.parentScopes[s].length-e.parentScopes[r].length;if(a!==0)return a;r++,s++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,a;if(r===-1?(s=e,a=""):(s=e.substring(0,r),a=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(a)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(_t._cmpBySpecificity),n}insert(e,n,r,s,a,i){if(n===""){this._doInsertHere(e,r,s,a,i);return}let o=n.indexOf("."),c,l;o===-1?(c=n,l=""):(c=n.substring(0,o),l=n.substring(o+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new _t(this._mainRule.clone(),Ct.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(e+1,l,r,s,a,i)}_doInsertHere(e,n,r,s,a){if(n===null){this._mainRule.acceptOverwrite(e,r,s,a);return}for(let i=0,o=this._rulesWithParentScopes.length;i<o;i++){let c=this._rulesWithParentScopes[i];if($n(c.parentScopes,n)===0){c.acceptOverwrite(e,r,s,a);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),a===0&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new Ct(e,n,r,s,a))}},ne=class M{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=M.getLanguageId(e),r=M.getTokenType(e),s=M.getFontStyle(e),a=M.getForeground(e),i=M.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:a,background:i})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,s,a,i,o){let c=M.getLanguageId(e),l=M.getTokenType(e),u=M.containsBalancedBrackets(e)?1:0,h=M.getFontStyle(e),g=M.getForeground(e),f=M.getBackground(e);return n!==0&&(c=n),r!==8&&(l=r),s!==null&&(u=s?1:0),a!==-1&&(h=a),i!==0&&(g=i),o!==0&&(f=o),(c<<0|l<<8|u<<10|h<<11|g<<15|f<<24)>>>0}};function Me(t,e){const n=[],r=ss(t);let s=r.next();for(;s!==null;){let c=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=i();if(n.push({matcher:l,priority:c}),s!==",")break;s=r.next()}return n;function a(){if(s==="-"){s=r.next();const c=a();return l=>!!c&&!c(l)}if(s==="("){s=r.next();const c=o();return s===")"&&(s=r.next()),c}if(Jt(s)){const c=[];do c.push(s),s=r.next();while(Jt(s));return l=>e(c,l)}return null}function i(){const c=[];let l=a();for(;l;)c.push(l),l=a();return u=>c.every(h=>h(u))}function o(){const c=[];let l=i();for(;l&&(c.push(l),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");l=i()}return u=>c.some(h=>h(u))}}function Jt(t){return!!t&&!!t.match(/[\w\.:]+/)}function ss(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function Mn(t){typeof t.dispose=="function"&&t.dispose()}var Ce=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},as=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},is=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},os=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ce(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new is;for(const n of t)cs(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof Ce){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function cs(t,e,n,r){const s=n.lookup(t.scopeName);if(!s){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const a=n.lookup(e);t instanceof Ce?Le({baseGrammar:a,selfGrammar:s},r):yt(t.ruleName,{baseGrammar:a,selfGrammar:s,repository:s.repository},r);const i=n.injections(t.scopeName);if(i)for(const o of i)r.add(new Ce(o))}function yt(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];Fe([r],e,n)}}function Le(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Fe(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Fe(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Fe(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?Nn({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&Fe(r.patterns,{...e,repository:s},n);const a=r.include;if(!a)continue;const i=Fn(a);switch(i.kind){case 0:Le({...e,selfGrammar:e.baseGrammar},n);break;case 1:Le(e,n);break;case 2:yt(i.ruleName,{...e,repository:s},n);break;case 3:case 4:const o=i.scopeName===e.selfGrammar.scopeName?e.selfGrammar:i.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(o){const c={baseGrammar:e.baseGrammar,selfGrammar:o,repository:s};i.kind===4?yt(i.ruleName,c,n):Le(c,n)}else i.kind===4?n.add(new as(i.scopeName,i.ruleName)):n.add(new Ce(i.scopeName));break}}}var ls=class{kind=0},us=class{kind=1},hs=class{constructor(t){this.ruleName=t}kind=2},fs=class{constructor(t){this.scopeName=t}kind=3},ps=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Fn(t){if(t==="$base")return new ls;if(t==="$self")return new us;const e=t.indexOf("#");if(e===-1)return new fs(t);if(e===0)return new hs(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new ps(n,r)}}var gs=/\\(\d+)/,Xt=/\\(\d+)/g,ds=-1,Bn=-2;var ke=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=Re.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Re.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${xn(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Re.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Re.replaceCaptures(this._contentName,t,e)}},ms=class extends ke{retokenizeCapturedWithRuleId;constructor(t,e,n,r,s){super(t,e,n,r),this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},Cs=class extends ke{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,null),this._match=new _e(r,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ye,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Zt=class extends ke{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,r),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ye,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},bt=class extends ke{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s,a,i,o,c,l){super(t,e,n,r),this._begin=new _e(s,this.id),this.beginCaptures=a,this._end=new _e(i||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ye;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Be=class extends ke{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,s,a,i,o,c){super(t,e,n,r),this._begin=new _e(s,this.id),this.beginCaptures=a,this.whileCaptures=o,this._while=new _e(i,Bn),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ye;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ye,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"￿"),this._cachedCompiledWhilePatterns}},jn=class T{static createCaptureRule(e,n,r,s,a){return e.registerRule(i=>new ms(n,i,r,s,a))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(s=>{if(e.id=s,e.match)return new Cs(e.$vscodeTextmateLocation,e.id,e.name,e.match,T._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Nn({},r,e.repository));let a=e.patterns;return typeof a>"u"&&e.include&&(a=[{include:e.include}]),new Zt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,T._compilePatterns(a,n,r))}return e.while?new Be(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,T._compileCaptures(e.whileCaptures||e.captures,n,r),T._compilePatterns(e.patterns,n,r)):new bt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,T._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,T._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let s=[];if(e){let a=0;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const o=parseInt(i,10);o>a&&(a=o)}for(let i=0;i<=a;i++)s[i]=null;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const o=parseInt(i,10);let c=0;e[i].patterns&&(c=T.getCompiledRuleId(e[i],n,r)),s[o]=T.createCaptureRule(n,e[i].$vscodeTextmateLocation,e[i].name,e[i].contentName,c)}}return s}static _compilePatterns(e,n,r){let s=[];if(e)for(let a=0,i=e.length;a<i;a++){const o=e[a];let c=-1;if(o.include){const l=Fn(o.include);switch(l.kind){case 0:case 1:c=T.getCompiledRuleId(r[o.include],n,r);break;case 2:let u=r[l.ruleName];u&&(c=T.getCompiledRuleId(u,n,r));break;case 3:case 4:const h=l.scopeName,g=l.kind===4?l.ruleName:null,f=n.getExternalGrammar(h,r);if(f)if(g){let p=f.repository[g];p&&(c=T.getCompiledRuleId(p,n,f.repository))}else c=T.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else c=T.getCompiledRuleId(o,n,r);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof Zt||l instanceof bt||l instanceof Be)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;s.push(c)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},_e=class Dn{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const r=e.length;let s=0,a=[],i=!1;for(let o=0;o<r;o++)if(e.charAt(o)==="\\"&&o+1<r){const l=e.charAt(o+1);l==="z"?(a.push(e.substring(s,o)),a.push("$(?!\\n)(?<!\\n)"),s=o+2):(l==="A"||l==="G")&&(i=!0),o++}this.hasAnchor=i,s===0?this.source=e:(a.push(e.substring(s,r)),this.source=a.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=gs.test(this.source):this.hasBackReferences=!1}clone(){return new Dn(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(s=>e.substring(s.start,s.end));return Xt.lastIndex=0,this.source.replace(Xt,(s,a)=>Gn(r[parseInt(a,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],s=[],a,i,o,c;for(a=0,i=this.source.length;a<i;a++)o=this.source.charAt(a),e[a]=o,n[a]=o,r[a]=o,s[a]=o,o==="\\"&&a+1<i&&(c=this.source.charAt(a+1),c==="A"?(e[a+1]="￿",n[a+1]="￿",r[a+1]="A",s[a+1]="A"):c==="G"?(e[a+1]="￿",n[a+1]="G",r[a+1]="￿",s[a+1]="G"):(e[a+1]=c,n[a+1]=c,r[a+1]=c,s[a+1]=c),a++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ye=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new Yt(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(s=>s.resolveAnchors(e,n));return new Yt(t,r,this._items.map(s=>s.ruleId))}},Yt=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const me=require("./engine-oniguruma-BkproSVE.cjs.js"),P=require("./index-CW09s4Xx.cjs.js");let q=class extends Error{constructor(e){super(e),this.name="ShikiError"}},$e=!1,In=!1;function zr(t=!0,e=!1){$e=t,In=e}function B(t,e=3){if($e&&!(typeof $e=="number"&&e>$e)){if(In)throw new Error(`[SHIKI DEPRECATE]: ${t}`);console.trace(`[SHIKI DEPRECATE]: ${t}`)}}function Vr(t){return Tt(t)}function Tt(t){return Array.isArray(t)?Kr(t):t instanceof RegExp?t:typeof t=="object"?Qr(t):t}function Kr(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=Tt(t[n]);return e}function Qr(t){let e={};for(let n in t)e[n]=Tt(t[n]);return e}function Nn(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function xn(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?xn(t.substring(0,t.length-1)):t.substr(~e+1)}var st=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Re=class{static hasCaptures(t){return t===null?!1:(st.lastIndex=0,st.test(t))}static replaceCaptures(t,e,n){return t.replace(st,(r,s,a,i)=>{let o=n[parseInt(s||a,10)];if(o){let c=e.substring(o.start,o.end);for(;c[0]===".";)c=c.substring(1);switch(i){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return r})}};function Tn(t,e){return t<e?-1:t>e?1:0}function $n(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let s=0;s<n;s++){let a=Tn(t[s],e[s]);if(a!==0)return a}return 0}return n-r}function Qt(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Gn(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Ln=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Oe=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Zr(t),e)}static createFromParsedTheme(t,e){return es(t,e)}_cachedMatchRoot=new Ln(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(s=>Jr(t.parent,s.parentScopes));return r?new Pn(r.fontStyle,r.foreground,r.background):null}},at=class Ge{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new Ge(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new Ge(n,e[r]);return n}push(e){return new Ge(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function Jr(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],s=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],s=!0}for(;t&&!Xr(t.scopeName,r);){if(s)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Xr(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Pn=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Zr(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let s=0,a=e.length;s<a;s++){let i=e[s];if(!i.settings)continue;let o;if(typeof i.scope=="string"){let h=i.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),o=h.split(",")}else Array.isArray(i.scope)?o=i.scope:o=[""];let c=-1;if(typeof i.settings.fontStyle=="string"){c=0;let h=i.settings.fontStyle.split(" ");for(let g=0,f=h.length;g<f;g++)switch(h[g]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof i.settings.foreground=="string"&&Qt(i.settings.foreground)&&(l=i.settings.foreground);let u=null;typeof i.settings.background=="string"&&Qt(i.settings.background)&&(u=i.settings.background);for(let h=0,g=o.length;h<g;h++){let p=o[h].trim().split(" "),b=p[p.length-1],m=null;p.length>1&&(m=p.slice(0,p.length-1),m.reverse()),n[r++]=new Yr(b,m,s,c,l,u)}}return n}var Yr=class{constructor(t,e,n,r,s,a){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=a}},H=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(H||{});function es(t,e){t.sort((c,l)=>{let u=Tn(c.scope,l.scope);return u!==0||(u=$n(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,r="#000000",s="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(r=c.foreground),c.background!==null&&(s=c.background)}let a=new ts(e),i=new Pn(n,a.getId(r),a.getId(s)),o=new rs(new Ct(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];o.insert(0,u.scope,u.parentScopes,u.fontStyle,a.getId(u.foreground),a.getId(u.background))}return new Oe(a,i,o)}var ts=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},ns=Object.freeze([]),Ct=class On{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,s,a){this.scopeDepth=e,this.parentScopes=n||ns,this.fontStyle=r,this.foreground=s,this.background=a}clone(){return new On(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,s=e.length;r<s;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},rs=class _t{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=n.parentScopes.length);){const a=n.parentScopes[s].length-e.parentScopes[r].length;if(a!==0)return a;r++,s++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,a;if(r===-1?(s=e,a=""):(s=e.substring(0,r),a=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(a)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(_t._cmpBySpecificity),n}insert(e,n,r,s,a,i){if(n===""){this._doInsertHere(e,r,s,a,i);return}let o=n.indexOf("."),c,l;o===-1?(c=n,l=""):(c=n.substring(0,o),l=n.substring(o+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new _t(this._mainRule.clone(),Ct.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(e+1,l,r,s,a,i)}_doInsertHere(e,n,r,s,a){if(n===null){this._mainRule.acceptOverwrite(e,r,s,a);return}for(let i=0,o=this._rulesWithParentScopes.length;i<o;i++){let c=this._rulesWithParentScopes[i];if($n(c.parentScopes,n)===0){c.acceptOverwrite(e,r,s,a);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),a===0&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new Ct(e,n,r,s,a))}},ne=class M{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=M.getLanguageId(e),r=M.getTokenType(e),s=M.getFontStyle(e),a=M.getForeground(e),i=M.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:a,background:i})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,s,a,i,o){let c=M.getLanguageId(e),l=M.getTokenType(e),u=M.containsBalancedBrackets(e)?1:0,h=M.getFontStyle(e),g=M.getForeground(e),f=M.getBackground(e);return n!==0&&(c=n),r!==8&&(l=r),s!==null&&(u=s?1:0),a!==-1&&(h=a),i!==0&&(g=i),o!==0&&(f=o),(c<<0|l<<8|u<<10|h<<11|g<<15|f<<24)>>>0}};function Me(t,e){const n=[],r=ss(t);let s=r.next();for(;s!==null;){let c=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=i();if(n.push({matcher:l,priority:c}),s!==",")break;s=r.next()}return n;function a(){if(s==="-"){s=r.next();const c=a();return l=>!!c&&!c(l)}if(s==="("){s=r.next();const c=o();return s===")"&&(s=r.next()),c}if(Jt(s)){const c=[];do c.push(s),s=r.next();while(Jt(s));return l=>e(c,l)}return null}function i(){const c=[];let l=a();for(;l;)c.push(l),l=a();return u=>c.every(h=>h(u))}function o(){const c=[];let l=i();for(;l&&(c.push(l),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");l=i()}return u=>c.some(h=>h(u))}}function Jt(t){return!!t&&!!t.match(/[\w\.:]+/)}function ss(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function Mn(t){typeof t.dispose=="function"&&t.dispose()}var Ce=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},as=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},is=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},os=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ce(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new is;for(const n of t)cs(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof Ce){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function cs(t,e,n,r){const s=n.lookup(t.scopeName);if(!s){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const a=n.lookup(e);t instanceof Ce?Le({baseGrammar:a,selfGrammar:s},r):yt(t.ruleName,{baseGrammar:a,selfGrammar:s,repository:s.repository},r);const i=n.injections(t.scopeName);if(i)for(const o of i)r.add(new Ce(o))}function yt(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];Fe([r],e,n)}}function Le(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Fe(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Fe(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Fe(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?Nn({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&Fe(r.patterns,{...e,repository:s},n);const a=r.include;if(!a)continue;const i=Fn(a);switch(i.kind){case 0:Le({...e,selfGrammar:e.baseGrammar},n);break;case 1:Le(e,n);break;case 2:yt(i.ruleName,{...e,repository:s},n);break;case 3:case 4:const o=i.scopeName===e.selfGrammar.scopeName?e.selfGrammar:i.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(o){const c={baseGrammar:e.baseGrammar,selfGrammar:o,repository:s};i.kind===4?yt(i.ruleName,c,n):Le(c,n)}else i.kind===4?n.add(new as(i.scopeName,i.ruleName)):n.add(new Ce(i.scopeName));break}}}var ls=class{kind=0},us=class{kind=1},hs=class{constructor(t){this.ruleName=t}kind=2},fs=class{constructor(t){this.scopeName=t}kind=3},ps=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Fn(t){if(t==="$base")return new ls;if(t==="$self")return new us;const e=t.indexOf("#");if(e===-1)return new fs(t);if(e===0)return new hs(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new ps(n,r)}}var gs=/\\(\d+)/,Xt=/\\(\d+)/g,ds=-1,Bn=-2;var ke=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=Re.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Re.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${xn(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Re.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Re.replaceCaptures(this._contentName,t,e)}},ms=class extends ke{retokenizeCapturedWithRuleId;constructor(t,e,n,r,s){super(t,e,n,r),this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},Cs=class extends ke{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,null),this._match=new _e(r,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ye,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Zt=class extends ke{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,r),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ye,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},bt=class extends ke{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s,a,i,o,c,l){super(t,e,n,r),this._begin=new _e(s,this.id),this.beginCaptures=a,this._end=new _e(i||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ye;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Be=class extends ke{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,s,a,i,o,c){super(t,e,n,r),this._begin=new _e(s,this.id),this.beginCaptures=a,this.whileCaptures=o,this._while=new _e(i,Bn),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ye;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ye,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"￿"),this._cachedCompiledWhilePatterns}},jn=class T{static createCaptureRule(e,n,r,s,a){return e.registerRule(i=>new ms(n,i,r,s,a))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(s=>{if(e.id=s,e.match)return new Cs(e.$vscodeTextmateLocation,e.id,e.name,e.match,T._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Nn({},r,e.repository));let a=e.patterns;return typeof a>"u"&&e.include&&(a=[{include:e.include}]),new Zt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,T._compilePatterns(a,n,r))}return e.while?new Be(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,T._compileCaptures(e.whileCaptures||e.captures,n,r),T._compilePatterns(e.patterns,n,r)):new bt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,T._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,T._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,T._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let s=[];if(e){let a=0;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const o=parseInt(i,10);o>a&&(a=o)}for(let i=0;i<=a;i++)s[i]=null;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const o=parseInt(i,10);let c=0;e[i].patterns&&(c=T.getCompiledRuleId(e[i],n,r)),s[o]=T.createCaptureRule(n,e[i].$vscodeTextmateLocation,e[i].name,e[i].contentName,c)}}return s}static _compilePatterns(e,n,r){let s=[];if(e)for(let a=0,i=e.length;a<i;a++){const o=e[a];let c=-1;if(o.include){const l=Fn(o.include);switch(l.kind){case 0:case 1:c=T.getCompiledRuleId(r[o.include],n,r);break;case 2:let u=r[l.ruleName];u&&(c=T.getCompiledRuleId(u,n,r));break;case 3:case 4:const h=l.scopeName,g=l.kind===4?l.ruleName:null,f=n.getExternalGrammar(h,r);if(f)if(g){let p=f.repository[g];p&&(c=T.getCompiledRuleId(p,n,f.repository))}else c=T.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else c=T.getCompiledRuleId(o,n,r);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof Zt||l instanceof bt||l instanceof Be)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;s.push(c)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},_e=class Dn{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const r=e.length;let s=0,a=[],i=!1;for(let o=0;o<r;o++)if(e.charAt(o)==="\\"&&o+1<r){const l=e.charAt(o+1);l==="z"?(a.push(e.substring(s,o)),a.push("$(?!\\n)(?<!\\n)"),s=o+2):(l==="A"||l==="G")&&(i=!0),o++}this.hasAnchor=i,s===0?this.source=e:(a.push(e.substring(s,r)),this.source=a.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=gs.test(this.source):this.hasBackReferences=!1}clone(){return new Dn(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(s=>e.substring(s.start,s.end));return Xt.lastIndex=0,this.source.replace(Xt,(s,a)=>Gn(r[parseInt(a,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],s=[],a,i,o,c;for(a=0,i=this.source.length;a<i;a++)o=this.source.charAt(a),e[a]=o,n[a]=o,r[a]=o,s[a]=o,o==="\\"&&a+1<i&&(c=this.source.charAt(a+1),c==="A"?(e[a+1]="￿",n[a+1]="￿",r[a+1]="A",s[a+1]="A"):c==="G"?(e[a+1]="￿",n[a+1]="G",r[a+1]="￿",s[a+1]="G"):(e[a+1]=c,n[a+1]=c,r[a+1]=c,s[a+1]=c),a++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ye=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new Yt(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(s=>s.resolveAnchors(e,n));return new Yt(t,r,this._items.map(s=>s.ruleId))}},Yt=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
2
2
  `)}findNextMatchSync(t,e,n){const r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},it=class{constructor(t,e){this.languageId=t,this.tokenType=e}},_s=class wt{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new it(e,8),this._embeddedLanguagesMatcher=new ys(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?wt._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new it(0,0);_getBasicScopeAttributes=new Ln(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new it(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(wt.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},ys=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>Gn(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}};typeof process<"u"&&process.env.VSCODE_TEXTMATE_DEBUG;var en=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function Un(t,e,n,r,s,a,i,o){const c=e.content.length;let l=!1,u=-1;if(i){const f=bs(t,e,n,r,s,a);s=f.stack,r=f.linePos,n=f.isFirstLine,u=f.anchorPosition}const h=Date.now();for(;!l;){if(o!==0&&Date.now()-h>o)return new en(s,!0);g()}return new en(s,!1);function g(){const f=ws(t,e,n,r,s,u);if(!f){a.produce(s,c),l=!0;return}const p=f.captureIndices,b=f.matchedRuleId,m=p&&p.length>0?p[0].end>r:!1;if(b===ds){const w=s.getRule(t);a.produce(s,p[0].start),s=s.withContentNameScopesList(s.nameScopesList),pe(t,e,n,s,a,w.endCaptures,p),a.produce(s,p[0].end);const C=s;if(s=s.parent,u=C.getAnchorPos(),!m&&C.getEnterPos()===r){s=C,a.produce(s,c),l=!0;return}}else{const w=t.getRule(b);a.produce(s,p[0].start);const C=s,S=w.getName(e.content,p),N=s.contentNameScopesList.pushAttributed(S,t);if(s=s.push(b,r,u,p[0].end===c,null,N,N),w instanceof bt){const A=w;pe(t,e,n,s,a,A.beginCaptures,p),a.produce(s,p[0].end),u=p[0].end;const D=A.getContentName(e.content,p),L=N.pushAttributed(D,t);if(s=s.withContentNameScopesList(L),A.endHasBackReferences&&(s=s.withEndRule(A.getEndWithResolvedBackReferences(e.content,p))),!m&&C.hasSameRuleAs(s)){s=s.pop(),a.produce(s,c),l=!0;return}}else if(w instanceof Be){const A=w;pe(t,e,n,s,a,A.beginCaptures,p),a.produce(s,p[0].end),u=p[0].end;const D=A.getContentName(e.content,p),L=N.pushAttributed(D,t);if(s=s.withContentNameScopesList(L),A.whileHasBackReferences&&(s=s.withEndRule(A.getWhileWithResolvedBackReferences(e.content,p))),!m&&C.hasSameRuleAs(s)){s=s.pop(),a.produce(s,c),l=!0;return}}else if(pe(t,e,n,s,a,w.captures,p),a.produce(s,p[0].end),s=s.pop(),!m){s=s.safePop(),a.produce(s,c),l=!0;return}}p[0].end>r&&(r=p[0].end,n=!1)}}function bs(t,e,n,r,s,a){let i=s.beginRuleCapturedEOL?0:-1;const o=[];for(let c=s;c;c=c.pop()){const l=c.getRule(t);l instanceof Be&&o.push({rule:l,stack:c})}for(let c=o.pop();c;c=o.pop()){const{ruleScanner:l,findOptions:u}=vs(c.rule,t,c.stack.endRule,n,r===i),h=l.findNextMatchSync(e,r,u);if(h){if(h.ruleId!==Bn){s=c.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(a.produce(c.stack,h.captureIndices[0].start),pe(t,e,n,c.stack,a,c.rule.whileCaptures,h.captureIndices),a.produce(c.stack,h.captureIndices[0].end),i=h.captureIndices[0].end,h.captureIndices[0].end>r&&(r=h.captureIndices[0].end,n=!1))}else{s=c.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:i,isFirstLine:n}}function ws(t,e,n,r,s,a){const i=Ss(t,e,n,r,s,a),o=t.getInjections();if(o.length===0)return i;const c=ks(o,t,e,n,r,s,a);if(!c)return i;if(!i)return c;const l=i.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:i}function Ss(t,e,n,r,s,a){const i=s.getRule(t),{ruleScanner:o,findOptions:c}=Wn(i,t,s.endRule,n,r===a),l=o.findNextMatchSync(e,r,c);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function ks(t,e,n,r,s,a,i){let o=Number.MAX_VALUE,c=null,l,u=0;const h=a.contentNameScopesList.getScopeNames();for(let g=0,f=t.length;g<f;g++){const p=t[g];if(!p.matcher(h))continue;const b=e.getRule(p.ruleId),{ruleScanner:m,findOptions:w}=Wn(b,e,null,r,s===i),C=m.findNextMatchSync(n,s,w);if(!C)continue;const S=C.captureIndices[0].start;if(!(S>=o)&&(o=S,c=C.captureIndices,l=C.ruleId,u=p.priority,o===s))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Wn(t,e,n,r,s){return{ruleScanner:t.compileAG(e,n,r,s),findOptions:0}}function vs(t,e,n,r,s){return{ruleScanner:t.compileWhileAG(e,n,r,s),findOptions:0}}function pe(t,e,n,r,s,a,i){if(a.length===0)return;const o=e.content,c=Math.min(a.length,i.length),l=[],u=i[0].end;for(let h=0;h<c;h++){const g=a[h];if(g===null)continue;const f=i[h];if(f.length===0)continue;if(f.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=f.start;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?s.produceFromScopes(l[l.length-1].scopes,f.start):s.produce(r,f.start),g.retokenizeCapturedWithRuleId){const b=g.getName(o,i),m=r.contentNameScopesList.pushAttributed(b,t),w=g.getContentName(o,i),C=m.pushAttributed(w,t),S=r.push(g.retokenizeCapturedWithRuleId,f.start,-1,!1,null,m,C),N=t.createOnigString(o.substring(0,f.end));Un(t,N,n&&f.start===0,f.start,S,s,!1,0),Mn(N);continue}const p=g.getName(o,i);if(p!==null){const m=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(p,t);l.push(new As(m,f.end))}}for(;l.length>0;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var As=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function Es(t,e,n,r,s,a,i,o){return new Is(t,e,n,r,s,a,i,o)}function tn(t,e,n,r,s){const a=Me(e,je),i=jn.getCompiledRuleId(n,r,s.repository);for(const o of a)t.push({debugSelector:e,matcher:o.matcher,ruleId:i,grammar:s,priority:o.priority})}function je(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let s=n;s<e.length;s++)if(Rs(e[s],r))return n=s+1,!0;return!1})}function Rs(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var Is=class{constructor(t,e,n,r,s,a,i,o){if(this._rootScopeName=t,this.balancedBracketSelectors=a,this._onigLib=o,this._basicScopeAttributesProvider=new _s(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=nn(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const c of Object.keys(s)){const l=Me(c,je);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:s[c]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const s=r.injections;if(s)for(let i in s)tn(e,i,s[i],this,r);const a=this._grammarRepository.injections(n);a&&a.forEach(i=>{const o=this.getExternalGrammar(i);if(o){const c=o.injectionSelector;c&&tn(e,c,o,this,o)}})}return e.sort((s,a)=>s.priority-a.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=nn(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=jn.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!e||e===St.NULL){s=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=ne.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),g=this.getRule(this._rootId).getName(null,null);let f;g?f=ge.createRootAndLookUpScopeName(g,h,this):f=ge.createRoot("unknown",h),e=new St(null,this._rootId,-1,-1,!1,null,f,f)}else s=!1,e.reset();t=t+`
3
3
  `;const a=this.createOnigString(t),i=a.content.length,o=new xs(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Un(this,a,s,0,e,o,!0,r);return Mn(a),{lineLength:i,lineTokens:o,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function nn(t,e){return t=Vr(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var ge=class U{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,s=e?.scopePath??null;for(const a of n)s=at.push(s,a.scopeNames),r=new U(r,s,a.encodedTokenAttributes);return r}static createRoot(e,n){return new U(null,new at(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const s=r.getMetadataForScope(e),a=new at(null,e),i=r.themeProvider.themeMatch(a),o=U.mergeAttributes(n,s,i);return new U(null,a,o)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return U.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let s=-1,a=0,i=0;return r!==null&&(s=r.fontStyle,a=r.foregroundId,i=r.backgroundId),ne.set(e,n.languageId,n.tokenType,null,s,a,i)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return U._pushAttributed(this,e,n);const r=e.split(/ /g);let s=this;for(const a of r)s=U._pushAttributed(s,a,n);return s}static _pushAttributed(e,n,r){const s=r.getMetadataForScope(n),a=e.scopePath.push(n),i=r.themeProvider.themeMatch(a),o=U.mergeAttributes(e.tokenAttributes,s,i);return new U(e,a,o)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},St=class ee{constructor(e,n,r,s,a,i,o,c){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=a,this.endRule=i,this.nameScopesList=o,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}_stackElementBrand=void 0;static NULL=new ee(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:ee._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?ge.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){ee._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,s,a,i,o){return new ee(this,e,n,r,s,a,i,o)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new ee(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){const r=ge.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new ee(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,ge.fromExtension(r,n.contentNameScopesList))}},Ns=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Me(n,je).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>Me(n,je).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},xs=class{constructor(t,e,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,s=!1;if(this.balancedBracketSelectors?.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=t?.getScopeNames()??[];for(const i of this._tokenTypeOverrides)i.matcher(a)&&(r=ne.set(r,0,i.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(a))}if(s&&(r=ne.set(r,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},Ts=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,s){if(!this._grammars.has(t)){let a=this._rawGrammars.get(t);if(!a)return null;this._grammars.set(t,Es(t,a,e,n,r,s,this,this._onigLib))}return this._grammars.get(t)}},$s=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Ts(Oe.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(Oe.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,r){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,n,r){return this._loadGrammar(e,n,r.embeddedLanguages,r.tokenTypes,new Ns(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,r,s,a){const i=new os(this._syncRegistry,e);for(;i.Q.length>0;)i.Q.map(o=>this._loadSingleGrammar(o.scopeName)),i.processQueue();return this._grammarForScopeName(e,n,r,s,a)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,s=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,s)}_grammarForScopeName(e,n=0,r=null,s=null,a=null){return this._syncRegistry.grammarForScopeName(e,n,r,s,a)}},kt=St.NULL;const Gs=/["&'<>`]/g,Ls=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ps=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Os=/[|\\{}()[\]^$+*?.]/g,rn=new WeakMap;function Ms(t,e){if(t=t.replace(e.subset?Fs(e.subset):Gs,r),e.subset||e.escapeOnly)return t;return t.replace(Ls,n).replace(Ps,r);function n(s,a,i){return e.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,i.charCodeAt(a+2),e)}function r(s,a,i){return e.format(s.charCodeAt(0),i.charCodeAt(a+1),e)}}function Fs(t){let e=rn.get(t);return e||(e=Bs(t),rn.set(t,e)),e}function Bs(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Os,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const js=/[\dA-Fa-f]/;function Ds(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!js.test(String.fromCharCode(e))?r:r+";"}const Us=/\d/;function Ws(t,e,n){const r="&#"+String(t);return n&&e&&!Us.test(String.fromCharCode(e))?r:r+";"}const Hs=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],ot={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},qs=["cent","copy","divide","gt","lt","not","para","times"],Hn={}.hasOwnProperty,vt={};let Ie;for(Ie in ot)Hn.call(ot,Ie)&&(vt[ot[Ie]]=Ie);const zs=/[^\dA-Za-z]/;function Vs(t,e,n,r){const s=String.fromCharCode(t);if(Hn.call(vt,s)){const a=vt[s],i="&"+a;return n&&Hs.includes(a)&&!qs.includes(a)&&(!r||e&&e!==61&&zs.test(String.fromCharCode(e)))?i:i+";"}return""}function Ks(t,e,n){let r=Ds(t,e,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=Vs(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const a=Ws(t,e,n.omitOptionalSemicolons);a.length<r.length&&(r=a)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function oe(t,e){return Ms(t,Object.assign({format:Ks},e))}const Qs=/^>|^->|<!--|-->|--!>|<!-$/g,Js=[">"],Xs=["<",">"];function Zs(t,e,n,r){return r.settings.bogusComments?"<?"+oe(t.value,Object.assign({},r.settings.characterReferences,{subset:Js}))+">":"<!--"+t.value.replace(Qs,s)+"-->";function s(a){return oe(a,Object.assign({},r.settings.characterReferences,{subset:Xs}))}}function Ys(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}const I=zn(1),qn=zn(-1),ea=[];function zn(t){return e;function e(n,r,s){const a=n?n.children:ea;let i=(r||0)+t,o=a[i];if(!s)for(;o&&P.whitespace(o);)i+=t,o=a[i];return o}}const ta={}.hasOwnProperty;function Vn(t){return e;function e(n,r,s){return ta.call(t,n.tagName)&&t[n.tagName](n,r,s)}}const $t=Vn({body:ra,caption:ct,colgroup:ct,dd:oa,dt:ia,head:ct,html:na,li:aa,optgroup:ca,option:la,p:sa,rp:sn,rt:sn,tbody:ha,td:an,tfoot:fa,th:an,thead:ua,tr:pa});function ct(t,e,n){const r=I(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&P.whitespace(r.value.charAt(0)))}function na(t,e,n){const r=I(n,e);return!r||r.type!=="comment"}function ra(t,e,n){const r=I(n,e);return!r||r.type!=="comment"}function sa(t,e,n){const r=I(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function aa(t,e,n){const r=I(n,e);return!r||r.type==="element"&&r.tagName==="li"}function ia(t,e,n){const r=I(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function oa(t,e,n){const r=I(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function sn(t,e,n){const r=I(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function ca(t,e,n){const r=I(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function la(t,e,n){const r=I(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function ua(t,e,n){const r=I(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function ha(t,e,n){const r=I(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function fa(t,e,n){return!I(n,e)}function pa(t,e,n){const r=I(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function an(t,e,n){const r=I(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const ga=Vn({body:Ca,colgroup:_a,head:ma,html:da,tbody:ya});function da(t){const e=I(t,-1);return!e||e.type!=="comment"}function ma(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function Ca(t){const e=I(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&P.whitespace(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function _a(t,e,n){const r=qn(n,e),s=I(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&$t(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function ya(t,e,n){const r=qn(n,e),s=I(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&$t(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const Ne={name:[[`
4
4
  \f\r &/=>`.split(""),`