v-code-diff.js 184 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378
  1. import "./chunk-MKUMB4YM.js";
  2. import "./chunk-S6VK5PVK.js";
  3. import {
  4. Fragment,
  5. computed,
  6. createBaseVNode,
  7. createBlock,
  8. createCommentVNode,
  9. createElementBlock,
  10. createVNode,
  11. defineComponent,
  12. openBlock,
  13. ref,
  14. renderList,
  15. renderSlot,
  16. unref,
  17. watch
  18. } from "./chunk-YVHZHMSQ.js";
  19. import {
  20. normalizeClass,
  21. normalizeStyle,
  22. toDisplayString
  23. } from "./chunk-VNBICN6T.js";
  24. import "./chunk-2LSFTFF7.js";
  25. // node_modules/.pnpm/v-code-diff@1.12.0_vue@3.4.27/node_modules/v-code-diff/dist/index.es.js
  26. (function() {
  27. "use strict";
  28. try {
  29. if (typeof document != "undefined") {
  30. var o = document.createElement("style");
  31. o.appendChild(document.createTextNode(".code-diff-view[theme=light]{color:var(--fgColor-default, var(--color-fg-default));background-color:var(--bgColor-default, var(--color-canvas-default));--color-canvas-default-transparent: rgba(255,255,255,0);--color-page-header-bg: #f6f8fa;--color-marketing-icon-primary: #218bff;--color-marketing-icon-secondary: #54aeff;--color-diff-blob-addition-num-text: #1F2328;--color-diff-blob-addition-fg: #1F2328;--color-diff-blob-addition-num-bg: #ccffd8;--color-diff-blob-addition-line-bg: #e6ffec;--color-diff-blob-addition-word-bg: #abf2bc;--color-diff-blob-deletion-num-text: #1F2328;--color-diff-blob-deletion-fg: #1F2328;--color-diff-blob-deletion-num-bg: #ffd7d5;--color-diff-blob-deletion-line-bg: #ffebe9;--color-diff-blob-deletion-word-bg: rgba(255,129,130,.4);--color-diff-blob-hunk-num-bg: rgba(84,174,255,.4);--color-diff-blob-expander-icon: #656d76;--color-diff-blob-selected-line-highlight-mix-blend-mode: multiply;--color-diffstat-deletion-border: rgba(31,35,40,.15);--color-diffstat-addition-border: rgba(31,35,40,.15);--color-diffstat-addition-bg: #1f883d;--color-search-keyword-hl: #fff8c5;--color-prettylights-syntax-comment: #6e7781;--color-prettylights-syntax-constant: #0550ae;--color-prettylights-syntax-entity: #6639ba;--color-prettylights-syntax-storage-modifier-import: #24292f;--color-prettylights-syntax-entity-tag: #116329;--color-prettylights-syntax-keyword: #cf222e;--color-prettylights-syntax-string: #0a3069;--color-prettylights-syntax-variable: #953800;--color-prettylights-syntax-brackethighlighter-unmatched: #82071e;--color-prettylights-syntax-invalid-illegal-text: #f6f8fa;--color-prettylights-syntax-invalid-illegal-bg: #82071e;--color-prettylights-syntax-carriage-return-text: #f6f8fa;--color-prettylights-syntax-carriage-return-bg: #cf222e;--color-prettylights-syntax-string-regexp: #116329;--color-prettylights-syntax-markup-list: #3b2300;--color-prettylights-syntax-markup-heading: #0550ae;--color-prettylights-syntax-markup-italic: #24292f;--color-prettylights-syntax-markup-bold: #24292f;--color-prettylights-syntax-markup-deleted-text: #82071e;--color-prettylights-syntax-markup-deleted-bg: #ffebe9;--color-prettylights-syntax-markup-inserted-text: #116329;--color-prettylights-syntax-markup-inserted-bg: #dafbe1;--color-prettylights-syntax-markup-changed-text: #953800;--color-prettylights-syntax-markup-changed-bg: #ffd8b5;--color-prettylights-syntax-markup-ignored-text: #eaeef2;--color-prettylights-syntax-markup-ignored-bg: #0550ae;--color-prettylights-syntax-meta-diff-range: #8250df;--color-prettylights-syntax-brackethighlighter-angle: #57606a;--color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;--color-prettylights-syntax-constant-other-reference-link: #0a3069;--color-codemirror-text: #1F2328;--color-codemirror-bg: #ffffff;--color-codemirror-gutters-bg: #ffffff;--color-codemirror-guttermarker-text: #ffffff;--color-codemirror-guttermarker-subtle-text: #6e7781;--color-codemirror-linenumber-text: #656d76;--color-codemirror-cursor: #1F2328;--color-codemirror-selection-bg: rgba(84,174,255,.4);--color-codemirror-activeline-bg: rgba(234,238,242,.5);--color-codemirror-matchingbracket-text: #1F2328;--color-codemirror-lines-bg: #ffffff;--color-codemirror-syntax-comment: #24292f;--color-codemirror-syntax-constant: #0550ae;--color-codemirror-syntax-entity: #8250df;--color-codemirror-syntax-keyword: #cf222e;--color-codemirror-syntax-storage: #cf222e;--color-codemirror-syntax-string: #0a3069;--color-codemirror-syntax-support: #0550ae;--color-codemirror-syntax-variable: #953800;--color-checks-bg: #24292f;--color-checks-run-border-width: 0px;--color-checks-container-border-width: 0px;--color-checks-text-primary: #f6f8fa;--color-checks-text-secondary: #8c959f;--color-checks-text-link: #54aeff;--color-checks-btn-icon: #afb8c1;--color-checks-btn-hover-icon: #f6f8fa;--color-checks-btn-hover-bg: rgba(255,255,255,.125);--color-checks-input-text: #eaeef2;--color-checks-input-placeholder-text: #8c959f;--color-checks-input-focus-text: #8c959f;--color-checks-input-bg: #32383f;--color-checks-input-shadow: none;--color-checks-donut-error: #fa4549;--color-checks-donut-pending: #bf8700;--color-checks-donut-success: #1f883d;--color-checks-donut-neutral: #afb8c1;--color-checks-dropdown-text: #afb8c1;--color-checks-dropdown-bg: #32383f;--color-checks-dropdown-border: #424a53;--color-checks-dropdown-shadow: rgba(31,35,40,.3);--color-checks-dropdown-hover-text: #f6f8fa;--color-checks-dropdown-hover-bg: #424a53;--color-checks-dropdown-btn-hover-text: #f6f8fa;--color-checks-dropdown-btn-hover-bg: #32383f;--color-checks-scrollbar-thumb-bg: #57606a;--color-checks-header-label-text: #d0d7de;--color-checks-header-label-open-text: #f6f8fa;--color-checks-header-border: #32383f;--color-checks-header-icon: #8c959f;--color-checks-line-text: #d0d7de;--color-checks-line-num-text: rgba(140,149,159,.75);--color-checks-line-timestamp-text: #8c959f;--color-checks-line-hover-bg: #32383f;--color-checks-line-selected-bg: rgba(33,139,255,.15);--color-checks-line-selected-num-text: #54aeff;--color-checks-line-dt-fm-text: #24292f;--color-checks-line-dt-fm-bg: #9a6700;--color-checks-gate-bg: rgba(125,78,0,.15);--color-checks-gate-text: #d0d7de;--color-checks-gate-waiting-text: #d4a72c;--color-checks-step-header-open-bg: #32383f;--color-checks-step-error-text: #ff8182;--color-checks-step-warning-text: #d4a72c;--color-checks-logline-text: #8c959f;--color-checks-logline-num-text: rgba(140,149,159,.75);--color-checks-logline-debug-text: #c297ff;--color-checks-logline-error-text: #d0d7de;--color-checks-logline-error-num-text: #ff8182;--color-checks-logline-error-bg: rgba(164,14,38,.15);--color-checks-logline-warning-text: #d0d7de;--color-checks-logline-warning-num-text: #d4a72c;--color-checks-logline-warning-bg: rgba(125,78,0,.15);--color-checks-logline-command-text: #54aeff;--color-checks-logline-section-text: #4ac26b;--color-checks-ansi-black: #24292f;--color-checks-ansi-black-bright: #32383f;--color-checks-ansi-white: #d0d7de;--color-checks-ansi-white-bright: #d0d7de;--color-checks-ansi-gray: #8c959f;--color-checks-ansi-red: #ff8182;--color-checks-ansi-red-bright: #ffaba8;--color-checks-ansi-green: #4ac26b;--color-checks-ansi-green-bright: #6fdd8b;--color-checks-ansi-yellow: #d4a72c;--color-checks-ansi-yellow-bright: #eac54f;--color-checks-ansi-blue: #54aeff;--color-checks-ansi-blue-bright: #80ccff;--color-checks-ansi-magenta: #c297ff;--color-checks-ansi-magenta-bright: #d8b9ff;--color-checks-ansi-cyan: #76e3ea;--color-checks-ansi-cyan-bright: #b3f0ff;--color-project-header-bg: #24292f;--color-project-sidebar-bg: #ffffff;--color-project-gradient-in: #ffffff;--color-project-gradient-out: rgba(255,255,255,0);--color-mktg-btn-bg: #1b1f23;--color-mktg-btn-shadow-outline: rgb(0 0 0 / 15%) 0 0 0 1px inset;--color-mktg-btn-shadow-focus: rgb(0 0 0 / 15%) 0 0 0 4px;--color-mktg-btn-shadow-hover: 0 3px 2px rgba(0, 0, 0, .07), 0 7px 5px rgba(0, 0, 0, .04), 0 12px 10px rgba(0, 0, 0, .03), 0 22px 18px rgba(0, 0, 0, .03), 0 42px 33px rgba(0, 0, 0, .02), 0 100px 80px rgba(0, 0, 0, .02);--color-mktg-btn-shadow-hover-muted: rgb(0 0 0 / 70%) 0 0 0 2px inset;--color-control-border-color-emphasis: #858F99;--color-avatar-bg: #ffffff;--color-avatar-border: rgba(31,35,40,.15);--color-avatar-stack-fade: #afb8c1;--color-avatar-stack-fade-more: #d0d7de;--color-avatar-child-shadow: 0 0 0 2px rgba(255,255,255,.8);--color-topic-tag-border: rgba(0,0,0,0);--color-counter-border: rgba(0,0,0,0);--color-select-menu-backdrop-border: rgba(0,0,0,0);--color-select-menu-tap-highlight: rgba(175,184,193,.5);--color-select-menu-tap-focus-bg: #b6e3ff;--color-overlay-shadow: 0 1px 3px rgba(31,35,40,.12), 0 8px 24px rgba(66,74,83,.12);--color-overlay-backdrop: rgba(140,149,159,.2);--color-header-text: rgba(255,255,255,.7);--color-header-bg: #24292f;--color-header-divider: #57606a;--color-header-logo: #ffffff;--color-header-search-bg: #24292f;--color-header-search-border: #57606a;--color-sidenav-selected-bg: #ffffff;--color-menu-bg-active: rgba(0,0,0,0);--color-input-disabled-bg: rgba(175,184,193,.2);--color-timeline-badge-bg: #eaeef2;--color-ansi-black: #24292f;--color-ansi-black-bright: #57606a;--color-ansi-white: #6e7781;--color-ansi-white-bright: #8c959f;--color-ansi-gray: #6e7781;--color-ansi-red: #cf222e;--color-ansi-red-bright: #a40e26;--color-ansi-green: #116329;--color-ansi-green-bright: #1a7f37;--color-ansi-yellow: #4d2d00;--color-ansi-yellow-bright: #633c01;--color-ansi-blue: #0969da;--color-ansi-blue-bright: #218bff;--color-ansi-magenta: #8250df;--color-ansi-magenta-bright: #a475f9;--color-ansi-cyan: #1b7c83;--color-ansi-cyan-bright: #3192aa;--color-btn-text: #24292f;--color-btn-bg: #f6f8fa;--color-btn-border: rgba(31,35,40,.15);--color-btn-shadow: 0 1px 0 rgba(31,35,40,.04);--color-btn-inset-shadow: inset 0 1px 0 rgba(255,255,255,.25);--color-btn-hover-bg: #f3f4f6;--color-btn-hover-border: rgba(31,35,40,.15);--color-btn-active-bg: hsla(220,14%,93%,1);--color-btn-active-border: rgba(31,35,40,.15);--color-btn-selected-bg: hsla(220,14%,94%,1);--color-btn-counter-bg: rgba(31,35,40,.08);--color-btn-primary-text: #ffffff;--color-btn-primary-bg: #1f883d;--color-btn-primary-border: rgba(31,35,40,.15);--color-btn-primary-shadow: 0 1px 0 rgba(31,35,40,.1);--color-btn-primary-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-primary-hover-bg: #1a7f37;--color-btn-primary-hover-border: rgba(31,35,40,.15);--color-btn-primary-selected-bg: hsla(137,66%,28%,1);--color-btn-primary-selected-shadow: inset 0 1px 0 rgba(0,45,17,.2);--color-btn-primary-disabled-text: rgba(255,255,255,.8);--color-btn-primary-disabled-bg: #94d3a2;--color-btn-primary-disabled-border: rgba(31,35,40,.15);--color-btn-primary-icon: rgba(255,255,255,.8);--color-btn-primary-counter-bg: rgba(0,45,17,.2);--color-btn-outline-text: #0969da;--color-btn-outline-hover-text: #ffffff;--color-btn-outline-hover-bg: #0969da;--color-btn-outline-hover-border: rgba(31,35,40,.15);--color-btn-outline-hover-shadow: 0 1px 0 rgba(31,35,40,.1);--color-btn-outline-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-outline-hover-counter-bg: rgba(255,255,255,.2);--color-btn-outline-selected-text: #ffffff;--color-btn-outline-selected-bg: hsla(212,92%,42%,1);--color-btn-outline-selected-border: rgba(31,35,40,.15);--color-btn-outline-selected-shadow: inset 0 1px 0 rgba(0,33,85,.2);--color-btn-outline-disabled-text: rgba(9,105,218,.5);--color-btn-outline-disabled-bg: #f6f8fa;--color-btn-outline-disabled-counter-bg: rgba(9,105,218,.05);--color-btn-outline-counter-bg: #0969da1a;--color-btn-outline-counter-fg: #0550ae;--color-btn-outline-hover-counter-fg: #ffffff;--color-btn-outline-disabled-counter-fg: rgba(9,105,218,.5);--color-btn-danger-text: #cf222e;--color-btn-danger-hover-text: #ffffff;--color-btn-danger-hover-bg: #a40e26;--color-btn-danger-hover-border: rgba(31,35,40,.15);--color-btn-danger-hover-shadow: 0 1px 0 rgba(31,35,40,.1);--color-btn-danger-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-danger-hover-counter-bg: rgba(255,255,255,.2);--color-btn-danger-selected-text: #ffffff;--color-btn-danger-selected-bg: hsla(356,72%,44%,1);--color-btn-danger-selected-border: rgba(31,35,40,.15);--color-btn-danger-selected-shadow: inset 0 1px 0 rgba(76,0,20,.2);--color-btn-danger-disabled-text: rgba(207,34,46,.5);--color-btn-danger-disabled-bg: #f6f8fa;--color-btn-danger-disabled-counter-bg: rgba(207,34,46,.05);--color-btn-danger-counter-bg: rgba(207,34,46,.1);--color-btn-danger-icon: #cf222e;--color-btn-danger-hover-icon: #ffffff;--color-btn-danger-counter-fg: #a40e26;--color-btn-danger-hover-counter-fg: #ffffff;--color-btn-danger-disabled-counter-fg: rgba(207,34,46,.5);--color-underlinenav-icon: #6e7781;--color-underlinenav-border-hover: rgba(175,184,193,.2);--color-action-list-item-inline-divider: rgba(208,215,222,.48);--color-action-list-item-default-hover-bg: rgba(208,215,222,.32);--color-action-list-item-default-hover-border: rgba(0,0,0,0);--color-action-list-item-default-active-bg: rgba(208,215,222,.48);--color-action-list-item-default-active-border: rgba(0,0,0,0);--color-action-list-item-default-selected-bg: rgba(208,215,222,.24);--color-action-list-item-danger-hover-bg: rgba(255,235,233,.64);--color-action-list-item-danger-active-bg: #ffebe9;--color-action-list-item-danger-hover-text: #d1242f;--color-switch-track-bg: #eaeef2;--color-switch-track-hover-bg: hsla(210,24%,90%,1);--color-switch-track-active-bg: hsla(210,24%,88%,1);--color-switch-track-disabled-bg: #8c959f;--color-switch-track-fg: #656d76;--color-switch-track-disabled-fg: #ffffff;--color-switch-track-border: rgba(0,0,0,0);--color-switch-track-checked-bg: #0969da;--color-switch-track-checked-hover-bg: #0860CA;--color-switch-track-checked-active-bg: #0757BA;--color-switch-track-checked-fg: #ffffff;--color-switch-track-checked-disabled-fg: #ffffff;--color-switch-track-checked-border: rgba(0,0,0,0);--color-switch-knob-bg: #ffffff;--color-switch-knob-disabled-bg: #f6f8fa;--color-switch-knob-border: #858F99;--color-switch-knob-checked-bg: #ffffff;--color-switch-knob-checked-disabled-bg: #f6f8fa;--color-switch-knob-checked-border: #0969da;--color-segmented-control-bg: #eaeef2;--color-segmented-control-button-bg: #ffffff;--color-segmented-control-button-hover-bg: rgba(175,184,193,.2);--color-segmented-control-button-active-bg: rgba(175,184,193,.4);--color-segmented-control-button-selected-border: #8c959f;--color-tree-view-item-chevron-hover-bg: rgba(208,215,222,.32);--color-tree-view-item-directory-fill: #54aeff;--color-fg-default: #1F2328;--color-fg-muted: #656d76;--color-fg-subtle: #6e7781;--color-fg-on-emphasis: #ffffff;--color-canvas-default: #ffffff;--color-canvas-overlay: #ffffff;--color-canvas-inset: #f6f8fa;--color-canvas-subtle: #f6f8fa;--color-border-default: #d0d7de;--color-border-muted: hsla(210,18%,87%,1);--color-border-subtle: rgba(31,35,40,.15);--color-shadow-small: 0 1px 0 rgba(31,35,40,.04);--color-shadow-medium: 0 3px 6px rgba(140,149,159,.15);--color-shadow-large: 0 8px 24px rgba(140,149,159,.2);--color-shadow-extra-large: 0 12px 28px rgba(140,149,159,.3);--color-neutral-emphasis-plus: #24292f;--color-neutral-emphasis: #6e7781;--color-neutral-muted: rgba(175,184,193,.2);--color-neutral-subtle: rgba(234,238,242,.5);--color-accent-fg: #0969da;--color-accent-emphasis: #0969da;--color-accent-muted: rgba(84,174,255,.4);--color-accent-subtle: #ddf4ff;--color-success-fg: #1a7f37;--color-success-emphasis: #1f883d;--color-success-muted: rgba(74,194,107,.4);--color-success-subtle: #dafbe1;--color-attention-fg: #9a6700;--color-attention-emphasis: #9a6700;--color-attention-muted: rgba(212,167,44,.4);--color-attention-subtle: #fff8c5;--color-severe-fg: #bc4c00;--color-severe-emphasis: #bc4c00;--color-severe-muted: rgba(251,143,68,.4);--color-severe-subtle: #fff1e5;--color-danger-fg: #d1242f;--color-danger-emphasis: #cf222e;--color-danger-muted: rgba(255,129,130,.4);--color-danger-subtle: #ffebe9;--color-open-fg: #1a7f37;--color-open-emphasis: #1f883d;--color-open-muted: rgba(74,194,107,.4);--color-open-subtle: #dafbe1;--color-closed-fg: #d1242f;--color-closed-emphasis: #cf222e;--color-closed-muted: rgba(255,129,130,.4);--color-closed-subtle: #ffebe9;--color-done-fg: #8250df;--color-done-emphasis: #8250df;--color-done-muted: rgba(194,151,255,.4);--color-done-subtle: #fbefff;--color-sponsors-fg: #bf3989;--color-sponsors-emphasis: #bf3989;--color-sponsors-muted: rgba(255,128,200,.4);--color-sponsors-subtle: #ffeff7;--color-primer-fg-disabled: #8c959f;--color-primer-canvas-backdrop: rgba(31,35,40,.5);--color-primer-canvas-sticky: rgba(255,255,255,.95);--color-primer-border-active: #fd8c73;--color-primer-border-contrast: rgba(31,35,40,.1);--color-primer-shadow-highlight: inset 0 1px 0 rgba(255,255,255,.25);--color-primer-shadow-inset: inset 0 1px 0 rgba(208,215,222,.2);--color-scale-black: #1F2328;--color-scale-white: #ffffff;--color-scale-gray-0: #f6f8fa;--color-scale-gray-1: #eaeef2;--color-scale-gray-2: #d0d7de;--color-scale-gray-3: #afb8c1;--color-scale-gray-4: #8c959f;--color-scale-gray-5: #6e7781;--color-scale-gray-6: #57606a;--color-scale-gray-7: #424a53;--color-scale-gray-8: #32383f;--color-scale-gray-9: #24292f;--color-scale-blue-0: #ddf4ff;--color-scale-blue-1: #b6e3ff;--color-scale-blue-2: #80ccff;--color-scale-blue-3: #54aeff;--color-scale-blue-4: #218bff;--color-scale-blue-5: #0969da;--color-scale-blue-6: #0550ae;--color-scale-blue-7: #033d8b;--color-scale-blue-8: #0a3069;--color-scale-blue-9: #002155;--color-scale-green-0: #dafbe1;--color-scale-green-1: #aceebb;--color-scale-green-2: #6fdd8b;--color-scale-green-3: #4ac26b;--color-scale-green-4: #2da44e;--color-scale-green-5: #1a7f37;--color-scale-green-6: #116329;--color-scale-green-7: #044f1e;--color-scale-green-8: #003d16;--color-scale-green-9: #002d11;--color-scale-yellow-0: #fff8c5;--color-scale-yellow-1: #fae17d;--color-scale-yellow-2: #eac54f;--color-scale-yellow-3: #d4a72c;--color-scale-yellow-4: #bf8700;--color-scale-yellow-5: #9a6700;--color-scale-yellow-6: #7d4e00;--color-scale-yellow-7: #633c01;--color-scale-yellow-8: #4d2d00;--color-scale-yellow-9: #3b2300;--color-scale-orange-0: #fff1e5;--color-scale-orange-1: #ffd8b5;--color-scale-orange-2: #ffb77c;--color-scale-orange-3: #fb8f44;--color-scale-orange-4: #e16f24;--color-scale-orange-5: #bc4c00;--color-scale-orange-6: #953800;--color-scale-orange-7: #762c00;--color-scale-orange-8: #5c2200;--color-scale-orange-9: #471700;--color-scale-red-0: #ffebe9;--color-scale-red-1: #ffcecb;--color-scale-red-2: #ffaba8;--color-scale-red-3: #ff8182;--color-scale-red-4: #fa4549;--color-scale-red-5: #cf222e;--color-scale-red-6: #a40e26;--color-scale-red-7: #82071e;--color-scale-red-8: #660018;--color-scale-red-9: #4c0014;--color-scale-purple-0: #fbefff;--color-scale-purple-1: #ecd8ff;--color-scale-purple-2: #d8b9ff;--color-scale-purple-3: #c297ff;--color-scale-purple-4: #a475f9;--color-scale-purple-5: #8250df;--color-scale-purple-6: #6639ba;--color-scale-purple-7: #512a97;--color-scale-purple-8: #3e1f79;--color-scale-purple-9: #2e1461;--color-scale-pink-0: #ffeff7;--color-scale-pink-1: #ffd3eb;--color-scale-pink-2: #ffadda;--color-scale-pink-3: #ff80c8;--color-scale-pink-4: #e85aad;--color-scale-pink-5: #bf3989;--color-scale-pink-6: #99286e;--color-scale-pink-7: #772057;--color-scale-pink-8: #611347;--color-scale-pink-9: #4d0336;--color-scale-coral-0: #fff0eb;--color-scale-coral-1: #ffd6cc;--color-scale-coral-2: #ffb4a1;--color-scale-coral-3: #fd8c73;--color-scale-coral-4: #ec6547;--color-scale-coral-5: #c4432b;--color-scale-coral-6: #9e2f1c;--color-scale-coral-7: #801f0f;--color-scale-coral-8: #691105;--color-scale-coral-9: #510901}.code-diff-view[theme=light] pre code.hljs{display:block;overflow-x:auto;padding:1em}.code-diff-view[theme=light] code.hljs{padding:3px 5px}.code-diff-view[theme=light] .hljs{color:#24292e;background:#ffffff}.code-diff-view[theme=light] .hljs-doctag,.code-diff-view[theme=light] .hljs-keyword,.code-diff-view[theme=light] .hljs-meta .hljs-keyword,.code-diff-view[theme=light] .hljs-template-tag,.code-diff-view[theme=light] .hljs-template-variable,.code-diff-view[theme=light] .hljs-type,.code-diff-view[theme=light] .hljs-variable.language_{color:#d73a49}.code-diff-view[theme=light] .hljs-title,.code-diff-view[theme=light] .hljs-title.class_,.code-diff-view[theme=light] .hljs-title.class_.inherited__,.code-diff-view[theme=light] .hljs-title.function_{color:#6f42c1}.code-diff-view[theme=light] .hljs-attr,.code-diff-view[theme=light] .hljs-attribute,.code-diff-view[theme=light] .hljs-literal,.code-diff-view[theme=light] .hljs-meta,.code-diff-view[theme=light] .hljs-number,.code-diff-view[theme=light] .hljs-operator,.code-diff-view[theme=light] .hljs-variable,.code-diff-view[theme=light] .hljs-selector-attr,.code-diff-view[theme=light] .hljs-selector-class,.code-diff-view[theme=light] .hljs-selector-id{color:#005cc5}.code-diff-view[theme=light] .hljs-regexp,.code-diff-view[theme=light] .hljs-string,.code-diff-view[theme=light] .hljs-meta .hljs-string{color:#032f62}.code-diff-view[theme=light] .hljs-built_in,.code-diff-view[theme=light] .hljs-symbol{color:#e36209}.code-diff-view[theme=light] .hljs-comment,.code-diff-view[theme=light] .hljs-code,.code-diff-view[theme=light] .hljs-formula{color:#6a737d}.code-diff-view[theme=light] .hljs-name,.code-diff-view[theme=light] .hljs-quote,.code-diff-view[theme=light] .hljs-selector-tag,.code-diff-view[theme=light] .hljs-selector-pseudo{color:#22863a}.code-diff-view[theme=light] .hljs-subst{color:#24292e}.code-diff-view[theme=light] .hljs-section{color:#005cc5;font-weight:700}.code-diff-view[theme=light] .hljs-bullet{color:#735c0f}.code-diff-view[theme=light] .hljs-emphasis{color:#24292e;font-style:italic}.code-diff-view[theme=light] .hljs-strong{color:#24292e;font-weight:700}.code-diff-view[theme=light] .hljs-addition{color:#22863a;background-color:#f0fff4}.code-diff-view[theme=light] .hljs-deletion{color:#b31d28;background-color:#ffeef0}.code-diff-view[theme=dark]{color:var(--fgColor-default, var(--color-fg-default));background-color:var(--bgColor-default, var(--color-canvas-default));--color-canvas-default-transparent: rgba(13,17,23,0);--color-page-header-bg: #0d1117;--color-marketing-icon-primary: #79c0ff;--color-marketing-icon-secondary: #1f6feb;--color-diff-blob-addition-num-text: #e6edf3;--color-diff-blob-addition-fg: #e6edf3;--color-diff-blob-addition-num-bg: rgba(63,185,80,.3);--color-diff-blob-addition-line-bg: rgba(46,160,67,.15);--color-diff-blob-addition-word-bg: rgba(46,160,67,.4);--color-diff-blob-deletion-num-text: #e6edf3;--color-diff-blob-deletion-fg: #e6edf3;--color-diff-blob-deletion-num-bg: rgba(248,81,73,.3);--color-diff-blob-deletion-line-bg: rgba(248,81,73,.1);--color-diff-blob-deletion-word-bg: rgba(248,81,73,.4);--color-diff-blob-hunk-num-bg: rgba(56,139,253,.4);--color-diff-blob-expander-icon: #7d8590;--color-diff-blob-selected-line-highlight-mix-blend-mode: screen;--color-diffstat-deletion-border: rgba(240,246,252,.1);--color-diffstat-addition-border: rgba(240,246,252,.1);--color-diffstat-addition-bg: #3fb950;--color-search-keyword-hl: rgba(210,153,34,.4);--color-prettylights-syntax-comment: #8b949e;--color-prettylights-syntax-constant: #79c0ff;--color-prettylights-syntax-entity: #d2a8ff;--color-prettylights-syntax-storage-modifier-import: #c9d1d9;--color-prettylights-syntax-entity-tag: #7ee787;--color-prettylights-syntax-keyword: #ff7b72;--color-prettylights-syntax-string: #a5d6ff;--color-prettylights-syntax-variable: #ffa657;--color-prettylights-syntax-brackethighlighter-unmatched: #f85149;--color-prettylights-syntax-invalid-illegal-text: #f0f6fc;--color-prettylights-syntax-invalid-illegal-bg: #8e1519;--color-prettylights-syntax-carriage-return-text: #f0f6fc;--color-prettylights-syntax-carriage-return-bg: #b62324;--color-prettylights-syntax-string-regexp: #7ee787;--color-prettylights-syntax-markup-list: #f2cc60;--color-prettylights-syntax-markup-heading: #1f6feb;--color-prettylights-syntax-markup-italic: #c9d1d9;--color-prettylights-syntax-markup-bold: #c9d1d9;--color-prettylights-syntax-markup-deleted-text: #ffdcd7;--color-prettylights-syntax-markup-deleted-bg: #67060c;--color-prettylights-syntax-markup-inserted-text: #aff5b4;--color-prettylights-syntax-markup-inserted-bg: #033a16;--color-prettylights-syntax-markup-changed-text: #ffdfb6;--color-prettylights-syntax-markup-changed-bg: #5a1e02;--color-prettylights-syntax-markup-ignored-text: #c9d1d9;--color-prettylights-syntax-markup-ignored-bg: #1158c7;--color-prettylights-syntax-meta-diff-range: #d2a8ff;--color-prettylights-syntax-brackethighlighter-angle: #8b949e;--color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;--color-prettylights-syntax-constant-other-reference-link: #a5d6ff;--color-codemirror-text: #e6edf3;--color-codemirror-bg: #0d1117;--color-codemirror-gutters-bg: #0d1117;--color-codemirror-guttermarker-text: #0d1117;--color-codemirror-guttermarker-subtle-text: #6e7681;--color-codemirror-linenumber-text: #7d8590;--color-codemirror-cursor: #e6edf3;--color-codemirror-selection-bg: rgba(56,139,253,.4);--color-codemirror-activeline-bg: rgba(110,118,129,.1);--color-codemirror-matchingbracket-text: #e6edf3;--color-codemirror-lines-bg: #0d1117;--color-codemirror-syntax-comment: #8b949e;--color-codemirror-syntax-constant: #79c0ff;--color-codemirror-syntax-entity: #d2a8ff;--color-codemirror-syntax-keyword: #ff7b72;--color-codemirror-syntax-storage: #ff7b72;--color-codemirror-syntax-string: #a5d6ff;--color-codemirror-syntax-support: #79c0ff;--color-codemirror-syntax-variable: #ffa657;--color-checks-bg: #010409;--color-checks-run-border-width: 1px;--color-checks-container-border-width: 1px;--color-checks-text-primary: #e6edf3;--color-checks-text-secondary: #7d8590;--color-checks-text-link: #2f81f7;--color-checks-btn-icon: #7d8590;--color-checks-btn-hover-icon: #e6edf3;--color-checks-btn-hover-bg: rgba(110,118,129,.1);--color-checks-input-text: #7d8590;--color-checks-input-placeholder-text: #6e7681;--color-checks-input-focus-text: #e6edf3;--color-checks-input-bg: #161b22;--color-checks-donut-error: #f85149;--color-checks-donut-pending: #d29922;--color-checks-donut-success: #2ea043;--color-checks-donut-neutral: #8b949e;--color-checks-dropdown-text: #e6edf3;--color-checks-dropdown-bg: #161b22;--color-checks-dropdown-border: #30363d;--color-checks-dropdown-shadow: rgba(1,4,9,.3);--color-checks-dropdown-hover-text: #e6edf3;--color-checks-dropdown-hover-bg: rgba(110,118,129,.1);--color-checks-dropdown-btn-hover-text: #e6edf3;--color-checks-dropdown-btn-hover-bg: rgba(110,118,129,.1);--color-checks-scrollbar-thumb-bg: rgba(110,118,129,.4);--color-checks-header-label-text: #7d8590;--color-checks-header-label-open-text: #e6edf3;--color-checks-header-border: #21262d;--color-checks-header-icon: #7d8590;--color-checks-line-text: #7d8590;--color-checks-line-num-text: #6e7681;--color-checks-line-timestamp-text: #6e7681;--color-checks-line-hover-bg: rgba(110,118,129,.1);--color-checks-line-selected-bg: rgba(56,139,253,.1);--color-checks-line-selected-num-text: #2f81f7;--color-checks-line-dt-fm-text: #ffffff;--color-checks-line-dt-fm-bg: #9e6a03;--color-checks-gate-bg: rgba(187,128,9,.15);--color-checks-gate-text: #7d8590;--color-checks-gate-waiting-text: #d29922;--color-checks-step-header-open-bg: #161b22;--color-checks-step-error-text: #f85149;--color-checks-step-warning-text: #d29922;--color-checks-logline-text: #7d8590;--color-checks-logline-num-text: #6e7681;--color-checks-logline-debug-text: #a371f7;--color-checks-logline-error-text: #7d8590;--color-checks-logline-error-num-text: #6e7681;--color-checks-logline-error-bg: rgba(248,81,73,.1);--color-checks-logline-warning-text: #7d8590;--color-checks-logline-warning-num-text: #d29922;--color-checks-logline-warning-bg: rgba(187,128,9,.15);--color-checks-logline-command-text: #2f81f7;--color-checks-logline-section-text: #3fb950;--color-checks-ansi-black: #0d1117;--color-checks-ansi-black-bright: #161b22;--color-checks-ansi-white: #b1bac4;--color-checks-ansi-white-bright: #b1bac4;--color-checks-ansi-gray: #6e7681;--color-checks-ansi-red: #ff7b72;--color-checks-ansi-red-bright: #ffa198;--color-checks-ansi-green: #3fb950;--color-checks-ansi-green-bright: #56d364;--color-checks-ansi-yellow: #d29922;--color-checks-ansi-yellow-bright: #e3b341;--color-checks-ansi-blue: #58a6ff;--color-checks-ansi-blue-bright: #79c0ff;--color-checks-ansi-magenta: #bc8cff;--color-checks-ansi-magenta-bright: #d2a8ff;--color-checks-ansi-cyan: #76e3ea;--color-checks-ansi-cyan-bright: #b3f0ff;--color-project-header-bg: #0d1117;--color-project-sidebar-bg: #161b22;--color-project-gradient-in: #161b22;--color-project-gradient-out: rgba(22,27,34,0);--color-mktg-btn-bg: #f6f8fa;--color-mktg-btn-shadow-outline: rgb(255 255 255 / 25%) 0 0 0 1px inset;--color-mktg-btn-shadow-focus: rgb(255 255 255 / 25%) 0 0 0 4px;--color-mktg-btn-shadow-hover: 0 4px 7px rgba(0, 0, 0, .15), 0 100px 80px rgba(255, 255, 255, .02), 0 42px 33px rgba(255, 255, 255, .024), 0 22px 18px rgba(255, 255, 255, .028), 0 12px 10px rgba(255, 255, 255, .034), 0 7px 5px rgba(255, 255, 255, .04), 0 3px 2px rgba(255, 255, 255, .07);--color-mktg-btn-shadow-hover-muted: rgb(255 255 255) 0 0 0 2px inset;--color-control-border-color-emphasis: #606771;--color-avatar-bg: rgba(255,255,255,.1);--color-avatar-border: rgba(240,246,252,.1);--color-avatar-stack-fade: #30363d;--color-avatar-stack-fade-more: #21262d;--color-avatar-child-shadow: 0 0 0 2px #0d1117;--color-topic-tag-border: rgba(0,0,0,0);--color-counter-border: rgba(0,0,0,0);--color-select-menu-backdrop-border: #484f58;--color-select-menu-tap-highlight: rgba(48,54,61,.5);--color-select-menu-tap-focus-bg: #0c2d6b;--color-overlay-shadow: 0 0 0 1px #30363d, 0 16px 32px rgba(1,4,9,.85);--color-overlay-backdrop: rgba(22,27,34,.4);--color-header-text: rgba(255,255,255,.7);--color-header-bg: #161b22;--color-header-divider: #8b949e;--color-header-logo: #f0f6fc;--color-header-search-bg: #0d1117;--color-header-search-border: #30363d;--color-sidenav-selected-bg: #21262d;--color-menu-bg-active: #161b22;--color-input-disabled-bg: rgba(110,118,129,0);--color-timeline-badge-bg: #21262d;--color-ansi-black: #484f58;--color-ansi-black-bright: #6e7681;--color-ansi-white: #b1bac4;--color-ansi-white-bright: #ffffff;--color-ansi-gray: #6e7681;--color-ansi-red: #ff7b72;--color-ansi-red-bright: #ffa198;--color-ansi-green: #3fb950;--color-ansi-green-bright: #56d364;--color-ansi-yellow: #d29922;--color-ansi-yellow-bright: #e3b341;--color-ansi-blue: #58a6ff;--color-ansi-blue-bright: #79c0ff;--color-ansi-magenta: #bc8cff;--color-ansi-magenta-bright: #d2a8ff;--color-ansi-cyan: #39c5cf;--color-ansi-cyan-bright: #56d4dd;--color-btn-text: #c9d1d9;--color-btn-bg: #21262d;--color-btn-border: rgba(240,246,252,.1);--color-btn-shadow: 0 0 transparent;--color-btn-inset-shadow: 0 0 transparent;--color-btn-hover-bg: #30363d;--color-btn-hover-border: #8b949e;--color-btn-active-bg: hsla(212,12%,18%,1);--color-btn-active-border: #6e7681;--color-btn-selected-bg: #161b22;--color-btn-counter-bg: #30363d;--color-btn-primary-text: #ffffff;--color-btn-primary-bg: #238636;--color-btn-primary-border: rgba(240,246,252,.1);--color-btn-primary-shadow: 0 0 transparent;--color-btn-primary-inset-shadow: 0 0 transparent;--color-btn-primary-hover-bg: #2ea043;--color-btn-primary-hover-border: rgba(240,246,252,.1);--color-btn-primary-selected-bg: #238636;--color-btn-primary-selected-shadow: 0 0 transparent;--color-btn-primary-disabled-text: rgba(255,255,255,.5);--color-btn-primary-disabled-bg: rgba(35,134,54,.6);--color-btn-primary-disabled-border: rgba(240,246,252,.1);--color-btn-primary-icon: #ffffff;--color-btn-primary-counter-bg: rgba(4,38,15,.2);--color-btn-outline-text: #388bfd;--color-btn-outline-hover-text: #58a6ff;--color-btn-outline-hover-bg: #30363d;--color-btn-outline-hover-border: rgba(240,246,252,.1);--color-btn-outline-hover-shadow: 0 1px 0 rgba(1,4,9,.1);--color-btn-outline-hover-inset-shadow: inset 0 1px 0 rgba(255,255,255,.03);--color-btn-outline-hover-counter-bg: rgba(5,29,77,.2);--color-btn-outline-selected-text: #ffffff;--color-btn-outline-selected-bg: #0d419d;--color-btn-outline-selected-border: rgba(240,246,252,.1);--color-btn-outline-selected-shadow: 0 0 transparent;--color-btn-outline-disabled-text: rgba(88,166,255,.5);--color-btn-outline-disabled-bg: #0d1117;--color-btn-outline-disabled-counter-bg: rgba(31,111,235,.05);--color-btn-outline-counter-bg: rgba(5,29,77,.2);--color-btn-outline-hover-counter-fg: #58a6ff;--color-btn-outline-disabled-counter-fg: rgba(47,129,247,.5);--color-btn-outline-counter-fg: #388bfd;--color-btn-danger-text: #f85149;--color-btn-danger-hover-text: #ffffff;--color-btn-danger-hover-bg: #da3633;--color-btn-danger-hover-border: #f85149;--color-btn-danger-hover-shadow: 0 0 transparent;--color-btn-danger-hover-inset-shadow: 0 0 transparent;--color-btn-danger-hover-icon: #ffffff;--color-btn-danger-hover-counter-bg: rgba(255,255,255,.2);--color-btn-danger-selected-text: #ffffff;--color-btn-danger-selected-bg: #b62324;--color-btn-danger-selected-border: #ff7b72;--color-btn-danger-selected-shadow: 0 0 transparent;--color-btn-danger-disabled-text: rgba(248,81,73,.5);--color-btn-danger-disabled-bg: #0d1117;--color-btn-danger-disabled-counter-bg: rgba(218,54,51,.05);--color-btn-danger-counter-bg: rgba(73,2,2,.2);--color-btn-danger-icon: #f85149;--color-btn-danger-counter-fg: #f85149;--color-btn-danger-disabled-counter-fg: rgba(248,81,73,.5);--color-btn-danger-hover-counter-fg: #ffffff;--color-underlinenav-icon: #6e7681;--color-underlinenav-border-hover: rgba(110,118,129,.4);--color-action-list-item-inline-divider: rgba(48,54,61,.48);--color-action-list-item-default-hover-bg: rgba(177,186,196,.12);--color-action-list-item-default-hover-border: rgba(0,0,0,0);--color-action-list-item-default-active-bg: rgba(177,186,196,.2);--color-action-list-item-default-active-border: rgba(0,0,0,0);--color-action-list-item-default-selected-bg: rgba(177,186,196,.08);--color-action-list-item-danger-hover-bg: rgba(248,81,73,.16);--color-action-list-item-danger-active-bg: rgba(248,81,73,.24);--color-action-list-item-danger-hover-text: #ff7b72;--color-switch-track-bg: rgba(110,118,129,.1);--color-switch-track-hover-bg: hsla(215,8%,72%,.1);--color-switch-track-active-bg: rgba(110,118,129,.4);--color-switch-track-disabled-bg: #21262d;--color-switch-track-fg: #7d8590;--color-switch-track-disabled-fg: #010409;--color-switch-track-border: rgba(0,0,0,0);--color-switch-track-checked-bg: rgba(31,111,235,.35);--color-switch-track-checked-hover-bg: rgba(31,111,235,.5);--color-switch-track-checked-active-bg: rgba(31,111,235,.65);--color-switch-track-checked-fg: #ffffff;--color-switch-track-checked-disabled-fg: #010409;--color-switch-track-checked-border: rgba(0,0,0,0);--color-switch-knob-bg: #0d1117;--color-switch-knob-border: #606771;--color-switch-knob-disabled-bg: #161b22;--color-switch-knob-checked-bg: #0d1117;--color-switch-knob-checked-disabled-bg: #161b22;--color-switch-knob-checked-border: rgba(31,111,235,.35);--color-segmented-control-bg: rgba(110,118,129,.1);--color-segmented-control-button-bg: #0d1117;--color-segmented-control-button-hover-bg: #30363d;--color-segmented-control-button-active-bg: #21262d;--color-segmented-control-button-selected-border: #6e7681;--color-tree-view-item-chevron-hover-bg: rgba(177,186,196,.12);--color-tree-view-item-directory-fill: #7d8590;--color-fg-default: #e6edf3;--color-fg-muted: #7d8590;--color-fg-subtle: #6e7681;--color-fg-on-emphasis: #ffffff;--color-canvas-default: #0d1117;--color-canvas-overlay: #161b22;--color-canvas-inset: #010409;--color-canvas-subtle: #161b22;--color-border-default: #30363d;--color-border-muted: #21262d;--color-border-subtle: rgba(240,246,252,.1);--color-shadow-small: 0 0 transparent;--color-shadow-medium: 0 3px 6px #010409;--color-shadow-large: 0 8px 24px #010409;--color-shadow-extra-large: 0 12px 48px #010409;--color-neutral-emphasis-plus: #6e7681;--color-neutral-emphasis: #6e7681;--color-neutral-muted: rgba(110,118,129,.4);--color-neutral-subtle: rgba(110,118,129,.1);--color-accent-fg: #2f81f7;--color-accent-emphasis: #1f6feb;--color-accent-muted: rgba(56,139,253,.4);--color-accent-subtle: rgba(56,139,253,.1);--color-success-fg: #3fb950;--color-success-emphasis: #238636;--color-success-muted: rgba(46,160,67,.4);--color-success-subtle: rgba(46,160,67,.15);--color-attention-fg: #d29922;--color-attention-emphasis: #9e6a03;--color-attention-muted: rgba(187,128,9,.4);--color-attention-subtle: rgba(187,128,9,.15);--color-severe-fg: #db6d28;--color-severe-emphasis: #bd561d;--color-severe-muted: rgba(219,109,40,.4);--color-severe-subtle: rgba(219,109,40,.1);--color-danger-fg: #f85149;--color-danger-emphasis: #da3633;--color-danger-muted: rgba(248,81,73,.4);--color-danger-subtle: rgba(248,81,73,.1);--color-open-fg: #3fb950;--color-open-emphasis: #238636;--color-open-muted: rgba(46,160,67,.4);--color-open-subtle: rgba(46,160,67,.15);--color-closed-fg: #f85149;--color-closed-emphasis: #da3633;--color-closed-muted: rgba(248,81,73,.4);--color-closed-subtle: rgba(248,81,73,.15);--color-done-fg: #a371f7;--color-done-emphasis: #8957e5;--color-done-muted: rgba(163,113,247,.4);--color-done-subtle: rgba(163,113,247,.1);--color-sponsors-fg: #db61a2;--color-sponsors-emphasis: #bf4b8a;--color-sponsors-muted: rgba(219,97,162,.4);--color-sponsors-subtle: rgba(219,97,162,.1);--color-primer-fg-disabled: #484f58;--color-primer-canvas-backdrop: rgba(1,4,9,.8);--color-primer-canvas-sticky: rgba(13,17,23,.95);--color-primer-border-active: #f78166;--color-primer-border-contrast: rgba(255,255,255,.2);--color-primer-shadow-highlight: 0 0 transparent;--color-primer-shadow-inset: 0 0 transparent;--color-scale-black: #010409;--color-scale-white: #ffffff;--color-scale-gray-0: #f0f6fc;--color-scale-gray-1: #c9d1d9;--color-scale-gray-2: #b1bac4;--color-scale-gray-3: #8b949e;--color-scale-gray-4: #6e7681;--color-scale-gray-5: #484f58;--color-scale-gray-6: #30363d;--color-scale-gray-7: #21262d;--color-scale-gray-8: #161b22;--color-scale-gray-9: #0d1117;--color-scale-blue-0: #cae8ff;--color-scale-blue-1: #a5d6ff;--color-scale-blue-2: #79c0ff;--color-scale-blue-3: #58a6ff;--color-scale-blue-4: #388bfd;--color-scale-blue-5: #1f6feb;--color-scale-blue-6: #1158c7;--color-scale-blue-7: #0d419d;--color-scale-blue-8: #0c2d6b;--color-scale-blue-9: #051d4d;--color-scale-green-0: #aff5b4;--color-scale-green-1: #7ee787;--color-scale-green-2: #56d364;--color-scale-green-3: #3fb950;--color-scale-green-4: #2ea043;--color-scale-green-5: #238636;--color-scale-green-6: #196c2e;--color-scale-green-7: #0f5323;--color-scale-green-8: #033a16;--color-scale-green-9: #04260f;--color-scale-yellow-0: #f8e3a1;--color-scale-yellow-1: #f2cc60;--color-scale-yellow-2: #e3b341;--color-scale-yellow-3: #d29922;--color-scale-yellow-4: #bb8009;--color-scale-yellow-5: #9e6a03;--color-scale-yellow-6: #845306;--color-scale-yellow-7: #693e00;--color-scale-yellow-8: #4b2900;--color-scale-yellow-9: #341a00;--color-scale-orange-0: #ffdfb6;--color-scale-orange-1: #ffc680;--color-scale-orange-2: #ffa657;--color-scale-orange-3: #f0883e;--color-scale-orange-4: #db6d28;--color-scale-orange-5: #bd561d;--color-scale-orange-6: #9b4215;--color-scale-orange-7: #762d0a;--color-scale-orange-8: #5a1e02;--color-scale-orange-9: #3d1300;--color-scale-red-0: #ffdcd7;--color-scale-red-1: #ffc1ba;--color-scale-red-2: #ffa198;--color-scale-red-3: #ff7b72;--color-scale-red-4: #f85149;--color-scale-red-5: #da3633;--color-scale-red-6: #b62324;--color-scale-red-7: #8e1519;--color-scale-red-8: #67060c;--color-scale-red-9: #490202;--color-scale-purple-0: #eddeff;--color-scale-purple-1: #e2c5ff;--color-scale-purple-2: #d2a8ff;--color-scale-purple-3: #bc8cff;--color-scale-purple-4: #a371f7;--color-scale-purple-5: #8957e5;--color-scale-purple-6: #6e40c9;--color-scale-purple-7: #553098;--color-scale-purple-8: #3c1e70;--color-scale-purple-9: #271052;--color-scale-pink-0: #ffdaec;--color-scale-pink-1: #ffbedd;--color-scale-pink-2: #ff9bce;--color-scale-pink-3: #f778ba;--color-scale-pink-4: #db61a2;--color-scale-pink-5: #bf4b8a;--color-scale-pink-6: #9e3670;--color-scale-pink-7: #7d2457;--color-scale-pink-8: #5e103e;--color-scale-pink-9: #42062a;--color-scale-coral-0: #ffddd2;--color-scale-coral-1: #ffc2b2;--color-scale-coral-2: #ffa28b;--color-scale-coral-3: #f78166;--color-scale-coral-4: #ea6045;--color-scale-coral-5: #cf462d;--color-scale-coral-6: #ac3220;--color-scale-coral-7: #872012;--color-scale-coral-8: #640d04;--color-scale-coral-9: #460701}.code-diff-view[theme=dark] pre code.hljs{display:block;overflow-x:auto;padding:1em}.code-diff-view[theme=dark] code.hljs{padding:3px 5px}.code-diff-view[theme=dark] .hljs{color:#c9d1d9;background:#0d1117}.code-diff-view[theme=dark] .hljs-doctag,.code-diff-view[theme=dark] .hljs-keyword,.code-diff-view[theme=dark] .hljs-meta .hljs-keyword,.code-diff-view[theme=dark] .hljs-template-tag,.code-diff-view[theme=dark] .hljs-template-variable,.code-diff-view[theme=dark] .hljs-type,.code-diff-view[theme=dark] .hljs-variable.language_{color:#ff7b72}.code-diff-view[theme=dark] .hljs-title,.code-diff-view[theme=dark] .hljs-title.class_,.code-diff-view[theme=dark] .hljs-title.class_.inherited__,.code-diff-view[theme=dark] .hljs-title.function_{color:#d2a8ff}.code-diff-view[theme=dark] .hljs-attr,.code-diff-view[theme=dark] .hljs-attribute,.code-diff-view[theme=dark] .hljs-literal,.code-diff-view[theme=dark] .hljs-meta,.code-diff-view[theme=dark] .hljs-number,.code-diff-view[theme=dark] .hljs-operator,.code-diff-view[theme=dark] .hljs-variable,.code-diff-view[theme=dark] .hljs-selector-attr,.code-diff-view[theme=dark] .hljs-selector-class,.code-diff-view[theme=dark] .hljs-selector-id{color:#79c0ff}.code-diff-view[theme=dark] .hljs-regexp,.code-diff-view[theme=dark] .hljs-string,.code-diff-view[theme=dark] .hljs-meta .hljs-string{color:#a5d6ff}.code-diff-view[theme=dark] .hljs-built_in,.code-diff-view[theme=dark] .hljs-symbol{color:#ffa657}.code-diff-view[theme=dark] .hljs-comment,.code-diff-view[theme=dark] .hljs-code,.code-diff-view[theme=dark] .hljs-formula{color:#8b949e}.code-diff-view[theme=dark] .hljs-name,.code-diff-view[theme=dark] .hljs-quote,.code-diff-view[theme=dark] .hljs-selector-tag,.code-diff-view[theme=dark] .hljs-selector-pseudo{color:#7ee787}.code-diff-view[theme=dark] .hljs-subst{color:#c9d1d9}.code-diff-view[theme=dark] .hljs-section{color:#1f6feb;font-weight:700}.code-diff-view[theme=dark] .hljs-bullet{color:#f2cc60}.code-diff-view[theme=dark] .hljs-emphasis{color:#c9d1d9;font-style:italic}.code-diff-view[theme=dark] .hljs-strong{color:#c9d1d9;font-weight:700}.code-diff-view[theme=dark] .hljs-addition{color:#aff5b4;background-color:#033a16}.code-diff-view[theme=dark] .hljs-deletion{color:#ffdcd7;background-color:#67060c}.code-diff-view{position:relative;margin-top:16px;margin-bottom:16px;border:1px solid var(--color-border-default, #ddd);border-radius:6px;overflow-y:auto}.code-diff-view *{position:static;box-sizing:border-box}.code-diff-view .file-header{position:sticky;top:0;z-index:1;background-color:var(--color-canvas-subtle);border-bottom:1px solid var(--color-border-default);padding:8px 16px;font-size:12px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace}.code-diff-view .file-header .file-info{display:flex;justify-content:space-between;align-items:center;margin-left:8px;height:24px}.code-diff-view .file-header .file-info .info-left{color:var(--color-fg-default)}.code-diff-view .file-header .file-info .info-right{display:flex;justify-content:space-between;align-items:center;width:50%}.code-diff-view .file-header .file-info .diff-stat{display:inline-flex;align-items:center;gap:8px}.code-diff-view .file-header .file-info .diff-stat .diff-stat-added{color:var(--color-diffstat-addition-bg)}.code-diff-view .file-header .file-info .diff-stat .diff-stat-deleted{color:var(--color-danger-emphasis)}.code-diff-view .file-header .file-info .diff-stat .diff-stat-ignored{color:var(--color-fg-subtle)}.code-diff-view .file-header .file-info .diff-commandbar{margin-left:auto;margin-right:1rem}.code-diff-view .file-header .file-info .diff-commandbar .command-item-button{background-color:transparent;color:var(--color-fg-subtle);border:none}.code-diff-view .file-header .file-info .diff-commandbar .command-item-button svg{fill:var(--color-fg-subtle)}.code-diff-view .file-header .file-info .diff-commandbar .command-item-button:hover{background-color:var(--color-btn-outline-hover-border)}.code-diff-view table{border-spacing:0}.code-diff-view .diff-table{width:100%}.code-diff-view .diff-table .blob-num{position:relative;width:1%;min-width:50px;padding-right:10px;padding-left:10px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;line-height:20px;color:var(--color-fg-subtle);text-align:right;white-space:nowrap;vertical-align:top;cursor:pointer;-webkit-user-select:none;user-select:none}.code-diff-view .diff-table .blob-num-deletion{color:var(--color-diff-blob-deletion-num-text);background-color:var(--color-diff-blob-deletion-num-bg);border-color:var(--color-danger-emphasis)}.code-diff-view .diff-table .blob-num-addition{color:var(--color-diff-blob-addition-num-text);background-color:var(--color-diff-blob-addition-num-bg);border-color:var(--color-success-emphasis)}.code-diff-view .diff-table .blob-code{position:relative;padding-right:10px;padding-left:10px;line-height:20px;vertical-align:top}.code-diff-view .diff-table .blob-code .blob-code-inner{display:table-cell;overflow:visible;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;color:var(--color-fg-default);word-wrap:anywhere;white-space:pre-wrap}.code-diff-view .diff-table .blob-code-deletion{background-color:var(--color-diff-blob-deletion-line-bg);outline:1px dashed transparent}.code-diff-view .diff-table .blob-code-deletion .x{color:var(--color-diff-blob-deletion-fg);background-color:var(--color-diff-blob-deletion-word-bg)}.code-diff-view .diff-table .blob-code-addition{background-color:var(--color-diff-blob-addition-line-bg);outline:1px dotted transparent}.code-diff-view .diff-table .blob-code-addition .x{color:var(--color-diff-blob-addition-fg);background-color:var(--color-diff-blob-addition-word-bg)}.code-diff-view .diff-table .current-diff{border:1px solid var(--color-border-muted)}.code-diff-view .diff-table .blob-code-context,.code-diff-view .diff-table .blob-code-addition,.code-diff-view .diff-table .blob-code-deletion{padding-left:22px!important}.code-diff-view .diff-table .blob-code-marker:before{position:absolute;top:1px;left:8px;padding-right:8px;content:attr(data-code-marker)}.code-diff-view .diff-table .blob-num-hunk{background-color:var(--color-diff-blob-hunk-num-bg)}.code-diff-view .diff-table .blob-code-hunk{background-color:var(--color-accent-subtle)}.code-diff-view .file-diff-split{table-layout:fixed}.code-diff-view .file-diff-split .blob-code+.blob-num{border-left:1px solid var(--color-border-muted)}.code-diff-view .file-diff-split .no-select{user-select:none}.code-diff-view .empty-cell{cursor:default;background-color:var(--color-neutral-subtle);border-right-color:var(--color-border-muted)}")), document.head.appendChild(o);
  32. }
  33. } catch (e) {
  34. console.error("vite-plugin-css-injected-by-js", e);
  35. }
  36. })();
  37. function ae() {
  38. }
  39. ae.prototype = {
  40. diff: function(r, l) {
  41. var f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, g = f.callback;
  42. typeof f == "function" && (g = f, f = {}), this.options = f;
  43. var n = this;
  44. function t(p) {
  45. return g ? (setTimeout(function() {
  46. g(void 0, p);
  47. }, 0), true) : p;
  48. }
  49. r = this.castInput(r), l = this.castInput(l), r = this.removeEmpty(this.tokenize(r)), l = this.removeEmpty(this.tokenize(l));
  50. var i = l.length, s = r.length, a = 1, o = i + s;
  51. f.maxEditLength && (o = Math.min(o, f.maxEditLength));
  52. var c = [{
  53. newPos: -1,
  54. components: []
  55. }], u = this.extractCommon(c[0], l, r, 0);
  56. if (c[0].newPos + 1 >= i && u + 1 >= s)
  57. return t([{
  58. value: this.join(l),
  59. count: l.length
  60. }]);
  61. function d() {
  62. for (var p = -1 * a; p <= a; p += 2) {
  63. var _ = void 0, E = c[p - 1], m = c[p + 1], v = (m ? m.newPos : 0) - p;
  64. E && (c[p - 1] = void 0);
  65. var A = E && E.newPos + 1 < i, D = m && 0 <= v && v < s;
  66. if (!A && !D) {
  67. c[p] = void 0;
  68. continue;
  69. }
  70. if (!A || D && E.newPos < m.newPos ? (_ = Yn(m), n.pushComponent(_.components, void 0, true)) : (_ = E, _.newPos++, n.pushComponent(_.components, true, void 0)), v = n.extractCommon(_, l, r, p), _.newPos + 1 >= i && v + 1 >= s)
  71. return t(Zn(n, _.components, l, r, n.useLongestToken));
  72. c[p] = _;
  73. }
  74. a++;
  75. }
  76. if (g)
  77. (function p() {
  78. setTimeout(function() {
  79. if (a > o)
  80. return g();
  81. d() || p();
  82. }, 0);
  83. })();
  84. else
  85. for (; a <= o; ) {
  86. var h = d();
  87. if (h)
  88. return h;
  89. }
  90. },
  91. pushComponent: function(r, l, f) {
  92. var g = r[r.length - 1];
  93. g && g.added === l && g.removed === f ? r[r.length - 1] = {
  94. count: g.count + 1,
  95. added: l,
  96. removed: f
  97. } : r.push({
  98. count: 1,
  99. added: l,
  100. removed: f
  101. });
  102. },
  103. extractCommon: function(r, l, f, g) {
  104. for (var n = l.length, t = f.length, i = r.newPos, s = i - g, a = 0; i + 1 < n && s + 1 < t && this.equals(l[i + 1], f[s + 1]); )
  105. i++, s++, a++;
  106. return a && r.components.push({
  107. count: a
  108. }), r.newPos = i, s;
  109. },
  110. equals: function(r, l) {
  111. return this.options.comparator ? this.options.comparator(r, l) : r === l || this.options.ignoreCase && r.toLowerCase() === l.toLowerCase();
  112. },
  113. removeEmpty: function(r) {
  114. for (var l = [], f = 0; f < r.length; f++)
  115. r[f] && l.push(r[f]);
  116. return l;
  117. },
  118. castInput: function(r) {
  119. return r;
  120. },
  121. tokenize: function(r) {
  122. return r.split("");
  123. },
  124. join: function(r) {
  125. return r.join("");
  126. }
  127. };
  128. function Zn(e, r, l, f, g) {
  129. for (var n = 0, t = r.length, i = 0, s = 0; n < t; n++) {
  130. var a = r[n];
  131. if (a.removed) {
  132. if (a.value = e.join(f.slice(s, s + a.count)), s += a.count, n && r[n - 1].added) {
  133. var c = r[n - 1];
  134. r[n - 1] = r[n], r[n] = c;
  135. }
  136. } else {
  137. if (!a.added && g) {
  138. var o = l.slice(i, i + a.count);
  139. o = o.map(function(d, h) {
  140. var p = f[s + h];
  141. return p.length > d.length ? p : d;
  142. }), a.value = e.join(o);
  143. } else
  144. a.value = e.join(l.slice(i, i + a.count));
  145. i += a.count, a.added || (s += a.count);
  146. }
  147. }
  148. var u = r[t - 1];
  149. return t > 1 && typeof u.value == "string" && (u.added || u.removed) && e.equals("", u.value) && (r[t - 2].value += u.value, r.pop()), r;
  150. }
  151. function Yn(e) {
  152. return {
  153. newPos: e.newPos,
  154. components: e.components.slice(0)
  155. };
  156. }
  157. var Xn = new ae();
  158. function Vn(e, r, l) {
  159. return Xn.diff(e, r, l);
  160. }
  161. function jn(e, r) {
  162. if (typeof e == "function")
  163. r.callback = e;
  164. else if (e)
  165. for (var l in e)
  166. e.hasOwnProperty(l) && (r[l] = e[l]);
  167. return r;
  168. }
  169. var rn = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
  170. var sn = /\S/;
  171. var We = new ae();
  172. We.equals = function(e, r) {
  173. return this.options.ignoreCase && (e = e.toLowerCase(), r = r.toLowerCase()), e === r || this.options.ignoreWhitespace && !sn.test(e) && !sn.test(r);
  174. };
  175. We.tokenize = function(e) {
  176. for (var r = e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/), l = 0; l < r.length - 1; l++)
  177. !r[l + 1] && r[l + 2] && rn.test(r[l]) && rn.test(r[l + 2]) && (r[l] += r[l + 2], r.splice(l + 1, 2), l--);
  178. return r;
  179. };
  180. function qn(e, r, l) {
  181. return l = jn(l, {
  182. ignoreWhitespace: true
  183. }), We.diff(e, r, l);
  184. }
  185. var bn = new ae();
  186. bn.tokenize = function(e) {
  187. var r = [], l = e.split(/(\n|\r\n)/);
  188. l[l.length - 1] || l.pop();
  189. for (var f = 0; f < l.length; f++) {
  190. var g = l[f];
  191. f % 2 && !this.options.newlineIsToken ? r[r.length - 1] += g : (this.options.ignoreWhitespace && (g = g.trim()), r.push(g));
  192. }
  193. return r;
  194. };
  195. var Jn = new ae();
  196. Jn.tokenize = function(e) {
  197. return e.split(/(\S.+?[.!?])(?=\s+|$)/);
  198. };
  199. var et = new ae();
  200. et.tokenize = function(e) {
  201. return e.split(/([{}:;,]|\s+)/);
  202. };
  203. function Ce(e) {
  204. "@babel/helpers - typeof";
  205. return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ce = function(r) {
  206. return typeof r;
  207. } : Ce = function(r) {
  208. return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
  209. }, Ce(e);
  210. }
  211. var nt = Object.prototype.toString;
  212. var we = new ae();
  213. we.useLongestToken = true;
  214. we.tokenize = bn.tokenize;
  215. we.castInput = function(e) {
  216. var r = this.options, l = r.undefinedReplacement, f = r.stringifyReplacer, g = f === void 0 ? function(n, t) {
  217. return typeof t == "undefined" ? l : t;
  218. } : f;
  219. return typeof e == "string" ? e : JSON.stringify(xe(e, null, null, g), g, " ");
  220. };
  221. we.equals = function(e, r) {
  222. return ae.prototype.equals.call(we, e.replace(/,([\r\n])/g, "$1"), r.replace(/,([\r\n])/g, "$1"));
  223. };
  224. function xe(e, r, l, f, g) {
  225. r = r || [], l = l || [], f && (e = f(g, e));
  226. var n;
  227. for (n = 0; n < r.length; n += 1)
  228. if (r[n] === e)
  229. return l[n];
  230. var t;
  231. if (nt.call(e) === "[object Array]") {
  232. for (r.push(e), t = new Array(e.length), l.push(t), n = 0; n < e.length; n += 1)
  233. t[n] = xe(e[n], r, l, f, g);
  234. return r.pop(), l.pop(), t;
  235. }
  236. if (e && e.toJSON && (e = e.toJSON()), Ce(e) === "object" && e !== null) {
  237. r.push(e), t = {}, l.push(t);
  238. var i = [], s;
  239. for (s in e)
  240. e.hasOwnProperty(s) && i.push(s);
  241. for (i.sort(), n = 0; n < i.length; n += 1)
  242. s = i[n], t[s] = xe(e[s], r, l, f, s);
  243. r.pop(), l.pop();
  244. } else
  245. t = e;
  246. return t;
  247. }
  248. var Ge = new ae();
  249. Ge.tokenize = function(e) {
  250. return e.slice();
  251. };
  252. Ge.join = Ge.removeEmpty = function(e) {
  253. return e;
  254. };
  255. function tt(e) {
  256. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  257. }
  258. var En = { exports: {} };
  259. (function(e) {
  260. var r = function() {
  261. this.Diff_Timeout = 1, this.Diff_EditCost = 4, this.Match_Threshold = 0.5, this.Match_Distance = 1e3, this.Patch_DeleteThreshold = 0.5, this.Patch_Margin = 4, this.Match_MaxBits = 32;
  262. }, l = -1, f = 1, g = 0;
  263. r.Diff = function(n, t) {
  264. return [n, t];
  265. }, r.prototype.diff_main = function(n, t, i, s) {
  266. typeof s == "undefined" && (this.Diff_Timeout <= 0 ? s = Number.MAX_VALUE : s = (/* @__PURE__ */ new Date()).getTime() + this.Diff_Timeout * 1e3);
  267. var a = s;
  268. if (n == null || t == null)
  269. throw new Error("Null input. (diff_main)");
  270. if (n == t)
  271. return n ? [new r.Diff(g, n)] : [];
  272. typeof i == "undefined" && (i = true);
  273. var o = i, c = this.diff_commonPrefix(n, t), u = n.substring(0, c);
  274. n = n.substring(c), t = t.substring(c), c = this.diff_commonSuffix(n, t);
  275. var d = n.substring(n.length - c);
  276. n = n.substring(0, n.length - c), t = t.substring(0, t.length - c);
  277. var h = this.diff_compute_(n, t, o, a);
  278. return u && h.unshift(new r.Diff(g, u)), d && h.push(new r.Diff(g, d)), this.diff_cleanupMerge(h), h;
  279. }, r.prototype.diff_compute_ = function(n, t, i, s) {
  280. var a;
  281. if (!n)
  282. return [new r.Diff(f, t)];
  283. if (!t)
  284. return [new r.Diff(l, n)];
  285. var o = n.length > t.length ? n : t, c = n.length > t.length ? t : n, u = o.indexOf(c);
  286. if (u != -1)
  287. return a = [
  288. new r.Diff(f, o.substring(0, u)),
  289. new r.Diff(g, c),
  290. new r.Diff(
  291. f,
  292. o.substring(u + c.length)
  293. )
  294. ], n.length > t.length && (a[0][0] = a[2][0] = l), a;
  295. if (c.length == 1)
  296. return [
  297. new r.Diff(l, n),
  298. new r.Diff(f, t)
  299. ];
  300. var d = this.diff_halfMatch_(n, t);
  301. if (d) {
  302. var h = d[0], p = d[1], _ = d[2], E = d[3], m = d[4], v = this.diff_main(h, _, i, s), A = this.diff_main(p, E, i, s);
  303. return v.concat(
  304. [new r.Diff(g, m)],
  305. A
  306. );
  307. }
  308. return i && n.length > 100 && t.length > 100 ? this.diff_lineMode_(n, t, s) : this.diff_bisect_(n, t, s);
  309. }, r.prototype.diff_lineMode_ = function(n, t, i) {
  310. var s = this.diff_linesToChars_(n, t);
  311. n = s.chars1, t = s.chars2;
  312. var a = s.lineArray, o = this.diff_main(n, t, false, i);
  313. this.diff_charsToLines_(o, a), this.diff_cleanupSemantic(o), o.push(new r.Diff(g, ""));
  314. for (var c = 0, u = 0, d = 0, h = "", p = ""; c < o.length; ) {
  315. switch (o[c][0]) {
  316. case f:
  317. d++, p += o[c][1];
  318. break;
  319. case l:
  320. u++, h += o[c][1];
  321. break;
  322. case g:
  323. if (u >= 1 && d >= 1) {
  324. o.splice(
  325. c - u - d,
  326. u + d
  327. ), c = c - u - d;
  328. for (var _ = this.diff_main(h, p, false, i), E = _.length - 1; E >= 0; E--)
  329. o.splice(c, 0, _[E]);
  330. c = c + _.length;
  331. }
  332. d = 0, u = 0, h = "", p = "";
  333. break;
  334. }
  335. c++;
  336. }
  337. return o.pop(), o;
  338. }, r.prototype.diff_bisect_ = function(n, t, i) {
  339. for (var s = n.length, a = t.length, o = Math.ceil((s + a) / 2), c = o, u = 2 * o, d = new Array(u), h = new Array(u), p = 0; p < u; p++)
  340. d[p] = -1, h[p] = -1;
  341. d[c + 1] = 0, h[c + 1] = 0;
  342. for (var _ = s - a, E = _ % 2 != 0, m = 0, v = 0, A = 0, D = 0, S = 0; S < o && !((/* @__PURE__ */ new Date()).getTime() > i); S++) {
  343. for (var M = -S + m; M <= S - v; M += 2) {
  344. var R = c + M, L;
  345. M == -S || M != S && d[R - 1] < d[R + 1] ? L = d[R + 1] : L = d[R - 1] + 1;
  346. for (var I = L - M; L < s && I < a && n.charAt(L) == t.charAt(I); )
  347. L++, I++;
  348. if (d[R] = L, L > s)
  349. v += 2;
  350. else if (I > a)
  351. m += 2;
  352. else if (E) {
  353. var P = c + _ - M;
  354. if (P >= 0 && P < u && h[P] != -1) {
  355. var $ = s - h[P];
  356. if (L >= $)
  357. return this.diff_bisectSplit_(n, t, L, I, i);
  358. }
  359. }
  360. }
  361. for (var K = -S + A; K <= S - D; K += 2) {
  362. var P = c + K, $;
  363. K == -S || K != S && h[P - 1] < h[P + 1] ? $ = h[P + 1] : $ = h[P - 1] + 1;
  364. for (var Y = $ - K; $ < s && Y < a && n.charAt(s - $ - 1) == t.charAt(a - Y - 1); )
  365. $++, Y++;
  366. if (h[P] = $, $ > s)
  367. D += 2;
  368. else if (Y > a)
  369. A += 2;
  370. else if (!E) {
  371. var R = c + _ - K;
  372. if (R >= 0 && R < u && d[R] != -1) {
  373. var L = d[R], I = c + L - R;
  374. if ($ = s - $, L >= $)
  375. return this.diff_bisectSplit_(n, t, L, I, i);
  376. }
  377. }
  378. }
  379. }
  380. return [
  381. new r.Diff(l, n),
  382. new r.Diff(f, t)
  383. ];
  384. }, r.prototype.diff_bisectSplit_ = function(n, t, i, s, a) {
  385. var o = n.substring(0, i), c = t.substring(0, s), u = n.substring(i), d = t.substring(s), h = this.diff_main(o, c, false, a), p = this.diff_main(u, d, false, a);
  386. return h.concat(p);
  387. }, r.prototype.diff_linesToChars_ = function(n, t) {
  388. var i = [], s = {};
  389. i[0] = "";
  390. function a(d) {
  391. for (var h = "", p = 0, _ = -1, E = i.length; _ < d.length - 1; ) {
  392. _ = d.indexOf(`
  393. `, p), _ == -1 && (_ = d.length - 1);
  394. var m = d.substring(p, _ + 1);
  395. (s.hasOwnProperty ? s.hasOwnProperty(m) : s[m] !== void 0) ? h += String.fromCharCode(s[m]) : (E == o && (m = d.substring(p), _ = d.length), h += String.fromCharCode(E), s[m] = E, i[E++] = m), p = _ + 1;
  396. }
  397. return h;
  398. }
  399. var o = 4e4, c = a(n);
  400. o = 65535;
  401. var u = a(t);
  402. return { chars1: c, chars2: u, lineArray: i };
  403. }, r.prototype.diff_charsToLines_ = function(n, t) {
  404. for (var i = 0; i < n.length; i++) {
  405. for (var s = n[i][1], a = [], o = 0; o < s.length; o++)
  406. a[o] = t[s.charCodeAt(o)];
  407. n[i][1] = a.join("");
  408. }
  409. }, r.prototype.diff_commonPrefix = function(n, t) {
  410. if (!n || !t || n.charAt(0) != t.charAt(0))
  411. return 0;
  412. for (var i = 0, s = Math.min(n.length, t.length), a = s, o = 0; i < a; )
  413. n.substring(o, a) == t.substring(o, a) ? (i = a, o = i) : s = a, a = Math.floor((s - i) / 2 + i);
  414. return a;
  415. }, r.prototype.diff_commonSuffix = function(n, t) {
  416. if (!n || !t || n.charAt(n.length - 1) != t.charAt(t.length - 1))
  417. return 0;
  418. for (var i = 0, s = Math.min(n.length, t.length), a = s, o = 0; i < a; )
  419. n.substring(n.length - a, n.length - o) == t.substring(t.length - a, t.length - o) ? (i = a, o = i) : s = a, a = Math.floor((s - i) / 2 + i);
  420. return a;
  421. }, r.prototype.diff_commonOverlap_ = function(n, t) {
  422. var i = n.length, s = t.length;
  423. if (i == 0 || s == 0)
  424. return 0;
  425. i > s ? n = n.substring(i - s) : i < s && (t = t.substring(0, i));
  426. var a = Math.min(i, s);
  427. if (n == t)
  428. return a;
  429. for (var o = 0, c = 1; ; ) {
  430. var u = n.substring(a - c), d = t.indexOf(u);
  431. if (d == -1)
  432. return o;
  433. c += d, (d == 0 || n.substring(a - c) == t.substring(0, c)) && (o = c, c++);
  434. }
  435. }, r.prototype.diff_halfMatch_ = function(n, t) {
  436. if (this.Diff_Timeout <= 0)
  437. return null;
  438. var i = n.length > t.length ? n : t, s = n.length > t.length ? t : n;
  439. if (i.length < 4 || s.length * 2 < i.length)
  440. return null;
  441. var a = this;
  442. function o(v, A, D) {
  443. for (var S = v.substring(D, D + Math.floor(v.length / 4)), M = -1, R = "", L, I, P, $; (M = A.indexOf(S, M + 1)) != -1; ) {
  444. var K = a.diff_commonPrefix(
  445. v.substring(D),
  446. A.substring(M)
  447. ), Y = a.diff_commonSuffix(
  448. v.substring(0, D),
  449. A.substring(0, M)
  450. );
  451. R.length < Y + K && (R = A.substring(M - Y, M) + A.substring(M, M + K), L = v.substring(0, D - Y), I = v.substring(D + K), P = A.substring(0, M - Y), $ = A.substring(M + K));
  452. }
  453. return R.length * 2 >= v.length ? [
  454. L,
  455. I,
  456. P,
  457. $,
  458. R
  459. ] : null;
  460. }
  461. var c = o(
  462. i,
  463. s,
  464. Math.ceil(i.length / 4)
  465. ), u = o(
  466. i,
  467. s,
  468. Math.ceil(i.length / 2)
  469. ), d;
  470. if (!c && !u)
  471. return null;
  472. u ? c ? d = c[4].length > u[4].length ? c : u : d = u : d = c;
  473. var h, p, _, E;
  474. n.length > t.length ? (h = d[0], p = d[1], _ = d[2], E = d[3]) : (_ = d[0], E = d[1], h = d[2], p = d[3]);
  475. var m = d[4];
  476. return [h, p, _, E, m];
  477. }, r.prototype.diff_cleanupSemantic = function(n) {
  478. for (var t = false, i = [], s = 0, a = null, o = 0, c = 0, u = 0, d = 0, h = 0; o < n.length; )
  479. n[o][0] == g ? (i[s++] = o, c = d, u = h, d = 0, h = 0, a = n[o][1]) : (n[o][0] == f ? d += n[o][1].length : h += n[o][1].length, a && a.length <= Math.max(c, u) && a.length <= Math.max(
  480. d,
  481. h
  482. ) && (n.splice(
  483. i[s - 1],
  484. 0,
  485. new r.Diff(l, a)
  486. ), n[i[s - 1] + 1][0] = f, s--, s--, o = s > 0 ? i[s - 1] : -1, c = 0, u = 0, d = 0, h = 0, a = null, t = true)), o++;
  487. for (t && this.diff_cleanupMerge(n), this.diff_cleanupSemanticLossless(n), o = 1; o < n.length; ) {
  488. if (n[o - 1][0] == l && n[o][0] == f) {
  489. var p = n[o - 1][1], _ = n[o][1], E = this.diff_commonOverlap_(p, _), m = this.diff_commonOverlap_(_, p);
  490. E >= m ? (E >= p.length / 2 || E >= _.length / 2) && (n.splice(o, 0, new r.Diff(
  491. g,
  492. _.substring(0, E)
  493. )), n[o - 1][1] = p.substring(0, p.length - E), n[o + 1][1] = _.substring(E), o++) : (m >= p.length / 2 || m >= _.length / 2) && (n.splice(o, 0, new r.Diff(
  494. g,
  495. p.substring(0, m)
  496. )), n[o - 1][0] = f, n[o - 1][1] = _.substring(0, _.length - m), n[o + 1][0] = l, n[o + 1][1] = p.substring(m), o++), o++;
  497. }
  498. o++;
  499. }
  500. }, r.prototype.diff_cleanupSemanticLossless = function(n) {
  501. function t(m, v) {
  502. if (!m || !v)
  503. return 6;
  504. var A = m.charAt(m.length - 1), D = v.charAt(0), S = A.match(r.nonAlphaNumericRegex_), M = D.match(r.nonAlphaNumericRegex_), R = S && A.match(r.whitespaceRegex_), L = M && D.match(r.whitespaceRegex_), I = R && A.match(r.linebreakRegex_), P = L && D.match(r.linebreakRegex_), $ = I && m.match(r.blanklineEndRegex_), K = P && v.match(r.blanklineStartRegex_);
  505. return $ || K ? 5 : I || P ? 4 : S && !R && L ? 3 : R || L ? 2 : S || M ? 1 : 0;
  506. }
  507. for (var i = 1; i < n.length - 1; ) {
  508. if (n[i - 1][0] == g && n[i + 1][0] == g) {
  509. var s = n[i - 1][1], a = n[i][1], o = n[i + 1][1], c = this.diff_commonSuffix(s, a);
  510. if (c) {
  511. var u = a.substring(a.length - c);
  512. s = s.substring(0, s.length - c), a = u + a.substring(0, a.length - c), o = u + o;
  513. }
  514. for (var d = s, h = a, p = o, _ = t(s, a) + t(a, o); a.charAt(0) === o.charAt(0); ) {
  515. s += a.charAt(0), a = a.substring(1) + o.charAt(0), o = o.substring(1);
  516. var E = t(s, a) + t(a, o);
  517. E >= _ && (_ = E, d = s, h = a, p = o);
  518. }
  519. n[i - 1][1] != d && (d ? n[i - 1][1] = d : (n.splice(i - 1, 1), i--), n[i][1] = h, p ? n[i + 1][1] = p : (n.splice(i + 1, 1), i--));
  520. }
  521. i++;
  522. }
  523. }, r.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/, r.whitespaceRegex_ = /\s/, r.linebreakRegex_ = /[\r\n]/, r.blanklineEndRegex_ = /\n\r?\n$/, r.blanklineStartRegex_ = /^\r?\n\r?\n/, r.prototype.diff_cleanupEfficiency = function(n) {
  524. for (var t = false, i = [], s = 0, a = null, o = 0, c = false, u = false, d = false, h = false; o < n.length; )
  525. n[o][0] == g ? (n[o][1].length < this.Diff_EditCost && (d || h) ? (i[s++] = o, c = d, u = h, a = n[o][1]) : (s = 0, a = null), d = h = false) : (n[o][0] == l ? h = true : d = true, a && (c && u && d && h || a.length < this.Diff_EditCost / 2 && c + u + d + h == 3) && (n.splice(
  526. i[s - 1],
  527. 0,
  528. new r.Diff(l, a)
  529. ), n[i[s - 1] + 1][0] = f, s--, a = null, c && u ? (d = h = true, s = 0) : (s--, o = s > 0 ? i[s - 1] : -1, d = h = false), t = true)), o++;
  530. t && this.diff_cleanupMerge(n);
  531. }, r.prototype.diff_cleanupMerge = function(n) {
  532. n.push(new r.Diff(g, ""));
  533. for (var t = 0, i = 0, s = 0, a = "", o = "", c; t < n.length; )
  534. switch (n[t][0]) {
  535. case f:
  536. s++, o += n[t][1], t++;
  537. break;
  538. case l:
  539. i++, a += n[t][1], t++;
  540. break;
  541. case g:
  542. i + s > 1 ? (i !== 0 && s !== 0 && (c = this.diff_commonPrefix(o, a), c !== 0 && (t - i - s > 0 && n[t - i - s - 1][0] == g ? n[t - i - s - 1][1] += o.substring(0, c) : (n.splice(0, 0, new r.Diff(
  543. g,
  544. o.substring(0, c)
  545. )), t++), o = o.substring(c), a = a.substring(c)), c = this.diff_commonSuffix(o, a), c !== 0 && (n[t][1] = o.substring(o.length - c) + n[t][1], o = o.substring(0, o.length - c), a = a.substring(0, a.length - c))), t -= i + s, n.splice(t, i + s), a.length && (n.splice(
  546. t,
  547. 0,
  548. new r.Diff(l, a)
  549. ), t++), o.length && (n.splice(
  550. t,
  551. 0,
  552. new r.Diff(f, o)
  553. ), t++), t++) : t !== 0 && n[t - 1][0] == g ? (n[t - 1][1] += n[t][1], n.splice(t, 1)) : t++, s = 0, i = 0, a = "", o = "";
  554. break;
  555. }
  556. n[n.length - 1][1] === "" && n.pop();
  557. var u = false;
  558. for (t = 1; t < n.length - 1; )
  559. n[t - 1][0] == g && n[t + 1][0] == g && (n[t][1].substring(n[t][1].length - n[t - 1][1].length) == n[t - 1][1] ? (n[t][1] = n[t - 1][1] + n[t][1].substring(0, n[t][1].length - n[t - 1][1].length), n[t + 1][1] = n[t - 1][1] + n[t + 1][1], n.splice(t - 1, 1), u = true) : n[t][1].substring(0, n[t + 1][1].length) == n[t + 1][1] && (n[t - 1][1] += n[t + 1][1], n[t][1] = n[t][1].substring(n[t + 1][1].length) + n[t + 1][1], n.splice(t + 1, 1), u = true)), t++;
  560. u && this.diff_cleanupMerge(n);
  561. }, r.prototype.diff_xIndex = function(n, t) {
  562. var i = 0, s = 0, a = 0, o = 0, c;
  563. for (c = 0; c < n.length && (n[c][0] !== f && (i += n[c][1].length), n[c][0] !== l && (s += n[c][1].length), !(i > t)); c++)
  564. a = i, o = s;
  565. return n.length != c && n[c][0] === l ? o : o + (t - a);
  566. }, r.prototype.diff_prettyHtml = function(n) {
  567. for (var t = [], i = /&/g, s = /</g, a = />/g, o = /\n/g, c = 0; c < n.length; c++) {
  568. var u = n[c][0], d = n[c][1], h = d.replace(i, "&amp;").replace(s, "&lt;").replace(a, "&gt;").replace(o, "&para;<br>");
  569. switch (u) {
  570. case f:
  571. t[c] = '<ins style="background:#e6ffe6;">' + h + "</ins>";
  572. break;
  573. case l:
  574. t[c] = '<del style="background:#ffe6e6;">' + h + "</del>";
  575. break;
  576. case g:
  577. t[c] = "<span>" + h + "</span>";
  578. break;
  579. }
  580. }
  581. return t.join("");
  582. }, r.prototype.diff_text1 = function(n) {
  583. for (var t = [], i = 0; i < n.length; i++)
  584. n[i][0] !== f && (t[i] = n[i][1]);
  585. return t.join("");
  586. }, r.prototype.diff_text2 = function(n) {
  587. for (var t = [], i = 0; i < n.length; i++)
  588. n[i][0] !== l && (t[i] = n[i][1]);
  589. return t.join("");
  590. }, r.prototype.diff_levenshtein = function(n) {
  591. for (var t = 0, i = 0, s = 0, a = 0; a < n.length; a++) {
  592. var o = n[a][0], c = n[a][1];
  593. switch (o) {
  594. case f:
  595. i += c.length;
  596. break;
  597. case l:
  598. s += c.length;
  599. break;
  600. case g:
  601. t += Math.max(i, s), i = 0, s = 0;
  602. break;
  603. }
  604. }
  605. return t += Math.max(i, s), t;
  606. }, r.prototype.diff_toDelta = function(n) {
  607. for (var t = [], i = 0; i < n.length; i++)
  608. switch (n[i][0]) {
  609. case f:
  610. t[i] = "+" + encodeURI(n[i][1]);
  611. break;
  612. case l:
  613. t[i] = "-" + n[i][1].length;
  614. break;
  615. case g:
  616. t[i] = "=" + n[i][1].length;
  617. break;
  618. }
  619. return t.join(" ").replace(/%20/g, " ");
  620. }, r.prototype.diff_fromDelta = function(n, t) {
  621. for (var i = [], s = 0, a = 0, o = t.split(/\t/g), c = 0; c < o.length; c++) {
  622. var u = o[c].substring(1);
  623. switch (o[c].charAt(0)) {
  624. case "+":
  625. try {
  626. i[s++] = new r.Diff(f, decodeURI(u));
  627. } catch (p) {
  628. throw new Error("Illegal escape in diff_fromDelta: " + u);
  629. }
  630. break;
  631. case "-":
  632. case "=":
  633. var d = parseInt(u, 10);
  634. if (isNaN(d) || d < 0)
  635. throw new Error("Invalid number in diff_fromDelta: " + u);
  636. var h = n.substring(a, a += d);
  637. o[c].charAt(0) == "=" ? i[s++] = new r.Diff(g, h) : i[s++] = new r.Diff(l, h);
  638. break;
  639. default:
  640. if (o[c])
  641. throw new Error("Invalid diff operation in diff_fromDelta: " + o[c]);
  642. }
  643. }
  644. if (a != n.length)
  645. throw new Error("Delta length (" + a + ") does not equal source text length (" + n.length + ").");
  646. return i;
  647. }, r.prototype.match_main = function(n, t, i) {
  648. if (n == null || t == null || i == null)
  649. throw new Error("Null input. (match_main)");
  650. return i = Math.max(0, Math.min(i, n.length)), n == t ? 0 : n.length ? n.substring(i, i + t.length) == t ? i : this.match_bitap_(n, t, i) : -1;
  651. }, r.prototype.match_bitap_ = function(n, t, i) {
  652. if (t.length > this.Match_MaxBits)
  653. throw new Error("Pattern too long for this browser.");
  654. var s = this.match_alphabet_(t), a = this;
  655. function o(L, I) {
  656. var P = L / t.length, $ = Math.abs(i - I);
  657. return a.Match_Distance ? P + $ / a.Match_Distance : $ ? 1 : P;
  658. }
  659. var c = this.Match_Threshold, u = n.indexOf(t, i);
  660. u != -1 && (c = Math.min(o(0, u), c), u = n.lastIndexOf(t, i + t.length), u != -1 && (c = Math.min(o(0, u), c)));
  661. var d = 1 << t.length - 1;
  662. u = -1;
  663. for (var h, p, _ = t.length + n.length, E, m = 0; m < t.length; m++) {
  664. for (h = 0, p = _; h < p; )
  665. o(m, i + p) <= c ? h = p : _ = p, p = Math.floor((_ - h) / 2 + h);
  666. _ = p;
  667. var v = Math.max(1, i - p + 1), A = Math.min(i + p, n.length) + t.length, D = Array(A + 2);
  668. D[A + 1] = (1 << m) - 1;
  669. for (var S = A; S >= v; S--) {
  670. var M = s[n.charAt(S - 1)];
  671. if (m === 0 ? D[S] = (D[S + 1] << 1 | 1) & M : D[S] = (D[S + 1] << 1 | 1) & M | ((E[S + 1] | E[S]) << 1 | 1) | E[S + 1], D[S] & d) {
  672. var R = o(m, S - 1);
  673. if (R <= c)
  674. if (c = R, u = S - 1, u > i)
  675. v = Math.max(1, 2 * i - u);
  676. else
  677. break;
  678. }
  679. }
  680. if (o(m + 1, i) > c)
  681. break;
  682. E = D;
  683. }
  684. return u;
  685. }, r.prototype.match_alphabet_ = function(n) {
  686. for (var t = {}, i = 0; i < n.length; i++)
  687. t[n.charAt(i)] = 0;
  688. for (var i = 0; i < n.length; i++)
  689. t[n.charAt(i)] |= 1 << n.length - i - 1;
  690. return t;
  691. }, r.prototype.patch_addContext_ = function(n, t) {
  692. if (t.length != 0) {
  693. if (n.start2 === null)
  694. throw Error("patch not initialized");
  695. for (var i = t.substring(n.start2, n.start2 + n.length1), s = 0; t.indexOf(i) != t.lastIndexOf(i) && i.length < this.Match_MaxBits - this.Patch_Margin - this.Patch_Margin; )
  696. s += this.Patch_Margin, i = t.substring(
  697. n.start2 - s,
  698. n.start2 + n.length1 + s
  699. );
  700. s += this.Patch_Margin;
  701. var a = t.substring(n.start2 - s, n.start2);
  702. a && n.diffs.unshift(new r.Diff(g, a));
  703. var o = t.substring(
  704. n.start2 + n.length1,
  705. n.start2 + n.length1 + s
  706. );
  707. o && n.diffs.push(new r.Diff(g, o)), n.start1 -= a.length, n.start2 -= a.length, n.length1 += a.length + o.length, n.length2 += a.length + o.length;
  708. }
  709. }, r.prototype.patch_make = function(n, t, i) {
  710. var s, a;
  711. if (typeof n == "string" && typeof t == "string" && typeof i == "undefined")
  712. s = /** @type {string} */
  713. n, a = this.diff_main(
  714. s,
  715. /** @type {string} */
  716. t,
  717. true
  718. ), a.length > 2 && (this.diff_cleanupSemantic(a), this.diff_cleanupEfficiency(a));
  719. else if (n && typeof n == "object" && typeof t == "undefined" && typeof i == "undefined")
  720. a = /** @type {!Array.<!diff_match_patch.Diff>} */
  721. n, s = this.diff_text1(a);
  722. else if (typeof n == "string" && t && typeof t == "object" && typeof i == "undefined")
  723. s = /** @type {string} */
  724. n, a = /** @type {!Array.<!diff_match_patch.Diff>} */
  725. t;
  726. else if (typeof n == "string" && typeof t == "string" && i && typeof i == "object")
  727. s = /** @type {string} */
  728. n, a = /** @type {!Array.<!diff_match_patch.Diff>} */
  729. i;
  730. else
  731. throw new Error("Unknown call format to patch_make.");
  732. if (a.length === 0)
  733. return [];
  734. for (var o = [], c = new r.patch_obj(), u = 0, d = 0, h = 0, p = s, _ = s, E = 0; E < a.length; E++) {
  735. var m = a[E][0], v = a[E][1];
  736. switch (!u && m !== g && (c.start1 = d, c.start2 = h), m) {
  737. case f:
  738. c.diffs[u++] = a[E], c.length2 += v.length, _ = _.substring(0, h) + v + _.substring(h);
  739. break;
  740. case l:
  741. c.length1 += v.length, c.diffs[u++] = a[E], _ = _.substring(0, h) + _.substring(h + v.length);
  742. break;
  743. case g:
  744. v.length <= 2 * this.Patch_Margin && u && a.length != E + 1 ? (c.diffs[u++] = a[E], c.length1 += v.length, c.length2 += v.length) : v.length >= 2 * this.Patch_Margin && u && (this.patch_addContext_(c, p), o.push(c), c = new r.patch_obj(), u = 0, p = _, d = h);
  745. break;
  746. }
  747. m !== f && (d += v.length), m !== l && (h += v.length);
  748. }
  749. return u && (this.patch_addContext_(c, p), o.push(c)), o;
  750. }, r.prototype.patch_deepCopy = function(n) {
  751. for (var t = [], i = 0; i < n.length; i++) {
  752. var s = n[i], a = new r.patch_obj();
  753. a.diffs = [];
  754. for (var o = 0; o < s.diffs.length; o++)
  755. a.diffs[o] = new r.Diff(s.diffs[o][0], s.diffs[o][1]);
  756. a.start1 = s.start1, a.start2 = s.start2, a.length1 = s.length1, a.length2 = s.length2, t[i] = a;
  757. }
  758. return t;
  759. }, r.prototype.patch_apply = function(n, t) {
  760. if (n.length == 0)
  761. return [t, []];
  762. n = this.patch_deepCopy(n);
  763. var i = this.patch_addPadding(n);
  764. t = i + t + i, this.patch_splitMax(n);
  765. for (var s = 0, a = [], o = 0; o < n.length; o++) {
  766. var c = n[o].start2 + s, u = this.diff_text1(n[o].diffs), d, h = -1;
  767. if (u.length > this.Match_MaxBits ? (d = this.match_main(
  768. t,
  769. u.substring(0, this.Match_MaxBits),
  770. c
  771. ), d != -1 && (h = this.match_main(
  772. t,
  773. u.substring(u.length - this.Match_MaxBits),
  774. c + u.length - this.Match_MaxBits
  775. ), (h == -1 || d >= h) && (d = -1))) : d = this.match_main(t, u, c), d == -1)
  776. a[o] = false, s -= n[o].length2 - n[o].length1;
  777. else {
  778. a[o] = true, s = d - c;
  779. var p;
  780. if (h == -1 ? p = t.substring(d, d + u.length) : p = t.substring(d, h + this.Match_MaxBits), u == p)
  781. t = t.substring(0, d) + this.diff_text2(n[o].diffs) + t.substring(d + u.length);
  782. else {
  783. var _ = this.diff_main(u, p, false);
  784. if (u.length > this.Match_MaxBits && this.diff_levenshtein(_) / u.length > this.Patch_DeleteThreshold)
  785. a[o] = false;
  786. else {
  787. this.diff_cleanupSemanticLossless(_);
  788. for (var E = 0, m, v = 0; v < n[o].diffs.length; v++) {
  789. var A = n[o].diffs[v];
  790. A[0] !== g && (m = this.diff_xIndex(_, E)), A[0] === f ? t = t.substring(0, d + m) + A[1] + t.substring(d + m) : A[0] === l && (t = t.substring(0, d + m) + t.substring(d + this.diff_xIndex(
  791. _,
  792. E + A[1].length
  793. ))), A[0] !== l && (E += A[1].length);
  794. }
  795. }
  796. }
  797. }
  798. }
  799. return t = t.substring(i.length, t.length - i.length), [t, a];
  800. }, r.prototype.patch_addPadding = function(n) {
  801. for (var t = this.Patch_Margin, i = "", s = 1; s <= t; s++)
  802. i += String.fromCharCode(s);
  803. for (var s = 0; s < n.length; s++)
  804. n[s].start1 += t, n[s].start2 += t;
  805. var a = n[0], o = a.diffs;
  806. if (o.length == 0 || o[0][0] != g)
  807. o.unshift(new r.Diff(g, i)), a.start1 -= t, a.start2 -= t, a.length1 += t, a.length2 += t;
  808. else if (t > o[0][1].length) {
  809. var c = t - o[0][1].length;
  810. o[0][1] = i.substring(o[0][1].length) + o[0][1], a.start1 -= c, a.start2 -= c, a.length1 += c, a.length2 += c;
  811. }
  812. if (a = n[n.length - 1], o = a.diffs, o.length == 0 || o[o.length - 1][0] != g)
  813. o.push(new r.Diff(g, i)), a.length1 += t, a.length2 += t;
  814. else if (t > o[o.length - 1][1].length) {
  815. var c = t - o[o.length - 1][1].length;
  816. o[o.length - 1][1] += i.substring(0, c), a.length1 += c, a.length2 += c;
  817. }
  818. return i;
  819. }, r.prototype.patch_splitMax = function(n) {
  820. for (var t = this.Match_MaxBits, i = 0; i < n.length; i++)
  821. if (!(n[i].length1 <= t)) {
  822. var s = n[i];
  823. n.splice(i--, 1);
  824. for (var a = s.start1, o = s.start2, c = ""; s.diffs.length !== 0; ) {
  825. var u = new r.patch_obj(), d = true;
  826. for (u.start1 = a - c.length, u.start2 = o - c.length, c !== "" && (u.length1 = u.length2 = c.length, u.diffs.push(new r.Diff(g, c))); s.diffs.length !== 0 && u.length1 < t - this.Patch_Margin; ) {
  827. var h = s.diffs[0][0], p = s.diffs[0][1];
  828. h === f ? (u.length2 += p.length, o += p.length, u.diffs.push(s.diffs.shift()), d = false) : h === l && u.diffs.length == 1 && u.diffs[0][0] == g && p.length > 2 * t ? (u.length1 += p.length, a += p.length, d = false, u.diffs.push(new r.Diff(h, p)), s.diffs.shift()) : (p = p.substring(
  829. 0,
  830. t - u.length1 - this.Patch_Margin
  831. ), u.length1 += p.length, a += p.length, h === g ? (u.length2 += p.length, o += p.length) : d = false, u.diffs.push(new r.Diff(h, p)), p == s.diffs[0][1] ? s.diffs.shift() : s.diffs[0][1] = s.diffs[0][1].substring(p.length));
  832. }
  833. c = this.diff_text2(u.diffs), c = c.substring(c.length - this.Patch_Margin);
  834. var _ = this.diff_text1(s.diffs).substring(0, this.Patch_Margin);
  835. _ !== "" && (u.length1 += _.length, u.length2 += _.length, u.diffs.length !== 0 && u.diffs[u.diffs.length - 1][0] === g ? u.diffs[u.diffs.length - 1][1] += _ : u.diffs.push(new r.Diff(g, _))), d || n.splice(++i, 0, u);
  836. }
  837. }
  838. }, r.prototype.patch_toText = function(n) {
  839. for (var t = [], i = 0; i < n.length; i++)
  840. t[i] = n[i];
  841. return t.join("");
  842. }, r.prototype.patch_fromText = function(n) {
  843. var t = [];
  844. if (!n)
  845. return t;
  846. for (var i = n.split(`
  847. `), s = 0, a = /^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/; s < i.length; ) {
  848. var o = i[s].match(a);
  849. if (!o)
  850. throw new Error("Invalid patch string: " + i[s]);
  851. var c = new r.patch_obj();
  852. for (t.push(c), c.start1 = parseInt(o[1], 10), o[2] === "" ? (c.start1--, c.length1 = 1) : o[2] == "0" ? c.length1 = 0 : (c.start1--, c.length1 = parseInt(o[2], 10)), c.start2 = parseInt(o[3], 10), o[4] === "" ? (c.start2--, c.length2 = 1) : o[4] == "0" ? c.length2 = 0 : (c.start2--, c.length2 = parseInt(o[4], 10)), s++; s < i.length; ) {
  853. var u = i[s].charAt(0);
  854. try {
  855. var d = decodeURI(i[s].substring(1));
  856. } catch (h) {
  857. throw new Error("Illegal escape in patch_fromText: " + d);
  858. }
  859. if (u == "-")
  860. c.diffs.push(new r.Diff(l, d));
  861. else if (u == "+")
  862. c.diffs.push(new r.Diff(f, d));
  863. else if (u == " ")
  864. c.diffs.push(new r.Diff(g, d));
  865. else {
  866. if (u == "@")
  867. break;
  868. if (u !== "")
  869. throw new Error('Invalid patch mode "' + u + '" in: ' + d);
  870. }
  871. s++;
  872. }
  873. }
  874. return t;
  875. }, r.patch_obj = function() {
  876. this.diffs = [], this.start1 = null, this.start2 = null, this.length1 = 0, this.length2 = 0;
  877. }, r.patch_obj.prototype.toString = function() {
  878. var n, t;
  879. this.length1 === 0 ? n = this.start1 + ",0" : this.length1 == 1 ? n = this.start1 + 1 : n = this.start1 + 1 + "," + this.length1, this.length2 === 0 ? t = this.start2 + ",0" : this.length2 == 1 ? t = this.start2 + 1 : t = this.start2 + 1 + "," + this.length2;
  880. for (var i = ["@@ -" + n + " +" + t + ` @@
  881. `], s, a = 0; a < this.diffs.length; a++) {
  882. switch (this.diffs[a][0]) {
  883. case f:
  884. s = "+";
  885. break;
  886. case l:
  887. s = "-";
  888. break;
  889. case g:
  890. s = " ";
  891. break;
  892. }
  893. i[a + 1] = s + encodeURI(this.diffs[a][1]) + `
  894. `;
  895. }
  896. return i.join("").replace(/%20/g, " ");
  897. }, e.exports = r, e.exports.diff_match_patch = r, e.exports.DIFF_DELETE = l, e.exports.DIFF_INSERT = f, e.exports.DIFF_EQUAL = g;
  898. })(En);
  899. var Fe = En.exports;
  900. function mn(e) {
  901. return e instanceof Map ? e.clear = e.delete = e.set = function() {
  902. throw new Error("map is read-only");
  903. } : e instanceof Set && (e.add = e.clear = e.delete = function() {
  904. throw new Error("set is read-only");
  905. }), Object.freeze(e), Object.getOwnPropertyNames(e).forEach((r) => {
  906. const l = e[r], f = typeof l;
  907. (f === "object" || f === "function") && !Object.isFrozen(l) && mn(l);
  908. }), e;
  909. }
  910. var an = class {
  911. /**
  912. * @param {CompiledMode} mode
  913. */
  914. constructor(r) {
  915. r.data === void 0 && (r.data = {}), this.data = r.data, this.isMatchIgnored = false;
  916. }
  917. ignoreMatch() {
  918. this.isMatchIgnored = true;
  919. }
  920. };
  921. function vn(e) {
  922. return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
  923. }
  924. function le(e, ...r) {
  925. const l = /* @__PURE__ */ Object.create(null);
  926. for (const f in e)
  927. l[f] = e[f];
  928. return r.forEach(function(f) {
  929. for (const g in f)
  930. l[g] = f[g];
  931. }), /** @type {T} */
  932. l;
  933. }
  934. var rt = "</span>";
  935. var on = (e) => !!e.scope;
  936. var it = (e, { prefix: r }) => {
  937. if (e.startsWith("language:"))
  938. return e.replace("language:", "language-");
  939. if (e.includes(".")) {
  940. const l = e.split(".");
  941. return [
  942. `${r}${l.shift()}`,
  943. ...l.map((f, g) => `${f}${"_".repeat(g + 1)}`)
  944. ].join(" ");
  945. }
  946. return `${r}${e}`;
  947. };
  948. var st = class {
  949. /**
  950. * Creates a new HTMLRenderer
  951. *
  952. * @param {Tree} parseTree - the parse tree (must support `walk` API)
  953. * @param {{classPrefix: string}} options
  954. */
  955. constructor(r, l) {
  956. this.buffer = "", this.classPrefix = l.classPrefix, r.walk(this);
  957. }
  958. /**
  959. * Adds texts to the output stream
  960. *
  961. * @param {string} text */
  962. addText(r) {
  963. this.buffer += vn(r);
  964. }
  965. /**
  966. * Adds a node open to the output stream (if needed)
  967. *
  968. * @param {Node} node */
  969. openNode(r) {
  970. if (!on(r))
  971. return;
  972. const l = it(
  973. r.scope,
  974. { prefix: this.classPrefix }
  975. );
  976. this.span(l);
  977. }
  978. /**
  979. * Adds a node close to the output stream (if needed)
  980. *
  981. * @param {Node} node */
  982. closeNode(r) {
  983. on(r) && (this.buffer += rt);
  984. }
  985. /**
  986. * returns the accumulated buffer
  987. */
  988. value() {
  989. return this.buffer;
  990. }
  991. // helpers
  992. /**
  993. * Builds a span element
  994. *
  995. * @param {string} className */
  996. span(r) {
  997. this.buffer += `<span class="${r}">`;
  998. }
  999. };
  1000. var ln = (e = {}) => {
  1001. const r = { children: [] };
  1002. return Object.assign(r, e), r;
  1003. };
  1004. var Qe = class _Qe {
  1005. constructor() {
  1006. this.rootNode = ln(), this.stack = [this.rootNode];
  1007. }
  1008. get top() {
  1009. return this.stack[this.stack.length - 1];
  1010. }
  1011. get root() {
  1012. return this.rootNode;
  1013. }
  1014. /** @param {Node} node */
  1015. add(r) {
  1016. this.top.children.push(r);
  1017. }
  1018. /** @param {string} scope */
  1019. openNode(r) {
  1020. const l = ln({ scope: r });
  1021. this.add(l), this.stack.push(l);
  1022. }
  1023. closeNode() {
  1024. if (this.stack.length > 1)
  1025. return this.stack.pop();
  1026. }
  1027. closeAllNodes() {
  1028. for (; this.closeNode(); )
  1029. ;
  1030. }
  1031. toJSON() {
  1032. return JSON.stringify(this.rootNode, null, 4);
  1033. }
  1034. /**
  1035. * @typedef { import("./html_renderer").Renderer } Renderer
  1036. * @param {Renderer} builder
  1037. */
  1038. walk(r) {
  1039. return this.constructor._walk(r, this.rootNode);
  1040. }
  1041. /**
  1042. * @param {Renderer} builder
  1043. * @param {Node} node
  1044. */
  1045. static _walk(r, l) {
  1046. return typeof l == "string" ? r.addText(l) : l.children && (r.openNode(l), l.children.forEach((f) => this._walk(r, f)), r.closeNode(l)), r;
  1047. }
  1048. /**
  1049. * @param {Node} node
  1050. */
  1051. static _collapse(r) {
  1052. typeof r != "string" && r.children && (r.children.every((l) => typeof l == "string") ? r.children = [r.children.join("")] : r.children.forEach((l) => {
  1053. _Qe._collapse(l);
  1054. }));
  1055. }
  1056. };
  1057. var at = class extends Qe {
  1058. /**
  1059. * @param {*} options
  1060. */
  1061. constructor(r) {
  1062. super(), this.options = r;
  1063. }
  1064. /**
  1065. * @param {string} text
  1066. */
  1067. addText(r) {
  1068. r !== "" && this.add(r);
  1069. }
  1070. /** @param {string} scope */
  1071. startScope(r) {
  1072. this.openNode(r);
  1073. }
  1074. endScope() {
  1075. this.closeNode();
  1076. }
  1077. /**
  1078. * @param {Emitter & {root: DataNode}} emitter
  1079. * @param {string} name
  1080. */
  1081. __addSublanguage(r, l) {
  1082. const f = r.root;
  1083. l && (f.scope = `language:${l}`), this.add(f);
  1084. }
  1085. toHTML() {
  1086. return new st(this, this.options).value();
  1087. }
  1088. finalize() {
  1089. return this.closeAllNodes(), true;
  1090. }
  1091. };
  1092. function ye(e) {
  1093. return e ? typeof e == "string" ? e : e.source : null;
  1094. }
  1095. function wn(e) {
  1096. return fe("(?=", e, ")");
  1097. }
  1098. function ot(e) {
  1099. return fe("(?:", e, ")*");
  1100. }
  1101. function lt(e) {
  1102. return fe("(?:", e, ")?");
  1103. }
  1104. function fe(...e) {
  1105. return e.map((l) => ye(l)).join("");
  1106. }
  1107. function ct(e) {
  1108. const r = e[e.length - 1];
  1109. return typeof r == "object" && r.constructor === Object ? (e.splice(e.length - 1, 1), r) : {};
  1110. }
  1111. function Ze(...e) {
  1112. return "(" + (ct(e).capture ? "" : "?:") + e.map((f) => ye(f)).join("|") + ")";
  1113. }
  1114. function yn(e) {
  1115. return new RegExp(e.toString() + "|").exec("").length - 1;
  1116. }
  1117. function ut(e, r) {
  1118. const l = e && e.exec(r);
  1119. return l && l.index === 0;
  1120. }
  1121. var ft = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
  1122. function Ye(e, { joinWith: r }) {
  1123. let l = 0;
  1124. return e.map((f) => {
  1125. l += 1;
  1126. const g = l;
  1127. let n = ye(f), t = "";
  1128. for (; n.length > 0; ) {
  1129. const i = ft.exec(n);
  1130. if (!i) {
  1131. t += n;
  1132. break;
  1133. }
  1134. t += n.substring(0, i.index), n = n.substring(i.index + i[0].length), i[0][0] === "\\" && i[1] ? t += "\\" + String(Number(i[1]) + g) : (t += i[0], i[0] === "(" && l++);
  1135. }
  1136. return t;
  1137. }).map((f) => `(${f})`).join(r);
  1138. }
  1139. var gt = /\b\B/;
  1140. var Nn = "[a-zA-Z]\\w*";
  1141. var Xe = "[a-zA-Z_]\\w*";
  1142. var An = "\\b\\d+(\\.\\d+)?";
  1143. var Mn = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";
  1144. var Tn = "\\b(0b[01]+)";
  1145. var ht = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";
  1146. var dt = (e = {}) => {
  1147. const r = /^#![ ]*\//;
  1148. return e.binary && (e.begin = fe(
  1149. r,
  1150. /.*\b/,
  1151. e.binary,
  1152. /\b.*/
  1153. )), le({
  1154. scope: "meta",
  1155. begin: r,
  1156. end: /$/,
  1157. relevance: 0,
  1158. /** @type {ModeCallback} */
  1159. "on:begin": (l, f) => {
  1160. l.index !== 0 && f.ignoreMatch();
  1161. }
  1162. }, e);
  1163. };
  1164. var Ne = {
  1165. begin: "\\\\[\\s\\S]",
  1166. relevance: 0
  1167. };
  1168. var pt = {
  1169. scope: "string",
  1170. begin: "'",
  1171. end: "'",
  1172. illegal: "\\n",
  1173. contains: [Ne]
  1174. };
  1175. var _t = {
  1176. scope: "string",
  1177. begin: '"',
  1178. end: '"',
  1179. illegal: "\\n",
  1180. contains: [Ne]
  1181. };
  1182. var bt = {
  1183. 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/
  1184. };
  1185. var $e = function(e, r, l = {}) {
  1186. const f = le(
  1187. {
  1188. scope: "comment",
  1189. begin: e,
  1190. end: r,
  1191. contains: []
  1192. },
  1193. l
  1194. );
  1195. f.contains.push({
  1196. scope: "doctag",
  1197. // hack to avoid the space from being included. the space is necessary to
  1198. // match here to prevent the plain text rule below from gobbling up doctags
  1199. begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
  1200. end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
  1201. excludeBegin: true,
  1202. relevance: 0
  1203. });
  1204. const g = Ze(
  1205. // list of common 1 and 2 letter words in English
  1206. "I",
  1207. "a",
  1208. "is",
  1209. "so",
  1210. "us",
  1211. "to",
  1212. "at",
  1213. "if",
  1214. "in",
  1215. "it",
  1216. "on",
  1217. // note: this is not an exhaustive list of contractions, just popular ones
  1218. /[A-Za-z]+['](d|ve|re|ll|t|s|n)/,
  1219. // contractions - can't we'd they're let's, etc
  1220. /[A-Za-z]+[-][a-z]+/,
  1221. // `no-way`, etc.
  1222. /[A-Za-z][a-z]{2,}/
  1223. // allow capitalized words at beginning of sentences
  1224. );
  1225. return f.contains.push(
  1226. {
  1227. // TODO: how to include ", (, ) without breaking grammars that use these for
  1228. // comment delimiters?
  1229. // begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/
  1230. // ---
  1231. // this tries to find sequences of 3 english words in a row (without any
  1232. // "programming" type syntax) this gives us a strong signal that we've
  1233. // TRULY found a comment - vs perhaps scanning with the wrong language.
  1234. // It's possible to find something that LOOKS like the start of the
  1235. // comment - but then if there is no readable text - good chance it is a
  1236. // false match and not a comment.
  1237. //
  1238. // for a visual example please see:
  1239. // https://github.com/highlightjs/highlight.js/issues/2827
  1240. begin: fe(
  1241. /[ ]+/,
  1242. // necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
  1243. "(",
  1244. g,
  1245. /[.]?[:]?([.][ ]|[ ])/,
  1246. "){3}"
  1247. )
  1248. // look for 3 words in a row
  1249. }
  1250. ), f;
  1251. };
  1252. var Et = $e("//", "$");
  1253. var mt = $e("/\\*", "\\*/");
  1254. var vt = $e("#", "$");
  1255. var wt = {
  1256. scope: "number",
  1257. begin: An,
  1258. relevance: 0
  1259. };
  1260. var yt = {
  1261. scope: "number",
  1262. begin: Mn,
  1263. relevance: 0
  1264. };
  1265. var Nt = {
  1266. scope: "number",
  1267. begin: Tn,
  1268. relevance: 0
  1269. };
  1270. var At = {
  1271. scope: "regexp",
  1272. begin: /\/(?=[^/\n]*\/)/,
  1273. end: /\/[gimuy]*/,
  1274. contains: [
  1275. Ne,
  1276. {
  1277. begin: /\[/,
  1278. end: /\]/,
  1279. relevance: 0,
  1280. contains: [Ne]
  1281. }
  1282. ]
  1283. };
  1284. var Mt = {
  1285. scope: "title",
  1286. begin: Nn,
  1287. relevance: 0
  1288. };
  1289. var Tt = {
  1290. scope: "title",
  1291. begin: Xe,
  1292. relevance: 0
  1293. };
  1294. var St = {
  1295. // excludes method names from keyword processing
  1296. begin: "\\.\\s*" + Xe,
  1297. relevance: 0
  1298. };
  1299. var Dt = function(e) {
  1300. return Object.assign(
  1301. e,
  1302. {
  1303. /** @type {ModeCallback} */
  1304. "on:begin": (r, l) => {
  1305. l.data._beginMatch = r[1];
  1306. },
  1307. /** @type {ModeCallback} */
  1308. "on:end": (r, l) => {
  1309. l.data._beginMatch !== r[1] && l.ignoreMatch();
  1310. }
  1311. }
  1312. );
  1313. };
  1314. var Le = Object.freeze({
  1315. __proto__: null,
  1316. APOS_STRING_MODE: pt,
  1317. BACKSLASH_ESCAPE: Ne,
  1318. BINARY_NUMBER_MODE: Nt,
  1319. BINARY_NUMBER_RE: Tn,
  1320. COMMENT: $e,
  1321. C_BLOCK_COMMENT_MODE: mt,
  1322. C_LINE_COMMENT_MODE: Et,
  1323. C_NUMBER_MODE: yt,
  1324. C_NUMBER_RE: Mn,
  1325. END_SAME_AS_BEGIN: Dt,
  1326. HASH_COMMENT_MODE: vt,
  1327. IDENT_RE: Nn,
  1328. MATCH_NOTHING_RE: gt,
  1329. METHOD_GUARD: St,
  1330. NUMBER_MODE: wt,
  1331. NUMBER_RE: An,
  1332. PHRASAL_WORDS_MODE: bt,
  1333. QUOTE_STRING_MODE: _t,
  1334. REGEXP_MODE: At,
  1335. RE_STARTERS_RE: ht,
  1336. SHEBANG: dt,
  1337. TITLE_MODE: Mt,
  1338. UNDERSCORE_IDENT_RE: Xe,
  1339. UNDERSCORE_TITLE_MODE: Tt
  1340. });
  1341. function Lt(e, r) {
  1342. e.input[e.index - 1] === "." && r.ignoreMatch();
  1343. }
  1344. function Rt(e, r) {
  1345. e.className !== void 0 && (e.scope = e.className, delete e.className);
  1346. }
  1347. function Ot(e, r) {
  1348. r && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", e.__beforeBegin = Lt, e.keywords = e.keywords || e.beginKeywords, delete e.beginKeywords, e.relevance === void 0 && (e.relevance = 0));
  1349. }
  1350. function Ct(e, r) {
  1351. Array.isArray(e.illegal) && (e.illegal = Ze(...e.illegal));
  1352. }
  1353. function It(e, r) {
  1354. if (e.match) {
  1355. if (e.begin || e.end)
  1356. throw new Error("begin & end are not supported with match");
  1357. e.begin = e.match, delete e.match;
  1358. }
  1359. }
  1360. function kt(e, r) {
  1361. e.relevance === void 0 && (e.relevance = 1);
  1362. }
  1363. var Bt = (e, r) => {
  1364. if (!e.beforeMatch)
  1365. return;
  1366. if (e.starts)
  1367. throw new Error("beforeMatch cannot be used with starts");
  1368. const l = Object.assign({}, e);
  1369. Object.keys(e).forEach((f) => {
  1370. delete e[f];
  1371. }), e.keywords = l.keywords, e.begin = fe(l.beforeMatch, wn(l.begin)), e.starts = {
  1372. relevance: 0,
  1373. contains: [
  1374. Object.assign(l, { endsParent: true })
  1375. ]
  1376. }, e.relevance = 0, delete l.beforeMatch;
  1377. };
  1378. var $t = [
  1379. "of",
  1380. "and",
  1381. "for",
  1382. "in",
  1383. "not",
  1384. "or",
  1385. "if",
  1386. "then",
  1387. "parent",
  1388. // common variable name
  1389. "list",
  1390. // common variable name
  1391. "value"
  1392. // common variable name
  1393. ];
  1394. var Pt = "keyword";
  1395. function Sn(e, r, l = Pt) {
  1396. const f = /* @__PURE__ */ Object.create(null);
  1397. return typeof e == "string" ? g(l, e.split(" ")) : Array.isArray(e) ? g(l, e) : Object.keys(e).forEach(function(n) {
  1398. Object.assign(
  1399. f,
  1400. Sn(e[n], r, n)
  1401. );
  1402. }), f;
  1403. function g(n, t) {
  1404. r && (t = t.map((i) => i.toLowerCase())), t.forEach(function(i) {
  1405. const s = i.split("|");
  1406. f[s[0]] = [n, Ut(s[0], s[1])];
  1407. });
  1408. }
  1409. }
  1410. function Ut(e, r) {
  1411. return r ? Number(r) : Ht(e) ? 0 : 1;
  1412. }
  1413. function Ht(e) {
  1414. return $t.includes(e.toLowerCase());
  1415. }
  1416. var cn = {};
  1417. var ue = (e) => {
  1418. console.error(e);
  1419. };
  1420. var un = (e, ...r) => {
  1421. console.log(`WARN: ${e}`, ...r);
  1422. };
  1423. var he = (e, r) => {
  1424. cn[`${e}/${r}`] || (console.log(`Deprecated as of ${e}. ${r}`), cn[`${e}/${r}`] = true);
  1425. };
  1426. var ke = new Error();
  1427. function Dn(e, r, { key: l }) {
  1428. let f = 0;
  1429. const g = e[l], n = {}, t = {};
  1430. for (let i = 1; i <= r.length; i++)
  1431. t[i + f] = g[i], n[i + f] = true, f += yn(r[i - 1]);
  1432. e[l] = t, e[l]._emit = n, e[l]._multi = true;
  1433. }
  1434. function Ft(e) {
  1435. if (Array.isArray(e.begin)) {
  1436. if (e.skip || e.excludeBegin || e.returnBegin)
  1437. throw ue("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), ke;
  1438. if (typeof e.beginScope != "object" || e.beginScope === null)
  1439. throw ue("beginScope must be object"), ke;
  1440. Dn(e, e.begin, { key: "beginScope" }), e.begin = Ye(e.begin, { joinWith: "" });
  1441. }
  1442. }
  1443. function zt(e) {
  1444. if (Array.isArray(e.end)) {
  1445. if (e.skip || e.excludeEnd || e.returnEnd)
  1446. throw ue("skip, excludeEnd, returnEnd not compatible with endScope: {}"), ke;
  1447. if (typeof e.endScope != "object" || e.endScope === null)
  1448. throw ue("endScope must be object"), ke;
  1449. Dn(e, e.end, { key: "endScope" }), e.end = Ye(e.end, { joinWith: "" });
  1450. }
  1451. }
  1452. function xt(e) {
  1453. e.scope && typeof e.scope == "object" && e.scope !== null && (e.beginScope = e.scope, delete e.scope);
  1454. }
  1455. function Gt(e) {
  1456. xt(e), typeof e.beginScope == "string" && (e.beginScope = { _wrap: e.beginScope }), typeof e.endScope == "string" && (e.endScope = { _wrap: e.endScope }), Ft(e), zt(e);
  1457. }
  1458. function Kt(e) {
  1459. function r(t, i) {
  1460. return new RegExp(
  1461. ye(t),
  1462. "m" + (e.case_insensitive ? "i" : "") + (e.unicodeRegex ? "u" : "") + (i ? "g" : "")
  1463. );
  1464. }
  1465. class l {
  1466. constructor() {
  1467. this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0;
  1468. }
  1469. // @ts-ignore
  1470. addRule(i, s) {
  1471. s.position = this.position++, this.matchIndexes[this.matchAt] = s, this.regexes.push([s, i]), this.matchAt += yn(i) + 1;
  1472. }
  1473. compile() {
  1474. this.regexes.length === 0 && (this.exec = () => null);
  1475. const i = this.regexes.map((s) => s[1]);
  1476. this.matcherRe = r(Ye(i, { joinWith: "|" }), true), this.lastIndex = 0;
  1477. }
  1478. /** @param {string} s */
  1479. exec(i) {
  1480. this.matcherRe.lastIndex = this.lastIndex;
  1481. const s = this.matcherRe.exec(i);
  1482. if (!s)
  1483. return null;
  1484. const a = s.findIndex((c, u) => u > 0 && c !== void 0), o = this.matchIndexes[a];
  1485. return s.splice(0, a), Object.assign(s, o);
  1486. }
  1487. }
  1488. class f {
  1489. constructor() {
  1490. this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
  1491. }
  1492. // @ts-ignore
  1493. getMatcher(i) {
  1494. if (this.multiRegexes[i])
  1495. return this.multiRegexes[i];
  1496. const s = new l();
  1497. return this.rules.slice(i).forEach(([a, o]) => s.addRule(a, o)), s.compile(), this.multiRegexes[i] = s, s;
  1498. }
  1499. resumingScanAtSamePosition() {
  1500. return this.regexIndex !== 0;
  1501. }
  1502. considerAll() {
  1503. this.regexIndex = 0;
  1504. }
  1505. // @ts-ignore
  1506. addRule(i, s) {
  1507. this.rules.push([i, s]), s.type === "begin" && this.count++;
  1508. }
  1509. /** @param {string} s */
  1510. exec(i) {
  1511. const s = this.getMatcher(this.regexIndex);
  1512. s.lastIndex = this.lastIndex;
  1513. let a = s.exec(i);
  1514. if (this.resumingScanAtSamePosition() && !(a && a.index === this.lastIndex)) {
  1515. const o = this.getMatcher(0);
  1516. o.lastIndex = this.lastIndex + 1, a = o.exec(i);
  1517. }
  1518. return a && (this.regexIndex += a.position + 1, this.regexIndex === this.count && this.considerAll()), a;
  1519. }
  1520. }
  1521. function g(t) {
  1522. const i = new f();
  1523. return t.contains.forEach((s) => i.addRule(s.begin, { rule: s, type: "begin" })), t.terminatorEnd && i.addRule(t.terminatorEnd, { type: "end" }), t.illegal && i.addRule(t.illegal, { type: "illegal" }), i;
  1524. }
  1525. function n(t, i) {
  1526. const s = (
  1527. /** @type CompiledMode */
  1528. t
  1529. );
  1530. if (t.isCompiled)
  1531. return s;
  1532. [
  1533. Rt,
  1534. // do this early so compiler extensions generally don't have to worry about
  1535. // the distinction between match/begin
  1536. It,
  1537. Gt,
  1538. Bt
  1539. ].forEach((o) => o(t, i)), e.compilerExtensions.forEach((o) => o(t, i)), t.__beforeBegin = null, [
  1540. Ot,
  1541. // do this later so compiler extensions that come earlier have access to the
  1542. // raw array if they wanted to perhaps manipulate it, etc.
  1543. Ct,
  1544. // default to 1 relevance if not specified
  1545. kt
  1546. ].forEach((o) => o(t, i)), t.isCompiled = true;
  1547. let a = null;
  1548. return typeof t.keywords == "object" && t.keywords.$pattern && (t.keywords = Object.assign({}, t.keywords), a = t.keywords.$pattern, delete t.keywords.$pattern), a = a || /\w+/, t.keywords && (t.keywords = Sn(t.keywords, e.case_insensitive)), s.keywordPatternRe = r(a, true), i && (t.begin || (t.begin = /\B|\b/), s.beginRe = r(s.begin), !t.end && !t.endsWithParent && (t.end = /\B|\b/), t.end && (s.endRe = r(s.end)), s.terminatorEnd = ye(s.end) || "", t.endsWithParent && i.terminatorEnd && (s.terminatorEnd += (t.end ? "|" : "") + i.terminatorEnd)), t.illegal && (s.illegalRe = r(
  1549. /** @type {RegExp | string} */
  1550. t.illegal
  1551. )), t.contains || (t.contains = []), t.contains = [].concat(...t.contains.map(function(o) {
  1552. return Wt(o === "self" ? t : o);
  1553. })), t.contains.forEach(function(o) {
  1554. n(
  1555. /** @type Mode */
  1556. o,
  1557. s
  1558. );
  1559. }), t.starts && n(t.starts, i), s.matcher = g(s), s;
  1560. }
  1561. if (e.compilerExtensions || (e.compilerExtensions = []), e.contains && e.contains.includes("self"))
  1562. throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
  1563. return e.classNameAliases = le(e.classNameAliases || {}), n(
  1564. /** @type Mode */
  1565. e
  1566. );
  1567. }
  1568. function Ln(e) {
  1569. return e ? e.endsWithParent || Ln(e.starts) : false;
  1570. }
  1571. function Wt(e) {
  1572. return e.variants && !e.cachedVariants && (e.cachedVariants = e.variants.map(function(r) {
  1573. return le(e, { variants: null }, r);
  1574. })), e.cachedVariants ? e.cachedVariants : Ln(e) ? le(e, { starts: e.starts ? le(e.starts) : null }) : Object.isFrozen(e) ? le(e) : e;
  1575. }
  1576. var Qt = "11.9.0";
  1577. var Zt = class extends Error {
  1578. constructor(r, l) {
  1579. super(r), this.name = "HTMLInjectionError", this.html = l;
  1580. }
  1581. };
  1582. var ze = vn;
  1583. var fn = le;
  1584. var gn = Symbol("nomatch");
  1585. var Yt = 7;
  1586. var Rn = function(e) {
  1587. const r = /* @__PURE__ */ Object.create(null), l = /* @__PURE__ */ Object.create(null), f = [];
  1588. let g = true;
  1589. const n = "Could not find the language '{}', did you forget to load/include a language module?", t = { disableAutodetect: true, name: "Plain text", contains: [] };
  1590. let i = {
  1591. ignoreUnescapedHTML: false,
  1592. throwUnescapedHTML: false,
  1593. noHighlightRe: /^(no-?highlight)$/i,
  1594. languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
  1595. classPrefix: "hljs-",
  1596. cssSelector: "pre code",
  1597. languages: null,
  1598. // beta configuration options, subject to change, welcome to discuss
  1599. // https://github.com/highlightjs/highlight.js/issues/1086
  1600. __emitter: at
  1601. };
  1602. function s(b) {
  1603. return i.noHighlightRe.test(b);
  1604. }
  1605. function a(b) {
  1606. let N = b.className + " ";
  1607. N += b.parentNode ? b.parentNode.className : "";
  1608. const O = i.languageDetectRe.exec(N);
  1609. if (O) {
  1610. const U = L(O[1]);
  1611. return U || (un(n.replace("{}", O[1])), un("Falling back to no-highlight mode for this block.", b)), U ? O[1] : "no-highlight";
  1612. }
  1613. return N.split(/\s+/).find((U) => s(U) || L(U));
  1614. }
  1615. function o(b, N, O) {
  1616. let U = "", x = "";
  1617. typeof N == "object" ? (U = b, O = N.ignoreIllegals, x = N.language) : (he("10.7.0", "highlight(lang, code, ...args) has been deprecated."), he("10.7.0", `Please use highlight(code, options) instead.
  1618. https://github.com/highlightjs/highlight.js/issues/2277`), x = b, U = N), O === void 0 && (O = true);
  1619. const X = {
  1620. code: U,
  1621. language: x
  1622. };
  1623. oe("before:highlight", X);
  1624. const J = X.result ? X.result : c(X.language, X.code, O);
  1625. return J.code = X.code, oe("after:highlight", J), J;
  1626. }
  1627. function c(b, N, O, U) {
  1628. const x = /* @__PURE__ */ Object.create(null);
  1629. function X(w, T) {
  1630. return w.keywords[T];
  1631. }
  1632. function J() {
  1633. if (!C.keywords) {
  1634. Q.addText(z);
  1635. return;
  1636. }
  1637. let w = 0;
  1638. C.keywordPatternRe.lastIndex = 0;
  1639. let T = C.keywordPatternRe.exec(z), k = "";
  1640. for (; T; ) {
  1641. k += z.substring(w, T.index);
  1642. const H = te.case_insensitive ? T[0].toLowerCase() : T[0], Z = X(C, H);
  1643. if (Z) {
  1644. const [re, Gn] = Z;
  1645. if (Q.addText(k), k = "", x[H] = (x[H] || 0) + 1, x[H] <= Yt && (Se += Gn), re.startsWith("_"))
  1646. k += T[0];
  1647. else {
  1648. const Kn = te.classNameAliases[re] || re;
  1649. ne(T[0], Kn);
  1650. }
  1651. } else
  1652. k += T[0];
  1653. w = C.keywordPatternRe.lastIndex, T = C.keywordPatternRe.exec(z);
  1654. }
  1655. k += z.substring(w), Q.addText(k);
  1656. }
  1657. function Me() {
  1658. if (z === "")
  1659. return;
  1660. let w = null;
  1661. if (typeof C.subLanguage == "string") {
  1662. if (!r[C.subLanguage]) {
  1663. Q.addText(z);
  1664. return;
  1665. }
  1666. w = c(C.subLanguage, z, true, en[C.subLanguage]), en[C.subLanguage] = /** @type {CompiledMode} */
  1667. w._top;
  1668. } else
  1669. w = d(z, C.subLanguage.length ? C.subLanguage : null);
  1670. C.relevance > 0 && (Se += w.relevance), Q.__addSublanguage(w._emitter, w.language);
  1671. }
  1672. function V() {
  1673. C.subLanguage != null ? Me() : J(), z = "";
  1674. }
  1675. function ne(w, T) {
  1676. w !== "" && (Q.startScope(T), Q.addText(w), Q.endScope());
  1677. }
  1678. function Ve(w, T) {
  1679. let k = 1;
  1680. const H = T.length - 1;
  1681. for (; k <= H; ) {
  1682. if (!w._emit[k]) {
  1683. k++;
  1684. continue;
  1685. }
  1686. const Z = te.classNameAliases[w[k]] || w[k], re = T[k];
  1687. Z ? ne(re, Z) : (z = re, J(), z = ""), k++;
  1688. }
  1689. }
  1690. function je(w, T) {
  1691. return w.scope && typeof w.scope == "string" && Q.openNode(te.classNameAliases[w.scope] || w.scope), w.beginScope && (w.beginScope._wrap ? (ne(z, te.classNameAliases[w.beginScope._wrap] || w.beginScope._wrap), z = "") : w.beginScope._multi && (Ve(w.beginScope, T), z = "")), C = Object.create(w, { parent: { value: C } }), C;
  1692. }
  1693. function qe(w, T, k) {
  1694. let H = ut(w.endRe, k);
  1695. if (H) {
  1696. if (w["on:end"]) {
  1697. const Z = new an(w);
  1698. w["on:end"](T, Z), Z.isMatchIgnored && (H = false);
  1699. }
  1700. if (H) {
  1701. for (; w.endsParent && w.parent; )
  1702. w = w.parent;
  1703. return w;
  1704. }
  1705. }
  1706. if (w.endsWithParent)
  1707. return qe(w.parent, T, k);
  1708. }
  1709. function Un(w) {
  1710. return C.matcher.regexIndex === 0 ? (z += w[0], 1) : (He = true, 0);
  1711. }
  1712. function Hn(w) {
  1713. const T = w[0], k = w.rule, H = new an(k), Z = [k.__beforeBegin, k["on:begin"]];
  1714. for (const re of Z)
  1715. if (re && (re(w, H), H.isMatchIgnored))
  1716. return Un(T);
  1717. return k.skip ? z += T : (k.excludeBegin && (z += T), V(), !k.returnBegin && !k.excludeBegin && (z = T)), je(k, w), k.returnBegin ? 0 : T.length;
  1718. }
  1719. function Fn(w) {
  1720. const T = w[0], k = N.substring(w.index), H = qe(C, w, k);
  1721. if (!H)
  1722. return gn;
  1723. const Z = C;
  1724. C.endScope && C.endScope._wrap ? (V(), ne(T, C.endScope._wrap)) : C.endScope && C.endScope._multi ? (V(), Ve(C.endScope, w)) : Z.skip ? z += T : (Z.returnEnd || Z.excludeEnd || (z += T), V(), Z.excludeEnd && (z = T));
  1725. do
  1726. C.scope && Q.closeNode(), !C.skip && !C.subLanguage && (Se += C.relevance), C = C.parent;
  1727. while (C !== H.parent);
  1728. return H.starts && je(H.starts, w), Z.returnEnd ? 0 : T.length;
  1729. }
  1730. function zn() {
  1731. const w = [];
  1732. for (let T = C; T !== te; T = T.parent)
  1733. T.scope && w.unshift(T.scope);
  1734. w.forEach((T) => Q.openNode(T));
  1735. }
  1736. let Te = {};
  1737. function Je(w, T) {
  1738. const k = T && T[0];
  1739. if (z += w, k == null)
  1740. return V(), 0;
  1741. if (Te.type === "begin" && T.type === "end" && Te.index === T.index && k === "") {
  1742. if (z += N.slice(T.index, T.index + 1), !g) {
  1743. const H = new Error(`0 width match regex (${b})`);
  1744. throw H.languageName = b, H.badRule = Te.rule, H;
  1745. }
  1746. return 1;
  1747. }
  1748. if (Te = T, T.type === "begin")
  1749. return Hn(T);
  1750. if (T.type === "illegal" && !O) {
  1751. const H = new Error('Illegal lexeme "' + k + '" for mode "' + (C.scope || "<unnamed>") + '"');
  1752. throw H.mode = C, H;
  1753. } else if (T.type === "end") {
  1754. const H = Fn(T);
  1755. if (H !== gn)
  1756. return H;
  1757. }
  1758. if (T.type === "illegal" && k === "")
  1759. return 1;
  1760. if (Ue > 1e5 && Ue > T.index * 3)
  1761. throw new Error("potential infinite loop, way more iterations than matches");
  1762. return z += k, k.length;
  1763. }
  1764. const te = L(b);
  1765. if (!te)
  1766. throw ue(n.replace("{}", b)), new Error('Unknown language: "' + b + '"');
  1767. const xn = Kt(te);
  1768. let Pe = "", C = U || xn;
  1769. const en = {}, Q = new i.__emitter(i);
  1770. zn();
  1771. let z = "", Se = 0, ce = 0, Ue = 0, He = false;
  1772. try {
  1773. if (te.__emitTokens)
  1774. te.__emitTokens(N, Q);
  1775. else {
  1776. for (C.matcher.considerAll(); ; ) {
  1777. Ue++, He ? He = false : C.matcher.considerAll(), C.matcher.lastIndex = ce;
  1778. const w = C.matcher.exec(N);
  1779. if (!w)
  1780. break;
  1781. const T = N.substring(ce, w.index), k = Je(T, w);
  1782. ce = w.index + k;
  1783. }
  1784. Je(N.substring(ce));
  1785. }
  1786. return Q.finalize(), Pe = Q.toHTML(), {
  1787. language: b,
  1788. value: Pe,
  1789. relevance: Se,
  1790. illegal: false,
  1791. _emitter: Q,
  1792. _top: C
  1793. };
  1794. } catch (w) {
  1795. if (w.message && w.message.includes("Illegal"))
  1796. return {
  1797. language: b,
  1798. value: ze(N),
  1799. illegal: true,
  1800. relevance: 0,
  1801. _illegalBy: {
  1802. message: w.message,
  1803. index: ce,
  1804. context: N.slice(ce - 100, ce + 100),
  1805. mode: w.mode,
  1806. resultSoFar: Pe
  1807. },
  1808. _emitter: Q
  1809. };
  1810. if (g)
  1811. return {
  1812. language: b,
  1813. value: ze(N),
  1814. illegal: false,
  1815. relevance: 0,
  1816. errorRaised: w,
  1817. _emitter: Q,
  1818. _top: C
  1819. };
  1820. throw w;
  1821. }
  1822. }
  1823. function u(b) {
  1824. const N = {
  1825. value: ze(b),
  1826. illegal: false,
  1827. relevance: 0,
  1828. _top: t,
  1829. _emitter: new i.__emitter(i)
  1830. };
  1831. return N._emitter.addText(b), N;
  1832. }
  1833. function d(b, N) {
  1834. N = N || i.languages || Object.keys(r);
  1835. const O = u(b), U = N.filter(L).filter(P).map(
  1836. (V) => c(V, b, false)
  1837. );
  1838. U.unshift(O);
  1839. const x = U.sort((V, ne) => {
  1840. if (V.relevance !== ne.relevance)
  1841. return ne.relevance - V.relevance;
  1842. if (V.language && ne.language) {
  1843. if (L(V.language).supersetOf === ne.language)
  1844. return 1;
  1845. if (L(ne.language).supersetOf === V.language)
  1846. return -1;
  1847. }
  1848. return 0;
  1849. }), [X, J] = x, Me = X;
  1850. return Me.secondBest = J, Me;
  1851. }
  1852. function h(b, N, O) {
  1853. const U = N && l[N] || O;
  1854. b.classList.add("hljs"), b.classList.add(`language-${U}`);
  1855. }
  1856. function p(b) {
  1857. let N = null;
  1858. const O = a(b);
  1859. if (s(O))
  1860. return;
  1861. if (oe(
  1862. "before:highlightElement",
  1863. { el: b, language: O }
  1864. ), b.dataset.highlighted) {
  1865. console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", b);
  1866. return;
  1867. }
  1868. if (b.children.length > 0 && (i.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(b)), i.throwUnescapedHTML))
  1869. throw new Zt(
  1870. "One of your code blocks includes unescaped HTML.",
  1871. b.innerHTML
  1872. );
  1873. N = b;
  1874. const U = N.textContent, x = O ? o(U, { language: O, ignoreIllegals: true }) : d(U);
  1875. b.innerHTML = x.value, b.dataset.highlighted = "yes", h(b, O, x.language), b.result = {
  1876. language: x.language,
  1877. // TODO: remove with version 11.0
  1878. re: x.relevance,
  1879. relevance: x.relevance
  1880. }, x.secondBest && (b.secondBest = {
  1881. language: x.secondBest.language,
  1882. relevance: x.secondBest.relevance
  1883. }), oe("after:highlightElement", { el: b, result: x, text: U });
  1884. }
  1885. function _(b) {
  1886. i = fn(i, b);
  1887. }
  1888. const E = () => {
  1889. A(), he("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
  1890. };
  1891. function m() {
  1892. A(), he("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
  1893. }
  1894. let v = false;
  1895. function A() {
  1896. if (document.readyState === "loading") {
  1897. v = true;
  1898. return;
  1899. }
  1900. document.querySelectorAll(i.cssSelector).forEach(p);
  1901. }
  1902. function D() {
  1903. v && A();
  1904. }
  1905. typeof window != "undefined" && window.addEventListener && window.addEventListener("DOMContentLoaded", D, false);
  1906. function S(b, N) {
  1907. let O = null;
  1908. try {
  1909. O = N(e);
  1910. } catch (U) {
  1911. if (ue("Language definition for '{}' could not be registered.".replace("{}", b)), g)
  1912. ue(U);
  1913. else
  1914. throw U;
  1915. O = t;
  1916. }
  1917. O.name || (O.name = b), r[b] = O, O.rawDefinition = N.bind(null, e), O.aliases && I(O.aliases, { languageName: b });
  1918. }
  1919. function M(b) {
  1920. delete r[b];
  1921. for (const N of Object.keys(l))
  1922. l[N] === b && delete l[N];
  1923. }
  1924. function R() {
  1925. return Object.keys(r);
  1926. }
  1927. function L(b) {
  1928. return b = (b || "").toLowerCase(), r[b] || r[l[b]];
  1929. }
  1930. function I(b, { languageName: N }) {
  1931. typeof b == "string" && (b = [b]), b.forEach((O) => {
  1932. l[O.toLowerCase()] = N;
  1933. });
  1934. }
  1935. function P(b) {
  1936. const N = L(b);
  1937. return N && !N.disableAutodetect;
  1938. }
  1939. function $(b) {
  1940. b["before:highlightBlock"] && !b["before:highlightElement"] && (b["before:highlightElement"] = (N) => {
  1941. b["before:highlightBlock"](
  1942. Object.assign({ block: N.el }, N)
  1943. );
  1944. }), b["after:highlightBlock"] && !b["after:highlightElement"] && (b["after:highlightElement"] = (N) => {
  1945. b["after:highlightBlock"](
  1946. Object.assign({ block: N.el }, N)
  1947. );
  1948. });
  1949. }
  1950. function K(b) {
  1951. $(b), f.push(b);
  1952. }
  1953. function Y(b) {
  1954. const N = f.indexOf(b);
  1955. N !== -1 && f.splice(N, 1);
  1956. }
  1957. function oe(b, N) {
  1958. const O = b;
  1959. f.forEach(function(U) {
  1960. U[O] && U[O](N);
  1961. });
  1962. }
  1963. function ge(b) {
  1964. return he("10.7.0", "highlightBlock will be removed entirely in v12.0"), he("10.7.0", "Please use highlightElement now."), p(b);
  1965. }
  1966. Object.assign(e, {
  1967. highlight: o,
  1968. highlightAuto: d,
  1969. highlightAll: A,
  1970. highlightElement: p,
  1971. // TODO: Remove with v12 API
  1972. highlightBlock: ge,
  1973. configure: _,
  1974. initHighlighting: E,
  1975. initHighlightingOnLoad: m,
  1976. registerLanguage: S,
  1977. unregisterLanguage: M,
  1978. listLanguages: R,
  1979. getLanguage: L,
  1980. registerAliases: I,
  1981. autoDetection: P,
  1982. inherit: fn,
  1983. addPlugin: K,
  1984. removePlugin: Y
  1985. }), e.debugMode = function() {
  1986. g = false;
  1987. }, e.safeMode = function() {
  1988. g = true;
  1989. }, e.versionString = Qt, e.regex = {
  1990. concat: fe,
  1991. lookahead: wn,
  1992. either: Ze,
  1993. optional: lt,
  1994. anyNumberOfTimes: ot
  1995. };
  1996. for (const b in Le)
  1997. typeof Le[b] == "object" && mn(Le[b]);
  1998. return Object.assign(e, Le), e;
  1999. };
  2000. var _e = Rn({});
  2001. _e.newInstance = () => Rn({});
  2002. var Xt = _e;
  2003. _e.HighlightJS = _e;
  2004. _e.default = _e;
  2005. var q = tt(Xt);
  2006. function Vt(e) {
  2007. const r = e.regex, l = r.concat(/[\p{L}_]/u, r.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), f = /[\p{L}0-9._:-]+/u, g = {
  2008. className: "symbol",
  2009. begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/
  2010. }, n = {
  2011. begin: /\s/,
  2012. contains: [
  2013. {
  2014. className: "keyword",
  2015. begin: /#?[a-z_][a-z1-9_-]+/,
  2016. illegal: /\n/
  2017. }
  2018. ]
  2019. }, t = e.inherit(n, {
  2020. begin: /\(/,
  2021. end: /\)/
  2022. }), i = e.inherit(e.APOS_STRING_MODE, { className: "string" }), s = e.inherit(e.QUOTE_STRING_MODE, { className: "string" }), a = {
  2023. endsWithParent: true,
  2024. illegal: /</,
  2025. relevance: 0,
  2026. contains: [
  2027. {
  2028. className: "attr",
  2029. begin: f,
  2030. relevance: 0
  2031. },
  2032. {
  2033. begin: /=\s*/,
  2034. relevance: 0,
  2035. contains: [
  2036. {
  2037. className: "string",
  2038. endsParent: true,
  2039. variants: [
  2040. {
  2041. begin: /"/,
  2042. end: /"/,
  2043. contains: [g]
  2044. },
  2045. {
  2046. begin: /'/,
  2047. end: /'/,
  2048. contains: [g]
  2049. },
  2050. { begin: /[^\s"'=<>`]+/ }
  2051. ]
  2052. }
  2053. ]
  2054. }
  2055. ]
  2056. };
  2057. return {
  2058. name: "HTML, XML",
  2059. aliases: [
  2060. "html",
  2061. "xhtml",
  2062. "rss",
  2063. "atom",
  2064. "xjb",
  2065. "xsd",
  2066. "xsl",
  2067. "plist",
  2068. "wsf",
  2069. "svg"
  2070. ],
  2071. case_insensitive: true,
  2072. unicodeRegex: true,
  2073. contains: [
  2074. {
  2075. className: "meta",
  2076. begin: /<![a-z]/,
  2077. end: />/,
  2078. relevance: 10,
  2079. contains: [
  2080. n,
  2081. s,
  2082. i,
  2083. t,
  2084. {
  2085. begin: /\[/,
  2086. end: /\]/,
  2087. contains: [
  2088. {
  2089. className: "meta",
  2090. begin: /<![a-z]/,
  2091. end: />/,
  2092. contains: [
  2093. n,
  2094. t,
  2095. s,
  2096. i
  2097. ]
  2098. }
  2099. ]
  2100. }
  2101. ]
  2102. },
  2103. e.COMMENT(
  2104. /<!--/,
  2105. /-->/,
  2106. { relevance: 10 }
  2107. ),
  2108. {
  2109. begin: /<!\[CDATA\[/,
  2110. end: /\]\]>/,
  2111. relevance: 10
  2112. },
  2113. g,
  2114. // xml processing instructions
  2115. {
  2116. className: "meta",
  2117. end: /\?>/,
  2118. variants: [
  2119. {
  2120. begin: /<\?xml/,
  2121. relevance: 10,
  2122. contains: [
  2123. s
  2124. ]
  2125. },
  2126. {
  2127. begin: /<\?[a-z][a-z0-9]+/
  2128. }
  2129. ]
  2130. },
  2131. {
  2132. className: "tag",
  2133. /*
  2134. The lookahead pattern (?=...) ensures that 'begin' only matches
  2135. '<style' as a single word, followed by a whitespace or an
  2136. ending bracket.
  2137. */
  2138. begin: /<style(?=\s|>)/,
  2139. end: />/,
  2140. keywords: { name: "style" },
  2141. contains: [a],
  2142. starts: {
  2143. end: /<\/style>/,
  2144. returnEnd: true,
  2145. subLanguage: [
  2146. "css",
  2147. "xml"
  2148. ]
  2149. }
  2150. },
  2151. {
  2152. className: "tag",
  2153. // See the comment in the <style tag about the lookahead pattern
  2154. begin: /<script(?=\s|>)/,
  2155. end: />/,
  2156. keywords: { name: "script" },
  2157. contains: [a],
  2158. starts: {
  2159. end: /<\/script>/,
  2160. returnEnd: true,
  2161. subLanguage: [
  2162. "javascript",
  2163. "handlebars",
  2164. "xml"
  2165. ]
  2166. }
  2167. },
  2168. // we need this for now for jSX
  2169. {
  2170. className: "tag",
  2171. begin: /<>|<\/>/
  2172. },
  2173. // open tag
  2174. {
  2175. className: "tag",
  2176. begin: r.concat(
  2177. /</,
  2178. r.lookahead(r.concat(
  2179. l,
  2180. // <tag/>
  2181. // <tag>
  2182. // <tag ...
  2183. r.either(/\/>/, />/, /\s/)
  2184. ))
  2185. ),
  2186. end: /\/?>/,
  2187. contains: [
  2188. {
  2189. className: "name",
  2190. begin: l,
  2191. relevance: 0,
  2192. starts: a
  2193. }
  2194. ]
  2195. },
  2196. // close tag
  2197. {
  2198. className: "tag",
  2199. begin: r.concat(
  2200. /<\//,
  2201. r.lookahead(r.concat(
  2202. l,
  2203. />/
  2204. ))
  2205. ),
  2206. contains: [
  2207. {
  2208. className: "name",
  2209. begin: l,
  2210. relevance: 0
  2211. },
  2212. {
  2213. begin: />/,
  2214. relevance: 0,
  2215. endsParent: true
  2216. }
  2217. ]
  2218. }
  2219. ]
  2220. };
  2221. }
  2222. var hn = "[A-Za-z$_][0-9A-Za-z$_]*";
  2223. var jt = [
  2224. "as",
  2225. // for exports
  2226. "in",
  2227. "of",
  2228. "if",
  2229. "for",
  2230. "while",
  2231. "finally",
  2232. "var",
  2233. "new",
  2234. "function",
  2235. "do",
  2236. "return",
  2237. "void",
  2238. "else",
  2239. "break",
  2240. "catch",
  2241. "instanceof",
  2242. "with",
  2243. "throw",
  2244. "case",
  2245. "default",
  2246. "try",
  2247. "switch",
  2248. "continue",
  2249. "typeof",
  2250. "delete",
  2251. "let",
  2252. "yield",
  2253. "const",
  2254. "class",
  2255. // JS handles these with a special rule
  2256. // "get",
  2257. // "set",
  2258. "debugger",
  2259. "async",
  2260. "await",
  2261. "static",
  2262. "import",
  2263. "from",
  2264. "export",
  2265. "extends"
  2266. ];
  2267. var qt = [
  2268. "true",
  2269. "false",
  2270. "null",
  2271. "undefined",
  2272. "NaN",
  2273. "Infinity"
  2274. ];
  2275. var On = [
  2276. // Fundamental objects
  2277. "Object",
  2278. "Function",
  2279. "Boolean",
  2280. "Symbol",
  2281. // numbers and dates
  2282. "Math",
  2283. "Date",
  2284. "Number",
  2285. "BigInt",
  2286. // text
  2287. "String",
  2288. "RegExp",
  2289. // Indexed collections
  2290. "Array",
  2291. "Float32Array",
  2292. "Float64Array",
  2293. "Int8Array",
  2294. "Uint8Array",
  2295. "Uint8ClampedArray",
  2296. "Int16Array",
  2297. "Int32Array",
  2298. "Uint16Array",
  2299. "Uint32Array",
  2300. "BigInt64Array",
  2301. "BigUint64Array",
  2302. // Keyed collections
  2303. "Set",
  2304. "Map",
  2305. "WeakSet",
  2306. "WeakMap",
  2307. // Structured data
  2308. "ArrayBuffer",
  2309. "SharedArrayBuffer",
  2310. "Atomics",
  2311. "DataView",
  2312. "JSON",
  2313. // Control abstraction objects
  2314. "Promise",
  2315. "Generator",
  2316. "GeneratorFunction",
  2317. "AsyncFunction",
  2318. // Reflection
  2319. "Reflect",
  2320. "Proxy",
  2321. // Internationalization
  2322. "Intl",
  2323. // WebAssembly
  2324. "WebAssembly"
  2325. ];
  2326. var Cn = [
  2327. "Error",
  2328. "EvalError",
  2329. "InternalError",
  2330. "RangeError",
  2331. "ReferenceError",
  2332. "SyntaxError",
  2333. "TypeError",
  2334. "URIError"
  2335. ];
  2336. var In = [
  2337. "setInterval",
  2338. "setTimeout",
  2339. "clearInterval",
  2340. "clearTimeout",
  2341. "require",
  2342. "exports",
  2343. "eval",
  2344. "isFinite",
  2345. "isNaN",
  2346. "parseFloat",
  2347. "parseInt",
  2348. "decodeURI",
  2349. "decodeURIComponent",
  2350. "encodeURI",
  2351. "encodeURIComponent",
  2352. "escape",
  2353. "unescape"
  2354. ];
  2355. var Jt = [
  2356. "arguments",
  2357. "this",
  2358. "super",
  2359. "console",
  2360. "window",
  2361. "document",
  2362. "localStorage",
  2363. "sessionStorage",
  2364. "module",
  2365. "global"
  2366. // Node.js
  2367. ];
  2368. var er = [].concat(
  2369. In,
  2370. On,
  2371. Cn
  2372. );
  2373. function nr(e) {
  2374. const r = e.regex, l = (N, { after: O }) => {
  2375. const U = "</" + N[0].slice(1);
  2376. return N.input.indexOf(U, O) !== -1;
  2377. }, f = hn, g = {
  2378. begin: "<>",
  2379. end: "</>"
  2380. }, n = /<[A-Za-z0-9\\._:-]+\s*\/>/, t = {
  2381. begin: /<[A-Za-z0-9\\._:-]+/,
  2382. end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
  2383. /**
  2384. * @param {RegExpMatchArray} match
  2385. * @param {CallbackResponse} response
  2386. */
  2387. isTrulyOpeningTag: (N, O) => {
  2388. const U = N[0].length + N.index, x = N.input[U];
  2389. if (
  2390. // HTML should not include another raw `<` inside a tag
  2391. // nested type?
  2392. // `<Array<Array<number>>`, etc.
  2393. x === "<" || // the , gives away that this is not HTML
  2394. // `<T, A extends keyof T, V>`
  2395. x === ","
  2396. ) {
  2397. O.ignoreMatch();
  2398. return;
  2399. }
  2400. x === ">" && (l(N, { after: U }) || O.ignoreMatch());
  2401. let X;
  2402. const J = N.input.substring(U);
  2403. if (X = J.match(/^\s*=/)) {
  2404. O.ignoreMatch();
  2405. return;
  2406. }
  2407. if ((X = J.match(/^\s+extends\s+/)) && X.index === 0) {
  2408. O.ignoreMatch();
  2409. return;
  2410. }
  2411. }
  2412. }, i = {
  2413. $pattern: hn,
  2414. keyword: jt,
  2415. literal: qt,
  2416. built_in: er,
  2417. "variable.language": Jt
  2418. }, s = "[0-9](_?[0-9])*", a = `\\.(${s})`, o = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", c = {
  2419. className: "number",
  2420. variants: [
  2421. // DecimalLiteral
  2422. { begin: `(\\b(${o})((${a})|\\.)?|(${a}))[eE][+-]?(${s})\\b` },
  2423. { begin: `\\b(${o})\\b((${a})\\b|\\.)?|(${a})\\b` },
  2424. // DecimalBigIntegerLiteral
  2425. { begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
  2426. // NonDecimalIntegerLiteral
  2427. { begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
  2428. { begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
  2429. { begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
  2430. // LegacyOctalIntegerLiteral (does not include underscore separators)
  2431. // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
  2432. { begin: "\\b0[0-7]+n?\\b" }
  2433. ],
  2434. relevance: 0
  2435. }, u = {
  2436. className: "subst",
  2437. begin: "\\$\\{",
  2438. end: "\\}",
  2439. keywords: i,
  2440. contains: []
  2441. // defined later
  2442. }, d = {
  2443. begin: "html`",
  2444. end: "",
  2445. starts: {
  2446. end: "`",
  2447. returnEnd: false,
  2448. contains: [
  2449. e.BACKSLASH_ESCAPE,
  2450. u
  2451. ],
  2452. subLanguage: "xml"
  2453. }
  2454. }, h = {
  2455. begin: "css`",
  2456. end: "",
  2457. starts: {
  2458. end: "`",
  2459. returnEnd: false,
  2460. contains: [
  2461. e.BACKSLASH_ESCAPE,
  2462. u
  2463. ],
  2464. subLanguage: "css"
  2465. }
  2466. }, p = {
  2467. begin: "gql`",
  2468. end: "",
  2469. starts: {
  2470. end: "`",
  2471. returnEnd: false,
  2472. contains: [
  2473. e.BACKSLASH_ESCAPE,
  2474. u
  2475. ],
  2476. subLanguage: "graphql"
  2477. }
  2478. }, _ = {
  2479. className: "string",
  2480. begin: "`",
  2481. end: "`",
  2482. contains: [
  2483. e.BACKSLASH_ESCAPE,
  2484. u
  2485. ]
  2486. }, m = {
  2487. className: "comment",
  2488. variants: [
  2489. e.COMMENT(
  2490. /\/\*\*(?!\/)/,
  2491. "\\*/",
  2492. {
  2493. relevance: 0,
  2494. contains: [
  2495. {
  2496. begin: "(?=@[A-Za-z]+)",
  2497. relevance: 0,
  2498. contains: [
  2499. {
  2500. className: "doctag",
  2501. begin: "@[A-Za-z]+"
  2502. },
  2503. {
  2504. className: "type",
  2505. begin: "\\{",
  2506. end: "\\}",
  2507. excludeEnd: true,
  2508. excludeBegin: true,
  2509. relevance: 0
  2510. },
  2511. {
  2512. className: "variable",
  2513. begin: f + "(?=\\s*(-)|$)",
  2514. endsParent: true,
  2515. relevance: 0
  2516. },
  2517. // eat spaces (not newlines) so we can find
  2518. // types or variables
  2519. {
  2520. begin: /(?=[^\n])\s/,
  2521. relevance: 0
  2522. }
  2523. ]
  2524. }
  2525. ]
  2526. }
  2527. ),
  2528. e.C_BLOCK_COMMENT_MODE,
  2529. e.C_LINE_COMMENT_MODE
  2530. ]
  2531. }, v = [
  2532. e.APOS_STRING_MODE,
  2533. e.QUOTE_STRING_MODE,
  2534. d,
  2535. h,
  2536. p,
  2537. _,
  2538. // Skip numbers when they are part of a variable name
  2539. { match: /\$\d+/ },
  2540. c
  2541. // This is intentional:
  2542. // See https://github.com/highlightjs/highlight.js/issues/3288
  2543. // hljs.REGEXP_MODE
  2544. ];
  2545. u.contains = v.concat({
  2546. // we need to pair up {} inside our subst to prevent
  2547. // it from ending too early by matching another }
  2548. begin: /\{/,
  2549. end: /\}/,
  2550. keywords: i,
  2551. contains: [
  2552. "self"
  2553. ].concat(v)
  2554. });
  2555. const A = [].concat(m, u.contains), D = A.concat([
  2556. // eat recursive parens in sub expressions
  2557. {
  2558. begin: /\(/,
  2559. end: /\)/,
  2560. keywords: i,
  2561. contains: ["self"].concat(A)
  2562. }
  2563. ]), S = {
  2564. className: "params",
  2565. begin: /\(/,
  2566. end: /\)/,
  2567. excludeBegin: true,
  2568. excludeEnd: true,
  2569. keywords: i,
  2570. contains: D
  2571. }, M = {
  2572. variants: [
  2573. // class Car extends vehicle
  2574. {
  2575. match: [
  2576. /class/,
  2577. /\s+/,
  2578. f,
  2579. /\s+/,
  2580. /extends/,
  2581. /\s+/,
  2582. r.concat(f, "(", r.concat(/\./, f), ")*")
  2583. ],
  2584. scope: {
  2585. 1: "keyword",
  2586. 3: "title.class",
  2587. 5: "keyword",
  2588. 7: "title.class.inherited"
  2589. }
  2590. },
  2591. // class Car
  2592. {
  2593. match: [
  2594. /class/,
  2595. /\s+/,
  2596. f
  2597. ],
  2598. scope: {
  2599. 1: "keyword",
  2600. 3: "title.class"
  2601. }
  2602. }
  2603. ]
  2604. }, R = {
  2605. relevance: 0,
  2606. match: r.either(
  2607. // Hard coded exceptions
  2608. /\bJSON/,
  2609. // Float32Array, OutT
  2610. /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
  2611. // CSSFactory, CSSFactoryT
  2612. /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
  2613. // FPs, FPsT
  2614. /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
  2615. // P
  2616. // single letters are not highlighted
  2617. // BLAH
  2618. // this will be flagged as a UPPER_CASE_CONSTANT instead
  2619. ),
  2620. className: "title.class",
  2621. keywords: {
  2622. _: [
  2623. // se we still get relevance credit for JS library classes
  2624. ...On,
  2625. ...Cn
  2626. ]
  2627. }
  2628. }, L = {
  2629. label: "use_strict",
  2630. className: "meta",
  2631. relevance: 10,
  2632. begin: /^\s*['"]use (strict|asm)['"]/
  2633. }, I = {
  2634. variants: [
  2635. {
  2636. match: [
  2637. /function/,
  2638. /\s+/,
  2639. f,
  2640. /(?=\s*\()/
  2641. ]
  2642. },
  2643. // anonymous function
  2644. {
  2645. match: [
  2646. /function/,
  2647. /\s*(?=\()/
  2648. ]
  2649. }
  2650. ],
  2651. className: {
  2652. 1: "keyword",
  2653. 3: "title.function"
  2654. },
  2655. label: "func.def",
  2656. contains: [S],
  2657. illegal: /%/
  2658. }, P = {
  2659. relevance: 0,
  2660. match: /\b[A-Z][A-Z_0-9]+\b/,
  2661. className: "variable.constant"
  2662. };
  2663. function $(N) {
  2664. return r.concat("(?!", N.join("|"), ")");
  2665. }
  2666. const K = {
  2667. match: r.concat(
  2668. /\b/,
  2669. $([
  2670. ...In,
  2671. "super",
  2672. "import"
  2673. ]),
  2674. f,
  2675. r.lookahead(/\(/)
  2676. ),
  2677. className: "title.function",
  2678. relevance: 0
  2679. }, Y = {
  2680. begin: r.concat(/\./, r.lookahead(
  2681. r.concat(f, /(?![0-9A-Za-z$_(])/)
  2682. )),
  2683. end: f,
  2684. excludeBegin: true,
  2685. keywords: "prototype",
  2686. className: "property",
  2687. relevance: 0
  2688. }, oe = {
  2689. match: [
  2690. /get|set/,
  2691. /\s+/,
  2692. f,
  2693. /(?=\()/
  2694. ],
  2695. className: {
  2696. 1: "keyword",
  2697. 3: "title.function"
  2698. },
  2699. contains: [
  2700. {
  2701. // eat to avoid empty params
  2702. begin: /\(\)/
  2703. },
  2704. S
  2705. ]
  2706. }, ge = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", b = {
  2707. match: [
  2708. /const|var|let/,
  2709. /\s+/,
  2710. f,
  2711. /\s*/,
  2712. /=\s*/,
  2713. /(async\s*)?/,
  2714. // async is optional
  2715. r.lookahead(ge)
  2716. ],
  2717. keywords: "async",
  2718. className: {
  2719. 1: "keyword",
  2720. 3: "title.function"
  2721. },
  2722. contains: [
  2723. S
  2724. ]
  2725. };
  2726. return {
  2727. name: "JavaScript",
  2728. aliases: ["js", "jsx", "mjs", "cjs"],
  2729. keywords: i,
  2730. // this will be extended by TypeScript
  2731. exports: { PARAMS_CONTAINS: D, CLASS_REFERENCE: R },
  2732. illegal: /#(?![$_A-z])/,
  2733. contains: [
  2734. e.SHEBANG({
  2735. label: "shebang",
  2736. binary: "node",
  2737. relevance: 5
  2738. }),
  2739. L,
  2740. e.APOS_STRING_MODE,
  2741. e.QUOTE_STRING_MODE,
  2742. d,
  2743. h,
  2744. p,
  2745. _,
  2746. m,
  2747. // Skip numbers when they are part of a variable name
  2748. { match: /\$\d+/ },
  2749. c,
  2750. R,
  2751. {
  2752. className: "attr",
  2753. begin: f + r.lookahead(":"),
  2754. relevance: 0
  2755. },
  2756. b,
  2757. {
  2758. // "value" container
  2759. begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
  2760. keywords: "return throw case",
  2761. relevance: 0,
  2762. contains: [
  2763. m,
  2764. e.REGEXP_MODE,
  2765. {
  2766. className: "function",
  2767. // we have to count the parens to make sure we actually have the
  2768. // correct bounding ( ) before the =>. There could be any number of
  2769. // sub-expressions inside also surrounded by parens.
  2770. begin: ge,
  2771. returnBegin: true,
  2772. end: "\\s*=>",
  2773. contains: [
  2774. {
  2775. className: "params",
  2776. variants: [
  2777. {
  2778. begin: e.UNDERSCORE_IDENT_RE,
  2779. relevance: 0
  2780. },
  2781. {
  2782. className: null,
  2783. begin: /\(\s*\)/,
  2784. skip: true
  2785. },
  2786. {
  2787. begin: /\(/,
  2788. end: /\)/,
  2789. excludeBegin: true,
  2790. excludeEnd: true,
  2791. keywords: i,
  2792. contains: D
  2793. }
  2794. ]
  2795. }
  2796. ]
  2797. },
  2798. {
  2799. // could be a comma delimited list of params to a function call
  2800. begin: /,/,
  2801. relevance: 0
  2802. },
  2803. {
  2804. match: /\s+/,
  2805. relevance: 0
  2806. },
  2807. {
  2808. // JSX
  2809. variants: [
  2810. { begin: g.begin, end: g.end },
  2811. { match: n },
  2812. {
  2813. begin: t.begin,
  2814. // we carefully check the opening tag to see if it truly
  2815. // is a tag and not a false positive
  2816. "on:begin": t.isTrulyOpeningTag,
  2817. end: t.end
  2818. }
  2819. ],
  2820. subLanguage: "xml",
  2821. contains: [
  2822. {
  2823. begin: t.begin,
  2824. end: t.end,
  2825. skip: true,
  2826. contains: ["self"]
  2827. }
  2828. ]
  2829. }
  2830. ]
  2831. },
  2832. I,
  2833. {
  2834. // prevent this from getting swallowed up by function
  2835. // since they appear "function like"
  2836. beginKeywords: "while if switch catch for"
  2837. },
  2838. {
  2839. // we have to count the parens to make sure we actually have the correct
  2840. // bounding ( ). There could be any number of sub-expressions inside
  2841. // also surrounded by parens.
  2842. begin: "\\b(?!function)" + e.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
  2843. // end parens
  2844. returnBegin: true,
  2845. label: "func.def",
  2846. contains: [
  2847. S,
  2848. e.inherit(e.TITLE_MODE, { begin: f, className: "title.function" })
  2849. ]
  2850. },
  2851. // catch ... so it won't trigger the property rule below
  2852. {
  2853. match: /\.\.\./,
  2854. relevance: 0
  2855. },
  2856. Y,
  2857. // hack: prevents detection of keywords in some circumstances
  2858. // .keyword()
  2859. // $keyword = x
  2860. {
  2861. match: "\\$" + f,
  2862. relevance: 0
  2863. },
  2864. {
  2865. match: [/\bconstructor(?=\s*\()/],
  2866. className: { 1: "title.function" },
  2867. contains: [S]
  2868. },
  2869. K,
  2870. P,
  2871. M,
  2872. oe,
  2873. {
  2874. match: /\$[(.]/
  2875. // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
  2876. }
  2877. ]
  2878. };
  2879. }
  2880. function tr(e) {
  2881. const r = {
  2882. className: "attr",
  2883. begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
  2884. relevance: 1.01
  2885. }, l = {
  2886. match: /[{}[\],:]/,
  2887. className: "punctuation",
  2888. relevance: 0
  2889. }, f = [
  2890. "true",
  2891. "false",
  2892. "null"
  2893. ], g = {
  2894. scope: "literal",
  2895. beginKeywords: f.join(" ")
  2896. };
  2897. return {
  2898. name: "JSON",
  2899. keywords: {
  2900. literal: f
  2901. },
  2902. contains: [
  2903. r,
  2904. l,
  2905. e.QUOTE_STRING_MODE,
  2906. g,
  2907. e.C_NUMBER_MODE,
  2908. e.C_LINE_COMMENT_MODE,
  2909. e.C_BLOCK_COMMENT_MODE
  2910. ],
  2911. illegal: "\\S"
  2912. };
  2913. }
  2914. function rr(e) {
  2915. const r = "true false yes no null", l = "[\\w#;/?:@&=+$,.~*'()[\\]]+", f = {
  2916. className: "attr",
  2917. variants: [
  2918. { begin: "\\w[\\w :\\/.-]*:(?=[ ]|$)" },
  2919. {
  2920. // double quoted keys
  2921. begin: '"\\w[\\w :\\/.-]*":(?=[ ]|$)'
  2922. },
  2923. {
  2924. // single quoted keys
  2925. begin: "'\\w[\\w :\\/.-]*':(?=[ ]|$)"
  2926. }
  2927. ]
  2928. }, g = {
  2929. className: "template-variable",
  2930. variants: [
  2931. {
  2932. // jinja templates Ansible
  2933. begin: /\{\{/,
  2934. end: /\}\}/
  2935. },
  2936. {
  2937. // Ruby i18n
  2938. begin: /%\{/,
  2939. end: /\}/
  2940. }
  2941. ]
  2942. }, n = {
  2943. className: "string",
  2944. relevance: 0,
  2945. variants: [
  2946. {
  2947. begin: /'/,
  2948. end: /'/
  2949. },
  2950. {
  2951. begin: /"/,
  2952. end: /"/
  2953. },
  2954. { begin: /\S+/ }
  2955. ],
  2956. contains: [
  2957. e.BACKSLASH_ESCAPE,
  2958. g
  2959. ]
  2960. }, t = e.inherit(n, { variants: [
  2961. {
  2962. begin: /'/,
  2963. end: /'/
  2964. },
  2965. {
  2966. begin: /"/,
  2967. end: /"/
  2968. },
  2969. { begin: /[^\s,{}[\]]+/ }
  2970. ] }), i = "[0-9]{4}(-[0-9][0-9]){0,2}", s = "([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?", a = "(\\.[0-9]*)?", o = "([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?", c = {
  2971. className: "number",
  2972. begin: "\\b" + i + s + a + o + "\\b"
  2973. }, u = {
  2974. end: ",",
  2975. endsWithParent: true,
  2976. excludeEnd: true,
  2977. keywords: r,
  2978. relevance: 0
  2979. }, d = {
  2980. begin: /\{/,
  2981. end: /\}/,
  2982. contains: [u],
  2983. illegal: "\\n",
  2984. relevance: 0
  2985. }, h = {
  2986. begin: "\\[",
  2987. end: "\\]",
  2988. contains: [u],
  2989. illegal: "\\n",
  2990. relevance: 0
  2991. }, p = [
  2992. f,
  2993. {
  2994. className: "meta",
  2995. begin: "^---\\s*$",
  2996. relevance: 10
  2997. },
  2998. {
  2999. // multi line string
  3000. // Blocks start with a | or > followed by a newline
  3001. //
  3002. // Indentation of subsequent lines must be the same to
  3003. // be considered part of the block
  3004. className: "string",
  3005. begin: "[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"
  3006. },
  3007. {
  3008. // Ruby/Rails erb
  3009. begin: "<%[%=-]?",
  3010. end: "[%-]?%>",
  3011. subLanguage: "ruby",
  3012. excludeBegin: true,
  3013. excludeEnd: true,
  3014. relevance: 0
  3015. },
  3016. {
  3017. // named tags
  3018. className: "type",
  3019. begin: "!\\w+!" + l
  3020. },
  3021. // https://yaml.org/spec/1.2/spec.html#id2784064
  3022. {
  3023. // verbatim tags
  3024. className: "type",
  3025. begin: "!<" + l + ">"
  3026. },
  3027. {
  3028. // primary tags
  3029. className: "type",
  3030. begin: "!" + l
  3031. },
  3032. {
  3033. // secondary tags
  3034. className: "type",
  3035. begin: "!!" + l
  3036. },
  3037. {
  3038. // fragment id &ref
  3039. className: "meta",
  3040. begin: "&" + e.UNDERSCORE_IDENT_RE + "$"
  3041. },
  3042. {
  3043. // fragment reference *ref
  3044. className: "meta",
  3045. begin: "\\*" + e.UNDERSCORE_IDENT_RE + "$"
  3046. },
  3047. {
  3048. // array listing
  3049. className: "bullet",
  3050. // TODO: remove |$ hack when we have proper look-ahead support
  3051. begin: "-(?=[ ]|$)",
  3052. relevance: 0
  3053. },
  3054. e.HASH_COMMENT_MODE,
  3055. {
  3056. beginKeywords: r,
  3057. keywords: { literal: r }
  3058. },
  3059. c,
  3060. // numbers are any valid C-style number that
  3061. // sit isolated from other words
  3062. {
  3063. className: "number",
  3064. begin: e.C_NUMBER_RE + "\\b",
  3065. relevance: 0
  3066. },
  3067. d,
  3068. h,
  3069. n
  3070. ], _ = [...p];
  3071. return _.pop(), _.push(t), u.contains = _, {
  3072. name: "YAML",
  3073. case_insensitive: true,
  3074. aliases: ["yml"],
  3075. contains: p
  3076. };
  3077. }
  3078. function ir(e) {
  3079. return {
  3080. name: "Plain text",
  3081. aliases: [
  3082. "text",
  3083. "txt"
  3084. ],
  3085. disableAutodetect: true
  3086. };
  3087. }
  3088. function sr(e) {
  3089. const r = e.regex, l = /[\p{XID_Start}_]\p{XID_Continue}*/u, f = [
  3090. "and",
  3091. "as",
  3092. "assert",
  3093. "async",
  3094. "await",
  3095. "break",
  3096. "case",
  3097. "class",
  3098. "continue",
  3099. "def",
  3100. "del",
  3101. "elif",
  3102. "else",
  3103. "except",
  3104. "finally",
  3105. "for",
  3106. "from",
  3107. "global",
  3108. "if",
  3109. "import",
  3110. "in",
  3111. "is",
  3112. "lambda",
  3113. "match",
  3114. "nonlocal|10",
  3115. "not",
  3116. "or",
  3117. "pass",
  3118. "raise",
  3119. "return",
  3120. "try",
  3121. "while",
  3122. "with",
  3123. "yield"
  3124. ], i = {
  3125. $pattern: /[A-Za-z]\w+|__\w+__/,
  3126. keyword: f,
  3127. built_in: [
  3128. "__import__",
  3129. "abs",
  3130. "all",
  3131. "any",
  3132. "ascii",
  3133. "bin",
  3134. "bool",
  3135. "breakpoint",
  3136. "bytearray",
  3137. "bytes",
  3138. "callable",
  3139. "chr",
  3140. "classmethod",
  3141. "compile",
  3142. "complex",
  3143. "delattr",
  3144. "dict",
  3145. "dir",
  3146. "divmod",
  3147. "enumerate",
  3148. "eval",
  3149. "exec",
  3150. "filter",
  3151. "float",
  3152. "format",
  3153. "frozenset",
  3154. "getattr",
  3155. "globals",
  3156. "hasattr",
  3157. "hash",
  3158. "help",
  3159. "hex",
  3160. "id",
  3161. "input",
  3162. "int",
  3163. "isinstance",
  3164. "issubclass",
  3165. "iter",
  3166. "len",
  3167. "list",
  3168. "locals",
  3169. "map",
  3170. "max",
  3171. "memoryview",
  3172. "min",
  3173. "next",
  3174. "object",
  3175. "oct",
  3176. "open",
  3177. "ord",
  3178. "pow",
  3179. "print",
  3180. "property",
  3181. "range",
  3182. "repr",
  3183. "reversed",
  3184. "round",
  3185. "set",
  3186. "setattr",
  3187. "slice",
  3188. "sorted",
  3189. "staticmethod",
  3190. "str",
  3191. "sum",
  3192. "super",
  3193. "tuple",
  3194. "type",
  3195. "vars",
  3196. "zip"
  3197. ],
  3198. literal: [
  3199. "__debug__",
  3200. "Ellipsis",
  3201. "False",
  3202. "None",
  3203. "NotImplemented",
  3204. "True"
  3205. ],
  3206. type: [
  3207. "Any",
  3208. "Callable",
  3209. "Coroutine",
  3210. "Dict",
  3211. "List",
  3212. "Literal",
  3213. "Generic",
  3214. "Optional",
  3215. "Sequence",
  3216. "Set",
  3217. "Tuple",
  3218. "Type",
  3219. "Union"
  3220. ]
  3221. }, s = {
  3222. className: "meta",
  3223. begin: /^(>>>|\.\.\.) /
  3224. }, a = {
  3225. className: "subst",
  3226. begin: /\{/,
  3227. end: /\}/,
  3228. keywords: i,
  3229. illegal: /#/
  3230. }, o = {
  3231. begin: /\{\{/,
  3232. relevance: 0
  3233. }, c = {
  3234. className: "string",
  3235. contains: [e.BACKSLASH_ESCAPE],
  3236. variants: [
  3237. {
  3238. begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,
  3239. end: /'''/,
  3240. contains: [
  3241. e.BACKSLASH_ESCAPE,
  3242. s
  3243. ],
  3244. relevance: 10
  3245. },
  3246. {
  3247. begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,
  3248. end: /"""/,
  3249. contains: [
  3250. e.BACKSLASH_ESCAPE,
  3251. s
  3252. ],
  3253. relevance: 10
  3254. },
  3255. {
  3256. begin: /([fF][rR]|[rR][fF]|[fF])'''/,
  3257. end: /'''/,
  3258. contains: [
  3259. e.BACKSLASH_ESCAPE,
  3260. s,
  3261. o,
  3262. a
  3263. ]
  3264. },
  3265. {
  3266. begin: /([fF][rR]|[rR][fF]|[fF])"""/,
  3267. end: /"""/,
  3268. contains: [
  3269. e.BACKSLASH_ESCAPE,
  3270. s,
  3271. o,
  3272. a
  3273. ]
  3274. },
  3275. {
  3276. begin: /([uU]|[rR])'/,
  3277. end: /'/,
  3278. relevance: 10
  3279. },
  3280. {
  3281. begin: /([uU]|[rR])"/,
  3282. end: /"/,
  3283. relevance: 10
  3284. },
  3285. {
  3286. begin: /([bB]|[bB][rR]|[rR][bB])'/,
  3287. end: /'/
  3288. },
  3289. {
  3290. begin: /([bB]|[bB][rR]|[rR][bB])"/,
  3291. end: /"/
  3292. },
  3293. {
  3294. begin: /([fF][rR]|[rR][fF]|[fF])'/,
  3295. end: /'/,
  3296. contains: [
  3297. e.BACKSLASH_ESCAPE,
  3298. o,
  3299. a
  3300. ]
  3301. },
  3302. {
  3303. begin: /([fF][rR]|[rR][fF]|[fF])"/,
  3304. end: /"/,
  3305. contains: [
  3306. e.BACKSLASH_ESCAPE,
  3307. o,
  3308. a
  3309. ]
  3310. },
  3311. e.APOS_STRING_MODE,
  3312. e.QUOTE_STRING_MODE
  3313. ]
  3314. }, u = "[0-9](_?[0-9])*", d = `(\\b(${u}))?\\.(${u})|\\b(${u})\\.`, h = `\\b|${f.join("|")}`, p = {
  3315. className: "number",
  3316. relevance: 0,
  3317. variants: [
  3318. // exponentfloat, pointfloat
  3319. // https://docs.python.org/3.9/reference/lexical_analysis.html#floating-point-literals
  3320. // optionally imaginary
  3321. // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
  3322. // Note: no leading \b because floats can start with a decimal point
  3323. // and we don't want to mishandle e.g. `fn(.5)`,
  3324. // no trailing \b for pointfloat because it can end with a decimal point
  3325. // and we don't want to mishandle e.g. `0..hex()`; this should be safe
  3326. // because both MUST contain a decimal point and so cannot be confused with
  3327. // the interior part of an identifier
  3328. {
  3329. begin: `(\\b(${u})|(${d}))[eE][+-]?(${u})[jJ]?(?=${h})`
  3330. },
  3331. {
  3332. begin: `(${d})[jJ]?`
  3333. },
  3334. // decinteger, bininteger, octinteger, hexinteger
  3335. // https://docs.python.org/3.9/reference/lexical_analysis.html#integer-literals
  3336. // optionally "long" in Python 2
  3337. // https://docs.python.org/2.7/reference/lexical_analysis.html#integer-and-long-integer-literals
  3338. // decinteger is optionally imaginary
  3339. // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
  3340. {
  3341. begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`
  3342. },
  3343. {
  3344. begin: `\\b0[bB](_?[01])+[lL]?(?=${h})`
  3345. },
  3346. {
  3347. begin: `\\b0[oO](_?[0-7])+[lL]?(?=${h})`
  3348. },
  3349. {
  3350. begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`
  3351. },
  3352. // imagnumber (digitpart-based)
  3353. // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
  3354. {
  3355. begin: `\\b(${u})[jJ](?=${h})`
  3356. }
  3357. ]
  3358. }, _ = {
  3359. className: "comment",
  3360. begin: r.lookahead(/# type:/),
  3361. end: /$/,
  3362. keywords: i,
  3363. contains: [
  3364. {
  3365. // prevent keywords from coloring `type`
  3366. begin: /# type:/
  3367. },
  3368. // comment within a datatype comment includes no keywords
  3369. {
  3370. begin: /#/,
  3371. end: /\b\B/,
  3372. endsWithParent: true
  3373. }
  3374. ]
  3375. }, E = {
  3376. className: "params",
  3377. variants: [
  3378. // Exclude params in functions without params
  3379. {
  3380. className: "",
  3381. begin: /\(\s*\)/,
  3382. skip: true
  3383. },
  3384. {
  3385. begin: /\(/,
  3386. end: /\)/,
  3387. excludeBegin: true,
  3388. excludeEnd: true,
  3389. keywords: i,
  3390. contains: [
  3391. "self",
  3392. s,
  3393. p,
  3394. c,
  3395. e.HASH_COMMENT_MODE
  3396. ]
  3397. }
  3398. ]
  3399. };
  3400. return a.contains = [
  3401. c,
  3402. p,
  3403. s
  3404. ], {
  3405. name: "Python",
  3406. aliases: [
  3407. "py",
  3408. "gyp",
  3409. "ipython"
  3410. ],
  3411. unicodeRegex: true,
  3412. keywords: i,
  3413. illegal: /(<\/|\?)|=>/,
  3414. contains: [
  3415. s,
  3416. p,
  3417. {
  3418. // very common convention
  3419. begin: /\bself\b/
  3420. },
  3421. {
  3422. // eat "if" prior to string so that it won't accidentally be
  3423. // labeled as an f-string
  3424. beginKeywords: "if",
  3425. relevance: 0
  3426. },
  3427. c,
  3428. _,
  3429. e.HASH_COMMENT_MODE,
  3430. {
  3431. match: [
  3432. /\bdef/,
  3433. /\s+/,
  3434. l
  3435. ],
  3436. scope: {
  3437. 1: "keyword",
  3438. 3: "title.function"
  3439. },
  3440. contains: [E]
  3441. },
  3442. {
  3443. variants: [
  3444. {
  3445. match: [
  3446. /\bclass/,
  3447. /\s+/,
  3448. l,
  3449. /\s*/,
  3450. /\(\s*/,
  3451. l,
  3452. /\s*\)/
  3453. ]
  3454. },
  3455. {
  3456. match: [
  3457. /\bclass/,
  3458. /\s+/,
  3459. l
  3460. ]
  3461. }
  3462. ],
  3463. scope: {
  3464. 1: "keyword",
  3465. 3: "title.class",
  3466. 6: "title.class.inherited"
  3467. }
  3468. },
  3469. {
  3470. className: "meta",
  3471. begin: /^[\t ]*@/,
  3472. end: /(?=#)|$/,
  3473. contains: [
  3474. p,
  3475. E,
  3476. c
  3477. ]
  3478. }
  3479. ]
  3480. };
  3481. }
  3482. var de = "[0-9](_*[0-9])*";
  3483. var Re = `\\.(${de})`;
  3484. var Oe = "[0-9a-fA-F](_*[0-9a-fA-F])*";
  3485. var dn = {
  3486. className: "number",
  3487. variants: [
  3488. // DecimalFloatingPointLiteral
  3489. // including ExponentPart
  3490. { begin: `(\\b(${de})((${Re})|\\.)?|(${Re}))[eE][+-]?(${de})[fFdD]?\\b` },
  3491. // excluding ExponentPart
  3492. { begin: `\\b(${de})((${Re})[fFdD]?\\b|\\.([fFdD]\\b)?)` },
  3493. { begin: `(${Re})[fFdD]?\\b` },
  3494. { begin: `\\b(${de})[fFdD]\\b` },
  3495. // HexadecimalFloatingPointLiteral
  3496. { begin: `\\b0[xX]((${Oe})\\.?|(${Oe})?\\.(${Oe}))[pP][+-]?(${de})[fFdD]?\\b` },
  3497. // DecimalIntegerLiteral
  3498. { begin: "\\b(0|[1-9](_*[0-9])*)[lL]?\\b" },
  3499. // HexIntegerLiteral
  3500. { begin: `\\b0[xX](${Oe})[lL]?\\b` },
  3501. // OctalIntegerLiteral
  3502. { begin: "\\b0(_*[0-7])*[lL]?\\b" },
  3503. // BinaryIntegerLiteral
  3504. { begin: "\\b0[bB][01](_*[01])*[lL]?\\b" }
  3505. ],
  3506. relevance: 0
  3507. };
  3508. function kn(e, r, l) {
  3509. return l === -1 ? "" : e.replace(r, (f) => kn(e, r, l - 1));
  3510. }
  3511. function ar(e) {
  3512. const r = e.regex, l = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", f = l + kn("(?:<" + l + "~~~(?:\\s*,\\s*" + l + "~~~)*>)?", /~~~/g, 2), s = {
  3513. keyword: [
  3514. "synchronized",
  3515. "abstract",
  3516. "private",
  3517. "var",
  3518. "static",
  3519. "if",
  3520. "const ",
  3521. "for",
  3522. "while",
  3523. "strictfp",
  3524. "finally",
  3525. "protected",
  3526. "import",
  3527. "native",
  3528. "final",
  3529. "void",
  3530. "enum",
  3531. "else",
  3532. "break",
  3533. "transient",
  3534. "catch",
  3535. "instanceof",
  3536. "volatile",
  3537. "case",
  3538. "assert",
  3539. "package",
  3540. "default",
  3541. "public",
  3542. "try",
  3543. "switch",
  3544. "continue",
  3545. "throws",
  3546. "protected",
  3547. "public",
  3548. "private",
  3549. "module",
  3550. "requires",
  3551. "exports",
  3552. "do",
  3553. "sealed",
  3554. "yield",
  3555. "permits"
  3556. ],
  3557. literal: [
  3558. "false",
  3559. "true",
  3560. "null"
  3561. ],
  3562. type: [
  3563. "char",
  3564. "boolean",
  3565. "long",
  3566. "float",
  3567. "int",
  3568. "byte",
  3569. "short",
  3570. "double"
  3571. ],
  3572. built_in: [
  3573. "super",
  3574. "this"
  3575. ]
  3576. }, a = {
  3577. className: "meta",
  3578. begin: "@" + l,
  3579. contains: [
  3580. {
  3581. begin: /\(/,
  3582. end: /\)/,
  3583. contains: ["self"]
  3584. // allow nested () inside our annotation
  3585. }
  3586. ]
  3587. }, o = {
  3588. className: "params",
  3589. begin: /\(/,
  3590. end: /\)/,
  3591. keywords: s,
  3592. relevance: 0,
  3593. contains: [e.C_BLOCK_COMMENT_MODE],
  3594. endsParent: true
  3595. };
  3596. return {
  3597. name: "Java",
  3598. aliases: ["jsp"],
  3599. keywords: s,
  3600. illegal: /<\/|#/,
  3601. contains: [
  3602. e.COMMENT(
  3603. "/\\*\\*",
  3604. "\\*/",
  3605. {
  3606. relevance: 0,
  3607. contains: [
  3608. {
  3609. // eat up @'s in emails to prevent them to be recognized as doctags
  3610. begin: /\w+@/,
  3611. relevance: 0
  3612. },
  3613. {
  3614. className: "doctag",
  3615. begin: "@[A-Za-z]+"
  3616. }
  3617. ]
  3618. }
  3619. ),
  3620. // relevance boost
  3621. {
  3622. begin: /import java\.[a-z]+\./,
  3623. keywords: "import",
  3624. relevance: 2
  3625. },
  3626. e.C_LINE_COMMENT_MODE,
  3627. e.C_BLOCK_COMMENT_MODE,
  3628. {
  3629. begin: /"""/,
  3630. end: /"""/,
  3631. className: "string",
  3632. contains: [e.BACKSLASH_ESCAPE]
  3633. },
  3634. e.APOS_STRING_MODE,
  3635. e.QUOTE_STRING_MODE,
  3636. {
  3637. match: [
  3638. /\b(?:class|interface|enum|extends|implements|new)/,
  3639. /\s+/,
  3640. l
  3641. ],
  3642. className: {
  3643. 1: "keyword",
  3644. 3: "title.class"
  3645. }
  3646. },
  3647. {
  3648. // Exceptions for hyphenated keywords
  3649. match: /non-sealed/,
  3650. scope: "keyword"
  3651. },
  3652. {
  3653. begin: [
  3654. r.concat(/(?!else)/, l),
  3655. /\s+/,
  3656. l,
  3657. /\s+/,
  3658. /=(?!=)/
  3659. ],
  3660. className: {
  3661. 1: "type",
  3662. 3: "variable",
  3663. 5: "operator"
  3664. }
  3665. },
  3666. {
  3667. begin: [
  3668. /record/,
  3669. /\s+/,
  3670. l
  3671. ],
  3672. className: {
  3673. 1: "keyword",
  3674. 3: "title.class"
  3675. },
  3676. contains: [
  3677. o,
  3678. e.C_LINE_COMMENT_MODE,
  3679. e.C_BLOCK_COMMENT_MODE
  3680. ]
  3681. },
  3682. {
  3683. // Expression keywords prevent 'keyword Name(...)' from being
  3684. // recognized as a function definition
  3685. beginKeywords: "new throw return else",
  3686. relevance: 0
  3687. },
  3688. {
  3689. begin: [
  3690. "(?:" + f + "\\s+)",
  3691. e.UNDERSCORE_IDENT_RE,
  3692. /\s*(?=\()/
  3693. ],
  3694. className: { 2: "title.function" },
  3695. keywords: s,
  3696. contains: [
  3697. {
  3698. className: "params",
  3699. begin: /\(/,
  3700. end: /\)/,
  3701. keywords: s,
  3702. relevance: 0,
  3703. contains: [
  3704. a,
  3705. e.APOS_STRING_MODE,
  3706. e.QUOTE_STRING_MODE,
  3707. dn,
  3708. e.C_BLOCK_COMMENT_MODE
  3709. ]
  3710. },
  3711. e.C_LINE_COMMENT_MODE,
  3712. e.C_BLOCK_COMMENT_MODE
  3713. ]
  3714. },
  3715. dn,
  3716. a
  3717. ]
  3718. };
  3719. }
  3720. function or(e) {
  3721. const r = e.regex, l = {}, f = {
  3722. begin: /\$\{/,
  3723. end: /\}/,
  3724. contains: [
  3725. "self",
  3726. {
  3727. begin: /:-/,
  3728. contains: [l]
  3729. }
  3730. // default values
  3731. ]
  3732. };
  3733. Object.assign(l, {
  3734. className: "variable",
  3735. variants: [
  3736. { begin: r.concat(
  3737. /\$[\w\d#@][\w\d_]*/,
  3738. // negative look-ahead tries to avoid matching patterns that are not
  3739. // Perl at all like $ident$, @ident@, etc.
  3740. "(?![\\w\\d])(?![$])"
  3741. ) },
  3742. f
  3743. ]
  3744. });
  3745. const g = {
  3746. className: "subst",
  3747. begin: /\$\(/,
  3748. end: /\)/,
  3749. contains: [e.BACKSLASH_ESCAPE]
  3750. }, n = {
  3751. begin: /<<-?\s*(?=\w+)/,
  3752. starts: { contains: [
  3753. e.END_SAME_AS_BEGIN({
  3754. begin: /(\w+)/,
  3755. end: /(\w+)/,
  3756. className: "string"
  3757. })
  3758. ] }
  3759. }, t = {
  3760. className: "string",
  3761. begin: /"/,
  3762. end: /"/,
  3763. contains: [
  3764. e.BACKSLASH_ESCAPE,
  3765. l,
  3766. g
  3767. ]
  3768. };
  3769. g.contains.push(t);
  3770. const i = {
  3771. match: /\\"/
  3772. }, s = {
  3773. className: "string",
  3774. begin: /'/,
  3775. end: /'/
  3776. }, a = {
  3777. match: /\\'/
  3778. }, o = {
  3779. begin: /\$?\(\(/,
  3780. end: /\)\)/,
  3781. contains: [
  3782. {
  3783. begin: /\d+#[0-9a-f]+/,
  3784. className: "number"
  3785. },
  3786. e.NUMBER_MODE,
  3787. l
  3788. ]
  3789. }, c = [
  3790. "fish",
  3791. "bash",
  3792. "zsh",
  3793. "sh",
  3794. "csh",
  3795. "ksh",
  3796. "tcsh",
  3797. "dash",
  3798. "scsh"
  3799. ], u = e.SHEBANG({
  3800. binary: `(${c.join("|")})`,
  3801. relevance: 10
  3802. }), d = {
  3803. className: "function",
  3804. begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
  3805. returnBegin: true,
  3806. contains: [e.inherit(e.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
  3807. relevance: 0
  3808. }, h = [
  3809. "if",
  3810. "then",
  3811. "else",
  3812. "elif",
  3813. "fi",
  3814. "for",
  3815. "while",
  3816. "until",
  3817. "in",
  3818. "do",
  3819. "done",
  3820. "case",
  3821. "esac",
  3822. "function",
  3823. "select"
  3824. ], p = [
  3825. "true",
  3826. "false"
  3827. ], _ = { match: /(\/[a-z._-]+)+/ }, E = [
  3828. "break",
  3829. "cd",
  3830. "continue",
  3831. "eval",
  3832. "exec",
  3833. "exit",
  3834. "export",
  3835. "getopts",
  3836. "hash",
  3837. "pwd",
  3838. "readonly",
  3839. "return",
  3840. "shift",
  3841. "test",
  3842. "times",
  3843. "trap",
  3844. "umask",
  3845. "unset"
  3846. ], m = [
  3847. "alias",
  3848. "bind",
  3849. "builtin",
  3850. "caller",
  3851. "command",
  3852. "declare",
  3853. "echo",
  3854. "enable",
  3855. "help",
  3856. "let",
  3857. "local",
  3858. "logout",
  3859. "mapfile",
  3860. "printf",
  3861. "read",
  3862. "readarray",
  3863. "source",
  3864. "type",
  3865. "typeset",
  3866. "ulimit",
  3867. "unalias"
  3868. ], v = [
  3869. "autoload",
  3870. "bg",
  3871. "bindkey",
  3872. "bye",
  3873. "cap",
  3874. "chdir",
  3875. "clone",
  3876. "comparguments",
  3877. "compcall",
  3878. "compctl",
  3879. "compdescribe",
  3880. "compfiles",
  3881. "compgroups",
  3882. "compquote",
  3883. "comptags",
  3884. "comptry",
  3885. "compvalues",
  3886. "dirs",
  3887. "disable",
  3888. "disown",
  3889. "echotc",
  3890. "echoti",
  3891. "emulate",
  3892. "fc",
  3893. "fg",
  3894. "float",
  3895. "functions",
  3896. "getcap",
  3897. "getln",
  3898. "history",
  3899. "integer",
  3900. "jobs",
  3901. "kill",
  3902. "limit",
  3903. "log",
  3904. "noglob",
  3905. "popd",
  3906. "print",
  3907. "pushd",
  3908. "pushln",
  3909. "rehash",
  3910. "sched",
  3911. "setcap",
  3912. "setopt",
  3913. "stat",
  3914. "suspend",
  3915. "ttyctl",
  3916. "unfunction",
  3917. "unhash",
  3918. "unlimit",
  3919. "unsetopt",
  3920. "vared",
  3921. "wait",
  3922. "whence",
  3923. "where",
  3924. "which",
  3925. "zcompile",
  3926. "zformat",
  3927. "zftp",
  3928. "zle",
  3929. "zmodload",
  3930. "zparseopts",
  3931. "zprof",
  3932. "zpty",
  3933. "zregexparse",
  3934. "zsocket",
  3935. "zstyle",
  3936. "ztcp"
  3937. ], A = [
  3938. "chcon",
  3939. "chgrp",
  3940. "chown",
  3941. "chmod",
  3942. "cp",
  3943. "dd",
  3944. "df",
  3945. "dir",
  3946. "dircolors",
  3947. "ln",
  3948. "ls",
  3949. "mkdir",
  3950. "mkfifo",
  3951. "mknod",
  3952. "mktemp",
  3953. "mv",
  3954. "realpath",
  3955. "rm",
  3956. "rmdir",
  3957. "shred",
  3958. "sync",
  3959. "touch",
  3960. "truncate",
  3961. "vdir",
  3962. "b2sum",
  3963. "base32",
  3964. "base64",
  3965. "cat",
  3966. "cksum",
  3967. "comm",
  3968. "csplit",
  3969. "cut",
  3970. "expand",
  3971. "fmt",
  3972. "fold",
  3973. "head",
  3974. "join",
  3975. "md5sum",
  3976. "nl",
  3977. "numfmt",
  3978. "od",
  3979. "paste",
  3980. "ptx",
  3981. "pr",
  3982. "sha1sum",
  3983. "sha224sum",
  3984. "sha256sum",
  3985. "sha384sum",
  3986. "sha512sum",
  3987. "shuf",
  3988. "sort",
  3989. "split",
  3990. "sum",
  3991. "tac",
  3992. "tail",
  3993. "tr",
  3994. "tsort",
  3995. "unexpand",
  3996. "uniq",
  3997. "wc",
  3998. "arch",
  3999. "basename",
  4000. "chroot",
  4001. "date",
  4002. "dirname",
  4003. "du",
  4004. "echo",
  4005. "env",
  4006. "expr",
  4007. "factor",
  4008. // "false", // keyword literal already
  4009. "groups",
  4010. "hostid",
  4011. "id",
  4012. "link",
  4013. "logname",
  4014. "nice",
  4015. "nohup",
  4016. "nproc",
  4017. "pathchk",
  4018. "pinky",
  4019. "printenv",
  4020. "printf",
  4021. "pwd",
  4022. "readlink",
  4023. "runcon",
  4024. "seq",
  4025. "sleep",
  4026. "stat",
  4027. "stdbuf",
  4028. "stty",
  4029. "tee",
  4030. "test",
  4031. "timeout",
  4032. // "true", // keyword literal already
  4033. "tty",
  4034. "uname",
  4035. "unlink",
  4036. "uptime",
  4037. "users",
  4038. "who",
  4039. "whoami",
  4040. "yes"
  4041. ];
  4042. return {
  4043. name: "Bash",
  4044. aliases: ["sh"],
  4045. keywords: {
  4046. $pattern: /\b[a-z][a-z0-9._-]+\b/,
  4047. keyword: h,
  4048. literal: p,
  4049. built_in: [
  4050. ...E,
  4051. ...m,
  4052. // Shell modifiers
  4053. "set",
  4054. "shopt",
  4055. ...v,
  4056. ...A
  4057. ]
  4058. },
  4059. contains: [
  4060. u,
  4061. // to catch known shells and boost relevancy
  4062. e.SHEBANG(),
  4063. // to catch unknown shells but still highlight the shebang
  4064. d,
  4065. o,
  4066. e.HASH_COMMENT_MODE,
  4067. n,
  4068. _,
  4069. t,
  4070. i,
  4071. s,
  4072. a,
  4073. l
  4074. ]
  4075. };
  4076. }
  4077. function lr(e) {
  4078. const r = e.regex, l = e.COMMENT("--", "$"), f = {
  4079. className: "string",
  4080. variants: [
  4081. {
  4082. begin: /'/,
  4083. end: /'/,
  4084. contains: [{ begin: /''/ }]
  4085. }
  4086. ]
  4087. }, g = {
  4088. begin: /"/,
  4089. end: /"/,
  4090. contains: [{ begin: /""/ }]
  4091. }, n = [
  4092. "true",
  4093. "false",
  4094. // Not sure it's correct to call NULL literal, and clauses like IS [NOT] NULL look strange that way.
  4095. // "null",
  4096. "unknown"
  4097. ], t = [
  4098. "double precision",
  4099. "large object",
  4100. "with timezone",
  4101. "without timezone"
  4102. ], i = [
  4103. "bigint",
  4104. "binary",
  4105. "blob",
  4106. "boolean",
  4107. "char",
  4108. "character",
  4109. "clob",
  4110. "date",
  4111. "dec",
  4112. "decfloat",
  4113. "decimal",
  4114. "float",
  4115. "int",
  4116. "integer",
  4117. "interval",
  4118. "nchar",
  4119. "nclob",
  4120. "national",
  4121. "numeric",
  4122. "real",
  4123. "row",
  4124. "smallint",
  4125. "time",
  4126. "timestamp",
  4127. "varchar",
  4128. "varying",
  4129. // modifier (character varying)
  4130. "varbinary"
  4131. ], s = [
  4132. "add",
  4133. "asc",
  4134. "collation",
  4135. "desc",
  4136. "final",
  4137. "first",
  4138. "last",
  4139. "view"
  4140. ], a = [
  4141. "abs",
  4142. "acos",
  4143. "all",
  4144. "allocate",
  4145. "alter",
  4146. "and",
  4147. "any",
  4148. "are",
  4149. "array",
  4150. "array_agg",
  4151. "array_max_cardinality",
  4152. "as",
  4153. "asensitive",
  4154. "asin",
  4155. "asymmetric",
  4156. "at",
  4157. "atan",
  4158. "atomic",
  4159. "authorization",
  4160. "avg",
  4161. "begin",
  4162. "begin_frame",
  4163. "begin_partition",
  4164. "between",
  4165. "bigint",
  4166. "binary",
  4167. "blob",
  4168. "boolean",
  4169. "both",
  4170. "by",
  4171. "call",
  4172. "called",
  4173. "cardinality",
  4174. "cascaded",
  4175. "case",
  4176. "cast",
  4177. "ceil",
  4178. "ceiling",
  4179. "char",
  4180. "char_length",
  4181. "character",
  4182. "character_length",
  4183. "check",
  4184. "classifier",
  4185. "clob",
  4186. "close",
  4187. "coalesce",
  4188. "collate",
  4189. "collect",
  4190. "column",
  4191. "commit",
  4192. "condition",
  4193. "connect",
  4194. "constraint",
  4195. "contains",
  4196. "convert",
  4197. "copy",
  4198. "corr",
  4199. "corresponding",
  4200. "cos",
  4201. "cosh",
  4202. "count",
  4203. "covar_pop",
  4204. "covar_samp",
  4205. "create",
  4206. "cross",
  4207. "cube",
  4208. "cume_dist",
  4209. "current",
  4210. "current_catalog",
  4211. "current_date",
  4212. "current_default_transform_group",
  4213. "current_path",
  4214. "current_role",
  4215. "current_row",
  4216. "current_schema",
  4217. "current_time",
  4218. "current_timestamp",
  4219. "current_path",
  4220. "current_role",
  4221. "current_transform_group_for_type",
  4222. "current_user",
  4223. "cursor",
  4224. "cycle",
  4225. "date",
  4226. "day",
  4227. "deallocate",
  4228. "dec",
  4229. "decimal",
  4230. "decfloat",
  4231. "declare",
  4232. "default",
  4233. "define",
  4234. "delete",
  4235. "dense_rank",
  4236. "deref",
  4237. "describe",
  4238. "deterministic",
  4239. "disconnect",
  4240. "distinct",
  4241. "double",
  4242. "drop",
  4243. "dynamic",
  4244. "each",
  4245. "element",
  4246. "else",
  4247. "empty",
  4248. "end",
  4249. "end_frame",
  4250. "end_partition",
  4251. "end-exec",
  4252. "equals",
  4253. "escape",
  4254. "every",
  4255. "except",
  4256. "exec",
  4257. "execute",
  4258. "exists",
  4259. "exp",
  4260. "external",
  4261. "extract",
  4262. "false",
  4263. "fetch",
  4264. "filter",
  4265. "first_value",
  4266. "float",
  4267. "floor",
  4268. "for",
  4269. "foreign",
  4270. "frame_row",
  4271. "free",
  4272. "from",
  4273. "full",
  4274. "function",
  4275. "fusion",
  4276. "get",
  4277. "global",
  4278. "grant",
  4279. "group",
  4280. "grouping",
  4281. "groups",
  4282. "having",
  4283. "hold",
  4284. "hour",
  4285. "identity",
  4286. "in",
  4287. "indicator",
  4288. "initial",
  4289. "inner",
  4290. "inout",
  4291. "insensitive",
  4292. "insert",
  4293. "int",
  4294. "integer",
  4295. "intersect",
  4296. "intersection",
  4297. "interval",
  4298. "into",
  4299. "is",
  4300. "join",
  4301. "json_array",
  4302. "json_arrayagg",
  4303. "json_exists",
  4304. "json_object",
  4305. "json_objectagg",
  4306. "json_query",
  4307. "json_table",
  4308. "json_table_primitive",
  4309. "json_value",
  4310. "lag",
  4311. "language",
  4312. "large",
  4313. "last_value",
  4314. "lateral",
  4315. "lead",
  4316. "leading",
  4317. "left",
  4318. "like",
  4319. "like_regex",
  4320. "listagg",
  4321. "ln",
  4322. "local",
  4323. "localtime",
  4324. "localtimestamp",
  4325. "log",
  4326. "log10",
  4327. "lower",
  4328. "match",
  4329. "match_number",
  4330. "match_recognize",
  4331. "matches",
  4332. "max",
  4333. "member",
  4334. "merge",
  4335. "method",
  4336. "min",
  4337. "minute",
  4338. "mod",
  4339. "modifies",
  4340. "module",
  4341. "month",
  4342. "multiset",
  4343. "national",
  4344. "natural",
  4345. "nchar",
  4346. "nclob",
  4347. "new",
  4348. "no",
  4349. "none",
  4350. "normalize",
  4351. "not",
  4352. "nth_value",
  4353. "ntile",
  4354. "null",
  4355. "nullif",
  4356. "numeric",
  4357. "octet_length",
  4358. "occurrences_regex",
  4359. "of",
  4360. "offset",
  4361. "old",
  4362. "omit",
  4363. "on",
  4364. "one",
  4365. "only",
  4366. "open",
  4367. "or",
  4368. "order",
  4369. "out",
  4370. "outer",
  4371. "over",
  4372. "overlaps",
  4373. "overlay",
  4374. "parameter",
  4375. "partition",
  4376. "pattern",
  4377. "per",
  4378. "percent",
  4379. "percent_rank",
  4380. "percentile_cont",
  4381. "percentile_disc",
  4382. "period",
  4383. "portion",
  4384. "position",
  4385. "position_regex",
  4386. "power",
  4387. "precedes",
  4388. "precision",
  4389. "prepare",
  4390. "primary",
  4391. "procedure",
  4392. "ptf",
  4393. "range",
  4394. "rank",
  4395. "reads",
  4396. "real",
  4397. "recursive",
  4398. "ref",
  4399. "references",
  4400. "referencing",
  4401. "regr_avgx",
  4402. "regr_avgy",
  4403. "regr_count",
  4404. "regr_intercept",
  4405. "regr_r2",
  4406. "regr_slope",
  4407. "regr_sxx",
  4408. "regr_sxy",
  4409. "regr_syy",
  4410. "release",
  4411. "result",
  4412. "return",
  4413. "returns",
  4414. "revoke",
  4415. "right",
  4416. "rollback",
  4417. "rollup",
  4418. "row",
  4419. "row_number",
  4420. "rows",
  4421. "running",
  4422. "savepoint",
  4423. "scope",
  4424. "scroll",
  4425. "search",
  4426. "second",
  4427. "seek",
  4428. "select",
  4429. "sensitive",
  4430. "session_user",
  4431. "set",
  4432. "show",
  4433. "similar",
  4434. "sin",
  4435. "sinh",
  4436. "skip",
  4437. "smallint",
  4438. "some",
  4439. "specific",
  4440. "specifictype",
  4441. "sql",
  4442. "sqlexception",
  4443. "sqlstate",
  4444. "sqlwarning",
  4445. "sqrt",
  4446. "start",
  4447. "static",
  4448. "stddev_pop",
  4449. "stddev_samp",
  4450. "submultiset",
  4451. "subset",
  4452. "substring",
  4453. "substring_regex",
  4454. "succeeds",
  4455. "sum",
  4456. "symmetric",
  4457. "system",
  4458. "system_time",
  4459. "system_user",
  4460. "table",
  4461. "tablesample",
  4462. "tan",
  4463. "tanh",
  4464. "then",
  4465. "time",
  4466. "timestamp",
  4467. "timezone_hour",
  4468. "timezone_minute",
  4469. "to",
  4470. "trailing",
  4471. "translate",
  4472. "translate_regex",
  4473. "translation",
  4474. "treat",
  4475. "trigger",
  4476. "trim",
  4477. "trim_array",
  4478. "true",
  4479. "truncate",
  4480. "uescape",
  4481. "union",
  4482. "unique",
  4483. "unknown",
  4484. "unnest",
  4485. "update",
  4486. "upper",
  4487. "user",
  4488. "using",
  4489. "value",
  4490. "values",
  4491. "value_of",
  4492. "var_pop",
  4493. "var_samp",
  4494. "varbinary",
  4495. "varchar",
  4496. "varying",
  4497. "versioning",
  4498. "when",
  4499. "whenever",
  4500. "where",
  4501. "width_bucket",
  4502. "window",
  4503. "with",
  4504. "within",
  4505. "without",
  4506. "year"
  4507. ], o = [
  4508. "abs",
  4509. "acos",
  4510. "array_agg",
  4511. "asin",
  4512. "atan",
  4513. "avg",
  4514. "cast",
  4515. "ceil",
  4516. "ceiling",
  4517. "coalesce",
  4518. "corr",
  4519. "cos",
  4520. "cosh",
  4521. "count",
  4522. "covar_pop",
  4523. "covar_samp",
  4524. "cume_dist",
  4525. "dense_rank",
  4526. "deref",
  4527. "element",
  4528. "exp",
  4529. "extract",
  4530. "first_value",
  4531. "floor",
  4532. "json_array",
  4533. "json_arrayagg",
  4534. "json_exists",
  4535. "json_object",
  4536. "json_objectagg",
  4537. "json_query",
  4538. "json_table",
  4539. "json_table_primitive",
  4540. "json_value",
  4541. "lag",
  4542. "last_value",
  4543. "lead",
  4544. "listagg",
  4545. "ln",
  4546. "log",
  4547. "log10",
  4548. "lower",
  4549. "max",
  4550. "min",
  4551. "mod",
  4552. "nth_value",
  4553. "ntile",
  4554. "nullif",
  4555. "percent_rank",
  4556. "percentile_cont",
  4557. "percentile_disc",
  4558. "position",
  4559. "position_regex",
  4560. "power",
  4561. "rank",
  4562. "regr_avgx",
  4563. "regr_avgy",
  4564. "regr_count",
  4565. "regr_intercept",
  4566. "regr_r2",
  4567. "regr_slope",
  4568. "regr_sxx",
  4569. "regr_sxy",
  4570. "regr_syy",
  4571. "row_number",
  4572. "sin",
  4573. "sinh",
  4574. "sqrt",
  4575. "stddev_pop",
  4576. "stddev_samp",
  4577. "substring",
  4578. "substring_regex",
  4579. "sum",
  4580. "tan",
  4581. "tanh",
  4582. "translate",
  4583. "translate_regex",
  4584. "treat",
  4585. "trim",
  4586. "trim_array",
  4587. "unnest",
  4588. "upper",
  4589. "value_of",
  4590. "var_pop",
  4591. "var_samp",
  4592. "width_bucket"
  4593. ], c = [
  4594. "current_catalog",
  4595. "current_date",
  4596. "current_default_transform_group",
  4597. "current_path",
  4598. "current_role",
  4599. "current_schema",
  4600. "current_transform_group_for_type",
  4601. "current_user",
  4602. "session_user",
  4603. "system_time",
  4604. "system_user",
  4605. "current_time",
  4606. "localtime",
  4607. "current_timestamp",
  4608. "localtimestamp"
  4609. ], u = [
  4610. "create table",
  4611. "insert into",
  4612. "primary key",
  4613. "foreign key",
  4614. "not null",
  4615. "alter table",
  4616. "add constraint",
  4617. "grouping sets",
  4618. "on overflow",
  4619. "character set",
  4620. "respect nulls",
  4621. "ignore nulls",
  4622. "nulls first",
  4623. "nulls last",
  4624. "depth first",
  4625. "breadth first"
  4626. ], d = o, h = [
  4627. ...a,
  4628. ...s
  4629. ].filter((v) => !o.includes(v)), p = {
  4630. className: "variable",
  4631. begin: /@[a-z0-9][a-z0-9_]*/
  4632. }, _ = {
  4633. className: "operator",
  4634. begin: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
  4635. relevance: 0
  4636. }, E = {
  4637. begin: r.concat(/\b/, r.either(...d), /\s*\(/),
  4638. relevance: 0,
  4639. keywords: { built_in: d }
  4640. };
  4641. function m(v, {
  4642. exceptions: A,
  4643. when: D
  4644. } = {}) {
  4645. const S = D;
  4646. return A = A || [], v.map((M) => M.match(/\|\d+$/) || A.includes(M) ? M : S(M) ? `${M}|0` : M);
  4647. }
  4648. return {
  4649. name: "SQL",
  4650. case_insensitive: true,
  4651. // does not include {} or HTML tags `</`
  4652. illegal: /[{}]|<\//,
  4653. keywords: {
  4654. $pattern: /\b[\w\.]+/,
  4655. keyword: m(h, { when: (v) => v.length < 3 }),
  4656. literal: n,
  4657. type: i,
  4658. built_in: c
  4659. },
  4660. contains: [
  4661. {
  4662. begin: r.either(...u),
  4663. relevance: 0,
  4664. keywords: {
  4665. $pattern: /[\w\.]+/,
  4666. keyword: h.concat(u),
  4667. literal: n,
  4668. type: i
  4669. }
  4670. },
  4671. {
  4672. className: "type",
  4673. begin: r.either(...t)
  4674. },
  4675. E,
  4676. p,
  4677. f,
  4678. g,
  4679. e.C_NUMBER_MODE,
  4680. e.C_BLOCK_COMMENT_MODE,
  4681. l,
  4682. _
  4683. ]
  4684. };
  4685. }
  4686. q.registerLanguage("xml", Vt);
  4687. q.registerLanguage("javascript", nr);
  4688. q.registerLanguage("json", tr);
  4689. q.registerLanguage("yaml", rr);
  4690. q.registerLanguage("plaintext", ir);
  4691. q.registerLanguage("python", sr);
  4692. q.registerLanguage("java", ar);
  4693. q.registerLanguage("bash", or);
  4694. q.registerLanguage("sql", lr);
  4695. var y = ((e) => (e.EQUAL = "equal", e.DELETE = "removed", e.ADD = "added", e.EMPTY = "empty", e))(y || {});
  4696. var ie = "<code-diff-modified>";
  4697. var se = "</code-diff-modified>";
  4698. var cr = ie.replace("<", "&lt;").replace(">", "&gt;");
  4699. var ur = se.replace("<", "&lt;").replace(">", "&gt;");
  4700. function be(e) {
  4701. return e === void 0 ? y.EQUAL : e.added ? y.ADD : e.removed ? y.DELETE : y.EQUAL;
  4702. }
  4703. function Be(e, r, l = "word") {
  4704. return typeof e == "undefined" ? r : typeof r == "undefined" ? e : (l === "char" ? Vn : qn)(e, r).filter((g) => be(g) !== y.DELETE).map(
  4705. (g) => be(g) === y.ADD ? `${ie}${g.value}${se}` : g.value
  4706. ).join("");
  4707. }
  4708. function Bn(e, r) {
  4709. const l = new Fe.diff_match_patch(), f = l.diff_linesToChars_(e, r), g = f.chars1, n = f.chars2, t = f.lineArray, i = l.diff_main(g, n, false);
  4710. return l.diff_charsToLines_(i, t), i.map((s) => {
  4711. const [a, o] = s;
  4712. return {
  4713. count: o.replace(/\n$/, "").split(`
  4714. `).length,
  4715. value: o,
  4716. removed: a === Fe.DIFF_DELETE,
  4717. added: a === Fe.DIFF_INSERT
  4718. };
  4719. });
  4720. }
  4721. function j(e, r) {
  4722. if (!r.match(new RegExp(`(${ie}|${se})`, "g")))
  4723. return q.highlight(r, { language: e }).value;
  4724. let f = r;
  4725. const g = r.replace(new RegExp(`(${ie}|${se})`, "g"), ""), n = document.createElement("div");
  4726. n.innerHTML = q.highlight(g, { language: e }).value;
  4727. let t = false;
  4728. const i = (s) => {
  4729. s.childNodes.forEach((a) => {
  4730. if (a.nodeType === Node.ELEMENT_NODE && i(a), a.nodeType === Node.TEXT_NODE) {
  4731. if (!a.textContent)
  4732. return;
  4733. let o = a.textContent, c = "";
  4734. for (t && (c = c + ie); o.length; ) {
  4735. if (f.startsWith(ie)) {
  4736. f = f.slice(ie.length), c = c + ie, t = true;
  4737. continue;
  4738. }
  4739. if (f.startsWith(se)) {
  4740. f = f.slice(se.length), c = c + se, t = false;
  4741. continue;
  4742. }
  4743. const u = f.match(new RegExp(`(${ie}|${se})`)), d = u && u.index ? u.index : f.length, h = Math.min(d, o.length);
  4744. c = c + f.substring(0, h), f = f.slice(h), o = o.slice(h);
  4745. }
  4746. t && (c = c + se), a.textContent = c;
  4747. }
  4748. });
  4749. };
  4750. return i(n), n.innerHTML.replace(new RegExp(cr, "g"), '<span class="x">').replace(new RegExp(ur, "g"), "</span>");
  4751. }
  4752. function $n(e, r) {
  4753. const l = (s, a) => (s.match(new RegExp(a, "g")) || []).length, f = (s) => s.filter((a) => r == null ? void 0 : r.test(a)).length;
  4754. let g = 0, n = 0, t = 0, i = 0;
  4755. for (const s of e) {
  4756. if (s.added) {
  4757. const a = f(s.value.trim().split(`
  4758. `));
  4759. g += l(s.value.trim(), `
  4760. `) + 1 - a, t += a;
  4761. continue;
  4762. }
  4763. if (s.removed) {
  4764. const a = f(s.value.trim().split(`
  4765. `));
  4766. n += l(s.value.trim(), `
  4767. `) + 1 - a, i += a;
  4768. continue;
  4769. }
  4770. }
  4771. return {
  4772. additionsNum: g,
  4773. deletionsNum: n,
  4774. ignoreAdditionsNum: t,
  4775. ignoreDeletionsNum: i
  4776. };
  4777. }
  4778. function fr(e, r, l = "plaintext", f = "word", g = false, n = 10, t) {
  4779. const i = () => ({ type: y.EMPTY }), s = (m, v, A) => ({ type: m, num: v, code: A }), a = Bn(e, r), o = t ? new RegExp(t) : void 0;
  4780. let c = 0, u = 0, d = false;
  4781. const h = [], p = {
  4782. changes: h,
  4783. collector: [],
  4784. stat: $n(a, o)
  4785. };
  4786. for (let m = 0; m < a.length; m++) {
  4787. if (d) {
  4788. d = false;
  4789. continue;
  4790. }
  4791. const [v, A] = [a[m], a[m + 1]], [D, S] = [be(v), be(A)], M = v.value.replace(/\n$/, "").split(`
  4792. `);
  4793. if (A === void 0) {
  4794. for (const L of M) {
  4795. let I = i(), P = i();
  4796. const $ = j(l, L);
  4797. D === y.EQUAL && (c++, u++, I = s(y.EQUAL, c, $), P = s(y.EQUAL, u, $)), D === y.DELETE && (c++, I = s(y.DELETE, c, $), P = i()), D === y.ADD && (u++, I = i(), P = s(y.ADD, u, $)), h.push({ left: I, right: P });
  4798. }
  4799. break;
  4800. }
  4801. if (D === y.EQUAL)
  4802. for (const L of M) {
  4803. c++, u++;
  4804. const I = j(l, L);
  4805. h.push({
  4806. left: s(y.EQUAL, c, I),
  4807. right: s(y.EQUAL, u, I)
  4808. });
  4809. }
  4810. const R = A.value.replace(/\n$/, "").split(`
  4811. `);
  4812. if (D === y.DELETE) {
  4813. if (S === y.EQUAL)
  4814. for (const L of M)
  4815. c++, h.push({
  4816. left: s(y.DELETE, c, j(l, L)),
  4817. right: i()
  4818. });
  4819. if (S === y.ADD) {
  4820. d = true;
  4821. const L = Math.max(v.count, A.count);
  4822. for (let I = 0; I < L; I++) {
  4823. I < v.count && c++, I < A.count && u++;
  4824. const [P, $] = [M[I], R[I]], K = g || M.length === R.length, Y = K ? Be($, P, f) : P, oe = K ? Be(P, $, f) : $, ge = o != null && o.test(P) ? y.EQUAL : y.DELETE, b = o != null && o.test($) ? y.EQUAL : y.ADD, N = I < v.count ? s(ge, c, j(l, Y)) : i(), O = I < A.count ? s(b, u, j(l, oe)) : i();
  4825. h.push({ left: N, right: O });
  4826. }
  4827. }
  4828. }
  4829. if (D === y.ADD)
  4830. for (const L of M)
  4831. u++, h.push({
  4832. left: i(),
  4833. right: s(y.ADD, u, j(l, L))
  4834. });
  4835. }
  4836. if (e === r) {
  4837. for (let m = 0; m < h.length; m++)
  4838. h[m].fold = false;
  4839. return p;
  4840. }
  4841. for (let m = 0; m < h.length; m++) {
  4842. const v = h[m];
  4843. if (v.left.type === y.DELETE || v.right.type === y.ADD) {
  4844. const [A, D] = [Math.max(m - n, 0), Math.min(m + n + 1, h.length)];
  4845. for (let S = A; S < D; S++)
  4846. h[S].fold = false;
  4847. }
  4848. v.fold === void 0 && (v.fold = true);
  4849. }
  4850. const _ = [];
  4851. let E = [];
  4852. for (let m = 0; m < h.length; m++) {
  4853. const v = h[m];
  4854. if (v.fold === false) {
  4855. E.length && (E[0].hideIndex = p.collector.length, p.collector.push({
  4856. lines: E,
  4857. fold: true
  4858. }), E = []), _.push(v);
  4859. continue;
  4860. }
  4861. v.hide = true, E.push(v), _.push(v);
  4862. }
  4863. return E.length && (E[0].hideIndex = p.collector.length, p.collector.push({
  4864. lines: E,
  4865. fold: true
  4866. }), E = []), p.changes = _, p;
  4867. }
  4868. function gr(e, r, l = "plaintext", f = "word", g = false, n = 10, t) {
  4869. const i = Bn(e, r), s = t ? new RegExp(t) : void 0;
  4870. let a = 0, o = 0, c = false;
  4871. const u = [], d = {
  4872. changes: u,
  4873. collector: [],
  4874. stat: $n(i, s)
  4875. };
  4876. for (let _ = 0; _ < i.length; _++) {
  4877. if (c) {
  4878. c = false;
  4879. continue;
  4880. }
  4881. const [E, m] = [i[_], i[_ + 1]], [v, A] = [be(E), be(m)], D = E.value.replace(/\n$/, "").split(`
  4882. `);
  4883. if (m === void 0) {
  4884. for (const M of D) {
  4885. v === y.EQUAL && (a++, o++), v === y.DELETE && a++, v === y.ADD && o++;
  4886. const R = j(l, M);
  4887. u.push({
  4888. type: v,
  4889. code: R,
  4890. addNum: v === y.DELETE ? void 0 : o,
  4891. delNum: v === y.ADD ? void 0 : a
  4892. });
  4893. }
  4894. break;
  4895. }
  4896. if (v === y.EQUAL)
  4897. for (const M of D) {
  4898. a++, o++;
  4899. const R = j(l, M);
  4900. u.push({ type: y.EQUAL, code: R, delNum: a, addNum: o });
  4901. }
  4902. const S = m.value.replace(/\n$/, "").split(`
  4903. `);
  4904. if (v === y.DELETE)
  4905. if (A === y.ADD && (D.length === S.length || g)) {
  4906. for (let M = 0; M < D.length; M++) {
  4907. const R = D[M], L = S[M];
  4908. a++;
  4909. const I = j(l, Be(L, R, f));
  4910. u.push({
  4911. type: s != null && s.test(R) ? y.EQUAL : y.DELETE,
  4912. code: I,
  4913. delNum: a
  4914. });
  4915. }
  4916. for (let M = 0; M < S.length; M++) {
  4917. const R = D[M], L = S[M];
  4918. o++;
  4919. const I = j(l, Be(R, L, f));
  4920. u.push({
  4921. type: s != null && s.test(L) ? y.EQUAL : y.ADD,
  4922. code: I,
  4923. addNum: o
  4924. });
  4925. }
  4926. c = true;
  4927. } else
  4928. for (const M of D) {
  4929. a++;
  4930. const R = j(l, M);
  4931. u.push({ type: y.DELETE, code: R, delNum: a });
  4932. }
  4933. if (v === y.ADD)
  4934. for (const M of D) {
  4935. o++;
  4936. const R = j(l, M);
  4937. u.push({ type: y.ADD, code: R, addNum: o });
  4938. }
  4939. }
  4940. for (let _ = 0; _ < u.length; _++) {
  4941. const E = u[_];
  4942. if (E.type === y.DELETE || E.type === y.ADD) {
  4943. const [m, v] = [Math.max(_ - n, 0), Math.min(_ + n + 1, u.length)];
  4944. for (let A = m; A < v; A++)
  4945. u[A].fold = false;
  4946. }
  4947. E.fold === void 0 && (E.fold = true);
  4948. }
  4949. if (e === r) {
  4950. for (let _ = 0; _ < u.length; _++)
  4951. u[_].fold = false;
  4952. return d;
  4953. }
  4954. const h = [];
  4955. let p = [];
  4956. for (let _ = 0; _ < u.length; _++) {
  4957. const E = u[_];
  4958. if (E.fold === false) {
  4959. p.length && (p[0].hideIndex = d.collector.length, d.collector.push({
  4960. lines: p,
  4961. fold: true
  4962. }), p = []), h.push(E);
  4963. continue;
  4964. }
  4965. E.type === "equal" && (E.hide = true, p.push(E)), h.push(E);
  4966. }
  4967. return p.length && (p[0].hideIndex = d.collector.length, d.collector.push({
  4968. lines: p,
  4969. fold: true
  4970. }), p = []), d.changes = h, d;
  4971. }
  4972. var hr = { key: 0 };
  4973. var dr = createBaseVNode("td", {
  4974. class: "blob-code blob-code-hunk",
  4975. align: "left"
  4976. }, " ⋯ ", -1);
  4977. var pr = { key: 1 };
  4978. var _r = ["data-code-marker", "innerHTML"];
  4979. var br = defineComponent({
  4980. __name: "UnifiedLine",
  4981. props: {
  4982. line: {}
  4983. },
  4984. emits: ["expand"],
  4985. setup(e, { emit: r }) {
  4986. const l = r;
  4987. function f(g) {
  4988. return g === y.DELETE ? "-" : g === y.ADD ? "+" : "";
  4989. }
  4990. return (g, n) => g.line.hideIndex !== void 0 && g.line.hide ? (openBlock(), createElementBlock("tr", hr, [
  4991. createBaseVNode("td", {
  4992. class: "blob-num blob-num-hunk text-center",
  4993. colspan: "2",
  4994. onClick: n[0] || (n[0] = (t) => l("expand", g.line))
  4995. }, " > "),
  4996. dr
  4997. ])) : g.line.hide ? createCommentVNode("", true) : (openBlock(), createElementBlock("tr", pr, [
  4998. createBaseVNode("td", {
  4999. class: normalizeClass(["blob-num", {
  5000. "blob-num-deletion": g.line.type === unref(y).DELETE,
  5001. "blob-num-addition": g.line.type === unref(y).ADD,
  5002. "blob-num-context": g.line.type === unref(y).EQUAL,
  5003. "blob-num-hunk": g.line.hide !== void 0
  5004. }])
  5005. }, toDisplayString(g.line.delNum), 3),
  5006. createBaseVNode("td", {
  5007. class: normalizeClass(["blob-num", {
  5008. "blob-num-deletion": g.line.type === unref(y).DELETE,
  5009. "blob-num-addition": g.line.type === unref(y).ADD,
  5010. "blob-num-context": g.line.type === unref(y).EQUAL,
  5011. "blob-num-hunk": g.line.hide !== void 0
  5012. }])
  5013. }, toDisplayString(g.line.addNum), 3),
  5014. createBaseVNode("td", {
  5015. class: normalizeClass(["blob-code", {
  5016. "blob-code-deletion": g.line.type === unref(y).DELETE,
  5017. "blob-code-addition": g.line.type === unref(y).ADD,
  5018. "blob-code-context": g.line.type === unref(y).EQUAL,
  5019. "blob-code-hunk": g.line.hide !== void 0
  5020. }])
  5021. }, [
  5022. createBaseVNode("span", {
  5023. class: "blob-code-inner blob-code-marker",
  5024. "data-code-marker": f(g.line.type),
  5025. innerHTML: g.line.code
  5026. }, null, 8, _r)
  5027. ], 2)
  5028. ]));
  5029. }
  5030. });
  5031. var Er = { class: "diff-table" };
  5032. var mr = defineComponent({
  5033. __name: "UnifiedViewer",
  5034. props: {
  5035. diffChange: {}
  5036. },
  5037. setup(e) {
  5038. const r = e;
  5039. function l({ hideIndex: f }) {
  5040. f !== void 0 && r.diffChange.collector[f].lines.forEach((g) => {
  5041. g.hide = false, g.fold = false;
  5042. });
  5043. }
  5044. return (f, g) => {
  5045. var n;
  5046. return openBlock(), createElementBlock("table", Er, [
  5047. createBaseVNode("tbody", null, [
  5048. (openBlock(true), createElementBlock(Fragment, null, renderList((n = f.diffChange) == null ? void 0 : n.changes, (t, i) => (openBlock(), createBlock(br, {
  5049. key: i,
  5050. line: t,
  5051. onExpand: l
  5052. }, null, 8, ["line"]))), 128))
  5053. ])
  5054. ]);
  5055. };
  5056. }
  5057. });
  5058. var vr = { key: 0 };
  5059. var wr = createBaseVNode("td", {
  5060. class: "blob-code blob-code-inner blob-code-hunk",
  5061. colspan: "3",
  5062. align: "left"
  5063. }, " ⋯ ", -1);
  5064. var yr = { key: 1 };
  5065. var Nr = createBaseVNode("td", { class: "blob-num blob-num-empty empty-cell" }, null, -1);
  5066. var Ar = createBaseVNode("td", { class: "blob-code blob-code-empty empty-cell" }, null, -1);
  5067. var Mr = ["onMousedown"];
  5068. var Tr = ["data-code-marker", "innerHTML"];
  5069. var Sr = defineComponent({
  5070. __name: "SplitLine",
  5071. props: {
  5072. splitLine: {}
  5073. },
  5074. emits: ["expand"],
  5075. setup(e, { emit: r }) {
  5076. const l = r;
  5077. function f(n) {
  5078. return n === y.DELETE ? "-" : n === y.ADD ? "+" : "";
  5079. }
  5080. function g(n) {
  5081. window.getSelection().removeAllRanges();
  5082. const t = document.querySelectorAll(".file-diff-split .split-side-left"), i = document.querySelectorAll(".file-diff-split .split-side-right");
  5083. for (const s of i)
  5084. s.classList.toggle("no-select", n === "left");
  5085. for (const s of t)
  5086. s.classList.toggle("no-select", n === "right");
  5087. }
  5088. return (n, t) => n.splitLine.hideIndex !== void 0 && n.splitLine.hide ? (openBlock(), createElementBlock("tr", vr, [
  5089. createBaseVNode("td", {
  5090. class: "blob-num blob-num-hunk",
  5091. colspan: "1",
  5092. onClick: t[0] || (t[0] = (i) => l("expand", n.splitLine))
  5093. }, " > "),
  5094. wr
  5095. ])) : n.splitLine.hide ? createCommentVNode("", true) : (openBlock(), createElementBlock("tr", yr, [
  5096. (openBlock(true), createElementBlock(Fragment, null, renderList([n.splitLine.left, n.splitLine.right], (i, s) => (openBlock(), createElementBlock(Fragment, null, [
  5097. i.type === unref(y).EMPTY ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  5098. Nr,
  5099. Ar
  5100. ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
  5101. createBaseVNode("td", {
  5102. class: normalizeClass(["blob-num", {
  5103. "blob-num-deletion": i.type === unref(y).DELETE,
  5104. "blob-num-addition": i.type === unref(y).ADD,
  5105. "blob-num-context": i.type === unref(y).EQUAL,
  5106. "blob-num-hunk": n.splitLine.hide !== void 0
  5107. }])
  5108. }, toDisplayString(i.num), 3),
  5109. createBaseVNode("td", {
  5110. class: normalizeClass(["blob-code", {
  5111. "blob-code-deletion": i.type === unref(y).DELETE,
  5112. "blob-code-addition": i.type === unref(y).ADD,
  5113. "blob-code-context": i.type === unref(y).EQUAL,
  5114. "blob-code-hunk": n.splitLine.hide !== void 0,
  5115. "split-side-left": s === 0,
  5116. "split-side-right": s === 1
  5117. }]),
  5118. onMousedown: (a) => g(s === 0 ? "left" : "right")
  5119. }, [
  5120. createBaseVNode("span", {
  5121. class: "blob-code-inner blob-code-marker",
  5122. "data-code-marker": f(i.type),
  5123. innerHTML: i.code
  5124. }, null, 8, Tr)
  5125. ], 42, Mr)
  5126. ], 64))
  5127. ], 64))), 256))
  5128. ]));
  5129. }
  5130. });
  5131. var Dr = { class: "file-diff-split diff-table" };
  5132. var Lr = createBaseVNode("colgroup", null, [
  5133. createBaseVNode("col", { width: "44" }),
  5134. createBaseVNode("col"),
  5135. createBaseVNode("col", { width: "44" }),
  5136. createBaseVNode("col")
  5137. ], -1);
  5138. var Rr = defineComponent({
  5139. __name: "SplitViewer",
  5140. props: {
  5141. diffChange: {}
  5142. },
  5143. setup(e) {
  5144. const r = e;
  5145. function l({ hideIndex: f }) {
  5146. f !== void 0 && r.diffChange.collector[f].lines.forEach((g) => {
  5147. g.hide = false, g.fold = false;
  5148. });
  5149. }
  5150. return (f, g) => {
  5151. var n;
  5152. return openBlock(), createElementBlock("table", Dr, [
  5153. Lr,
  5154. createBaseVNode("tbody", null, [
  5155. (openBlock(true), createElementBlock(Fragment, null, renderList((n = f.diffChange) == null ? void 0 : n.changes, (t, i) => (openBlock(), createBlock(Sr, {
  5156. key: i,
  5157. "split-line": t,
  5158. onExpand: l
  5159. }, null, 8, ["split-line"]))), 128))
  5160. ])
  5161. ]);
  5162. };
  5163. }
  5164. });
  5165. var Pn = (e, r) => {
  5166. const l = e.__vccOpts || e;
  5167. for (const [f, g] of r)
  5168. l[f] = g;
  5169. return l;
  5170. };
  5171. var Or = {
  5172. name: "DownArrowIcon"
  5173. };
  5174. var Cr = {
  5175. width: "1rem",
  5176. viewBox: "0 0 512 512",
  5177. xmlns: "http://www.w3.org/2000/svg"
  5178. };
  5179. var Ir = createBaseVNode("path", { d: "M383.6,322.7L278.6,423c-5.8,6-13.7,9-22.4,9c-8.7,0-16.5-3-22.4-9L128.4,322.7c-12.5-11.9-12.5-31.3,0-43.2 c12.5-11.9,32.7-11.9,45.2,0l50.4,48.2v-217c0-16.9,14.3-30.6,32-30.6c17.7,0,32,13.7,32,30.6v217l50.4-48.2 c12.5-11.9,32.7-11.9,45.2,0C396.1,291.4,396.1,310.7,383.6,322.7z" }, null, -1);
  5180. var kr = [
  5181. Ir
  5182. ];
  5183. function Br(e, r, l, f, g, n) {
  5184. return openBlock(), createElementBlock("svg", Cr, kr);
  5185. }
  5186. var pn = Pn(Or, [["render", Br]]);
  5187. var $r = {
  5188. name: "UpArrowIcon"
  5189. };
  5190. var Pr = {
  5191. width: "1rem",
  5192. viewBox: "0 0 512 512",
  5193. xmlns: "http://www.w3.org/2000/svg"
  5194. };
  5195. var Ur = createBaseVNode("path", { d: "M128.4,189.3L233.4,89c5.8-6,13.7-9,22.4-9c8.7,0,16.5,3,22.4,9l105.4,100.3c12.5,11.9,12.5,31.3,0,43.2 c-12.5,11.9-32.7,11.9-45.2,0L288,184.4v217c0,16.9-14.3,30.6-32,30.6c-17.7,0-32-13.7-32-30.6v-217l-50.4,48.2 c-12.5,11.9-32.7,11.9-45.2,0C115.9,220.6,115.9,201.3,128.4,189.3z" }, null, -1);
  5196. var Hr = [
  5197. Ur
  5198. ];
  5199. function Fr(e, r, l, f, g, n) {
  5200. return openBlock(), createElementBlock("svg", Pr, Hr);
  5201. }
  5202. var _n = Pn($r, [["render", Fr]]);
  5203. var zr = ["theme"];
  5204. var xr = {
  5205. key: 0,
  5206. class: "file-header"
  5207. };
  5208. var Gr = {
  5209. key: 0,
  5210. class: "file-info"
  5211. };
  5212. var Kr = { class: "info-left" };
  5213. var Wr = { class: "info-left" };
  5214. var Qr = { class: "diff-commandbar" };
  5215. var Zr = {
  5216. key: 0,
  5217. class: "diff-stat"
  5218. };
  5219. var Yr = { class: "diff-stat-added" };
  5220. var Xr = { class: "diff-stat-deleted" };
  5221. var Vr = {
  5222. key: 1,
  5223. class: "file-info"
  5224. };
  5225. var jr = { class: "info-left" };
  5226. var qr = { class: "info-right" };
  5227. var Jr = { style: { "margin-left": "20px" } };
  5228. var ei = { class: "diff-commandbar" };
  5229. var ni = {
  5230. key: 0,
  5231. class: "diff-stat"
  5232. };
  5233. var ti = { class: "diff-stat-added" };
  5234. var ri = { class: "diff-stat-deleted" };
  5235. var ii = defineComponent({
  5236. __name: "CodeDiff",
  5237. props: {
  5238. newString: {},
  5239. oldString: {},
  5240. language: { default: "plaintext" },
  5241. context: { default: 10 },
  5242. diffStyle: { default: "word" },
  5243. forceInlineComparison: { type: Boolean, default: false },
  5244. outputFormat: { default: "line-by-line" },
  5245. trim: { type: Boolean, default: false },
  5246. noDiffLineFeed: { type: Boolean, default: false },
  5247. maxHeight: { default: void 0 },
  5248. filename: { default: void 0 },
  5249. newFilename: { default: void 0 },
  5250. hideHeader: { type: Boolean, default: false },
  5251. hideStat: { type: Boolean, default: false },
  5252. theme: { default: "light" },
  5253. ignoreMatchingLines: { default: void 0 }
  5254. },
  5255. emits: ["diff"],
  5256. setup(e, { emit: r }) {
  5257. const l = e, f = r, g = computed(() => l.outputFormat === "line-by-line"), n = computed(() => {
  5258. let h = l.oldString || "";
  5259. return h = l.trim ? h.trim() : h, h = l.noDiffLineFeed ? h.replace(/(\r\n)/g, `
  5260. `) : h, h;
  5261. }), t = computed(() => {
  5262. let h = l.newString || "";
  5263. return h = l.trim ? h.trim() : h, h = l.noDiffLineFeed ? h.replace(/(\r\n)/g, `
  5264. `) : h, h;
  5265. }), i = computed(
  5266. () => g.value ? gr(n.value, t.value, l.language, l.diffStyle, l.forceInlineComparison, l.context, l.ignoreMatchingLines) : fr(n.value, t.value, l.language, l.diffStyle, l.forceInlineComparison, l.context, l.ignoreMatchingLines)
  5267. ), s = ref(i.value), a = computed(() => s.value.stat.additionsNum === 0 && s.value.stat.deletionsNum === 0), o = ref(-1);
  5268. function c() {
  5269. const h = document.querySelectorAll(".blob-code-addition");
  5270. o.value < h.length - 1 && (o.value++, d(h));
  5271. }
  5272. function u() {
  5273. const h = document.querySelectorAll(".blob-code-addition");
  5274. o.value > 0 && (o.value--, d(h));
  5275. }
  5276. function d(h) {
  5277. h.forEach((_) => _.classList.remove("current-diff"));
  5278. const p = h[o.value];
  5279. p && (p.classList.add("current-diff"), p.scrollIntoView({ behavior: "smooth", block: "center" }));
  5280. }
  5281. return watch(() => l, () => {
  5282. s.value = i.value, f("diff", {
  5283. stat: {
  5284. isChanged: !a.value,
  5285. addNum: s.value.stat.additionsNum,
  5286. delNum: s.value.stat.deletionsNum
  5287. }
  5288. });
  5289. }, { deep: true, immediate: true }), (h, p) => (openBlock(), createElementBlock("div", {
  5290. class: "code-diff-view",
  5291. theme: h.theme,
  5292. style: normalizeStyle({ maxHeight: h.maxHeight })
  5293. }, [
  5294. h.hideHeader ? createCommentVNode("", true) : (openBlock(), createElementBlock("div", xr, [
  5295. unref(g) ? (openBlock(), createElementBlock("div", Gr, [
  5296. createBaseVNode("span", null, [
  5297. createBaseVNode("div", Kr, toDisplayString(h.filename), 1),
  5298. createBaseVNode("div", Wr, toDisplayString(h.newFilename), 1)
  5299. ]),
  5300. createBaseVNode("span", Qr, [
  5301. createBaseVNode("button", {
  5302. class: "command-item-button",
  5303. title: "Next Change",
  5304. onClick: c
  5305. }, [
  5306. createVNode(pn)
  5307. ]),
  5308. createBaseVNode("button", {
  5309. class: "command-item-button",
  5310. title: "Previous Change",
  5311. onClick: u
  5312. }, [
  5313. createVNode(_n)
  5314. ])
  5315. ]),
  5316. h.hideStat ? createCommentVNode("", true) : (openBlock(), createElementBlock("span", Zr, [
  5317. renderSlot(h.$slots, "stat", {
  5318. stat: unref(s).stat
  5319. }, () => [
  5320. createBaseVNode("span", Yr, "+" + toDisplayString(unref(s).stat.additionsNum) + " additions", 1),
  5321. createBaseVNode("span", Xr, "-" + toDisplayString(unref(s).stat.deletionsNum) + " deletions", 1)
  5322. ])
  5323. ]))
  5324. ])) : (openBlock(), createElementBlock("div", Vr, [
  5325. createBaseVNode("span", jr, toDisplayString(h.filename), 1),
  5326. createBaseVNode("span", qr, [
  5327. createBaseVNode("span", Jr, toDisplayString(h.newFilename), 1),
  5328. createBaseVNode("span", ei, [
  5329. createBaseVNode("button", {
  5330. class: "command-item-button",
  5331. title: "Next Change",
  5332. onClick: c
  5333. }, [
  5334. createVNode(pn)
  5335. ]),
  5336. createBaseVNode("button", {
  5337. class: "command-item-button",
  5338. title: "Previous Change",
  5339. onClick: u
  5340. }, [
  5341. createVNode(_n)
  5342. ])
  5343. ]),
  5344. h.hideStat ? createCommentVNode("", true) : (openBlock(), createElementBlock("span", ni, [
  5345. renderSlot(h.$slots, "stat", {
  5346. stat: unref(s).stat
  5347. }, () => [
  5348. createBaseVNode("span", ti, "+" + toDisplayString(unref(s).stat.additionsNum) + " additions", 1),
  5349. createBaseVNode("span", ri, "-" + toDisplayString(unref(s).stat.deletionsNum) + " deletions", 1)
  5350. ])
  5351. ]))
  5352. ])
  5353. ]))
  5354. ])),
  5355. unref(g) ? (openBlock(), createBlock(mr, {
  5356. key: 1,
  5357. "diff-change": unref(s)
  5358. }, null, 8, ["diff-change"])) : (openBlock(), createBlock(Rr, {
  5359. key: 2,
  5360. "diff-change": unref(s)
  5361. }, null, 8, ["diff-change"]))
  5362. ], 12, zr));
  5363. }
  5364. });
  5365. function si(e) {
  5366. e.component("CodeDiff", ii);
  5367. }
  5368. var oi = {
  5369. install: si,
  5370. hljs: q
  5371. };
  5372. export {
  5373. ii as CodeDiff,
  5374. oi as default,
  5375. q as hljs
  5376. };
  5377. //# sourceMappingURL=v-code-diff.js.map