uEdition-Editor 2.0.0b6__py3-none-any.whl → 2.0.0b8__py3-none-any.whl

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.

Potentially problematic release.


This version of uEdition-Editor might be problematic. Click here for more details.

@@ -3,4 +3,4 @@
3
3
  # SPDX-License-Identifier: MIT
4
4
  """About this package."""
5
5
 
6
- __version__ = "2.0.0b6"
6
+ __version__ = "2.0.0b8"
@@ -97,6 +97,7 @@ async def create_branch(
97
97
  repo.branches.local.create(branch_id, commit)
98
98
  repo.checkout(repo.branches[branch_id])
99
99
  repo.branches[branch_id].upstream = repo.branches[f"{init_settings.git.remote_name}/{branch_id}"]
100
+ await cron.insecure_track_branches()
100
101
  return {"id": branch_id, "title": de_slugify(data.title)}
101
102
  else:
102
103
  for remote_branch_id in repo.branches.remote:
@@ -115,6 +116,7 @@ async def create_branch(
115
116
  )
116
117
  fetch_repo(repo, init_settings.git.remote_name)
117
118
  repo.branches[branch_id].upstream = repo.branches[f"{init_settings.git.remote_name}/{branch_id}"]
119
+ await cron.insecure_track_branches()
118
120
  return {"id": branch_id, "title": data.title}
119
121
  except GitError as ge:
120
122
  logger.error(ge)
@@ -145,12 +147,14 @@ async def merge_from_default(
145
147
  Signature(current_user["name"], current_user["sub"]),
146
148
  extra_parents=[default_branch_head.id],
147
149
  )
150
+ await cron.insecure_track_branches()
148
151
 
149
152
 
150
153
  @router.delete("/{branch_id}", status_code=204)
151
154
  async def delete_branch(
152
155
  branch_id: str,
153
156
  current_user: Annotated[dict, Depends(get_current_user)], # noqa:ARG001
157
+ local_delete: Annotated[bool, Header(alias="x-ueditor-delete-local-only")] = False, # noqa:FBT002
154
158
  ) -> None:
155
159
  """Delete the given branch locally and remotely."""
156
160
  async with BranchContextManager(branch_id) as repo:
@@ -158,10 +162,11 @@ async def delete_branch(
158
162
  if init_settings.git.default_branch == branch_id:
159
163
  raise HTTPException(422, detail=[{"msg": "you cannot delete the default branch"}])
160
164
  repo.checkout(repo.branches[init_settings.git.default_branch])
161
- if init_settings.git.remote_name in list(repo.remotes.names()):
165
+ if init_settings.git.remote_name in list(repo.remotes.names()) and not local_delete:
162
166
  if repo.branches[branch_id].upstream is not None:
163
167
  repo.remotes[init_settings.git.remote_name].push(
164
168
  [f":refs/heads/{branch_id}"], callbacks=RemoteRepositoryCallbacks()
165
169
  )
166
170
  if branch_id in repo.branches:
167
171
  repo.branches.delete(branch_id)
172
+ await cron.insecure_track_branches()
uedition_editor/cron.py CHANGED
@@ -16,42 +16,56 @@ from uedition_editor.state import local_branches, remote_branches
16
16
  logger = logging.getLogger(__name__)
17
17
 
18
18
 
19
+ def format_remote_branch_title(title: str) -> str:
20
+ """Format the remote branch name as a title."""
21
+ if "/" in title:
22
+ return de_slugify(title[title.find("/") + 1 :])
23
+ return title
24
+
25
+
26
+ async def insecure_track_branches():
27
+ """
28
+ Track the status of all git branches.
29
+
30
+ Use only when the uedition_lock is already aquired.
31
+ """
32
+ remote_branches.clear()
33
+ local_branches.clear()
34
+ try:
35
+ repo = Repository(init_settings.base_path, flags=RepositoryOpenFlag.NO_SEARCH)
36
+ logger.debug("Tracking branches")
37
+ repo.checkout(repo.branches[init_settings.git.default_branch])
38
+ if init_settings.git.remote_name in list(repo.remotes.names()):
39
+ logger.debug("Synchronising with remote")
40
+ fetch_repo(repo, init_settings.git.remote_name)
41
+ logger.debug("Updating branch status")
42
+ for branch_name in repo.branches.local:
43
+ repo.checkout(repo.branches[branch_name])
44
+ if init_settings.git.remote_name in list(repo.remotes.names()):
45
+ if repo.branches[branch_name].upstream is not None:
46
+ pull_branch(repo, branch_name)
47
+ merge_base = repo.merge_base(
48
+ repo.revparse_single(init_settings.git.default_branch).id, repo.revparse_single(branch_name).id
49
+ )
50
+ diff = repo.diff(merge_base, repo.revparse_single(init_settings.git.default_branch))
51
+ local_branches.append(
52
+ {
53
+ "id": branch_name,
54
+ "title": de_slugify(branch_name),
55
+ "update_from_default": diff.stats.files_changed > 0,
56
+ }
57
+ )
58
+ for branch_name in repo.branches.remote:
59
+ if repo.branches[branch_name].remote_name == init_settings.git.remote_name and "HEAD" not in branch_name:
60
+ remote_branches.append({"id": branch_name, "title": format_remote_branch_title(branch_name)})
61
+ logger.debug("Tracking complete")
62
+ except GitError as ge:
63
+ logger.error(ge)
64
+ local_branches.append({"id": "-", "title": "Direct Access", "nogit": True})
65
+
66
+
19
67
  @aiocron.crontab("*/5 * * * *")
20
68
  async def track_branches() -> None:
21
69
  """Track the status of all git branches."""
22
70
  async with uedition_lock:
23
- remote_branches.clear()
24
- local_branches.clear()
25
- try:
26
- repo = Repository(init_settings.base_path, flags=RepositoryOpenFlag.NO_SEARCH)
27
- logger.debug("Tracking branches")
28
- repo.checkout(repo.branches[init_settings.git.default_branch])
29
- if init_settings.git.remote_name in list(repo.remotes.names()):
30
- logger.debug("Synchronising with remote")
31
- fetch_repo(repo, init_settings.git.remote_name)
32
- logger.debug("Updating branch status")
33
- for branch_name in repo.branches.local:
34
- repo.checkout(repo.branches[branch_name])
35
- if init_settings.git.remote_name in list(repo.remotes.names()):
36
- if repo.branches[branch_name].upstream is not None:
37
- pull_branch(repo, branch_name)
38
- diff = repo.diff(
39
- repo.revparse_single(init_settings.git.default_branch),
40
- )
41
- local_branches.append(
42
- {
43
- "id": branch_name,
44
- "title": de_slugify(branch_name),
45
- "update_from_default": diff.stats.files_changed > 0,
46
- }
47
- )
48
- for branch_name in repo.branches.remote:
49
- if (
50
- repo.branches[branch_name].remote_name == init_settings.git.remote_name
51
- and "HEAD" not in branch_name
52
- ):
53
- remote_branches.append({"id": branch_name, "title": de_slugify(branch_name)})
54
- logger.debug("Tracking complete")
55
- except GitError as ge:
56
- logger.error(ge)
57
- local_branches.append({"id": "-", "title": "Direct Access", "nogit": True})
71
+ await insecure_track_branches()
@@ -1,4 +1,4 @@
1
- import{S as af,i as hf,s as cf,F as ff,g as qn,G as uo,r as En,H as Rp,y as Ap,z as uf,E as wl,e as bi,c as df,t as Mp,f as Qt,h as pi,k as Lp,o as qp,p as Rr,q as Ep,n as Ar,w as $s,J as Un,x as xa,K as Vp,L as Dp,M as ka,N as vs,O as Wp,d as Of,j as pf,l as _p,P as Bp,u as mf,Q as jp}from"./index-D6QIwXwq.js";import{k as Yp,b as zp,s as Ip}from"./index-Vcq4gwWv.js";const gf=1024;let Up=0,We=class{constructor(e,t){this.from=e,this.to=t}};class L{constructor(e={}){this.id=Up++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ae.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.isolate=new L({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class dn{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[L.mounted.id]}}const Np=Object.create(null);class ae{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Np,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new ae(e.name||"",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(L.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(" "))t[r]=e[i];return i=>{for(let r=i.prop(L.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?i.name:r[s]];if(o)return o}}}}ae.none=new ae("",Object.create(null),0,8);class Vn{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let r=null;for(let s of e){let o=s(i);o&&(r||(r=Object.assign({},i.props)),r[o[0].id]=o[1])}t.push(r?new ae(i.name,r,i.id,i.flags):i)}return new Vn(t)}}const Nn=new WeakMap,wa=new WeakMap;var K;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(K||(K={}));class U{constructor(e,t,i,r,s){if(this.type=e,this.children=t,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=dn.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let r=i.toString();r&&(t&&(t+=","),t+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Mr(this.topNode,e)}cursorAt(e,t=0,i=0){let r=Nn.get(this)||this.topNode,s=new Mr(r);return s.moveTo(e,t),Nn.set(this,s._tree),s}get topNode(){return new be(this,0,0,null)}resolve(e,t=0){let i=On(Nn.get(this)||this.topNode,e,t,!1);return Nn.set(this,i),i}resolveInner(e,t=0){let i=On(wa.get(this)||this.topNode,e,t,!0);return wa.set(this,i),i}resolveStack(e,t=0){return Fp(this,e,t)}iterate(e){let{enter:t,leave:i,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&K.IncludeAnonymous)>0;for(let a=this.cursor(o|K.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:vl(ae.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new U(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new U(ae.none,t,i,r)))}static build(e){return Kp(e)}}U.empty=new U(ae.none,[],[],0);class Pl{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Pl(this.buffer,this.index)}}class Wt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ae.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],r=this.set.types[t],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,i,r,s){let{buffer:o}=this,l=-1;for(let a=e;a!=t&&!(bf(s,r,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,t,i){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l<t;){s[a++]=r[l++],s[a++]=r[l++]-i;let h=s[a++]=r[l++]-i;s[a++]=r[l++]-e,o=Math.max(o,h)}return new Wt(s,o,this.set)}}function bf(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function On(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!i&&n instanceof be&&n.index<0?null:n.parent;if(!o)return n;n=o}let s=i?0:K.IgnoreOverlays;if(i)for(let o=n,l=o.parent;l;o=l,l=o.parent)o instanceof be&&o.index<0&&((r=l.enter(e,t,s))===null||r===void 0?void 0:r.from)!=o.from&&(n=l);for(;;){let o=n.enter(e,t,s);if(!o)return n;n=o}}class Sf{cursor(e=0){return new Mr(this,e)}getChild(e,t=null,i=null){let r=Pa(this,e,t,i);return r.length?r[0]:null}getChildren(e,t=null,i=null){return Pa(this,e,t,i)}resolve(e,t=0){return On(this,e,t,!1)}resolveInner(e,t=0){return On(this,e,t,!0)}matchContext(e){return Oo(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let r=t.lastChild;if(!r||r.to!=t.to)break;r.type.isError&&r.from==r.to?(i=t,t=r.prevSibling):t=r}return i}get node(){return this}get next(){return this.parent}}class be extends Sf{constructor(e,t,i,r){super(),this._tree=e,this.from=t,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,r,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,h=t>0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(bf(r,i,f,f+c.length)){if(c instanceof Wt){if(s&K.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,r);if(u>-1)return new ot(new Gp(o,c,e,f),null,u)}else if(s&K.IncludeAnonymous||!c.type.isAnonymous||$l(c)){let u;if(!(s&K.IgnoreMounts)&&(u=dn.get(c))&&!u.overlay)return new be(u.tree,f,e,o);let d=new be(c,f,e,o);return s&K.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,r)}}}if(s&K.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let r;if(!(i&K.IgnoreOverlays)&&(r=dn.get(this._tree))&&r.overlay){let s=e-this.from;for(let{from:o,to:l}of r.overlay)if((t>0?o<=s:o<s)&&(t<0?l>=s:l>s))return new be(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Pa(n,e,t,i){let r=n.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function Oo(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Gp{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}}class ot extends Sf{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new ot(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&K.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new ot(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ot(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ot(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),t.push(0)}return new U(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Qf(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let o=n[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let i=t instanceof be&&t.index<0?null:t.parent,r=n.slice();return i?r[e]=i:r.splice(e,1),new Hp(r,t)}class Hp{constructor(e,t){this.heads=e,this.node=t}get next(){return Qf(this.heads)}}function Fp(n,e,t){let i=n.resolveInner(e,t),r=null;for(let s=i instanceof be?i:i.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[i])).push(o.resolve(e,t)),s=o}else{let o=dn.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new be(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(On(l,e,t,!1))}}return r?Qf(r):i}class Mr{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof be)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof be?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&K.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&K.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&K.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:i}=r)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let s=t+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let l=i._tree.children[s];if(this.mode&K.IncludeAnonymous||l instanceof Wt||!l.type.isAnonymous||$l(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)t=new ot(this.buffer,t,this.stack[r]);return this.bufferNode=new ot(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return Oo(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return Oo(this._tree,e,r);let o=i[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function $l(n){return n.children.some(e=>e instanceof Wt||!e.type.isAnonymous||$l(e))}function Kp(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=gf,reused:s=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Pl(t,t.length):t,a=i.types,h=0,c=0;function f(y,k,$,E,D,I){let{id:V,start:M,end:z,size:_}=l,N=c,fe=h;for(;_<0;)if(l.next(),_==-1){let xe=s[V];$.push(xe),E.push(M-y);return}else if(_==-3){h=V;return}else if(_==-4){c=V;return}else throw new RangeError(`Unrecognized record size: ${_}`);let ye=a[V],Ve,X,ue=M-y;if(z-M<=r&&(X=p(l.pos-k,D))){let xe=new Uint16Array(X.size-X.skip),Pe=l.pos-X.size,Re=xe.length;for(;l.pos>Pe;)Re=b(X.start,xe,Re);Ve=new Wt(xe,z-X.start,i),ue=X.start-y}else{let xe=l.pos-_;l.next();let Pe=[],Re=[],pt=V>=o?V:-1,Rt=0,It=z;for(;l.pos>xe;)pt>=0&&l.id==pt&&l.size>=0?(l.end<=It-r&&(O(Pe,Re,M,Rt,l.end,It,pt,N,fe),Rt=Pe.length,It=l.end),l.next()):I>2500?u(M,xe,Pe,Re):f(M,xe,Pe,Re,pt,I+1);if(pt>=0&&Rt>0&&Rt<Pe.length&&O(Pe,Re,M,Rt,M,It,pt,N,fe),Pe.reverse(),Re.reverse(),pt>-1&&Rt>0){let mt=d(ye,fe);Ve=vl(ye,Pe,Re,0,Pe.length,0,z-M,mt,mt)}else Ve=g(ye,Pe,Re,z-M,N-z,fe)}$.push(Ve),E.push(ue)}function u(y,k,$,E){let D=[],I=0,V=-1;for(;l.pos>k;){let{id:M,start:z,end:_,size:N}=l;if(N>4)l.next();else{if(V>-1&&z<V)break;V<0&&(V=_-r),D.push(M,z,_),I++,l.next()}}if(I){let M=new Uint16Array(I*4),z=D[D.length-2];for(let _=D.length-3,N=0;_>=0;_-=3)M[N++]=D[_],M[N++]=D[_+1]-z,M[N++]=D[_+2]-z,M[N++]=N;$.push(new Wt(M,D[2]-z,i)),E.push(z-y)}}function d(y,k){return($,E,D)=>{let I=0,V=$.length-1,M,z;if(V>=0&&(M=$[V])instanceof U){if(!V&&M.type==y&&M.length==D)return M;(z=M.prop(L.lookAhead))&&(I=E[V]+M.length+z)}return g(y,$,E,D,I,k)}}function O(y,k,$,E,D,I,V,M,z){let _=[],N=[];for(;y.length>E;)_.push(y.pop()),N.push(k.pop()+$-D);y.push(g(i.types[V],_,N,I-D,M-I,z)),k.push(D-$)}function g(y,k,$,E,D,I,V){if(I){let M=[L.contextHash,I];V=V?[M].concat(V):[M]}if(D>25){let M=[L.lookAhead,D];V=V?[M].concat(V):[M]}return new U(y,k,$,E,V)}function p(y,k){let $=l.fork(),E=0,D=0,I=0,V=$.end-r,M={size:0,start:0,skip:0};e:for(let z=$.pos-y;$.pos>z;){let _=$.size;if($.id==k&&_>=0){M.size=E,M.start=D,M.skip=I,I+=4,E+=4,$.next();continue}let N=$.pos-_;if(_<0||N<z||$.start<V)break;let fe=$.id>=o?4:0,ye=$.start;for($.next();$.pos>N;){if($.size<0)if($.size==-3)fe+=4;else break e;else $.id>=o&&(fe+=4);$.next()}D=ye,E+=_,I+=fe}return(k<0||E==y)&&(M.size=E,M.start=D,M.skip=I),M.size>4?M:void 0}function b(y,k,$){let{id:E,start:D,end:I,size:V}=l;if(l.next(),V>=0&&E<o){let M=$;if(V>4){let z=l.pos-(V-4);for(;l.pos>z;)$=b(y,k,$)}k[--$]=M,k[--$]=I-y,k[--$]=D-y,k[--$]=E}else V==-3?h=E:V==-4&&(c=E);return $}let S=[],x=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,S,x,-1,0);let w=(e=n.length)!==null&&e!==void 0?e:S.length?x[0]+S[0].length:0;return new U(a[n.topID],S.reverse(),x.reverse(),w)}const $a=new WeakMap;function Sr(n,e){if(!n.isAnonymous||e instanceof Wt||e.type!=n)return 1;let t=$a.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof U)){t=1;break}t+=Sr(n,i)}$a.set(e,t)}return t}function vl(n,e,t,i,r,s,o,l,a){let h=0;for(let O=i;O<r;O++)h+=Sr(n,e[O]);let c=Math.ceil(h*1.5/8),f=[],u=[];function d(O,g,p,b,S){for(let x=p;x<b;){let w=x,y=g[x],k=Sr(n,O[x]);for(x++;x<b;x++){let $=Sr(n,O[x]);if(k+$>=c)break;k+=$}if(x==w+1){if(k>c){let $=O[w];d($.children,$.positions,0,$.children.length,g[w]+S);continue}f.push(O[w])}else{let $=g[x-1]+O[x-1].length-y;f.push(vl(n,O,g,w,x,y,$,null,a))}u.push(y+S-s)}}return d(e,t,i,r,0),(l||a)(f,u,o)}class yf{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof ot?this.setBuffer(e.context.buffer,e.index,t):e instanceof be&&this.map.set(e.tree,t)}get(e){return e instanceof ot?this.getBuffer(e.context.buffer,e.index):e instanceof be?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class yt{constructor(e,t,i,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new yt(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l<t.length?t[l]:null,f=c?c.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let u=o;if(a>=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,O=Math.min(u.to,f)-h;u=d>=O?null:new yt(d,O,u.tree,u.offset+h,l>0,!!c)}if(u&&r.push(u),o.to>f)break;o=s<e.length?e[s++]:null}if(!c)break;a=c.toA,h=c.toA-c.toB}return r}}class Cl{startParse(e,t,i){return typeof e=="string"&&(e=new Jp(e)),i=i?i.length?i.map(r=>new We(r.from,r.to)):[new We(0,0)]:[new We(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let s=r.advance();if(s)return s}}}class Jp{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function xf(n){return(e,t,i,r)=>new tm(e,n,t,i,r)}class va{constructor(e,t,i,r,s){this.parser=e,this.parse=t,this.overlay=i,this.target=r,this.from=s}}function Ca(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class em{constructor(e,t,i,r,s,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=r,this.start=s,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const po=new L({perNode:!0});class tm{constructor(e,t,i,r,s){this.nest=t,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new U(i.type,i.children,i.positions,i.length,i.propValues.concat([[po,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[L.mounted.id]=new dn(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new rm(this.fragments),t=null,i=null,r=new Mr(new be(this.baseTree,this.ranges[0].from,0,null),K.IncludeAnonymous|K.IgnoreMounts);e:for(let s,o;;){let l=!0,a;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=r.from&&u<=r.to&&!t.ranges.some(d=>d.from<u&&d.to>f)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=im(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.from<r.to||!s.overlay)){r.tree||nm(r);let h=e.findMounts(r.from,s.parser);if(typeof s.overlay=="function")t=new em(s.parser,s.overlay,h,this.inner.length,r.from,r.tree,t);else{let c=Xa(this.ranges,s.overlay||(r.from<r.to?[new We(r.from,r.to)]:[]));c.length&&Ca(c),(c.length||!s.overlay)&&this.inner.push(new va(s.parser,c.length?s.parser.startParse(this.input,Ra(h,c),c):s.parser.startParse(""),s.overlay?s.overlay.map(f=>new We(f.from-r.from,f.to-r.from)):null,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new We(r.from,r.to)),a.from<a.to)){let h=t.ranges.length-1;h>=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=Xa(this.ranges,t.ranges);h.length&&(Ca(h),this.inner.splice(t.index,0,new va(t.parser,t.parser.startParse(this.input,Ra(t.mounts,h),h),t.ranges.map(c=>new We(c.from-t.start,c.to-t.start)),t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function im(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Za(n,e,t,i,r,s){if(e<t){let o=n.buffer[e+1];i.push(n.slice(e,t,o)),r.push(o-s)}}function nm(n){let{node:e}=n,t=[],i=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let r=n.tree,s=r.children.indexOf(i),o=r.children[s],l=o.buffer,a=[s];function h(c,f,u,d,O,g){let p=t[g],b=[],S=[];Za(o,c,p,b,S,d);let x=l[p+1],w=l[p+2];a.push(b.length);let y=g?h(p+4,l[p+3],o.set.types[l[p]],x,w-x,g-1):e.toTree();return b.push(y),S.push(x-d),Za(o,l[p+3],f,b,S,d),new U(u,b,S,O)}r.children[s]=h(0,l.length,ae.none,0,o.length,t.length-1);for(let c of a){let f=n.tree.children[c],u=n.tree.positions[c];n.yield(new be(f,u+n.from,c,n._tree))}}class Ta{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(K.IncludeAnonymous|K.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from<i;)t.to>=e&&t.enter(i,1,K.IgnoreOverlays|K.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof U)t=t.children[0];else break}return!1}}let rm=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(po))!==null&&t!==void 0?t:i.to,this.inner=new Ta(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(po))!==null&&e!==void 0?e:t.to,this.inner=new Ta(t.tree,-t.offset)}}findMounts(e,t){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==t)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function Xa(n,e){let t=null,i=e;for(let r=1,s=0;r<n.length;r++){let o=n[r-1].to,l=n[r].from;for(;s<i.length;s++){let a=i[s];if(a.from>=l)break;a.to<=o||(t||(i=t=e.slice()),a.from<o?(t[s]=new We(a.from,o),a.to>l&&t.splice(s+1,0,new We(l,a.to))):a.to>l?t[s--]=new We(l,a.to):t.splice(s--,1))}}return i}function sm(n,e,t,i){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==n.length?1e9:o?n[r].to:n[r].from,f=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);u<d&&h.push(new We(u,d))}if(a=Math.min(c,f),a==1e9)break;c==a&&(o?(o=!1,r++):o=!0),f==a&&(l?(l=!1,s++):l=!0)}return h}function Ra(n,e){let t=[];for(let{pos:i,mount:r,frag:s}of n){let o=i+(r.overlay?r.overlay[0].from:0),l=o+r.tree.length,a=Math.max(s.from,o),h=Math.min(s.to,l);if(r.overlay){let c=r.overlay.map(u=>new We(u.from+i,u.to+i)),f=sm(e,c,a,h);for(let u=0,d=a;;u++){let O=u==f.length,g=O?h:f[u].from;if(g>d&&t.push(new yt(d,g,r.tree,-o,s.from>=d||s.openStart,s.to<=g||s.openEnd)),O)break;d=f[u].to}}else t.push(new yt(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}let mo=[],kf=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?kf:mo).push(t=t+n[e])})();function om(n){if(n<768)return!1;for(let e=0,t=mo.length;;){let i=e+t>>1;if(n<mo[i])t=i;else if(n>=kf[i])e=i+1;else return!0;if(e==t)return!1}}function Aa(n){return n>=127462&&n<=127487}const Ma=8205;function lm(n,e,t=!0,i=!0){return(t?wf:am)(n,e,i)}function wf(n,e,t){if(e==n.length)return e;e&&Pf(n.charCodeAt(e))&&$f(n.charCodeAt(e-1))&&e--;let i=Cs(n,e);for(e+=La(i);e<n.length;){let r=Cs(n,e);if(i==Ma||r==Ma||t&&om(r))e+=La(r),i=r;else if(Aa(r)){let s=0,o=e-2;for(;o>=0&&Aa(Cs(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function am(n,e,t){for(;e>0;){let i=wf(n,e-2,t);if(i<e)return i;e--}return 0}function Cs(n,e){let t=n.charCodeAt(e);if(!$f(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Pf(i)?(t-55296<<10)+(i-56320)+65536:t}function Pf(n){return n>=56320&&n<57344}function $f(n){return n>=55296&&n<56320}function La(n){return n<65536?1:2}class Y{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=$i(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),nt.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=$i(this,e,t);let i=[];return this.decompose(e,t,i,0),nt.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new sn(this),s=new sn(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new sn(this,e)}iterRange(e,t=this.length){return new vf(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Cf(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Y.empty:e.length<=32?new ne(e):nt.from(ne.split(e,[]))}}class ne extends Y{constructor(e,t=hm(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?i:l)>=e)return new cm(r,l,i,o);r=l+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new ne(qa(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=Qr(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new ne(l,o.length+s.length));else{let a=l.length>>1;i.push(new ne(l.slice(0,a)),new ne(l.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof ne))return super.replace(e,t,i);[e,t]=$i(this,e,t);let r=Qr(this.text,Qr(i.text,qa(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new ne(r,s):nt.from(ne.split(r,[]),s)}sliceString(e,t=this.length,i=`
1
+ import{S as af,i as hf,s as cf,F as ff,g as qn,G as uo,r as En,H as Rp,y as Ap,z as uf,E as wl,e as bi,c as df,t as Mp,f as Qt,h as pi,k as Lp,o as qp,p as Rr,q as Ep,n as Ar,w as $s,J as Un,x as xa,K as Vp,L as Dp,M as ka,N as vs,O as Wp,d as Of,j as pf,l as _p,P as Bp,u as mf,Q as jp}from"./index-DAdhbT7C.js";import{k as Yp,b as zp,s as Ip}from"./index-Vcq4gwWv.js";const gf=1024;let Up=0,We=class{constructor(e,t){this.from=e,this.to=t}};class L{constructor(e={}){this.id=Up++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ae.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.isolate=new L({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class dn{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[L.mounted.id]}}const Np=Object.create(null);class ae{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Np,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new ae(e.name||"",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(L.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(" "))t[r]=e[i];return i=>{for(let r=i.prop(L.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?i.name:r[s]];if(o)return o}}}}ae.none=new ae("",Object.create(null),0,8);class Vn{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let r=null;for(let s of e){let o=s(i);o&&(r||(r=Object.assign({},i.props)),r[o[0].id]=o[1])}t.push(r?new ae(i.name,r,i.id,i.flags):i)}return new Vn(t)}}const Nn=new WeakMap,wa=new WeakMap;var K;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(K||(K={}));class U{constructor(e,t,i,r,s){if(this.type=e,this.children=t,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=dn.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let r=i.toString();r&&(t&&(t+=","),t+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Mr(this.topNode,e)}cursorAt(e,t=0,i=0){let r=Nn.get(this)||this.topNode,s=new Mr(r);return s.moveTo(e,t),Nn.set(this,s._tree),s}get topNode(){return new be(this,0,0,null)}resolve(e,t=0){let i=On(Nn.get(this)||this.topNode,e,t,!1);return Nn.set(this,i),i}resolveInner(e,t=0){let i=On(wa.get(this)||this.topNode,e,t,!0);return wa.set(this,i),i}resolveStack(e,t=0){return Fp(this,e,t)}iterate(e){let{enter:t,leave:i,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&K.IncludeAnonymous)>0;for(let a=this.cursor(o|K.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:vl(ae.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new U(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new U(ae.none,t,i,r)))}static build(e){return Kp(e)}}U.empty=new U(ae.none,[],[],0);class Pl{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Pl(this.buffer,this.index)}}class Wt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ae.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],r=this.set.types[t],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,i,r,s){let{buffer:o}=this,l=-1;for(let a=e;a!=t&&!(bf(s,r,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,t,i){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l<t;){s[a++]=r[l++],s[a++]=r[l++]-i;let h=s[a++]=r[l++]-i;s[a++]=r[l++]-e,o=Math.max(o,h)}return new Wt(s,o,this.set)}}function bf(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function On(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!i&&n instanceof be&&n.index<0?null:n.parent;if(!o)return n;n=o}let s=i?0:K.IgnoreOverlays;if(i)for(let o=n,l=o.parent;l;o=l,l=o.parent)o instanceof be&&o.index<0&&((r=l.enter(e,t,s))===null||r===void 0?void 0:r.from)!=o.from&&(n=l);for(;;){let o=n.enter(e,t,s);if(!o)return n;n=o}}class Sf{cursor(e=0){return new Mr(this,e)}getChild(e,t=null,i=null){let r=Pa(this,e,t,i);return r.length?r[0]:null}getChildren(e,t=null,i=null){return Pa(this,e,t,i)}resolve(e,t=0){return On(this,e,t,!1)}resolveInner(e,t=0){return On(this,e,t,!0)}matchContext(e){return Oo(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let r=t.lastChild;if(!r||r.to!=t.to)break;r.type.isError&&r.from==r.to?(i=t,t=r.prevSibling):t=r}return i}get node(){return this}get next(){return this.parent}}class be extends Sf{constructor(e,t,i,r){super(),this._tree=e,this.from=t,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,r,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,h=t>0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(bf(r,i,f,f+c.length)){if(c instanceof Wt){if(s&K.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,r);if(u>-1)return new ot(new Gp(o,c,e,f),null,u)}else if(s&K.IncludeAnonymous||!c.type.isAnonymous||$l(c)){let u;if(!(s&K.IgnoreMounts)&&(u=dn.get(c))&&!u.overlay)return new be(u.tree,f,e,o);let d=new be(c,f,e,o);return s&K.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,r)}}}if(s&K.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let r;if(!(i&K.IgnoreOverlays)&&(r=dn.get(this._tree))&&r.overlay){let s=e-this.from;for(let{from:o,to:l}of r.overlay)if((t>0?o<=s:o<s)&&(t<0?l>=s:l>s))return new be(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Pa(n,e,t,i){let r=n.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function Oo(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Gp{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}}class ot extends Sf{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new ot(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&K.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new ot(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ot(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ot(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),t.push(0)}return new U(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Qf(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let o=n[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let i=t instanceof be&&t.index<0?null:t.parent,r=n.slice();return i?r[e]=i:r.splice(e,1),new Hp(r,t)}class Hp{constructor(e,t){this.heads=e,this.node=t}get next(){return Qf(this.heads)}}function Fp(n,e,t){let i=n.resolveInner(e,t),r=null;for(let s=i instanceof be?i:i.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[i])).push(o.resolve(e,t)),s=o}else{let o=dn.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new be(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(On(l,e,t,!1))}}return r?Qf(r):i}class Mr{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof be)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof be?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&K.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&K.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&K.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:i}=r)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let s=t+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let l=i._tree.children[s];if(this.mode&K.IncludeAnonymous||l instanceof Wt||!l.type.isAnonymous||$l(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)t=new ot(this.buffer,t,this.stack[r]);return this.bufferNode=new ot(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return Oo(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return Oo(this._tree,e,r);let o=i[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function $l(n){return n.children.some(e=>e instanceof Wt||!e.type.isAnonymous||$l(e))}function Kp(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=gf,reused:s=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Pl(t,t.length):t,a=i.types,h=0,c=0;function f(y,k,$,E,D,I){let{id:V,start:M,end:z,size:_}=l,N=c,fe=h;for(;_<0;)if(l.next(),_==-1){let xe=s[V];$.push(xe),E.push(M-y);return}else if(_==-3){h=V;return}else if(_==-4){c=V;return}else throw new RangeError(`Unrecognized record size: ${_}`);let ye=a[V],Ve,X,ue=M-y;if(z-M<=r&&(X=p(l.pos-k,D))){let xe=new Uint16Array(X.size-X.skip),Pe=l.pos-X.size,Re=xe.length;for(;l.pos>Pe;)Re=b(X.start,xe,Re);Ve=new Wt(xe,z-X.start,i),ue=X.start-y}else{let xe=l.pos-_;l.next();let Pe=[],Re=[],pt=V>=o?V:-1,Rt=0,It=z;for(;l.pos>xe;)pt>=0&&l.id==pt&&l.size>=0?(l.end<=It-r&&(O(Pe,Re,M,Rt,l.end,It,pt,N,fe),Rt=Pe.length,It=l.end),l.next()):I>2500?u(M,xe,Pe,Re):f(M,xe,Pe,Re,pt,I+1);if(pt>=0&&Rt>0&&Rt<Pe.length&&O(Pe,Re,M,Rt,M,It,pt,N,fe),Pe.reverse(),Re.reverse(),pt>-1&&Rt>0){let mt=d(ye,fe);Ve=vl(ye,Pe,Re,0,Pe.length,0,z-M,mt,mt)}else Ve=g(ye,Pe,Re,z-M,N-z,fe)}$.push(Ve),E.push(ue)}function u(y,k,$,E){let D=[],I=0,V=-1;for(;l.pos>k;){let{id:M,start:z,end:_,size:N}=l;if(N>4)l.next();else{if(V>-1&&z<V)break;V<0&&(V=_-r),D.push(M,z,_),I++,l.next()}}if(I){let M=new Uint16Array(I*4),z=D[D.length-2];for(let _=D.length-3,N=0;_>=0;_-=3)M[N++]=D[_],M[N++]=D[_+1]-z,M[N++]=D[_+2]-z,M[N++]=N;$.push(new Wt(M,D[2]-z,i)),E.push(z-y)}}function d(y,k){return($,E,D)=>{let I=0,V=$.length-1,M,z;if(V>=0&&(M=$[V])instanceof U){if(!V&&M.type==y&&M.length==D)return M;(z=M.prop(L.lookAhead))&&(I=E[V]+M.length+z)}return g(y,$,E,D,I,k)}}function O(y,k,$,E,D,I,V,M,z){let _=[],N=[];for(;y.length>E;)_.push(y.pop()),N.push(k.pop()+$-D);y.push(g(i.types[V],_,N,I-D,M-I,z)),k.push(D-$)}function g(y,k,$,E,D,I,V){if(I){let M=[L.contextHash,I];V=V?[M].concat(V):[M]}if(D>25){let M=[L.lookAhead,D];V=V?[M].concat(V):[M]}return new U(y,k,$,E,V)}function p(y,k){let $=l.fork(),E=0,D=0,I=0,V=$.end-r,M={size:0,start:0,skip:0};e:for(let z=$.pos-y;$.pos>z;){let _=$.size;if($.id==k&&_>=0){M.size=E,M.start=D,M.skip=I,I+=4,E+=4,$.next();continue}let N=$.pos-_;if(_<0||N<z||$.start<V)break;let fe=$.id>=o?4:0,ye=$.start;for($.next();$.pos>N;){if($.size<0)if($.size==-3)fe+=4;else break e;else $.id>=o&&(fe+=4);$.next()}D=ye,E+=_,I+=fe}return(k<0||E==y)&&(M.size=E,M.start=D,M.skip=I),M.size>4?M:void 0}function b(y,k,$){let{id:E,start:D,end:I,size:V}=l;if(l.next(),V>=0&&E<o){let M=$;if(V>4){let z=l.pos-(V-4);for(;l.pos>z;)$=b(y,k,$)}k[--$]=M,k[--$]=I-y,k[--$]=D-y,k[--$]=E}else V==-3?h=E:V==-4&&(c=E);return $}let S=[],x=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,S,x,-1,0);let w=(e=n.length)!==null&&e!==void 0?e:S.length?x[0]+S[0].length:0;return new U(a[n.topID],S.reverse(),x.reverse(),w)}const $a=new WeakMap;function Sr(n,e){if(!n.isAnonymous||e instanceof Wt||e.type!=n)return 1;let t=$a.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof U)){t=1;break}t+=Sr(n,i)}$a.set(e,t)}return t}function vl(n,e,t,i,r,s,o,l,a){let h=0;for(let O=i;O<r;O++)h+=Sr(n,e[O]);let c=Math.ceil(h*1.5/8),f=[],u=[];function d(O,g,p,b,S){for(let x=p;x<b;){let w=x,y=g[x],k=Sr(n,O[x]);for(x++;x<b;x++){let $=Sr(n,O[x]);if(k+$>=c)break;k+=$}if(x==w+1){if(k>c){let $=O[w];d($.children,$.positions,0,$.children.length,g[w]+S);continue}f.push(O[w])}else{let $=g[x-1]+O[x-1].length-y;f.push(vl(n,O,g,w,x,y,$,null,a))}u.push(y+S-s)}}return d(e,t,i,r,0),(l||a)(f,u,o)}class yf{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof ot?this.setBuffer(e.context.buffer,e.index,t):e instanceof be&&this.map.set(e.tree,t)}get(e){return e instanceof ot?this.getBuffer(e.context.buffer,e.index):e instanceof be?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class yt{constructor(e,t,i,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new yt(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l<t.length?t[l]:null,f=c?c.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let u=o;if(a>=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,O=Math.min(u.to,f)-h;u=d>=O?null:new yt(d,O,u.tree,u.offset+h,l>0,!!c)}if(u&&r.push(u),o.to>f)break;o=s<e.length?e[s++]:null}if(!c)break;a=c.toA,h=c.toA-c.toB}return r}}class Cl{startParse(e,t,i){return typeof e=="string"&&(e=new Jp(e)),i=i?i.length?i.map(r=>new We(r.from,r.to)):[new We(0,0)]:[new We(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let s=r.advance();if(s)return s}}}class Jp{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function xf(n){return(e,t,i,r)=>new tm(e,n,t,i,r)}class va{constructor(e,t,i,r,s){this.parser=e,this.parse=t,this.overlay=i,this.target=r,this.from=s}}function Ca(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class em{constructor(e,t,i,r,s,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=r,this.start=s,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const po=new L({perNode:!0});class tm{constructor(e,t,i,r,s){this.nest=t,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new U(i.type,i.children,i.positions,i.length,i.propValues.concat([[po,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[L.mounted.id]=new dn(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new rm(this.fragments),t=null,i=null,r=new Mr(new be(this.baseTree,this.ranges[0].from,0,null),K.IncludeAnonymous|K.IgnoreMounts);e:for(let s,o;;){let l=!0,a;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=r.from&&u<=r.to&&!t.ranges.some(d=>d.from<u&&d.to>f)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=im(i.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.from<r.to||!s.overlay)){r.tree||nm(r);let h=e.findMounts(r.from,s.parser);if(typeof s.overlay=="function")t=new em(s.parser,s.overlay,h,this.inner.length,r.from,r.tree,t);else{let c=Xa(this.ranges,s.overlay||(r.from<r.to?[new We(r.from,r.to)]:[]));c.length&&Ca(c),(c.length||!s.overlay)&&this.inner.push(new va(s.parser,c.length?s.parser.startParse(this.input,Ra(h,c),c):s.parser.startParse(""),s.overlay?s.overlay.map(f=>new We(f.from-r.from,f.to-r.from)):null,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new We(r.from,r.to)),a.from<a.to)){let h=t.ranges.length-1;h>=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=Xa(this.ranges,t.ranges);h.length&&(Ca(h),this.inner.splice(t.index,0,new va(t.parser,t.parser.startParse(this.input,Ra(t.mounts,h),h),t.ranges.map(c=>new We(c.from-t.start,c.to-t.start)),t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function im(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Za(n,e,t,i,r,s){if(e<t){let o=n.buffer[e+1];i.push(n.slice(e,t,o)),r.push(o-s)}}function nm(n){let{node:e}=n,t=[],i=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let r=n.tree,s=r.children.indexOf(i),o=r.children[s],l=o.buffer,a=[s];function h(c,f,u,d,O,g){let p=t[g],b=[],S=[];Za(o,c,p,b,S,d);let x=l[p+1],w=l[p+2];a.push(b.length);let y=g?h(p+4,l[p+3],o.set.types[l[p]],x,w-x,g-1):e.toTree();return b.push(y),S.push(x-d),Za(o,l[p+3],f,b,S,d),new U(u,b,S,O)}r.children[s]=h(0,l.length,ae.none,0,o.length,t.length-1);for(let c of a){let f=n.tree.children[c],u=n.tree.positions[c];n.yield(new be(f,u+n.from,c,n._tree))}}class Ta{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(K.IncludeAnonymous|K.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from<i;)t.to>=e&&t.enter(i,1,K.IgnoreOverlays|K.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof U)t=t.children[0];else break}return!1}}let rm=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(po))!==null&&t!==void 0?t:i.to,this.inner=new Ta(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(po))!==null&&e!==void 0?e:t.to,this.inner=new Ta(t.tree,-t.offset)}}findMounts(e,t){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==t)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function Xa(n,e){let t=null,i=e;for(let r=1,s=0;r<n.length;r++){let o=n[r-1].to,l=n[r].from;for(;s<i.length;s++){let a=i[s];if(a.from>=l)break;a.to<=o||(t||(i=t=e.slice()),a.from<o?(t[s]=new We(a.from,o),a.to>l&&t.splice(s+1,0,new We(l,a.to))):a.to>l?t[s--]=new We(l,a.to):t.splice(s--,1))}}return i}function sm(n,e,t,i){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==n.length?1e9:o?n[r].to:n[r].from,f=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);u<d&&h.push(new We(u,d))}if(a=Math.min(c,f),a==1e9)break;c==a&&(o?(o=!1,r++):o=!0),f==a&&(l?(l=!1,s++):l=!0)}return h}function Ra(n,e){let t=[];for(let{pos:i,mount:r,frag:s}of n){let o=i+(r.overlay?r.overlay[0].from:0),l=o+r.tree.length,a=Math.max(s.from,o),h=Math.min(s.to,l);if(r.overlay){let c=r.overlay.map(u=>new We(u.from+i,u.to+i)),f=sm(e,c,a,h);for(let u=0,d=a;;u++){let O=u==f.length,g=O?h:f[u].from;if(g>d&&t.push(new yt(d,g,r.tree,-o,s.from>=d||s.openStart,s.to<=g||s.openEnd)),O)break;d=f[u].to}}else t.push(new yt(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}let mo=[],kf=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?kf:mo).push(t=t+n[e])})();function om(n){if(n<768)return!1;for(let e=0,t=mo.length;;){let i=e+t>>1;if(n<mo[i])t=i;else if(n>=kf[i])e=i+1;else return!0;if(e==t)return!1}}function Aa(n){return n>=127462&&n<=127487}const Ma=8205;function lm(n,e,t=!0,i=!0){return(t?wf:am)(n,e,i)}function wf(n,e,t){if(e==n.length)return e;e&&Pf(n.charCodeAt(e))&&$f(n.charCodeAt(e-1))&&e--;let i=Cs(n,e);for(e+=La(i);e<n.length;){let r=Cs(n,e);if(i==Ma||r==Ma||t&&om(r))e+=La(r),i=r;else if(Aa(r)){let s=0,o=e-2;for(;o>=0&&Aa(Cs(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function am(n,e,t){for(;e>0;){let i=wf(n,e-2,t);if(i<e)return i;e--}return 0}function Cs(n,e){let t=n.charCodeAt(e);if(!$f(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Pf(i)?(t-55296<<10)+(i-56320)+65536:t}function Pf(n){return n>=56320&&n<57344}function $f(n){return n>=55296&&n<56320}function La(n){return n<65536?1:2}class Y{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=$i(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),nt.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=$i(this,e,t);let i=[];return this.decompose(e,t,i,0),nt.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new sn(this),s=new sn(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new sn(this,e)}iterRange(e,t=this.length){return new vf(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Cf(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Y.empty:e.length<=32?new ne(e):nt.from(ne.split(e,[]))}}class ne extends Y{constructor(e,t=hm(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?i:l)>=e)return new cm(r,l,i,o);r=l+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new ne(qa(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=Qr(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new ne(l,o.length+s.length));else{let a=l.length>>1;i.push(new ne(l.slice(0,a)),new ne(l.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof ne))return super.replace(e,t,i);[e,t]=$i(this,e,t);let r=Qr(this.text,Qr(i.text,qa(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new ne(r,s):nt.from(ne.split(r,[]),s)}sliceString(e,t=this.length,i=`
2
2
  `){[e,t]=$i(this,e,t);let r="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=i),e<a&&t>s&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(t.push(new ne(i,r)),i=[],r=-1);return r>-1&&t.push(new ne(i,r)),t}}class nt extends Y{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,r);r=l+1,i=a+1}}decompose(e,t,i,r){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&t>=o){let h=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=$i(this,e,t),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&t<=l){let a=o.replace(e-s,t-s,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[r]=a,new nt(c,this.length-(t-e)+i.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
3
3
  `){[e,t]=$i(this,e,t);let r="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=i),e<a&&t>o&&(r+=l.sliceString(e-o,t-o,i)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof nt))return 0;let i=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return i;let a=this.children[r],h=e.children[s];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let O of e)O.flatten(d);return new ne(d,t)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],a=0,h=-1,c=[];function f(d){let O;if(d.lines>s&&d instanceof nt)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof ne&&a&&(O=c[c.length-1])instanceof ne&&d.lines+O.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new ne(O.text.concat(d.text),O.length+1+d.length)):(a+d.lines>r&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:nt.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new nt(l,t)}}Y.empty=new ne([""],0);function hm(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Qr(n,e,t=0,i=1e9){for(let r=0,s=0,o=!0;s<n.length&&r<=i;s++){let l=n[s],a=r+l.length;a>=t&&(a>i&&(l=l.slice(0,i-r)),r<t&&(l=l.slice(t-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function qa(n,e,t){return Qr(n,[""],e,t)}class sn{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof ne?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof ne?r.text.length:r.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
4
4
  `,this;e--}else if(r instanceof ne){let a=r.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof ne?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class vf{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new sn(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Cf{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Y.prototype[Symbol.iterator]=function(){return this.iter()},sn.prototype[Symbol.iterator]=vf.prototype[Symbol.iterator]=Cf.prototype[Symbol.iterator]=function(){return this});let cm=class{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}};function $i(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function pe(n,e,t=!0,i=!0){return lm(n,e,t,i)}function fm(n){return n>=56320&&n<57344}function um(n){return n>=55296&&n<56320}function ve(n,e){let t=n.charCodeAt(e);if(!um(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return fm(i)?(t-55296<<10)+(i-56320)+65536:t}function Zl(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function rt(n){return n<65536?1:2}const go=/\r\n?|\n/;var Oe=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(Oe||(Oe={}));class ht{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,r=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(i,r,s),r+=s):r+=o,i+=s}}iterChangedRanges(e,t=!1){bo(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];r<0?e.push(i,r):e.push(r,i)}return new ht(e)}composeDesc(e){return this.empty?e:e.empty?this:Zf(this,e)}mapDesc(e,t=!1){return e.empty?this:So(this,e,t)}mapPos(e,t=-1,i=Oe.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=r+l;if(a<0){if(h>e)return s+(e-r);s+=l}else{if(i!=Oe.Simple&&h>=e&&(i==Oe.TrackDel&&r<e&&h>e||i==Oe.TrackBefore&&r<e||i==Oe.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let i=0,r=0;i<this.sections.length&&r<=t;){let s=this.sections[i++],o=this.sections[i++],l=r+s;if(o>=0&&r<=t&&l>=e)return r<e&&l>t?"cover":!0;r=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ht(e)}static create(e){return new ht(e)}}class le extends ht{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return bo(this,(t,i,r,s,o)=>e=e.replace(r,r+(i-t),o),!1),e}mapDesc(e,t=!1){return So(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,s=0;r<t.length;r+=2){let o=t[r],l=t[r+1];if(l>=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;i.length<a;)i.push(Y.empty);i.push(o?e.slice(s,s+o):Y.empty)}s+=o}return new le(t,i)}compose(e){return this.empty?e:e.empty?this:Zf(this,e,!0)}map(e,t=!1){return e.empty?this:So(this,e,t,!0)}iterChanges(e,t=!1){bo(this,e,t)}get desc(){return ht.create(this.sections)}filter(e){let t=[],i=[],r=[],s=new pn(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let c=Math.min(s.len,a-l);me(r,c,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;me(t,c,f),f>0&&qt(i,t,s.text),s.forward(c),l+=c}let h=e[o++];for(;l<h;){if(s.done)break e;let c=Math.min(s.len,h-l);me(t,c,-1),me(r,c,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(c),l+=c}}return{changes:new le(t,i),filtered:ht.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],r=this.sections[t+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let r=[],s=[],o=0,l=null;function a(c=!1){if(!c&&!r.length)return;o<t&&me(r,t-o,-1);let f=new le(r,s);l=l?l.compose(f.map(l)):f,r=[],s=[],o=0}function h(c){if(Array.isArray(c))for(let f of c)h(f);else if(c instanceof le){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:f,to:u=f,insert:d}=c;if(f>u||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let O=d?typeof d=="string"?Y.of(d.split(i||go)):d:Y.empty,g=O.length;if(f==u&&g==0)return;f<o&&a(),f>o&&me(r,f-o,-1),me(r,u-f,g),qt(s,r,O),o=u}}return h(e),a(!l),l}static empty(e){return new le(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length<r;)i.push(Y.empty);i[r]=Y.of(s.slice(1)),t.push(s[0],i[r].length)}}}return new le(t,i)}static createSet(e,t){return new le(e,t)}}function me(n,e,t,i=!1){if(e==0&&t<=0)return;let r=n.length-2;r>=0&&t<=0&&t==n[r+1]?n[r]+=e:r>=0&&e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function qt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(Y.empty);n.push(t)}}function bo(n,e,t){let i=n.inserted;for(let r=0,s=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)r+=l,s+=l;else{let h=r,c=s,f=Y.empty;for(;h+=l,c+=a,a&&i&&(f=f.append(i[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(r,h,s,c,f),r=h,s=c}}}function So(n,e,t,i=!1){let r=[],s=i?[]:null,o=new pn(n),l=new pn(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);me(r,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let h=l.len;for(me(r,l.ins,-1);h;){let c=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=c&&(me(r,0,o.ins),s&&qt(s,r,o.text),a=o.i),o.forward(c),h-=c}l.next()}else if(o.ins>=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;me(r,h,a<o.i?o.ins:0),s&&a<o.i&&qt(s,r,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return s?le.createSet(r,s):ht.create(r);throw new Error("Mismatched change set lengths")}}}function Zf(n,e,t=!1){let i=[],r=t?[]:null,s=new pn(n),o=new pn(e);for(let l=!1;;){if(s.done&&o.done)return r?le.createSet(i,r):ht.create(i);if(s.ins==0)me(i,s.len,0,l),s.next();else if(o.len==0&&!o.done)me(i,0,o.ins,l),r&&qt(r,i,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),h=i.length;if(s.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;me(i,a,c,l),r&&c&&qt(r,i,o.text)}else o.ins==-1?(me(i,s.off?0:s.len,a,l),r&&qt(r,i,s.textBit(a))):(me(i,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&qt(r,i,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),s.forward2(a),o.forward(a)}}}}class pn{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Y.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Y.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Kt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new Kt(i,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Q.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Q.range(this.anchor,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Q.range(e.anchor,e.head)}static create(e,t,i){return new Kt(e,t,i)}}class Q{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Q.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Q([this.main],0)}addRange(e,t=!0){return Q.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,Q.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Q(e.ranges.map(t=>Kt.fromJSON(t)),e.main)}static single(e,t=e){return new Q([Q.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return Q.normalized(e.slice(),t);i=s.to}return new Q(e,t)}static cursor(e,t=0,i,r){return Kt.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(r??16777215)<<6)}static range(e,t,i,r){let s=(i??16777215)<<6|(r==null?7:Math.min(6,r));return t<e?Kt.create(t,e,48|s):Kt.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let i=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=t&&t--,e.splice(--r,2,s.anchor>s.head?Q.range(a,l):Q.range(l,a))}}return new Q(e,t)}}function Tf(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Tl=0;class Z{constructor(e,t,i,r,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=Tl++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Z(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Xl),!!e.static,e.enables)}of(e){return new yr([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new yr(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new yr(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Xl(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class yr{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=Tl++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Qo(f,c)){let d=i(f);if(l?!Ea(d,f.values[o],r):!r(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,O=u.config.address[s];if(O!=null){let g=qr(u,O);if(this.dependencies.every(p=>p instanceof Z?u.facet(p)===f.facet(p):p instanceof ce?u.field(p,!1)==f.field(p,!1):!0)||(l?Ea(d=i(f),g,r):r(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}}function Ea(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function Qo(n,e){let t=!1;for(let i of e)on(n,i)&1&&(t=!0);return t}function dm(n,e,t){let i=t.map(a=>n[a.id]),r=t.map(a=>a.type),s=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;c<i.length;c++){let f=qr(a,i[c]);if(r[c]==2)for(let u of f)h.push(u);else h.push(f)}return e.combine(h)}return{create(a){for(let h of i)on(a,h);return a.values[o]=l(a),1},update(a,h){if(!Qo(a,s))return 0;let c=l(a);return e.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=Qo(a,i),f=h.config.facets[e.id],u=h.facet(e);if(f&&!c&&Xl(t,f))return a.values[o]=u,0;let d=l(a);return e.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}const Va=Z.define({static:!0});class ce{constructor(e,t,i,r,s){this.id=e,this.createF=t,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let t=new ce(Tl++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Va).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let s=i.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[t]=o,1)},reconfigure:(i,r)=>r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Va.of({field:this,create:e})]}get extension(){return this}}const Gt={lowest:4,low:3,default:2,high:1,highest:0};function ji(n){return e=>new Xf(e,n)}const Zt={highest:ji(Gt.highest),high:ji(Gt.high),default:ji(Gt.default),low:ji(Gt.low),lowest:ji(Gt.lowest)};class Xf{constructor(e,t){this.inner=e,this.prec=t}}class us{of(e){return new yo(this,e)}reconfigure(e){return us.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class yo{constructor(e,t){this.compartment=e,this.inner=t}}class Lr{constructor(e,t,i,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let r=[],s=Object.create(null),o=new Map;for(let u of Om(e,t,o))u instanceof ce?r.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of r)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in s){let d=s[u],O=d[0].facet,g=c&&c[u]||[];if(d.every(p=>p.type==0))if(l[O.id]=a.length<<1|1,Xl(g,d))a.push(i.facet(O));else{let p=O.combine(d.map(b=>b.value));a.push(i&&O.compare(p,i.facet(O))?i.facet(O):p)}else{for(let p of d)p.type==0?(l[p.id]=a.length<<1|1,a.push(p.value)):(l[p.id]=h.length<<1,h.push(b=>p.dynamicSlot(b)));l[O.id]=h.length<<1,h.push(p=>dm(p,O,d))}}let f=h.map(u=>u(l));return new Lr(e,o,f,l,a,s)}}function Om(n,e,t){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof yo&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let h of o)s(h,l);else if(o instanceof yo){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),s(h,l)}else if(o instanceof Xf)s(o.inner,o.prec);else if(o instanceof ce)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof yr)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,Gt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,l)}}return s(n,Gt.default),i.reduce((o,l)=>o.concat(l))}function on(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function qr(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const Rf=Z.define(),xo=Z.define({combine:n=>n.some(e=>e),static:!0}),Af=Z.define({combine:n=>n.length?n[0]:void 0,static:!0}),Mf=Z.define(),Lf=Z.define(),qf=Z.define(),Ef=Z.define({combine:n=>n.length?n[0]:!1});class Tt{constructor(e,t){this.type=e,this.value=t}static define(){return new pm}}class pm{of(e){return new Tt(this,e)}}class mm{constructor(e){this.map=e}of(e){return new q(this,e)}}class q{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new q(this.type,t)}is(e){return this.type==e}static define(e={}){return new mm(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(t);s&&i.push(s)}return i}}q.reconfigure=q.define();q.appendConfig=q.define();class oe{constructor(e,t,i,r,s,o){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Tf(i,t.newLength),s.some(l=>l.type==oe.time)||(this.annotations=s.concat(oe.time.of(Date.now())))}static create(e,t,i,r,s,o){return new oe(e,t,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(oe.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}oe.time=Tt.define();oe.userEvent=Tt.define();oe.addToHistory=Tt.define();oe.remote=Tt.define();function gm(n,e){let t=[];for(let i=0,r=0;;){let s,o;if(i<n.length&&(r==e.length||e[r]>=n[i]))s=n[i++],o=n[i++];else if(r<e.length)s=e[r++],o=e[r++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function Vf(n,e,t){var i;let r,s,o;return t?(r=e.changes,s=le.empty(e.changes.length),o=n.changes.compose(e.changes)):(r=e.changes.map(n.changes),s=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(i=n.selection)===null||i===void 0?void 0:i.map(r),effects:q.mapEffects(n.effects,r).concat(q.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function ko(n,e,t){let i=e.selection,r=Si(e.annotations);return e.userEvent&&(r=r.concat(oe.userEvent.of(e.userEvent))),{changes:e.changes instanceof le?e.changes:le.of(e.changes||[],t,n.facet(Af)),selection:i&&(i instanceof Q?i:Q.single(i.anchor,i.head)),effects:Si(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function Df(n,e,t){let i=ko(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;i=Vf(i,ko(n,e[s],o?i.changes.newLength:n.doc.length),o)}let r=oe.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return Sm(t?bm(r):r)}function bm(n){let e=n.startState,t=!0;for(let r of e.facet(Mf)){let s=r(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:gm(t,s))}if(t!==!0){let r,s;if(t===!1)s=n.changes.invertedDesc,r=le.empty(e.doc.length);else{let o=n.changes.filter(t);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}n=oe.create(e,r,n.selection&&n.selection.map(s),q.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let i=e.facet(Lf);for(let r=i.length-1;r>=0;r--){let s=i[r](n);s instanceof oe?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof oe?n=s[0]:n=Df(e,Si(s),!1)}return n}function Sm(n){let e=n.startState,t=e.facet(qf),i=n;for(let r=t.length-1;r>=0;r--){let s=t[r](n);s&&Object.keys(s).length&&(i=Vf(i,ko(e,s,n.changes.newLength),!0))}return i==n?n:oe.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const Qm=[];function Si(n){return n==null?Qm:Array.isArray(n)?n:[n]}var ie=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(ie||(ie={}));const ym=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let wo;try{wo=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function xm(n){if(wo)return wo.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||ym.test(t)))return!0}return!1}function km(n){return e=>{if(!/\S/.test(e))return ie.Space;if(xm(e))return ie.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return ie.Word;return ie.Other}}class W{constructor(e,t,i,r,s,o){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)on(this,l<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return on(this,i),qr(this,i)}update(...e){return Df(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:r}=t;for(let l of e.effects)l.is(us.reconfigure)?(t&&(r=new Map,t.compartments.forEach((a,h)=>r.set(h,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(q.reconfigure)?(t=null,i=l.value):l.is(q.appendConfig)&&(t=null,i=Si(i).concat(l.value));let s;t?s=e.startState.values.slice():(t=Lr.resolve(i,r,this),s=new W(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(xo)?e.newSelection:e.newSelection.asSingle();new W(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Q.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),s=[i.range],o=Si(i.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),h=this.changes(a.changes),c=h.map(r);for(let u=0;u<l;u++)s[u]=s[u].map(c);let f=r.mapDesc(h,!0);s.push(a.range.map(f)),r=r.compose(c),o=q.mapEffects(o,c).concat(q.mapEffects(Si(a.effects),f))}return{changes:r,selection:Q.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof le?e:le.of(e,this.doc.length,this.facet(W.lineSeparator))}toText(e){return Y.of(e.split(this.facet(W.lineSeparator)||go))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(on(this,t),qr(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof ce&&this.config.address[r.id]!=null&&(t[i]=r.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let o=i[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return W.create({doc:e.doc,selection:Q.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Lr.resolve(e.extensions||[],new Map),i=e.doc instanceof Y?e.doc:Y.of((e.doc||"").split(t.staticFacet(W.lineSeparator)||go)),r=e.selection?e.selection instanceof Q?e.selection:Q.single(e.selection.anchor,e.selection.head):Q.single(0);return Tf(r,i.length),t.staticFacet(xo)||(r=r.asSingle()),new W(t,i,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(W.tabSize)}get lineBreak(){return this.facet(W.lineSeparator)||`
@@ -1 +1 @@
1
- import{S as tt,i as et,s as nt,I as R,m as lt,a as st,b as at,e as c,t as W,c as _,d as L,f as b,g as T,h as e,j as y,l as A,k as ot,n as E,o as it,p as k,q as rt,r as U,u as I,v as Z,w as ut,x as X,y as ct,z as ft,A as pt,B as dt,C as O,D as v,E as mt}from"./index-D6QIwXwq.js";function Y(i){let t,r,g,a,h,u,n,f,p,$,d,C;return r=new R({props:{path:pt,class:"w-4 h-4"}}),n=new R({props:{path:dt,class:"w-4 h-4"}}),{c(){t=c("button"),L(r.$$.fragment),g=_(),a=c("span"),a.textContent="Rename",h=_(),u=c("button"),L(n.$$.fragment),f=_(),p=c("span"),p.textContent="Delete this Folder",b(t,"data-button",""),b(u,"data-button","")},m(l,m){T(l,t,m),y(r,t,null),e(t,g),e(t,a),T(l,h,m),T(l,u,m),y(n,u,null),e(u,f),e(u,p),$=!0,d||(C=[A(t,"click",i[5]),A(u,"click",i[6])],d=!0)},i(l){$||(E(r.$$.fragment,l),E(n.$$.fragment,l),$=!0)},o(l){k(r.$$.fragment,l),k(n.$$.fragment,l),$=!1},d(l){l&&(U(t),U(h),U(u)),I(r),I(n),d=!1,Z(C)}}}function _t(i){var G,H,J;let t,r,g,a=((G=i[1])!=null&&G.fullpath?(H=i[1])==null?void 0:H.fullpath:"/")+"",h,u,n,f,p,$,d,C,l,m,S,q,j,F,w,z,x,B,D,M,N;p=new R({props:{path:lt,class:"w4 h-4"}}),m=new R({props:{path:st,class:"w4 h-4"}}),w=new R({props:{path:at,class:"w4 h-4"}});let s=((J=i[1])==null?void 0:J.fullpath)&&Y(i);return{c(){t=c("div"),r=c("h2"),g=W("Actions for the directory "),h=W(a),u=_(),n=c("div"),f=c("button"),L(p.$$.fragment),$=_(),d=c("span"),d.textContent="Create a new Folder",C=_(),l=c("button"),L(m.$$.fragment),S=_(),q=c("span"),q.textContent="Create a new File",j=_(),F=c("button"),L(w.$$.fragment),z=_(),x=c("span"),x.textContent="Upload Files",B=_(),s&&s.c(),b(r,"class","sr-only"),b(f,"data-button",""),b(l,"data-button",""),b(F,"data-button",""),b(n,"class","flex flex-col w-60 space-y-2"),b(t,"class","flex-1 px-2 py-2"),b(t,"tabindex","-1")},m(o,P){T(o,t,P),e(t,r),e(r,g),e(r,h),e(t,u),e(t,n),e(n,f),y(p,f,null),e(f,$),e(f,d),e(n,C),e(n,l),y(m,l,null),e(l,S),e(l,q),e(n,j),e(n,F),y(w,F,null),e(F,z),e(F,x),e(n,B),s&&s.m(n,null),i[7](t),D=!0,M||(N=[A(f,"click",i[2]),A(l,"click",i[3]),A(F,"click",i[4])],M=!0)},p(o,[P]){var K,Q,V;(!D||P&2)&&a!==(a=((K=o[1])!=null&&K.fullpath?(Q=o[1])==null?void 0:Q.fullpath:"/")+"")&&ot(h,a),(V=o[1])!=null&&V.fullpath?s?P&2&&E(s,1):(s=Y(o),s.c(),E(s,1),s.m(n,null)):s&&(it(),k(s,1,1,()=>{s=null}),rt())},i(o){D||(E(p.$$.fragment,o),E(m.$$.fragment,o),E(w.$$.fragment,o),E(s),D=!0)},o(o){k(p.$$.fragment,o),k(m.$$.fragment,o),k(w.$$.fragment,o),k(s),D=!1},d(o){o&&U(t),I(p),I(m),I(w),s&&s.d(),i[7](null),M=!1,Z(N)}}}function ht(i,t,r){let g;ut(i,X,d=>r(1,g=d));let a=null;ct(()=>{a&&a.focus()}),ft(X.subscribe(()=>{a&&a.focus()}));const h=()=>{O.set(v.FOLDER_CREATE)},u=()=>{O.set(v.FILE_CREATE)},n=()=>{O.set(v.FILE_UPLOAD)},f=()=>{O.set(v.FOLDER_RENAME)},p=()=>{O.set(v.FOLDER_DELETE)};function $(d){mt[d?"unshift":"push"](()=>{a=d,r(0,a)})}return[a,g,h,u,n,f,p,$]}class bt extends tt{constructor(t){super(),et(this,t,ht,_t,nt,{})}}export{bt as default};
1
+ import{S as tt,i as et,s as nt,I as R,m as lt,a as st,b as at,e as c,t as W,c as _,d as L,f as b,g as T,h as e,j as y,l as A,k as ot,n as E,o as it,p as k,q as rt,r as U,u as I,v as Z,w as ut,x as X,y as ct,z as ft,A as pt,B as dt,C as O,D as v,E as mt}from"./index-DAdhbT7C.js";function Y(i){let t,r,g,a,h,u,n,f,p,$,d,C;return r=new R({props:{path:pt,class:"w-4 h-4"}}),n=new R({props:{path:dt,class:"w-4 h-4"}}),{c(){t=c("button"),L(r.$$.fragment),g=_(),a=c("span"),a.textContent="Rename",h=_(),u=c("button"),L(n.$$.fragment),f=_(),p=c("span"),p.textContent="Delete this Folder",b(t,"data-button",""),b(u,"data-button","")},m(l,m){T(l,t,m),y(r,t,null),e(t,g),e(t,a),T(l,h,m),T(l,u,m),y(n,u,null),e(u,f),e(u,p),$=!0,d||(C=[A(t,"click",i[5]),A(u,"click",i[6])],d=!0)},i(l){$||(E(r.$$.fragment,l),E(n.$$.fragment,l),$=!0)},o(l){k(r.$$.fragment,l),k(n.$$.fragment,l),$=!1},d(l){l&&(U(t),U(h),U(u)),I(r),I(n),d=!1,Z(C)}}}function _t(i){var G,H,J;let t,r,g,a=((G=i[1])!=null&&G.fullpath?(H=i[1])==null?void 0:H.fullpath:"/")+"",h,u,n,f,p,$,d,C,l,m,S,q,j,F,w,z,x,B,D,M,N;p=new R({props:{path:lt,class:"w4 h-4"}}),m=new R({props:{path:st,class:"w4 h-4"}}),w=new R({props:{path:at,class:"w4 h-4"}});let s=((J=i[1])==null?void 0:J.fullpath)&&Y(i);return{c(){t=c("div"),r=c("h2"),g=W("Actions for the directory "),h=W(a),u=_(),n=c("div"),f=c("button"),L(p.$$.fragment),$=_(),d=c("span"),d.textContent="Create a new Folder",C=_(),l=c("button"),L(m.$$.fragment),S=_(),q=c("span"),q.textContent="Create a new File",j=_(),F=c("button"),L(w.$$.fragment),z=_(),x=c("span"),x.textContent="Upload Files",B=_(),s&&s.c(),b(r,"class","sr-only"),b(f,"data-button",""),b(l,"data-button",""),b(F,"data-button",""),b(n,"class","flex flex-col w-60 space-y-2"),b(t,"class","flex-1 px-2 py-2"),b(t,"tabindex","-1")},m(o,P){T(o,t,P),e(t,r),e(r,g),e(r,h),e(t,u),e(t,n),e(n,f),y(p,f,null),e(f,$),e(f,d),e(n,C),e(n,l),y(m,l,null),e(l,S),e(l,q),e(n,j),e(n,F),y(w,F,null),e(F,z),e(F,x),e(n,B),s&&s.m(n,null),i[7](t),D=!0,M||(N=[A(f,"click",i[2]),A(l,"click",i[3]),A(F,"click",i[4])],M=!0)},p(o,[P]){var K,Q,V;(!D||P&2)&&a!==(a=((K=o[1])!=null&&K.fullpath?(Q=o[1])==null?void 0:Q.fullpath:"/")+"")&&ot(h,a),(V=o[1])!=null&&V.fullpath?s?P&2&&E(s,1):(s=Y(o),s.c(),E(s,1),s.m(n,null)):s&&(it(),k(s,1,1,()=>{s=null}),rt())},i(o){D||(E(p.$$.fragment,o),E(m.$$.fragment,o),E(w.$$.fragment,o),E(s),D=!0)},o(o){k(p.$$.fragment,o),k(m.$$.fragment,o),k(w.$$.fragment,o),k(s),D=!1},d(o){o&&U(t),I(p),I(m),I(w),s&&s.d(),i[7](null),M=!1,Z(N)}}}function ht(i,t,r){let g;ut(i,X,d=>r(1,g=d));let a=null;ct(()=>{a&&a.focus()}),ft(X.subscribe(()=>{a&&a.focus()}));const h=()=>{O.set(v.FOLDER_CREATE)},u=()=>{O.set(v.FILE_CREATE)},n=()=>{O.set(v.FILE_UPLOAD)},f=()=>{O.set(v.FOLDER_RENAME)},p=()=>{O.set(v.FOLDER_DELETE)};function $(d){mt[d?"unshift":"push"](()=>{a=d,r(0,a)})}return[a,g,h,u,n,f,p,$]}class bt extends tt{constructor(t){super(),et(this,t,ht,_t,nt,{})}}export{bt as default};
@@ -1 +1 @@
1
- import{S as _,i as h,s as b,e as p,f as a,g as m,G as c,r as d,w as u,x as g,L as v,bn as f}from"./index-D6QIwXwq.js";function o(n){let r,e;return{c(){r=p("img"),f(r.src,e="/api/branches/"+n[0].id+"/files/"+n[1].fullpath)||a(r,"src",e),a(r,"alt","")},m(s,l){m(s,r,l)},p(s,l){l&3&&!f(r.src,e="/api/branches/"+s[0].id+"/files/"+s[1].fullpath)&&a(r,"src",e)},d(s){s&&d(r)}}}function B(n){let r,e=n[0]!==null&&n[1]&&o(n);return{c(){r=p("div"),e&&e.c(),a(r,"class","overflow-auto")},m(s,l){m(s,r,l),e&&e.m(r,null)},p(s,[l]){s[0]!==null&&s[1]?e?e.p(s,l):(e=o(s),e.c(),e.m(r,null)):e&&(e.d(1),e=null)},i:c,o:c,d(s){s&&d(r),e&&e.d()}}}function k(n,r,e){let s,l;u(n,g,i=>e(1,l=i));const t=v();return u(n,t,i=>e(0,s=i)),[s,l,t]}class w extends _{constructor(r){super(),h(this,r,k,B,b,{})}}export{w as default};
1
+ import{S as _,i as h,s as b,e as p,f as a,g as m,G as c,r as d,w as u,x as g,L as v,bn as f}from"./index-DAdhbT7C.js";function o(n){let r,e;return{c(){r=p("img"),f(r.src,e="/api/branches/"+n[0].id+"/files/"+n[1].fullpath)||a(r,"src",e),a(r,"alt","")},m(s,l){m(s,r,l)},p(s,l){l&3&&!f(r.src,e="/api/branches/"+s[0].id+"/files/"+s[1].fullpath)&&a(r,"src",e)},d(s){s&&d(r)}}}function B(n){let r,e=n[0]!==null&&n[1]&&o(n);return{c(){r=p("div"),e&&e.c(),a(r,"class","overflow-auto")},m(s,l){m(s,r,l),e&&e.m(r,null)},p(s,[l]){s[0]!==null&&s[1]?e?e.p(s,l):(e=o(s),e.c(),e.m(r,null)):e&&(e.d(1),e=null)},i:c,o:c,d(s){s&&d(r),e&&e.d()}}}function k(n,r,e){let s,l;u(n,g,i=>e(1,l=i));const t=v();return u(n,t,i=>e(0,s=i)),[s,l,t]}class w extends _{constructor(r){super(),h(this,r,k,B,b,{})}}export{w as default};