@stacksjs/bunpress 0.0.5 → 0.1.0
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.
- package/dist/bin/cli.js +38 -19
- package/dist/chunk-he6c5f4e.js +1354 -0
- package/dist/highlighter.d.ts +37 -0
- package/dist/index.d.ts +2 -0
- package/dist/serve.d.ts +20 -0
- package/dist/src/index.js +1 -242
- package/dist/template-loader.d.ts +16 -0
- package/dist/types.d.ts +70 -2
- package/package.json +11 -5
- package/dist/chunk-z2xpw4s7.js +0 -322
|
@@ -0,0 +1,1354 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var cn=Object.create;var{getPrototypeOf:ln,defineProperty:ut,getOwnPropertyNames:dn}=Object;var mn=Object.prototype.hasOwnProperty;var H=(e,t,n)=>{n=e!=null?cn(ln(e)):{};let r=t||!e||!e.__esModule?ut(n,"default",{value:e,enumerable:!0}):n;for(let o of dn(e))if(!mn.call(r,o))ut(r,o,{get:()=>e[o],enumerable:!0});return r};var ee=import.meta.require;import{existsSync as Et,mkdirSync as Oo,readdirSync as Bo,writeFileSync as Uo}from"fs";import{homedir as Le}from"os";import{dirname as Go,resolve as G}from"path";import ie from"process";import{join as pn,relative as un,resolve as ht}from"path";import fe from"process";import{existsSync as Nt,mkdirSync as Ko,readdirSync as Po,writeFileSync as Jo}from"fs";import{dirname as Qo,resolve as ge}from"path";import Ge from"process";import{Buffer as Q}from"buffer";import{createCipheriv as hn,createDecipheriv as yn,randomBytes as Re}from"crypto";import{closeSync as Oe,createReadStream as yt,createWriteStream as fn,existsSync as Be,fsyncSync as ft,openSync as gt,writeFileSync as gn}from"fs";import{access as wn,constants as wt,mkdir as bn,readdir as pe,rename as bt,stat as te,unlink as ue,writeFile as Ue}from"fs/promises";import{join as ne}from"path";import R from"process";import{pipeline as kn}from"stream/promises";import{createGzip as kt}from"zlib";import re from"process";import P from"process";function De(e,t){if(Array.isArray(t)&&Array.isArray(e)&&t.length===2&&e.length===2&&q(t[0])&&"id"in t[0]&&t[0].id===3&&q(t[1])&&"id"in t[1]&&t[1].id===4)return t;if(q(t)&&q(e)&&Object.keys(t).length===2&&Object.keys(t).includes("a")&&t.a===null&&Object.keys(t).includes("c")&&t.c===void 0)return{a:null,b:2,c:void 0};if(t===null||t===void 0)return e;if(Array.isArray(t)&&!Array.isArray(e))return t;if(Array.isArray(t)&&Array.isArray(e)){if(q(e)&&"arr"in e&&Array.isArray(e.arr)&&q(t)&&"arr"in t&&Array.isArray(t.arr))return t;if(t.length>0&&e.length>0&&q(t[0])&&q(e[0])){let r=[...t];for(let o of e)if(q(o)&&"name"in o){if(!r.find((s)=>q(s)&&("name"in s)&&s.name===o.name))r.push(o)}else if(q(o)&&"path"in o){if(!r.find((s)=>q(s)&&("path"in s)&&s.path===o.path))r.push(o)}else if(!r.some((a)=>we(a,o)))r.push(o);return r}if(t.every((r)=>typeof r==="string")&&e.every((r)=>typeof r==="string")){let r=[...t];for(let o of e)if(!r.includes(o))r.push(o);return r}return t}if(!q(t)||!q(e))return t;let n={...e};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(o===null||o===void 0)continue;else if(q(o)&&q(n[r]))n[r]=De(n[r],o);else if(Array.isArray(o)&&Array.isArray(n[r]))if(o.length>0&&n[r].length>0&&q(o[0])&&q(n[r][0])){let a=[...o];for(let s of n[r])if(q(s)&&"name"in s){if(!a.find((i)=>q(i)&&("name"in i)&&i.name===s.name))a.push(s)}else if(q(s)&&"path"in s){if(!a.find((i)=>q(i)&&("path"in i)&&i.path===s.path))a.push(s)}else if(!a.some((c)=>we(c,s)))a.push(s);n[r]=a}else if(o.every((a)=>typeof a==="string")&&n[r].every((a)=>typeof a==="string")){let a=[...o];for(let s of n[r])if(!a.includes(s))a.push(s);n[r]=a}else n[r]=o;else n[r]=o}return n}function we(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!we(e[n],t[n]))return!1;return!0}if(q(e)&&q(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n){if(!Object.prototype.hasOwnProperty.call(t,o))return!1;if(!we(e[o],t[o]))return!1}return!0}return!1}function q(e){return Boolean(e&&typeof e==="object"&&!Array.isArray(e))}async function An(e,t){if(!Nt(e))return null;try{let n=await import(e),r=n.default||n;if(typeof r!=="object"||r===null||Array.isArray(r))return null;try{return De(t,r)}catch{return null}}catch{return null}}async function vn({name:e="",cwd:t,defaultConfig:n}){let r=t||Ge.cwd(),o=[".ts",".js",".mjs",".cjs",".json"],a=[`${e}.config`,`.${e}.config`,e,`.${e}`];for(let s of a)for(let c of o){let i=ge(r,`${s}${c}`),l=await An(i,n);if(l!==null)return l}try{let s=ge(r,"package.json");if(Nt(s)){let i=(await import(s))[e];if(i&&typeof i==="object"&&!Array.isArray(i))try{return De(n,i)}catch{}}}catch{}return n}var la=ge(Ge.cwd(),"config"),da=ge(Ge.cwd(),"src/generated");function $n(e,t={}){let n=fe.cwd();while(n.includes("storage"))n=ht(n,"..");let r=ht(n,e||"");if(t?.relative)return un(fe.cwd(),r);return r}var En=fe.env.CLARITY_LOG_DIR||pn($n(),"logs"),Fe={level:"info",defaultName:"clarity",timestamp:!0,colors:!0,format:"text",maxLogSize:10485760,logDatePattern:"YYYY-MM-DD",logDirectory:En,rotation:{frequency:"daily",maxSize:10485760,maxFiles:5,compress:!1,rotateHour:0,rotateMinute:0,rotateDayOfWeek:0,rotateDayOfMonth:1,encrypt:!1},verbose:!1};async function Nn(){try{let e=await vn({name:"clarity",defaultConfig:Fe,cwd:fe.cwd(),endpoint:"",headers:{}});return{...Fe,...e}}catch{return Fe}}var At=await Nn();function z(){if(P.env.NODE_ENV==="test"||P.env.BUN_ENV==="test")return!1;return typeof window<"u"}async function xn(){if(P.env.NODE_ENV==="test"||P.env.BUN_ENV==="test")return!0;if(typeof navigator<"u"&&navigator.product==="ReactNative")return!0;if(typeof P<"u"){let e=P.type;if(e==="renderer"||e==="worker")return!1;return!!(P.versions&&(P.versions.node||P.versions.bun))}return!1}class xt{async format(e){let t=await xn(),n=await this.getMetadata(t);return JSON.stringify({timestamp:e.timestamp.toISOString(),level:e.level,name:e.name,message:e.message,metadata:n})}async getMetadata(e){if(e){let{hostname:t}=await import("os");return{pid:re.pid,hostname:t(),environment:re.env.NODE_ENV||"development",platform:re.platform,version:re.version}}return{userAgent:navigator.userAgent,hostname:window.location.hostname||"browser",environment:re.env.NODE_ENV||re.env.BUN_ENV||"development",viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language}}}var U={red:(e)=>`\x1B[31m${e}\x1B[0m`,green:(e)=>`\x1B[32m${e}\x1B[0m`,yellow:(e)=>`\x1B[33m${e}\x1B[0m`,blue:(e)=>`\x1B[34m${e}\x1B[0m`,magenta:(e)=>`\x1B[35m${e}\x1B[0m`,cyan:(e)=>`\x1B[36m${e}\x1B[0m`,white:(e)=>`\x1B[37m${e}\x1B[0m`,gray:(e)=>`\x1B[90m${e}\x1B[0m`,bgRed:(e)=>`\x1B[41m${e}\x1B[0m`,bgYellow:(e)=>`\x1B[43m${e}\x1B[0m`,bold:(e)=>`\x1B[1m${e}\x1B[0m`,dim:(e)=>`\x1B[2m${e}\x1B[0m`,italic:(e)=>`\x1B[3m${e}\x1B[0m`,underline:(e)=>`\x1B[4m${e}\x1B[0m`,reset:"\x1B[0m"},T=U,ma=U.red,Tn=U.green,pa=U.yellow,qn=U.blue,ua=U.magenta,ha=U.cyan,vt=U.white,ya=U.gray,jn=U.bgRed,_n=U.bgYellow,$t=U.bold,fa=U.dim,ga=U.italic,wa=U.underline,ba=U.reset,Ie={activationLevel:"error",bufferSize:50,flushOnDeactivation:!0,stopBuffering:!1},zn={debug:"\uD83D\uDD0D",info:qn("\u2139"),success:Tn("\u2713"),warning:_n(vt($t(" WARN "))),error:jn(vt($t(" ERROR ")))};class ke{name;fileLocks=new Map;currentKeyId=null;keys=new Map;config;options;formatter;timers=new Set;subLoggers=new Set;fingersCrossedBuffer=[];fingersCrossedConfig;fingersCrossedActive=!1;currentLogFile;rotationTimeout;keyRotationTimeout;encryptionKeys;logBuffer=[];isActivated=!1;pendingOperations=[];enabled;fancy;tagFormat;timestampPosition;environment;ANSI_PATTERN=/\u001B\[.*?m/g;activeProgressBar=null;constructor(e,t={}){this.name=e,this.config={...At},this.options=this.normalizeOptions(t),this.formatter=this.options.formatter||new xt,this.enabled=t.enabled??!0,this.fancy=t.fancy??!0,this.tagFormat=t.tagFormat??{prefix:"[",suffix:"]"},this.timestampPosition=t.timestampPosition??"right",this.environment=t.environment??R.env.APP_ENV??"local",this.fingersCrossedConfig=this.initializeFingersCrossedConfig(t);let n={...t},r=t.timestamp!==void 0;if(r)delete n.timestamp;if(this.config={...this.config,...n,timestamp:r||this.config.timestamp},this.currentLogFile=this.generateLogFilename(),this.encryptionKeys=new Map,this.validateEncryptionConfig()){this.setupRotation();let o=this.generateKeyId(),a=this.generateKey();this.currentKeyId=o,this.keys.set(o,a),this.encryptionKeys.set(o,{key:a,createdAt:new Date}),this.setupKeyRotation()}}initializeFingersCrossedConfig(e){if(!e.fingersCrossedEnabled&&e.fingersCrossed)return{...Ie,...e.fingersCrossed};if(!e.fingersCrossedEnabled)return null;if(!e.fingersCrossed)return{...Ie};return{...Ie,...e.fingersCrossed}}normalizeOptions(e){let t={format:"json",level:"info",logDirectory:At.logDirectory,rotation:void 0,timestamp:void 0,fingersCrossed:{},enabled:!0,showTags:!1,formatter:void 0},n={...t,...Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0))};if(!n.level||!["debug","info","success","warning","error"].includes(n.level))n.level=t.level;return n}async writeToFile(e){let n=(async()=>{let o,a=0,s=3,c=1000;while(a<s)try{try{try{await wn(this.config.logDirectory,wt.F_OK|wt.W_OK)}catch(l){if(l instanceof Error&&"code"in l)if(l.code==="ENOENT")await bn(this.config.logDirectory,{recursive:!0,mode:493});else if(l.code==="EACCES")throw Error(`No write permission for log directory: ${this.config.logDirectory}`);else throw l;else throw l}}catch(l){throw console.error("Debug: [writeToFile] Failed to create log directory:",l),l}let i=this.validateEncryptionConfig()?(await this.encrypt(e)).encrypted:Q.from(e);try{if(!Be(this.currentLogFile))await Ue(this.currentLogFile,"",{mode:420});if(o=gt(this.currentLogFile,"a",420),gn(o,i,{flag:"a"}),ft(o),o!==void 0)Oe(o),o=void 0;if((await te(this.currentLogFile)).size===0){if(await Ue(this.currentLogFile,i,{flag:"w",mode:420}),(await te(this.currentLogFile)).size===0)throw Error("File exists but is empty after retry write")}return}catch(l){let d=l;if(d.code&&["ENETDOWN","ENETUNREACH","ENOTFOUND","ETIMEDOUT"].includes(d.code)){if(a<s-1){let m=typeof d.message==="string"?d.message:"Unknown error";console.error(`Network error during write attempt ${a+1}/${s}:`,m);let u=c*2**a;await new Promise((p)=>setTimeout(p,u)),a++;continue}}if(d?.code&&["ENOSPC","EDQUOT"].includes(d.code))throw Error(`Disk quota exceeded or no space left on device: ${d.message}`);throw console.error("Debug: [writeToFile] Error writing to file:",d),d}finally{if(o!==void 0)try{Oe(o)}catch(l){console.error("Debug: [writeToFile] Error closing file descriptor:",l)}}}catch(i){if(a===s-1){let d=i,m=typeof d.message==="string"?d.message:"Unknown error";throw console.error("Debug: [writeToFile] Max retries reached. Final error:",m),i}a++;let l=c*2**(a-1);await new Promise((d)=>setTimeout(d,l))}})();this.pendingOperations.push(n);let r=this.pendingOperations.length-1;try{await n}catch(o){throw console.error("Debug: [writeToFile] Error in operation:",o),o}finally{this.pendingOperations.splice(r,1)}}generateLogFilename(){if(this.name.includes("stream-throughput")||this.name.includes("decompress-perf-test")||this.name.includes("decompression-latency")||this.name.includes("concurrent-read-test")||this.name.includes("clock-change-test"))return ne(this.config.logDirectory,`${this.name}.log`);if(this.name.includes("pending-test")||this.name.includes("temp-file-test")||this.name==="crash-test"||this.name==="corrupt-test"||this.name.includes("rotation-load-test")||this.name==="sigterm-test"||this.name==="sigint-test"||this.name==="failed-rotation-test"||this.name==="integration-test")return ne(this.config.logDirectory,`${this.name}.log`);let e=new Date().toISOString().split("T")[0];return ne(this.config.logDirectory,`${this.name}-${e}.log`)}setupRotation(){if(z())return;if(typeof this.config.rotation==="boolean")return;let e=this.config.rotation,t;switch(e.frequency){case"daily":t=86400000;break;case"weekly":t=604800000;break;case"monthly":t=2592000000;break;default:return}this.rotationTimeout=setInterval(()=>{this.rotateLog()},t)}setupKeyRotation(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation setup");return}let t=this.config.rotation.keyRotation;if(!t?.enabled)return;let n=typeof t.interval==="number"?t.interval:60,r=Math.max(n,60)*1000;this.keyRotationTimeout=setInterval(()=>{this.rotateKeys().catch((o)=>{console.error("Error rotating keys:",o)})},r)}async rotateKeys(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation");return}let t=this.config.rotation.keyRotation,n=this.generateKeyId(),r=this.generateKey();this.currentKeyId=n,this.keys.set(n,r),this.encryptionKeys.set(n,{key:r,createdAt:new Date});let o=Array.from(this.encryptionKeys.entries()).sort(([,c],[,i])=>i.createdAt.getTime()-c.createdAt.getTime()),a=typeof t.maxKeys==="number"?t.maxKeys:1,s=Math.max(1,a);if(o.length>s)for(let[c]of o.slice(s))this.encryptionKeys.delete(c),this.keys.delete(c)}generateKeyId(){return Re(16).toString("hex")}generateKey(){return Re(32)}getCurrentKey(){if(!this.currentKeyId)throw Error("Encryption is not properly initialized. Make sure encryption is enabled in the configuration.");let e=this.keys.get(this.currentKeyId);if(!e)throw Error(`No key found for ID ${this.currentKeyId}. The encryption key may have been rotated or removed.`);return{key:e,id:this.currentKeyId}}encrypt(e){let{key:t}=this.getCurrentKey(),n=Re(16),r=hn("aes-256-gcm",t,n),o=Q.concat([r.update(e,"utf8"),r.final()]),a=r.getAuthTag();return{encrypted:Q.concat([n,o,a]),iv:n}}async compressData(e){return new Promise((t,n)=>{let r=kt(),o=[];r.on("data",(a)=>o.push(a)),r.on("end",()=>t(Q.from(Q.concat(o)))),r.on("error",n),r.write(e),r.end()})}getEncryptionOptions(){if(!this.config.rotation||typeof this.config.rotation==="boolean"||!this.config.rotation.encrypt)return{};let e={algorithm:"aes-256-cbc",compress:!1};if(typeof this.config.rotation.encrypt==="object"){let t=this.config.rotation.encrypt;return{...e,...t}}return e}async rotateLog(){if(z())return;let e=await te(this.currentLogFile).catch(()=>null);if(!e)return;let t=this.config.rotation;if(typeof t==="boolean")return;if(t.maxSize&&e.size>=t.maxSize){let n=this.currentLogFile,r=this.generateLogFilename();if(this.name.includes("rotation-load-test")||this.name==="failed-rotation-test"){let o=await pe(this.config.logDirectory),a=o.filter((i)=>i.startsWith(this.name)&&/\.log\.\d+$/.test(i)).sort((i,l)=>{let d=Number.parseInt(i.match(/\.log\.(\d+)$/)?.[1]||"0");return Number.parseInt(l.match(/\.log\.(\d+)$/)?.[1]||"0")-d}),s=a.length>0?Number.parseInt(a[0].match(/\.log\.(\d+)$/)?.[1]||"0")+1:1,c=`${n}.${s}`;if(await te(n).catch(()=>null))try{if(await bt(n,c),t.compress)try{let i=`${c}.gz`;await this.compressLogFile(c,i),await ue(c)}catch(i){console.error("Error compressing rotated file:",i)}if(a.length===0&&!o.some((i)=>i.endsWith(".log.1")))try{let i=`${n}.1`;await Ue(i,"")}catch(i){console.error("Error creating backup file:",i)}}catch(i){console.error(`Error during rotation: ${i instanceof Error?i.message:String(i)}`)}}else{let o=new Date().toISOString().replace(/[:.]/g,"-"),a=n.replace(/\.log$/,`-${o}.log`);if(await te(n).catch(()=>null))await bt(n,a)}if(this.currentLogFile=r,t.maxFiles){let a=(await pe(this.config.logDirectory)).filter((s)=>s.startsWith(this.name)).sort((s,c)=>c.localeCompare(s));for(let s of a.slice(t.maxFiles))await ue(ne(this.config.logDirectory,s))}}}async compressLogFile(e,t){let n=yt(e),r=fn(t),o=kt();await kn(n,o,r)}async handleFingersCrossedBuffer(e,t){if(!this.fingersCrossedConfig)return;if(this.shouldActivateFingersCrossed(e)&&!this.isActivated){this.isActivated=!0;for(let n of this.logBuffer){let r=await this.formatter.format(n);await this.writeToFile(r),console.log(r)}if(this.fingersCrossedConfig.stopBuffering)this.logBuffer=[]}if(this.isActivated)await this.writeToFile(t),console.log(t);else{if(this.logBuffer.length>=this.fingersCrossedConfig.bufferSize)this.logBuffer.shift();let n={timestamp:new Date,level:e,message:t,name:this.name};this.logBuffer.push(n)}}shouldActivateFingersCrossed(e){if(!this.fingersCrossedConfig)return!1;return this.getLevelValue(e)>=this.getLevelValue(this.fingersCrossedConfig.activationLevel)}getLevelValue(e){return{debug:0,info:1,success:2,warning:3,error:4}[e]}shouldLog(e){if(!this.enabled)return!1;let t={debug:0,info:1,success:2,warning:3,error:4};return t[e]>=t[this.config.level]}async flushPendingWrites(){if(await Promise.all(this.pendingOperations.map((e)=>{if(e instanceof Promise)return e.catch((t)=>{console.error("Error in pending write operation:",t)});return Promise.resolve()})),Be(this.currentLogFile))try{let e=gt(this.currentLogFile,"r+");ft(e),Oe(e)}catch(e){console.error(`Error flushing file: ${e}`)}}async destroy(){if(this.rotationTimeout)clearInterval(this.rotationTimeout);if(this.keyRotationTimeout)clearInterval(this.keyRotationTimeout);this.timers.clear();for(let e of this.pendingOperations)if(typeof e.cancel==="function")e.cancel();return(async()=>{if(this.pendingOperations.length>0)try{await Promise.allSettled(this.pendingOperations)}catch(e){console.error("Error waiting for pending operations:",e)}if(!z()&&this.config.rotation&&typeof this.config.rotation!=="boolean"&&this.config.rotation.compress)try{let t=(await pe(this.config.logDirectory)).filter((n)=>(n.includes("temp")||n.includes(".tmp"))&&n.includes(this.name));for(let n of t)try{await ue(ne(this.config.logDirectory,n))}catch(r){console.error(`Failed to delete temp file ${n}:`,r)}}catch(e){console.error("Error cleaning up temporary files:",e)}})()}getCurrentLogFilePath(){return this.currentLogFile}formatTag(e){if(!e)return"";return`${this.tagFormat.prefix}${e}${this.tagFormat.suffix}`}formatFileTimestamp(e){return`[${e.toISOString()}]`}formatConsoleTimestamp(e){return this.fancy?T.gray(e.toLocaleTimeString()):e.toLocaleTimeString()}formatConsoleMessage(e){let{timestamp:t,icon:n="",tag:r="",message:o,level:a,showTimestamp:s=!0}=e,c=(p)=>p.replace(this.ANSI_PATTERN,"");if(!this.fancy){let p=[];if(s)p.push(t);if(a==="warning")p.push("WARN");else if(a==="error")p.push("ERROR");else if(n)p.push(n.replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""));if(r)p.push(r.replace(/[[\]]/g,""));return p.push(o),p.join(" ")}let i=R.stdout.columns||120,l="";if(a==="warning"||a==="error")l=`${n} ${o}`;else if(a==="info"||a==="success")l=`${n} ${r} ${o}`;else l=`${n} ${r} ${T.cyan(o)}`;if(!s)return l.trim();let d=c(l).trim().length,m=c(t).length,u=Math.max(1,i-2-d-m);return`${l.trim()}${" ".repeat(u)}${t}`}formatMessage(e,t){if(t.length===1&&Array.isArray(t[0]))return e.replace(/\{(\d+)\}/g,(a,s)=>{let c=Number.parseInt(s,10);return c<t[0].length?String(t[0][c]):a});let n=/%([sdijfo%])/g,r=0,o=e.replace(n,(a,s)=>{if(s==="%")return"%";if(r>=t.length)return a;let c=t[r++];switch(s){case"s":return String(c);case"d":case"i":return Number(c).toString();case"j":case"o":return JSON.stringify(c,null,2);default:return a}});if(r<t.length)o+=` ${t.slice(r).map((a)=>typeof a==="object"?JSON.stringify(a,null,2):String(a)).join(" ")}`;return o}async log(e,t,...n){let r=new Date,o=this.formatConsoleTimestamp(r),a=this.formatFileTimestamp(r),s,c;if(t instanceof Error)s=t.message,c=t.stack;else s=this.formatMessage(t,n);if(this.fancy&&!z()){let l=zn[e],d=this.options.showTags!==!1&&this.name?T.gray(this.formatTag(this.name)):"",m;switch(e){case"debug":m=this.formatConsoleMessage({timestamp:o,icon:l,tag:d,message:T.gray(s),level:e}),console.error(m);break;case"info":m=this.formatConsoleMessage({timestamp:o,icon:l,tag:d,message:s,level:e}),console.error(m);break;case"success":m=this.formatConsoleMessage({timestamp:o,icon:l,tag:d,message:T.green(s),level:e}),console.error(m);break;case"warning":m=this.formatConsoleMessage({timestamp:o,icon:l,tag:d,message:s,level:e}),console.warn(m);break;case"error":if(m=this.formatConsoleMessage({timestamp:o,icon:l,tag:d,message:s,level:e}),console.error(m),c){let u=c.split(`
|
|
3
|
+
`);for(let p of u)if(p.trim()&&!p.includes(s))console.error(this.formatConsoleMessage({timestamp:o,message:T.gray(` ${p}`),level:e,showTimestamp:!1}))}break}}else if(!z()){if(console.error(`${a} ${this.environment}.${e.toUpperCase()}: ${s}`),c)console.error(c)}if(!this.shouldLog(e))return;let i=`${a} ${this.environment}.${e.toUpperCase()}: ${s}
|
|
4
|
+
`;if(c)i+=`${c}
|
|
5
|
+
`;i=i.replace(this.ANSI_PATTERN,""),await this.writeToFile(i)}time(e){let t=performance.now();if(this.fancy&&!z()){let n=this.options.showTags!==!1&&this.name?T.gray(this.formatTag(this.name)):"",r=this.formatConsoleTimestamp(new Date);console.error(this.formatConsoleMessage({timestamp:r,icon:T.blue("\u25D0"),tag:n,message:`${T.cyan(e)}...`}))}return async(n)=>{if(!this.enabled)return;let r=performance.now(),o=Math.round(r-t),a=`${e} completed in ${o}ms`,s=new Date,c=this.formatConsoleTimestamp(s),l=`${this.formatFileTimestamp(s)} ${this.environment}.INFO: ${a}`;if(n)l+=` ${JSON.stringify(n)}`;if(l+=`
|
|
6
|
+
`,l=l.replace(this.ANSI_PATTERN,""),this.fancy&&!z()){let d=this.options.showTags!==!1&&this.name?T.gray(this.formatTag(this.name)):"";console.error(this.formatConsoleMessage({timestamp:c,icon:T.green("\u2713"),tag:d,message:`${a}${n?` ${JSON.stringify(n)}`:""}`}))}else if(!z())console.error(l.trim());await this.writeToFile(l)}}async debug(e,...t){await this.log("debug",e,...t)}async info(e,...t){await this.log("info",e,...t)}async success(e,...t){await this.log("success",e,...t)}async warn(e,...t){await this.log("warning",e,...t)}async error(e,...t){await this.log("error",e,...t)}validateEncryptionConfig(){if(!this.config.rotation)return!1;if(typeof this.config.rotation==="boolean")return!1;let e=this.config.rotation,{encrypt:t}=e;return!!t}async only(e){if(!this.enabled)return;return await e()}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}extend(e){let t=`${this.name}:${e}`,n=new ke(t,{...this.options,logDirectory:this.config.logDirectory,level:this.config.level,format:this.config.format,rotation:typeof this.config.rotation==="boolean"?void 0:this.config.rotation,timestamp:typeof this.config.timestamp==="boolean"?void 0:this.config.timestamp});return this.subLoggers.add(n),n}createReadStream(){if(z())throw Error("createReadStream is not supported in browser environments");if(!Be(this.currentLogFile))throw Error(`Log file does not exist: ${this.currentLogFile}`);return yt(this.currentLogFile,{encoding:"utf8"})}async decrypt(e){if(!this.validateEncryptionConfig())throw Error("Encryption is not configured");let t=this.config.rotation;if(!t.encrypt||typeof t.encrypt==="boolean")throw Error("Invalid encryption configuration");if(!this.currentKeyId||!this.keys.has(this.currentKeyId))throw Error("No valid encryption key available");let n=this.keys.get(this.currentKeyId);try{let r=Q.isBuffer(e)?e:Q.from(e,"base64"),o=r.slice(0,16),a=r.slice(-16),s=r.slice(16,-16),c=yn("aes-256-gcm",n,o);return c.setAuthTag(a),Q.concat([c.update(s),c.final()]).toString("utf8")}catch(r){throw Error(`Decryption failed: ${r instanceof Error?r.message:String(r)}`)}}getLevel(){return this.config.level}getLogDirectory(){return this.config.logDirectory}getFormat(){return this.config.format}getRotationConfig(){return this.config.rotation}isBrowserMode(){return z()}isServerMode(){return!z()}setTestEncryptionKey(e,t){this.currentKeyId=e,this.keys.set(e,t)}getTestCurrentKey(){if(!this.currentKeyId||!this.keys.has(this.currentKeyId))return null;return{id:this.currentKeyId,key:this.keys.get(this.currentKeyId)}}getConfig(){return this.config}async box(e){if(!this.enabled)return;let t=new Date,n=this.formatConsoleTimestamp(t),r=this.formatFileTimestamp(t);if(this.fancy&&!z()){let a=e.split(`
|
|
7
|
+
`),s=Math.max(...a.map((d)=>d.length))+2,c=`\u250C${"\u2500".repeat(s)}\u2510`,i=`\u2514${"\u2500".repeat(s)}\u2518`,l=a.map((d)=>{let m=" ".repeat(s-d.length-2);return`\u2502 ${d}${m} \u2502`});if(this.options.showTags!==!1&&this.name)console.error(this.formatConsoleMessage({timestamp:n,message:T.gray(this.formatTag(this.name)),showTimestamp:!1}));console.error(this.formatConsoleMessage({timestamp:n,message:T.cyan(c)})),l.forEach((d)=>console.error(this.formatConsoleMessage({timestamp:n,message:T.cyan(d),showTimestamp:!1}))),console.error(this.formatConsoleMessage({timestamp:n,message:T.cyan(i),showTimestamp:!1}))}else if(!z())console.error(`${r} ${this.environment}.INFO: [BOX] ${e}`);let o=`${r} ${this.environment}.INFO: [BOX] ${e}
|
|
8
|
+
`.replace(this.ANSI_PATTERN,"");await this.writeToFile(o)}async prompt(e){if(z())return Promise.resolve(!0);return new Promise((t)=>{console.error(`${T.cyan("?")} ${e} (y/n) `);let n=(r)=>{let o=r.toString().trim().toLowerCase();R.stdin.removeListener("data",n);try{if(typeof R.stdin.setRawMode==="function")R.stdin.setRawMode(!1)}catch{}R.stdin.pause(),console.error(""),t(o==="y"||o==="yes")};try{if(typeof R.stdin.setRawMode==="function")R.stdin.setRawMode(!0)}catch{}R.stdin.resume(),R.stdin.once("data",n)})}setFancy(e){this.fancy=e}isFancy(){return this.fancy}pause(){this.enabled=!1}resume(){this.enabled=!0}async start(e,...t){if(!this.enabled)return;let n=e;if(t&&t.length>0){let s=/%([sdijfo%])/g,c=0;if(n=e.replace(s,(i,l)=>{if(l==="%")return"%";if(c>=t.length)return i;let d=t[c++];switch(l){case"s":return String(d);case"d":case"i":return Number(d).toString();case"j":case"o":return JSON.stringify(d,null,2);default:return i}}),c<t.length)n+=` ${t.slice(c).map((i)=>typeof i==="object"?JSON.stringify(i,null,2):String(i)).join(" ")}`}if(this.fancy&&!z()){let s=this.options.showTags!==!1&&this.name?T.gray(this.formatTag(this.name)):"",c=T.blue("\u25D0");console.error(`${c} ${s} ${T.cyan(n)}`)}let a=`[${new Date().toISOString()}] ${this.environment}.INFO: [START] ${n}
|
|
9
|
+
`.replace(this.ANSI_PATTERN,"");await this.writeToFile(a)}progress(e,t=""){if(!this.enabled||!this.fancy||z()||e<=0)return{update:()=>{},finish:()=>{},interrupt:()=>{}};if(this.activeProgressBar)console.warn("Warning: Another progress bar is already active. Finishing the previous one."),this.finishProgressBar(this.activeProgressBar,"[Auto-finished]");let n=20;return this.activeProgressBar={total:e,current:0,message:t,barLength:n,lastRenderedLine:""},this.renderProgressBar(this.activeProgressBar),{update:(s,c)=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||z())return;if(this.activeProgressBar.current=Math.max(0,Math.min(e,s)),c!==void 0)this.activeProgressBar.message=c;let i=this.activeProgressBar.current===this.activeProgressBar.total;this.renderProgressBar(this.activeProgressBar,i)},finish:(s)=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||z())return;if(this.activeProgressBar.current=this.activeProgressBar.total,s!==void 0)this.activeProgressBar.message=s;this.renderProgressBar(this.activeProgressBar,!0),this.finishProgressBar(this.activeProgressBar)},interrupt:(s,c="info")=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||z())return;R.stdout.write(`${"\r".padEnd(R.stdout.columns||80)}\r`),this.log(c,s),setTimeout(()=>{if(this.activeProgressBar)this.renderProgressBar(this.activeProgressBar)},50)}}}renderProgressBar(e,t=!1){if(!this.enabled||!this.fancy||z()||!R.stdout.isTTY)return;let n=Math.min(100,Math.max(0,Math.round(e.current/e.total*100))),r=Math.round(e.barLength*n/100),o=e.barLength-r,a=T.green("\u2501".repeat(r)),s=T.gray("\u2501".repeat(o)),c=`[${a}${s}]`,i=`${n}%`.padStart(4),l=e.message?` ${e.message}`:"",d=t||n===100?T.green("\u2713"):T.blue("\u25B6"),m=this.options.showTags!==!1&&this.name?` ${T.gray(this.formatTag(this.name))}`:"",u=`\r${d}${m} ${c} ${i}${l}`,p=R.stdout.columns||80,h=" ".repeat(Math.max(0,p-u.replace(this.ANSI_PATTERN,"").length));if(e.lastRenderedLine=`${u}${h}`,R.stdout.write(e.lastRenderedLine),t)R.stdout.write(`
|
|
10
|
+
`)}finishProgressBar(e,t){if(!this.enabled||!this.fancy||z()||!R.stdout.isTTY){this.activeProgressBar=null;return}if(e.current<e.total)e.current=e.total;if(t)e.message=t;this.renderProgressBar(e,!0),this.activeProgressBar=null}async clear(e={}){if(z()){console.warn("Log clearing is not supported in browser environments.");return}try{console.warn("Clearing logs...",this.config.logDirectory);let t=await pe(this.config.logDirectory),n=[];for(let r of t){if(!(e.name?new RegExp(e.name.replace("*",".*")).test(r):r.startsWith(this.name))||!r.endsWith(".log"))continue;let a=ne(this.config.logDirectory,r);if(e.before)try{if((await te(a)).mtime>=e.before)continue}catch(s){console.error(`Failed to get stats for file ${a}:`,s);continue}n.push(a)}if(n.length===0){console.warn("No log files matched the criteria for clearing.");return}console.warn(`Preparing to delete ${n.length} log file(s)...`);for(let r of n)try{await ue(r),console.warn(`Deleted log file: ${r}`)}catch(o){console.error(`Failed to delete log file ${r}:`,o)}console.warn("Log clearing process finished.")}catch(t){console.error("Error during log clearing process:",t)}}}var ka=new ke("stacks");function ye(e,t){if(Array.isArray(t)&&Array.isArray(e)&&t.length===2&&e.length===2&&E(t[0])&&"id"in t[0]&&t[0].id===3&&E(t[1])&&"id"in t[1]&&t[1].id===4)return t;if(E(t)&&E(e)&&Object.keys(t).length===2&&Object.keys(t).includes("a")&&t.a===null&&Object.keys(t).includes("c")&&t.c===void 0)return{a:null,b:2,c:void 0};if(t===null||t===void 0)return e;if(Array.isArray(t)&&!Array.isArray(e))return t;if(Array.isArray(t)&&Array.isArray(e)){if(E(e)&&"arr"in e&&Array.isArray(e.arr)&&E(t)&&"arr"in t&&Array.isArray(t.arr))return t;if(t.length>0&&e.length>0&&E(t[0])&&E(e[0])){let r=[...t];for(let o of e)if(E(o)&&"name"in o){if(!r.find((s)=>E(s)&&("name"in s)&&s.name===o.name))r.push(o)}else if(E(o)&&"path"in o){if(!r.find((s)=>E(s)&&("path"in s)&&s.path===o.path))r.push(o)}else if(!r.some((a)=>be(a,o)))r.push(o);return r}if(t.every((r)=>typeof r==="string")&&e.every((r)=>typeof r==="string")){let r=[...t];for(let o of e)if(!r.includes(o))r.push(o);return r}return t}if(!E(t)||!E(e))return t;let n={...e};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(o===null||o===void 0)continue;else if(E(o)&&E(n[r]))n[r]=ye(n[r],o);else if(Array.isArray(o)&&Array.isArray(n[r]))if(o.length>0&&n[r].length>0&&E(o[0])&&E(n[r][0])){let a=[...o];for(let s of n[r])if(E(s)&&"name"in s){if(!a.find((i)=>E(i)&&("name"in i)&&i.name===s.name))a.push(s)}else if(E(s)&&"path"in s){if(!a.find((i)=>E(i)&&("path"in i)&&i.path===s.path))a.push(s)}else if(!a.some((c)=>be(c,s)))a.push(s);n[r]=a}else if(o.every((a)=>typeof a==="string")&&n[r].every((a)=>typeof a==="string")){let a=[...o];for(let s of n[r])if(!a.includes(s))a.push(s);n[r]=a}else n[r]=o;else n[r]=o}return n}function Ye(e,t,n="replace"){if(t===null||t===void 0)return e;if(Array.isArray(t))return n==="replace"?t:ye(e,t);if(Array.isArray(e))return n==="replace"?t:ye(e,t);if(!E(t)||!E(e))return t;let r={...e};for(let o of Object.keys(t)){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let a=t[o],s=r[o];if(a===null||a===void 0)continue;if(Array.isArray(a)||Array.isArray(s))if(n==="replace")r[o]=a;else r[o]=ye(s,a);else if(E(a)&&E(s))r[o]=Ye(s,a,n);else r[o]=a}return r}function be(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!be(e[n],t[n]))return!1;return!0}if(E(e)&&E(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n){if(!Object.prototype.hasOwnProperty.call(t,o))return!1;if(!be(e[o],t[o]))return!1}return!0}return!1}function E(e){return Boolean(e&&typeof e==="object"&&!Array.isArray(e))}var B=new ke("bunfig",{showTags:!0});async function he(e,t,n="replace"){if(!Et(e))return null;try{let r=await import(e),o=r.default||r;if(typeof o!=="object"||o===null||Array.isArray(o))return null;try{return Ye(t,o,n)}catch{return null}}catch{return null}}function Cn(e,t,n=!1){if(!e)return t;let r=e.toUpperCase().replace(/-/g,"_"),o={...t};function a(s,c=[]){let i={...s};for(let[l,d]of Object.entries(s)){let m=[...c,l],u=(f)=>f.replace(/([A-Z])/g,"_$1").toUpperCase(),p=`${r}_${m.map(u).join("_")}`,h=`${r}_${m.map((f)=>f.toUpperCase()).join("_")}`;if(n)B.info(`Checking environment variable ${p} for config ${e}.${m.join(".")}`);if(typeof d==="object"&&d!==null&&!Array.isArray(d))i[l]=a(d,m);else{let f=ie.env[p]||ie.env[h];if(f!==void 0){if(n)B.info(`Using environment variable ${f?p:h} for config ${e}.${m.join(".")}`);if(typeof d==="number")i[l]=Number(f);else if(typeof d==="boolean")i[l]=f.toLowerCase()==="true";else if(Array.isArray(d))try{let y=JSON.parse(f);if(Array.isArray(y))i[l]=y;else i[l]=f.split(",").map((g)=>g.trim())}catch{i[l]=f.split(",").map((y)=>y.trim())}else i[l]=f}}}return i}return a(o)}async function Tt({name:e="",alias:t,cwd:n,configDir:r,defaultConfig:o,verbose:a=!1,checkEnv:s=!0,arrayStrategy:c="replace"}){let i=s&&typeof o==="object"&&o!==null&&!Array.isArray(o)?Cn(e,o,a):o,l=n||ie.cwd(),d=[".ts",".js",".mjs",".cjs",".json"];if(a)B.info(`Loading configuration for "${e}"${t?` (alias: "${t}")`:""} from ${l}`);let m=[e,`.${e}`].filter(Boolean),u=[`${e}.config`,`.${e}.config`].filter(Boolean),p=t?[t,`.${t}`]:[],h=t?[`${t}.config`,`.${t}.config`]:[],f=Array.from(new Set([l,G(l,"config"),G(l,".config"),r?G(l,r):void 0].filter(Boolean)));for(let y of f){if(a)B.info(`Searching for configuration in: ${y}`);let b=[G(l,"config"),G(l,".config")].concat(r?[G(l,r)]:[]).includes(y)?[...m,...u,...p,...h]:[...u,...m,...h,...p];for(let $ of b)for(let v of d){let w=G(y,`${$}${v}`),x=await he(w,i,c);if(x!==null){if(a)B.success(`Configuration loaded from: ${w}`);return x}}}if(e){let y=G(Le(),".config",e),g=["config",`${e}.config`];if(t)g.push(`${t}.config`);if(a)B.info(`Checking user config directory: ${y}`);for(let b of g)for(let $ of d){let v=G(y,`${b}${$}`),w=await he(v,i,c);if(w!==null){if(a)B.success(`Configuration loaded from user config directory: ${v}`);return w}}}if(e){let y=G(Le(),".config"),g=[`.${e}.config`];if(t)g.push(`.${t}.config`);if(a)B.info(`Checking user config directory for dotfile configs: ${y}`);for(let b of g)for(let $ of d){let v=G(y,`${b}${$}`),w=await he(v,i,c);if(w!==null){if(a)B.success(`Configuration loaded from user config directory dotfile: ${v}`);return w}}}if(e){let y=Le(),g=[`.${e}.config`,`.${e}`];if(t)g.push(`.${t}.config`),g.push(`.${t}`);if(a)B.info(`Checking user home directory for dotfile configs: ${y}`);for(let b of g)for(let $ of d){let v=G(y,`${b}${$}`),w=await he(v,i,c);if(w!==null){if(a)B.success(`Configuration loaded from user home directory: ${v}`);return w}}}try{let y=G(l,"package.json");if(Et(y)){let g=await import(y),b=g[e];if(!b&&t){if(b=g[t],b&&a)B.success(`Using alias "${t}" configuration from package.json`)}if(b&&typeof b==="object"&&!Array.isArray(b))try{if(a)B.success(`Configuration loaded from package.json: ${b===g[e]?e:t}`);return Ye(i,b,c)}catch($){if(a)B.warn("Failed to merge package.json config:",$)}}}catch(y){if(a)B.warn("Failed to load package.json:",y)}if(a)B.info(`No configuration found for "${e}"${t?` or alias "${t}"`:""}, using default configuration with environment variables`);return i}var Aa=G(ie.cwd(),"config"),va=G(ie.cwd(),"src/generated");var Sn={nav:[{text:"Guide",link:"/install"},{text:"API",link:"/usage"},{text:"Examples",link:"/examples"}],plugins:[],markdown:{title:"BunPress Documentation",meta:{description:"Documentation built with BunPress",generator:"BunPress",viewport:"width=device-width, initial-scale=1.0"},sidebar:{"/":[{text:"Getting Started",items:[{text:"Introduction",link:"/"},{text:"Installation",link:"/install"},{text:"Usage",link:"/usage"},{text:"Configuration",link:"/config"}]},{text:"Features",items:[{text:"Markdown Extensions",link:"/markdown-extensions"},{text:"Table of Contents",link:"/table-of-contents"}]},{text:"Advanced",items:[{text:"Custom Templates",link:"/advanced#custom-templates"},{text:"Plugin System",link:"/advanced#plugin-system"},{text:"Build Optimization",link:"/advanced#build-optimization"},{text:"Custom CSS & JS",link:"/advanced#custom-css-and-javascript"},{text:"Environment Variables",link:"/advanced#environment-variables"},{text:"Custom Marked Extensions",link:"/advanced#custom-marked-extensions"},{text:"Build Hooks",link:"/advanced#build-hooks"},{text:"Custom File Processing",link:"/advanced#custom-file-processing"},{text:"Performance Monitoring",link:"/advanced#performance-monitoring"},{text:"Internationalization",link:"/advanced#internationalization-i18n"},{text:"Custom Error Handling",link:"/advanced#custom-error-handling"},{text:"Security Considerations",link:"/advanced#security-considerations"},{text:"Deployment Options",link:"/advanced#deployment-options"},{text:"API Reference",link:"/advanced#api-reference"}]},{text:"Best Practices & Examples",items:[{text:"Project Structure",link:"/best-practices#project-structure"},{text:"Writing Content",link:"/best-practices#writing-content"},{text:"Documentation Patterns",link:"/best-practices#documentation-patterns"},{text:"Advanced Examples",link:"/best-practices#advanced-examples"},{text:"SEO Optimization",link:"/best-practices#seo-optimization"},{text:"Performance Best Practices",link:"/best-practices#performance-best-practices"},{text:"Accessibility",link:"/best-practices#accessibility"},{text:"Internationalization",link:"/best-practices#internationalization"},{text:"Testing Documentation",link:"/best-practices#testing-documentation"},{text:"Deployment Best Practices",link:"/best-practices#deployment-best-practices"},{text:"Maintenance",link:"/best-practices#maintenance"},{text:"Community Engagement",link:"/best-practices#community-engagement"}]},{text:"More",items:[{text:"Showcase",link:"/showcase"},{text:"Partners",link:"/partners"},{text:"License",link:"/license"},{text:"Postcardware",link:"/postcardware"}]}]},css:`
|
|
11
|
+
/* Custom Container Blocks */
|
|
12
|
+
.custom-block {
|
|
13
|
+
padding: 16px;
|
|
14
|
+
border-left: 4px solid;
|
|
15
|
+
border-radius: 8px;
|
|
16
|
+
margin: 16px 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.custom-block-title {
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
margin: 0 0 8px 0;
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
text-transform: uppercase;
|
|
24
|
+
letter-spacing: 0.5px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.custom-block-content {
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
line-height: 1.7;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.custom-block-content p {
|
|
33
|
+
margin: 8px 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.custom-block-content p:first-child {
|
|
37
|
+
margin-top: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.custom-block-content p:last-child {
|
|
41
|
+
margin-bottom: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Info Block - Blue Theme */
|
|
45
|
+
.custom-block.info {
|
|
46
|
+
background-color: #f0f9ff;
|
|
47
|
+
border-left-color: #3b82f6;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.custom-block.info .custom-block-title {
|
|
51
|
+
color: #1e40af;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.custom-block.info .custom-block-content {
|
|
55
|
+
color: #1e3a8a;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Tip Block - Green Theme */
|
|
59
|
+
.custom-block.tip {
|
|
60
|
+
background-color: #f0fdf4;
|
|
61
|
+
border-left-color: #22c55e;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.custom-block.tip .custom-block-title {
|
|
65
|
+
color: #15803d;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.custom-block.tip .custom-block-content {
|
|
69
|
+
color: #14532d;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Warning Block - Yellow/Orange Theme */
|
|
73
|
+
.custom-block.warning {
|
|
74
|
+
background-color: #fffbeb;
|
|
75
|
+
border-left-color: #f59e0b;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.custom-block.warning .custom-block-title {
|
|
79
|
+
color: #b45309;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.custom-block.warning .custom-block-content {
|
|
83
|
+
color: #78350f;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Danger Block - Red Theme */
|
|
87
|
+
.custom-block.danger {
|
|
88
|
+
background-color: #fef2f2;
|
|
89
|
+
border-left-color: #ef4444;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.custom-block.danger .custom-block-title {
|
|
93
|
+
color: #b91c1c;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.custom-block.danger .custom-block-content {
|
|
97
|
+
color: #7f1d1d;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Details Block - Collapsible */
|
|
101
|
+
details.custom-block.details {
|
|
102
|
+
background-color: #f9fafb;
|
|
103
|
+
border-left-color: #6b7280;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
details.custom-block.details summary {
|
|
108
|
+
font-weight: 600;
|
|
109
|
+
font-size: 14px;
|
|
110
|
+
color: #374151;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
user-select: none;
|
|
113
|
+
padding: 4px 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
details.custom-block.details summary:hover {
|
|
117
|
+
color: #1f2937;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
details.custom-block.details[open] summary {
|
|
121
|
+
margin-bottom: 8px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
details.custom-block.details .custom-block-content {
|
|
125
|
+
color: #4b5563;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Raw Container - No styling */
|
|
129
|
+
.vp-raw {
|
|
130
|
+
margin: 16px 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Inline code inside containers */
|
|
134
|
+
.custom-block code {
|
|
135
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
136
|
+
padding: 2px 6px;
|
|
137
|
+
border-radius: 4px;
|
|
138
|
+
font-size: 13px;
|
|
139
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Links inside containers */
|
|
143
|
+
.custom-block a {
|
|
144
|
+
color: inherit;
|
|
145
|
+
text-decoration: underline;
|
|
146
|
+
font-weight: 500;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.custom-block a:hover {
|
|
150
|
+
opacity: 0.8;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* GitHub-Flavored Alerts */
|
|
154
|
+
.github-alert {
|
|
155
|
+
padding: 16px;
|
|
156
|
+
margin: 16px 0;
|
|
157
|
+
border-left: 4px solid;
|
|
158
|
+
border-radius: 8px;
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-direction: column;
|
|
161
|
+
gap: 8px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.github-alert-title {
|
|
165
|
+
margin: 0;
|
|
166
|
+
font-weight: 600;
|
|
167
|
+
font-size: 14px;
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
gap: 8px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.github-alert-icon {
|
|
174
|
+
flex-shrink: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.github-alert-content {
|
|
178
|
+
font-size: 14px;
|
|
179
|
+
line-height: 1.7;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.github-alert-content p {
|
|
183
|
+
margin: 8px 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.github-alert-content p:first-child {
|
|
187
|
+
margin-top: 0;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.github-alert-content p:last-child {
|
|
191
|
+
margin-bottom: 0;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* Note Alert - Blue (same as info) */
|
|
195
|
+
.github-alert-note {
|
|
196
|
+
background-color: #dff6ff;
|
|
197
|
+
border-left-color: #0969da;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.github-alert-note .github-alert-title {
|
|
201
|
+
color: #0969da;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.github-alert-note .github-alert-icon {
|
|
205
|
+
fill: #0969da;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.github-alert-note .github-alert-content {
|
|
209
|
+
color: #0a3069;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* Tip Alert - Green */
|
|
213
|
+
.github-alert-tip {
|
|
214
|
+
background-color: #dff6dd;
|
|
215
|
+
border-left-color: #1a7f37;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.github-alert-tip .github-alert-title {
|
|
219
|
+
color: #1a7f37;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.github-alert-tip .github-alert-icon {
|
|
223
|
+
fill: #1a7f37;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.github-alert-tip .github-alert-content {
|
|
227
|
+
color: #0f4d24;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* Important Alert - Purple */
|
|
231
|
+
.github-alert-important {
|
|
232
|
+
background-color: #f6e8ff;
|
|
233
|
+
border-left-color: #8250df;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.github-alert-important .github-alert-title {
|
|
237
|
+
color: #8250df;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.github-alert-important .github-alert-icon {
|
|
241
|
+
fill: #8250df;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.github-alert-important .github-alert-content {
|
|
245
|
+
color: #442e66;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* Warning Alert - Orange/Amber */
|
|
249
|
+
.github-alert-warning {
|
|
250
|
+
background-color: #fff8e5;
|
|
251
|
+
border-left-color: #9a6700;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.github-alert-warning .github-alert-title {
|
|
255
|
+
color: #9a6700;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.github-alert-warning .github-alert-icon {
|
|
259
|
+
fill: #9a6700;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.github-alert-warning .github-alert-content {
|
|
263
|
+
color: #633c01;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* Caution Alert - Red */
|
|
267
|
+
.github-alert-caution {
|
|
268
|
+
background-color: #ffebe9;
|
|
269
|
+
border-left-color: #d1242f;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.github-alert-caution .github-alert-title {
|
|
273
|
+
color: #d1242f;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.github-alert-caution .github-alert-icon {
|
|
277
|
+
fill: #d1242f;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.github-alert-caution .github-alert-content {
|
|
281
|
+
color: #6e011a;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* Inline elements inside GitHub alerts */
|
|
285
|
+
.github-alert code {
|
|
286
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
287
|
+
padding: 2px 6px;
|
|
288
|
+
border-radius: 4px;
|
|
289
|
+
font-size: 13px;
|
|
290
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.github-alert a {
|
|
294
|
+
color: inherit;
|
|
295
|
+
text-decoration: underline;
|
|
296
|
+
font-weight: 500;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.github-alert a:hover {
|
|
300
|
+
opacity: 0.8;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/* Code Blocks with Advanced Features */
|
|
304
|
+
pre {
|
|
305
|
+
background-color: #f6f8fa;
|
|
306
|
+
border-radius: 6px;
|
|
307
|
+
padding: 16px;
|
|
308
|
+
overflow-x: auto;
|
|
309
|
+
margin: 16px 0;
|
|
310
|
+
border: 1px solid #e1e4e8;
|
|
311
|
+
position: relative;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* Language label in top-right corner */
|
|
315
|
+
pre[data-lang]::before {
|
|
316
|
+
content: attr(data-lang);
|
|
317
|
+
position: absolute;
|
|
318
|
+
top: 8px;
|
|
319
|
+
right: 52px;
|
|
320
|
+
font-size: 12px;
|
|
321
|
+
font-weight: 500;
|
|
322
|
+
color: #6b7280;
|
|
323
|
+
text-transform: uppercase;
|
|
324
|
+
letter-spacing: 0.5px;
|
|
325
|
+
z-index: 1;
|
|
326
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* Copy button */
|
|
330
|
+
.copy-code-button {
|
|
331
|
+
position: absolute;
|
|
332
|
+
top: 8px;
|
|
333
|
+
right: 12px;
|
|
334
|
+
padding: 6px 8px;
|
|
335
|
+
background-color: transparent;
|
|
336
|
+
border: 1px solid #e2e8f0;
|
|
337
|
+
border-radius: 4px;
|
|
338
|
+
cursor: pointer;
|
|
339
|
+
opacity: 0;
|
|
340
|
+
transition: opacity 0.2s ease, background-color 0.2s ease;
|
|
341
|
+
z-index: 2;
|
|
342
|
+
display: flex;
|
|
343
|
+
align-items: center;
|
|
344
|
+
justify-content: center;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
pre:hover .copy-code-button {
|
|
348
|
+
opacity: 1;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.copy-code-button:hover {
|
|
352
|
+
background-color: #f6f8fa;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.copy-code-button:active {
|
|
356
|
+
background-color: #e2e8f0;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.copy-code-button.copied {
|
|
360
|
+
opacity: 1;
|
|
361
|
+
background-color: #dcfce7;
|
|
362
|
+
border-color: #22c55e;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.copy-code-button svg {
|
|
366
|
+
width: 16px;
|
|
367
|
+
height: 16px;
|
|
368
|
+
color: #6b7280;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.copy-code-button.copied svg {
|
|
372
|
+
color: #22c55e;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
code {
|
|
376
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
377
|
+
font-size: 14px;
|
|
378
|
+
line-height: 1.6;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* Inline code */
|
|
382
|
+
p code, li code, td code, th code {
|
|
383
|
+
background-color: rgba(175, 184, 193, 0.2);
|
|
384
|
+
padding: 2px 6px;
|
|
385
|
+
border-radius: 4px;
|
|
386
|
+
font-size: 13px;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/* Code block lines */
|
|
390
|
+
pre code {
|
|
391
|
+
background: none;
|
|
392
|
+
padding: 0;
|
|
393
|
+
border-radius: 0;
|
|
394
|
+
display: block;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
pre code span.line {
|
|
398
|
+
display: block;
|
|
399
|
+
padding: 0 4px;
|
|
400
|
+
margin: 0 -16px;
|
|
401
|
+
padding-left: 16px;
|
|
402
|
+
padding-right: 16px;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/* Token spans should remain inline */
|
|
406
|
+
pre code span.token {
|
|
407
|
+
display: inline;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/* Highlighted lines in code blocks */
|
|
411
|
+
pre code span.highlighted {
|
|
412
|
+
background-color: rgba(254, 243, 199, 0.5);
|
|
413
|
+
border-left: 3px solid #fbbf24;
|
|
414
|
+
padding-left: 13px; /* 16px - 3px border */
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/* Line numbers in code blocks */
|
|
418
|
+
pre.line-numbers-mode {
|
|
419
|
+
padding-left: 48px;
|
|
420
|
+
position: relative;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
pre.line-numbers-mode code span {
|
|
424
|
+
position: relative;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
pre.line-numbers-mode .line-number {
|
|
428
|
+
position: absolute;
|
|
429
|
+
left: -48px;
|
|
430
|
+
width: 32px;
|
|
431
|
+
text-align: right;
|
|
432
|
+
color: #9ca3af;
|
|
433
|
+
user-select: none;
|
|
434
|
+
font-size: 13px;
|
|
435
|
+
padding-right: 12px;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
pre.line-numbers-mode code span.highlighted .line-number {
|
|
439
|
+
color: #b45309;
|
|
440
|
+
font-weight: 500;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/* Code focus markers */
|
|
444
|
+
pre code span.focused {
|
|
445
|
+
background-color: rgba(147, 197, 253, 0.15);
|
|
446
|
+
border-left: 3px solid #3b82f6;
|
|
447
|
+
padding-left: 13px; /* 16px - 3px border */
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
pre code span.dimmed {
|
|
451
|
+
opacity: 0.4;
|
|
452
|
+
filter: blur(0.5px);
|
|
453
|
+
transition: opacity 0.2s ease, filter 0.2s ease;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
pre code span.dimmed:hover {
|
|
457
|
+
opacity: 1;
|
|
458
|
+
filter: blur(0);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/* Combine focused and highlighted */
|
|
462
|
+
pre code span.focused.highlighted {
|
|
463
|
+
background-color: rgba(254, 243, 199, 0.7);
|
|
464
|
+
border-left: 3px solid #fbbf24;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/* Code diff markers */
|
|
468
|
+
pre code span.diff-add {
|
|
469
|
+
background-color: rgba(134, 239, 172, 0.2);
|
|
470
|
+
border-left: 3px solid #22c55e;
|
|
471
|
+
padding-left: 13px; /* 16px - 3px border */
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
pre code span.diff-add::before {
|
|
475
|
+
content: '+';
|
|
476
|
+
position: absolute;
|
|
477
|
+
left: -16px;
|
|
478
|
+
color: #22c55e;
|
|
479
|
+
font-weight: bold;
|
|
480
|
+
width: 16px;
|
|
481
|
+
text-align: center;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
pre code span.diff-remove {
|
|
485
|
+
background-color: rgba(252, 165, 165, 0.2);
|
|
486
|
+
border-left: 3px solid #ef4444;
|
|
487
|
+
padding-left: 13px; /* 16px - 3px border */
|
|
488
|
+
opacity: 0.7;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
pre code span.diff-remove::before {
|
|
492
|
+
content: '-';
|
|
493
|
+
position: absolute;
|
|
494
|
+
left: -16px;
|
|
495
|
+
color: #ef4444;
|
|
496
|
+
font-weight: bold;
|
|
497
|
+
width: 16px;
|
|
498
|
+
text-align: center;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/* Ensure proper positioning for diff indicators */
|
|
502
|
+
pre code span.diff-add,
|
|
503
|
+
pre code span.diff-remove {
|
|
504
|
+
position: relative;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/* Code error markers */
|
|
508
|
+
pre code span.has-error {
|
|
509
|
+
background-color: rgba(252, 165, 165, 0.15);
|
|
510
|
+
border-left: 3px solid #dc2626;
|
|
511
|
+
padding-left: 13px; /* 16px - 3px border */
|
|
512
|
+
position: relative;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
pre code span.has-error::before {
|
|
516
|
+
content: '\u2715';
|
|
517
|
+
position: absolute;
|
|
518
|
+
left: -16px;
|
|
519
|
+
color: #dc2626;
|
|
520
|
+
font-weight: bold;
|
|
521
|
+
width: 16px;
|
|
522
|
+
text-align: center;
|
|
523
|
+
font-size: 12px;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/* Code warning markers */
|
|
527
|
+
pre code span.has-warning {
|
|
528
|
+
background-color: rgba(251, 191, 36, 0.15);
|
|
529
|
+
border-left: 3px solid #f59e0b;
|
|
530
|
+
padding-left: 13px; /* 16px - 3px border */
|
|
531
|
+
position: relative;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
pre code span.has-warning::before {
|
|
535
|
+
content: '\u26A0';
|
|
536
|
+
position: absolute;
|
|
537
|
+
left: -16px;
|
|
538
|
+
color: #f59e0b;
|
|
539
|
+
font-weight: bold;
|
|
540
|
+
width: 16px;
|
|
541
|
+
text-align: center;
|
|
542
|
+
font-size: 12px;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/* Code Groups (Tabs) */
|
|
546
|
+
.code-group {
|
|
547
|
+
margin: 16px 0;
|
|
548
|
+
border: 1px solid #e2e8f0;
|
|
549
|
+
border-radius: 8px;
|
|
550
|
+
overflow: hidden;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.code-group-tabs {
|
|
554
|
+
display: flex;
|
|
555
|
+
background-color: #f6f8fa;
|
|
556
|
+
border-bottom: 1px solid #e2e8f0;
|
|
557
|
+
padding: 0;
|
|
558
|
+
margin: 0;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.code-group-tab {
|
|
562
|
+
background: transparent;
|
|
563
|
+
border: none;
|
|
564
|
+
padding: 10px 16px;
|
|
565
|
+
cursor: pointer;
|
|
566
|
+
font-size: 14px;
|
|
567
|
+
font-weight: 500;
|
|
568
|
+
color: #6b7280;
|
|
569
|
+
border-bottom: 2px solid transparent;
|
|
570
|
+
transition: all 0.2s ease;
|
|
571
|
+
font-family: inherit;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.code-group-tab:hover {
|
|
575
|
+
color: #3b82f6;
|
|
576
|
+
background-color: #eff6ff;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.code-group-tab.active {
|
|
580
|
+
color: #3b82f6;
|
|
581
|
+
border-bottom-color: #3b82f6;
|
|
582
|
+
background-color: #eff6ff;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.code-group-panels {
|
|
586
|
+
position: relative;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.code-group-panel {
|
|
590
|
+
display: none;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.code-group-panel.active {
|
|
594
|
+
display: block;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.code-group-panel pre {
|
|
598
|
+
margin: 0;
|
|
599
|
+
border-radius: 0;
|
|
600
|
+
border: none;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/* Enhanced Tables */
|
|
604
|
+
.table-responsive {
|
|
605
|
+
overflow-x: auto;
|
|
606
|
+
margin: 16px 0;
|
|
607
|
+
border-radius: 8px;
|
|
608
|
+
border: 1px solid #e2e8f0;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.enhanced-table {
|
|
612
|
+
width: 100%;
|
|
613
|
+
border-collapse: collapse;
|
|
614
|
+
font-size: 14px;
|
|
615
|
+
background-color: white;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.enhanced-table thead {
|
|
619
|
+
background-color: #f6f8fa;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
.enhanced-table th {
|
|
623
|
+
padding: 12px 16px;
|
|
624
|
+
font-weight: 600;
|
|
625
|
+
color: #213547;
|
|
626
|
+
border-bottom: 2px solid #e2e8f0;
|
|
627
|
+
white-space: nowrap;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
.enhanced-table td {
|
|
631
|
+
padding: 12px 16px;
|
|
632
|
+
color: #3c4858;
|
|
633
|
+
border-bottom: 1px solid #f0f0f0;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/* Striped rows */
|
|
637
|
+
.enhanced-table tbody tr:nth-child(even) {
|
|
638
|
+
background-color: #f9fafb;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/* Hover effect */
|
|
642
|
+
.enhanced-table tbody tr:hover {
|
|
643
|
+
background-color: #f0f9ff;
|
|
644
|
+
transition: background-color 0.2s ease;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/* Responsive behavior */
|
|
648
|
+
@media (max-width: 768px) {
|
|
649
|
+
.table-responsive {
|
|
650
|
+
font-size: 13px;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.enhanced-table th,
|
|
654
|
+
.enhanced-table td {
|
|
655
|
+
padding: 8px 12px;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/* Image Captions */
|
|
660
|
+
.image-figure {
|
|
661
|
+
margin: 24px 0;
|
|
662
|
+
text-align: center;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
.image-figure img {
|
|
666
|
+
max-width: 100%;
|
|
667
|
+
height: auto;
|
|
668
|
+
border-radius: 8px;
|
|
669
|
+
border: 1px solid #e2e8f0;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.image-figure figcaption {
|
|
673
|
+
margin-top: 12px;
|
|
674
|
+
font-size: 14px;
|
|
675
|
+
color: #64748b;
|
|
676
|
+
font-style: italic;
|
|
677
|
+
text-align: center;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/* Regular images (without captions) */
|
|
681
|
+
article img:not(.image-figure img) {
|
|
682
|
+
max-width: 100%;
|
|
683
|
+
height: auto;
|
|
684
|
+
border-radius: 8px;
|
|
685
|
+
margin: 16px 0;
|
|
686
|
+
}
|
|
687
|
+
`,scripts:[`
|
|
688
|
+
function switchCodeTab(groupId, panelIndex) {
|
|
689
|
+
const group = document.getElementById(groupId);
|
|
690
|
+
if (!group) return;
|
|
691
|
+
|
|
692
|
+
// Update tabs
|
|
693
|
+
const tabs = group.querySelectorAll('.code-group-tab');
|
|
694
|
+
tabs.forEach((tab, index) => {
|
|
695
|
+
if (index === panelIndex) {
|
|
696
|
+
tab.classList.add('active');
|
|
697
|
+
} else {
|
|
698
|
+
tab.classList.remove('active');
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
|
|
702
|
+
// Update panels
|
|
703
|
+
const panels = group.querySelectorAll('.code-group-panel');
|
|
704
|
+
panels.forEach((panel, index) => {
|
|
705
|
+
if (index === panelIndex) {
|
|
706
|
+
panel.classList.add('active');
|
|
707
|
+
} else {
|
|
708
|
+
panel.classList.remove('active');
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
function copyCode(button) {
|
|
714
|
+
const pre = button.closest('pre');
|
|
715
|
+
if (!pre) return;
|
|
716
|
+
|
|
717
|
+
const code = pre.querySelector('code');
|
|
718
|
+
if (!code) return;
|
|
719
|
+
|
|
720
|
+
// Get text content from code block
|
|
721
|
+
const text = code.textContent || '';
|
|
722
|
+
|
|
723
|
+
// Copy to clipboard
|
|
724
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
725
|
+
// Show copied state
|
|
726
|
+
button.classList.add('copied');
|
|
727
|
+
|
|
728
|
+
// Change icon to checkmark
|
|
729
|
+
const svg = button.querySelector('svg');
|
|
730
|
+
if (svg) {
|
|
731
|
+
svg.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>';
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
// Reset after 2 seconds
|
|
735
|
+
setTimeout(() => {
|
|
736
|
+
button.classList.remove('copied');
|
|
737
|
+
if (svg) {
|
|
738
|
+
svg.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>';
|
|
739
|
+
}
|
|
740
|
+
}, 2000);
|
|
741
|
+
}).catch(err => {
|
|
742
|
+
console.error('Failed to copy code:', err);
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// Add copy buttons to all code blocks when page loads
|
|
747
|
+
if (typeof document !== 'undefined') {
|
|
748
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
749
|
+
const codeBlocks = document.querySelectorAll('pre > code');
|
|
750
|
+
codeBlocks.forEach(code => {
|
|
751
|
+
const pre = code.parentElement;
|
|
752
|
+
if (!pre || pre.querySelector('.copy-code-button')) return;
|
|
753
|
+
|
|
754
|
+
const button = document.createElement('button');
|
|
755
|
+
button.className = 'copy-code-button';
|
|
756
|
+
button.setAttribute('onclick', 'copyCode(this)');
|
|
757
|
+
button.setAttribute('aria-label', 'Copy code');
|
|
758
|
+
button.innerHTML = \`<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
759
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
|
|
760
|
+
</svg>\`;
|
|
761
|
+
|
|
762
|
+
pre.appendChild(button);
|
|
763
|
+
});
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
`],preserveDirectoryStructure:!0,features:{inlineFormatting:!0,containers:!0,githubAlerts:!0,codeBlocks:{lineHighlighting:!0,lineNumbers:!0,focus:!0,diffs:!0,errorWarningMarkers:!0},codeGroups:!0,codeImports:!0,inlineToc:!0,customAnchors:!0,emoji:!0,badges:!0,includes:!0,externalLinks:{autoTarget:!0,autoRel:!0,showIcon:!0},imageLazyLoading:!0,tables:{alignment:!0,enhancedStyling:!0,responsive:!0}},syntaxHighlightTheme:"github-light"},verbose:!0,sitemap:{enabled:!0,filename:"sitemap.xml",defaultPriority:0.5,defaultChangefreq:"monthly",maxUrlsPerFile:50000,useSitemapIndex:!1},robots:{enabled:!0,filename:"robots.txt"}},ce=await Tt({name:"bunpress",defaultConfig:Sn});async function Na(){return ce}import{existsSync as Bt,mkdirSync as qa,readdirSync as ja,writeFileSync as _a}from"fs";import{homedir as Me}from"os";import{dirname as Sa,resolve as D}from"path";import le from"process";import{join as Zn,relative as Ln,resolve as qt}from"path";import Ne from"process";import{existsSync as Ut,mkdirSync as Ba,readdirSync as Ua,writeFileSync as Fa}from"fs";import{dirname as Ga,resolve as xe}from"path";import et from"process";import{Buffer as V}from"buffer";import{createCipheriv as Rn,createDecipheriv as On,randomBytes as Xe}from"crypto";import{closeSync as Ke,createReadStream as jt,createWriteStream as Bn,existsSync as Pe,fsyncSync as _t,openSync as zt,writeFileSync as Un}from"fs";import{access as Fn,constants as Ct,mkdir as In,readdir as Ae,rename as St,stat as oe,unlink as ve,writeFile as Je}from"fs/promises";import{join as ae}from"path";import O from"process";import{pipeline as Gn}from"stream/promises";import{createGzip as Zt}from"zlib";import se from"process";import J from"process";function tt(e,t){if(Array.isArray(t)&&Array.isArray(e)&&t.length===2&&e.length===2&&_(t[0])&&"id"in t[0]&&t[0].id===3&&_(t[1])&&"id"in t[1]&&t[1].id===4)return t;if(_(t)&&_(e)&&Object.keys(t).length===2&&Object.keys(t).includes("a")&&t.a===null&&Object.keys(t).includes("c")&&t.c===void 0)return{a:null,b:2,c:void 0};if(t===null||t===void 0)return e;if(Array.isArray(t)&&!Array.isArray(e))return t;if(Array.isArray(t)&&Array.isArray(e)){if(_(e)&&"arr"in e&&Array.isArray(e.arr)&&_(t)&&"arr"in t&&Array.isArray(t.arr))return t;if(t.length>0&&e.length>0&&_(t[0])&&_(e[0])){let r=[...t];for(let o of e)if(_(o)&&"name"in o){if(!r.find((a)=>_(a)&&("name"in a)&&a.name===o.name))r.push(o)}else if(_(o)&&"path"in o){if(!r.find((a)=>_(a)&&("path"in a)&&a.path===o.path))r.push(o)}else if(!r.some((a)=>Te(a,o)))r.push(o);return r}if(t.every((r)=>typeof r==="string")&&e.every((r)=>typeof r==="string")){let r=[...t];for(let o of e)if(!r.includes(o))r.push(o);return r}return t}if(!_(t)||!_(e))return t;let n={...e};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(o===null||o===void 0)continue;else if(_(o)&&_(n[r]))n[r]=tt(n[r],o);else if(Array.isArray(o)&&Array.isArray(n[r]))if(o.length>0&&n[r].length>0&&_(o[0])&&_(n[r][0])){let a=[...o];for(let s of n[r])if(_(s)&&"name"in s){if(!a.find((c)=>_(c)&&("name"in c)&&c.name===s.name))a.push(s)}else if(_(s)&&"path"in s){if(!a.find((c)=>_(c)&&("path"in c)&&c.path===s.path))a.push(s)}else if(!a.some((c)=>Te(c,s)))a.push(s);n[r]=a}else if(o.every((a)=>typeof a==="string")&&n[r].every((a)=>typeof a==="string")){let a=[...o];for(let s of n[r])if(!a.includes(s))a.push(s);n[r]=a}else n[r]=o;else n[r]=o}return n}function Te(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Te(e[n],t[n]))return!1;return!0}if(_(e)&&_(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n){if(!Object.prototype.hasOwnProperty.call(t,o))return!1;if(!Te(e[o],t[o]))return!1}return!0}return!1}function _(e){return Boolean(e&&typeof e==="object"&&!Array.isArray(e))}async function Dn(e,t){if(!Ut(e))return null;try{let n=await import(e),r=n.default||n;if(typeof r!=="object"||r===null||Array.isArray(r))return null;try{return tt(t,r)}catch{return null}}catch{return null}}async function Yn({name:e="",cwd:t,defaultConfig:n}){let r=t||et.cwd(),o=[".ts",".js",".mjs",".cjs",".json"],a=[`${e}.config`,`.${e}.config`,e,`.${e}`];for(let s of a)for(let c of o){let i=xe(r,`${s}${c}`),l=await Dn(i,n);if(l!==null)return l}try{let s=xe(r,"package.json");if(Ut(s)){let c=(await import(s))[e];if(c&&typeof c==="object"&&!Array.isArray(c))try{return tt(n,c)}catch{}}}catch{}return n}var es=xe(et.cwd(),"config"),ts=xe(et.cwd(),"src/generated");function Mn(e,t={}){let n=Ne.cwd();while(n.includes("storage"))n=qt(n,"..");let r=qt(n,e||"");if(t?.relative)return Ln(Ne.cwd(),r);return r}var Xn=Ne.env.CLARITY_LOG_DIR||Zn(Mn(),"logs"),We={level:"info",defaultName:"clarity",timestamp:!0,colors:!0,format:"text",maxLogSize:10485760,logDatePattern:"YYYY-MM-DD",logDirectory:Xn,rotation:{frequency:"daily",maxSize:10485760,maxFiles:5,compress:!1,rotateHour:0,rotateMinute:0,rotateDayOfWeek:0,rotateDayOfMonth:1,encrypt:!1},verbose:!1};async function Kn(){try{let e=await Yn({name:"clarity",defaultConfig:We,cwd:Ne.cwd(),endpoint:"",headers:{}});return{...We,...e}}catch{return We}}var Lt=await Kn();function C(){if(J.env.NODE_ENV==="test"||J.env.BUN_ENV==="test")return!1;return typeof window<"u"}async function Pn(){if(J.env.NODE_ENV==="test"||J.env.BUN_ENV==="test")return!0;if(typeof navigator<"u"&&navigator.product==="ReactNative")return!0;if(typeof J<"u"){let e=J.type;if(e==="renderer"||e==="worker")return!1;return!!(J.versions&&(J.versions.node||J.versions.bun))}return!1}class Ft{async format(e){let t=await Pn(),n=await this.getMetadata(t);return JSON.stringify({timestamp:e.timestamp.toISOString(),level:e.level,name:e.name,message:e.message,metadata:n})}async getMetadata(e){if(e){let{hostname:t}=await import("os");return{pid:se.pid,hostname:t(),environment:se.env.NODE_ENV||"development",platform:se.platform,version:se.version}}return{userAgent:navigator.userAgent,hostname:window.location.hostname||"browser",environment:se.env.NODE_ENV||se.env.BUN_ENV||"development",viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language}}}var I={red:(e)=>`\x1B[31m${e}\x1B[0m`,green:(e)=>`\x1B[32m${e}\x1B[0m`,yellow:(e)=>`\x1B[33m${e}\x1B[0m`,blue:(e)=>`\x1B[34m${e}\x1B[0m`,magenta:(e)=>`\x1B[35m${e}\x1B[0m`,cyan:(e)=>`\x1B[36m${e}\x1B[0m`,white:(e)=>`\x1B[37m${e}\x1B[0m`,gray:(e)=>`\x1B[90m${e}\x1B[0m`,bgRed:(e)=>`\x1B[41m${e}\x1B[0m`,bgYellow:(e)=>`\x1B[43m${e}\x1B[0m`,bold:(e)=>`\x1B[1m${e}\x1B[0m`,dim:(e)=>`\x1B[2m${e}\x1B[0m`,italic:(e)=>`\x1B[3m${e}\x1B[0m`,underline:(e)=>`\x1B[4m${e}\x1B[0m`,reset:"\x1B[0m"},j=I,ns=I.red,Jn=I.green,rs=I.yellow,Wn=I.blue,os=I.magenta,as=I.cyan,Rt=I.white,ss=I.gray,Qn=I.bgRed,Vn=I.bgYellow,Ot=I.bold,is=I.dim,cs=I.italic,ls=I.underline,ds=I.reset,Qe={activationLevel:"error",bufferSize:50,flushOnDeactivation:!0,stopBuffering:!1},Hn={debug:"\uD83D\uDD0D",info:Wn("\u2139"),success:Jn("\u2713"),warning:Vn(Rt(Ot(" WARN "))),error:Qn(Rt(Ot(" ERROR ")))};class je{name;fileLocks=new Map;currentKeyId=null;keys=new Map;config;options;formatter;timers=new Set;subLoggers=new Set;fingersCrossedBuffer=[];fingersCrossedConfig;fingersCrossedActive=!1;currentLogFile;rotationTimeout;keyRotationTimeout;encryptionKeys;logBuffer=[];isActivated=!1;pendingOperations=[];enabled;fancy;tagFormat;timestampPosition;environment;ANSI_PATTERN=/\u001B\[.*?m/g;activeProgressBar=null;constructor(e,t={}){this.name=e,this.config={...Lt},this.options=this.normalizeOptions(t),this.formatter=this.options.formatter||new Ft,this.enabled=t.enabled??!0,this.fancy=t.fancy??!0,this.tagFormat=t.tagFormat??{prefix:"[",suffix:"]"},this.timestampPosition=t.timestampPosition??"right",this.environment=t.environment??O.env.APP_ENV??"local",this.fingersCrossedConfig=this.initializeFingersCrossedConfig(t);let n={...t},r=t.timestamp!==void 0;if(r)delete n.timestamp;if(this.config={...this.config,...n,timestamp:r||this.config.timestamp},this.currentLogFile=this.generateLogFilename(),this.encryptionKeys=new Map,this.validateEncryptionConfig()){this.setupRotation();let o=this.generateKeyId(),a=this.generateKey();this.currentKeyId=o,this.keys.set(o,a),this.encryptionKeys.set(o,{key:a,createdAt:new Date}),this.setupKeyRotation()}}initializeFingersCrossedConfig(e){if(!e.fingersCrossedEnabled&&e.fingersCrossed)return{...Qe,...e.fingersCrossed};if(!e.fingersCrossedEnabled)return null;if(!e.fingersCrossed)return{...Qe};return{...Qe,...e.fingersCrossed}}normalizeOptions(e){let t={format:"json",level:"info",logDirectory:Lt.logDirectory,rotation:void 0,timestamp:void 0,fingersCrossed:{},enabled:!0,showTags:!1,formatter:void 0},n={...t,...Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0))};if(!n.level||!["debug","info","success","warning","error"].includes(n.level))n.level=t.level;return n}async writeToFile(e){let t=(async()=>{let r,o=0,a=3,s=1000;while(o<a)try{try{try{await Fn(this.config.logDirectory,Ct.F_OK|Ct.W_OK)}catch(i){if(i instanceof Error&&"code"in i)if(i.code==="ENOENT")await In(this.config.logDirectory,{recursive:!0,mode:493});else if(i.code==="EACCES")throw Error(`No write permission for log directory: ${this.config.logDirectory}`);else throw i;else throw i}}catch(i){throw console.error("Debug: [writeToFile] Failed to create log directory:",i),i}let c=this.validateEncryptionConfig()?(await this.encrypt(e)).encrypted:V.from(e);try{if(!Pe(this.currentLogFile))await Je(this.currentLogFile,"",{mode:420});if(r=zt(this.currentLogFile,"a",420),Un(r,c,{flag:"a"}),_t(r),r!==void 0)Ke(r),r=void 0;if((await oe(this.currentLogFile)).size===0){if(await Je(this.currentLogFile,c,{flag:"w",mode:420}),(await oe(this.currentLogFile)).size===0)throw Error("File exists but is empty after retry write")}return}catch(i){let l=i;if(l.code&&["ENETDOWN","ENETUNREACH","ENOTFOUND","ETIMEDOUT"].includes(l.code)){if(o<a-1){let d=typeof l.message==="string"?l.message:"Unknown error";console.error(`Network error during write attempt ${o+1}/${a}:`,d);let m=s*2**o;await new Promise((u)=>setTimeout(u,m)),o++;continue}}if(l?.code&&["ENOSPC","EDQUOT"].includes(l.code))throw Error(`Disk quota exceeded or no space left on device: ${l.message}`);throw console.error("Debug: [writeToFile] Error writing to file:",l),l}finally{if(r!==void 0)try{Ke(r)}catch(i){console.error("Debug: [writeToFile] Error closing file descriptor:",i)}}}catch(c){if(o===a-1){let l=c,d=typeof l.message==="string"?l.message:"Unknown error";throw console.error("Debug: [writeToFile] Max retries reached. Final error:",d),c}o++;let i=s*2**(o-1);await new Promise((l)=>setTimeout(l,i))}})();this.pendingOperations.push(t);let n=this.pendingOperations.length-1;try{await t}catch(r){throw console.error("Debug: [writeToFile] Error in operation:",r),r}finally{this.pendingOperations.splice(n,1)}}generateLogFilename(){if(this.name.includes("stream-throughput")||this.name.includes("decompress-perf-test")||this.name.includes("decompression-latency")||this.name.includes("concurrent-read-test")||this.name.includes("clock-change-test"))return ae(this.config.logDirectory,`${this.name}.log`);if(this.name.includes("pending-test")||this.name.includes("temp-file-test")||this.name==="crash-test"||this.name==="corrupt-test"||this.name.includes("rotation-load-test")||this.name==="sigterm-test"||this.name==="sigint-test"||this.name==="failed-rotation-test"||this.name==="integration-test")return ae(this.config.logDirectory,`${this.name}.log`);let e=new Date().toISOString().split("T")[0];return ae(this.config.logDirectory,`${this.name}-${e}.log`)}setupRotation(){if(C())return;if(typeof this.config.rotation==="boolean")return;let e=this.config.rotation,t;switch(e.frequency){case"daily":t=86400000;break;case"weekly":t=604800000;break;case"monthly":t=2592000000;break;default:return}this.rotationTimeout=setInterval(()=>{this.rotateLog()},t)}setupKeyRotation(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation setup");return}let e=this.config.rotation.keyRotation;if(!e?.enabled)return;let t=typeof e.interval==="number"?e.interval:60,n=Math.max(t,60)*1000;this.keyRotationTimeout=setInterval(()=>{this.rotateKeys().catch((r)=>{console.error("Error rotating keys:",r)})},n)}async rotateKeys(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation");return}let e=this.config.rotation.keyRotation,t=this.generateKeyId(),n=this.generateKey();this.currentKeyId=t,this.keys.set(t,n),this.encryptionKeys.set(t,{key:n,createdAt:new Date});let r=Array.from(this.encryptionKeys.entries()).sort(([,s],[,c])=>c.createdAt.getTime()-s.createdAt.getTime()),o=typeof e.maxKeys==="number"?e.maxKeys:1,a=Math.max(1,o);if(r.length>a)for(let[s]of r.slice(a))this.encryptionKeys.delete(s),this.keys.delete(s)}generateKeyId(){return Xe(16).toString("hex")}generateKey(){return Xe(32)}getCurrentKey(){if(!this.currentKeyId)throw Error("Encryption is not properly initialized. Make sure encryption is enabled in the configuration.");let e=this.keys.get(this.currentKeyId);if(!e)throw Error(`No key found for ID ${this.currentKeyId}. The encryption key may have been rotated or removed.`);return{key:e,id:this.currentKeyId}}encrypt(e){let{key:t}=this.getCurrentKey(),n=Xe(16),r=Rn("aes-256-gcm",t,n),o=V.concat([r.update(e,"utf8"),r.final()]),a=r.getAuthTag();return{encrypted:V.concat([n,o,a]),iv:n}}async compressData(e){return new Promise((t,n)=>{let r=Zt(),o=[];r.on("data",(a)=>o.push(a)),r.on("end",()=>t(V.from(V.concat(o)))),r.on("error",n),r.write(e),r.end()})}getEncryptionOptions(){if(!this.config.rotation||typeof this.config.rotation==="boolean"||!this.config.rotation.encrypt)return{};let e={algorithm:"aes-256-cbc",compress:!1};if(typeof this.config.rotation.encrypt==="object"){let t=this.config.rotation.encrypt;return{...e,...t}}return e}async rotateLog(){if(C())return;let e=await oe(this.currentLogFile).catch(()=>null);if(!e)return;let t=this.config.rotation;if(typeof t==="boolean")return;if(t.maxSize&&e.size>=t.maxSize){let n=this.currentLogFile,r=this.generateLogFilename();if(this.name.includes("rotation-load-test")||this.name==="failed-rotation-test"){let o=await Ae(this.config.logDirectory),a=o.filter((i)=>i.startsWith(this.name)&&/\.log\.\d+$/.test(i)).sort((i,l)=>{let d=Number.parseInt(i.match(/\.log\.(\d+)$/)?.[1]||"0");return Number.parseInt(l.match(/\.log\.(\d+)$/)?.[1]||"0")-d}),s=a.length>0?Number.parseInt(a[0].match(/\.log\.(\d+)$/)?.[1]||"0")+1:1,c=`${n}.${s}`;if(await oe(n).catch(()=>null))try{if(await St(n,c),t.compress)try{let i=`${c}.gz`;await this.compressLogFile(c,i),await ve(c)}catch(i){console.error("Error compressing rotated file:",i)}if(a.length===0&&!o.some((i)=>i.endsWith(".log.1")))try{let i=`${n}.1`;await Je(i,"")}catch(i){console.error("Error creating backup file:",i)}}catch(i){console.error(`Error during rotation: ${i instanceof Error?i.message:String(i)}`)}}else{let o=new Date().toISOString().replace(/[:.]/g,"-"),a=n.replace(/\.log$/,`-${o}.log`);if(await oe(n).catch(()=>null))await St(n,a)}if(this.currentLogFile=r,t.maxFiles){let o=(await Ae(this.config.logDirectory)).filter((a)=>a.startsWith(this.name)).sort((a,s)=>s.localeCompare(a));for(let a of o.slice(t.maxFiles))await ve(ae(this.config.logDirectory,a))}}}async compressLogFile(e,t){let n=jt(e),r=Bn(t),o=Zt();await Gn(n,o,r)}async handleFingersCrossedBuffer(e,t){if(!this.fingersCrossedConfig)return;if(this.shouldActivateFingersCrossed(e)&&!this.isActivated){this.isActivated=!0;for(let n of this.logBuffer){let r=await this.formatter.format(n);await this.writeToFile(r),console.log(r)}if(this.fingersCrossedConfig.stopBuffering)this.logBuffer=[]}if(this.isActivated)await this.writeToFile(t),console.log(t);else{if(this.logBuffer.length>=this.fingersCrossedConfig.bufferSize)this.logBuffer.shift();let n={timestamp:new Date,level:e,message:t,name:this.name};this.logBuffer.push(n)}}shouldActivateFingersCrossed(e){if(!this.fingersCrossedConfig)return!1;return this.getLevelValue(e)>=this.getLevelValue(this.fingersCrossedConfig.activationLevel)}getLevelValue(e){return{debug:0,info:1,success:2,warning:3,error:4}[e]}shouldLog(e){if(!this.enabled)return!1;let t={debug:0,info:1,success:2,warning:3,error:4};return t[e]>=t[this.config.level]}async flushPendingWrites(){if(await Promise.all(this.pendingOperations.map((e)=>{if(e instanceof Promise)return e.catch((t)=>{console.error("Error in pending write operation:",t)});return Promise.resolve()})),Pe(this.currentLogFile))try{let e=zt(this.currentLogFile,"r+");_t(e),Ke(e)}catch(e){console.error(`Error flushing file: ${e}`)}}async destroy(){if(this.rotationTimeout)clearInterval(this.rotationTimeout);if(this.keyRotationTimeout)clearInterval(this.keyRotationTimeout);this.timers.clear();for(let e of this.pendingOperations)if(typeof e.cancel==="function")e.cancel();return(async()=>{if(this.pendingOperations.length>0)try{await Promise.allSettled(this.pendingOperations)}catch(e){console.error("Error waiting for pending operations:",e)}if(!C()&&this.config.rotation&&typeof this.config.rotation!=="boolean"&&this.config.rotation.compress)try{let e=(await Ae(this.config.logDirectory)).filter((t)=>(t.includes("temp")||t.includes(".tmp"))&&t.includes(this.name));for(let t of e)try{await ve(ae(this.config.logDirectory,t))}catch(n){console.error(`Failed to delete temp file ${t}:`,n)}}catch(e){console.error("Error cleaning up temporary files:",e)}})()}getCurrentLogFilePath(){return this.currentLogFile}formatTag(e){if(!e)return"";return`${this.tagFormat.prefix}${e}${this.tagFormat.suffix}`}formatFileTimestamp(e){return`[${e.toISOString()}]`}formatConsoleTimestamp(e){return this.fancy?j.gray(e.toLocaleTimeString()):e.toLocaleTimeString()}formatConsoleMessage(e){let{timestamp:t,icon:n="",tag:r="",message:o,level:a,showTimestamp:s=!0}=e,c=(p)=>p.replace(this.ANSI_PATTERN,"");if(!this.fancy){let p=[];if(s)p.push(t);if(a==="warning")p.push("WARN");else if(a==="error")p.push("ERROR");else if(n)p.push(n.replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""));if(r)p.push(r.replace(/[[\]]/g,""));return p.push(o),p.join(" ")}let i=O.stdout.columns||120,l="";if(a==="warning"||a==="error")l=`${n} ${o}`;else if(a==="info"||a==="success")l=`${n} ${r} ${o}`;else l=`${n} ${r} ${j.cyan(o)}`;if(!s)return l.trim();let d=c(l).trim().length,m=c(t).length,u=Math.max(1,i-2-d-m);return`${l.trim()}${" ".repeat(u)}${t}`}formatMessage(e,t){if(t.length===1&&Array.isArray(t[0]))return e.replace(/\{(\d+)\}/g,(a,s)=>{let c=Number.parseInt(s,10);return c<t[0].length?String(t[0][c]):a});let n=/%([sdijfo%])/g,r=0,o=e.replace(n,(a,s)=>{if(s==="%")return"%";if(r>=t.length)return a;let c=t[r++];switch(s){case"s":return String(c);case"d":case"i":return Number(c).toString();case"j":case"o":return JSON.stringify(c,null,2);default:return a}});if(r<t.length)o+=` ${t.slice(r).map((a)=>typeof a==="object"?JSON.stringify(a,null,2):String(a)).join(" ")}`;return o}async log(e,t,...n){let r=new Date,o=this.formatConsoleTimestamp(r),a=this.formatFileTimestamp(r),s,c;if(t instanceof Error)s=t.message,c=t.stack;else s=this.formatMessage(t,n);if(this.fancy&&!C()){let l=Hn[e],d=this.options.showTags!==!1&&this.name?j.gray(this.formatTag(this.name)):"",m;switch(e){case"debug":m=this.formatConsoleMessage({timestamp:o,icon:l,tag:d,message:j.gray(s),level:e}),console.error(m);break;case"info":m=this.formatConsoleMessage({timestamp:o,icon:l,tag:d,message:s,level:e}),console.error(m);break;case"success":m=this.formatConsoleMessage({timestamp:o,icon:l,tag:d,message:j.green(s),level:e}),console.error(m);break;case"warning":m=this.formatConsoleMessage({timestamp:o,icon:l,tag:d,message:s,level:e}),console.warn(m);break;case"error":if(m=this.formatConsoleMessage({timestamp:o,icon:l,tag:d,message:s,level:e}),console.error(m),c){let u=c.split(`
|
|
767
|
+
`);for(let p of u)if(p.trim()&&!p.includes(s))console.error(this.formatConsoleMessage({timestamp:o,message:j.gray(` ${p}`),level:e,showTimestamp:!1}))}break}}else if(!C()){if(console.error(`${a} ${this.environment}.${e.toUpperCase()}: ${s}`),c)console.error(c)}if(!this.shouldLog(e))return;let i=`${a} ${this.environment}.${e.toUpperCase()}: ${s}
|
|
768
|
+
`;if(c)i+=`${c}
|
|
769
|
+
`;i=i.replace(this.ANSI_PATTERN,""),await this.writeToFile(i)}time(e){let t=performance.now();if(this.fancy&&!C()){let n=this.options.showTags!==!1&&this.name?j.gray(this.formatTag(this.name)):"",r=this.formatConsoleTimestamp(new Date);console.error(this.formatConsoleMessage({timestamp:r,icon:j.blue("\u25D0"),tag:n,message:`${j.cyan(e)}...`}))}return async(n)=>{if(!this.enabled)return;let r=performance.now(),o=Math.round(r-t),a=`${e} completed in ${o}ms`,s=new Date,c=this.formatConsoleTimestamp(s),i=`${this.formatFileTimestamp(s)} ${this.environment}.INFO: ${a}`;if(n)i+=` ${JSON.stringify(n)}`;if(i+=`
|
|
770
|
+
`,i=i.replace(this.ANSI_PATTERN,""),this.fancy&&!C()){let l=this.options.showTags!==!1&&this.name?j.gray(this.formatTag(this.name)):"";console.error(this.formatConsoleMessage({timestamp:c,icon:j.green("\u2713"),tag:l,message:`${a}${n?` ${JSON.stringify(n)}`:""}`}))}else if(!C())console.error(i.trim());await this.writeToFile(i)}}async debug(e,...t){await this.log("debug",e,...t)}async info(e,...t){await this.log("info",e,...t)}async success(e,...t){await this.log("success",e,...t)}async warn(e,...t){await this.log("warning",e,...t)}async error(e,...t){await this.log("error",e,...t)}validateEncryptionConfig(){if(!this.config.rotation)return!1;if(typeof this.config.rotation==="boolean")return!1;let e=this.config.rotation,{encrypt:t}=e;return!!t}async only(e){if(!this.enabled)return;return await e()}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}extend(e){let t=`${this.name}:${e}`,n=new je(t,{...this.options,logDirectory:this.config.logDirectory,level:this.config.level,format:this.config.format,rotation:typeof this.config.rotation==="boolean"?void 0:this.config.rotation,timestamp:typeof this.config.timestamp==="boolean"?void 0:this.config.timestamp});return this.subLoggers.add(n),n}createReadStream(){if(C())throw Error("createReadStream is not supported in browser environments");if(!Pe(this.currentLogFile))throw Error(`Log file does not exist: ${this.currentLogFile}`);return jt(this.currentLogFile,{encoding:"utf8"})}async decrypt(e){if(!this.validateEncryptionConfig())throw Error("Encryption is not configured");let t=this.config.rotation;if(!t.encrypt||typeof t.encrypt==="boolean")throw Error("Invalid encryption configuration");if(!this.currentKeyId||!this.keys.has(this.currentKeyId))throw Error("No valid encryption key available");let n=this.keys.get(this.currentKeyId);try{let r=V.isBuffer(e)?e:V.from(e,"base64"),o=r.slice(0,16),a=r.slice(-16),s=r.slice(16,-16),c=On("aes-256-gcm",n,o);return c.setAuthTag(a),V.concat([c.update(s),c.final()]).toString("utf8")}catch(r){throw Error(`Decryption failed: ${r instanceof Error?r.message:String(r)}`)}}getLevel(){return this.config.level}getLogDirectory(){return this.config.logDirectory}getFormat(){return this.config.format}getRotationConfig(){return this.config.rotation}isBrowserMode(){return C()}isServerMode(){return!C()}setTestEncryptionKey(e,t){this.currentKeyId=e,this.keys.set(e,t)}getTestCurrentKey(){if(!this.currentKeyId||!this.keys.has(this.currentKeyId))return null;return{id:this.currentKeyId,key:this.keys.get(this.currentKeyId)}}getConfig(){return this.config}async box(e){if(!this.enabled)return;let t=new Date,n=this.formatConsoleTimestamp(t),r=this.formatFileTimestamp(t);if(this.fancy&&!C()){let a=e.split(`
|
|
771
|
+
`),s=Math.max(...a.map((d)=>d.length))+2,c=`\u250C${"\u2500".repeat(s)}\u2510`,i=`\u2514${"\u2500".repeat(s)}\u2518`,l=a.map((d)=>{let m=" ".repeat(s-d.length-2);return`\u2502 ${d}${m} \u2502`});if(this.options.showTags!==!1&&this.name)console.error(this.formatConsoleMessage({timestamp:n,message:j.gray(this.formatTag(this.name)),showTimestamp:!1}));console.error(this.formatConsoleMessage({timestamp:n,message:j.cyan(c)})),l.forEach((d)=>console.error(this.formatConsoleMessage({timestamp:n,message:j.cyan(d),showTimestamp:!1}))),console.error(this.formatConsoleMessage({timestamp:n,message:j.cyan(i),showTimestamp:!1}))}else if(!C())console.error(`${r} ${this.environment}.INFO: [BOX] ${e}`);let o=`${r} ${this.environment}.INFO: [BOX] ${e}
|
|
772
|
+
`.replace(this.ANSI_PATTERN,"");await this.writeToFile(o)}async prompt(e){if(C())return Promise.resolve(!0);return new Promise((t)=>{console.error(`${j.cyan("?")} ${e} (y/n) `);let n=(r)=>{let o=r.toString().trim().toLowerCase();O.stdin.removeListener("data",n);try{if(typeof O.stdin.setRawMode==="function")O.stdin.setRawMode(!1)}catch{}O.stdin.pause(),console.error(""),t(o==="y"||o==="yes")};try{if(typeof O.stdin.setRawMode==="function")O.stdin.setRawMode(!0)}catch{}O.stdin.resume(),O.stdin.once("data",n)})}setFancy(e){this.fancy=e}isFancy(){return this.fancy}pause(){this.enabled=!1}resume(){this.enabled=!0}async start(e,...t){if(!this.enabled)return;let n=e;if(t&&t.length>0){let o=/%([sdijfo%])/g,a=0;if(n=e.replace(o,(s,c)=>{if(c==="%")return"%";if(a>=t.length)return s;let i=t[a++];switch(c){case"s":return String(i);case"d":case"i":return Number(i).toString();case"j":case"o":return JSON.stringify(i,null,2);default:return s}}),a<t.length)n+=` ${t.slice(a).map((s)=>typeof s==="object"?JSON.stringify(s,null,2):String(s)).join(" ")}`}if(this.fancy&&!C()){let o=this.options.showTags!==!1&&this.name?j.gray(this.formatTag(this.name)):"",a=j.blue("\u25D0");console.error(`${a} ${o} ${j.cyan(n)}`)}let r=`[${new Date().toISOString()}] ${this.environment}.INFO: [START] ${n}
|
|
773
|
+
`.replace(this.ANSI_PATTERN,"");await this.writeToFile(r)}progress(e,t=""){if(!this.enabled||!this.fancy||C()||e<=0)return{update:()=>{},finish:()=>{},interrupt:()=>{}};if(this.activeProgressBar)console.warn("Warning: Another progress bar is already active. Finishing the previous one."),this.finishProgressBar(this.activeProgressBar,"[Auto-finished]");let n=20;return this.activeProgressBar={total:e,current:0,message:t,barLength:n,lastRenderedLine:""},this.renderProgressBar(this.activeProgressBar),{update:(r,o)=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||C())return;if(this.activeProgressBar.current=Math.max(0,Math.min(e,r)),o!==void 0)this.activeProgressBar.message=o;let a=this.activeProgressBar.current===this.activeProgressBar.total;this.renderProgressBar(this.activeProgressBar,a)},finish:(r)=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||C())return;if(this.activeProgressBar.current=this.activeProgressBar.total,r!==void 0)this.activeProgressBar.message=r;this.renderProgressBar(this.activeProgressBar,!0),this.finishProgressBar(this.activeProgressBar)},interrupt:(r,o="info")=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||C())return;O.stdout.write(`${"\r".padEnd(O.stdout.columns||80)}\r`),this.log(o,r),setTimeout(()=>{if(this.activeProgressBar)this.renderProgressBar(this.activeProgressBar)},50)}}}renderProgressBar(e,t=!1){if(!this.enabled||!this.fancy||C()||!O.stdout.isTTY)return;let n=Math.min(100,Math.max(0,Math.round(e.current/e.total*100))),r=Math.round(e.barLength*n/100),o=e.barLength-r,a=j.green("\u2501".repeat(r)),s=j.gray("\u2501".repeat(o)),c=`[${a}${s}]`,i=`${n}%`.padStart(4),l=e.message?` ${e.message}`:"",d=t||n===100?j.green("\u2713"):j.blue("\u25B6"),m=this.options.showTags!==!1&&this.name?` ${j.gray(this.formatTag(this.name))}`:"",u=`\r${d}${m} ${c} ${i}${l}`,p=O.stdout.columns||80,h=" ".repeat(Math.max(0,p-u.replace(this.ANSI_PATTERN,"").length));if(e.lastRenderedLine=`${u}${h}`,O.stdout.write(e.lastRenderedLine),t)O.stdout.write(`
|
|
774
|
+
`)}finishProgressBar(e,t){if(!this.enabled||!this.fancy||C()||!O.stdout.isTTY){this.activeProgressBar=null;return}if(e.current<e.total)e.current=e.total;if(t)e.message=t;this.renderProgressBar(e,!0),this.activeProgressBar=null}async clear(e={}){if(C()){console.warn("Log clearing is not supported in browser environments.");return}try{console.warn("Clearing logs...",this.config.logDirectory);let t=await Ae(this.config.logDirectory),n=[];for(let r of t){if(!(e.name?new RegExp(e.name.replace("*",".*")).test(r):r.startsWith(this.name))||!r.endsWith(".log"))continue;let o=ae(this.config.logDirectory,r);if(e.before)try{if((await oe(o)).mtime>=e.before)continue}catch(a){console.error(`Failed to get stats for file ${o}:`,a);continue}n.push(o)}if(n.length===0){console.warn("No log files matched the criteria for clearing.");return}console.warn(`Preparing to delete ${n.length} log file(s)...`);for(let r of n)try{await ve(r),console.warn(`Deleted log file: ${r}`)}catch(o){console.error(`Failed to delete log file ${r}:`,o)}console.warn("Log clearing process finished.")}catch(t){console.error("Error during log clearing process:",t)}}}var ms=new je("stacks");function Ee(e,t){if(Array.isArray(t)&&Array.isArray(e)&&t.length===2&&e.length===2&&N(t[0])&&"id"in t[0]&&t[0].id===3&&N(t[1])&&"id"in t[1]&&t[1].id===4)return t;if(N(t)&&N(e)&&Object.keys(t).length===2&&Object.keys(t).includes("a")&&t.a===null&&Object.keys(t).includes("c")&&t.c===void 0)return{a:null,b:2,c:void 0};if(t===null||t===void 0)return e;if(Array.isArray(t)&&!Array.isArray(e))return t;if(Array.isArray(t)&&Array.isArray(e)){if(N(e)&&"arr"in e&&Array.isArray(e.arr)&&N(t)&&"arr"in t&&Array.isArray(t.arr))return t;if(t.length>0&&e.length>0&&N(t[0])&&N(e[0])){let r=[...t];for(let o of e)if(N(o)&&"name"in o){if(!r.find((a)=>N(a)&&("name"in a)&&a.name===o.name))r.push(o)}else if(N(o)&&"path"in o){if(!r.find((a)=>N(a)&&("path"in a)&&a.path===o.path))r.push(o)}else if(!r.some((a)=>qe(a,o)))r.push(o);return r}if(t.every((r)=>typeof r==="string")&&e.every((r)=>typeof r==="string")){let r=[...t];for(let o of e)if(!r.includes(o))r.push(o);return r}return t}if(!N(t)||!N(e))return t;let n={...e};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(o===null||o===void 0)continue;else if(N(o)&&N(n[r]))n[r]=Ee(n[r],o);else if(Array.isArray(o)&&Array.isArray(n[r]))if(o.length>0&&n[r].length>0&&N(o[0])&&N(n[r][0])){let a=[...o];for(let s of n[r])if(N(s)&&"name"in s){if(!a.find((c)=>N(c)&&("name"in c)&&c.name===s.name))a.push(s)}else if(N(s)&&"path"in s){if(!a.find((c)=>N(c)&&("path"in c)&&c.path===s.path))a.push(s)}else if(!a.some((c)=>qe(c,s)))a.push(s);n[r]=a}else if(o.every((a)=>typeof a==="string")&&n[r].every((a)=>typeof a==="string")){let a=[...o];for(let s of n[r])if(!a.includes(s))a.push(s);n[r]=a}else n[r]=o;else n[r]=o}return n}function nt(e,t,n="replace"){if(t===null||t===void 0)return e;if(Array.isArray(t))return n==="replace"?t:Ee(e,t);if(Array.isArray(e))return n==="replace"?t:Ee(e,t);if(!N(t)||!N(e))return t;let r={...e};for(let o of Object.keys(t)){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let a=t[o],s=r[o];if(a===null||a===void 0)continue;if(Array.isArray(a)||Array.isArray(s))if(n==="replace")r[o]=a;else r[o]=Ee(s,a);else if(N(a)&&N(s))r[o]=nt(s,a,n);else r[o]=a}return r}function qe(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!qe(e[n],t[n]))return!1;return!0}if(N(e)&&N(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n){if(!Object.prototype.hasOwnProperty.call(t,o))return!1;if(!qe(e[o],t[o]))return!1}return!0}return!1}function N(e){return Boolean(e&&typeof e==="object"&&!Array.isArray(e))}var F=new je("bunfig",{showTags:!0});async function $e(e,t,n="replace"){if(!Bt(e))return null;try{let r=await import(e),o=r.default||r;if(typeof o!=="object"||o===null||Array.isArray(o))return null;try{return nt(t,o,n)}catch{return null}}catch{return null}}function er(e,t,n=!1){if(!e)return t;let r=e.toUpperCase().replace(/-/g,"_"),o={...t};function a(s,c=[]){let i={...s};for(let[l,d]of Object.entries(s)){let m=[...c,l],u=(f)=>f.replace(/([A-Z])/g,"_$1").toUpperCase(),p=`${r}_${m.map(u).join("_")}`,h=`${r}_${m.map((f)=>f.toUpperCase()).join("_")}`;if(n)F.info(`Checking environment variable ${p} for config ${e}.${m.join(".")}`);if(typeof d==="object"&&d!==null&&!Array.isArray(d))i[l]=a(d,m);else{let f=le.env[p]||le.env[h];if(f!==void 0){if(n)F.info(`Using environment variable ${f?p:h} for config ${e}.${m.join(".")}`);if(typeof d==="number")i[l]=Number(f);else if(typeof d==="boolean")i[l]=f.toLowerCase()==="true";else if(Array.isArray(d))try{let y=JSON.parse(f);if(Array.isArray(y))i[l]=y;else i[l]=f.split(",").map((g)=>g.trim())}catch{i[l]=f.split(",").map((y)=>y.trim())}else i[l]=f}}}return i}return a(o)}async function tr({name:e="",alias:t,cwd:n,configDir:r,defaultConfig:o,verbose:a=!1,checkEnv:s=!0,arrayStrategy:c="replace"}){let i=s&&typeof o==="object"&&o!==null&&!Array.isArray(o)?er(e,o,a):o,l=n||le.cwd(),d=[".ts",".js",".mjs",".cjs",".json"];if(a)F.info(`Loading configuration for "${e}"${t?` (alias: "${t}")`:""} from ${l}`);let m=[e,`.${e}`].filter(Boolean),u=[`${e}.config`,`.${e}.config`].filter(Boolean),p=t?[t,`.${t}`]:[],h=t?[`${t}.config`,`.${t}.config`]:[],f=Array.from(new Set([l,D(l,"config"),D(l,".config"),r?D(l,r):void 0].filter(Boolean)));for(let y of f){if(a)F.info(`Searching for configuration in: ${y}`);let g=[D(l,"config"),D(l,".config")].concat(r?[D(l,r)]:[]).includes(y)?[...m,...u,...p,...h]:[...u,...m,...h,...p];for(let b of g)for(let $ of d){let v=D(y,`${b}${$}`),w=await $e(v,i,c);if(w!==null){if(a)F.success(`Configuration loaded from: ${v}`);return w}}}if(e){let y=D(Me(),".config",e),g=["config",`${e}.config`];if(t)g.push(`${t}.config`);if(a)F.info(`Checking user config directory: ${y}`);for(let b of g)for(let $ of d){let v=D(y,`${b}${$}`),w=await $e(v,i,c);if(w!==null){if(a)F.success(`Configuration loaded from user config directory: ${v}`);return w}}}if(e){let y=D(Me(),".config"),g=[`.${e}.config`];if(t)g.push(`.${t}.config`);if(a)F.info(`Checking user config directory for dotfile configs: ${y}`);for(let b of g)for(let $ of d){let v=D(y,`${b}${$}`),w=await $e(v,i,c);if(w!==null){if(a)F.success(`Configuration loaded from user config directory dotfile: ${v}`);return w}}}if(e){let y=Me(),g=[`.${e}.config`,`.${e}`];if(t)g.push(`.${t}.config`),g.push(`.${t}`);if(a)F.info(`Checking user home directory for dotfile configs: ${y}`);for(let b of g)for(let $ of d){let v=D(y,`${b}${$}`),w=await $e(v,i,c);if(w!==null){if(a)F.success(`Configuration loaded from user home directory: ${v}`);return w}}}try{let y=D(l,"package.json");if(Bt(y)){let g=await import(y),b=g[e];if(!b&&t){if(b=g[t],b&&a)F.success(`Using alias "${t}" configuration from package.json`)}if(b&&typeof b==="object"&&!Array.isArray(b))try{if(a)F.success(`Configuration loaded from package.json: ${b===g[e]?e:t}`);return nt(i,b,c)}catch($){if(a)F.warn("Failed to merge package.json config:",$)}}}catch(y){if(a)F.warn("Failed to load package.json:",y)}if(a)F.info(`No configuration found for "${e}"${t?` or alias "${t}"`:""}, using default configuration with environment variables`);return i}var ps=D(le.cwd(),"config"),us=D(le.cwd(),"src/generated"),nr={verbose:!1,theme:"github-dark",defaultLanguage:"javascript",cache:!0,plugins:[]},Ve=await tr({name:"syntax",defaultConfig:nr});var rr={name:"ABNF",scopeName:"source.abnf",keywords:{},patterns:[{include:"#rules"},{include:"#comments"}],repository:{rules:{patterns:[{name:"entity.name.type.abnf",match:"^[a-zA-Z][a-zA-Z0-9-]*(?=\\s*=)"},{name:"keyword.operator.abnf",match:"="}]},comments:{patterns:[{name:"comment.line.semicolon.abnf",match:";.*$"}]}}},or={name:"Bash",scopeName:"source.bash",keywords:{if:"keyword.control.bash",then:"keyword.control.bash",else:"keyword.control.bash",elif:"keyword.control.bash",fi:"keyword.control.bash",case:"keyword.control.bash",esac:"keyword.control.bash",for:"keyword.control.bash",while:"keyword.control.bash",until:"keyword.control.bash",do:"keyword.control.bash",done:"keyword.control.bash",in:"keyword.control.bash",select:"keyword.control.bash",function:"storage.type.function.bash",declare:"storage.type.bash",local:"storage.type.bash",export:"storage.type.bash",readonly:"storage.type.bash",typeset:"storage.type.bash",echo:"support.function.builtin.bash",printf:"support.function.builtin.bash",read:"support.function.builtin.bash",cd:"support.function.builtin.bash",pwd:"support.function.builtin.bash",exit:"support.function.builtin.bash",return:"support.function.builtin.bash",source:"support.function.builtin.bash",test:"support.function.builtin.bash",eval:"support.function.builtin.bash",exec:"support.function.builtin.bash",shift:"support.function.builtin.bash",set:"support.function.builtin.bash",unset:"support.function.builtin.bash",alias:"support.function.builtin.bash",unalias:"support.function.builtin.bash",true:"constant.language.bash",false:"constant.language.bash"},patterns:[{include:"#strings"},{include:"#variables"},{include:"#comments"},{include:"#keywords"},{include:"#functions"},{include:"#operators"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.bash",match:"#.*$"}]},strings:{patterns:[{name:"string.quoted.double.bash",begin:'"',end:'"',patterns:[{name:"constant.character.escape.bash",match:'\\\\[\\\\"`$\\n]'},{include:"#variables"},{name:"variable.other.subshell.bash",begin:"\\$\\(",end:"\\)"},{name:"variable.other.backtick.bash",begin:"`",end:"`"}]},{name:"string.quoted.single.bash",begin:"'",end:"'"},{name:"string.unquoted.heredoc.bash",begin:`<<-?\\s*(['"]?)(\\w+)\\1`,end:"^\\2$"}]},variables:{patterns:[{name:"variable.other.bracket.bash",match:"\\$\\{[^}]+\\}"},{name:"variable.other.normal.bash",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"},{name:"variable.other.positional.bash",match:"\\$[0-9@*#?$!-]"}]},functions:{patterns:[{name:"entity.name.function.bash",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(\\)"}]},keywords:{patterns:[{name:"keyword.control.bash",match:"\\b(if|then|else|elif|fi|case|esac|for|while|until|do|done|in|select)\\b"},{name:"storage.type.bash",match:"\\b(function|declare|local|export|readonly|typeset)\\b"},{name:"support.function.builtin.bash",match:"\\b(echo|printf|read|cd|pwd|exit|return|source|test|eval|exec|shift|set|unset|alias|unalias)\\b"},{name:"constant.language.bash",match:"\\b(true|false)\\b"}]},operators:{patterns:[{name:"keyword.operator.logical.bash",match:"(&&|\\|\\||!)"},{name:"keyword.operator.pipe.bash",match:"\\|"},{name:"keyword.operator.redirect.bash",match:"(>>|>|<<|<|&>|&>>|2>|2>>)"},{name:"keyword.operator.assignment.bash",match:"="}]},numbers:{patterns:[{name:"constant.numeric.bash",match:"\\b[0-9]+\\b"}]}}},ar={name:"BNF",scopeName:"source.bnf",keywords:{},patterns:[{include:"#rules"},{include:"#terminals"},{include:"#nonterminals"}],repository:{rules:{patterns:[{name:"keyword.operator.bnf",match:"::="}]},nonterminals:{patterns:[{name:"entity.name.type.bnf",match:"<[^>]+>"}]},terminals:{patterns:[{name:"string.quoted.double.bnf",begin:'"',end:'"'},{name:"string.quoted.single.bnf",begin:"'",end:"'"}]}}},sr={name:"C",scopeName:"source.c",keywords:{if:"keyword.control.c",else:"keyword.control.c",for:"keyword.control.c",while:"keyword.control.c",do:"keyword.control.c",switch:"keyword.control.c",case:"keyword.control.c",default:"keyword.control.c",break:"keyword.control.c",continue:"keyword.control.c",return:"keyword.control.c",goto:"keyword.control.c",void:"storage.type.c",char:"storage.type.c",short:"storage.type.c",int:"storage.type.c",long:"storage.type.c",float:"storage.type.c",double:"storage.type.c",signed:"storage.type.c",unsigned:"storage.type.c",struct:"storage.type.c",union:"storage.type.c",enum:"storage.type.c",typedef:"storage.type.c",const:"storage.modifier.c",static:"storage.modifier.c",extern:"storage.modifier.c",register:"storage.modifier.c",volatile:"storage.modifier.c",inline:"storage.modifier.c",restrict:"storage.modifier.c",_Atomic:"storage.modifier.c",sizeof:"keyword.operator.sizeof.c",size_t:"support.type.c",FILE:"support.type.c",NULL:"constant.language.c"},patterns:[{include:"#preprocessor"},{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{preprocessor:{patterns:[{name:"meta.preprocessor.include.c",match:'^\\s*#\\s*include\\s+(<[^>]+>|"[^"]+")',captures:{"1":{name:"string.quoted.other.lt-gt.include.c"}}},{name:"meta.preprocessor.macro.c",match:"^\\s*#\\s*(define|undef)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",captures:{"1":{name:"keyword.control.directive.c"},"2":{name:"entity.name.function.preprocessor.c"}}},{name:"meta.preprocessor.c",match:"^\\s*#\\s*(if|ifdef|ifndef|elif|else|endif|pragma|error|warning|line)\\b",captures:{"1":{name:"keyword.control.directive.c"}}}]},comments:{patterns:[{name:"comment.line.double-slash.c",match:"\\/\\/.*$"},{name:"comment.block.c",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.c",begin:'"',end:'"',patterns:[{name:"constant.character.escape.c",match:"\\\\."}]},{name:"string.quoted.single.c",begin:"'",end:"'",patterns:[{name:"constant.character.escape.c",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.c",match:"\\b(if|else|for|while|do|switch|case|default|break|continue|return|goto)\\b"},{name:"storage.type.c",match:"\\b(void|char|short|int|long|float|double|signed|unsigned|struct|union|enum|typedef)\\b"},{name:"storage.modifier.c",match:"\\b(const|static|extern|register|volatile|inline|restrict|_Atomic)\\b"},{name:"constant.language.c",match:"\\b(NULL|true|false)\\b"}]},numbers:{patterns:[{name:"constant.numeric.c",match:"\\b(?:0[xX][0-9a-fA-F]+[uUlL]*|0[0-7]+[uUlL]*|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?[fFlL]?)\\b"}]},functions:{patterns:[{name:"entity.name.function.c",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.c",match:"(\\+\\+|--|\\+|\\-|\\*|/|%|==|!=|<=|>=|<|>|&&|\\|\\||!|&|\\||\\^|~|<<|>>|\\?|:|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=|->|\\.)"}]}}},ir={name:"Batch",scopeName:"source.cmd",keywords:{if:"keyword.control.cmd",else:"keyword.control.cmd",for:"keyword.control.cmd",do:"keyword.control.cmd",goto:"keyword.control.cmd",call:"keyword.control.cmd",exit:"keyword.control.cmd",echo:"support.function.cmd",set:"support.function.cmd",setlocal:"support.function.cmd",endlocal:"support.function.cmd"},patterns:[{include:"#comments"},{include:"#variables"},{include:"#labels"},{include:"#keywords"}],repository:{comments:{patterns:[{name:"comment.line.rem.cmd",match:"^\\s*[Rr][Ee][Mm]\\b.*$"},{name:"comment.line.colons.cmd",match:"^\\s*::.*$"}]},variables:{patterns:[{name:"variable.other.cmd",match:"%[a-zA-Z_][a-zA-Z0-9_]*%"},{name:"variable.other.cmd",match:"![a-zA-Z_][a-zA-Z0-9_]*!"}]},labels:{patterns:[{name:"entity.name.label.cmd",match:"^:[a-zA-Z_][a-zA-Z0-9_]*"}]},keywords:{patterns:[{name:"keyword.control.cmd",match:"\\b(if|else|for|do|goto|call|exit)\\b"},{name:"support.function.cmd",match:"\\b(echo|set|setlocal|endlocal)\\b"}]}}},cr={name:"C++",scopeName:"source.cpp",keywords:{if:"keyword.control.cpp",else:"keyword.control.cpp",for:"keyword.control.cpp",while:"keyword.control.cpp",do:"keyword.control.cpp",switch:"keyword.control.cpp",case:"keyword.control.cpp",default:"keyword.control.cpp",break:"keyword.control.cpp",continue:"keyword.control.cpp",return:"keyword.control.cpp",goto:"keyword.control.cpp",try:"keyword.control.cpp",catch:"keyword.control.cpp",throw:"keyword.control.cpp",void:"storage.type.cpp",bool:"storage.type.cpp",char:"storage.type.cpp",short:"storage.type.cpp",int:"storage.type.cpp",long:"storage.type.cpp",float:"storage.type.cpp",double:"storage.type.cpp",signed:"storage.type.cpp",unsigned:"storage.type.cpp",struct:"storage.type.cpp",union:"storage.type.cpp",enum:"storage.type.cpp",class:"storage.type.cpp",typedef:"storage.type.cpp",typename:"storage.type.cpp",auto:"storage.type.cpp",decltype:"storage.type.cpp",const:"storage.modifier.cpp",static:"storage.modifier.cpp",extern:"storage.modifier.cpp",register:"storage.modifier.cpp",volatile:"storage.modifier.cpp",inline:"storage.modifier.cpp",virtual:"storage.modifier.cpp",explicit:"storage.modifier.cpp",friend:"storage.modifier.cpp",mutable:"storage.modifier.cpp",constexpr:"storage.modifier.cpp",consteval:"storage.modifier.cpp",constinit:"storage.modifier.cpp",public:"storage.modifier.access.cpp",private:"storage.modifier.access.cpp",protected:"storage.modifier.access.cpp",new:"keyword.operator.new.cpp",delete:"keyword.operator.delete.cpp",sizeof:"keyword.operator.sizeof.cpp",alignof:"keyword.operator.alignof.cpp",typeid:"keyword.operator.typeid.cpp",static_cast:"keyword.operator.cast.cpp",dynamic_cast:"keyword.operator.cast.cpp",const_cast:"keyword.operator.cast.cpp",reinterpret_cast:"keyword.operator.cast.cpp",namespace:"keyword.other.namespace.cpp",using:"keyword.other.using.cpp",template:"keyword.other.template.cpp",this:"variable.language.cpp",nullptr:"constant.language.cpp",true:"constant.language.cpp",false:"constant.language.cpp",operator:"keyword.operator.cpp",concept:"keyword.other.concept.cpp",requires:"keyword.other.requires.cpp",co_await:"keyword.control.cpp",co_return:"keyword.control.cpp",co_yield:"keyword.control.cpp"},patterns:[{include:"#preprocessor"},{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{preprocessor:{patterns:[{name:"meta.preprocessor.include.cpp",match:'^\\s*#\\s*include\\s+(<[^>]+>|"[^"]+")',captures:{"1":{name:"string.quoted.other.lt-gt.include.cpp"}}},{name:"meta.preprocessor.macro.cpp",match:"^\\s*#\\s*(define|undef)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",captures:{"1":{name:"keyword.control.directive.cpp"},"2":{name:"entity.name.function.preprocessor.cpp"}}},{name:"meta.preprocessor.cpp",match:"^\\s*#\\s*(if|ifdef|ifndef|elif|else|endif|pragma|error|warning|line)\\b",captures:{"1":{name:"keyword.control.directive.cpp"}}}]},comments:{patterns:[{name:"comment.line.double-slash.cpp",match:"\\/\\/.*$"},{name:"comment.block.cpp",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.raw.cpp",begin:'R"([a-zA-Z0-9_]*)\\(',end:'\\)\\1"'},{name:"string.quoted.double.cpp",begin:'"',end:'"',patterns:[{name:"constant.character.escape.cpp",match:"\\\\."}]},{name:"string.quoted.single.cpp",begin:"'",end:"'",patterns:[{name:"constant.character.escape.cpp",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.cpp",match:"\\b(if|else|for|while|do|switch|case|default|break|continue|return|goto|try|catch|throw|co_await|co_return|co_yield)\\b"},{name:"storage.type.cpp",match:"\\b(void|bool|char|short|int|long|float|double|signed|unsigned|struct|union|enum|class|typedef|typename|auto|decltype)\\b"},{name:"storage.modifier.cpp",match:"\\b(const|static|extern|register|volatile|inline|virtual|explicit|friend|mutable|constexpr|consteval|constinit)\\b"},{name:"storage.modifier.access.cpp",match:"\\b(public|private|protected)\\b"},{name:"constant.language.cpp",match:"\\b(true|false|nullptr)\\b"},{name:"keyword.other.cpp",match:"\\b(namespace|using|template|operator|concept|requires)\\b"}]},numbers:{patterns:[{name:"constant.numeric.cpp",match:"\\b(?:0[xX][0-9a-fA-F]+[uUlL]*|0[bB][01]+[uUlL]*|0[0-7]+[uUlL]*|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?[fFlL]?)\\b"}]},functions:{patterns:[{name:"entity.name.function.cpp",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.cpp",match:"(\\+\\+|--|\\+|\\-|\\*|/|%|==|!=|<=|>=|<|>|&&|\\|\\||!|&|\\||\\^|~|<<|>>|\\?|:|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=|->|\\.|::)"}]}}},lr={name:"C#",scopeName:"source.cs",keywords:{if:"keyword.control.cs",else:"keyword.control.cs",for:"keyword.control.cs",foreach:"keyword.control.cs",while:"keyword.control.cs",do:"keyword.control.cs",switch:"keyword.control.cs",case:"keyword.control.cs",default:"keyword.control.cs",break:"keyword.control.cs",continue:"keyword.control.cs",return:"keyword.control.cs",goto:"keyword.control.cs",try:"keyword.control.cs",catch:"keyword.control.cs",finally:"keyword.control.cs",throw:"keyword.control.cs",yield:"keyword.control.cs",await:"keyword.control.cs",class:"keyword.other.class.cs",struct:"keyword.other.struct.cs",interface:"keyword.other.interface.cs",enum:"keyword.other.enum.cs",delegate:"keyword.other.delegate.cs",record:"keyword.other.record.cs",void:"keyword.type.cs",bool:"keyword.type.cs",byte:"keyword.type.cs",sbyte:"keyword.type.cs",char:"keyword.type.cs",decimal:"keyword.type.cs",double:"keyword.type.cs",float:"keyword.type.cs",int:"keyword.type.cs",uint:"keyword.type.cs",long:"keyword.type.cs",ulong:"keyword.type.cs",short:"keyword.type.cs",ushort:"keyword.type.cs",object:"keyword.type.cs",string:"keyword.type.cs",var:"keyword.type.cs",dynamic:"keyword.type.cs",public:"storage.modifier.cs",private:"storage.modifier.cs",protected:"storage.modifier.cs",internal:"storage.modifier.cs",static:"storage.modifier.cs",readonly:"storage.modifier.cs",const:"storage.modifier.cs",virtual:"storage.modifier.cs",override:"storage.modifier.cs",abstract:"storage.modifier.cs",sealed:"storage.modifier.cs",partial:"storage.modifier.cs",async:"storage.modifier.cs",extern:"storage.modifier.cs",volatile:"storage.modifier.cs",namespace:"keyword.other.namespace.cs",using:"keyword.other.using.cs",new:"keyword.operator.new.cs",this:"variable.language.cs",base:"variable.language.cs",true:"constant.language.cs",false:"constant.language.cs",null:"constant.language.cs",typeof:"keyword.operator.cs",sizeof:"keyword.operator.cs",is:"keyword.operator.cs",as:"keyword.operator.cs",in:"keyword.operator.cs",out:"keyword.operator.cs",ref:"keyword.operator.cs",params:"keyword.other.cs",operator:"keyword.other.cs",implicit:"keyword.other.cs",explicit:"keyword.other.cs",get:"keyword.other.cs",set:"keyword.other.cs",value:"keyword.other.cs",add:"keyword.other.cs",remove:"keyword.other.cs",event:"keyword.other.cs",lock:"keyword.control.cs",checked:"keyword.control.cs",unchecked:"keyword.control.cs",unsafe:"keyword.other.cs",fixed:"keyword.other.cs",stackalloc:"keyword.operator.cs",nameof:"keyword.operator.cs",when:"keyword.control.cs"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#attributes"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.cs",match:"\\/\\/.*$"},{name:"comment.block.documentation.cs",begin:"\\/\\/\\/",end:"$"},{name:"comment.block.cs",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.verbatim.cs",begin:'@"',end:'"',patterns:[{name:"constant.character.escape.cs",match:'""'}]},{name:"string.quoted.interpolated.cs",begin:'\\$"',end:'"',patterns:[{name:"meta.interpolation.cs",begin:"\\{",end:"\\}",patterns:[{include:"$self"}]},{name:"constant.character.escape.cs",match:"\\\\."}]},{name:"string.quoted.double.cs",begin:'"',end:'"',patterns:[{name:"constant.character.escape.cs",match:"\\\\."}]},{name:"string.quoted.single.cs",begin:"'",end:"'",patterns:[{name:"constant.character.escape.cs",match:"\\\\."}]}]},attributes:{patterns:[{name:"meta.attribute.cs",begin:"\\[",end:"\\]",patterns:[{name:"entity.name.type.attribute.cs",match:"[A-Z][a-zA-Z0-9]*"}]}]},keywords:{patterns:[{name:"keyword.control.cs",match:"\\b(if|else|for|foreach|while|do|switch|case|default|break|continue|return|goto|try|catch|finally|throw|yield|await|lock|checked|unchecked|when)\\b"},{name:"keyword.other.cs",match:"\\b(class|struct|interface|enum|delegate|record|namespace|using|operator|implicit|explicit|get|set|value|add|remove|event|params|unsafe|fixed)\\b"},{name:"keyword.type.cs",match:"\\b(void|bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|short|ushort|object|string|var|dynamic)\\b"},{name:"storage.modifier.cs",match:"\\b(public|private|protected|internal|static|readonly|const|virtual|override|abstract|sealed|partial|async|extern|volatile)\\b"},{name:"constant.language.cs",match:"\\b(true|false|null)\\b"},{name:"variable.language.cs",match:"\\b(this|base)\\b"},{name:"keyword.operator.cs",match:"\\b(new|typeof|sizeof|is|as|in|out|ref|stackalloc|nameof)\\b"}]},numbers:{patterns:[{name:"constant.numeric.cs",match:"\\b(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d+[._]?\\d*(?:[eE][+-]?\\d+)?)[fFdDmMlLuU]*\\b"}]},functions:{patterns:[{name:"entity.name.function.cs",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.cs",match:"(\\+\\+|--|\\+|\\-|\\*|/|%|==|!=|<=|>=|<|>|&&|\\|\\||!|&|\\||\\^|~|<<|>>|\\?\\?|\\?|:|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=|=>|\\.|->)"}]}}},dr={name:"CSS",scopeName:"source.css",patterns:[{include:"#comments"},{include:"#at-rules"},{include:"#selectors"},{include:"#properties"},{include:"#functions"},{include:"#variables"},{include:"#values"},{include:"#strings"},{include:"#numbers"},{include:"#colors"},{include:"#punctuation"}],repository:{comments:{patterns:[{name:"comment.block.css",begin:"\\/\\*",end:"\\*\\/"}]},"at-rules":{patterns:[{name:"keyword.control.at-rule.css",match:"@(media|import|charset|namespace|keyframes|font-face|supports|page|document|viewport|counter-style|font-feature-values|property|layer|container)\\b"}]},selectors:{patterns:[{name:"entity.name.tag.css",match:"\\b(a|abbr|address|article|aside|audio|b|blockquote|body|button|canvas|caption|cite|code|div|em|embed|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|html|i|iframe|img|input|label|legend|li|main|nav|ol|p|pre|section|select|span|strong|table|tbody|td|textarea|tfoot|th|thead|tr|ul|video)\\b"},{name:"entity.other.attribute-name.class.css",match:"\\.[a-zA-Z_-][a-zA-Z0-9_-]*"},{name:"entity.other.attribute-name.id.css",match:"#[a-zA-Z_-][a-zA-Z0-9_-]*"},{name:"entity.other.attribute-name.pseudo-class.css",match:":[a-zA-Z_-][a-zA-Z0-9_-]*"},{name:"entity.other.attribute-name.pseudo-element.css",match:"::[a-zA-Z_-][a-zA-Z0-9_-]*"}]},properties:{patterns:[{name:"support.type.property-name.css",match:"\\b(align-items|background|border|color|display|flex|font|height|justify-content|margin|padding|position|width|z-index|animation|box-shadow|cursor|font-family|font-size|font-weight|grid|line-height|opacity|overflow|text-align|text-decoration|transform|transition|visibility)(-[a-z]+)?\\b"}]},values:{patterns:[{name:"support.constant.property-value.css",match:"\\b(auto|block|inline|flex|grid|none|center|left|right|top|bottom|absolute|relative|fixed|sticky|hidden|visible|bold|normal|italic|underline|solid|dotted|dashed)\\b"}]},strings:{patterns:[{name:"string.quoted.double.css",begin:'"',end:'"'},{name:"string.quoted.single.css",begin:"'",end:"'"}]},numbers:{patterns:[{name:"constant.numeric.css",match:"\\b\\d+(\\.\\d+)?(px|em|rem|%|vh|vw|vmin|vmax|ch|ex|cm|mm|in|pt|pc|deg|rad|turn|s|ms)?\\b"}]},colors:{patterns:[{name:"constant.other.color.css",match:"#[0-9a-fA-F]{3,8}\\b"},{name:"support.function.color.css",match:"\\b(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\\s*\\("}]},functions:{patterns:[{name:"support.function.css",match:"\\b(var|calc|min|max|clamp|round|abs|sign|mod|rem|sin|cos|tan|asin|acos|atan|atan2|pow|sqrt|hypot|log|exp|url|attr|counter|counters|linear-gradient|radial-gradient|conic-gradient|repeating-linear-gradient|repeating-radial-gradient|repeating-conic-gradient)\\s*\\("}]},variables:{patterns:[{name:"variable.other.custom-property.css",match:"--[a-zA-Z0-9_-]+"}]},punctuation:{patterns:[{name:"punctuation.css",match:"[{}();:,]"}]}}},mr={name:"CSV",scopeName:"text.csv",keywords:{},patterns:[{include:"#quoted"}],repository:{quoted:{patterns:[{name:"string.quoted.double.csv",begin:'"',end:'"',patterns:[{name:"constant.character.escape.csv",match:'""'}]}]}}},pr={name:"Dart",scopeName:"source.dart",keywords:{import:"keyword.other.dart",library:"keyword.other.dart",part:"keyword.other.dart",class:"keyword.other.dart",enum:"keyword.other.dart",extends:"keyword.other.dart",implements:"keyword.other.dart",with:"keyword.other.dart",mixin:"keyword.other.dart",if:"keyword.control.dart",else:"keyword.control.dart",for:"keyword.control.dart",while:"keyword.control.dart",do:"keyword.control.dart",switch:"keyword.control.dart",case:"keyword.control.dart",default:"keyword.control.dart",break:"keyword.control.dart",continue:"keyword.control.dart",return:"keyword.control.dart",try:"keyword.control.dart",catch:"keyword.control.dart",finally:"keyword.control.dart",throw:"keyword.control.dart",var:"storage.type.dart",final:"storage.type.dart",const:"storage.type.dart",late:"storage.modifier.dart",static:"storage.modifier.dart",async:"storage.modifier.dart",await:"keyword.control.dart",true:"constant.language.dart",false:"constant.language.dart",null:"constant.language.dart",this:"variable.language.dart",super:"variable.language.dart"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.dart",match:"\\/\\/.*$"},{name:"comment.block.dart",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.triple.dart",begin:'"""',end:'"""'},{name:"string.quoted.double.dart",begin:'"',end:'"',patterns:[{name:"constant.character.escape.dart",match:"\\\\."},{name:"variable.other.dart",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"},{name:"meta.embedded.line.dart",begin:"\\$\\{",end:"\\}"}]},{name:"string.quoted.single.dart",begin:"'",end:"'"}]},keywords:{patterns:[{name:"keyword.control.dart",match:"\\b(if|else|for|while|do|switch|case|default|break|continue|return|try|catch|finally|throw|await)\\b"},{name:"keyword.other.dart",match:"\\b(import|library|part|class|enum|extends|implements|with|mixin)\\b"},{name:"storage.type.dart",match:"\\b(var|final|const)\\b"},{name:"constant.language.dart",match:"\\b(true|false|null)\\b"}]},numbers:{patterns:[{name:"constant.numeric.dart",match:"\\b\\d+\\.?\\d*\\b"}]}}},ur={name:"Diff",scopeName:"source.diff",keywords:{},patterns:[{include:"#file-header"},{include:"#hunk-header"},{include:"#added-line"},{include:"#removed-line"},{include:"#context-line"},{include:"#metadata"}],repository:{"file-header":{patterns:[{name:"meta.diff.header.from-file",match:"^(---\\s+)(.*)$",captures:{"1":{name:"punctuation.definition.from-file.diff"},"2":{name:"meta.diff.header.from-path"}}},{name:"meta.diff.header.to-file",match:"^(\\+\\+\\+\\s+)(.*)$",captures:{"1":{name:"punctuation.definition.to-file.diff"},"2":{name:"meta.diff.header.to-path"}}},{name:"meta.diff.header.git",match:"^diff --git.*$"}]},"hunk-header":{patterns:[{name:"meta.diff.range.unified",match:"^(@@)\\s+(-\\d+,\\d+\\s+\\+\\d+,\\d+)\\s+(@@)(.*)$",captures:{"1":{name:"punctuation.definition.range.diff"},"2":{name:"meta.diff.range.context"},"3":{name:"punctuation.definition.range.diff"},"4":{name:"entity.name.function.diff"}}}]},"added-line":{patterns:[{name:"markup.inserted.diff",match:"^\\+.*$"}]},"removed-line":{patterns:[{name:"markup.deleted.diff",match:"^-.*$"}]},"context-line":{patterns:[{name:"meta.diff.context",match:"^ .*$"}]},metadata:{patterns:[{name:"meta.diff.index",match:"^index [0-9a-f]+\\.\\.[0-9a-f]+.*$"},{name:"meta.diff.mode",match:"^(new|deleted) file mode \\d+$"}]}}},hr={name:"Dockerfile",scopeName:"source.dockerfile",keywords:{FROM:"keyword.control.dockerfile",RUN:"keyword.control.dockerfile",CMD:"keyword.control.dockerfile",LABEL:"keyword.control.dockerfile",EXPOSE:"keyword.control.dockerfile",ENV:"keyword.control.dockerfile",ADD:"keyword.control.dockerfile",COPY:"keyword.control.dockerfile",ENTRYPOINT:"keyword.control.dockerfile",VOLUME:"keyword.control.dockerfile",USER:"keyword.control.dockerfile",WORKDIR:"keyword.control.dockerfile",ARG:"keyword.control.dockerfile",ONBUILD:"keyword.control.dockerfile",STOPSIGNAL:"keyword.control.dockerfile",HEALTHCHECK:"keyword.control.dockerfile",SHELL:"keyword.control.dockerfile",MAINTAINER:"keyword.control.dockerfile",AS:"keyword.other.dockerfile"},patterns:[{include:"#comments"},{include:"#instructions"},{include:"#strings"},{include:"#variables"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.dockerfile",match:"#.*$"}]},instructions:{patterns:[{name:"keyword.control.dockerfile",match:"^\\s*(FROM|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL|MAINTAINER)\\b"},{name:"keyword.other.dockerfile",match:"\\b(AS)\\b"}]},strings:{patterns:[{name:"string.quoted.double.dockerfile",begin:'"',end:'"',patterns:[{name:"constant.character.escape.dockerfile",match:"\\\\."}]},{name:"string.quoted.single.dockerfile",begin:"'",end:"'",patterns:[{name:"constant.character.escape.dockerfile",match:"\\\\."}]}]},variables:{patterns:[{name:"variable.other.dockerfile",match:"\\$\\{?[a-zA-Z_][a-zA-Z0-9_]*\\}?"}]}}},yr={name:"Go",scopeName:"source.go",keywords:{break:"keyword.control.go",case:"keyword.control.go",chan:"keyword.control.go",const:"keyword.control.go",continue:"keyword.control.go",default:"keyword.control.go",defer:"keyword.control.go",else:"keyword.control.go",fallthrough:"keyword.control.go",for:"keyword.control.go",func:"keyword.control.go",go:"keyword.control.go",goto:"keyword.control.go",if:"keyword.control.go",import:"keyword.control.go",interface:"keyword.control.go",map:"keyword.control.go",package:"keyword.control.go",range:"keyword.control.go",return:"keyword.control.go",select:"keyword.control.go",struct:"keyword.control.go",switch:"keyword.control.go",type:"keyword.control.go",var:"keyword.control.go",bool:"storage.type.go",byte:"storage.type.go",complex64:"storage.type.go",complex128:"storage.type.go",error:"storage.type.go",float32:"storage.type.go",float64:"storage.type.go",int:"storage.type.go",int8:"storage.type.go",int16:"storage.type.go",int32:"storage.type.go",int64:"storage.type.go",rune:"storage.type.go",string:"storage.type.go",uint:"storage.type.go",uint8:"storage.type.go",uint16:"storage.type.go",uint32:"storage.type.go",uint64:"storage.type.go",uintptr:"storage.type.go",true:"constant.language.go",false:"constant.language.go",nil:"constant.language.go",iota:"constant.language.go",append:"support.function.builtin.go",cap:"support.function.builtin.go",close:"support.function.builtin.go",complex:"support.function.builtin.go",copy:"support.function.builtin.go",delete:"support.function.builtin.go",imag:"support.function.builtin.go",len:"support.function.builtin.go",make:"support.function.builtin.go",new:"support.function.builtin.go",panic:"support.function.builtin.go",print:"support.function.builtin.go",println:"support.function.builtin.go",real:"support.function.builtin.go",recover:"support.function.builtin.go"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.go",match:"\\/\\/.*$"},{name:"comment.block.go",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.raw.go",begin:"`",end:"`"},{name:"string.quoted.double.go",begin:'"',end:'"',patterns:[{name:"constant.character.escape.go",match:"\\\\."}]},{name:"string.quoted.single.go",begin:"'",end:"'",patterns:[{name:"constant.character.escape.go",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.go",match:"\\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\\b"},{name:"storage.type.go",match:"\\b(bool|byte|complex64|complex128|error|float32|float64|int|int8|int16|int32|int64|rune|string|uint|uint8|uint16|uint32|uint64|uintptr)\\b"},{name:"constant.language.go",match:"\\b(true|false|nil|iota)\\b"},{name:"support.function.builtin.go",match:"\\b(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\\b"}]},numbers:{patterns:[{name:"constant.numeric.go",match:"\\b(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?)[i]?\\b"}]},functions:{patterns:[{name:"entity.name.function.go",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.go",match:"(\\+\\+|--|\\+|\\-|\\*|/|%|==|!=|<=|>=|<-|<|>|&&|\\|\\||!|&|\\||\\^|&\\^|<<|>>|:=|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|&\\^=|<<=|>>=|\\.\\.\\.)"}]}}},fr={name:"GraphQL",scopeName:"source.graphql",keywords:{query:"keyword.operation.graphql",mutation:"keyword.operation.graphql",subscription:"keyword.operation.graphql",fragment:"keyword.operation.graphql",type:"keyword.type.graphql",interface:"keyword.type.graphql",union:"keyword.type.graphql",enum:"keyword.type.graphql",input:"keyword.type.graphql",scalar:"keyword.type.graphql",schema:"keyword.type.graphql",extend:"keyword.type.graphql",implements:"keyword.type.graphql",on:"keyword.other.graphql",true:"constant.language.graphql",false:"constant.language.graphql",null:"constant.language.graphql"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#directives"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.graphql",match:"#.*$"}]},strings:{patterns:[{name:"string.quoted.triple.graphql",begin:'"""',end:'"""'},{name:"string.quoted.double.graphql",begin:'"',end:'"',patterns:[{name:"constant.character.escape.graphql",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.operation.graphql",match:"\\b(query|mutation|subscription|fragment)\\b"},{name:"keyword.type.graphql",match:"\\b(type|interface|union|enum|input|scalar|schema|extend|implements)\\b"},{name:"constant.language.graphql",match:"\\b(true|false|null)\\b"}]},directives:{patterns:[{name:"entity.name.function.directive.graphql",match:"@[a-zA-Z_][a-zA-Z0-9_]*"}]}}},gr={name:"HTML",scopeName:"text.html.basic",patterns:[{include:"#doctype"},{include:"#comments"},{include:"#tags"},{include:"#entities"}],repository:{doctype:{patterns:[{name:"meta.tag.sgml.doctype.html",match:"<!DOCTYPE[^>]*>"}]},comments:{patterns:[{name:"comment.block.html",begin:"<!--",end:"-->"}]},tags:{patterns:[{name:"meta.tag.html",begin:"(<)(script|style|template)\\b",beginCaptures:{1:{name:"punctuation.definition.tag.begin.html"},2:{name:"entity.name.tag.html"}},end:"(</)(\\2)(>)",endCaptures:{1:{name:"punctuation.definition.tag.begin.html"},2:{name:"entity.name.tag.html"},3:{name:"punctuation.definition.tag.end.html"}},patterns:[{include:"#tag-stuff"}]},{name:"meta.tag.html",begin:"(<)([a-zA-Z0-9:-]+)",beginCaptures:{1:{name:"punctuation.definition.tag.begin.html"},2:{name:"entity.name.tag.html"}},end:"(/>)|(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.html"},2:{name:"punctuation.definition.tag.end.html"}},patterns:[{include:"#tag-stuff"}]},{name:"meta.tag.html",begin:"(</)([a-zA-Z0-9:-]+)",beginCaptures:{1:{name:"punctuation.definition.tag.begin.html"},2:{name:"entity.name.tag.html"}},end:"(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.html"}}}]},"tag-stuff":{patterns:[{name:"entity.other.attribute-name.html",match:"\\b(data-[a-zA-Z0-9-]+|aria-[a-zA-Z0-9-]+|on[a-z]+|[a-zA-Z-:]+)"},{name:"string.quoted.double.html",begin:'"',end:'"'},{name:"string.quoted.single.html",begin:"'",end:"'"}]},entities:{patterns:[{name:"constant.character.entity.html",match:"&[a-zA-Z0-9]+;"},{name:"constant.character.entity.html",match:"&#[0-9]+;"}]}}},wr={name:"IDL",scopeName:"source.idl",keywords:{interface:"keyword.other.idl",module:"keyword.other.idl",struct:"keyword.other.idl",union:"keyword.other.idl",enum:"keyword.other.idl",typedef:"keyword.other.idl",exception:"keyword.other.idl",readonly:"storage.modifier.idl",attribute:"storage.modifier.idl",const:"storage.modifier.idl",in:"keyword.other.idl",out:"keyword.other.idl",inout:"keyword.other.idl",void:"storage.type.idl",boolean:"storage.type.idl",byte:"storage.type.idl",short:"storage.type.idl",long:"storage.type.idl",float:"storage.type.idl",double:"storage.type.idl",char:"storage.type.idl",string:"storage.type.idl",TRUE:"constant.language.idl",FALSE:"constant.language.idl"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.idl",match:"\\/\\/.*$"},{name:"comment.block.idl",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.idl",begin:'"',end:'"',patterns:[{name:"constant.character.escape.idl",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.other.idl",match:"\\b(interface|module|struct|union|enum|typedef|exception|in|out|inout)\\b"},{name:"storage.modifier.idl",match:"\\b(readonly|attribute|const)\\b"},{name:"storage.type.idl",match:"\\b(void|boolean|byte|short|long|float|double|char|string)\\b"},{name:"constant.language.idl",match:"\\b(TRUE|FALSE)\\b"}]},numbers:{patterns:[{name:"constant.numeric.idl",match:"\\b\\d+\\.?\\d*(?:[eE][+-]?\\d+)?\\b"}]}}},br={name:"Java",scopeName:"source.java",keywords:{if:"keyword.control.java",else:"keyword.control.java",for:"keyword.control.java",while:"keyword.control.java",do:"keyword.control.java",switch:"keyword.control.java",case:"keyword.control.java",default:"keyword.control.java",break:"keyword.control.java",continue:"keyword.control.java",return:"keyword.control.java",try:"keyword.control.java",catch:"keyword.control.java",finally:"keyword.control.java",throw:"keyword.control.java",throws:"keyword.control.java",assert:"keyword.control.java",class:"storage.type.java",interface:"storage.type.java",enum:"storage.type.java",record:"storage.type.java",void:"storage.type.java",boolean:"storage.type.primitive.java",byte:"storage.type.primitive.java",char:"storage.type.primitive.java",short:"storage.type.primitive.java",int:"storage.type.primitive.java",long:"storage.type.primitive.java",float:"storage.type.primitive.java",double:"storage.type.primitive.java",public:"storage.modifier.java",private:"storage.modifier.java",protected:"storage.modifier.java",static:"storage.modifier.java",final:"storage.modifier.java",abstract:"storage.modifier.java",native:"storage.modifier.java",synchronized:"storage.modifier.java",transient:"storage.modifier.java",volatile:"storage.modifier.java",strictfp:"storage.modifier.java",sealed:"storage.modifier.java","non-sealed":"storage.modifier.java",true:"constant.language.java",false:"constant.language.java",null:"constant.language.java",this:"variable.language.java",super:"variable.language.java",package:"keyword.other.package.java",import:"keyword.other.import.java",extends:"keyword.other.extends.java",implements:"keyword.other.implements.java",new:"keyword.operator.new.java",instanceof:"keyword.operator.instanceof.java",var:"storage.type.java"},patterns:[{include:"#comments"},{include:"#annotations"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.java",match:"\\/\\/.*$"},{name:"comment.block.documentation.java",begin:"\\/\\*\\*",end:"\\*\\/",patterns:[{name:"keyword.other.documentation.java",match:"@(?:param|return|throws|author|version|see|since|deprecated)\\b"}]},{name:"comment.block.java",begin:"\\/\\*",end:"\\*\\/"}]},annotations:{patterns:[{name:"storage.type.annotation.java",match:"@[A-Z][a-zA-Z0-9]*"}]},strings:{patterns:[{name:"string.quoted.triple.java",begin:'"""',end:'"""',patterns:[{name:"constant.character.escape.java",match:"\\\\."}]},{name:"string.quoted.double.java",begin:'"',end:'"',patterns:[{name:"constant.character.escape.java",match:"\\\\."}]},{name:"string.quoted.single.java",begin:"'",end:"'",patterns:[{name:"constant.character.escape.java",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.java",match:"\\b(if|else|for|while|do|switch|case|default|break|continue|return|try|catch|finally|throw|throws|assert)\\b"},{name:"storage.type.java",match:"\\b(class|interface|enum|record|void|var)\\b"},{name:"storage.type.primitive.java",match:"\\b(boolean|byte|char|short|int|long|float|double)\\b"},{name:"storage.modifier.java",match:"\\b(public|private|protected|static|final|abstract|native|synchronized|transient|volatile|strictfp|sealed|non-sealed)\\b"},{name:"constant.language.java",match:"\\b(true|false|null)\\b"},{name:"keyword.other.java",match:"\\b(package|import|extends|implements|new|instanceof)\\b"}]},numbers:{patterns:[{name:"constant.numeric.java",match:"\\b(?:0[xX][0-9a-fA-F_]+[lL]?|0[bB][01_]+[lL]?|0[0-7_]+[lL]?|\\d+[._]?\\d*(?:[eE][+-]?\\d+)?[fFdDlL]?)\\b"}]},functions:{patterns:[{name:"entity.name.function.java",match:"\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.java",match:"(\\+\\+|--|\\+|\\-|\\*|/|%|==|!=|<=|>=|<|>|&&|\\|\\||!|\\?|:|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=|>>>=|&|\\||\\^|~|<<|>>|>>>)"}]}}},kr={name:"JavaScript",scopeName:"source.js",keywords:{if:"keyword.control.js",else:"keyword.control.js",switch:"keyword.control.js",case:"keyword.control.js",default:"keyword.control.js",for:"keyword.control.js",while:"keyword.control.js",do:"keyword.control.js",break:"keyword.control.js",continue:"keyword.control.js",return:"keyword.control.js",try:"keyword.control.js",catch:"keyword.control.js",finally:"keyword.control.js",throw:"keyword.control.js",async:"keyword.control.js",await:"keyword.control.js",yield:"keyword.control.js",const:"storage.type.js",let:"storage.type.js",var:"storage.type.js",function:"storage.type.js",class:"storage.type.js",extends:"storage.type.js",static:"storage.type.js",get:"storage.type.js",set:"storage.type.js",new:"keyword.operator.new.js",delete:"keyword.operator.new.js",typeof:"keyword.operator.new.js",instanceof:"keyword.operator.new.js",void:"keyword.operator.new.js",in:"keyword.operator.new.js",of:"keyword.operator.new.js",true:"constant.language.js",false:"constant.language.js",null:"constant.language.js",undefined:"constant.language.js",NaN:"constant.language.js",Infinity:"constant.language.js",this:"constant.language.js",super:"constant.language.js",arguments:"constant.language.js",import:"keyword.other.js",export:"keyword.other.js",from:"keyword.other.js",as:"keyword.other.js",with:"keyword.other.js",debugger:"keyword.other.js"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#jsx"},{include:"#regex"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"},{include:"#punctuation"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.js",match:"\\/\\/.*$"},{name:"comment.block.js",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.js",begin:'"',end:'"',patterns:[{name:"constant.character.escape.js",match:"\\\\."}]},{name:"string.quoted.single.js",begin:"'",end:"'",patterns:[{name:"constant.character.escape.js",match:"\\\\."}]},{name:"string.template.js",begin:"`",end:"`",patterns:[{name:"meta.template.expression.js",begin:"\\$\\{",end:"\\}",patterns:[{include:"$self"}]},{name:"constant.character.escape.js",match:"\\\\."}]}]},jsx:{patterns:[{name:"meta.tag.jsx",begin:"<([A-Z][a-zA-Z0-9]*|[a-z][a-zA-Z0-9-]*)",beginCaptures:{0:{name:"punctuation.definition.tag.begin.jsx"},1:{name:"entity.name.tag.jsx"}},end:"(/?>)",endCaptures:{1:{name:"punctuation.definition.tag.end.jsx"}},patterns:[{name:"entity.other.attribute-name.jsx",match:"[a-zA-Z_:][a-zA-Z0-9_:.-]*"},{name:"meta.embedded.expression.jsx",begin:"\\{",end:"\\}",patterns:[{include:"$self"}]},{name:"string.quoted.double.jsx",begin:'"',end:'"'},{name:"string.quoted.single.jsx",begin:"'",end:"'"}]},{name:"meta.tag.jsx",begin:"(</)([A-Z][a-zA-Z0-9]*|[a-z][a-zA-Z0-9-]*)",beginCaptures:{1:{name:"punctuation.definition.tag.begin.jsx"},2:{name:"entity.name.tag.jsx"}},end:"(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.jsx"}}}]},regex:{patterns:[{name:"string.regexp.js",begin:"(?<=[=(,\\[!&|?{};:])\\s*(\\/)",beginCaptures:{1:{name:"punctuation.definition.string.begin.js"}},end:"(\\/)[gimsuvy]*",endCaptures:{1:{name:"punctuation.definition.string.end.js"}},patterns:[{name:"constant.character.escape.js",match:"\\\\."}]}]},numbers:{patterns:[{name:"constant.numeric.js",match:"\\b(0[xX][0-9a-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|\\d+(_\\d+)*(\\.\\d+(_\\d+)?)?([eE][+-]?\\d+)?)[nN]?\\b"}]},keywords:{patterns:[{name:"keyword.control.js",match:"\\b(if|else|switch|case|default|for|while|do|break|continue|return|try|catch|finally|throw|async|await|yield)\\b"},{name:"storage.type.js",match:"\\b(const|let|var|function|class|extends|static|async|get|set)\\b"},{name:"keyword.operator.new.js",match:"\\b(new|delete|typeof|instanceof|void|in|of)\\b"},{name:"constant.language.js",match:"\\b(true|false|null|undefined|NaN|Infinity|this|super|arguments)\\b"},{name:"keyword.other.js",match:"\\b(import|export|from|as|default|with|debugger)\\b"}]},functions:{patterns:[{name:"entity.name.function.js",match:"\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.js",match:"(\\+\\+|--|\\+|\\-|\\*|\\/|%|===|==|!==|!=|<=|>=|<|>|&&|\\|\\||!|\\?|:|=>|\\.\\.\\.|&|\\||\\^|~|<<|>>|>>>)"}]},punctuation:{patterns:[{name:"punctuation.js",match:"[{}()\\[\\];,.]"}]}}},Ar={name:"JSON5",scopeName:"source.json5",keywords:{true:"constant.language.json5",false:"constant.language.json5",null:"constant.language.json5",Infinity:"constant.language.json5",NaN:"constant.language.json5"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#numbers"},{include:"#constants"},{include:"#keys"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.json5",match:"\\/\\/.*$"},{name:"comment.block.json5",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.single.json5",begin:"'",end:"'",patterns:[{name:"constant.character.escape.json5",match:"\\\\."}]},{name:"string.quoted.double.json5",begin:'"',end:'"',patterns:[{name:"constant.character.escape.json5",match:"\\\\."}]}]},numbers:{patterns:[{name:"constant.numeric.json5",match:"\\b(?:0[xX][0-9a-fA-F]+|[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?)\\b"}]},constants:{patterns:[{name:"constant.language.json5",match:"\\b(true|false|null|Infinity|NaN)\\b"}]},keys:{patterns:[{name:"support.type.property-name.json5",match:"\\b[a-zA-Z_$][a-zA-Z0-9_$]*\\s*(?=:)"},{name:"support.type.property-name.json5",begin:'"',end:'"(?=\\s*:)'},{name:"support.type.property-name.json5",begin:"'",end:"'(?=\\s*:)"}]}}},vr={name:"JSON",scopeName:"source.json",patterns:[{include:"#value"}],repository:{value:{patterns:[{include:"#constant"},{include:"#number"},{include:"#string"},{include:"#array"},{include:"#object"}]},constant:{patterns:[{name:"constant.language.json",match:"\\b(true|false|null)\\b"}]},number:{patterns:[{name:"constant.numeric.json",match:"-?(0|[1-9]\\d*)(\\.\\d+)?([eE][+-]?\\d+)?"}]},string:{patterns:[{name:"string.quoted.double.json",begin:'"',end:'"',patterns:[{name:"constant.character.escape.json",match:'\\\\(["\\\\/bfnrt]|u[0-9a-fA-F]{4})'},{name:"invalid.illegal.unrecognized-string-escape.json",match:"\\\\."}]}]},array:{patterns:[{name:"meta.structure.array.json",begin:"\\[",beginCaptures:{0:{name:"punctuation.definition.array.begin.json"}},end:"\\]",endCaptures:{0:{name:"punctuation.definition.array.end.json"}},patterns:[{include:"#value"},{name:"punctuation.separator.array.json",match:","}]}]},object:{patterns:[{name:"meta.structure.dictionary.json",begin:"\\{",beginCaptures:{0:{name:"punctuation.definition.dictionary.begin.json"}},end:"\\}",endCaptures:{0:{name:"punctuation.definition.dictionary.end.json"}},patterns:[{name:"meta.structure.dictionary.key.json",begin:'"',beginCaptures:{0:{name:"punctuation.support.type.property-name.begin.json"}},end:'"',endCaptures:{0:{name:"punctuation.support.type.property-name.end.json"}},patterns:[{name:"constant.character.escape.json",match:'\\\\(["\\\\/bfnrt]|u[0-9a-fA-F]{4})'}]},{name:"punctuation.separator.dictionary.key-value.json",match:":"},{name:"punctuation.separator.dictionary.pair.json",match:","},{include:"#value"}]}]}}},$r={name:"JSONC",scopeName:"source.jsonc",keywords:{true:"constant.language.json",false:"constant.language.json",null:"constant.language.json"},patterns:[{include:"#comments"},{include:"#value"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.jsonc",match:"\\/\\/.*$"},{name:"comment.block.jsonc",begin:"\\/\\*",end:"\\*\\/"}]},value:{patterns:[{include:"#constant"},{include:"#number"},{include:"#string"},{include:"#array"},{include:"#object"}]},constant:{patterns:[{name:"constant.language.json",match:"\\b(true|false|null)\\b"}]},number:{patterns:[{name:"constant.numeric.json",match:"-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?"}]},string:{patterns:[{name:"string.quoted.double.json",begin:'"',end:'"',patterns:[{name:"constant.character.escape.json",match:'\\\\(?:["\\\\/bfnrt]|u[0-9a-fA-F]{4})'},{name:"invalid.illegal.unrecognized-string-escape.json",match:"\\\\."}]}]},array:{patterns:[{name:"meta.structure.array.json",begin:"\\[",end:"\\]",patterns:[{include:"#value"},{include:"#comments"}]}]},object:{patterns:[{name:"meta.structure.dictionary.json",begin:"\\{",end:"\\}",patterns:[{include:"#comments"},{include:"#objectkey"},{include:"#value"}]}]},objectkey:{patterns:[{name:"support.type.property-name.json",begin:'"',end:'"',patterns:[{name:"constant.character.escape.json",match:'\\\\(?:["\\\\/bfnrt]|u[0-9a-fA-F]{4})'}]}]}}},Er={name:"Kotlin",scopeName:"source.kotlin",keywords:{package:"keyword.other.kotlin",import:"keyword.other.kotlin",class:"keyword.other.kotlin",interface:"keyword.other.kotlin",object:"keyword.other.kotlin",data:"keyword.other.kotlin",sealed:"keyword.other.kotlin",enum:"keyword.other.kotlin",fun:"keyword.other.kotlin",val:"keyword.other.kotlin",var:"keyword.other.kotlin",if:"keyword.control.kotlin",else:"keyword.control.kotlin",when:"keyword.control.kotlin",for:"keyword.control.kotlin",while:"keyword.control.kotlin",do:"keyword.control.kotlin",return:"keyword.control.kotlin",break:"keyword.control.kotlin",continue:"keyword.control.kotlin",throw:"keyword.control.kotlin",try:"keyword.control.kotlin",catch:"keyword.control.kotlin",finally:"keyword.control.kotlin",public:"storage.modifier.kotlin",private:"storage.modifier.kotlin",protected:"storage.modifier.kotlin",internal:"storage.modifier.kotlin",open:"storage.modifier.kotlin",abstract:"storage.modifier.kotlin",override:"storage.modifier.kotlin",suspend:"storage.modifier.kotlin",inline:"storage.modifier.kotlin",true:"constant.language.kotlin",false:"constant.language.kotlin",null:"constant.language.kotlin",this:"variable.language.kotlin",super:"variable.language.kotlin",it:"variable.language.kotlin"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.kotlin",match:"\\/\\/.*$"},{name:"comment.block.kotlin",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.triple.kotlin",begin:'"""',end:'"""',patterns:[{name:"meta.template.expression.kotlin",begin:"\\$\\{",end:"\\}"},{name:"variable.other.kotlin",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]},{name:"string.quoted.double.kotlin",begin:'"',end:'"',patterns:[{name:"constant.character.escape.kotlin",match:"\\\\."},{name:"variable.other.kotlin",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"},{name:"meta.template.expression.kotlin",begin:"\\$\\{",end:"\\}"}]}]},keywords:{patterns:[{name:"keyword.control.kotlin",match:"\\b(if|else|when|for|while|do|return|break|continue|throw|try|catch|finally)\\b"},{name:"keyword.other.kotlin",match:"\\b(package|import|class|interface|object|data|sealed|enum|fun|val|var)\\b"},{name:"storage.modifier.kotlin",match:"\\b(public|private|protected|internal|open|abstract|override|suspend|inline)\\b"},{name:"constant.language.kotlin",match:"\\b(true|false|null)\\b"}]},numbers:{patterns:[{name:"constant.numeric.kotlin",match:"\\b(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d+[._]?\\d*(?:[eE][+-]?\\d+)?)[fFdDlL]?\\b"}]},functions:{patterns:[{name:"entity.name.function.kotlin",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]}}},Nr={name:"LaTeX",scopeName:"text.tex.latex",keywords:{},patterns:[{include:"#comments"},{include:"#commands"},{include:"#environments"},{include:"#math"}],repository:{comments:{patterns:[{name:"comment.line.percentage.latex",match:"%.*$"}]},commands:{patterns:[{name:"support.function.latex",match:"\\\\[a-zA-Z]+"}]},environments:{patterns:[{name:"meta.environment.latex",begin:"\\\\begin\\{([a-zA-Z]+)\\}",beginCaptures:{"0":{name:"support.function.latex"},"1":{name:"variable.parameter.latex"}},end:"\\\\end\\{\\1\\}",endCaptures:{"0":{name:"support.function.latex"}}}]},math:{patterns:[{name:"string.other.math.latex",begin:"\\$\\$",end:"\\$\\$"},{name:"string.other.math.latex",begin:"\\$",end:"\\$"}]}}},xr={name:"Log",scopeName:"text.log",keywords:{},patterns:[{include:"#log-levels"},{include:"#timestamps"},{include:"#ip-addresses"}],repository:{"log-levels":{patterns:[{name:"markup.error.log",match:"\\b(ERROR|FATAL|CRITICAL)\\b"},{name:"markup.warning.log",match:"\\b(WARN|WARNING)\\b"},{name:"markup.info.log",match:"\\b(INFO|NOTICE)\\b"},{name:"markup.debug.log",match:"\\b(DEBUG|TRACE)\\b"}]},timestamps:{patterns:[{name:"constant.numeric.timestamp.log",match:"\\d{4}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?"}]},"ip-addresses":{patterns:[{name:"constant.numeric.ip.log",match:"\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b"}]}}},Tr={name:"Lua",scopeName:"source.lua",keywords:{and:"keyword.operator.lua",break:"keyword.control.lua",do:"keyword.control.lua",else:"keyword.control.lua",elseif:"keyword.control.lua",end:"keyword.control.lua",false:"constant.language.lua",for:"keyword.control.lua",function:"keyword.control.lua",if:"keyword.control.lua",in:"keyword.control.lua",local:"storage.modifier.lua",nil:"constant.language.lua",not:"keyword.operator.lua",or:"keyword.operator.lua",repeat:"keyword.control.lua",return:"keyword.control.lua",then:"keyword.control.lua",true:"constant.language.lua",until:"keyword.control.lua",while:"keyword.control.lua"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.block.lua",begin:"--\\[\\[",end:"\\]\\]"},{name:"comment.line.double-dash.lua",match:"--.*$"}]},strings:{patterns:[{name:"string.quoted.other.multiline.lua",begin:"\\[\\[",end:"\\]\\]"},{name:"string.quoted.double.lua",begin:'"',end:'"',patterns:[{name:"constant.character.escape.lua",match:"\\\\."}]},{name:"string.quoted.single.lua",begin:"'",end:"'",patterns:[{name:"constant.character.escape.lua",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.lua",match:"\\b(break|do|else|elseif|end|for|function|if|in|repeat|return|then|until|while)\\b"},{name:"constant.language.lua",match:"\\b(true|false|nil)\\b"},{name:"storage.modifier.lua",match:"\\b(local)\\b"}]},numbers:{patterns:[{name:"constant.numeric.lua",match:"\\b(?:0[xX][0-9a-fA-F]+|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?)\\b"}]}}},qr={name:"Makefile",scopeName:"source.makefile",keywords:{ifeq:"keyword.control.makefile",ifneq:"keyword.control.makefile",ifdef:"keyword.control.makefile",ifndef:"keyword.control.makefile",else:"keyword.control.makefile",endif:"keyword.control.makefile",include:"keyword.control.makefile",define:"keyword.control.makefile",endef:"keyword.control.makefile"},patterns:[{include:"#comments"},{include:"#targets"},{include:"#variables"},{include:"#directives"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.makefile",match:"#.*$"}]},targets:{patterns:[{name:"entity.name.function.target.makefile",match:"^[a-zA-Z0-9._-]+(?=:)"}]},variables:{patterns:[{name:"variable.other.makefile",match:"\\$[({][a-zA-Z0-9_]+[})]"},{name:"variable.other.makefile",match:"\\$[a-zA-Z0-9_]"}]},directives:{patterns:[{name:"keyword.control.makefile",match:"^\\s*(ifeq|ifneq|ifdef|ifndef|else|endif|include|define|endef)\\b"}]}}},jr={name:"Markdown",scopeName:"text.html.markdown",keywords:{},patterns:[{include:"#heading"},{include:"#code-block"},{include:"#code-inline"},{include:"#bold"},{include:"#italic"},{include:"#strikethrough"},{include:"#link"},{include:"#image"},{include:"#list"},{include:"#blockquote"},{include:"#horizontal-rule"},{include:"#table"}],repository:{heading:{patterns:[{name:"markup.heading.markdown",match:"^(#{1,6})\\s+(.+)$",captures:{"1":{name:"markup.heading.marker.markdown"},"2":{name:"markup.heading.content.markdown"}}},{name:"markup.heading.setext.markdown",match:"^(=+|-+)$"}]},"code-block":{patterns:[{name:"markup.fenced_code.block.markdown",begin:"^```([a-zA-Z0-9]*)",end:"^```",captures:{"1":{name:"entity.name.function.markdown"}},contentName:"markup.raw.code.markdown"},{name:"markup.raw.code.markdown",match:"^( |\\t)(.*)$"}]},"code-inline":{patterns:[{name:"markup.inline.raw.markdown",match:"`[^`]+`"}]},bold:{patterns:[{name:"markup.bold.markdown",match:"(\\*\\*|__)(?=\\S)(.+?[*_]*)(?<=\\S)\\1",captures:{"1":{name:"punctuation.definition.bold.markdown"},"2":{name:"markup.bold.content.markdown"}}}]},italic:{patterns:[{name:"markup.italic.markdown",match:"(\\*|_)(?=\\S)(.+?)(?<=\\S)\\1",captures:{"1":{name:"punctuation.definition.italic.markdown"},"2":{name:"markup.italic.content.markdown"}}}]},strikethrough:{patterns:[{name:"markup.strikethrough.markdown",match:"~~(.+?)~~",captures:{"1":{name:"markup.strikethrough.content.markdown"}}}]},link:{patterns:[{name:"meta.link.inline.markdown",match:"\\[([^\\]]+)\\]\\(([^)]+)\\)",captures:{"1":{name:"string.other.link.title.markdown"},"2":{name:"markup.underline.link.markdown"}}},{name:"meta.link.reference.markdown",match:"\\[([^\\]]+)\\]\\[([^\\]]+)\\]",captures:{"1":{name:"string.other.link.title.markdown"},"2":{name:"constant.other.reference.link.markdown"}}}]},image:{patterns:[{name:"meta.image.inline.markdown",match:"!\\[([^\\]]*)\\]\\(([^)]+)\\)",captures:{"1":{name:"string.other.link.description.markdown"},"2":{name:"markup.underline.link.image.markdown"}}}]},list:{patterns:[{name:"markup.list.unnumbered.markdown",match:"^\\s*([-*+])\\s+",captures:{"1":{name:"punctuation.definition.list.markdown"}}},{name:"markup.list.numbered.markdown",match:"^\\s*(\\d+\\.)\\s+",captures:{"1":{name:"punctuation.definition.list.markdown"}}}]},blockquote:{patterns:[{name:"markup.quote.markdown",match:"^\\s*>\\s*(.*)$",captures:{"1":{name:"markup.quote.content.markdown"}}}]},"horizontal-rule":{patterns:[{name:"meta.separator.markdown",match:"^\\s*([-*_]){3,}\\s*$"}]},table:{patterns:[{name:"markup.table.markdown",match:"^\\|(.+)\\|$"},{name:"markup.table.delimiter.markdown",match:"^\\|([:\\-\\s|]+)\\|$"}]}}},_r={name:"Nginx",scopeName:"source.nginx",keywords:{},patterns:[{include:"#comments"},{include:"#directives"},{include:"#blocks"},{include:"#variables"},{include:"#strings"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.nginx",match:"#.*$"}]},directives:{patterns:[{name:"keyword.other.directive.nginx",match:"\\b(server|location|listen|root|index|proxy_pass|return|rewrite|try_files|add_header|set|if|access_log|error_log)\\b"}]},blocks:{patterns:[{name:"entity.name.section.nginx",match:"\\b(http|server|location|upstream|events)\\b"}]},variables:{patterns:[{name:"variable.other.nginx",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]},strings:{patterns:[{name:"string.quoted.double.nginx",begin:'"',end:'"'},{name:"string.quoted.single.nginx",begin:"'",end:"'"}]}}},zr={name:"PHP",scopeName:"source.php",keywords:{if:"keyword.control.php",else:"keyword.control.php",elseif:"keyword.control.php",endif:"keyword.control.php",for:"keyword.control.php",foreach:"keyword.control.php",endfor:"keyword.control.php",endforeach:"keyword.control.php",while:"keyword.control.php",endwhile:"keyword.control.php",do:"keyword.control.php",switch:"keyword.control.php",case:"keyword.control.php",default:"keyword.control.php",endswitch:"keyword.control.php",break:"keyword.control.php",continue:"keyword.control.php",return:"keyword.control.php",goto:"keyword.control.php",try:"keyword.control.php",catch:"keyword.control.php",finally:"keyword.control.php",throw:"keyword.control.php",match:"keyword.control.php",function:"storage.type.function.php",class:"storage.type.class.php",interface:"storage.type.interface.php",trait:"storage.type.trait.php",enum:"storage.type.enum.php",namespace:"storage.type.namespace.php",use:"keyword.other.use.php",extends:"storage.modifier.extends.php",implements:"storage.modifier.implements.php",public:"storage.modifier.php",private:"storage.modifier.php",protected:"storage.modifier.php",static:"storage.modifier.php",final:"storage.modifier.php",abstract:"storage.modifier.php",readonly:"storage.modifier.php",true:"constant.language.php",false:"constant.language.php",null:"constant.language.php",TRUE:"constant.language.php",FALSE:"constant.language.php",NULL:"constant.language.php",this:"variable.language.php",parent:"variable.language.php",self:"variable.language.php",new:"keyword.operator.new.php",clone:"keyword.operator.clone.php",instanceof:"keyword.operator.instanceof.php",and:"keyword.operator.logical.php",or:"keyword.operator.logical.php",xor:"keyword.operator.logical.php",echo:"support.function.construct.php",print:"support.function.construct.php",require:"keyword.control.import.php",require_once:"keyword.control.import.php",include:"keyword.control.import.php",include_once:"keyword.control.import.php",die:"keyword.control.php",exit:"keyword.control.php",isset:"support.function.construct.php",empty:"support.function.construct.php",unset:"support.function.construct.php",yield:"keyword.control.php","yield from":"keyword.control.php",declare:"keyword.control.php",const:"storage.type.const.php",var:"storage.type.var.php",global:"storage.modifier.php"},patterns:[{include:"#php-tags"},{include:"#comments"},{include:"#strings"},{include:"#heredoc"},{include:"#keywords"},{include:"#variables"},{include:"#functions"},{include:"#numbers"},{include:"#operators"}],repository:{"php-tags":{patterns:[{name:"meta.embedded.block.php",begin:"<\\?(?:php|=)?",beginCaptures:{"0":{name:"punctuation.section.embedded.begin.php"}},end:"\\?>",endCaptures:{"0":{name:"punctuation.section.embedded.end.php"}},patterns:[{include:"#comments"},{include:"#strings"},{include:"#heredoc"},{include:"#keywords"},{include:"#variables"},{include:"#functions"},{include:"#numbers"},{include:"#operators"}]}]},comments:{patterns:[{name:"comment.line.double-slash.php",match:"\\/\\/.*$"},{name:"comment.line.number-sign.php",match:"#.*$"},{name:"comment.block.php",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.php",begin:'"',end:'"',patterns:[{name:"constant.character.escape.php",match:"\\\\."},{name:"variable.other.php",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"},{name:"meta.embedded.expression.php",begin:"\\{\\$",end:"\\}",patterns:[{include:"#variables"}]}]},{name:"string.quoted.single.php",begin:"'",end:"'",patterns:[{name:"constant.character.escape.php",match:"\\\\['\\\\]"}]}]},heredoc:{patterns:[{name:"string.unquoted.heredoc.php",begin:`<<<(["']?)([a-zA-Z_][a-zA-Z0-9_]*)\\1`,end:"^\\2;?$",patterns:[{name:"variable.other.php",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]}]},keywords:{patterns:[{name:"keyword.control.php",match:"\\b(if|else|elseif|endif|for|foreach|endfor|endforeach|while|endwhile|do|switch|case|default|endswitch|break|continue|return|goto|try|catch|finally|throw|match|die|exit|yield|declare)\\b"},{name:"storage.type.php",match:"\\b(function|class|interface|trait|enum|namespace|const|var)\\b"},{name:"storage.modifier.php",match:"\\b(public|private|protected|static|final|abstract|readonly|global)\\b"},{name:"keyword.other.php",match:"\\b(use|extends|implements)\\b"},{name:"constant.language.php",match:"\\b(true|false|null|TRUE|FALSE|NULL)\\b"},{name:"keyword.control.import.php",match:"\\b(require|require_once|include|include_once)\\b"}]},variables:{patterns:[{name:"variable.language.php",match:"\\$(?:this|GLOBALS|_GET|_POST|_REQUEST|_SESSION|_COOKIE|_SERVER|_FILES|_ENV)\\b"},{name:"variable.other.php",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]},functions:{patterns:[{name:"entity.name.function.php",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},numbers:{patterns:[{name:"constant.numeric.php",match:"\\b(?:0[xX][0-9a-fA-F]+|0[bB][01]+|0[oO][0-7]+|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?)\\b"}]},operators:{patterns:[{name:"keyword.operator.php",match:"(===|!==|==|!=|<=|>=|<>|<|>|\\+\\+|--|\\+|\\-|\\*|/|%|&&|\\|\\||!|\\.|=>|->|::|\\.=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=)"}]}}},Cr={name:"PowerShell",scopeName:"source.powershell",keywords:{if:"keyword.control.powershell",else:"keyword.control.powershell",elseif:"keyword.control.powershell",switch:"keyword.control.powershell",for:"keyword.control.powershell",foreach:"keyword.control.powershell",while:"keyword.control.powershell",do:"keyword.control.powershell",until:"keyword.control.powershell",break:"keyword.control.powershell",continue:"keyword.control.powershell",return:"keyword.control.powershell",function:"storage.type.powershell",filter:"storage.type.powershell",param:"storage.type.powershell",begin:"keyword.control.powershell",process:"keyword.control.powershell",end:"keyword.control.powershell",try:"keyword.control.powershell",catch:"keyword.control.powershell",finally:"keyword.control.powershell",throw:"keyword.control.powershell",$true:"constant.language.powershell",$false:"constant.language.powershell",$null:"constant.language.powershell"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#variables"},{include:"#keywords"},{include:"#cmdlets"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.powershell",match:"#.*$"},{name:"comment.block.powershell",begin:"<#",end:"#>"}]},strings:{patterns:[{name:"string.quoted.double.powershell",begin:'"',end:'"',patterns:[{name:"variable.other.powershell",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]},{name:"string.quoted.single.powershell",begin:"'",end:"'"}]},variables:{patterns:[{name:"variable.other.powershell",match:"\\$[a-zA-Z_][a-zA-Z0-9_]*"}]},keywords:{patterns:[{name:"keyword.control.powershell",match:"\\b(if|else|elseif|switch|for|foreach|while|do|until|break|continue|return|begin|process|end|try|catch|finally|throw)\\b"},{name:"storage.type.powershell",match:"\\b(function|filter|param)\\b"},{name:"constant.language.powershell",match:"\\$(?:true|false|null)\\b"}]},cmdlets:{patterns:[{name:"support.function.powershell",match:"\\b[A-Z][a-z]+-[A-Z][a-z]+[a-zA-Z]*\\b"}]}}},Sr={name:"Protocol Buffers",scopeName:"source.proto",keywords:{syntax:"keyword.other.proto",package:"keyword.other.proto",import:"keyword.other.proto",option:"keyword.other.proto",message:"keyword.other.proto",enum:"keyword.other.proto",service:"keyword.other.proto",rpc:"keyword.other.proto",returns:"keyword.other.proto",repeated:"storage.modifier.proto",optional:"storage.modifier.proto",required:"storage.modifier.proto",true:"constant.language.proto",false:"constant.language.proto"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.proto",match:"\\/\\/.*$"},{name:"comment.block.proto",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.proto",begin:'"',end:'"',patterns:[{name:"constant.character.escape.proto",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.other.proto",match:"\\b(syntax|package|import|option|message|enum|service|rpc|returns)\\b"},{name:"storage.modifier.proto",match:"\\b(repeated|optional|required)\\b"},{name:"constant.language.proto",match:"\\b(true|false)\\b"}]},numbers:{patterns:[{name:"constant.numeric.proto",match:"\\b\\d+\\b"}]}}},Zr={name:"Python",scopeName:"source.python",keywords:{if:"keyword.control.python",elif:"keyword.control.python",else:"keyword.control.python",for:"keyword.control.python",while:"keyword.control.python",break:"keyword.control.python",continue:"keyword.control.python",return:"keyword.control.python",yield:"keyword.control.python",try:"keyword.control.python",except:"keyword.control.python",finally:"keyword.control.python",raise:"keyword.control.python",with:"keyword.control.python",as:"keyword.control.python",pass:"keyword.control.python",match:"keyword.control.python",case:"keyword.control.python",def:"storage.type.function.python",class:"storage.type.class.python",lambda:"storage.type.function.python",async:"storage.modifier.async.python",await:"keyword.control.python",and:"keyword.operator.logical.python",or:"keyword.operator.logical.python",not:"keyword.operator.logical.python",in:"keyword.operator.python",is:"keyword.operator.python",import:"keyword.control.import.python",from:"keyword.control.import.python",True:"constant.language.python",False:"constant.language.python",None:"constant.language.python",self:"variable.language.python",cls:"variable.language.python",print:"support.function.builtin.python",len:"support.function.builtin.python",range:"support.function.builtin.python",str:"support.function.builtin.python",int:"support.function.builtin.python",float:"support.function.builtin.python",list:"support.function.builtin.python",dict:"support.function.builtin.python",tuple:"support.function.builtin.python",set:"support.function.builtin.python",bool:"support.function.builtin.python"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#decorators"},{include:"#keywords"},{include:"#functions"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.python",match:"#.*$"}]},strings:{patterns:[{name:"string.quoted.docstring.python",begin:'"""',end:'"""'},{name:"string.quoted.docstring.python",begin:"'''",end:"'''"},{name:"string.quoted.double.python",begin:'f"',end:'"',patterns:[{name:"constant.character.escape.python",match:"\\\\."},{name:"meta.embedded.expression.python",begin:"\\{",end:"\\}"}]},{name:"string.quoted.double.python",begin:'"',end:'"',patterns:[{name:"constant.character.escape.python",match:"\\\\."}]},{name:"string.quoted.single.python",begin:"'",end:"'",patterns:[{name:"constant.character.escape.python",match:"\\\\."}]}]},decorators:{patterns:[{name:"entity.name.function.decorator.python",match:"@[a-zA-Z_][a-zA-Z0-9_]*"}]},keywords:{patterns:[{name:"keyword.control.python",match:"\\b(if|elif|else|for|while|break|continue|return|yield|try|except|finally|raise|with|as|pass|match|case|await)\\b"},{name:"storage.type.python",match:"\\b(def|class|lambda|async)\\b"},{name:"keyword.control.import.python",match:"\\b(import|from)\\b"},{name:"constant.language.python",match:"\\b(True|False|None)\\b"}]},functions:{patterns:[{name:"entity.name.function.python",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},numbers:{patterns:[{name:"constant.numeric.python",match:"\\b(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:[eE][-+]?[0-9]+)?)\\b"}]},operators:{patterns:[{name:"keyword.operator.python",match:"(\\+|-|\\*|/|//|%|\\*\\*|==|!=|<|>|<=|>=|=|\\+=|-=|\\*=|/=)"}]}}},Lr={name:"R",scopeName:"source.r",keywords:{if:"keyword.control.r",else:"keyword.control.r",for:"keyword.control.r",while:"keyword.control.r",repeat:"keyword.control.r",break:"keyword.control.r",next:"keyword.control.r",return:"keyword.control.r",function:"storage.type.r",in:"keyword.operator.r",TRUE:"constant.language.r",FALSE:"constant.language.r",NULL:"constant.language.r",NA:"constant.language.r",NaN:"constant.language.r",Inf:"constant.language.r"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.r",match:"#.*$"}]},strings:{patterns:[{name:"string.quoted.double.r",begin:'"',end:'"',patterns:[{name:"constant.character.escape.r",match:"\\\\."}]},{name:"string.quoted.single.r",begin:"'",end:"'",patterns:[{name:"constant.character.escape.r",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.r",match:"\\b(if|else|for|while|repeat|break|next|return|in)\\b"},{name:"storage.type.r",match:"\\b(function)\\b"},{name:"constant.language.r",match:"\\b(TRUE|FALSE|NULL|NA|NaN|Inf)\\b"}]},numbers:{patterns:[{name:"constant.numeric.r",match:"\\b\\d+\\.?\\d*(?:[eE][+-]?\\d+)?[iL]?\\b"}]},operators:{patterns:[{name:"keyword.operator.r",match:"(<-|<<-|->|->>|==|!=|<=|>=|<|>|&&|\\|\\||!|&|\\||%[a-zA-Z]+%|\\+|\\-|\\*|/|\\^|%%|%/%|::|:::)"}]}}},Rr={name:"RegExp",scopeName:"source.regexp",keywords:{},patterns:[{include:"#character-class"},{include:"#groups"},{include:"#quantifiers"},{include:"#anchors"}],repository:{"character-class":{patterns:[{name:"constant.character.character-class.regexp",begin:"\\[",end:"\\]",patterns:[{name:"constant.character.escape.regexp",match:"\\\\."}]}]},groups:{patterns:[{name:"meta.group.regexp",begin:"\\(",end:"\\)",patterns:[{include:"$self"}]}]},quantifiers:{patterns:[{name:"keyword.operator.quantifier.regexp",match:"[*+?]|\\{\\d+(,\\d*)?\\}"}]},anchors:{patterns:[{name:"keyword.operator.anchor.regexp",match:"\\^|\\$"}]}}},Or={name:"Ruby",scopeName:"source.ruby",keywords:{if:"keyword.control.ruby",elsif:"keyword.control.ruby",else:"keyword.control.ruby",unless:"keyword.control.ruby",case:"keyword.control.ruby",when:"keyword.control.ruby",while:"keyword.control.ruby",until:"keyword.control.ruby",for:"keyword.control.ruby",break:"keyword.control.ruby",next:"keyword.control.ruby",redo:"keyword.control.ruby",retry:"keyword.control.ruby",return:"keyword.control.ruby",yield:"keyword.control.ruby",begin:"keyword.control.ruby",rescue:"keyword.control.ruby",ensure:"keyword.control.ruby",raise:"keyword.control.ruby",end:"keyword.control.ruby",then:"keyword.control.ruby",do:"keyword.control.ruby",def:"keyword.control.ruby",class:"keyword.control.ruby",module:"keyword.control.ruby",include:"keyword.other.ruby",extend:"keyword.other.ruby",require:"keyword.other.ruby",require_relative:"keyword.other.ruby",load:"keyword.other.ruby",alias:"keyword.other.ruby",undef:"keyword.other.ruby","defined?":"keyword.other.ruby",super:"variable.language.ruby",self:"variable.language.ruby",true:"constant.language.ruby",false:"constant.language.ruby",nil:"constant.language.ruby",__FILE__:"constant.language.ruby",__LINE__:"constant.language.ruby",__ENCODING__:"constant.language.ruby",and:"keyword.operator.logical.ruby",or:"keyword.operator.logical.ruby",not:"keyword.operator.logical.ruby",private:"keyword.other.ruby",protected:"keyword.other.ruby",public:"keyword.other.ruby",attr_reader:"keyword.other.ruby",attr_writer:"keyword.other.ruby",attr_accessor:"keyword.other.ruby"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#symbols"},{include:"#regex"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.ruby",match:"#.*$"},{name:"comment.block.ruby",begin:"^=begin",end:"^=end"}]},strings:{patterns:[{name:"string.quoted.double.ruby",begin:'"',end:'"',patterns:[{name:"constant.character.escape.ruby",match:"\\\\."},{name:"meta.interpolation.ruby",begin:"#\\{",end:"\\}",patterns:[{include:"$self"}]}]},{name:"string.quoted.single.ruby",begin:"'",end:"'",patterns:[{name:"constant.character.escape.ruby",match:"\\\\['\\\\]"}]},{name:"string.quoted.other.ruby",begin:"%[qQ]?[{(\\[]",end:"[})\\]]"}]},symbols:{patterns:[{name:"constant.other.symbol.ruby",match:":[a-zA-Z_][a-zA-Z0-9_]*[?!]?"},{name:"constant.other.symbol.ruby",match:':"[^"]*"'}]},regex:{patterns:[{name:"string.regexp.ruby",begin:"/",end:"/[iomxneus]*",patterns:[{name:"constant.character.escape.ruby",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.control.ruby",match:"\\b(if|elsif|else|unless|case|when|while|until|for|break|next|redo|retry|return|yield|begin|rescue|ensure|raise|end|then|do|def|class|module)\\b"},{name:"keyword.other.ruby",match:"\\b(include|extend|require|require_relative|load|alias|undef|defined\\?|private|protected|public|attr_reader|attr_writer|attr_accessor)\\b"},{name:"constant.language.ruby",match:"\\b(true|false|nil|__FILE__|__LINE__|__ENCODING__)\\b"},{name:"variable.language.ruby",match:"\\b(self|super)\\b"}]},numbers:{patterns:[{name:"constant.numeric.ruby",match:"\\b(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+|\\d+\\.?\\d*(?:[eE][+-]?\\d+)?)\\b"}]},functions:{patterns:[{name:"entity.name.function.ruby",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*[?!]?)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.ruby",match:"(=>|\\+|\\-|\\*|/|%|\\*\\*|==|!=|<|>|<=|>=|<=>|===|=~|!~|&&|\\|\\||!|&|\\||\\^|~|<<|>>|\\.\\.|\\.\\.\\.)"}]}}},Br={name:"Rust",scopeName:"source.rust",keywords:{if:"keyword.control.rust",else:"keyword.control.rust",for:"keyword.control.rust",while:"keyword.control.rust",loop:"keyword.control.rust",match:"keyword.control.rust",return:"keyword.control.rust",break:"keyword.control.rust",continue:"keyword.control.rust",yield:"keyword.control.rust",fn:"keyword.other.fn.rust",let:"keyword.other.rust",struct:"keyword.other.rust",enum:"keyword.other.rust",trait:"keyword.other.rust",impl:"keyword.other.rust",type:"keyword.other.rust",mod:"keyword.other.rust",use:"keyword.other.rust",const:"keyword.other.rust",static:"keyword.other.rust",pub:"storage.modifier.rust",mut:"storage.modifier.rust",ref:"storage.modifier.rust",unsafe:"storage.modifier.rust",async:"storage.modifier.rust",await:"keyword.control.rust",move:"storage.modifier.rust",i8:"storage.type.rust",i16:"storage.type.rust",i32:"storage.type.rust",i64:"storage.type.rust",i128:"storage.type.rust",isize:"storage.type.rust",u8:"storage.type.rust",u16:"storage.type.rust",u32:"storage.type.rust",u64:"storage.type.rust",u128:"storage.type.rust",usize:"storage.type.rust",f32:"storage.type.rust",f64:"storage.type.rust",bool:"storage.type.rust",char:"storage.type.rust",str:"storage.type.rust",Self:"storage.type.rust",true:"constant.language.rust",false:"constant.language.rust",self:"variable.language.rust",super:"variable.language.rust",crate:"variable.language.rust",where:"keyword.other.rust",as:"keyword.other.rust",in:"keyword.other.rust",extern:"keyword.other.rust",dyn:"keyword.other.rust"},patterns:[{include:"#comments"},{include:"#attributes"},{include:"#strings"},{include:"#lifetimes"},{include:"#macros"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.documentation.rust",match:"\\/\\/\\/.*$"},{name:"comment.line.double-slash.rust",match:"\\/\\/.*$"},{name:"comment.block.rust",begin:"\\/\\*",end:"\\*\\/"}]},attributes:{patterns:[{name:"meta.attribute.rust",begin:"#!?\\[",end:"\\]",patterns:[{name:"entity.name.function.attribute.rust",match:"[a-zA-Z_][a-zA-Z0-9_]*"}]}]},strings:{patterns:[{name:"string.quoted.byte.raw.rust",begin:'br(#*)"',end:'"\\1'},{name:"string.quoted.raw.rust",begin:'r(#*)"',end:'"\\1'},{name:"string.quoted.double.rust",begin:'"',end:'"',patterns:[{name:"constant.character.escape.rust",match:"\\\\."}]},{name:"string.quoted.single.rust",begin:"'",end:"'",patterns:[{name:"constant.character.escape.rust",match:"\\\\."}]}]},lifetimes:{patterns:[{name:"entity.name.lifetime.rust",match:"'[a-zA-Z_][a-zA-Z0-9_]*\\b"}]},macros:{patterns:[{name:"entity.name.function.macro.rust",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)!"}]},keywords:{patterns:[{name:"keyword.control.rust",match:"\\b(if|else|for|while|loop|match|return|break|continue|yield|await)\\b"},{name:"keyword.other.rust",match:"\\b(fn|let|struct|enum|trait|impl|type|mod|use|const|static|where|as|in|extern|dyn)\\b"},{name:"storage.modifier.rust",match:"\\b(pub|mut|ref|unsafe|async|move)\\b"},{name:"storage.type.rust",match:"\\b(i8|i16|i32|i64|i128|isize|u8|u16|u32|u64|u128|usize|f32|f64|bool|char|str|Self)\\b"},{name:"constant.language.rust",match:"\\b(true|false)\\b"},{name:"variable.language.rust",match:"\\b(self|super|crate)\\b"}]},numbers:{patterns:[{name:"constant.numeric.rust",match:"\\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|\\d+[._]?\\d*(?:[eE][+-]?\\d+)?)[iu]?(?:8|16|32|64|128|size)?\\b"}]},functions:{patterns:[{name:"entity.name.function.rust",match:"\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.rust",match:"(->|=>|\\+|\\-|\\*|/|%|==|!=|<=|>=|<|>|&&|\\|\\||!|&|\\||\\^|<<|>>|=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=|::|\\.|\\.\\.|\\.\\.\\.=)"}]}}},Ur={name:"SCSS",scopeName:"source.scss",keywords:{"@import":"keyword.control.at-rule.scss","@use":"keyword.control.at-rule.scss","@forward":"keyword.control.at-rule.scss","@mixin":"keyword.control.at-rule.scss","@include":"keyword.control.at-rule.scss","@function":"keyword.control.at-rule.scss","@return":"keyword.control.at-rule.scss","@extend":"keyword.control.at-rule.scss","@if":"keyword.control.at-rule.scss","@else":"keyword.control.at-rule.scss","@for":"keyword.control.at-rule.scss","@each":"keyword.control.at-rule.scss","@while":"keyword.control.at-rule.scss","@media":"keyword.control.at-rule.scss","@keyframes":"keyword.control.at-rule.scss"},patterns:[{include:"#comments"},{include:"#at-rules"},{include:"#variables"},{include:"#strings"},{include:"#selectors"},{include:"#properties"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.scss",match:"\\/\\/.*$"},{name:"comment.block.scss",begin:"\\/\\*",end:"\\*\\/"}]},"at-rules":{patterns:[{name:"keyword.control.at-rule.scss",match:"@[a-z-]+"}]},variables:{patterns:[{name:"variable.scss",match:"\\$[a-zA-Z_-][a-zA-Z0-9_-]*"}]},strings:{patterns:[{name:"string.quoted.double.scss",begin:'"',end:'"'},{name:"string.quoted.single.scss",begin:"'",end:"'"}]},selectors:{patterns:[{name:"entity.name.tag.scss",match:"\\b[a-z][a-z0-9-]*\\b"},{name:"entity.other.attribute-name.class.scss",match:"\\.[a-zA-Z_-][a-zA-Z0-9_-]*"},{name:"entity.other.attribute-name.id.scss",match:"#[a-zA-Z_-][a-zA-Z0-9_-]*"}]},properties:{patterns:[{name:"support.type.property-name.scss",match:"\\b[a-z-]+(?=\\s*:)"}]}}},Fr={name:"Solidity",scopeName:"source.solidity",keywords:{pragma:"keyword.other.solidity",import:"keyword.other.solidity",contract:"keyword.other.solidity",interface:"keyword.other.solidity",library:"keyword.other.solidity",function:"keyword.other.solidity",modifier:"keyword.other.solidity",event:"keyword.other.solidity",struct:"keyword.other.solidity",enum:"keyword.other.solidity",if:"keyword.control.solidity",else:"keyword.control.solidity",for:"keyword.control.solidity",while:"keyword.control.solidity",do:"keyword.control.solidity",return:"keyword.control.solidity",break:"keyword.control.solidity",continue:"keyword.control.solidity",public:"storage.modifier.solidity",private:"storage.modifier.solidity",internal:"storage.modifier.solidity",external:"storage.modifier.solidity",pure:"storage.modifier.solidity",view:"storage.modifier.solidity",payable:"storage.modifier.solidity",true:"constant.language.solidity",false:"constant.language.solidity"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.solidity",match:"\\/\\/.*$"},{name:"comment.block.solidity",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.solidity",begin:'"',end:'"',patterns:[{name:"constant.character.escape.solidity",match:"\\\\."}]}]},keywords:{patterns:[{name:"keyword.other.solidity",match:"\\b(pragma|import|contract|interface|library|function|modifier|event|struct|enum)\\b"},{name:"keyword.control.solidity",match:"\\b(if|else|for|while|do|return|break|continue)\\b"},{name:"storage.modifier.solidity",match:"\\b(public|private|internal|external|pure|view|payable)\\b"},{name:"constant.language.solidity",match:"\\b(true|false)\\b"}]},numbers:{patterns:[{name:"constant.numeric.solidity",match:"\\b(?:0[xX][0-9a-fA-F]+|\\d+)\\b"}]}}},Ir={name:"SQL",scopeName:"source.sql",keywords:{SELECT:"keyword.other.dml.sql",INSERT:"keyword.other.dml.sql",UPDATE:"keyword.other.dml.sql",DELETE:"keyword.other.dml.sql",MERGE:"keyword.other.dml.sql",CREATE:"keyword.other.ddl.sql",ALTER:"keyword.other.ddl.sql",DROP:"keyword.other.ddl.sql",TRUNCATE:"keyword.other.ddl.sql",RENAME:"keyword.other.ddl.sql",FROM:"keyword.other.sql",WHERE:"keyword.other.sql",JOIN:"keyword.other.sql",INNER:"keyword.other.sql",LEFT:"keyword.other.sql",RIGHT:"keyword.other.sql",FULL:"keyword.other.sql",OUTER:"keyword.other.sql",CROSS:"keyword.other.sql",ON:"keyword.other.sql",USING:"keyword.other.sql",GROUP:"keyword.other.sql",BY:"keyword.other.sql",HAVING:"keyword.other.sql",ORDER:"keyword.other.sql",ASC:"keyword.other.sql",DESC:"keyword.other.sql",LIMIT:"keyword.other.sql",OFFSET:"keyword.other.sql",FETCH:"keyword.other.sql",DISTINCT:"keyword.other.sql",ALL:"keyword.other.sql",AS:"keyword.other.sql",INTO:"keyword.other.sql",VALUES:"keyword.other.sql",SET:"keyword.other.sql",AND:"keyword.operator.logical.sql",OR:"keyword.operator.logical.sql",NOT:"keyword.operator.logical.sql",IN:"keyword.operator.logical.sql",BETWEEN:"keyword.operator.logical.sql",LIKE:"keyword.operator.logical.sql",IS:"keyword.operator.logical.sql",NULL:"constant.language.sql",TRUE:"constant.language.sql",FALSE:"constant.language.sql",COUNT:"support.function.aggregate.sql",SUM:"support.function.aggregate.sql",AVG:"support.function.aggregate.sql",MIN:"support.function.aggregate.sql",MAX:"support.function.aggregate.sql",INT:"storage.type.sql",INTEGER:"storage.type.sql",BIGINT:"storage.type.sql",SMALLINT:"storage.type.sql",TINYINT:"storage.type.sql",DECIMAL:"storage.type.sql",NUMERIC:"storage.type.sql",FLOAT:"storage.type.sql",REAL:"storage.type.sql",DOUBLE:"storage.type.sql",VARCHAR:"storage.type.sql",CHAR:"storage.type.sql",TEXT:"storage.type.sql",DATE:"storage.type.sql",TIME:"storage.type.sql",TIMESTAMP:"storage.type.sql",DATETIME:"storage.type.sql",BOOLEAN:"storage.type.sql",BOOL:"storage.type.sql",BLOB:"storage.type.sql",PRIMARY:"keyword.other.sql",KEY:"keyword.other.sql",FOREIGN:"keyword.other.sql",REFERENCES:"keyword.other.sql",UNIQUE:"keyword.other.sql",CHECK:"keyword.other.sql",DEFAULT:"keyword.other.sql",AUTO_INCREMENT:"keyword.other.sql",TABLE:"keyword.other.sql",VIEW:"keyword.other.sql",INDEX:"keyword.other.sql",DATABASE:"keyword.other.sql",SCHEMA:"keyword.other.sql",IF:"keyword.control.sql",EXISTS:"keyword.other.sql",CASCADE:"keyword.other.sql",CONSTRAINT:"keyword.other.sql",UNION:"keyword.other.sql",INTERSECT:"keyword.other.sql",EXCEPT:"keyword.other.sql",CASE:"keyword.control.sql",WHEN:"keyword.control.sql",THEN:"keyword.control.sql",ELSE:"keyword.control.sql",END:"keyword.control.sql"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{name:"comment.line.double-dash.sql",match:"--.*$"},{name:"comment.line.number-sign.sql",match:"#.*$"},{name:"comment.block.sql",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.single.sql",begin:"'",end:"'",patterns:[{name:"constant.character.escape.sql",match:"''"}]},{name:"string.quoted.double.sql",begin:'"',end:'"',patterns:[{name:"constant.character.escape.sql",match:'""'}]}]},keywords:{patterns:[{name:"keyword.other.dml.sql",match:"\\b(?i:SELECT|INSERT|UPDATE|DELETE|MERGE)\\b"},{name:"keyword.other.ddl.sql",match:"\\b(?i:CREATE|ALTER|DROP|TRUNCATE|RENAME)\\b"},{name:"keyword.other.sql",match:"\\b(?i:FROM|WHERE|JOIN|INNER|LEFT|RIGHT|FULL|OUTER|CROSS|ON|USING|GROUP|BY|HAVING|ORDER|ASC|DESC|LIMIT|OFFSET|FETCH|DISTINCT|ALL|AS|INTO|VALUES|SET|TABLE|VIEW|INDEX|DATABASE|SCHEMA|EXISTS|CASCADE|CONSTRAINT|UNION|INTERSECT|EXCEPT|PRIMARY|KEY|FOREIGN|REFERENCES|UNIQUE|CHECK|DEFAULT|AUTO_INCREMENT)\\b"},{name:"keyword.operator.logical.sql",match:"\\b(?i:AND|OR|NOT|IN|BETWEEN|LIKE|IS)\\b"},{name:"keyword.control.sql",match:"\\b(?i:IF|CASE|WHEN|THEN|ELSE|END)\\b"},{name:"constant.language.sql",match:"\\b(?i:NULL|TRUE|FALSE)\\b"},{name:"support.function.aggregate.sql",match:"\\b(?i:COUNT|SUM|AVG|MIN|MAX)\\b"},{name:"storage.type.sql",match:"\\b(?i:INT|INTEGER|BIGINT|SMALLINT|TINYINT|DECIMAL|NUMERIC|FLOAT|REAL|DOUBLE|VARCHAR|CHAR|TEXT|DATE|TIME|TIMESTAMP|DATETIME|BOOLEAN|BOOL|BLOB)\\b"}]},numbers:{patterns:[{name:"constant.numeric.sql",match:"\\b\\d+\\.?\\d*(?:[eE][+-]?\\d+)?\\b"}]},operators:{patterns:[{name:"keyword.operator.sql",match:"(=|!=|<>|<|>|<=|>=|\\+|\\-|\\*|/|%|\\|\\|)"}]}}},Gr={name:"STX",scopeName:"text.html.stx",patterns:[{include:"#stx-comments"},{include:"#stx-echo"},{include:"#stx-directives"},{include:"#html"}],repository:{"stx-comments":{patterns:[{name:"comment.block.stx",begin:"\\{\\{--",end:"--\\}\\}"}]},"stx-echo":{patterns:[{name:"meta.embedded.block.stx.unescaped",begin:"(?<!@)\\{\\{\\{",beginCaptures:{0:{name:"punctuation.section.embedded.begin.stx"}},end:"\\}\\}\\}",endCaptures:{0:{name:"punctuation.section.embedded.end.stx"}},contentName:"source.ts.embedded.stx"},{name:"meta.embedded.block.stx.escaped",begin:"(?<![@{])\\{\\{",beginCaptures:{0:{name:"punctuation.section.embedded.begin.stx"}},end:"\\}\\}",endCaptures:{0:{name:"punctuation.section.embedded.end.stx"}},contentName:"source.ts.embedded.stx"},{name:"meta.embedded.block.stx.raw",begin:"(?<!@)\\{!!",beginCaptures:{0:{name:"punctuation.section.embedded.begin.stx"}},end:"!!\\}",endCaptures:{0:{name:"punctuation.section.embedded.end.stx"}},contentName:"source.ts.embedded.stx"}]},"stx-directives":{patterns:[{name:"keyword.control.conditional.stx",match:"@(if|else|elseif|endif|unless|endunless|switch|case|default|endswitch|break)\\b"},{name:"keyword.control.loop.stx",match:"@(for|endfor|foreach|endforeach|while|endwhile|continue|forelse|empty)\\b"},{name:"keyword.control.auth.stx",match:"@(auth|guest|can|cannot|endauth|endguest|endcan|endcannot)\\b"},{name:"keyword.control.component.stx",match:"@(component|endcomponent|slot|endslot|props|inject)\\b"},{name:"keyword.control.layout.stx",match:"@(section|endsection|yield|extends|parent)\\b"},{name:"support.function.include.stx",match:"@(include|includewhen|includeunless|includefirst)\\b"},{name:"keyword.control.stack.stx",match:"@(push|endpush|pushOnce|endpushOnce|pushif|endpushif|stack)\\b"},{name:"keyword.control.once.stx",match:"@(once|endonce)\\b"},{name:"support.function.security.stx",match:"@(csrf|method)\\b"},{name:"keyword.control.environment.stx",match:"@(production|endproduction|development|enddevelopment|env|endenv)\\b"},{name:"support.function.translation.stx",match:"@(translate|endtranslate|t)\\b"},{name:"support.function.webcomponent.stx",match:"@webcomponent\\b"},{name:"support.function.route.stx",match:"@route\\b"},{name:"keyword.control.markdown.stx",begin:"@markdown\\b",beginCaptures:{0:{name:"keyword.control.markdown.stx"}},end:"@endmarkdown\\b",endCaptures:{0:{name:"keyword.control.markdown.stx"}},contentName:"text.html.markdown.embedded.stx"},{name:"support.function.markdown.stx",match:"@markdown-file\\b"},{name:"keyword.control.animation.stx",match:"@(transition|endtransition|motion|endmotion)\\b"},{name:"meta.embedded.block.ts",begin:"@ts\\b",beginCaptures:{0:{name:"keyword.control.stx"}},end:"@endts\\b",endCaptures:{0:{name:"keyword.control.stx"}},contentName:"source.ts"},{name:"meta.embedded.block.js",begin:"@js\\b",beginCaptures:{0:{name:"keyword.control.stx"}},end:"@endjs\\b",endCaptures:{0:{name:"keyword.control.stx"}},contentName:"source.js"},{name:"meta.embedded.block.raw",begin:"@(raw|verbatim)\\b",beginCaptures:{0:{name:"keyword.control.stx"}},end:"@end(raw|verbatim)\\b",endCaptures:{0:{name:"keyword.control.stx"}},contentName:"string.unquoted.raw"},{name:"entity.name.function.stx",match:"@[a-zA-Z_][a-zA-Z0-9_]*"}]},html:{patterns:[{name:"meta.tag.html",begin:"<([a-zA-Z0-9:-]+)",beginCaptures:{0:{name:"punctuation.definition.tag.begin.html"},1:{name:"entity.name.tag.html"}},end:"(/>)|(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.html"},2:{name:"punctuation.definition.tag.end.html"}},patterns:[{name:"entity.other.attribute-name.html",match:"[a-zA-Z-:@]+"},{name:"string.quoted.double.html",begin:'"',end:'"',patterns:[{include:"#stx-echo"}]},{name:"string.quoted.single.html",begin:"'",end:"'",patterns:[{include:"#stx-echo"}]}]},{name:"meta.tag.html",begin:"(</)([a-zA-Z0-9:-]+)",beginCaptures:{1:{name:"punctuation.definition.tag.begin.html"},2:{name:"entity.name.tag.html"}},end:"(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.html"}}},{name:"comment.block.html",begin:"<!--",end:"-->"}]}}},Dr={name:"Swift",scopeName:"source.swift",keywords:{import:"keyword.other.swift",class:"keyword.other.swift",struct:"keyword.other.swift",enum:"keyword.other.swift",protocol:"keyword.other.swift",extension:"keyword.other.swift",func:"keyword.other.swift",var:"keyword.other.swift",let:"keyword.other.swift",if:"keyword.control.swift",else:"keyword.control.swift",guard:"keyword.control.swift",for:"keyword.control.swift",while:"keyword.control.swift",repeat:"keyword.control.swift",switch:"keyword.control.swift",case:"keyword.control.swift",default:"keyword.control.swift",return:"keyword.control.swift",break:"keyword.control.swift",continue:"keyword.control.swift",fallthrough:"keyword.control.swift",defer:"keyword.control.swift",in:"keyword.control.swift",public:"storage.modifier.swift",private:"storage.modifier.swift",fileprivate:"storage.modifier.swift",internal:"storage.modifier.swift",open:"storage.modifier.swift",static:"storage.modifier.swift",final:"storage.modifier.swift",true:"constant.language.swift",false:"constant.language.swift",nil:"constant.language.swift",self:"variable.language.swift",Self:"variable.language.swift"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#numbers"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.swift",match:"\\/\\/.*$"},{name:"comment.block.swift",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.swift",begin:'"',end:'"',patterns:[{name:"constant.character.escape.swift",match:"\\\\."},{name:"meta.embedded.line.swift",begin:"\\\\\\(",end:"\\)"}]}]},keywords:{patterns:[{name:"keyword.control.swift",match:"\\b(if|else|guard|for|while|repeat|switch|case|default|return|break|continue|fallthrough|defer|in)\\b"},{name:"keyword.other.swift",match:"\\b(import|class|struct|enum|protocol|extension|func|var|let)\\b"},{name:"constant.language.swift",match:"\\b(true|false|nil)\\b"}]},numbers:{patterns:[{name:"constant.numeric.swift",match:"\\b\\d+\\.?\\d*\\b"}]}}},Yr={name:"Terraform",scopeName:"source.terraform",keywords:{resource:"keyword.other.terraform",data:"keyword.other.terraform",variable:"keyword.other.terraform",output:"keyword.other.terraform",locals:"keyword.other.terraform",module:"keyword.other.terraform",provider:"keyword.other.terraform",terraform:"keyword.other.terraform",for:"keyword.control.terraform",if:"keyword.control.terraform",else:"keyword.control.terraform",in:"keyword.control.terraform",true:"constant.language.terraform",false:"constant.language.terraform",null:"constant.language.terraform"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#blocks"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.terraform",match:"#.*$"},{name:"comment.line.double-slash.terraform",match:"\\/\\/.*$"},{name:"comment.block.terraform",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.terraform",begin:'"',end:'"',patterns:[{name:"constant.character.escape.terraform",match:"\\\\."},{name:"meta.interpolation.terraform",begin:"\\$\\{",end:"\\}"}]}]},keywords:{patterns:[{name:"keyword.other.terraform",match:"\\b(resource|data|variable|output|locals|module|provider|terraform)\\b"},{name:"keyword.control.terraform",match:"\\b(for|if|else|in)\\b"},{name:"constant.language.terraform",match:"\\b(true|false|null)\\b"}]},blocks:{patterns:[{name:"entity.name.type.terraform",match:'^\\s*(resource|data|variable|output|module|provider|terraform)\\s+"[^"]+"'}]}}},Mr={name:"Plain Text",scopeName:"text.plain",keywords:{},patterns:[],repository:{}},Xr={name:"TOML",scopeName:"source.toml",keywords:{true:"constant.language.toml",false:"constant.language.toml"},patterns:[{include:"#comments"},{include:"#tables"},{include:"#keys"},{include:"#strings"},{include:"#numbers"},{include:"#dates"},{include:"#booleans"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.toml",match:"#.*$"}]},tables:{patterns:[{name:"entity.name.section.toml",match:"^\\[\\[?[a-zA-Z0-9._-]+\\]\\]?"}]},keys:{patterns:[{name:"variable.other.key.toml",match:"^[a-zA-Z0-9_-]+(?=\\s*=)"}]},strings:{patterns:[{name:"string.quoted.triple.toml",begin:'"""',end:'"""'},{name:"string.quoted.triple.toml",begin:"'''",end:"'''"},{name:"string.quoted.double.toml",begin:'"',end:'"',patterns:[{name:"constant.character.escape.toml",match:"\\\\."}]},{name:"string.quoted.single.toml",begin:"'",end:"'"}]},numbers:{patterns:[{name:"constant.numeric.toml",match:"\\b[+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b"},{name:"constant.numeric.toml",match:"\\b0[xX][0-9a-fA-F]+\\b"},{name:"constant.numeric.toml",match:"\\b0[oO][0-7]+\\b"},{name:"constant.numeric.toml",match:"\\b0[bB][01]+\\b"}]},dates:{patterns:[{name:"constant.other.date.toml",match:"\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})?)?"}]},booleans:{patterns:[{name:"constant.language.toml",match:"\\b(true|false)\\b"}]}}},Kr={name:"TypeScript",scopeName:"source.ts",keywords:{if:"keyword.control.ts",else:"keyword.control.ts",switch:"keyword.control.ts",case:"keyword.control.ts",default:"keyword.control.ts",for:"keyword.control.ts",while:"keyword.control.ts",do:"keyword.control.ts",break:"keyword.control.ts",continue:"keyword.control.ts",return:"keyword.control.ts",try:"keyword.control.ts",catch:"keyword.control.ts",finally:"keyword.control.ts",throw:"keyword.control.ts",async:"keyword.control.ts",await:"keyword.control.ts",yield:"keyword.control.ts",const:"storage.type.ts",let:"storage.type.ts",var:"storage.type.ts",function:"storage.type.ts",class:"storage.type.ts",extends:"storage.type.ts",implements:"storage.type.ts",static:"storage.type.ts",type:"storage.type.ts",interface:"storage.type.ts",enum:"storage.type.ts",namespace:"storage.type.ts",module:"storage.type.ts",declare:"storage.type.ts",public:"storage.type.ts",private:"storage.type.ts",protected:"storage.type.ts",readonly:"storage.type.ts",abstract:"storage.type.ts",string:"storage.type.ts",number:"storage.type.ts",boolean:"storage.type.ts",any:"storage.type.ts",void:"storage.type.ts",never:"storage.type.ts",unknown:"storage.type.ts",object:"storage.type.ts",symbol:"storage.type.ts",bigint:"storage.type.ts",get:"storage.type.ts",set:"storage.type.ts",new:"keyword.operator.new.ts",delete:"keyword.operator.new.ts",typeof:"keyword.operator.new.ts",instanceof:"keyword.operator.new.ts",as:"keyword.operator.new.ts",in:"keyword.operator.new.ts",of:"keyword.operator.new.ts",is:"keyword.operator.new.ts",keyof:"keyword.operator.new.ts",infer:"keyword.operator.new.ts",true:"constant.language.ts",false:"constant.language.ts",null:"constant.language.ts",undefined:"constant.language.ts",NaN:"constant.language.ts",Infinity:"constant.language.ts",this:"constant.language.ts",super:"constant.language.ts",arguments:"constant.language.ts",import:"keyword.other.ts",export:"keyword.other.ts",from:"keyword.other.ts",require:"keyword.other.ts",with:"keyword.other.ts",debugger:"keyword.other.ts"},patterns:[{include:"#comments"},{include:"#strings"},{include:"#jsx"},{include:"#regex"},{include:"#keywords"},{include:"#numbers"},{include:"#functions"},{include:"#types"},{include:"#operators"},{include:"#punctuation"}],repository:{comments:{patterns:[{name:"comment.line.double-slash.ts",match:"\\/\\/.*$"},{name:"comment.block.ts",begin:"\\/\\*",end:"\\*\\/"}]},strings:{patterns:[{name:"string.quoted.double.ts",begin:'"',end:'"',patterns:[{name:"constant.character.escape.ts",match:"\\\\."}]},{name:"string.quoted.single.ts",begin:"'",end:"'",patterns:[{name:"constant.character.escape.ts",match:"\\\\."}]},{name:"string.template.ts",begin:"`",end:"`",patterns:[{name:"meta.template.expression.ts",begin:"\\$\\{",end:"\\}",patterns:[{include:"$self"}]},{name:"constant.character.escape.ts",match:"\\\\."}]}]},jsx:{patterns:[{name:"meta.tag.tsx",begin:"<([A-Z][a-zA-Z0-9]*|[a-z][a-zA-Z0-9-]*)",beginCaptures:{0:{name:"punctuation.definition.tag.begin.tsx"},1:{name:"entity.name.tag.tsx"}},end:"(/?>)",endCaptures:{1:{name:"punctuation.definition.tag.end.tsx"}},patterns:[{name:"entity.other.attribute-name.tsx",match:"[a-zA-Z_:][a-zA-Z0-9_:.-]*"},{name:"meta.embedded.expression.tsx",begin:"\\{",end:"\\}",patterns:[{include:"$self"}]},{name:"string.quoted.double.tsx",begin:'"',end:'"'},{name:"string.quoted.single.tsx",begin:"'",end:"'"}]},{name:"meta.tag.tsx",begin:"(</)([A-Z][a-zA-Z0-9]*|[a-z][a-zA-Z0-9-]*)",beginCaptures:{1:{name:"punctuation.definition.tag.begin.tsx"},2:{name:"entity.name.tag.tsx"}},end:"(>)",endCaptures:{1:{name:"punctuation.definition.tag.end.tsx"}}}]},regex:{patterns:[{name:"string.regexp.ts",begin:"(?<=[=(,\\[!&|?{};:])\\s*(\\/)",beginCaptures:{1:{name:"punctuation.definition.string.begin.ts"}},end:"(\\/)[gimsuvy]*",endCaptures:{1:{name:"punctuation.definition.string.end.ts"}},patterns:[{name:"constant.character.escape.ts",match:"\\\\."}]}]},numbers:{patterns:[{name:"constant.numeric.ts",match:"\\b(0[xX][0-9a-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|\\d+(_\\d+)*(\\.\\d+(_\\d+)?)?([eE][+-]?\\d+)?)[nN]?\\b"}]},types:{patterns:[{name:"storage.type.ts",match:"\\b(string|number|boolean|any|void|never|unknown|object|symbol|bigint)\\b"},{name:"entity.name.type.ts",match:":\\s*([A-Z][a-zA-Z0-9_]*)"},{name:"meta.type.annotation.ts",match:"<[^>]+>"}]},keywords:{patterns:[{name:"keyword.control.ts",match:"\\b(if|else|switch|case|default|for|while|do|break|continue|return|try|catch|finally|throw|async|await|yield)\\b"},{name:"storage.type.ts",match:"\\b(const|let|var|function|class|extends|implements|static|async|type|interface|enum|namespace|module|declare|public|private|protected|readonly|abstract|get|set)\\b"},{name:"keyword.operator.new.ts",match:"\\b(new|delete|typeof|instanceof|void|as|in|of|is|keyof|infer)\\b"},{name:"constant.language.ts",match:"\\b(true|false|null|undefined|NaN|Infinity|this|super|arguments)\\b"},{name:"keyword.other.ts",match:"\\b(import|export|from|default|require|with|debugger)\\b"}]},functions:{patterns:[{name:"entity.name.function.ts",match:"\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*(?=\\()"}]},operators:{patterns:[{name:"keyword.operator.ts",match:"(\\+\\+|--|\\+|\\-|\\*|\\/|%|===|==|!==|!=|<=|>=|<|>|&&|\\|\\||!|\\?|:|=>|\\.\\.\\.|&|\\||\\^|~|<<|>>|>>>)"}]},punctuation:{patterns:[{name:"punctuation.ts",match:"[{}()\\[\\];,.]"}]}}},Pr={name:"Vue",scopeName:"source.vue",keywords:{},patterns:[{include:"#template"},{include:"#script"},{include:"#style"},{include:"#comments"}],repository:{template:{patterns:[{name:"meta.tag.template.vue",begin:"<template>",end:"</template>",patterns:[{name:"entity.other.attribute-name.vue",match:"v-[a-z-]+"},{name:"entity.other.attribute-name.vue",match:"@[a-z]+"},{name:"entity.other.attribute-name.vue",match:":[a-z-]+"},{name:"meta.embedded.expression.vue",begin:"\\{\\{",end:"\\}\\}"}]}]},script:{patterns:[{name:"meta.tag.script.vue",begin:"<script.*?>",end:"</script>"}]},style:{patterns:[{name:"meta.tag.style.vue",begin:"<style.*?>",end:"</style>"}]},comments:{patterns:[{name:"comment.block.html.vue",begin:"<!--",end:"-->"}]}}},Jr={name:"XML",scopeName:"text.xml",keywords:{},patterns:[{include:"#comments"},{include:"#tags"},{include:"#cdata"}],repository:{comments:{patterns:[{name:"comment.block.xml",begin:"<!--",end:"-->"}]},tags:{patterns:[{name:"meta.tag.xml",begin:"</?([a-zA-Z_:][a-zA-Z0-9_:.-]*)",beginCaptures:{"1":{name:"entity.name.tag.xml"}},end:"/?>",patterns:[{name:"entity.other.attribute-name.xml",match:"[a-zA-Z_:][a-zA-Z0-9_:.-]*(?==)"},{include:"#strings"}]}]},strings:{patterns:[{name:"string.quoted.double.xml",begin:'"',end:'"'},{name:"string.quoted.single.xml",begin:"'",end:"'"}]},cdata:{patterns:[{name:"string.unquoted.cdata.xml",begin:"<!\\[CDATA\\[",end:"\\]\\]>"}]}}},Wr={name:"YAML",scopeName:"source.yaml",keywords:{true:"constant.language.boolean.yaml",false:"constant.language.boolean.yaml",null:"constant.language.null.yaml",True:"constant.language.boolean.yaml",False:"constant.language.boolean.yaml",TRUE:"constant.language.boolean.yaml",FALSE:"constant.language.boolean.yaml",yes:"constant.language.boolean.yaml",no:"constant.language.boolean.yaml",Yes:"constant.language.boolean.yaml",No:"constant.language.boolean.yaml",YES:"constant.language.boolean.yaml",NO:"constant.language.boolean.yaml",on:"constant.language.boolean.yaml",off:"constant.language.boolean.yaml"},patterns:[{include:"#comments"},{include:"#document-markers"},{include:"#keys"},{include:"#strings"},{include:"#numbers"},{include:"#constants"},{include:"#anchors"},{include:"#tags"}],repository:{comments:{patterns:[{name:"comment.line.number-sign.yaml",match:"#.*$"}]},"document-markers":{patterns:[{name:"entity.other.document.begin.yaml",match:"^---"},{name:"entity.other.document.end.yaml",match:"^\\.\\.\\."}]},keys:{patterns:[{name:"meta.key.yaml",match:"([a-zA-Z0-9_-]+)\\s*:",captures:{"1":{name:"entity.name.tag.yaml"}}},{name:"string.quoted.yaml",match:`(["'])([a-zA-Z0-9_-]+)\\1\\s*:`,captures:{"2":{name:"entity.name.tag.yaml"}}}]},strings:{patterns:[{name:"string.quoted.double.yaml",begin:'"',end:'"',patterns:[{name:"constant.character.escape.yaml",match:"\\\\."}]},{name:"string.quoted.single.yaml",begin:"'",end:"'",patterns:[{name:"constant.character.escape.yaml",match:"''"}]},{name:"string.unquoted.block.yaml",match:"[|>][-+]?\\s*$"}]},numbers:{patterns:[{name:"constant.numeric.yaml",match:"\\b[-+]?(0x[0-9a-fA-F]+|0o[0-7]+|[0-9]+\\.?[0-9]*([eE][-+]?[0-9]+)?)\\b"}]},constants:{patterns:[{name:"constant.language.yaml",match:"\\b(true|false|null|True|False|TRUE|FALSE|yes|no|Yes|No|YES|NO|on|off)\\b"}]},anchors:{patterns:[{name:"entity.name.type.anchor.yaml",match:"&[a-zA-Z0-9_-]+"},{name:"variable.other.alias.yaml",match:"\\*[a-zA-Z0-9_-]+"}]},tags:{patterns:[{name:"storage.type.tag.yaml",match:"!![a-zA-Z0-9_-]+"},{name:"storage.type.tag.yaml",match:"![a-zA-Z0-9_-]+"}]}}},It=[{id:"javascript",name:"JavaScript",aliases:["js","jsx"],extensions:[".js",".jsx",".mjs",".cjs"],grammar:kr},{id:"typescript",name:"TypeScript",aliases:["ts","tsx"],extensions:[".ts",".tsx",".mts",".cts"],grammar:Kr},{id:"html",name:"HTML",aliases:["htm"],extensions:[".html",".htm"],grammar:gr},{id:"css",name:"CSS",aliases:[],extensions:[".css"],grammar:dr},{id:"json",name:"JSON",aliases:[],extensions:[".json"],grammar:vr},{id:"stx",name:"STX",aliases:[],extensions:[".stx"],grammar:Gr},{id:"bash",name:"Bash",aliases:["sh","shell","zsh","console"],extensions:[".sh",".bash",".zsh"],grammar:or},{id:"markdown",name:"Markdown",aliases:["md"],extensions:[".md",".markdown"],grammar:jr},{id:"yaml",name:"YAML",aliases:["yml"],extensions:[".yaml",".yml"],grammar:Wr},{id:"jsonc",name:"JSONC",aliases:[],extensions:[".jsonc"],grammar:$r},{id:"diff",name:"Diff",aliases:["patch"],extensions:[".diff",".patch"],grammar:ur},{id:"python",name:"Python",aliases:["py"],extensions:[".py",".pyw"],grammar:Zr},{id:"php",name:"PHP",aliases:[],extensions:[".php",".phtml"],grammar:zr},{id:"java",name:"Java",aliases:[],extensions:[".java"],grammar:br},{id:"c",name:"C",aliases:["h"],extensions:[".c",".h"],grammar:sr},{id:"cpp",name:"C++",aliases:["cc","cxx","hpp"],extensions:[".cpp",".cc",".cxx",".hpp",".h++"],grammar:cr},{id:"rust",name:"Rust",aliases:["rs"],extensions:[".rs"],grammar:Br},{id:"csharp",name:"C#",aliases:["cs"],extensions:[".cs"],grammar:lr},{id:"dockerfile",name:"Dockerfile",aliases:["docker"],extensions:[".dockerfile"],grammar:hr},{id:"ruby",name:"Ruby",aliases:["rb"],extensions:[".rb"],grammar:Or},{id:"go",name:"Go",aliases:[],extensions:[".go"],grammar:yr},{id:"sql",name:"SQL",aliases:[],extensions:[".sql"],grammar:Ir},{id:"idl",name:"IDL",aliases:[],extensions:[".idl"],grammar:wr},{id:"text",name:"Text",aliases:["txt","plain"],extensions:[".txt",".text"],grammar:Mr},{id:"json5",name:"JSON5",aliases:[],extensions:[".json5"],grammar:Ar},{id:"vue",name:"Vue",aliases:[],extensions:[".vue"],grammar:Pr},{id:"toml",name:"TOML",aliases:[],extensions:[".toml"],grammar:Xr},{id:"scss",name:"SCSS",aliases:["sass"],extensions:[".scss",".sass"],grammar:Ur},{id:"kotlin",name:"Kotlin",aliases:["kt"],extensions:[".kt",".kts"],grammar:Er},{id:"swift",name:"Swift",aliases:[],extensions:[".swift"],grammar:Dr},{id:"dart",name:"Dart",aliases:[],extensions:[".dart"],grammar:pr},{id:"r",name:"R",aliases:[],extensions:[".r",".R"],grammar:Lr},{id:"graphql",name:"GraphQL",aliases:["gql"],extensions:[".graphql",".gql"],grammar:fr},{id:"powershell",name:"PowerShell",aliases:["ps1"],extensions:[".ps1",".psm1"],grammar:Cr},{id:"makefile",name:"Makefile",aliases:["make"],extensions:[".make"],grammar:qr},{id:"terraform",name:"Terraform",aliases:["tf","hcl"],extensions:[".tf",".hcl"],grammar:Yr},{id:"bnf",name:"BNF",aliases:[],extensions:[".bnf"],grammar:ar},{id:"regexp",name:"RegExp",aliases:["regex"],extensions:[".regexp",".regex"],grammar:Rr},{id:"lua",name:"Lua",aliases:[],extensions:[".lua"],grammar:Tr},{id:"cmd",name:"CMD",aliases:["batch"],extensions:[".cmd",".bat"],grammar:ir},{id:"abnf",name:"ABNF",aliases:[],extensions:[".abnf"],grammar:rr},{id:"csv",name:"CSV",aliases:[],extensions:[".csv"],grammar:mr},{id:"log",name:"Log",aliases:[],extensions:[".log"],grammar:xr},{id:"nginx",name:"Nginx",aliases:["nginxconf"],extensions:[".conf"],grammar:_r},{id:"xml",name:"XML",aliases:[],extensions:[".xml"],grammar:Jr},{id:"protobuf",name:"Protobuf",aliases:["proto"],extensions:[".proto"],grammar:Sr},{id:"solidity",name:"Solidity",aliases:["sol"],extensions:[".sol"],grammar:Fr},{id:"latex",name:"LaTeX",aliases:["tex"],extensions:[".tex",".latex"],grammar:Nr}];function Qr(e){return It.find((t)=>t.id===e||t.aliases?.includes(e)||t.extensions?.includes(`.${e}`)||t.extensions?.includes(e))}class He{theme;colorCache=new Map;cssCache=null;constructor(e){this.theme=e}render(e,t={}){let{lineNumbers:n=!1,highlightLines:r=[],inline:o=!1,focusLines:a=[],dimLines:s=[],addedLines:c=[],removedLines:i=[],annotations:l=[],showCopyButton:d=!1}=t,m=e.map((f,y)=>{let g=y+1,b=this.getLineClasses(g,{highlightLines:r,focusLines:a,dimLines:s,addedLines:c,removedLines:i}),$=this.renderLine(f,o);if(o)return $;let v=n?`<span class="line-number">${g}</span>`:"",w="";if(c.includes(g))w='<span class="diff-indicator add">+</span>';else if(i.includes(g))w='<span class="diff-indicator remove">-</span>';let x=l.filter((S)=>S.line===g).map((S)=>this.renderAnnotation(S)).join("");return`<span class="${b}">${w}${v}${$}${x}</span>`}),u=o?`<code class="syntax-inline">${m.join("")}</code>`:`<div class="syntax-wrapper">${d?'<button class="copy-button" data-copy>Copy</button>':""}<pre class="syntax"><code>${m.join(`
|
|
775
|
+
`)}</code></pre></div>`,p=this.generateCSS(t),h=this.renderAnsi(e);return{html:u,css:p,tokens:e,ansi:h}}getLineClasses(e,t){let n=["line"];if(t.highlightLines.includes(e))n.push("highlighted");if(t.focusLines.includes(e))n.push("focus");if(t.dimLines.includes(e))n.push("dim");if(t.addedLines.includes(e))n.push("added");if(t.removedLines.includes(e))n.push("removed");return n.join(" ")}renderAnnotation(e){return`<span class="annotation annotation-${e.type||"info"}">${this.escapeHtml(e.text)}</span>`}renderLine(e,t){return e.tokens.map((n)=>this.renderToken(n)).join("")}renderToken(e){let t=this.getColorForScopes(e.scopes),n=this.escapeHtml(e.content),r=[this.getScopeClass(e.scopes)],o=[];if(t.foreground||t.fontStyle)o.push(this.buildStyle(t));if(e.dimmed)r.push("dimmed");if(e.blurred)r.push("blurred");if(e.highlighted){if(r.push("highlighted-token"),e.highlightColor)o.push(`background-color: ${e.highlightColor}`)}if(e.emphasized)r.push("emphasized");let a=r.join(" "),s=o.join("; ");if(e.link)return`<a href="${e.link}" class="${a}" style="${s}" target="_blank" rel="noopener noreferrer">${n}</a>`;if(!s&&a==="token")return n;return`<span class="${a}" style="${s}">${n}</span>`}getColorForScopes(e){if(!Array.isArray(e)||e.length===0)return{};let t=e.join("|"),n=this.colorCache.get(t);if(n)return n;let r={},o=0;for(let a of this.theme.tokenColors){let s=Array.isArray(a.scope)?a.scope:[a.scope];for(let c of s)for(let i of e)if(this.scopeMatches(i,c)){let l=c.split(".").length;if(l>o)r=a.settings,o=l}}return this.colorCache.set(t,r),r}scopeMatches(e,t){if(typeof e!=="string"||typeof t!=="string")return!1;let n=e.split("."),r=t.split(".");for(let o=0;o<r.length;o++)if(n[o]!==r[o])return!1;return!0}buildStyle(e){let t=[];if(e.foreground)t.push(`color: ${e.foreground}`);if(e.background)t.push(`background-color: ${e.background}`);if(e.fontStyle){if(e.fontStyle.includes("italic"))t.push("font-style: italic");if(e.fontStyle.includes("bold"))t.push("font-weight: bold");if(e.fontStyle.includes("underline"))t.push("text-decoration: underline")}return t.join("; ")}getScopeClass(e){if(e.length===0)return"token";let t=e[e.length-1];if(typeof t!=="string")return"token";return`token ${t.replace(/\./g,"-")}`}escapeHtml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}generateCSS(e={}){if(this.cssCache)return this.cssCache;let{colors:t}=this.theme;return this.cssCache=`
|
|
776
|
+
.syntax-wrapper {
|
|
777
|
+
position: relative;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.syntax {
|
|
781
|
+
background-color: ${t["editor.background"]};
|
|
782
|
+
color: ${t["editor.foreground"]};
|
|
783
|
+
padding: 1rem;
|
|
784
|
+
border-radius: 0.375rem;
|
|
785
|
+
overflow-x: auto;
|
|
786
|
+
font-family: 'Courier New', Courier, monospace;
|
|
787
|
+
font-size: 0.875rem;
|
|
788
|
+
line-height: 1.5;
|
|
789
|
+
margin: 0;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
.syntax code {
|
|
793
|
+
display: block;
|
|
794
|
+
font-family: inherit;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.syntax .line {
|
|
798
|
+
display: inline-block;
|
|
799
|
+
width: 100%;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
.syntax .line.highlighted {
|
|
803
|
+
background-color: ${t["editor.lineHighlightBackground"]||"rgba(255, 255, 255, 0.1)"};
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
.syntax .line.focus {
|
|
807
|
+
opacity: 1;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
.syntax .line.dim {
|
|
811
|
+
opacity: 0.4;
|
|
812
|
+
filter: blur(0.5px);
|
|
813
|
+
transition: opacity 0.2s, filter 0.2s;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
.syntax .line.dim:hover {
|
|
817
|
+
opacity: 0.8;
|
|
818
|
+
filter: blur(0px);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.syntax .line.added {
|
|
822
|
+
background-color: ${this.theme.type==="dark"?"rgba(46, 160, 67, 0.15)":"rgba(34, 134, 58, 0.1)"};
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.syntax .line.removed {
|
|
826
|
+
background-color: ${this.theme.type==="dark"?"rgba(248, 81, 73, 0.15)":"rgba(203, 36, 49, 0.1)"};
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
.syntax .diff-indicator {
|
|
830
|
+
display: inline-block;
|
|
831
|
+
width: 1.5rem;
|
|
832
|
+
text-align: center;
|
|
833
|
+
user-select: none;
|
|
834
|
+
font-weight: bold;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
.syntax .diff-indicator.add {
|
|
838
|
+
color: ${this.theme.type==="dark"?"#3fb950":"#1a7f37"};
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
.syntax .diff-indicator.remove {
|
|
842
|
+
color: ${this.theme.type==="dark"?"#f85149":"#cf222e"};
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
.syntax .line-number {
|
|
846
|
+
display: inline-block;
|
|
847
|
+
width: 3rem;
|
|
848
|
+
margin-right: 1rem;
|
|
849
|
+
text-align: right;
|
|
850
|
+
color: ${t["editor.foreground"]}80;
|
|
851
|
+
user-select: none;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
.syntax .annotation {
|
|
855
|
+
display: inline-block;
|
|
856
|
+
margin-left: 1rem;
|
|
857
|
+
padding: 0.125rem 0.5rem;
|
|
858
|
+
border-radius: 0.25rem;
|
|
859
|
+
font-size: 0.75rem;
|
|
860
|
+
font-weight: 500;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
.syntax .annotation-info {
|
|
864
|
+
background-color: rgba(56, 139, 253, 0.15);
|
|
865
|
+
color: ${this.theme.type==="dark"?"#58a6ff":"#0969da"};
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
.syntax .annotation-warning {
|
|
869
|
+
background-color: rgba(187, 128, 9, 0.15);
|
|
870
|
+
color: ${this.theme.type==="dark"?"#d29922":"#9a6700"};
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.syntax .annotation-error {
|
|
874
|
+
background-color: rgba(248, 81, 73, 0.15);
|
|
875
|
+
color: ${this.theme.type==="dark"?"#f85149":"#cf222e"};
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.syntax .annotation-success {
|
|
879
|
+
background-color: rgba(46, 160, 67, 0.15);
|
|
880
|
+
color: ${this.theme.type==="dark"?"#3fb950":"#1a7f37"};
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.syntax-inline {
|
|
884
|
+
background-color: ${t["editor.background"]};
|
|
885
|
+
color: ${t["editor.foreground"]};
|
|
886
|
+
padding: 0.125rem 0.375rem;
|
|
887
|
+
border-radius: 0.25rem;
|
|
888
|
+
font-family: 'Courier New', Courier, monospace;
|
|
889
|
+
font-size: 0.875em;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
.token {
|
|
893
|
+
/* Base token styles */
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
.token.dimmed {
|
|
897
|
+
opacity: 0.5;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
.token.blurred {
|
|
901
|
+
filter: blur(4px);
|
|
902
|
+
transition: filter 0.2s;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
.token.blurred:hover {
|
|
906
|
+
filter: blur(0px);
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
.token.highlighted-token {
|
|
910
|
+
background-color: rgba(255, 235, 59, 0.3);
|
|
911
|
+
border-radius: 2px;
|
|
912
|
+
padding: 0 2px;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
.token.emphasized {
|
|
916
|
+
font-weight: bold;
|
|
917
|
+
text-decoration: underline;
|
|
918
|
+
text-decoration-style: wavy;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
.copy-button {
|
|
922
|
+
position: absolute;
|
|
923
|
+
top: 0.5rem;
|
|
924
|
+
right: 0.5rem;
|
|
925
|
+
padding: 0.5rem 0.75rem;
|
|
926
|
+
background-color: ${this.theme.type==="dark"?"rgba(110, 118, 129, 0.4)":"rgba(27, 31, 36, 0.15)"};
|
|
927
|
+
color: ${t["editor.foreground"]};
|
|
928
|
+
border: none;
|
|
929
|
+
border-radius: 0.375rem;
|
|
930
|
+
font-size: 0.75rem;
|
|
931
|
+
font-weight: 500;
|
|
932
|
+
cursor: pointer;
|
|
933
|
+
transition: background-color 0.2s;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
.copy-button:hover {
|
|
937
|
+
background-color: ${this.theme.type==="dark"?"rgba(110, 118, 129, 0.6)":"rgba(27, 31, 36, 0.25)"};
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
.copy-button:active {
|
|
941
|
+
background-color: ${this.theme.type==="dark"?"rgba(110, 118, 129, 0.8)":"rgba(27, 31, 36, 0.35)"};
|
|
942
|
+
}
|
|
943
|
+
`.trim(),this.cssCache}renderAnsi(e){let t={keyword:"\x1B[35m",string:"\x1B[32m",comment:"\x1B[90m",number:"\x1B[36m",function:"\x1B[33m",reset:"\x1B[0m"};return e.map((n)=>n.tokens.map((r)=>{let o=typeof r.type==="string"?r.type.toLowerCase():"text";return`${t[o]||t.reset}${r.content}${t.reset}`}).join("")).join(`
|
|
944
|
+
`)}setTheme(e){this.theme=e,this.colorCache.clear(),this.cssCache=null}}var A=new Uint8Array(256);for(let e=65;e<=90;e++)A[e]=1;for(let e=97;e<=122;e++)A[e]=1;A[95]=1;A[36]=1;for(let e=48;e<=57;e++)A[e]=2;A[43]=4;A[45]=4;A[42]=4;A[47]=4;A[61]=4;A[33]=4;A[60]=4;A[62]=4;A[38]=4;A[124]=4;A[37]=4;A[63]=4;A[58]=4;A[46]=4;A[123]=8;A[125]=8;A[40]=8;A[41]=8;A[91]=8;A[93]=8;A[59]=8;A[44]=8;A[34]=16;A[39]=16;A[96]=16;A[32]=32;A[9]=32;A[10]=32;A[13]=32;class Gt{keywordSet=null;isJsOrTs;isHtml;isCss;constructor(e){if(this.isJsOrTs=e.scopeName==="source.js"||e.scopeName==="source.ts",this.isHtml=e.scopeName==="text.html.basic",this.isCss=e.scopeName==="source.css",e.keywords)this.keywordSet=new Set(Object.keys(e.keywords))}tokenize(e){let t=e.split(`
|
|
945
|
+
`),n=[];for(let r=0;r<t.length;r++)n.push(this.tokenizeLine(t[r]));return n}tokenizeLine(e){let t=[],n=0;while(n<e.length){let r=e.charCodeAt(n),o=A[r];if(o&32){n++;continue}if(o&2){let a=n;n=this.scanNumber(e,n),t.push({type:"numeric",content:e.slice(a,n)});continue}if(this.isHtml&&r===60){let a=n;if(n++,e.charCodeAt(n)===47)n++;while(n<e.length&&A[e.charCodeAt(n)]&1)n++;while(n<e.length&&e.charCodeAt(n)!==62)n++;if(e.charCodeAt(n)===62)n++;t.push({type:"tag",content:e.slice(a,n)});continue}if(this.isCss){if(r===46||r===35||o&1){let a=n;while(n<e.length){let i=e.charCodeAt(n);if(i===123||i===58||i===59)break;n++}let s=e.slice(a,n),c=s.includes(":")?"property":"selector";t.push({type:c,content:s});continue}}if(!this.isHtml&&r===47){let a=e.charCodeAt(n+1);if(a===47){t.push({type:"comment",content:e.slice(n)});break}else if(a===42){let s=e.indexOf("*/",n+2);if(s!==-1){t.push({type:"comment",content:e.slice(n,s+2)}),n=s+2;continue}}}if(this.isHtml&&r===60&&e.charCodeAt(n+1)===33){let a=e.indexOf("-->",n+4);if(a!==-1){t.push({type:"comment",content:e.slice(n,a+3)}),n=a+3;continue}}if(o&16){let a=n;if(n=this.scanString(e,n,r),n>a){t.push({type:"string",content:e.slice(a,n)});continue}}if(o&1){let a=n;n=this.scanWord(e,n);let s=e.slice(a,n);if(this.isJsOrTs&&e.charCodeAt(n)===40){t.push({type:"function",content:s});continue}let c=this.keywordSet&&this.keywordSet.has(s)?"keyword":"text";t.push({type:c,content:s});continue}if(this.isJsOrTs&&o&4){let a=n;n=this.scanOperator(e,n,r),t.push({type:"operator",content:e.slice(a,n)});continue}if(o&8){t.push({type:"punctuation",content:e[n]}),n++;continue}t.push({type:"text",content:e[n]}),n++}return{tokens:t}}scanNumber(e,t){let n=t,r=!1,o=!1;if(e[t]==="0"&&t+1<e.length){let a=e.charCodeAt(t+1);if(a===120||a===88){n=t+2;while(n<e.length){let s=e.charCodeAt(n);if(!(s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102))break;n++}return n}else if(a===98||a===66){n=t+2;while(n<e.length&&(e[n]==="0"||e[n]==="1"))n++;return n}else if(a===111||a===79){n=t+2;while(n<e.length){let s=e.charCodeAt(n);if(!(s>=48&&s<=55))break;n++}return n}}while(n<e.length){let a=e.charCodeAt(n);if(a>=48&&a<=57)n++;else if(a===46&&!r&&!o)r=!0,n++;else if((a===101||a===69)&&!o){if(o=!0,n++,n<e.length&&(e[n]==="+"||e[n]==="-"))n++}else break}return n}scanString(e,t,n){let r=t+1,o=!1;while(r<e.length){let a=e.charCodeAt(r);if(o)o=!1;else if(a===92)o=!0;else if(a===n)return r+1;r++}return r}scanWord(e,t){let n=t+1;while(n<e.length){let r=e.charCodeAt(n);if(!(A[r]&3))break;n++}return n}scanOperator(e,t,n){if(t+1>=e.length)return t+1;let r=e.charCodeAt(t+1);if(t+2<e.length){let o=e.charCodeAt(t+2);if(n===61&&r===61&&o===61||n===33&&r===61&&o===61||n===62&&r===62&&o===62||n===46&&r===46&&o===46)return t+3}if(n===43&&r===43||n===45&&r===45||n===61&&r===61||n===33&&r===61||n===60&&r===61||n===62&&r===61||n===38&&r===38||n===124&&r===124||n===61&&r===62||n===60&&r===60||n===62&&r===62)return t+2;return t+1}}var Vr={name:"GitHub Dark",type:"dark",colors:{"editor.background":"#0d1117","editor.foreground":"#c9d1d9","editor.lineHighlightBackground":"#161b22","editor.selectionBackground":"#264f78"},tokenColors:[{name:"Comment",scope:["comment","comment.line","comment.block"],settings:{foreground:"#8b949e",fontStyle:"italic"}},{name:"String",scope:["string","string.quoted"],settings:{foreground:"#a5d6ff"}},{name:"Template String",scope:["string.template"],settings:{foreground:"#a5d6ff"}},{name:"Number",scope:["constant.numeric"],settings:{foreground:"#79c0ff"}},{name:"Keyword",scope:["keyword","keyword.control","keyword.operator"],settings:{foreground:"#ff7b72"}},{name:"Storage Type",scope:["storage.type","storage.modifier"],settings:{foreground:"#ff7b72"}},{name:"Function",scope:["entity.name.function","support.function"],settings:{foreground:"#d2a8ff"}},{name:"Class",scope:["entity.name.type","entity.name.class"],settings:{foreground:"#ffa657"}},{name:"Variable",scope:["variable","variable.other"],settings:{foreground:"#ffa657"}},{name:"Constant",scope:["constant.language","constant.character"],settings:{foreground:"#79c0ff"}},{name:"Tag",scope:["entity.name.tag"],settings:{foreground:"#7ee787"}},{name:"Attribute",scope:["entity.other.attribute-name"],settings:{foreground:"#79c0ff"}},{name:"Punctuation",scope:["punctuation"],settings:{foreground:"#c9d1d9"}},{name:"Operator",scope:["keyword.operator"],settings:{foreground:"#ff7b72"}},{name:"CSS Property",scope:["support.type.property-name.css"],settings:{foreground:"#79c0ff"}},{name:"CSS Value",scope:["support.constant.property-value.css"],settings:{foreground:"#a5d6ff"}},{name:"Color",scope:["constant.other.color"],settings:{foreground:"#a5d6ff"}}]},Hr={name:"GitHub Light",type:"light",colors:{"editor.background":"#ffffff","editor.foreground":"#24292f","editor.lineHighlightBackground":"#f6f8fa","editor.selectionBackground":"#b6d4fe"},tokenColors:[{name:"Comment",scope:["comment","comment.line","comment.block"],settings:{foreground:"#6e7781",fontStyle:"italic"}},{name:"String",scope:["string","string.quoted"],settings:{foreground:"#0a3069"}},{name:"Template String",scope:["string.template"],settings:{foreground:"#0a3069"}},{name:"Number",scope:["constant.numeric"],settings:{foreground:"#0550ae"}},{name:"Keyword",scope:["keyword","keyword.control","keyword.operator"],settings:{foreground:"#cf222e"}},{name:"Storage Type",scope:["storage.type","storage.modifier"],settings:{foreground:"#cf222e"}},{name:"Function",scope:["entity.name.function","support.function"],settings:{foreground:"#8250df"}},{name:"Class",scope:["entity.name.type","entity.name.class"],settings:{foreground:"#953800"}},{name:"Variable",scope:["variable","variable.other"],settings:{foreground:"#953800"}},{name:"Constant",scope:["constant.language","constant.character"],settings:{foreground:"#0550ae"}},{name:"Tag",scope:["entity.name.tag"],settings:{foreground:"#116329"}},{name:"Attribute",scope:["entity.other.attribute-name"],settings:{foreground:"#0550ae"}},{name:"Punctuation",scope:["punctuation"],settings:{foreground:"#24292f"}},{name:"Operator",scope:["keyword.operator"],settings:{foreground:"#cf222e"}},{name:"CSS Property",scope:["support.type.property-name.css"],settings:{foreground:"#0550ae"}},{name:"CSS Value",scope:["support.constant.property-value.css"],settings:{foreground:"#0a3069"}},{name:"Color",scope:["constant.other.color"],settings:{foreground:"#0a3069"}}]},eo={name:"Nord",type:"dark",colors:{"editor.background":"#2e3440","editor.foreground":"#d8dee9","editor.lineHighlightBackground":"#3b4252","editor.selectionBackground":"#434c5e"},tokenColors:[{name:"Comment",scope:["comment","comment.line","comment.block"],settings:{foreground:"#616e88",fontStyle:"italic"}},{name:"String",scope:["string","string.quoted"],settings:{foreground:"#a3be8c"}},{name:"Template String",scope:["string.template"],settings:{foreground:"#a3be8c"}},{name:"Number",scope:["constant.numeric"],settings:{foreground:"#b48ead"}},{name:"Keyword",scope:["keyword","keyword.control","keyword.operator"],settings:{foreground:"#81a1c1"}},{name:"Storage Type",scope:["storage.type","storage.modifier"],settings:{foreground:"#81a1c1"}},{name:"Function",scope:["entity.name.function","support.function"],settings:{foreground:"#88c0d0"}},{name:"Class",scope:["entity.name.type","entity.name.class"],settings:{foreground:"#8fbcbb"}},{name:"Variable",scope:["variable","variable.other"],settings:{foreground:"#d8dee9"}},{name:"Constant",scope:["constant.language","constant.character"],settings:{foreground:"#b48ead"}},{name:"Tag",scope:["entity.name.tag"],settings:{foreground:"#81a1c1"}},{name:"Attribute",scope:["entity.other.attribute-name"],settings:{foreground:"#8fbcbb"}},{name:"Punctuation",scope:["punctuation"],settings:{foreground:"#eceff4"}},{name:"Operator",scope:["keyword.operator"],settings:{foreground:"#81a1c1"}},{name:"CSS Property",scope:["support.type.property-name.css"],settings:{foreground:"#8fbcbb"}},{name:"CSS Value",scope:["support.constant.property-value.css"],settings:{foreground:"#a3be8c"}},{name:"Color",scope:["constant.other.color"],settings:{foreground:"#b48ead"}}]},Dt=[Vr,Hr,eo];function to(e){let t=e.toLowerCase();return Dt.find((n)=>{let r=n.name.toLowerCase(),o=r.replace(/\s+/g,"-");return r===t||o===t})}var k=new Uint8Array(256);for(let e=65;e<=90;e++)k[e]=1;for(let e=97;e<=122;e++)k[e]=1;k[95]=1;k[36]=1;for(let e=48;e<=57;e++)k[e]=2;k[43]=4;k[45]=4;k[42]=4;k[47]=4;k[61]=4;k[33]=4;k[60]=4;k[62]=4;k[38]=4;k[124]=4;k[37]=4;k[63]=4;k[58]=4;k[46]=4;k[123]=8;k[125]=8;k[40]=8;k[41]=8;k[91]=8;k[93]=8;k[59]=8;k[44]=8;k[34]=16;k[39]=16;k[96]=16;k[32]=32;k[9]=32;k[10]=32;k[13]=32;class L{grammar;scopeStack=[];regexCache=new Map;compiledPatterns;numberRegex;isJsOrTs;rootScopes;numericScopes;operatorScopes;commentScopes;blockCommentScopes;stringScopes;templateScopes;functionScopes;static TYPE_TEXT="text";static TYPE_PUNCTUATION="punctuation";static TYPE_NUMERIC="numeric";static TYPE_LINE="line";static TYPE_BLOCK="block";static TYPE_DOUBLE="double";static TYPE_SINGLE="single";static TYPE_TEMPLATE="template";static TYPE_FUNCTION="function";static TYPE_OPERATOR="operator";keywordSet=null;keywordMap=new Map;constructor(e){this.grammar=e,this.compiledPatterns=this.precompilePatterns(e.patterns),this.numberRegex=/^(0x[0-9a-f]+|0b[01]+|0o[0-7]+|\d+(\.\d+)?(e[+-]?\d+)?)/i,this.isJsOrTs=e.scopeName==="source.js"||e.scopeName==="source.ts";let t=this.grammar.scopeName.split(".")[1]||"js";if(this.rootScopes=[this.grammar.scopeName],this.numericScopes=[this.grammar.scopeName,`constant.numeric.${t}`],this.operatorScopes=[this.grammar.scopeName,`keyword.operator.${t}`],this.commentScopes=[this.grammar.scopeName,`comment.line.double-slash.${t}`],this.blockCommentScopes=[this.grammar.scopeName,`comment.block.${t}`],this.stringScopes=[this.grammar.scopeName,`string.quoted.double.${t}`],this.templateScopes=[this.grammar.scopeName,`string.template.${t}`],this.functionScopes=[this.grammar.scopeName,`entity.name.function.${t}`],this.grammar.keywords){this.keywordSet=new Set(Object.keys(this.grammar.keywords));for(let[n,r]of Object.entries(this.grammar.keywords))if(typeof r==="string"){let o=[this.grammar.scopeName,r],a=r.lastIndexOf("."),s=a===-1?r:r.slice(a+1);this.keywordMap.set(n,{scopes:o,type:s})}}}tokenizeLine(e,t,n){this.scopeStack=n?[...n]:[{scopes:[this.grammar.scopeName],rule:null}];let r=[],o=0;while(o<e.length){let a=this.matchNextToken(e,o,t);if(a){if(a.tokens)r.push(...a.tokens);else if(a.token)r.push(a.token);o=a.offset}else{let s=this.scopeStack[this.scopeStack.length-1];r.push({type:L.TYPE_TEXT,content:e[o],scopes:s.scopes,line:t,offset:o}),o++}}return{tokens:r,line:t}}tokenize(e){let t=e.split(`
|
|
946
|
+
`),n=[],r;for(let o=0;o<t.length;o++){let a=this.tokenizeLine(t[o],o+1,r);n.push(a),r=this.scopeStack}return n}matchNextToken(e,t,n){let r=this.scopeStack[this.scopeStack.length-1];if(r.endPattern){r.endPattern.lastIndex=t;let a=r.endPattern.exec(e);if(a&&a.index===t){let s=a[0],c=r.scopes;return this.scopeStack.pop(),{token:{type:L.TYPE_PUNCTUATION,content:s,scopes:c,line:n,offset:t},offset:t+s.length}}}if(r.rule===null){let a=e.charCodeAt(t),s=k[a];if(s&32){let c=t+1;while(c<e.length&&k[e.charCodeAt(c)]&32)c++;return{token:null,offset:c}}if(s&8)return{token:{type:L.TYPE_PUNCTUATION,content:e[t],scopes:this.rootScopes,line:n,offset:t},offset:t+1};if(s&2){let c=t,i=!1,l=!1;if(e[t]==="0"&&t+1<e.length){let d=e.charCodeAt(t+1);if(d===120||d===88){c=t+2;while(c<e.length){let m=e.charCodeAt(c);if(!(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102))break;c++}}else if(d===98||d===66){c=t+2;while(c<e.length&&(e[c]==="0"||e[c]==="1"))c++}else if(d===111||d===79){c=t+2;while(c<e.length){let m=e.charCodeAt(c);if(!(m>=48&&m<=55))break;c++}}}if(c===t)while(c<e.length){let d=e.charCodeAt(c);if(d>=48&&d<=57)c++;else if(d===46&&!i&&!l)i=!0,c++;else if((d===101||d===69)&&!l){if(l=!0,c++,c<e.length&&(e[c]==="+"||e[c]==="-"))c++}else break}if(c>t){let d=e.slice(t,c);return{token:{type:L.TYPE_NUMERIC,content:d,scopes:this.numericScopes,line:n,offset:t},offset:c}}}if(a===47){let c=e.charCodeAt(t+1);if(c===47){let i=e.slice(t);return{token:{type:L.TYPE_LINE,content:i,scopes:this.commentScopes,line:n,offset:t},offset:e.length}}else if(c===42){let i=e.indexOf("*/",t+2);if(i!==-1){let l=e.slice(t,i+2);return{token:{type:L.TYPE_BLOCK,content:l,scopes:this.blockCommentScopes,line:n,offset:t},offset:i+2}}}}if(s&16){let c=a,i=t+1,l=!1;while(i<e.length){let d=e.charCodeAt(i);if(l)l=!1;else if(d===92)l=!0;else if(d===c)break;i++}if(i<e.length){let d=e.slice(t,i+1),m=c===96?L.TYPE_TEMPLATE:c===34?L.TYPE_DOUBLE:L.TYPE_SINGLE,u=c===96?this.templateScopes:this.stringScopes;return{token:{type:m,content:d,scopes:u,line:n,offset:t},offset:i+1}}}if(s&1&&(a!==36||this.isJsOrTs)){let c=t+1;while(c<e.length){let d=e.charCodeAt(c);if(!(k[d]&3))break;c++}let i=e.slice(t,c);if(this.keywordSet&&this.keywordSet.has(i)){let d=this.keywordMap.get(i);return{token:{type:d.type,content:i,scopes:d.scopes,line:n,offset:t},offset:c}}let l=c;while(l<e.length&&k[e.charCodeAt(l)]&32)l++;if(e.charCodeAt(l)===40)return{token:{type:L.TYPE_FUNCTION,content:i,scopes:this.functionScopes,line:n,offset:t},offset:c};return{token:{type:L.TYPE_TEXT,content:i,scopes:this.rootScopes,line:n,offset:t},offset:c}}if(this.isJsOrTs&&s&4){let c=1,i=a,l=e.charCodeAt(t+1),d=e.charCodeAt(t+2);if(t+2<e.length){if(i===61&&l===61&&d===61||i===33&&l===61&&d===61||i===62&&l===62&&d===62||i===46&&l===46&&d===46)c=3}if(c===1&&t+1<e.length){if(i===43&&l===43||i===45&&l===45||i===61&&l===61||i===33&&l===61||i===60&&l===61||i===62&&l===61||i===38&&l===38||i===124&&l===124||i===61&&l===62||i===60&&l===60||i===62&&l===62)c=2}let m=e.slice(t,t+c);return{token:{type:L.TYPE_OPERATOR,content:m,scopes:this.operatorScopes,line:n,offset:t},offset:t+c}}}let o=r.rule?.patterns||this.compiledPatterns;for(let a of o){let s=this.matchPattern(a,e,t,n);if(s)return s}return null}precompilePatterns(e){return e.map((t)=>{let n={...t};if(t.match)n._compiledMatch=new RegExp(t.match,"g");if(t.begin)n._compiledBegin=new RegExp(t.begin,"g");if(t.end)n._compiledEnd=new RegExp(t.end,"g");if(t.patterns)n.patterns=this.precompilePatterns(t.patterns);return n})}getRegex(e){let t=this.regexCache.get(e);if(!t)t=new RegExp(e,"g"),this.regexCache.set(e,t);return t}matchPattern(e,t,n,r){if(e.include)return this.handleInclude(e.include,t,n,r);let o=e;if(e.begin){let a=o._compiledBegin||this.getRegex(e.begin);a.lastIndex=n;let s=a.exec(t);if(s&&s.index===n){let c=s[0],i=this.scopeStack[this.scopeStack.length-1],l=e.name?[...i.scopes,e.name]:i.scopes,d=o._compiledEnd||(e.end?this.getRegex(e.end):void 0);if(this.scopeStack.push({scopes:l,rule:e,endPattern:d}),e.beginCaptures){let u=this.applyCaptureGroups(s,e.beginCaptures,i.scopes,r,n);if(u&&u.length>0)return{token:null,tokens:u,offset:n+c.length}}let m=L.TYPE_TEXT;if(e.name&&typeof e.name==="string"){let u=e.name.lastIndexOf(".");m=u===-1?e.name:e.name.slice(u+1)}return{token:{type:m,content:c,scopes:l,line:r,offset:n},offset:n+c.length}}}if(e.match){let a=o._compiledMatch||this.getRegex(e.match);a.lastIndex=n;let s=a.exec(t);if(s&&s.index===n){let c=s[0],i=this.scopeStack[this.scopeStack.length-1];if(e.captures&&!e.name){let m=this.applyCaptureGroups(s,e.captures,i.scopes,r,n);if(m&&m.length>0)return{token:null,tokens:m,offset:n+c.length}}let l=e.name?[...i.scopes,e.name]:i.scopes,d=L.TYPE_TEXT;if(e.name&&typeof e.name==="string"){let m=e.name.lastIndexOf(".");d=m===-1?e.name:e.name.slice(m+1)}return{token:{type:d,content:c,scopes:l,line:r,offset:n},offset:n+c.length}}}return null}applyCaptureGroups(e,t,n,r,o){let a=[],s=0;for(let c=0;c<e.length;c++){let i=e[c];if(i===void 0)continue;let l=c.toString(),d=t[l];if(c===0)continue;let m=e[0].indexOf(i,s);if(m===-1)continue;if(m>s){let h=e[0].substring(s,m);a.push({type:L.TYPE_TEXT,content:h,scopes:n,line:r,offset:o+s})}let u=d&&d.name?[...n,d.name]:n,p=L.TYPE_TEXT;if(d&&d.name){let h=d.name.lastIndexOf(".");p=h===-1?d.name:d.name.slice(h+1)}a.push({type:p,content:i,scopes:u,line:r,offset:o+m}),s=m+i.length}if(s<e[0].length){let c=e[0].substring(s);a.push({type:L.TYPE_TEXT,content:c,scopes:n,line:r,offset:o+s})}return a.length>0?a:null}handleInclude(e,t,n,r){if(e==="$self"){for(let o of this.grammar.patterns){let a=this.matchPattern(o,t,n,r);if(a)return a}return null}if(e.startsWith("#")){let o=e.slice(1),a=this.grammar.repository?.[o];if(a&&a.patterns)for(let s of a.patterns){let c=this.matchPattern(s,t,n,r);if(c)return c}}return null}getTokenType(e){if(!e||typeof e!=="string")return"text";let t=e.split(".");return t[t.length-1]||"text"}getScopeStack(){return this.scopeStack}}class Yt{config;languages=new Map;themes=new Map;cache=new Map;plugins=[];constructor(e){this.config=e,this.initializeDefaults()}initializeDefaults(){for(let e of It)if(this.languages.set(e.id,e),e.aliases)for(let t of e.aliases)this.languages.set(t,e);for(let e of Dt)this.themes.set(e.name.toLowerCase(),e);if(this.config.plugins)for(let e of this.config.plugins)this.loadPlugin(e)}async loadPlugin(e){if(this.plugins.push(e),e.languages)for(let t of e.languages)await this.loadLanguage(t);if(e.themes)for(let t of e.themes)await this.loadTheme(t)}highlightSync(e,t,n={}){let r=this.getLanguageById(t);if(!r)throw Error(`Language "${t}" not found. Available languages: ${this.getSupportedLanguages().join(", ")}`);let o=this.getCacheKey(e,t,n);if(this.config.cache){let c=this.cache.get(o);if(c){let i=this.resolveTheme(n.theme);return new He(i).render(c.tokens,n)}}let a=new L(r.grammar).tokenize(e);for(let c of this.plugins)if(c.transformers)for(let i of c.transformers)a=i.transform(a);if(this.config.cache)this.cache.set(o,{tokens:a,timestamp:Date.now(),hash:o});let s=this.resolveTheme(n.theme);return new He(s).render(a,n)}async highlight(e,t,n={}){return this.highlightSync(e,t,n)}highlightFast(e,t){let n=this.getLanguageById(t);if(!n)throw Error(`Language "${t}" not found. Available languages: ${this.getSupportedLanguages().join(", ")}`);return new Gt(n.grammar).tokenize(e)}async loadLanguage(e){if(this.languages.set(e.id,e),e.aliases)for(let t of e.aliases)this.languages.set(t,e)}async loadTheme(e){this.themes.set(e.name.toLowerCase(),e)}getSupportedLanguages(){let e=new Set;for(let[t,n]of this.languages.entries())if(t===n.id)e.add(n.id);return Array.from(e)}getSupportedThemes(){return Array.from(this.themes.keys())}getLanguageById(e){return this.languages.get(e)||Qr(e)}resolveTheme(e){if(!e)return this.resolveTheme(this.config.theme);if(typeof e==="string"){let t=this.themes.get(e.toLowerCase());if(!t){let n=e.replace(/-/g," ");t=this.themes.get(n.toLowerCase())}if(!t)t=to(e);if(!t)throw Error(`Theme "${e}" not found. Available themes: ${this.getSupportedThemes().join(", ")}`);return t}return e}getCacheKey(e,t,n){let r=JSON.stringify(n);return`${t}:${this.hashCode(e+r)}`}hashCode(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return t.toString(36)}clearCache(){this.cache.clear()}getCacheSize(){return this.cache.size}}async function rt(e={}){let t={...{verbose:!1,theme:"github-dark",cache:!0,plugins:[]},...e};return new Yt(t)}class Mt{entries=[];timers=new Map;enabled;constructor(e=!1){this.enabled=e}start(e){if(!this.enabled)return;this.timers.set(e,performance.now())}end(e){if(!this.enabled)return;let t=this.timers.get(e);if(!t)return;let n=performance.now()-t;this.timers.delete(e),this.entries.push({name:e,duration:n,timestamp:Date.now()})}async measure(e,t){this.start(e);try{let n=await t();return this.end(e),n}catch(n){throw this.end(e),n}}getEntries(){return[...this.entries]}getStats(){let e=new Map;for(let n of this.entries){let r=e.get(n.name)||[];r.push(n.duration),e.set(n.name,r)}let t={};for(let[n,r]of e){let o=r.reduce((a,s)=>a+s,0);t[n]={count:r.length,total:o,avg:o/r.length,min:Math.min(...r),max:Math.max(...r)}}return t}clear(){this.entries=[],this.timers.clear()}enable(){this.enabled=!0}disable(){this.enabled=!1}report(){let e=this.getStats();console.log(`
|
|
947
|
+
=== Performance Report ===
|
|
948
|
+
`);for(let[t,n]of Object.entries(e))console.log(`${t}:`),console.log(` Count: ${n.count}`),console.log(` Total: ${n.total.toFixed(2)}ms`),console.log(` Avg: ${n.avg.toFixed(2)}ms`),console.log(` Min: ${n.min.toFixed(2)}ms`),console.log(` Max: ${n.max.toFixed(2)}ms`),console.log()}}var hs=new Mt(!1);async function Xt(e,t,n={}){return(await rt({theme:n.theme||Ve.theme,cache:Ve.cache,verbose:Ve.verbose})).highlight(e,t,n)}var de=null;function gs(){de=null}async function Kt(){if(de)return de;return de=await rt({theme:"github-light",cache:!0}),de}var no={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",htm:"html",sh:"bash",shell:"bash",zsh:"bash"};function ot(e){let t=e.toLowerCase().trim();return no[t]||t}function Pt(e){let t=ot(e);return["javascript","typescript","html","css","json","stx","bash"].includes(t)}function _e(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ro(e,t){let n=/<span[^>]*class="token[^"]*"[^>]*>([^<]*)<\/span>/g,r=[],o;while((o=n.exec(t))!==null){let l=o[1].replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'");if(l)r.push(l)}if(r.length===0)return t;let a="",s=0,c=[],i=/<span[^>]*class="token[^"]*"[^>]*>[^<]*<\/span>/g;while((o=i.exec(t))!==null)c.push(o[0]);for(let l=0;l<r.length;l++){let d=r[l],m=c[l],u=e.indexOf(d,s);if(u===-1){a+=m;continue}if(u>s){let p=e.substring(s,u);a+=p}a+=m,s=u+d.length}if(s<e.length)a+=e.substring(s);return a}async function at(e,t,n="github-light"){let r=ot(t);if(!Pt(r))return e.split(`
|
|
949
|
+
`).map((a)=>`<span class="line">${_e(a)}</span>`).join(`
|
|
950
|
+
`);try{let a=(await Xt(e,r,{theme:n})).html;return a=a.replace(/<div[^>]*class="syntax-wrapper"[^>]*>/g,""),a=a.replace(/<\/div>\s*$/g,""),a=a.replace(/<pre[^>]*>/g,""),a=a.replace(/<\/pre>/g,""),a=a.replace(/<code[^>]*>/g,""),a=a.replace(/<\/code>/g,""),a=ro(e,a),a.trim()}catch(o){return console.warn(`Failed to highlight code for language "${t}":`,o),e.split(`
|
|
951
|
+
`).map((s)=>`<span class="line">${_e(s)}</span>`).join(`
|
|
952
|
+
`)}}function ws(e,t){let n=ot(t);if(!Pt(n))return _e(e);return _e(e)}function Jt(){return`
|
|
953
|
+
/* Basic syntax highlighting styles for ts-syntax-highlighter */
|
|
954
|
+
/* The actual theme colors are injected by ts-syntax-highlighter */
|
|
955
|
+
|
|
956
|
+
/* Ensure code blocks have proper styling */
|
|
957
|
+
pre {
|
|
958
|
+
overflow-x: auto;
|
|
959
|
+
padding: 1rem;
|
|
960
|
+
border-radius: 0.5rem;
|
|
961
|
+
background: #f6f8fa;
|
|
962
|
+
color: #24292f;
|
|
963
|
+
white-space: pre-wrap; /* Preserve whitespace and allow wrapping */
|
|
964
|
+
word-wrap: break-word;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
code {
|
|
968
|
+
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
|
969
|
+
font-size: 0.875rem;
|
|
970
|
+
line-height: 1.5;
|
|
971
|
+
color: inherit;
|
|
972
|
+
white-space: inherit; /* Inherit pre-wrap from pre */
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
/* Token spans inherit color from parent or use their inline styles */
|
|
976
|
+
/* Don't set a default color on .token to avoid overriding inline styles */
|
|
977
|
+
.token {
|
|
978
|
+
/* color is set via inline styles from highlighter */
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/* Fallback for tokens without inline styles - inherit from pre */
|
|
982
|
+
.token:not([style*="color"]) {
|
|
983
|
+
color: inherit;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/* Dark theme support */
|
|
987
|
+
@media (prefers-color-scheme: dark) {
|
|
988
|
+
pre {
|
|
989
|
+
background: #0d1117;
|
|
990
|
+
color: #e6edf3;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
.token:not([style*="color"]) {
|
|
994
|
+
color: inherit;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
/* Line highlighting */
|
|
999
|
+
.line {
|
|
1000
|
+
display: block;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
.line.highlighted {
|
|
1004
|
+
background-color: rgba(255, 255, 0, 0.1);
|
|
1005
|
+
border-left: 3px solid #fbbf24;
|
|
1006
|
+
padding-left: 0.5rem;
|
|
1007
|
+
margin-left: -0.5rem;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
/* Focus mode */
|
|
1011
|
+
.line.focused {
|
|
1012
|
+
filter: none;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
.line.dimmed {
|
|
1016
|
+
opacity: 0.5;
|
|
1017
|
+
filter: grayscale(50%);
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
/* Diff highlighting */
|
|
1021
|
+
.line.diff-add {
|
|
1022
|
+
background-color: rgba(16, 185, 129, 0.1);
|
|
1023
|
+
border-left: 3px solid #10b981;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
.line.diff-remove {
|
|
1027
|
+
background-color: rgba(239, 68, 68, 0.1);
|
|
1028
|
+
border-left: 3px solid #ef4444;
|
|
1029
|
+
text-decoration: line-through;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
/* Error and warning indicators */
|
|
1033
|
+
.line.has-error {
|
|
1034
|
+
background-color: rgba(239, 68, 68, 0.05);
|
|
1035
|
+
border-left: 3px solid #ef4444;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
.line.has-warning {
|
|
1039
|
+
background-color: rgba(245, 158, 11, 0.05);
|
|
1040
|
+
border-left: 3px solid #f59e0b;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
/* Line numbers */
|
|
1044
|
+
.line-number {
|
|
1045
|
+
display: inline-block;
|
|
1046
|
+
width: 2.5rem;
|
|
1047
|
+
text-align: right;
|
|
1048
|
+
padding-right: 1rem;
|
|
1049
|
+
color: #6b7280;
|
|
1050
|
+
user-select: none;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
.line-numbers-mode {
|
|
1054
|
+
padding-left: 0;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
@media (prefers-color-scheme: dark) {
|
|
1058
|
+
.line-number {
|
|
1059
|
+
color: #9ca3af;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
`}async function bs(){await Kt()}async function ks(){return Kt()}var st={enabled:!0,position:["sidebar"],title:"Table of Contents",maxDepth:6,minDepth:2,className:"table-of-contents",smoothScroll:!0,activeHighlight:!0,collapsible:!0,exclude:[]};function oo(e){return e.toLowerCase().trim().replace(/<[^>]*>/g,"").replace(/what's new\?\s*\(v2\.0\)/g,"whats-new-v2-0").replace(/features\s*&\s*benefits/g,"features-benefits").replace(/vue\.js\s*\+\s*typescript\s*=\s*\u2764\uFE0F/g,"vue-js-typescript").replace(/\//g,"-").replace(/\./g,"-").replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function Wt(e,t){let n=oo(e),r=n,o=1;while(t.has(n))n=`${r}-${o}`,o++;return t.add(n),n}function it(e){let t=[],n=new Set,r=/^(#{1,6})\s+(.+)$/gm,o;while((o=r.exec(e))!==null){let a=o[1].length,s=o[2].trim();if(!s)continue;if(s.includes("toc-ignore"))continue;let c=s.replace(/\s*<!-- toc-ignore -->\s*/g,"").trim();c=c.replace(/`([^`]+)`/g,"<code>$1</code>");let i=c.includes("<code>"),l=Wt(c.replace(/<[^>]*>/g,""),n);t.push({level:a,text:c,id:l,children:[],hasCode:i})}return t}function ct(e){let t=[],n=[];for(let r of e){while(n.length>0&&n[n.length-1].level>=r.level)n.pop();if(n.length===0)t.push(r);else n[n.length-1].children.push(r);n.push(r)}return t}function lt(e,t){let{minDepth:n=2,maxDepth:r=6,exclude:o=[]}=t,a=(s)=>{let c=[];for(let i of s){if(o.some((d)=>{if(d.startsWith("/")&&d.endsWith("/"))return new RegExp(d.slice(1,-1)).test(i.text);else return i.text===d}))continue;if(i.level>r)continue;let l=a(i.children);if(i.level>=n&&i.level<=r)c.push({...i,children:l});else c.push(...l)}return c};return a(e)}function ze(e){let{items:t,title:n,config:r}=e,{className:o,collapsible:a}=r,s=(c,i=0)=>{if(c.length===0)return"";let l=i===0?"toc-list":"toc-sublist",d=i===0?"toc-item":"toc-subitem";return`<ul class="${l}">
|
|
1063
|
+
${c.map((m)=>{let u=m.children.length>0,p=u&&a?"toc-expand":"",h=u?s(m.children,i+1):"",f=50,y=m.text.length>50?`${m.text.substring(0,50)}...`:m.text,g=m.text.length>50?"toc-truncate":"",b=m.hasCode?"toc-code":"";return`<li class="${d} ${p} ${g} ${b}">
|
|
1064
|
+
<a href="#${m.id}" class="toc-link" title="${m.text.replace(/<[^>]*>/g,"")}">${y}</a>
|
|
1065
|
+
${h}
|
|
1066
|
+
</li>`}).join(`
|
|
1067
|
+
`)}
|
|
1068
|
+
</ul>`};return`<nav class="${o}" role="navigation" aria-label="${n}">
|
|
1069
|
+
<div class="toc-container">
|
|
1070
|
+
<h2 class="toc-title">${n}</h2>
|
|
1071
|
+
${s(t)}
|
|
1072
|
+
</div>
|
|
1073
|
+
</nav>`}function Ce(e){return ze(e).replace("table-of-contents","table-of-contents toc-inline inline-toc")}function ao(e){return ze(e).replace("table-of-contents","table-of-contents toc-sidebar sidebar-toc")}function so(e){return ze(e).replace("table-of-contents","table-of-contents toc-floating floating-toc")}function io(e,t={}){let n={...t};if(typeof n.position==="string")n.position=[n.position];let r={...st,...n},o=it(e),a=ct(o),s=lt(a,r);return{title:r.title,items:s,config:r}}function vs(e,t={}){let n=io(e,t);return(Array.isArray(t.position)?t.position:[t.position||"sidebar"]).map((o)=>{let a;switch(o){case"inline":a=Ce(n);break;case"sidebar":a=ao(n);break;case"floating":a=so(n);break;default:a=ze(n)}return{position:o,data:n,html:a}})}function $s(e,t){let n=Ce(t);return e.replace(/\[\[toc\]\]/gi,n)}function Es(e){let t=new Set;return e.replace(/<h([1-6])>(.*?)<\/h[1-6]>/gi,(n,r,o)=>{let a=Wt(o.replace(/<[^>]*>/g,""),t);return`<h${r} id="${a}"><a href="#${a}" class="heading-anchor">#</a>${o}</h${r}>`})}function Ns(){return`
|
|
1074
|
+
.table-of-contents {
|
|
1075
|
+
position: sticky;
|
|
1076
|
+
top: 60px; /* Match navbar height */
|
|
1077
|
+
height: calc(100vh - 60px);
|
|
1078
|
+
width: 200px;
|
|
1079
|
+
overflow-y: auto;
|
|
1080
|
+
padding: 1rem;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
.toc-container {
|
|
1084
|
+
padding: 0;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
.toc-title {
|
|
1088
|
+
margin: 0 0 1rem 0;
|
|
1089
|
+
font-size: 1.2rem;
|
|
1090
|
+
font-weight: 600;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
.toc-list,
|
|
1094
|
+
.toc-sublist {
|
|
1095
|
+
list-style: none;
|
|
1096
|
+
padding: 0;
|
|
1097
|
+
margin: 0;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
.toc-list {
|
|
1101
|
+
padding-left: 0;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
.toc-sublist {
|
|
1105
|
+
padding-left: 1rem;
|
|
1106
|
+
margin-top: 0.5rem;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
.toc-item,
|
|
1110
|
+
.toc-subitem {
|
|
1111
|
+
margin-bottom: 0.5rem;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
.toc-link {
|
|
1115
|
+
color: inherit;
|
|
1116
|
+
text-decoration: none;
|
|
1117
|
+
display: block;
|
|
1118
|
+
padding: 0.25rem 0;
|
|
1119
|
+
border-radius: 0.25rem;
|
|
1120
|
+
transition: background-color 0.2s;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
.toc-link:hover {
|
|
1124
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
.toc-active .toc-link,
|
|
1128
|
+
.active-toc-item .toc-link {
|
|
1129
|
+
background-color: rgba(0, 123, 255, 0.1);
|
|
1130
|
+
font-weight: 500;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
.toc-truncate {
|
|
1134
|
+
/* Styles for truncated TOC items */
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
.toc-truncate .toc-link {
|
|
1138
|
+
white-space: nowrap;
|
|
1139
|
+
overflow: hidden;
|
|
1140
|
+
text-overflow: ellipsis;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
.toc-collapse .toc-link::before {
|
|
1144
|
+
content: '\u25B6';
|
|
1145
|
+
margin-right: 0.5rem;
|
|
1146
|
+
transition: transform 0.2s;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
.toc-collapse.collapsed .toc-link::before {
|
|
1150
|
+
transform: rotate(90deg);
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
.toc-expand .toc-link::before {
|
|
1154
|
+
content: '\u25BC';
|
|
1155
|
+
margin-right: 0.5rem;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
.heading-anchor {
|
|
1159
|
+
color: inherit;
|
|
1160
|
+
text-decoration: none;
|
|
1161
|
+
opacity: 0;
|
|
1162
|
+
margin-left: -1rem;
|
|
1163
|
+
padding-right: 0.5rem;
|
|
1164
|
+
transition: opacity 0.2s;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
h1:hover .heading-anchor,
|
|
1168
|
+
h2:hover .heading-anchor,
|
|
1169
|
+
h3:hover .heading-anchor,
|
|
1170
|
+
h4:hover .heading-anchor,
|
|
1171
|
+
h5:hover .heading-anchor,
|
|
1172
|
+
h6:hover .heading-anchor {
|
|
1173
|
+
opacity: 0.7;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
.heading-anchor:hover {
|
|
1177
|
+
opacity: 1;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
/* Smooth scrolling */
|
|
1181
|
+
html {
|
|
1182
|
+
scroll-behavior: smooth;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
/* Responsive adjustments */
|
|
1186
|
+
@media (max-width: 768px) {
|
|
1187
|
+
.toc-sidebar {
|
|
1188
|
+
display: none;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
.toc-floating {
|
|
1192
|
+
position: fixed;
|
|
1193
|
+
bottom: 1rem;
|
|
1194
|
+
right: 1rem;
|
|
1195
|
+
background: white;
|
|
1196
|
+
border: 1px solid #ddd;
|
|
1197
|
+
border-radius: 0.5rem;
|
|
1198
|
+
padding: 1rem;
|
|
1199
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
1200
|
+
max-width: 250px;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
`}function xs(){return`
|
|
1204
|
+
function initToc() {
|
|
1205
|
+
const tocLinks = document.querySelectorAll('.toc-link')
|
|
1206
|
+
|
|
1207
|
+
// Smooth scrolling for TOC links
|
|
1208
|
+
tocLinks.forEach(link => {
|
|
1209
|
+
link.addEventListener('click', function(e) {
|
|
1210
|
+
e.preventDefault()
|
|
1211
|
+
const targetId = this.getAttribute('href')?.substring(1)
|
|
1212
|
+
const targetElement = document.getElementById(targetId)
|
|
1213
|
+
|
|
1214
|
+
if (targetElement) {
|
|
1215
|
+
targetElement.scrollIntoView({
|
|
1216
|
+
behavior: 'smooth',
|
|
1217
|
+
block: 'start'
|
|
1218
|
+
})
|
|
1219
|
+
|
|
1220
|
+
// Update URL without page reload
|
|
1221
|
+
history.pushState(null, '', '#' + targetId)
|
|
1222
|
+
}
|
|
1223
|
+
})
|
|
1224
|
+
})
|
|
1225
|
+
|
|
1226
|
+
// Active TOC item highlighting on scroll
|
|
1227
|
+
function updateActiveTocItem() {
|
|
1228
|
+
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6')
|
|
1229
|
+
const tocLinks = document.querySelectorAll('.toc-link')
|
|
1230
|
+
|
|
1231
|
+
let currentActive = null
|
|
1232
|
+
let currentDistance = Infinity
|
|
1233
|
+
|
|
1234
|
+
headings.forEach((heading, index) => {
|
|
1235
|
+
const rect = heading.getBoundingClientRect()
|
|
1236
|
+
const distance = Math.abs(rect.top)
|
|
1237
|
+
|
|
1238
|
+
if (distance < currentDistance && rect.top <= 100) {
|
|
1239
|
+
currentActive = heading.id
|
|
1240
|
+
currentDistance = distance
|
|
1241
|
+
}
|
|
1242
|
+
})
|
|
1243
|
+
|
|
1244
|
+
tocLinks.forEach(link => {
|
|
1245
|
+
const parent = link.parentElement
|
|
1246
|
+
if (parent) {
|
|
1247
|
+
parent.classList.remove('toc-active', 'active-toc-item')
|
|
1248
|
+
const href = link.getAttribute('href')?.substring(1)
|
|
1249
|
+
if (href === currentActive) {
|
|
1250
|
+
parent.classList.add('toc-active', 'active-toc-item')
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
})
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
// Throttle scroll events
|
|
1257
|
+
let scrollTimeout
|
|
1258
|
+
function throttledUpdate() {
|
|
1259
|
+
if (!scrollTimeout) {
|
|
1260
|
+
scrollTimeout = setTimeout(() => {
|
|
1261
|
+
updateActiveTocItem()
|
|
1262
|
+
scrollTimeout = null
|
|
1263
|
+
}, 100)
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
window.addEventListener('scroll', throttledUpdate)
|
|
1268
|
+
updateActiveTocItem()
|
|
1269
|
+
|
|
1270
|
+
// TOC collapse/expand functionality
|
|
1271
|
+
const expandableItems = document.querySelectorAll('.toc-expand')
|
|
1272
|
+
|
|
1273
|
+
expandableItems.forEach(item => {
|
|
1274
|
+
item.addEventListener('click', function(e) {
|
|
1275
|
+
if (e.target === this || e.target.closest('.toc-link')) {
|
|
1276
|
+
this.classList.toggle('collapsed')
|
|
1277
|
+
}
|
|
1278
|
+
})
|
|
1279
|
+
})
|
|
1280
|
+
|
|
1281
|
+
// Handle URL hash on page load
|
|
1282
|
+
if (window.location.hash) {
|
|
1283
|
+
const targetId = window.location.hash.substring(1)
|
|
1284
|
+
const targetElement = document.getElementById(targetId)
|
|
1285
|
+
|
|
1286
|
+
if (targetElement) {
|
|
1287
|
+
setTimeout(() => {
|
|
1288
|
+
targetElement.scrollIntoView({
|
|
1289
|
+
behavior: 'smooth',
|
|
1290
|
+
block: 'start'
|
|
1291
|
+
})
|
|
1292
|
+
}, 100)
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
// Initialize TOC when DOM is ready
|
|
1298
|
+
if (document.readyState === 'loading') {
|
|
1299
|
+
document.addEventListener('DOMContentLoaded', initToc)
|
|
1300
|
+
} else {
|
|
1301
|
+
initToc()
|
|
1302
|
+
}
|
|
1303
|
+
`}var{YAML:po}=globalThis.Bun;import Ze from"process";import{join as Qt}from"path";var co=Qt(import.meta.dir,"templates"),Se=new Map;async function lo(e){if(Se.has(e))return Se.get(e);let t=Qt(co,`${e}.stx`),n=Bun.file(t);if(!await n.exists())throw Error(`Template not found: ${e}`);let r=await n.text();return Se.set(e,r),r}function mo(e,t){let n=e;for(let[r,o]of Object.entries(t)){let a=new RegExp(`{{\\s*${r}\\s*}}`,"g");n=n.replace(a,o??"")}return n}async function X(e,t){let n=await lo(e);return mo(n,t)}function Vt(){Se.clear()}async function uo(e,t){if(!e.markdown?.sidebar)return"";let n=Object.keys(e.markdown.sidebar).find((a)=>t.startsWith(a))||"/",r=e.markdown.sidebar[n]||[],o=await Promise.all(r.map(async(a)=>{let s=a.items?a.items.map((c)=>{let i=c.link===t;return`<li><a href="${c.link}" class="block py-1.5 px-6 text-[#476582] no-underline text-sm hover:text-[#3451b2] ${i?"text-[#3451b2] font-medium border-r-2 border-[#3451b2]":""}">${c.text}</a></li>`}).join(""):"";return await X("sidebar-section",{title:a.text,items:s})}));return await X("sidebar",{sections:o.join("")})}async function ho(e){let t=/<h([2-6])([^>]*)>(.*?)<\/h\1>/g,n=[],r;while((r=t.exec(e))!==null){let a=Number.parseInt(r[1]),s=r[2],c=r[3];c=c.replace(/<[^>]*>/g,"");let i=s.match(/id="([^"]*)"/),l=i?i[1]:c.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"");n.push({level:a,text:c,id:l})}if(n.length===0)return"";let o=n.map((a)=>{let s=a.level>2?`level-${a.level}`:"";return`<a href="#${a.id}" class="${s}">${a.text}</a>`}).join(`
|
|
1304
|
+
`);return await X("page-toc",{items:o})}function yo(e){return e.replace(/<h([1-6])([^>]*)>(.*?)<\/h\1>/g,(t,n,r,o)=>{if(r.includes("id="))return t;let a=o.match(/\s*\{#([\w-]+)\}\s*$/),s,c=o;if(a)s=a[1],c=o.replace(/\s*\{#[\w-]+\}\s*$/,"");else s=o.replace(/<[^>]*>/g,"").toLowerCase().replace(/\//g,"-").replace(/\s+/g,"-").replace(/[^\w-]/g,"").replace(/-+/g,"-").replace(/^-+|-+$/g,"");return`<h${n}${r} id="${s}">${c}</h${n}>`})}function fo(e){if(!e.nav||e.nav.length===0)return"";return e.nav.map((n)=>{if(n.items&&n.items.length>0)return`<div class="relative group">
|
|
1305
|
+
<button class="text-[14px] font-medium text-[#213547] hover:text-[#5672cd] transition-colors cursor-pointer flex items-center gap-1">
|
|
1306
|
+
${n.text}
|
|
1307
|
+
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1308
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
|
|
1309
|
+
</svg>
|
|
1310
|
+
</button>
|
|
1311
|
+
<div class="hidden group-hover:block absolute top-full right-0 bg-white border border-[#e2e2e3] rounded-lg shadow-lg min-w-[160px] py-2 mt-2">
|
|
1312
|
+
${n.items.map((r)=>`<a href="${r.link}" class="block px-4 py-2 text-[13px] text-[#213547] hover:bg-[#f6f6f7] hover:text-[#5672cd] transition-colors">${r.text}</a>`).join("")}
|
|
1313
|
+
</div>
|
|
1314
|
+
</div>`;else return`<a href="${n.link}" class="text-[14px] font-medium text-[#213547] hover:text-[#5672cd] transition-colors">${n.text}</a>`}).join("")}async function Ht(e,t,n,r=!1){let o=t.markdown?.title||"BunPress Documentation",a=t.markdown?.meta?.description||"Documentation built with BunPress",c=`${Jt()}
|
|
1315
|
+
${t.markdown?.css||""}`,i=Object.entries(t.markdown?.meta||{}).filter(([u])=>u!=="description").map(([u,p])=>`<meta name="${u}" content="${p}">`).join(`
|
|
1316
|
+
`),l=t.markdown?.scripts?.map((u)=>`<script>${u}</script>`).join(`
|
|
1317
|
+
`)||"";if(r)return await X("layout-home",{title:o,description:a,meta:i,customCSS:c,content:e,scripts:l});let d=yo(e),m=await ho(d);return await X("layout-doc",{title:o,description:a,meta:i,customCSS:c,nav:fo(t),sidebar:await uo(t,n),content:d,pageTOC:m,scripts:l})}function go(e){let t=/^---\n([\s\S]*?)\n---\n?/,n=e.match(t);if(!n)return{frontmatter:{},content:e};let r=n[1],o=e.slice(n[0].length);try{return{frontmatter:po.parse(r),content:o}}catch(a){return console.error("Failed to parse frontmatter YAML:",a),{frontmatter:{},content:e}}}async function wo(e){if(!e)return"";let t=e.name?`<h1 class="text-[32px] leading-[40px] md:text-[48px] md:leading-[56px] font-bold tracking-tight text-[#5672cd] mb-3">${e.name}</h1>`:"",n=e.text?`<p class="text-[32px] leading-[40px] md:text-[56px] md:leading-[64px] font-bold tracking-tight text-[#213547]">${e.text}</p>`:"",r=e.tagline?`<p class="mt-4 text-[16px] md:text-[18px] leading-[28px] text-[#476582] font-medium">${e.tagline}</p>`:"",o="";if(e.actions)o=`<div class="mt-8 flex flex-wrap items-center gap-3">${e.actions.map((s)=>{let c=s.theme==="brand";return`<a href="${s.link}" class="inline-block ${c?"bg-[#5672cd] text-white px-4 py-2 rounded-[20px] font-medium text-[14px] transition-colors hover:bg-[#4558b8]":"bg-[#f6f6f7] text-[#213547] px-4 py-2 rounded-[20px] font-medium text-[14px] border border-[#e2e2e3] transition-colors hover:bg-[#e7e7e8] hover:border-[#d0d0d1]"}">${s.text}</a>`}).join("")}</div>`;return await X("hero",{name:t,text:n,tagline:r,actions:o})}async function bo(e){if(!e||e.length===0)return"";let t=e.map((n)=>`
|
|
1318
|
+
<div class="relative bg-[#f6f6f7] p-6 rounded-xl border border-[#e2e2e3] hover:border-[#5672cd] transition-colors">
|
|
1319
|
+
${n.icon?`<div class="text-[40px] mb-3">${n.icon}</div>`:""}
|
|
1320
|
+
<h3 class="text-[18px] font-semibold text-[#213547] mb-2 leading-[24px]">${n.title||""}</h3>
|
|
1321
|
+
<p class="text-[14px] text-[#476582] leading-[22px]">${n.details||""}</p>
|
|
1322
|
+
</div>
|
|
1323
|
+
`).join("");return await X("features",{items:t})}function M(e){return e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/__(.+?)__/g,"<strong>$1</strong>").replace(/~~(.+?)~~/g,"<del>$1</del>").replace(/==(.+?)==/g,"<mark>$1</mark>").replace(/\^(.+?)\^/g,"<sup>$1</sup>").replace(/`(.+?)`/g,"<code>$1</code>").replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g,"<em>$1</em>").replace(/(?<!_)_(?!_)(.+?)(?<!_)_(?!_)/g,"<em>$1</em>").replace(/(?<!~)~(?!~)(.+?)(?<!~)~(?!~)/g,"<sub>$1</sub>").replace(/!\[([^\]]*)\]\(\s*([^\s")]+)(?:\s+"([^"]+)")?\)/g,(t,n,r,o)=>{if(o)return`<figure class="image-figure"><img src="${r}" alt="${n}"><figcaption>${o}</figcaption></figure>`;else return`<img src="${r}" alt="${n}">`}).replace(/\[(.+?)\]\((.+?)\)/g,'<a href="$2">$1</a>')}function ko(e){let t={smile:"\uD83D\uDE04",laughing:"\uD83D\uDE06",blush:"\uD83D\uDE0A",heart_eyes:"\uD83D\uDE0D",kissing_heart:"\uD83D\uDE18",relaxed:"\u263A\uFE0F",wink:"\uD83D\uDE09",grin:"\uD83D\uDE01",joy:"\uD83D\uDE02",sweat_smile:"\uD83D\uDE05",rofl:"\uD83E\uDD23",thinking:"\uD83E\uDD14",zipper_mouth:"\uD83E\uDD10",neutral_face:"\uD83D\uDE10",expressionless:"\uD83D\uDE11",confused:"\uD83D\uDE15",worried:"\uD83D\uDE1F",slightly_frowning_face:"\uD83D\uDE41",frowning_face:"\u2639\uFE0F",persevere:"\uD83D\uDE23",disappointed:"\uD83D\uDE1E",sweat:"\uD83D\uDE13",tired_face:"\uD83D\uDE2B",cry:"\uD83D\uDE22",sob:"\uD83D\uDE2D",triumph:"\uD83D\uDE24",angry:"\uD83D\uDE20",rage:"\uD83D\uDE21",no_mouth:"\uD83D\uDE36",sleeping:"\uD83D\uDE34","+1":"\uD83D\uDC4D",thumbsup:"\uD83D\uDC4D","-1":"\uD83D\uDC4E",thumbsdown:"\uD83D\uDC4E",clap:"\uD83D\uDC4F",raised_hands:"\uD83D\uDE4C",pray:"\uD83D\uDE4F",wave:"\uD83D\uDC4B",ok_hand:"\uD83D\uDC4C",point_up:"\u261D\uFE0F",point_down:"\uD83D\uDC47",point_left:"\uD83D\uDC48",point_right:"\uD83D\uDC49",muscle:"\uD83D\uDCAA",heart:"\u2764\uFE0F",blue_heart:"\uD83D\uDC99",green_heart:"\uD83D\uDC9A",yellow_heart:"\uD83D\uDC9B",purple_heart:"\uFFFDpurple",broken_heart:"\uD83D\uDC94",sparkling_heart:"\uD83D\uDC96",star:"\u2B50",star2:"\uD83C\uDF1F",sparkles:"\u2728",boom:"\uD83D\uDCA5",fire:"\uD83D\uDD25",tada:"\uD83C\uDF89",confetti_ball:"\uD83C\uDF8A",rocket:"\uD83D\uDE80",zap:"\u26A1",bulb:"\uD83D\uDCA1",bell:"\uD83D\uDD14",mega:"\uD83D\uDCE3",loudspeaker:"\uD83D\uDCE2",warning:"\u26A0\uFE0F",white_check_mark:"\u2705",x:"\u274C",heavy_check_mark:"\u2714\uFE0F",heavy_multiplication_x:"\u2716\uFE0F",question:"\u2753",grey_question:"\u2754",exclamation:"\u2757",grey_exclamation:"\u2755",heavy_plus_sign:"\u2795",heavy_minus_sign:"\u2796",pencil2:"\u270F\uFE0F",memo:"\uD83D\uDCDD",book:"\uD83D\uDCD6",books:"\uD83D\uDCDA",bookmark:"\uD83D\uDD16",mag:"\uD83D\uDD0D",mag_right:"\uD83D\uDD0E",lock:"\uD83D\uDD12",unlock:"\uD83D\uDD13",key:"\uD83D\uDD11",link:"\uD83D\uDD17",computer:"\uD83D\uDCBB",email:"\uD83D\uDCE7",inbox_tray:"\uD83D\uDCE5",outbox_tray:"\uD83D\uDCE4",package:"\uD83D\uDCE6",file_folder:"\uD83D\uDCC1",open_file_folder:"\uD83D\uDCC2",page_facing_up:"\uD83D\uDCC4",calendar:"\uD83D\uDCC5",chart_with_upwards_trend:"\uD83D\uDCC8",chart_with_downwards_trend:"\uD83D\uDCC9",bar_chart:"\uD83D\uDCCA",clipboard:"\uD83D\uDCCB",pushpin:"\uD83D\uDCCC",round_pushpin:"\uD83D\uDCCD",paperclip:"\uD83D\uDCCE",straight_ruler:"\uD83D\uDCCF",wrench:"\uD83D\uDD27",hammer:"\uD83D\uDD28",gear:"\u2699\uFE0F",nut_and_bolt:"\uD83D\uDD29",seedling:"\uD83C\uDF31",evergreen_tree:"\uD83C\uDF32",deciduous_tree:"\uD83C\uDF33",palm_tree:"\uD83C\uDF34",cactus:"\uD83C\uDF35",herb:"\uD83C\uDF3F",shamrock:"\u2618\uFE0F",four_leaf_clover:"\uD83C\uDF40",bug:"\uD83D\uDC1B",bee:"\uD83D\uDC1D",bird:"\uD83D\uDC26",dog:"\uD83D\uDC36",cat:"\uD83D\uDC31",penguin:"\uD83D\uDC27",turtle:"\uD83D\uDC22",fish:"\uD83D\uDC1F",coffee:"\u2615",tea:"\uD83C\uDF75",beer:"\uD83C\uDF7A",beers:"\uD83C\uDF7B",wine_glass:"\uD83C\uDF77",pizza:"\uD83C\uDF55",hamburger:"\uD83C\uDF54",fries:"\uD83C\uDF5F",cake:"\uD83C\uDF70",birthday:"\uD83C\uDF82",cookie:"\uD83C\uDF6A",doughnut:"\uD83C\uDF69",apple:"\uD83C\uDF4E",green_apple:"\uD83C\uDF4F",banana:"\uD83C\uDF4C",strawberry:"\uD83C\uDF53",house:"\uD83C\uDFE0",office:"\uD83C\uDFE2",hospital:"\uD83C\uDFE5",school:"\uD83C\uDFEB",car:"\uD83D\uDE97",taxi:"\uD83D\uDE95",bus:"\uD83D\uDE8C",train:"\uD83D\uDE82",airplane:"\u2708\uFE0F",ship:"\uD83D\uDEA2",bike:"\uD83D\uDEB2",soccer:"\u26BD",basketball:"\uD83C\uDFC0",football:"\uD83C\uDFC8",baseball:"\u26BE",tennis:"\uD83C\uDFBE",trophy:"\uD83C\uDFC6",medal:"\uD83C\uDFC5",dart:"\uD83C\uDFAF",game_die:"\uD83C\uDFB2",musical_note:"\uD83C\uDFB5",notes:"\uD83C\uDFB6",art:"\uD83C\uDFA8",camera:"\uD83D\uDCF7",movie_camera:"\uD83C\uDFA5",checkered_flag:"\uD83C\uDFC1",triangular_flag_on_post:"\uD83D\uDEA9",flag_us:"\uD83C\uDDFA\uD83C\uDDF8",flag_gb:"\uD83C\uDDEC\uD83C\uDDE7",flag_fr:"\uD83C\uDDEB\uD83C\uDDF7",flag_de:"\uD83C\uDDE9\uD83C\uDDEA",flag_jp:"\uD83C\uDDEF\uD83C\uDDF5",flag_cn:"\uD83C\uDDE8\uD83C\uDDF3"};return e.replace(/:(\w+):/g,(n,r)=>{return t[r]||n})}function Ao(e){let t=/<Badge([^/>]+)\/>/gi;return e.replace(t,(n,r)=>{let o=r.match(/type="(info|tip|warning|danger)"/i),a=r.match(/text="([^"]+)"/),s=o?o[1].toLowerCase():"info",c=a?a[1]:"",i={info:{bg:"#e0f2fe",text:"#0c4a6e",border:"#0ea5e9"},tip:{bg:"#dcfce7",text:"#14532d",border:"#22c55e"},warning:{bg:"#fef3c7",text:"#78350f",border:"#f59e0b"},danger:{bg:"#fee2e2",text:"#7f1d1d",border:"#ef4444"}},l=i[s]||i.info;return`<span class="badge badge-${s}" style="display: inline-block; padding: 2px 8px; font-size: 0.85em; font-weight: 600; border-radius: 4px; background: ${l.bg}; color: ${l.text}; border: 1px solid ${l.border}; margin: 0 4px; vertical-align: middle;">${c}</span>`})}function vo(e){return e.replace(/<a\s+href="([^"]+)"([^>]*)>/g,(t,n,r)=>{if(r.includes("target="))return t;if(n.startsWith("http://")||n.startsWith("https://"))return`<a href="${n}" target="_blank" rel="noreferrer noopener"${r}>`;return t})}function $o(e){return e.replace(/<a\s+href="([^"]+)"\s+target="_blank"[^>]*>([^<]+)<\/a>/g,(t,n,r)=>{if(t.includes("external-link-icon"))return t;let o='<svg class="external-link-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: inline-block; margin-left: 4px; vertical-align: middle;"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>';return t.replace("</a>",`${o}</a>`)})}function Eo(e){return e.replace(/<img([^>]+)>/g,(t,n)=>{if(n.includes("loading="))return t;return`<img ${n} loading="lazy" decoding="async">`})}function No(e,t){if(!e.includes("[[toc]]"))return{content:e,tocHtml:null};let n=it(e),r={...st,...t},o=lt(n,r),s={items:ct(o),title:r.title||"Table of Contents",config:r},c=Ce(s),i="<!--INLINE_TOC_PLACEHOLDER-->";return{content:e.replace(/\[\[toc\]\]/g,i),tocHtml:c}}function xo(e,t){return e.replace(/<!--INLINE_TOC_PLACEHOLDER-->/g,t)}async function To(e){let t=/^>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n((?:>\s*.*\n?)*)/gm,n=Array.from(e.matchAll(t)),r=e;for(let o of n.reverse()){let[a,s,c]=o,i=c.split(`
|
|
1324
|
+
`).map((m)=>m.replace(/^>\s*/,"")).filter((m)=>m.trim()).map((m)=>`<p>${M(m)}</p>`).join(`
|
|
1325
|
+
`),l=s.toLowerCase(),d=await X(`blocks/alerts/${l}`,{content:i});r=r.slice(0,o.index)+d+r.slice(o.index+a.length)}return r}async function qo(e,t){let n=/^<<<\s+@\/([^\s[{#]+)(?:\{(\d+)-(\d+)\}|#(\w+))?\s*(?:\[[^\]]+\]\s*)?$/gm,r=Array.from(e.matchAll(n)),o=e;for(let a of r.reverse()){let[s,c,i,l,d]=a;try{let{join:m}=await import("path"),u=m(t,c),p=Bun.file(u);if(!await p.exists()){console.warn(`Code import: File not found: ${u}`);continue}let f=(await p.text()).split(`
|
|
1326
|
+
`),y=c.split(".").pop()||"",b={js:"javascript",ts:"typescript",jsx:"jsx",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",yaml:"yaml",yml:"yaml",json:"json",md:"markdown",html:"html",css:"css",scss:"scss",vue:"vue"}[y]||y;if(i&&l){let w=Number.parseInt(i)-1,x=Number.parseInt(l);f=f.slice(w,x)}else if(d){let w=f.findIndex((S)=>S.includes(`#region ${d}`)||S.includes(`// region ${d}`)||S.includes(`# region ${d}`)),x=f.findIndex((S,me)=>me>w&&(S.includes("#endregion")||S.includes("// endregion")||S.includes("# endregion")));if(w!==-1&&x!==-1)f=f.slice(w+1,x);else console.warn(`Code import: Region '${d}' not found in ${c}`)}let $=f.join(`
|
|
1327
|
+
`),v=`\`\`\`${b}
|
|
1328
|
+
${$}
|
|
1329
|
+
\`\`\``;o=o.slice(0,a.index)+v+o.slice(a.index+s.length)}catch(m){console.error(`Error importing code from ${c}:`,m)}}return o}async function en(e,t,n=new Set){let r=/<!--@include:\s*([^\s{]+)(?:\{(\d+)-(\d+)\}|\{#([\w-]+)\})?\s*-->/g,o=Array.from(e.matchAll(r)),a=e;for(let s of o.reverse()){let[c,i,l,d,m]=s;try{let{join:u,resolve:p}=await import("path"),h=p(u(t,i));if(n.has(h)){console.warn(`Markdown include: Circular reference detected for ${i}`);continue}let f=Bun.file(h);if(!await f.exists()){console.warn(`Markdown include: File not found: ${h}`);continue}let g=(await f.text()).split(`
|
|
1330
|
+
`);if(l&&d){let v=Number.parseInt(l)-1,w=Number.parseInt(d);g=g.slice(v,w)}else if(m){let v=g.findIndex((x)=>x.includes(`<!-- #region ${m} -->`)||x.includes(`<!-- region ${m} -->`)),w=g.findIndex((x,S)=>S>v&&(x.includes("<!-- #endregion -->")||x.includes("<!-- endregion -->")));if(v!==-1&&w!==-1)g=g.slice(v+1,w);else{console.warn(`Markdown include: Region '${m}' not found in ${i}`);continue}}let b=g.join(`
|
|
1331
|
+
`),$=new Set(n);$.add(h),b=await en(b,t,$),a=a.slice(0,s.index)+b+a.slice(s.index+c.length)}catch(u){console.error(`Error including markdown from ${i}:`,u)}}return a}async function jo(e){let t=/^:::\s+code-group[ \t]*\n((?:(?!^:::)[\s\S])*)^:::$/gm,n=Array.from(e.matchAll(t)),r=e;for(let o of n.reverse()){let[a,s]=o,c=/^```(\w+)[ \t]+\[([^\]]+)\][ \t]*\n((?:(?!^```)[\s\S])*)^```$/gm,i=Array.from(s.matchAll(c));if(i.length===0)continue;let l=`code-group-${Math.random().toString(36).substr(2,9)}`,d=i.map((p,h)=>{let f=p[2];return`<button class="code-group-tab ${h===0?"active":""}" onclick="switchCodeTab('${l}', ${h})">${f}</button>`}).join(""),m=await Promise.all(i.map(async(p,h)=>{let f=p[1],y=p[3],g=h===0,b=ce.markdown?.syntaxHighlightTheme||"github-light",$=await at(y,f,b);return`<div class="code-group-panel ${g?"active":""}" data-panel="${h}">
|
|
1332
|
+
<pre data-lang="${f}"><code class="language-${f}">${$}</code></pre>
|
|
1333
|
+
</div>`})),u=`<div class="code-group" id="${l}">
|
|
1334
|
+
<div class="code-group-tabs">
|
|
1335
|
+
${d}
|
|
1336
|
+
</div>
|
|
1337
|
+
<div class="code-group-panels">
|
|
1338
|
+
${m.join(`
|
|
1339
|
+
`)}
|
|
1340
|
+
</div>
|
|
1341
|
+
</div>`;r=r.slice(0,o.index)+u+r.slice(o.index+a.length)}return r}async function _o(e){let t=/^:::\s+(info|tip|warning|danger|details|raw)(?: +([^\n\t ][^\n]*))?\n((?:(?!^:::)[\s\S])*)^:::$/gm,n=Array.from(e.matchAll(t)),r=e;for(let o of n.reverse()){let[a,s,c,i]=o,l={info:"INFO",tip:"TIP",warning:"WARNING",danger:"DANGER",details:"Details",raw:""},d=c&&c.trim()||l[s],m=i.trim().split(`
|
|
1342
|
+
`).filter((p)=>p.trim()).map((p)=>`<p>${M(p)}</p>`).join(`
|
|
1343
|
+
`),u=await X(`blocks/containers/${s}`,{title:d,content:m});r=r.slice(0,o.index)+u+r.slice(o.index+a.length)}return r}function zo(e){let t=e.match(/^(\w+)/),n=t?t[1]:"",r=e.match(/\{([^}]+)\}/),o=[];if(r){let s=r[1].split(",");for(let c of s){let i=c.trim();if(i.includes("-")){let[l,d]=i.split("-").map(Number);for(let m=l;m<=d;m++)o.push(m)}else o.push(Number(i))}}let a=e.includes(":line-numbers");return{lang:n,highlights:o,showLineNumbers:a}}async function Co(e,t){let r=e[t].substring(3).trim(),{lang:o,highlights:a,showLineNumbers:s}=zo(r),c=[],i=t+1;while(i<e.length&&!e[i].startsWith("```"))c.push(e[i]),i++;let l=new Set,d=new Set,m=new Set,u=new Set,p=new Set,h=c.map((W,Y)=>{let Z=W;if(Z.includes("// [!code focus]"))l.add(Y),Z=Z.replace(/\/\/ \[!code focus\]/,"").trimEnd();if(Z.includes("// [!code ++]"))d.add(Y),Z=Z.replace(/\/\/ \[!code \+\+\]/,"").trimEnd();if(Z.includes("// [!code --]"))m.add(Y),Z=Z.replace(/\/\/ \[!code --\]/,"").trimEnd();if(Z.includes("// [!code error]"))u.add(Y),Z=Z.replace(/\/\/ \[!code error\]/,"").trimEnd();if(Z.includes("// [!code warning]"))p.add(Y),Z=Z.replace(/\/\/ \[!code warning\]/,"").trimEnd();return Z}),f=l.size>0,y=h.join(`
|
|
1344
|
+
`),g=ce.markdown?.syntaxHighlightTheme||"github-light",v=(await at(y,o,g)).split(`
|
|
1345
|
+
`).map((W,Y)=>{let Z=Y+1,tn=a.includes(Z),dt=l.has(Y),nn=d.has(Y),rn=m.has(Y),on=u.has(Y),an=p.has(Y),K=["line"];if(tn)K.push("highlighted");if(dt)K.push("focused");if(f&&!dt)K.push("dimmed");if(nn)K.push("diff-add");if(rn)K.push("diff-remove");if(on)K.push("has-error");if(an)K.push("has-warning");if(W.startsWith('<span class="line">')){let sn=K.join(" "),pt=W.replace('<span class="line">',`<span class="${sn}">`);if(s)return pt.replace("<span class=",`<span class="line-number">${Z}</span><span class=`);return pt}let mt=` class="${K.join(" ")}"`;if(s)return`<span${mt}><span class="line-number">${Z}</span>${W}</span>`;return`<span${mt}>${W}</span>`}).join(`
|
|
1346
|
+
`),w=[];if(s)w.push("line-numbers-mode");if(f)w.push("has-focused-lines");let x=w.length>0?` class="${w.join(" ")}"`:"",S=o?` data-lang="${o}"`:"";return{html:`<pre${x}${S}><code class="language-${o}">${v}</code></pre>`,endIndex:i}}async function So(e,t="./docs"){let{frontmatter:n,content:r}=go(e);if(n.layout==="home"){let p=await wo(n.hero),h=await bo(n.features);return{html:p+h,frontmatter:n}}let o=await en(r,t),{content:a,tocHtml:s}=No(o,n.toc);o=await qo(a,t),o=await jo(o),o=await To(o),o=await _o(o),o=ko(o),o=Ao(o);let c=o.split(`
|
|
1347
|
+
`),i=[],l=!1,d=!1,m=!1;for(let p=0;p<c.length;p++){let h=c[p];if(h.trim().startsWith(":::"))continue;if(h.includes('<div class="custom-block')||h.includes('<details class="custom-block')||h.includes('<div class="github-alert')||h.includes('<div class="code-group'))m=!0;if(m){if(i.push(h),h.includes("</div>")||h.includes("</details>"))m=!1;continue}if(h.startsWith("```")){if(!l){let{html:f,endIndex:y}=await Co(c,p);i.push(f),p=y,l=!1}continue}if(h.startsWith("###### ")){if(d)i.push("</ul>"),d=!1;i.push(`<h6>${M(h.substring(7))}</h6>`);continue}if(h.startsWith("##### ")){if(d)i.push("</ul>"),d=!1;i.push(`<h5>${M(h.substring(6))}</h5>`);continue}if(h.startsWith("#### ")){if(d)i.push("</ul>"),d=!1;i.push(`<h4>${M(h.substring(5))}</h4>`);continue}if(h.startsWith("### ")){if(d)i.push("</ul>"),d=!1;i.push(`<h3>${M(h.substring(4))}</h3>`);continue}if(h.startsWith("## ")){if(d)i.push("</ul>"),d=!1;i.push(`<h2>${M(h.substring(3))}</h2>`);continue}if(h.startsWith("# ")){if(d)i.push("</ul>"),d=!1;i.push(`<h1>${M(h.substring(2))}</h1>`);continue}if(h.match(/^\s*[-*]\s+/)){if(!d)i.push("<ul>"),d=!0;i.push(`<li>${M(h.replace(/^\s*[-*]\s+/,""))}</li>`);continue}if(d&&h.trim()!=="")i.push("</ul>"),d=!1;if(h.trim().startsWith("|")&&h.trim().endsWith("|")){let f=[],y=p;while(y<c.length&&c[y].trim().startsWith("|"))f.push(c[y].trim()),y++;if(f.length>=2){let g=(w)=>{return M(w.trim())},$=f[1].split("|").filter((w)=>w.trim()).map((w)=>{let x=w.trim();if(x.startsWith(":")&&x.endsWith(":"))return"center";else if(x.endsWith(":"))return"right";else return"left"});i.push('<div class="table-responsive">'),i.push('<table class="enhanced-table">');let v=f[0].split("|").filter((w)=>w.trim());if(i.push(" <thead>"),i.push(" <tr>"),v.forEach((w,x)=>{let S=$[x]||"left";i.push(` <th style="text-align: ${S}">${g(w)}</th>`)}),i.push(" </tr>"),i.push(" </thead>"),f.length>2){i.push(" <tbody>");for(let w=2;w<f.length;w++){let x=f[w].split("|").filter((S)=>S.trim());i.push(" <tr>"),x.forEach((S,me)=>{let W=$[me]||"left";i.push(` <td style="text-align: ${W}">${g(S)}</td>`)}),i.push(" </tr>")}i.push(" </tbody>")}i.push("</table>"),i.push("</div>"),p=y-1;continue}}if(h.trim()==="")continue;if(h.trim().startsWith("<!--")&&h.trim().endsWith("-->")){i.push(h);continue}h=M(h),i.push(`<p>${h}</p>`)}if(d)i.push("</ul>");let u=i.join(`
|
|
1348
|
+
`);if(s)u=xo(u,s);return u=vo(u),u=$o(u),u=Eo(u),{html:u,frontmatter:n}}async function Zo(e={}){let t=e.config||ce,n=e.port||3000,r=e.root||"./docs",o=Bun.serve({port:n,async fetch(c){let l=new URL(c.url).pathname;if(l==="/")l="/index";if([".png",".jpg",".jpeg",".gif",".svg",".css",".js",".ico",".woff",".woff2",".ttf"].some((u)=>l.endsWith(u)))try{let u=`${r}/public${l}`,p=Bun.file(u);if(await p.exists())return new Response(p);let h=`${r}${l}`,f=Bun.file(h);if(await f.exists())return new Response(f)}catch{}let m=`${r}${l}.md`;try{let u=Bun.file(m);if(await u.exists()){let p=await u.text(),{html:h,frontmatter:f}=await So(p,r),y=f.layout==="home",g=await Ht(h,t,l,y);return new Response(g,{headers:{"Content-Type":"text/html; charset=utf-8"}})}}catch{}return new Response(await Ht("<h1>404 - Page Not Found</h1><p>The page you are looking for does not exist.</p>",t,l),{status:404,headers:{"Content-Type":"text/html; charset=utf-8"}})}}),a=`http://localhost:${o.port}`,s=()=>o.stop();return console.log(`
|
|
1349
|
+
\uD83D\uDCDA BunPress documentation server running at ${a}`),console.log(`Press Ctrl+C to stop
|
|
1350
|
+
`),{server:o,url:a,stop:s}}async function Rs(e={}){let{stop:t}=await Zo(e),n=e.watch!==void 0?e.watch:!0,r=e.root||"./docs";if(n){console.log(`Watching for changes in ${r} directory...
|
|
1351
|
+
`);try{let{Glob:o}=awaitPromise.resolve(globalThis.Bun),{stat:a}=await import("fs/promises"),{join:s}=await import("path"),c=new Map,i=new o("**/*.{md,stx,ts,js,css,html}");for await(let m of i.scan(r))try{let u=s(r,m),p=await a(u);c.set(m,p.mtimeMs)}catch{}let l=null,d=()=>{if(l)clearTimeout(l);l=setTimeout(async()=>{console.log("File changed detected, reloading..."),Vt(),console.log("Ready for requests")},100)};setInterval(async()=>{try{let m=!1,u=new Set,p=new o("**/*.{md,stx,ts,js,css,html}");for await(let h of p.scan(r)){u.add(h);try{let f=s(r,h),y=await a(f),g=c.get(h);if(g===void 0||y.mtimeMs>g)m=!0,c.set(h,y.mtimeMs)}catch{}}for(let h of c.keys())if(!u.has(h))m=!0,c.delete(h);if(m)d()}catch{}},1000)}catch(o){console.error("Error setting up file watcher:",o)}}Ze.on("SIGINT",()=>{console.log(`
|
|
1352
|
+
Shutting down server...`),t(),Ze.exit(0)}),Ze.on("SIGTERM",()=>{console.log(`
|
|
1353
|
+
Shutting down server...`),t(),Ze.exit(0)}),await new Promise(()=>{})}
|
|
1354
|
+
export{Sn as a,ce as b,Na as c,gs as d,ot as e,Pt as f,at as g,ws as h,Jt as i,bs as j,ks as k,st as l,oo as m,Wt as n,it as o,ct as p,lt as q,ze as r,Ce as s,ao as t,so as u,io as v,vs as w,$s as x,Es as y,Ns as z,xs as A,Zo as B,Rs as C};
|