chainlit 0.4.1__py3-none-any.whl → 0.4.2__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 chainlit might be problematic. Click here for more details.

@@ -0,0 +1,23 @@
1
+ from fastapi import HTTPException, Request
2
+
3
+ from chainlit.config import config
4
+ from chainlit.client.base import BaseClient
5
+ from chainlit.client.local import LocalClient
6
+ from chainlit.client.cloud import CloudClient
7
+
8
+
9
+ async def get_client(request: Request) -> BaseClient:
10
+ auth_header = request.headers.get("Authorization")
11
+
12
+ db = config.project.database
13
+
14
+ if db == "local":
15
+ client = LocalClient()
16
+ elif db == "cloud":
17
+ client = CloudClient(config.project.id, auth_header)
18
+ elif db == "custom":
19
+ client = await config.code.client_factory()
20
+ else:
21
+ raise HTTPException(status_code=500, detail="Invalid database type")
22
+
23
+ return client
chainlit/config.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import Optional, Any, Callable, List, Dict, TYPE_CHECKING
1
+ from typing import Optional, Any, Callable, Literal, List, Dict, TYPE_CHECKING
2
2
  import os
3
3
  import sys
4
4
  import tomli
@@ -10,6 +10,7 @@ from chainlit.version import __version__
10
10
 
11
11
  if TYPE_CHECKING:
12
12
  from chainlit.action import Action
13
+ from chainlit.client.base import BaseClient
13
14
 
14
15
  PACKAGE_ROOT = os.path.dirname(__file__)
15
16
 
