@blinkk/root-cms 2.5.13 → 2.5.14-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +4 -4
- package/dist/{chunk-EKLY6WLD.js → chunk-XNGSOET2.js} +2 -6
- package/dist/plugin.js +1 -1
- package/dist/ui/ui.js +1 -1
- package/package.json +5 -9
package/dist/app.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getServerVersion
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XNGSOET2.js";
|
|
4
4
|
import {
|
|
5
5
|
getCollectionSchema,
|
|
6
6
|
getProjectSchemas
|
|
@@ -10,7 +10,7 @@ import "./chunk-MLKGABMK.js";
|
|
|
10
10
|
// core/app.tsx
|
|
11
11
|
import crypto from "crypto";
|
|
12
12
|
import path from "path";
|
|
13
|
-
import {
|
|
13
|
+
import { renderJsxToString } from "@blinkk/root/jsx";
|
|
14
14
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
15
15
|
var DEFAULT_FAVICON_URL = "https://lh3.googleusercontent.com/ijK50TfQlV_yJw3i-CMlnD6osH4PboZBILZrJcWhoNMEmoyCD5e1bAxXbaOPe5w4gG_Scf37EXrmZ6p8sP2lue5fLZ419m5JyLMs=e385-w256";
|
|
16
16
|
function App(props) {
|
|
@@ -139,7 +139,7 @@ async function renderApp(req, res, options) {
|
|
|
139
139
|
};
|
|
140
140
|
const projectName = cmsConfig.name || cmsConfig.id || "";
|
|
141
141
|
const title = getCmsTitle(projectName, cmsConfig.minimalBranding);
|
|
142
|
-
const mainHtml =
|
|
142
|
+
const mainHtml = renderJsxToString(
|
|
143
143
|
/* @__PURE__ */ jsx(App, { title, ctx, favicon: cmsConfig.favicon })
|
|
144
144
|
);
|
|
145
145
|
const nonce = generateNonce();
|
|
@@ -234,7 +234,7 @@ async function renderSignIn(req, res, options) {
|
|
|
234
234
|
ctx.warning = "Dev warning: Server may be misconfigured. See logs for more information.";
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
const mainHtml =
|
|
237
|
+
const mainHtml = renderJsxToString(
|
|
238
238
|
/* @__PURE__ */ jsx(SignIn, { title: "Sign in", ctx, favicon: options.cmsConfig.favicon })
|
|
239
239
|
);
|
|
240
240
|
const nonce = generateNonce();
|
|
@@ -12,9 +12,6 @@ var package_default = {
|
|
|
12
12
|
url: "git+https://github.com/blinkk/rootjs.git",
|
|
13
13
|
directory: "packages/root-cms"
|
|
14
14
|
},
|
|
15
|
-
publishConfig: {
|
|
16
|
-
provenance: true
|
|
17
|
-
},
|
|
18
15
|
files: [
|
|
19
16
|
"dist/**/*"
|
|
20
17
|
],
|
|
@@ -157,7 +154,7 @@ var package_default = {
|
|
|
157
154
|
playwright: "1.56.1",
|
|
158
155
|
preact: "10.27.1",
|
|
159
156
|
"preact-iso": "2.11.1",
|
|
160
|
-
"preact-render-to-string": "6.6.
|
|
157
|
+
"preact-render-to-string": "6.6.7",
|
|
161
158
|
react: "npm:@preact/compat@18.3.1",
|
|
162
159
|
"react-dom": "npm:@preact/compat@18.3.1",
|
|
163
160
|
"react-easy-crop": "5.5.6",
|
|
@@ -172,8 +169,7 @@ var package_default = {
|
|
|
172
169
|
"@blinkk/root": "2.5.13",
|
|
173
170
|
"firebase-admin": ">=11",
|
|
174
171
|
"firebase-functions": ">=4",
|
|
175
|
-
preact: ">=10"
|
|
176
|
-
"preact-render-to-string": ">=5"
|
|
172
|
+
preact: ">=10"
|
|
177
173
|
},
|
|
178
174
|
peerDependenciesMeta: {
|
|
179
175
|
"firebase-functions": {
|
package/dist/plugin.js
CHANGED
package/dist/ui/ui.js
CHANGED
|
@@ -61,7 +61,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),B=H,q=j),U===void 0&&(
|
|
|
61
61
|
`},c]}}Iwe.exports=Fft});var Dwe=Ht((jbo,Rwe)=>{"use strict";var Lft=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),Bft=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],zft=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Twe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],kwe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Hft=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),Vft=Twe.concat(kwe);function Gft(e){let t=Lft(e),o=Vft,r="and or not only",n="[\\w-]+",i="("+n+"|@\\{"+n+"\\})",s=[],a=[],l=function(C){return{className:"string",begin:"~?"+C+".*?"+C}},c=function(C,E,R){return{className:C,begin:E,relevance:R}},d={$pattern:/[a-z-]+/,keyword:r,attribute:zft.join(" ")},u={begin:"\\(",end:"\\)",contains:a,keywords:d,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,u,c("variable","@@?"+n,10),c("variable","@\\{"+n+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:n+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);let f=a.concat({begin:/\{/,end:/\}/,contains:s}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},g={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Hft.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:a,relevance:0}},v={className:"variable",variants:[{begin:"@"+n+"\\s*:",relevance:15},{begin:"@"+n}],starts:{end:"[;}]",returnEnd:!0,contains:f}},b={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,c("keyword","all\\b"),c("variable","@\\{"+n+"\\}"),{begin:"\\b("+Bft.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",i,0),c("selector-id","#"+i),c("selector-class","\\."+i,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Twe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+kwe.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},t.FUNCTION_DISPATCH]},y={begin:n+`:(:)?(${o.join("|")})`,returnBegin:!0,contains:[b]};return s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,v,y,g,b,h,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}Rwe.exports=Gft});var Awe=Ht((Kbo,Pwe)=>{"use strict";function Uft(e){let t="\\[=*\\[",o="\\]=*\\]",r={begin:t,end:o,contains:["self"]},n=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,o,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:n.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:n}].concat(n)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:o,contains:[r],relevance:5}])}}Pwe.exports=Uft});var Mwe=Ht((qbo,Owe)=>{"use strict";function $ft(e){let t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t]},n={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},i={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,o,r,n,i,s]}}Owe.exports=$ft});var Fwe=Ht((Ybo,Nwe)=>{"use strict";function Wft(e){let t=e.regex,o=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,n={$pattern:/[\w.]+/,keyword:o.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},s={begin:/->\{/,end:/\}/},a={variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},l=[e.BACKSLASH_ESCAPE,i,a],c=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],d=(h,g,m="\\1")=>{let v=m==="\\1"?m:t.concat(m,g);return t.concat(t.concat("(?:",h,")"),g,/(?:\\.|[^\\\/])*?/,v,/(?:\\.|[^\\\/])*?/,m,r)},u=(h,g,m)=>t.concat(t.concat("(?:",h,")"),g,/(?:\\.|[^\\\/])*?/,m,r),f=[a,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:l,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:d("s|tr|y",t.either(...c,{capture:!0}))},{begin:d("s|tr|y","\\(","\\)")},{begin:d("s|tr|y","\\[","\\]")},{begin:d("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:u("(?:m|qr)?",/\//,/\//)},{begin:u("m|qr",t.either(...c,{capture:!0}),/\1/)},{begin:u("m|qr",/\(/,/\)/)},{begin:u("m|qr",/\[/,/\]/)},{begin:u("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=f,s.contains=f,{name:"Perl",aliases:["pl","pm"],keywords:n,contains:f}}Nwe.exports=Wft});var Bwe=Ht((Xbo,Lwe)=>{"use strict";function jft(e){let t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},o=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:o,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:o,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}Lwe.exports=jft});var Hwe=Ht((Qbo,zwe)=>{"use strict";function Kft(e){let t=e.regex,o=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,o),n=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,o),i={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},a={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),c=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),d=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),u=`[
|
|
62
62
|
]`,f={scope:"string",variants:[c,l,d]},h={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},g=["false","null","true"],m=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],v=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],y={keyword:m,literal:(A=>{let P=[];return A.forEach(z=>{P.push(z),z.toLowerCase()===z?P.push(z.toUpperCase()):P.push(z.toLowerCase())}),P})(g),built_in:v},C=A=>A.map(P=>P.replace(/\|\d+$/,"")),E={variants:[{match:[/new/,t.concat(u,"+"),t.concat("(?!",C(v).join("\\b|"),"\\b)"),n],scope:{1:"keyword",4:"title.class"}}]},R=t.concat(r,"\\b(?!\\()"),I={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[n,t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[n,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[n,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},S={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},_={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[S,i,I,e.C_BLOCK_COMMENT_MODE,f,h,E]},T={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",C(m).join("\\b|"),"|",C(v).join("\\b|"),"\\b)"),r,t.concat(u,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[_]};_.contains.push(T);let k=[S,I,e.C_BLOCK_COMMENT_MODE,f,h,E],D={begin:t.concat(/#\[\s*/,n),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...k]},...k,{scope:"meta",match:n}]};return{case_insensitive:!1,keywords:y,contains:[D,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},i,T,I,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},E,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:y,contains:["self",i,I,e.C_BLOCK_COMMENT_MODE,f,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},f,h]}}zwe.exports=Kft});var Gwe=Ht((Jbo,Vwe)=>{"use strict";function qft(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}Vwe.exports=qft});var $we=Ht((Zbo,Uwe)=>{"use strict";function Yft(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}Uwe.exports=Yft});var jwe=Ht((eyo,Wwe)=>{"use strict";function Xft(e){let t=e.regex,o=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},d={begin:/\{\{/,relevance:0},u={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,d,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",h=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,g=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${h}))[eE][+-]?(${f})[jJ]?(?=${g})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${f})[jJ](?=${g})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,m,u,e.HASH_COMMENT_MODE]}]};return c.contains=[u,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|->|\?)|=>/,contains:[l,m,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},u,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,o],scope:{1:"keyword",3:"title.function"},contains:[b]},{variants:[{match:[/\bclass/,/\s+/,o,/\s*/,/\(\s*/,o,/\s*\)/]},{match:[/\bclass/,/\s+/,o]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,b,u]}]}}Wwe.exports=Xft});var qwe=Ht((tyo,Kwe)=>{"use strict";function Qft(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}Kwe.exports=Qft});var Xwe=Ht((oyo,Ywe)=>{"use strict";function Jft(e){let t=e.regex,o=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),n=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:o,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:o},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[n,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[o,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:n},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}Ywe.exports=Jft});var Jwe=Ht((ryo,Qwe)=>{"use strict";function Zft(e){let t=e.regex,o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",n=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],i=["true","false","Some","None","Ok","Err"],s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],a=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:a,keyword:n,literal:i,built_in:s},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+r},{begin:"\\b0o([0-7_]+)"+r},{begin:"\\b0x([A-Fa-f0-9_]+)"+r},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+r}],relevance:0},{begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,e.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:s,type:a}},{className:"punctuation",begin:"->"},o]}}Qwe.exports=Zft});var e_e=Ht((nyo,Zwe)=>{"use strict";var ept=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),tpt=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],opt=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],rpt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],npt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ipt=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function spt(e){let t=ept(e),o=npt,r=rpt,n="@[a-z-]+",i="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+tpt.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+o.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ipt.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:n,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:opt.join(" ")},contains:[{begin:n,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}Zwe.exports=spt});var o_e=Ht((iyo,t_e)=>{"use strict";function apt(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}t_e.exports=apt});var n_e=Ht((syo,r_e)=>{"use strict";function lpt(e){let t=e.regex,o=e.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},n={begin:/"/,end:/"/,contains:[{begin:/""/}]},i=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],u=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=d,g=[...c,...l].filter(C=>!d.includes(C)),m={className:"variable",begin:/@[a-z0-9]+/},v={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},b={begin:t.concat(/\b/,t.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function y(C,{exceptions:E,when:R}={}){let I=R;return E=E||[],C.map(S=>S.match(/\|\d+$/)||E.includes(S)?S:I(S)?`${S}|0`:S)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:y(g,{when:C=>C.length<3}),literal:i,type:a,built_in:u},contains:[{begin:t.either(...f),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:g.concat(f),literal:i,type:a}},{className:"type",begin:t.either(...s)},b,m,r,n,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,o,v]}}r_e.exports=lpt});var p_e=Ht((ayo,f_e)=>{"use strict";function l_e(e){return e?typeof e=="string"?e:e.source:null}function HP(e){return Sr("(?=",e,")")}function Sr(...e){return e.map(o=>l_e(o)).join("")}function cpt(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function wa(...e){return"("+(cpt(e).capture?"":"?:")+e.map(r=>l_e(r)).join("|")+")"}var uG=e=>Sr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),dpt=["Protocol","Type"].map(uG),i_e=["init","self"].map(uG),upt=["Any","Self"],lG=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],s_e=["false","nil","true"],fpt=["assignment","associativity","higherThan","left","lowerThan","none","right"],ppt=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],a_e=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],c_e=wa(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),d_e=wa(c_e,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),cG=Sr(c_e,d_e,"*"),u_e=wa(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),VP=wa(u_e,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ef=Sr(u_e,VP,"*"),dG=Sr(/[A-Z]/,VP,"*"),hpt=["autoclosure",Sr(/convention\(/,wa("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Sr(/objc\(/,ef,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],gpt=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function mpt(e){let t={match:/\s+/,relevance:0},o=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,o],n={match:[/\./,wa(...dpt,...i_e)],className:{2:"keyword"}},i={match:Sr(/\./,wa(...lG)),relevance:0},s=lG.filter(_e=>typeof _e=="string").concat(["_|0"]),a=lG.filter(_e=>typeof _e!="string").concat(upt).map(uG),l={variants:[{className:"keyword",match:wa(...a,...i_e)}]},c={$pattern:wa(/\b\w+/,/#\w+/),keyword:s.concat(ppt),literal:s_e},d=[n,i,l],u={match:Sr(/\./,wa(...a_e)),relevance:0},f={className:"built_in",match:Sr(/\b/,wa(...a_e),/(?=\()/)},h=[u,f],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:cG},{match:`\\.(\\.|${d_e})+`}]},v=[g,m],b="([0-9]_*)+",y="([0-9a-fA-F]_*)+",C={className:"number",relevance:0,variants:[{match:`\\b(${b})(\\.(${b}))?([eE][+-]?(${b}))?\\b`},{match:`\\b0x(${y})(\\.(${y}))?([pP][+-]?(${b}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},E=(_e="")=>({className:"subst",variants:[{match:Sr(/\\/,_e,/[0\\tnr"']/)},{match:Sr(/\\/,_e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),R=(_e="")=>({className:"subst",match:Sr(/\\/,_e,/[\t ]*(?:[\r\n]|\r\n)/)}),I=(_e="")=>({className:"subst",label:"interpol",begin:Sr(/\\/,_e,/\(/),end:/\)/}),S=(_e="")=>({begin:Sr(_e,/"""/),end:Sr(/"""/,_e),contains:[E(_e),R(_e),I(_e)]}),_=(_e="")=>({begin:Sr(_e,/"/),end:Sr(/"/,_e),contains:[E(_e),I(_e)]}),T={className:"string",variants:[S(),S("#"),S("##"),S("###"),_(),_("#"),_("##"),_("###")]},k={match:Sr(/`/,ef,/`/)},D={className:"variable",match:/\$\d+/},A={className:"variable",match:`\\$${VP}+`},P=[k,D,A],z={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:gpt,contains:[...v,C,T]}]}},L={className:"keyword",match:Sr(/@/,wa(...hpt))},H={className:"meta",match:Sr(/@/,ef)},j=[z,L,H],U={match:HP(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Sr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,VP,"+")},{className:"type",match:dG,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Sr(/\s+&\s+/,HP(dG)),relevance:0}]},q={begin:/</,end:/>/,keywords:c,contains:[...r,...d,...j,g,U]};U.contains.push(q);let B={match:Sr(ef,/\s*:/),keywords:"_|0",relevance:0},ne={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",B,...r,...d,...h,...v,C,T,...P,...j,U]},Q={begin:/</,end:/>/,contains:[...r,U]},V={begin:wa(HP(Sr(ef,/\s*:/)),HP(Sr(ef,/\s+/,ef,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ef}]},ie={begin:/\(/,end:/\)/,keywords:c,contains:[V,...r,...d,...v,C,T,...j,U,ne],endsParent:!0,illegal:/["']/},de={match:[/func/,/\s+/,wa(k.match,ef,cG)],className:{1:"keyword",3:"title.function"},contains:[Q,ie,t],illegal:[/\[/,/%/]},he={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Q,ie,t],illegal:/\[|%/},ke={match:[/operator/,/\s+/,cG],className:{1:"keyword",3:"title"}},Ce={begin:[/precedencegroup/,/\s+/,dG],className:{1:"keyword",3:"title"},contains:[U],keywords:[...fpt,...s_e],end:/}/};for(let _e of T.variants){let Ge=_e.contains.find(Ue=>Ue.label==="interpol");Ge.keywords=c;let pt=[...d,...h,...v,C,T,...P];Ge.contains=[...pt,{begin:/\(/,end:/\)/,contains:["self",...pt]}]}return{name:"Swift",keywords:c,contains:[...r,de,he,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:c,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...d]},ke,Ce,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...d,...h,...v,C,T,...P,...j,U,ne]}}f_e.exports=mpt});var g_e=Ht((lyo,h_e)=>{"use strict";function vpt(e){let t="true false yes no null",o="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},n={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,n]},s=e.inherit(i,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),u={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},h={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},m=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+o},{className:"type",begin:"!<"+o+">"},{className:"type",begin:"!"+o},{className:"type",begin:"!!"+o},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},u,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},h,g,i],v=[...m];return v.pop(),v.push(s),f.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:m}}h_e.exports=vpt});var S_e=Ht((cyo,__e)=>{"use strict";var GP="[A-Za-z$_][0-9A-Za-z$_]*",m_e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],v_e=["true","false","null","undefined","NaN","Infinity"],b_e=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],y_e=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],x_e=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],C_e=["arguments","this","super","console","window","document","localStorage","module","global"],w_e=[].concat(x_e,b_e,y_e);function bpt(e){let t=e.regex,o=(j,{after:U})=>{let q="</"+j[0].slice(1);return j.input.indexOf(q,U)!==-1},r=GP,n={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(j,U)=>{let q=j[0].length+j.index,B=j.input[q];if(B==="<"||B===","){U.ignoreMatch();return}B===">"&&(o(j,{after:q})||U.ignoreMatch());let ne;if((ne=j.input.substring(q).match(/^\s+extends\s+/))&&ne.index===0){U.ignoreMatch();return}}},a={$pattern:GP,keyword:m_e,literal:v_e,built_in:w_e,"variable.language":C_e},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},g={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},y=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,m,u];f.contains=y.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(y)});let C=[].concat(b,f.contains),E=C.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(C)}]),R={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E},I={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},S={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...b_e,...y_e]}},_={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},k={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(j){return t.concat("(?!",j.join("|"),")")}let A={match:t.concat(/\b/,D([...x_e,"super"]),r,t.lookahead(/\(/)),className:"title.function",relevance:0},P={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},L="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(L)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),_,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,m,b,u,S,{className:"attr",begin:r+t.lookahead(":"),relevance:0},H,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:L,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},A,k,I,z,{match:/\$[(.]/}]}}function ypt(e){let t=bpt(e),o=GP,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],n={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},i={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[t.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],l={$pattern:GP,keyword:m_e.concat(a),literal:v_e,built_in:w_e.concat(r),"variable.language":C_e},c={className:"meta",begin:"@"+o},d=(f,h,g)=>{let m=f.contains.findIndex(v=>v.label===h);if(m===-1)throw new Error("can not find mode to replace");f.contains.splice(m,1,g)};Object.assign(t.keywords,l),t.exports.PARAMS_CONTAINS.push(c),t.contains=t.contains.concat([c,n,i]),d(t,"shebang",e.SHEBANG()),d(t,"use_strict",s);let u=t.contains.find(f=>f.label==="func.def");return u.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx"]}),t}__e.exports=ypt});var E_e=Ht((dyo,I_e)=>{"use strict";function xpt(e){let t=e.regex,o={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},n=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,n),/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,t.either(i,n),/ +/,t.either(s,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},u=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[o,r,l,c,d,u,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}I_e.exports=xpt});var k_e=Ht((uyo,T_e)=>{"use strict";function Cpt(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");let o=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],n={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[o,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,s,n,e.QUOTE_STRING_MODE,l,c,a]}}T_e.exports=Cpt});var D_e=Ht((fyo,R_e)=>{"use strict";var lo=GCe();lo.registerLanguage("xml",$Ce());lo.registerLanguage("bash",jCe());lo.registerLanguage("c",qCe());lo.registerLanguage("cpp",XCe());lo.registerLanguage("csharp",JCe());lo.registerLanguage("css",ewe());lo.registerLanguage("markdown",owe());lo.registerLanguage("diff",nwe());lo.registerLanguage("ruby",swe());lo.registerLanguage("go",lwe());lo.registerLanguage("graphql",dwe());lo.registerLanguage("ini",fwe());lo.registerLanguage("java",mwe());lo.registerLanguage("javascript",wwe());lo.registerLanguage("json",Swe());lo.registerLanguage("kotlin",Ewe());lo.registerLanguage("less",Dwe());lo.registerLanguage("lua",Awe());lo.registerLanguage("makefile",Mwe());lo.registerLanguage("perl",Fwe());lo.registerLanguage("objectivec",Bwe());lo.registerLanguage("php",Hwe());lo.registerLanguage("php-template",Gwe());lo.registerLanguage("plaintext",$we());lo.registerLanguage("python",jwe());lo.registerLanguage("python-repl",qwe());lo.registerLanguage("r",Xwe());lo.registerLanguage("rust",Jwe());lo.registerLanguage("scss",e_e());lo.registerLanguage("shell",o_e());lo.registerLanguage("sql",n_e());lo.registerLanguage("swift",p_e());lo.registerLanguage("yaml",g_e());lo.registerLanguage("typescript",S_e());lo.registerLanguage("vbnet",E_e());lo.registerLanguage("wasm",k_e());lo.HighlightJS=lo;lo.default=lo;R_e.exports=lo});var P_e,fG,A_e=x(()=>{"use strict";P_e=sg(D_e(),1),fG=P_e.default});function pG(e,t){let o=t||wpt,r=typeof o.includeImageAlt=="boolean"?o.includeImageAlt:!0,n=typeof o.includeHtml=="boolean"?o.includeHtml:!0;return M_e(e,r,n)}function M_e(e,t,o){if(_pt(e)){if("value"in e)return e.type==="html"&&!o?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return O_e(e.children,t,o)}return Array.isArray(e)?O_e(e,t,o):""}function O_e(e,t,o){let r=[],n=-1;for(;++n<e.length;)r[n]=M_e(e[n],t,o);return r.join("")}function _pt(e){return!!(e&&typeof e=="object")}var wpt,N_e=x(()=>{"use strict";wpt={}});var F_e=x(()=>{"use strict";N_e()});function px(e){let t="&"+e+";";L_e.innerHTML=t;let o=L_e.textContent;return o.charCodeAt(o.length-1)===59&&e!=="semi"||o===t?!1:o}var L_e,UP=x(()=>{"use strict";L_e=document.createElement("i")});function jn(e,t,o,r){let n=e.length,i=0,s;if(t<0?t=-t>n?0:n+t:t=t>n?n:t,o=o>0?o:0,r.length<1e4)s=Array.from(r),s.unshift(t,o),e.splice(...s);else for(o&&e.splice(t,o);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function Ks(e,t){return e.length>0?(jn(e,e.length,0,t),e):t}var tf=x(()=>{"use strict"});function $P(e){let t={},o=-1;for(;++o<e.length;)Spt(t,e[o]);return t}function Spt(e,t){let o;for(o in t){let n=(B_e.call(e,o)?e[o]:void 0)||(e[o]={}),i=t[o],s;if(i)for(s in i){B_e.call(n,s)||(n[s]=[]);let a=i[s];Ipt(n[s],Array.isArray(a)?a:a?[a]:[])}}}function Ipt(e,t){let o=-1,r=[];for(;++o<t.length;)(t[o].add==="after"?e:r).push(t[o]);jn(e,0,0,r)}var B_e,hG=x(()=>{"use strict";tf();B_e={}.hasOwnProperty});function WP(e,t){let o=Number.parseInt(e,t);return o<9||o===11||o>13&&o<32||o>126&&o<160||o>55295&&o<57344||o>64975&&o<65008||(o&65535)===65535||(o&65535)===65534||o>1114111?"\uFFFD":String.fromCodePoint(o)}var gG=x(()=>{"use strict"});function _s(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var hx=x(()=>{"use strict"});function Cm(e){return e!==null&&(e<32||e===127)}function it(e){return e!==null&&e<-2}function vo(e){return e!==null&&(e<0||e===32)}function Ft(e){return e===-2||e===-1||e===32}function Xp(e){return t;function t(o){return o!==null&&o>-1&&e.test(String.fromCharCode(o))}}var si,ai,z_e,yI,H_e,V_e,wm,Md,Vo=x(()=>{"use strict";si=Xp(/[A-Za-z]/),ai=Xp(/[\dA-Za-z]/),z_e=Xp(/[#-'*+\--9=?A-Z^-~]/);yI=Xp(/\d/),H_e=Xp(/[\dA-Fa-f]/),V_e=Xp(/[!-/:-@[-`{-~]/);wm=Xp(/\p{P}|\p{S}/u),Md=Xp(/\s/)});function At(e,t,o,r){let n=r?r-1:Number.POSITIVE_INFINITY,i=0;return s;function s(l){return Ft(l)?(e.enter(o),a(l)):t(l)}function a(l){return Ft(l)&&i++<n?(e.consume(l),a):(e.exit(o),t(l))}}var Rn=x(()=>{"use strict";Vo()});function Ept(e){let t=e.attempt(this.parser.constructs.contentInitial,r,n),o;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),At(e,t,"linePrefix")}function n(a){return e.enter("paragraph"),i(a)}function i(a){let l=e.enter("chunkText",{contentType:"text",previous:o});return o&&(o.next=l),o=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return it(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}var G_e,U_e=x(()=>{"use strict";Rn();Vo();G_e={tokenize:Ept}});function Tpt(e){let t=this,o=[],r=0,n,i,s;return a;function a(C){if(r<o.length){let E=o[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,n&&y();let E=t.events.length,R=E,I;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){I=t.events[R][1].end;break}b(r);let S=E;for(;S<t.events.length;)t.events[S][1].end=Object.assign({},I),S++;return jn(t.events,R+1,0,t.events.slice(E)),t.events.length=S,c(C)}return a(C)}function c(C){if(r===o.length){if(!n)return f(C);if(n.currentConstruct&&n.currentConstruct.concrete)return g(C);t.interrupt=!!(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($_e,d,u)(C)}function d(C){return n&&y(),b(r),f(C)}function u(C){return t.parser.lazy[t.now().line]=r!==o.length,s=t.now().offset,g(C)}function f(C){return t.containerState={},e.attempt($_e,h,g)(C)}function h(C){return r++,o.push([t.currentConstruct,t.containerState]),f(C)}function g(C){if(C===null){n&&y(),b(0),e.consume(C);return}return n=n||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:n}),m(C)}function m(C){if(C===null){v(e.exit("chunkFlow"),!0),b(0),e.consume(C);return}return it(C)?(e.consume(C),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),m)}function v(C,E){let R=t.sliceStream(C);if(E&&R.push(null),C.previous=i,i&&(i.next=C),i=C,n.defineSkip(C.start),n.write(R),t.parser.lazy[C.start.line]){let I=n.events.length;for(;I--;)if(n.events[I][1].start.offset<s&&(!n.events[I][1].end||n.events[I][1].end.offset>s))return;let S=t.events.length,_=S,T,k;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(T){k=t.events[_][1].end;break}T=!0}for(b(r),I=S;I<t.events.length;)t.events[I][1].end=Object.assign({},k),I++;jn(t.events,_+1,0,t.events.slice(S)),t.events.length=I}}function b(C){let E=o.length;for(;E-- >C;){let R=o[E];t.containerState=R[1],R[0].exit.call(t,e)}o.length=C}function y(){n.write([null]),i=void 0,n=void 0,t.containerState._closeFlow=void 0}}function kpt(e,t,o){return At(e,e.attempt(this.parser.constructs.document,t,o),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var W_e,$_e,j_e=x(()=>{"use strict";Rn();Vo();tf();W_e={tokenize:Tpt},$_e={tokenize:kpt}});function gx(e){if(e===null||vo(e)||Md(e))return 1;if(wm(e))return 2}var mG=x(()=>{"use strict";Vo()});function Qp(e,t,o){let r=[],n=-1;for(;++n<e.length;){let i=e[n].resolveAll;i&&!r.includes(i)&&(t=i(t,o),r.push(i))}return t}var xI=x(()=>{"use strict"});function Rpt(e,t){let o=-1,r,n,i,s,a,l,c,d;for(;++o<e.length;)if(e[o][0]==="enter"&&e[o][1].type==="attentionSequence"&&e[o][1]._close){for(r=o;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[o][1]).charCodeAt(0)){if((e[r][1]._close||e[o][1]._open)&&(e[o][1].end.offset-e[o][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[o][1].end.offset-e[o][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[o][1].end.offset-e[o][1].start.offset>1?2:1;let u=Object.assign({},e[r][1].end),f=Object.assign({},e[o][1].start);K_e(u,-l),K_e(f,l),s={type:l>1?"strongSequence":"emphasisSequence",start:u,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[o][1].start),end:f},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[o][1].start)},n={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[o][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ks(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ks(c,[["enter",n,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=Ks(c,Qp(t.parser.constructs.insideSpan.null,e.slice(r+1,o),t)),c=Ks(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",n,t]]),e[o][1].end.offset-e[o][1].start.offset?(d=2,c=Ks(c,[["enter",e[o][1],t],["exit",e[o][1],t]])):d=0,jn(e,r-1,o-r+3,c),o=r+c.length-d-2;break}}for(o=-1;++o<e.length;)e[o][1].type==="attentionSequence"&&(e[o][1].type="data");return e}function Dpt(e,t){let o=this.parser.constructs.attentionMarkers.null,r=this.previous,n=gx(r),i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;let c=e.exit("attentionSequence"),d=gx(l),u=!d||d===2&&n||o.includes(l),f=!n||n===2&&d||o.includes(r);return c._open=!!(i===42?u:u&&(n||!f)),c._close=!!(i===42?f:f&&(d||!u)),t(l)}}function K_e(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var CI,q_e=x(()=>{"use strict";tf();mG();xI();CI={name:"attention",tokenize:Dpt,resolveAll:Rpt}});function Ppt(e,t,o){let r=0;return n;function n(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return si(h)?(e.consume(h),s):h===64?o(h):c(h)}function s(h){return h===43||h===45||h===46||ai(h)?(r=1,a(h)):c(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||ai(h))&&r++<32?(e.consume(h),a):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Cm(h)?o(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),d):z_e(h)?(e.consume(h),c):o(h)}function d(h){return ai(h)?u(h):o(h)}function u(h){return h===46?(e.consume(h),r=0,d):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):f(h)}function f(h){if((h===45||ai(h))&&r++<63){let g=h===45?f:u;return e.consume(h),g}return o(h)}}var vG,Y_e=x(()=>{"use strict";Vo();vG={name:"autolink",tokenize:Ppt}});function Apt(e,t,o){return r;function r(i){return Ft(i)?At(e,n,"linePrefix")(i):n(i)}function n(i){return i===null||it(i)?t(i):o(i)}}var Nd,jP=x(()=>{"use strict";Rn();Vo();Nd={tokenize:Apt,partial:!0}});function Opt(e,t,o){let r=this;return n;function n(s){if(s===62){let a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return o(s)}function i(s){return Ft(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Mpt(e,t,o){let r=this;return n;function n(s){return Ft(s)?At(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(KP,t,o)(s)}}function Npt(e){e.exit("blockQuote")}var KP,X_e=x(()=>{"use strict";Rn();Vo();KP={name:"blockQuote",tokenize:Opt,continuation:{tokenize:Mpt},exit:Npt}});function Fpt(e,t,o){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),n}function n(i){return V_e(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):o(i)}}var qP,Q_e=x(()=>{"use strict";Vo();qP={name:"characterEscape",tokenize:Fpt}});function Lpt(e,t,o){let r=this,n=0,i,s;return a;function a(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=ai,d(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=H_e,d):(e.enter("characterReferenceValue"),i=7,s=yI,d(u))}function d(u){if(u===59&&n){let f=e.exit("characterReferenceValue");return s===ai&&!px(r.sliceSerialize(f))?o(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(u)&&n++<i?(e.consume(u),d):o(u)}}var YP,J_e=x(()=>{"use strict";UP();Vo();YP={name:"characterReference",tokenize:Lpt}});function Bpt(e,t,o){let r=this,n={tokenize:R,partial:!0},i=0,s=0,a;return l;function l(I){return c(I)}function c(I){let S=r.events[r.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,a=I,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(I)}function d(I){return I===a?(s++,e.consume(I),d):s<3?o(I):(e.exit("codeFencedFenceSequence"),Ft(I)?At(e,u,"whitespace")(I):u(I))}function u(I){return I===null||it(I)?(e.exit("codeFencedFence"),r.interrupt?t(I):e.check(Z_e,m,E)(I)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(I))}function f(I){return I===null||it(I)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(I)):Ft(I)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),At(e,h,"whitespace")(I)):I===96&&I===a?o(I):(e.consume(I),f)}function h(I){return I===null||it(I)?u(I):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(I))}function g(I){return I===null||it(I)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(I)):I===96&&I===a?o(I):(e.consume(I),g)}function m(I){return e.attempt(n,E,v)(I)}function v(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),b}function b(I){return i>0&&Ft(I)?At(e,y,"linePrefix",i+1)(I):y(I)}function y(I){return I===null||it(I)?e.check(Z_e,m,E)(I):(e.enter("codeFlowValue"),C(I))}function C(I){return I===null||it(I)?(e.exit("codeFlowValue"),y(I)):(e.consume(I),C)}function E(I){return e.exit("codeFenced"),t(I)}function R(I,S,_){let T=0;return k;function k(L){return I.enter("lineEnding"),I.consume(L),I.exit("lineEnding"),D}function D(L){return I.enter("codeFencedFence"),Ft(L)?At(I,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):A(L)}function A(L){return L===a?(I.enter("codeFencedFenceSequence"),P(L)):_(L)}function P(L){return L===a?(T++,I.consume(L),P):T>=s?(I.exit("codeFencedFenceSequence"),Ft(L)?At(I,z,"whitespace")(L):z(L)):_(L)}function z(L){return L===null||it(L)?(I.exit("codeFencedFence"),S(L)):_(L)}}}function zpt(e,t,o){let r=this;return n;function n(s){return s===null?o(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?o(s):t(s)}}var Z_e,XP,eSe=x(()=>{"use strict";Rn();Vo();Z_e={tokenize:zpt,partial:!0},XP={name:"codeFenced",tokenize:Bpt,concrete:!0}});function Vpt(e,t,o){let r=this;return n;function n(c){return e.enter("codeIndented"),At(e,i,"linePrefix",5)(c)}function i(c){let d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):o(c)}function s(c){return c===null?l(c):it(c)?e.attempt(Hpt,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||it(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function Gpt(e,t,o){let r=this;return n;function n(s){return r.parser.lazy[r.now().line]?o(s):it(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n):At(e,i,"linePrefix",5)(s)}function i(s){let a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):it(s)?n(s):o(s)}}var wI,Hpt,tSe=x(()=>{"use strict";Rn();Vo();wI={name:"codeIndented",tokenize:Vpt},Hpt={tokenize:Gpt,partial:!0}});function Upt(e){let t=e.length-4,o=3,r,n;if((e[o][1].type==="lineEnding"||e[o][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=o;++r<t;)if(e[r][1].type==="codeTextData"){e[o][1].type="codeTextPadding",e[t][1].type="codeTextPadding",o+=2,t-=2;break}}for(r=o-1,t++;++r<=t;)n===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(n=r):(r===t||e[r][1].type==="lineEnding")&&(e[n][1].type="codeTextData",r!==n+2&&(e[n][1].end=e[r-1][1].end,e.splice(n+2,r-n-2),t-=r-n-2,r=n+2),n=void 0);return e}function $pt(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Wpt(e,t,o){let r=this,n=0,i,s;return a;function a(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),n++,l):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?o(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(s=e.enter("codeTextSequence"),i=0,u(f)):it(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(f))}function d(f){return f===null||f===32||f===96||it(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),d)}function u(f){return f===96?(e.consume(f),i++,u):i===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",d(f))}}var bG,oSe=x(()=>{"use strict";Vo();bG={name:"codeText",tokenize:Wpt,resolve:Upt,previous:$pt}});function _I(e,t){let o=0;if(t.length<1e4)e.push(...t);else for(;o<t.length;)e.push(...t.slice(o,o+1e4)),o+=1e4}var QP,rSe=x(()=>{"use strict";QP=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,o){let r=o??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,o,r){let n=o||0;this.setCursor(Math.trunc(t));let i=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);return r&&_I(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),_I(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),_I(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let o=this.left.splice(t,Number.POSITIVE_INFINITY);_I(this.right,o.reverse())}else{let o=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);_I(this.left,o.reverse())}}}});function JP(e){let t={},o=-1,r,n,i,s,a,l,c,d=new QP(e);for(;++o<d.length;){for(;o in t;)o=t[o];if(r=d.get(o),o&&r[1].type==="chunkFlow"&&d.get(o-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,jpt(d,o)),o=t[o],c=!0);else if(r[1]._container){for(i=o,n=void 0;i--&&(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(n&&(d.get(n)[1].type="lineEndingBlank"),s[1].type="lineEnding",n=i);n&&(r[1].end=Object.assign({},d.get(n)[1].start),a=d.slice(n,o),a.unshift(r),d.splice(n,o-n+1,a))}}return jn(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function jpt(e,t){let o=e.get(t)[1],r=e.get(t)[2],n=t-1,i=[],s=o._tokenizer||r.parser[o.contentType](o.start),a=s.events,l=[],c={},d,u,f=-1,h=o,g=0,m=0,v=[m];for(;h;){for(;e.get(++n)[1]!==h;);i.push(n),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),u&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),u=h,h=h.next}for(h=o;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(m=f+1,v.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),f=v.length;f--;){let b=a.slice(v[f],v[f+1]),y=i.pop();l.push([y,y+b.length-1]),e.splice(y,2,b)}for(l.reverse(),f=-1;++f<l.length;)c[g+l[f][0]]=g+l[f][1],g+=l[f][1]-l[f][0]-1;return c}var yG=x(()=>{"use strict";tf();rSe()});function qpt(e){return JP(e),e}function Ypt(e,t){let o;return r;function r(a){return e.enter("content"),o=e.enter("chunkContent",{contentType:"content"}),n(a)}function n(a){return a===null?i(a):it(a)?e.check(Kpt,s,i)(a):(e.consume(a),n)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),o.next=e.enter("chunkContent",{contentType:"content",previous:o}),o=o.next,n}}function Xpt(e,t,o){let r=this;return n;function n(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),At(e,i,"linePrefix")}function i(s){if(s===null||it(s))return o(s);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,o,t)(s)}}var xG,Kpt,nSe=x(()=>{"use strict";Rn();Vo();yG();xG={tokenize:Ypt,resolve:qpt},Kpt={tokenize:Xpt,partial:!0}});function ZP(e,t,o,r,n,i,s,a,l){let c=l||Number.POSITIVE_INFINITY,d=0;return u;function u(b){return b===60?(e.enter(r),e.enter(n),e.enter(i),e.consume(b),e.exit(i),f):b===null||b===32||b===41||Cm(b)?o(b):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(b))}function f(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(n),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===62?(e.exit("chunkString"),e.exit(a),f(b)):b===null||b===60||it(b)?o(b):(e.consume(b),b===92?g:h)}function g(b){return b===60||b===62||b===92?(e.consume(b),h):h(b)}function m(b){return!d&&(b===null||b===41||vo(b))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(b)):d<c&&b===40?(e.consume(b),d++,m):b===41?(e.consume(b),d--,m):b===null||b===32||b===40||Cm(b)?o(b):(e.consume(b),b===92?v:m)}function v(b){return b===40||b===41||b===92?(e.consume(b),m):m(b)}}var CG=x(()=>{"use strict";Vo()});function eA(e,t,o,r,n,i){let s=this,a=0,l;return c;function c(h){return e.enter(r),e.enter(n),e.consume(h),e.exit(n),e.enter(i),d}function d(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?o(h):h===93?(e.exit(i),e.enter(n),e.consume(h),e.exit(n),e.exit(r),t):it(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===null||h===91||h===93||it(h)||a++>999?(e.exit("chunkString"),d(h)):(e.consume(h),l||(l=!Ft(h)),h===92?f:u)}function f(h){return h===91||h===92||h===93?(e.consume(h),a++,u):u(h)}}var wG=x(()=>{"use strict";Vo()});function tA(e,t,o,r,n,i){let s;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(n),e.consume(f),e.exit(n),s=f===40?41:f,l):o(f)}function l(f){return f===s?(e.enter(n),e.consume(f),e.exit(n),e.exit(r),t):(e.enter(i),c(f))}function c(f){return f===s?(e.exit(i),l(s)):f===null?o(f):it(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),At(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===s||f===null||it(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?u:d)}function u(f){return f===s||f===92?(e.consume(f),d):d(f)}}var _G=x(()=>{"use strict";Rn();Vo()});function _m(e,t){let o;return r;function r(n){return it(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),o=!0,r):Ft(n)?At(e,r,o?"linePrefix":"lineSuffix")(n):t(n)}}var SG=x(()=>{"use strict";Rn();Vo()});function Jpt(e,t,o){let r=this,n;return i;function i(h){return e.enter("definition"),s(h)}function s(h){return eA.call(r,e,a,o,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return n=_s(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):o(h)}function l(h){return vo(h)?_m(e,c)(h):c(h)}function c(h){return ZP(e,d,o,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(Qpt,u,u)(h)}function u(h){return Ft(h)?At(e,f,"whitespace")(h):f(h)}function f(h){return h===null||it(h)?(e.exit("definition"),r.parser.defined.push(n),t(h)):o(h)}}function Zpt(e,t,o){return r;function r(a){return vo(a)?_m(e,n)(a):o(a)}function n(a){return tA(e,i,o,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Ft(a)?At(e,s,"whitespace")(a):s(a)}function s(a){return a===null||it(a)?t(a):o(a)}}var IG,Qpt,iSe=x(()=>{"use strict";CG();wG();Rn();_G();SG();Vo();hx();IG={name:"definition",tokenize:Jpt},Qpt={tokenize:Zpt,partial:!0}});function eht(e,t,o){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),n}function n(i){return it(i)?(e.exit("hardBreakEscape"),t(i)):o(i)}}var EG,sSe=x(()=>{"use strict";Vo();EG={name:"hardBreakEscape",tokenize:eht}});function tht(e,t){let o=e.length-2,r=3,n,i;return e[r][1].type==="whitespace"&&(r+=2),o-2>r&&e[o][1].type==="whitespace"&&(o-=2),e[o][1].type==="atxHeadingSequence"&&(r===o-1||o-4>r&&e[o-2][1].type==="whitespace")&&(o-=r+1===o?2:4),o>r&&(n={type:"atxHeadingText",start:e[r][1].start,end:e[o][1].end},i={type:"chunkText",start:e[r][1].start,end:e[o][1].end,contentType:"text"},jn(e,r,o-r+1,[["enter",n,t],["enter",i,t],["exit",i,t],["exit",n,t]])),e}function oht(e,t,o){let r=0;return n;function n(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||vo(d)?(e.exit("atxHeadingSequence"),a(d)):o(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||it(d)?(e.exit("atxHeading"),t(d)):Ft(d)?At(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||vo(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}var TG,aSe=x(()=>{"use strict";Rn();Vo();tf();TG={name:"headingAtx",tokenize:oht,resolve:tht}});var lSe,kG,cSe=x(()=>{"use strict";lSe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],kG=["pre","script","style","textarea"]});function iht(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function sht(e,t,o){let r=this,n,i,s,a,l;return c;function c(V){return d(V)}function d(V){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(V),u}function u(V){return V===33?(e.consume(V),f):V===47?(e.consume(V),i=!0,m):V===63?(e.consume(V),n=3,r.interrupt?t:B):si(V)?(e.consume(V),s=String.fromCharCode(V),v):o(V)}function f(V){return V===45?(e.consume(V),n=2,h):V===91?(e.consume(V),n=5,a=0,g):si(V)?(e.consume(V),n=4,r.interrupt?t:B):o(V)}function h(V){return V===45?(e.consume(V),r.interrupt?t:B):o(V)}function g(V){let ie="CDATA[";return V===ie.charCodeAt(a++)?(e.consume(V),a===ie.length?r.interrupt?t:A:g):o(V)}function m(V){return si(V)?(e.consume(V),s=String.fromCharCode(V),v):o(V)}function v(V){if(V===null||V===47||V===62||vo(V)){let ie=V===47,de=s.toLowerCase();return!ie&&!i&&kG.includes(de)?(n=1,r.interrupt?t(V):A(V)):lSe.includes(s.toLowerCase())?(n=6,ie?(e.consume(V),b):r.interrupt?t(V):A(V)):(n=7,r.interrupt&&!r.parser.lazy[r.now().line]?o(V):i?y(V):C(V))}return V===45||ai(V)?(e.consume(V),s+=String.fromCharCode(V),v):o(V)}function b(V){return V===62?(e.consume(V),r.interrupt?t:A):o(V)}function y(V){return Ft(V)?(e.consume(V),y):k(V)}function C(V){return V===47?(e.consume(V),k):V===58||V===95||si(V)?(e.consume(V),E):Ft(V)?(e.consume(V),C):k(V)}function E(V){return V===45||V===46||V===58||V===95||ai(V)?(e.consume(V),E):R(V)}function R(V){return V===61?(e.consume(V),I):Ft(V)?(e.consume(V),R):C(V)}function I(V){return V===null||V===60||V===61||V===62||V===96?o(V):V===34||V===39?(e.consume(V),l=V,S):Ft(V)?(e.consume(V),I):_(V)}function S(V){return V===l?(e.consume(V),l=null,T):V===null||it(V)?o(V):(e.consume(V),S)}function _(V){return V===null||V===34||V===39||V===47||V===60||V===61||V===62||V===96||vo(V)?R(V):(e.consume(V),_)}function T(V){return V===47||V===62||Ft(V)?C(V):o(V)}function k(V){return V===62?(e.consume(V),D):o(V)}function D(V){return V===null||it(V)?A(V):Ft(V)?(e.consume(V),D):o(V)}function A(V){return V===45&&n===2?(e.consume(V),H):V===60&&n===1?(e.consume(V),j):V===62&&n===4?(e.consume(V),ne):V===63&&n===3?(e.consume(V),B):V===93&&n===5?(e.consume(V),q):it(V)&&(n===6||n===7)?(e.exit("htmlFlowData"),e.check(rht,Q,P)(V)):V===null||it(V)?(e.exit("htmlFlowData"),P(V)):(e.consume(V),A)}function P(V){return e.check(nht,z,Q)(V)}function z(V){return e.enter("lineEnding"),e.consume(V),e.exit("lineEnding"),L}function L(V){return V===null||it(V)?P(V):(e.enter("htmlFlowData"),A(V))}function H(V){return V===45?(e.consume(V),B):A(V)}function j(V){return V===47?(e.consume(V),s="",U):A(V)}function U(V){if(V===62){let ie=s.toLowerCase();return kG.includes(ie)?(e.consume(V),ne):A(V)}return si(V)&&s.length<8?(e.consume(V),s+=String.fromCharCode(V),U):A(V)}function q(V){return V===93?(e.consume(V),B):A(V)}function B(V){return V===62?(e.consume(V),ne):V===45&&n===2?(e.consume(V),B):A(V)}function ne(V){return V===null||it(V)?(e.exit("htmlFlowData"),Q(V)):(e.consume(V),ne)}function Q(V){return e.exit("htmlFlow"),t(V)}}function aht(e,t,o){let r=this;return n;function n(s){return it(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):o(s)}function i(s){return r.parser.lazy[r.now().line]?o(s):t(s)}}function lht(e,t,o){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(Nd,t,o)}}var RG,rht,nht,dSe=x(()=>{"use strict";Vo();cSe();jP();RG={name:"htmlFlow",tokenize:sht,resolveTo:iht,concrete:!0},rht={tokenize:lht,partial:!0},nht={tokenize:aht,partial:!0}});function cht(e,t,o){let r=this,n,i,s;return a;function a(B){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(B),l}function l(B){return B===33?(e.consume(B),c):B===47?(e.consume(B),R):B===63?(e.consume(B),C):si(B)?(e.consume(B),_):o(B)}function c(B){return B===45?(e.consume(B),d):B===91?(e.consume(B),i=0,g):si(B)?(e.consume(B),y):o(B)}function d(B){return B===45?(e.consume(B),h):o(B)}function u(B){return B===null?o(B):B===45?(e.consume(B),f):it(B)?(s=u,j(B)):(e.consume(B),u)}function f(B){return B===45?(e.consume(B),h):u(B)}function h(B){return B===62?H(B):B===45?f(B):u(B)}function g(B){let ne="CDATA[";return B===ne.charCodeAt(i++)?(e.consume(B),i===ne.length?m:g):o(B)}function m(B){return B===null?o(B):B===93?(e.consume(B),v):it(B)?(s=m,j(B)):(e.consume(B),m)}function v(B){return B===93?(e.consume(B),b):m(B)}function b(B){return B===62?H(B):B===93?(e.consume(B),b):m(B)}function y(B){return B===null||B===62?H(B):it(B)?(s=y,j(B)):(e.consume(B),y)}function C(B){return B===null?o(B):B===63?(e.consume(B),E):it(B)?(s=C,j(B)):(e.consume(B),C)}function E(B){return B===62?H(B):C(B)}function R(B){return si(B)?(e.consume(B),I):o(B)}function I(B){return B===45||ai(B)?(e.consume(B),I):S(B)}function S(B){return it(B)?(s=S,j(B)):Ft(B)?(e.consume(B),S):H(B)}function _(B){return B===45||ai(B)?(e.consume(B),_):B===47||B===62||vo(B)?T(B):o(B)}function T(B){return B===47?(e.consume(B),H):B===58||B===95||si(B)?(e.consume(B),k):it(B)?(s=T,j(B)):Ft(B)?(e.consume(B),T):H(B)}function k(B){return B===45||B===46||B===58||B===95||ai(B)?(e.consume(B),k):D(B)}function D(B){return B===61?(e.consume(B),A):it(B)?(s=D,j(B)):Ft(B)?(e.consume(B),D):T(B)}function A(B){return B===null||B===60||B===61||B===62||B===96?o(B):B===34||B===39?(e.consume(B),n=B,P):it(B)?(s=A,j(B)):Ft(B)?(e.consume(B),A):(e.consume(B),z)}function P(B){return B===n?(e.consume(B),n=void 0,L):B===null?o(B):it(B)?(s=P,j(B)):(e.consume(B),P)}function z(B){return B===null||B===34||B===39||B===60||B===61||B===96?o(B):B===47||B===62||vo(B)?T(B):(e.consume(B),z)}function L(B){return B===47||B===62||vo(B)?T(B):o(B)}function H(B){return B===62?(e.consume(B),e.exit("htmlTextData"),e.exit("htmlText"),t):o(B)}function j(B){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),U}function U(B){return Ft(B)?At(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):q(B)}function q(B){return e.enter("htmlTextData"),s(B)}}var DG,uSe=x(()=>{"use strict";Rn();Vo();DG={name:"htmlText",tokenize:cht}});function pht(e){let t=-1;for(;++t<e.length;){let o=e[t][1];(o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd")&&(e.splice(t+1,o.type==="labelImage"?4:2),o.type="data",t++)}return e}function hht(e,t){let o=e.length,r=0,n,i,s,a;for(;o--;)if(n=e[o][1],i){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;e[o][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(s){if(e[o][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(i=o,n.type!=="labelLink")){r=2;break}}else n.type==="labelEnd"&&(s=o);let l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[s][1].end)},d={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=Ks(a,e.slice(i+1,i+r+3)),a=Ks(a,[["enter",d,t]]),a=Ks(a,Qp(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=Ks(a,[["exit",d,t],e[s-2],e[s-1],["exit",c,t]]),a=Ks(a,e.slice(s+1)),a=Ks(a,[["exit",l,t]]),jn(e,i,e.length,a),e}function ght(e,t,o){let r=this,n=r.events.length,i,s;for(;n--;)if((r.events[n][1].type==="labelImage"||r.events[n][1].type==="labelLink")&&!r.events[n][1]._balanced){i=r.events[n][1];break}return a;function a(f){return i?i._inactive?u(f):(s=r.parser.defined.includes(_s(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):o(f)}function l(f){return f===40?e.attempt(dht,d,s?d:u)(f):f===91?e.attempt(uht,d,s?c:u)(f):s?d(f):u(f)}function c(f){return e.attempt(fht,d,u)(f)}function d(f){return t(f)}function u(f){return i._balanced=!0,o(f)}}function mht(e,t,o){return r;function r(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),n}function n(u){return vo(u)?_m(e,i)(u):i(u)}function i(u){return u===41?d(u):ZP(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function s(u){return vo(u)?_m(e,l)(u):d(u)}function a(u){return o(u)}function l(u){return u===34||u===39||u===40?tA(e,c,o,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):d(u)}function c(u){return vo(u)?_m(e,d)(u):d(u)}function d(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):o(u)}}function vht(e,t,o){let r=this;return n;function n(a){return eA.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(_s(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):o(a)}function s(a){return o(a)}}function bht(e,t,o){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),n}function n(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):o(i)}}var Sm,dht,uht,fht,oA=x(()=>{"use strict";CG();wG();_G();SG();Vo();tf();hx();xI();Sm={name:"labelEnd",tokenize:ght,resolveTo:hht,resolveAll:pht},dht={tokenize:mht},uht={tokenize:vht},fht={tokenize:bht}});function yht(e,t,o){let r=this;return n;function n(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):o(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?o(a):t(a)}}var PG,fSe=x(()=>{"use strict";oA();PG={name:"labelStartImage",tokenize:yht,resolveAll:Sm.resolveAll}});function xht(e,t,o){let r=this;return n;function n(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?o(s):t(s)}}var AG,pSe=x(()=>{"use strict";oA();AG={name:"labelStartLink",tokenize:xht,resolveAll:Sm.resolveAll}});function Cht(e,t){return o;function o(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),At(e,t,"linePrefix")}}var SI,hSe=x(()=>{"use strict";Rn();SI={name:"lineEnding",tokenize:Cht}});function wht(e,t,o){let r=0,n;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return n=c,a(c)}function a(c){return c===n?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||it(c))?(e.exit("thematicBreak"),t(c)):o(c)}function l(c){return c===n?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Ft(c)?At(e,a,"whitespace")(c):a(c))}}var Im,OG=x(()=>{"use strict";Rn();Vo();Im={name:"thematicBreak",tokenize:wht}});function Iht(e,t,o){let r=this,n=r.events[r.events.length-1],i=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,s=0;return a;function a(h){let g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:yI(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Im,o,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return o(h)}function l(h){return yI(h)&&++s<10?(e.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):o(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Nd,r.interrupt?o:d,e.attempt(_ht,f,u))}function d(h){return r.containerState.initialBlankLine=!0,i++,f(h)}function u(h){return Ft(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):o(h)}function f(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Eht(e,t,o){let r=this;return r.containerState._closeFlow=void 0,e.check(Nd,n,i);function n(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,At(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Ft(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Sht,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,At(e,e.attempt(Ss,t,o),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Tht(e,t,o){let r=this;return At(e,n,"listItemIndent",r.containerState.size+1);function n(i){let s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):o(i)}}function kht(e){e.exit(this.containerState.type)}function Rht(e,t,o){let r=this;return At(e,n,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(i){let s=r.events[r.events.length-1];return!Ft(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):o(i)}}var Ss,_ht,Sht,gSe=x(()=>{"use strict";Rn();Vo();jP();OG();Ss={name:"list",tokenize:Iht,continuation:{tokenize:Eht},exit:kht},_ht={tokenize:Rht,partial:!0},Sht={tokenize:Tht,partial:!0}});function Dht(e,t){let o=e.length,r,n,i;for(;o--;)if(e[o][0]==="enter"){if(e[o][1].type==="content"){r=o;break}e[o][1].type==="paragraph"&&(n=o)}else e[o][1].type==="content"&&e.splice(o,1),!i&&e[o][1].type==="definition"&&(i=o);let s={type:"setextHeading",start:Object.assign({},e[n][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[n][1].type="setextHeadingText",i?(e.splice(n,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function Pht(e,t,o){let r=this,n;return i;function i(c){let d=r.events.length,u;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){u=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),n=c,s(c)):o(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===n?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Ft(c)?At(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||it(c)?(e.exit("setextHeadingLine"),t(c)):o(c)}}var rA,mSe=x(()=>{"use strict";Rn();Vo();rA={name:"setextUnderline",tokenize:Pht,resolveTo:Dht}});var nA=x(()=>{"use strict";q_e();Y_e();jP();X_e();Q_e();J_e();eSe();tSe();oSe();nSe();iSe();sSe();aSe();dSe();uSe();oA();fSe();pSe();hSe();gSe();mSe();OG()});function Aht(e){let t=this,o=e.attempt(Nd,r,e.attempt(this.parser.constructs.flowInitial,n,At(e,e.attempt(this.parser.constructs.flow,n,e.attempt(xG,n)),"linePrefix")));return o;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,o}function n(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,o}}var vSe,bSe=x(()=>{"use strict";nA();Rn();vSe={tokenize:Aht}});function wSe(e){return{tokenize:t,resolveAll:_Se(e==="text"?Oht:void 0)};function t(o){let r=this,n=this.parser.constructs[e],i=o.attempt(n,s,a);return s;function s(d){return c(d)?i(d):a(d)}function a(d){if(d===null){o.consume(d);return}return o.enter("data"),o.consume(d),l}function l(d){return c(d)?(o.exit("data"),i(d)):(o.consume(d),l)}function c(d){if(d===null)return!0;let u=n[d],f=-1;if(u)for(;++f<u.length;){let h=u[f];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function _Se(e){return t;function t(o,r){let n=-1,i;for(;++n<=o.length;)i===void 0?o[n]&&o[n][1].type==="data"&&(i=n,n++):(!o[n]||o[n][1].type!=="data")&&(n!==i+2&&(o[i][1].end=o[n-1][1].end,o.splice(i+2,n-i-2),n=i+2),i=void 0);return e?e(o,r):o}}function Oht(e,t){let o=0;for(;++o<=e.length;)if((o===e.length||e[o][1].type==="lineEnding")&&e[o-1][1].type==="data"){let r=e[o-1][1],n=t.sliceStream(r),i=n.length,s=-1,a=0,l;for(;i--;){let c=n[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(a){let c={type:o===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+i,_bufferIndex:i?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(o,0,["enter",c,t],["exit",c,t]),o+=2)}o++}return e}var ySe,xSe,CSe,MG=x(()=>{"use strict";ySe={resolveAll:_Se()},xSe=wSe("string"),CSe=wSe("text")});function SSe(e,t,o){let r=Object.assign(o?Object.assign({},o):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),n={},i=[],s=[],a=[],l=!0,c={consume:E,enter:R,exit:I,attempt:T(S),check:T(_),interrupt:T(_,{interrupt:!0})},d={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:m,sliceSerialize:g,now:v,defineSkip:b,write:h},u=t.tokenize.call(d,c),f;return t.resolveAll&&i.push(t),d;function h(P){return s=Ks(s,P),y(),s[s.length-1]!==null?[]:(k(t,0),d.events=Qp(i,d.events,d),d.events)}function g(P,z){return Nht(m(P),z)}function m(P){return Mht(s,P)}function v(){let{line:P,column:z,offset:L,_index:H,_bufferIndex:j}=r;return{line:P,column:z,offset:L,_index:H,_bufferIndex:j}}function b(P){n[P.line]=P.column,A()}function y(){let P;for(;r._index<s.length;){let z=s[r._index];if(typeof z=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<z.length;)C(z.charCodeAt(r._bufferIndex));else C(z)}}function C(P){l=void 0,f=P,u=u(P)}function E(P){it(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,A()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=P,l=!0}function R(P,z){let L=z||{};return L.type=P,L.start=v(),d.events.push(["enter",L,d]),a.push(L),L}function I(P){let z=a.pop();return z.end=v(),d.events.push(["exit",z,d]),z}function S(P,z){k(P,z.from)}function _(P,z){z.restore()}function T(P,z){return L;function L(H,j,U){let q,B,ne,Q;return Array.isArray(H)?ie(H):"tokenize"in H?ie([H]):V(H);function V(Ce){return _e;function _e(Ge){let pt=Ge!==null&&Ce[Ge],Ue=Ge!==null&&Ce.null,tt=[...Array.isArray(pt)?pt:pt?[pt]:[],...Array.isArray(Ue)?Ue:Ue?[Ue]:[]];return ie(tt)(Ge)}}function ie(Ce){return q=Ce,B=0,Ce.length===0?U:de(Ce[B])}function de(Ce){return _e;function _e(Ge){return Q=D(),ne=Ce,Ce.partial||(d.currentConstruct=Ce),Ce.name&&d.parser.constructs.disable.null.includes(Ce.name)?ke(Ge):Ce.tokenize.call(z?Object.assign(Object.create(d),z):d,c,he,ke)(Ge)}}function he(Ce){return l=!0,P(ne,Q),j}function ke(Ce){return l=!0,Q.restore(),++B<q.length?de(q[B]):U}}}function k(P,z){P.resolveAll&&!i.includes(P)&&i.push(P),P.resolve&&jn(d.events,z,d.events.length-z,P.resolve(d.events.slice(z),d)),P.resolveTo&&(d.events=P.resolveTo(d.events,d))}function D(){let P=v(),z=d.previous,L=d.currentConstruct,H=d.events.length,j=Array.from(a);return{restore:U,from:H};function U(){r=P,d.previous=z,d.currentConstruct=L,d.events.length=H,a=j,A()}}function A(){r.line in n&&r.column<2&&(r.column=n[r.line],r.offset+=n[r.line]-1)}}function Mht(e,t){let o=t.start._index,r=t.start._bufferIndex,n=t.end._index,i=t.end._bufferIndex,s;if(o===n)s=[e[o].slice(r,i)];else{if(s=e.slice(o,n),r>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[n].slice(0,i))}return s}function Nht(e,t){let o=-1,r=[],n;for(;++o<e.length;){let i=e[o],s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
63
63
|
`;break}case-3:{s=`\r
|
|
64
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&n)continue;s=" ";break}default:s=String.fromCharCode(i)}n=i===-2,r.push(s)}return r.join("")}var ISe=x(()=>{"use strict";Vo();tf();xI()});var NG={};_t(NG,{attentionMarkers:()=>Uht,contentInitial:()=>Lht,disable:()=>$ht,document:()=>Fht,flow:()=>zht,flowInitial:()=>Bht,insideSpan:()=>Ght,string:()=>Hht,text:()=>Vht});var Fht,Lht,Bht,zht,Hht,Vht,Ght,Uht,$ht,ESe=x(()=>{"use strict";nA();MG();Fht={42:Ss,43:Ss,45:Ss,48:Ss,49:Ss,50:Ss,51:Ss,52:Ss,53:Ss,54:Ss,55:Ss,56:Ss,57:Ss,62:KP},Lht={91:IG},Bht={[-2]:wI,[-1]:wI,32:wI},zht={35:TG,42:Im,45:[rA,Im],60:RG,61:rA,95:Im,96:XP,126:XP},Hht={38:YP,92:qP},Vht={[-5]:SI,[-4]:SI,[-3]:SI,33:PG,38:YP,42:CI,60:[vG,DG],91:AG,92:[EG,qP],93:Sm,95:CI,96:bG},Ght={null:[CI,ySe]},Uht={null:[42,95]},$ht={null:[]}});function FG(e){let o=$P([NG,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:o,content:n(G_e),document:n(W_e),flow:n(vSe),string:n(xSe),text:n(CSe)};return r;function n(i){return s;function s(a){return SSe(r,i,a)}}}var TSe=x(()=>{"use strict";hG();U_e();j_e();bSe();MG();ISe();ESe()});function LG(e){for(;!JP(e););return e}var kSe=x(()=>{"use strict";yG()});function BG(){let e=1,t="",o=!0,r;return n;function n(i,s,a){let l=[],c,d,u,f,h;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),u=0,t="",o&&(i.charCodeAt(0)===65279&&u++,o=void 0);u<i.length;){if(RSe.lastIndex=u,c=RSe.exec(i),f=c&&c.index!==void 0?c.index:i.length,h=i.charCodeAt(f),!c){t=i.slice(u);break}if(h===10&&u===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<f&&(l.push(i.slice(u,f)),e+=f-u),h){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=f+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}var RSe,DSe=x(()=>{"use strict";RSe=/[\0\t\n\r]/g});var PSe=x(()=>{"use strict";TSe();kSe();DSe()});function ASe(e){return e.replace(Wht,jht)}function jht(e,t,o){if(t)return t;if(o.charCodeAt(0)===35){let n=o.charCodeAt(1),i=n===120||n===88;return WP(o.slice(i?2:1),i?16:10)}return px(o)||e}var Wht,OSe=x(()=>{"use strict";UP();gG();Wht=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});function mx(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?MSe(e.position):"start"in e||"end"in e?MSe(e):"line"in e||"column"in e?zG(e):""}function zG(e){return NSe(e&&e.line)+":"+NSe(e&&e.column)}function MSe(e){return zG(e&&e.start)+"-"+zG(e&&e.end)}function NSe(e){return e&&typeof e=="number"?e:1}var FSe=x(()=>{"use strict"});var LSe=x(()=>{"use strict";FSe()});function HG(e,t,o){return typeof t!="string"&&(o=t,t=void 0),Kht(o)(LG(FG(o).document().write(BG()(e,t,!0))))}function Kht(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Pe),autolinkProtocol:T,autolinkEmail:T,atxHeading:i(so),blockQuote:i(Ge),characterEscape:T,characterReference:T,codeFenced:i(pt),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(pt,s),codeText:i(Ue,s),codeTextData:T,data:T,codeFlowValue:T,definition:i(tt),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(mt),hardBreakEscape:i(wt),hardBreakTrailing:i(wt),htmlFlow:i($e,s),htmlFlowData:T,htmlText:i($e,s),htmlTextData:T,image:i(pe),label:s,link:i(Pe),listItem:i(je),listItemValue:f,listOrdered:i(Se,u),listUnordered:i(Se),paragraph:i(ot),reference:V,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(so),strong:i(It),thematicBreak:i(ue)},exit:{atxHeading:l(),atxHeadingSequence:R,autolink:l(),autolinkEmail:_e,autolinkProtocol:Ce,blockQuote:l(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:he,characterReference:ke,codeFenced:l(v),codeFencedFence:m,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:k,codeIndented:l(b),codeText:l(L),codeTextData:k,data:k,definition:l(),definitionDestinationString:E,definitionLabelString:y,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(P),htmlFlowData:k,htmlText:l(z),htmlTextData:k,image:l(j),label:q,labelText:U,lineEnding:D,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ie,resourceDestinationString:B,resourceTitleString:ne,resource:Q,setextHeading:l(_),setextHeadingLineSequence:S,setextHeadingText:I,strong:l(),thematicBreak:l()}};HSe(t,(e||{}).mdastExtensions||[]);let o={};return r;function r(K){let te={type:"root",children:[]},be={stack:[te],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:d,data:o},nt=[],Ut=-1;for(;++Ut<K.length;)if(K[Ut][1].type==="listOrdered"||K[Ut][1].type==="listUnordered")if(K[Ut][0]==="enter")nt.push(Ut);else{let ro=nt.pop();Ut=n(K,ro,Ut)}for(Ut=-1;++Ut<K.length;){let ro=t[K[Ut][0]];zSe.call(ro,K[Ut][1].type)&&ro[K[Ut][1].type].call(Object.assign({sliceSerialize:K[Ut][2].sliceSerialize},be),K[Ut][1])}if(be.tokenStack.length>0){let ro=be.tokenStack[be.tokenStack.length-1];(ro[1]||BSe).call(be,void 0,ro[0])}for(te.position={start:Jp(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Jp(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},Ut=-1;++Ut<t.transforms.length;)te=t.transforms[Ut](te)||te;return te}function n(K,te,be){let nt=te-1,Ut=-1,ro=!1,Cr,wo,_o,Pr;for(;++nt<=be;){let ar=K[nt];switch(ar[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ar[0]==="enter"?Ut++:Ut--,Pr=void 0;break}case"lineEndingBlank":{ar[0]==="enter"&&(Cr&&!Pr&&!Ut&&!_o&&(_o=nt),Pr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pr=void 0}if(!Ut&&ar[0]==="enter"&&ar[1].type==="listItemPrefix"||Ut===-1&&ar[0]==="exit"&&(ar[1].type==="listUnordered"||ar[1].type==="listOrdered")){if(Cr){let nn=nt;for(wo=void 0;nn--;){let Gi=K[nn];if(Gi[1].type==="lineEnding"||Gi[1].type==="lineEndingBlank"){if(Gi[0]==="exit")continue;wo&&(K[wo][1].type="lineEndingBlank",ro=!0),Gi[1].type="lineEnding",wo=nn}else if(!(Gi[1].type==="linePrefix"||Gi[1].type==="blockQuotePrefix"||Gi[1].type==="blockQuotePrefixWhitespace"||Gi[1].type==="blockQuoteMarker"||Gi[1].type==="listItemIndent"))break}_o&&(!wo||_o<wo)&&(Cr._spread=!0),Cr.end=Object.assign({},wo?K[wo][1].start:ar[1].end),K.splice(wo||nt,0,["exit",Cr,ar[2]]),nt++,be++}if(ar[1].type==="listItemPrefix"){let nn={type:"listItem",_spread:!1,start:Object.assign({},ar[1].start),end:void 0};Cr=nn,K.splice(nt,0,["enter",nn,ar[2]]),nt++,be++,_o=void 0,Pr=!0}}}return K[te][1]._spread=ro,be}function i(K,te){return be;function be(nt){a.call(this,K(nt),nt),te&&te.call(this,nt)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(K,te,be){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([te,be]),K.position={start:Jp(te.start),end:void 0}}function l(K){return te;function te(be){K&&K.call(this,be),c.call(this,be)}}function c(K,te){let be=this.stack.pop(),nt=this.tokenStack.pop();if(nt)nt[0].type!==K.type&&(te?te.call(this,K,nt[0]):(nt[1]||BSe).call(this,K,nt[0]));else throw new Error("Cannot close `"+K.type+"` ("+mx({start:K.start,end:K.end})+"): it\u2019s not open");be.position.end=Jp(K.end)}function d(){return pG(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function f(K){if(this.data.expectingFirstListItemValue){let te=this.stack[this.stack.length-2];te.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function h(){let K=this.resume(),te=this.stack[this.stack.length-1];te.lang=K}function g(){let K=this.resume(),te=this.stack[this.stack.length-1];te.meta=K}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){let K=this.resume(),te=this.stack[this.stack.length-1];te.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){let K=this.resume(),te=this.stack[this.stack.length-1];te.value=K.replace(/(\r?\n|\r)$/g,"")}function y(K){let te=this.resume(),be=this.stack[this.stack.length-1];be.label=te,be.identifier=_s(this.sliceSerialize(K)).toLowerCase()}function C(){let K=this.resume(),te=this.stack[this.stack.length-1];te.title=K}function E(){let K=this.resume(),te=this.stack[this.stack.length-1];te.url=K}function R(K){let te=this.stack[this.stack.length-1];if(!te.depth){let be=this.sliceSerialize(K).length;te.depth=be}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function S(K){let te=this.stack[this.stack.length-1];te.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function T(K){let be=this.stack[this.stack.length-1].children,nt=be[be.length-1];(!nt||nt.type!=="text")&&(nt=We(),nt.position={start:Jp(K.start),end:void 0},be.push(nt)),this.stack.push(nt)}function k(K){let te=this.stack.pop();te.value+=this.sliceSerialize(K),te.position.end=Jp(K.end)}function D(K){let te=this.stack[this.stack.length-1];if(this.data.atHardBreak){let be=te.children[te.children.length-1];be.position.end=Jp(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(te.type)&&(T.call(this,K),k.call(this,K))}function A(){this.data.atHardBreak=!0}function P(){let K=this.resume(),te=this.stack[this.stack.length-1];te.value=K}function z(){let K=this.resume(),te=this.stack[this.stack.length-1];te.value=K}function L(){let K=this.resume(),te=this.stack[this.stack.length-1];te.value=K}function H(){let K=this.stack[this.stack.length-1];if(this.data.inReference){let te=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=te,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function j(){let K=this.stack[this.stack.length-1];if(this.data.inReference){let te=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=te,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function U(K){let te=this.sliceSerialize(K),be=this.stack[this.stack.length-2];be.label=ASe(te),be.identifier=_s(te).toLowerCase()}function q(){let K=this.stack[this.stack.length-1],te=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){let nt=K.children;be.children=nt}else be.alt=te}function B(){let K=this.resume(),te=this.stack[this.stack.length-1];te.url=K}function ne(){let K=this.resume(),te=this.stack[this.stack.length-1];te.title=K}function Q(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function ie(K){let te=this.resume(),be=this.stack[this.stack.length-1];be.label=te,be.identifier=_s(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function de(K){this.data.characterReferenceType=K.type}function he(K){let te=this.sliceSerialize(K),be=this.data.characterReferenceType,nt;be?(nt=WP(te,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):nt=px(te);let Ut=this.stack[this.stack.length-1];Ut.value+=nt}function ke(K){let te=this.stack.pop();te.position.end=Jp(K.end)}function Ce(K){k.call(this,K);let te=this.stack[this.stack.length-1];te.url=this.sliceSerialize(K)}function _e(K){k.call(this,K);let te=this.stack[this.stack.length-1];te.url="mailto:"+this.sliceSerialize(K)}function Ge(){return{type:"blockquote",children:[]}}function pt(){return{type:"code",lang:null,meta:null,value:""}}function Ue(){return{type:"inlineCode",value:""}}function tt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function mt(){return{type:"emphasis",children:[]}}function so(){return{type:"heading",depth:0,children:[]}}function wt(){return{type:"break"}}function $e(){return{type:"html",value:""}}function pe(){return{type:"image",title:null,url:"",alt:null}}function Pe(){return{type:"link",title:null,url:"",children:[]}}function Se(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function je(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function ot(){return{type:"paragraph",children:[]}}function It(){return{type:"strong",children:[]}}function We(){return{type:"text",value:""}}function ue(){return{type:"thematicBreak"}}}function Jp(e){return{line:e.line,column:e.column,offset:e.offset}}function HSe(e,t){let o=-1;for(;++o<t.length;){let r=t[o];Array.isArray(r)?HSe(e,r):qht(e,r)}}function qht(e,t){let o;for(o in t)if(zSe.call(t,o))switch(o){case"canContainEols":{let r=t[o];r&&e[o].push(...r);break}case"transforms":{let r=t[o];r&&e[o].push(...r);break}case"enter":case"exit":{let r=t[o];r&&Object.assign(e[o],r);break}}}function BSe(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+mx({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mx({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+mx({start:t.start,end:t.end})+") is still open")}var zSe,VSe=x(()=>{"use strict";F_e();PSe();gG();OSe();hx();UP();LSe();zSe={}.hasOwnProperty});var GSe=x(()=>{"use strict";VSe()});function VG(e,t){let o=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,n=o.indexOf(t);for(;n!==-1;)r++,n=o.indexOf(t,n+t.length);return r}var USe=x(()=>{"use strict"});function GG(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var $Se=x(()=>{"use strict"});function Yht(e){let t=[],o=-1;for(;++o<e.length;)t[o]=vx(e[o]);return iA(r);function r(...n){let i=-1;for(;++i<t.length;)if(t[i].apply(this,n))return!0;return!1}}function Xht(e){let t=e;return iA(o);function o(r){let n=r,i;for(i in e)if(n[i]!==t[i])return!1;return!0}}function Qht(e){return iA(t);function t(o){return o&&o.type===e}}function iA(e){return t;function t(o,r,n){return!!(Zht(o)&&e.call(this,o,typeof r=="number"?r:void 0,n||void 0))}}function Jht(){return!0}function Zht(e){return e!==null&&typeof e=="object"&&"type"in e}var vx,WSe=x(()=>{"use strict";vx=(function(e){if(e==null)return Jht;if(typeof e=="function")return iA(e);if(typeof e=="object")return Array.isArray(e)?Yht(e):Xht(e);if(typeof e=="string")return Qht(e);throw new Error("Expected function, string, or object as test")})});var UG=x(()=>{"use strict";WSe()});function WG(e,t,o,r){let n;typeof t=="function"&&typeof o!="function"?(r=o,o=t):n=t;let i=vx(n),s=r?-1:1;a(e,void 0,[])();function a(l,c,d){let u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){let h=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return f;function f(){let h=jSe,g,m,v;if((!t||i(l,c,d[d.length-1]||void 0))&&(h=egt(o(l,d)),h[0]===$G))return h;if("children"in l&&l.children){let b=l;if(b.children&&h[0]!==qSe)for(m=(r?b.children.length:-1)+s,v=d.concat(b);m>-1&&m<b.children.length;){let y=b.children[m];if(g=a(y,m,v)(),g[0]===$G)return g;m=typeof g[1]=="number"?g[1]:m+s}}return h}}}function egt(e){return Array.isArray(e)?e:typeof e=="number"?[KSe,e]:e==null?jSe:[e]}var jSe,KSe,$G,qSe,YSe=x(()=>{"use strict";UG();jSe=[],KSe=!0,$G=!1,qSe="skip"});var XSe=x(()=>{"use strict";YSe()});function jG(e,t,o){let n=vx((o||{}).ignore||[]),i=tgt(t),s=-1;for(;++s<i.length;)WG(e,"text",a);function a(c,d){let u=-1,f;for(;++u<d.length;){let h=d[u],g=f?f.children:void 0;if(n(h,g?g.indexOf(h):void 0,f))return;f=h}if(f)return l(c,d)}function l(c,d){let u=d[d.length-1],f=i[s][0],h=i[s][1],g=0,v=u.children.indexOf(c),b=!1,y=[];f.lastIndex=0;let C=f.exec(c.value);for(;C;){let E=C.index,R={index:C.index,input:C.input,stack:[...d,c]},I=h(...C,R);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?f.lastIndex=E+1:(g!==E&&y.push({type:"text",value:c.value.slice(g,E)}),Array.isArray(I)?y.push(...I):I&&y.push(I),g=E+C[0].length,b=!0),!f.global)break;C=f.exec(c.value)}return b?(g<c.value.length&&y.push({type:"text",value:c.value.slice(g)}),u.children.splice(v,1,...y)):y=[c],v+y.length}}function tgt(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let o=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<o.length;){let n=o[r];t.push([ogt(n[0]),rgt(n[1])])}return t}function ogt(e){return typeof e=="string"?new RegExp(GG(e),"g"):e}function rgt(e){return typeof e=="function"?e:function(){return e}}var QSe=x(()=>{"use strict";$Se();XSe();UG()});var JSe=x(()=>{"use strict";QSe()});function qG(){return{transforms:[cgt],enter:{literalAutolink:ngt,literalAutolinkEmail:KG,literalAutolinkHttp:KG,literalAutolinkWww:KG},exit:{literalAutolink:lgt,literalAutolinkEmail:agt,literalAutolinkHttp:igt,literalAutolinkWww:sgt}}}function ngt(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function KG(e){this.config.enter.autolinkProtocol.call(this,e)}function igt(e){this.config.exit.autolinkProtocol.call(this,e)}function sgt(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function agt(e){this.config.exit.autolinkEmail.call(this,e)}function lgt(e){this.exit(e)}function cgt(e){jG(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,dgt],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,ugt]],{ignore:["link","linkReference"]})}function dgt(e,t,o,r,n){let i="";if(!ZSe(n)||(/^w/i.test(t)&&(o=t+o,t="",i="http://"),!fgt(o)))return!1;let s=pgt(o+r);if(!s[0])return!1;let a={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function ugt(e,t,o,r){return!ZSe(r,!0)||/[-\d_]$/.test(o)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+o,children:[{type:"text",value:t+"@"+o}]}}function fgt(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function pgt(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let o=t[0],r=o.indexOf(")"),n=VG(e,"("),i=VG(e,")");for(;r!==-1&&n>i;)e+=o.slice(0,r+1),o=o.slice(r+1),r=o.indexOf(")"),i++;return[e,o]}function ZSe(e,t){let o=e.input.charCodeAt(e.index-1);return(e.index===0||Md(o)||wm(o))&&(!t||o!==47)}var eIe=x(()=>{"use strict";USe();Vo();JSe()});var tIe=x(()=>{"use strict";eIe()});function YG(){return{enter:{gfmFootnoteDefinition:ggt,gfmFootnoteDefinitionLabelString:mgt,gfmFootnoteCall:ygt,gfmFootnoteCallString:xgt},exit:{gfmFootnoteDefinition:bgt,gfmFootnoteDefinitionLabelString:vgt,gfmFootnoteCall:wgt,gfmFootnoteCallString:Cgt}}}function ggt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mgt(){this.buffer()}function vgt(e){let t=this.resume(),o=this.stack[this.stack.length-1];o.type,o.label=t,o.identifier=_s(this.sliceSerialize(e)).toLowerCase()}function bgt(e){this.exit(e)}function ygt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function xgt(){this.buffer()}function Cgt(e){let t=this.resume(),o=this.stack[this.stack.length-1];o.type,o.label=t,o.identifier=_s(this.sliceSerialize(e)).toLowerCase()}function wgt(e){this.exit(e)}function _gt(e,t,o,r){let n=o.createTracker(r),i=n.move("[^"),s=o.enter("footnoteReference"),a=o.enter("reference");return i+=n.move(o.safe(o.associationId(e),{...n.current(),before:i,after:"]"})),a(),s(),i+=n.move("]"),i}function Sgt(){return"["}var oIe=x(()=>{"use strict";hx();_gt.peek=Sgt});var rIe=x(()=>{"use strict";oIe()});function XG(){return{canContainEols:["delete"],enter:{strikethrough:Egt},exit:{strikethrough:Tgt}}}function Egt(e){this.enter({type:"delete",children:[]},e)}function Tgt(e){this.exit(e)}function kgt(e,t,o,r){let n=o.createTracker(r),i=o.enter("strikethrough"),s=n.move("~~");return s+=o.containerPhrasing(e,{...n.current(),before:s,after:"~"}),s+=n.move("~~"),i(),s}function Rgt(){return"~"}var nIe=x(()=>{"use strict";kgt.peek=Rgt});var iIe=x(()=>{"use strict";nIe()});function JG(){return{enter:{table:Pgt,tableData:sIe,tableHeader:sIe,tableRow:Ogt},exit:{codeText:Mgt,table:Agt,tableData:QG,tableHeader:QG,tableRow:QG}}}function Pgt(e){let t=e._align;this.enter({type:"table",align:t.map(function(o){return o==="none"?null:o}),children:[]},e),this.data.inTable=!0}function Agt(e){this.exit(e),this.data.inTable=void 0}function Ogt(e){this.enter({type:"tableRow",children:[]},e)}function QG(e){this.exit(e)}function sIe(e){this.enter({type:"tableCell",children:[]},e)}function Mgt(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ngt));let o=this.stack[this.stack.length-1];o.type,o.value=t,this.exit(e)}function Ngt(e,t){return t==="|"?t:e}var aIe=x(()=>{"use strict"});var lIe=x(()=>{"use strict";aIe()});function ZG(){return{exit:{taskListCheckValueChecked:cIe,taskListCheckValueUnchecked:cIe,paragraph:Lgt}}}function cIe(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Lgt(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let o=this.stack[this.stack.length-1];o.type;let r=o.children[0];if(r&&r.type==="text"){let n=t.children,i=-1,s;for(;++i<n.length;){let a=n[i];if(a.type==="paragraph"){s=a;break}}s===o&&(r.value=r.value.slice(1),r.value.length===0?o.children.shift():o.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,o.position.start=Object.assign({},r.position.start)))}}this.exit(e)}var dIe=x(()=>{"use strict"});var uIe=x(()=>{"use strict";dIe()});function e6(){return[qG(),YG(),XG(),JG(),ZG()]}var fIe=x(()=>{"use strict";tIe();rIe();iIe();lIe();uIe()});var pIe=x(()=>{"use strict";fIe()});function o6(){return{text:Fd}}function Vgt(e,t,o){let r=this,n,i;return s;function s(u){return!t6(u)||!CIe.call(r,r.previous)||r6(r.events)?o(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(u))}function a(u){return t6(u)?(e.consume(u),a):u===64?(e.consume(u),l):o(u)}function l(u){return u===46?e.check(Hgt,d,c)(u):u===45||u===95||ai(u)?(i=!0,e.consume(u),l):d(u)}function c(u){return e.consume(u),n=!0,l}function d(u){return i&&n&&si(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):o(u)}}function Ggt(e,t,o){let r=this;return n;function n(s){return s!==87&&s!==119||!yIe.call(r,r.previous)||r6(r.events)?o(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(zgt,e.attempt(hIe,e.attempt(gIe,i),o),o)(s))}function i(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function Ugt(e,t,o){let r=this,n="",i=!1;return s;function s(u){return(u===72||u===104)&&xIe.call(r,r.previous)&&!r6(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),n+=String.fromCodePoint(u),e.consume(u),a):o(u)}function a(u){if(si(u)&&n.length<5)return n+=String.fromCodePoint(u),e.consume(u),a;if(u===58){let f=n.toLowerCase();if(f==="http"||f==="https")return e.consume(u),l}return o(u)}function l(u){return u===47?(e.consume(u),i?c:(i=!0,l)):o(u)}function c(u){return u===null||Cm(u)||vo(u)||Md(u)||wm(u)?o(u):e.attempt(hIe,e.attempt(gIe,d),o)(u)}function d(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function $gt(e,t,o){let r=0;return n;function n(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),n):s===46&&r===3?(e.consume(s),i):o(s)}function i(s){return s===null?o(s):t(s)}}function Wgt(e,t,o){let r,n,i;return s;function s(c){return c===46||c===95?e.check(mIe,l,a)(c):c===null||vo(c)||Md(c)||c!==45&&wm(c)?l(c):(i=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(n=r,r=void 0),e.consume(c),s}function l(c){return n||r||!i?o(c):t(c)}}function jgt(e,t){let o=0,r=0;return n;function n(s){return s===40?(o++,e.consume(s),n):s===41&&r<o?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(mIe,t,i)(s):s===null||vo(s)||Md(s)?t(s):(e.consume(s),n)}function i(s){return s===41&&r++,e.consume(s),n}}function Kgt(e,t,o){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),i):a===93?(e.consume(a),n):a===60||a===null||vo(a)||Md(a)?t(a):o(a)}function n(a){return a===null||a===40||a===91||vo(a)||Md(a)?t(a):r(a)}function i(a){return si(a)?s(a):o(a)}function s(a){return a===59?(e.consume(a),r):si(a)?(e.consume(a),s):o(a)}}function qgt(e,t,o){return r;function r(i){return e.consume(i),n}function n(i){return ai(i)?o(i):t(i)}}function yIe(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||vo(e)}function xIe(e){return!si(e)}function CIe(e){return!(e===47||t6(e))}function t6(e){return e===43||e===45||e===46||e===95||ai(e)}function r6(e){let t=e.length,o=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){o=!0;break}if(r._gfmAutolinkLiteralWalkedInto){o=!1;break}}return e.length>0&&!o&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),o}var zgt,hIe,gIe,mIe,Hgt,vIe,bIe,of,Fd,Em,wIe=x(()=>{"use strict";Vo();zgt={tokenize:$gt,partial:!0},hIe={tokenize:Wgt,partial:!0},gIe={tokenize:jgt,partial:!0},mIe={tokenize:Kgt,partial:!0},Hgt={tokenize:qgt,partial:!0},vIe={tokenize:Ggt,previous:yIe},bIe={tokenize:Ugt,previous:xIe},of={tokenize:Vgt,previous:CIe},Fd={};Em=48;for(;Em<123;)Fd[Em]=of,Em++,Em===58?Em=65:Em===91&&(Em=97);Fd[43]=of;Fd[45]=of;Fd[46]=of;Fd[95]=of;Fd[72]=[of,bIe];Fd[104]=[of,bIe];Fd[87]=[of,vIe];Fd[119]=[of,vIe]});var _Ie=x(()=>{"use strict";wIe()});function n6(){return{document:{91:{tokenize:Zgt,continuation:{tokenize:emt},exit:tmt}},text:{91:{tokenize:Jgt},93:{add:"after",tokenize:Xgt,resolveTo:Qgt}}}}function Xgt(e,t,o){let r=this,n=r.events.length,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s;for(;n--;){let l=r.events[n][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return o(l);let c=_s(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?o(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Qgt(e,t){let o=e.length,r;for(;o--;)if(e[o][1].type==="labelImage"&&e[o][0]==="enter"){r=e[o][1];break}e[o+1][1].type="data",e[o+3][1].type="gfmFootnoteCallLabelMarker";let n={type:"gfmFootnoteCall",start:Object.assign({},e[o+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[o+3][1].end),end:Object.assign({},e[o+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[o+1],e[o+2],["enter",n,t],e[o+3],e[o+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",n,t]];return e.splice(o,e.length-o+1,...l),e}function Jgt(e,t,o){let r=this,n=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),i=0,s;return a;function a(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?o(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(i>999||u===93&&!s||u===null||u===91||vo(u))return o(u);if(u===93){e.exit("chunkString");let f=e.exit("gfmFootnoteCallString");return n.includes(_s(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):o(u)}return vo(u)||(s=!0),i++,e.consume(u),u===92?d:c}function d(u){return u===91||u===92||u===93?(e.consume(u),i++,c):c(u)}}function Zgt(e,t,o){let r=this,n=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),i,s=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):o(g)}function d(g){if(s>999||g===93&&!a||g===null||g===91||vo(g))return o(g);if(g===93){e.exit("chunkString");let m=e.exit("gfmFootnoteDefinitionLabelString");return i=_s(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return vo(g)||(a=!0),s++,e.consume(g),g===92?u:d}function u(g){return g===91||g===92||g===93?(e.consume(g),s++,d):d(g)}function f(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),n.includes(i)||n.push(i),At(e,h,"gfmFootnoteDefinitionWhitespace")):o(g)}function h(g){return t(g)}}function emt(e,t,o){return e.check(Nd,t,e.attempt(Ygt,t,o))}function tmt(e){e.exit("gfmFootnoteDefinition")}function omt(e,t,o){let r=this;return At(e,n,"gfmFootnoteDefinitionIndent",5);function n(i){let s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(i):o(i)}}var Ygt,SIe=x(()=>{"use strict";nA();Rn();Vo();hx();Ygt={tokenize:omt,partial:!0}});var IIe=x(()=>{"use strict";SIe()});function i6(e){let o=(e||{}).singleTilde,r={tokenize:i,resolveAll:n};return o==null&&(o=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function n(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let c=l;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[l][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";let d={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[l][1].end)},u={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[l][1].start)},f=[["enter",d,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",u,a]],h=a.parser.constructs.insideSpan.null;h&&jn(f,f.length,0,Qp(h,s.slice(c+1,l),a)),jn(f,f.length,0,[["exit",u,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",d,a]]),jn(s,c-1,l-c+3,f),l=c+f.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function i(s,a,l){let c=this.previous,d=this.events,u=0;return f;function f(g){return c===126&&d[d.length-1][1].type!=="characterEscape"?l(g):(s.enter("strikethroughSequenceTemporary"),h(g))}function h(g){let m=gx(c);if(g===126)return u>1?l(g):(s.consume(g),u++,h);if(u<2&&!o)return l(g);let v=s.exit("strikethroughSequenceTemporary"),b=gx(g);return v._open=!b||b===2&&!!m,v._close=!m||m===2&&!!b,a(g)}}}var EIe=x(()=>{"use strict";tf();mG();xI()});var TIe=x(()=>{"use strict";EIe()});function rmt(e,t,o,r){let n=0;if(!(o===0&&r.length===0)){for(;n<e.map.length;){if(e.map[n][0]===t){e.map[n][1]+=o,e.map[n][2].push(...r);return}n+=1}e.map.push([t,o,r])}}var sA,kIe=x(()=>{"use strict";sA=class{constructor(){this.map=[]}add(t,o,r){rmt(this,t,o,r)}consume(t){if(this.map.sort(function(i,s){return i[0]-s[0]}),this.map.length===0)return;let o=this.map.length,r=[];for(;o>0;)o-=1,r.push(t.slice(this.map[o][0]+this.map[o][1]),this.map[o][2]),t.length=this.map[o][0];r.push([...t]),t.length=0;let n=r.pop();for(;n;)t.push(...n),n=r.pop();this.map.length=0}}});function RIe(e,t){let o=!1,r=[];for(;t<e.length;){let n=e[t];if(o){if(n[0]==="enter")n[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(n[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(n[1].type==="tableDelimiterRow")break}else n[0]==="enter"&&n[1].type==="tableDelimiterRow"&&(o=!0);t+=1}return r}var DIe=x(()=>{"use strict"});function s6(){return{flow:{null:{tokenize:nmt,resolveAll:imt}}}}function nmt(e,t,o){let r=this,n=0,i=0,s;return a;function a(k){let D=r.events.length-1;for(;D>-1;){let z=r.events[D][1].type;if(z==="lineEnding"||z==="linePrefix")D--;else break}let A=D>-1?r.events[D][1].type:null,P=A==="tableHead"||A==="tableRow"?I:l;return P===I&&r.parser.lazy[r.now().line]?o(k):P(k)}function l(k){return e.enter("tableHead"),e.enter("tableRow"),c(k)}function c(k){return k===124||(s=!0,i+=1),d(k)}function d(k){return k===null?o(k):it(k)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),h):o(k):Ft(k)?At(e,d,"whitespace")(k):(i+=1,s&&(s=!1,n+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),u(k)))}function u(k){return k===null||k===124||vo(k)?(e.exit("data"),d(k)):(e.consume(k),k===92?f:u)}function f(k){return k===92||k===124?(e.consume(k),u):u(k)}function h(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?o(k):(e.enter("tableDelimiterRow"),s=!1,Ft(k)?At(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):g(k))}function g(k){return k===45||k===58?v(k):k===124?(s=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),m):R(k)}function m(k){return Ft(k)?At(e,v,"whitespace")(k):v(k)}function v(k){return k===58?(i+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),b):k===45?(i+=1,b(k)):k===null||it(k)?E(k):R(k)}function b(k){return k===45?(e.enter("tableDelimiterFiller"),y(k)):R(k)}function y(k){return k===45?(e.consume(k),y):k===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(k))}function C(k){return Ft(k)?At(e,E,"whitespace")(k):E(k)}function E(k){return k===124?g(k):k===null||it(k)?!s||n!==i?R(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):R(k)}function R(k){return o(k)}function I(k){return e.enter("tableRow"),S(k)}function S(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),S):k===null||it(k)?(e.exit("tableRow"),t(k)):Ft(k)?At(e,S,"whitespace")(k):(e.enter("data"),_(k))}function _(k){return k===null||k===124||vo(k)?(e.exit("data"),S(k)):(e.consume(k),k===92?T:_)}function T(k){return k===92||k===124?(e.consume(k),_):_(k)}}function imt(e,t){let o=-1,r=!0,n=0,i=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,c,d,u,f=new sA;for(;++o<e.length;){let h=e[o],g=h[1];h[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(PIe(f,t,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(o,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,u=void 0,i=[0,0,0,0],s=[0,o+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(o,0,[["enter",d,t]])),n=g.type==="tableDelimiterRow"?2:d?3:1):n&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(i[1]!==0&&(s[0]=s[1],u=aA(f,t,i,n,void 0,u),i=[0,0,0,0]),s[2]=o)):g.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(s[0]=s[1],u=aA(f,t,i,n,void 0,u)),i=s,s=[i[1],o,0,0])):g.type==="tableHead"?(a=!0,l=o):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=o,i[1]!==0?(s[0]=s[1],u=aA(f,t,i,n,o,u)):s[1]!==0&&(u=aA(f,t,s,n,o,u)),n=0):n&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=o)}for(l!==0&&PIe(f,t,l,c,d),f.consume(t.events),o=-1;++o<t.events.length;){let h=t.events[o];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=RIe(t.events,o))}return e}function aA(e,t,o,r,n,i){let s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";o[0]!==0&&(i.end=Object.assign({},bx(t.events,o[0])),e.add(o[0],0,[["exit",i,t]]));let l=bx(t.events,o[1]);if(i={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(o[1],0,[["enter",i,t]]),o[2]!==0){let c=bx(t.events,o[2]),d=bx(t.events,o[3]),u={type:a,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(o[2],0,[["enter",u,t]]),r!==2){let f=t.events[o[2]],h=t.events[o[3]];if(f[1].end=Object.assign({},h[1].end),f[1].type="chunkText",f[1].contentType="text",o[3]>o[2]+1){let g=o[2]+1,m=o[3]-o[2]-1;e.add(g,m,[])}}e.add(o[3]+1,0,[["exit",u,t]])}return n!==void 0&&(i.end=Object.assign({},bx(t.events,n)),e.add(n,0,[["exit",i,t]]),i=void 0),i}function PIe(e,t,o,r,n){let i=[],s=bx(t.events,o);n&&(n.end=Object.assign({},s),i.push(["exit",n,t])),r.end=Object.assign({},s),i.push(["exit",r,t]),e.add(o+1,0,i)}function bx(e,t){let o=e[t],r=o[0]==="enter"?"start":"end";return o[1][r]}var AIe=x(()=>{"use strict";Rn();Vo();kIe();DIe()});var OIe=x(()=>{"use strict";AIe()});function a6(){return{text:{91:smt}}}function amt(e,t,o){let r=this;return n;function n(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?o(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return vo(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):o(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):o(l)}function a(l){return it(l)?t(l):Ft(l)?e.check({tokenize:lmt},t,o)(l):o(l)}}function lmt(e,t,o){return At(e,r,"whitespace");function r(n){return n===null?o(n):t(n)}}var smt,MIe=x(()=>{"use strict";Rn();Vo();smt={tokenize:amt}});var NIe=x(()=>{"use strict";MIe()});function FIe(e){return $P([o6(),n6(),i6(e),s6(),a6()])}var LIe=x(()=>{"use strict";hG();_Ie();IIe();TIe();OIe();NIe()});var zIe={};_t(zIe,{GCI_SUPPORTED_EXTS:()=>l6,GCI_URL_PREFIX:()=>lA,IMAGE_EXTS:()=>c6,VIDEO_EXTS:()=>d6,buildDownloadURL:()=>f6,checkFileExists:()=>cA,deleteFileFromGCS:()=>u6,getFileExt:()=>Tm,shouldImageUseDarkBg:()=>BIe,testIsGoogleCloudImageFile:()=>yx,testIsImageFile:()=>Ld,testIsVideoFile:()=>xx,uploadFileToGCS:()=>rf});async function rf(e,t){let o=window.__ROOT_CTX.rootConfig.projectId,r=await gmt(e),n=Tm(e.name),i=cmt(e,r,n,t),s=`${o}/uploads/${i}`,a=Ky(window.firebase.storage,s);if(t?.checkExists&&await cA(s))throw new Error(`File already exists: ${s}`);let l=rbe(a,e),c=-1,d=Date.now();return await new Promise((u,f)=>{let h=setInterval(()=>{Date.now()-d>1e4&&(clearInterval(h),f(new Error("Upload stalled: no progress for 10 seconds")))},1e3);l.on("state_changed",g=>{g.bytesTransferred>0&&clearInterval(h),console.log(`uploading ${e.name}: ${g.bytesTransferred} / ${g.totalBytes} bytes`),g.bytesTransferred!==c&&(c=g.bytesTransferred,d=Date.now())},g=>{clearInterval(h),f(g)},()=>{console.log(`uploaded ${s}`),clearInterval(h),u(l.snapshot)})}),dmt(a,e,n,t)}async function u6(e){let t=window.firebase.storage,o;e.startsWith("/")?o=Ky(t,`gs://${e.substring(1)}`):e.startsWith("http")?o=Ky(t,e):o=Ky(t,e),await sbe(o),console.log(`deleted ${e}`)}function cmt(e,t,o,r){return r?.namingMode==="clean"?e.name:r?.namingMode==="hash-path"||r?.preserveFilename?`${t}/${e.name}`:`${t}.${o}`}async function cA(e){let t=Ky(window.firebase.storage,e);try{return await nbe(t),!0}catch(o){if(o.code==="storage/object-not-found")return!1;throw o}}async function dmt(e,t,o,r){let n={};n.filename=t.name,n.uploadedBy=window.firebase.user.email||"unknown",n.uploadedAt=String(Math.floor(new Date().getTime()));let i=`/${e.bucket}/${e.fullPath}`,s=`https://storage.googleapis.com${i}`;if(c6.includes(o)){let l=await pmt(t);if(n.width=l.width,n.height=l.height,!r?.disableGci&&l6.includes(o)){let c=await fmt(i);c&&(n.gcsPath=i,s=c)}n.canvasBgColor=await BIe(t)?"dark":"light"}else if(d6.includes(o)){let l=await hmt(s);n.width=l.width,n.height=l.height,console.log("video dimensions:",l)}let a=r?.cacheControl||"public, max-age=31536000";return await ibe(e,{cacheControl:a,customMetadata:mmt(n)}),console.log("updated meta data: ",n),{...n,src:s}}function Tm(e){return umt(e.split(".").at(-1)||"")}function umt(e){let t=String(e).toLowerCase();return t==="jpeg"&&(t="jpg"),t}async function fmt(e){let t=window.__ROOT_CTX.rootConfig.gci;if(!t)return"";let o=new URLSearchParams({gcs:e}),r=`${t}/_/serving_url?${o.toString()}`,n=await window.fetch(r);if(n.status!==200){let s=await n.text();throw console.error(`failed to get gci url: ${r}`),console.error(s),new Error("failed to get gci url")}return(await n.json()).servingUrl}async function pmt(e){return new Promise((t,o)=>{let r=new FileReader;r.onload=()=>{let n=new Image;n.onload=()=>{t({width:n.width,height:n.height})},n.onerror=o,n.src=String(r.result)},r.onerror=o,r.readAsDataURL(e)})}async function hmt(e){return new Promise((t,o)=>{let r=document.createElement("video");r.addEventListener("loadedmetadata",()=>{let n={width:r.videoWidth,height:r.videoHeight};t(n),document.body.removeChild(r)},!1),r.addEventListener("error",()=>{o(new Error("Failed to load video metadata")),document.body.removeChild(r)},!1),r.className="sr-only",r.src=e,r.preload="metadata",document.body.appendChild(r)})}async function gmt(e){let t=await e.arrayBuffer(),o=await crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(o)).map(i=>i.toString(16).padStart(2,"0")).join("")}function mmt(e){let t={};return Object.entries(e).forEach(([o,r])=>{e[o]=String(r).trim()}),t}function Ld(e){if(!e)return!1;if(yx(e)||e.startsWith("data:image/")||e.startsWith("blob:"))return!0;let t=Tm(e);return c6.includes(t)}function yx(e){return e?e.startsWith(lA):!1}function xx(e){if(!e)return!1;let t=Tm(e);return d6.includes(t)}function f6(e){return yx(e)?e.split("=")[0]+"=s0-d":e}function BIe(e){return new Promise((t,o)=>{let r=new Image,n=new FileReader;n.onload=()=>{r.src=n.result},r.onload=()=>{let i=document.createElement("canvas"),s=i.getContext("2d");i.width=r.width,i.height=r.height,s.drawImage(r,0,0,i.width,i.height);let{data:a}=s.getImageData(0,0,i.width,i.height),l=0,c=0,d=0,u=0,f=Math.floor(a.length/4e4)*4;f<4&&(f=4);for(let g=0;g<a.length;g+=f)a[g+3]<128||(l+=a[g],c+=a[g+1],d+=a[g+2],u++);if(u===0){t(!1);return}let h=.299*(l/u)+.587*(c/u)+.114*(d/u);t(h>128)},r.onerror=o,n.onerror=o,n.readAsDataURL(e)})}var l6,c6,d6,lA,Zp=x(()=>{"use strict";A3();l6=["bmp","gif","ico","jpeg","jpg","png","tiff","webp"],c6=[...l6,"svg"],d6=["mp4","webm"],lA="https://lh3.googleusercontent.com/"});function dA(e){let[t,o]=N(""),r=G(null),n=G(null),[i,s]=N(null),[a,l]=N(!1),c=!t;function d(b){return b.endsWith(".jpg")?"image/jpeg":"image/png"}async function u(){if(!t)return;let b=[{type:"text",text:t}];i&&b.push({type:"image",image:{src:i.src,width:i.width,height:i.height,alt:i.filename}});let y=e.chat.addMessage({sender:"user",blocks:b});o(""),s(null),f();let C=[{text:t}];i&&C.push({media:{url:i.src,contentType:d(i.filename)}});let E=await e.chat.sendPrompt(y,C,e.options);e.onData&&E&&e.onData(E)}function f(){window.requestAnimationFrame(()=>{let b=r.current;b.style.height="auto",b.style.height=`${b.scrollHeight}px`})}function h(b){if(b.key==="Enter"&&!b.shiftKey){b.preventDefault(),u();return}}async function g(b){try{l(!0),f();let y=await rf(b,{disableGci:!0});s({src:y.src,width:y.width,height:y.height,filename:y.filename}),l(!1)}catch{l(!1)}if(n.current){let y=n.current;y.value=""}}function m(b){let E=(b.target.files||[])[0];E&&g(E)}function v(){s(null),f()}return $(()=>{f()},[t]),p("div",{className:"AIPage__ChatBar",children:[p("div",{className:ze("AIPage__ChatBar__prompt",(a||i)&&"AIPage__ChatBar__prompt--hasImage"),children:[p("label",{className:"AIPage__ChatBar__prompt__imageUpload",children:[p("input",{className:"AIPage__ChatBar__prompt__imageUpload__input",type:"file",accept:"image/png, image/jpeg, image/webp",onChange:m,ref:n}),p(Ee,{label:"Upload image",children:p(Ke,{component:"div",className:"AIPage__ChatBar__prompt__imageUpload__icon",radius:"xl",children:p(iI,{size:18})})})]}),p("textarea",{className:"AIPage__ChatBar__prompt__textInput",ref:r,placeholder:"Enter prompt...",rows:1,onKeyDown:h,onPaste:b=>{let y=b.clipboardData?.items||[];for(let C of y)if(C.kind==="file"&&C.type.startsWith("image/")){let E=C.getAsFile();E&&g(E)}},onChange:b=>{o(b.target.value)},value:t,autofocus:!0}),(a||i)&&p("div",{className:"AIPage__ChatBar__prompt__imagePreview",children:a?p(gt,{size:"sm"}):p(Ee,{label:i.filename,transition:"pop",position:"right",withArrow:!0,children:p("button",{className:"AIPage__ChatBar__prompt__imagePreview__closeButton",onClick:()=>v(),children:[p("img",{src:i.src,width:i.width,height:i.height,alt:"attachment"}),p("div",{className:"AIPage__ChatBar__prompt__imagePreview__closeButton__icon",children:p(hI,{size:24,color:"white"})})]})})}),p(Ke,{className:"AIPage__ChatBar__prompt__submit",variant:"filled",color:"dark",radius:"xl",onClick:()=>u(),disabled:c,children:p(B5,{size:18})})]}),p("div",{className:"AIPage__ChatBar__disclaimer",children:"Root AI is experimental and makes mistakes. Check all info."})]})}var p6=x(()=>{"use strict";Ye();qt();Ne();No();Zp();X()});function eo(e){$(()=>{let t=window.__ROOT_CTX?.rootConfig,o=t?.projectName||"Root CMS",r=t?.minimalBranding?o:`${o} \u2013 Root CMS`;document.title=e?`${e} \u2013 ${r}`:r},[e])}var Xr=x(()=>{"use strict";Ne()});var h6,HIe=x(()=>{h6={name:"@blinkk/root-cms",version:"2.5.13",author:"s@blinkk.com",license:"MIT",engines:{node:">=16.0.0"},repository:{type:"git",url:"git+https://github.com/blinkk/rootjs.git",directory:"packages/root-cms"},publishConfig:{provenance:!0},files:["dist/**/*"],bin:{"root-cms":"./bin/root-cms.js"},type:"module",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./client":{types:"./dist/client.d.ts",import:"./dist/client.js"},"./core":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./functions":{types:"./dist/functions.d.ts",import:"./dist/functions.js"},"./plugin":{types:"./dist/plugin.d.ts",import:"./dist/plugin.js"},"./project":{types:"./dist/project.d.ts",import:"./dist/project.js"},"./richtext":{types:"./dist/richtext.d.ts",import:"./dist/richtext.js"}},scripts:{build:'rm -rf dist && concurrently -n "core,signin,ui" npm:build:core npm:build:signin npm:build:ui',"build:core":"tsup-node --config=./core/tsup.config.ts","//":"NOTE: esbuild is used here because tsup doesn't currently support aliases.","build:ui":"esbuild ui/ui.tsx --bundle --minify --alias:react=@preact/compat --alias:react-dom=@preact/compat --tsconfig=ui/tsconfig.json --outdir=dist/ui --legal-comments=external","build:signin":"esbuild signin/signin.tsx --bundle --minify --tsconfig=signin/tsconfig.json --outdir=dist/ui --legal-comments=external",dev:'rm -rf dist && concurrently -k -n "core,ui" npm:dev:core npm:dev:signin npm:dev:ui',"dev:core":"pnpm build:core --watch","dev:signin":"pnpm build:signin --watch","dev:ui":"pnpm build:ui --watch",test:"pnpm build && firebase emulators:exec 'vitest run --exclude=**/*.visual.test.tsx'","test:visual":"vitest run --config=vitest.config.visual.ts","test:watch":"pnpm build && firebase emulators:exec 'vitest'"},dependencies:{"@ag-grid-community/client-side-row-model":"32.3.9","@ag-grid-community/core":"32.3.9","@ag-grid-community/react":"32.3.9","@ag-grid-community/styles":"32.3.9","@genkit-ai/ai":"1.26.0","@genkit-ai/core":"1.26.0","@genkit-ai/google-genai":"1.26.0","@google-cloud/firestore":"7.11.3","@hello-pangea/dnd":"18.0.1","@types/cli-progress":"3.11.6","body-parser":"1.20.2","cli-progress":"3.12.0",commander:"11.0.0","csv-parse":"5.5.2","csv-stringify":"6.4.4","date-fns":"4.1.0","date-fns-tz":"3.2.0",diff:"8.0.2","dts-dom":"3.7.0","fnv-plus":"1.3.1",genkit:"1.26.0",jsonwebtoken:"9.0.2",kleur:"4.1.5",sirv:"2.0.3","tiny-glob":"0.2.9"},"//":"NOTE(stevenle): due to compat issues with mantine and preact, mantine is pinned to v4.2.12",devDependencies:{"@babel/core":"7.17.9","@blinkk/root":"workspace:*","@editorjs/editorjs":"2.30.8","@editorjs/header":"2.8.8","@editorjs/image":"2.10.2","@editorjs/list":"2.0.6","@editorjs/nested-list":"1.4.3","@editorjs/raw":"2.5.1","@editorjs/table":"2.4.4","@editorjs/underline":"1.2.1","@emotion/react":"11.10.5","@firebase/app-compat":"0.5.2","@firebase/app-types":"0.9.3","@firebase/rules-unit-testing":"5.0.0","@lexical/code":"0.33.1","@lexical/html":"0.33.1","@lexical/link":"0.33.1","@lexical/list":"0.33.1","@lexical/markdown":"0.33.1","@lexical/react":"0.33.1","@lexical/rich-text":"0.33.1","@lexical/selection":"0.33.1","@lexical/table":"0.33.1","@lexical/utils":"0.33.1","@mantine/core":"4.2.12","@mantine/hooks":"4.2.12","@mantine/modals":"4.2.12","@mantine/notifications":"4.2.12","@mantine/spotlight":"4.2.12","@preact/compat":"18.3.1","@tabler/icons-preact":"3.35.0","@testing-library/preact":"3.2.4","@testing-library/user-event":"14.6.1","@types/body-parser":"1.19.3","@types/fnv-plus":"1.3.2","@types/gapi":"0.0.47","@types/gapi.client.drive-v3":"0.0.4","@types/gapi.client.sheets-v4":"0.0.4","@types/google.accounts":"0.0.14","@types/jsonwebtoken":"9.0.1","@types/node":"24.3.1","@vitest/browser":"4.0.10","@vitest/browser-playwright":"4.0.10",concurrently:"7.6.0",esbuild:"0.25.9",firebase:"12.2.1","firebase-admin":"13.5.0","firebase-functions":"6.4.0","firebase-tools":"14.15.2","highlight.js":"11.6.0",jsdom:"27.2.0","json-diff-kit":"1.0.29",lexical:"0.33.1",marked:"9.1.1","mdast-util-from-markdown":"2.0.1","mdast-util-gfm":"3.0.0","micromark-extension-gfm":"3.0.0",playwright:"1.56.1",preact:"10.27.1","preact-iso":"2.11.1","preact-render-to-string":"6.6.1",react:"npm:@preact/compat@18.3.1","react-dom":"npm:@preact/compat@18.3.1","react-easy-crop":"5.5.6","react-json-view-compare":"2.0.2",tsup:"8.5.0",typescript:"5.9.2",vite:"7.1.4",vitest:"4.0.10",yjs:"13.6.27"},peerDependencies:{"@blinkk/root":"2.5.13","firebase-admin":">=11","firebase-functions":">=4",preact:">=10","preact-render-to-string":">=5"},peerDependenciesMeta:{"firebase-functions":{optional:!0}}}});function VIe(){return p("svg",{width:"100",height:"23",viewBox:"0 0 100 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("g",{"clip-path":"url(#clip0_1_318)",children:[p("path",{d:"M7.82998 5.01802C3.12925 5.6479 0.833937 18.1194 2.62578 19.6731C5.64773 22.2934 16.6441 14.1722 15.6786 9.46913C15.3009 6.61371 11.2717 4.28377 7.82998 5.01802Z",fill:"black"}),p("path",{d:"M13.9782 0.720147C12.6553 0.896474 12.0093 4.38767 12.5136 4.8226C13.364 5.55611 16.4587 3.28271 16.187 1.96616C16.0807 1.16683 14.9468 0.514607 13.9782 0.720147Z",fill:"black"}),p("path",{d:"M92.7383 17.6275C90.9681 17.6275 89.3816 17.0263 88.3796 16.0744C87.9955 15.7237 87.8953 15.3396 88.246 14.9555L88.8305 14.2541C89.1645 13.87 89.5486 13.7865 89.9327 14.1205C90.6007 14.6883 91.7029 15.1726 92.5713 15.1726C93.5232 15.1726 94.1244 14.8219 94.1244 14.2875C94.1244 13.5193 93.2059 13.4358 91.9868 13.0684C90.417 12.6008 88.5132 11.7324 88.5132 9.64493C88.5132 7.70773 90.25 6.37173 92.7383 6.37173C94.2413 6.37173 95.5272 6.87273 96.4123 7.57413C96.8131 7.90813 96.9467 8.27553 96.596 8.67633L96.0282 9.37773C95.7109 9.76183 95.3435 9.82863 94.926 9.51133C94.3916 9.09383 93.6568 8.69303 92.7884 8.69303C92.0202 8.69303 91.5192 9.01033 91.5192 9.51133C91.5192 10.1292 92.3041 10.4131 93.1224 10.6636C94.9761 11.2314 97.1304 11.8326 97.1304 14.2708C97.1304 16.4585 95.1264 17.6275 92.7383 17.6275Z",fill:"black"}),p("path",{d:"M87.0008 16.6756C87.0843 17.1766 86.8171 17.4271 86.2994 17.4271H85.097C84.596 17.4271 84.3789 17.1766 84.3121 16.6756L83.7443 11.9161L81.757 16.7424C81.5399 17.2434 81.1892 17.5106 80.6882 17.5106H80.5212C80.0202 17.5106 79.6695 17.2434 79.4524 16.7424L77.4651 11.8994L76.8973 16.6756C76.8472 17.1766 76.6301 17.4271 76.1291 17.4271H74.7263C74.2086 17.4271 73.9414 17.1766 74.0082 16.6756L75.4945 7.24013C75.5613 6.75583 75.8786 6.48863 76.3796 6.48863H76.5466C77.0476 6.48863 77.3315 6.75583 77.5486 7.24013L80.6047 13.8032L83.4938 7.24013C83.7109 6.75583 84.0115 6.48863 84.4958 6.48863H84.6795C85.1638 6.48863 85.4811 6.75583 85.5646 7.24013L87.0008 16.6756Z",fill:"black"}),p("path",{d:"M68.6496 17.6275C65.3096 17.6275 62.7211 15.2227 62.7211 11.9996C62.7211 8.77653 65.3096 6.37173 68.683 6.37173C70.3029 6.37173 71.7558 6.97293 72.7745 7.99163C73.1419 8.34233 73.1419 8.77653 72.7745 9.09383L71.9228 9.81193C71.5554 10.1292 71.2047 10.1125 70.8206 9.79523C70.2361 9.31093 69.5013 9.01033 68.683 9.01033C67.013 9.01033 65.7104 10.2628 65.7104 11.9996C65.7104 13.7364 67.013 14.9889 68.683 14.9889C69.5013 14.9889 70.2528 14.6883 70.8206 14.204C71.2047 13.8867 71.5554 13.87 71.9228 14.1873L72.7745 14.9054C73.1419 15.2227 73.1419 15.6569 72.7745 16.0076C71.7558 17.0263 70.3029 17.6275 68.6496 17.6275Z",fill:"black"}),p("path",{d:"M58.575 16.2915C58.7587 16.6923 58.4581 16.8927 58.241 17.0597C57.7233 17.4271 56.9384 17.6442 56.1201 17.6442C54.4501 17.6442 52.8469 16.6923 52.8469 14.4044V11.0978H52.1121C51.6111 11.0978 51.3439 10.8139 51.3439 10.3296V9.76183C51.3439 9.26083 51.6111 8.99363 52.1121 8.99363H52.8469V7.05643C52.8469 6.57213 53.1308 6.38843 53.6151 6.28823L54.9511 6.05443C55.4521 5.95423 55.7193 6.30493 55.7193 6.80593V8.99363H57.3726C57.8569 8.99363 58.1408 9.26083 58.1408 9.76183V10.3296C58.1408 10.8139 57.8569 11.0978 57.3726 11.0978H55.7193V14.1038C55.7193 14.9221 56.1368 15.1893 56.6545 15.1893C56.905 15.1893 57.1555 15.0724 57.3392 14.9555C57.7567 14.6883 57.9571 14.8887 58.1074 15.206L58.575 16.2915Z",fill:"black"}),p("path",{d:"M46.2592 17.6442C43.5538 17.6442 41.5999 15.7738 41.5999 13.2521C41.5999 10.7304 43.5538 8.86003 46.2592 8.86003C48.9646 8.86003 50.9185 10.7304 50.9185 13.2521C50.9185 15.7738 48.9646 17.6442 46.2592 17.6442ZM46.2592 15.1726C47.3113 15.1726 48.0628 14.3543 48.0628 13.2521C48.0628 12.1499 47.3113 11.3316 46.2592 11.3316C45.2071 11.3316 44.4389 12.1499 44.4389 13.2521C44.4389 14.3543 45.2071 15.1726 46.2592 15.1726Z",fill:"black"}),p("path",{d:"M36.052 17.6442C33.3466 17.6442 31.3927 15.7738 31.3927 13.2521C31.3927 10.7304 33.3466 8.86003 36.052 8.86003C38.7574 8.86003 40.7113 10.7304 40.7113 13.2521C40.7113 15.7738 38.7574 17.6442 36.052 17.6442ZM36.052 15.1726C37.1041 15.1726 37.8556 14.3543 37.8556 13.2521C37.8556 12.1499 37.1041 11.3316 36.052 11.3316C34.9999 11.3316 34.2317 12.1499 34.2317 13.2521C34.2317 14.3543 34.9999 15.1726 36.052 15.1726Z",fill:"black"}),p("path",{d:"M28.7099 13.0851L30.6805 16.6422C30.9644 17.1599 30.6638 17.4271 30.1628 17.4271H28.4594C27.9417 17.4271 27.8081 17.1766 27.5242 16.6589L25.7707 13.4859H24.6351V16.6422C24.6351 17.1432 24.3512 17.4271 23.8502 17.4271H22.4808C21.9798 17.4271 21.6959 17.1432 21.6959 16.6422V7.35703C21.6959 6.85603 21.9798 6.57213 22.4808 6.57213H26.5222C29.3111 6.57213 30.8141 7.92483 30.8141 10.1125C30.8141 11.5654 29.9791 12.5841 28.7099 13.0851ZM24.6351 8.96023V11.5153H26.4721C27.2236 11.5153 27.8248 11.0644 27.8248 10.2628C27.8248 9.44453 27.2236 8.96023 26.4721 8.96023H24.6351Z",fill:"black"})]}),p("defs",{children:p("clipPath",{id:"clip0_1_318",children:p("rect",{width:"99",height:"22",fill:"white",transform:"translate(0.0175781 0.177246)"})})})]})}var GIe=x(()=>{"use strict";X()});var UIe=x(()=>{});function dt(e){return p("div",{className:"Layout",children:[p(dt.Top,{}),p(dt.Side,{}),p(dt.Main,{...e,children:e.children}),p(dt.Bottom,{})]})}var nf,Qr=x(()=>{"use strict";Ye();qt();nl();HIe();GIe();No();UIe();X();nf="1.5";dt.Top=()=>{let e=window.__ROOT_CTX.rootConfig,t=e.projectName||e.projectId,o=e.minimalBranding;return p("div",{className:"Layout__top",children:o?p(Oe,{children:[p("a",{className:"Layout__top__logo",href:"/cms",children:t}),p("div",{className:"Layout__top__version",children:["v",h6.version]})]}):p(Oe,{children:[p("a",{className:"Layout__top__logo",href:"/cms",children:p(VIe,{})}),p("div",{className:"Layout__top__version",children:["v",h6.version]}),p("div",{className:"Layout__top__project",children:t})]})})};dt.Side=()=>{let{url:e}=Nr(),t=e.replace(/\/*$/g,""),o=window.firebase.user,r=window.__ROOT_CTX.sidebar?.tools,n=new Set(window.__ROOT_CTX.sidebar?.hiddenBuiltInTools||[]),i=l=>n.has(l),s=window.__ROOT_CTX.experiments||{},a=async()=>{await window.firebase.auth.signOut(),window.location.href="/cms/login"};return p("div",{className:"Layout__side",children:[p("div",{className:"Layout__side__buttons",children:[!i("home")&&p(dt.SideButton,{label:"Home",url:"/cms",active:t==="/cms",children:p(x5,{stroke:nf})}),!i("content")&&p(dt.SideButton,{label:"Content",url:"/cms/content",active:t.startsWith("/cms/content"),children:p(sx,{stroke:nf})}),!i("releases")&&p(dt.SideButton,{label:"Releases",url:"/cms/releases",active:t.startsWith("/cms/releases"),children:p(qp,{stroke:nf})}),!i("data")&&p(dt.SideButton,{label:"Data",url:"/cms/data",active:t.startsWith("/cms/data"),children:p(s5,{stroke:nf})}),!i("assets")&&p(dt.SideButton,{label:"Assets",url:"/cms/assets",active:t.startsWith("/cms/assets"),children:p(aI,{stroke:nf})}),!i("translations")&&p(dt.SideButton,{label:"Translations",url:"/cms/translations",active:t.startsWith("/cms/translations"),children:p(Od,{stroke:nf})}),s.ai&&!i("ai")&&p(dt.SideButton,{label:"Root AI (experimental)",url:"/cms/ai",active:t.startsWith("/cms/ai"),children:p(gm,{stroke:nf})}),r&&p(Oe,{children:[p("div",{className:"Layout__side__divider"}),Object.entries(r).map(([l,c])=>{let d=c.cmsUrl?.startsWith("/cms/")?c.cmsUrl:void 0,u=c.externalUrl,f=u??d??`/cms/tools/${l}`,h=u?void 0:f.replace(/\/*$/g,""),g=!u&&!!h&&(t===h||t.startsWith(`${h}/`));return p(dt.SideButton,{className:"Layout__side__tool",label:c.label||"",url:f,active:g,external:!!u,children:c.icon?p("img",{className:"Layout__side__tool__icon",src:c.icon,alt:c.label||""}):p(Z3,{stroke:nf})},l)}),p("div",{className:"Layout__side__divider"})]}),!i("settings")&&p(dt.SideButton,{label:"Settings",url:"/cms/settings",active:t.startsWith("/cms/settings"),children:p(bm,{stroke:nf})})]}),p("div",{className:"Layout__side__user",children:p(Me,{shadow:"md",position:"right",control:p(Ab,{children:p(hd,{src:o.photoURL,alt:o.email,size:30,radius:"xl"})}),children:[p(Me.Label,{children:p(Xt,{size:"xs",color:"dimmed",truncate:!0,children:["Signed in as ",o.email]})}),p(wi,{}),p(Me.Item,{color:"red",icon:p(k5,{style:{width:14,height:14}}),onClick:a,children:"Sign out"})]})})]})};dt.SideButton=e=>p(Ee,{className:ze("Layout__side__button",e.className),label:e.label,position:"right",withArrow:!0,children:p("a",{className:ze(e.active&&"active"),href:e.url,target:e.external?"_blank":void 0,rel:e.external?"noreferrer noopener":void 0,children:e.children})});dt.Main=e=>p("div",{className:"Layout__main",children:e.children});dt.Bottom=()=>p("div",{className:"Layout__bottom"})});function qs(e){e||(e=6);let t=[],o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=o.length;for(let n=0;n<e;n++)t.push(o.charAt(Math.floor(Math.random()*r)));return t.join("")}function $Ie(e,t){return Math.random()*(t-e)+e}var II=x(()=>{"use strict"});var XIe={};_t(XIe,{AIPage:()=>ymt,ChatWindow:()=>uA,useChat:()=>Cx});function WIe(){return $Ie(...bmt)}function Cx(){let[e,t]=N([]),[o,r]=N(""),n=a=>{let l=0;return t(c=>{let d={sender:"bot",blocks:[{type:"pending"}],key:qs()},u=[...c,{...a,key:qs()},d];return l=u.length-1,u}),l},i=(a,l)=>{t(c=>{let d=[...c];return d[a]={...l,key:qs()},d})};return{chatId:o,messages:e,addMessage:n,updateMessage:i,sendPrompt:async(a,l,c)=>{let d="/cms/api/ai.chat";typeof window.__ROOT_CTX.experiments?.ai=="object"&&window.__ROOT_CTX.experiments.ai.endpoint&&(d=window.__ROOT_CTX.experiments.ai.endpoint);let u={prompt:l,chatId:o,options:c},f=await window.fetch(d,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(u)});if(f.status!==200){let g=await f.text();console.error("chat failed",g);let m=["Something went wrong:","```",g,"```"].join(`
|
|
64
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&n)continue;s=" ";break}default:s=String.fromCharCode(i)}n=i===-2,r.push(s)}return r.join("")}var ISe=x(()=>{"use strict";Vo();tf();xI()});var NG={};_t(NG,{attentionMarkers:()=>Uht,contentInitial:()=>Lht,disable:()=>$ht,document:()=>Fht,flow:()=>zht,flowInitial:()=>Bht,insideSpan:()=>Ght,string:()=>Hht,text:()=>Vht});var Fht,Lht,Bht,zht,Hht,Vht,Ght,Uht,$ht,ESe=x(()=>{"use strict";nA();MG();Fht={42:Ss,43:Ss,45:Ss,48:Ss,49:Ss,50:Ss,51:Ss,52:Ss,53:Ss,54:Ss,55:Ss,56:Ss,57:Ss,62:KP},Lht={91:IG},Bht={[-2]:wI,[-1]:wI,32:wI},zht={35:TG,42:Im,45:[rA,Im],60:RG,61:rA,95:Im,96:XP,126:XP},Hht={38:YP,92:qP},Vht={[-5]:SI,[-4]:SI,[-3]:SI,33:PG,38:YP,42:CI,60:[vG,DG],91:AG,92:[EG,qP],93:Sm,95:CI,96:bG},Ght={null:[CI,ySe]},Uht={null:[42,95]},$ht={null:[]}});function FG(e){let o=$P([NG,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:o,content:n(G_e),document:n(W_e),flow:n(vSe),string:n(xSe),text:n(CSe)};return r;function n(i){return s;function s(a){return SSe(r,i,a)}}}var TSe=x(()=>{"use strict";hG();U_e();j_e();bSe();MG();ISe();ESe()});function LG(e){for(;!JP(e););return e}var kSe=x(()=>{"use strict";yG()});function BG(){let e=1,t="",o=!0,r;return n;function n(i,s,a){let l=[],c,d,u,f,h;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),u=0,t="",o&&(i.charCodeAt(0)===65279&&u++,o=void 0);u<i.length;){if(RSe.lastIndex=u,c=RSe.exec(i),f=c&&c.index!==void 0?c.index:i.length,h=i.charCodeAt(f),!c){t=i.slice(u);break}if(h===10&&u===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<f&&(l.push(i.slice(u,f)),e+=f-u),h){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=f+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}var RSe,DSe=x(()=>{"use strict";RSe=/[\0\t\n\r]/g});var PSe=x(()=>{"use strict";TSe();kSe();DSe()});function ASe(e){return e.replace(Wht,jht)}function jht(e,t,o){if(t)return t;if(o.charCodeAt(0)===35){let n=o.charCodeAt(1),i=n===120||n===88;return WP(o.slice(i?2:1),i?16:10)}return px(o)||e}var Wht,OSe=x(()=>{"use strict";UP();gG();Wht=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});function mx(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?MSe(e.position):"start"in e||"end"in e?MSe(e):"line"in e||"column"in e?zG(e):""}function zG(e){return NSe(e&&e.line)+":"+NSe(e&&e.column)}function MSe(e){return zG(e&&e.start)+"-"+zG(e&&e.end)}function NSe(e){return e&&typeof e=="number"?e:1}var FSe=x(()=>{"use strict"});var LSe=x(()=>{"use strict";FSe()});function HG(e,t,o){return typeof t!="string"&&(o=t,t=void 0),Kht(o)(LG(FG(o).document().write(BG()(e,t,!0))))}function Kht(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Pe),autolinkProtocol:T,autolinkEmail:T,atxHeading:i(so),blockQuote:i(Ge),characterEscape:T,characterReference:T,codeFenced:i(pt),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(pt,s),codeText:i(Ue,s),codeTextData:T,data:T,codeFlowValue:T,definition:i(tt),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(mt),hardBreakEscape:i(wt),hardBreakTrailing:i(wt),htmlFlow:i($e,s),htmlFlowData:T,htmlText:i($e,s),htmlTextData:T,image:i(pe),label:s,link:i(Pe),listItem:i(je),listItemValue:f,listOrdered:i(Se,u),listUnordered:i(Se),paragraph:i(ot),reference:V,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(so),strong:i(It),thematicBreak:i(ue)},exit:{atxHeading:l(),atxHeadingSequence:R,autolink:l(),autolinkEmail:_e,autolinkProtocol:Ce,blockQuote:l(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:he,characterReference:ke,codeFenced:l(v),codeFencedFence:m,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:k,codeIndented:l(b),codeText:l(L),codeTextData:k,data:k,definition:l(),definitionDestinationString:E,definitionLabelString:y,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(P),htmlFlowData:k,htmlText:l(z),htmlTextData:k,image:l(j),label:q,labelText:U,lineEnding:D,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ie,resourceDestinationString:B,resourceTitleString:ne,resource:Q,setextHeading:l(_),setextHeadingLineSequence:S,setextHeadingText:I,strong:l(),thematicBreak:l()}};HSe(t,(e||{}).mdastExtensions||[]);let o={};return r;function r(K){let te={type:"root",children:[]},be={stack:[te],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:d,data:o},nt=[],Ut=-1;for(;++Ut<K.length;)if(K[Ut][1].type==="listOrdered"||K[Ut][1].type==="listUnordered")if(K[Ut][0]==="enter")nt.push(Ut);else{let ro=nt.pop();Ut=n(K,ro,Ut)}for(Ut=-1;++Ut<K.length;){let ro=t[K[Ut][0]];zSe.call(ro,K[Ut][1].type)&&ro[K[Ut][1].type].call(Object.assign({sliceSerialize:K[Ut][2].sliceSerialize},be),K[Ut][1])}if(be.tokenStack.length>0){let ro=be.tokenStack[be.tokenStack.length-1];(ro[1]||BSe).call(be,void 0,ro[0])}for(te.position={start:Jp(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Jp(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},Ut=-1;++Ut<t.transforms.length;)te=t.transforms[Ut](te)||te;return te}function n(K,te,be){let nt=te-1,Ut=-1,ro=!1,Cr,wo,_o,Pr;for(;++nt<=be;){let ar=K[nt];switch(ar[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ar[0]==="enter"?Ut++:Ut--,Pr=void 0;break}case"lineEndingBlank":{ar[0]==="enter"&&(Cr&&!Pr&&!Ut&&!_o&&(_o=nt),Pr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pr=void 0}if(!Ut&&ar[0]==="enter"&&ar[1].type==="listItemPrefix"||Ut===-1&&ar[0]==="exit"&&(ar[1].type==="listUnordered"||ar[1].type==="listOrdered")){if(Cr){let nn=nt;for(wo=void 0;nn--;){let Gi=K[nn];if(Gi[1].type==="lineEnding"||Gi[1].type==="lineEndingBlank"){if(Gi[0]==="exit")continue;wo&&(K[wo][1].type="lineEndingBlank",ro=!0),Gi[1].type="lineEnding",wo=nn}else if(!(Gi[1].type==="linePrefix"||Gi[1].type==="blockQuotePrefix"||Gi[1].type==="blockQuotePrefixWhitespace"||Gi[1].type==="blockQuoteMarker"||Gi[1].type==="listItemIndent"))break}_o&&(!wo||_o<wo)&&(Cr._spread=!0),Cr.end=Object.assign({},wo?K[wo][1].start:ar[1].end),K.splice(wo||nt,0,["exit",Cr,ar[2]]),nt++,be++}if(ar[1].type==="listItemPrefix"){let nn={type:"listItem",_spread:!1,start:Object.assign({},ar[1].start),end:void 0};Cr=nn,K.splice(nt,0,["enter",nn,ar[2]]),nt++,be++,_o=void 0,Pr=!0}}}return K[te][1]._spread=ro,be}function i(K,te){return be;function be(nt){a.call(this,K(nt),nt),te&&te.call(this,nt)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(K,te,be){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([te,be]),K.position={start:Jp(te.start),end:void 0}}function l(K){return te;function te(be){K&&K.call(this,be),c.call(this,be)}}function c(K,te){let be=this.stack.pop(),nt=this.tokenStack.pop();if(nt)nt[0].type!==K.type&&(te?te.call(this,K,nt[0]):(nt[1]||BSe).call(this,K,nt[0]));else throw new Error("Cannot close `"+K.type+"` ("+mx({start:K.start,end:K.end})+"): it\u2019s not open");be.position.end=Jp(K.end)}function d(){return pG(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function f(K){if(this.data.expectingFirstListItemValue){let te=this.stack[this.stack.length-2];te.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function h(){let K=this.resume(),te=this.stack[this.stack.length-1];te.lang=K}function g(){let K=this.resume(),te=this.stack[this.stack.length-1];te.meta=K}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){let K=this.resume(),te=this.stack[this.stack.length-1];te.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){let K=this.resume(),te=this.stack[this.stack.length-1];te.value=K.replace(/(\r?\n|\r)$/g,"")}function y(K){let te=this.resume(),be=this.stack[this.stack.length-1];be.label=te,be.identifier=_s(this.sliceSerialize(K)).toLowerCase()}function C(){let K=this.resume(),te=this.stack[this.stack.length-1];te.title=K}function E(){let K=this.resume(),te=this.stack[this.stack.length-1];te.url=K}function R(K){let te=this.stack[this.stack.length-1];if(!te.depth){let be=this.sliceSerialize(K).length;te.depth=be}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function S(K){let te=this.stack[this.stack.length-1];te.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function T(K){let be=this.stack[this.stack.length-1].children,nt=be[be.length-1];(!nt||nt.type!=="text")&&(nt=We(),nt.position={start:Jp(K.start),end:void 0},be.push(nt)),this.stack.push(nt)}function k(K){let te=this.stack.pop();te.value+=this.sliceSerialize(K),te.position.end=Jp(K.end)}function D(K){let te=this.stack[this.stack.length-1];if(this.data.atHardBreak){let be=te.children[te.children.length-1];be.position.end=Jp(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(te.type)&&(T.call(this,K),k.call(this,K))}function A(){this.data.atHardBreak=!0}function P(){let K=this.resume(),te=this.stack[this.stack.length-1];te.value=K}function z(){let K=this.resume(),te=this.stack[this.stack.length-1];te.value=K}function L(){let K=this.resume(),te=this.stack[this.stack.length-1];te.value=K}function H(){let K=this.stack[this.stack.length-1];if(this.data.inReference){let te=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=te,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function j(){let K=this.stack[this.stack.length-1];if(this.data.inReference){let te=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=te,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function U(K){let te=this.sliceSerialize(K),be=this.stack[this.stack.length-2];be.label=ASe(te),be.identifier=_s(te).toLowerCase()}function q(){let K=this.stack[this.stack.length-1],te=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){let nt=K.children;be.children=nt}else be.alt=te}function B(){let K=this.resume(),te=this.stack[this.stack.length-1];te.url=K}function ne(){let K=this.resume(),te=this.stack[this.stack.length-1];te.title=K}function Q(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function ie(K){let te=this.resume(),be=this.stack[this.stack.length-1];be.label=te,be.identifier=_s(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function de(K){this.data.characterReferenceType=K.type}function he(K){let te=this.sliceSerialize(K),be=this.data.characterReferenceType,nt;be?(nt=WP(te,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):nt=px(te);let Ut=this.stack[this.stack.length-1];Ut.value+=nt}function ke(K){let te=this.stack.pop();te.position.end=Jp(K.end)}function Ce(K){k.call(this,K);let te=this.stack[this.stack.length-1];te.url=this.sliceSerialize(K)}function _e(K){k.call(this,K);let te=this.stack[this.stack.length-1];te.url="mailto:"+this.sliceSerialize(K)}function Ge(){return{type:"blockquote",children:[]}}function pt(){return{type:"code",lang:null,meta:null,value:""}}function Ue(){return{type:"inlineCode",value:""}}function tt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function mt(){return{type:"emphasis",children:[]}}function so(){return{type:"heading",depth:0,children:[]}}function wt(){return{type:"break"}}function $e(){return{type:"html",value:""}}function pe(){return{type:"image",title:null,url:"",alt:null}}function Pe(){return{type:"link",title:null,url:"",children:[]}}function Se(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function je(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function ot(){return{type:"paragraph",children:[]}}function It(){return{type:"strong",children:[]}}function We(){return{type:"text",value:""}}function ue(){return{type:"thematicBreak"}}}function Jp(e){return{line:e.line,column:e.column,offset:e.offset}}function HSe(e,t){let o=-1;for(;++o<t.length;){let r=t[o];Array.isArray(r)?HSe(e,r):qht(e,r)}}function qht(e,t){let o;for(o in t)if(zSe.call(t,o))switch(o){case"canContainEols":{let r=t[o];r&&e[o].push(...r);break}case"transforms":{let r=t[o];r&&e[o].push(...r);break}case"enter":case"exit":{let r=t[o];r&&Object.assign(e[o],r);break}}}function BSe(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+mx({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mx({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+mx({start:t.start,end:t.end})+") is still open")}var zSe,VSe=x(()=>{"use strict";F_e();PSe();gG();OSe();hx();UP();LSe();zSe={}.hasOwnProperty});var GSe=x(()=>{"use strict";VSe()});function VG(e,t){let o=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,n=o.indexOf(t);for(;n!==-1;)r++,n=o.indexOf(t,n+t.length);return r}var USe=x(()=>{"use strict"});function GG(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var $Se=x(()=>{"use strict"});function Yht(e){let t=[],o=-1;for(;++o<e.length;)t[o]=vx(e[o]);return iA(r);function r(...n){let i=-1;for(;++i<t.length;)if(t[i].apply(this,n))return!0;return!1}}function Xht(e){let t=e;return iA(o);function o(r){let n=r,i;for(i in e)if(n[i]!==t[i])return!1;return!0}}function Qht(e){return iA(t);function t(o){return o&&o.type===e}}function iA(e){return t;function t(o,r,n){return!!(Zht(o)&&e.call(this,o,typeof r=="number"?r:void 0,n||void 0))}}function Jht(){return!0}function Zht(e){return e!==null&&typeof e=="object"&&"type"in e}var vx,WSe=x(()=>{"use strict";vx=(function(e){if(e==null)return Jht;if(typeof e=="function")return iA(e);if(typeof e=="object")return Array.isArray(e)?Yht(e):Xht(e);if(typeof e=="string")return Qht(e);throw new Error("Expected function, string, or object as test")})});var UG=x(()=>{"use strict";WSe()});function WG(e,t,o,r){let n;typeof t=="function"&&typeof o!="function"?(r=o,o=t):n=t;let i=vx(n),s=r?-1:1;a(e,void 0,[])();function a(l,c,d){let u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){let h=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return f;function f(){let h=jSe,g,m,v;if((!t||i(l,c,d[d.length-1]||void 0))&&(h=egt(o(l,d)),h[0]===$G))return h;if("children"in l&&l.children){let b=l;if(b.children&&h[0]!==qSe)for(m=(r?b.children.length:-1)+s,v=d.concat(b);m>-1&&m<b.children.length;){let y=b.children[m];if(g=a(y,m,v)(),g[0]===$G)return g;m=typeof g[1]=="number"?g[1]:m+s}}return h}}}function egt(e){return Array.isArray(e)?e:typeof e=="number"?[KSe,e]:e==null?jSe:[e]}var jSe,KSe,$G,qSe,YSe=x(()=>{"use strict";UG();jSe=[],KSe=!0,$G=!1,qSe="skip"});var XSe=x(()=>{"use strict";YSe()});function jG(e,t,o){let n=vx((o||{}).ignore||[]),i=tgt(t),s=-1;for(;++s<i.length;)WG(e,"text",a);function a(c,d){let u=-1,f;for(;++u<d.length;){let h=d[u],g=f?f.children:void 0;if(n(h,g?g.indexOf(h):void 0,f))return;f=h}if(f)return l(c,d)}function l(c,d){let u=d[d.length-1],f=i[s][0],h=i[s][1],g=0,v=u.children.indexOf(c),b=!1,y=[];f.lastIndex=0;let C=f.exec(c.value);for(;C;){let E=C.index,R={index:C.index,input:C.input,stack:[...d,c]},I=h(...C,R);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?f.lastIndex=E+1:(g!==E&&y.push({type:"text",value:c.value.slice(g,E)}),Array.isArray(I)?y.push(...I):I&&y.push(I),g=E+C[0].length,b=!0),!f.global)break;C=f.exec(c.value)}return b?(g<c.value.length&&y.push({type:"text",value:c.value.slice(g)}),u.children.splice(v,1,...y)):y=[c],v+y.length}}function tgt(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let o=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<o.length;){let n=o[r];t.push([ogt(n[0]),rgt(n[1])])}return t}function ogt(e){return typeof e=="string"?new RegExp(GG(e),"g"):e}function rgt(e){return typeof e=="function"?e:function(){return e}}var QSe=x(()=>{"use strict";$Se();XSe();UG()});var JSe=x(()=>{"use strict";QSe()});function qG(){return{transforms:[cgt],enter:{literalAutolink:ngt,literalAutolinkEmail:KG,literalAutolinkHttp:KG,literalAutolinkWww:KG},exit:{literalAutolink:lgt,literalAutolinkEmail:agt,literalAutolinkHttp:igt,literalAutolinkWww:sgt}}}function ngt(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function KG(e){this.config.enter.autolinkProtocol.call(this,e)}function igt(e){this.config.exit.autolinkProtocol.call(this,e)}function sgt(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function agt(e){this.config.exit.autolinkEmail.call(this,e)}function lgt(e){this.exit(e)}function cgt(e){jG(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,dgt],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,ugt]],{ignore:["link","linkReference"]})}function dgt(e,t,o,r,n){let i="";if(!ZSe(n)||(/^w/i.test(t)&&(o=t+o,t="",i="http://"),!fgt(o)))return!1;let s=pgt(o+r);if(!s[0])return!1;let a={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function ugt(e,t,o,r){return!ZSe(r,!0)||/[-\d_]$/.test(o)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+o,children:[{type:"text",value:t+"@"+o}]}}function fgt(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function pgt(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let o=t[0],r=o.indexOf(")"),n=VG(e,"("),i=VG(e,")");for(;r!==-1&&n>i;)e+=o.slice(0,r+1),o=o.slice(r+1),r=o.indexOf(")"),i++;return[e,o]}function ZSe(e,t){let o=e.input.charCodeAt(e.index-1);return(e.index===0||Md(o)||wm(o))&&(!t||o!==47)}var eIe=x(()=>{"use strict";USe();Vo();JSe()});var tIe=x(()=>{"use strict";eIe()});function YG(){return{enter:{gfmFootnoteDefinition:ggt,gfmFootnoteDefinitionLabelString:mgt,gfmFootnoteCall:ygt,gfmFootnoteCallString:xgt},exit:{gfmFootnoteDefinition:bgt,gfmFootnoteDefinitionLabelString:vgt,gfmFootnoteCall:wgt,gfmFootnoteCallString:Cgt}}}function ggt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mgt(){this.buffer()}function vgt(e){let t=this.resume(),o=this.stack[this.stack.length-1];o.type,o.label=t,o.identifier=_s(this.sliceSerialize(e)).toLowerCase()}function bgt(e){this.exit(e)}function ygt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function xgt(){this.buffer()}function Cgt(e){let t=this.resume(),o=this.stack[this.stack.length-1];o.type,o.label=t,o.identifier=_s(this.sliceSerialize(e)).toLowerCase()}function wgt(e){this.exit(e)}function _gt(e,t,o,r){let n=o.createTracker(r),i=n.move("[^"),s=o.enter("footnoteReference"),a=o.enter("reference");return i+=n.move(o.safe(o.associationId(e),{...n.current(),before:i,after:"]"})),a(),s(),i+=n.move("]"),i}function Sgt(){return"["}var oIe=x(()=>{"use strict";hx();_gt.peek=Sgt});var rIe=x(()=>{"use strict";oIe()});function XG(){return{canContainEols:["delete"],enter:{strikethrough:Egt},exit:{strikethrough:Tgt}}}function Egt(e){this.enter({type:"delete",children:[]},e)}function Tgt(e){this.exit(e)}function kgt(e,t,o,r){let n=o.createTracker(r),i=o.enter("strikethrough"),s=n.move("~~");return s+=o.containerPhrasing(e,{...n.current(),before:s,after:"~"}),s+=n.move("~~"),i(),s}function Rgt(){return"~"}var nIe=x(()=>{"use strict";kgt.peek=Rgt});var iIe=x(()=>{"use strict";nIe()});function JG(){return{enter:{table:Pgt,tableData:sIe,tableHeader:sIe,tableRow:Ogt},exit:{codeText:Mgt,table:Agt,tableData:QG,tableHeader:QG,tableRow:QG}}}function Pgt(e){let t=e._align;this.enter({type:"table",align:t.map(function(o){return o==="none"?null:o}),children:[]},e),this.data.inTable=!0}function Agt(e){this.exit(e),this.data.inTable=void 0}function Ogt(e){this.enter({type:"tableRow",children:[]},e)}function QG(e){this.exit(e)}function sIe(e){this.enter({type:"tableCell",children:[]},e)}function Mgt(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ngt));let o=this.stack[this.stack.length-1];o.type,o.value=t,this.exit(e)}function Ngt(e,t){return t==="|"?t:e}var aIe=x(()=>{"use strict"});var lIe=x(()=>{"use strict";aIe()});function ZG(){return{exit:{taskListCheckValueChecked:cIe,taskListCheckValueUnchecked:cIe,paragraph:Lgt}}}function cIe(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Lgt(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let o=this.stack[this.stack.length-1];o.type;let r=o.children[0];if(r&&r.type==="text"){let n=t.children,i=-1,s;for(;++i<n.length;){let a=n[i];if(a.type==="paragraph"){s=a;break}}s===o&&(r.value=r.value.slice(1),r.value.length===0?o.children.shift():o.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,o.position.start=Object.assign({},r.position.start)))}}this.exit(e)}var dIe=x(()=>{"use strict"});var uIe=x(()=>{"use strict";dIe()});function e6(){return[qG(),YG(),XG(),JG(),ZG()]}var fIe=x(()=>{"use strict";tIe();rIe();iIe();lIe();uIe()});var pIe=x(()=>{"use strict";fIe()});function o6(){return{text:Fd}}function Vgt(e,t,o){let r=this,n,i;return s;function s(u){return!t6(u)||!CIe.call(r,r.previous)||r6(r.events)?o(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(u))}function a(u){return t6(u)?(e.consume(u),a):u===64?(e.consume(u),l):o(u)}function l(u){return u===46?e.check(Hgt,d,c)(u):u===45||u===95||ai(u)?(i=!0,e.consume(u),l):d(u)}function c(u){return e.consume(u),n=!0,l}function d(u){return i&&n&&si(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):o(u)}}function Ggt(e,t,o){let r=this;return n;function n(s){return s!==87&&s!==119||!yIe.call(r,r.previous)||r6(r.events)?o(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(zgt,e.attempt(hIe,e.attempt(gIe,i),o),o)(s))}function i(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function Ugt(e,t,o){let r=this,n="",i=!1;return s;function s(u){return(u===72||u===104)&&xIe.call(r,r.previous)&&!r6(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),n+=String.fromCodePoint(u),e.consume(u),a):o(u)}function a(u){if(si(u)&&n.length<5)return n+=String.fromCodePoint(u),e.consume(u),a;if(u===58){let f=n.toLowerCase();if(f==="http"||f==="https")return e.consume(u),l}return o(u)}function l(u){return u===47?(e.consume(u),i?c:(i=!0,l)):o(u)}function c(u){return u===null||Cm(u)||vo(u)||Md(u)||wm(u)?o(u):e.attempt(hIe,e.attempt(gIe,d),o)(u)}function d(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function $gt(e,t,o){let r=0;return n;function n(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),n):s===46&&r===3?(e.consume(s),i):o(s)}function i(s){return s===null?o(s):t(s)}}function Wgt(e,t,o){let r,n,i;return s;function s(c){return c===46||c===95?e.check(mIe,l,a)(c):c===null||vo(c)||Md(c)||c!==45&&wm(c)?l(c):(i=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(n=r,r=void 0),e.consume(c),s}function l(c){return n||r||!i?o(c):t(c)}}function jgt(e,t){let o=0,r=0;return n;function n(s){return s===40?(o++,e.consume(s),n):s===41&&r<o?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(mIe,t,i)(s):s===null||vo(s)||Md(s)?t(s):(e.consume(s),n)}function i(s){return s===41&&r++,e.consume(s),n}}function Kgt(e,t,o){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),i):a===93?(e.consume(a),n):a===60||a===null||vo(a)||Md(a)?t(a):o(a)}function n(a){return a===null||a===40||a===91||vo(a)||Md(a)?t(a):r(a)}function i(a){return si(a)?s(a):o(a)}function s(a){return a===59?(e.consume(a),r):si(a)?(e.consume(a),s):o(a)}}function qgt(e,t,o){return r;function r(i){return e.consume(i),n}function n(i){return ai(i)?o(i):t(i)}}function yIe(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||vo(e)}function xIe(e){return!si(e)}function CIe(e){return!(e===47||t6(e))}function t6(e){return e===43||e===45||e===46||e===95||ai(e)}function r6(e){let t=e.length,o=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){o=!0;break}if(r._gfmAutolinkLiteralWalkedInto){o=!1;break}}return e.length>0&&!o&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),o}var zgt,hIe,gIe,mIe,Hgt,vIe,bIe,of,Fd,Em,wIe=x(()=>{"use strict";Vo();zgt={tokenize:$gt,partial:!0},hIe={tokenize:Wgt,partial:!0},gIe={tokenize:jgt,partial:!0},mIe={tokenize:Kgt,partial:!0},Hgt={tokenize:qgt,partial:!0},vIe={tokenize:Ggt,previous:yIe},bIe={tokenize:Ugt,previous:xIe},of={tokenize:Vgt,previous:CIe},Fd={};Em=48;for(;Em<123;)Fd[Em]=of,Em++,Em===58?Em=65:Em===91&&(Em=97);Fd[43]=of;Fd[45]=of;Fd[46]=of;Fd[95]=of;Fd[72]=[of,bIe];Fd[104]=[of,bIe];Fd[87]=[of,vIe];Fd[119]=[of,vIe]});var _Ie=x(()=>{"use strict";wIe()});function n6(){return{document:{91:{tokenize:Zgt,continuation:{tokenize:emt},exit:tmt}},text:{91:{tokenize:Jgt},93:{add:"after",tokenize:Xgt,resolveTo:Qgt}}}}function Xgt(e,t,o){let r=this,n=r.events.length,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s;for(;n--;){let l=r.events[n][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return o(l);let c=_s(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?o(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Qgt(e,t){let o=e.length,r;for(;o--;)if(e[o][1].type==="labelImage"&&e[o][0]==="enter"){r=e[o][1];break}e[o+1][1].type="data",e[o+3][1].type="gfmFootnoteCallLabelMarker";let n={type:"gfmFootnoteCall",start:Object.assign({},e[o+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[o+3][1].end),end:Object.assign({},e[o+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[o+1],e[o+2],["enter",n,t],e[o+3],e[o+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",n,t]];return e.splice(o,e.length-o+1,...l),e}function Jgt(e,t,o){let r=this,n=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),i=0,s;return a;function a(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?o(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(i>999||u===93&&!s||u===null||u===91||vo(u))return o(u);if(u===93){e.exit("chunkString");let f=e.exit("gfmFootnoteCallString");return n.includes(_s(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):o(u)}return vo(u)||(s=!0),i++,e.consume(u),u===92?d:c}function d(u){return u===91||u===92||u===93?(e.consume(u),i++,c):c(u)}}function Zgt(e,t,o){let r=this,n=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),i,s=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):o(g)}function d(g){if(s>999||g===93&&!a||g===null||g===91||vo(g))return o(g);if(g===93){e.exit("chunkString");let m=e.exit("gfmFootnoteDefinitionLabelString");return i=_s(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return vo(g)||(a=!0),s++,e.consume(g),g===92?u:d}function u(g){return g===91||g===92||g===93?(e.consume(g),s++,d):d(g)}function f(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),n.includes(i)||n.push(i),At(e,h,"gfmFootnoteDefinitionWhitespace")):o(g)}function h(g){return t(g)}}function emt(e,t,o){return e.check(Nd,t,e.attempt(Ygt,t,o))}function tmt(e){e.exit("gfmFootnoteDefinition")}function omt(e,t,o){let r=this;return At(e,n,"gfmFootnoteDefinitionIndent",5);function n(i){let s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(i):o(i)}}var Ygt,SIe=x(()=>{"use strict";nA();Rn();Vo();hx();Ygt={tokenize:omt,partial:!0}});var IIe=x(()=>{"use strict";SIe()});function i6(e){let o=(e||{}).singleTilde,r={tokenize:i,resolveAll:n};return o==null&&(o=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function n(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let c=l;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[l][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";let d={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[l][1].end)},u={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[l][1].start)},f=[["enter",d,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",u,a]],h=a.parser.constructs.insideSpan.null;h&&jn(f,f.length,0,Qp(h,s.slice(c+1,l),a)),jn(f,f.length,0,[["exit",u,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",d,a]]),jn(s,c-1,l-c+3,f),l=c+f.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function i(s,a,l){let c=this.previous,d=this.events,u=0;return f;function f(g){return c===126&&d[d.length-1][1].type!=="characterEscape"?l(g):(s.enter("strikethroughSequenceTemporary"),h(g))}function h(g){let m=gx(c);if(g===126)return u>1?l(g):(s.consume(g),u++,h);if(u<2&&!o)return l(g);let v=s.exit("strikethroughSequenceTemporary"),b=gx(g);return v._open=!b||b===2&&!!m,v._close=!m||m===2&&!!b,a(g)}}}var EIe=x(()=>{"use strict";tf();mG();xI()});var TIe=x(()=>{"use strict";EIe()});function rmt(e,t,o,r){let n=0;if(!(o===0&&r.length===0)){for(;n<e.map.length;){if(e.map[n][0]===t){e.map[n][1]+=o,e.map[n][2].push(...r);return}n+=1}e.map.push([t,o,r])}}var sA,kIe=x(()=>{"use strict";sA=class{constructor(){this.map=[]}add(t,o,r){rmt(this,t,o,r)}consume(t){if(this.map.sort(function(i,s){return i[0]-s[0]}),this.map.length===0)return;let o=this.map.length,r=[];for(;o>0;)o-=1,r.push(t.slice(this.map[o][0]+this.map[o][1]),this.map[o][2]),t.length=this.map[o][0];r.push([...t]),t.length=0;let n=r.pop();for(;n;)t.push(...n),n=r.pop();this.map.length=0}}});function RIe(e,t){let o=!1,r=[];for(;t<e.length;){let n=e[t];if(o){if(n[0]==="enter")n[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(n[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(n[1].type==="tableDelimiterRow")break}else n[0]==="enter"&&n[1].type==="tableDelimiterRow"&&(o=!0);t+=1}return r}var DIe=x(()=>{"use strict"});function s6(){return{flow:{null:{tokenize:nmt,resolveAll:imt}}}}function nmt(e,t,o){let r=this,n=0,i=0,s;return a;function a(k){let D=r.events.length-1;for(;D>-1;){let z=r.events[D][1].type;if(z==="lineEnding"||z==="linePrefix")D--;else break}let A=D>-1?r.events[D][1].type:null,P=A==="tableHead"||A==="tableRow"?I:l;return P===I&&r.parser.lazy[r.now().line]?o(k):P(k)}function l(k){return e.enter("tableHead"),e.enter("tableRow"),c(k)}function c(k){return k===124||(s=!0,i+=1),d(k)}function d(k){return k===null?o(k):it(k)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),h):o(k):Ft(k)?At(e,d,"whitespace")(k):(i+=1,s&&(s=!1,n+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),u(k)))}function u(k){return k===null||k===124||vo(k)?(e.exit("data"),d(k)):(e.consume(k),k===92?f:u)}function f(k){return k===92||k===124?(e.consume(k),u):u(k)}function h(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?o(k):(e.enter("tableDelimiterRow"),s=!1,Ft(k)?At(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):g(k))}function g(k){return k===45||k===58?v(k):k===124?(s=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),m):R(k)}function m(k){return Ft(k)?At(e,v,"whitespace")(k):v(k)}function v(k){return k===58?(i+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),b):k===45?(i+=1,b(k)):k===null||it(k)?E(k):R(k)}function b(k){return k===45?(e.enter("tableDelimiterFiller"),y(k)):R(k)}function y(k){return k===45?(e.consume(k),y):k===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(k))}function C(k){return Ft(k)?At(e,E,"whitespace")(k):E(k)}function E(k){return k===124?g(k):k===null||it(k)?!s||n!==i?R(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):R(k)}function R(k){return o(k)}function I(k){return e.enter("tableRow"),S(k)}function S(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),S):k===null||it(k)?(e.exit("tableRow"),t(k)):Ft(k)?At(e,S,"whitespace")(k):(e.enter("data"),_(k))}function _(k){return k===null||k===124||vo(k)?(e.exit("data"),S(k)):(e.consume(k),k===92?T:_)}function T(k){return k===92||k===124?(e.consume(k),_):_(k)}}function imt(e,t){let o=-1,r=!0,n=0,i=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,c,d,u,f=new sA;for(;++o<e.length;){let h=e[o],g=h[1];h[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(PIe(f,t,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(o,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,u=void 0,i=[0,0,0,0],s=[0,o+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(o,0,[["enter",d,t]])),n=g.type==="tableDelimiterRow"?2:d?3:1):n&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(i[1]!==0&&(s[0]=s[1],u=aA(f,t,i,n,void 0,u),i=[0,0,0,0]),s[2]=o)):g.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(s[0]=s[1],u=aA(f,t,i,n,void 0,u)),i=s,s=[i[1],o,0,0])):g.type==="tableHead"?(a=!0,l=o):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=o,i[1]!==0?(s[0]=s[1],u=aA(f,t,i,n,o,u)):s[1]!==0&&(u=aA(f,t,s,n,o,u)),n=0):n&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=o)}for(l!==0&&PIe(f,t,l,c,d),f.consume(t.events),o=-1;++o<t.events.length;){let h=t.events[o];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=RIe(t.events,o))}return e}function aA(e,t,o,r,n,i){let s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";o[0]!==0&&(i.end=Object.assign({},bx(t.events,o[0])),e.add(o[0],0,[["exit",i,t]]));let l=bx(t.events,o[1]);if(i={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(o[1],0,[["enter",i,t]]),o[2]!==0){let c=bx(t.events,o[2]),d=bx(t.events,o[3]),u={type:a,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(o[2],0,[["enter",u,t]]),r!==2){let f=t.events[o[2]],h=t.events[o[3]];if(f[1].end=Object.assign({},h[1].end),f[1].type="chunkText",f[1].contentType="text",o[3]>o[2]+1){let g=o[2]+1,m=o[3]-o[2]-1;e.add(g,m,[])}}e.add(o[3]+1,0,[["exit",u,t]])}return n!==void 0&&(i.end=Object.assign({},bx(t.events,n)),e.add(n,0,[["exit",i,t]]),i=void 0),i}function PIe(e,t,o,r,n){let i=[],s=bx(t.events,o);n&&(n.end=Object.assign({},s),i.push(["exit",n,t])),r.end=Object.assign({},s),i.push(["exit",r,t]),e.add(o+1,0,i)}function bx(e,t){let o=e[t],r=o[0]==="enter"?"start":"end";return o[1][r]}var AIe=x(()=>{"use strict";Rn();Vo();kIe();DIe()});var OIe=x(()=>{"use strict";AIe()});function a6(){return{text:{91:smt}}}function amt(e,t,o){let r=this;return n;function n(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?o(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return vo(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):o(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):o(l)}function a(l){return it(l)?t(l):Ft(l)?e.check({tokenize:lmt},t,o)(l):o(l)}}function lmt(e,t,o){return At(e,r,"whitespace");function r(n){return n===null?o(n):t(n)}}var smt,MIe=x(()=>{"use strict";Rn();Vo();smt={tokenize:amt}});var NIe=x(()=>{"use strict";MIe()});function FIe(e){return $P([o6(),n6(),i6(e),s6(),a6()])}var LIe=x(()=>{"use strict";hG();_Ie();IIe();TIe();OIe();NIe()});var zIe={};_t(zIe,{GCI_SUPPORTED_EXTS:()=>l6,GCI_URL_PREFIX:()=>lA,IMAGE_EXTS:()=>c6,VIDEO_EXTS:()=>d6,buildDownloadURL:()=>f6,checkFileExists:()=>cA,deleteFileFromGCS:()=>u6,getFileExt:()=>Tm,shouldImageUseDarkBg:()=>BIe,testIsGoogleCloudImageFile:()=>yx,testIsImageFile:()=>Ld,testIsVideoFile:()=>xx,uploadFileToGCS:()=>rf});async function rf(e,t){let o=window.__ROOT_CTX.rootConfig.projectId,r=await gmt(e),n=Tm(e.name),i=cmt(e,r,n,t),s=`${o}/uploads/${i}`,a=Ky(window.firebase.storage,s);if(t?.checkExists&&await cA(s))throw new Error(`File already exists: ${s}`);let l=rbe(a,e),c=-1,d=Date.now();return await new Promise((u,f)=>{let h=setInterval(()=>{Date.now()-d>1e4&&(clearInterval(h),f(new Error("Upload stalled: no progress for 10 seconds")))},1e3);l.on("state_changed",g=>{g.bytesTransferred>0&&clearInterval(h),console.log(`uploading ${e.name}: ${g.bytesTransferred} / ${g.totalBytes} bytes`),g.bytesTransferred!==c&&(c=g.bytesTransferred,d=Date.now())},g=>{clearInterval(h),f(g)},()=>{console.log(`uploaded ${s}`),clearInterval(h),u(l.snapshot)})}),dmt(a,e,n,t)}async function u6(e){let t=window.firebase.storage,o;e.startsWith("/")?o=Ky(t,`gs://${e.substring(1)}`):e.startsWith("http")?o=Ky(t,e):o=Ky(t,e),await sbe(o),console.log(`deleted ${e}`)}function cmt(e,t,o,r){return r?.namingMode==="clean"?e.name:r?.namingMode==="hash-path"||r?.preserveFilename?`${t}/${e.name}`:`${t}.${o}`}async function cA(e){let t=Ky(window.firebase.storage,e);try{return await nbe(t),!0}catch(o){if(o.code==="storage/object-not-found")return!1;throw o}}async function dmt(e,t,o,r){let n={};n.filename=t.name,n.uploadedBy=window.firebase.user.email||"unknown",n.uploadedAt=String(Math.floor(new Date().getTime()));let i=`/${e.bucket}/${e.fullPath}`,s=`https://storage.googleapis.com${i}`;if(c6.includes(o)){let l=await pmt(t);if(n.width=l.width,n.height=l.height,!r?.disableGci&&l6.includes(o)){let c=await fmt(i);c&&(n.gcsPath=i,s=c)}n.canvasBgColor=await BIe(t)?"dark":"light"}else if(d6.includes(o)){let l=await hmt(s);n.width=l.width,n.height=l.height,console.log("video dimensions:",l)}let a=r?.cacheControl||"public, max-age=31536000";return await ibe(e,{cacheControl:a,customMetadata:mmt(n)}),console.log("updated meta data: ",n),{...n,src:s}}function Tm(e){return umt(e.split(".").at(-1)||"")}function umt(e){let t=String(e).toLowerCase();return t==="jpeg"&&(t="jpg"),t}async function fmt(e){let t=window.__ROOT_CTX.rootConfig.gci;if(!t)return"";let o=new URLSearchParams({gcs:e}),r=`${t}/_/serving_url?${o.toString()}`,n=await window.fetch(r);if(n.status!==200){let s=await n.text();throw console.error(`failed to get gci url: ${r}`),console.error(s),new Error("failed to get gci url")}return(await n.json()).servingUrl}async function pmt(e){return new Promise((t,o)=>{let r=new FileReader;r.onload=()=>{let n=new Image;n.onload=()=>{t({width:n.width,height:n.height})},n.onerror=o,n.src=String(r.result)},r.onerror=o,r.readAsDataURL(e)})}async function hmt(e){return new Promise((t,o)=>{let r=document.createElement("video");r.addEventListener("loadedmetadata",()=>{let n={width:r.videoWidth,height:r.videoHeight};t(n),document.body.removeChild(r)},!1),r.addEventListener("error",()=>{o(new Error("Failed to load video metadata")),document.body.removeChild(r)},!1),r.className="sr-only",r.src=e,r.preload="metadata",document.body.appendChild(r)})}async function gmt(e){let t=await e.arrayBuffer(),o=await crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(o)).map(i=>i.toString(16).padStart(2,"0")).join("")}function mmt(e){let t={};return Object.entries(e).forEach(([o,r])=>{e[o]=String(r).trim()}),t}function Ld(e){if(!e)return!1;if(yx(e)||e.startsWith("data:image/")||e.startsWith("blob:"))return!0;let t=Tm(e);return c6.includes(t)}function yx(e){return e?e.startsWith(lA):!1}function xx(e){if(!e)return!1;let t=Tm(e);return d6.includes(t)}function f6(e){return yx(e)?e.split("=")[0]+"=s0-d":e}function BIe(e){return new Promise((t,o)=>{let r=new Image,n=new FileReader;n.onload=()=>{r.src=n.result},r.onload=()=>{let i=document.createElement("canvas"),s=i.getContext("2d");i.width=r.width,i.height=r.height,s.drawImage(r,0,0,i.width,i.height);let{data:a}=s.getImageData(0,0,i.width,i.height),l=0,c=0,d=0,u=0,f=Math.floor(a.length/4e4)*4;f<4&&(f=4);for(let g=0;g<a.length;g+=f)a[g+3]<128||(l+=a[g],c+=a[g+1],d+=a[g+2],u++);if(u===0){t(!1);return}let h=.299*(l/u)+.587*(c/u)+.114*(d/u);t(h>128)},r.onerror=o,n.onerror=o,n.readAsDataURL(e)})}var l6,c6,d6,lA,Zp=x(()=>{"use strict";A3();l6=["bmp","gif","ico","jpeg","jpg","png","tiff","webp"],c6=[...l6,"svg"],d6=["mp4","webm"],lA="https://lh3.googleusercontent.com/"});function dA(e){let[t,o]=N(""),r=G(null),n=G(null),[i,s]=N(null),[a,l]=N(!1),c=!t;function d(b){return b.endsWith(".jpg")?"image/jpeg":"image/png"}async function u(){if(!t)return;let b=[{type:"text",text:t}];i&&b.push({type:"image",image:{src:i.src,width:i.width,height:i.height,alt:i.filename}});let y=e.chat.addMessage({sender:"user",blocks:b});o(""),s(null),f();let C=[{text:t}];i&&C.push({media:{url:i.src,contentType:d(i.filename)}});let E=await e.chat.sendPrompt(y,C,e.options);e.onData&&E&&e.onData(E)}function f(){window.requestAnimationFrame(()=>{let b=r.current;b.style.height="auto",b.style.height=`${b.scrollHeight}px`})}function h(b){if(b.key==="Enter"&&!b.shiftKey){b.preventDefault(),u();return}}async function g(b){try{l(!0),f();let y=await rf(b,{disableGci:!0});s({src:y.src,width:y.width,height:y.height,filename:y.filename}),l(!1)}catch{l(!1)}if(n.current){let y=n.current;y.value=""}}function m(b){let E=(b.target.files||[])[0];E&&g(E)}function v(){s(null),f()}return $(()=>{f()},[t]),p("div",{className:"AIPage__ChatBar",children:[p("div",{className:ze("AIPage__ChatBar__prompt",(a||i)&&"AIPage__ChatBar__prompt--hasImage"),children:[p("label",{className:"AIPage__ChatBar__prompt__imageUpload",children:[p("input",{className:"AIPage__ChatBar__prompt__imageUpload__input",type:"file",accept:"image/png, image/jpeg, image/webp",onChange:m,ref:n}),p(Ee,{label:"Upload image",children:p(Ke,{component:"div",className:"AIPage__ChatBar__prompt__imageUpload__icon",radius:"xl",children:p(iI,{size:18})})})]}),p("textarea",{className:"AIPage__ChatBar__prompt__textInput",ref:r,placeholder:"Enter prompt...",rows:1,onKeyDown:h,onPaste:b=>{let y=b.clipboardData?.items||[];for(let C of y)if(C.kind==="file"&&C.type.startsWith("image/")){let E=C.getAsFile();E&&g(E)}},onChange:b=>{o(b.target.value)},value:t,autofocus:!0}),(a||i)&&p("div",{className:"AIPage__ChatBar__prompt__imagePreview",children:a?p(gt,{size:"sm"}):p(Ee,{label:i.filename,transition:"pop",position:"right",withArrow:!0,children:p("button",{className:"AIPage__ChatBar__prompt__imagePreview__closeButton",onClick:()=>v(),children:[p("img",{src:i.src,width:i.width,height:i.height,alt:"attachment"}),p("div",{className:"AIPage__ChatBar__prompt__imagePreview__closeButton__icon",children:p(hI,{size:24,color:"white"})})]})})}),p(Ke,{className:"AIPage__ChatBar__prompt__submit",variant:"filled",color:"dark",radius:"xl",onClick:()=>u(),disabled:c,children:p(B5,{size:18})})]}),p("div",{className:"AIPage__ChatBar__disclaimer",children:"Root AI is experimental and makes mistakes. Check all info."})]})}var p6=x(()=>{"use strict";Ye();qt();Ne();No();Zp();X()});function eo(e){$(()=>{let t=window.__ROOT_CTX?.rootConfig,o=t?.projectName||"Root CMS",r=t?.minimalBranding?o:`${o} \u2013 Root CMS`;document.title=e?`${e} \u2013 ${r}`:r},[e])}var Xr=x(()=>{"use strict";Ne()});var h6,HIe=x(()=>{h6={name:"@blinkk/root-cms",version:"2.5.13",author:"s@blinkk.com",license:"MIT",engines:{node:">=16.0.0"},repository:{type:"git",url:"git+https://github.com/blinkk/rootjs.git",directory:"packages/root-cms"},files:["dist/**/*"],bin:{"root-cms":"./bin/root-cms.js"},type:"module",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./client":{types:"./dist/client.d.ts",import:"./dist/client.js"},"./core":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./functions":{types:"./dist/functions.d.ts",import:"./dist/functions.js"},"./plugin":{types:"./dist/plugin.d.ts",import:"./dist/plugin.js"},"./project":{types:"./dist/project.d.ts",import:"./dist/project.js"},"./richtext":{types:"./dist/richtext.d.ts",import:"./dist/richtext.js"}},scripts:{build:'rm -rf dist && concurrently -n "core,signin,ui" npm:build:core npm:build:signin npm:build:ui',"build:core":"tsup-node --config=./core/tsup.config.ts","//":"NOTE: esbuild is used here because tsup doesn't currently support aliases.","build:ui":"esbuild ui/ui.tsx --bundle --minify --alias:react=@preact/compat --alias:react-dom=@preact/compat --tsconfig=ui/tsconfig.json --outdir=dist/ui --legal-comments=external","build:signin":"esbuild signin/signin.tsx --bundle --minify --tsconfig=signin/tsconfig.json --outdir=dist/ui --legal-comments=external",dev:'rm -rf dist && concurrently -k -n "core,ui" npm:dev:core npm:dev:signin npm:dev:ui',"dev:core":"pnpm build:core --watch","dev:signin":"pnpm build:signin --watch","dev:ui":"pnpm build:ui --watch",test:"pnpm build && firebase emulators:exec 'vitest run --exclude=**/*.visual.test.tsx'","test:visual":"vitest run --config=vitest.config.visual.ts","test:watch":"pnpm build && firebase emulators:exec 'vitest'"},dependencies:{"@ag-grid-community/client-side-row-model":"32.3.9","@ag-grid-community/core":"32.3.9","@ag-grid-community/react":"32.3.9","@ag-grid-community/styles":"32.3.9","@genkit-ai/ai":"1.26.0","@genkit-ai/core":"1.26.0","@genkit-ai/google-genai":"1.26.0","@google-cloud/firestore":"7.11.3","@hello-pangea/dnd":"18.0.1","@types/cli-progress":"3.11.6","body-parser":"1.20.2","cli-progress":"3.12.0",commander:"11.0.0","csv-parse":"5.5.2","csv-stringify":"6.4.4","date-fns":"4.1.0","date-fns-tz":"3.2.0",diff:"8.0.2","dts-dom":"3.7.0","fnv-plus":"1.3.1",genkit:"1.26.0",jsonwebtoken:"9.0.2",kleur:"4.1.5",sirv:"2.0.3","tiny-glob":"0.2.9"},"//":"NOTE(stevenle): due to compat issues with mantine and preact, mantine is pinned to v4.2.12",devDependencies:{"@babel/core":"7.17.9","@blinkk/root":"workspace:*","@editorjs/editorjs":"2.30.8","@editorjs/header":"2.8.8","@editorjs/image":"2.10.2","@editorjs/list":"2.0.6","@editorjs/nested-list":"1.4.3","@editorjs/raw":"2.5.1","@editorjs/table":"2.4.4","@editorjs/underline":"1.2.1","@emotion/react":"11.10.5","@firebase/app-compat":"0.5.2","@firebase/app-types":"0.9.3","@firebase/rules-unit-testing":"5.0.0","@lexical/code":"0.33.1","@lexical/html":"0.33.1","@lexical/link":"0.33.1","@lexical/list":"0.33.1","@lexical/markdown":"0.33.1","@lexical/react":"0.33.1","@lexical/rich-text":"0.33.1","@lexical/selection":"0.33.1","@lexical/table":"0.33.1","@lexical/utils":"0.33.1","@mantine/core":"4.2.12","@mantine/hooks":"4.2.12","@mantine/modals":"4.2.12","@mantine/notifications":"4.2.12","@mantine/spotlight":"4.2.12","@preact/compat":"18.3.1","@tabler/icons-preact":"3.35.0","@testing-library/preact":"3.2.4","@testing-library/user-event":"14.6.1","@types/body-parser":"1.19.3","@types/fnv-plus":"1.3.2","@types/gapi":"0.0.47","@types/gapi.client.drive-v3":"0.0.4","@types/gapi.client.sheets-v4":"0.0.4","@types/google.accounts":"0.0.14","@types/jsonwebtoken":"9.0.1","@types/node":"24.3.1","@vitest/browser":"4.0.10","@vitest/browser-playwright":"4.0.10",concurrently:"7.6.0",esbuild:"0.25.9",firebase:"12.2.1","firebase-admin":"13.5.0","firebase-functions":"6.4.0","firebase-tools":"14.15.2","highlight.js":"11.6.0",jsdom:"27.2.0","json-diff-kit":"1.0.29",lexical:"0.33.1",marked:"9.1.1","mdast-util-from-markdown":"2.0.1","mdast-util-gfm":"3.0.0","micromark-extension-gfm":"3.0.0",playwright:"1.56.1",preact:"10.27.1","preact-iso":"2.11.1","preact-render-to-string":"6.6.7",react:"npm:@preact/compat@18.3.1","react-dom":"npm:@preact/compat@18.3.1","react-easy-crop":"5.5.6","react-json-view-compare":"2.0.2",tsup:"8.5.0",typescript:"5.9.2",vite:"7.1.4",vitest:"4.0.10",yjs:"13.6.27"},peerDependencies:{"@blinkk/root":"2.5.13","firebase-admin":">=11","firebase-functions":">=4",preact:">=10"},peerDependenciesMeta:{"firebase-functions":{optional:!0}}}});function VIe(){return p("svg",{width:"100",height:"23",viewBox:"0 0 100 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("g",{"clip-path":"url(#clip0_1_318)",children:[p("path",{d:"M7.82998 5.01802C3.12925 5.6479 0.833937 18.1194 2.62578 19.6731C5.64773 22.2934 16.6441 14.1722 15.6786 9.46913C15.3009 6.61371 11.2717 4.28377 7.82998 5.01802Z",fill:"black"}),p("path",{d:"M13.9782 0.720147C12.6553 0.896474 12.0093 4.38767 12.5136 4.8226C13.364 5.55611 16.4587 3.28271 16.187 1.96616C16.0807 1.16683 14.9468 0.514607 13.9782 0.720147Z",fill:"black"}),p("path",{d:"M92.7383 17.6275C90.9681 17.6275 89.3816 17.0263 88.3796 16.0744C87.9955 15.7237 87.8953 15.3396 88.246 14.9555L88.8305 14.2541C89.1645 13.87 89.5486 13.7865 89.9327 14.1205C90.6007 14.6883 91.7029 15.1726 92.5713 15.1726C93.5232 15.1726 94.1244 14.8219 94.1244 14.2875C94.1244 13.5193 93.2059 13.4358 91.9868 13.0684C90.417 12.6008 88.5132 11.7324 88.5132 9.64493C88.5132 7.70773 90.25 6.37173 92.7383 6.37173C94.2413 6.37173 95.5272 6.87273 96.4123 7.57413C96.8131 7.90813 96.9467 8.27553 96.596 8.67633L96.0282 9.37773C95.7109 9.76183 95.3435 9.82863 94.926 9.51133C94.3916 9.09383 93.6568 8.69303 92.7884 8.69303C92.0202 8.69303 91.5192 9.01033 91.5192 9.51133C91.5192 10.1292 92.3041 10.4131 93.1224 10.6636C94.9761 11.2314 97.1304 11.8326 97.1304 14.2708C97.1304 16.4585 95.1264 17.6275 92.7383 17.6275Z",fill:"black"}),p("path",{d:"M87.0008 16.6756C87.0843 17.1766 86.8171 17.4271 86.2994 17.4271H85.097C84.596 17.4271 84.3789 17.1766 84.3121 16.6756L83.7443 11.9161L81.757 16.7424C81.5399 17.2434 81.1892 17.5106 80.6882 17.5106H80.5212C80.0202 17.5106 79.6695 17.2434 79.4524 16.7424L77.4651 11.8994L76.8973 16.6756C76.8472 17.1766 76.6301 17.4271 76.1291 17.4271H74.7263C74.2086 17.4271 73.9414 17.1766 74.0082 16.6756L75.4945 7.24013C75.5613 6.75583 75.8786 6.48863 76.3796 6.48863H76.5466C77.0476 6.48863 77.3315 6.75583 77.5486 7.24013L80.6047 13.8032L83.4938 7.24013C83.7109 6.75583 84.0115 6.48863 84.4958 6.48863H84.6795C85.1638 6.48863 85.4811 6.75583 85.5646 7.24013L87.0008 16.6756Z",fill:"black"}),p("path",{d:"M68.6496 17.6275C65.3096 17.6275 62.7211 15.2227 62.7211 11.9996C62.7211 8.77653 65.3096 6.37173 68.683 6.37173C70.3029 6.37173 71.7558 6.97293 72.7745 7.99163C73.1419 8.34233 73.1419 8.77653 72.7745 9.09383L71.9228 9.81193C71.5554 10.1292 71.2047 10.1125 70.8206 9.79523C70.2361 9.31093 69.5013 9.01033 68.683 9.01033C67.013 9.01033 65.7104 10.2628 65.7104 11.9996C65.7104 13.7364 67.013 14.9889 68.683 14.9889C69.5013 14.9889 70.2528 14.6883 70.8206 14.204C71.2047 13.8867 71.5554 13.87 71.9228 14.1873L72.7745 14.9054C73.1419 15.2227 73.1419 15.6569 72.7745 16.0076C71.7558 17.0263 70.3029 17.6275 68.6496 17.6275Z",fill:"black"}),p("path",{d:"M58.575 16.2915C58.7587 16.6923 58.4581 16.8927 58.241 17.0597C57.7233 17.4271 56.9384 17.6442 56.1201 17.6442C54.4501 17.6442 52.8469 16.6923 52.8469 14.4044V11.0978H52.1121C51.6111 11.0978 51.3439 10.8139 51.3439 10.3296V9.76183C51.3439 9.26083 51.6111 8.99363 52.1121 8.99363H52.8469V7.05643C52.8469 6.57213 53.1308 6.38843 53.6151 6.28823L54.9511 6.05443C55.4521 5.95423 55.7193 6.30493 55.7193 6.80593V8.99363H57.3726C57.8569 8.99363 58.1408 9.26083 58.1408 9.76183V10.3296C58.1408 10.8139 57.8569 11.0978 57.3726 11.0978H55.7193V14.1038C55.7193 14.9221 56.1368 15.1893 56.6545 15.1893C56.905 15.1893 57.1555 15.0724 57.3392 14.9555C57.7567 14.6883 57.9571 14.8887 58.1074 15.206L58.575 16.2915Z",fill:"black"}),p("path",{d:"M46.2592 17.6442C43.5538 17.6442 41.5999 15.7738 41.5999 13.2521C41.5999 10.7304 43.5538 8.86003 46.2592 8.86003C48.9646 8.86003 50.9185 10.7304 50.9185 13.2521C50.9185 15.7738 48.9646 17.6442 46.2592 17.6442ZM46.2592 15.1726C47.3113 15.1726 48.0628 14.3543 48.0628 13.2521C48.0628 12.1499 47.3113 11.3316 46.2592 11.3316C45.2071 11.3316 44.4389 12.1499 44.4389 13.2521C44.4389 14.3543 45.2071 15.1726 46.2592 15.1726Z",fill:"black"}),p("path",{d:"M36.052 17.6442C33.3466 17.6442 31.3927 15.7738 31.3927 13.2521C31.3927 10.7304 33.3466 8.86003 36.052 8.86003C38.7574 8.86003 40.7113 10.7304 40.7113 13.2521C40.7113 15.7738 38.7574 17.6442 36.052 17.6442ZM36.052 15.1726C37.1041 15.1726 37.8556 14.3543 37.8556 13.2521C37.8556 12.1499 37.1041 11.3316 36.052 11.3316C34.9999 11.3316 34.2317 12.1499 34.2317 13.2521C34.2317 14.3543 34.9999 15.1726 36.052 15.1726Z",fill:"black"}),p("path",{d:"M28.7099 13.0851L30.6805 16.6422C30.9644 17.1599 30.6638 17.4271 30.1628 17.4271H28.4594C27.9417 17.4271 27.8081 17.1766 27.5242 16.6589L25.7707 13.4859H24.6351V16.6422C24.6351 17.1432 24.3512 17.4271 23.8502 17.4271H22.4808C21.9798 17.4271 21.6959 17.1432 21.6959 16.6422V7.35703C21.6959 6.85603 21.9798 6.57213 22.4808 6.57213H26.5222C29.3111 6.57213 30.8141 7.92483 30.8141 10.1125C30.8141 11.5654 29.9791 12.5841 28.7099 13.0851ZM24.6351 8.96023V11.5153H26.4721C27.2236 11.5153 27.8248 11.0644 27.8248 10.2628C27.8248 9.44453 27.2236 8.96023 26.4721 8.96023H24.6351Z",fill:"black"})]}),p("defs",{children:p("clipPath",{id:"clip0_1_318",children:p("rect",{width:"99",height:"22",fill:"white",transform:"translate(0.0175781 0.177246)"})})})]})}var GIe=x(()=>{"use strict";X()});var UIe=x(()=>{});function dt(e){return p("div",{className:"Layout",children:[p(dt.Top,{}),p(dt.Side,{}),p(dt.Main,{...e,children:e.children}),p(dt.Bottom,{})]})}var nf,Qr=x(()=>{"use strict";Ye();qt();nl();HIe();GIe();No();UIe();X();nf="1.5";dt.Top=()=>{let e=window.__ROOT_CTX.rootConfig,t=e.projectName||e.projectId,o=e.minimalBranding;return p("div",{className:"Layout__top",children:o?p(Oe,{children:[p("a",{className:"Layout__top__logo",href:"/cms",children:t}),p("div",{className:"Layout__top__version",children:["v",h6.version]})]}):p(Oe,{children:[p("a",{className:"Layout__top__logo",href:"/cms",children:p(VIe,{})}),p("div",{className:"Layout__top__version",children:["v",h6.version]}),p("div",{className:"Layout__top__project",children:t})]})})};dt.Side=()=>{let{url:e}=Nr(),t=e.replace(/\/*$/g,""),o=window.firebase.user,r=window.__ROOT_CTX.sidebar?.tools,n=new Set(window.__ROOT_CTX.sidebar?.hiddenBuiltInTools||[]),i=l=>n.has(l),s=window.__ROOT_CTX.experiments||{},a=async()=>{await window.firebase.auth.signOut(),window.location.href="/cms/login"};return p("div",{className:"Layout__side",children:[p("div",{className:"Layout__side__buttons",children:[!i("home")&&p(dt.SideButton,{label:"Home",url:"/cms",active:t==="/cms",children:p(x5,{stroke:nf})}),!i("content")&&p(dt.SideButton,{label:"Content",url:"/cms/content",active:t.startsWith("/cms/content"),children:p(sx,{stroke:nf})}),!i("releases")&&p(dt.SideButton,{label:"Releases",url:"/cms/releases",active:t.startsWith("/cms/releases"),children:p(qp,{stroke:nf})}),!i("data")&&p(dt.SideButton,{label:"Data",url:"/cms/data",active:t.startsWith("/cms/data"),children:p(s5,{stroke:nf})}),!i("assets")&&p(dt.SideButton,{label:"Assets",url:"/cms/assets",active:t.startsWith("/cms/assets"),children:p(aI,{stroke:nf})}),!i("translations")&&p(dt.SideButton,{label:"Translations",url:"/cms/translations",active:t.startsWith("/cms/translations"),children:p(Od,{stroke:nf})}),s.ai&&!i("ai")&&p(dt.SideButton,{label:"Root AI (experimental)",url:"/cms/ai",active:t.startsWith("/cms/ai"),children:p(gm,{stroke:nf})}),r&&p(Oe,{children:[p("div",{className:"Layout__side__divider"}),Object.entries(r).map(([l,c])=>{let d=c.cmsUrl?.startsWith("/cms/")?c.cmsUrl:void 0,u=c.externalUrl,f=u??d??`/cms/tools/${l}`,h=u?void 0:f.replace(/\/*$/g,""),g=!u&&!!h&&(t===h||t.startsWith(`${h}/`));return p(dt.SideButton,{className:"Layout__side__tool",label:c.label||"",url:f,active:g,external:!!u,children:c.icon?p("img",{className:"Layout__side__tool__icon",src:c.icon,alt:c.label||""}):p(Z3,{stroke:nf})},l)}),p("div",{className:"Layout__side__divider"})]}),!i("settings")&&p(dt.SideButton,{label:"Settings",url:"/cms/settings",active:t.startsWith("/cms/settings"),children:p(bm,{stroke:nf})})]}),p("div",{className:"Layout__side__user",children:p(Me,{shadow:"md",position:"right",control:p(Ab,{children:p(hd,{src:o.photoURL,alt:o.email,size:30,radius:"xl"})}),children:[p(Me.Label,{children:p(Xt,{size:"xs",color:"dimmed",truncate:!0,children:["Signed in as ",o.email]})}),p(wi,{}),p(Me.Item,{color:"red",icon:p(k5,{style:{width:14,height:14}}),onClick:a,children:"Sign out"})]})})]})};dt.SideButton=e=>p(Ee,{className:ze("Layout__side__button",e.className),label:e.label,position:"right",withArrow:!0,children:p("a",{className:ze(e.active&&"active"),href:e.url,target:e.external?"_blank":void 0,rel:e.external?"noreferrer noopener":void 0,children:e.children})});dt.Main=e=>p("div",{className:"Layout__main",children:e.children});dt.Bottom=()=>p("div",{className:"Layout__bottom"})});function qs(e){e||(e=6);let t=[],o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=o.length;for(let n=0;n<e;n++)t.push(o.charAt(Math.floor(Math.random()*r)));return t.join("")}function $Ie(e,t){return Math.random()*(t-e)+e}var II=x(()=>{"use strict"});var XIe={};_t(XIe,{AIPage:()=>ymt,ChatWindow:()=>uA,useChat:()=>Cx});function WIe(){return $Ie(...bmt)}function Cx(){let[e,t]=N([]),[o,r]=N(""),n=a=>{let l=0;return t(c=>{let d={sender:"bot",blocks:[{type:"pending"}],key:qs()},u=[...c,{...a,key:qs()},d];return l=u.length-1,u}),l},i=(a,l)=>{t(c=>{let d=[...c];return d[a]={...l,key:qs()},d})};return{chatId:o,messages:e,addMessage:n,updateMessage:i,sendPrompt:async(a,l,c)=>{let d="/cms/api/ai.chat";typeof window.__ROOT_CTX.experiments?.ai=="object"&&window.__ROOT_CTX.experiments.ai.endpoint&&(d=window.__ROOT_CTX.experiments.ai.endpoint);let u={prompt:l,chatId:o,options:c},f=await window.fetch(d,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(u)});if(f.status!==200){let g=await f.text();console.error("chat failed",g);let m=["Something went wrong:","```",g,"```"].join(`
|
|
65
65
|
`);return i(a,{sender:"bot",blocks:[{type:"text",text:m}]}),{message:m,data:{},error:g}}let h=await f.json();return h.success&&h.chatId?(r(h.chatId),i(a,{sender:"bot",data:h.response?.data||{},blocks:[{type:"text",text:h.response?.message||""}]}),h.response):{message:"Sorry. Something went wrong. An unknown error occurred.",data:{},error:"Unknown error"}}}}function ymt(){eo("AI");let e=Cx(),t=window.__ROOT_CTX.experiments?.ai||!1;return p(dt,{children:p("div",{className:"AIPage",children:t?p(Oe,{children:[p(uA,{chat:e,children:p("p",{children:"Chat with me about your website. Ask questions about the content and I can tell you about it."})}),p(dA,{chat:e})]}):p("div",{className:"AIPage__notEnabled",children:[p("div",{className:"AIPage__notEnabled__icon",children:p(gm,{size:36})}),p("div",{className:"AIPage__notEnabled__title",children:"Root AI is not enabled for this project."})]})})})}function uA(e){let t=e.chat.messages;return p("div",{className:"AIPage__ChatWindow",children:t.length>0?p("div",{className:"AIPage__ChatWindow__messages",children:e.chat.messages.map((o,r)=>p(xmt,{message:o},o.key||r))}):p("div",{className:"AIPage__ChatWindow__welcome",children:[p("div",{className:"AIPage__ChatWindow__welcome__icon",children:p(gm,{size:36})}),p("div",{className:"AIPage__ChatWindow__welcome__title",children:"Root AI is ready"}),e.children&&p("div",{className:"AIPage__ChatWindow__welcome__body",children:e.children})]})})}function xmt(e){let t=e.message,o=t.sender==="user"?"You":"Root AI",r=window.firebase.user,n=t.sender==="bot",i=G(null);return $(()=>{t.sender==="user"&&i.current.scrollIntoView({behavior:"smooth",block:"start"})},[]),p("div",{className:"AIPage__ChatMessage",ref:i,children:[p("div",{className:"AIPage__ChatMessage__side",children:p("div",{className:"AIPage__ChatMessage__side__avatar",children:t.sender==="user"?p(hd,{src:r.photoURL,alt:r.email,size:28,radius:"xl"}):p(gm,{size:28})})}),p("div",{className:"AIPage__ChatMessage__main",children:[p("div",{className:"AIPage__ChatMessage__main__username",children:o}),p("div",{className:"AIPage__ChatMessage__main__blocks",children:p(Cmt,{message:t,animated:n})})]})]})}function Cmt(e){let t=e.message,[o,r]=N(e.animated?[]:t.blocks);function n(){if(o.length>=t.blocks.length)return;let i=[...o,t.blocks[o.length]];r(i)}return $(()=>{e.animated&&n()},[e.animated]),p("div",{className:"AIPage__ChatMessageBlocks",children:o.map((i,s)=>{let a=`${s}-${i.type}`;return i.type==="image"?p(Imt,{block:i,animated:e.animated,onAnimationComplete:()=>n()},a):i.type==="pending"?p(Smt,{block:i,animated:e.animated,onAnimationComplete:()=>n()},a):i.type==="text"?p(wmt,{block:i,animated:e.animated,onAnimationComplete:()=>n()},a):p("div",{children:["unknown block type: ",i.type]})})})}function jIe(e){let[t,o]=N(e.animated?[]:e.nodes),r=t.length>=e.nodes.length,n=()=>{o(s=>s.length>=e.nodes.length?e.nodes:[...s,e.nodes[s.length]])},i=()=>{if(t.length>=e.nodes.length){e.onAnimationComplete&&e.onAnimationComplete();return}window.setTimeout(()=>n(),WIe())};return $(()=>{e.animated&&n()},[]),{nodes:t,next:i,complete:r}}function wmt(e){let t=ee(()=>HG(e.block.text,{extensions:[FIe()],mdastExtensions:[e6()]}),[e.block.text]),{nodes:o,next:r}=jIe({nodes:t.children,animated:e.animated,onAnimationComplete:e.onAnimationComplete});return $(()=>{t.children.length===0&&e.animated&&e.onAnimationComplete()},[t.children.length,e.animated]),p("div",{className:"AIPage__ChatMessageTextBlock",children:o.map((n,i)=>p(KIe,{node:n,animated:e.animated,onAnimationComplete:r},i))})}function KIe(e){let t=e.node;if(t.type==="code")return p(_mt,{text:t.value,language:t.lang,animated:e.animated,onAnimationComplete:e.onAnimationComplete});if(t.type==="heading"){let o=`h${t.depth||2}`;return p(km,{as:o,nodes:t.children,animated:e.animated,onAnimationComplete:e.onAnimationComplete})}if(t.type==="inlineCode")return p(km,{as:"code",nodes:[{type:"text",value:t.value}],animated:e.animated,onAnimationComplete:e.onAnimationComplete});if(t.type==="link")return p(km,{as:"a",attrs:{href:t.url,target:"_blank"},nodes:t.children,animated:e.animated,onAnimationComplete:e.onAnimationComplete});if(t.type==="list"){let o=t.ordered?"ol":"ul";return p(km,{as:o,nodes:t.children,animated:e.animated,onAnimationComplete:e.onAnimationComplete})}return t.type==="listItem"?p(km,{as:"li",nodes:t.children,animated:e.animated,onAnimationComplete:e.onAnimationComplete}):t.type==="paragraph"?p(km,{as:"p",nodes:t.children,animated:e.animated,onAnimationComplete:e.onAnimationComplete}):t.type==="strong"?p(km,{as:"b",nodes:t.children,animated:e.animated,onAnimationComplete:e.onAnimationComplete}):t.type==="text"?p(qIe,{text:t.value,animated:e.animated,onAnimationComplete:e.onAnimationComplete}):p("div",{children:JSON.stringify(e.node)})}function km(e){let{nodes:t,next:o}=jIe({nodes:e.nodes,animated:e.animated,onAnimationComplete:e.onAnimationComplete}),r=e.as;return p(r,{...e.attrs,children:t.map((n,i)=>p(KIe,{node:n,animated:e.animated,onAnimationComplete:()=>o()},i))})}function qIe(e){let t=e.sep||" ",o=ee(()=>e.text.split(t),[e.text]),[r,n]=N(e.animated?0:o.length),i=r>=o.length;return $(()=>{if(!e.animated||r>=o.length)return;let s=window.setTimeout(()=>{n(r+1)},WIe());return()=>window.clearTimeout(s)},[e.text,r]),$(()=>{i&&e.animated&&e.onAnimationComplete()},[i]),p(Oe,{children:[o.slice(0,r).join(t),!i&&p(YIe,{})]})}function _mt(e){let t=G(null),[o,r]=N(!1);function n(){let a=t.current;fG.highlightElement(a),console.log("highlight:",a)}async function i(){try{await navigator.clipboard.writeText(e.text),r(!0),window.setTimeout(()=>{r(!1)},2e3)}catch(a){console.error("failed to copy to clipboard:",a)}}function s(){n(),e.onAnimationComplete()}return $(()=>{e.animated||n()},[e.animated]),p("div",{className:"AIPage__CodeBlockNode",children:[p("div",{className:"AIPage__CodeBlockNode__header",children:[e.language&&p("div",{className:"AIPage__CodeBlockNode__language",children:e.language}),p(Ee,{label:"Copy code",position:"bottom",transition:"pop",children:p(Ke,{onClick:()=>i(),size:"xs",children:o?p(o5,{color:"#80868b","stroke-width":1.5,size:16}):p(YS,{color:"#80868b","stroke-width":1.5,size:16})})})]}),p("pre",{ref:t,class:`language-${e.language||"unknown"}`,children:p(qIe,{text:e.text,sep:`
|
|
66
66
|
`,animated:e.animated,onAnimationComplete:s})})]})}function Smt(e){return $(()=>{e.animated&&e.onAnimationComplete()},[]),p("div",{className:"AIPage__PendingMessageBlock",children:p(YIe,{})})}function YIe(){return p("div",{className:"AIPage__CursorDot"})}function Imt(e){let t=e.block.image;return $(()=>{e.animated&&e.onAnimationComplete()},[]),p("div",{className:"AIPage__ImageMessageBlock",children:p("img",{src:t.src,width:t.width,height:t.height,alt:t.alt})})}var bmt,fA=x(()=>{"use strict";SCe();Ye();qt();A_e();GSe();pIe();LIe();Ne();p6();Xr();Qr();II();X();bmt=[20,40];fG.configure({ignoreUnescapedHTML:!0})});function QIe(e){let t=Cx();return p(Oe,{children:[p(uA,{chat:t,children:e.children}),p(dA,{chat:t,options:{mode:"edit",editData:e.editModeData},onData:e.onEditModeResponse})]})}var JIe=x(()=>{"use strict";fA();p6();X()});function ZIe(){let e=Wt(),t=io();return{open:o=>{e.openContextModal(g6,{...t,title:o.title||"Edit with AI (Experimental)",innerProps:o,size:"calc(min(1920px, calc(100% - 96px)))",centered:!0})},close:()=>{e.closeModal(g6)}}}function pA(e){let{innerProps:t,context:o,id:r}=e,n=G(null),i=ee(()=>JSON.stringify(t.data||{},null,2),[t.data]),[s,a]=N(i),l=ee(()=>{if(!s)return null;try{return JSON.parse(s)}catch{return null}},[s]),c=ee(()=>s!==i,[s,i]),d=fe(()=>{if(!l)return;let f=Zy(l);t.onSave&&t.onSave(f)},[l]),u=fe(f=>{if(f?.data){let h=JSON.stringify(f.data,null,2);a(h),n.current?.click()}},[]);return p("div",{className:"AiEditModal",children:[p("div",{className:"AiEditModal__SplitPanel",children:[p("div",{className:"AiEditModal__SplitPanel__ChatPanel",children:p(QIe,{editModeData:l,onEditModeResponse:u,children:[p("p",{children:"Tell me what you want to change. I can make simple text edits, replace content within a module, or answer questions about the content."}),p("p",{children:"Just enter simple instructions, or attach a screenshot and ask me to use it as reference."})]})}),p("div",{className:"AiEditModal__SplitPanel__JsonPanel",children:p(gd,{className:"AiEditModal__Tabs",grow:!0,children:[p(gd.Tab,{label:"JSON",icon:p(C5,{size:20}),children:p("div",{className:"AiEditModal__JsonEditor",children:p(vp,{value:s,onChange:f=>a(f),formatOnBlur:!0,height:"100%",className:"AiEditModal__JsonInput"})})}),p(gd.Tab,{ref:n,label:"Diff",icon:p(f5,{size:20}),children:p("div",{className:"AiEditModal__JsonDiffViewer",children:t.data&&s&&p(PP,{oldCode:i,newCode:s})})})]})})]}),p("div",{className:"AiEditModal__buttons",children:[p(oe,{variant:"default",size:"xs",color:"dark",type:"button",onClick:()=>o.closeModal(r),children:"Cancel"}),p(oe,{variant:"default",size:"xs",type:"button",leftIcon:p(Zu,{size:16}),disabled:!c,onClick:()=>a(i),children:"Reset"}),p(oe,{leftIcon:p(js,{size:16}),variant:"filled",size:"xs",color:"green",disabled:!l||!c,onClick:d,children:"Accept changes"})]})]})}var g6,m6=x(()=>{"use strict";uye();Ye();Tn();qt();Ne();Ne();fn();pn();Q5();JIe();X();g6="AiEditModal";pA.id=g6});var e0e=x(()=>{});function ht(e){let{className:t,as:o,size:r,weight:n,color:i,children:s,...a}=e;return p(o||"div",{...a,className:ze(t,"text",r&&`size:${r}`,n&&`weight:${n}`,i&&`color:${i}`),children:s})}var Kn=x(()=>{"use strict";No();e0e();X()});function EI(e){let o=window.__ROOT_CTX.collections[e.collectionId];if(!o)throw new Error(`collection not found: ${e.collectionId}`);if(!o.url)return"";let r=o.domain||window.__ROOT_CTX.rootConfig.domain||"https://example.com",n=v6(e);return`${r}${n}`}function v6(e){let t=window.__ROOT_CTX.collections,{collectionId:o,slug:r,locale:n}=e,i=t[o];if(!i)throw new Error(`collection not found: ${o}`);if(!i.url)return"";let s=window.__ROOT_CTX.rootConfig,a=s.base||"/",l="/[base]/[path]";n&&(l=s.i18n.urlFormat||"/[locale]/[base]/[path]");let c="",d=i?.url;if(d)if(r){let u=d.replace(/\[.*slug\]/,r).replaceAll("--","/").replace(/\/+/g,"/");u==="/index"&&(u="/"),c=u}else c=d;return t0e(l,{base:a,path:c,locale:n||"",slug:r})}function hA(e){let t=window.__ROOT_CTX.collections,{collectionId:o,slug:r,locale:n}=e,i=t[o];if(!i)throw new Error(`collection not found: ${o}`);let s=window.__ROOT_CTX.rootConfig,a=s.base||"/",l="/[base]/[path]";n&&(l=s.i18n.urlFormat||"/[locale]/[base]/[path]");let c="",d=i?.previewUrl||i?.url;if(d)if(r){let u=d.replace(/\[.*slug\]/,r).replaceAll("--","/").replace(/\/+/g,"/");u==="/index"&&(u="/"),c=u}else c=d;return t0e(l,{base:a,path:c,locale:n||"",slug:r})}function t0e(e,t){let o=e.replaceAll(/\[\[?(\.\.\.)?([\w\-_]*)\]?\]/g,(r,n,i)=>t[i]??r);return Emt(o,{trailingSlash:window.__ROOT_CTX.rootConfig.server.trailingSlash})}function Emt(e,t){return e=e.replace(/\/+/g,"/"),t?.trailingSlash===!1&&e!=="/"&&e.endsWith("/")&&(e=e.replace(/\/*$/g,"")),(e.endsWith("/index")||e.endsWith("/index/"))&&(e=e.slice(0,-6)),e.startsWith("/")||(e=`/${e}`),t?.trailingSlash&&!e.endsWith("/")&&(e=`${e}/`),e}var gA=x(()=>{"use strict"});var o0e=x(()=>{});function mA(e){let[t,o]=N(e.collectionId||""),r=G(null),[n,i]=N(""),s=window.__ROOT_CTX.collections[t],a=[];e.collectionId&&e.collectionDisabled?a.push({value:e.collectionId,label:e.collectionId}):Object.keys(window.__ROOT_CTX.collections).forEach(f=>{a.push({value:f,label:f})});let l="",c="";if(s?.url){if(n){let f=Td(n),h=s?.slugRegex;zp(f,h)?l=EI({collectionId:t,slug:f}):c=Yy(f,h)}else l=EI({collectionId:t,slug:"[slug]"});l.endsWith("/index")&&(l=l.replace(/\/index$/,"/"))}function d(f){o(f),e.onChange&&e.onChange({collectionId:f,slug:n})}function u(f){i(f),e.onChange&&e.onChange({collectionId:t,slug:f})}return p("div",{className:ze(e.className,"SlugInput"),children:[p("div",{className:"SlugInput__inputs",children:[p(Ao,{className:"SlugInput__collection",placeholder:"Collection",size:"xs",data:a,onChange:f=>d(f),value:t,disabled:!!e.collectionDisabled}),p("div",{className:"SlugInput__divider",children:"/"}),p(Ro,{className:"SlugInput__slug",name:"slug",ref:r,value:n,onChange:f=>{u(f.currentTarget.value)},placeholder:"slug",autoComplete:"off",size:"xs"})]}),l&&p(ht,{className:"SlugInput__urlHelp",size:"body-sm",children:l}),c&&p(ht,{className:"SlugInput__slugError",size:"body-sm",children:c})]})}var b6=x(()=>{"use strict";Ye();Ne();Hp();Kn();No();gA();o0e();X()});var r0e=x(()=>{});function vA(e){let t=Wt(),o=io();return{open:r=>{t.openContextModal(n0e,{...o,innerProps:{...e,...r}})}}}function bA(e){let{innerProps:t,context:o,id:r}=e,{route:n}=Nr(),[i,s]=N(""),[a,l]=N(""),[c,d]=N(""),[u,f]=N(""),[h,g]=N(!1),[m,v]=N(!1),[b,y]=N({}),C=t.fromDocId,E=C.split("/")[0],R=t.fromLabel||C;$(()=>{Gl({tags:[C]}).then(y)},[C]);function I(_,T){let k=Td(_),D=window.__ROOT_CTX.collections[T]?.slugRegex;return k?Yy(k,D):""}async function S(_){if(_.preventDefault(),v(!0),f(""),!E){f("Please select a collection."),v(!1);return}if(I(a,i)){v(!1);return}let k=Td(a),D=`${i}/${k}`;try{t.fields?await GS(D,{fields:t.fields,overwrite:h}):await Wbe(C,D,{overwrite:h});let A=Object.keys(b);if(A.length>0){let P=A.map(z=>({hash:z,tags:[D]}));await Dd(P,{mode:"union"})}o.closeModal(r),Re({title:"Copied!",message:`Succesfully copied ${R} to ${D}.`,autoClose:5e3}),t.onSuccess&&t.onSuccess(D)}catch(A){let P=String(A);f(P),P.includes("already exists")&&g(!0),v(!1);return}v(!1),n(`/cms/content/${i}/${k}`)}return p("div",{className:"CopyDocModal",children:p("form",{onSubmit:_=>S(_),children:[p("div",{className:"CopyDocModal__from",children:[p(ht,{className:"CopyDocModal__from__label",size:"body",weight:"bold",children:"From:"}),p(ht,{className:"CopyDocModal__from__value",size:"body-sm",children:p("code",{children:R})})]}),p("div",{className:"CopyDocModal__to",children:[p(ht,{className:"CopyDocModal__to__label",size:"body",weight:"bold",children:"To:"}),p(mA,{className:"CopyDocModal__slug",collectionId:E,onChange:_=>{s(_.collectionId),l(_.slug),d(I(_.slug,_.collectionId)),f(""),g(!1)}})]}),u&&p("div",{className:"CopyDocModal__error",children:u}),p("div",{className:"CopyDocModal__buttons",children:[p(oe,{variant:"outline",onClick:()=>o.closeModal(r),type:"button",size:"xs",color:"dark",children:"Cancel"}),p(oe,{variant:"filled",type:"submit",size:"xs",color:"dark",loading:m,disabled:!!u||!!c,children:h?"Overwrite?":"Submit"})]})]})})}var n0e,yA=x(()=>{"use strict";Ye();Tn();dr();Ne();nl();Hp();fn();pn();sl();b6();Kn();r0e();X();n0e="CopyDocModal";bA.id=n0e});var i0e=x(()=>{});function s0e(){let e=Wt(),t=io();return{open:o=>{e.openContextModal(y6,{...t,innerProps:o,size:"600px",overflow:"inside"})},close:()=>{e.closeModal(y6)}}}function xA(e){let{innerProps:t}=e,[o,r]=N(!0),[n,i]=N([]),s=t.selectedDataSourceIds||[];$(()=>{async function c(){let d=await uP();i(d),r(!1)}c()},[]);function a(c){t.onChange&&t.onChange(c,!0)}function l(c){t.onChange&&t.onChange(c,!1)}return p("div",{className:"DataSourceSelectModal",children:o?p("div",{className:"DataSourceSelectModal__loading",children:p(gt,{color:"gray",size:"xl"})}):n.length===0?p("div",{className:"DataSourceSelectModal__empty",children:"No data sources."}):p("div",{className:"DataSourceSelectModal__list",children:n.map(c=>p("div",{className:"DataSourceSelectModal__item",children:[p("div",{className:"DataSourceSelectModal__item__info",children:[p("div",{className:"DataSourceSelectModal__item__id",children:c.id}),p("div",{className:"DataSourceSelectModal__item__description",children:c.description||""})]}),p("div",{className:"DataSourceSelectModal__item__action",children:s.includes(c.id)?p(oe,{variant:"light",color:"blue",size:"xs",onClick:()=>l(c.id),children:"Unselect"}):p(oe,{variant:"filled",color:"blue",size:"xs",onClick:()=>a(c.id),children:"Select"})})]},c.id))})})}var y6,x6=x(()=>{"use strict";Ye();Tn();Ne();fn();Gp();i0e();X();y6="DataSourceSelectModal";xA.id=y6});var a0e=x(()=>{});function wx(){let e=Ve(C6);if(!e)throw new Error("useFirebase() should be called within a <FirebaseProvider>");return e}var C6,TI=x(()=>{"use strict";kr();Ne();C6=Ct(null)});function CA(e,t){let[o,r]=N([]),[n,i]=N(!0),a=wx().db,l=window.__ROOT_CTX.rootConfig.projectId||"default",c=async()=>{i(!0);let d=ol(a,"Projects",l,"Collections",e,"Drafts"),u=d,f=t.orderBy;if(f==="modifiedAt")u=cn(d,$s("sys.modifiedAt","desc"));else if(f==="newest")u=cn(d,$s("sys.createdAt","desc"));else if(f==="oldest")u=cn(d,$s("sys.createdAt"));else if(f==="slug")u=cn(d,$s(TS()));else if(f==="slugDesc")u=cn(d,$s(TS(),"desc"));else{let g=window.__ROOT_CTX.collections[e]?.sortOptions?.find(m=>m.id===f);g&&(u=g.direction==="desc"?cn(d,$s(g.field,"desc")):cn(d,$s(g.field)))}await mo(async()=>{let h=await rl(u),g=[];h.docs.forEach(m=>{let v=m.data(),b=m.id,y=`${e}/${b}`,C={...v,id:y,slug:b};g.push(C),VS(y,C)}),r(g)}),i(!1)};return $(()=>{i(!0),c()},[e,t.orderBy]),[n,c,o]}var w6=x(()=>{"use strict";kn();Ne();dm();ns();TI()});function l0e(e,t){return ee(()=>{if(!t.trim())return e;let o=t.toLowerCase();return e.filter(r=>{let[n,i]=r.id.split("/"),s=r.fields||{},a=window.__ROOT_CTX.collections[n],c=hn(s,a.preview?.title||"meta.title")||"";return r.id.toLowerCase().includes(o)||c.toLowerCase().includes(o)||i.toLowerCase().includes(o)})},[e,t])}var c0e=x(()=>{"use strict";Ne();Lr()});function Ys(e,t){let[o,r]=N(()=>{try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.error(i),t}}),n=fe(i=>{r(s=>{let a=typeof i=="function"?i(s):i;return window.localStorage.setItem(e,JSON.stringify(a)),a})},[e]);return[o,n]}var _x=x(()=>{"use strict";Ne();Ne()});async function kI(e){if(!window.__ROOT_CTX.collections[e])throw new Error(`collection not found: ${e}`);let o=await window.fetch("/cms/api/collection.get",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collectionId:e})});if(o.status!==200){let n=await o.text();throw new Error(n)}return(await o.json()).data}var _6=x(()=>{"use strict"});var RI,S6=x(()=>{"use strict";RI={CONNECTED:"connected",SCHEMA_CHANGED:"schemaChanged"}});function d0e(e){let o=new URLSearchParams(window.location.search).get("e");return o?o.split(",").includes(e):!1}var u0e=x(()=>{"use strict"});function g0e(e){let o=G(new I6).current,r=G(null),n=G(!1),i=G({attempt:0,timer:0}),s=G(""),a=()=>{r.current&&(r.current.close(),r.current=null)},l=fe(()=>{wA&&console.log("[sse] connecting..."),a();let d=new EventSource(Tmt);r.current=d,d.addEventListener(RI.CONNECTED,f=>{if(wA&&console.log("[sse] connected"),n.current=!1,i.current.attempt=0,f0e){let g=p0e(f.data)?.serverVersion||"";s.current?s.current!==g&&(console.log(`server version changed: ${s.current} -> ${g}`),console.log("reloading..."),window.location.reload()):s.current=g}});let u=f=>{if(!f||!f.type)return;let h=p0e(f.data);wA&&console.log("[sse] event:",f.type,h),o.emit(f.type,h,f)};Object.values(RI).forEach(f=>{d.addEventListener(f,u)}),d.addEventListener("error",()=>{wA&&console.log("[sse] disconnected"),d.readyState===EventSource.CLOSED&&!n.current&&(n.current=!0,(()=>{let h=++i.current.attempt,g=Math.min(3e4,Math.pow(2,h)*500),m=Math.random()*.3*g,v=g+m;window.clearTimeout(i.current.timer),i.current.timer=window.setTimeout(()=>{n.current=!1,l()},v)})())})},[o]);$(()=>{if(!f0e)return;l();let d=()=>{document.visibilityState==="visible"&&r.current?.readyState!==EventSource.OPEN&&l()};return document.addEventListener("visibilitychange",d),()=>{document.removeEventListener("visibilitychange",d),window.clearTimeout(i.current.timer),a()}},[l]);let c=ee(()=>({emitter:o}),[o]);return p(h0e.Provider,{value:c,children:e.children})}function p0e(e){try{return JSON.parse(e)}catch{return e}}function m0e(e,t){let o=Ve(h0e);if(!o)throw new Error("useSSE() must be used within an <SSEProvider>");let r=G(t);$(()=>{r.current=t},[t]),$(()=>o.emitter.on(e,(n,i)=>r.current(n,i)),[o,e])}var Tmt,wA,f0e,I6,h0e,E6=x(()=>{"use strict";kr();Ne();S6();u0e();S6();X();Tmt="/cms/api/sse.connect",wA=d0e("EnableVerboseLogging"),f0e=window.location.hostname==="localhost",I6=class{constructor(){this.map=new Map}on(t,o){return this.map.has(t)||this.map.set(t,new Set),this.map.get(t).add(o),()=>{this.map.get(t)?.delete(o)}}emit(t,o,r){this.map.get(t)?.forEach(n=>n(o,r)),this.map.get("*")?.forEach(n=>n({type:t,data:o},r))}},h0e=Ct(null)});function _A(e){let[t,o]=N(!0),[r,n]=N(null),i=fe(async()=>{try{let s=await kI(e);n(s)}catch(s){console.error(s),Re({title:`Failed to load collection: ${e}`,message:String(s),color:"red",autoClose:!1})}o(!1)},[e]);return $(()=>{i()},[e]),m0e(RI.SCHEMA_CHANGED,async s=>{await i();let a=s.file?`Applied updates from changes to ${s.file}.`:"Applied updates from changes to a .schema.ts file.";Re({title:"Updated schema!",message:a})}),{loading:t,schema:r}}var T6=x(()=>{"use strict";dr();Ne();_6();E6()});function v0e(e){let t={_array:[]};return e.forEach(o=>{let r=kmt();t._array.push(r),t[r]=o}),t}function kmt(){let e=[],t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=t.length;for(let r=0;r<6;r++)e.push(t.charAt(Math.floor(Math.random()*o)));return e.join("")}var b0e=x(()=>{"use strict"});function eh(e){let t={};return e.fields.forEach(o=>{o.id&&(o.type==="array"&&o.default&&Array.isArray(o.default)?t[o.id]=v0e(o.default):o.default?t[o.id]=o.default:o.type==="object"&&(t[o.id]=eh(o)))}),t}var SA=x(()=>{"use strict";b0e()});var y0e=x(()=>{});function IA(e){let{route:t}=Nr(),[o,r]=N(""),[n,i]=N(!1),[s,a]=N(""),[l,c]=N(""),d=ko(),u=e.collection,f=window.__ROOT_CTX.collections[u];if(!f)throw new Error(`collection not found: ${u}`);let h=_A(u);function g(b){let y=Td(b);return y?Yy(y,f.slugRegex):""}function m(){e.onClose&&e.onClose()}async function v(b){if(b.preventDefault(),i(!0),a(""),g(o)){i(!1);return}let C=Td(o),E=`${u}/${C}`;try{let R={};!h.loading&&h.schema&&(R=await eh(h.schema)),await GS(E,{fields:R})}catch(R){c(String(R)),i(!1);return}i(!1),e.skipNavigation?m():t(`/cms/content/${e.collection}/${C}`)}return p(_i,{className:"NewDocModal",opened:e.opened||!1,onClose:()=>m(),title:"New",size:"500px",overlayColor:d.colorScheme==="dark"?d.colors.dark[9]:d.colors.gray[2],children:[p("div",{className:"NewDocModal__body",children:"Enter a slug for the new doc. The slug is the ID of the page and is what's used in the URL. Use only lowercase letters, numbers, and dashes."}),p("form",{onSubmit:b=>v(b),children:[p(mA,{className:"NewDocModal__slug",collectionId:u,onChange:b=>{r(b.slug),a(g(b.slug)),c("")}}),l&&p("div",{className:"NewDocModal__slugError",children:l}),p("div",{className:"NewDocModal__buttons",children:[p(oe,{variant:"outline",onClick:()=>m(),type:"button",size:"xs",color:"dark",children:"Cancel"}),p(oe,{variant:"filled",type:"submit",size:"xs",color:"dark",loading:h.loading||n,disabled:!!s||!!l,children:"Submit"})]})]})]})}var k6=x(()=>{"use strict";Ye();Ne();nl();Hp();T6();pn();SA();b6();y0e();X()});function Sx(){let e=Wt(),t=io();return{open:o=>{e.openContextModal(R6,{...t,innerProps:o,size:"700px",overflow:"inside"})},close:()=>{e.closeModal(R6)}}}function th(e){let{innerProps:t}=e,o=Object.keys(window.__ROOT_CTX.collections);t.collections?.length&&(o=o.filter(f=>t.collections?.includes(f)));let r=[{value:"",label:"Select"}];o.forEach(f=>{r.push({value:f,label:f})});let[n,i]=Ys("DocPickerModal.lastSelectedCollection",""),s=()=>t.initialCollection?t.initialCollection:n&&o.includes(n)?n:o.length===1?o[0]:"",[a,l]=N(s()),c=f=>{l(f),i(f)};function d(f){t.multiSelect&&t.onChangeMulti?t.onChangeMulti(f.id,!0):t.onChange&&t.onChange(f.id)}function u(f){t.multiSelect&&t.onChangeMulti&&t.onChangeMulti(f.id,!1)}return p("div",{className:"DocPickerModal",children:[o.length===0&&p("div",{className:"DocPickerModal__noCollections",children:"No collections matching schema field definition."}),o.length>0&&p(th.DocsList,{collection:a,onDocSelected:d,onDocUnselected:u,onCollectionChange:c,multiSelect:t.multiSelect,selectedDocIds:t.selectedDocIds,options:{enableSearch:t.enableSearch??!0,enableSort:t.enableSort??!0,enableCreate:t.enableCreate??!0,enableStatusBadges:t.enableStatusBadges??!0,showCollectionSelect:o.length>1,collectionSelectValue:a,collectionSelectOptions:r}})]})}var R6,DI=x(()=>{"use strict";a0e();Ye();Tn();qt();Ne();w6();c0e();_x();fn();Lr();$S();_P();k6();X();R6="DocPickerModal";th.DocsList=e=>{let[t,o]=N(""),[r,n]=Ys(`root::DocPickerModal:${e.collection}:sortBy`,"modifiedAt"),[i,s]=N(!1),[a,l,c]=CA(e.collection||"",{orderBy:r}),d=l0e(c,t),u=[{value:"modifiedAt",label:"Last Modified"},{value:"slug",label:"A-Z"},{value:"slugDesc",label:"Z-A"},{value:"newest",label:"Newest"},{value:"oldest",label:"Oldest"}],f=e.selectedDocIds||[],h=e.options||{};return p("div",{className:"DocPickerModal__DocsList",children:[p("div",{className:"DocPickerModal__DocsList__stickyHeader",children:[h.showCollectionSelect&&p("div",{className:"DocPickerModal__collection__select",children:[p("div",{className:"DocPickerModal__collection__select__label",children:"Content Type:"}),p(Ao,{data:h.collectionSelectOptions||[],value:h.collectionSelectValue,placeholder:"Select",onChange:g=>{e.onCollectionChange?.(g||"")},size:"xs",radius:0,searchable:!0,autoFocus:!0,dropdownComponent:"div"}),h.collectionSelectValue&&p(oe,{variant:"outline",color:"dark",size:"xs",onClick:()=>s(!0),children:"New"})]}),h.enableSearch&&h.collectionSelectValue&&p("div",{className:"DocPickerModal__DocsList__controls",children:[p(Ro,{placeholder:"Search documents...",value:t,onChange:g=>o(g.target.value),icon:p(vm,{size:16}),size:"xs",className:"DocPickerModal__DocsList__controls__search"}),h.enableSort&&p(Ao,{data:u,value:r,onChange:g=>n(g||"modifiedAt"),size:"xs",className:"DocPickerModal__DocsList__controls__sort"})]}),!a&&c.length>0&&p("div",{className:"DocPickerModal__DocsList__count",children:["Showing ",d.length," of ",c.length," documents"]})]}),p("div",{className:"DocPickerModal__DocsList__docsContainer",children:e.collection?a?p("div",{className:"DocPickerModal__DocsList__loading",children:p(gt,{color:"gray",size:"xl"})}):d.length===0?p("div",{className:"DocPickerModal__DocsList__empty",children:c.length===0?"Collection is empty.":"No documents match your search."}):p("div",{className:"DocPickerModal__DocsList__docs",children:d.map(g=>p(th.DocCard,{doc:g,onDocSelected:e.onDocSelected,onDocUnselected:e.onDocUnselected,multiSelect:e.multiSelect,selected:f.includes(g.id),enableStatusBadges:h.enableStatusBadges},g.id))}):p("div",{className:"DocPickerModal__DocsList__empty",children:"Select a content type to view documents"})}),h.collectionSelectValue&&p(IA,{collection:h.collectionSelectValue,opened:i,skipNavigation:!0,onClose:()=>{s(!1),l()}})]})};th.DocCard=e=>{let[t,o]=N(!!e.selected),r=e.doc,[n,i]=r.id.split("/"),s=r.fields||{},a=window.__ROOT_CTX.collections[n],l=`/cms/content/${n}/${i}`,c=hn(s,a.preview?.title||"meta.title"),d=hn(s,a.preview?.image||"meta.image")||a.preview?.defaultImage;return p("div",{className:"DocPickerModal__DocCard",children:[p("div",{className:"DocPickerModal__DocCard__image",onClick:()=>window.open(l,"_blank"),children:p(ox,{file:d,width:120,height:90,withPlaceholder:!d?.src})}),p("div",{className:"DocPickerModal__DocCard__content",children:[p("div",{className:"DocPickerModal__DocCard__content__header",children:p("div",{className:"DocPickerModal__DocCard__content__header__docId",onClick:()=>window.open(l,"_blank"),children:r.id})}),p("div",{className:"DocPickerModal__DocCard__content__title",children:p("div",{className:"DocPickerModal__DocCard__content__link",onClick:()=>window.open(l,"_blank"),children:c||"[UNTITLED]"})}),e.enableStatusBadges&&p("div",{className:"DocPickerModal__DocCard__content__badges",children:p(Wp,{doc:r})})]}),p("div",{className:"DocPickerModal__DocCard__controls",children:p("div",{className:"DocPickerModal__DocCard__controls__buttons",children:e.multiSelect?t?p(oe,{variant:"light",color:"blue",size:"xs",onClick:()=>{o(!1),e.onDocUnselected(e.doc)},children:"Unselect"}):p(oe,{variant:"filled",color:"blue",size:"xs",onClick:()=>{o(!0),e.onDocSelected(e.doc)},children:"Select"}):p(oe,{color:"blue",size:"xs",onClick:()=>e.onDocSelected(e.doc),children:"Select"})})})]})};th.id=R6});var x0e=x(()=>{});function EA(){let e=Wt(),t=io();return{open:o=>{e.openContextModal(D6,{...t,title:o.title||"Edit JSON",innerProps:o,size:"680px",centered:!0})},close:()=>{e.closeModal(D6)}}}function TA(e){let{innerProps:t,context:o,id:r}=e,n=JSON.stringify(t.data||{},null,2),[i,s]=N(n),[a,l]=N(!0),[c,d]=N(!1),[u,f]=N(!1);function h(v){s(v),d(!1);try{JSON.parse(v),l(!0)}catch{l(!1)}f(v!==n)}function g(){navigator.clipboard.writeText(i).then(()=>d(!0))}function m(){let v=JSON.parse(i),b=Zy(v);t.onSave&&t.onSave(b)}return p("div",{className:"EditJsonModal",children:[p(vp,{value:i,onChange:h,formatOnBlur:!0,autosize:!0,minRows:4,maxRows:25}),p("div",{className:"EditJsonModal__buttons",children:[p(oe,{variant:"default",size:"xs",color:"dark",type:"button",onClick:()=>o.closeModal(r),children:"Cancel"}),p(oe,{leftIcon:p(YS,{size:16}),variant:"filled",size:"xs",color:"dark",disabled:!a,type:"button",onClick:g,children:c?"Copied!":"Copy"}),p(oe,{variant:"default",size:"xs",type:"button",leftIcon:p(Zu,{size:16}),disabled:!u,onClick:()=>{s(n),l(!0),f(!1)},children:"Reset"}),p(oe,{leftIcon:p(QS,{size:16}),variant:"filled",size:"xs",color:"blue",disabled:!a||!u,onClick:m,children:"Save"})]})]})}var D6,kA=x(()=>{"use strict";Ye();Tn();qt();Ne();fn();x0e();pn();X();D6="EditJsonModal";TA.id=D6});var C0e=x(()=>{});var w0e=x(()=>{});function S0e(e){let{docId:t,deepKey:o,translatable:r}=e,[n,i]=N(!0),[s,a]=N([]),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});return $(()=>{async function c(){i(!0);let[d,u]=await Promise.all([mP(t),fm(t,"draft")]),f=[];if(u){let g=hn(u,o);f.push({value:_0e(g),modifiedBy:u.sys?.modifiedBy||"Unknown",modifiedAt:u.sys?.modifiedAt?.toDate?.()||new Date,versionId:"draft"})}for(let g of d){let m=hn(g,o);f.push({value:_0e(m),modifiedBy:g.sys?.modifiedBy||"Unknown",modifiedAt:g.sys?.modifiedAt?.toDate?.()||new Date,versionId:g._versionId})}let h=[];for(let g of f){let m=h[h.length-1];(!m||m.value!==g.value)&&h.push(g)}a(h),i(!1)}c()},[t,o]),n?p("div",{className:"FieldHistory__loading",children:p(gt,{size:"sm"})}):s.length===0?p("div",{className:"FieldHistory__empty",children:"No history available."}):p("div",{className:"FieldHistory",children:s.map((c,d)=>p("div",{className:"FieldHistory__entry",children:[p("div",{className:"FieldHistory__entry__header",children:[p("span",{className:"FieldHistory__entry__author",children:c.modifiedBy}),p("span",{className:"FieldHistory__entry__date",children:l.format(c.modifiedAt)}),d===0&&p("span",{className:"FieldHistory__entry__badge",children:"Current"}),r&&c.value&&p("span",{className:"FieldHistory__entry__translationsLink",children:p(Rmt,{value:c.value})})]}),p("div",{className:"FieldHistory__entry__value",children:c.value||p("span",{className:"FieldHistory__entry__empty",children:"(empty)"})})]},c.versionId))})}function Rmt(e){let[t,o]=N("");return $(()=>{xs(e.value).then(r=>{o(`/cms/translations/${r}`)})},[e.value]),t?p(Ee,{label:"Open in Translations Editor",withArrow:!0,position:"right",children:p(Ke,{component:"a",href:t,target:"_blank",variant:"transparent",size:"sm",children:p(Od,{size:16})})}):null}function _0e(e){return e==null?"":typeof e=="string"?e:JSON.stringify(e)}var I0e=x(()=>{"use strict";Ye();qt();Ne();pn();sl();Lr();w0e();X()});var E0e=x(()=>{});function Et(e){let{className:t,as:o,size:r,weight:n,color:i,children:s,...a}=e;return p(o||"h2",{...a,className:ze(t,"heading",r&&`size:${r}`,n&&`weight:${n}`,i&&`color:${i}`),children:s})}var Dn=x(()=>{"use strict";No();E0e();X()});function k0e(){let e=Wt(),t=io();return{open:o=>{e.openContextModal(P6,{...t,innerProps:o,size:"900px",title:"Edit translations",overflow:"inside",className:"EditTranslationsModalWrap"})},close:()=>{e.closeModal(P6)}}}function Ix(e){let{innerProps:t,context:o,id:r}=e,n=t.strings||[],s=(window.__ROOT_CTX.rootConfig.i18n||{}).locales||["en"],[a,l]=N({}),[c,d]=N([]),[u,f]=N(!1),[h,g]=N(!1),[m,v]=N(!0),[b,y]=N(!1),[C,E]=N(""),[R,I]=N(!1),[S,_]=N("translations"),T=t.draft||null;$(()=>{if(t.field?.deepKey&&T?.controller){let z=T0e(t.field.deepKey),L=T.controller.getValue(z)||{};y(L.disableTranslations||!1),E(L.description||"")}},[t.field?.deepKey,T?.controller]),$(()=>{Gl({tags:[t.docId]}).then(z=>{let L={};Object.values(z).forEach(H=>{L[H.source]=H}),l(L),v(!1)})},[t.docId]);async function k(){g(!0),await mo(async()=>{let z=`edit-translations-${t.docId}`;if(Re({id:z,loading:!0,title:"Saving translations",message:`Updating for ${t.docId}...`,autoClose:!1,disallowClose:!0}),t.field?.deepKey&&T?.controller){let L=T0e(t.field.deepKey),H=T.controller.getValue(L)||{};b?H.disableTranslations=!0:delete H.disableTranslations,C?H.description=C:delete H.description,Object.keys(H).length>0?await T.controller.updateKey(L,H):await T.controller.removeKey(L),await T.controller.flush()}if(!b&&c.length>0){let L=[];c.forEach(H=>{let j=a[H];L.push(j)}),await Up(t.docId,L)}ho({id:z,title:"Saved translations",message:`Updated translations for ${t.docId}!`,autoClose:!1})}),g(!1)}function D(z){l(L=>{let H={...L};return H[z.source]=z,H}),d(L=>{let H=new Set(L);return H.add(z.source),Array.from(H)}),f(!0)}async function A(){if(n.length!==0){I(!0);try{await mo(async()=>{for(let z of n){let L=a[z]||{source:z},H={};s.forEach(B=>{L[B]&&(H[B]=L[B])});let j=s.filter(B=>!L[B]);if(j.length===0)continue;let U=await window.fetch("/cms/api/ai.translate",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sourceText:z,targetLocales:j,description:C||void 0,existingTranslations:H})});if(U.status!==200){let B=await U.text();throw new Error(`Translation failed: ${B}`)}let q=await U.json();if(q.success&&q.translations){let B={...L};Object.entries(q.translations).forEach(([ne,Q])=>{B[ne]=Q}),D(B)}}Re({message:"Finished generating AI translations",color:"green"})})}finally{I(!1)}}}function P(){if(!!!(window.__ROOT_CTX?.experiments||{}).ai)return!1;for(let H of n){let j=a[H]||{};for(let U of s)if(!j[U])return!0}return!1}return p("div",{className:"EditTranslationsModal",children:[m?p(gt,{}):p(Oe,{children:[t.field?.deepKey&&p("div",{className:"EditTranslationsModal__tabs",children:[p("button",{type:"button",className:ze("EditTranslationsModal__tabs__tab",S==="translations"&&"active"),onClick:()=>_("translations"),children:"Translations"}),p("button",{type:"button",className:ze("EditTranslationsModal__tabs__tab",S==="history"&&"active"),onClick:()=>_("history"),children:"History"})]}),S==="history"&&t.field?.deepKey?p(S0e,{docId:t.docId,deepKey:t.field.deepKey,translatable:!0}):p(Oe,{children:[p("div",{className:"EditTranslationsModal__controls",children:[p("div",{className:"EditTranslationsModal__controls__doNotTranslate",children:[p(zn,{label:"Do not translate",checked:b,onChange:z=>{y(z.currentTarget.checked),f(!0)},size:"sm"}),p(Ee,{label:"Prevent the string from being included for translation",withArrow:!0,position:"right",children:p(ax,{size:14,style:{marginLeft:"6px"}})})]}),p("div",{className:"EditTranslationsModal__controls__description",children:[p("div",{className:"EditTranslationsModal__controls__description__label",children:[p("span",{children:"Description"}),p(Ee,{label:"Translator notes may be included when the string is extracted and sent for translation",withArrow:!0,position:"right",children:p(ax,{size:14,style:{marginLeft:"6px"}})})]}),p(yo,{size:"sm",autosize:!0,minRows:1,maxRows:6,value:C,placeholder:"Add context or notes for translators...",onChange:z=>{E(z.currentTarget.value),f(!0)}})]})]}),p("table",{className:"EditTranslationsModal__table",children:[p("thead",{style:{display:b?"none":"table-header-group"},children:p("tr",{children:[p("th",{children:p(Et,{size:"h4",weight:"semi-bold",children:"SOURCE"})}),p("th",{children:p("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[p(Et,{size:"h4",weight:"semi-bold",children:"TRANSLATIONS"}),P()&&p(Ee,{label:"Generate quick translations using AI",withArrow:!0,position:"left",children:p(Ke,{variant:"outline",onClick:A,loading:R,disabled:R,sx:{height:30,width:30,borderColor:"#ced4da"},children:R?p(oI,{size:16}):p(Cs,{size:16,fill:"currentColor",stroke:1.5})})})]})})]})}),p("tbody",{children:n.map(z=>p("tr",{style:{display:b?"none":"table-row"},children:[p("td",{children:p("div",{className:"EditTranslationsModal__table__source",children:z})}),p("td",{children:p(Ix.StringsEditor,{source:z,locales:s,translations:a[z]||{},onChange:D})})]}))})]})]})]}),p("div",{className:"EditTranslationsModal__footer",children:[p("div",{className:"EditTranslationsModal__footer__left",children:[p(oe,{component:"a",href:`/cms/translations/${t.docId}`,target:"_blank",variant:"default",size:"xs",rightIcon:p(Dc,{size:14}),children:"Open Translations Editor"}),t.l10nSheet&&p("div",{className:"EditTranslationsModal__footer__gsheet",children:[p("strong",{children:"NOTE:"})," Translations for this doc are managed in"," ",p("a",{href:Hl(t.l10nSheet),target:"_blank",rel:"noopener noreferrer",children:"Google Sheets"})]})]}),p("div",{className:"EditTranslationsModal__footer__buttons",children:[p(oe,{variant:"default",size:"xs",color:"dark",type:"button",onClick:()=>o.closeModal(r),children:"Cancel"}),p(oe,{variant:"filled",size:"xs",color:"dark",onClick:()=>k(),disabled:!u,loading:h,children:"Save"})]})]})]})}function T0e(e){let t=e.split("."),o=t.pop();return[...t,`@${o}`].join(".")}var P6,A6=x(()=>{"use strict";C0e();Ye();Tn();dr();qt();Ne();fn();No();pn();Qu();sl();ns();I0e();Dn();X();P6="EditTranslationsModal";Ix.StringsEditor=e=>{let t=e.locales,[o,r]=N(e.translations||{}),[n,i]=N(!1);$(()=>{r(e.translations||{})},[e.translations]);function s(a,l){i(!0),r(c=>{let d={...c,source:e.source};return d[a]=l,d})}return $(()=>{n&&e.onChange(o)},[n,o]),p("div",{className:"EditTranslationsModal__StringsEditor",children:t.map(a=>p("div",{className:"EditTranslationsModal__StringsEditor__row",children:[p("div",{className:"EditTranslationsModal__StringsEditor__row__locale",children:a}),p("div",{className:ze("EditTranslationsModal__StringsEditor__row__translation",o[a]?"hasValue":"empty"),children:p(yo,{size:"xs",radius:0,autosize:!0,minRows:1,maxRows:10,value:o[a],onChange:l=>{s(a,l.currentTarget.value)}})})]}))})};Ix.id=P6});function Bd(){let e=window.__ROOT_CTX.rootConfig.projectId,t=!!(window.__ROOT_CTX.gapi?.apiKey&&window.__ROOT_CTX.gapi?.clientId),[o,r]=N(t),[n,i]=N(0),[s,a]=k2({key:`root-cms::${e}::gapi-user-consent`,defaultValue:{}});async function l(){await Promise.all([Omt(),Mmt()]),r(!1)}$(()=>{t&&l()},[]);function c(f){return new Promise(h=>{let g=window.__ROOT_CTX.gapi.clientId,m=Array.from(new Set([...Dmt,...f?.scopes||[]])),v=google.accounts.oauth2.initTokenClient({client_id:g,scope:m.join(" "),callback:async b=>{let y=O6()+parseInt(b.expires_in);i(y),a({at:O6(),clientId:g,scopes:m}),h()}});s&&Amt(s,m)?(console.log("requesting token without prompt"),v.requestAccessToken({prompt:""})):(console.log("requesting token with prompt"),v.requestAccessToken({prompt:"consent"}))})}function d(){return O6()<n}function u(f){return s?.scopes?.includes(f)||!1}return{enabled:t,loading:o,isLoggedIn:d,login:c,hasScope:u}}function Amt(e,t){if(!e||!e.at)return!1;let o=window.__ROOT_CTX.gapi?.clientId;if(e.clientId!==o)return!1;let r=e.scopes||[];return t.every(n=>r.includes(n))}function O6(){return Math.floor(new Date().getTime()/1e3)}async function Omt(){return M6||(M6=new Promise((e,t)=>{let o=document.createElement("script");o.src="https://apis.google.com/js/api.js",o.onload=()=>{gapi.load("client",async()=>{try{await gapi.client.init({}),await Promise.all(Pmt.map(r=>gapi.client.load(r))),console.log("gapi loaded"),e()}catch(r){console.error("Error initializing gapi:",r),t(r)}})},o.onerror=()=>{console.error("gapi script failed to load"),t(new Error("gapi script failed to load"))},document.head.appendChild(o)})),M6}async function Mmt(){return N6||(N6=new Promise((e,t)=>{let o=document.createElement("script");o.src="https://accounts.google.com/gsi/client",o.onload=()=>{e()},o.onerror=()=>{console.error("gis script failed to load"),t(new Error("gis script failed to load"))},document.head.appendChild(o)})),N6}var Dmt,Pmt,M6,N6,Ex=x(()=>{"use strict";po();Ne();Dmt=["https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/spreadsheets"],Pmt=["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest","https://sheets.googleapis.com/$discovery/rest?version=v4"];M6=null;N6=null});function P0e(e){let{db:t,user:o}=wx(),r=window.__ROOT_CTX.rootConfig.projectId,[n,i]=N({});$(()=>{let a=at(t,"Projects",r),l=Fp(a,c=>{if(c.exists()){let d=c.data()||{};i(d.settings||{})}else i({})},c=>{console.error("Failed to subscribe to site settings:",c)});return()=>l()},[t,r,o.uid]);let s=fe(async(a,l)=>{let c=at(t,"Projects",r);try{await _r(c,new ts("settings",a),l)}catch(d){console.error("Failed to set setting",a,d)}},[t,r,o.uid]);return p(D0e.Provider,{value:{settings:n,setSettings:s},children:e.children})}function RA(){let e=Ve(D0e);if(!e)throw new Error("useSiteSettings must be used within a <SiteSettingsProvider>");return e}var R0e,D0e,DA=x(()=>{"use strict";Ye();qt();kn();kr();Ne();Qu();TI();X();R0e=[{name:"Google Drive Folder",key:"googleDriveFolder",placeholder:"https://drive.google.com/drive/folders/...",description:`Where Google Sheets created by Root CMS's localization process are stored. If unspecified, they will be created in your "My Drive".`,ui:e=>p(oe,{disabled:!e,variant:"outline",size:"compact-sm",color:"dark",rightIcon:p(Dc,{size:16}),onClick:()=>{e&&window.open(e,wbe(e))},children:"Open"})}],D0e=Ct(null)});var A0e=x(()=>{});function M0e(){let e=Wt(),t=io();return{open:o=>{e.openContextModal(O0e,{...t,title:"Export to Google Sheet",innerProps:o,size:"650px"})}}}function Tx(e){let{innerProps:t,context:o,id:r}=e,[n,i]=N(!1),[s,a]=N("new-sheet"),[l,c]=N(""),[d,u]=N(!1),f=Bd(),h=RA(),g=G(),m=M3(h.settings.googleDriveFolder),v=[{value:"new-sheet",label:"Create Google Sheet",help:"Creates a new Google Sheet and exports strings to the sheet."},{value:"add-tab",label:"Add tab in Google Sheet",help:"Adds a new tab in an existing Google Sheet and exports strings to the sheet."},{value:"link-sheet",label:"Link Google Sheet",help:"Links an existing Google Sheet without exporting strings."}],b=!1;(s==="add-tab"||s==="link-sheet")&&(b=!0,l&&Vp(l)?.spreadsheetId&&(b=!1));async function y(S,_){let T=_?.isNew||!1,{headers:k,rows:D}=t.csvData;T?(await S.replaceSheet(k,D),await S.applyL10nTheme()):await S.updateValuesMap(D,{keyedBy:"source",preserveColumns:t.locales})}async function C(){f.isLoggedIn()||await f.login();let S=window.__ROOT_CTX.rootConfig,_=S.projectName||S.projectId||"Root CMS",T,k,D="create-google-sheet";try{if(Re({id:D,loading:!0,title:"Creating Google Sheet...",message:"Creating Google Sheet for localization.",autoClose:!1,disallowClose:!0}),T=await Rd.create({title:`${_} Localization`,parent:m,share:g.current?.checked}),k=await T.getSheet(0),!k)throw new Error("could not find sheet gid=0");k.setTitle(t.docId)}catch(A){console.error(A);let P=A;typeof A=="object"&&A.body&&(P=String(A.body)),ho({id:D,title:"Failed to create Google Sheet",message:String(P),color:"red",autoClose:!1});return}try{ho({id:D,loading:!0,title:"Created Google Sheet!",message:`Linking sheet to ${t.docId}...`,autoClose:!1,disallowClose:!0});let A={spreadsheetId:T.spreadsheetId,gid:0};await vP(t.docId,A)}catch(A){console.error(A),ho({id:D,title:"Failed to link Google Sheet",message:String(A),color:"red",autoClose:!1});return}try{ho({id:D,loading:!0,title:"Linked Google Sheet!",message:"Exporting strings to sheet...",autoClose:!1,disallowClose:!0}),await y(k,{isNew:!0})}catch(A){console.error(A);let P=A;typeof A=="object"&&A.body&&(P=String(A.body)),ho({id:D,title:"Failed to export strings to Google Sheet",message:P,color:"red",autoClose:!1});return}c(k.getUrl()),u(!0),ho({id:D,title:"Done! Exported strings to Google Sheet.",message:T.getUrl(),autoClose:!1})}async function E(){f.isLoggedIn()||await f.login();let S=Vp(l);if(!S?.spreadsheetId)throw new Error("failed to parse spreadsheet id");let _=new Rd(S.spreadsheetId),T,k="add-tab-google-sheet";try{Re({id:k,loading:!0,title:"Creating tab in Google Sheet...",message:"Adding tab in existing Google Sheet",autoClose:!1,disallowClose:!0}),T=await _.createSheet({title:t.docId})}catch(D){console.error(D);let A=D;typeof D=="object"&&D.body&&(A=String(D.body)),ho({id:k,title:"Failed to create Google Sheet",message:String(A),color:"red",autoClose:!1});return}try{ho({id:k,loading:!0,title:"Created Google Sheet!",message:`Linking sheet to ${t.docId}...`,autoClose:!1,disallowClose:!0});let D={spreadsheetId:_.spreadsheetId,gid:T.gid};await vP(t.docId,D)}catch(D){console.error(D),ho({id:k,title:"Failed to link Google Sheet",message:String(D),color:"red",autoClose:!1});return}try{ho({id:k,loading:!0,title:"Linked Google Sheet!",message:"Exporting strings to sheet...",autoClose:!1,disallowClose:!0}),await y(T,{isNew:!0})}catch(D){console.error(D);let A=D;typeof D=="object"&&D.body&&(A=String(D.body)),ho({id:k,title:"Failed to export strings to Google Sheet",message:A,color:"red",autoClose:!1});return}u(!0),ho({id:k,title:"Done! Exported strings to Google Sheet.",message:T.getUrl(),autoClose:!1})}async function R(){let S="link-google-sheet",_=Vp(l);if(!_?.spreadsheetId)throw new Error("failed to parse spreadsheet id");try{Re({id:S,loading:!0,title:"Link Google Sheet",message:`Linking sheet to ${t.docId}...`,autoClose:!1,disallowClose:!0}),await vP(t.docId,_)}catch(T){console.error(T),ho({id:S,title:"Failed to link Google Sheet",message:String(T),color:"red",autoClose:!1});return}u(!0),ho({id:S,title:`Done! Linked ${t.docId} to Google Sheet.`,message:Hl(_),autoClose:!1})}async function I(){console.log(s),i(!0),s==="new-sheet"?await mo(C):s==="add-tab"?await mo(E):s==="link-sheet"&&await mo(R),i(!1)}return p("div",{className:"ExportSheetModal",children:p("div",{className:"ExportSheetModal__content",children:[p("div",{className:"ExportSheetModal__content__body",children:"Export strings to Google Sheet or link an existing Google Sheet for managing translations."}),p("form",{className:"ExportSheetModal__form",children:[p("div",{className:"ExportSheetModal__form__section",children:[p("div",{className:"ExportSheetModal__form__description",children:"Export options:"}),p(Ao,{disabled:d||n,itemComponent:Tx.SelectItem,data:v,onChange:S=>{a(S),S==="new-sheet"&&c("")},value:s})]}),p("div",{className:"ExportSheetModal__form__section",children:[p("div",{className:"ExportSheetModal__form__description",children:"Google Sheet URL:"}),s==="new-sheet"?p(Ro,{disabled:!0,placeholder:h.settings.googleDriveFolder?"A new Google Sheet will be created in the project's Google Drive folder.":'A new Google Sheet will be created in your "My Drive" folder.'}):p(Ro,{placeholder:"https://docs.google.com/spreadsheets/d/...",value:l,disabled:d||n,onChange:S=>c(S.currentTarget.value)})]}),s==="new-sheet"&&p("div",{className:"ExportSheetModal__form__section",children:p(Ee,{label:"Whether to share the Google Sheet with Admins and Editors upon creation. If your site has a Google Drive folder configured, the sheet will be created within it and inherit its permissions.",wrapLines:!0,width:320,withArrow:!0,position:"bottom",children:p(zn,{disabled:d||n,ref:g,name:"share",value:"true",label:"Share Google Sheet with collaborators",checked:!m})})}),p("div",{className:"ExportSheetModal__form__buttons",children:d?p(Oe,{children:[p(oe,{component:"a",target:"_blank",rel:"noopener noreferrer",href:l,variant:"default",size:"xs",color:"dark",rightIcon:p(Dc,{size:16}),children:"Open Google Sheet"}),p(oe,{variant:"filled",onClick:()=>o.closeModal(r),type:"button",size:"xs",color:"primary",children:"Done"})]}):p(Oe,{children:[p(oe,{variant:"outline",onClick:()=>o.closeModal(r),type:"button",size:"xs",color:"dark",children:"Cancel"}),p(oe,{variant:"filled",size:"xs",color:"primary",loading:n,disabled:b,onClick:()=>I(),children:s==="link-sheet"?"Link Google Sheet":"Export to Google Sheet"})]})})]})]})})}var O0e,F6=x(()=>{"use strict";Ye();Tn();dr();qt();Tl();Ne();Ex();fn();DA();pn();Qu();ns();Kn();A0e();X();O0e="ExportSheetModal";Tx.SelectItem=le(e=>{let{label:t,help:o,...r}=e;return p("div",{className:"ExportSheetModal__SelectItem",...r,children:[p(ht,{className:"ExportSheetModal__SelectItem__label",size:"body",children:t}),p(ht,{className:"ExportSheetModal__SelectItem__help",size:"body-sm",children:o})]})});Tx.id=O0e});async function PA(e){let t=window.firebase.db,o=window.__ROOT_CTX.rootConfig.projectId,[r,n]=e.split("/",2),i=await kI(r),s=at(t,"Projects",o,"Collections",r,"Drafts",n),l=(await Yr(s)).data()||{},c=new Set;return L6(c,i.fields,l.fields||{},i.types||{}),Array.from(c)}async function AA(e){let t=window.firebase.db,o=window.__ROOT_CTX.rootConfig.projectId,[r,n]=e.split("/",2),i=await kI(r),s=at(t,"Projects",o,"Collections",r,"Drafts",n),l=(await Yr(s)).data()||{},c=new Map;return B6(c,i.fields,l.fields||{},i.types||{}),c}function L6(e,t,o,r={}){t.forEach(n=>{if(!n.id)return;let i=o[n.id],s=`@${n.id}`;o[s]?.disableTranslations||PI(e,n,i,r)})}function B6(e,t,o,r={}){t.forEach(n=>{if(!n.id)return;let i=o[n.id],s=`@${n.id}`,a=o[s];if(a?.disableTranslations)return;let l=a?.description;N0e(e,n,i,r,l)})}function PI(e,t,o,r={}){if(!o)return;function n(i){let s=Tc(i);s&&e.add(s)}if(t.type==="object")L6(e,t.fields||[],o,r);else if(t.type==="array"){let i=o._array||[];for(let s of i)PI(e,t.of,o[s],r)}else if(t.type==="string"||t.type==="select")t.translate&&n(o);else if(t.type==="image")t.translate&&o&&o.alt&&t.alt!==!1&&n(o.alt);else if(t.type==="multiselect"){if(t.translate&&Array.isArray(o))for(let i of o)n(i)}else if(t.type==="oneof"){let i=t.types||[],s;typeof i[0]=="string"?i.includes(o._type)&&(s=r[o._type]):s=i.find(a=>a.name===o._type),s&&L6(e,s.fields||[],o,r)}else t.type==="richtext"?t.translate&&F0e(e,o):console.log(`extract: ignoring field, id=${t.id}, type=${t.type}`)}function N0e(e,t,o,r={},n){if(!o)return;function i(s){let a=Tc(s);if(a){let l=e.get(a);(!l||!l.description)&&e.set(a,{description:n})}}if(t.type==="object")B6(e,t.fields||[],o,r);else if(t.type==="array"){let s=o._array||[];for(let a of s)N0e(e,t.of,o[a],r,n)}else if(t.type==="string"||t.type==="select")t.translate&&i(o);else if(t.type==="image")t.translate&&o&&o.alt&&t.alt!==!1&&i(o.alt);else if(t.type==="multiselect"){if(t.translate&&Array.isArray(o))for(let s of o)i(s)}else if(t.type==="oneof"){let s=t.types||[],a;typeof s[0]=="string"?s.includes(o._type)&&(a=r[o._type]):a=s.find(l=>l.name===o._type),a&&B6(e,a.fields||[],o,r)}else if(t.type==="richtext"&&t.translate){let s=new Set;F0e(s,o),s.forEach(a=>i(a))}}function F0e(e,t){(t?.blocks||[]).forEach(r=>{L0e(e,r)})}function L0e(e,t){if(!t?.type)return;function o(s){if(!s)return;let a=Tc(s);a&&e.add(a)}function r(s){s&&Object.values(s).forEach(a=>{n(a)})}function n(s){if(typeof s=="string"){o(s);return}if(Array.isArray(s)){s.forEach(a=>n(a));return}Ws(s)&&Object.values(s).forEach(a=>n(a))}function i(s){s&&s.forEach(a=>{o(a.content),r(a.components),i(a.items)})}t.type==="heading"||t.type==="paragraph"?(o(t.data?.text),r(t.data?.components)):t.type==="orderedList"||t.type==="unorderedList"?i(t.data?.items):t.type==="html"?o(t.data?.html):t.type==="table"&&(t.data?.rows||[]).forEach(a=>{(a.cells||[]).forEach(c=>{(c.blocks||[]).forEach(u=>{L0e(e,u)})})})}var AI=x(()=>{"use strict";kn();_6();sl();Lr()});var B0e=x(()=>{});function z0e(e){let{labels:t}=e,[o,r]=N(0);return $(()=>{let n=setTimeout(()=>{r(i=>(i+1)%t.length)},2e3);return()=>clearTimeout(n)},[o,t.length]),p("div",{className:"ProgressiveLoader",children:[p(gt,{color:"gray",size:"md"}),p("div",{className:"ProgressiveLoader__labels",children:p(Xt,{size:"sm",color:"dimmed",className:"ProgressiveLoader__label--entering",children:t[o]},o)})]})}var H0e=x(()=>{"use strict";Ye();Ne();B0e();X()});var V0e=x(()=>{});function OA(){let e=Wt(),t=io();return{open:o=>{e.openContextModal(G0e,{...t,title:`Prune unused strings from ${o.docId}`,innerProps:o,size:600})}}}function MA(e){let{innerProps:t,context:o,id:r}=e,[n,i]=N(!0),[s,a]=N([]),[l,c]=N(!1);$(()=>{let u=!1;async function f(){let h=t.docId,g=await Gl({tags:[h]}),m=new Set(await Promise.all(t.sourceStrings.map(b=>xs(b)))),v=[];for(let[b,y]of Object.entries(g))if(!m.has(b)){let C=y.tags||[];C.includes(h)&&v.push({hash:b,source:y.source||b,tags:C.filter(E=>E!==h)})}u||(a(v),i(!1))}return f().catch(h=>{console.error(h),u||i(!1)}),()=>{u=!0}},[t.docId,t.sourceStrings]);async function d(){if(s.length!==0){c(!0);try{let u=s.map(({hash:h,tags:g})=>({hash:h,tags:g}));await Dd(u,{mode:"replace"});let f=s.map(h=>h.hash);Re({title:"Pruned translations",message:`Removed "${t.docId}" tag from ${f.length} unused translation(s).`,color:"green",autoClose:5e3}),t.onPruned?.(f),o.closeModal(r)}catch(u){console.error(u),Re({title:"Error pruning translations",message:String(u),color:"red",autoClose:!1})}finally{c(!1)}}}return p("div",{className:"PruneTranslationsModal",children:[p("div",{className:"PruneTranslationsModal__description",children:p(ht,{size:"body",children:["Pruning removes the ",p("strong",{children:t.docId})," tag from translation strings that are no longer referenced by this document. The translations themselves are not deleted and will remain available to other documents that still reference them."]})}),n&&p("div",{className:"PruneTranslationsModal__loading",children:[p(gt,{color:"gray",size:"sm"}),p(ht,{size:"body",color:"gray",children:"Scanning for unused strings\u2026"})]}),!n&&s.length===0&&p("div",{className:"PruneTranslationsModal__empty",children:p(ht,{size:"body",color:"gray",children:['All translations tagged with "',t.docId,'" are still in use. Nothing to prune.']})}),!n&&s.length>0&&p(Oe,{children:[p(ht,{size:"body",weight:"semi-bold",children:[s.length," unused string",s.length!==1?"s":""," will be untagged:"]}),p("div",{className:"PruneTranslationsModal__list",children:s.map(u=>p("div",{className:"PruneTranslationsModal__list__item",children:p(ht,{size:"body-sm",children:u.source})},u.hash))})]}),p("div",{className:"PruneTranslationsModal__actions",children:[p(oe,{variant:"default",size:"xs",onClick:()=>o.closeModal(r),children:"Cancel"}),p(oe,{variant:"filled",size:"xs",color:"red",leftIcon:p(mm,{size:14}),loading:l,disabled:n||s.length===0,onClick:d,children:["Prune ",s.length>0?s.length:""," string",s.length!==1?"s":""]})]})]})}var G0e,NA=x(()=>{"use strict";Ye();Tn();dr();qt();Ne();Kn();fn();sl();V0e();X();G0e="PruneTranslationsModal";MA.id=G0e});var U0e=x(()=>{});function W0e(){let e=Wt(),t=io();return{open:o=>{let r=new URLSearchParams(window.location.search);r.set("modal","localization"),window.history.replaceState(null,"",`${window.location.pathname}?${r}`),e.openContextModal($0e,{...t,innerProps:o,size:"clamp(80%, 1024px, 1280px)",onClose:()=>{o.draft?.flush({quiet:!0});let n=new URLSearchParams(window.location.search);n.delete("modal");let i=n.toString()?`${window.location.pathname}?${n}`:window.location.pathname;window.history.replaceState(null,"",i)}})}}}function al(e){let t=e.innerProps;return p("div",{className:"LocalizationModal",children:p("div",{className:"LocalizationModal__layout",children:[p(al.ConfigLocales,{...t}),p(al.Translations,{...t})]})})}function Nmt(e){let t=e.pendingValue!==void 0?e.pendingValue:e.savedValue,r=[e.pendingValue!==void 0?"LocalizationModal__translations__cell--edited":"",e.isAiGenerating?"LocalizationModal__translations__cell--ai-generating":"",t?"":"LocalizationModal__translations__cell--empty"].filter(Boolean).join(" ")||void 0;return p(yo,{size:"xs",autosize:!0,minRows:1,value:t,placeholder:"",readOnly:e.readOnly,onChange:n=>e.onEdit(n.currentTarget.value),className:r,styles:{root:{height:"100%"},wrapper:{height:"100%"},input:{fontSize:"12px",minHeight:"100%"}}})}function Fmt(e){function t(n){e.onAction&&e.onAction(n)}let o=e.linkedSheet,r=(window.__ROOT_CTX.translations||[]).filter(n=>n.hasImport);return p(Me,{className:"LocalizationModal__translations__menu",position:"bottom",placement:"end",control:p(oe,{variant:"default",color:"dark",size:"xs",leftIcon:p(Kp,{size:16,strokeWidth:1.75}),rightIcon:p(Ad,{size:16,strokeWidth:1.75}),children:"Import"}),children:[e.gapiClient.enabled&&p(Oe,{children:[p(Me.Label,{children:"Google Sheets"}),p(Me.Item,{className:"LocalizationModal__translations__menu__item",disabled:!o?.spreadsheetId,onClick:()=>t("IMPORT_GOOGLE_SHEET_LINKED"),children:"Import Google Sheet"}),p(wi,{})]}),p(Me.Label,{children:"File"}),p(Me.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>t("IMPORT_CSV"),children:"Import .csv"}),r.length>0&&p(Oe,{children:[p(wi,{}),p(Me.Label,{children:"Services"}),r.map(n=>p(Me.Item,{className:"LocalizationModal__translations__menu__item",icon:n.icon?p("img",{src:n.icon,alt:n.label,style:{width:16,height:16}}):void 0,onClick:()=>e.onServiceAction?.(n.id,"import"),children:["Import from ",n.label]},n.id))]})]})}function Lmt(e){async function t(i){e.onAction&&e.onAction(i)}let r=!!e.linkedSheet?.spreadsheetId,n=(window.__ROOT_CTX.translations||[]).filter(i=>i.hasExport);return p(Me,{className:"LocalizationModal__translations__menu",position:"bottom",placement:"start",control:p(oe,{variant:"default",color:"dark",size:"xs",leftIcon:p(pm,{size:16,strokeWidth:1.75}),rightIcon:p(Ad,{size:16,strokeWidth:1.75}),children:"Export"}),children:[e.gapiClient.enabled&&p(Oe,{children:[p(Me.Label,{children:"Google Sheets"}),r?p(Oe,{children:p(Me.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>t("EXPORT_GOOGLE_SHEET_LINKED"),children:"Export to Google Sheet"})}):p(Oe,{children:p(Me.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>t("EXPORT_GOOGLE_SHEET_SHOW_OPTIONS"),children:"Export to Google Sheet"})}),p(wi,{})]}),p(Me.Label,{children:"File"}),p(Me.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>t("EXPORT_DOWNLOAD_CSV"),children:"Download .csv"}),n.length>0&&p(Oe,{children:[p(wi,{}),p(Me.Label,{children:"Services"}),n.map(i=>p(Me.Item,{className:"LocalizationModal__translations__menu__item",icon:i.icon?p("img",{src:i.icon,alt:i.label,style:{width:16,height:16}}):void 0,onClick:()=>e.onServiceAction?.(i.id,"export"),children:["Export to ",i.label]},i.id))]}),r&&p(Oe,{children:[p(wi,{}),p(Me.Label,{children:"Danger zone"}),p(Me.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>t("UNLINK_GOOGLE_SHEET"),color:"red",children:"Unlink Google Sheet"})]})]})}function z6(e,t){let o={...e};for(let[r,n]of Object.entries(t)){let i=o[r];o[r]=i?{...i,...n}:n}return o}function j0e(e){let t=e.split("_"),o=t[0];if(o==="ALL"){let i=String(t[1]).toUpperCase();return`${new Intl.DisplayNames(["en"],{type:"region"}).of(i)||e} (${e})`}return`${new Intl.DisplayNames(["en"],{type:"language"}).of(o)||e} (${e})`}var $0e,H6=x(()=>{"use strict";Ye();Tn();dr();qt();Ne();Ex();fn();Xu();pn();AI();Qu();sl();sl();F6();Dn();H0e();NA();U0e();X();$0e="LocalizationModal";al.id=$0e;al.ConfigLocales=e=>{let[t,o]=N(()=>e.draft?e.draft.getLocales():["en"]),r=window.__ROOT_CTX.rootConfig.i18n||{},n=r.locales||["en"],i=r.groups||{default:{label:"",locales:n}};function s(c){return t.filter(d=>(i[c].locales||[]).includes(d))}function a(c,d){let u=new Set(t),f=i[c].locales||[];for(let g of f)d.includes(g)?u.add(g):u.delete(g);let h=Array.from(u.values()).sort();l(h)}function l(c){o(c),e.draft.setLocales(c)}return p("div",{className:"LocalizationModal__locales",children:p(hs,{spacing:30,children:[p(Ho,{children:[p(Et,{className:"LocalizationModal__iconTitle LocalizationModal__locales__title",size:"h2",children:[p(R5,{strokeWidth:1.5}),p("span",{children:"Locales"})]}),p(al.AllNoneButtons,{onAllClicked:()=>l(n),onNoneClicked:()=>l([])})]}),p(hs,{spacing:40,children:Object.keys(i).map(c=>{let d=i[c],u=s(c);return p(al.LocaleGroup,{group:d,groupEnabledLocales:u,allEnabledLocales:t,onChange:f=>a(c,f)})})})]})})};al.LocaleGroup=e=>{let t=e.groupEnabledLocales||[],o=e.group.locales||[],r=e.allEnabledLocales||[];function n(s){e.onChange&&e.onChange(s)}function i(s){let a=t.indexOf(s);a===-1?t.push(s):t.splice(a,1),n(t)}return p(hs,{spacing:16,children:[e.group.label&&p(Ho,{position:"apart",children:[p(Et,{size:"h4",weight:"semi-bold",children:e.group.label}),p(al.AllNoneButtons,{onAllClicked:()=>n(o),onNoneClicked:()=>n([])})]}),p(Ho,{children:o.map(s=>{let a=t.includes(s),l=r.length<=1&&a;return p(zn,{value:s,checked:a,disabled:l,label:j0e(s),onChange:()=>i(s),size:"xs"})})})]})};al.AllNoneButtons=e=>p(Ho,{spacing:"8px",children:[p(oe,{className:"LocalizationModal__allNoneBtn",variant:"subtle",size:"xs",compact:!0,onClick:e.onAllClicked,children:"All"}),"/",p(oe,{className:"LocalizationModal__allNoneBtn",variant:"subtle",size:"xs",compact:!0,onClick:e.onNoneClicked,children:"None"})]});al.Translations=e=>{let[t,o]=N(!0),[r,n]=N([]),i=window.__ROOT_CTX.rootConfig.i18n?.locales||[],s=e.locale||i.find(pe=>pe!=="en")||"en",[a,l]=N(s),[c,d]=N(!1),[u,f]=N({}),h=ee(()=>{if(!a)return{};let pe={};return Object.values(u).forEach(Pe=>{pe[Pe.source]=Pe[a]||""}),pe},[a,u]),g=Bd(),[m,v]=N(null),b=M0e(),y=OA(),[C,E]=N(new Set),R=C.size,[I,S]=N({}),[_,T]=N(!1),[k,D]=N(!1),[A,P]=N(null),z=G(!1),L=G(null),H=Object.keys(I).length;function j(pe,Pe,Se){S(je=>{let ot={...je};ot[pe]||(ot[pe]={}),ot[pe]={...ot[pe],[Pe]:Se};let It=h[pe]||"";return Se===It&&(delete ot[pe][Pe],Object.keys(ot[pe]).length===0&&delete ot[pe]),ot})}async function U(){T(!0);try{let pe=Object.entries(I).map(([je,ot])=>({source:je,locales:ot}));await Fbe(pe,{tags:[e.docId]});let Pe=await Promise.all(pe.map(async je=>({hash:await xs(je.source),source:je.source,locales:je.locales}))),Se=[e.docId];f(je=>{let ot={...je};for(let{hash:It,source:We,locales:ue}of Pe){let K=ot[It],te=K?.tags||[],be=Array.from(new Set([...te,...Se]));K?ot[It]={...K,...ue,tags:be}:ot[It]={source:We,...ue,tags:be}}return ot}),S({}),Re({title:"Saved!",message:`Updated ${pe.length} translation(s).`,autoClose:2500})}catch(pe){console.error(pe),Re({title:"Error saving translations",message:String(pe),color:"red",autoClose:!1})}T(!1)}function q(){return!!!(window.__ROOT_CTX?.experiments||{}).ai||!a?!1:r.some(Se=>{let je=I[Se]?.[a];return je!==void 0?!je:!h[Se]})}function B(){z.current=!0,L.current?.abort()}async function ne(){if(!(!a||r.length===0)){z.current=!1,D(!0);try{for(let pe of r){if(z.current)break;if(I[pe]?.[a]||h[pe])continue;P(pe);let Se=new AbortController;L.current=Se;let je={},ot=V[pe];ot&&i.forEach(ue=>{ot[ue]&&(je[ue]=ot[ue])});let It=await window.fetch("/cms/api/ai.translate",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sourceText:pe,targetLocales:[a],existingTranslations:je}),signal:Se.signal});if(It.status!==200){let ue=await It.text();throw new Error(`Translation failed: ${ue}`)}let We=await It.json();We.success&&We.translations?.[a]&&j(pe,a,We.translations[a])}z.current?Re({message:"AI translation stopped",color:"yellow"}):Re({message:"Finished generating AI translations",color:"green"})}catch(pe){pe instanceof DOMException&&pe.name==="AbortError"||(console.error(pe),Re({title:"Error generating translations",message:String(pe),color:"red"}))}finally{D(!1),P(null),z.current=!1,L.current=null}}}let Q=G(!1);$(()=>{if(t)return;if(!Q.current){Q.current=!0;return}let pe=!1;async function Pe(){let Se=[e.docId],je=await Promise.all(r.map(async It=>({source:It,hash:await xs(It)})));if(pe)return;let ot=new Set;for(let{source:It,hash:We}of je)if(u[We]){let ue=u[We].tags||[];Se.every(te=>ue.includes(te))||ot.add(It)}pe||E(ot)}return Pe(),()=>{pe=!0}},[e.docId,r,u,t]);let V=ee(()=>{let pe={};return Object.values(u).forEach(Pe=>{pe[Pe.source]=Pe}),pe},[u]),ie=i.map(pe=>({value:pe,label:j0e(pe)})),de=ee(()=>!a||r.length===0?0:r.filter(pe=>{let Pe=I[pe]?.[a];return Pe!==void 0?!Pe:!h[pe]}).length,[r,h,a,I]);$(()=>{o(!0),Promise.all([PA(e.docId),Gl(),bP(e.docId)]).then(async([pe,Pe,Se])=>{let je=[e.docId],ot=await Promise.all(pe.map(async We=>({source:We,hash:await xs(We)}))),It=new Set;for(let{source:We,hash:ue}of ot)if(Pe[ue]){let K=Pe[ue].tags||[];je.every(be=>K.includes(be))||It.add(We)}n(pe),f(Pe),v(Se),E(It),o(!1)}).catch(pe=>{console.error("Failed to load translations:",pe),o(!1),Re({title:"Error",message:String(pe?.message||pe),color:"red",autoClose:!1})})},[e.docId]);function he(pe,Pe){let Se=V[pe];return Se&&Se[Pe]||""}function ke(){let pe=i.filter(je=>je!=="en"),Pe=["source","en",...pe],Se=[];return r.forEach(je=>{let ot={source:je,en:he(je,"en")||je};pe.forEach(It=>{ot[It]=he(je,It)}),Se.push(ot)}),{headers:Pe,rows:Se}}async function Ce(){let{headers:pe,rows:Pe}=ke(),Se=await window.fetch("/cms/api/csv.download",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:pe,rows:Pe})});if(Se.status!==200){console.error("csv.download failed:");let It=await Se.text();console.error(It)}let je=await Se.blob(),ot=window.URL.createObjectURL(je);window.location.assign(ot),window.URL.revokeObjectURL(ot)}async function _e(){let pe=document.createElement("input");pe.type="file",pe.accept=".csv",pe.addEventListener("change",async()=>{let Pe=pe.files?.[0];if(Pe){let Se=new FormData;Se.append("file",Pe);try{let je=await fetch("/cms/api/csv.import",{method:"POST",body:Se});if(je.status!==200){let We=await je.text();throw new Error(`RPCError: ${We}`)}let ot=(await je.json()).data,It=await Up(e.docId,ot);f(We=>z6(We,It)),Re({title:"Saved!",message:`Imported translations for ${e.docId}.`,autoClose:5e3})}catch(je){console.error(je),Re({title:"Failed to import CSV",message:String(je),color:"red",autoClose:!1})}}}),pe.click()}async function Ge(){if(g.isLoggedIn()||await g.login(),!m?.spreadsheetId)throw new Error("no sheet linked");let Pe=await new Rd(m.spreadsheetId).getSheet(m.gid??0);if(!Pe)throw new Error(`sheet not found: ${JSON.stringify(m)}`);await pt(Pe),Re({title:"Exported strings to Google Sheet",message:Pe.getUrl(),autoClose:!1})}async function pt(pe,Pe){let Se=Pe?.isNew||!1,{headers:je,rows:ot}=ke();Se?(await pe.replaceSheet(je,ot),await pe.applyL10nTheme()):await pe.updateValuesMap(ot,{keyedBy:"source",preserveColumns:i}),uo("doc.export_to_sheet",{metadata:{docId:e.docId,sheetId:{spreadsheetId:pe.spreadsheet.spreadsheetId,gid:pe.gid}}})}async function Ue(){if(g.isLoggedIn()||await g.login(),!m?.spreadsheetId)throw new Error("no sheet linked");let Pe=await new Rd(m.spreadsheetId).getSheet(m.gid??0);if(!Pe)throw new Error(`sheet not found: ${JSON.stringify(m)}`);console.log("importing google sheet");let Se=await Pe.getValuesMap(),je=await Up(e.docId,Se);f(ot=>z6(ot,je)),Re({title:"Saved!",message:`Imported translations for ${e.docId}.`,autoClose:5e3})}async function tt(){await Kbe(e.docId),v(null),Re({title:"Unlinked Google Sheet",message:`${e.docId} is no longer connected to a Google Sheet.`,autoClose:5e3})}async function mt(){o(!0);let pe=[],Pe=[e.docId];for(let Se of r){let je=await xs(Se);if(u[je]){let ot=u[je].tags||[],It=Array.from(new Set([...ot,...Pe]));pe.push({hash:je,tags:It})}}pe.length>0?(await Dd(pe,{mode:"union"}),f(Se=>{let je={...Se};return pe.forEach(({hash:ot,tags:It})=>{je[ot]&&(je[ot]={...je[ot],tags:It})}),je}),Re({title:"Tags Applied",message:`Applied tag "${e.docId}" to ${pe.length} string(s).`,color:"green"})):Re({title:"No strings updated",message:"No existing translations found to tag.",color:"blue"}),o(!1)}async function so(pe){try{await pe()}catch(Pe){console.error(Pe);let Se;typeof Pe=="object"&&Pe.body?Se=String(Pe.body):Se=String(Pe),Re({title:"Error",message:Se,color:"red",autoClose:!1})}}function wt(pe){switch(pe){case"EXPORT_DOWNLOAD_CSV":{so(Ce);return}case"EXPORT_GOOGLE_SHEET_LINKED":{so(Ge);return}case"EXPORT_GOOGLE_SHEET_SHOW_OPTIONS":{b.open({docId:e.docId,csvData:ke(),locales:i});return}case"IMPORT_CSV":{so(_e);return}case"IMPORT_GOOGLE_SHEET_LINKED":{so(Ue);return}case"UNLINK_GOOGLE_SHEET":{so(tt);return}default:console.log("unhandled action: "+pe)}}async function $e(pe,Pe){let je=(window.__ROOT_CTX.translations||[]).find(ot=>ot.id===pe)?.label||pe;await so(async()=>{let ot=Pe==="export"?await AA(e.docId):null,It=r.map(K=>{let te={};i.forEach(nt=>{te[nt]=he(K,nt)??""});let be=ot?.get(K)?.description;return{source:K,translations:te,...be?{description:be}:{}}}),We=Pe==="import"||Pe==="export"?Pe:(()=>{throw new Error("Invalid translations action")})(),ue=`translations-${We}-${pe}`;Re({id:ue,message:Pe==="import"?`Importing from ${je}...`:`Exporting to ${je}...`,loading:!0,autoClose:!1,disallowClose:!0});try{let K=await window.fetch(`/cms/api/translations.${We}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serviceId:pe,docId:e.docId,data:It})});if(!(K.headers.get("content-type")||"").includes("application/json"))throw new Error(`Unexpected response (${K.status}). Please reload the page and try again.`);let be=await K.json();if(!be.success)throw new Error(be.error||"Unknown error");if(Pe==="import"){if(!Array.isArray(be.data))throw new Error("Import did not return translation data.");let nt=be.data.map(wo=>{let _o={source:String(wo?.source??"")},Pr=wo?.translations;return Pr&&typeof Pr=="object"&&i.forEach(ar=>{let nn=Pr[ar];nn!=null&&(_o[ar]=String(nn))}),_o}),Ut=await Up(e.docId,nt,{actionMetadata:{service:pe,numStrings:nt.length,locales:i},actionLinks:[{label:"Open translations",url:`/cms/content/${e.docId}?modal=localization`}]});f(wo=>z6(wo,Ut));let ro=[e.docId],Cr=[];for(let wo of nt){let _o=await xs(wo.source),ar=u[_o]?.tags||[],nn=Array.from(new Set([...ar,...ro]));Cr.push({hash:_o,tags:nn})}Cr.length>0&&(await Dd(Cr,{mode:"union"}),f(wo=>{let _o={...wo};return Cr.forEach(({hash:Pr,tags:ar})=>{_o[Pr]&&(_o[Pr]={..._o[Pr],tags:ar})}),_o})),ho({id:ue,title:"Imported!",message:`Imported translations from ${je}.`,loading:!1,autoClose:5e3})}else{let nt=be.data||{},Ut=nt.title||"Exported!",ro=nt.message||`Exported translations to ${je}.`,Cr=nt.link;ho({id:ue,title:Ut,message:Cr?.url?p("div",{children:[p("div",{children:ro}),p(oe,{component:"a",href:Cr.url,target:"_blank",rel:"noopener noreferrer",size:"xs",variant:"default",rightIcon:p(Ca,{size:14}),style:{marginTop:"8px"},children:Cr.label||"Open"})]}):ro,loading:!1,autoClose:Cr?.url?1e4:5e3})}}catch(K){throw sy(ue),K}})}return p("div",{className:"LocalizationModal__translations",children:[p("div",{className:"LocalizationModal__translations__topWrapper",children:[p("div",{className:"LocalizationModal__translations__header",children:[p("div",{className:"LocalizationModal__translations__titleWrap",children:p(Et,{className:"LocalizationModal__translations__title LocalizationModal__iconTitle",size:"h2",children:[p(Od,{strokeWidth:1.5})," ",p("span",{children:"Translations"})]})}),p("div",{className:"LocalizationModal__translations__header__buttons",children:[g.enabled&&m?.spreadsheetId&&p(Ee,{label:"Open Google Sheet",children:p(Ke,{component:"a",href:Hl(m),target:"_blank",variant:"filled",color:"green",size:"sm",children:p(Pc,{size:16,strokeWidth:2.25})})}),p(oe,{component:"a",href:`/cms/translations/${e.docId}`,target:"_blank",variant:"default",size:"xs",rightIcon:p(Ca,{size:14,strokeWidth:1.75}),children:"Open Editor"}),p(Fmt,{onAction:wt,onServiceAction:$e,gapiClient:g,linkedSheet:m}),p(Lmt,{onAction:wt,onServiceAction:$e,gapiClient:g,linkedSheet:m}),p(Me,{className:"LocalizationModal__translations__menu",control:p(Ee,{label:"Tools",children:p(Ke,{className:"LocalizationModal__translations__menu__dots",variant:"default",children:p(cx,{size:16})})}),size:220,children:p(Me.Item,{className:"LocalizationModal__translations__menu__item",icon:p(mm,{size:16}),onClick:()=>y.open({docId:e.docId,sourceStrings:r,onPruned:pe=>{f(Pe=>{let Se={...Pe};return pe.forEach(je=>delete Se[je]),Se})}}),children:"Prune unused strings"})})]})]}),t&&p(z0e,{labels:["Transmogrifying...","Deciphering the vibes...","Consulting the Rosetta Stone...","Untangling the syntax...","Babel-ing..."]}),!t&&R>0&&p("div",{className:"LocalizationModal__missingTags",children:[p("div",{className:"LocalizationModal__missingTags__message",children:[p(nx,{}),R>1?p(Xt,{size:"sm",children:[p("b",{children:[R," strings"]}),' are missing the "',e.docId,'" tag.']}):p(Xt,{size:"sm",children:[p("b",{children:[R," string"]}),' is missing the "',e.docId,'" tag.']})]}),p(oe,{variant:"filled",size:"xs",onClick:()=>so(mt),loading:t,leftIcon:p(cx,{size:16}),children:"Fix missing tags"})]}),!t&&p("table",{className:"LocalizationModal__translations__table",children:[p("tr",{className:"LocalizationModal__translations__table__row LocalizationModal__translations__table__row--header",children:[p("th",{className:"LocalizationModal__translations__table__header",children:p(Et,{size:"h4",weight:"semi-bold",children:"SOURCE STRING"})}),p("th",{className:"LocalizationModal__translations__table__header",children:p("div",{className:"LocalizationModal__translations__localeHeader",children:[p(Et,{className:"LocalizationModal__translations__localeSelect",size:"h4",weight:"semi-bold",children:[p("span",{children:"LOCALE: "})," ",p(Ao,{data:ie,size:"xs",placeholder:"select locale",allowDeselect:!0,value:a,onChange:pe=>l(pe)})]}),p("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[a&&de>0&&p(Ee,{label:c?"Show all translations":"Show only missing translations",position:"top",withArrow:!0,children:p("button",{className:`LocalizationModal__translations__missingToggle${c?" LocalizationModal__translations__missingToggle--active":""}`,onClick:()=>d(pe=>!pe),children:[p(p5,{size:14}),p("span",{children:[de," missing"]})]})},c?"active":"inactive"),a&&r.length>0&&de===0&&H===0&&p("div",{className:"LocalizationModal__translations__fullyTranslated",children:[p(js,{size:14}),p("span",{children:"Translated"})]}),q()&&!k&&p(Ee,{label:"Generate translations using AI",withArrow:!0,position:"top",children:p(Ke,{variant:"default",size:"sm",onClick:ne,children:p(Cs,{size:14,fill:"black"})})}),k&&p(Ee,{label:"Stop generating",withArrow:!0,position:"top",children:p(Ke,{variant:"default",size:"sm",onClick:B,children:p(O5,{size:14,fill:"black"})})}),k&&p(oI,{size:18,className:"LocalizationModal__spinner"})]})]})})]}),r.filter(pe=>!c||!a?!0:!h[pe]).map((pe,Pe)=>p("tr",{className:"LocalizationModal__translations__table__row",children:[p("td",{className:"LocalizationModal__translations__table__col",children:p("div",{className:"LocalizationModal__sourceCell",children:[p("span",{className:"LocalizationModal__sourceCell__text",children:pe}),(V[pe]||C.has(pe))&&p("div",{className:"LocalizationModal__sourceCell__icons",children:[V[pe]&&p(Ke,{className:"LocalizationModal__sourceCell__link",size:"sm",variant:"subtle",onClick:async()=>{let Se=await xs(pe);window.open(`/cms/translations/${Se}`,"_blank")},children:p(Dc,{size:16})}),C.has(pe)&&p(Ee,{label:`Missing "${e.docId}" tag`,position:"top",withArrow:!0,children:p(Ke,{className:"LocalizationModal__sourceCell__missingTag",size:"sm",variant:"subtle",children:p(nx,{size:14})})})]})]})}),p("td",{className:"LocalizationModal__translations__table__col",children:p(Nmt,{source:pe,locale:a,savedValue:h[pe]||"",pendingValue:I[pe]?.[a],isAiGenerating:A===pe,readOnly:k,onEdit:Se=>j(pe,a,Se)})})]},Pe))]})]}),p("div",{className:"LocalizationModal__translations__saveBar",children:[p("span",{className:"LocalizationModal__translations__saveBar__status",children:H>0?`${H} unsaved change${H!==1?"s":""}`:""}),H>0&&p(oe,{variant:"default",size:"xs",leftIcon:p(Zu,{size:14}),onClick:()=>S({}),children:"Discard changes"}),p(oe,{variant:"filled",size:"xs",color:"dark",leftIcon:p(js,{size:14}),onClick:U,loading:_,disabled:H===0,children:"Save"})]})]})}});var K0e=x(()=>{});function sf(e){return p("div",{className:"DocIdBadge",children:p("code",{"data-testid":"doc-id",children:e.docId})})}var FA=x(()=>{"use strict";K0e();X()});var q0e=x(()=>{});function X0e(e){let t=Wt(),o=io();return{open:r=>{let i={...e,...r}.unlock?`Unlock publishing for ${e.docId}`:`Lock publishing for ${e.docId}`;t.openContextModal(Y0e,{...o,title:i,innerProps:{...e,...r},size:"600px"})}}}function oh(e){let{innerProps:t}=e;return t.unlock?p(oh.Unlock,{...e}):p(oh.Lock,{...e})}var Y0e,V6=x(()=>{"use strict";Ye();Tn();dr();qt();Ne();fn();pn();ns();il();FA();Kn();q0e();X();Y0e="LockPublishingModal";oh.Lock=e=>{let{innerProps:t,context:o,id:r}=e,[n,i]=N(""),[s,a]=N(0),[l,c]=N(!1),d=Wt();function u(h){return h?Math.floor(new Date(h).getTime()):0}async function f(h){h.preventDefault(),c(!0),await mo(async()=>{await Ube(t.docId,{reason:n,until:s}),Re({title:"Locked!",message:`Publishing is locked for ${t.docId}.`,autoClose:1e4}),d.closeModal(r),t.onChange&&t.onChange("locked")})}return p("div",{className:"LockPublishingModal LockPublishingModal--lock",children:[p(ht,{className:"LockPublishingModal__body",children:"Are you sure you want to lock publishing? Content editors will not be able to publish until publishing is unlocked."}),p("form",{className:"LockPublishingModal__form",onSubmit:h=>f(h),children:[p("div",{className:"LockPublishingModal__form__section",children:p(Ro,{name:"reason",label:"Reason",description:"Specify a short reason so other content editors know why publishing is locked.",size:"xs",radius:0,onChange:h=>{i(h.currentTarget.value)}})}),p("div",{className:"LockPublishingModal__form__section",children:p(es,{label:"Lock until",description:"Optional. Publishing is unlocked at the specified time. If not provided, publishing will be locked indefinitely.",size:"xs",children:p("div",{className:"DocEditor__DateTimeField",children:[p("input",{name:"until",type:"datetime-local",min:Qy(),onChange:h=>{let m=h.target.value;a(u(m))}}),p("div",{className:"DocEditor__DateTimeField__timezone",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]})})}),p("div",{className:"LockPublishingModal__buttons",children:[p(oe,{variant:"outline",onClick:()=>o.closeModal(r),type:"button",size:"xs",color:"dark",children:"Cancel"}),p(oe,{variant:"filled",size:"xs",color:"dark",leftIcon:p(hm,{size:14}),disabled:!n,type:"submit",loading:l,children:"Lock"})]})]})]})};oh.Unlock=e=>{let{innerProps:t,context:o,id:r}=e,[n,i]=N(!1),s=Wt();async function a(){i(!0),await mo(async()=>{await $be(t.docId),Re({title:"Unlocked!",message:`Publishing is unlocked for ${t.docId}.`,autoClose:1e4}),s.closeModal(r),t.onChange&&t.onChange("unlocked")})}return p("div",{className:"LockPublishingModal LockPublishingModal--unlock",children:[p(ht,{className:"LockPublishingModal__body",children:"Are you sure you want to unlock publishing for the following doc? This will re-enable content editors to publish the doc."}),p(sf,{docId:t.docId}),p("div",{className:"LockPublishingModal__buttons",children:[p(oe,{variant:"outline",onClick:()=>o.closeModal(r),type:"button",size:"xs",color:"dark",children:"Cancel"}),p(oe,{variant:"filled",size:"xs",color:"dark",leftIcon:p(rI,{size:14}),loading:n,onClick:()=>a(),children:"Unlock"})]})]})};oh.id=Y0e});var Q0e=x(()=>{});function Bmt(){return G6||(G6=(async()=>{let e=window.firebase.db,t=window.__ROOT_CTX.rootConfig.projectId||"default",o=at(e,"Projects",t);return((await Yr(o)).data()||{}).roles||{}})()),G6}function gn(){let[e,t]=N({}),[o,r]=N(!0);return $(()=>{Bmt().then(n=>{t(n),r(!1)})},[]),{roles:e,loading:o}}var G6,Ul=x(()=>{"use strict";kn();Ne();G6=null});function J0e(e,t){if(t in e)return e[t];let r=`*@${t.split("@").at(-1)}`;return r in e?e[r]:null}function Is(e,t){let o=J0e(e,t);return o==="ADMIN"||o==="EDITOR"}function rh(e,t){let o=J0e(e,t);return o==="ADMIN"||o==="EDITOR"||o==="CONTRIBUTOR"}var $l=x(()=>{"use strict"});function Z0e(e){let t=new Set;return U6(e,t),Array.from(t)}function U6(e,t){if(!(!e||typeof e!="object")){if(Array.isArray(e)){for(let o of e)U6(o,t);return}if(zmt(e)){t.add(e.id);return}for(let o of Object.keys(e))U6(e[o],t)}}function zmt(e){return typeof e.id=="string"&&typeof e.collection=="string"&&typeof e.slug=="string"&&e.id.includes("/")}var eEe=x(()=>{"use strict"});var tEe=x(()=>{});function j6(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function sEe(e){Dm=e}function ll(e,t){if(t){if(aEe.test(e))return e.replace(Hmt,oEe)}else if(lEe.test(e))return e.replace(Vmt,oEe);return e}function $mt(e){return e.replace(Umt,(t,o)=>(o=o.toLowerCase(),o==="colon"?":":o.charAt(0)==="#"?o.charAt(1)==="x"?String.fromCharCode(parseInt(o.substring(2),16)):String.fromCharCode(+o.substring(1)):""))}function Zo(e,t){e=typeof e=="string"?e:e.source,t=t||"";let o={replace:(r,n)=>(n=typeof n=="object"&&"source"in n?n.source:n,n=n.replace(Wmt,"$1"),e=e.replace(r,n),o),getRegex:()=>new RegExp(e,t)};return o}function rEe(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}function nEe(e,t){let o=e.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=o.split(/ \|/),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(/\\\|/g,"|");return r}function $6(e,t,o){let r=e.length;if(r===0)return"";let n=0;for(;n<r;){let i=e.charAt(r-n-1);if(i===t&&!o)n++;else if(i!==t&&o)n++;else break}return e.slice(0,r-n)}function jmt(e,t){if(e.indexOf(t[1])===-1)return-1;let o=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])o++;else if(e[r]===t[1]&&(o--,o<0))return r;return-1}function iEe(e,t,o,r){let n=t.href,i=t.title?ll(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;let a={type:"link",raw:o,href:n,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:o,href:n,title:i,text:ll(s)}}function Kmt(e,t){let o=e.match(/^(\s+)(?:```)/);if(o===null)return t;let r=o[1];return t.split(`
|
|
67
67
|
`).map(n=>{let i=n.match(/^\s+/);if(i===null)return n;let[s]=i;return s.length>=r.length?n.slice(r.length):n}).join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blinkk/root-cms",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.14-alpha.0",
|
|
4
4
|
"author": "s@blinkk.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -11,9 +11,6 @@
|
|
|
11
11
|
"url": "git+https://github.com/blinkk/rootjs.git",
|
|
12
12
|
"directory": "packages/root-cms"
|
|
13
13
|
},
|
|
14
|
-
"publishConfig": {
|
|
15
|
-
"provenance": true
|
|
16
|
-
},
|
|
17
14
|
"files": [
|
|
18
15
|
"dist/**/*"
|
|
19
16
|
],
|
|
@@ -141,7 +138,7 @@
|
|
|
141
138
|
"playwright": "1.56.1",
|
|
142
139
|
"preact": "10.27.1",
|
|
143
140
|
"preact-iso": "2.11.1",
|
|
144
|
-
"preact-render-to-string": "6.6.
|
|
141
|
+
"preact-render-to-string": "6.6.7",
|
|
145
142
|
"react": "npm:@preact/compat@18.3.1",
|
|
146
143
|
"react-dom": "npm:@preact/compat@18.3.1",
|
|
147
144
|
"react-easy-crop": "5.5.6",
|
|
@@ -151,14 +148,13 @@
|
|
|
151
148
|
"vite": "7.1.4",
|
|
152
149
|
"vitest": "4.0.10",
|
|
153
150
|
"yjs": "13.6.27",
|
|
154
|
-
"@blinkk/root": "2.5.
|
|
151
|
+
"@blinkk/root": "2.5.14-alpha.0"
|
|
155
152
|
},
|
|
156
153
|
"peerDependencies": {
|
|
157
|
-
"@blinkk/root": "2.5.
|
|
154
|
+
"@blinkk/root": "2.5.14-alpha.0",
|
|
158
155
|
"firebase-admin": ">=11",
|
|
159
156
|
"firebase-functions": ">=4",
|
|
160
|
-
"preact": ">=10"
|
|
161
|
-
"preact-render-to-string": ">=5"
|
|
157
|
+
"preact": ">=10"
|
|
162
158
|
},
|
|
163
159
|
"peerDependenciesMeta": {
|
|
164
160
|
"firebase-functions": {
|