@origintrail-official/dkg-node-ui 10.0.12 → 10.0.13
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/LICENSE +201 -201
- package/README.md +50 -50
- package/dist/chain-cursor-stores.js +6 -6
- package/dist/chat-memory.js +209 -209
- package/dist/db.js +955 -955
- package/dist-ui/assets/{3d-force-graph-Bl6v-uII.js → 3d-force-graph-C9KowW4u.js} +1 -1
- package/dist-ui/assets/{AgentHub-D2vaQxlw.js → AgentHub-BVrcom9_.js} +1 -1
- package/dist-ui/assets/{AgentProfilePage-BgSTdsjD.js → AgentProfilePage-C9XaTt7j.js} +1 -1
- package/dist-ui/assets/{ApproveWalletsModal-D0Ub_eiD.js → ApproveWalletsModal-BdR2mshx.js} +3 -3
- package/dist-ui/assets/{ConvictionDetailView-CieVypna.js → ConvictionDetailView-cao48GL1.js} +1 -1
- package/dist-ui/assets/{Network-DKw_XEGi.js → Network-B3jCYzr5.js} +1 -1
- package/dist-ui/assets/{OnChainProvenanceCard-Dn_IEP7Q.js → OnChainProvenanceCard-DboMX4Aq.js} +1 -1
- package/dist-ui/assets/{Operations-BO2C3UWB.js → Operations-Dg1gfLXv.js} +1 -1
- package/dist-ui/assets/{PublishingConviction-xKRNHbzk.js → PublishingConviction-Byp6t69e.js} +1 -1
- package/dist-ui/assets/{Settings-DC_d9STV.js → Settings-CxI0SKeV.js} +1 -1
- package/dist-ui/assets/{ccip-zWfeQL8Q.js → ccip-wJ3OMRuz.js} +1 -1
- package/dist-ui/assets/{index-CwRQnNYh.js → index-5DS6xjw0.js} +3 -3
- package/dist-ui/assets/index-DOjsv0r7.css +1 -0
- package/dist-ui/assets/index-KoAnx9JE.js +1661 -0
- package/dist-ui/assets/{jsonld-B67IUHNU-C3ydusi_.js → jsonld-32FQRO67-CDirPi8u.js} +2 -2
- package/dist-ui/assets/{jsonld-G-CM-8JR.js → jsonld-CwHW9UDN.js} +1 -1
- package/dist-ui/assets/{renderer-3d-OSESAPET-ConXqyK6.js → renderer-3d-2EVDZII7-BNXV6iSu.js} +2 -2
- package/dist-ui/assets/{shikiHighlighter-C6lRYd1O.js → shikiHighlighter-C-LWPPSu.js} +1 -1
- package/dist-ui/index.html +14 -14
- package/package.json +4 -3
- package/dist-ui/assets/index-DEtfq9qv.css +0 -1
- package/dist-ui/assets/index-hrI-Ir4l.js +0 -1661
- /package/dist-ui/assets/{ntriples-SF2LFNMC-DH7OofPp.js → ntriples-ZWBY2WET-DH7OofPp.js} +0 -0
- /package/dist-ui/assets/{turtle-BXN4L2BY-BzTu0283.js → turtle-JJPK7LJ5-BzTu0283.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonld-
|
|
2
|
-
import{_ as y}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonld-CwHW9UDN.js","assets/index-KoAnx9JE.js","assets/index-DOjsv0r7.css","assets/ntriples-ZWBY2WET-DH7OofPp.js","assets/N3Parser-CI_4owEm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as y}from"./index-KoAnx9JE.js";async function _(a){const e=typeof a=="string"?JSON.parse(a):a;try{const n=await(await y(()=>import("./jsonld-CwHW9UDN.js").then(r=>r.j),__vite__mapDeps([0,1,2]))).default.toRDF(e,{format:"application/n-quads"}),{parseNQuads:o}=await y(async()=>{const{parseNQuads:r}=await import("./ntriples-ZWBY2WET-DH7OofPp.js");return{parseNQuads:r}},__vite__mapDeps([3,4]));return o(n)}catch{return d(e)}}function d(a){const e=[],p=Array.isArray(a["@graph"])?a["@graph"]:[a];for(const n of p){if(!n||typeof n!="object")continue;const o=n,r=o["@id"]||`_:b${Math.random().toString(36).slice(2,10)}`,f=Array.isArray(o["@type"])?o["@type"]:o["@type"]?[o["@type"]]:[];for(const s of f)e.push({subject:r,predicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",object:s});for(const[s,i]of Object.entries(o)){if(s.startsWith("@"))continue;const u=Array.isArray(i)?i:[i];for(const t of u)if(t&&typeof t=="object"&&"@id"in t)e.push({subject:r,predicate:s,object:t["@id"]});else if(t&&typeof t=="object"&&"@value"in t){const c=t;e.push({subject:r,predicate:s,object:c["@value"],datatype:c["@type"],language:c["@language"]})}else(typeof t=="string"||typeof t=="number"||typeof t=="boolean")&&e.push({subject:r,predicate:s,object:String(t)})}}return e}export{_ as parseJsonLd};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as rt,a2 as Kt,a3 as Wt}from"./index-
|
|
1
|
+
import{k as rt,a2 as Kt,a3 as Wt}from"./index-KoAnx9JE.js";function Yt(v,s){for(var g=0;g<s.length;g++){const p=s[g];if(typeof p!="string"&&!Array.isArray(p)){for(const A in p)if(A!=="default"&&!(A in v)){const r=Object.getOwnPropertyDescriptor(p,A);r&&Object.defineProperty(v,A,r.get?r:{enumerable:!0,get:()=>p[A]})}}}return Object.freeze(Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}))}var pe={},ge,it;function Ce(){return it||(it=1,ge=class Bt{constructor(s,g=new Map,p=0){this.prefix=s,this._existing=g,this.counter=p}clone(){const{prefix:s,_existing:g,counter:p}=this;return new Bt(s,new Map(g),p)}getId(s){const g=s&&this._existing.get(s);if(g)return g;const p=this.prefix+this.counter;return this.counter++,s&&this._existing.set(s,p),p}hasId(s){return this._existing.has(s)}getOldIds(){return[...this._existing.keys()]}}),ge}var ye={},st;function Ct(){return st||(st=1,(function(v,s){if(v.setImmediate)return;var g=1,p={},A=!1,r=v.document,t;function n(k){typeof k!="function"&&(k=new Function(""+k));for(var f=new Array(arguments.length-1),e=0;e<f.length;e++)f[e]=arguments[e+1];var i={callback:k,args:f};return p[g]=i,t(g),g++}function a(k){delete p[k]}function b(k){var f=k.callback,e=k.args;switch(e.length){case 0:f();break;case 1:f(e[0]);break;case 2:f(e[0],e[1]);break;case 3:f(e[0],e[1],e[2]);break;default:f.apply(s,e);break}}function N(k){if(A)setTimeout(N,0,k);else{var f=p[k];if(f){A=!0;try{b(f)}finally{a(k),A=!1}}}}function D(){t=function(k){process.nextTick(function(){N(k)})}}function u(){if(v.postMessage&&!v.importScripts){var k=!0,f=v.onmessage;return v.onmessage=function(){k=!1},v.postMessage("","*"),v.onmessage=f,k}}function l(){var k="setImmediate$"+Math.random()+"$",f=function(e){e.source===v&&typeof e.data=="string"&&e.data.indexOf(k)===0&&N(+e.data.slice(k.length))};v.addEventListener?v.addEventListener("message",f,!1):v.attachEvent("onmessage",f),t=function(e){v.postMessage(k+e,"*")}}function w(){var k=new MessageChannel;k.port1.onmessage=function(f){var e=f.data;N(e)},t=function(f){k.port2.postMessage(f)}}function _(){var k=r.documentElement;t=function(f){var e=r.createElement("script");e.onreadystatechange=function(){N(f),e.onreadystatechange=null,k.removeChild(e),e=null},k.appendChild(e)}}function O(){t=function(k){setTimeout(N,0,k)}}var H=Object.getPrototypeOf&&Object.getPrototypeOf(v);H=H&&H.setTimeout?H:v,{}.toString.call(v.process)==="[object process]"?D():u()?l():v.MessageChannel?w():r&&"onreadystatechange"in r.createElement("script")?_():O(),H.setImmediate=n,H.clearImmediate=a})(typeof self>"u"?typeof rt>"u"?ye:rt:self)),ye}/*!
|
|
2
2
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
3
3
|
*/var ve,at;function ue(){if(at)return ve;at=1,Ct();const v=self.crypto||self.msCrypto;return ve=class{constructor(g){if(!(v&&v.subtle))throw new Error("crypto.subtle not found.");if(g==="sha256")this.algorithm={name:"SHA-256"};else if(g==="sha1")this.algorithm={name:"SHA-1"};else throw new Error(`Unsupported algorithm "${g}".`);this._content=""}update(g){this._content+=g}async digest(){const g=new TextEncoder().encode(this._content),p=new Uint8Array(await v.subtle.digest(this.algorithm,g));let A="";for(let r=0;r<p.length;++r)A+=p[r].toString(16).padStart(2,"0");return A}},ve}/*!
|
|
4
4
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
package/dist-ui/assets/{renderer-3d-OSESAPET-ConXqyK6.js → renderer-3d-2EVDZII7-BNXV6iSu.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/3d-force-graph-
|
|
2
|
-
var w=Object.defineProperty;var P=(e,a,i)=>a in e?w(e,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[a]=i;var d=(e,a,i)=>P(e,typeof a!="symbol"?a+"":a,i);import{_ as E}from"./index-hrI-Ir4l.js";var R=class{constructor(e){d(this,"_container");d(this,"_graph",null);d(this,"_hexPainter");d(this,"_styleEngine");d(this,"_events");d(this,"_currentNodes",new Map);d(this,"_positionCache",new Map);d(this,"_ForceGraph3D",null);d(this,"_THREE",null);d(this,"_textureCache",new Map);d(this,"_textureLoader",null);d(this,"_labelSprites",new Map);d(this,"_labelTimer",null);d(this,"_driftTimer",null);d(this,"_labelFraction",.08);d(this,"_labelMaxDistSq",62500);d(this,"_labelBaseScale",.06);d(this,"_riskPulseEnabled",!1);d(this,"_hoverTraceEnabled",!1);d(this,"_hoveredNodeId",null);d(this,"_fadeInEnabled",!1);d(this,"_loadTime",0);d(this,"_animTime",0);d(this,"_pulseTimer",null);this._container=e.container,this._hexPainter=e.hexPainter,this._styleEngine=e.styleEngine,this._events=e.events}async init(){if(this._graph)return;const[e,a]=await Promise.all([E(()=>import("./3d-force-graph-Bl6v-uII.js"),__vite__mapDeps([0,1,2,3,4,5])),E(()=>import("./three.module-BXIk8GZS.js").then(s=>s.da),[])]);this._ForceGraph3D=e.default??e,this._THREE=a,this._textureLoader=new a.TextureLoader;const i=this._container.clientWidth||this._container.offsetWidth||800,n=this._container.clientHeight||this._container.offsetHeight||600;this._graph=this._ForceGraph3D()(this._container).width(i).height(n).backgroundColor("#0a0a0f").nodeColor(s=>{const r=s;return r._graphNode?r._graphNode.isHighRisk?"#e04040":this._styleEngine.getNodeColor(r._graphNode):"#334"}).nodeVal(s=>{const r=s;if(!r._graphNode)return 1;const t=this._hexPainter.getRadius(r._graphNode);let c=t*t*t*.05;if(this._riskPulseEnabled&&r._graphNode.isHighRisk){const o=C(r._graphNode.id),_=1+.25*Math.sin(this._animTime*2+o);c*=_}return c}).nodeOpacity(.85).nodeResolution(6).nodeThreeObject(s=>{var t;const r=s;if((t=r._graphNode)!=null&&t.imageUrl)return this._createIconSprite(r._graphNode)}).nodeThreeObjectExtend(!1).linkColor("#1a1a3a").linkWidth(0).linkOpacity(.15).onNodeClick(s=>{const r=s;r._graphNode&&this._events.emit("node:click",r._graphNode)}).onNodeDrag(s=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeDragEnd(s=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeHover(s=>{const r=s;r!=null&&r._graphNode?(this._hoveredNodeId=r._graphNode.id,this._events.emit("node:hover",r._graphNode),this._container.style.cursor="pointer"):(this._hoveredNodeId=null,this._events.emit("node:unhover",null),this._container.style.cursor="default")}).onLinkClick(s=>{const r=s;r._graphEdge&&this._events.emit("edge:click",r._graphEdge)}).onBackgroundClick(()=>{this._events.emit("background:click",{x:0,y:0})}).cooldownTicks(80).d3AlphaDecay(.05).d3VelocityDecay(.5).warmupTicks(30),this._labelTimer=setInterval(()=>this._updateProximityLabels(),500)}render(e,a,i){if(!this._graph){this.init().then(()=>this.render(e,a,i));return}if(this._loadTime===0&&(this._loadTime=performance.now(),this._fadeInEnabled)){this._graph.nodeOpacity(.05);const o=()=>{const _=performance.now()-this._loadTime;if(_<1500){const l=_/1500,h=1-Math.pow(1-l,3);this._graph.nodeOpacity(h*.85),requestAnimationFrame(o)}else this._graph.nodeOpacity(.85)};requestAnimationFrame(o)}let n=1;for(const o of e.values())o.degree>n&&(n=o.degree);this._hexPainter.setMaxDegree(n);const s=new Map;for(const[o,_]of e){if(i!=null&&i.has(o))continue;const l=this._currentNodes.get(o),h=this._positionCache.get(o);s.set(o,{id:o,x:(l==null?void 0:l.x)??(h==null?void 0:h.x)??(Math.random()-.5)*300,y:(l==null?void 0:l.y)??(h==null?void 0:h.y)??(Math.random()-.5)*300,vx:(l==null?void 0:l.vx)??(h==null?void 0:h.vx),vy:(l==null?void 0:l.vy)??(h==null?void 0:h.vy),fx:typeof(l==null?void 0:l.fx)=="number"?l.fx:typeof(h==null?void 0:h.fx)=="number"?h.fx:void 0,fy:typeof(l==null?void 0:l.fy)=="number"?l.fy:typeof(h==null?void 0:h.fy)=="number"?h.fy:void 0,_graphNode:_})}const r=new Set(s.keys()),t=[];for(const o of a.values())i!=null&&i.has(o.source)||i!=null&&i.has(o.target)||!r.has(o.source)||!r.has(o.target)||t.push({source:o.source,target:o.target,_graphEdge:o});this._currentNodes=s;const c=new Map;for(const[o,_]of s)c.set(o,{x:_.x,y:_.y,vx:_.vx,vy:_.vy,fx:typeof _.fx=="number"?_.fx:void 0,fy:typeof _.fy=="number"?_.fy:void 0});this._positionCache=c,this._labelSprites.clear(),this._graph.graphData({nodes:[...s.values()],links:t})}centerOnNode(e,a=350,i){const n=this._currentNodes.get(e);if(n&&this._graph){const s={x:n.x??0,y:n.y??0,z:0},r=i!=null&&Number.isFinite(i)&&i>0?i:1,t=Math.max(60,200/r);this._graph.cameraPosition({x:s.x,y:s.y,z:t},s,a)}}zoomToFit(e=40,a=500){var i;(i=this._graph)==null||i.zoomToFit(a,e)}getCanvas(){return this._graph?this._container.querySelector("canvas")??null:null}refresh(){if(!this._graph)return;const e=this._graph.refresh;typeof e=="function"&&e.call(this._graph)}resize(){this._graph&&(this._graph.width(this._container.clientWidth),this._graph.height(this._container.clientHeight))}destroy(){var e,a;this._labelTimer&&(clearInterval(this._labelTimer),this._labelTimer=null),this._driftTimer&&(clearInterval(this._driftTimer),this._driftTimer=null),this._pulseTimer&&(clearInterval(this._pulseTimer),this._pulseTimer=null),this._graph&&((a=(e=this._graph)._destructor)==null||a.call(e),this._graph=null),this._currentNodes.clear(),this._positionCache.clear(),this._labelSprites.clear(),this._textureCache.clear()}_createIconSprite(e){const a=this._THREE;if(!a||!e.imageUrl)return;const i=this._hexPainter.getRadius(e),n=Math.max(i*2.5,6),s=e.imageUrl;if(s.startsWith("data:image/svg+xml"))return this._createSvgSprite(s,n,e);let r=this._textureCache.get(s);r||(r=this._textureLoader.load(s),r.colorSpace=a.SRGBColorSpace,this._textureCache.set(s,r));const t=new a.SpriteMaterial({map:r,transparent:!0,opacity:.9}),c=new a.Sprite(t);return c.scale.set(n,n,1),c}_createSvgSprite(e,a,i){const n=this._THREE;let s=this._textureCache.get(e);if(s){const y=new n.SpriteMaterial({map:s,transparent:!0}),T=new n.Sprite(y);return T.scale.set(a,a,1),T}const r=document.createElement("canvas"),t=64;r.width=t,r.height=t;const c=r.getContext("2d"),o=this._styleEngine.getNodeColor(i);c.beginPath(),c.arc(t/2,t/2,t/2-2,0,Math.PI*2),c.fillStyle=o,c.fill();const _=new Image;_.onload=()=>{const y=t*.2;c.drawImage(_,y,y,t-y*2,t-y*2),s.needsUpdate=!0},_.src=e,s=new n.CanvasTexture(r),this._textureCache.set(e,s);const l=new n.SpriteMaterial({map:s,transparent:!0}),h=new n.Sprite(l);return h.scale.set(a,a,1),h}_updateProximityLabels(){var o,_,l,h,y,T;const e=this._THREE;if(!this._graph||!e)return;const a=this._graph.camera();if(!a)return;const i=a.position,n=this._currentNodes.size;if(n===0)return;const s=Math.max(3,Math.ceil(n*this._labelFraction)),r=[];for(const[f,u]of this._currentNodes){if(!((o=u._graphNode)!=null&&o.label)||u._graphNode.label===u._graphNode.id)continue;const p=i.x-(u.x??0),v=i.y-(u.y??0),x=i.z-(u.z??0),g=p*p+v*v+x*x;g>this._labelMaxDistSq||r.push({id:f,distSq:g})}r.sort((f,u)=>f.distSq-u.distSq);const t=new Map;for(const f of r.slice(0,s))t.set(f.id,f.distSq);const c=this._labelMaxDistSq*4;for(const[f,u]of this._currentNodes){const p=u._graphNode;if(!(p!=null&&p.label)||p.label===p.id||!(p.sizeMultiplier&&p.sizeMultiplier>1)&&!p.isHighRisk)continue;const v=i.x-(u.x??0),x=i.y-(u.y??0),g=i.z-(u.z??0),b=v*v+x*x+g*g;b<=c&&t.set(f,b)}for(const[f,u]of this._labelSprites)t.has(f)||((_=u.parent)==null||_.remove(u),(l=u.material.map)==null||l.dispose(),u.material.dispose(),this._labelSprites.delete(f));for(const[f,u]of t){const p=this._currentNodes.get(f);if(!((h=p==null?void 0:p._graphNode)!=null&&h.label))continue;const v=this._hexPainter.getRadius(p._graphNode),x=Math.sqrt(u),g=Math.max(.3,Math.min(1,120/Math.max(x,1))),b=this._labelSprites.get(f);if(b){const k=((y=b.userData)==null?void 0:y.baseW)??1,N=((T=b.userData)==null?void 0:T.baseH)??1;b.scale.set(k*g,N*g,1),b.material.opacity=.3+g*.6;continue}const m=this._createLabelSprite(p._graphNode.label);if(!m)continue;m.userData={baseW:m.scale.x,baseH:m.scale.y},m.scale.set(m.scale.x*g,m.scale.y*g,1),m.material.opacity=.3+g*.6;const S=p.__threeObj;S&&(m.position.set(0,-v-2,0),S.add(m),this._labelSprites.set(f,m))}}_createLabelSprite(e){const a=this._THREE;if(!a)return null;const i=document.createElement("canvas"),n=i.getContext("2d");if(!n)return null;const s=28,r=e.length>22?e.slice(0,21)+"…":e;n.font=`500 ${s}px system-ui, -apple-system, sans-serif`;const t=n.measureText(r).width;i.width=t+12,i.height=s+8,n.fillStyle="rgba(10, 10, 20, 0.6)",n.beginPath(),n.roundRect(0,0,i.width,i.height,4),n.fill(),n.font=`500 ${s}px system-ui, -apple-system, sans-serif`,n.fillStyle="#d0d4dc",n.textAlign="center",n.textBaseline="middle",n.fillText(r,i.width/2,i.height/2);const c=new a.CanvasTexture(i),o=new a.SpriteMaterial({map:c,transparent:!0,opacity:.8,depthTest:!1}),_=new a.Sprite(o);return _.scale.set(i.width*this._labelBaseScale,i.height*this._labelBaseScale,1),_}applyAnimation(e){if(!this._graph)return;this._riskPulseEnabled=e.riskPulse??!1,this._hoverTraceEnabled=e.hoverTrace??!1,this._fadeInEnabled=e.fadeIn??!1,this._pulseTimer&&(clearInterval(this._pulseTimer),this._pulseTimer=null),this._riskPulseEnabled&&(this._pulseTimer=setInterval(()=>{this._animTime+=.05,this._graph&&this._graph.nodeVal(this._graph.nodeVal())},50));const a=e.linkParticleSpeed??.003,i=e.linkParticleColor??"rgba(100,150,255,0.6)",n=e.linkParticleWidth??.8;if(e.linkParticles||e.hoverTrace)try{const s=e.linkParticleCount??1;this._hoverTraceEnabled?this._graph.linkDirectionalParticles(r=>{if(!this._hoveredNodeId)return e.linkParticles?s:0;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?4:e.linkParticles?s:0}).linkDirectionalParticleSpeed(r=>{if(!this._hoveredNodeId)return a;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?.015:a}).linkDirectionalParticleWidth(r=>{if(!this._hoveredNodeId)return n;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?2:n}).linkDirectionalParticleColor(r=>{if(!this._hoveredNodeId)return i;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?"#60a0ff":i}):this._graph.linkDirectionalParticles(s).linkDirectionalParticleSpeed(a).linkDirectionalParticleWidth(n).linkDirectionalParticleColor(()=>i)}catch{}else try{this._graph.linkDirectionalParticles(0)}catch{}if(this._driftTimer&&(clearInterval(this._driftTimer),this._driftTimer=null),e.drift){this._graph.d3AlphaDecay(.005),this._driftTimer=setInterval(()=>{if(this._graph)try{this._graph.d3ReheatSimulation()}catch{}},8e3);try{this._graph.d3ReheatSimulation()}catch{}}else this._graph.d3AlphaDecay(.05)}applyPalette(e){this._graph&&this._graph.backgroundColor(e.background)}};function C(e){let a=0;for(let i=0;i<e.length;i++)a=(a<<5)-a+e.charCodeAt(i)|0;return a}export{R as WebGL3DRenderer};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/3d-force-graph-C9KowW4u.js","assets/three.module-BXIk8GZS.js","assets/index-KoAnx9JE.js","assets/index-DOjsv0r7.css","assets/index-5DS6xjw0.js","assets/ordinal-DhEzRPdO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var w=Object.defineProperty;var P=(e,a,i)=>a in e?w(e,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[a]=i;var d=(e,a,i)=>P(e,typeof a!="symbol"?a+"":a,i);import{_ as E}from"./index-KoAnx9JE.js";var R=class{constructor(e){d(this,"_container");d(this,"_graph",null);d(this,"_hexPainter");d(this,"_styleEngine");d(this,"_events");d(this,"_currentNodes",new Map);d(this,"_positionCache",new Map);d(this,"_ForceGraph3D",null);d(this,"_THREE",null);d(this,"_textureCache",new Map);d(this,"_textureLoader",null);d(this,"_labelSprites",new Map);d(this,"_labelTimer",null);d(this,"_driftTimer",null);d(this,"_labelFraction",.08);d(this,"_labelMaxDistSq",62500);d(this,"_labelBaseScale",.06);d(this,"_riskPulseEnabled",!1);d(this,"_hoverTraceEnabled",!1);d(this,"_hoveredNodeId",null);d(this,"_fadeInEnabled",!1);d(this,"_loadTime",0);d(this,"_animTime",0);d(this,"_pulseTimer",null);this._container=e.container,this._hexPainter=e.hexPainter,this._styleEngine=e.styleEngine,this._events=e.events}async init(){if(this._graph)return;const[e,a]=await Promise.all([E(()=>import("./3d-force-graph-C9KowW4u.js"),__vite__mapDeps([0,1,2,3,4,5])),E(()=>import("./three.module-BXIk8GZS.js").then(s=>s.da),[])]);this._ForceGraph3D=e.default??e,this._THREE=a,this._textureLoader=new a.TextureLoader;const i=this._container.clientWidth||this._container.offsetWidth||800,n=this._container.clientHeight||this._container.offsetHeight||600;this._graph=this._ForceGraph3D()(this._container).width(i).height(n).backgroundColor("#0a0a0f").nodeColor(s=>{const r=s;return r._graphNode?r._graphNode.isHighRisk?"#e04040":this._styleEngine.getNodeColor(r._graphNode):"#334"}).nodeVal(s=>{const r=s;if(!r._graphNode)return 1;const t=this._hexPainter.getRadius(r._graphNode);let c=t*t*t*.05;if(this._riskPulseEnabled&&r._graphNode.isHighRisk){const o=C(r._graphNode.id),_=1+.25*Math.sin(this._animTime*2+o);c*=_}return c}).nodeOpacity(.85).nodeResolution(6).nodeThreeObject(s=>{var t;const r=s;if((t=r._graphNode)!=null&&t.imageUrl)return this._createIconSprite(r._graphNode)}).nodeThreeObjectExtend(!1).linkColor("#1a1a3a").linkWidth(0).linkOpacity(.15).onNodeClick(s=>{const r=s;r._graphNode&&this._events.emit("node:click",r._graphNode)}).onNodeDrag(s=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeDragEnd(s=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeHover(s=>{const r=s;r!=null&&r._graphNode?(this._hoveredNodeId=r._graphNode.id,this._events.emit("node:hover",r._graphNode),this._container.style.cursor="pointer"):(this._hoveredNodeId=null,this._events.emit("node:unhover",null),this._container.style.cursor="default")}).onLinkClick(s=>{const r=s;r._graphEdge&&this._events.emit("edge:click",r._graphEdge)}).onBackgroundClick(()=>{this._events.emit("background:click",{x:0,y:0})}).cooldownTicks(80).d3AlphaDecay(.05).d3VelocityDecay(.5).warmupTicks(30),this._labelTimer=setInterval(()=>this._updateProximityLabels(),500)}render(e,a,i){if(!this._graph){this.init().then(()=>this.render(e,a,i));return}if(this._loadTime===0&&(this._loadTime=performance.now(),this._fadeInEnabled)){this._graph.nodeOpacity(.05);const o=()=>{const _=performance.now()-this._loadTime;if(_<1500){const l=_/1500,h=1-Math.pow(1-l,3);this._graph.nodeOpacity(h*.85),requestAnimationFrame(o)}else this._graph.nodeOpacity(.85)};requestAnimationFrame(o)}let n=1;for(const o of e.values())o.degree>n&&(n=o.degree);this._hexPainter.setMaxDegree(n);const s=new Map;for(const[o,_]of e){if(i!=null&&i.has(o))continue;const l=this._currentNodes.get(o),h=this._positionCache.get(o);s.set(o,{id:o,x:(l==null?void 0:l.x)??(h==null?void 0:h.x)??(Math.random()-.5)*300,y:(l==null?void 0:l.y)??(h==null?void 0:h.y)??(Math.random()-.5)*300,vx:(l==null?void 0:l.vx)??(h==null?void 0:h.vx),vy:(l==null?void 0:l.vy)??(h==null?void 0:h.vy),fx:typeof(l==null?void 0:l.fx)=="number"?l.fx:typeof(h==null?void 0:h.fx)=="number"?h.fx:void 0,fy:typeof(l==null?void 0:l.fy)=="number"?l.fy:typeof(h==null?void 0:h.fy)=="number"?h.fy:void 0,_graphNode:_})}const r=new Set(s.keys()),t=[];for(const o of a.values())i!=null&&i.has(o.source)||i!=null&&i.has(o.target)||!r.has(o.source)||!r.has(o.target)||t.push({source:o.source,target:o.target,_graphEdge:o});this._currentNodes=s;const c=new Map;for(const[o,_]of s)c.set(o,{x:_.x,y:_.y,vx:_.vx,vy:_.vy,fx:typeof _.fx=="number"?_.fx:void 0,fy:typeof _.fy=="number"?_.fy:void 0});this._positionCache=c,this._labelSprites.clear(),this._graph.graphData({nodes:[...s.values()],links:t})}centerOnNode(e,a=350,i){const n=this._currentNodes.get(e);if(n&&this._graph){const s={x:n.x??0,y:n.y??0,z:0},r=i!=null&&Number.isFinite(i)&&i>0?i:1,t=Math.max(60,200/r);this._graph.cameraPosition({x:s.x,y:s.y,z:t},s,a)}}zoomToFit(e=40,a=500){var i;(i=this._graph)==null||i.zoomToFit(a,e)}getCanvas(){return this._graph?this._container.querySelector("canvas")??null:null}refresh(){if(!this._graph)return;const e=this._graph.refresh;typeof e=="function"&&e.call(this._graph)}resize(){this._graph&&(this._graph.width(this._container.clientWidth),this._graph.height(this._container.clientHeight))}destroy(){var e,a;this._labelTimer&&(clearInterval(this._labelTimer),this._labelTimer=null),this._driftTimer&&(clearInterval(this._driftTimer),this._driftTimer=null),this._pulseTimer&&(clearInterval(this._pulseTimer),this._pulseTimer=null),this._graph&&((a=(e=this._graph)._destructor)==null||a.call(e),this._graph=null),this._currentNodes.clear(),this._positionCache.clear(),this._labelSprites.clear(),this._textureCache.clear()}_createIconSprite(e){const a=this._THREE;if(!a||!e.imageUrl)return;const i=this._hexPainter.getRadius(e),n=Math.max(i*2.5,6),s=e.imageUrl;if(s.startsWith("data:image/svg+xml"))return this._createSvgSprite(s,n,e);let r=this._textureCache.get(s);r||(r=this._textureLoader.load(s),r.colorSpace=a.SRGBColorSpace,this._textureCache.set(s,r));const t=new a.SpriteMaterial({map:r,transparent:!0,opacity:.9}),c=new a.Sprite(t);return c.scale.set(n,n,1),c}_createSvgSprite(e,a,i){const n=this._THREE;let s=this._textureCache.get(e);if(s){const y=new n.SpriteMaterial({map:s,transparent:!0}),T=new n.Sprite(y);return T.scale.set(a,a,1),T}const r=document.createElement("canvas"),t=64;r.width=t,r.height=t;const c=r.getContext("2d"),o=this._styleEngine.getNodeColor(i);c.beginPath(),c.arc(t/2,t/2,t/2-2,0,Math.PI*2),c.fillStyle=o,c.fill();const _=new Image;_.onload=()=>{const y=t*.2;c.drawImage(_,y,y,t-y*2,t-y*2),s.needsUpdate=!0},_.src=e,s=new n.CanvasTexture(r),this._textureCache.set(e,s);const l=new n.SpriteMaterial({map:s,transparent:!0}),h=new n.Sprite(l);return h.scale.set(a,a,1),h}_updateProximityLabels(){var o,_,l,h,y,T;const e=this._THREE;if(!this._graph||!e)return;const a=this._graph.camera();if(!a)return;const i=a.position,n=this._currentNodes.size;if(n===0)return;const s=Math.max(3,Math.ceil(n*this._labelFraction)),r=[];for(const[f,u]of this._currentNodes){if(!((o=u._graphNode)!=null&&o.label)||u._graphNode.label===u._graphNode.id)continue;const p=i.x-(u.x??0),v=i.y-(u.y??0),x=i.z-(u.z??0),g=p*p+v*v+x*x;g>this._labelMaxDistSq||r.push({id:f,distSq:g})}r.sort((f,u)=>f.distSq-u.distSq);const t=new Map;for(const f of r.slice(0,s))t.set(f.id,f.distSq);const c=this._labelMaxDistSq*4;for(const[f,u]of this._currentNodes){const p=u._graphNode;if(!(p!=null&&p.label)||p.label===p.id||!(p.sizeMultiplier&&p.sizeMultiplier>1)&&!p.isHighRisk)continue;const v=i.x-(u.x??0),x=i.y-(u.y??0),g=i.z-(u.z??0),b=v*v+x*x+g*g;b<=c&&t.set(f,b)}for(const[f,u]of this._labelSprites)t.has(f)||((_=u.parent)==null||_.remove(u),(l=u.material.map)==null||l.dispose(),u.material.dispose(),this._labelSprites.delete(f));for(const[f,u]of t){const p=this._currentNodes.get(f);if(!((h=p==null?void 0:p._graphNode)!=null&&h.label))continue;const v=this._hexPainter.getRadius(p._graphNode),x=Math.sqrt(u),g=Math.max(.3,Math.min(1,120/Math.max(x,1))),b=this._labelSprites.get(f);if(b){const k=((y=b.userData)==null?void 0:y.baseW)??1,N=((T=b.userData)==null?void 0:T.baseH)??1;b.scale.set(k*g,N*g,1),b.material.opacity=.3+g*.6;continue}const m=this._createLabelSprite(p._graphNode.label);if(!m)continue;m.userData={baseW:m.scale.x,baseH:m.scale.y},m.scale.set(m.scale.x*g,m.scale.y*g,1),m.material.opacity=.3+g*.6;const S=p.__threeObj;S&&(m.position.set(0,-v-2,0),S.add(m),this._labelSprites.set(f,m))}}_createLabelSprite(e){const a=this._THREE;if(!a)return null;const i=document.createElement("canvas"),n=i.getContext("2d");if(!n)return null;const s=28,r=e.length>22?e.slice(0,21)+"…":e;n.font=`500 ${s}px system-ui, -apple-system, sans-serif`;const t=n.measureText(r).width;i.width=t+12,i.height=s+8,n.fillStyle="rgba(10, 10, 20, 0.6)",n.beginPath(),n.roundRect(0,0,i.width,i.height,4),n.fill(),n.font=`500 ${s}px system-ui, -apple-system, sans-serif`,n.fillStyle="#d0d4dc",n.textAlign="center",n.textBaseline="middle",n.fillText(r,i.width/2,i.height/2);const c=new a.CanvasTexture(i),o=new a.SpriteMaterial({map:c,transparent:!0,opacity:.8,depthTest:!1}),_=new a.Sprite(o);return _.scale.set(i.width*this._labelBaseScale,i.height*this._labelBaseScale,1),_}applyAnimation(e){if(!this._graph)return;this._riskPulseEnabled=e.riskPulse??!1,this._hoverTraceEnabled=e.hoverTrace??!1,this._fadeInEnabled=e.fadeIn??!1,this._pulseTimer&&(clearInterval(this._pulseTimer),this._pulseTimer=null),this._riskPulseEnabled&&(this._pulseTimer=setInterval(()=>{this._animTime+=.05,this._graph&&this._graph.nodeVal(this._graph.nodeVal())},50));const a=e.linkParticleSpeed??.003,i=e.linkParticleColor??"rgba(100,150,255,0.6)",n=e.linkParticleWidth??.8;if(e.linkParticles||e.hoverTrace)try{const s=e.linkParticleCount??1;this._hoverTraceEnabled?this._graph.linkDirectionalParticles(r=>{if(!this._hoveredNodeId)return e.linkParticles?s:0;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?4:e.linkParticles?s:0}).linkDirectionalParticleSpeed(r=>{if(!this._hoveredNodeId)return a;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?.015:a}).linkDirectionalParticleWidth(r=>{if(!this._hoveredNodeId)return n;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?2:n}).linkDirectionalParticleColor(r=>{if(!this._hoveredNodeId)return i;const t=r,c=typeof t.source=="object"?t.source.id:t.source,o=typeof t.target=="object"?t.target.id:t.target;return c===this._hoveredNodeId||o===this._hoveredNodeId?"#60a0ff":i}):this._graph.linkDirectionalParticles(s).linkDirectionalParticleSpeed(a).linkDirectionalParticleWidth(n).linkDirectionalParticleColor(()=>i)}catch{}else try{this._graph.linkDirectionalParticles(0)}catch{}if(this._driftTimer&&(clearInterval(this._driftTimer),this._driftTimer=null),e.drift){this._graph.d3AlphaDecay(.005),this._driftTimer=setInterval(()=>{if(this._graph)try{this._graph.d3ReheatSimulation()}catch{}},8e3);try{this._graph.d3ReheatSimulation()}catch{}}else this._graph.d3AlphaDecay(.05)}applyPalette(e){this._graph&&this._graph.backgroundColor(e.background)}};function C(e){let a=0;for(let i=0;i<e.length;i++)a=(a<<5)-a+e.charCodeAt(i)|0;return a}export{R as WebGL3DRenderer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var zt=Object.defineProperty;var Vt=(n,e,t)=>e in n?zt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var g=(n,e,t)=>Vt(n,typeof e!="symbol"?e+"":e,t);import{aP as He,av as gt,T as Kt,at as Yt,au as Qt,i as Ye,a6 as Jt,ah as Xt,_ as Zt}from"./index-hrI-Ir4l.js";const Qe={}.hasOwnProperty;function en(n,e){const t=e||{};function r(s,...o){let i=r.invalid;const c=r.handlers;if(s&&Qe.call(s,n)){const a=String(s[n]);i=Qe.call(c,a)?c[a]:r.unknown}if(i)return i.call(this,s,...o)}return r.handlers=t.handlers||{},r.invalid=t.invalid,r.unknown=t.unknown,r}var v=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function tn(n){return De(n)}function De(n){return Array.isArray(n)?nn(n):n instanceof RegExp?n:typeof n=="object"?rn(n):n}function nn(n){let e=[];for(let t=0,r=n.length;t<r;t++)e[t]=De(n[t]);return e}function rn(n){let e={};for(let t in n)e[t]=De(n[t]);return e}function pt(n,...e){return e.forEach(t=>{for(let r in t)n[r]=t[r]}),n}function mt(n){const e=~n.lastIndexOf("/")||~n.lastIndexOf("\\");return e===0?n:~e===n.length-1?mt(n.substring(0,n.length-1)):n.substr(~e+1)}var Be=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,te=class{static hasCaptures(n){return n===null?!1:(Be.lastIndex=0,Be.test(n))}static replaceCaptures(n,e,t){return n.replace(Be,(r,s,o,i)=>{let c=t[parseInt(s||o,10)];if(c){let a=e.substring(c.start,c.end);for(;a[0]===".";)a=a.substring(1);switch(i){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return r})}};function bt(n,e){return n<e?-1:n>e?1:0}function _t(n,e){if(n===null&&e===null)return 0;if(!n)return-1;if(!e)return 1;let t=n.length,r=e.length;if(t===r){for(let s=0;s<t;s++){let o=bt(n[s],e[s]);if(o!==0)return o}return 0}return t-r}function Je(n){return!!(/^#[0-9a-f]{6}$/i.test(n)||/^#[0-9a-f]{8}$/i.test(n)||/^#[0-9a-f]{3}$/i.test(n)||/^#[0-9a-f]{4}$/i.test(n))}function yt(n){return n.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var kt=class{constructor(n){g(this,"cache",new Map);this.fn=n}get(n){if(this.cache.has(n))return this.cache.get(n);const e=this.fn(n);return this.cache.set(n,e),e}},ae=class{constructor(n,e,t){g(this,"_cachedMatchRoot",new kt(n=>this._root.match(n)));this._colorMap=n,this._defaults=e,this._root=t}static createFromRawTheme(n,e){return this.createFromParsedTheme(an(n),e)}static createFromParsedTheme(n,e){return ln(n,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(n){if(n===null)return this._defaults;const e=n.scopeName,r=this._cachedMatchRoot.get(e).find(s=>sn(n.parent,s.parentScopes));return r?new St(r.fontStyle,r.foreground,r.background):null}},Re=class oe{constructor(e,t){this.parent=e,this.scopeName=t}static push(e,t){for(const r of t)e=new oe(e,r);return e}static from(...e){let t=null;for(let r=0;r<e.length;r++)t=new oe(t,e[r]);return t}push(e){return new oe(this,e)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let r=this;for(;r&&r!==e;)t.push(r.scopeName),r=r.parent;return r===e?t.reverse():void 0}};function sn(n,e){if(e.length===0)return!0;for(let t=0;t<e.length;t++){let r=e[t],s=!1;if(r===">"){if(t===e.length-1)return!1;r=e[++t],s=!0}for(;n&&!on(n.scopeName,r);){if(s)return!1;n=n.parent}if(!n)return!1;n=n.parent}return!0}function on(n,e){return e===n||n.startsWith(e)&&n[e.length]==="."}var St=class{constructor(n,e,t){this.fontStyle=n,this.foregroundId=e,this.backgroundId=t}};function an(n){if(!n)return[];if(!n.settings||!Array.isArray(n.settings))return[];let e=n.settings,t=[],r=0;for(let s=0,o=e.length;s<o;s++){let i=e[s];if(!i.settings)continue;let c;if(typeof i.scope=="string"){let u=i.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),c=u.split(",")}else Array.isArray(i.scope)?c=i.scope:c=[""];let a=-1;if(typeof i.settings.fontStyle=="string"){a=0;let u=i.settings.fontStyle.split(" ");for(let f=0,h=u.length;f<h;f++)switch(u[f]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let l=null;typeof i.settings.foreground=="string"&&Je(i.settings.foreground)&&(l=i.settings.foreground);let d=null;typeof i.settings.background=="string"&&Je(i.settings.background)&&(d=i.settings.background);for(let u=0,f=c.length;u<f;u++){let p=c[u].trim().split(" "),k=p[p.length-1],y=null;p.length>1&&(y=p.slice(0,p.length-1),y.reverse()),t[r++]=new cn(k,y,s,a,l,d)}}return t}var cn=class{constructor(n,e,t,r,s,o){this.scope=n,this.parentScopes=e,this.index=t,this.fontStyle=r,this.foreground=s,this.background=o}},T=(n=>(n[n.NotSet=-1]="NotSet",n[n.None=0]="None",n[n.Italic=1]="Italic",n[n.Bold=2]="Bold",n[n.Underline=4]="Underline",n[n.Strikethrough=8]="Strikethrough",n))(T||{});function ln(n,e){n.sort((a,l)=>{let d=bt(a.scope,l.scope);return d!==0||(d=_t(a.parentScopes,l.parentScopes),d!==0)?d:a.index-l.index});let t=0,r="#000000",s="#ffffff";for(;n.length>=1&&n[0].scope==="";){let a=n.shift();a.fontStyle!==-1&&(t=a.fontStyle),a.foreground!==null&&(r=a.foreground),a.background!==null&&(s=a.background)}let o=new un(e),i=new St(t,o.getId(r),o.getId(s)),c=new fn(new Ee(0,null,-1,0,0),[]);for(let a=0,l=n.length;a<l;a++){let d=n[a];c.insert(0,d.scope,d.parentScopes,d.fontStyle,o.getId(d.foreground),o.getId(d.background))}return new ae(o,i,c)}var un=class{constructor(n){g(this,"_isFrozen");g(this,"_lastColorId");g(this,"_id2color");g(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(n)){this._isFrozen=!0;for(let e=0,t=n.length;e<t;e++)this._color2id[n[e]]=e,this._id2color[e]=n[e]}else this._isFrozen=!1}getId(n){if(n===null)return 0;n=n.toUpperCase();let e=this._color2id[n];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${n}`);return e=++this._lastColorId,this._color2id[n]=e,this._id2color[e]=n,e}getColorMap(){return this._id2color.slice(0)}},dn=Object.freeze([]),Ee=class wt{constructor(e,t,r,s,o){g(this,"scopeDepth");g(this,"parentScopes");g(this,"fontStyle");g(this,"foreground");g(this,"background");this.scopeDepth=e,this.parentScopes=t||dn,this.fontStyle=r,this.foreground=s,this.background=o}clone(){return new wt(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let r=0,s=e.length;r<s;r++)t[r]=e[r].clone();return t}acceptOverwrite(e,t,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},fn=class Pe{constructor(e,t=[],r={}){g(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=t}static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,t.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=t.parentScopes.length);){const o=t.parentScopes[s].length-e.parentScopes[r].length;if(o!==0)return o;r++,s++}return t.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,o;if(r===-1?(s=e,o=""):(s=e.substring(0,r),o=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(o)}const t=this._rulesWithParentScopes.concat(this._mainRule);return t.sort(Pe._cmpBySpecificity),t}insert(e,t,r,s,o,i){if(t===""){this._doInsertHere(e,r,s,o,i);return}let c=t.indexOf("."),a,l;c===-1?(a=t,l=""):(a=t.substring(0,c),l=t.substring(c+1));let d;this._children.hasOwnProperty(a)?d=this._children[a]:(d=new Pe(this._mainRule.clone(),Ee.cloneArr(this._rulesWithParentScopes)),this._children[a]=d),d.insert(e+1,l,r,s,o,i)}_doInsertHere(e,t,r,s,o){if(t===null){this._mainRule.acceptOverwrite(e,r,s,o);return}for(let i=0,c=this._rulesWithParentScopes.length;i<c;i++){let a=this._rulesWithParentScopes[i];if(_t(a.parentScopes,t)===0){a.acceptOverwrite(e,r,s,o);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new Ee(e,t,r,s,o))}},q=class E{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const t=E.getLanguageId(e),r=E.getTokenType(e),s=E.getFontStyle(e),o=E.getForeground(e),i=E.getBackground(e);console.log({languageId:t,tokenType:r,fontStyle:s,foreground:o,background:i})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,t,r,s,o,i,c){let a=E.getLanguageId(e),l=E.getTokenType(e),d=E.containsBalancedBrackets(e)?1:0,u=E.getFontStyle(e),f=E.getForeground(e),h=E.getBackground(e);return t!==0&&(a=t),r!==8&&(l=r),s!==null&&(d=s?1:0),o!==-1&&(u=o),i!==0&&(f=i),c!==0&&(h=c),(a<<0|l<<8|d<<10|u<<11|f<<15|h<<24)>>>0}};function ce(n,e){const t=[],r=hn(n);let s=r.next();for(;s!==null;){let a=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=i();if(t.push({matcher:l,priority:a}),s!==",")break;s=r.next()}return t;function o(){if(s==="-"){s=r.next();const a=o();return l=>!!a&&!a(l)}if(s==="("){s=r.next();const a=c();return s===")"&&(s=r.next()),a}if(Xe(s)){const a=[];do a.push(s),s=r.next();while(Xe(s));return l=>e(a,l)}return null}function i(){const a=[];let l=o();for(;l;)a.push(l),l=o();return d=>a.every(u=>u(d))}function c(){const a=[];let l=i();for(;l&&(a.push(l),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");l=i()}return d=>a.some(u=>u(d))}}function Xe(n){return!!n&&!!n.match(/[\w\.:]+/)}function hn(n){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,t=e.exec(n);return{next:()=>{if(!t)return null;const r=t[0];return t=e.exec(n),r}}}function Ct(n){typeof n.dispose=="function"&&n.dispose()}var Q=class{constructor(n){this.scopeName=n}toKey(){return this.scopeName}},gn=class{constructor(n,e){this.scopeName=n,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},pn=class{constructor(){g(this,"_references",[]);g(this,"_seenReferenceKeys",new Set);g(this,"visitedRule",new Set)}get references(){return this._references}add(n){const e=n.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(n))}},mn=class{constructor(n,e){g(this,"seenFullScopeRequests",new Set);g(this,"seenPartialScopeRequests",new Set);g(this,"Q");this.repo=n,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Q(this.initialScopeName)]}processQueue(){const n=this.Q;this.Q=[];const e=new pn;for(const t of n)bn(t,this.initialScopeName,this.repo,e);for(const t of e.references)if(t instanceof Q){if(this.seenFullScopeRequests.has(t.scopeName))continue;this.seenFullScopeRequests.add(t.scopeName),this.Q.push(t)}else{if(this.seenFullScopeRequests.has(t.scopeName)||this.seenPartialScopeRequests.has(t.toKey()))continue;this.seenPartialScopeRequests.add(t.toKey()),this.Q.push(t)}}};function bn(n,e,t,r){const s=t.lookup(n.scopeName);if(!s){if(n.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=t.lookup(e);n instanceof Q?ie({baseGrammar:o,selfGrammar:s},r):Le(n.ruleName,{baseGrammar:o,selfGrammar:s,repository:s.repository},r);const i=t.injections(n.scopeName);if(i)for(const c of i)r.add(new Q(c))}function Le(n,e,t){if(e.repository&&e.repository[n]){const r=e.repository[n];le([r],e,t)}}function ie(n,e){n.selfGrammar.patterns&&Array.isArray(n.selfGrammar.patterns)&&le(n.selfGrammar.patterns,{...n,repository:n.selfGrammar.repository},e),n.selfGrammar.injections&&le(Object.values(n.selfGrammar.injections),{...n,repository:n.selfGrammar.repository},e)}function le(n,e,t){for(const r of n){if(t.visitedRule.has(r))continue;t.visitedRule.add(r);const s=r.repository?pt({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&le(r.patterns,{...e,repository:s},t);const o=r.include;if(!o)continue;const i=vt(o);switch(i.kind){case 0:ie({...e,selfGrammar:e.baseGrammar},t);break;case 1:ie(e,t);break;case 2:Le(i.ruleName,{...e,repository:s},t);break;case 3:case 4:const c=i.scopeName===e.selfGrammar.scopeName?e.selfGrammar:i.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const a={baseGrammar:e.baseGrammar,selfGrammar:c,repository:s};i.kind===4?Le(i.ruleName,a,t):ie(a,t)}else i.kind===4?t.add(new gn(i.scopeName,i.ruleName)):t.add(new Q(i.scopeName));break}}}var _n=class{constructor(){g(this,"kind",0)}},yn=class{constructor(){g(this,"kind",1)}},kn=class{constructor(n){g(this,"kind",2);this.ruleName=n}},Sn=class{constructor(n){g(this,"kind",3);this.scopeName=n}},wn=class{constructor(n,e){g(this,"kind",4);this.scopeName=n,this.ruleName=e}};function vt(n){if(n==="$base")return new _n;if(n==="$self")return new yn;const e=n.indexOf("#");if(e===-1)return new Sn(n);if(e===0)return new kn(n.substring(1));{const t=n.substring(0,e),r=n.substring(e+1);return new wn(t,r)}}var Cn=/\\(\d+)/,Ze=/\\(\d+)/g,vn=-1,Bt=-2;var ee=class{constructor(n,e,t,r){g(this,"$location");g(this,"id");g(this,"_nameIsCapturing");g(this,"_name");g(this,"_contentNameIsCapturing");g(this,"_contentName");this.$location=n,this.id=e,this._name=t||null,this._nameIsCapturing=te.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=te.hasCaptures(this._contentName)}get debugName(){const n=this.$location?`${mt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${n}`}getName(n,e){return!this._nameIsCapturing||this._name===null||n===null||e===null?this._name:te.replaceCaptures(this._name,n,e)}getContentName(n,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:te.replaceCaptures(this._contentName,n,e)}},Bn=class extends ee{constructor(e,t,r,s,o){super(e,t,r,s);g(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,r,s){throw new Error("Not supported!")}},Rn=class extends ee{constructor(e,t,r,s,o){super(e,t,r,null);g(this,"_match");g(this,"captures");g(this,"_cachedCompiledPatterns");this._match=new J(s,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new X,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},et=class extends ee{constructor(e,t,r,s,o){super(e,t,r,s);g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new X,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ge=class extends ee{constructor(e,t,r,s,o,i,c,a,l,d){super(e,t,r,s);g(this,"_begin");g(this,"beginCaptures");g(this,"_end");g(this,"endHasBackReferences");g(this,"endCaptures");g(this,"applyEndPatternLast");g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");this._begin=new J(o,this.id),this.beginCaptures=i,this._end=new J(c||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,s)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new X;for(const r of this.patterns)e.getRule(r).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},ue=class extends ee{constructor(e,t,r,s,o,i,c,a,l){super(e,t,r,s);g(this,"_begin");g(this,"beginCaptures");g(this,"whileCaptures");g(this,"_while");g(this,"whileHasBackReferences");g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");g(this,"_cachedCompiledWhilePatterns");this._begin=new J(o,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new J(c,Bt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new X;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,r,s){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,s)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new X,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},Rt=class A{static createCaptureRule(e,t,r,s,o){return e.registerRule(i=>new Bn(t,i,r,s,o))}static getCompiledRuleId(e,t,r){return e.id||t.registerRule(s=>{if(e.id=s,e.match)return new Rn(e.$vscodeTextmateLocation,e.id,e.name,e.match,A._compileCaptures(e.captures,t,r));if(typeof e.begin>"u"){e.repository&&(r=pt({},r,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new et(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,A._compilePatterns(o,t,r))}return e.while?new ue(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,A._compileCaptures(e.beginCaptures||e.captures,t,r),e.while,A._compileCaptures(e.whileCaptures||e.captures,t,r),A._compilePatterns(e.patterns,t,r)):new Ge(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,A._compileCaptures(e.beginCaptures||e.captures,t,r),e.end,A._compileCaptures(e.endCaptures||e.captures,t,r),e.applyEndPatternLast,A._compilePatterns(e.patterns,t,r))}),e.id}static _compileCaptures(e,t,r){let s=[];if(e){let o=0;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const c=parseInt(i,10);c>o&&(o=c)}for(let i=0;i<=o;i++)s[i]=null;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const c=parseInt(i,10);let a=0;e[i].patterns&&(a=A.getCompiledRuleId(e[i],t,r)),s[c]=A.createCaptureRule(t,e[i].$vscodeTextmateLocation,e[i].name,e[i].contentName,a)}}return s}static _compilePatterns(e,t,r){let s=[];if(e)for(let o=0,i=e.length;o<i;o++){const c=e[o];let a=-1;if(c.include){const l=vt(c.include);switch(l.kind){case 0:case 1:a=A.getCompiledRuleId(r[c.include],t,r);break;case 2:let d=r[l.ruleName];d&&(a=A.getCompiledRuleId(d,t,r));break;case 3:case 4:const u=l.scopeName,f=l.kind===4?l.ruleName:null,h=t.getExternalGrammar(u,r);if(h)if(f){let p=h.repository[f];p&&(a=A.getCompiledRuleId(p,t,h.repository))}else a=A.getCompiledRuleId(h.repository.$self,t,h.repository);break}}else a=A.getCompiledRuleId(c,t,r);if(a!==-1){const l=t.getRule(a);let d=!1;if((l instanceof et||l instanceof Ge||l instanceof ue)&&l.hasMissingPatterns&&l.patterns.length===0&&(d=!0),d)continue;s.push(a)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},J=class Nt{constructor(e,t){g(this,"source");g(this,"ruleId");g(this,"hasAnchor");g(this,"hasBackReferences");g(this,"_anchorCache");if(e&&typeof e=="string"){const r=e.length;let s=0,o=[],i=!1;for(let c=0;c<r;c++)if(e.charAt(c)==="\\"&&c+1<r){const l=e.charAt(c+1);l==="z"?(o.push(e.substring(s,c)),o.push("$(?!\\n)(?<!\\n)"),s=c+2):(l==="A"||l==="G")&&(i=!0),c++}this.hasAnchor=i,s===0?this.source=e:(o.push(e.substring(s,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source=="string"?this.hasBackReferences=Cn.test(this.source):this.hasBackReferences=!1}clone(){return new Nt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=t.map(s=>e.substring(s.start,s.end));return Ze.lastIndex=0,this.source.replace(Ze,(s,o)=>yt(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],t=[],r=[],s=[],o,i,c,a;for(o=0,i=this.source.length;o<i;o++)c=this.source.charAt(o),e[o]=c,t[o]=c,r[o]=c,s[o]=c,c==="\\"&&o+1<i&&(a=this.source.charAt(o+1),a==="A"?(e[o+1]="",t[o+1]="",r[o+1]="A",s[o+1]="A"):a==="G"?(e[o+1]="",t[o+1]="G",r[o+1]="",s[o+1]="G"):(e[o+1]=a,t[o+1]=a,r[o+1]=a,s[o+1]=a),o++);return{A0_G0:e.join(""),A0_G1:t.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},X=class{constructor(){g(this,"_items");g(this,"_hasAnchors");g(this,"_cached");g(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(n){this._items.push(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}unshift(n){this._items.unshift(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}length(){return this._items.length}setSource(n,e){this._items[n].source!==e&&(this._disposeCaches(),this._items[n].setSource(e))}compile(n){if(!this._cached){let e=this._items.map(t=>t.source);this._cached=new tt(n,e,this._items.map(t=>t.ruleId))}return this._cached}compileAG(n,e,t){return this._hasAnchors?e?t?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G0):t?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G0):this.compile(n)}_resolveAnchors(n,e,t){let r=this._items.map(s=>s.resolveAnchors(e,t));return new tt(n,r,this._items.map(s=>s.ruleId))}},tt=class{constructor(n,e,t){g(this,"scanner");this.regExps=e,this.rules=t,this.scanner=n.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const n=[];for(let e=0,t=this.rules.length;e<t;e++)n.push(" - "+this.rules[e]+": "+this.regExps[e]);return n.join(`
|
|
1
|
+
var zt=Object.defineProperty;var Vt=(n,e,t)=>e in n?zt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var g=(n,e,t)=>Vt(n,typeof e!="symbol"?e+"":e,t);import{aP as He,av as gt,T as Kt,at as Yt,au as Qt,i as Ye,a6 as Jt,ah as Xt,_ as Zt}from"./index-KoAnx9JE.js";const Qe={}.hasOwnProperty;function en(n,e){const t=e||{};function r(s,...o){let i=r.invalid;const c=r.handlers;if(s&&Qe.call(s,n)){const a=String(s[n]);i=Qe.call(c,a)?c[a]:r.unknown}if(i)return i.call(this,s,...o)}return r.handlers=t.handlers||{},r.invalid=t.invalid,r.unknown=t.unknown,r}var v=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function tn(n){return De(n)}function De(n){return Array.isArray(n)?nn(n):n instanceof RegExp?n:typeof n=="object"?rn(n):n}function nn(n){let e=[];for(let t=0,r=n.length;t<r;t++)e[t]=De(n[t]);return e}function rn(n){let e={};for(let t in n)e[t]=De(n[t]);return e}function pt(n,...e){return e.forEach(t=>{for(let r in t)n[r]=t[r]}),n}function mt(n){const e=~n.lastIndexOf("/")||~n.lastIndexOf("\\");return e===0?n:~e===n.length-1?mt(n.substring(0,n.length-1)):n.substr(~e+1)}var Be=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,te=class{static hasCaptures(n){return n===null?!1:(Be.lastIndex=0,Be.test(n))}static replaceCaptures(n,e,t){return n.replace(Be,(r,s,o,i)=>{let c=t[parseInt(s||o,10)];if(c){let a=e.substring(c.start,c.end);for(;a[0]===".";)a=a.substring(1);switch(i){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return r})}};function bt(n,e){return n<e?-1:n>e?1:0}function _t(n,e){if(n===null&&e===null)return 0;if(!n)return-1;if(!e)return 1;let t=n.length,r=e.length;if(t===r){for(let s=0;s<t;s++){let o=bt(n[s],e[s]);if(o!==0)return o}return 0}return t-r}function Je(n){return!!(/^#[0-9a-f]{6}$/i.test(n)||/^#[0-9a-f]{8}$/i.test(n)||/^#[0-9a-f]{3}$/i.test(n)||/^#[0-9a-f]{4}$/i.test(n))}function yt(n){return n.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var kt=class{constructor(n){g(this,"cache",new Map);this.fn=n}get(n){if(this.cache.has(n))return this.cache.get(n);const e=this.fn(n);return this.cache.set(n,e),e}},ae=class{constructor(n,e,t){g(this,"_cachedMatchRoot",new kt(n=>this._root.match(n)));this._colorMap=n,this._defaults=e,this._root=t}static createFromRawTheme(n,e){return this.createFromParsedTheme(an(n),e)}static createFromParsedTheme(n,e){return ln(n,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(n){if(n===null)return this._defaults;const e=n.scopeName,r=this._cachedMatchRoot.get(e).find(s=>sn(n.parent,s.parentScopes));return r?new St(r.fontStyle,r.foreground,r.background):null}},Re=class oe{constructor(e,t){this.parent=e,this.scopeName=t}static push(e,t){for(const r of t)e=new oe(e,r);return e}static from(...e){let t=null;for(let r=0;r<e.length;r++)t=new oe(t,e[r]);return t}push(e){return new oe(this,e)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let r=this;for(;r&&r!==e;)t.push(r.scopeName),r=r.parent;return r===e?t.reverse():void 0}};function sn(n,e){if(e.length===0)return!0;for(let t=0;t<e.length;t++){let r=e[t],s=!1;if(r===">"){if(t===e.length-1)return!1;r=e[++t],s=!0}for(;n&&!on(n.scopeName,r);){if(s)return!1;n=n.parent}if(!n)return!1;n=n.parent}return!0}function on(n,e){return e===n||n.startsWith(e)&&n[e.length]==="."}var St=class{constructor(n,e,t){this.fontStyle=n,this.foregroundId=e,this.backgroundId=t}};function an(n){if(!n)return[];if(!n.settings||!Array.isArray(n.settings))return[];let e=n.settings,t=[],r=0;for(let s=0,o=e.length;s<o;s++){let i=e[s];if(!i.settings)continue;let c;if(typeof i.scope=="string"){let u=i.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),c=u.split(",")}else Array.isArray(i.scope)?c=i.scope:c=[""];let a=-1;if(typeof i.settings.fontStyle=="string"){a=0;let u=i.settings.fontStyle.split(" ");for(let f=0,h=u.length;f<h;f++)switch(u[f]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let l=null;typeof i.settings.foreground=="string"&&Je(i.settings.foreground)&&(l=i.settings.foreground);let d=null;typeof i.settings.background=="string"&&Je(i.settings.background)&&(d=i.settings.background);for(let u=0,f=c.length;u<f;u++){let p=c[u].trim().split(" "),k=p[p.length-1],y=null;p.length>1&&(y=p.slice(0,p.length-1),y.reverse()),t[r++]=new cn(k,y,s,a,l,d)}}return t}var cn=class{constructor(n,e,t,r,s,o){this.scope=n,this.parentScopes=e,this.index=t,this.fontStyle=r,this.foreground=s,this.background=o}},T=(n=>(n[n.NotSet=-1]="NotSet",n[n.None=0]="None",n[n.Italic=1]="Italic",n[n.Bold=2]="Bold",n[n.Underline=4]="Underline",n[n.Strikethrough=8]="Strikethrough",n))(T||{});function ln(n,e){n.sort((a,l)=>{let d=bt(a.scope,l.scope);return d!==0||(d=_t(a.parentScopes,l.parentScopes),d!==0)?d:a.index-l.index});let t=0,r="#000000",s="#ffffff";for(;n.length>=1&&n[0].scope==="";){let a=n.shift();a.fontStyle!==-1&&(t=a.fontStyle),a.foreground!==null&&(r=a.foreground),a.background!==null&&(s=a.background)}let o=new un(e),i=new St(t,o.getId(r),o.getId(s)),c=new fn(new Ee(0,null,-1,0,0),[]);for(let a=0,l=n.length;a<l;a++){let d=n[a];c.insert(0,d.scope,d.parentScopes,d.fontStyle,o.getId(d.foreground),o.getId(d.background))}return new ae(o,i,c)}var un=class{constructor(n){g(this,"_isFrozen");g(this,"_lastColorId");g(this,"_id2color");g(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(n)){this._isFrozen=!0;for(let e=0,t=n.length;e<t;e++)this._color2id[n[e]]=e,this._id2color[e]=n[e]}else this._isFrozen=!1}getId(n){if(n===null)return 0;n=n.toUpperCase();let e=this._color2id[n];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${n}`);return e=++this._lastColorId,this._color2id[n]=e,this._id2color[e]=n,e}getColorMap(){return this._id2color.slice(0)}},dn=Object.freeze([]),Ee=class wt{constructor(e,t,r,s,o){g(this,"scopeDepth");g(this,"parentScopes");g(this,"fontStyle");g(this,"foreground");g(this,"background");this.scopeDepth=e,this.parentScopes=t||dn,this.fontStyle=r,this.foreground=s,this.background=o}clone(){return new wt(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let r=0,s=e.length;r<s;r++)t[r]=e[r].clone();return t}acceptOverwrite(e,t,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},fn=class Pe{constructor(e,t=[],r={}){g(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=t}static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,t.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=t.parentScopes.length);){const o=t.parentScopes[s].length-e.parentScopes[r].length;if(o!==0)return o;r++,s++}return t.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,o;if(r===-1?(s=e,o=""):(s=e.substring(0,r),o=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(o)}const t=this._rulesWithParentScopes.concat(this._mainRule);return t.sort(Pe._cmpBySpecificity),t}insert(e,t,r,s,o,i){if(t===""){this._doInsertHere(e,r,s,o,i);return}let c=t.indexOf("."),a,l;c===-1?(a=t,l=""):(a=t.substring(0,c),l=t.substring(c+1));let d;this._children.hasOwnProperty(a)?d=this._children[a]:(d=new Pe(this._mainRule.clone(),Ee.cloneArr(this._rulesWithParentScopes)),this._children[a]=d),d.insert(e+1,l,r,s,o,i)}_doInsertHere(e,t,r,s,o){if(t===null){this._mainRule.acceptOverwrite(e,r,s,o);return}for(let i=0,c=this._rulesWithParentScopes.length;i<c;i++){let a=this._rulesWithParentScopes[i];if(_t(a.parentScopes,t)===0){a.acceptOverwrite(e,r,s,o);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new Ee(e,t,r,s,o))}},q=class E{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const t=E.getLanguageId(e),r=E.getTokenType(e),s=E.getFontStyle(e),o=E.getForeground(e),i=E.getBackground(e);console.log({languageId:t,tokenType:r,fontStyle:s,foreground:o,background:i})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,t,r,s,o,i,c){let a=E.getLanguageId(e),l=E.getTokenType(e),d=E.containsBalancedBrackets(e)?1:0,u=E.getFontStyle(e),f=E.getForeground(e),h=E.getBackground(e);return t!==0&&(a=t),r!==8&&(l=r),s!==null&&(d=s?1:0),o!==-1&&(u=o),i!==0&&(f=i),c!==0&&(h=c),(a<<0|l<<8|d<<10|u<<11|f<<15|h<<24)>>>0}};function ce(n,e){const t=[],r=hn(n);let s=r.next();for(;s!==null;){let a=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=i();if(t.push({matcher:l,priority:a}),s!==",")break;s=r.next()}return t;function o(){if(s==="-"){s=r.next();const a=o();return l=>!!a&&!a(l)}if(s==="("){s=r.next();const a=c();return s===")"&&(s=r.next()),a}if(Xe(s)){const a=[];do a.push(s),s=r.next();while(Xe(s));return l=>e(a,l)}return null}function i(){const a=[];let l=o();for(;l;)a.push(l),l=o();return d=>a.every(u=>u(d))}function c(){const a=[];let l=i();for(;l&&(a.push(l),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");l=i()}return d=>a.some(u=>u(d))}}function Xe(n){return!!n&&!!n.match(/[\w\.:]+/)}function hn(n){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,t=e.exec(n);return{next:()=>{if(!t)return null;const r=t[0];return t=e.exec(n),r}}}function Ct(n){typeof n.dispose=="function"&&n.dispose()}var Q=class{constructor(n){this.scopeName=n}toKey(){return this.scopeName}},gn=class{constructor(n,e){this.scopeName=n,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},pn=class{constructor(){g(this,"_references",[]);g(this,"_seenReferenceKeys",new Set);g(this,"visitedRule",new Set)}get references(){return this._references}add(n){const e=n.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(n))}},mn=class{constructor(n,e){g(this,"seenFullScopeRequests",new Set);g(this,"seenPartialScopeRequests",new Set);g(this,"Q");this.repo=n,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Q(this.initialScopeName)]}processQueue(){const n=this.Q;this.Q=[];const e=new pn;for(const t of n)bn(t,this.initialScopeName,this.repo,e);for(const t of e.references)if(t instanceof Q){if(this.seenFullScopeRequests.has(t.scopeName))continue;this.seenFullScopeRequests.add(t.scopeName),this.Q.push(t)}else{if(this.seenFullScopeRequests.has(t.scopeName)||this.seenPartialScopeRequests.has(t.toKey()))continue;this.seenPartialScopeRequests.add(t.toKey()),this.Q.push(t)}}};function bn(n,e,t,r){const s=t.lookup(n.scopeName);if(!s){if(n.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=t.lookup(e);n instanceof Q?ie({baseGrammar:o,selfGrammar:s},r):Le(n.ruleName,{baseGrammar:o,selfGrammar:s,repository:s.repository},r);const i=t.injections(n.scopeName);if(i)for(const c of i)r.add(new Q(c))}function Le(n,e,t){if(e.repository&&e.repository[n]){const r=e.repository[n];le([r],e,t)}}function ie(n,e){n.selfGrammar.patterns&&Array.isArray(n.selfGrammar.patterns)&&le(n.selfGrammar.patterns,{...n,repository:n.selfGrammar.repository},e),n.selfGrammar.injections&&le(Object.values(n.selfGrammar.injections),{...n,repository:n.selfGrammar.repository},e)}function le(n,e,t){for(const r of n){if(t.visitedRule.has(r))continue;t.visitedRule.add(r);const s=r.repository?pt({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&le(r.patterns,{...e,repository:s},t);const o=r.include;if(!o)continue;const i=vt(o);switch(i.kind){case 0:ie({...e,selfGrammar:e.baseGrammar},t);break;case 1:ie(e,t);break;case 2:Le(i.ruleName,{...e,repository:s},t);break;case 3:case 4:const c=i.scopeName===e.selfGrammar.scopeName?e.selfGrammar:i.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const a={baseGrammar:e.baseGrammar,selfGrammar:c,repository:s};i.kind===4?Le(i.ruleName,a,t):ie(a,t)}else i.kind===4?t.add(new gn(i.scopeName,i.ruleName)):t.add(new Q(i.scopeName));break}}}var _n=class{constructor(){g(this,"kind",0)}},yn=class{constructor(){g(this,"kind",1)}},kn=class{constructor(n){g(this,"kind",2);this.ruleName=n}},Sn=class{constructor(n){g(this,"kind",3);this.scopeName=n}},wn=class{constructor(n,e){g(this,"kind",4);this.scopeName=n,this.ruleName=e}};function vt(n){if(n==="$base")return new _n;if(n==="$self")return new yn;const e=n.indexOf("#");if(e===-1)return new Sn(n);if(e===0)return new kn(n.substring(1));{const t=n.substring(0,e),r=n.substring(e+1);return new wn(t,r)}}var Cn=/\\(\d+)/,Ze=/\\(\d+)/g,vn=-1,Bt=-2;var ee=class{constructor(n,e,t,r){g(this,"$location");g(this,"id");g(this,"_nameIsCapturing");g(this,"_name");g(this,"_contentNameIsCapturing");g(this,"_contentName");this.$location=n,this.id=e,this._name=t||null,this._nameIsCapturing=te.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=te.hasCaptures(this._contentName)}get debugName(){const n=this.$location?`${mt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${n}`}getName(n,e){return!this._nameIsCapturing||this._name===null||n===null||e===null?this._name:te.replaceCaptures(this._name,n,e)}getContentName(n,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:te.replaceCaptures(this._contentName,n,e)}},Bn=class extends ee{constructor(e,t,r,s,o){super(e,t,r,s);g(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,r,s){throw new Error("Not supported!")}},Rn=class extends ee{constructor(e,t,r,s,o){super(e,t,r,null);g(this,"_match");g(this,"captures");g(this,"_cachedCompiledPatterns");this._match=new J(s,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new X,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},et=class extends ee{constructor(e,t,r,s,o){super(e,t,r,s);g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new X,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ge=class extends ee{constructor(e,t,r,s,o,i,c,a,l,d){super(e,t,r,s);g(this,"_begin");g(this,"beginCaptures");g(this,"_end");g(this,"endHasBackReferences");g(this,"endCaptures");g(this,"applyEndPatternLast");g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");this._begin=new J(o,this.id),this.beginCaptures=i,this._end=new J(c||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,s)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new X;for(const r of this.patterns)e.getRule(r).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},ue=class extends ee{constructor(e,t,r,s,o,i,c,a,l){super(e,t,r,s);g(this,"_begin");g(this,"beginCaptures");g(this,"whileCaptures");g(this,"_while");g(this,"whileHasBackReferences");g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");g(this,"_cachedCompiledWhilePatterns");this._begin=new J(o,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new J(c,Bt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new X;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,r,s){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,s)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new X,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},Rt=class A{static createCaptureRule(e,t,r,s,o){return e.registerRule(i=>new Bn(t,i,r,s,o))}static getCompiledRuleId(e,t,r){return e.id||t.registerRule(s=>{if(e.id=s,e.match)return new Rn(e.$vscodeTextmateLocation,e.id,e.name,e.match,A._compileCaptures(e.captures,t,r));if(typeof e.begin>"u"){e.repository&&(r=pt({},r,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new et(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,A._compilePatterns(o,t,r))}return e.while?new ue(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,A._compileCaptures(e.beginCaptures||e.captures,t,r),e.while,A._compileCaptures(e.whileCaptures||e.captures,t,r),A._compilePatterns(e.patterns,t,r)):new Ge(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,A._compileCaptures(e.beginCaptures||e.captures,t,r),e.end,A._compileCaptures(e.endCaptures||e.captures,t,r),e.applyEndPatternLast,A._compilePatterns(e.patterns,t,r))}),e.id}static _compileCaptures(e,t,r){let s=[];if(e){let o=0;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const c=parseInt(i,10);c>o&&(o=c)}for(let i=0;i<=o;i++)s[i]=null;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const c=parseInt(i,10);let a=0;e[i].patterns&&(a=A.getCompiledRuleId(e[i],t,r)),s[c]=A.createCaptureRule(t,e[i].$vscodeTextmateLocation,e[i].name,e[i].contentName,a)}}return s}static _compilePatterns(e,t,r){let s=[];if(e)for(let o=0,i=e.length;o<i;o++){const c=e[o];let a=-1;if(c.include){const l=vt(c.include);switch(l.kind){case 0:case 1:a=A.getCompiledRuleId(r[c.include],t,r);break;case 2:let d=r[l.ruleName];d&&(a=A.getCompiledRuleId(d,t,r));break;case 3:case 4:const u=l.scopeName,f=l.kind===4?l.ruleName:null,h=t.getExternalGrammar(u,r);if(h)if(f){let p=h.repository[f];p&&(a=A.getCompiledRuleId(p,t,h.repository))}else a=A.getCompiledRuleId(h.repository.$self,t,h.repository);break}}else a=A.getCompiledRuleId(c,t,r);if(a!==-1){const l=t.getRule(a);let d=!1;if((l instanceof et||l instanceof Ge||l instanceof ue)&&l.hasMissingPatterns&&l.patterns.length===0&&(d=!0),d)continue;s.push(a)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},J=class Nt{constructor(e,t){g(this,"source");g(this,"ruleId");g(this,"hasAnchor");g(this,"hasBackReferences");g(this,"_anchorCache");if(e&&typeof e=="string"){const r=e.length;let s=0,o=[],i=!1;for(let c=0;c<r;c++)if(e.charAt(c)==="\\"&&c+1<r){const l=e.charAt(c+1);l==="z"?(o.push(e.substring(s,c)),o.push("$(?!\\n)(?<!\\n)"),s=c+2):(l==="A"||l==="G")&&(i=!0),c++}this.hasAnchor=i,s===0?this.source=e:(o.push(e.substring(s,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source=="string"?this.hasBackReferences=Cn.test(this.source):this.hasBackReferences=!1}clone(){return new Nt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=t.map(s=>e.substring(s.start,s.end));return Ze.lastIndex=0,this.source.replace(Ze,(s,o)=>yt(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],t=[],r=[],s=[],o,i,c,a;for(o=0,i=this.source.length;o<i;o++)c=this.source.charAt(o),e[o]=c,t[o]=c,r[o]=c,s[o]=c,c==="\\"&&o+1<i&&(a=this.source.charAt(o+1),a==="A"?(e[o+1]="",t[o+1]="",r[o+1]="A",s[o+1]="A"):a==="G"?(e[o+1]="",t[o+1]="G",r[o+1]="",s[o+1]="G"):(e[o+1]=a,t[o+1]=a,r[o+1]=a,s[o+1]=a),o++);return{A0_G0:e.join(""),A0_G1:t.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},X=class{constructor(){g(this,"_items");g(this,"_hasAnchors");g(this,"_cached");g(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(n){this._items.push(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}unshift(n){this._items.unshift(n),this._hasAnchors=this._hasAnchors||n.hasAnchor}length(){return this._items.length}setSource(n,e){this._items[n].source!==e&&(this._disposeCaches(),this._items[n].setSource(e))}compile(n){if(!this._cached){let e=this._items.map(t=>t.source);this._cached=new tt(n,e,this._items.map(t=>t.ruleId))}return this._cached}compileAG(n,e,t){return this._hasAnchors?e?t?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A1_G0):t?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(n,e,t)),this._anchorCache.A0_G0):this.compile(n)}_resolveAnchors(n,e,t){let r=this._items.map(s=>s.resolveAnchors(e,t));return new tt(n,r,this._items.map(s=>s.ruleId))}},tt=class{constructor(n,e,t){g(this,"scanner");this.regExps=e,this.rules=t,this.scanner=n.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const n=[];for(let e=0,t=this.rules.length;e<t;e++)n.push(" - "+this.rules[e]+": "+this.regExps[e]);return n.join(`
|
|
2
2
|
`)}findNextMatchSync(n,e,t){const r=this.scanner.findNextMatchSync(n,e,t);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ne=class{constructor(n,e){this.languageId=n,this.tokenType=e}},M,Nn=(M=class{constructor(e,t){g(this,"_defaultAttributes");g(this,"_embeddedLanguagesMatcher");g(this,"_getBasicScopeAttributes",new kt(e=>{const t=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Ne(t,r)}));this._defaultAttributes=new Ne(e,8),this._embeddedLanguagesMatcher=new An(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?M._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const t=e.match(M.STANDARD_TOKEN_TYPE_REGEXP);if(!t)return 8;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},g(M,"_NULL_SCOPE_METADATA",new Ne(0,0)),g(M,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),M),An=class{constructor(n){g(this,"values");g(this,"scopesRegExp");if(n.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(n);const e=n.map(([t,r])=>yt(t));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(n){if(!this.scopesRegExp)return;const e=n.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},nt=class{constructor(n,e){this.stack=n,this.stoppedEarly=e}};function At(n,e,t,r,s,o,i,c){const a=e.content.length;let l=!1,d=-1;if(i){const h=Tn(n,e,t,r,s,o);s=h.stack,r=h.linePos,t=h.isFirstLine,d=h.anchorPosition}const u=Date.now();for(;!l;){if(c!==0&&Date.now()-u>c)return new nt(s,!0);f()}return new nt(s,!1);function f(){const h=In(n,e,t,r,s,d);if(!h){o.produce(s,a),l=!0;return}const p=h.captureIndices,k=h.matchedRuleId,y=p&&p.length>0?p[0].end>r:!1;if(k===vn){const _=s.getRule(n);o.produce(s,p[0].start),s=s.withContentNameScopesList(s.nameScopesList),K(n,e,t,s,o,_.endCaptures,p),o.produce(s,p[0].end);const m=s;if(s=s.parent,d=m.getAnchorPos(),!y&&m.getEnterPos()===r){s=m,o.produce(s,a),l=!0;return}}else{const _=n.getRule(k);o.produce(s,p[0].start);const m=s,b=_.getName(e.content,p),w=s.contentNameScopesList.pushAttributed(b,n);if(s=s.push(k,r,d,p[0].end===a,null,w,w),_ instanceof Ge){const S=_;K(n,e,t,s,o,S.beginCaptures,p),o.produce(s,p[0].end),d=p[0].end;const C=S.getContentName(e.content,p),I=w.pushAttributed(C,n);if(s=s.withContentNameScopesList(I),S.endHasBackReferences&&(s=s.withEndRule(S.getEndWithResolvedBackReferences(e.content,p))),!y&&m.hasSameRuleAs(s)){s=s.pop(),o.produce(s,a),l=!0;return}}else if(_ instanceof ue){const S=_;K(n,e,t,s,o,S.beginCaptures,p),o.produce(s,p[0].end),d=p[0].end;const C=S.getContentName(e.content,p),I=w.pushAttributed(C,n);if(s=s.withContentNameScopesList(I),S.whileHasBackReferences&&(s=s.withEndRule(S.getWhileWithResolvedBackReferences(e.content,p))),!y&&m.hasSameRuleAs(s)){s=s.pop(),o.produce(s,a),l=!0;return}}else if(K(n,e,t,s,o,_.captures,p),o.produce(s,p[0].end),s=s.pop(),!y){s=s.safePop(),o.produce(s,a),l=!0;return}}p[0].end>r&&(r=p[0].end,t=!1)}}function Tn(n,e,t,r,s,o){let i=s.beginRuleCapturedEOL?0:-1;const c=[];for(let a=s;a;a=a.pop()){const l=a.getRule(n);l instanceof ue&&c.push({rule:l,stack:a})}for(let a=c.pop();a;a=c.pop()){const{ruleScanner:l,findOptions:d}=Pn(a.rule,n,a.stack.endRule,t,r===i),u=l.findNextMatchSync(e,r,d);if(u){if(u.ruleId!==Bt){s=a.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(o.produce(a.stack,u.captureIndices[0].start),K(n,e,t,a.stack,o,a.rule.whileCaptures,u.captureIndices),o.produce(a.stack,u.captureIndices[0].end),i=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,t=!1))}else{s=a.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:i,isFirstLine:t}}function In(n,e,t,r,s,o){const i=xn(n,e,t,r,s,o),c=n.getInjections();if(c.length===0)return i;const a=En(c,n,e,t,r,s,o);if(!a)return i;if(!i)return a;const l=i.captureIndices[0].start,d=a.captureIndices[0].start;return d<l||a.priorityMatch&&d===l?a:i}function xn(n,e,t,r,s,o){const i=s.getRule(n),{ruleScanner:c,findOptions:a}=Tt(i,n,s.endRule,t,r===o),l=c.findNextMatchSync(e,r,a);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function En(n,e,t,r,s,o,i){let c=Number.MAX_VALUE,a=null,l,d=0;const u=o.contentNameScopesList.getScopeNames();for(let f=0,h=n.length;f<h;f++){const p=n[f];if(!p.matcher(u))continue;const k=e.getRule(p.ruleId),{ruleScanner:y,findOptions:_}=Tt(k,e,null,r,s===i),m=y.findNextMatchSync(t,s,_);if(!m)continue;const b=m.captureIndices[0].start;if(!(b>=c)&&(c=b,a=m.captureIndices,l=m.ruleId,d=p.priority,c===s))break}return a?{priorityMatch:d===-1,captureIndices:a,matchedRuleId:l}:null}function Tt(n,e,t,r,s){return{ruleScanner:n.compileAG(e,t,r,s),findOptions:0}}function Pn(n,e,t,r,s){return{ruleScanner:n.compileWhileAG(e,t,r,s),findOptions:0}}function K(n,e,t,r,s,o,i){if(o.length===0)return;const c=e.content,a=Math.min(o.length,i.length),l=[],d=i[0].end;for(let u=0;u<a;u++){const f=o[u];if(f===null)continue;const h=i[u];if(h.length===0)continue;if(h.start>d)break;for(;l.length>0&&l[l.length-1].endPos<=h.start;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?s.produceFromScopes(l[l.length-1].scopes,h.start):s.produce(r,h.start),f.retokenizeCapturedWithRuleId){const k=f.getName(c,i),y=r.contentNameScopesList.pushAttributed(k,n),_=f.getContentName(c,i),m=y.pushAttributed(_,n),b=r.push(f.retokenizeCapturedWithRuleId,h.start,-1,!1,null,y,m),w=n.createOnigString(c.substring(0,h.end));At(n,w,t&&h.start===0,h.start,b,s,!1,0),Ct(w);continue}const p=f.getName(c,i);if(p!==null){const y=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(p,n);l.push(new Ln(y,h.end))}}for(;l.length>0;)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Ln=class{constructor(n,e){g(this,"scopes");g(this,"endPos");this.scopes=n,this.endPos=e}};function Gn(n,e,t,r,s,o,i,c){return new Mn(n,e,t,r,s,o,i,c)}function rt(n,e,t,r,s){const o=ce(e,de),i=Rt.getCompiledRuleId(t,r,s.repository);for(const c of o)n.push({debugSelector:e,matcher:c.matcher,ruleId:i,grammar:s,priority:c.priority})}function de(n,e){if(e.length<n.length)return!1;let t=0;return n.every(r=>{for(let s=t;s<e.length;s++)if(On(e[s],r))return t=s+1,!0;return!1})}function On(n,e){if(!n)return!1;if(n===e)return!0;const t=e.length;return n.length>t&&n.substr(0,t)===e&&n[t]==="."}var Mn=class{constructor(n,e,t,r,s,o,i,c){g(this,"_rootId");g(this,"_lastRuleId");g(this,"_ruleId2desc");g(this,"_includedGrammars");g(this,"_grammarRepository");g(this,"_grammar");g(this,"_injections");g(this,"_basicScopeAttributesProvider");g(this,"_tokenTypeMatchers");if(this._rootScopeName=n,this.balancedBracketSelectors=o,this._onigLib=c,this._basicScopeAttributesProvider=new Nn(t,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=st(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const a of Object.keys(s)){const l=ce(a,de);for(const d of l)this._tokenTypeMatchers.push({matcher:d.matcher,type:s[a]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const n of this._ruleId2desc)n&&n.dispose()}createOnigScanner(n){return this._onigLib.createOnigScanner(n)}createOnigString(n){return this._onigLib.createOnigString(n)}getMetadataForScope(n){return this._basicScopeAttributesProvider.getBasicScopeAttributes(n)}_collectInjections(){const n={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},e=[],t=this._rootScopeName,r=n.lookup(t);if(r){const s=r.injections;if(s)for(let i in s)rt(e,i,s[i],this,r);const o=this._grammarRepository.injections(t);o&&o.forEach(i=>{const c=this.getExternalGrammar(i);if(c){const a=c.injectionSelector;a&&rt(e,a,c,this,c)}})}return e.sort((s,o)=>s.priority-o.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(n){const e=++this._lastRuleId,t=n(e);return this._ruleId2desc[e]=t,t}getRule(n){return this._ruleId2desc[n]}getExternalGrammar(n,e){if(this._includedGrammars[n])return this._includedGrammars[n];if(this._grammarRepository){const t=this._grammarRepository.lookup(n);if(t)return this._includedGrammars[n]=st(t,e&&e.$base),this._includedGrammars[n]}}tokenizeLine(n,e,t=0){const r=this._tokenize(n,e,!1,t);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(n,e,t=0){const r=this._tokenize(n,e,!0,t);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(n,e,t,r){this._rootId===-1&&(this._rootId=Rt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!e||e===Oe.NULL){s=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),d=this.themeProvider.getDefaults(),u=q.set(0,l.languageId,l.tokenType,null,d.fontStyle,d.foregroundId,d.backgroundId),f=this.getRule(this._rootId).getName(null,null);let h;f?h=Y.createRootAndLookUpScopeName(f,u,this):h=Y.createRoot("unknown",u),e=new Oe(null,this._rootId,-1,-1,!1,null,h,h)}else s=!1,e.reset();n=n+`
|
|
3
3
|
`;const o=this.createOnigString(n),i=o.content.length,c=new $n(t,n,this._tokenTypeMatchers,this.balancedBracketSelectors),a=At(this,o,s,0,e,c,!0,r);return Ct(o),{lineLength:i,lineTokens:c,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function st(n,e){return n=tn(n),n.repository=n.repository||{},n.repository.$self={$vscodeTextmateLocation:n.$vscodeTextmateLocation,patterns:n.patterns,name:n.scopeName},n.repository.$base=e||n.repository.$self,n}var Y=class L{constructor(e,t,r){this.parent=e,this.scopePath=t,this.tokenAttributes=r}static fromExtension(e,t){let r=e,s=(e==null?void 0:e.scopePath)??null;for(const o of t)s=Re.push(s,o.scopeNames),r=new L(r,s,o.encodedTokenAttributes);return r}static createRoot(e,t){return new L(null,new Re(null,e),t)}static createRootAndLookUpScopeName(e,t,r){const s=r.getMetadataForScope(e),o=new Re(null,e),i=r.themeProvider.themeMatch(o),c=L.mergeAttributes(t,s,i);return new L(null,o,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return L.equals(this,e)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,r){let s=-1,o=0,i=0;return r!==null&&(s=r.fontStyle,o=r.foregroundId,i=r.backgroundId),q.set(e,t.languageId,t.tokenType,null,s,o,i)}pushAttributed(e,t){if(e===null)return this;if(e.indexOf(" ")===-1)return L._pushAttributed(this,e,t);const r=e.split(/ /g);let s=this;for(const o of r)s=L._pushAttributed(s,o,t);return s}static _pushAttributed(e,t,r){const s=r.getMetadataForScope(t),o=e.scopePath.push(t),i=r.themeProvider.themeMatch(o),c=L.mergeAttributes(e.tokenAttributes,s,i);return new L(e,o,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var s;const t=[];let r=this;for(;r&&r!==e;)t.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((s=r.parent)==null?void 0:s.scopePath)??null)}),r=r.parent;return r===e?t.reverse():void 0}},P,Oe=(P=class{constructor(e,t,r,s,o,i,c,a){g(this,"_stackElementBrand");g(this,"_enterPos");g(this,"_anchorPos");g(this,"depth");this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=o,this.endRule=i,this.nameScopesList=c,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}equals(e){return e===null?!1:P._equals(this,e)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Y.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){P._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,t,r,s,o,i,c){return new P(this,e,t,r,s,o,i,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){var r,s;return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(s=this.contentNameScopesList)==null?void 0:s.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new P(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){var e,t,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((t=this.nameScopesList)==null?void 0:t.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,t){const r=Y.fromExtension((e==null?void 0:e.nameScopesList)??null,t.nameScopesList);return new P(e,t.ruleId,t.enterPos??-1,t.anchorPos??-1,t.beginRuleCapturedEOL,t.endRule,r,Y.fromExtension(r,t.contentNameScopesList))}},g(P,"NULL",new P(null,0,0,0,!1,null,null,null)),P),Fn=class{constructor(n,e){g(this,"balancedBracketScopes");g(this,"unbalancedBracketScopes");g(this,"allowAny",!1);this.balancedBracketScopes=n.flatMap(t=>t==="*"?(this.allowAny=!0,[]):ce(t,de).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(t=>ce(t,de).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(n){for(const e of this.unbalancedBracketScopes)if(e(n))return!1;for(const e of this.balancedBracketScopes)if(e(n))return!0;return this.allowAny}},$n=class{constructor(n,e,t,r){g(this,"_emitBinaryTokens");g(this,"_lineText");g(this,"_tokens");g(this,"_binaryTokens");g(this,"_lastTokenEndIndex");g(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=n,this._tokenTypeOverrides=t,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(n,e){this.produceFromScopes(n.contentNameScopesList,e)}produceFromScopes(n,e){var r;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let s=(n==null?void 0:n.tokenAttributes)??0,o=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=(n==null?void 0:n.getScopeNames())??[];for(const c of this._tokenTypeOverrides)c.matcher(i)&&(s=q.set(s,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(i))}if(o&&(s=q.set(s,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=e;return}const t=(n==null?void 0:n.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:t}),this._lastTokenEndIndex=e}getResult(n,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(n,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(n,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(n,e),this._binaryTokens[this._binaryTokens.length-2]=0);const t=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)t[r]=this._binaryTokens[r];return t}},jn=class{constructor(n,e){g(this,"_grammars",new Map);g(this,"_rawGrammars",new Map);g(this,"_injectionGrammars",new Map);g(this,"_theme");this._onigLib=e,this._theme=n}dispose(){for(const n of this._grammars.values())n.dispose()}setTheme(n){this._theme=n}getColorMap(){return this._theme.getColorMap()}addGrammar(n,e){this._rawGrammars.set(n.scopeName,n),e&&this._injectionGrammars.set(n.scopeName,e)}lookup(n){return this._rawGrammars.get(n)}injections(n){return this._injectionGrammars.get(n)}getDefaults(){return this._theme.getDefaults()}themeMatch(n){return this._theme.match(n)}grammarForScopeName(n,e,t,r,s){if(!this._grammars.has(n)){let o=this._rawGrammars.get(n);if(!o)return null;this._grammars.set(n,Gn(n,o,e,t,r,s,this,this._onigLib))}return this._grammars.get(n)}},Hn=class{constructor(e){g(this,"_options");g(this,"_syncRegistry");g(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new jn(ae.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(ae.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,r){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,t,r){return this._loadGrammar(e,t,r.embeddedLanguages,r.tokenTypes,new Fn(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,r,s,o){const i=new mn(this._syncRegistry,e);for(;i.Q.length>0;)i.Q.map(c=>this._loadSingleGrammar(c.scopeName)),i.processQueue();return this._grammarForScopeName(e,t,r,s,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,r)}}addGrammar(e,t=[],r=0,s=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,r,s)}_grammarForScopeName(e,t=0,r=null,s=null,o=null){return this._syncRegistry.grammarForScopeName(e,t,r,s,o)}},Me=Oe.NULL;function fe(n,e){const t=typeof n=="string"?{}:{...n.colorReplacements},r=typeof n=="string"?n:n.name;for(const[s,o]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof o=="string"?t[s]=o:s===r&&Object.assign(t,o);return t}function $(n,e){return n&&((e==null?void 0:e[n==null?void 0:n.toLowerCase()])||n)}function Dn(n){return Array.isArray(n)?n:[n]}async function It(n){return Promise.resolve(typeof n=="function"?n():n).then(e=>e.default||e)}function be(n){return!n||["plaintext","txt","text","plain"].includes(n)}function Wn(n){return n==="ansi"||be(n)}function _e(n){return n==="none"}function Un(n){return _e(n)}function ye(n,e=!1){var o;if(n.length===0)return[["",0]];const t=n.split(/(\r?\n)/g);let r=0;const s=[];for(let i=0;i<t.length;i+=2){const c=e?t[i]+(t[i+1]||""):t[i];s.push([c,r]),r+=t[i].length,r+=((o=t[i+1])==null?void 0:o.length)||0}return s}const ot={light:"#333333",dark:"#bbbbbb"},it={light:"#fffffe",dark:"#1e1e1e"},at="__shiki_resolved";function We(n){var c,a,l,d,u;if(n!=null&&n[at])return n;const e={...n};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:t,fg:r}=e;if(!t||!r){const f=e.settings?e.settings.find(h=>!h.name&&!h.scope):void 0;(c=f==null?void 0:f.settings)!=null&&c.foreground&&(r=f.settings.foreground),(a=f==null?void 0:f.settings)!=null&&a.background&&(t=f.settings.background),!r&&((l=e==null?void 0:e.colors)!=null&&l["editor.foreground"])&&(r=e.colors["editor.foreground"]),!t&&((d=e==null?void 0:e.colors)!=null&&d["editor.background"])&&(t=e.colors["editor.background"]),r||(r=e.type==="light"?ot.light:ot.dark),t||(t=e.type==="light"?it.light:it.dark),e.fg=r,e.bg=t}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let s=0;const o=new Map;function i(f){var p;if(o.has(f))return o.get(f);s+=1;const h=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return(p=e.colorReplacements)!=null&&p[`#${h}`]?i(f):(o.set(f,h),h)}e.settings=e.settings.map(f=>{var y,_;const h=((y=f.settings)==null?void 0:y.foreground)&&!f.settings.foreground.startsWith("#"),p=((_=f.settings)==null?void 0:_.background)&&!f.settings.background.startsWith("#");if(!h&&!p)return f;const k={...f,settings:{...f.settings}};if(h){const m=i(f.settings.foreground);e.colorReplacements[m]=f.settings.foreground,k.settings.foreground=m}if(p){const m=i(f.settings.background);e.colorReplacements[m]=f.settings.background,k.settings.background=m}return k});for(const f of Object.keys(e.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!((u=e.colors[f])!=null&&u.startsWith("#"))){const h=i(e.colors[f]);e.colorReplacements[h]=e.colors[f],e.colors[f]=h}return Object.defineProperty(e,at,{enumerable:!1,writable:!1,value:!0}),e}async function xt(n){return Array.from(new Set((await Promise.all(n.filter(e=>!Wn(e)).map(async e=>await It(e).then(t=>Array.isArray(t)?t:[t])))).flat()))}async function Et(n){return(await Promise.all(n.map(async e=>Un(e)?null:We(await It(e))))).filter(e=>!!e)}function Pt(n,e){if(!e)return n;if(e[n]){const t=new Set([n]);for(;e[n];){if(n=e[n],t.has(n))throw new v(`Circular alias \`${Array.from(t).join(" -> ")} -> ${n}\``);t.add(n)}}return n}var qn=class extends Hn{constructor(e,t,r,s={}){super(e);g(this,"_resolvedThemes",new Map);g(this,"_resolvedGrammars",new Map);g(this,"_langMap",new Map);g(this,"_langGraph",new Map);g(this,"_textmateThemeCache",new WeakMap);g(this,"_loadedThemesCache",null);g(this,"_loadedLanguagesCache",null);this._resolver=e,this._themes=t,this._langs=r,this._alias=s,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=We(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=ae.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Pt(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){var o,i,c,a;if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(l=>{var d;return(d=l.embeddedLangsLazy)==null?void 0:d.includes(e.name)}));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const s=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(s.name=e.name,this._resolvedGrammars.set(e.name,s),e.aliases&&e.aliases.forEach(l=>{this._alias[l]=e.name}),this._loadedLanguagesCache=null,t.size)for(const l of t)this._resolvedGrammars.delete(l.name),this._loadedLanguagesCache=null,(i=(o=this._syncRegistry)==null?void 0:o._injectionGrammars)==null||i.delete(l.scopeName),(a=(c=this._syncRegistry)==null?void 0:c._grammars)==null||a.delete(l.scopeName),this.loadLanguage(this._langMap.get(l.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const s of e)this.resolveEmbeddedLanguages(s);const t=Array.from(this._langGraph.entries()),r=t.filter(([s,o])=>!o);if(r.length){const s=t.filter(([o,i])=>{var c;return i?(c=i.embeddedLanguages||i.embeddedLangs)==null?void 0:c.some(a=>r.map(([l])=>l).includes(a)):!1}).filter(o=>!r.includes(o));throw new v(`Missing languages ${r.map(([o])=>`\`${o}\``).join(", ")}, required by ${s.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[s,o]of t)this._resolver.addLanguage(o);for(const[s,o]of t)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const r of t)this._langGraph.set(r,this._langMap.get(r))}},zn=class{constructor(n,e){g(this,"_langs",new Map);g(this,"_scopeToLang",new Map);g(this,"_injections",new Map);g(this,"_onigLib");this._onigLib={createOnigScanner:t=>n.createScanner(t),createOnigString:t=>n.createString(t)},e.forEach(t=>this.addLanguage(t))}get onigLib(){return this._onigLib}getLangRegistration(n){return this._langs.get(n)}loadGrammar(n){return this._scopeToLang.get(n)}addLanguage(n){this._langs.set(n.name,n),n.aliases&&n.aliases.forEach(e=>{this._langs.set(e,n)}),this._scopeToLang.set(n.scopeName,n),n.injectTo&&n.injectTo.forEach(e=>{this._injections.get(e)||this._injections.set(e,[]),this._injections.get(e).push(n.scopeName)})}getInjections(n){const e=n.split(".");let t=[];for(let r=1;r<=e.length;r++){const s=e.slice(0,r).join(".");t=[...t,...this._injections.get(s)||[]]}return t}};let V=0;function Vn(n){V+=1,n.warnings!==!1&&V>=10&&V%10===0&&console.warn(`[Shiki] ${V} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!n.engine)throw new v("`engine` option is required for synchronous mode");const t=(n.langs||[]).flat(1),r=(n.themes||[]).flat(1).map(We),s=new qn(new zn(n.engine,t),r,t,n.langAlias);let o;function i(m){return Pt(m,n.langAlias)}function c(m){y();const b=s.getGrammar(typeof m=="string"?m:m.name);if(!b)throw new v(`Language \`${m}\` not found, you may need to load it first`);return b}function a(m){if(m==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const b=s.getTheme(m);if(!b)throw new v(`Theme \`${m}\` not found, you may need to load it first`);return b}function l(m){y();const b=a(m);return o!==m&&(s.setTheme(b),o=m),{theme:b,colorMap:s.getColorMap()}}function d(){return y(),s.getLoadedThemes()}function u(){return y(),s.getLoadedLanguages()}function f(...m){y(),s.loadLanguages(m.flat(1))}async function h(...m){return f(await xt(m))}function p(...m){y();for(const b of m.flat(1))s.loadTheme(b)}async function k(...m){return y(),p(await Et(m))}function y(){if(e)throw new v("Shiki instance has been disposed")}function _(){e||(e=!0,s.dispose(),V-=1)}return{setTheme:l,getTheme:a,getLanguage:c,getLoadedThemes:d,getLoadedLanguages:u,resolveLangAlias:i,loadLanguage:h,loadLanguageSync:f,loadTheme:k,loadThemeSync:p,dispose:_,[Symbol.dispose]:_}}async function Kn(n){n.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,t,r]=await Promise.all([Et(n.themes||[]),xt(n.langs||[]),n.engine]);return Vn({...n,themes:e,langs:t,engine:r})}const Lt=new WeakMap;function ke(n,e){Lt.set(n,e)}function Z(n){return Lt.get(n)}var Se=class Gt{constructor(...e){g(this,"_stacks",{});g(this,"lang");if(e.length===2){const[t,r]=e;this.lang=r,this._stacks=t}else{const[t,r,s]=e;this.lang=r,this._stacks={[s]:t}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new Gt(Object.fromEntries(Dn(t).map(r=>[r,Me])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Yn(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Yn(n){const e=[],t=new Set;function r(s){var i;if(t.has(s))return;t.add(s);const o=(i=s==null?void 0:s.nameScopesList)==null?void 0:i.scopeName;o&&e.push(o),s.parent&&r(s.parent)}return r(n),e}function Qn(n,e){if(!(n instanceof Se))throw new v("Invalid grammar state");return n.getInternalStack(e)}function Ot(n,e,t={}){const{theme:r=n.getLoadedThemes()[0]}=t;if(be(n.resolveLangAlias(t.lang||"text"))||_e(r))return ye(e).map(c=>[{content:c[0],offset:c[1]}]);const{theme:s,colorMap:o}=n.setTheme(r),i=n.getLanguage(t.lang||"text");if(t.grammarState){if(t.grammarState.lang!==i.name)throw new v(`Grammar state language "${t.grammarState.lang}" does not match highlight language "${i.name}"`);if(!t.grammarState.themes.includes(s.name))throw new v(`Grammar state themes "${t.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return Xn(e,i,s,o,t)}function Jn(...n){if(n.length===2)return Z(n[1]);const[e,t,r={}]=n,{lang:s="text",theme:o=e.getLoadedThemes()[0]}=r;if(be(s)||_e(o))throw new v("Plain language does not have grammar state");if(s==="ansi")throw new v("ANSI language does not have grammar state");const{theme:i,colorMap:c}=e.setTheme(o),a=e.getLanguage(s);return new Se(Ue(t,a,i,c,r).stateStack,a.name,i.name)}function Xn(n,e,t,r,s){const o=Ue(n,e,t,r,s),i=new Se(o.stateStack,e.name,t.name);return ke(o.tokens,i),o.tokens}function Ue(n,e,t,r,s){const o=fe(t,s),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:c=500}=s,a=ye(n);let l=s.grammarState?Qn(s.grammarState,t.name)??Me:s.grammarContextCode!=null?Ue(s.grammarContextCode,e,t,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:Me,d=[];const u=[];for(let f=0,h=a.length;f<h;f++){const[p,k]=a[f];if(p===""){d=[],u.push([]);continue}if(i>0&&p.length>=i){d=[],u.push([{content:p,offset:k,color:"",fontStyle:0}]);continue}let y,_,m;s.includeExplanation&&(y=e.tokenizeLine(p,l,c),_=y.tokens,m=0);const b=e.tokenizeLine2(p,l,c),w=b.tokens.length/2;for(let S=0;S<w;S++){const C=b.tokens[2*S],I=S+1<w?b.tokens[2*S+2]:p.length;if(C===I)continue;const z=b.tokens[2*S+1],x=$(r[q.getForeground(z)],o),F=q.getFontStyle(z),H={content:p.substring(C,I),offset:k+C,color:x,fontStyle:F};if(s.includeExplanation){const D=[];if(s.includeExplanation!=="scopeName")for(const O of t.settings){let W;switch(typeof O.scope){case"string":W=O.scope.split(/,/).map(ve=>ve.trim());break;case"object":W=O.scope;break;default:continue}D.push({settings:O,selectors:W.map(ve=>ve.split(/ /))})}H.explanation=[];let Ke=0;for(;C+Ke<I;){const O=_[m],W=p.substring(O.startIndex,O.endIndex);Ke+=W.length,H.explanation.push({content:W,scopes:s.includeExplanation==="scopeName"?Zn(O.scopes):er(D,O.scopes)}),m+=1}}d.push(H)}u.push(d),d=[],l=b.ruleStack}return{tokens:u,stateStack:l}}function Zn(n){return n.map(e=>({scopeName:e}))}function er(n,e){const t=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];t[r]={scopeName:o,themeMatches:nr(n,o,e.slice(0,r))}}return t}function ct(n,e){return n===e||e.substring(0,n.length)===n&&e[n.length]==="."}function tr(n,e,t){if(!ct(n[n.length-1],e))return!1;let r=n.length-2,s=t.length-1;for(;r>=0&&s>=0;)ct(n[r],t[s])&&(r-=1),s-=1;return r===-1}function nr(n,e,t){const r=[];for(const{selectors:s,settings:o}of n)for(const i of s)if(tr(i,e,t)){r.push(o);break}return r}function Mt(n,e,t,r=Ot){const s=Object.entries(t.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),o=s.map(l=>{const d=r(n,e,{...t,theme:l.theme});return{tokens:d,state:Z(d),theme:typeof l.theme=="string"?l.theme:l.theme.name}}),i=rr(...o.map(l=>l.tokens)),c=i[0].map((l,d)=>l.map((u,f)=>{const h={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in t&&t.includeExplanation&&(h.explanation=u.explanation),i.forEach((p,k)=>{const{content:y,explanation:_,offset:m,...b}=p[d][f];h.variants[s[k].color]=b}),h})),a=o[0].state?new Se(Object.fromEntries(o.map(l=>{var d;return[l.theme,(d=l.state)==null?void 0:d.getInternalStack(l.theme)]})),o[0].state.lang):void 0;return a&&ke(c,a),c}function rr(...n){const e=n.map(()=>[]),t=n.length;for(let r=0;r<n[0].length;r++){const s=n.map(a=>a[r]),o=e.map(()=>[]);e.forEach((a,l)=>a.push(o[l]));const i=s.map(()=>0),c=s.map(a=>a[0]);for(;c.every(a=>a);){const a=Math.min(...c.map(l=>l.content.length));for(let l=0;l<t;l++){const d=c[l];d.content.length===a?(o[l].push(d),i[l]+=1,c[l]=s[l][i[l]]):(o[l].push({...d,content:d.content.slice(0,a)}),c[l]={...d,content:d.content.slice(a),offset:d.offset+a})}}}return e}const sr=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],or=/["&'<>`]/g,ir=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ar=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,cr=/[|\\{}()[\]^$+*?.]/g,lt=new WeakMap;function lr(n,e){if(n=n.replace(e.subset?ur(e.subset):or,r),e.subset||e.escapeOnly)return n;return n.replace(ir,t).replace(ar,r);function t(s,o,i){return e.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,i.charCodeAt(o+2),e)}function r(s,o,i){return e.format(s.charCodeAt(0),i.charCodeAt(o+1),e)}}function ur(n){let e=lt.get(n);return e||(e=dr(n),lt.set(n,e)),e}function dr(n){const e=[];let t=-1;for(;++t<n.length;)e.push(n[t].replace(cr,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const fr=/[\dA-Fa-f]/;function hr(n,e,t){const r="&#x"+n.toString(16).toUpperCase();return t&&e&&!fr.test(String.fromCharCode(e))?r:r+";"}const gr=/\d/;function pr(n,e,t){const r="&#"+String(n);return t&&e&&!gr.test(String.fromCharCode(e))?r:r+";"}const mr=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Ae={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},br=["cent","copy","divide","gt","lt","not","para","times"],Ft={}.hasOwnProperty,Fe={};let ne;for(ne in Ae)Ft.call(Ae,ne)&&(Fe[Ae[ne]]=ne);const _r=/[^\dA-Za-z]/;function yr(n,e,t,r){const s=String.fromCharCode(n);if(Ft.call(Fe,s)){const o=Fe[s],i="&"+o;return t&&mr.includes(o)&&!br.includes(o)&&(!r||e&&e!==61&&_r.test(String.fromCharCode(e)))?i:i+";"}return""}function kr(n,e,t){let r=hr(n,e,t.omitOptionalSemicolons),s;if((t.useNamedReferences||t.useShortestReferences)&&(s=yr(n,e,t.omitOptionalSemicolons,t.attribute)),(t.useShortestReferences||!s)&&t.useShortestReferences){const o=pr(n,e,t.omitOptionalSemicolons);o.length<r.length&&(r=o)}return s&&(!t.useShortestReferences||s.length<r.length)?s:r}function U(n,e){return lr(n,Object.assign({format:kr},e))}const Sr=/^>|^->|<!--|-->|--!>|<!-$/g,wr=[">"],Cr=["<",">"];function vr(n,e,t,r){return r.settings.bogusComments?"<?"+U(n.value,Object.assign({},r.settings.characterReferences,{subset:wr}))+">":"<!--"+n.value.replace(Sr,s)+"-->";function s(o){return U(o,Object.assign({},r.settings.characterReferences,{subset:Cr}))}}function Br(n,e,t,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}const R=jt(1),$t=jt(-1),Rr=[];function jt(n){return e;function e(t,r,s){const o=t?t.children:Rr;let i=(r||0)+n,c=o[i];if(!s)for(;c&&He(c);)i+=n,c=o[i];return c}}const Nr={}.hasOwnProperty;function Ht(n){return e;function e(t,r,s){return Nr.call(n,t.tagName)&&n[t.tagName](t,r,s)}}const qe=Ht({body:Tr,caption:Te,colgroup:Te,dd:Pr,dt:Er,head:Te,html:Ar,li:xr,optgroup:Lr,option:Gr,p:Ir,rp:ut,rt:ut,tbody:Mr,td:dt,tfoot:Fr,th:dt,thead:Or,tr:$r});function Te(n,e,t){const r=R(t,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&He(r.value.charAt(0)))}function Ar(n,e,t){const r=R(t,e);return!r||r.type!=="comment"}function Tr(n,e,t){const r=R(t,e);return!r||r.type!=="comment"}function Ir(n,e,t){const r=R(t,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!t||!(t.type==="element"&&(t.tagName==="a"||t.tagName==="audio"||t.tagName==="del"||t.tagName==="ins"||t.tagName==="map"||t.tagName==="noscript"||t.tagName==="video"))}function xr(n,e,t){const r=R(t,e);return!r||r.type==="element"&&r.tagName==="li"}function Er(n,e,t){const r=R(t,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Pr(n,e,t){const r=R(t,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function ut(n,e,t){const r=R(t,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Lr(n,e,t){const r=R(t,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Gr(n,e,t){const r=R(t,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Or(n,e,t){const r=R(t,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Mr(n,e,t){const r=R(t,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Fr(n,e,t){return!R(t,e)}function $r(n,e,t){const r=R(t,e);return!r||r.type==="element"&&r.tagName==="tr"}function dt(n,e,t){const r=R(t,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const jr=Ht({body:Wr,colgroup:Ur,head:Dr,html:Hr,tbody:qr});function Hr(n){const e=R(n,-1);return!e||e.type!=="comment"}function Dr(n){const e=new Set;for(const r of n.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const t=n.children[0];return!t||t.type==="element"}function Wr(n){const e=R(n,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&He(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Ur(n,e,t){const r=$t(t,e),s=R(n,-1,!0);return t&&r&&r.type==="element"&&r.tagName==="colgroup"&&qe(r,t.children.indexOf(r),t)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function qr(n,e,t){const r=$t(t,e),s=R(n,-1);return t&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&qe(r,t.children.indexOf(r),t)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const re={name:[[`
|
|
4
4
|
\f\r &/=>`.split(""),`
|
package/dist-ui/index.html
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>DKG Node</title>
|
|
7
|
-
<link rel="icon" type="image/png" sizes="120x120" href="/ui/favicon.png" />
|
|
8
|
-
<script type="module" crossorigin src="/ui/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/ui/assets/index-
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="root"></div>
|
|
13
|
-
</body>
|
|
14
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>DKG Node</title>
|
|
7
|
+
<link rel="icon" type="image/png" sizes="120x120" href="/ui/favicon.png" />
|
|
8
|
+
<script type="module" crossorigin src="/ui/assets/index-KoAnx9JE.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/ui/assets/index-DOjsv0r7.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="root"></div>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@origintrail-official/dkg-node-ui",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,11 +22,12 @@
|
|
|
22
22
|
"remark-breaks": "^4.0.0",
|
|
23
23
|
"remark-gfm": "^4.0.1",
|
|
24
24
|
"shiki": "^4.0.2",
|
|
25
|
+
"thinking-orbs": "^0.2.0",
|
|
25
26
|
"viem": "^2.53.1",
|
|
26
27
|
"zod": "^3.25.76",
|
|
27
28
|
"zustand": "^5.0.12",
|
|
28
|
-
"@origintrail-official/dkg-core": "10.0.
|
|
29
|
-
"@origintrail-official/dkg-graph-viz": "10.0.
|
|
29
|
+
"@origintrail-official/dkg-core": "10.0.13",
|
|
30
|
+
"@origintrail-official/dkg-graph-viz": "10.0.13"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@playwright/test": "^1.59.1",
|