@@ -26,10 +27,15 @@ DEFAULT_CONFIG_STR = f"""[project]
26
27
  public = true
27
28
 
28
29
  # The project ID (found on https://cloud.chainlit.io).
29
- # If provided, all the message data will be stored in the cloud.
30
- # The project ID is required when public is set to false.
30
+ # The project ID is required when public is set to false or when using the cloud database.
31
31
  #id = ""
32
32
 
33
+ # Uncomment if you want to persist the chats.
34
+ # local will create a database in your .chainlit directory (requires node.js installed).
35
+ # cloud will use the Chainlit cloud database.
36
+ # custom will load use your custom client.
37
+ # database = "local"
38
+
33
39
  # Whether to enable telemetry (default: true). No personal data is collected.
34
40
  enable_telemetry = true
35
41
 
@@ -102,6 +108,7 @@ class CodeSettings:
102
108
  lc_postprocess: Optional[Callable[[Any], str]] = None
103
109
  lc_factory: Optional[Callable[[], Any]] = None
104
110
  lc_rename: Optional[Callable[[str], str]] = None
111
+ client_factory: Optional[Callable[[str], "BaseClient"]] = None
105
112
 
106
113
  def validate(self):
107
114
  requires_one_of = [
@@ -136,12 +143,18 @@ class ProjectSettings:
136
143
  id: Optional[str] = None
137
144
  # Whether the app is available to anonymous users or only to team members.
138
145
  public: bool = True
146
+ # Storage type
147
+ database: Optional[Literal["local", "cloud", "custom"]] = None
139
148
  # Whether to enable telemetry. No personal data is collected.
140
149
  enable_telemetry: bool = True
141
150
  # List of environment variables to be provided by each user to use the app. If empty, no environment variables will be asked to the user.
142
151
  user_env: List[str] = None
143
152
  # Path to the local langchain cache database
144
153
  lc_cache_path: str = None
154
+ # Path to the local chat db
155
+ local_db_path: str = None
156
+ # Path to the local file system
157
+ local_fs_path: str = None
145
158
 
146
159
 
147
160
  @dataclass()
@@ -203,10 +216,20 @@ def load_settings():
203
216
  )
204
217
 
205
218
  lc_cache_path = os.path.join(config_dir, ".langchain.db")
219
+ local_db_path = os.path.join(config_dir, "chat.db")
220
+ local_fs_path = os.path.join(config_dir, "chat_files")
221
+
222
+ os.environ[
223
+ "LOCAL_DB_PATH"
224
+ ] = f"file:{local_db_path}?socket_timeout=10&connection_limit=1"
206
225
 
207
226
  project_settings = ProjectSettings(
208
- lc_cache_path=lc_cache_path, **project_config
227
+ lc_cache_path=lc_cache_path,
228
+ local_db_path=local_db_path,
229
+ local_fs_path=local_fs_path,
230
+ **project_config,
209
231
  )
232
+
210
233
  ui_settings = UISettings(**ui_settings)
211
234
 
212
235
  if not project_settings.public and not project_settings.id:
chainlit/context.py ADDED
@@ -0,0 +1,29 @@
1
+ import contextvars
2
+ from typing import TYPE_CHECKING
3
+ from asyncio import AbstractEventLoop
4
+
5
+ if TYPE_CHECKING:
6
+ from chainlit.emitter import ChainlitEmitter
7
+
8
+
9
+ class ChainlitContextException(Exception):
10
+ def __init__(self, msg="Chainlit context not found", *args, **kwargs):
11
+ super().__init__(msg, *args, **kwargs)
12
+
13
+
14
+ emitter_var = contextvars.ContextVar("emitter")
15
+ loop_var = contextvars.ContextVar("loop")
16
+
17
+
18
+ def get_emitter() -> "ChainlitEmitter":
19
+ try:
20
+ return emitter_var.get()
21
+ except LookupError:
22
+ raise ChainlitContextException()
23
+
24
+
25
+ def get_loop() -> AbstractEventLoop:
26
+ try:
27
+ return loop_var.get()
28
+ except LookupError:
29
+ raise ChainlitContextException()
@@ -0,0 +1,35 @@
1
+ import os
2
+ from chainlit.logger import logger
3
+ from chainlit.config import config, PACKAGE_ROOT
4
+
5
+ SCHEMA_PATH = os.path.join(PACKAGE_ROOT, "db/prisma/schema.prisma")
6
+
7
+
8
+ def db_push():
9
+ from prisma.cli.prisma import run
10
+ import prisma
11
+ from importlib import reload
12
+
13
+ args = ["db", "push", f"--schema={SCHEMA_PATH}"]
14
+ env = {"LOCAL_DB_PATH": os.environ.get("LOCAL_DB_PATH")}
15
+ run(args, env=env)
16
+
17
+ # Without this the client will fail to initialize the first time.
18
+ reload(prisma)
19
+
20
+
21
+ def init_local_db():
22
+ use_local_db = config.project.database == "local"
23
+ if use_local_db:
24
+ if not os.path.exists(config.project.local_db_path):
25
+ db_push()
26
+
27
+
28
+ def migrate_local_db():
29
+ use_local_db = config.project.database == "local"
30
+ if use_local_db:
31
+ if os.path.exists(config.project.local_db_path):
32
+ db_push()
33
+ logger.info(f"Local db migrated")
34
+ else:
35
+ logger.info(f"Local db does not exist, skipping migration")
@@ -0,0 +1,48 @@
1
+ datasource db {
2
+ provider = "sqlite"
3
+ url = env("LOCAL_DB_PATH")
4
+ }
5
+
6
+ generator client {
7
+ provider = "prisma-client-py"
8
+ recursive_type_depth = 5
9
+ }
10
+
11
+ model Conversation {
12
+ id Int @id @default(autoincrement())
13
+ createdAt DateTime @default(now())
14
+ messages Message[]
15
+ elements Element[]
16
+ }
17
+
18
+ model Element {
19
+ id Int @id @default(autoincrement())
20
+ createdAt DateTime @default(now())
21
+ conversationId Int
22
+ conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
23
+ type String
24
+ url String
25
+ name String
26
+ display String
27
+ size String?
28
+ language String?
29
+ forIds String?
30
+ }
31
+
32
+ model Message {
33
+ id Int @id @default(autoincrement())
34
+ createdAt DateTime @default(now())
35
+ conversationId Int
36
+ conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
37
+ authorIsUser Boolean @default(false)
38
+ isError Boolean @default(false)
39
+ waitForAnswer Boolean @default(false)
40
+ indent Int @default(0)
41
+ author String
42
+ content String
43
+ humanFeedback Int @default(0)
44
+ language String?
45
+ prompt String?
46
+ // Sqlite does not support JSON
47
+ llmSettings String?
48
+ }
chainlit/element.py CHANGED
@@ -1,22 +1,27 @@
1
1
  from pydantic.dataclasses import dataclass
2
- from dataclasses_json import dataclass_json
3
- from typing import Dict, Union, Any
2
+ from typing import Dict, List, Union, Any
4
3
  import uuid
5
4
  import aiofiles
6
5
  from io import BytesIO
7
6
 
8
- from chainlit.emitter import get_emitter, BaseClient
7
+ from chainlit.context import get_emitter
8
+ from chainlit.client.base import BaseClient
9
9
  from chainlit.telemetry import trace_event
10
10
  from chainlit.types import ElementType, ElementDisplay, ElementSize
11
11
 
12
12
  type_to_mime = {
13
- "image": "binary/octet-stream",
13
+ "image": "image/png",
14
14
  "text": "text/plain",
15
15
  "pdf": "application/pdf",
16
16
  }
17
17
 
18
+ mime_to_ext = {
19
+ "image/png": "png",
20
+ "text/plain": "txt",
21
+ "application/pdf": "pdf",
22
+ }
23
+
18
24
 
19
- @dataclass_json
20
25
  @dataclass
21
26
  class Element:
22
27
  # Name of the element, this will be used to reference the element in the UI.
@@ -34,20 +39,35 @@ class Element:
34
39
  # The ID of the element. This is set automatically when the element is sent to the UI if cloud is enabled.
35
40
  id: int = None
36
41
  # The ID of the element if cloud is disabled.
37
- tempId: str = None
42
+ temp_id: str = None
38
43
  # The ID of the message this element is associated with.
39
- forId: str = None
44
+ for_ids: List[str] = None
40
45
 
41
46
  def __post_init__(self) -> None:
42
47
  trace_event(f"init {self.__class__.__name__}")
43
48
  self.emitter = get_emitter()
44
- if not self.emitter:
45
- raise RuntimeError("Element should be instantiated in a Chainlit context")
49
+ self.for_ids = []
50
+ self.temp_id = str(uuid.uuid4())
46
51
 
47
52
  if not self.url and not self.path and not self.content:
48
53
  raise ValueError("Must provide url, path or content to instantiate element")
49
54
 
50
- self.tempId = uuid.uuid4().hex
55
+ def to_dict(self) -> Dict:
56
+ _dict = {
57
+ "tempId": self.temp_id,
58
+ "type": self.type,
59
+ "url": self.url,
60
+ "name": self.name,
61
+ "display": self.display,
62
+ "size": getattr(self, "size", None),
63
+ "language": getattr(self, "language", None),
64
+ "forIds": getattr(self, "for_ids", None),
65
+ }
66
+
67
+ if self.id:
68
+ _dict["id"] = self.id
69
+
70
+ return _dict
51
71
 
52
72
  async def preprocess_content(self):
53
73
  pass
@@ -56,29 +76,15 @@ class Element:
56
76
  if self.path:
57
77
  async with aiofiles.open(self.path, "rb") as f:
58
78
  self.content = await f.read()
59
- await self.preprocess_content()
60
- elif self.content:
61
- await self.preprocess_content()
62
79
  else:
63
80
  raise ValueError("Must provide path or content to load element")
64
81
 
65
- async def persist(self, client: BaseClient, for_id: str = None):
66
- if not self.url and self.content:
82
+ async def persist(self, client: BaseClient):
83
+ if not self.url and self.content and not self.id:
67
84
  self.url = await client.upload_element(
68
85
  content=self.content, mime=type_to_mime[self.type]
69
86
  )
70
-
71
- size = getattr(self, "size", None)
72
- language = getattr(self, "language", None)
73
- element = await client.create_element(
74
- name=self.name,
75
- url=self.url,
76
- type=self.type,
77
- display=self.display,
78
- size=size,
79
- language=language,
80
- for_id=for_id,
81
- )
87
+ element = await client.upsert_element(self.to_dict())
82
88
  return element
83
89
 
84
90
  async def before_emit(self, element: Dict) -> Dict:
@@ -90,22 +96,34 @@ class Element:
90
96
  if not self.content and not self.url and self.path:
91
97
  await self.load()
92
98
 
93
- # Cloud is enabled, upload the element to S3
94
- if self.emitter.client and not self.id:
95
- element = await self.persist(self.emitter.client, for_id)
96
- self.id = element["id"]
99
+ await self.preprocess_content()
100
+
101
+ if for_id:
102
+ self.for_ids.append(for_id)
103
+
104
+ # We have a client, persist the element
105
+ if self.emitter.client:
106
+ element = await self.persist(self.emitter.client)
107
+ self.id = element and element.get("id")
97
108
 
98
109
  elif not self.url and not self.content:
99
110
  raise ValueError("Must provide url or content to send element")
100
111
 
101
112
  element = self.to_dict()
102
- if for_id:
103
- element["forId"] = for_id
113
+
114
+ element["content"] = self.content
104
115
 
105
116
  if self.emitter.emit and element:
106
- trace_event(f"send {self.__class__.__name__}")
107
- element = await self.before_emit(element)
108
- await self.emitter.emit("element", element)
117
+ if len(self.for_ids) > 1:
118
+ trace_event(f"update {self.__class__.__name__}")
119
+ await self.emitter.emit(
120
+ "update_element",
121
+ {"id": self.id or self.temp_id, "forIds": self.for_ids},
122
+ )
123
+ else:
124
+ trace_event(f"send {self.__class__.__name__}")
125
+ element = await self.before_emit(element)
126
+ await self.emitter.emit("element", element)
109
127
 
110
128
 
111
129
  @dataclass
@@ -187,8 +205,3 @@ class Pyplot(Element):
187
205
  self.content = image.getvalue()
188
206
 
189
207
  super().__post_init__()
190
-
191
- async def before_emit(self, element: Dict) -> Dict:
192
- # Prevent the figure from being serialized
193
- del element["figure"]
194
- return element
chainlit/emitter.py CHANGED
@@ -1,9 +1,8 @@
1
1
  from typing import Union, Dict
2
2
  from chainlit.session import Session
3
3
  from chainlit.types import AskSpec
4
- from chainlit.client import BaseClient
4
+ from chainlit.client.base import BaseClient
5
5
  from socketio.exceptions import TimeoutError
6
- import inspect
7
6
 
8
7
 
9
8
  class ChainlitEmitter:
@@ -129,31 +128,3 @@ class ChainlitEmitter:
129
128
  def send_token(self, id: Union[str, int], token: str):
130
129
  """Send a message token to the UI."""
131
130
  return self.emit("stream_token", {"id": id, "token": token})
132
-
133
-
134
- def get_emitter() -> Union[ChainlitEmitter, None]:
135
- """
136
- Get the Chainlit Emitter instance from the current call stack.
137
- This unusual approach is necessary because:
138
- - we need to get the right Emitter instance with the right websocket connection
139
- - to preserve a lean developer experience, we do not pass the Emitter instance to every function call
140
-
141
- What happens is that we set __chainlit_emitter__ in the local variables when we receive a websocket message.
142
- Then we can retrieve it from the call stack when we need it, even if the developer's code has no idea about it.
143
- """
144
- attr = "__chainlit_emitter__"
145
- candidates = [i[0].f_locals.get(attr) for i in inspect.stack()]
146
- emitter = None
147
- for candidate in candidates:
148
- if candidate:
149
- emitter = candidate
150
- break
151
-
152
- return emitter
153
-
154
-
155
- def get_emit_fn():
156
- emitter = get_emitter()
157
- if emitter:
158
- return emitter.emit
159
- return None
@@ -1,4 +1,4 @@
1
- import{c as me,g as Xc}from"./index-68c36c96.js";function Qc(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const i=Object.getOwnPropertyDescriptor(a,n);i&&Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Jc=tp,ep=Object.prototype.hasOwnProperty;function tp(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var a in r)ep.call(r,a)&&(e[a]=r[a])}return e}var yc=Tc,ki=Tc.prototype;ki.space=null;ki.normal={};ki.property={};function Tc(e,t,r){this.property=e,this.normal=t,r&&(this.space=r)}var eo=Jc,rp=yc,ap=np;function np(e){for(var t=e.length,r=[],a=[],n=-1,i,s;++n<t;)i=e[n],r.push(i.property),a.push(i.normal),s=i.space;return new rp(eo.apply(null,r),eo.apply(null,a),s)}var Oi=ip;function ip(e){return e.toLowerCase()}var vc=Ac,W=Ac.prototype;W.space=null;W.attribute=null;W.property=null;W.boolean=!1;W.booleanish=!1;W.overloadedBoolean=!1;W.number=!1;W.commaSeparated=!1;W.spaceSeparated=!1;W.commaOrSpaceSeparated=!1;W.mustUseProperty=!1;W.defined=!1;function Ac(e,t){this.property=e,this.attribute=t}var K={},op=0;K.boolean=re();K.booleanish=re();K.overloadedBoolean=re();K.number=re();K.spaceSeparated=re();K.commaSeparated=re();K.commaOrSpaceSeparated=re();function re(){return Math.pow(2,++op)}var Rc=vc,to=K,_c=Li;Li.prototype=new Rc;Li.prototype.defined=!0;var Ic=["boolean","booleanish","overloadedBoolean","number","commaSeparated","spaceSeparated","commaOrSpaceSeparated"],sp=Ic.length;function Li(e,t,r,a){var n=-1,i;for(ro(this,"space",a),Rc.call(this,e,t);++n<sp;)i=Ic[n],ro(this,i,(r&to[i])===to[i])}function ro(e,t,r){r&&(e[t]=r)}var ao=Oi,lp=yc,up=_c,de=dp;function dp(e){var t=e.space,r=e.mustUseProperty||[],a=e.attributes||{},n=e.properties,i=e.transform,s={},l={},u,c;for(u in n)c=new up(u,i(a,u),n[u],t),r.indexOf(u)!==-1&&(c.mustUseProperty=!0),s[u]=c,l[ao(u)]=u,l[ao(c.attribute)]=u;return new lp(s,l,t)}var cp=de,pp=cp({space:"xlink",transform:gp,properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}});function gp(e,t){return"xlink:"+t.slice(5).toLowerCase()}var bp=de,mp=bp({space:"xml",transform:fp,properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function fp(e,t){return"xml:"+t.slice(3).toLowerCase()}var Ep=hp;function hp(e,t){return t in e?e[t]:t}var Sp=Ep,Nc=yp;function yp(e,t){return Sp(e,t.toLowerCase())}var Tp=de,vp=Nc,Ap=Tp({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:vp,properties:{xmlns:null,xmlnsXLink:null}}),Di=K,Rp=de,H=Di.booleanish,j=Di.number,te=Di.spaceSeparated,_p=Rp({transform:Ip,properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:te,ariaCurrent:null,ariaDescribedBy:te,ariaDetails:null,ariaDisabled:H,ariaDropEffect:te,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:te,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:te,ariaLevel:j,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:te,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:te,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:H,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null}});function Ip(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}var oe=K,Np=de,wp=Nc,w=oe.boolean,Cp=oe.overloadedBoolean,se=oe.booleanish,D=oe.number,$=oe.spaceSeparated,ge=oe.commaSeparated,kp=Np({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:wp,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ge,acceptCharset:$,accessKey:$,action:null,allow:null,allowFullScreen:w,allowPaymentRequest:w,allowUserMedia:w,alt:null,as:null,async:w,autoCapitalize:null,autoComplete:$,autoFocus:w,autoPlay:w,capture:w,charSet:null,checked:w,cite:null,className:$,cols:D,colSpan:null,content:null,contentEditable:se,controls:w,controlsList:$,coords:D|ge,crossOrigin:null,data:null,dateTime:null,decoding:null,default:w,defer:w,dir:null,dirName:null,disabled:w,download:Cp,draggable:se,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:w,formTarget:null,headers:$,height:D,hidden:w,high:D,href:null,hrefLang:null,htmlFor:$,httpEquiv:$,id:null,imageSizes:null,imageSrcSet:ge,inputMode:null,integrity:null,is:null,isMap:w,itemId:null,itemProp:$,itemRef:$,itemScope:w,itemType:$,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:w,low:D,manifest:null,max:null,maxLength:D,media:null,method:null,min:null,minLength:D,multiple:w,muted:w,name:null,nonce:null,noModule:w,noValidate:w,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextMenu:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:w,optimum:D,pattern:null,ping:$,placeholder:null,playsInline:w,poster:null,preload:null,readOnly:w,referrerPolicy:null,rel:$,required:w,reversed:w,rows:D,rowSpan:D,sandbox:$,scope:null,scoped:w,seamless:w,selected:w,shape:null,size:D,sizes:null,slot:null,span:D,spellCheck:se,src:null,srcDoc:null,srcLang:null,srcSet:ge,start:D,step:null,style:null,tabIndex:D,target:null,title:null,translate:null,type:null,typeMustMatch:w,useMap:null,value:se,width:D,wrap:null,align:null,aLink:null,archive:$,axis:null,background:null,bgColor:null,border:D,borderColor:null,bottomMargin:D,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:w,declare:w,event:null,face:null,frame:null,frameBorder:null,hSpace:D,leftMargin:D,link:null,longDesc:null,lowSrc:null,marginHeight:D,marginWidth:D,noResize:w,noHref:w,noShade:w,noWrap:w,object:null,profile:null,prompt:null,rev:null,rightMargin:D,rules:null,scheme:null,scrolling:se,standby:null,summary:null,text:null,topMargin:D,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:w,disableRemotePlayback:w,prefix:null,property:null,results:D,security:null,unselectable:null}}),Op=ap,Lp=pp,Dp=mp,xp=Ap,Mp=_p,Fp=kp,Up=Op([Dp,Lp,xp,Mp,Fp]),Bp=Oi,Pp=_c,Gp=vc,xi="data",$p=zp,qp=/^data[-\w.:]+$/i,wc=/-[a-z]/g,Hp=/[A-Z]/g;function zp(e,t){var r=Bp(t),a=t,n=Gp;return r in e.normal?e.property[e.normal[r]]:(r.length>4&&r.slice(0,4)===xi&&qp.test(t)&&(t.charAt(4)==="-"?a=Vp(t):t=jp(t),n=Pp),new n(a,t))}function Vp(e){var t=e.slice(5).replace(wc,Yp);return xi+t.charAt(0).toUpperCase()+t.slice(1)}function jp(e){var t=e.slice(4);return wc.test(t)?e:(t=t.replace(Hp,Wp),t.charAt(0)!=="-"&&(t="-"+t),xi+t)}function Wp(e){return"-"+e.toLowerCase()}function Yp(e){return e.charAt(1).toUpperCase()}var Kp=Zp,no=/[#.]/g;function Zp(e,t){for(var r=e||"",a=t||"div",n={},i=0,s,l,u;i<r.length;)no.lastIndex=i,u=no.exec(r),s=r.slice(i,u?u.index:r.length),s&&(l?l==="#"?n.id=s:n.className?n.className.push(s):n.className=[s]:a=s,i+=s.length),u&&(l=u[0],i++);return{type:"element",tagName:a,properties:n,children:[]}}var Mi={};Mi.parse=Jp;Mi.stringify=eg;var io="",Xp=" ",Qp=/[ \t\n\r\f]+/g;function Jp(e){var t=String(e||io).trim();return t===io?[]:t.split(Qp)}function eg(e){return e.join(Xp).trim()}var Fi={};Fi.parse=tg;Fi.stringify=rg;var wi=",",oo=" ",le="";function tg(e){for(var t=[],r=String(e||le),a=r.indexOf(wi),n=0,i=!1,s;!i;)a===-1&&(a=r.length,i=!0),s=r.slice(n,a).trim(),(s||!i)&&t.push(s),n=a+1,a=r.indexOf(wi,n);return t}function rg(e,t){var r=t||{},a=r.padLeft===!1?le:oo,n=r.padRight?oo:le;return e[e.length-1]===le&&(e=e.concat(le)),e.join(n+wi+a).trim()}var ag=$p,so=Oi,ng=Kp,lo=Mi.parse,uo=Fi.parse,ig=sg,og={}.hasOwnProperty;function sg(e,t,r){var a=r?pg(r):null;return n;function n(s,l){var u=ng(s,t),c=Array.prototype.slice.call(arguments,2),d=u.tagName.toLowerCase(),b;if(u.tagName=a&&og.call(a,d)?a[d]:d,l&&lg(l,u)&&(c.unshift(l),l=null),l)for(b in l)i(u.properties,b,l[b]);return Cc(u.children,c),u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}function i(s,l,u){var c,d,b;u==null||u!==u||(c=ag(e,l),d=c.property,b=u,typeof b=="string"&&(c.spaceSeparated?b=lo(b):c.commaSeparated?b=uo(b):c.commaOrSpaceSeparated&&(b=lo(uo(b).join(" ")))),d==="style"&&typeof u!="string"&&(b=cg(b)),d==="className"&&s.className&&(b=s.className.concat(b)),s[d]=dg(c,d,b))}}function lg(e,t){return typeof e=="string"||"length"in e||ug(t.tagName,e)}function ug(e,t){var r=t.type;return e==="input"||!r||typeof r!="string"?!1:typeof t.children=="object"&&"length"in t.children?!0:(r=r.toLowerCase(),e==="button"?r!=="menu"&&r!=="submit"&&r!=="reset"&&r!=="button":"value"in t)}function Cc(e,t){var r,a;if(typeof t=="string"||typeof t=="number"){e.push({type:"text",value:String(t)});return}if(typeof t=="object"&&"length"in t){for(r=-1,a=t.length;++r<a;)Cc(e,t[r]);return}if(typeof t!="object"||!("type"in t))throw new Error("Expected node, nodes, or string, got `"+t+"`");e.push(t)}function dg(e,t,r){var a,n,i;if(typeof r!="object"||!("length"in r))return co(e,t,r);for(n=r.length,a=-1,i=[];++a<n;)i[a]=co(e,t,r[a]);return i}function co(e,t,r){var a=r;return e.number||e.positiveNumber?!isNaN(a)&&a!==""&&(a=Number(a)):(e.boolean||e.overloadedBoolean)&&typeof a=="string"&&(a===""||so(r)===so(t))&&(a=!0),a}function cg(e){var t=[],r;for(r in e)t.push([r,e[r]].join(": "));return t.join("; ")}function pg(e){for(var t=e.length,r=-1,a={},n;++r<t;)n=e[r],a[n.toLowerCase()]=n;return a}var gg=Up,bg=ig,kc=bg(gg,"div");kc.displayName="html";var mg=kc,fg=mg;const Eg="Æ",hg="&",Sg="Á",yg="Â",Tg="À",vg="Å",Ag="Ã",Rg="Ä",_g="©",Ig="Ç",Ng="Ð",wg="É",Cg="Ê",kg="È",Og="Ë",Lg=">",Dg="Í",xg="Î",Mg="Ì",Fg="Ï",Ug="<",Bg="Ñ",Pg="Ó",Gg="Ô",$g="Ò",qg="Ø",Hg="Õ",zg="Ö",Vg='"',jg="®",Wg="Þ",Yg="Ú",Kg="Û",Zg="Ù",Xg="Ü",Qg="Ý",Jg="á",eb="â",tb="´",rb="æ",ab="à",nb="&",ib="å",ob="ã",sb="ä",lb="¦",ub="ç",db="¸",cb="¢",pb="©",gb="¤",bb="°",mb="÷",fb="é",Eb="ê",hb="è",Sb="ð",yb="ë",Tb="½",vb="¼",Ab="¾",Rb=">",_b="í",Ib="î",Nb="¡",wb="ì",Cb="¿",kb="ï",Ob="«",Lb="<",Db="¯",xb="µ",Mb="·",Fb=" ",Ub="¬",Bb="ñ",Pb="ó",Gb="ô",$b="ò",qb="ª",Hb="º",zb="ø",Vb="õ",jb="ö",Wb="¶",Yb="±",Kb="£",Zb='"',Xb="»",Qb="®",Jb="§",em="­",tm="¹",rm="²",am="³",nm="ß",im="þ",om="×",sm="ú",lm="û",um="ù",dm="¨",cm="ü",pm="ý",gm="¥",bm="ÿ",mm={AElig:Eg,AMP:hg,Aacute:Sg,Acirc:yg,Agrave:Tg,Aring:vg,Atilde:Ag,Auml:Rg,COPY:_g,Ccedil:Ig,ETH:Ng,Eacute:wg,Ecirc:Cg,Egrave:kg,Euml:Og,GT:Lg,Iacute:Dg,Icirc:xg,Igrave:Mg,Iuml:Fg,LT:Ug,Ntilde:Bg,Oacute:Pg,Ocirc:Gg,Ograve:$g,Oslash:qg,Otilde:Hg,Ouml:zg,QUOT:Vg,REG:jg,THORN:Wg,Uacute:Yg,Ucirc:Kg,Ugrave:Zg,Uuml:Xg,Yacute:Qg,aacute:Jg,acirc:eb,acute:tb,aelig:rb,agrave:ab,amp:nb,aring:ib,atilde:ob,auml:sb,brvbar:lb,ccedil:ub,cedil:db,cent:cb,copy:pb,curren:gb,deg:bb,divide:mb,eacute:fb,ecirc:Eb,egrave:hb,eth:Sb,euml:yb,frac12:Tb,frac14:vb,frac34:Ab,gt:Rb,iacute:_b,icirc:Ib,iexcl:Nb,igrave:wb,iquest:Cb,iuml:kb,laquo:Ob,lt:Lb,macr:Db,micro:xb,middot:Mb,nbsp:Fb,not:Ub,ntilde:Bb,oacute:Pb,ocirc:Gb,ograve:$b,ordf:qb,ordm:Hb,oslash:zb,otilde:Vb,ouml:jb,para:Wb,plusmn:Yb,pound:Kb,quot:Zb,raquo:Xb,reg:Qb,sect:Jb,shy:em,sup1:tm,sup2:rm,sup3:am,szlig:nm,thorn:im,times:om,uacute:sm,ucirc:lm,ugrave:um,uml:dm,uuml:cm,yacute:pm,yen:gm,yuml:bm},fm={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};var Oc=Em;function Em(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}var hm=Sm;function Sm(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}var ym=Tm;function Tm(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}var vm=ym,Am=Oc,Rm=_m;function _m(e){return vm(e)||Am(e)}var be,Im=59,Nm=wm;function wm(e){var t="&"+e+";",r;return be=be||document.createElement("i"),be.innerHTML=t,r=be.textContent,r.charCodeAt(r.length-1)===Im&&e!=="semi"||r===t?!1:r}var po=mm,go=fm,Cm=Oc,km=hm,Lc=Rm,Om=Nm,Lm=Vm,Dm={}.hasOwnProperty,ne=String.fromCharCode,xm=Function.prototype,bo={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},Mm=9,mo=10,Fm=12,Um=32,fo=38,Bm=59,Pm=60,Gm=61,$m=35,qm=88,Hm=120,zm=65533,ie="named",Ui="hexadecimal",Bi="decimal",Pi={};Pi[Ui]=16;Pi[Bi]=10;var fe={};fe[ie]=Lc;fe[Bi]=Cm;fe[Ui]=km;var Dc=1,xc=2,Mc=3,Fc=4,Uc=5,Ci=6,Bc=7,J={};J[Dc]="Named character references must be terminated by a semicolon";J[xc]="Numeric character references must be terminated by a semicolon";J[Mc]="Named character references cannot be empty";J[Fc]="Numeric character references cannot be empty";J[Uc]="Named character references must be known";J[Ci]="Numeric character references cannot be disallowed";J[Bc]="Numeric character references cannot be outside the permissible Unicode range";function Vm(e,t){var r={},a,n;t||(t={});for(n in bo)a=t[n],r[n]=a??bo[n];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),jm(e,r)}function jm(e,t){var r=t.additional,a=t.nonTerminated,n=t.text,i=t.reference,s=t.warning,l=t.textContext,u=t.referenceContext,c=t.warningContext,d=t.position,b=t.indent||[],h=e.length,S=0,_=-1,y=d.column||1,R=d.line||1,v="",g=[],p,m,E,f,A,I,T,N,C,U,B,q,P,G,Y,O,M,x,k;for(typeof r=="string"&&(r=r.charCodeAt(0)),O=L(),N=s?Z:xm,S--,h++;++S<h;)if(A===mo&&(y=b[_]||1),A=e.charCodeAt(S),A===fo){if(T=e.charCodeAt(S+1),T===Mm||T===mo||T===Fm||T===Um||T===fo||T===Pm||T!==T||r&&T===r){v+=ne(A),y++;continue}for(P=S+1,q=P,k=P,T===$m?(k=++q,T=e.charCodeAt(k),T===qm||T===Hm?(G=Ui,k=++q):G=Bi):G=ie,p="",B="",f="",Y=fe[G],k--;++k<h&&(T=e.charCodeAt(k),!!Y(T));)f+=ne(T),G===ie&&Dm.call(po,f)&&(p=f,B=po[f]);E=e.charCodeAt(k)===Bm,E&&(k++,m=G===ie?Om(f):!1,m&&(p=f,B=m)),x=1+k-P,!E&&!a||(f?G===ie?(E&&!B?N(Uc,1):(p!==f&&(k=q+p.length,x=1+k-q,E=!1),E||(C=p?Dc:Mc,t.attribute?(T=e.charCodeAt(k),T===Gm?(N(C,x),B=null):Lc(T)?B=null:N(C,x)):N(C,x))),I=B):(E||N(xc,x),I=parseInt(f,Pi[G]),Wm(I)?(N(Bc,x),I=ne(zm)):I in go?(N(Ci,x),I=go[I]):(U="",Ym(I)&&N(Ci,x),I>65535&&(I-=65536,U+=ne(I>>>10|55296),I=56320|I&1023),I=U+ne(I))):G!==ie&&N(Fc,x)),I?(V(),O=L(),S=k-1,y+=k-P+1,g.push(I),M=L(),M.offset++,i&&i.call(u,I,{start:O,end:M},e.slice(P-1,k)),O=M):(f=e.slice(P-1,k),v+=f,y+=f.length,S=k-1)}else A===10&&(R++,_++,y=0),A===A?(v+=ne(A),y++):V();return g.join("");function L(){return{line:R,column:y,offset:S+(d.offset||0)}}function Z(X,ee){var Q=L();Q.column+=ee,Q.offset+=ee,s.call(c,J[X],Q,X)}function V(){v&&(g.push(v),n&&n.call(l,v,{start:O,end:L()}),v="")}}function Wm(e){return e>=55296&&e<=57343||e>1114111}function Ym(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Pc={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
1
+ import{c as me,g as Xc}from"./index-fb1e167a.js";function Qc(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const i=Object.getOwnPropertyDescriptor(a,n);i&&Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Jc=tp,ep=Object.prototype.hasOwnProperty;function tp(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var a in r)ep.call(r,a)&&(e[a]=r[a])}return e}var yc=Tc,ki=Tc.prototype;ki.space=null;ki.normal={};ki.property={};function Tc(e,t,r){this.property=e,this.normal=t,r&&(this.space=r)}var eo=Jc,rp=yc,ap=np;function np(e){for(var t=e.length,r=[],a=[],n=-1,i,s;++n<t;)i=e[n],r.push(i.property),a.push(i.normal),s=i.space;return new rp(eo.apply(null,r),eo.apply(null,a),s)}var Oi=ip;function ip(e){return e.toLowerCase()}var vc=Ac,W=Ac.prototype;W.space=null;W.attribute=null;W.property=null;W.boolean=!1;W.booleanish=!1;W.overloadedBoolean=!1;W.number=!1;W.commaSeparated=!1;W.spaceSeparated=!1;W.commaOrSpaceSeparated=!1;W.mustUseProperty=!1;W.defined=!1;function Ac(e,t){this.property=e,this.attribute=t}var K={},op=0;K.boolean=re();K.booleanish=re();K.overloadedBoolean=re();K.number=re();K.spaceSeparated=re();K.commaSeparated=re();K.commaOrSpaceSeparated=re();function re(){return Math.pow(2,++op)}var Rc=vc,to=K,_c=Li;Li.prototype=new Rc;Li.prototype.defined=!0;var Ic=["boolean","booleanish","overloadedBoolean","number","commaSeparated","spaceSeparated","commaOrSpaceSeparated"],sp=Ic.length;function Li(e,t,r,a){var n=-1,i;for(ro(this,"space",a),Rc.call(this,e,t);++n<sp;)i=Ic[n],ro(this,i,(r&to[i])===to[i])}function ro(e,t,r){r&&(e[t]=r)}var ao=Oi,lp=yc,up=_c,de=dp;function dp(e){var t=e.space,r=e.mustUseProperty||[],a=e.attributes||{},n=e.properties,i=e.transform,s={},l={},u,c;for(u in n)c=new up(u,i(a,u),n[u],t),r.indexOf(u)!==-1&&(c.mustUseProperty=!0),s[u]=c,l[ao(u)]=u,l[ao(c.attribute)]=u;return new lp(s,l,t)}var cp=de,pp=cp({space:"xlink",transform:gp,properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}});function gp(e,t){return"xlink:"+t.slice(5).toLowerCase()}var bp=de,mp=bp({space:"xml",transform:fp,properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function fp(e,t){return"xml:"+t.slice(3).toLowerCase()}var Ep=hp;function hp(e,t){return t in e?e[t]:t}var Sp=Ep,Nc=yp;function yp(e,t){return Sp(e,t.toLowerCase())}var Tp=de,vp=Nc,Ap=Tp({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:vp,properties:{xmlns:null,xmlnsXLink:null}}),Di=K,Rp=de,H=Di.booleanish,j=Di.number,te=Di.spaceSeparated,_p=Rp({transform:Ip,properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:te,ariaCurrent:null,ariaDescribedBy:te,ariaDetails:null,ariaDisabled:H,ariaDropEffect:te,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:te,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:te,ariaLevel:j,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:te,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:te,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:H,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null}});function Ip(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}var oe=K,Np=de,wp=Nc,w=oe.boolean,Cp=oe.overloadedBoolean,se=oe.booleanish,D=oe.number,$=oe.spaceSeparated,ge=oe.commaSeparated,kp=Np({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:wp,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ge,acceptCharset:$,accessKey:$,action:null,allow:null,allowFullScreen:w,allowPaymentRequest:w,allowUserMedia:w,alt:null,as:null,async:w,autoCapitalize:null,autoComplete:$,autoFocus:w,autoPlay:w,capture:w,charSet:null,checked:w,cite:null,className:$,cols:D,colSpan:null,content:null,contentEditable:se,controls:w,controlsList:$,coords:D|ge,crossOrigin:null,data:null,dateTime:null,decoding:null,default:w,defer:w,dir:null,dirName:null,disabled:w,download:Cp,draggable:se,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:w,formTarget:null,headers:$,height:D,hidden:w,high:D,href:null,hrefLang:null,htmlFor:$,httpEquiv:$,id:null,imageSizes:null,imageSrcSet:ge,inputMode:null,integrity:null,is:null,isMap:w,itemId:null,itemProp:$,itemRef:$,itemScope:w,itemType:$,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:w,low:D,manifest:null,max:null,maxLength:D,media:null,method:null,min:null,minLength:D,multiple:w,muted:w,name:null,nonce:null,noModule:w,noValidate:w,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextMenu:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:w,optimum:D,pattern:null,ping:$,placeholder:null,playsInline:w,poster:null,preload:null,readOnly:w,referrerPolicy:null,rel:$,required:w,reversed:w,rows:D,rowSpan:D,sandbox:$,scope:null,scoped:w,seamless:w,selected:w,shape:null,size:D,sizes:null,slot:null,span:D,spellCheck:se,src:null,srcDoc:null,srcLang:null,srcSet:ge,start:D,step:null,style:null,tabIndex:D,target:null,title:null,translate:null,type:null,typeMustMatch:w,useMap:null,value:se,width:D,wrap:null,align:null,aLink:null,archive:$,axis:null,background:null,bgColor:null,border:D,borderColor:null,bottomMargin:D,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:w,declare:w,event:null,face:null,frame:null,frameBorder:null,hSpace:D,leftMargin:D,link:null,longDesc:null,lowSrc:null,marginHeight:D,marginWidth:D,noResize:w,noHref:w,noShade:w,noWrap:w,object:null,profile:null,prompt:null,rev:null,rightMargin:D,rules:null,scheme:null,scrolling:se,standby:null,summary:null,text:null,topMargin:D,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:w,disableRemotePlayback:w,prefix:null,property:null,results:D,security:null,unselectable:null}}),Op=ap,Lp=pp,Dp=mp,xp=Ap,Mp=_p,Fp=kp,Up=Op([Dp,Lp,xp,Mp,Fp]),Bp=Oi,Pp=_c,Gp=vc,xi="data",$p=zp,qp=/^data[-\w.:]+$/i,wc=/-[a-z]/g,Hp=/[A-Z]/g;function zp(e,t){var r=Bp(t),a=t,n=Gp;return r in e.normal?e.property[e.normal[r]]:(r.length>4&&r.slice(0,4)===xi&&qp.test(t)&&(t.charAt(4)==="-"?a=Vp(t):t=jp(t),n=Pp),new n(a,t))}function Vp(e){var t=e.slice(5).replace(wc,Yp);return xi+t.charAt(0).toUpperCase()+t.slice(1)}function jp(e){var t=e.slice(4);return wc.test(t)?e:(t=t.replace(Hp,Wp),t.charAt(0)!=="-"&&(t="-"+t),xi+t)}function Wp(e){return"-"+e.toLowerCase()}function Yp(e){return e.charAt(1).toUpperCase()}var Kp=Zp,no=/[#.]/g;function Zp(e,t){for(var r=e||"",a=t||"div",n={},i=0,s,l,u;i<r.length;)no.lastIndex=i,u=no.exec(r),s=r.slice(i,u?u.index:r.length),s&&(l?l==="#"?n.id=s:n.className?n.className.push(s):n.className=[s]:a=s,i+=s.length),u&&(l=u[0],i++);return{type:"element",tagName:a,properties:n,children:[]}}var Mi={};Mi.parse=Jp;Mi.stringify=eg;var io="",Xp=" ",Qp=/[ \t\n\r\f]+/g;function Jp(e){var t=String(e||io).trim();return t===io?[]:t.split(Qp)}function eg(e){return e.join(Xp).trim()}var Fi={};Fi.parse=tg;Fi.stringify=rg;var wi=",",oo=" ",le="";function tg(e){for(var t=[],r=String(e||le),a=r.indexOf(wi),n=0,i=!1,s;!i;)a===-1&&(a=r.length,i=!0),s=r.slice(n,a).trim(),(s||!i)&&t.push(s),n=a+1,a=r.indexOf(wi,n);return t}function rg(e,t){var r=t||{},a=r.padLeft===!1?le:oo,n=r.padRight?oo:le;return e[e.length-1]===le&&(e=e.concat(le)),e.join(n+wi+a).trim()}var ag=$p,so=Oi,ng=Kp,lo=Mi.parse,uo=Fi.parse,ig=sg,og={}.hasOwnProperty;function sg(e,t,r){var a=r?pg(r):null;return n;function n(s,l){var u=ng(s,t),c=Array.prototype.slice.call(arguments,2),d=u.tagName.toLowerCase(),b;if(u.tagName=a&&og.call(a,d)?a[d]:d,l&&lg(l,u)&&(c.unshift(l),l=null),l)for(b in l)i(u.properties,b,l[b]);return Cc(u.children,c),u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}function i(s,l,u){var c,d,b;u==null||u!==u||(c=ag(e,l),d=c.property,b=u,typeof b=="string"&&(c.spaceSeparated?b=lo(b):c.commaSeparated?b=uo(b):c.commaOrSpaceSeparated&&(b=lo(uo(b).join(" ")))),d==="style"&&typeof u!="string"&&(b=cg(b)),d==="className"&&s.className&&(b=s.className.concat(b)),s[d]=dg(c,d,b))}}function lg(e,t){return typeof e=="string"||"length"in e||ug(t.tagName,e)}function ug(e,t){var r=t.type;return e==="input"||!r||typeof r!="string"?!1:typeof t.children=="object"&&"length"in t.children?!0:(r=r.toLowerCase(),e==="button"?r!=="menu"&&r!=="submit"&&r!=="reset"&&r!=="button":"value"in t)}function Cc(e,t){var r,a;if(typeof t=="string"||typeof t=="number"){e.push({type:"text",value:String(t)});return}if(typeof t=="object"&&"length"in t){for(r=-1,a=t.length;++r<a;)Cc(e,t[r]);return}if(typeof t!="object"||!("type"in t))throw new Error("Expected node, nodes, or string, got `"+t+"`");e.push(t)}function dg(e,t,r){var a,n,i;if(typeof r!="object"||!("length"in r))return co(e,t,r);for(n=r.length,a=-1,i=[];++a<n;)i[a]=co(e,t,r[a]);return i}function co(e,t,r){var a=r;return e.number||e.positiveNumber?!isNaN(a)&&a!==""&&(a=Number(a)):(e.boolean||e.overloadedBoolean)&&typeof a=="string"&&(a===""||so(r)===so(t))&&(a=!0),a}function cg(e){var t=[],r;for(r in e)t.push([r,e[r]].join(": "));return t.join("; ")}function pg(e){for(var t=e.length,r=-1,a={},n;++r<t;)n=e[r],a[n.toLowerCase()]=n;return a}var gg=Up,bg=ig,kc=bg(gg,"div");kc.displayName="html";var mg=kc,fg=mg;const Eg="Æ",hg="&",Sg="Á",yg="Â",Tg="À",vg="Å",Ag="Ã",Rg="Ä",_g="©",Ig="Ç",Ng="Ð",wg="É",Cg="Ê",kg="È",Og="Ë",Lg=">",Dg="Í",xg="Î",Mg="Ì",Fg="Ï",Ug="<",Bg="Ñ",Pg="Ó",Gg="Ô",$g="Ò",qg="Ø",Hg="Õ",zg="Ö",Vg='"',jg="®",Wg="Þ",Yg="Ú",Kg="Û",Zg="Ù",Xg="Ü",Qg="Ý",Jg="á",eb="â",tb="´",rb="æ",ab="à",nb="&",ib="å",ob="ã",sb="ä",lb="¦",ub="ç",db="¸",cb="¢",pb="©",gb="¤",bb="°",mb="÷",fb="é",Eb="ê",hb="è",Sb="ð",yb="ë",Tb="½",vb="¼",Ab="¾",Rb=">",_b="í",Ib="î",Nb="¡",wb="ì",Cb="¿",kb="ï",Ob="«",Lb="<",Db="¯",xb="µ",Mb="·",Fb=" ",Ub="¬",Bb="ñ",Pb="ó",Gb="ô",$b="ò",qb="ª",Hb="º",zb="ø",Vb="õ",jb="ö",Wb="¶",Yb="±",Kb="£",Zb='"',Xb="»",Qb="®",Jb="§",em="­",tm="¹",rm="²",am="³",nm="ß",im="þ",om="×",sm="ú",lm="û",um="ù",dm="¨",cm="ü",pm="ý",gm="¥",bm="ÿ",mm={AElig:Eg,AMP:hg,Aacute:Sg,Acirc:yg,Agrave:Tg,Aring:vg,Atilde:Ag,Auml:Rg,COPY:_g,Ccedil:Ig,ETH:Ng,Eacute:wg,Ecirc:Cg,Egrave:kg,Euml:Og,GT:Lg,Iacute:Dg,Icirc:xg,Igrave:Mg,Iuml:Fg,LT:Ug,Ntilde:Bg,Oacute:Pg,Ocirc:Gg,Ograve:$g,Oslash:qg,Otilde:Hg,Ouml:zg,QUOT:Vg,REG:jg,THORN:Wg,Uacute:Yg,Ucirc:Kg,Ugrave:Zg,Uuml:Xg,Yacute:Qg,aacute:Jg,acirc:eb,acute:tb,aelig:rb,agrave:ab,amp:nb,aring:ib,atilde:ob,auml:sb,brvbar:lb,ccedil:ub,cedil:db,cent:cb,copy:pb,curren:gb,deg:bb,divide:mb,eacute:fb,ecirc:Eb,egrave:hb,eth:Sb,euml:yb,frac12:Tb,frac14:vb,frac34:Ab,gt:Rb,iacute:_b,icirc:Ib,iexcl:Nb,igrave:wb,iquest:Cb,iuml:kb,laquo:Ob,lt:Lb,macr:Db,micro:xb,middot:Mb,nbsp:Fb,not:Ub,ntilde:Bb,oacute:Pb,ocirc:Gb,ograve:$b,ordf:qb,ordm:Hb,oslash:zb,otilde:Vb,ouml:jb,para:Wb,plusmn:Yb,pound:Kb,quot:Zb,raquo:Xb,reg:Qb,sect:Jb,shy:em,sup1:tm,sup2:rm,sup3:am,szlig:nm,thorn:im,times:om,uacute:sm,ucirc:lm,ugrave:um,uml:dm,uuml:cm,yacute:pm,yen:gm,yuml:bm},fm={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};var Oc=Em;function Em(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}var hm=Sm;function Sm(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}var ym=Tm;function Tm(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}var vm=ym,Am=Oc,Rm=_m;function _m(e){return vm(e)||Am(e)}var be,Im=59,Nm=wm;function wm(e){var t="&"+e+";",r;return be=be||document.createElement("i"),be.innerHTML=t,r=be.textContent,r.charCodeAt(r.length-1)===Im&&e!=="semi"||r===t?!1:r}var po=mm,go=fm,Cm=Oc,km=hm,Lc=Rm,Om=Nm,Lm=Vm,Dm={}.hasOwnProperty,ne=String.fromCharCode,xm=Function.prototype,bo={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},Mm=9,mo=10,Fm=12,Um=32,fo=38,Bm=59,Pm=60,Gm=61,$m=35,qm=88,Hm=120,zm=65533,ie="named",Ui="hexadecimal",Bi="decimal",Pi={};Pi[Ui]=16;Pi[Bi]=10;var fe={};fe[ie]=Lc;fe[Bi]=Cm;fe[Ui]=km;var Dc=1,xc=2,Mc=3,Fc=4,Uc=5,Ci=6,Bc=7,J={};J[Dc]="Named character references must be terminated by a semicolon";J[xc]="Numeric character references must be terminated by a semicolon";J[Mc]="Named character references cannot be empty";J[Fc]="Numeric character references cannot be empty";J[Uc]="Named character references must be known";J[Ci]="Numeric character references cannot be disallowed";J[Bc]="Numeric character references cannot be outside the permissible Unicode range";function Vm(e,t){var r={},a,n;t||(t={});for(n in bo)a=t[n],r[n]=a??bo[n];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),jm(e,r)}function jm(e,t){var r=t.additional,a=t.nonTerminated,n=t.text,i=t.reference,s=t.warning,l=t.textContext,u=t.referenceContext,c=t.warningContext,d=t.position,b=t.indent||[],h=e.length,S=0,_=-1,y=d.column||1,R=d.line||1,v="",g=[],p,m,E,f,A,I,T,N,C,U,B,q,P,G,Y,O,M,x,k;for(typeof r=="string"&&(r=r.charCodeAt(0)),O=L(),N=s?Z:xm,S--,h++;++S<h;)if(A===mo&&(y=b[_]||1),A=e.charCodeAt(S),A===fo){if(T=e.charCodeAt(S+1),T===Mm||T===mo||T===Fm||T===Um||T===fo||T===Pm||T!==T||r&&T===r){v+=ne(A),y++;continue}for(P=S+1,q=P,k=P,T===$m?(k=++q,T=e.charCodeAt(k),T===qm||T===Hm?(G=Ui,k=++q):G=Bi):G=ie,p="",B="",f="",Y=fe[G],k--;++k<h&&(T=e.charCodeAt(k),!!Y(T));)f+=ne(T),G===ie&&Dm.call(po,f)&&(p=f,B=po[f]);E=e.charCodeAt(k)===Bm,E&&(k++,m=G===ie?Om(f):!1,m&&(p=f,B=m)),x=1+k-P,!E&&!a||(f?G===ie?(E&&!B?N(Uc,1):(p!==f&&(k=q+p.length,x=1+k-q,E=!1),E||(C=p?Dc:Mc,t.attribute?(T=e.charCodeAt(k),T===Gm?(N(C,x),B=null):Lc(T)?B=null:N(C,x)):N(C,x))),I=B):(E||N(xc,x),I=parseInt(f,Pi[G]),Wm(I)?(N(Bc,x),I=ne(zm)):I in go?(N(Ci,x),I=go[I]):(U="",Ym(I)&&N(Ci,x),I>65535&&(I-=65536,U+=ne(I>>>10|55296),I=56320|I&1023),I=U+ne(I))):G!==ie&&N(Fc,x)),I?(V(),O=L(),S=k-1,y+=k-P+1,g.push(I),M=L(),M.offset++,i&&i.call(u,I,{start:O,end:M},e.slice(P-1,k)),O=M):(f=e.slice(P-1,k),v+=f,y+=f.length,S=k-1)}else A===10&&(R++,_++,y=0),A===A?(v+=ne(A),y++):V();return g.join("");function L(){return{line:R,column:y,offset:S+(d.offset||0)}}function Z(X,ee){var Q=L();Q.column+=ee,Q.offset+=ee,s.call(c,J[X],Q,X)}function V(){v&&(g.push(v),n&&n.call(l,v,{start:O,end:L()}),v="")}}function Wm(e){return e>=55296&&e<=57343||e>1114111}function Ym(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Pc={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
2
2
  * Prism: Lightweight, robust, elegant syntax highlighting
3
3
  *
4
4
  * @license MIT <https://opensource.org/licenses/MIT>