@mario9/tiptap-editor 0.1.2 → 0.1.4
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/tiptap-editor.css +1 -1
- package/dist/tiptap-editor.js +785 -14629
- package/dist/tiptap-editor.umd.cjs +1 -5
- package/package.json +29 -1
|
@@ -1,5 +1 @@
|
|
|
1
|
-
(function(W,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@tiptap/starter-kit"),require("@tiptap/vue-3"),require("@tiptap/extension-list"),require("@tiptap/extension-text-align"),require("@tiptap/extension-placeholder"),require("@tiptap/extension-code-block-lowlight"),require("@tiptap/extension-image"),require("@tiptap/pm/state"),require("@tiptap/pm/view"),require("@tiptap/extension-table"),require("@tiptap/extension-mathematics"),require("@tiptap/core"),require("element-plus"),require("katex"),require("@tiptap/vue-3/menus")):typeof define=="function"&&define.amd?define(["exports","vue","@tiptap/starter-kit","@tiptap/vue-3","@tiptap/extension-list","@tiptap/extension-text-align","@tiptap/extension-placeholder","@tiptap/extension-code-block-lowlight","@tiptap/extension-image","@tiptap/pm/state","@tiptap/pm/view","@tiptap/extension-table","@tiptap/extension-mathematics","@tiptap/core","element-plus","katex","@tiptap/vue-3/menus"],t):(W=typeof globalThis<"u"?globalThis:W||self,t(W.TiptapEditor={},W.Vue,W.StarterKit,W.vue3,W.extensionList,W.extensionTextAlign,W.extensionPlaceholder,W.extensionCodeBlockLowlight,W.extensionImage,W.state,W.view,W.extensionTable,W.extensionMathematics,W.core$1,W.ElementPlus,W.katex,W.menus))})(this,(function(W,t,Cn,Le,Nt,wn,yn,Tn,Sn,Ct,wt,Pe,An,yt,F,vn,kn){"use strict";function On(e){const n=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",g="(?!struct)("+r+"|"+n.optional(s)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},a={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:n.optional(s)+e.IDENT_RE,relevance:0},_=n.optional(s)+e.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],f=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],N=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:h,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:f},M={className:"function.dispatch",relevance:0,keywords:{_hint:N},begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},I=[M,l,d,i,e.C_BLOCK_COMMENT_MODE,a,c],G={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:I.concat([{begin:/\(/,end:/\)/,keywords:A,contains:I.concat(["self"]),relevance:0}]),relevance:0},V={className:"function",begin:"("+g+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:A,relevance:0},{begin:_,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,a]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,c,a,d,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,c,a,d]}]},d,i,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(G,V,M,I,[l,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Mn(e){const n={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},i=On(e),r=i.keywords;return r.type=[...r.type,...n.type],r.literal=[...r.literal,...n.literal],r.built_in=[...r.built_in,...n.built_in],r._hints=n._hints,i.name="Arduino",i.aliases=["ino"],i.supersetOf="cpp",i}function Rn(e){const n=e.regex,i={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]};Object.assign(i,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},u=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),g={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},d={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i,s]};s.contains.push(d);const p={match:/\\"/},c={className:"string",begin:/'/,end:/'/},a={match:/\\'/},l={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,i]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],_=e.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},h=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],f=["true","false"],N={match:/(\/[a-z._-]+)+/},T=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],R=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:h,literal:f,built_in:[...T,...R,"set","shopt",...A,...M]},contains:[_,e.SHEBANG(),y,l,u,g,N,d,p,c,a,i]}}function xn(e){const n=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",g="("+r+"|"+n.optional(s)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",d={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},a={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:n.optional(s)+e.IDENT_RE,relevance:0},_=n.optional(s)+e.IDENT_RE+"\\s*\\(",f={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},N=[l,d,i,e.C_BLOCK_COMMENT_MODE,a,c],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:f,contains:N.concat([{begin:/\(/,end:/\)/,keywords:f,contains:N.concat(["self"]),relevance:0}]),relevance:0},R={begin:"("+g+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:_,returnBegin:!0,contains:[e.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,c,a,d,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,c,a,d]}]},d,i,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C",aliases:["h"],keywords:f,disableAutodetect:!0,illegal:"</",contains:[].concat(T,R,N,[l,{begin:e.IDENT_RE+"::",keywords:f},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:c,keywords:f}}}function In(e){const n=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",g="(?!struct)("+r+"|"+n.optional(s)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},a={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:n.optional(s)+e.IDENT_RE,relevance:0},_=n.optional(s)+e.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],f=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],N=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:h,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:f},M={className:"function.dispatch",relevance:0,keywords:{_hint:N},begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},I=[M,l,d,i,e.C_BLOCK_COMMENT_MODE,a,c],G={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:I.concat([{begin:/\(/,end:/\)/,keywords:A,contains:I.concat(["self"]),relevance:0}]),relevance:0},V={className:"function",begin:"("+g+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:A,relevance:0},{begin:_,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,a]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,c,a,d,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,c,a,d]}]},d,i,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(G,V,M,I,[l,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Ln(e){const n=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],i=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],u=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],g={keyword:s.concat(u),built_in:n,literal:r},d=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),p={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},a={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},l=e.inherit(a,{illegal:/\n/}),m={className:"subst",begin:/\{/,end:/\}/,keywords:g},_=e.inherit(m,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,_]},h={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]},f=e.inherit(h,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},_]});m.contains=[h,y,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,e.C_BLOCK_COMMENT_MODE],_.contains=[f,y,l,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const N={variants:[c,h,y,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},T={begin:"<",end:">",contains:[{beginKeywords:"in out"},d]},R=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",A={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:g,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},N,p,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},d,T,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[d,T,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+R+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:g,contains:[{beginKeywords:i.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,T],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:g,relevance:0,contains:[N,p,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},A]}}const Dn=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_-]*/}}),Bn=["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","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Un=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Pn=[...Bn,...Un],Fn=["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"].sort().reverse(),Vn=["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"].sort().reverse(),Hn=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$n=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","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-end-end-radius","border-end-start-radius","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-start-end-radius","border-start-start-radius","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-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","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","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","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","margin-trim","marker","marker-end","marker-mid","marker-start","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","masonry-auto-flow","math-depth","math-shift","math-style","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","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-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","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","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","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function zn(e){const n=e.regex,i=Dn(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",u=/@-?\w[\w]*(-\w+)*/,g="[a-zA-Z-][a-zA-Z0-9_-]*",d=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[i.BLOCK_COMMENT,r,i.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+g,relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Vn.join("|")+")"},{begin:":(:)?("+Hn.join("|")+")"}]},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$n.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[i.BLOCK_COMMENT,i.HEXCOLOR,i.IMPORTANT,i.CSS_NUMBER_MODE,...d,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...d,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},i.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:u},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Fn.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,i.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Pn.join("|")+")\\b"}]}}function Gn(e){const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Kn(e){const u={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:u,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:u,illegal:/["']/}]}]}}function Zn(e){const n=e.regex,i=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:n.concat(i,n.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function qn(e){const n=e.regex,i={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const s={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},u={className:"literal",begin:/\bon|off|true|false|yes|no\b/},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},d={begin:/\[/,end:/\]/,contains:[r,u,s,g,i,"self"],relevance:0},p=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,a=/'[^']*'/,l=n.either(p,c,a),m=n.concat(l,"(\\s*\\.\\s*",l,")*",n.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:m,className:"attr",starts:{end:/$/,contains:[r,d,u,s,g,i]}}]}}var ke="[0-9](_*[0-9])*",Fe=`\\.(${ke})`,Ve="[0-9a-fA-F](_*[0-9a-fA-F])*",Tt={className:"number",variants:[{begin:`(\\b(${ke})((${Fe})|\\.)?|(${Fe}))[eE][+-]?(${ke})[fFdD]?\\b`},{begin:`\\b(${ke})((${Fe})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Fe})[fFdD]?\\b`},{begin:`\\b(${ke})[fFdD]\\b`},{begin:`\\b0[xX]((${Ve})\\.?|(${Ve})?\\.(${Ve}))[pP][+-]?(${ke})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ve})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function St(e,n,i){return i===-1?"":e.replace(n,r=>St(e,n,i-1))}function Wn(e){const n=e.regex,i="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=i+St("(?:<"+i+"~~~(?:\\s*,\\s*"+i+"~~~)*>)?",/~~~/g,2),p={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+i,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},a={className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:p,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[n.concat(/(?!else)/,i),/\s+/,i,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,i],className:{1:"keyword",3:"title.class"},contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:p,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Tt,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Tt,c]}}const At="[A-Za-z$_][0-9A-Za-z$_]*",Yn=["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","using"],Xn=["true","false","null","undefined","NaN","Infinity"],vt=["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"],kt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ot=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Qn=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Jn=[].concat(Ot,vt,kt);function jn(e){const n=e.regex,i=(L,{after:re})=>{const pe="</"+L[0].slice(1);return L.input.indexOf(pe,re)!==-1},r=At,s={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,g={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,re)=>{const pe=L[0].length+L.index,le=L.input[pe];if(le==="<"||le===","){re.ignoreMatch();return}le===">"&&(i(L,{after:pe})||re.ignoreMatch());let ae;const Ce=L.input.substring(pe);if(ae=Ce.match(/^\s*=/)){re.ignoreMatch();return}if((ae=Ce.match(/^\s+extends\s+/))&&ae.index===0){re.ignoreMatch();return}}},d={$pattern:At,keyword:Yn,literal:Xn,built_in:Jn,"variable.language":Qn},p="[0-9](_?[0-9])*",c=`\\.(${p})`,a="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",l={className:"number",variants:[{begin:`(\\b(${a})((${c})|\\.)?|(${c}))[eE][+-]?(${p})\\b`},{begin:`\\b(${a})\\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},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},_={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},T={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]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,y,h,f,{match:/\$\d+/},l];m.contains=R.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(R)});const A=[].concat(T,m.contains),M=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(A)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:M},G={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,n.concat(r,"(",n.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},V={relevance:0,match:n.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:{_:[...vt,...kt]}},K={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ce={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},be={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ge(L){return n.concat("(?!",L.join("|"),")")}const me={match:n.concat(/\b/,ge([...Ot,"super","import"].map(L=>`${L}\\s*\\(`)),r,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:n.concat(/\./,n.lookahead(n.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Q={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},ne="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ie={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(ne)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:V},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),K,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,y,h,f,T,{match:/\$\d+/},l,V,{scope:"attr",match:r+n.lookahead(":"),relevance:0},ie,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,e.REGEXP_MODE,{className:"function",begin:ne,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:u},{begin:g.begin,"on:begin":g.isTrulyOpeningTag,end:g.end}],subLanguage:"xml",contains:[{begin:g.begin,end:g.end,skip:!0,contains:["self"]}]}]},ce,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},me,be,G,Q,{match:/\$[(.]/}]}}function ei(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},i={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[n,i,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Oe="[0-9](_*[0-9])*",He=`\\.(${Oe})`,$e="[0-9a-fA-F](_*[0-9a-fA-F])*",ti={className:"number",variants:[{begin:`(\\b(${Oe})((${He})|\\.)?|(${He}))[eE][+-]?(${Oe})[fFdD]?\\b`},{begin:`\\b(${Oe})((${He})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${He})[fFdD]?\\b`},{begin:`\\b(${Oe})[fFdD]\\b`},{begin:`\\b0[xX]((${$e})\\.?|(${$e})?\\.(${$e}))[pP][+-]?(${Oe})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${$e})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ni(e){const n={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},i={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},u={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},g={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[u,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,u,s]}]};s.contains.push(g);const d={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},p={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(g,{className:"string"}),"self"]}]},c=ti,a=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),l={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=l;return m.variants[1].contains=[l],l.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:n,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,a,i,r,d,p,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[l,e.C_LINE_COMMENT_MODE,a],relevance:0},e.C_LINE_COMMENT_MODE,a,d,p,g,e.C_NUMBER_MODE]},a]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},d,p]},g,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
2
|
-
`},c]}}const ii=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_-]*/}}),oi=["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","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ri=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ai=[...oi,...ri],si=["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"].sort().reverse(),Mt=["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"].sort().reverse(),Rt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ci=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","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-end-end-radius","border-end-start-radius","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-start-end-radius","border-start-start-radius","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-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","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","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","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","margin-trim","marker","marker-end","marker-mid","marker-start","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","masonry-auto-flow","math-depth","math-shift","math-style","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","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-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","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","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","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),li=Mt.concat(Rt).sort().reverse();function di(e){const n=ii(e),i=li,r="and or not only",s="[\\w-]+",u="("+s+"|@\\{"+s+"\\})",g=[],d=[],p=function(R){return{className:"string",begin:"~?"+R+".*?"+R}},c=function(R,A,M){return{className:R,begin:A,relevance:M}},a={$pattern:/[a-z-]+/,keyword:r,attribute:si.join(" ")},l={begin:"\\(",end:"\\)",contains:d,keywords:a,relevance:0};d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p("'"),p('"'),n.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},n.HEXCOLOR,l,c("variable","@@?"+s,10),c("variable","@\\{"+s+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:s+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},n.IMPORTANT,{beginKeywords:"and not"},n.FUNCTION_DISPATCH);const m=d.concat({begin:/\{/,end:/\}/,contains:g}),_={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(d)},y={begin:u+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ci.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:d}}]},h={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:a,returnEnd:!0,contains:d,relevance:0}},f={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:m}},N={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:u,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_,c("keyword","all\\b"),c("variable","@\\{"+s+"\\}"),{begin:"\\b("+ai.join("|")+")\\b",className:"selector-tag"},n.CSS_NUMBER_MODE,c("selector-tag",u,0),c("selector-id","#"+u),c("selector-class","\\."+u,0),c("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Mt.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Rt.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},n.FUNCTION_DISPATCH]},T={begin:s+`:(:)?(${i.join("|")})`,returnBegin:!0,contains:[N]};return g.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,f,T,y,N,_,n.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:g}}function ui(e){const n="\\[=*\\[",i="\\]=*\\]",r={begin:n,end:i,contains:["self"]},s=[e.COMMENT("--(?!"+n+")","$"),e.COMMENT("--"+n,i,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],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:s.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:s}].concat(s)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:n,end:i,contains:[r],relevance:5}])}}function pi(e){const n={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},i={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n]},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:[n,i]},s={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},u={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},g={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[n]};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,n,i,r,s,u,g]}}function gi(e){const n=e.regex,i={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},u={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},g={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},d=/[A-Za-z][A-Za-z0-9+.-]*/,p={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,d,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},a={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},l=e.inherit(c,{contains:[]}),m=e.inherit(a,{contains:[]});c.contains.push(m),a.contains.push(l);let _=[i,p];return[c,a,l,m].forEach(N=>{N.contains=N.contains.concat(_)}),_=_.concat(c,a),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:_},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:_}]}]},i,u,c,a,{className:"quote",begin:"^>\\s+",contains:_,end:"$"},s,r,p,g,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function bi(e){const n={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+"},i=/[a-zA-Z@][a-zA-Z0-9_]*/,d={"variable.language":["this","super"],$pattern:i,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"]},p={$pattern:i,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:d,illegal:"</",contains:[n,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:"("+p.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:p,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function mi(e){const n=e.regex,i=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","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","field","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","method","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}/,s={$pattern:/[\w.]+/,keyword:i.join(" ")},u={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},g={begin:/->\{/,end:/\}/},d={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},p={scope:"variable",variants:[{begin:/\$\d/},{begin:n.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[d]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},a=[e.BACKSLASH_ESCAPE,u,p],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],m=(h,f,N="\\1")=>{const T=N==="\\1"?N:n.concat(N,f);return n.concat(n.concat("(?:",h,")"),f,/(?:\\.|[^\\\/])*?/,T,/(?:\\.|[^\\\/])*?/,N,r)},_=(h,f,N)=>n.concat(n.concat("(?:",h,")"),f,/(?:\\.|[^\\\/])*?/,N,r),y=[p,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),g,{className:"string",contains:a,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}]},c,{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:m("s|tr|y",n.either(...l,{capture:!0}))},{begin:m("s|tr|y","\\(","\\)")},{begin:m("s|tr|y","\\[","\\]")},{begin:m("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:_("(?:m|qr)?",/\//,/\//)},{begin:_("m|qr",n.either(...l,{capture:!0}),/\1/)},{begin:_("m|qr",/\(/,/\)/)},{begin:_("m|qr",/\[/,/\]/)},{begin:_("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,d]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,d,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return u.contains=y,g.contains=y,{name:"Perl",aliases:["pl","pm"],keywords:s,contains:y}}function fi(e){const n=e.regex,i=/(?![A-Za-z0-9])(?![$])/,r=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,i),s=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,i),u=n.concat(/[A-Z]+/,i),g={scope:"variable",match:"\\$+"+r},d={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},p={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),a=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(p)}),l={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(p),"on:begin":(Y,Q)=>{Q.data._beginMatch=Y[1]||Y[2]},"on:end":(Y,Q)=>{Q.data._beginMatch!==Y[1]&&Q.ignoreMatch()}},m=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),_=`[
|
|
3
|
-
]`,y={scope:"string",variants:[a,c,l,m]},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},f=["false","null","true"],N=["__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"],T=["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"],A={keyword:N,literal:(Y=>{const Q=[];return Y.forEach(ne=>{Q.push(ne),ne.toLowerCase()===ne?Q.push(ne.toUpperCase()):Q.push(ne.toLowerCase())}),Q})(f),built_in:T},M=Y=>Y.map(Q=>Q.replace(/\|\d+$/,"")),I={variants:[{match:[/new/,n.concat(_,"+"),n.concat("(?!",M(T).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},G=n.concat(r,"\\b(?!\\()"),V={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),G],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,n.concat(/::/,n.lookahead(/(?!class\b)/)),G],scope:{1:"title.class",3:"variable.constant"}},{match:[s,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},K={scope:"attr",match:n.concat(r,n.lookahead(":"),n.lookahead(/(?!::)/))},ce={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[K,g,V,e.C_BLOCK_COMMENT_MODE,y,h,I]},be={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",M(N).join("\\b|"),"|",M(T).join("\\b|"),"\\b)"),r,n.concat(_,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[ce]};ce.contains.push(be);const ge=[K,V,e.C_BLOCK_COMMENT_MODE,y,h,I],me={begin:n.concat(/#\[\s*\\?/,n.either(s,u)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:f,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:f,keyword:["new","array"]},contains:["self",...ge]},...ge,{scope:"meta",variants:[{match:s},{match:u}]}]};return{case_insensitive:!1,keywords:A,contains:[me,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}]}},d,{scope:"variable.language",match:/\$this\b/},g,be,V,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},I,{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:A,contains:["self",me,g,V,e.C_BLOCK_COMMENT_MODE,y,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]},y,h]}}function _i(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})]}]}}function Ei(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function hi(e){const n=e.regex,i=new RegExp("[\\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"],d={$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"]},p={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:d,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,p],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,p],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,p,a,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,p,a,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,a,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",_=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,y=`\\b|${r.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${_}))[eE][+-]?(${m})[jJ]?(?=${y})`},{begin:`(${_})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${m})[jJ](?=${y})`}]},f={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:d,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},N={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:["self",p,h,l,e.HASH_COMMENT_MODE]}]};return c.contains=[l,h,p],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:d,illegal:/(<\/|\?)|=>/,contains:[p,h,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},l,f,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[N]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,N,l]}]}}function Ni(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Ci(e){const n=e.regex,i=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=n.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]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,u=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:i,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:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:i},{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:[s,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[u,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[i,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:u},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function wi(e){const n=e.regex,i="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=n.concat(r,/(::\w+)*/),g={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},d={className:"doctag",begin:"@[A-Za-z]+"},p={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[d]}),e.COMMENT("^=begin","^=end",{contains:[d],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],a={className:"subst",begin:/#\{/,end:/\}/,keywords:g},l={className:"string",contains:[e.BACKSLASH_ESCAPE,a],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,a]})]}]},m="[1-9](_?[0-9])*|0",_="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${_}))?([eE][+-]?(${_})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:g}]},I=[l,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:g},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:g},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[l,{begin:i}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:g},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,a],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(p,c),relevance:0}].concat(p,c);a.contains=I,h.contains=I;const ce=[{begin:/^\s*=>/,starts:{end:"$",contains:I}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:g,contains:I}}];return c.unshift(p),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:g,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(ce).concat(c).concat(I)}}function yi(e){const n=e.regex,i=/(r#)?/,r=n.concat(i,e.UNDERSCORE_IDENT_RE),s=n.concat(i,e.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,n.lookahead(/\s*\(/))},g="([ui](8|16|32|64|128|size)|f(32|64))?",d=["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","union","unsafe","unsized","use","virtual","where","while","yield"],p=["true","false","Some","None","Ok","Err"],c=["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!","eprintln!","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:d,literal:p,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+g},{begin:"\\b0o([0-7_]+)"+g},{begin:"\\b0x([A-Fa-f0-9_]+)"+g},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+g}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:a}},{className:"punctuation",begin:"->"},u]}}const Ti=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_-]*/}}),Si=["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","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Ai=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],vi=[...Si,...Ai],ki=["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"].sort().reverse(),Oi=["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"].sort().reverse(),Mi=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ri=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","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-end-end-radius","border-end-start-radius","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-start-end-radius","border-start-start-radius","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-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","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","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","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","margin-trim","marker","marker-end","marker-mid","marker-start","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","masonry-auto-flow","math-depth","math-shift","math-style","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","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-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","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","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","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function xi(e){const n=Ti(e),i=Mi,r=Oi,s="@[a-z-]+",u="and or not only",d={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,n.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+vi.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+i.join("|")+")"},d,{begin:/\(/,end:/\)/,contains:[n.CSS_NUMBER_MODE]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ri.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:[n.BLOCK_COMMENT,d,n.HEXCOLOR,n.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.IMPORTANT,n.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:u,attribute:ki.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},d,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.HEXCOLOR,n.CSS_NUMBER_MODE]},n.FUNCTION_DISPATCH]}}function Ii(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Li(e){const n=e.regex,i=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],g=["double precision","large object","with timezone","without timezone"],d=["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"],p=["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"],a=["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"],l=["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"],m=["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"],_=a,y=[...c,...p].filter(M=>!a.includes(M)),h={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},f={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},N={match:n.concat(/\b/,n.either(..._),/\s*\(/),relevance:0,keywords:{built_in:_}};function T(M){return n.concat(/\b/,n.either(...M.map(I=>I.replace(/\s+/,"\\s+"))),/\b/)}const R={scope:"keyword",match:T(m),relevance:0};function A(M,{exceptions:I,when:G}={}){const V=G;return I=I||[],M.map(K=>K.match(/\|\d+$/)||I.includes(K)?K:V(K)?`${K}|0`:K)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(y,{when:M=>M.length<3}),literal:u,type:d,built_in:l},contains:[{scope:"type",match:T(g)},R,N,h,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,i,f]}}function xt(e){return e?typeof e=="string"?e:e.source:null}function De(e){return $("(?=",e,")")}function $(...e){return e.map(i=>xt(i)).join("")}function Di(e){const n=e[e.length-1];return typeof n=="object"&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}function ue(...e){return"("+(Di(e).capture?"":"?:")+e.map(r=>xt(r)).join("|")+")"}const tt=e=>$(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Bi=["Protocol","Type"].map(tt),It=["init","self"].map(tt),Ui=["Any","Self"],nt=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","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","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","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"],Lt=["false","nil","true"],Pi=["assignment","associativity","higherThan","left","lowerThan","none","right"],Fi=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Dt=["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"],Bt=ue(/[/=\-+!*%<>&|^~?]/,/[\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]/),Ut=ue(Bt,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),it=$(Bt,Ut,"*"),Pt=ue(/[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]/),ze=ue(Pt,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ee=$(Pt,ze,"*"),Ge=$(/[A-Z]/,ze,"*"),Vi=["attached","autoclosure",$(/convention\(/,ue("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",$(/objc\(/,Ee,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Hi=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function $i(e){const n={match:/\s+/,relevance:0},i=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,i],s={match:[/\./,ue(...Bi,...It)],className:{2:"keyword"}},u={match:$(/\./,ue(...nt)),relevance:0},g=nt.filter(z=>typeof z=="string").concat(["_|0"]),d=nt.filter(z=>typeof z!="string").concat(Ui).map(tt),p={variants:[{className:"keyword",match:ue(...d,...It)}]},c={$pattern:ue(/\b\w+/,/#\w+/),keyword:g.concat(Fi),literal:Lt},a=[s,u,p],l={match:$(/\./,ue(...Dt)),relevance:0},m={className:"built_in",match:$(/\b/,ue(...Dt),/(?=\()/)},_=[l,m],y={match:/->/,relevance:0},h={className:"operator",relevance:0,variants:[{match:it},{match:`\\.(\\.|${Ut})+`}]},f=[y,h],N="([0-9]_*)+",T="([0-9a-fA-F]_*)+",R={className:"number",relevance:0,variants:[{match:`\\b(${N})(\\.(${N}))?([eE][+-]?(${N}))?\\b`},{match:`\\b0x(${T})(\\.(${T}))?([pP][+-]?(${N}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(z="")=>({className:"subst",variants:[{match:$(/\\/,z,/[0\\tnr"']/)},{match:$(/\\/,z,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(z="")=>({className:"subst",match:$(/\\/,z,/[\t ]*(?:[\r\n]|\r\n)/)}),I=(z="")=>({className:"subst",label:"interpol",begin:$(/\\/,z,/\(/),end:/\)/}),G=(z="")=>({begin:$(z,/"""/),end:$(/"""/,z),contains:[A(z),M(z),I(z)]}),V=(z="")=>({begin:$(z,/"/),end:$(/"/,z),contains:[A(z),I(z)]}),K={className:"string",variants:[G(),G("#"),G("##"),G("###"),V(),V("#"),V("##"),V("###")]},ce=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],be={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:ce},ge=z=>{const Re=$(z,/\//),Se=$(/\//,z);return{begin:Re,end:Se,contains:[...ce,{scope:"comment",begin:`#(?!.*${Se})`,end:/$/}]}},me={scope:"regexp",variants:[ge("###"),ge("##"),ge("#"),be]},Y={match:$(/`/,Ee,/`/)},Q={className:"variable",match:/\$\d+/},ne={className:"variable",match:`\\$${ze}+`},ie=[Y,Q,ne],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Hi,contains:[...f,R,K]}]}},re={scope:"keyword",match:$(/@/,ue(...Vi),De(ue(/\(/,/\s+/)))},pe={scope:"meta",match:$(/@/,Ee)},le=[L,re,pe],ae={match:De(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:$(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,ze,"+")},{className:"type",match:Ge,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:$(/\s+&\s+/,De(Ge)),relevance:0}]},Ce={begin:/</,end:/>/,keywords:c,contains:[...r,...a,...le,y,ae]};ae.contains.push(Ce);const rt={match:$(Ee,/\s*:/),keywords:"_|0",relevance:0},qe={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",rt,...r,me,...a,..._,...f,R,K,...ie,...le,ae]},Be={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,ae]},at={begin:ue(De($(Ee,/\s*:/)),De($(Ee,/\s+/,Ee,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ee}]},We={begin:/\(/,end:/\)/,keywords:c,contains:[at,...r,...a,...f,R,K,...le,ae,qe],endsParent:!0,illegal:/["']/},on={match:[/(func|macro)/,/\s+/,ue(Y.match,Ee,it)],className:{1:"keyword",3:"title.function"},contains:[Be,We,n],illegal:[/\[/,/%/]},Me={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Be,We,n],illegal:/\[|%/},st={match:[/operator/,/\s+/,it],className:{1:"keyword",3:"title"}},ct={begin:[/precedencegroup/,/\s+/,Ge],className:{1:"keyword",3:"title"},contains:[ae],keywords:[...Pi,...Lt],end:/}/},lt={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},dt={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ut={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ee,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[Be,...a,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Ge},...a],relevance:0}]};for(const z of K.variants){const Re=z.contains.find(pt=>pt.label==="interpol");Re.keywords=c;const Se=[...a,..._,...f,R,K,...ie];Re.contains=[...Se,{begin:/\(/,end:/\)/,contains:["self",...Se]}]}return{name:"Swift",keywords:c,contains:[...r,on,Me,lt,dt,ut,st,ct,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},me,...a,..._,...f,R,K,...ie,...le,ae,qe]}}const Ke="[A-Za-z$_][0-9A-Za-z$_]*",Ft=["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","using"],Vt=["true","false","null","undefined","NaN","Infinity"],Ht=["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"],$t=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],zt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Gt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Kt=[].concat(zt,Ht,$t);function zi(e){const n=e.regex,i=(L,{after:re})=>{const pe="</"+L[0].slice(1);return L.input.indexOf(pe,re)!==-1},r=Ke,s={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,g={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,re)=>{const pe=L[0].length+L.index,le=L.input[pe];if(le==="<"||le===","){re.ignoreMatch();return}le===">"&&(i(L,{after:pe})||re.ignoreMatch());let ae;const Ce=L.input.substring(pe);if(ae=Ce.match(/^\s*=/)){re.ignoreMatch();return}if((ae=Ce.match(/^\s+extends\s+/))&&ae.index===0){re.ignoreMatch();return}}},d={$pattern:Ke,keyword:Ft,literal:Vt,built_in:Kt,"variable.language":Gt},p="[0-9](_?[0-9])*",c=`\\.(${p})`,a="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",l={className:"number",variants:[{begin:`(\\b(${a})((${c})|\\.)?|(${c}))[eE][+-]?(${p})\\b`},{begin:`\\b(${a})\\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},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},_={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},T={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]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,y,h,f,{match:/\$\d+/},l];m.contains=R.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(R)});const A=[].concat(T,m.contains),M=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(A)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:M},G={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,n.concat(r,"(",n.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},V={relevance:0,match:n.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:{_:[...Ht,...$t]}},K={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ce={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},be={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ge(L){return n.concat("(?!",L.join("|"),")")}const me={match:n.concat(/\b/,ge([...zt,"super","import"].map(L=>`${L}\\s*\\(`)),r,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:n.concat(/\./,n.lookahead(n.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Q={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},ne="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ie={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(ne)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:V},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),K,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,_,y,h,f,T,{match:/\$\d+/},l,V,{scope:"attr",match:r+n.lookahead(":"),relevance:0},ie,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,e.REGEXP_MODE,{className:"function",begin:ne,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:u},{begin:g.begin,"on:begin":g.isTrulyOpeningTag,end:g.end}],subLanguage:"xml",contains:[{begin:g.begin,end:g.end,skip:!0,contains:["self"]}]}]},ce,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},me,be,G,Q,{match:/\$[(.]/}]}}function Gi(e){const n=e.regex,i=zi(e),r=Ke,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],u={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},g={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[i.exports.CLASS_REFERENCE]},d={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},p=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Ke,keyword:Ft.concat(p),literal:Vt,built_in:Kt.concat(s),"variable.language":Gt},a={className:"meta",begin:"@"+r},l=(h,f,N)=>{const T=h.contains.findIndex(R=>R.label===f);if(T===-1)throw new Error("can not find mode to replace");h.contains.splice(T,1,N)};Object.assign(i.keywords,c),i.exports.PARAMS_CONTAINS.push(a);const m=i.contains.find(h=>h.scope==="attr"),_=Object.assign({},m,{match:n.concat(r,n.lookahead(/\s*\?:/))});i.exports.PARAMS_CONTAINS.push([i.exports.CLASS_REFERENCE,m,_]),i.contains=i.contains.concat([a,u,g,_]),l(i,"shebang",e.SHEBANG()),l(i,"use_strict",d);const y=i.contains.find(h=>h.label==="func.def");return y.relevance=0,Object.assign(i,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),i}function Ki(e){const n=e.regex,i={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,u=/\d{4}-\d{1,2}-\d{1,2}/,g=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,d=/\d{1,2}(:\d{1,2}){1,2}/,p={className:"literal",variants:[{begin:n.concat(/# */,n.either(u,s),/ *#/)},{begin:n.concat(/# */,d,/ *#/)},{begin:n.concat(/# */,g,/ *#/)},{begin:n.concat(/# */,n.either(u,s),/ +/,n.either(g,d),/ *#/)}]},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])|[%&])?/}]},a={className:"label",begin:/^\w+:/},l=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=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:[i,r,p,c,a,l,m,{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:[m]}]}}function Zi(e){e.regex;const n=e.COMMENT(/\(;/,/;\)/);n.contains.push("self");const i=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"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},u={className:"variable",begin:/\$[\w_]+/},g={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},d={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/},p={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:[i,n,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},u,g,s,e.QUOTE_STRING_MODE,p,c,d]}}function qi(e){const n=e.regex,i=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},g=e.inherit(u,{begin:/\(/,end:/\)/}),d=e.inherit(e.APOS_STRING_MODE,{className:"string"}),p=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[u,p,d,g,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,g,p,d]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[p]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(i,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:i,relevance:0,starts:c}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(i,/>/))),contains:[{className:"name",begin:i,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Wi(e){const n="true false yes no null",i="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},u={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},g={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},d=e.inherit(g,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={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"},_={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},y={begin:/\{/,end:/\}/,contains:[_],illegal:"\\n",relevance:0},h={begin:"\\[",end:"\\]",contains:[_],illegal:"\\n",relevance:0},f=[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+!"+i},{className:"type",begin:"!<"+i+">"},{className:"type",begin:"!"+i},{className:"type",begin:"!!"+i},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},m,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},y,h,u,g],N=[...f];return N.pop(),N.push(d),_.contains=N,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:f}}const Yi={arduino:Mn,bash:Rn,c:xn,cpp:In,csharp:Ln,css:zn,diff:Gn,go:Kn,graphql:Zn,ini:qn,java:Wn,javascript:jn,json:ei,kotlin:ni,less:di,lua:ui,makefile:pi,markdown:gi,objectivec:bi,perl:mi,php:fi,"php-template":_i,plaintext:Ei,python:hi,"python-repl":Ni,r:Ci,ruby:wi,rust:yi,scss:xi,shell:Ii,sql:Li,swift:$i,typescript:Gi,vbnet:Ki,wasm:Zi,xml:qi,yaml:Wi};function Xi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ot,Zt;function Qi(){if(Zt)return ot;Zt=1;function e(o){return o instanceof Map?o.clear=o.delete=o.set=function(){throw new Error("map is read-only")}:o instanceof Set&&(o.add=o.clear=o.delete=function(){throw new Error("set is read-only")}),Object.freeze(o),Object.getOwnPropertyNames(o).forEach(b=>{const C=o[b],D=typeof C;(D==="object"||D==="function")&&!Object.isFrozen(C)&&e(C)}),o}class n{constructor(b){b.data===void 0&&(b.data={}),this.data=b.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(o){return o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(o,...b){const C=Object.create(null);for(const D in o)C[D]=o[D];return b.forEach(function(D){for(const J in D)C[J]=D[J]}),C}const s="</span>",u=o=>!!o.scope,g=(o,{prefix:b})=>{if(o.startsWith("language:"))return o.replace("language:","language-");if(o.includes(".")){const C=o.split(".");return[`${b}${C.shift()}`,...C.map((D,J)=>`${D}${"_".repeat(J+1)}`)].join(" ")}return`${b}${o}`};class d{constructor(b,C){this.buffer="",this.classPrefix=C.classPrefix,b.walk(this)}addText(b){this.buffer+=i(b)}openNode(b){if(!u(b))return;const C=g(b.scope,{prefix:this.classPrefix});this.span(C)}closeNode(b){u(b)&&(this.buffer+=s)}value(){return this.buffer}span(b){this.buffer+=`<span class="${b}">`}}const p=(o={})=>{const b={children:[]};return Object.assign(b,o),b};class c{constructor(){this.rootNode=p(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(b){this.top.children.push(b)}openNode(b){const C=p({scope:b});this.add(C),this.stack.push(C)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(b){return this.constructor._walk(b,this.rootNode)}static _walk(b,C){return typeof C=="string"?b.addText(C):C.children&&(b.openNode(C),C.children.forEach(D=>this._walk(b,D)),b.closeNode(C)),b}static _collapse(b){typeof b!="string"&&b.children&&(b.children.every(C=>typeof C=="string")?b.children=[b.children.join("")]:b.children.forEach(C=>{c._collapse(C)}))}}class a extends c{constructor(b){super(),this.options=b}addText(b){b!==""&&this.add(b)}startScope(b){this.openNode(b)}endScope(){this.closeNode()}__addSublanguage(b,C){const D=b.root;C&&(D.scope=`language:${C}`),this.add(D)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function l(o){return o?typeof o=="string"?o:o.source:null}function m(o){return h("(?=",o,")")}function _(o){return h("(?:",o,")*")}function y(o){return h("(?:",o,")?")}function h(...o){return o.map(C=>l(C)).join("")}function f(o){const b=o[o.length-1];return typeof b=="object"&&b.constructor===Object?(o.splice(o.length-1,1),b):{}}function N(...o){return"("+(f(o).capture?"":"?:")+o.map(D=>l(D)).join("|")+")"}function T(o){return new RegExp(o.toString()+"|").exec("").length-1}function R(o,b){const C=o&&o.exec(b);return C&&C.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(o,{joinWith:b}){let C=0;return o.map(D=>{C+=1;const J=C;let j=l(D),v="";for(;j.length>0;){const S=A.exec(j);if(!S){v+=j;break}v+=j.substring(0,S.index),j=j.substring(S.index+S[0].length),S[0][0]==="\\"&&S[1]?v+="\\"+String(Number(S[1])+J):(v+=S[0],S[0]==="("&&C++)}return v}).map(D=>`(${D})`).join(b)}const I=/\b\B/,G="[a-zA-Z]\\w*",V="[a-zA-Z_]\\w*",K="\\b\\d+(\\.\\d+)?",ce="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",be="\\b(0b[01]+)",ge="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",me=(o={})=>{const b=/^#![ ]*\//;return o.binary&&(o.begin=h(b,/.*\b/,o.binary,/\b.*/)),r({scope:"meta",begin:b,end:/$/,relevance:0,"on:begin":(C,D)=>{C.index!==0&&D.ignoreMatch()}},o)},Y={begin:"\\\\[\\s\\S]",relevance:0},Q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Y]},ne={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Y]},ie={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},L=function(o,b,C={}){const D=r({scope:"comment",begin:o,end:b,contains:[]},C);D.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const J=N("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return D.contains.push({begin:h(/[ ]+/,"(",J,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),D},re=L("//","$"),pe=L("/\\*","\\*/"),le=L("#","$"),ae={scope:"number",begin:K,relevance:0},Ce={scope:"number",begin:ce,relevance:0},rt={scope:"number",begin:be,relevance:0},qe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Y,{begin:/\[/,end:/\]/,relevance:0,contains:[Y]}]},Be={scope:"title",begin:G,relevance:0},at={scope:"title",begin:V,relevance:0},We={begin:"\\.\\s*"+V,relevance:0};var Me=Object.freeze({__proto__:null,APOS_STRING_MODE:Q,BACKSLASH_ESCAPE:Y,BINARY_NUMBER_MODE:rt,BINARY_NUMBER_RE:be,COMMENT:L,C_BLOCK_COMMENT_MODE:pe,C_LINE_COMMENT_MODE:re,C_NUMBER_MODE:Ce,C_NUMBER_RE:ce,END_SAME_AS_BEGIN:function(o){return Object.assign(o,{"on:begin":(b,C)=>{C.data._beginMatch=b[1]},"on:end":(b,C)=>{C.data._beginMatch!==b[1]&&C.ignoreMatch()}})},HASH_COMMENT_MODE:le,IDENT_RE:G,MATCH_NOTHING_RE:I,METHOD_GUARD:We,NUMBER_MODE:ae,NUMBER_RE:K,PHRASAL_WORDS_MODE:ie,QUOTE_STRING_MODE:ne,REGEXP_MODE:qe,RE_STARTERS_RE:ge,SHEBANG:me,TITLE_MODE:Be,UNDERSCORE_IDENT_RE:V,UNDERSCORE_TITLE_MODE:at});function st(o,b){o.input[o.index-1]==="."&&b.ignoreMatch()}function ct(o,b){o.className!==void 0&&(o.scope=o.className,delete o.className)}function lt(o,b){b&&o.beginKeywords&&(o.begin="\\b("+o.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",o.__beforeBegin=st,o.keywords=o.keywords||o.beginKeywords,delete o.beginKeywords,o.relevance===void 0&&(o.relevance=0))}function dt(o,b){Array.isArray(o.illegal)&&(o.illegal=N(...o.illegal))}function ut(o,b){if(o.match){if(o.begin||o.end)throw new Error("begin & end are not supported with match");o.begin=o.match,delete o.match}}function z(o,b){o.relevance===void 0&&(o.relevance=1)}const Re=(o,b)=>{if(!o.beforeMatch)return;if(o.starts)throw new Error("beforeMatch cannot be used with starts");const C=Object.assign({},o);Object.keys(o).forEach(D=>{delete o[D]}),o.keywords=C.keywords,o.begin=h(C.beforeMatch,m(C.begin)),o.starts={relevance:0,contains:[Object.assign(C,{endsParent:!0})]},o.relevance=0,delete C.beforeMatch},Se=["of","and","for","in","not","or","if","then","parent","list","value"],pt="keyword";function rn(o,b,C=pt){const D=Object.create(null);return typeof o=="string"?J(C,o.split(" ")):Array.isArray(o)?J(C,o):Object.keys(o).forEach(function(j){Object.assign(D,rn(o[j],b,j))}),D;function J(j,v){b&&(v=v.map(S=>S.toLowerCase())),v.forEach(function(S){const x=S.split("|");D[x[0]]=[j,or(x[0],x[1])]})}}function or(o,b){return b?Number(b):rr(o)?0:1}function rr(o){return Se.includes(o.toLowerCase())}const an={},Ae=o=>{console.error(o)},sn=(o,...b)=>{console.log(`WARN: ${o}`,...b)},xe=(o,b)=>{an[`${o}/${b}`]||(console.log(`Deprecated as of ${o}. ${b}`),an[`${o}/${b}`]=!0)},Ye=new Error;function cn(o,b,{key:C}){let D=0;const J=o[C],j={},v={};for(let S=1;S<=b.length;S++)v[S+D]=J[S],j[S+D]=!0,D+=T(b[S-1]);o[C]=v,o[C]._emit=j,o[C]._multi=!0}function ar(o){if(Array.isArray(o.begin)){if(o.skip||o.excludeBegin||o.returnBegin)throw Ae("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ye;if(typeof o.beginScope!="object"||o.beginScope===null)throw Ae("beginScope must be object"),Ye;cn(o,o.begin,{key:"beginScope"}),o.begin=M(o.begin,{joinWith:""})}}function sr(o){if(Array.isArray(o.end)){if(o.skip||o.excludeEnd||o.returnEnd)throw Ae("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ye;if(typeof o.endScope!="object"||o.endScope===null)throw Ae("endScope must be object"),Ye;cn(o,o.end,{key:"endScope"}),o.end=M(o.end,{joinWith:""})}}function cr(o){o.scope&&typeof o.scope=="object"&&o.scope!==null&&(o.beginScope=o.scope,delete o.scope)}function lr(o){cr(o),typeof o.beginScope=="string"&&(o.beginScope={_wrap:o.beginScope}),typeof o.endScope=="string"&&(o.endScope={_wrap:o.endScope}),ar(o),sr(o)}function dr(o){function b(v,S){return new RegExp(l(v),"m"+(o.case_insensitive?"i":"")+(o.unicodeRegex?"u":"")+(S?"g":""))}class C{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(S,x){x.position=this.position++,this.matchIndexes[this.matchAt]=x,this.regexes.push([x,S]),this.matchAt+=T(S)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const S=this.regexes.map(x=>x[1]);this.matcherRe=b(M(S,{joinWith:"|"}),!0),this.lastIndex=0}exec(S){this.matcherRe.lastIndex=this.lastIndex;const x=this.matcherRe.exec(S);if(!x)return null;const oe=x.findIndex((Ue,bt)=>bt>0&&Ue!==void 0),ee=this.matchIndexes[oe];return x.splice(0,oe),Object.assign(x,ee)}}class D{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(S){if(this.multiRegexes[S])return this.multiRegexes[S];const x=new C;return this.rules.slice(S).forEach(([oe,ee])=>x.addRule(oe,ee)),x.compile(),this.multiRegexes[S]=x,x}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(S,x){this.rules.push([S,x]),x.type==="begin"&&this.count++}exec(S){const x=this.getMatcher(this.regexIndex);x.lastIndex=this.lastIndex;let oe=x.exec(S);if(this.resumingScanAtSamePosition()&&!(oe&&oe.index===this.lastIndex)){const ee=this.getMatcher(0);ee.lastIndex=this.lastIndex+1,oe=ee.exec(S)}return oe&&(this.regexIndex+=oe.position+1,this.regexIndex===this.count&&this.considerAll()),oe}}function J(v){const S=new D;return v.contains.forEach(x=>S.addRule(x.begin,{rule:x,type:"begin"})),v.terminatorEnd&&S.addRule(v.terminatorEnd,{type:"end"}),v.illegal&&S.addRule(v.illegal,{type:"illegal"}),S}function j(v,S){const x=v;if(v.isCompiled)return x;[ct,ut,lr,Re].forEach(ee=>ee(v,S)),o.compilerExtensions.forEach(ee=>ee(v,S)),v.__beforeBegin=null,[lt,dt,z].forEach(ee=>ee(v,S)),v.isCompiled=!0;let oe=null;return typeof v.keywords=="object"&&v.keywords.$pattern&&(v.keywords=Object.assign({},v.keywords),oe=v.keywords.$pattern,delete v.keywords.$pattern),oe=oe||/\w+/,v.keywords&&(v.keywords=rn(v.keywords,o.case_insensitive)),x.keywordPatternRe=b(oe,!0),S&&(v.begin||(v.begin=/\B|\b/),x.beginRe=b(x.begin),!v.end&&!v.endsWithParent&&(v.end=/\B|\b/),v.end&&(x.endRe=b(x.end)),x.terminatorEnd=l(x.end)||"",v.endsWithParent&&S.terminatorEnd&&(x.terminatorEnd+=(v.end?"|":"")+S.terminatorEnd)),v.illegal&&(x.illegalRe=b(v.illegal)),v.contains||(v.contains=[]),v.contains=[].concat(...v.contains.map(function(ee){return ur(ee==="self"?v:ee)})),v.contains.forEach(function(ee){j(ee,x)}),v.starts&&j(v.starts,S),x.matcher=J(x),x}if(o.compilerExtensions||(o.compilerExtensions=[]),o.contains&&o.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return o.classNameAliases=r(o.classNameAliases||{}),j(o)}function ln(o){return o?o.endsWithParent||ln(o.starts):!1}function ur(o){return o.variants&&!o.cachedVariants&&(o.cachedVariants=o.variants.map(function(b){return r(o,{variants:null},b)})),o.cachedVariants?o.cachedVariants:ln(o)?r(o,{starts:o.starts?r(o.starts):null}):Object.isFrozen(o)?r(o):o}var pr="11.11.1";class gr extends Error{constructor(b,C){super(b),this.name="HTMLInjectionError",this.html=C}}const gt=i,dn=r,un=Symbol("nomatch"),br=7,pn=function(o){const b=Object.create(null),C=Object.create(null),D=[];let J=!0;const j="Could not find the language '{}', did you forget to load/include a language module?",v={disableAutodetect:!0,name:"Plain text",contains:[]};let S={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:a};function x(E){return S.noHighlightRe.test(E)}function oe(E){let O=E.className+" ";O+=E.parentNode?E.parentNode.className:"";const P=S.languageDetectRe.exec(O);if(P){const Z=ye(P[1]);return Z||(sn(j.replace("{}",P[1])),sn("Falling back to no-highlight mode for this block.",E)),Z?P[1]:"no-highlight"}return O.split(/\s+/).find(Z=>x(Z)||ye(Z))}function ee(E,O,P){let Z="",te="";typeof O=="object"?(Z=E,P=O.ignoreIllegals,te=O.language):(xe("10.7.0","highlight(lang, code, ...args) has been deprecated."),xe("10.7.0",`Please use highlight(code, options) instead.
|
|
4
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),te=E,Z=O),P===void 0&&(P=!0);const _e={code:Z,language:te};Qe("before:highlight",_e);const Te=_e.result?_e.result:Ue(_e.language,_e.code,P);return Te.code=_e.code,Qe("after:highlight",Te),Te}function Ue(E,O,P,Z){const te=Object.create(null);function _e(w,k){return w.keywords[k]}function Te(){if(!B.keywords){se.addText(q);return}let w=0;B.keywordPatternRe.lastIndex=0;let k=B.keywordPatternRe.exec(q),U="";for(;k;){U+=q.substring(w,k.index);const H=Ne.case_insensitive?k[0].toLowerCase():k[0],de=_e(B,H);if(de){const[we,Rr]=de;if(se.addText(U),U="",te[H]=(te[H]||0)+1,te[H]<=br&&(et+=Rr),we.startsWith("_"))U+=k[0];else{const xr=Ne.classNameAliases[we]||we;he(k[0],xr)}}else U+=k[0];w=B.keywordPatternRe.lastIndex,k=B.keywordPatternRe.exec(q)}U+=q.substring(w),se.addText(U)}function Je(){if(q==="")return;let w=null;if(typeof B.subLanguage=="string"){if(!b[B.subLanguage]){se.addText(q);return}w=Ue(B.subLanguage,q,!0,Nn[B.subLanguage]),Nn[B.subLanguage]=w._top}else w=mt(q,B.subLanguage.length?B.subLanguage:null);B.relevance>0&&(et+=w.relevance),se.__addSublanguage(w._emitter,w.language)}function fe(){B.subLanguage!=null?Je():Te(),q=""}function he(w,k){w!==""&&(se.startScope(k),se.addText(w),se.endScope())}function fn(w,k){let U=1;const H=k.length-1;for(;U<=H;){if(!w._emit[U]){U++;continue}const de=Ne.classNameAliases[w[U]]||w[U],we=k[U];de?he(we,de):(q=we,Te(),q=""),U++}}function _n(w,k){return w.scope&&typeof w.scope=="string"&&se.openNode(Ne.classNameAliases[w.scope]||w.scope),w.beginScope&&(w.beginScope._wrap?(he(q,Ne.classNameAliases[w.beginScope._wrap]||w.beginScope._wrap),q=""):w.beginScope._multi&&(fn(w.beginScope,k),q="")),B=Object.create(w,{parent:{value:B}}),B}function En(w,k,U){let H=R(w.endRe,U);if(H){if(w["on:end"]){const de=new n(w);w["on:end"](k,de),de.isMatchIgnored&&(H=!1)}if(H){for(;w.endsParent&&w.parent;)w=w.parent;return w}}if(w.endsWithParent)return En(w.parent,k,U)}function Ar(w){return B.matcher.regexIndex===0?(q+=w[0],1):(ht=!0,0)}function vr(w){const k=w[0],U=w.rule,H=new n(U),de=[U.__beforeBegin,U["on:begin"]];for(const we of de)if(we&&(we(w,H),H.isMatchIgnored))return Ar(k);return U.skip?q+=k:(U.excludeBegin&&(q+=k),fe(),!U.returnBegin&&!U.excludeBegin&&(q=k)),_n(U,w),U.returnBegin?0:k.length}function kr(w){const k=w[0],U=O.substring(w.index),H=En(B,w,U);if(!H)return un;const de=B;B.endScope&&B.endScope._wrap?(fe(),he(k,B.endScope._wrap)):B.endScope&&B.endScope._multi?(fe(),fn(B.endScope,w)):de.skip?q+=k:(de.returnEnd||de.excludeEnd||(q+=k),fe(),de.excludeEnd&&(q=k));do B.scope&&se.closeNode(),!B.skip&&!B.subLanguage&&(et+=B.relevance),B=B.parent;while(B!==H.parent);return H.starts&&_n(H.starts,w),de.returnEnd?0:k.length}function Or(){const w=[];for(let k=B;k!==Ne;k=k.parent)k.scope&&w.unshift(k.scope);w.forEach(k=>se.openNode(k))}let je={};function hn(w,k){const U=k&&k[0];if(q+=w,U==null)return fe(),0;if(je.type==="begin"&&k.type==="end"&&je.index===k.index&&U===""){if(q+=O.slice(k.index,k.index+1),!J){const H=new Error(`0 width match regex (${E})`);throw H.languageName=E,H.badRule=je.rule,H}return 1}if(je=k,k.type==="begin")return vr(k);if(k.type==="illegal"&&!P){const H=new Error('Illegal lexeme "'+U+'" for mode "'+(B.scope||"<unnamed>")+'"');throw H.mode=B,H}else if(k.type==="end"){const H=kr(k);if(H!==un)return H}if(k.type==="illegal"&&U==="")return q+=`
|
|
5
|
-
`,1;if(Et>1e5&&Et>k.index*3)throw new Error("potential infinite loop, way more iterations than matches");return q+=U,U.length}const Ne=ye(E);if(!Ne)throw Ae(j.replace("{}",E)),new Error('Unknown language: "'+E+'"');const Mr=dr(Ne);let _t="",B=Z||Mr;const Nn={},se=new S.__emitter(S);Or();let q="",et=0,ve=0,Et=0,ht=!1;try{if(Ne.__emitTokens)Ne.__emitTokens(O,se);else{for(B.matcher.considerAll();;){Et++,ht?ht=!1:B.matcher.considerAll(),B.matcher.lastIndex=ve;const w=B.matcher.exec(O);if(!w)break;const k=O.substring(ve,w.index),U=hn(k,w);ve=w.index+U}hn(O.substring(ve))}return se.finalize(),_t=se.toHTML(),{language:E,value:_t,relevance:et,illegal:!1,_emitter:se,_top:B}}catch(w){if(w.message&&w.message.includes("Illegal"))return{language:E,value:gt(O),illegal:!0,relevance:0,_illegalBy:{message:w.message,index:ve,context:O.slice(ve-100,ve+100),mode:w.mode,resultSoFar:_t},_emitter:se};if(J)return{language:E,value:gt(O),illegal:!1,relevance:0,errorRaised:w,_emitter:se,_top:B};throw w}}function bt(E){const O={value:gt(E),illegal:!1,relevance:0,_top:v,_emitter:new S.__emitter(S)};return O._emitter.addText(E),O}function mt(E,O){O=O||S.languages||Object.keys(b);const P=bt(E),Z=O.filter(ye).filter(mn).map(fe=>Ue(fe,E,!1));Z.unshift(P);const te=Z.sort((fe,he)=>{if(fe.relevance!==he.relevance)return he.relevance-fe.relevance;if(fe.language&&he.language){if(ye(fe.language).supersetOf===he.language)return 1;if(ye(he.language).supersetOf===fe.language)return-1}return 0}),[_e,Te]=te,Je=_e;return Je.secondBest=Te,Je}function mr(E,O,P){const Z=O&&C[O]||P;E.classList.add("hljs"),E.classList.add(`language-${Z}`)}function ft(E){let O=null;const P=oe(E);if(x(P))return;if(Qe("before:highlightElement",{el:E,language:P}),E.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",E);return}if(E.children.length>0&&(S.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(E)),S.throwUnescapedHTML))throw new gr("One of your code blocks includes unescaped HTML.",E.innerHTML);O=E;const Z=O.textContent,te=P?ee(Z,{language:P,ignoreIllegals:!0}):mt(Z);E.innerHTML=te.value,E.dataset.highlighted="yes",mr(E,P,te.language),E.result={language:te.language,re:te.relevance,relevance:te.relevance},te.secondBest&&(E.secondBest={language:te.secondBest.language,relevance:te.secondBest.relevance}),Qe("after:highlightElement",{el:E,result:te,text:Z})}function fr(E){S=dn(S,E)}const _r=()=>{Xe(),xe("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Er(){Xe(),xe("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let gn=!1;function Xe(){function E(){Xe()}if(document.readyState==="loading"){gn||window.addEventListener("DOMContentLoaded",E,!1),gn=!0;return}document.querySelectorAll(S.cssSelector).forEach(ft)}function hr(E,O){let P=null;try{P=O(o)}catch(Z){if(Ae("Language definition for '{}' could not be registered.".replace("{}",E)),J)Ae(Z);else throw Z;P=v}P.name||(P.name=E),b[E]=P,P.rawDefinition=O.bind(null,o),P.aliases&&bn(P.aliases,{languageName:E})}function Nr(E){delete b[E];for(const O of Object.keys(C))C[O]===E&&delete C[O]}function Cr(){return Object.keys(b)}function ye(E){return E=(E||"").toLowerCase(),b[E]||b[C[E]]}function bn(E,{languageName:O}){typeof E=="string"&&(E=[E]),E.forEach(P=>{C[P.toLowerCase()]=O})}function mn(E){const O=ye(E);return O&&!O.disableAutodetect}function wr(E){E["before:highlightBlock"]&&!E["before:highlightElement"]&&(E["before:highlightElement"]=O=>{E["before:highlightBlock"](Object.assign({block:O.el},O))}),E["after:highlightBlock"]&&!E["after:highlightElement"]&&(E["after:highlightElement"]=O=>{E["after:highlightBlock"](Object.assign({block:O.el},O))})}function yr(E){wr(E),D.push(E)}function Tr(E){const O=D.indexOf(E);O!==-1&&D.splice(O,1)}function Qe(E,O){const P=E;D.forEach(function(Z){Z[P]&&Z[P](O)})}function Sr(E){return xe("10.7.0","highlightBlock will be removed entirely in v12.0"),xe("10.7.0","Please use highlightElement now."),ft(E)}Object.assign(o,{highlight:ee,highlightAuto:mt,highlightAll:Xe,highlightElement:ft,highlightBlock:Sr,configure:fr,initHighlighting:_r,initHighlightingOnLoad:Er,registerLanguage:hr,unregisterLanguage:Nr,listLanguages:Cr,getLanguage:ye,registerAliases:bn,autoDetection:mn,inherit:dn,addPlugin:yr,removePlugin:Tr}),o.debugMode=function(){J=!1},o.safeMode=function(){J=!0},o.versionString=pr,o.regex={concat:h,lookahead:m,either:N,optional:y,anyNumberOfTimes:_};for(const E in Me)typeof Me[E]=="object"&&e(Me[E]);return Object.assign(o,Me),o},Ie=pn({});return Ie.newInstance=()=>pn({}),ot=Ie,Ie.HighlightJS=Ie,Ie.default=Ie,ot}var Ji=Qi();const ji=Xi(Ji),qt={},eo="hljs-";function to(e){const n=ji.newInstance();return e&&u(e),{highlight:i,highlightAuto:r,listLanguages:s,register:u,registerAlias:g,registered:d};function i(p,c,a){const l=a||qt,m=typeof l.prefix=="string"?l.prefix:eo;if(!n.getLanguage(p))throw new Error("Unknown language: `"+p+"` is not registered");n.configure({__emitter:no,classPrefix:m});const _=n.highlight(c,{ignoreIllegals:!0,language:p});if(_.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:_.errorRaised});const y=_._emitter.root,h=y.data;return h.language=_.language,h.relevance=_.relevance,y}function r(p,c){const l=(c||qt).subset||s();let m=-1,_=0,y;for(;++m<l.length;){const h=l[m];if(!n.getLanguage(h))continue;const f=i(h,p,c);f.data&&f.data.relevance!==void 0&&f.data.relevance>_&&(_=f.data.relevance,y=f)}return y||{type:"root",children:[],data:{language:void 0,relevance:_}}}function s(){return n.listLanguages()}function u(p,c){if(typeof p=="string")n.registerLanguage(p,c);else{let a;for(a in p)Object.hasOwn(p,a)&&n.registerLanguage(a,p[a])}}function g(p,c){if(typeof p=="string")n.registerAliases(typeof c=="string"?c:[...c],{languageName:p});else{let a;for(a in p)if(Object.hasOwn(p,a)){const l=p[a];n.registerAliases(typeof l=="string"?l:[...l],{languageName:a})}}}function d(p){return!!n.getLanguage(p)}}class no{constructor(n){this.options=n,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(n){if(n==="")return;const i=this.stack[this.stack.length-1],r=i.children[i.children.length-1];r&&r.type==="text"?r.value+=n:i.children.push({type:"text",value:n})}startScope(n){this.openNode(String(n))}endScope(){this.closeNode()}__addSublanguage(n,i){const r=this.stack[this.stack.length-1],s=n.root.children;i?r.children.push({type:"element",tagName:"span",properties:{className:[i]},children:s}):r.children.push(...s)}openNode(n){const i=this,r=n.split(".").map(function(g,d){return d?g+"_".repeat(d):i.options.classPrefix+g}),s=this.stack[this.stack.length-1],u={type:"element",tagName:"span",properties:{className:r},children:[]};s.children.push(u),this.stack.push(u)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Wt=Sn.Image.extend({addAttributes(){return{...this.parent?.(),align:{default:"left",parseHTML:e=>e.getAttribute("data-align")??"left",renderHTML:e=>({"data-align":e.align})}}},addProseMirrorPlugins(){const e=this.name;return[new Ct.Plugin({props:{decorations(n){const i=[];return n.doc.descendants((r,s)=>{r.type.name===e&&r.attrs.align&&i.push(wt.Decoration.node(s,s+r.nodeSize,{"data-align":r.attrs.align}))}),wt.DecorationSet.create(n.doc,i)}}})]}}),io={class:"tiptap-image-upload-content"},oo={class:"tiptap-image-upload-subtext"},ro={key:1,class:"tiptap-image-upload-previews"},ao={class:"tiptap-image-upload-preview-content"},so={class:"tiptap-image-upload-text"},co={class:"tiptap-image-upload-subtext"},lo=["onClick"],uo=["accept","multiple"],po=t.defineComponent({__name:"ImageUploadView",props:Le.nodeViewProps,setup(e){const n=e,i=t.computed(()=>n.node.attrs.accept),r=t.computed(()=>n.node.attrs.limit),s=t.computed(()=>n.node.attrs.maxSize),u=t.ref([]),g=t.ref(),d=t.ref(!1),p=async f=>{if(s.value>0&&f.size>s.value)return n.extension.options.onError?.(new Error(`文件大小超出限制 ${s.value/1024/1024}MB`)),null;const N=crypto.randomUUID();u.value.push({id:N,file:f,progress:0,status:"uploading"});try{const T=n.extension.options.upload;if(!T)throw new Error("未配置 upload 函数");const R=await T(f);if(!R)throw new Error("上传失败:未返回 URL");const A=u.value.find(M=>M.id===N);return A&&(A.status="success",A.progress=100),n.extension.options.onSuccess?.(R),R}catch(T){const R=u.value.find(A=>A.id===N);return R&&(R.status="error",R.progress=0),n.extension.options.onError?.(T instanceof Error?T:new Error("上传失败")),null}},c=async f=>{if(!f.length)return;if(f.length>r.value){n.extension.options.onError?.(new Error(`最多上传 ${r.value} 个文件`));return}const N=(await Promise.all(f.map(p))).filter(T=>!!T);if(N.length>0){const T=n.getPos();if(typeof T!="number")return;const R=N.map(A=>({type:"image",attrs:{src:A}}));n.editor.chain().focus().deleteRange({from:T,to:T+n.node.nodeSize}).insertContentAt(T,R).run()}},a=()=>{u.value.length===0&&g.value&&(g.value.value="",g.value.click())},l=f=>{const N=f.target.files;N&&c(Array.from(N))},m=f=>{f.preventDefault(),d.value=!0},_=f=>{f.currentTarget.contains(f.relatedTarget)||(d.value=!1)},y=f=>{f.preventDefault(),d.value=!1;const N=Array.from(f.dataTransfer?.files??[]);N.length&&c(N)},h=f=>{u.value=u.value.filter(N=>N.id!==f)};return(f,N)=>(t.openBlock(),t.createBlock(t.unref(Le.NodeViewWrapper),{class:"tiptap-image-upload",onClick:a},{default:t.withCtx(()=>[u.value.length?(t.openBlock(),t.createElementBlock("div",ro,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,T=>(t.openBlock(),t.createElementBlock("div",{key:T.id,class:"tiptap-image-upload-preview"},[T.status==="uploading"?(t.openBlock(),t.createElementBlock("div",{key:0,class:"tiptap-image-upload-progress",style:t.normalizeStyle({width:`${T.progress}%`})},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",ao,[t.createElementVNode("span",so,t.toDisplayString(T.file.name),1),t.createElementVNode("span",co,t.toDisplayString(T.status==="uploading"?`${T.progress}%`:T.status==="error"?"上传失败":"上传成功"),1),t.createElementVNode("button",{class:"tiptap-image-upload-remove",onClick:t.withModifiers(R=>h(T.id),["stop"])},"×",8,lo)])]))),128))])):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["tiptap-image-upload-drag-area",{"drag-active":d.value}]),onDragover:m,onDragleave:_,onDrop:y},[t.createElementVNode("div",io,[N[1]||(N[1]=t.createElementVNode("span",{class:"tiptap-image-upload-text"},[t.createElementVNode("em",null,"点击上传"),t.createTextVNode(" 或拖拽图片到此处")],-1)),t.createElementVNode("span",oo," 最多 "+t.toDisplayString(r.value)+" 个文件"+t.toDisplayString(s.value?`,每个不超过 ${s.value/1024/1024}MB`:""),1)])],34)),t.createElementVNode("input",{ref_key:"inputRef",ref:g,type:"file",accept:i.value,multiple:r.value>1,onChange:l,onClick:N[0]||(N[0]=t.withModifiers(()=>{},["stop"]))},null,40,uo)]),_:1}))}}),go=yt.Node.create({name:"imageUpload",group:"block",draggable:!0,selectable:!0,atom:!0,addOptions(){return{type:"image",accept:"image/*",limit:1,maxSize:0,upload:e=>new Promise(n=>{const i=new FileReader;i.onloadend=()=>n(i.result),i.readAsDataURL(e)}),onError:void 0,onSuccess:void 0,HTMLAttributes:{}}},addAttributes(){return{accept:{default:this.options.accept},limit:{default:this.options.limit},maxSize:{default:this.options.maxSize}}},parseHTML(){return[{tag:'div[data-type="image-upload"]'}]},renderHTML({HTMLAttributes:e}){return["div",yt.mergeAttributes({"data-type":"image-upload"},e)]},addNodeView(){return Le.VueNodeViewRenderer(po)},addCommands(){return{setImageUploadNode:()=>({commands:e})=>e.insertContent({type:this.name})}},addKeyboardShortcuts(){return{Enter:({editor:e})=>{const{selection:n}=e.state,{nodeAfter:i}=n.$from;if(i?.type.name==="imageUpload"&&e.isActive("imageUpload")){const r=e.view.nodeDOM(n.$from.pos);if(r instanceof HTMLElement){const s=r.firstChild;if(s instanceof HTMLElement)return s.click(),!0}}return!1}}}}),bo={icon:{type:Object,required:!0},tooltip:{type:String,required:!0},isActive:{type:Boolean},disabled:{type:Boolean,default:!1},onClick:{type:Function}},X=t.defineComponent({name:"IconButton",props:bo,setup(e){return()=>t.createVNode(F.ElTooltip,{showArrow:!1,offset:6,content:e.tooltip},{default:()=>[t.createVNode(F.ElButton,{text:!0,icon:e.icon,class:["tiptap-button",{"is-active":e.isActive}],disabled:e.disabled,onClick:e.onClick},null)]})}}),mo=t.defineComponent({name:"UndoIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.70711 3.70711C10.0976 3.31658 10.0976 2.68342 9.70711 2.29289C9.31658 1.90237 8.68342 1.90237 8.29289 2.29289L3.29289 7.29289C2.90237 7.68342 2.90237 8.31658 3.29289 8.70711L8.29289 13.7071C8.68342 14.0976 9.31658 14.0976 9.70711 13.7071C10.0976 13.3166 10.0976 12.6834 9.70711 12.2929L6.41421 9H14.5C15.0909 9 15.6761 9.1164 16.2221 9.34254C16.768 9.56869 17.2641 9.90016 17.682 10.318C18.0998 10.7359 18.4313 11.232 18.6575 11.7779C18.8836 12.3239 19 12.9091 19 13.5C19 14.0909 18.8836 14.6761 18.6575 15.2221C18.4313 15.768 18.0998 16.2641 17.682 16.682C17.2641 17.0998 16.768 17.4313 16.2221 17.6575C15.6761 17.8836 15.0909 18 14.5 18H11C10.4477 18 10 18.4477 10 19C10 19.5523 10.4477 20 11 20H14.5C15.3536 20 16.1988 19.8319 16.9874 19.5052C17.7761 19.1786 18.4926 18.6998 19.0962 18.0962C19.6998 17.4926 20.1786 16.7761 20.5052 15.9874C20.8319 15.1988 21 14.3536 21 13.5C21 12.6464 20.8319 11.8012 20.5052 11.0126C20.1786 10.2239 19.6998 9.50739 19.0962 8.90381C18.4926 8.30022 17.7761 7.82144 16.9874 7.49478C16.1988 7.16813 15.3536 7 14.5 7H6.41421L9.70711 3.70711Z",fill:"currentColor"},null)])}}),fo=t.defineComponent({name:"RedoIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.7071 2.29289C15.3166 1.90237 14.6834 1.90237 14.2929 2.29289C13.9024 2.68342 13.9024 3.31658 14.2929 3.70711L17.5858 7H9.5C7.77609 7 6.12279 7.68482 4.90381 8.90381C3.68482 10.1228 3 11.7761 3 13.5C3 14.3536 3.16813 15.1988 3.49478 15.9874C3.82144 16.7761 4.30023 17.4926 4.90381 18.0962C6.12279 19.3152 7.77609 20 9.5 20H13C13.5523 20 14 19.5523 14 19C14 18.4477 13.5523 18 13 18H9.5C8.30653 18 7.16193 17.5259 6.31802 16.682C5.90016 16.2641 5.56869 15.768 5.34254 15.2221C5.1164 14.6761 5 14.0909 5 13.5C5 12.3065 5.47411 11.1619 6.31802 10.318C7.16193 9.47411 8.30653 9 9.5 9H17.5858L14.2929 12.2929C13.9024 12.6834 13.9024 13.3166 14.2929 13.7071C14.6834 14.0976 15.3166 14.0976 15.7071 13.7071L20.7071 8.70711C21.0976 8.31658 21.0976 7.68342 20.7071 7.29289L15.7071 2.29289Z",fill:"currentColor"},null)])}}),_o=t.defineComponent({name:"UndoRedoButton",setup(){const e=t.inject("editor"),n=t.computed(()=>e?.value?.can().undo()??!1),i=t.computed(()=>e?.value?.can().redo()??!1);return()=>t.createVNode("div",null,[t.createVNode(X,{icon:mo,tooltip:"撤销",disabled:!n.value,onClick:()=>e?.value?.chain().focus().undo().run()},null),t.createVNode(X,{icon:fo,tooltip:"重做",disabled:!i.value,onClick:()=>e?.value?.chain().focus().redo().run()},null)])}}),Eo=t.defineComponent({name:"LinkIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{d:"M16.9958 1.06669C15.4226 1.05302 13.907 1.65779 12.7753 2.75074L12.765 2.76086L11.045 4.47086C10.6534 4.86024 10.6515 5.49341 11.0409 5.88507C11.4303 6.27673 12.0634 6.27858 12.4551 5.88919L14.1697 4.18456C14.9236 3.45893 15.9319 3.05752 16.9784 3.06662C18.0272 3.07573 19.0304 3.49641 19.772 4.23804C20.5137 4.97967 20.9344 5.98292 20.9435 7.03171C20.9526 8.07776 20.5515 9.08563 19.8265 9.83941L16.833 12.8329C16.4274 13.2386 15.9393 13.5524 15.4019 13.7529C14.8645 13.9533 14.2903 14.0359 13.7181 13.9949C13.146 13.9539 12.5894 13.7904 12.0861 13.5154C11.5827 13.2404 11.1444 12.8604 10.8008 12.401C10.47 11.9588 9.84333 11.8685 9.40108 12.1993C8.95883 12.5301 8.86849 13.1568 9.1993 13.599C9.71464 14.288 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9898C14.4334 16.0513 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8555 18.2473 14.247L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58751 22.9434 7.01433C22.9297 5.44115 22.2987 3.93628 21.1863 2.82383C20.0738 1.71138 18.5689 1.08036 16.9958 1.06669Z",fill:"currentColor"},null),t.createVNode("path",{d:"M10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.74067 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z",fill:"currentColor"},null)])}}),ho=t.defineComponent({name:"CornerDownLeftIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("polyline",{points:"9 10 4 15 9 20"},null),t.createVNode("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"},null)])}}),No=t.defineComponent({name:"ExternalLinkIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},null),t.createVNode("polyline",{points:"15 3 21 3 21 9"},null),t.createVNode("line",{x1:"10",y1:"14",x2:"21",y2:"3"},null)])}}),Co=t.defineComponent({name:"TrashIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("polyline",{points:"3 6 5 6 21 6"},null),t.createVNode("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},null)])}}),wo=t.defineComponent({name:"LinkPopover",setup(){const e=t.inject("editor"),n=t.ref(!1),i=t.ref("");let r=!1;t.watch(()=>e?.value?.isActive("link"),a=>{r||a&&(i.value=e?.value?.getAttributes("link").href??"",t.nextTick(()=>{n.value=!0}))});const s=()=>{const a=e?.value;if(!a||!i.value)return;r=!0;const{empty:l}=a.state.selection;let m=a.chain().focus().extendMarkRange("link").setLink({href:i.value});l&&(m=m.insertContent({type:"text",text:i.value})),m.run(),n.value=!1,t.nextTick(()=>{r=!1})},u=()=>{const a=e?.value;a&&(r=!0,a.chain().focus().extendMarkRange("link").unsetLink().run(),i.value="",n.value=!1,t.nextTick(()=>{r=!1}))},g=()=>{const a=e?.value?.getAttributes("link").href;a&&window.open(a,"_blank","noopener,noreferrer")},d=a=>{a.key==="Enter"&&(a.preventDefault(),s())},p=a=>{a&&(i.value=e?.value?.getAttributes("link").href??""),n.value=a},c=a=>{i.value=a};return()=>{const a=e?.value?.isActive("link")??!1;return t.createVNode(F.ElPopover,{visible:n.value,"onUpdate:visible":p,placement:"bottom",width:300,trigger:"click",showArrow:!1,popperClass:"link-popover-popper",offset:6},{reference:()=>t.createVNode("span",null,[t.createVNode(X,{tooltip:"链接",icon:Eo,class:["tiptap-button",{"is-active":a}]},null)]),default:()=>t.createVNode("div",{class:"link-popover-inner"},[t.createVNode(F.ElInput,{modelValue:i.value,"onUpdate:modelValue":c,type:"url",placeholder:"请输入链接...",size:"small",autofocus:!0,onKeydown:d},null),t.createVNode("div",{class:"link-popover-actions"},[t.createVNode(F.ElTooltip,{content:"确认",showArrow:!1,offset:4},{default:()=>[t.createVNode(F.ElButton,{text:!0,icon:ho,disabled:!i.value,onClick:s},null)]}),t.createVNode(F.ElTooltip,{content:"在新标签页打开",showArrow:!1,offset:4},{default:()=>[t.createVNode(F.ElButton,{text:!0,icon:No,disabled:!i.value&&!a,onClick:g},null)]}),t.createVNode(F.ElTooltip,{content:"移除链接",showArrow:!1,offset:4},{default:()=>[t.createVNode(F.ElButton,{text:!0,icon:Co,disabled:!a,onClick:u},null)]})])])})}}}),Yt=t.defineComponent({name:"BoldIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6 2.5C5.17157 2.5 4.5 3.17157 4.5 4V20C4.5 20.8284 5.17157 21.5 6 21.5H15C16.4587 21.5 17.8576 20.9205 18.8891 19.8891C19.9205 18.8576 20.5 17.4587 20.5 16C20.5 14.5413 19.9205 13.1424 18.8891 12.1109C18.6781 11.9 18.4518 11.7079 18.2128 11.5359C19.041 10.5492 19.5 9.29829 19.5 8C19.5 6.54131 18.9205 5.14236 17.8891 4.11091C16.8576 3.07946 15.4587 2.5 14 2.5H6ZM14 10.5C14.663 10.5 15.2989 10.2366 15.7678 9.76777C16.2366 9.29893 16.5 8.66304 16.5 8C16.5 7.33696 16.2366 6.70107 15.7678 6.23223C15.2989 5.76339 14.663 5.5 14 5.5H7.5V10.5H14ZM7.5 18.5V13.5H15C15.663 13.5 16.2989 13.7634 16.7678 14.2322C17.2366 14.7011 17.5 15.337 17.5 16C17.5 16.663 17.2366 17.2989 16.7678 17.7678C16.2989 18.2366 15.663 18.5 15 18.5H7.5Z",fill:"currentColor"},null)])}}),Xt=t.defineComponent({name:"ItalicIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{d:"M15.0222 3H19C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H15.693L10.443 19H14C14.5523 19 15 19.4477 15 20C15 20.5523 14.5523 21 14 21H9.02418C9.00802 21.0004 8.99181 21.0004 8.97557 21H5C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19H8.30704L13.557 5H10C9.44772 5 9 4.55228 9 4C9 3.44772 9.44772 3 10 3H14.9782C14.9928 2.99968 15.0075 2.99967 15.0222 3Z",fill:"currentColor"},null)])}}),Qt=t.defineComponent({name:"StrikeIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{d:"M9.00039 3H16.0001C16.5524 3 17.0001 3.44772 17.0001 4C17.0001 4.55229 16.5524 5 16.0001 5H9.00011C8.68006 4.99983 8.36412 5.07648 8.07983 5.22349C7.79555 5.37051 7.55069 5.5836 7.36585 5.84487C7.181 6.10614 7.06155 6.40796 7.01754 6.72497C6.97352 7.04198 7.00623 7.36492 7.11292 7.66667C7.29701 8.18737 7.02414 8.75872 6.50344 8.94281C5.98274 9.1269 5.4114 8.85403 5.2273 8.33333C5.01393 7.72984 4.94851 7.08396 5.03654 6.44994C5.12456 5.81592 5.36346 5.21229 5.73316 4.68974C6.10285 4.1672 6.59256 3.74101 7.16113 3.44698C7.72955 3.15303 8.36047 2.99975 9.00039 3Z",fill:"currentColor"},null),t.createVNode("path",{d:"M18 13H20C20.5523 13 21 12.5523 21 12C21 11.4477 20.5523 11 20 11H4C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H14C14.7956 13 15.5587 13.3161 16.1213 13.8787C16.6839 14.4413 17 15.2044 17 16C17 16.7956 16.6839 17.5587 16.1213 18.1213C15.5587 18.6839 14.7956 19 14 19H6C5.44772 19 5 19.4477 5 20C5 20.5523 5.44772 21 6 21H14C15.3261 21 16.5979 20.4732 17.5355 19.5355C18.4732 18.5979 19 17.3261 19 16C19 14.9119 18.6453 13.8604 18 13Z",fill:"currentColor"},null)])}}),Jt=t.defineComponent({name:"UnderlineIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4V10C5 11.8565 5.7375 13.637 7.05025 14.9497C8.36301 16.2625 10.1435 17 12 17C13.8565 17 15.637 16.2625 16.9497 14.9497C18.2625 13.637 19 11.8565 19 10V4C19 3.44772 18.5523 3 18 3C17.4477 3 17 3.44772 17 4V10C17 11.3261 16.4732 12.5979 15.5355 13.5355C14.5979 14.4732 13.3261 15 12 15C10.6739 15 9.40215 14.4732 8.46447 13.5355C7.52678 12.5979 7 11.3261 7 10V4ZM4 19C3.44772 19 3 19.4477 3 20C3 20.5523 3.44772 21 4 21H20C20.5523 21 21 20.5523 21 20C21 19.4477 20.5523 19 20 19H4Z",fill:"currentColor"},null)])}}),yo=t.defineComponent({name:"TextStyleButton",setup(){const e=t.inject("editor");return()=>t.createVNode("div",null,[t.createVNode(X,{icon:Yt,tooltip:"粗体",isActive:e?.value?.isActive("bold"),onClick:()=>e?.value?.chain().focus().toggleBold().run()},null),t.createVNode(X,{icon:Xt,tooltip:"斜体",isActive:e?.value?.isActive("italic"),onClick:()=>e?.value?.chain().focus().toggleItalic().run()},null),t.createVNode(X,{icon:Qt,tooltip:"删除线",isActive:e?.value?.isActive("strike"),onClick:()=>e?.value?.chain().focus().toggleStrike().run()},null),t.createVNode(X,{icon:Jt,tooltip:"下划线",isActive:e?.value?.isActive("underline"),onClick:()=>e?.value?.chain().focus().toggleUnderline().run()},null),t.createVNode(wo,null,null)])}}),jt=t.defineComponent({name:"AlignLeftIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H15C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H17C17.5523 17 18 17.4477 18 18C18 18.5523 17.5523 19 17 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"},null)])}}),en=t.defineComponent({name:"AlignCenterIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 18C4 17.4477 4.44772 17 5 17H19C19.5523 17 20 17.4477 20 18C20 18.5523 19.5523 19 19 19H5C4.44772 19 4 18.5523 4 18Z",fill:"currentColor"},null)])}}),tn=t.defineComponent({name:"AlignRightIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 12C8 11.4477 8.44772 11 9 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H9C8.44772 13 8 12.5523 8 12Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6 18C6 17.4477 6.44772 17 7 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H7C6.44772 19 6 18.5523 6 18Z",fill:"currentColor"},null)])}}),To=t.defineComponent({name:"AlignJustifyIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"},null)])}}),So=t.defineComponent({name:"TextAlignButton",setup(){const e=t.inject("editor");return()=>t.createVNode("div",null,[t.createVNode(X,{icon:jt,tooltip:"左边对齐",isActive:e?.value?.isActive({textAlign:"left"}),onClick:()=>e?.value?.chain().focus().setTextAlign("left").run()},null),t.createVNode(X,{icon:en,tooltip:"中间对齐",isActive:e?.value?.isActive({textAlign:"center"}),onClick:()=>e?.value?.chain().focus().setTextAlign("center").run()},null),t.createVNode(X,{icon:tn,tooltip:"右边对齐",isActive:e?.value?.isActive({textAlign:"right"}),onClick:()=>e?.value?.chain().focus().setTextAlign("right").run()},null),t.createVNode(X,{icon:To,tooltip:"两端对齐",isActive:e?.value?.isActive({textAlign:"justify"}),onClick:()=>e?.value?.chain().focus().setTextAlign("justify").run()},null)])}}),Ao=t.defineComponent({name:"ListIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7 6C7 5.44772 7.44772 5 8 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H8C7.44772 7 7 6.55228 7 6Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7 12C7 11.4477 7.44772 11 8 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H8C7.44772 13 7 12.5523 7 12Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7 18C7 17.4477 7.44772 17 8 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H8C7.44772 19 7 18.5523 7 18Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H3.01C3.56228 5 4.01 5.44772 4.01 6C4.01 6.55228 3.56228 7 3.01 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H3.01C3.56228 11 4.01 11.4477 4.01 12C4.01 12.5523 3.56228 13 3.01 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H3.01C3.56228 17 4.01 17.4477 4.01 18C4.01 18.5523 3.56228 19 3.01 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"},null)])}}),vo=t.defineComponent({name:"ListOrderedIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 6C9 5.44772 9.44772 5 10 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H10C9.44772 7 9 6.55228 9 6Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 12C9 11.4477 9.44772 11 10 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H10C9.44772 13 9 12.5523 9 12Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 18C9 17.4477 9.44772 17 10 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H10C9.44772 19 9 18.5523 9 18Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 6C3 5.44772 3.44772 5 4 5H5C5.55228 5 6 5.44772 6 6V10C6 10.5523 5.55228 11 5 11C4.44772 11 4 10.5523 4 10V7C3.44772 7 3 6.55228 3 6Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 10C3 9.44772 3.44772 9 4 9H6C6.55228 9 7 9.44772 7 10C7 10.5523 6.55228 11 6 11H4C3.44772 11 3 10.5523 3 10Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.82219 13.0431C6.54543 13.4047 6.99997 14.1319 6.99997 15C6.99997 15.5763 6.71806 16.0426 6.48747 16.35C6.31395 16.5814 6.1052 16.8044 5.91309 17H5.99997C6.55226 17 6.99997 17.4477 6.99997 18C6.99997 18.5523 6.55226 19 5.99997 19H3.99997C3.44769 19 2.99997 18.5523 2.99997 18C2.99997 17.4237 3.28189 16.9575 3.51247 16.65C3.74323 16.3424 4.03626 16.0494 4.26965 15.8161C4.27745 15.8083 4.2852 15.8006 4.29287 15.7929C4.55594 15.5298 4.75095 15.3321 4.88748 15.15C4.96287 15.0495 4.99021 14.9922 4.99911 14.9714C4.99535 14.9112 4.9803 14.882 4.9739 14.8715C4.96613 14.8588 4.95382 14.845 4.92776 14.8319C4.87723 14.8067 4.71156 14.7623 4.44719 14.8944C3.95321 15.1414 3.35254 14.9412 3.10555 14.4472C2.85856 13.9533 3.05878 13.3526 3.55276 13.1056C4.28839 12.7378 5.12272 12.6934 5.82219 13.0431Z",fill:"currentColor"},null)])}}),ko=t.defineComponent({name:"ListTodoIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 4.89543 2.89543 4 4 4H8C9.10457 4 10 4.89543 10 6V10C10 11.1046 9.10457 12 8 12H4C2.89543 12 2 11.1046 2 10V6ZM8 6H4V10H8V6Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.70711 14.2929C10.0976 14.6834 10.0976 15.3166 9.70711 15.7071L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071L2.29289 17.7071C1.90237 17.3166 1.90237 16.6834 2.29289 16.2929C2.68342 15.9024 3.31658 15.9024 3.70711 16.2929L5 17.5858L8.29289 14.2929C8.68342 13.9024 9.31658 13.9024 9.70711 14.2929Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 6C12 5.44772 12.4477 5 13 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H13C12.4477 7 12 6.55228 12 6Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 12C12 11.4477 12.4477 11 13 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H13C12.4477 13 12 12.5523 12 12Z",fill:"currentColor"},null),t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 18C12 17.4477 12.4477 17 13 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H13C12.4477 19 12 18.5523 12 18Z",fill:"currentColor"},null)])}}),Oo=t.defineComponent({name:"ListButton",setup(){const e=t.inject("editor");return()=>t.createVNode("div",null,[t.createVNode(X,{icon:Ao,tooltip:"无序列表",isActive:e?.value?.isActive("bulletList"),onClick:()=>e?.value?.chain().focus().toggleBulletList().run()},null),t.createVNode(X,{icon:vo,tooltip:"有序列表",isActive:e?.value?.isActive("orderedList"),onClick:()=>e?.value?.chain().focus().toggleOrderedList().run()},null),t.createVNode(X,{icon:ko,tooltip:"任务列表",isActive:e?.value?.isActive("taskList"),onClick:()=>e?.value?.chain().focus().toggleTaskList().run()},null)])}}),Mo=t.defineComponent({name:"ImagePlusIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20 2C20 1.44772 19.5523 1 19 1C18.4477 1 18 1.44772 18 2V4H16C15.4477 4 15 4.44772 15 5C15 5.55228 15.4477 6 16 6H18V8C18 8.55228 18.4477 9 19 9C19.5523 9 20 8.55228 20 8V6H22C22.5523 6 23 5.55228 23 5C23 4.44772 22.5523 4 22 4H20V2ZM5 4C4.73478 4 4.48043 4.10536 4.29289 4.29289C4.10536 4.48043 4 4.73478 4 5V19C4 19.2652 4.10536 19.5196 4.29289 19.7071C4.48043 19.8946 4.73478 20 5 20H5.58579L14.379 11.2068C14.9416 10.6444 15.7045 10.3284 16.5 10.3284C17.2955 10.3284 18.0584 10.6444 18.621 11.2068L20 12.5858V12C20 11.4477 20.4477 11 21 11C21.5523 11 22 11.4477 22 12V14.998C22 14.9994 22 15.0007 22 15.002V19C22 19.7957 21.6839 20.5587 21.1213 21.1213C20.5587 21.6839 19.7957 22 19 22H6.00219C6.00073 22 5.99927 22 5.99781 22H5C4.20435 22 3.44129 21.6839 2.87868 21.1213C2.31607 20.5587 2 19.7957 2 19V5C2 4.20435 2.31607 3.44129 2.87868 2.87868C3.44129 2.31607 4.20435 2 5 2H12C12.5523 2 13 2.44772 13 3C13 3.55228 12.5523 4 12 4H5ZM8.41422 20H19C19.2652 20 19.5196 19.8946 19.7071 19.7071C19.8946 19.5196 20 19.2652 20 19V15.4142L17.207 12.6212C17.0195 12.4338 16.7651 12.3284 16.5 12.3284C16.2349 12.3284 15.9806 12.4337 15.7931 12.6211L8.41422 20ZM6.87868 6.87868C7.44129 6.31607 8.20435 6 9 6C9.79565 6 10.5587 6.31607 11.1213 6.87868C11.6839 7.44129 12 8.20435 12 9C12 9.79565 11.6839 10.5587 11.1213 11.1213C10.5587 11.6839 9.79565 12 9 12C8.20435 12 7.44129 11.6839 6.87868 11.1213C6.31607 10.5587 6 9.79565 6 9C6 8.20435 6.31607 7.44129 6.87868 6.87868ZM9 8C8.73478 8 8.48043 8.10536 8.29289 8.29289C8.10536 8.48043 8 8.73478 8 9C8 9.26522 8.10536 9.51957 8.29289 9.70711C8.48043 9.89464 8.73478 10 9 10C9.26522 10 9.51957 9.89464 9.70711 9.70711C9.89464 9.51957 10 9.26522 10 9C10 8.73478 9.89464 8.48043 9.70711 8.29289C9.51957 8.10536 9.26522 8 9 8Z",fill:"currentColor"},null)])}}),Ro=t.defineComponent({name:"ImageButton",setup(){const e=t.inject("editor");return()=>t.createVNode("div",null,[t.createVNode(X,{icon:Mo,tooltip:"图片",onClick:()=>e?.value?.commands.setImageUploadNode()},null)])}}),xo=t.defineComponent({name:"TableIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 5C2 3.34315 3.34315 2 5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5ZM4 5C4 4.44772 4.44772 4 5 4H11V8H4V5ZM4 10H11V14H4V10ZM20 14V10H13V14H20ZM13 16H20V19C20 19.5523 19.5523 20 19 20H13V16ZM11 16V20H5C4.44772 20 4 19.5523 4 19V16H11ZM13 8H20V5C20 4.44772 19.5523 4 19 4H13V8Z",fill:"currentColor"},null)])}}),Io=8,Lo=8,Do=t.defineComponent({name:"TableButton",setup(){const e=t.inject("editor"),n=t.ref(!1),i=t.ref(0),r=t.ref(0),s=(d,p)=>{i.value=d,r.value=p},u=()=>{i.value=0,r.value=0},g=(d,p)=>{e?.value?.chain().focus().insertTable({rows:p,cols:d,withHeaderRow:!0}).run(),n.value=!1};return()=>t.createVNode(F.ElPopover,{visible:n.value,"onUpdate:visible":d=>n.value=d,trigger:"click",placement:"bottom-start",popperClass:"table-picker-popper",width:"auto",showArrow:!1},{reference:()=>t.createVNode("span",null,[t.createVNode(F.ElTooltip,{content:"表格",showArrow:!1,offset:6,disabled:n.value},{default:()=>[t.createVNode(F.ElButton,{text:!0,class:["tiptap-button",{"is-active":n.value}]},{default:()=>[t.createVNode(xo,{class:"tiptap-button-icon"},null)]})]})]),default:()=>t.createVNode("div",{class:"table-picker"},[t.createVNode("div",{class:"table-picker-grid",onMouseleave:u},[Array.from({length:Lo},(d,p)=>t.createVNode("div",{key:p,class:"table-picker-row"},[Array.from({length:Io},(c,a)=>t.createVNode("div",{key:a,class:["table-picker-cell",{"is-active":a<i.value&&p<r.value}],onMouseenter:()=>s(a+1,p+1),onClick:()=>g(a+1,p+1)},null))]))]),t.createVNode("div",{class:"table-picker-footer"},[t.createVNode("div",{class:"table-picker-counter"},[t.createVNode("span",null,[t.createTextVNode("列")]),t.createVNode("span",null,[i.value||1])]),t.createVNode("span",{class:"table-picker-x"},[t.createTextVNode("x")]),t.createVNode("div",{class:"table-picker-counter"},[t.createVNode("span",null,[t.createTextVNode("行")]),t.createVNode("span",null,[r.value||1])])])])})}});function Bo(e){let n=e.nodeType===Node.TEXT_NODE?e.parentElement:e;for(;n&&n instanceof HTMLElement;){if(n.tagName==="TD"||n.tagName==="TH")return n;n=n.parentElement}return null}function Uo(e){if(!e.isActive("tableCell")&&!e.isActive("tableHeader"))return null;const{node:n}=e.view.domAtPos(e.state.selection.from),i=Bo(n);if(!i)return null;const r=i.parentElement,s=r.parentElement,u=i.closest("table");if(!u)return null;const g=Array.from(r.children).indexOf(i),d=Array.from(s.children).indexOf(r),p=r.children.length,c=s.children.length,a=i.getBoundingClientRect(),l=u.getBoundingClientRect(),m=e.view.dom.closest(".tiptap-editor").getBoundingClientRect();return{cell:i,colIndex:g,rowIndex:d,totalCols:p,totalRows:c,cellRect:a,tableRect:l,editorRect:m}}function nn(e){const{state:n}=e,i=n.selection.from;let r=null;return n.doc.nodesBetween(0,n.doc.content.size,(s,u)=>{if(s.type.name==="table"&&u<=i&&i<=u+s.nodeSize)return r={node:s,pos:u},!1}),r}const Po=t.defineComponent({name:"TableControls",setup(){const e=t.inject("editor"),n=t.ref(null),i=t.ref(null);function r(){const c=e?.value;if(i.value&&(i.value.classList.remove("tcc-cell-focused"),i.value=null),!c){n.value=null;return}const a=Uo(c);n.value=a,a&&(a.cell.classList.add("tcc-cell-focused"),i.value=a.cell)}t.watchEffect(c=>{const a=e?.value;a&&(a.on("selectionUpdate",r),a.on("transaction",r),c(()=>{a.off("selectionUpdate",r),a.off("transaction",r),i.value&&(i.value.classList.remove("tcc-cell-focused"),i.value=null)}))});function s(c){const a=e?.value;if(!a||!n.value)return;const{colIndex:l,totalCols:m}=n.value,_=c==="left"?l-1:l+1;if(_<0||_>=m)return;const y=nn(a);if(!y)return;const{node:h,pos:f}=y,N=[];h.forEach(A=>{if(A.type.name!=="tableRow"){N.push(A);return}const M=[];A.forEach(G=>M.push(G));const I=M[l];M[l]=M[_],M[_]=I,N.push(A.type.create(A.attrs,M,A.marks))});const T=h.type.create(h.attrs,N,h.marks),R=a.state.tr.replaceWith(f,f+h.nodeSize,T);a.view.dispatch(R)}function u(c){const a=e?.value;if(!a||!n.value)return;const{rowIndex:l,totalRows:m}=n.value,_=c==="up"?l-1:l+1;if(_<0||_>=m)return;const y=nn(a);if(!y)return;const{node:h,pos:f}=y,N=[];h.forEach(M=>N.push(M));const T=N[l];N[l]=N[_],N[_]=T;const R=h.type.create(h.attrs,N,h.marks),A=a.state.tr.replaceWith(f,f+h.nodeSize,R);a.view.dispatch(A)}const g=()=>t.createVNode("svg",{width:"16",height:"4",viewBox:"0 0 16 4",fill:"currentColor"},[t.createVNode("circle",{cx:"2",cy:"2",r:"1.5"},null),t.createVNode("circle",{cx:"8",cy:"2",r:"1.5"},null),t.createVNode("circle",{cx:"14",cy:"2",r:"1.5"},null)]),d=()=>t.createVNode("svg",{width:"4",height:"16",viewBox:"0 0 4 16",fill:"currentColor"},[t.createVNode("circle",{cx:"2",cy:"2",r:"1.5"},null),t.createVNode("circle",{cx:"2",cy:"8",r:"1.5"},null),t.createVNode("circle",{cx:"2",cy:"14",r:"1.5"},null)]),p=()=>t.createVNode("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},[t.createVNode("path",{d:"M5 1v8M1 5h8"},null)]);return()=>{const c=n.value;if(!c)return null;const{colIndex:a,rowIndex:l,totalCols:m,totalRows:_,cellRect:y,tableRect:h,editorRect:f}=c,N=h.top-f.top,T=h.left-f.left,R=h.right-f.left,A=h.bottom-f.top,M=y.left-f.left,I=y.top-f.top,G=y.width,V=y.height,K={position:"absolute",top:`${N-20}px`,left:`${M+G/2-18}px`},ce={position:"absolute",top:`${I+V/2-18}px`,left:`${T-20}px`},be={position:"absolute",top:`${I+V/2-12}px`,left:`${R+6}px`},ge={position:"absolute",top:`${A+6}px`,left:`${M+G/2-12}px`},me=a===0,Y=a===m-1,Q=l===0,ne=l===_-1,ie=e?.value;return t.createVNode("div",{class:"table-cell-controls"},[t.createVNode(F.ElDropdown,{trigger:"click",placement:"bottom",style:K,onCommand:L=>{L==="move-left"?s("left"):L==="move-right"?s("right"):L==="insert-left"?ie?.chain().focus().addColumnBefore().run():L==="insert-right"?ie?.chain().focus().addColumnAfter().run():L==="delete"&&ie?.chain().focus().deleteColumn().run()}},{default:()=>[t.createVNode("button",{class:"tcc-btn tcc-btn--col"},[t.createVNode(g,null,null)])],dropdown:()=>t.createVNode(F.ElDropdownMenu,null,{default:()=>[t.createVNode(F.ElDropdownItem,{command:"move-left",disabled:me},{default:()=>[t.createTextVNode("移动列到左侧")]}),t.createVNode(F.ElDropdownItem,{command:"move-right",disabled:Y},{default:()=>[t.createTextVNode("移动列到右侧")]}),t.createVNode(F.ElDropdownItem,{command:"insert-left"},{default:()=>[t.createTextVNode("在左侧插入一列")]}),t.createVNode(F.ElDropdownItem,{command:"insert-right"},{default:()=>[t.createTextVNode("在右侧插入一列")]}),t.createVNode(F.ElDropdownItem,{command:"delete",divided:!0},{default:()=>[t.createTextVNode("删除列")]})]})}),t.createVNode(F.ElDropdown,{trigger:"click",placement:"right",style:ce,onCommand:L=>{L==="move-up"?u("up"):L==="move-down"?u("down"):L==="insert-above"?ie?.chain().focus().addRowBefore().run():L==="insert-below"?ie?.chain().focus().addRowAfter().run():L==="delete"&&ie?.chain().focus().deleteRow().run()}},{default:()=>[t.createVNode("button",{class:"tcc-btn tcc-btn--row"},[t.createVNode(d,null,null)])],dropdown:()=>t.createVNode(F.ElDropdownMenu,null,{default:()=>[t.createVNode(F.ElDropdownItem,{command:"move-up",disabled:Q},{default:()=>[t.createTextVNode("上移")]}),t.createVNode(F.ElDropdownItem,{command:"move-down",disabled:ne},{default:()=>[t.createTextVNode("下移")]}),t.createVNode(F.ElDropdownItem,{command:"insert-above"},{default:()=>[t.createTextVNode("在上方插入一行")]}),t.createVNode(F.ElDropdownItem,{command:"insert-below"},{default:()=>[t.createTextVNode("在下方插入一行")]}),t.createVNode(F.ElDropdownItem,{command:"delete",divided:!0},{default:()=>[t.createTextVNode("删除行")]})]})}),Y&&t.createVNode("button",{class:"tcc-btn tcc-btn--add",style:be,onClick:()=>ie?.chain().focus().addColumnAfter().run()},[t.createVNode(p,null,null)]),ne&&t.createVNode("button",{class:"tcc-btn tcc-btn--add",style:ge,onClick:()=>ie?.chain().focus().addRowAfter().run()},[t.createVNode(p,null,null)])])}}}),Fo=t.defineComponent({name:"MathIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 4.8c.1-.5.5-.8 1-.8h10a1 1 0 1 1 0 2h-9.2L8.3 19.2a1 1 0 0 1-1.7.4l-3.4-4.2a1 1 0 0 1 1.6-1.2l2 2.5L9 4.8Zm9.7 5.5c.4.4.4 1 0 1.4L17 13.5l1.8 1.8a1 1 0 1 1-1.4 1.4L15.5 15l-1.8 1.8a1 1 0 0 1-1.4-1.4l1.8-1.8-1.8-1.8a1 1 0 0 1 1.4-1.4l1.8 1.8 1.8-1.8a1 1 0 0 1 1.4 0Z",fill:"currentColor"},null)])}}),Vo=t.defineComponent({name:"MathButton",setup(){const e=t.inject("editor"),n=t.inject("openMathDialog");return()=>t.createVNode(X,{icon:Fo,tooltip:"数学公式",isActive:e?.value?.isActive("inlineMath")||e?.value?.isActive("blockMath"),onClick:()=>n?.()},null)}}),Ho={class:"math-dialog"},$o={key:0,class:"math-preview__placeholder"},zo=["innerHTML"],Go=((e,n)=>{const i=e.__vccOpts||e;for(const[r,s]of n)i[r]=s;return i})(t.defineComponent({__name:"MathEditDialog",props:{visible:{type:Boolean},latex:{},pos:{},type:{}},emits:["update:visible"],setup(e,{emit:n}){const i=e,r=n,s=t.inject("editor"),u=t.ref(""),g=t.ref("inline");t.watch(()=>i.latex,a=>{u.value=a},{immediate:!0}),t.watch(()=>i.type,a=>{g.value=a},{immediate:!0});const d=t.computed(()=>i.pos===null),p=t.computed(()=>u.value.trim()?vn.renderToString(u.value,{displayMode:g.value==="block",throwOnError:!1}):""),c=()=>{const a=s?.value;if(!(!a||!u.value.trim())){if(d.value)g.value==="inline"?a.chain().focus().insertInlineMath({latex:u.value}).run():a.chain().focus().insertBlockMath({latex:u.value}).run();else if(g.value===i.type)i.type==="inline"?a.commands.updateInlineMath({latex:u.value,pos:i.pos}):a.commands.updateBlockMath({latex:u.value,pos:i.pos});else{const l=i.pos;i.type==="inline"?a.chain().focus().deleteInlineMath({pos:l}).insertBlockMath({latex:u.value}).run():a.chain().focus().deleteBlockMath({pos:l}).insertInlineMath({latex:u.value}).run()}r("update:visible",!1)}};return(a,l)=>(t.openBlock(),t.createBlock(t.unref(F.ElDialog),{"model-value":e.visible,title:d.value?"插入数学公式":"编辑数学公式",width:"520px","onUpdate:modelValue":l[3]||(l[3]=m=>r("update:visible",m))},{footer:t.withCtx(()=>[t.createVNode(t.unref(F.ElButton),{onClick:l[2]||(l[2]=m=>r("update:visible",!1))},{default:t.withCtx(()=>[...l[6]||(l[6]=[t.createTextVNode("取消",-1)])]),_:1}),t.createVNode(t.unref(F.ElButton),{type:"primary",disabled:!u.value.trim(),onClick:c},{default:t.withCtx(()=>[...l[7]||(l[7]=[t.createTextVNode("确认",-1)])]),_:1},8,["disabled"])]),default:t.withCtx(()=>[t.createElementVNode("div",Ho,[t.createVNode(t.unref(F.ElRadioGroup),{modelValue:g.value,"onUpdate:modelValue":l[0]||(l[0]=m=>g.value=m)},{default:t.withCtx(()=>[t.createVNode(t.unref(F.ElRadioButton),{value:"inline"},{default:t.withCtx(()=>[...l[4]||(l[4]=[t.createTextVNode("行内公式",-1)])]),_:1}),t.createVNode(t.unref(F.ElRadioButton),{value:"block"},{default:t.withCtx(()=>[...l[5]||(l[5]=[t.createTextVNode("块级公式",-1)])]),_:1})]),_:1},8,["modelValue"]),t.createVNode(t.unref(F.ElInput),{modelValue:u.value,"onUpdate:modelValue":l[1]||(l[1]=m=>u.value=m),type:"textarea",rows:3,placeholder:"请输入 LaTeX 公式,例如:E=mc^2"},null,8,["modelValue"]),t.createElementVNode("div",{class:t.normalizeClass(["math-preview",{"math-preview--empty":!p.value}])},[p.value?(t.openBlock(),t.createElementBlock("div",{key:1,innerHTML:p.value},null,8,zo)):(t.openBlock(),t.createElementBlock("span",$o,"预览将在此处显示"))],2)])]),_:1},8,["model-value","title"]))}}),[["__scopeId","data-v-995dc22f"]]),Ko=[{value:"left",title:"居左",Icon:jt},{value:"center",title:"居中",Icon:en},{value:"right",title:"居右",Icon:tn}],Ze=e=>e.preventDefault();function Zo(e){if(!e.isActive("image"))return null;const{selection:n}=e.state;if(!(n instanceof Ct.NodeSelection)||n.node.type.name!=="image")return null;const i=n.node;return{pos:n.from,nodeSize:i.nodeSize,src:i.attrs.src,align:i.attrs.align??"left"}}function qo(e){const n=e.startsWith("data:")?"image.png":e.split("/").pop()?.split("?")[0]||"image.png",i=document.createElement("a");i.href=e,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i)}const Wo=()=>t.createVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},null),t.createVNode("polyline",{points:"7 10 12 15 17 10"},null),t.createVNode("line",{x1:"12",y1:"15",x2:"12",y2:"3"},null)]),Yo=()=>t.createVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("polyline",{points:"1 4 1 10 7 10"},null),t.createVNode("path",{d:"M3.51 15a9 9 0 1 0 .49-4.1L1 10"},null)]),Xo=()=>t.createVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("polyline",{points:"3 6 5 6 21 6"},null),t.createVNode("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"},null),t.createVNode("path",{d:"M10 11v6M14 11v6"},null),t.createVNode("path",{d:"M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"},null)]),Qo=t.defineComponent({name:"ImageControls",setup(){const e=t.inject("editor"),n=t.ref(null);function i(){const r=e?.value;if(!r){n.value=null;return}n.value=Zo(r)}return t.watchEffect(r=>{const s=e?.value;s&&(s.on("transaction",i),r(()=>{s.off("transaction",i)}))}),()=>{const r=n.value;if(!r)return null;const s=e?.value;if(!s)return null;const{pos:u,nodeSize:g,src:d,align:p}=r,c=s.view.nodeDOM(u);if(!c||!(c instanceof HTMLElement))return null;const a=c.querySelector("[data-resize-wrapper]")??c,l=s.view.dom.closest(".tiptap-editor");if(!l)return null;const m=a.getBoundingClientRect(),_=l.getBoundingClientRect(),y={position:"absolute",top:`${m.top-_.top}px`,left:`${m.left-_.left+m.width/2}px`,transform:"translate(-50%, calc(-100% - 8px))",zIndex:20};return t.createVNode("div",{class:"image-controls",style:y},[Ko.map(({value:h,title:f,Icon:N})=>t.createVNode("button",{key:h,class:["image-controls-btn",p===h&&"is-active"],title:f,onMousedown:Ze,onClick:()=>s.chain().focus().updateAttributes("image",{align:h}).run()},[t.createVNode(N,null,null)])),t.createVNode("span",{class:"image-controls-separator"},null),t.createVNode("button",{class:"image-controls-btn",title:"下载",onMousedown:Ze,onClick:()=>qo(d)},[t.createVNode(Wo,null,null)]),t.createVNode("button",{class:"image-controls-btn",title:"重新上传",onMousedown:Ze,onClick:()=>s.chain().focus().deleteRange({from:u,to:u+g}).insertContentAt(u,{type:"imageUpload"}).run()},[t.createVNode(Yo,null,null)]),t.createVNode("button",{class:"image-controls-btn",title:"删除",onMousedown:Ze,onClick:()=>s.chain().focus().deleteRange({from:u,to:u+g}).run()},[t.createVNode(Xo,null,null)])])}}}),Jo=t.defineComponent({name:"CodeBlockIcon",setup(e,{attrs:n}){return()=>t.createVNode("svg",t.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},n),[t.createVNode("polyline",{points:"16 18 22 12 16 6"},null),t.createVNode("polyline",{points:"8 6 2 12 8 18"},null)])}}),jo=t.defineComponent({name:"CodeBlockButton",setup(){const e=t.inject("editor");return()=>t.createVNode(X,{icon:Jo,tooltip:"代码块",isActive:e?.value?.isActive("codeBlock"),onClick:()=>e?.value?.chain().focus().toggleCodeBlock().run()},null)}}),er=t.defineComponent({name:"BubbleMenuBar",setup(){const e=t.inject("editor");return()=>e?.value?t.createVNode(kn.BubbleMenu,{editor:e.value,class:"bubble-menu",options:{placement:"top",offset:{mainAxis:8}},shouldShow:n=>{const{editor:i,from:r,to:s}=n;return!(r===s||i.isActive("image")||i.isActive("table"))}},{default:()=>[t.createVNode("div",{class:"bubble-menu-content"},[t.createVNode(X,{icon:Yt,tooltip:"粗体",isActive:e.value.isActive("bold"),onClick:()=>e.value?.chain().focus().toggleBold().run()},null),t.createVNode(X,{icon:Xt,tooltip:"斜体",isActive:e.value.isActive("italic"),onClick:()=>e.value?.chain().focus().toggleItalic().run()},null),t.createVNode(X,{icon:Qt,tooltip:"删除线",isActive:e.value.isActive("strike"),onClick:()=>e.value?.chain().focus().toggleStrike().run()},null),t.createVNode(X,{icon:Jt,tooltip:"下划线",isActive:e.value.isActive("underline"),onClick:()=>e.value?.chain().focus().toggleUnderline().run()},null)])]}):null}}),tr={class:"tiptap-editor"},nr={class:"tiptap-toolbar"},ir=t.defineComponent({__name:"TiptapEditor",props:{modelValue:{default:""},placeholder:{default:"请输入内容..."},upload:{}},emits:["update:modelValue"],setup(e,{emit:n}){const i=to(Yi),r=e,s=n,u=t.ref(!1),g=t.ref(""),d=t.ref(null),p=t.ref("inline"),c=(l={})=>{g.value=l.latex??"",d.value=l.pos??null,p.value=l.type??"inline",u.value=!0};t.provide("openMathDialog",c);const a=Le.useEditor({content:r.modelValue,extensions:[Cn.configure({codeBlock:!1,link:{openOnClick:!1,enableClickSelection:!0}}),yn.Placeholder.configure({placeholder:r.placeholder}),Tn.CodeBlockLowlight.configure({lowlight:i,defaultLanguage:"plaintext"}),wn.TextAlign.configure({types:["heading","paragraph"]}),Nt.TaskList,Nt.TaskItem.configure({nested:!0}),Wt.configure({allowBase64:!0,resize:{enabled:!0,directions:["top","right","bottom","left","top-right","top-left","bottom-right","bottom-left"],minWidth:50,minHeight:50,alwaysPreserveAspectRatio:!1}}),go.configure({...r.upload?{upload:r.upload}:{}}),Pe.Table.configure({resizable:!0}),Pe.TableRow,Pe.TableHeader,Pe.TableCell,An.Mathematics.configure({inlineOptions:{onClick:(l,m)=>c({latex:l.attrs.latex,pos:m,type:"inline"})},blockOptions:{onClick:(l,m)=>c({latex:l.attrs.latex,pos:m,type:"block"})}})],onUpdate:({editor:l})=>{s("update:modelValue",l.getHTML())}});return t.provide("editor",a),t.watch(()=>r.modelValue,l=>{a.value&&l!==a.value.getHTML()&&a.value.commands.setContent(l,{emitUpdate:!1})}),(l,m)=>(t.openBlock(),t.createElementBlock("div",tr,[t.createElementVNode("div",nr,[t.createVNode(t.unref(_o)),m[1]||(m[1]=t.createElementVNode("div",{class:"tiptap-separator"},null,-1)),t.createVNode(t.unref(yo)),t.createVNode(t.unref(jo)),m[2]||(m[2]=t.createElementVNode("div",{class:"tiptap-separator"},null,-1)),t.createVNode(t.unref(Oo)),m[3]||(m[3]=t.createElementVNode("div",{class:"tiptap-separator"},null,-1)),t.createVNode(t.unref(So)),m[4]||(m[4]=t.createElementVNode("div",{class:"tiptap-separator"},null,-1)),t.createVNode(t.unref(Ro)),t.createVNode(t.unref(Do)),t.createVNode(t.unref(Vo))]),t.createVNode(t.unref(Le.EditorContent),{class:"tiptap-content",editor:t.unref(a)},null,8,["editor"]),t.createVNode(t.unref(er)),t.createVNode(t.unref(Po)),t.createVNode(t.unref(Qo)),t.createVNode(Go,{visible:u.value,"onUpdate:visible":m[0]||(m[0]=_=>u.value=_),latex:g.value,pos:d.value,type:p.value},null,8,["visible","latex","pos","type"])]))}});W.IconButton=X,W.ImageWithAlign=Wt,W.TiptapEditor=ir,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(h,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@tiptap/starter-kit"),require("@tiptap/vue-3"),require("@tiptap/extension-list"),require("@tiptap/extension-text-align"),require("@tiptap/extension-placeholder"),require("@tiptap/extension-code-block-lowlight"),require("lowlight"),require("@tiptap/extension-image"),require("@tiptap/pm/state"),require("@tiptap/pm/view"),require("@tiptap/extension-table"),require("@tiptap/extension-mathematics"),require("@tiptap/core"),require("element-plus"),require("katex"),require("@tiptap/vue-3/menus")):typeof define=="function"&&define.amd?define(["exports","vue","@tiptap/starter-kit","@tiptap/vue-3","@tiptap/extension-list","@tiptap/extension-text-align","@tiptap/extension-placeholder","@tiptap/extension-code-block-lowlight","lowlight","@tiptap/extension-image","@tiptap/pm/state","@tiptap/pm/view","@tiptap/extension-table","@tiptap/extension-mathematics","@tiptap/core","element-plus","katex","@tiptap/vue-3/menus"],e):(h=typeof globalThis<"u"?globalThis:h||self,e(h.TiptapEditor={},h.Vue,h.StarterKit,h.vue3,h.extensionList,h.extensionTextAlign,h.extensionPlaceholder,h.extensionCodeBlockLowlight,h.lowlight,h.extensionImage,h.state,h.view,h.extensionTable,h.extensionMathematics,h.core,h.ElementPlus,h.katex,h.menus))})(this,(function(h,e,J,A,T,X,Q,Y,D,ee,_,Z,y,te,F,u,oe,ne){"use strict";const R=ee.Image.extend({addAttributes(){return{...this.parent?.(),align:{default:"left",parseHTML:t=>t.getAttribute("data-align")??"left",renderHTML:t=>({"data-align":t.align})}}},addProseMirrorPlugins(){const t=this.name;return[new _.Plugin({props:{decorations(o){const n=[];return o.doc.descendants((r,c)=>{r.type.name===t&&r.attrs.align&&n.push(Z.Decoration.node(c,c+r.nodeSize,{"data-align":r.attrs.align}))}),Z.DecorationSet.create(o.doc,n)}}})]}}),le={class:"tiptap-image-upload-content"},re={class:"tiptap-image-upload-subtext"},ie={key:1,class:"tiptap-image-upload-previews"},ae={class:"tiptap-image-upload-preview-content"},ce={class:"tiptap-image-upload-text"},de={class:"tiptap-image-upload-subtext"},se=["onClick"],ue=["accept","multiple"],pe=e.defineComponent({__name:"ImageUploadView",props:A.nodeViewProps,setup(t){const o=t,n=e.computed(()=>o.node.attrs.accept),r=e.computed(()=>o.node.attrs.limit),c=e.computed(()=>o.node.attrs.maxSize),a=e.ref([]),g=e.ref(),V=e.ref(!1),m=async s=>{if(c.value>0&&s.size>c.value)return o.extension.options.onError?.(new Error(`文件大小超出限制 ${c.value/1024/1024}MB`)),null;const p=crypto.randomUUID();a.value.push({id:p,file:s,progress:0,status:"uploading"});try{const f=o.extension.options.upload;if(!f)throw new Error("未配置 upload 函数");const B=await f(s);if(!B)throw new Error("上传失败:未返回 URL");const k=a.value.find(E=>E.id===p);return k&&(k.status="success",k.progress=100),o.extension.options.onSuccess?.(B),B}catch(f){const B=a.value.find(k=>k.id===p);return B&&(B.status="error",B.progress=0),o.extension.options.onError?.(f instanceof Error?f:new Error("上传失败")),null}},C=async s=>{if(!s.length)return;if(s.length>r.value){o.extension.options.onError?.(new Error(`最多上传 ${r.value} 个文件`));return}const p=(await Promise.all(s.map(m))).filter(f=>!!f);if(p.length>0){const f=o.getPos();if(typeof f!="number")return;const B=p.map(k=>({type:"image",attrs:{src:k}}));o.editor.chain().focus().deleteRange({from:f,to:f+o.node.nodeSize}).insertContentAt(f,B).run()}},l=()=>{a.value.length===0&&g.value&&(g.value.value="",g.value.click())},i=s=>{const p=s.target.files;p&&C(Array.from(p))},d=s=>{s.preventDefault(),V.value=!0},x=s=>{s.currentTarget.contains(s.relatedTarget)||(V.value=!1)},b=s=>{s.preventDefault(),V.value=!1;const p=Array.from(s.dataTransfer?.files??[]);p.length&&C(p)},N=s=>{a.value=a.value.filter(p=>p.id!==s)};return(s,p)=>(e.openBlock(),e.createBlock(e.unref(A.NodeViewWrapper),{class:"tiptap-image-upload",onClick:l},{default:e.withCtx(()=>[a.value.length?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,f=>(e.openBlock(),e.createElementBlock("div",{key:f.id,class:"tiptap-image-upload-preview"},[f.status==="uploading"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tiptap-image-upload-progress",style:e.normalizeStyle({width:`${f.progress}%`})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",ae,[e.createElementVNode("span",ce,e.toDisplayString(f.file.name),1),e.createElementVNode("span",de,e.toDisplayString(f.status==="uploading"?`${f.progress}%`:f.status==="error"?"上传失败":"上传成功"),1),e.createElementVNode("button",{class:"tiptap-image-upload-remove",onClick:e.withModifiers(B=>N(f.id),["stop"])},"×",8,se)])]))),128))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["tiptap-image-upload-drag-area",{"drag-active":V.value}]),onDragover:d,onDragleave:x,onDrop:b},[e.createElementVNode("div",le,[p[1]||(p[1]=e.createElementVNode("span",{class:"tiptap-image-upload-text"},[e.createElementVNode("em",null,"点击上传"),e.createTextVNode(" 或拖拽图片到此处")],-1)),e.createElementVNode("span",re," 最多 "+e.toDisplayString(r.value)+" 个文件"+e.toDisplayString(c.value?`,每个不超过 ${c.value/1024/1024}MB`:""),1)])],34)),e.createElementVNode("input",{ref_key:"inputRef",ref:g,type:"file",accept:n.value,multiple:r.value>1,onChange:i,onClick:p[0]||(p[0]=e.withModifiers(()=>{},["stop"]))},null,40,ue)]),_:1}))}}),Ce=F.Node.create({name:"imageUpload",group:"block",draggable:!0,selectable:!0,atom:!0,addOptions(){return{type:"image",accept:"image/*",limit:1,maxSize:0,upload:t=>new Promise(o=>{const n=new FileReader;n.onloadend=()=>o(n.result),n.readAsDataURL(t)}),onError:void 0,onSuccess:void 0,HTMLAttributes:{}}},addAttributes(){return{accept:{default:this.options.accept},limit:{default:this.options.limit},maxSize:{default:this.options.maxSize}}},parseHTML(){return[{tag:'div[data-type="image-upload"]'}]},renderHTML({HTMLAttributes:t}){return["div",F.mergeAttributes({"data-type":"image-upload"},t)]},addNodeView(){return A.VueNodeViewRenderer(pe)},addCommands(){return{setImageUploadNode:()=>({commands:t})=>t.insertContent({type:this.name})}},addKeyboardShortcuts(){return{Enter:({editor:t})=>{const{selection:o}=t.state,{nodeAfter:n}=o.$from;if(n?.type.name==="imageUpload"&&t.isActive("imageUpload")){const r=t.view.nodeDOM(o.$from.pos);if(r instanceof HTMLElement){const c=r.firstChild;if(c instanceof HTMLElement)return c.click(),!0}}return!1}}}}),fe={icon:{type:Object,required:!0},tooltip:{type:String,required:!0},isActive:{type:Boolean},disabled:{type:Boolean,default:!1},onClick:{type:Function}},w=e.defineComponent({name:"IconButton",props:fe,setup(t){return()=>e.createVNode(u.ElTooltip,{showArrow:!1,offset:6,content:t.tooltip},{default:()=>[e.createVNode(u.ElButton,{text:!0,icon:t.icon,class:["tiptap-button",{"is-active":t.isActive}],disabled:t.disabled,onClick:t.onClick},null)]})}}),me=e.defineComponent({name:"UndoIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.70711 3.70711C10.0976 3.31658 10.0976 2.68342 9.70711 2.29289C9.31658 1.90237 8.68342 1.90237 8.29289 2.29289L3.29289 7.29289C2.90237 7.68342 2.90237 8.31658 3.29289 8.70711L8.29289 13.7071C8.68342 14.0976 9.31658 14.0976 9.70711 13.7071C10.0976 13.3166 10.0976 12.6834 9.70711 12.2929L6.41421 9H14.5C15.0909 9 15.6761 9.1164 16.2221 9.34254C16.768 9.56869 17.2641 9.90016 17.682 10.318C18.0998 10.7359 18.4313 11.232 18.6575 11.7779C18.8836 12.3239 19 12.9091 19 13.5C19 14.0909 18.8836 14.6761 18.6575 15.2221C18.4313 15.768 18.0998 16.2641 17.682 16.682C17.2641 17.0998 16.768 17.4313 16.2221 17.6575C15.6761 17.8836 15.0909 18 14.5 18H11C10.4477 18 10 18.4477 10 19C10 19.5523 10.4477 20 11 20H14.5C15.3536 20 16.1988 19.8319 16.9874 19.5052C17.7761 19.1786 18.4926 18.6998 19.0962 18.0962C19.6998 17.4926 20.1786 16.7761 20.5052 15.9874C20.8319 15.1988 21 14.3536 21 13.5C21 12.6464 20.8319 11.8012 20.5052 11.0126C20.1786 10.2239 19.6998 9.50739 19.0962 8.90381C18.4926 8.30022 17.7761 7.82144 16.9874 7.49478C16.1988 7.16813 15.3536 7 14.5 7H6.41421L9.70711 3.70711Z",fill:"currentColor"},null)])}}),he=e.defineComponent({name:"RedoIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.7071 2.29289C15.3166 1.90237 14.6834 1.90237 14.2929 2.29289C13.9024 2.68342 13.9024 3.31658 14.2929 3.70711L17.5858 7H9.5C7.77609 7 6.12279 7.68482 4.90381 8.90381C3.68482 10.1228 3 11.7761 3 13.5C3 14.3536 3.16813 15.1988 3.49478 15.9874C3.82144 16.7761 4.30023 17.4926 4.90381 18.0962C6.12279 19.3152 7.77609 20 9.5 20H13C13.5523 20 14 19.5523 14 19C14 18.4477 13.5523 18 13 18H9.5C8.30653 18 7.16193 17.5259 6.31802 16.682C5.90016 16.2641 5.56869 15.768 5.34254 15.2221C5.1164 14.6761 5 14.0909 5 13.5C5 12.3065 5.47411 11.1619 6.31802 10.318C7.16193 9.47411 8.30653 9 9.5 9H17.5858L14.2929 12.2929C13.9024 12.6834 13.9024 13.3166 14.2929 13.7071C14.6834 14.0976 15.3166 14.0976 15.7071 13.7071L20.7071 8.70711C21.0976 8.31658 21.0976 7.68342 20.7071 7.29289L15.7071 2.29289Z",fill:"currentColor"},null)])}}),ge=e.defineComponent({name:"UndoRedoButton",setup(){const t=e.inject("editor"),o=e.computed(()=>t?.value?.can().undo()??!1),n=e.computed(()=>t?.value?.can().redo()??!1);return()=>e.createVNode("div",null,[e.createVNode(w,{icon:me,tooltip:"撤销",disabled:!o.value,onClick:()=>t?.value?.chain().focus().undo().run()},null),e.createVNode(w,{icon:he,tooltip:"重做",disabled:!n.value,onClick:()=>t?.value?.chain().focus().redo().run()},null)])}}),Ve=e.defineComponent({name:"LinkIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{d:"M16.9958 1.06669C15.4226 1.05302 13.907 1.65779 12.7753 2.75074L12.765 2.76086L11.045 4.47086C10.6534 4.86024 10.6515 5.49341 11.0409 5.88507C11.4303 6.27673 12.0634 6.27858 12.4551 5.88919L14.1697 4.18456C14.9236 3.45893 15.9319 3.05752 16.9784 3.06662C18.0272 3.07573 19.0304 3.49641 19.772 4.23804C20.5137 4.97967 20.9344 5.98292 20.9435 7.03171C20.9526 8.07776 20.5515 9.08563 19.8265 9.83941L16.833 12.8329C16.4274 13.2386 15.9393 13.5524 15.4019 13.7529C14.8645 13.9533 14.2903 14.0359 13.7181 13.9949C13.146 13.9539 12.5894 13.7904 12.0861 13.5154C11.5827 13.2404 11.1444 12.8604 10.8008 12.401C10.47 11.9588 9.84333 11.8685 9.40108 12.1993C8.95883 12.5301 8.86849 13.1568 9.1993 13.599C9.71464 14.288 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9898C14.4334 16.0513 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8555 18.2473 14.247L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58751 22.9434 7.01433C22.9297 5.44115 22.2987 3.93628 21.1863 2.82383C20.0738 1.71138 18.5689 1.08036 16.9958 1.06669Z",fill:"currentColor"},null),e.createVNode("path",{d:"M10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.74067 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z",fill:"currentColor"},null)])}}),we=e.defineComponent({name:"CornerDownLeftIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("polyline",{points:"9 10 4 15 9 20"},null),e.createVNode("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"},null)])}}),Ne=e.defineComponent({name:"ExternalLinkIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},null),e.createVNode("polyline",{points:"15 3 21 3 21 9"},null),e.createVNode("line",{x1:"10",y1:"14",x2:"21",y2:"3"},null)])}}),xe=e.defineComponent({name:"TrashIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("polyline",{points:"3 6 5 6 21 6"},null),e.createVNode("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},null)])}}),ke=e.defineComponent({name:"LinkPopover",setup(){const t=e.inject("editor"),o=e.ref(!1),n=e.ref("");let r=!1;e.watch(()=>t?.value?.isActive("link"),l=>{r||l&&(n.value=t?.value?.getAttributes("link").href??"",e.nextTick(()=>{o.value=!0}))});const c=()=>{const l=t?.value;if(!l||!n.value)return;r=!0;const{empty:i}=l.state.selection;let d=l.chain().focus().extendMarkRange("link").setLink({href:n.value});i&&(d=d.insertContent({type:"text",text:n.value})),d.run(),o.value=!1,e.nextTick(()=>{r=!1})},a=()=>{const l=t?.value;l&&(r=!0,l.chain().focus().extendMarkRange("link").unsetLink().run(),n.value="",o.value=!1,e.nextTick(()=>{r=!1}))},g=()=>{const l=t?.value?.getAttributes("link").href;l&&window.open(l,"_blank","noopener,noreferrer")},V=l=>{l.key==="Enter"&&(l.preventDefault(),c())},m=l=>{l&&(n.value=t?.value?.getAttributes("link").href??""),o.value=l},C=l=>{n.value=l};return()=>{const l=t?.value?.isActive("link")??!1;return e.createVNode(u.ElPopover,{visible:o.value,"onUpdate:visible":m,placement:"bottom",width:300,trigger:"click",showArrow:!1,popperClass:"link-popover-popper",offset:6},{reference:()=>e.createVNode("span",null,[e.createVNode(w,{tooltip:"链接",icon:Ve,class:["tiptap-button",{"is-active":l}]},null)]),default:()=>e.createVNode("div",{class:"link-popover-inner"},[e.createVNode(u.ElInput,{modelValue:n.value,"onUpdate:modelValue":C,type:"url",placeholder:"请输入链接...",size:"small",autofocus:!0,onKeydown:V},null),e.createVNode("div",{class:"link-popover-actions"},[e.createVNode(u.ElTooltip,{content:"确认",showArrow:!1,offset:4},{default:()=>[e.createVNode(u.ElButton,{text:!0,icon:we,disabled:!n.value,onClick:c},null)]}),e.createVNode(u.ElTooltip,{content:"在新标签页打开",showArrow:!1,offset:4},{default:()=>[e.createVNode(u.ElButton,{text:!0,icon:Ne,disabled:!n.value&&!l,onClick:g},null)]}),e.createVNode(u.ElTooltip,{content:"移除链接",showArrow:!1,offset:4},{default:()=>[e.createVNode(u.ElButton,{text:!0,icon:xe,disabled:!l,onClick:a},null)]})])])})}}}),S=e.defineComponent({name:"BoldIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6 2.5C5.17157 2.5 4.5 3.17157 4.5 4V20C4.5 20.8284 5.17157 21.5 6 21.5H15C16.4587 21.5 17.8576 20.9205 18.8891 19.8891C19.9205 18.8576 20.5 17.4587 20.5 16C20.5 14.5413 19.9205 13.1424 18.8891 12.1109C18.6781 11.9 18.4518 11.7079 18.2128 11.5359C19.041 10.5492 19.5 9.29829 19.5 8C19.5 6.54131 18.9205 5.14236 17.8891 4.11091C16.8576 3.07946 15.4587 2.5 14 2.5H6ZM14 10.5C14.663 10.5 15.2989 10.2366 15.7678 9.76777C16.2366 9.29893 16.5 8.66304 16.5 8C16.5 7.33696 16.2366 6.70107 15.7678 6.23223C15.2989 5.76339 14.663 5.5 14 5.5H7.5V10.5H14ZM7.5 18.5V13.5H15C15.663 13.5 16.2989 13.7634 16.7678 14.2322C17.2366 14.7011 17.5 15.337 17.5 16C17.5 16.663 17.2366 17.2989 16.7678 17.7678C16.2989 18.2366 15.663 18.5 15 18.5H7.5Z",fill:"currentColor"},null)])}}),U=e.defineComponent({name:"ItalicIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{d:"M15.0222 3H19C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H15.693L10.443 19H14C14.5523 19 15 19.4477 15 20C15 20.5523 14.5523 21 14 21H9.02418C9.00802 21.0004 8.99181 21.0004 8.97557 21H5C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19H8.30704L13.557 5H10C9.44772 5 9 4.55228 9 4C9 3.44772 9.44772 3 10 3H14.9782C14.9928 2.99968 15.0075 2.99967 15.0222 3Z",fill:"currentColor"},null)])}}),$=e.defineComponent({name:"StrikeIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{d:"M9.00039 3H16.0001C16.5524 3 17.0001 3.44772 17.0001 4C17.0001 4.55229 16.5524 5 16.0001 5H9.00011C8.68006 4.99983 8.36412 5.07648 8.07983 5.22349C7.79555 5.37051 7.55069 5.5836 7.36585 5.84487C7.181 6.10614 7.06155 6.40796 7.01754 6.72497C6.97352 7.04198 7.00623 7.36492 7.11292 7.66667C7.29701 8.18737 7.02414 8.75872 6.50344 8.94281C5.98274 9.1269 5.4114 8.85403 5.2273 8.33333C5.01393 7.72984 4.94851 7.08396 5.03654 6.44994C5.12456 5.81592 5.36346 5.21229 5.73316 4.68974C6.10285 4.1672 6.59256 3.74101 7.16113 3.44698C7.72955 3.15303 8.36047 2.99975 9.00039 3Z",fill:"currentColor"},null),e.createVNode("path",{d:"M18 13H20C20.5523 13 21 12.5523 21 12C21 11.4477 20.5523 11 20 11H4C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H14C14.7956 13 15.5587 13.3161 16.1213 13.8787C16.6839 14.4413 17 15.2044 17 16C17 16.7956 16.6839 17.5587 16.1213 18.1213C15.5587 18.6839 14.7956 19 14 19H6C5.44772 19 5 19.4477 5 20C5 20.5523 5.44772 21 6 21H14C15.3261 21 16.5979 20.4732 17.5355 19.5355C18.4732 18.5979 19 17.3261 19 16C19 14.9119 18.6453 13.8604 18 13Z",fill:"currentColor"},null)])}}),j=e.defineComponent({name:"UnderlineIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4V10C5 11.8565 5.7375 13.637 7.05025 14.9497C8.36301 16.2625 10.1435 17 12 17C13.8565 17 15.637 16.2625 16.9497 14.9497C18.2625 13.637 19 11.8565 19 10V4C19 3.44772 18.5523 3 18 3C17.4477 3 17 3.44772 17 4V10C17 11.3261 16.4732 12.5979 15.5355 13.5355C14.5979 14.4732 13.3261 15 12 15C10.6739 15 9.40215 14.4732 8.46447 13.5355C7.52678 12.5979 7 11.3261 7 10V4ZM4 19C3.44772 19 3 19.4477 3 20C3 20.5523 3.44772 21 4 21H20C20.5523 21 21 20.5523 21 20C21 19.4477 20.5523 19 20 19H4Z",fill:"currentColor"},null)])}}),Be=e.defineComponent({name:"TextStyleButton",setup(){const t=e.inject("editor");return()=>e.createVNode("div",null,[e.createVNode(w,{icon:S,tooltip:"粗体",isActive:t?.value?.isActive("bold"),onClick:()=>t?.value?.chain().focus().toggleBold().run()},null),e.createVNode(w,{icon:U,tooltip:"斜体",isActive:t?.value?.isActive("italic"),onClick:()=>t?.value?.chain().focus().toggleItalic().run()},null),e.createVNode(w,{icon:$,tooltip:"删除线",isActive:t?.value?.isActive("strike"),onClick:()=>t?.value?.chain().focus().toggleStrike().run()},null),e.createVNode(w,{icon:j,tooltip:"下划线",isActive:t?.value?.isActive("underline"),onClick:()=>t?.value?.chain().focus().toggleUnderline().run()},null),e.createVNode(ke,null,null)])}}),z=e.defineComponent({name:"AlignLeftIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H15C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H17C17.5523 17 18 17.4477 18 18C18 18.5523 17.5523 19 17 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"},null)])}}),O=e.defineComponent({name:"AlignCenterIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 18C4 17.4477 4.44772 17 5 17H19C19.5523 17 20 17.4477 20 18C20 18.5523 19.5523 19 19 19H5C4.44772 19 4 18.5523 4 18Z",fill:"currentColor"},null)])}}),q=e.defineComponent({name:"AlignRightIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 12C8 11.4477 8.44772 11 9 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H9C8.44772 13 8 12.5523 8 12Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6 18C6 17.4477 6.44772 17 7 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H7C6.44772 19 6 18.5523 6 18Z",fill:"currentColor"},null)])}}),be=e.defineComponent({name:"AlignJustifyIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"},null)])}}),Ee=e.defineComponent({name:"TextAlignButton",setup(){const t=e.inject("editor");return()=>e.createVNode("div",null,[e.createVNode(w,{icon:z,tooltip:"左边对齐",isActive:t?.value?.isActive({textAlign:"left"}),onClick:()=>t?.value?.chain().focus().setTextAlign("left").run()},null),e.createVNode(w,{icon:O,tooltip:"中间对齐",isActive:t?.value?.isActive({textAlign:"center"}),onClick:()=>t?.value?.chain().focus().setTextAlign("center").run()},null),e.createVNode(w,{icon:q,tooltip:"右边对齐",isActive:t?.value?.isActive({textAlign:"right"}),onClick:()=>t?.value?.chain().focus().setTextAlign("right").run()},null),e.createVNode(w,{icon:be,tooltip:"两端对齐",isActive:t?.value?.isActive({textAlign:"justify"}),onClick:()=>t?.value?.chain().focus().setTextAlign("justify").run()},null)])}}),He=e.defineComponent({name:"ListIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7 6C7 5.44772 7.44772 5 8 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H8C7.44772 7 7 6.55228 7 6Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7 12C7 11.4477 7.44772 11 8 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H8C7.44772 13 7 12.5523 7 12Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7 18C7 17.4477 7.44772 17 8 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H8C7.44772 19 7 18.5523 7 18Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H3.01C3.56228 5 4.01 5.44772 4.01 6C4.01 6.55228 3.56228 7 3.01 7H3C2.44772 7 2 6.55228 2 6Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 11.4477 2.44772 11 3 11H3.01C3.56228 11 4.01 11.4477 4.01 12C4.01 12.5523 3.56228 13 3.01 13H3C2.44772 13 2 12.5523 2 12Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 18C2 17.4477 2.44772 17 3 17H3.01C3.56228 17 4.01 17.4477 4.01 18C4.01 18.5523 3.56228 19 3.01 19H3C2.44772 19 2 18.5523 2 18Z",fill:"currentColor"},null)])}}),Me=e.defineComponent({name:"ListOrderedIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 6C9 5.44772 9.44772 5 10 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H10C9.44772 7 9 6.55228 9 6Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 12C9 11.4477 9.44772 11 10 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H10C9.44772 13 9 12.5523 9 12Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 18C9 17.4477 9.44772 17 10 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H10C9.44772 19 9 18.5523 9 18Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 6C3 5.44772 3.44772 5 4 5H5C5.55228 5 6 5.44772 6 6V10C6 10.5523 5.55228 11 5 11C4.44772 11 4 10.5523 4 10V7C3.44772 7 3 6.55228 3 6Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 10C3 9.44772 3.44772 9 4 9H6C6.55228 9 7 9.44772 7 10C7 10.5523 6.55228 11 6 11H4C3.44772 11 3 10.5523 3 10Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.82219 13.0431C6.54543 13.4047 6.99997 14.1319 6.99997 15C6.99997 15.5763 6.71806 16.0426 6.48747 16.35C6.31395 16.5814 6.1052 16.8044 5.91309 17H5.99997C6.55226 17 6.99997 17.4477 6.99997 18C6.99997 18.5523 6.55226 19 5.99997 19H3.99997C3.44769 19 2.99997 18.5523 2.99997 18C2.99997 17.4237 3.28189 16.9575 3.51247 16.65C3.74323 16.3424 4.03626 16.0494 4.26965 15.8161C4.27745 15.8083 4.2852 15.8006 4.29287 15.7929C4.55594 15.5298 4.75095 15.3321 4.88748 15.15C4.96287 15.0495 4.99021 14.9922 4.99911 14.9714C4.99535 14.9112 4.9803 14.882 4.9739 14.8715C4.96613 14.8588 4.95382 14.845 4.92776 14.8319C4.87723 14.8067 4.71156 14.7623 4.44719 14.8944C3.95321 15.1414 3.35254 14.9412 3.10555 14.4472C2.85856 13.9533 3.05878 13.3526 3.55276 13.1056C4.28839 12.7378 5.12272 12.6934 5.82219 13.0431Z",fill:"currentColor"},null)])}}),Ae=e.defineComponent({name:"ListTodoIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 6C2 4.89543 2.89543 4 4 4H8C9.10457 4 10 4.89543 10 6V10C10 11.1046 9.10457 12 8 12H4C2.89543 12 2 11.1046 2 10V6ZM8 6H4V10H8V6Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.70711 14.2929C10.0976 14.6834 10.0976 15.3166 9.70711 15.7071L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071L2.29289 17.7071C1.90237 17.3166 1.90237 16.6834 2.29289 16.2929C2.68342 15.9024 3.31658 15.9024 3.70711 16.2929L5 17.5858L8.29289 14.2929C8.68342 13.9024 9.31658 13.9024 9.70711 14.2929Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 6C12 5.44772 12.4477 5 13 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H13C12.4477 7 12 6.55228 12 6Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 12C12 11.4477 12.4477 11 13 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H13C12.4477 13 12 12.5523 12 12Z",fill:"currentColor"},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 18C12 17.4477 12.4477 17 13 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H13C12.4477 19 12 18.5523 12 18Z",fill:"currentColor"},null)])}}),ye=e.defineComponent({name:"ListButton",setup(){const t=e.inject("editor");return()=>e.createVNode("div",null,[e.createVNode(w,{icon:He,tooltip:"无序列表",isActive:t?.value?.isActive("bulletList"),onClick:()=>t?.value?.chain().focus().toggleBulletList().run()},null),e.createVNode(w,{icon:Me,tooltip:"有序列表",isActive:t?.value?.isActive("orderedList"),onClick:()=>t?.value?.chain().focus().toggleOrderedList().run()},null),e.createVNode(w,{icon:Ae,tooltip:"任务列表",isActive:t?.value?.isActive("taskList"),onClick:()=>t?.value?.chain().focus().toggleTaskList().run()},null)])}}),Ie=e.defineComponent({name:"ImagePlusIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20 2C20 1.44772 19.5523 1 19 1C18.4477 1 18 1.44772 18 2V4H16C15.4477 4 15 4.44772 15 5C15 5.55228 15.4477 6 16 6H18V8C18 8.55228 18.4477 9 19 9C19.5523 9 20 8.55228 20 8V6H22C22.5523 6 23 5.55228 23 5C23 4.44772 22.5523 4 22 4H20V2ZM5 4C4.73478 4 4.48043 4.10536 4.29289 4.29289C4.10536 4.48043 4 4.73478 4 5V19C4 19.2652 4.10536 19.5196 4.29289 19.7071C4.48043 19.8946 4.73478 20 5 20H5.58579L14.379 11.2068C14.9416 10.6444 15.7045 10.3284 16.5 10.3284C17.2955 10.3284 18.0584 10.6444 18.621 11.2068L20 12.5858V12C20 11.4477 20.4477 11 21 11C21.5523 11 22 11.4477 22 12V14.998C22 14.9994 22 15.0007 22 15.002V19C22 19.7957 21.6839 20.5587 21.1213 21.1213C20.5587 21.6839 19.7957 22 19 22H6.00219C6.00073 22 5.99927 22 5.99781 22H5C4.20435 22 3.44129 21.6839 2.87868 21.1213C2.31607 20.5587 2 19.7957 2 19V5C2 4.20435 2.31607 3.44129 2.87868 2.87868C3.44129 2.31607 4.20435 2 5 2H12C12.5523 2 13 2.44772 13 3C13 3.55228 12.5523 4 12 4H5ZM8.41422 20H19C19.2652 20 19.5196 19.8946 19.7071 19.7071C19.8946 19.5196 20 19.2652 20 19V15.4142L17.207 12.6212C17.0195 12.4338 16.7651 12.3284 16.5 12.3284C16.2349 12.3284 15.9806 12.4337 15.7931 12.6211L8.41422 20ZM6.87868 6.87868C7.44129 6.31607 8.20435 6 9 6C9.79565 6 10.5587 6.31607 11.1213 6.87868C11.6839 7.44129 12 8.20435 12 9C12 9.79565 11.6839 10.5587 11.1213 11.1213C10.5587 11.6839 9.79565 12 9 12C8.20435 12 7.44129 11.6839 6.87868 11.1213C6.31607 10.5587 6 9.79565 6 9C6 8.20435 6.31607 7.44129 6.87868 6.87868ZM9 8C8.73478 8 8.48043 8.10536 8.29289 8.29289C8.10536 8.48043 8 8.73478 8 9C8 9.26522 8.10536 9.51957 8.29289 9.70711C8.48043 9.89464 8.73478 10 9 10C9.26522 10 9.51957 9.89464 9.70711 9.70711C9.89464 9.51957 10 9.26522 10 9C10 8.73478 9.89464 8.48043 9.70711 8.29289C9.51957 8.10536 9.26522 8 9 8Z",fill:"currentColor"},null)])}}),Le=e.defineComponent({name:"ImageButton",setup(){const t=e.inject("editor");return()=>e.createVNode("div",null,[e.createVNode(w,{icon:Ie,tooltip:"图片",onClick:()=>t?.value?.commands.setImageUploadNode()},null)])}}),ve=e.defineComponent({name:"TableIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 5C2 3.34315 3.34315 2 5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5ZM4 5C4 4.44772 4.44772 4 5 4H11V8H4V5ZM4 10H11V14H4V10ZM20 14V10H13V14H20ZM13 16H20V19C20 19.5523 19.5523 20 19 20H13V16ZM11 16V20H5C4.44772 20 4 19.5523 4 19V16H11ZM13 8H20V5C20 4.44772 19.5523 4 19 4H13V8Z",fill:"currentColor"},null)])}}),Te=8,De=8,_e=e.defineComponent({name:"TableButton",setup(){const t=e.inject("editor"),o=e.ref(!1),n=e.ref(0),r=e.ref(0),c=(V,m)=>{n.value=V,r.value=m},a=()=>{n.value=0,r.value=0},g=(V,m)=>{t?.value?.chain().focus().insertTable({rows:m,cols:V,withHeaderRow:!0}).run(),o.value=!1};return()=>e.createVNode(u.ElPopover,{visible:o.value,"onUpdate:visible":V=>o.value=V,trigger:"click",placement:"bottom-start",popperClass:"table-picker-popper",width:"auto",showArrow:!1},{reference:()=>e.createVNode("span",null,[e.createVNode(u.ElTooltip,{content:"表格",showArrow:!1,offset:6,disabled:o.value},{default:()=>[e.createVNode(u.ElButton,{text:!0,class:["tiptap-button",{"is-active":o.value}]},{default:()=>[e.createVNode(ve,{class:"tiptap-button-icon"},null)]})]})]),default:()=>e.createVNode("div",{class:"table-picker"},[e.createVNode("div",{class:"table-picker-grid",onMouseleave:a},[Array.from({length:De},(V,m)=>e.createVNode("div",{key:m,class:"table-picker-row"},[Array.from({length:Te},(C,l)=>e.createVNode("div",{key:l,class:["table-picker-cell",{"is-active":l<n.value&&m<r.value}],onMouseenter:()=>c(l+1,m+1),onClick:()=>g(l+1,m+1)},null))]))]),e.createVNode("div",{class:"table-picker-footer"},[e.createVNode("div",{class:"table-picker-counter"},[e.createVNode("span",null,[e.createTextVNode("列")]),e.createVNode("span",null,[n.value||1])]),e.createVNode("span",{class:"table-picker-x"},[e.createTextVNode("x")]),e.createVNode("div",{class:"table-picker-counter"},[e.createVNode("span",null,[e.createTextVNode("行")]),e.createVNode("span",null,[r.value||1])])])])})}});function Ze(t){let o=t.nodeType===Node.TEXT_NODE?t.parentElement:t;for(;o&&o instanceof HTMLElement;){if(o.tagName==="TD"||o.tagName==="TH")return o;o=o.parentElement}return null}function Fe(t){if(!t.isActive("tableCell")&&!t.isActive("tableHeader"))return null;const{node:o}=t.view.domAtPos(t.state.selection.from),n=Ze(o);if(!n)return null;const r=n.parentElement,c=r.parentElement,a=n.closest("table");if(!a)return null;const g=Array.from(r.children).indexOf(n),V=Array.from(c.children).indexOf(r),m=r.children.length,C=c.children.length,l=n.getBoundingClientRect(),i=a.getBoundingClientRect(),d=t.view.dom.closest(".tiptap-editor").getBoundingClientRect();return{cell:n,colIndex:g,rowIndex:V,totalCols:m,totalRows:C,cellRect:l,tableRect:i,editorRect:d}}function P(t){const{state:o}=t,n=o.selection.from;let r=null;return o.doc.nodesBetween(0,o.doc.content.size,(c,a)=>{if(c.type.name==="table"&&a<=n&&n<=a+c.nodeSize)return r={node:c,pos:a},!1}),r}const Re=e.defineComponent({name:"TableControls",setup(){const t=e.inject("editor"),o=e.ref(null),n=e.ref(null);function r(){const C=t?.value;if(n.value&&(n.value.classList.remove("tcc-cell-focused"),n.value=null),!C){o.value=null;return}const l=Fe(C);o.value=l,l&&(l.cell.classList.add("tcc-cell-focused"),n.value=l.cell)}e.watchEffect(C=>{const l=t?.value;l&&(l.on("selectionUpdate",r),l.on("transaction",r),C(()=>{l.off("selectionUpdate",r),l.off("transaction",r),n.value&&(n.value.classList.remove("tcc-cell-focused"),n.value=null)}))});function c(C){const l=t?.value;if(!l||!o.value)return;const{colIndex:i,totalCols:d}=o.value,x=C==="left"?i-1:i+1;if(x<0||x>=d)return;const b=P(l);if(!b)return;const{node:N,pos:s}=b,p=[];N.forEach(k=>{if(k.type.name!=="tableRow"){p.push(k);return}const E=[];k.forEach(v=>E.push(v));const L=E[i];E[i]=E[x],E[x]=L,p.push(k.type.create(k.attrs,E,k.marks))});const f=N.type.create(N.attrs,p,N.marks),B=l.state.tr.replaceWith(s,s+N.nodeSize,f);l.view.dispatch(B)}function a(C){const l=t?.value;if(!l||!o.value)return;const{rowIndex:i,totalRows:d}=o.value,x=C==="up"?i-1:i+1;if(x<0||x>=d)return;const b=P(l);if(!b)return;const{node:N,pos:s}=b,p=[];N.forEach(E=>p.push(E));const f=p[i];p[i]=p[x],p[x]=f;const B=N.type.create(N.attrs,p,N.marks),k=l.state.tr.replaceWith(s,s+N.nodeSize,B);l.view.dispatch(k)}const g=()=>e.createVNode("svg",{width:"16",height:"4",viewBox:"0 0 16 4",fill:"currentColor"},[e.createVNode("circle",{cx:"2",cy:"2",r:"1.5"},null),e.createVNode("circle",{cx:"8",cy:"2",r:"1.5"},null),e.createVNode("circle",{cx:"14",cy:"2",r:"1.5"},null)]),V=()=>e.createVNode("svg",{width:"4",height:"16",viewBox:"0 0 4 16",fill:"currentColor"},[e.createVNode("circle",{cx:"2",cy:"2",r:"1.5"},null),e.createVNode("circle",{cx:"2",cy:"8",r:"1.5"},null),e.createVNode("circle",{cx:"2",cy:"14",r:"1.5"},null)]),m=()=>e.createVNode("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},[e.createVNode("path",{d:"M5 1v8M1 5h8"},null)]);return()=>{const C=o.value;if(!C)return null;const{colIndex:l,rowIndex:i,totalCols:d,totalRows:x,cellRect:b,tableRect:N,editorRect:s}=C,p=N.top-s.top,f=N.left-s.left,B=N.right-s.left,k=N.bottom-s.top,E=b.left-s.left,L=b.top-s.top,v=b.width,W=b.height,lt={position:"absolute",top:`${p-20}px`,left:`${E+v/2-18}px`},rt={position:"absolute",top:`${L+W/2-18}px`,left:`${f-20}px`},it={position:"absolute",top:`${L+W/2-12}px`,left:`${B+6}px`},at={position:"absolute",top:`${k+6}px`,left:`${E+v/2-12}px`},ct=l===0,K=l===d-1,dt=i===0,G=i===x-1,M=t?.value;return e.createVNode("div",{class:"table-cell-controls"},[e.createVNode(u.ElDropdown,{trigger:"click",placement:"bottom",style:lt,onCommand:H=>{H==="move-left"?c("left"):H==="move-right"?c("right"):H==="insert-left"?M?.chain().focus().addColumnBefore().run():H==="insert-right"?M?.chain().focus().addColumnAfter().run():H==="delete"&&M?.chain().focus().deleteColumn().run()}},{default:()=>[e.createVNode("button",{class:"tcc-btn tcc-btn--col"},[e.createVNode(g,null,null)])],dropdown:()=>e.createVNode(u.ElDropdownMenu,null,{default:()=>[e.createVNode(u.ElDropdownItem,{command:"move-left",disabled:ct},{default:()=>[e.createTextVNode("移动列到左侧")]}),e.createVNode(u.ElDropdownItem,{command:"move-right",disabled:K},{default:()=>[e.createTextVNode("移动列到右侧")]}),e.createVNode(u.ElDropdownItem,{command:"insert-left"},{default:()=>[e.createTextVNode("在左侧插入一列")]}),e.createVNode(u.ElDropdownItem,{command:"insert-right"},{default:()=>[e.createTextVNode("在右侧插入一列")]}),e.createVNode(u.ElDropdownItem,{command:"delete",divided:!0},{default:()=>[e.createTextVNode("删除列")]})]})}),e.createVNode(u.ElDropdown,{trigger:"click",placement:"right",style:rt,onCommand:H=>{H==="move-up"?a("up"):H==="move-down"?a("down"):H==="insert-above"?M?.chain().focus().addRowBefore().run():H==="insert-below"?M?.chain().focus().addRowAfter().run():H==="delete"&&M?.chain().focus().deleteRow().run()}},{default:()=>[e.createVNode("button",{class:"tcc-btn tcc-btn--row"},[e.createVNode(V,null,null)])],dropdown:()=>e.createVNode(u.ElDropdownMenu,null,{default:()=>[e.createVNode(u.ElDropdownItem,{command:"move-up",disabled:dt},{default:()=>[e.createTextVNode("上移")]}),e.createVNode(u.ElDropdownItem,{command:"move-down",disabled:G},{default:()=>[e.createTextVNode("下移")]}),e.createVNode(u.ElDropdownItem,{command:"insert-above"},{default:()=>[e.createTextVNode("在上方插入一行")]}),e.createVNode(u.ElDropdownItem,{command:"insert-below"},{default:()=>[e.createTextVNode("在下方插入一行")]}),e.createVNode(u.ElDropdownItem,{command:"delete",divided:!0},{default:()=>[e.createTextVNode("删除行")]})]})}),K&&e.createVNode("button",{class:"tcc-btn tcc-btn--add",style:it,onClick:()=>M?.chain().focus().addColumnAfter().run()},[e.createVNode(m,null,null)]),G&&e.createVNode("button",{class:"tcc-btn tcc-btn--add",style:at,onClick:()=>M?.chain().focus().addRowAfter().run()},[e.createVNode(m,null,null)])])}}}),Se=e.defineComponent({name:"MathIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 4.8c.1-.5.5-.8 1-.8h10a1 1 0 1 1 0 2h-9.2L8.3 19.2a1 1 0 0 1-1.7.4l-3.4-4.2a1 1 0 0 1 1.6-1.2l2 2.5L9 4.8Zm9.7 5.5c.4.4.4 1 0 1.4L17 13.5l1.8 1.8a1 1 0 1 1-1.4 1.4L15.5 15l-1.8 1.8a1 1 0 0 1-1.4-1.4l1.8-1.8-1.8-1.8a1 1 0 0 1 1.4-1.4l1.8 1.8 1.8-1.8a1 1 0 0 1 1.4 0Z",fill:"currentColor"},null)])}}),Ue=e.defineComponent({name:"MathButton",setup(){const t=e.inject("editor"),o=e.inject("openMathDialog");return()=>e.createVNode(w,{icon:Se,tooltip:"数学公式",isActive:t?.value?.isActive("inlineMath")||t?.value?.isActive("blockMath"),onClick:()=>o?.()},null)}}),$e={class:"math-dialog"},je={key:0,class:"math-preview__placeholder"},ze=["innerHTML"],Oe=((t,o)=>{const n=t.__vccOpts||t;for(const[r,c]of o)n[r]=c;return n})(e.defineComponent({__name:"MathEditDialog",props:{visible:{type:Boolean},latex:{},pos:{},type:{}},emits:["update:visible"],setup(t,{emit:o}){const n=t,r=o,c=e.inject("editor"),a=e.ref(""),g=e.ref("inline");e.watch(()=>n.latex,l=>{a.value=l},{immediate:!0}),e.watch(()=>n.type,l=>{g.value=l},{immediate:!0});const V=e.computed(()=>n.pos===null),m=e.computed(()=>a.value.trim()?oe.renderToString(a.value,{displayMode:g.value==="block",throwOnError:!1}):""),C=()=>{const l=c?.value;if(!(!l||!a.value.trim())){if(V.value)g.value==="inline"?l.chain().focus().insertInlineMath({latex:a.value}).run():l.chain().focus().insertBlockMath({latex:a.value}).run();else if(g.value===n.type)n.type==="inline"?l.commands.updateInlineMath({latex:a.value,pos:n.pos}):l.commands.updateBlockMath({latex:a.value,pos:n.pos});else{const i=n.pos;n.type==="inline"?l.chain().focus().deleteInlineMath({pos:i}).insertBlockMath({latex:a.value}).run():l.chain().focus().deleteBlockMath({pos:i}).insertInlineMath({latex:a.value}).run()}r("update:visible",!1)}};return(l,i)=>(e.openBlock(),e.createBlock(e.unref(u.ElDialog),{"model-value":t.visible,title:V.value?"插入数学公式":"编辑数学公式",width:"520px","onUpdate:modelValue":i[3]||(i[3]=d=>r("update:visible",d))},{footer:e.withCtx(()=>[e.createVNode(e.unref(u.ElButton),{onClick:i[2]||(i[2]=d=>r("update:visible",!1))},{default:e.withCtx(()=>[...i[6]||(i[6]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(u.ElButton),{type:"primary",disabled:!a.value.trim(),onClick:C},{default:e.withCtx(()=>[...i[7]||(i[7]=[e.createTextVNode("确认",-1)])]),_:1},8,["disabled"])]),default:e.withCtx(()=>[e.createElementVNode("div",$e,[e.createVNode(e.unref(u.ElRadioGroup),{modelValue:g.value,"onUpdate:modelValue":i[0]||(i[0]=d=>g.value=d)},{default:e.withCtx(()=>[e.createVNode(e.unref(u.ElRadioButton),{value:"inline"},{default:e.withCtx(()=>[...i[4]||(i[4]=[e.createTextVNode("行内公式",-1)])]),_:1}),e.createVNode(e.unref(u.ElRadioButton),{value:"block"},{default:e.withCtx(()=>[...i[5]||(i[5]=[e.createTextVNode("块级公式",-1)])]),_:1})]),_:1},8,["modelValue"]),e.createVNode(e.unref(u.ElInput),{modelValue:a.value,"onUpdate:modelValue":i[1]||(i[1]=d=>a.value=d),type:"textarea",rows:3,placeholder:"请输入 LaTeX 公式,例如:E=mc^2"},null,8,["modelValue"]),e.createElementVNode("div",{class:e.normalizeClass(["math-preview",{"math-preview--empty":!m.value}])},[m.value?(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:m.value},null,8,ze)):(e.openBlock(),e.createElementBlock("span",je,"预览将在此处显示"))],2)])]),_:1},8,["model-value","title"]))}}),[["__scopeId","data-v-995dc22f"]]),qe=[{value:"left",title:"居左",Icon:z},{value:"center",title:"居中",Icon:O},{value:"right",title:"居右",Icon:q}],I=t=>t.preventDefault();function Pe(t){if(!t.isActive("image"))return null;const{selection:o}=t.state;if(!(o instanceof _.NodeSelection)||o.node.type.name!=="image")return null;const n=o.node;return{pos:o.from,nodeSize:n.nodeSize,src:n.attrs.src,align:n.attrs.align??"left"}}function We(t){const o=t.startsWith("data:")?"image.png":t.split("/").pop()?.split("?")[0]||"image.png",n=document.createElement("a");n.href=t,n.download=o,document.body.appendChild(n),n.click(),document.body.removeChild(n)}const Ke=()=>e.createVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},null),e.createVNode("polyline",{points:"7 10 12 15 17 10"},null),e.createVNode("line",{x1:"12",y1:"15",x2:"12",y2:"3"},null)]),Ge=()=>e.createVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createVNode("polyline",{points:"1 4 1 10 7 10"},null),e.createVNode("path",{d:"M3.51 15a9 9 0 1 0 .49-4.1L1 10"},null)]),Je=()=>e.createVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createVNode("polyline",{points:"3 6 5 6 21 6"},null),e.createVNode("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"},null),e.createVNode("path",{d:"M10 11v6M14 11v6"},null),e.createVNode("path",{d:"M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"},null)]),Xe=e.defineComponent({name:"ImageControls",setup(){const t=e.inject("editor"),o=e.ref(null);function n(){const r=t?.value;if(!r){o.value=null;return}o.value=Pe(r)}return e.watchEffect(r=>{const c=t?.value;c&&(c.on("transaction",n),r(()=>{c.off("transaction",n)}))}),()=>{const r=o.value;if(!r)return null;const c=t?.value;if(!c)return null;const{pos:a,nodeSize:g,src:V,align:m}=r,C=c.view.nodeDOM(a);if(!C||!(C instanceof HTMLElement))return null;const l=C.querySelector("[data-resize-wrapper]")??C,i=c.view.dom.closest(".tiptap-editor");if(!i)return null;const d=l.getBoundingClientRect(),x=i.getBoundingClientRect(),b={position:"absolute",top:`${d.top-x.top}px`,left:`${d.left-x.left+d.width/2}px`,transform:"translate(-50%, calc(-100% - 8px))",zIndex:20};return e.createVNode("div",{class:"image-controls",style:b},[qe.map(({value:N,title:s,Icon:p})=>e.createVNode("button",{key:N,class:["image-controls-btn",m===N&&"is-active"],title:s,onMousedown:I,onClick:()=>c.chain().focus().updateAttributes("image",{align:N}).run()},[e.createVNode(p,null,null)])),e.createVNode("span",{class:"image-controls-separator"},null),e.createVNode("button",{class:"image-controls-btn",title:"下载",onMousedown:I,onClick:()=>We(V)},[e.createVNode(Ke,null,null)]),e.createVNode("button",{class:"image-controls-btn",title:"重新上传",onMousedown:I,onClick:()=>c.chain().focus().deleteRange({from:a,to:a+g}).insertContentAt(a,{type:"imageUpload"}).run()},[e.createVNode(Ge,null,null)]),e.createVNode("button",{class:"image-controls-btn",title:"删除",onMousedown:I,onClick:()=>c.chain().focus().deleteRange({from:a,to:a+g}).run()},[e.createVNode(Je,null,null)])])}}}),Qe=e.defineComponent({name:"CodeBlockIcon",setup(t,{attrs:o}){return()=>e.createVNode("svg",e.mergeProps({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},o),[e.createVNode("polyline",{points:"16 18 22 12 16 6"},null),e.createVNode("polyline",{points:"8 6 2 12 8 18"},null)])}}),Ye=e.defineComponent({name:"CodeBlockButton",setup(){const t=e.inject("editor");return()=>e.createVNode(w,{icon:Qe,tooltip:"代码块",isActive:t?.value?.isActive("codeBlock"),onClick:()=>t?.value?.chain().focus().toggleCodeBlock().run()},null)}}),et=e.defineComponent({name:"BubbleMenuBar",setup(){const t=e.inject("editor");return()=>t?.value?e.createVNode(ne.BubbleMenu,{editor:t.value,class:"bubble-menu",options:{placement:"top",offset:{mainAxis:8}},shouldShow:o=>{const{editor:n,from:r,to:c}=o;return!(r===c||n.isActive("image")||n.isActive("table"))}},{default:()=>[e.createVNode("div",{class:"bubble-menu-content"},[e.createVNode(w,{icon:S,tooltip:"粗体",isActive:t.value.isActive("bold"),onClick:()=>t.value?.chain().focus().toggleBold().run()},null),e.createVNode(w,{icon:U,tooltip:"斜体",isActive:t.value.isActive("italic"),onClick:()=>t.value?.chain().focus().toggleItalic().run()},null),e.createVNode(w,{icon:$,tooltip:"删除线",isActive:t.value.isActive("strike"),onClick:()=>t.value?.chain().focus().toggleStrike().run()},null),e.createVNode(w,{icon:j,tooltip:"下划线",isActive:t.value.isActive("underline"),onClick:()=>t.value?.chain().focus().toggleUnderline().run()},null)])]}):null}}),tt={class:"tiptap-editor"},ot={class:"tiptap-toolbar"},nt=e.defineComponent({__name:"TiptapEditor",props:{modelValue:{default:""},placeholder:{default:"请输入内容..."},upload:{}},emits:["update:modelValue"],setup(t,{emit:o}){const n=D.createLowlight(D.common),r=t,c=o,a=e.ref(!1),g=e.ref(""),V=e.ref(null),m=e.ref("inline"),C=(i={})=>{g.value=i.latex??"",V.value=i.pos??null,m.value=i.type??"inline",a.value=!0};e.provide("openMathDialog",C);const l=A.useEditor({content:r.modelValue,extensions:[J.configure({codeBlock:!1,link:{openOnClick:!1,enableClickSelection:!0}}),Q.Placeholder.configure({placeholder:r.placeholder}),Y.CodeBlockLowlight.configure({lowlight:n,defaultLanguage:"plaintext"}),X.TextAlign.configure({types:["heading","paragraph"]}),T.TaskList,T.TaskItem.configure({nested:!0}),R.configure({allowBase64:!0,resize:{enabled:!0,directions:["top","right","bottom","left","top-right","top-left","bottom-right","bottom-left"],minWidth:50,minHeight:50,alwaysPreserveAspectRatio:!1}}),Ce.configure({...r.upload?{upload:r.upload}:{}}),y.Table.configure({resizable:!0}),y.TableRow,y.TableHeader,y.TableCell,te.Mathematics.configure({inlineOptions:{onClick:(i,d)=>C({latex:i.attrs.latex,pos:d,type:"inline"})},blockOptions:{onClick:(i,d)=>C({latex:i.attrs.latex,pos:d,type:"block"})}})],onUpdate:({editor:i})=>{c("update:modelValue",i.getHTML())}});return e.provide("editor",l),e.watch(()=>r.modelValue,i=>{l.value&&i!==l.value.getHTML()&&l.value.commands.setContent(i,{emitUpdate:!1})}),(i,d)=>(e.openBlock(),e.createElementBlock("div",tt,[e.createElementVNode("div",ot,[e.createVNode(e.unref(ge)),d[1]||(d[1]=e.createElementVNode("div",{class:"tiptap-separator"},null,-1)),e.createVNode(e.unref(Be)),e.createVNode(e.unref(Ye)),d[2]||(d[2]=e.createElementVNode("div",{class:"tiptap-separator"},null,-1)),e.createVNode(e.unref(ye)),d[3]||(d[3]=e.createElementVNode("div",{class:"tiptap-separator"},null,-1)),e.createVNode(e.unref(Ee)),d[4]||(d[4]=e.createElementVNode("div",{class:"tiptap-separator"},null,-1)),e.createVNode(e.unref(Le)),e.createVNode(e.unref(_e)),e.createVNode(e.unref(Ue))]),e.createVNode(e.unref(A.EditorContent),{class:"tiptap-content",editor:e.unref(l)},null,8,["editor"]),e.createVNode(e.unref(et)),e.createVNode(e.unref(Re)),e.createVNode(e.unref(Xe)),e.createVNode(Oe,{visible:a.value,"onUpdate:visible":d[0]||(d[0]=x=>a.value=x),latex:g.value,pos:V.value,type:m.value},null,8,["visible","latex","pos","type"])]))}});h.IconButton=w,h.ImageWithAlign=R,h.TiptapEditor=nt,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}));
|