json.worker.bundle.js 644 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341
  1. (() => {
  2. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/errors.js
  3. var ErrorHandler = class {
  4. constructor() {
  5. this.listeners = [];
  6. this.unexpectedErrorHandler = function(e) {
  7. setTimeout(() => {
  8. if (e.stack) {
  9. throw new Error(e.message + "\n\n" + e.stack);
  10. }
  11. throw e;
  12. }, 0);
  13. };
  14. }
  15. emit(e) {
  16. this.listeners.forEach((listener) => {
  17. listener(e);
  18. });
  19. }
  20. onUnexpectedError(e) {
  21. this.unexpectedErrorHandler(e);
  22. this.emit(e);
  23. }
  24. onUnexpectedExternalError(e) {
  25. this.unexpectedErrorHandler(e);
  26. }
  27. };
  28. var errorHandler = new ErrorHandler();
  29. function onUnexpectedError(e) {
  30. if (!isCancellationError(e)) {
  31. errorHandler.onUnexpectedError(e);
  32. }
  33. return void 0;
  34. }
  35. function transformErrorForSerialization(error) {
  36. if (error instanceof Error) {
  37. let {name, message} = error;
  38. const stack = error.stacktrace || error.stack;
  39. return {
  40. $isError: true,
  41. name,
  42. message,
  43. stack
  44. };
  45. }
  46. return error;
  47. }
  48. var canceledName = "Canceled";
  49. function isCancellationError(error) {
  50. if (error instanceof CancellationError) {
  51. return true;
  52. }
  53. return error instanceof Error && error.name === canceledName && error.message === canceledName;
  54. }
  55. var CancellationError = class extends Error {
  56. constructor() {
  57. super(canceledName);
  58. this.name = this.message;
  59. }
  60. };
  61. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/functional.js
  62. function once(fn) {
  63. const _this = this;
  64. let didCall = false;
  65. let result;
  66. return function() {
  67. if (didCall) {
  68. return result;
  69. }
  70. didCall = true;
  71. result = fn.apply(_this, arguments);
  72. return result;
  73. };
  74. }
  75. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/iterator.js
  76. var Iterable;
  77. (function(Iterable2) {
  78. function is(thing) {
  79. return thing && typeof thing === "object" && typeof thing[Symbol.iterator] === "function";
  80. }
  81. Iterable2.is = is;
  82. const _empty2 = Object.freeze([]);
  83. function empty() {
  84. return _empty2;
  85. }
  86. Iterable2.empty = empty;
  87. function* single(element) {
  88. yield element;
  89. }
  90. Iterable2.single = single;
  91. function from(iterable) {
  92. return iterable || _empty2;
  93. }
  94. Iterable2.from = from;
  95. function isEmpty(iterable) {
  96. return !iterable || iterable[Symbol.iterator]().next().done === true;
  97. }
  98. Iterable2.isEmpty = isEmpty;
  99. function first(iterable) {
  100. return iterable[Symbol.iterator]().next().value;
  101. }
  102. Iterable2.first = first;
  103. function some(iterable, predicate) {
  104. for (const element of iterable) {
  105. if (predicate(element)) {
  106. return true;
  107. }
  108. }
  109. return false;
  110. }
  111. Iterable2.some = some;
  112. function find(iterable, predicate) {
  113. for (const element of iterable) {
  114. if (predicate(element)) {
  115. return element;
  116. }
  117. }
  118. return void 0;
  119. }
  120. Iterable2.find = find;
  121. function* filter(iterable, predicate) {
  122. for (const element of iterable) {
  123. if (predicate(element)) {
  124. yield element;
  125. }
  126. }
  127. }
  128. Iterable2.filter = filter;
  129. function* map(iterable, fn) {
  130. let index = 0;
  131. for (const element of iterable) {
  132. yield fn(element, index++);
  133. }
  134. }
  135. Iterable2.map = map;
  136. function* concat(...iterables) {
  137. for (const iterable of iterables) {
  138. for (const element of iterable) {
  139. yield element;
  140. }
  141. }
  142. }
  143. Iterable2.concat = concat;
  144. function* concatNested(iterables) {
  145. for (const iterable of iterables) {
  146. for (const element of iterable) {
  147. yield element;
  148. }
  149. }
  150. }
  151. Iterable2.concatNested = concatNested;
  152. function reduce(iterable, reducer, initialValue) {
  153. let value = initialValue;
  154. for (const element of iterable) {
  155. value = reducer(value, element);
  156. }
  157. return value;
  158. }
  159. Iterable2.reduce = reduce;
  160. function* slice(arr, from2, to = arr.length) {
  161. if (from2 < 0) {
  162. from2 += arr.length;
  163. }
  164. if (to < 0) {
  165. to += arr.length;
  166. } else if (to > arr.length) {
  167. to = arr.length;
  168. }
  169. for (; from2 < to; from2++) {
  170. yield arr[from2];
  171. }
  172. }
  173. Iterable2.slice = slice;
  174. function consume(iterable, atMost = Number.POSITIVE_INFINITY) {
  175. const consumed = [];
  176. if (atMost === 0) {
  177. return [consumed, iterable];
  178. }
  179. const iterator = iterable[Symbol.iterator]();
  180. for (let i = 0; i < atMost; i++) {
  181. const next = iterator.next();
  182. if (next.done) {
  183. return [consumed, Iterable2.empty()];
  184. }
  185. consumed.push(next.value);
  186. }
  187. return [consumed, {[Symbol.iterator]() {
  188. return iterator;
  189. }}];
  190. }
  191. Iterable2.consume = consume;
  192. function equals3(a2, b, comparator = (at, bt) => at === bt) {
  193. const ai = a2[Symbol.iterator]();
  194. const bi = b[Symbol.iterator]();
  195. while (true) {
  196. const an = ai.next();
  197. const bn = bi.next();
  198. if (an.done !== bn.done) {
  199. return false;
  200. } else if (an.done) {
  201. return true;
  202. } else if (!comparator(an.value, bn.value)) {
  203. return false;
  204. }
  205. }
  206. }
  207. Iterable2.equals = equals3;
  208. })(Iterable || (Iterable = {}));
  209. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/lifecycle.js
  210. var TRACK_DISPOSABLES = false;
  211. var disposableTracker = null;
  212. function setDisposableTracker(tracker) {
  213. disposableTracker = tracker;
  214. }
  215. if (TRACK_DISPOSABLES) {
  216. const __is_disposable_tracked__ = "__is_disposable_tracked__";
  217. setDisposableTracker(new class {
  218. trackDisposable(x) {
  219. const stack = new Error("Potentially leaked disposable").stack;
  220. setTimeout(() => {
  221. if (!x[__is_disposable_tracked__]) {
  222. console.log(stack);
  223. }
  224. }, 3e3);
  225. }
  226. setParent(child, parent) {
  227. if (child && child !== Disposable.None) {
  228. try {
  229. child[__is_disposable_tracked__] = true;
  230. } catch (_a3) {
  231. }
  232. }
  233. }
  234. markAsDisposed(disposable) {
  235. if (disposable && disposable !== Disposable.None) {
  236. try {
  237. disposable[__is_disposable_tracked__] = true;
  238. } catch (_a3) {
  239. }
  240. }
  241. }
  242. markAsSingleton(disposable) {
  243. }
  244. }());
  245. }
  246. function trackDisposable(x) {
  247. disposableTracker === null || disposableTracker === void 0 ? void 0 : disposableTracker.trackDisposable(x);
  248. return x;
  249. }
  250. function markAsDisposed(disposable) {
  251. disposableTracker === null || disposableTracker === void 0 ? void 0 : disposableTracker.markAsDisposed(disposable);
  252. }
  253. function setParentOfDisposable(child, parent) {
  254. disposableTracker === null || disposableTracker === void 0 ? void 0 : disposableTracker.setParent(child, parent);
  255. }
  256. function setParentOfDisposables(children, parent) {
  257. if (!disposableTracker) {
  258. return;
  259. }
  260. for (const child of children) {
  261. disposableTracker.setParent(child, parent);
  262. }
  263. }
  264. var MultiDisposeError = class extends Error {
  265. constructor(errors) {
  266. super(`Encountered errors while disposing of store. Errors: [${errors.join(", ")}]`);
  267. this.errors = errors;
  268. }
  269. };
  270. function dispose(arg) {
  271. if (Iterable.is(arg)) {
  272. let errors = [];
  273. for (const d of arg) {
  274. if (d) {
  275. try {
  276. d.dispose();
  277. } catch (e) {
  278. errors.push(e);
  279. }
  280. }
  281. }
  282. if (errors.length === 1) {
  283. throw errors[0];
  284. } else if (errors.length > 1) {
  285. throw new MultiDisposeError(errors);
  286. }
  287. return Array.isArray(arg) ? [] : arg;
  288. } else if (arg) {
  289. arg.dispose();
  290. return arg;
  291. }
  292. }
  293. function combinedDisposable(...disposables) {
  294. const parent = toDisposable(() => dispose(disposables));
  295. setParentOfDisposables(disposables, parent);
  296. return parent;
  297. }
  298. function toDisposable(fn) {
  299. const self2 = trackDisposable({
  300. dispose: once(() => {
  301. markAsDisposed(self2);
  302. fn();
  303. })
  304. });
  305. return self2;
  306. }
  307. var DisposableStore = class {
  308. constructor() {
  309. this._toDispose = new Set();
  310. this._isDisposed = false;
  311. trackDisposable(this);
  312. }
  313. dispose() {
  314. if (this._isDisposed) {
  315. return;
  316. }
  317. markAsDisposed(this);
  318. this._isDisposed = true;
  319. this.clear();
  320. }
  321. get isDisposed() {
  322. return this._isDisposed;
  323. }
  324. clear() {
  325. try {
  326. dispose(this._toDispose.values());
  327. } finally {
  328. this._toDispose.clear();
  329. }
  330. }
  331. add(o) {
  332. if (!o) {
  333. return o;
  334. }
  335. if (o === this) {
  336. throw new Error("Cannot register a disposable on itself!");
  337. }
  338. setParentOfDisposable(o, this);
  339. if (this._isDisposed) {
  340. if (!DisposableStore.DISABLE_DISPOSED_WARNING) {
  341. console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack);
  342. }
  343. } else {
  344. this._toDispose.add(o);
  345. }
  346. return o;
  347. }
  348. };
  349. DisposableStore.DISABLE_DISPOSED_WARNING = false;
  350. var Disposable = class {
  351. constructor() {
  352. this._store = new DisposableStore();
  353. trackDisposable(this);
  354. setParentOfDisposable(this._store, this);
  355. }
  356. dispose() {
  357. markAsDisposed(this);
  358. this._store.dispose();
  359. }
  360. _register(o) {
  361. if (o === this) {
  362. throw new Error("Cannot register a disposable on itself!");
  363. }
  364. return this._store.add(o);
  365. }
  366. };
  367. Disposable.None = Object.freeze({dispose() {
  368. }});
  369. var SafeDisposable = class {
  370. constructor() {
  371. this.dispose = () => {
  372. };
  373. this.unset = () => {
  374. };
  375. this.isset = () => false;
  376. trackDisposable(this);
  377. }
  378. set(fn) {
  379. let callback = fn;
  380. this.unset = () => callback = void 0;
  381. this.isset = () => callback !== void 0;
  382. this.dispose = () => {
  383. if (callback) {
  384. callback();
  385. callback = void 0;
  386. markAsDisposed(this);
  387. }
  388. };
  389. return this;
  390. }
  391. };
  392. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/linkedList.js
  393. var Node = class {
  394. constructor(element) {
  395. this.element = element;
  396. this.next = Node.Undefined;
  397. this.prev = Node.Undefined;
  398. }
  399. };
  400. Node.Undefined = new Node(void 0);
  401. var LinkedList = class {
  402. constructor() {
  403. this._first = Node.Undefined;
  404. this._last = Node.Undefined;
  405. this._size = 0;
  406. }
  407. get size() {
  408. return this._size;
  409. }
  410. isEmpty() {
  411. return this._first === Node.Undefined;
  412. }
  413. clear() {
  414. let node = this._first;
  415. while (node !== Node.Undefined) {
  416. const next = node.next;
  417. node.prev = Node.Undefined;
  418. node.next = Node.Undefined;
  419. node = next;
  420. }
  421. this._first = Node.Undefined;
  422. this._last = Node.Undefined;
  423. this._size = 0;
  424. }
  425. unshift(element) {
  426. return this._insert(element, false);
  427. }
  428. push(element) {
  429. return this._insert(element, true);
  430. }
  431. _insert(element, atTheEnd) {
  432. const newNode = new Node(element);
  433. if (this._first === Node.Undefined) {
  434. this._first = newNode;
  435. this._last = newNode;
  436. } else if (atTheEnd) {
  437. const oldLast = this._last;
  438. this._last = newNode;
  439. newNode.prev = oldLast;
  440. oldLast.next = newNode;
  441. } else {
  442. const oldFirst = this._first;
  443. this._first = newNode;
  444. newNode.next = oldFirst;
  445. oldFirst.prev = newNode;
  446. }
  447. this._size += 1;
  448. let didRemove = false;
  449. return () => {
  450. if (!didRemove) {
  451. didRemove = true;
  452. this._remove(newNode);
  453. }
  454. };
  455. }
  456. shift() {
  457. if (this._first === Node.Undefined) {
  458. return void 0;
  459. } else {
  460. const res = this._first.element;
  461. this._remove(this._first);
  462. return res;
  463. }
  464. }
  465. pop() {
  466. if (this._last === Node.Undefined) {
  467. return void 0;
  468. } else {
  469. const res = this._last.element;
  470. this._remove(this._last);
  471. return res;
  472. }
  473. }
  474. _remove(node) {
  475. if (node.prev !== Node.Undefined && node.next !== Node.Undefined) {
  476. const anchor = node.prev;
  477. anchor.next = node.next;
  478. node.next.prev = anchor;
  479. } else if (node.prev === Node.Undefined && node.next === Node.Undefined) {
  480. this._first = Node.Undefined;
  481. this._last = Node.Undefined;
  482. } else if (node.next === Node.Undefined) {
  483. this._last = this._last.prev;
  484. this._last.next = Node.Undefined;
  485. } else if (node.prev === Node.Undefined) {
  486. this._first = this._first.next;
  487. this._first.prev = Node.Undefined;
  488. }
  489. this._size -= 1;
  490. }
  491. *[Symbol.iterator]() {
  492. let node = this._first;
  493. while (node !== Node.Undefined) {
  494. yield node.element;
  495. node = node.next;
  496. }
  497. }
  498. };
  499. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/platform.js
  500. var _a;
  501. var LANGUAGE_DEFAULT = "en";
  502. var _isWindows = false;
  503. var _isMacintosh = false;
  504. var _isLinux = false;
  505. var _isLinuxSnap = false;
  506. var _isNative = false;
  507. var _isWeb = false;
  508. var _isElectron = false;
  509. var _isIOS = false;
  510. var _isCI = false;
  511. var _locale = void 0;
  512. var _language = LANGUAGE_DEFAULT;
  513. var _translationsConfigFile = void 0;
  514. var _userAgent = void 0;
  515. var globals = typeof self === "object" ? self : typeof global === "object" ? global : {};
  516. var nodeProcess = void 0;
  517. if (typeof globals.vscode !== "undefined" && typeof globals.vscode.process !== "undefined") {
  518. nodeProcess = globals.vscode.process;
  519. } else if (typeof process !== "undefined") {
  520. nodeProcess = process;
  521. }
  522. var isElectronProcess = typeof ((_a = nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.versions) === null || _a === void 0 ? void 0 : _a.electron) === "string";
  523. var isElectronRenderer = isElectronProcess && (nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.type) === "renderer";
  524. if (typeof navigator === "object" && !isElectronRenderer) {
  525. _userAgent = navigator.userAgent;
  526. _isWindows = _userAgent.indexOf("Windows") >= 0;
  527. _isMacintosh = _userAgent.indexOf("Macintosh") >= 0;
  528. _isIOS = (_userAgent.indexOf("Macintosh") >= 0 || _userAgent.indexOf("iPad") >= 0 || _userAgent.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;
  529. _isLinux = _userAgent.indexOf("Linux") >= 0;
  530. _isWeb = true;
  531. _locale = navigator.language;
  532. _language = _locale;
  533. } else if (typeof nodeProcess === "object") {
  534. _isWindows = nodeProcess.platform === "win32";
  535. _isMacintosh = nodeProcess.platform === "darwin";
  536. _isLinux = nodeProcess.platform === "linux";
  537. _isLinuxSnap = _isLinux && !!nodeProcess.env["SNAP"] && !!nodeProcess.env["SNAP_REVISION"];
  538. _isElectron = isElectronProcess;
  539. _isCI = !!nodeProcess.env["CI"] || !!nodeProcess.env["BUILD_ARTIFACTSTAGINGDIRECTORY"];
  540. _locale = LANGUAGE_DEFAULT;
  541. _language = LANGUAGE_DEFAULT;
  542. const rawNlsConfig = nodeProcess.env["VSCODE_NLS_CONFIG"];
  543. if (rawNlsConfig) {
  544. try {
  545. const nlsConfig = JSON.parse(rawNlsConfig);
  546. const resolved = nlsConfig.availableLanguages["*"];
  547. _locale = nlsConfig.locale;
  548. _language = resolved ? resolved : LANGUAGE_DEFAULT;
  549. _translationsConfigFile = nlsConfig._translationsConfigFile;
  550. } catch (e) {
  551. }
  552. }
  553. _isNative = true;
  554. } else {
  555. console.error("Unable to resolve platform.");
  556. }
  557. var _platform = 0;
  558. if (_isMacintosh) {
  559. _platform = 1;
  560. } else if (_isWindows) {
  561. _platform = 3;
  562. } else if (_isLinux) {
  563. _platform = 2;
  564. }
  565. var isWindows = _isWindows;
  566. var isMacintosh = _isMacintosh;
  567. var isWebWorker = _isWeb && typeof globals.importScripts === "function";
  568. var userAgent = _userAgent;
  569. var setTimeout0 = (() => {
  570. if (typeof globals.postMessage === "function" && !globals.importScripts) {
  571. let pending = [];
  572. globals.addEventListener("message", (e) => {
  573. if (e.data && e.data.vscodeScheduleAsyncWork) {
  574. for (let i = 0, len = pending.length; i < len; i++) {
  575. const candidate = pending[i];
  576. if (candidate.id === e.data.vscodeScheduleAsyncWork) {
  577. pending.splice(i, 1);
  578. candidate.callback();
  579. return;
  580. }
  581. }
  582. }
  583. });
  584. let lastId = 0;
  585. return (callback) => {
  586. const myId = ++lastId;
  587. pending.push({
  588. id: myId,
  589. callback
  590. });
  591. globals.postMessage({vscodeScheduleAsyncWork: myId}, "*");
  592. };
  593. }
  594. return (callback) => setTimeout(callback);
  595. })();
  596. var isChrome = !!(userAgent && userAgent.indexOf("Chrome") >= 0);
  597. var isFirefox = !!(userAgent && userAgent.indexOf("Firefox") >= 0);
  598. var isSafari = !!(!isChrome && (userAgent && userAgent.indexOf("Safari") >= 0));
  599. var isEdge = !!(userAgent && userAgent.indexOf("Edg/") >= 0);
  600. var isAndroid = !!(userAgent && userAgent.indexOf("Android") >= 0);
  601. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/stopwatch.js
  602. var hasPerformanceNow = globals.performance && typeof globals.performance.now === "function";
  603. var StopWatch = class {
  604. constructor(highResolution) {
  605. this._highResolution = hasPerformanceNow && highResolution;
  606. this._startTime = this._now();
  607. this._stopTime = -1;
  608. }
  609. static create(highResolution = true) {
  610. return new StopWatch(highResolution);
  611. }
  612. stop() {
  613. this._stopTime = this._now();
  614. }
  615. elapsed() {
  616. if (this._stopTime !== -1) {
  617. return this._stopTime - this._startTime;
  618. }
  619. return this._now() - this._startTime;
  620. }
  621. _now() {
  622. return this._highResolution ? globals.performance.now() : Date.now();
  623. }
  624. };
  625. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/event.js
  626. var _enableDisposeWithListenerWarning = false;
  627. var _enableSnapshotPotentialLeakWarning = false;
  628. var Event;
  629. (function(Event2) {
  630. Event2.None = () => Disposable.None;
  631. function _addLeakageTraceLogic(options) {
  632. if (_enableSnapshotPotentialLeakWarning) {
  633. const {onListenerDidAdd: origListenerDidAdd} = options;
  634. const stack = Stacktrace.create();
  635. let count = 0;
  636. options.onListenerDidAdd = () => {
  637. if (++count === 2) {
  638. console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here");
  639. stack.print();
  640. }
  641. origListenerDidAdd === null || origListenerDidAdd === void 0 ? void 0 : origListenerDidAdd();
  642. };
  643. }
  644. }
  645. function once3(event) {
  646. return (listener, thisArgs = null, disposables) => {
  647. let didFire = false;
  648. let result;
  649. result = event((e) => {
  650. if (didFire) {
  651. return;
  652. } else if (result) {
  653. result.dispose();
  654. } else {
  655. didFire = true;
  656. }
  657. return listener.call(thisArgs, e);
  658. }, null, disposables);
  659. if (didFire) {
  660. result.dispose();
  661. }
  662. return result;
  663. };
  664. }
  665. Event2.once = once3;
  666. function map(event, map2, disposable) {
  667. return snapshot((listener, thisArgs = null, disposables) => event((i) => listener.call(thisArgs, map2(i)), null, disposables), disposable);
  668. }
  669. Event2.map = map;
  670. function forEach(event, each, disposable) {
  671. return snapshot((listener, thisArgs = null, disposables) => event((i) => {
  672. each(i);
  673. listener.call(thisArgs, i);
  674. }, null, disposables), disposable);
  675. }
  676. Event2.forEach = forEach;
  677. function filter(event, filter2, disposable) {
  678. return snapshot((listener, thisArgs = null, disposables) => event((e) => filter2(e) && listener.call(thisArgs, e), null, disposables), disposable);
  679. }
  680. Event2.filter = filter;
  681. function signal(event) {
  682. return event;
  683. }
  684. Event2.signal = signal;
  685. function any(...events) {
  686. return (listener, thisArgs = null, disposables) => combinedDisposable(...events.map((event) => event((e) => listener.call(thisArgs, e), null, disposables)));
  687. }
  688. Event2.any = any;
  689. function reduce(event, merge, initial, disposable) {
  690. let output = initial;
  691. return map(event, (e) => {
  692. output = merge(output, e);
  693. return output;
  694. }, disposable);
  695. }
  696. Event2.reduce = reduce;
  697. function snapshot(event, disposable) {
  698. let listener;
  699. const options = {
  700. onFirstListenerAdd() {
  701. listener = event(emitter.fire, emitter);
  702. },
  703. onLastListenerRemove() {
  704. listener.dispose();
  705. }
  706. };
  707. if (!disposable) {
  708. _addLeakageTraceLogic(options);
  709. }
  710. const emitter = new Emitter(options);
  711. if (disposable) {
  712. disposable.add(emitter);
  713. }
  714. return emitter.event;
  715. }
  716. function debounce(event, merge, delay = 100, leading = false, leakWarningThreshold, disposable) {
  717. let subscription;
  718. let output = void 0;
  719. let handle = void 0;
  720. let numDebouncedCalls = 0;
  721. const options = {
  722. leakWarningThreshold,
  723. onFirstListenerAdd() {
  724. subscription = event((cur) => {
  725. numDebouncedCalls++;
  726. output = merge(output, cur);
  727. if (leading && !handle) {
  728. emitter.fire(output);
  729. output = void 0;
  730. }
  731. clearTimeout(handle);
  732. handle = setTimeout(() => {
  733. const _output = output;
  734. output = void 0;
  735. handle = void 0;
  736. if (!leading || numDebouncedCalls > 1) {
  737. emitter.fire(_output);
  738. }
  739. numDebouncedCalls = 0;
  740. }, delay);
  741. });
  742. },
  743. onLastListenerRemove() {
  744. subscription.dispose();
  745. }
  746. };
  747. if (!disposable) {
  748. _addLeakageTraceLogic(options);
  749. }
  750. const emitter = new Emitter(options);
  751. if (disposable) {
  752. disposable.add(emitter);
  753. }
  754. return emitter.event;
  755. }
  756. Event2.debounce = debounce;
  757. function latch(event, equals3 = (a2, b) => a2 === b, disposable) {
  758. let firstCall = true;
  759. let cache;
  760. return filter(event, (value) => {
  761. const shouldEmit = firstCall || !equals3(value, cache);
  762. firstCall = false;
  763. cache = value;
  764. return shouldEmit;
  765. }, disposable);
  766. }
  767. Event2.latch = latch;
  768. function split(event, isT, disposable) {
  769. return [
  770. Event2.filter(event, isT, disposable),
  771. Event2.filter(event, (e) => !isT(e), disposable)
  772. ];
  773. }
  774. Event2.split = split;
  775. function buffer(event, flushAfterTimeout = false, _buffer = []) {
  776. let buffer2 = _buffer.slice();
  777. let listener = event((e) => {
  778. if (buffer2) {
  779. buffer2.push(e);
  780. } else {
  781. emitter.fire(e);
  782. }
  783. });
  784. const flush = () => {
  785. if (buffer2) {
  786. buffer2.forEach((e) => emitter.fire(e));
  787. }
  788. buffer2 = null;
  789. };
  790. const emitter = new Emitter({
  791. onFirstListenerAdd() {
  792. if (!listener) {
  793. listener = event((e) => emitter.fire(e));
  794. }
  795. },
  796. onFirstListenerDidAdd() {
  797. if (buffer2) {
  798. if (flushAfterTimeout) {
  799. setTimeout(flush);
  800. } else {
  801. flush();
  802. }
  803. }
  804. },
  805. onLastListenerRemove() {
  806. if (listener) {
  807. listener.dispose();
  808. }
  809. listener = null;
  810. }
  811. });
  812. return emitter.event;
  813. }
  814. Event2.buffer = buffer;
  815. class ChainableEvent {
  816. constructor(event) {
  817. this.event = event;
  818. }
  819. map(fn) {
  820. return new ChainableEvent(map(this.event, fn));
  821. }
  822. forEach(fn) {
  823. return new ChainableEvent(forEach(this.event, fn));
  824. }
  825. filter(fn) {
  826. return new ChainableEvent(filter(this.event, fn));
  827. }
  828. reduce(merge, initial) {
  829. return new ChainableEvent(reduce(this.event, merge, initial));
  830. }
  831. latch() {
  832. return new ChainableEvent(latch(this.event));
  833. }
  834. debounce(merge, delay = 100, leading = false, leakWarningThreshold) {
  835. return new ChainableEvent(debounce(this.event, merge, delay, leading, leakWarningThreshold));
  836. }
  837. on(listener, thisArgs, disposables) {
  838. return this.event(listener, thisArgs, disposables);
  839. }
  840. once(listener, thisArgs, disposables) {
  841. return once3(this.event)(listener, thisArgs, disposables);
  842. }
  843. }
  844. function chain(event) {
  845. return new ChainableEvent(event);
  846. }
  847. Event2.chain = chain;
  848. function fromNodeEventEmitter(emitter, eventName, map2 = (id) => id) {
  849. const fn = (...args) => result.fire(map2(...args));
  850. const onFirstListenerAdd = () => emitter.on(eventName, fn);
  851. const onLastListenerRemove = () => emitter.removeListener(eventName, fn);
  852. const result = new Emitter({onFirstListenerAdd, onLastListenerRemove});
  853. return result.event;
  854. }
  855. Event2.fromNodeEventEmitter = fromNodeEventEmitter;
  856. function fromDOMEventEmitter(emitter, eventName, map2 = (id) => id) {
  857. const fn = (...args) => result.fire(map2(...args));
  858. const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn);
  859. const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn);
  860. const result = new Emitter({onFirstListenerAdd, onLastListenerRemove});
  861. return result.event;
  862. }
  863. Event2.fromDOMEventEmitter = fromDOMEventEmitter;
  864. function toPromise(event) {
  865. return new Promise((resolve2) => once3(event)(resolve2));
  866. }
  867. Event2.toPromise = toPromise;
  868. function runAndSubscribe(event, handler) {
  869. handler(void 0);
  870. return event((e) => handler(e));
  871. }
  872. Event2.runAndSubscribe = runAndSubscribe;
  873. function runAndSubscribeWithStore(event, handler) {
  874. let store = null;
  875. function run(e) {
  876. store === null || store === void 0 ? void 0 : store.dispose();
  877. store = new DisposableStore();
  878. handler(e, store);
  879. }
  880. run(void 0);
  881. const disposable = event((e) => run(e));
  882. return toDisposable(() => {
  883. disposable.dispose();
  884. store === null || store === void 0 ? void 0 : store.dispose();
  885. });
  886. }
  887. Event2.runAndSubscribeWithStore = runAndSubscribeWithStore;
  888. })(Event || (Event = {}));
  889. var EventProfiling = class {
  890. constructor(name) {
  891. this._listenerCount = 0;
  892. this._invocationCount = 0;
  893. this._elapsedOverall = 0;
  894. this._name = `${name}_${EventProfiling._idPool++}`;
  895. }
  896. start(listenerCount) {
  897. this._stopWatch = new StopWatch(true);
  898. this._listenerCount = listenerCount;
  899. }
  900. stop() {
  901. if (this._stopWatch) {
  902. const elapsed = this._stopWatch.elapsed();
  903. this._elapsedOverall += elapsed;
  904. this._invocationCount += 1;
  905. console.info(`did FIRE ${this._name}: elapsed_ms: ${elapsed.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`);
  906. this._stopWatch = void 0;
  907. }
  908. }
  909. };
  910. EventProfiling._idPool = 0;
  911. var _globalLeakWarningThreshold = -1;
  912. var LeakageMonitor = class {
  913. constructor(customThreshold, name = Math.random().toString(18).slice(2, 5)) {
  914. this.customThreshold = customThreshold;
  915. this.name = name;
  916. this._warnCountdown = 0;
  917. }
  918. dispose() {
  919. if (this._stacks) {
  920. this._stacks.clear();
  921. }
  922. }
  923. check(stack, listenerCount) {
  924. let threshold = _globalLeakWarningThreshold;
  925. if (typeof this.customThreshold === "number") {
  926. threshold = this.customThreshold;
  927. }
  928. if (threshold <= 0 || listenerCount < threshold) {
  929. return void 0;
  930. }
  931. if (!this._stacks) {
  932. this._stacks = new Map();
  933. }
  934. const count = this._stacks.get(stack.value) || 0;
  935. this._stacks.set(stack.value, count + 1);
  936. this._warnCountdown -= 1;
  937. if (this._warnCountdown <= 0) {
  938. this._warnCountdown = threshold * 0.5;
  939. let topStack;
  940. let topCount = 0;
  941. for (const [stack2, count2] of this._stacks) {
  942. if (!topStack || topCount < count2) {
  943. topStack = stack2;
  944. topCount = count2;
  945. }
  946. }
  947. console.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`);
  948. console.warn(topStack);
  949. }
  950. return () => {
  951. const count2 = this._stacks.get(stack.value) || 0;
  952. this._stacks.set(stack.value, count2 - 1);
  953. };
  954. }
  955. };
  956. var Stacktrace = class {
  957. constructor(value) {
  958. this.value = value;
  959. }
  960. static create() {
  961. var _a3;
  962. return new Stacktrace((_a3 = new Error().stack) !== null && _a3 !== void 0 ? _a3 : "");
  963. }
  964. print() {
  965. console.warn(this.value.split("\n").slice(2).join("\n"));
  966. }
  967. };
  968. var Listener = class {
  969. constructor(callback, callbackThis, stack) {
  970. this.callback = callback;
  971. this.callbackThis = callbackThis;
  972. this.stack = stack;
  973. this.subscription = new SafeDisposable();
  974. }
  975. invoke(e) {
  976. this.callback.call(this.callbackThis, e);
  977. }
  978. };
  979. var Emitter = class {
  980. constructor(options) {
  981. var _a3;
  982. this._disposed = false;
  983. this._options = options;
  984. this._leakageMon = _globalLeakWarningThreshold > 0 ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) : void 0;
  985. this._perfMon = ((_a3 = this._options) === null || _a3 === void 0 ? void 0 : _a3._profName) ? new EventProfiling(this._options._profName) : void 0;
  986. }
  987. dispose() {
  988. var _a3, _b, _c, _d;
  989. if (!this._disposed) {
  990. this._disposed = true;
  991. if (this._listeners) {
  992. if (_enableDisposeWithListenerWarning) {
  993. const listeners = Array.from(this._listeners);
  994. queueMicrotask(() => {
  995. var _a4;
  996. for (const listener of listeners) {
  997. if (listener.subscription.isset()) {
  998. listener.subscription.unset();
  999. (_a4 = listener.stack) === null || _a4 === void 0 ? void 0 : _a4.print();
  1000. }
  1001. }
  1002. });
  1003. }
  1004. this._listeners.clear();
  1005. }
  1006. (_a3 = this._deliveryQueue) === null || _a3 === void 0 ? void 0 : _a3.clear();
  1007. (_c = (_b = this._options) === null || _b === void 0 ? void 0 : _b.onLastListenerRemove) === null || _c === void 0 ? void 0 : _c.call(_b);
  1008. (_d = this._leakageMon) === null || _d === void 0 ? void 0 : _d.dispose();
  1009. }
  1010. }
  1011. get event() {
  1012. if (!this._event) {
  1013. this._event = (callback, thisArgs, disposables) => {
  1014. var _a3, _b, _c;
  1015. if (!this._listeners) {
  1016. this._listeners = new LinkedList();
  1017. }
  1018. const firstListener = this._listeners.isEmpty();
  1019. if (firstListener && ((_a3 = this._options) === null || _a3 === void 0 ? void 0 : _a3.onFirstListenerAdd)) {
  1020. this._options.onFirstListenerAdd(this);
  1021. }
  1022. let removeMonitor;
  1023. let stack;
  1024. if (this._leakageMon && this._listeners.size >= 30) {
  1025. stack = Stacktrace.create();
  1026. removeMonitor = this._leakageMon.check(stack, this._listeners.size + 1);
  1027. }
  1028. if (_enableDisposeWithListenerWarning) {
  1029. stack = stack !== null && stack !== void 0 ? stack : Stacktrace.create();
  1030. }
  1031. const listener = new Listener(callback, thisArgs, stack);
  1032. const removeListener = this._listeners.push(listener);
  1033. if (firstListener && ((_b = this._options) === null || _b === void 0 ? void 0 : _b.onFirstListenerDidAdd)) {
  1034. this._options.onFirstListenerDidAdd(this);
  1035. }
  1036. if ((_c = this._options) === null || _c === void 0 ? void 0 : _c.onListenerDidAdd) {
  1037. this._options.onListenerDidAdd(this, callback, thisArgs);
  1038. }
  1039. const result = listener.subscription.set(() => {
  1040. if (removeMonitor) {
  1041. removeMonitor();
  1042. }
  1043. if (!this._disposed) {
  1044. removeListener();
  1045. if (this._options && this._options.onLastListenerRemove) {
  1046. const hasListeners = this._listeners && !this._listeners.isEmpty();
  1047. if (!hasListeners) {
  1048. this._options.onLastListenerRemove(this);
  1049. }
  1050. }
  1051. }
  1052. });
  1053. if (disposables instanceof DisposableStore) {
  1054. disposables.add(result);
  1055. } else if (Array.isArray(disposables)) {
  1056. disposables.push(result);
  1057. }
  1058. return result;
  1059. };
  1060. }
  1061. return this._event;
  1062. }
  1063. fire(event) {
  1064. var _a3, _b;
  1065. if (this._listeners) {
  1066. if (!this._deliveryQueue) {
  1067. this._deliveryQueue = new LinkedList();
  1068. }
  1069. for (let listener of this._listeners) {
  1070. this._deliveryQueue.push([listener, event]);
  1071. }
  1072. (_a3 = this._perfMon) === null || _a3 === void 0 ? void 0 : _a3.start(this._deliveryQueue.size);
  1073. while (this._deliveryQueue.size > 0) {
  1074. const [listener, event2] = this._deliveryQueue.shift();
  1075. try {
  1076. listener.invoke(event2);
  1077. } catch (e) {
  1078. onUnexpectedError(e);
  1079. }
  1080. }
  1081. (_b = this._perfMon) === null || _b === void 0 ? void 0 : _b.stop();
  1082. }
  1083. }
  1084. };
  1085. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/types.js
  1086. function getAllPropertyNames(obj) {
  1087. let res = [];
  1088. let proto = Object.getPrototypeOf(obj);
  1089. while (Object.prototype !== proto) {
  1090. res = res.concat(Object.getOwnPropertyNames(proto));
  1091. proto = Object.getPrototypeOf(proto);
  1092. }
  1093. return res;
  1094. }
  1095. function getAllMethodNames(obj) {
  1096. const methods = [];
  1097. for (const prop of getAllPropertyNames(obj)) {
  1098. if (typeof obj[prop] === "function") {
  1099. methods.push(prop);
  1100. }
  1101. }
  1102. return methods;
  1103. }
  1104. function createProxyObject(methodNames, invoke) {
  1105. const createProxyMethod = (method) => {
  1106. return function() {
  1107. const args = Array.prototype.slice.call(arguments, 0);
  1108. return invoke(method, args);
  1109. };
  1110. };
  1111. let result = {};
  1112. for (const methodName of methodNames) {
  1113. result[methodName] = createProxyMethod(methodName);
  1114. }
  1115. return result;
  1116. }
  1117. function assertNever(value, message = "Unreachable") {
  1118. throw new Error(message);
  1119. }
  1120. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/cache.js
  1121. var LRUCachedComputed = class {
  1122. constructor(computeFn) {
  1123. this.computeFn = computeFn;
  1124. this.lastCache = void 0;
  1125. this.lastArgKey = void 0;
  1126. }
  1127. get(arg) {
  1128. const key = JSON.stringify(arg);
  1129. if (this.lastArgKey !== key) {
  1130. this.lastArgKey = key;
  1131. this.lastCache = this.computeFn(arg);
  1132. }
  1133. return this.lastCache;
  1134. }
  1135. };
  1136. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/lazy.js
  1137. var Lazy = class {
  1138. constructor(executor) {
  1139. this.executor = executor;
  1140. this._didRun = false;
  1141. }
  1142. getValue() {
  1143. if (!this._didRun) {
  1144. try {
  1145. this._value = this.executor();
  1146. } catch (err) {
  1147. this._error = err;
  1148. } finally {
  1149. this._didRun = true;
  1150. }
  1151. }
  1152. if (this._error) {
  1153. throw this._error;
  1154. }
  1155. return this._value;
  1156. }
  1157. get rawValue() {
  1158. return this._value;
  1159. }
  1160. };
  1161. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/strings.js
  1162. var _a2;
  1163. function escapeRegExpCharacters(value) {
  1164. return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, "\\$&");
  1165. }
  1166. function splitLines(str) {
  1167. return str.split(/\r\n|\r|\n/);
  1168. }
  1169. function firstNonWhitespaceIndex(str) {
  1170. for (let i = 0, len = str.length; i < len; i++) {
  1171. const chCode = str.charCodeAt(i);
  1172. if (chCode !== 32 && chCode !== 9) {
  1173. return i;
  1174. }
  1175. }
  1176. return -1;
  1177. }
  1178. function lastNonWhitespaceIndex(str, startIndex = str.length - 1) {
  1179. for (let i = startIndex; i >= 0; i--) {
  1180. const chCode = str.charCodeAt(i);
  1181. if (chCode !== 32 && chCode !== 9) {
  1182. return i;
  1183. }
  1184. }
  1185. return -1;
  1186. }
  1187. function isUpperAsciiLetter(code) {
  1188. return code >= 65 && code <= 90;
  1189. }
  1190. function isHighSurrogate(charCode) {
  1191. return 55296 <= charCode && charCode <= 56319;
  1192. }
  1193. function isLowSurrogate(charCode) {
  1194. return 56320 <= charCode && charCode <= 57343;
  1195. }
  1196. function computeCodePoint(highSurrogate, lowSurrogate) {
  1197. return (highSurrogate - 55296 << 10) + (lowSurrogate - 56320) + 65536;
  1198. }
  1199. function getNextCodePoint(str, len, offset) {
  1200. const charCode = str.charCodeAt(offset);
  1201. if (isHighSurrogate(charCode) && offset + 1 < len) {
  1202. const nextCharCode = str.charCodeAt(offset + 1);
  1203. if (isLowSurrogate(nextCharCode)) {
  1204. return computeCodePoint(charCode, nextCharCode);
  1205. }
  1206. }
  1207. return charCode;
  1208. }
  1209. var IS_BASIC_ASCII = /^[\t\n\r\x20-\x7E]*$/;
  1210. function isBasicASCII(str) {
  1211. return IS_BASIC_ASCII.test(str);
  1212. }
  1213. var UTF8_BOM_CHARACTER = String.fromCharCode(65279);
  1214. var GraphemeBreakTree = class {
  1215. constructor() {
  1216. this._data = getGraphemeBreakRawData();
  1217. }
  1218. static getInstance() {
  1219. if (!GraphemeBreakTree._INSTANCE) {
  1220. GraphemeBreakTree._INSTANCE = new GraphemeBreakTree();
  1221. }
  1222. return GraphemeBreakTree._INSTANCE;
  1223. }
  1224. getGraphemeBreakType(codePoint) {
  1225. if (codePoint < 32) {
  1226. if (codePoint === 10) {
  1227. return 3;
  1228. }
  1229. if (codePoint === 13) {
  1230. return 2;
  1231. }
  1232. return 4;
  1233. }
  1234. if (codePoint < 127) {
  1235. return 0;
  1236. }
  1237. const data = this._data;
  1238. const nodeCount = data.length / 3;
  1239. let nodeIndex = 1;
  1240. while (nodeIndex <= nodeCount) {
  1241. if (codePoint < data[3 * nodeIndex]) {
  1242. nodeIndex = 2 * nodeIndex;
  1243. } else if (codePoint > data[3 * nodeIndex + 1]) {
  1244. nodeIndex = 2 * nodeIndex + 1;
  1245. } else {
  1246. return data[3 * nodeIndex + 2];
  1247. }
  1248. }
  1249. return 0;
  1250. }
  1251. };
  1252. GraphemeBreakTree._INSTANCE = null;
  1253. function getGraphemeBreakRawData() {
  1254. return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]");
  1255. }
  1256. var AmbiguousCharacters = class {
  1257. constructor(confusableDictionary) {
  1258. this.confusableDictionary = confusableDictionary;
  1259. }
  1260. static getInstance(locales) {
  1261. return AmbiguousCharacters.cache.get(Array.from(locales));
  1262. }
  1263. static getLocales() {
  1264. return AmbiguousCharacters._locales.getValue();
  1265. }
  1266. isAmbiguous(codePoint) {
  1267. return this.confusableDictionary.has(codePoint);
  1268. }
  1269. getPrimaryConfusable(codePoint) {
  1270. return this.confusableDictionary.get(codePoint);
  1271. }
  1272. getConfusableCodePoints() {
  1273. return new Set(this.confusableDictionary.keys());
  1274. }
  1275. };
  1276. _a2 = AmbiguousCharacters;
  1277. AmbiguousCharacters.ambiguousCharacterData = new Lazy(() => {
  1278. return JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}');
  1279. });
  1280. AmbiguousCharacters.cache = new LRUCachedComputed((locales) => {
  1281. function arrayToMap(arr) {
  1282. const result = new Map();
  1283. for (let i = 0; i < arr.length; i += 2) {
  1284. result.set(arr[i], arr[i + 1]);
  1285. }
  1286. return result;
  1287. }
  1288. function mergeMaps(map1, map2) {
  1289. const result = new Map(map1);
  1290. for (const [key, value] of map2) {
  1291. result.set(key, value);
  1292. }
  1293. return result;
  1294. }
  1295. function intersectMaps(map1, map2) {
  1296. if (!map1) {
  1297. return map2;
  1298. }
  1299. const result = new Map();
  1300. for (const [key, value] of map1) {
  1301. if (map2.has(key)) {
  1302. result.set(key, value);
  1303. }
  1304. }
  1305. return result;
  1306. }
  1307. const data = _a2.ambiguousCharacterData.getValue();
  1308. let filteredLocales = locales.filter((l) => !l.startsWith("_") && l in data);
  1309. if (filteredLocales.length === 0) {
  1310. filteredLocales = ["_default"];
  1311. }
  1312. let languageSpecificMap = void 0;
  1313. for (const locale of filteredLocales) {
  1314. const map2 = arrayToMap(data[locale]);
  1315. languageSpecificMap = intersectMaps(languageSpecificMap, map2);
  1316. }
  1317. const commonMap = arrayToMap(data["_common"]);
  1318. const map = mergeMaps(commonMap, languageSpecificMap);
  1319. return new AmbiguousCharacters(map);
  1320. });
  1321. AmbiguousCharacters._locales = new Lazy(() => Object.keys(AmbiguousCharacters.ambiguousCharacterData.getValue()).filter((k) => !k.startsWith("_")));
  1322. var InvisibleCharacters = class {
  1323. static getRawData() {
  1324. return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]");
  1325. }
  1326. static getData() {
  1327. if (!this._data) {
  1328. this._data = new Set(InvisibleCharacters.getRawData());
  1329. }
  1330. return this._data;
  1331. }
  1332. static isInvisibleCharacter(codePoint) {
  1333. return InvisibleCharacters.getData().has(codePoint);
  1334. }
  1335. static get codePoints() {
  1336. return InvisibleCharacters.getData();
  1337. }
  1338. };
  1339. InvisibleCharacters._data = void 0;
  1340. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js
  1341. var INITIALIZE = "$initialize";
  1342. var RequestMessage = class {
  1343. constructor(vsWorker, req, method, args) {
  1344. this.vsWorker = vsWorker;
  1345. this.req = req;
  1346. this.method = method;
  1347. this.args = args;
  1348. this.type = 0;
  1349. }
  1350. };
  1351. var ReplyMessage = class {
  1352. constructor(vsWorker, seq, res, err) {
  1353. this.vsWorker = vsWorker;
  1354. this.seq = seq;
  1355. this.res = res;
  1356. this.err = err;
  1357. this.type = 1;
  1358. }
  1359. };
  1360. var SubscribeEventMessage = class {
  1361. constructor(vsWorker, req, eventName, arg) {
  1362. this.vsWorker = vsWorker;
  1363. this.req = req;
  1364. this.eventName = eventName;
  1365. this.arg = arg;
  1366. this.type = 2;
  1367. }
  1368. };
  1369. var EventMessage = class {
  1370. constructor(vsWorker, req, event) {
  1371. this.vsWorker = vsWorker;
  1372. this.req = req;
  1373. this.event = event;
  1374. this.type = 3;
  1375. }
  1376. };
  1377. var UnsubscribeEventMessage = class {
  1378. constructor(vsWorker, req) {
  1379. this.vsWorker = vsWorker;
  1380. this.req = req;
  1381. this.type = 4;
  1382. }
  1383. };
  1384. var SimpleWorkerProtocol = class {
  1385. constructor(handler) {
  1386. this._workerId = -1;
  1387. this._handler = handler;
  1388. this._lastSentReq = 0;
  1389. this._pendingReplies = Object.create(null);
  1390. this._pendingEmitters = new Map();
  1391. this._pendingEvents = new Map();
  1392. }
  1393. setWorkerId(workerId) {
  1394. this._workerId = workerId;
  1395. }
  1396. sendMessage(method, args) {
  1397. const req = String(++this._lastSentReq);
  1398. return new Promise((resolve2, reject) => {
  1399. this._pendingReplies[req] = {
  1400. resolve: resolve2,
  1401. reject
  1402. };
  1403. this._send(new RequestMessage(this._workerId, req, method, args));
  1404. });
  1405. }
  1406. listen(eventName, arg) {
  1407. let req = null;
  1408. const emitter = new Emitter({
  1409. onFirstListenerAdd: () => {
  1410. req = String(++this._lastSentReq);
  1411. this._pendingEmitters.set(req, emitter);
  1412. this._send(new SubscribeEventMessage(this._workerId, req, eventName, arg));
  1413. },
  1414. onLastListenerRemove: () => {
  1415. this._pendingEmitters.delete(req);
  1416. this._send(new UnsubscribeEventMessage(this._workerId, req));
  1417. req = null;
  1418. }
  1419. });
  1420. return emitter.event;
  1421. }
  1422. handleMessage(message) {
  1423. if (!message || !message.vsWorker) {
  1424. return;
  1425. }
  1426. if (this._workerId !== -1 && message.vsWorker !== this._workerId) {
  1427. return;
  1428. }
  1429. this._handleMessage(message);
  1430. }
  1431. _handleMessage(msg) {
  1432. switch (msg.type) {
  1433. case 1:
  1434. return this._handleReplyMessage(msg);
  1435. case 0:
  1436. return this._handleRequestMessage(msg);
  1437. case 2:
  1438. return this._handleSubscribeEventMessage(msg);
  1439. case 3:
  1440. return this._handleEventMessage(msg);
  1441. case 4:
  1442. return this._handleUnsubscribeEventMessage(msg);
  1443. }
  1444. }
  1445. _handleReplyMessage(replyMessage) {
  1446. if (!this._pendingReplies[replyMessage.seq]) {
  1447. console.warn("Got reply to unknown seq");
  1448. return;
  1449. }
  1450. let reply = this._pendingReplies[replyMessage.seq];
  1451. delete this._pendingReplies[replyMessage.seq];
  1452. if (replyMessage.err) {
  1453. let err = replyMessage.err;
  1454. if (replyMessage.err.$isError) {
  1455. err = new Error();
  1456. err.name = replyMessage.err.name;
  1457. err.message = replyMessage.err.message;
  1458. err.stack = replyMessage.err.stack;
  1459. }
  1460. reply.reject(err);
  1461. return;
  1462. }
  1463. reply.resolve(replyMessage.res);
  1464. }
  1465. _handleRequestMessage(requestMessage) {
  1466. let req = requestMessage.req;
  1467. let result = this._handler.handleMessage(requestMessage.method, requestMessage.args);
  1468. result.then((r) => {
  1469. this._send(new ReplyMessage(this._workerId, req, r, void 0));
  1470. }, (e) => {
  1471. if (e.detail instanceof Error) {
  1472. e.detail = transformErrorForSerialization(e.detail);
  1473. }
  1474. this._send(new ReplyMessage(this._workerId, req, void 0, transformErrorForSerialization(e)));
  1475. });
  1476. }
  1477. _handleSubscribeEventMessage(msg) {
  1478. const req = msg.req;
  1479. const disposable = this._handler.handleEvent(msg.eventName, msg.arg)((event) => {
  1480. this._send(new EventMessage(this._workerId, req, event));
  1481. });
  1482. this._pendingEvents.set(req, disposable);
  1483. }
  1484. _handleEventMessage(msg) {
  1485. if (!this._pendingEmitters.has(msg.req)) {
  1486. console.warn("Got event for unknown req");
  1487. return;
  1488. }
  1489. this._pendingEmitters.get(msg.req).fire(msg.event);
  1490. }
  1491. _handleUnsubscribeEventMessage(msg) {
  1492. if (!this._pendingEvents.has(msg.req)) {
  1493. console.warn("Got unsubscribe for unknown req");
  1494. return;
  1495. }
  1496. this._pendingEvents.get(msg.req).dispose();
  1497. this._pendingEvents.delete(msg.req);
  1498. }
  1499. _send(msg) {
  1500. let transfer = [];
  1501. if (msg.type === 0) {
  1502. for (let i = 0; i < msg.args.length; i++) {
  1503. if (msg.args[i] instanceof ArrayBuffer) {
  1504. transfer.push(msg.args[i]);
  1505. }
  1506. }
  1507. } else if (msg.type === 1) {
  1508. if (msg.res instanceof ArrayBuffer) {
  1509. transfer.push(msg.res);
  1510. }
  1511. }
  1512. this._handler.sendMessage(msg, transfer);
  1513. }
  1514. };
  1515. function propertyIsEvent(name) {
  1516. return name[0] === "o" && name[1] === "n" && isUpperAsciiLetter(name.charCodeAt(2));
  1517. }
  1518. function propertyIsDynamicEvent(name) {
  1519. return /^onDynamic/.test(name) && isUpperAsciiLetter(name.charCodeAt(9));
  1520. }
  1521. function createProxyObject2(methodNames, invoke, proxyListen) {
  1522. const createProxyMethod = (method) => {
  1523. return function() {
  1524. const args = Array.prototype.slice.call(arguments, 0);
  1525. return invoke(method, args);
  1526. };
  1527. };
  1528. const createProxyDynamicEvent = (eventName) => {
  1529. return function(arg) {
  1530. return proxyListen(eventName, arg);
  1531. };
  1532. };
  1533. let result = {};
  1534. for (const methodName of methodNames) {
  1535. if (propertyIsDynamicEvent(methodName)) {
  1536. result[methodName] = createProxyDynamicEvent(methodName);
  1537. continue;
  1538. }
  1539. if (propertyIsEvent(methodName)) {
  1540. result[methodName] = proxyListen(methodName, void 0);
  1541. continue;
  1542. }
  1543. result[methodName] = createProxyMethod(methodName);
  1544. }
  1545. return result;
  1546. }
  1547. var SimpleWorkerServer = class {
  1548. constructor(postMessage, requestHandlerFactory) {
  1549. this._requestHandlerFactory = requestHandlerFactory;
  1550. this._requestHandler = null;
  1551. this._protocol = new SimpleWorkerProtocol({
  1552. sendMessage: (msg, transfer) => {
  1553. postMessage(msg, transfer);
  1554. },
  1555. handleMessage: (method, args) => this._handleMessage(method, args),
  1556. handleEvent: (eventName, arg) => this._handleEvent(eventName, arg)
  1557. });
  1558. }
  1559. onmessage(msg) {
  1560. this._protocol.handleMessage(msg);
  1561. }
  1562. _handleMessage(method, args) {
  1563. if (method === INITIALIZE) {
  1564. return this.initialize(args[0], args[1], args[2], args[3]);
  1565. }
  1566. if (!this._requestHandler || typeof this._requestHandler[method] !== "function") {
  1567. return Promise.reject(new Error("Missing requestHandler or method: " + method));
  1568. }
  1569. try {
  1570. return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args));
  1571. } catch (e) {
  1572. return Promise.reject(e);
  1573. }
  1574. }
  1575. _handleEvent(eventName, arg) {
  1576. if (!this._requestHandler) {
  1577. throw new Error(`Missing requestHandler`);
  1578. }
  1579. if (propertyIsDynamicEvent(eventName)) {
  1580. const event = this._requestHandler[eventName].call(this._requestHandler, arg);
  1581. if (typeof event !== "function") {
  1582. throw new Error(`Missing dynamic event ${eventName} on request handler.`);
  1583. }
  1584. return event;
  1585. }
  1586. if (propertyIsEvent(eventName)) {
  1587. const event = this._requestHandler[eventName];
  1588. if (typeof event !== "function") {
  1589. throw new Error(`Missing event ${eventName} on request handler.`);
  1590. }
  1591. return event;
  1592. }
  1593. throw new Error(`Malformed event name ${eventName}`);
  1594. }
  1595. initialize(workerId, loaderConfig, moduleId, hostMethods) {
  1596. this._protocol.setWorkerId(workerId);
  1597. const proxyMethodRequest = (method, args) => {
  1598. return this._protocol.sendMessage(method, args);
  1599. };
  1600. const proxyListen = (eventName, arg) => {
  1601. return this._protocol.listen(eventName, arg);
  1602. };
  1603. const hostProxy = createProxyObject2(hostMethods, proxyMethodRequest, proxyListen);
  1604. if (this._requestHandlerFactory) {
  1605. this._requestHandler = this._requestHandlerFactory(hostProxy);
  1606. return Promise.resolve(getAllMethodNames(this._requestHandler));
  1607. }
  1608. if (loaderConfig) {
  1609. if (typeof loaderConfig.baseUrl !== "undefined") {
  1610. delete loaderConfig["baseUrl"];
  1611. }
  1612. if (typeof loaderConfig.paths !== "undefined") {
  1613. if (typeof loaderConfig.paths.vs !== "undefined") {
  1614. delete loaderConfig.paths["vs"];
  1615. }
  1616. }
  1617. if (typeof loaderConfig.trustedTypesPolicy !== void 0) {
  1618. delete loaderConfig["trustedTypesPolicy"];
  1619. }
  1620. loaderConfig.catchError = true;
  1621. globals.require.config(loaderConfig);
  1622. }
  1623. return new Promise((resolve2, reject) => {
  1624. const req = globals.require;
  1625. req([moduleId], (module) => {
  1626. this._requestHandler = module.create(hostProxy);
  1627. if (!this._requestHandler) {
  1628. reject(new Error(`No RequestHandler!`));
  1629. return;
  1630. }
  1631. resolve2(getAllMethodNames(this._requestHandler));
  1632. }, reject);
  1633. });
  1634. }
  1635. };
  1636. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js
  1637. var DiffChange = class {
  1638. constructor(originalStart, originalLength, modifiedStart, modifiedLength) {
  1639. this.originalStart = originalStart;
  1640. this.originalLength = originalLength;
  1641. this.modifiedStart = modifiedStart;
  1642. this.modifiedLength = modifiedLength;
  1643. }
  1644. getOriginalEnd() {
  1645. return this.originalStart + this.originalLength;
  1646. }
  1647. getModifiedEnd() {
  1648. return this.modifiedStart + this.modifiedLength;
  1649. }
  1650. };
  1651. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/hash.js
  1652. function numberHash(val, initialHashVal) {
  1653. return (initialHashVal << 5) - initialHashVal + val | 0;
  1654. }
  1655. function stringHash(s, hashVal) {
  1656. hashVal = numberHash(149417, hashVal);
  1657. for (let i = 0, length = s.length; i < length; i++) {
  1658. hashVal = numberHash(s.charCodeAt(i), hashVal);
  1659. }
  1660. return hashVal;
  1661. }
  1662. function leftRotate(value, bits, totalBits = 32) {
  1663. const delta = totalBits - bits;
  1664. const mask = ~((1 << delta) - 1);
  1665. return (value << bits | (mask & value) >>> delta) >>> 0;
  1666. }
  1667. function fill(dest, index = 0, count = dest.byteLength, value = 0) {
  1668. for (let i = 0; i < count; i++) {
  1669. dest[index + i] = value;
  1670. }
  1671. }
  1672. function leftPad(value, length, char = "0") {
  1673. while (value.length < length) {
  1674. value = char + value;
  1675. }
  1676. return value;
  1677. }
  1678. function toHexString(bufferOrValue, bitsize = 32) {
  1679. if (bufferOrValue instanceof ArrayBuffer) {
  1680. return Array.from(new Uint8Array(bufferOrValue)).map((b) => b.toString(16).padStart(2, "0")).join("");
  1681. }
  1682. return leftPad((bufferOrValue >>> 0).toString(16), bitsize / 4);
  1683. }
  1684. var StringSHA1 = class {
  1685. constructor() {
  1686. this._h0 = 1732584193;
  1687. this._h1 = 4023233417;
  1688. this._h2 = 2562383102;
  1689. this._h3 = 271733878;
  1690. this._h4 = 3285377520;
  1691. this._buff = new Uint8Array(64 + 3);
  1692. this._buffDV = new DataView(this._buff.buffer);
  1693. this._buffLen = 0;
  1694. this._totalLen = 0;
  1695. this._leftoverHighSurrogate = 0;
  1696. this._finished = false;
  1697. }
  1698. update(str) {
  1699. const strLen = str.length;
  1700. if (strLen === 0) {
  1701. return;
  1702. }
  1703. const buff = this._buff;
  1704. let buffLen = this._buffLen;
  1705. let leftoverHighSurrogate = this._leftoverHighSurrogate;
  1706. let charCode;
  1707. let offset;
  1708. if (leftoverHighSurrogate !== 0) {
  1709. charCode = leftoverHighSurrogate;
  1710. offset = -1;
  1711. leftoverHighSurrogate = 0;
  1712. } else {
  1713. charCode = str.charCodeAt(0);
  1714. offset = 0;
  1715. }
  1716. while (true) {
  1717. let codePoint = charCode;
  1718. if (isHighSurrogate(charCode)) {
  1719. if (offset + 1 < strLen) {
  1720. const nextCharCode = str.charCodeAt(offset + 1);
  1721. if (isLowSurrogate(nextCharCode)) {
  1722. offset++;
  1723. codePoint = computeCodePoint(charCode, nextCharCode);
  1724. } else {
  1725. codePoint = 65533;
  1726. }
  1727. } else {
  1728. leftoverHighSurrogate = charCode;
  1729. break;
  1730. }
  1731. } else if (isLowSurrogate(charCode)) {
  1732. codePoint = 65533;
  1733. }
  1734. buffLen = this._push(buff, buffLen, codePoint);
  1735. offset++;
  1736. if (offset < strLen) {
  1737. charCode = str.charCodeAt(offset);
  1738. } else {
  1739. break;
  1740. }
  1741. }
  1742. this._buffLen = buffLen;
  1743. this._leftoverHighSurrogate = leftoverHighSurrogate;
  1744. }
  1745. _push(buff, buffLen, codePoint) {
  1746. if (codePoint < 128) {
  1747. buff[buffLen++] = codePoint;
  1748. } else if (codePoint < 2048) {
  1749. buff[buffLen++] = 192 | (codePoint & 1984) >>> 6;
  1750. buff[buffLen++] = 128 | (codePoint & 63) >>> 0;
  1751. } else if (codePoint < 65536) {
  1752. buff[buffLen++] = 224 | (codePoint & 61440) >>> 12;
  1753. buff[buffLen++] = 128 | (codePoint & 4032) >>> 6;
  1754. buff[buffLen++] = 128 | (codePoint & 63) >>> 0;
  1755. } else {
  1756. buff[buffLen++] = 240 | (codePoint & 1835008) >>> 18;
  1757. buff[buffLen++] = 128 | (codePoint & 258048) >>> 12;
  1758. buff[buffLen++] = 128 | (codePoint & 4032) >>> 6;
  1759. buff[buffLen++] = 128 | (codePoint & 63) >>> 0;
  1760. }
  1761. if (buffLen >= 64) {
  1762. this._step();
  1763. buffLen -= 64;
  1764. this._totalLen += 64;
  1765. buff[0] = buff[64 + 0];
  1766. buff[1] = buff[64 + 1];
  1767. buff[2] = buff[64 + 2];
  1768. }
  1769. return buffLen;
  1770. }
  1771. digest() {
  1772. if (!this._finished) {
  1773. this._finished = true;
  1774. if (this._leftoverHighSurrogate) {
  1775. this._leftoverHighSurrogate = 0;
  1776. this._buffLen = this._push(this._buff, this._buffLen, 65533);
  1777. }
  1778. this._totalLen += this._buffLen;
  1779. this._wrapUp();
  1780. }
  1781. return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4);
  1782. }
  1783. _wrapUp() {
  1784. this._buff[this._buffLen++] = 128;
  1785. fill(this._buff, this._buffLen);
  1786. if (this._buffLen > 56) {
  1787. this._step();
  1788. fill(this._buff);
  1789. }
  1790. const ml = 8 * this._totalLen;
  1791. this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false);
  1792. this._buffDV.setUint32(60, ml % 4294967296, false);
  1793. this._step();
  1794. }
  1795. _step() {
  1796. const bigBlock32 = StringSHA1._bigBlock32;
  1797. const data = this._buffDV;
  1798. for (let j = 0; j < 64; j += 4) {
  1799. bigBlock32.setUint32(j, data.getUint32(j, false), false);
  1800. }
  1801. for (let j = 64; j < 320; j += 4) {
  1802. bigBlock32.setUint32(j, leftRotate(bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false), 1), false);
  1803. }
  1804. let a2 = this._h0;
  1805. let b = this._h1;
  1806. let c = this._h2;
  1807. let d = this._h3;
  1808. let e = this._h4;
  1809. let f2, k;
  1810. let temp;
  1811. for (let j = 0; j < 80; j++) {
  1812. if (j < 20) {
  1813. f2 = b & c | ~b & d;
  1814. k = 1518500249;
  1815. } else if (j < 40) {
  1816. f2 = b ^ c ^ d;
  1817. k = 1859775393;
  1818. } else if (j < 60) {
  1819. f2 = b & c | b & d | c & d;
  1820. k = 2400959708;
  1821. } else {
  1822. f2 = b ^ c ^ d;
  1823. k = 3395469782;
  1824. }
  1825. temp = leftRotate(a2, 5) + f2 + e + k + bigBlock32.getUint32(j * 4, false) & 4294967295;
  1826. e = d;
  1827. d = c;
  1828. c = leftRotate(b, 30);
  1829. b = a2;
  1830. a2 = temp;
  1831. }
  1832. this._h0 = this._h0 + a2 & 4294967295;
  1833. this._h1 = this._h1 + b & 4294967295;
  1834. this._h2 = this._h2 + c & 4294967295;
  1835. this._h3 = this._h3 + d & 4294967295;
  1836. this._h4 = this._h4 + e & 4294967295;
  1837. }
  1838. };
  1839. StringSHA1._bigBlock32 = new DataView(new ArrayBuffer(320));
  1840. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/diff/diff.js
  1841. var StringDiffSequence = class {
  1842. constructor(source) {
  1843. this.source = source;
  1844. }
  1845. getElements() {
  1846. const source = this.source;
  1847. const characters = new Int32Array(source.length);
  1848. for (let i = 0, len = source.length; i < len; i++) {
  1849. characters[i] = source.charCodeAt(i);
  1850. }
  1851. return characters;
  1852. }
  1853. };
  1854. function stringDiff(original, modified, pretty) {
  1855. return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes;
  1856. }
  1857. var Debug = class {
  1858. static Assert(condition, message) {
  1859. if (!condition) {
  1860. throw new Error(message);
  1861. }
  1862. }
  1863. };
  1864. var MyArray = class {
  1865. static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {
  1866. for (let i = 0; i < length; i++) {
  1867. destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];
  1868. }
  1869. }
  1870. static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {
  1871. for (let i = 0; i < length; i++) {
  1872. destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];
  1873. }
  1874. }
  1875. };
  1876. var DiffChangeHelper = class {
  1877. constructor() {
  1878. this.m_changes = [];
  1879. this.m_originalStart = 1073741824;
  1880. this.m_modifiedStart = 1073741824;
  1881. this.m_originalCount = 0;
  1882. this.m_modifiedCount = 0;
  1883. }
  1884. MarkNextChange() {
  1885. if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
  1886. this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount));
  1887. }
  1888. this.m_originalCount = 0;
  1889. this.m_modifiedCount = 0;
  1890. this.m_originalStart = 1073741824;
  1891. this.m_modifiedStart = 1073741824;
  1892. }
  1893. AddOriginalElement(originalIndex, modifiedIndex) {
  1894. this.m_originalStart = Math.min(this.m_originalStart, originalIndex);
  1895. this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);
  1896. this.m_originalCount++;
  1897. }
  1898. AddModifiedElement(originalIndex, modifiedIndex) {
  1899. this.m_originalStart = Math.min(this.m_originalStart, originalIndex);
  1900. this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);
  1901. this.m_modifiedCount++;
  1902. }
  1903. getChanges() {
  1904. if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
  1905. this.MarkNextChange();
  1906. }
  1907. return this.m_changes;
  1908. }
  1909. getReverseChanges() {
  1910. if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
  1911. this.MarkNextChange();
  1912. }
  1913. this.m_changes.reverse();
  1914. return this.m_changes;
  1915. }
  1916. };
  1917. var LcsDiff = class {
  1918. constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) {
  1919. this.ContinueProcessingPredicate = continueProcessingPredicate;
  1920. this._originalSequence = originalSequence;
  1921. this._modifiedSequence = modifiedSequence;
  1922. const [originalStringElements, originalElementsOrHash, originalHasStrings] = LcsDiff._getElements(originalSequence);
  1923. const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = LcsDiff._getElements(modifiedSequence);
  1924. this._hasStrings = originalHasStrings && modifiedHasStrings;
  1925. this._originalStringElements = originalStringElements;
  1926. this._originalElementsOrHash = originalElementsOrHash;
  1927. this._modifiedStringElements = modifiedStringElements;
  1928. this._modifiedElementsOrHash = modifiedElementsOrHash;
  1929. this.m_forwardHistory = [];
  1930. this.m_reverseHistory = [];
  1931. }
  1932. static _isStringArray(arr) {
  1933. return arr.length > 0 && typeof arr[0] === "string";
  1934. }
  1935. static _getElements(sequence) {
  1936. const elements = sequence.getElements();
  1937. if (LcsDiff._isStringArray(elements)) {
  1938. const hashes = new Int32Array(elements.length);
  1939. for (let i = 0, len = elements.length; i < len; i++) {
  1940. hashes[i] = stringHash(elements[i], 0);
  1941. }
  1942. return [elements, hashes, true];
  1943. }
  1944. if (elements instanceof Int32Array) {
  1945. return [[], elements, false];
  1946. }
  1947. return [[], new Int32Array(elements), false];
  1948. }
  1949. ElementsAreEqual(originalIndex, newIndex) {
  1950. if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) {
  1951. return false;
  1952. }
  1953. return this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true;
  1954. }
  1955. ElementsAreStrictEqual(originalIndex, newIndex) {
  1956. if (!this.ElementsAreEqual(originalIndex, newIndex)) {
  1957. return false;
  1958. }
  1959. const originalElement = LcsDiff._getStrictElement(this._originalSequence, originalIndex);
  1960. const modifiedElement = LcsDiff._getStrictElement(this._modifiedSequence, newIndex);
  1961. return originalElement === modifiedElement;
  1962. }
  1963. static _getStrictElement(sequence, index) {
  1964. if (typeof sequence.getStrictElement === "function") {
  1965. return sequence.getStrictElement(index);
  1966. }
  1967. return null;
  1968. }
  1969. OriginalElementsAreEqual(index1, index2) {
  1970. if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) {
  1971. return false;
  1972. }
  1973. return this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true;
  1974. }
  1975. ModifiedElementsAreEqual(index1, index2) {
  1976. if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) {
  1977. return false;
  1978. }
  1979. return this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true;
  1980. }
  1981. ComputeDiff(pretty) {
  1982. return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty);
  1983. }
  1984. _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) {
  1985. const quitEarlyArr = [false];
  1986. let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr);
  1987. if (pretty) {
  1988. changes = this.PrettifyChanges(changes);
  1989. }
  1990. return {
  1991. quitEarly: quitEarlyArr[0],
  1992. changes
  1993. };
  1994. }
  1995. ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) {
  1996. quitEarlyArr[0] = false;
  1997. while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) {
  1998. originalStart++;
  1999. modifiedStart++;
  2000. }
  2001. while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) {
  2002. originalEnd--;
  2003. modifiedEnd--;
  2004. }
  2005. if (originalStart > originalEnd || modifiedStart > modifiedEnd) {
  2006. let changes;
  2007. if (modifiedStart <= modifiedEnd) {
  2008. Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd");
  2009. changes = [
  2010. new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1)
  2011. ];
  2012. } else if (originalStart <= originalEnd) {
  2013. Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd");
  2014. changes = [
  2015. new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0)
  2016. ];
  2017. } else {
  2018. Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd");
  2019. Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd");
  2020. changes = [];
  2021. }
  2022. return changes;
  2023. }
  2024. const midOriginalArr = [0];
  2025. const midModifiedArr = [0];
  2026. const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);
  2027. const midOriginal = midOriginalArr[0];
  2028. const midModified = midModifiedArr[0];
  2029. if (result !== null) {
  2030. return result;
  2031. } else if (!quitEarlyArr[0]) {
  2032. const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr);
  2033. let rightChanges = [];
  2034. if (!quitEarlyArr[0]) {
  2035. rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr);
  2036. } else {
  2037. rightChanges = [
  2038. new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1)
  2039. ];
  2040. }
  2041. return this.ConcatenateChanges(leftChanges, rightChanges);
  2042. }
  2043. return [
  2044. new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)
  2045. ];
  2046. }
  2047. WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) {
  2048. let forwardChanges = null;
  2049. let reverseChanges = null;
  2050. let changeHelper = new DiffChangeHelper();
  2051. let diagonalMin = diagonalForwardStart;
  2052. let diagonalMax = diagonalForwardEnd;
  2053. let diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalForwardOffset;
  2054. let lastOriginalIndex = -1073741824;
  2055. let historyIndex = this.m_forwardHistory.length - 1;
  2056. do {
  2057. const diagonal = diagonalRelative + diagonalForwardBase;
  2058. if (diagonal === diagonalMin || diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) {
  2059. originalIndex = forwardPoints[diagonal + 1];
  2060. modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;
  2061. if (originalIndex < lastOriginalIndex) {
  2062. changeHelper.MarkNextChange();
  2063. }
  2064. lastOriginalIndex = originalIndex;
  2065. changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex);
  2066. diagonalRelative = diagonal + 1 - diagonalForwardBase;
  2067. } else {
  2068. originalIndex = forwardPoints[diagonal - 1] + 1;
  2069. modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;
  2070. if (originalIndex < lastOriginalIndex) {
  2071. changeHelper.MarkNextChange();
  2072. }
  2073. lastOriginalIndex = originalIndex - 1;
  2074. changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1);
  2075. diagonalRelative = diagonal - 1 - diagonalForwardBase;
  2076. }
  2077. if (historyIndex >= 0) {
  2078. forwardPoints = this.m_forwardHistory[historyIndex];
  2079. diagonalForwardBase = forwardPoints[0];
  2080. diagonalMin = 1;
  2081. diagonalMax = forwardPoints.length - 1;
  2082. }
  2083. } while (--historyIndex >= -1);
  2084. forwardChanges = changeHelper.getReverseChanges();
  2085. if (quitEarlyArr[0]) {
  2086. let originalStartPoint = midOriginalArr[0] + 1;
  2087. let modifiedStartPoint = midModifiedArr[0] + 1;
  2088. if (forwardChanges !== null && forwardChanges.length > 0) {
  2089. const lastForwardChange = forwardChanges[forwardChanges.length - 1];
  2090. originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd());
  2091. modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd());
  2092. }
  2093. reverseChanges = [
  2094. new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1)
  2095. ];
  2096. } else {
  2097. changeHelper = new DiffChangeHelper();
  2098. diagonalMin = diagonalReverseStart;
  2099. diagonalMax = diagonalReverseEnd;
  2100. diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalReverseOffset;
  2101. lastOriginalIndex = 1073741824;
  2102. historyIndex = deltaIsEven ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;
  2103. do {
  2104. const diagonal = diagonalRelative + diagonalReverseBase;
  2105. if (diagonal === diagonalMin || diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) {
  2106. originalIndex = reversePoints[diagonal + 1] - 1;
  2107. modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;
  2108. if (originalIndex > lastOriginalIndex) {
  2109. changeHelper.MarkNextChange();
  2110. }
  2111. lastOriginalIndex = originalIndex + 1;
  2112. changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);
  2113. diagonalRelative = diagonal + 1 - diagonalReverseBase;
  2114. } else {
  2115. originalIndex = reversePoints[diagonal - 1];
  2116. modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;
  2117. if (originalIndex > lastOriginalIndex) {
  2118. changeHelper.MarkNextChange();
  2119. }
  2120. lastOriginalIndex = originalIndex;
  2121. changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1);
  2122. diagonalRelative = diagonal - 1 - diagonalReverseBase;
  2123. }
  2124. if (historyIndex >= 0) {
  2125. reversePoints = this.m_reverseHistory[historyIndex];
  2126. diagonalReverseBase = reversePoints[0];
  2127. diagonalMin = 1;
  2128. diagonalMax = reversePoints.length - 1;
  2129. }
  2130. } while (--historyIndex >= -1);
  2131. reverseChanges = changeHelper.getChanges();
  2132. }
  2133. return this.ConcatenateChanges(forwardChanges, reverseChanges);
  2134. }
  2135. ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) {
  2136. let originalIndex = 0, modifiedIndex = 0;
  2137. let diagonalForwardStart = 0, diagonalForwardEnd = 0;
  2138. let diagonalReverseStart = 0, diagonalReverseEnd = 0;
  2139. originalStart--;
  2140. modifiedStart--;
  2141. midOriginalArr[0] = 0;
  2142. midModifiedArr[0] = 0;
  2143. this.m_forwardHistory = [];
  2144. this.m_reverseHistory = [];
  2145. const maxDifferences = originalEnd - originalStart + (modifiedEnd - modifiedStart);
  2146. const numDiagonals = maxDifferences + 1;
  2147. const forwardPoints = new Int32Array(numDiagonals);
  2148. const reversePoints = new Int32Array(numDiagonals);
  2149. const diagonalForwardBase = modifiedEnd - modifiedStart;
  2150. const diagonalReverseBase = originalEnd - originalStart;
  2151. const diagonalForwardOffset = originalStart - modifiedStart;
  2152. const diagonalReverseOffset = originalEnd - modifiedEnd;
  2153. const delta = diagonalReverseBase - diagonalForwardBase;
  2154. const deltaIsEven = delta % 2 === 0;
  2155. forwardPoints[diagonalForwardBase] = originalStart;
  2156. reversePoints[diagonalReverseBase] = originalEnd;
  2157. quitEarlyArr[0] = false;
  2158. for (let numDifferences = 1; numDifferences <= maxDifferences / 2 + 1; numDifferences++) {
  2159. let furthestOriginalIndex = 0;
  2160. let furthestModifiedIndex = 0;
  2161. diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals);
  2162. diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals);
  2163. for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) {
  2164. if (diagonal === diagonalForwardStart || diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) {
  2165. originalIndex = forwardPoints[diagonal + 1];
  2166. } else {
  2167. originalIndex = forwardPoints[diagonal - 1] + 1;
  2168. }
  2169. modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset;
  2170. const tempOriginalIndex = originalIndex;
  2171. while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) {
  2172. originalIndex++;
  2173. modifiedIndex++;
  2174. }
  2175. forwardPoints[diagonal] = originalIndex;
  2176. if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) {
  2177. furthestOriginalIndex = originalIndex;
  2178. furthestModifiedIndex = modifiedIndex;
  2179. }
  2180. if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= numDifferences - 1) {
  2181. if (originalIndex >= reversePoints[diagonal]) {
  2182. midOriginalArr[0] = originalIndex;
  2183. midModifiedArr[0] = modifiedIndex;
  2184. if (tempOriginalIndex <= reversePoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) {
  2185. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  2186. } else {
  2187. return null;
  2188. }
  2189. }
  2190. }
  2191. }
  2192. const matchLengthOfLongest = (furthestOriginalIndex - originalStart + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;
  2193. if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) {
  2194. quitEarlyArr[0] = true;
  2195. midOriginalArr[0] = furthestOriginalIndex;
  2196. midModifiedArr[0] = furthestModifiedIndex;
  2197. if (matchLengthOfLongest > 0 && 1447 > 0 && numDifferences <= 1447 + 1) {
  2198. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  2199. } else {
  2200. originalStart++;
  2201. modifiedStart++;
  2202. return [
  2203. new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)
  2204. ];
  2205. }
  2206. }
  2207. diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals);
  2208. diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals);
  2209. for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) {
  2210. if (diagonal === diagonalReverseStart || diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) {
  2211. originalIndex = reversePoints[diagonal + 1] - 1;
  2212. } else {
  2213. originalIndex = reversePoints[diagonal - 1];
  2214. }
  2215. modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset;
  2216. const tempOriginalIndex = originalIndex;
  2217. while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) {
  2218. originalIndex--;
  2219. modifiedIndex--;
  2220. }
  2221. reversePoints[diagonal] = originalIndex;
  2222. if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) {
  2223. if (originalIndex <= forwardPoints[diagonal]) {
  2224. midOriginalArr[0] = originalIndex;
  2225. midModifiedArr[0] = modifiedIndex;
  2226. if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) {
  2227. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  2228. } else {
  2229. return null;
  2230. }
  2231. }
  2232. }
  2233. }
  2234. if (numDifferences <= 1447) {
  2235. let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2);
  2236. temp[0] = diagonalForwardBase - diagonalForwardStart + 1;
  2237. MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);
  2238. this.m_forwardHistory.push(temp);
  2239. temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2);
  2240. temp[0] = diagonalReverseBase - diagonalReverseStart + 1;
  2241. MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1);
  2242. this.m_reverseHistory.push(temp);
  2243. }
  2244. }
  2245. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  2246. }
  2247. PrettifyChanges(changes) {
  2248. for (let i = 0; i < changes.length; i++) {
  2249. const change = changes[i];
  2250. const originalStop = i < changes.length - 1 ? changes[i + 1].originalStart : this._originalElementsOrHash.length;
  2251. const modifiedStop = i < changes.length - 1 ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length;
  2252. const checkOriginal = change.originalLength > 0;
  2253. const checkModified = change.modifiedLength > 0;
  2254. while (change.originalStart + change.originalLength < originalStop && change.modifiedStart + change.modifiedLength < modifiedStop && (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) && (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) {
  2255. const startStrictEqual = this.ElementsAreStrictEqual(change.originalStart, change.modifiedStart);
  2256. const endStrictEqual = this.ElementsAreStrictEqual(change.originalStart + change.originalLength, change.modifiedStart + change.modifiedLength);
  2257. if (endStrictEqual && !startStrictEqual) {
  2258. break;
  2259. }
  2260. change.originalStart++;
  2261. change.modifiedStart++;
  2262. }
  2263. let mergedChangeArr = [null];
  2264. if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) {
  2265. changes[i] = mergedChangeArr[0];
  2266. changes.splice(i + 1, 1);
  2267. i--;
  2268. continue;
  2269. }
  2270. }
  2271. for (let i = changes.length - 1; i >= 0; i--) {
  2272. const change = changes[i];
  2273. let originalStop = 0;
  2274. let modifiedStop = 0;
  2275. if (i > 0) {
  2276. const prevChange = changes[i - 1];
  2277. originalStop = prevChange.originalStart + prevChange.originalLength;
  2278. modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;
  2279. }
  2280. const checkOriginal = change.originalLength > 0;
  2281. const checkModified = change.modifiedLength > 0;
  2282. let bestDelta = 0;
  2283. let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength);
  2284. for (let delta = 1; ; delta++) {
  2285. const originalStart = change.originalStart - delta;
  2286. const modifiedStart = change.modifiedStart - delta;
  2287. if (originalStart < originalStop || modifiedStart < modifiedStop) {
  2288. break;
  2289. }
  2290. if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) {
  2291. break;
  2292. }
  2293. if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) {
  2294. break;
  2295. }
  2296. const touchingPreviousChange = originalStart === originalStop && modifiedStart === modifiedStop;
  2297. const score = (touchingPreviousChange ? 5 : 0) + this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength);
  2298. if (score > bestScore) {
  2299. bestScore = score;
  2300. bestDelta = delta;
  2301. }
  2302. }
  2303. change.originalStart -= bestDelta;
  2304. change.modifiedStart -= bestDelta;
  2305. const mergedChangeArr = [null];
  2306. if (i > 0 && this.ChangesOverlap(changes[i - 1], changes[i], mergedChangeArr)) {
  2307. changes[i - 1] = mergedChangeArr[0];
  2308. changes.splice(i, 1);
  2309. i++;
  2310. continue;
  2311. }
  2312. }
  2313. if (this._hasStrings) {
  2314. for (let i = 1, len = changes.length; i < len; i++) {
  2315. const aChange = changes[i - 1];
  2316. const bChange = changes[i];
  2317. const matchedLength = bChange.originalStart - aChange.originalStart - aChange.originalLength;
  2318. const aOriginalStart = aChange.originalStart;
  2319. const bOriginalEnd = bChange.originalStart + bChange.originalLength;
  2320. const abOriginalLength = bOriginalEnd - aOriginalStart;
  2321. const aModifiedStart = aChange.modifiedStart;
  2322. const bModifiedEnd = bChange.modifiedStart + bChange.modifiedLength;
  2323. const abModifiedLength = bModifiedEnd - aModifiedStart;
  2324. if (matchedLength < 5 && abOriginalLength < 20 && abModifiedLength < 20) {
  2325. const t = this._findBetterContiguousSequence(aOriginalStart, abOriginalLength, aModifiedStart, abModifiedLength, matchedLength);
  2326. if (t) {
  2327. const [originalMatchStart, modifiedMatchStart] = t;
  2328. if (originalMatchStart !== aChange.originalStart + aChange.originalLength || modifiedMatchStart !== aChange.modifiedStart + aChange.modifiedLength) {
  2329. aChange.originalLength = originalMatchStart - aChange.originalStart;
  2330. aChange.modifiedLength = modifiedMatchStart - aChange.modifiedStart;
  2331. bChange.originalStart = originalMatchStart + matchedLength;
  2332. bChange.modifiedStart = modifiedMatchStart + matchedLength;
  2333. bChange.originalLength = bOriginalEnd - bChange.originalStart;
  2334. bChange.modifiedLength = bModifiedEnd - bChange.modifiedStart;
  2335. }
  2336. }
  2337. }
  2338. }
  2339. }
  2340. return changes;
  2341. }
  2342. _findBetterContiguousSequence(originalStart, originalLength, modifiedStart, modifiedLength, desiredLength) {
  2343. if (originalLength < desiredLength || modifiedLength < desiredLength) {
  2344. return null;
  2345. }
  2346. const originalMax = originalStart + originalLength - desiredLength + 1;
  2347. const modifiedMax = modifiedStart + modifiedLength - desiredLength + 1;
  2348. let bestScore = 0;
  2349. let bestOriginalStart = 0;
  2350. let bestModifiedStart = 0;
  2351. for (let i = originalStart; i < originalMax; i++) {
  2352. for (let j = modifiedStart; j < modifiedMax; j++) {
  2353. const score = this._contiguousSequenceScore(i, j, desiredLength);
  2354. if (score > 0 && score > bestScore) {
  2355. bestScore = score;
  2356. bestOriginalStart = i;
  2357. bestModifiedStart = j;
  2358. }
  2359. }
  2360. }
  2361. if (bestScore > 0) {
  2362. return [bestOriginalStart, bestModifiedStart];
  2363. }
  2364. return null;
  2365. }
  2366. _contiguousSequenceScore(originalStart, modifiedStart, length) {
  2367. let score = 0;
  2368. for (let l = 0; l < length; l++) {
  2369. if (!this.ElementsAreEqual(originalStart + l, modifiedStart + l)) {
  2370. return 0;
  2371. }
  2372. score += this._originalStringElements[originalStart + l].length;
  2373. }
  2374. return score;
  2375. }
  2376. _OriginalIsBoundary(index) {
  2377. if (index <= 0 || index >= this._originalElementsOrHash.length - 1) {
  2378. return true;
  2379. }
  2380. return this._hasStrings && /^\s*$/.test(this._originalStringElements[index]);
  2381. }
  2382. _OriginalRegionIsBoundary(originalStart, originalLength) {
  2383. if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) {
  2384. return true;
  2385. }
  2386. if (originalLength > 0) {
  2387. const originalEnd = originalStart + originalLength;
  2388. if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) {
  2389. return true;
  2390. }
  2391. }
  2392. return false;
  2393. }
  2394. _ModifiedIsBoundary(index) {
  2395. if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) {
  2396. return true;
  2397. }
  2398. return this._hasStrings && /^\s*$/.test(this._modifiedStringElements[index]);
  2399. }
  2400. _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) {
  2401. if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) {
  2402. return true;
  2403. }
  2404. if (modifiedLength > 0) {
  2405. const modifiedEnd = modifiedStart + modifiedLength;
  2406. if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) {
  2407. return true;
  2408. }
  2409. }
  2410. return false;
  2411. }
  2412. _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) {
  2413. const originalScore = this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0;
  2414. const modifiedScore = this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0;
  2415. return originalScore + modifiedScore;
  2416. }
  2417. ConcatenateChanges(left, right) {
  2418. let mergedChangeArr = [];
  2419. if (left.length === 0 || right.length === 0) {
  2420. return right.length > 0 ? right : left;
  2421. } else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) {
  2422. const result = new Array(left.length + right.length - 1);
  2423. MyArray.Copy(left, 0, result, 0, left.length - 1);
  2424. result[left.length - 1] = mergedChangeArr[0];
  2425. MyArray.Copy(right, 1, result, left.length, right.length - 1);
  2426. return result;
  2427. } else {
  2428. const result = new Array(left.length + right.length);
  2429. MyArray.Copy(left, 0, result, 0, left.length);
  2430. MyArray.Copy(right, 0, result, left.length, right.length);
  2431. return result;
  2432. }
  2433. }
  2434. ChangesOverlap(left, right, mergedChangeArr) {
  2435. Debug.Assert(left.originalStart <= right.originalStart, "Left change is not less than or equal to right change");
  2436. Debug.Assert(left.modifiedStart <= right.modifiedStart, "Left change is not less than or equal to right change");
  2437. if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) {
  2438. const originalStart = left.originalStart;
  2439. let originalLength = left.originalLength;
  2440. const modifiedStart = left.modifiedStart;
  2441. let modifiedLength = left.modifiedLength;
  2442. if (left.originalStart + left.originalLength >= right.originalStart) {
  2443. originalLength = right.originalStart + right.originalLength - left.originalStart;
  2444. }
  2445. if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) {
  2446. modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart;
  2447. }
  2448. mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength);
  2449. return true;
  2450. } else {
  2451. mergedChangeArr[0] = null;
  2452. return false;
  2453. }
  2454. }
  2455. ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) {
  2456. if (diagonal >= 0 && diagonal < numDiagonals) {
  2457. return diagonal;
  2458. }
  2459. const diagonalsBelow = diagonalBaseIndex;
  2460. const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;
  2461. const diffEven = numDifferences % 2 === 0;
  2462. if (diagonal < 0) {
  2463. const lowerBoundEven = diagonalsBelow % 2 === 0;
  2464. return diffEven === lowerBoundEven ? 0 : 1;
  2465. } else {
  2466. const upperBoundEven = diagonalsAbove % 2 === 0;
  2467. return diffEven === upperBoundEven ? numDiagonals - 1 : numDiagonals - 2;
  2468. }
  2469. }
  2470. };
  2471. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/process.js
  2472. var safeProcess;
  2473. if (typeof globals.vscode !== "undefined" && typeof globals.vscode.process !== "undefined") {
  2474. const sandboxProcess = globals.vscode.process;
  2475. safeProcess = {
  2476. get platform() {
  2477. return sandboxProcess.platform;
  2478. },
  2479. get arch() {
  2480. return sandboxProcess.arch;
  2481. },
  2482. get env() {
  2483. return sandboxProcess.env;
  2484. },
  2485. cwd() {
  2486. return sandboxProcess.cwd();
  2487. }
  2488. };
  2489. } else if (typeof process !== "undefined") {
  2490. safeProcess = {
  2491. get platform() {
  2492. return process.platform;
  2493. },
  2494. get arch() {
  2495. return process.arch;
  2496. },
  2497. get env() {
  2498. return process.env;
  2499. },
  2500. cwd() {
  2501. return process.env["VSCODE_CWD"] || process.cwd();
  2502. }
  2503. };
  2504. } else {
  2505. safeProcess = {
  2506. get platform() {
  2507. return isWindows ? "win32" : isMacintosh ? "darwin" : "linux";
  2508. },
  2509. get arch() {
  2510. return void 0;
  2511. },
  2512. get env() {
  2513. return {};
  2514. },
  2515. cwd() {
  2516. return "/";
  2517. }
  2518. };
  2519. }
  2520. var cwd = safeProcess.cwd;
  2521. var env = safeProcess.env;
  2522. var platform = safeProcess.platform;
  2523. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/path.js
  2524. var CHAR_UPPERCASE_A = 65;
  2525. var CHAR_LOWERCASE_A = 97;
  2526. var CHAR_UPPERCASE_Z = 90;
  2527. var CHAR_LOWERCASE_Z = 122;
  2528. var CHAR_DOT = 46;
  2529. var CHAR_FORWARD_SLASH = 47;
  2530. var CHAR_BACKWARD_SLASH = 92;
  2531. var CHAR_COLON = 58;
  2532. var CHAR_QUESTION_MARK = 63;
  2533. var ErrorInvalidArgType = class extends Error {
  2534. constructor(name, expected, actual) {
  2535. let determiner;
  2536. if (typeof expected === "string" && expected.indexOf("not ") === 0) {
  2537. determiner = "must not be";
  2538. expected = expected.replace(/^not /, "");
  2539. } else {
  2540. determiner = "must be";
  2541. }
  2542. const type = name.indexOf(".") !== -1 ? "property" : "argument";
  2543. let msg = `The "${name}" ${type} ${determiner} of type ${expected}`;
  2544. msg += `. Received type ${typeof actual}`;
  2545. super(msg);
  2546. this.code = "ERR_INVALID_ARG_TYPE";
  2547. }
  2548. };
  2549. function validateString(value, name) {
  2550. if (typeof value !== "string") {
  2551. throw new ErrorInvalidArgType(name, "string", value);
  2552. }
  2553. }
  2554. function isPathSeparator(code) {
  2555. return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
  2556. }
  2557. function isPosixPathSeparator(code) {
  2558. return code === CHAR_FORWARD_SLASH;
  2559. }
  2560. function isWindowsDeviceRoot(code) {
  2561. return code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z || code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z;
  2562. }
  2563. function normalizeString(path, allowAboveRoot, separator, isPathSeparator2) {
  2564. let res = "";
  2565. let lastSegmentLength = 0;
  2566. let lastSlash = -1;
  2567. let dots = 0;
  2568. let code = 0;
  2569. for (let i = 0; i <= path.length; ++i) {
  2570. if (i < path.length) {
  2571. code = path.charCodeAt(i);
  2572. } else if (isPathSeparator2(code)) {
  2573. break;
  2574. } else {
  2575. code = CHAR_FORWARD_SLASH;
  2576. }
  2577. if (isPathSeparator2(code)) {
  2578. if (lastSlash === i - 1 || dots === 1) {
  2579. } else if (dots === 2) {
  2580. if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
  2581. if (res.length > 2) {
  2582. const lastSlashIndex = res.lastIndexOf(separator);
  2583. if (lastSlashIndex === -1) {
  2584. res = "";
  2585. lastSegmentLength = 0;
  2586. } else {
  2587. res = res.slice(0, lastSlashIndex);
  2588. lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
  2589. }
  2590. lastSlash = i;
  2591. dots = 0;
  2592. continue;
  2593. } else if (res.length !== 0) {
  2594. res = "";
  2595. lastSegmentLength = 0;
  2596. lastSlash = i;
  2597. dots = 0;
  2598. continue;
  2599. }
  2600. }
  2601. if (allowAboveRoot) {
  2602. res += res.length > 0 ? `${separator}..` : "..";
  2603. lastSegmentLength = 2;
  2604. }
  2605. } else {
  2606. if (res.length > 0) {
  2607. res += `${separator}${path.slice(lastSlash + 1, i)}`;
  2608. } else {
  2609. res = path.slice(lastSlash + 1, i);
  2610. }
  2611. lastSegmentLength = i - lastSlash - 1;
  2612. }
  2613. lastSlash = i;
  2614. dots = 0;
  2615. } else if (code === CHAR_DOT && dots !== -1) {
  2616. ++dots;
  2617. } else {
  2618. dots = -1;
  2619. }
  2620. }
  2621. return res;
  2622. }
  2623. function _format(sep2, pathObject) {
  2624. if (pathObject === null || typeof pathObject !== "object") {
  2625. throw new ErrorInvalidArgType("pathObject", "Object", pathObject);
  2626. }
  2627. const dir = pathObject.dir || pathObject.root;
  2628. const base = pathObject.base || `${pathObject.name || ""}${pathObject.ext || ""}`;
  2629. if (!dir) {
  2630. return base;
  2631. }
  2632. return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep2}${base}`;
  2633. }
  2634. var win32 = {
  2635. resolve(...pathSegments) {
  2636. let resolvedDevice = "";
  2637. let resolvedTail = "";
  2638. let resolvedAbsolute = false;
  2639. for (let i = pathSegments.length - 1; i >= -1; i--) {
  2640. let path;
  2641. if (i >= 0) {
  2642. path = pathSegments[i];
  2643. validateString(path, "path");
  2644. if (path.length === 0) {
  2645. continue;
  2646. }
  2647. } else if (resolvedDevice.length === 0) {
  2648. path = cwd();
  2649. } else {
  2650. path = env[`=${resolvedDevice}`] || cwd();
  2651. if (path === void 0 || path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() && path.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
  2652. path = `${resolvedDevice}\\`;
  2653. }
  2654. }
  2655. const len = path.length;
  2656. let rootEnd = 0;
  2657. let device = "";
  2658. let isAbsolute = false;
  2659. const code = path.charCodeAt(0);
  2660. if (len === 1) {
  2661. if (isPathSeparator(code)) {
  2662. rootEnd = 1;
  2663. isAbsolute = true;
  2664. }
  2665. } else if (isPathSeparator(code)) {
  2666. isAbsolute = true;
  2667. if (isPathSeparator(path.charCodeAt(1))) {
  2668. let j = 2;
  2669. let last = j;
  2670. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2671. j++;
  2672. }
  2673. if (j < len && j !== last) {
  2674. const firstPart = path.slice(last, j);
  2675. last = j;
  2676. while (j < len && isPathSeparator(path.charCodeAt(j))) {
  2677. j++;
  2678. }
  2679. if (j < len && j !== last) {
  2680. last = j;
  2681. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2682. j++;
  2683. }
  2684. if (j === len || j !== last) {
  2685. device = `\\\\${firstPart}\\${path.slice(last, j)}`;
  2686. rootEnd = j;
  2687. }
  2688. }
  2689. }
  2690. } else {
  2691. rootEnd = 1;
  2692. }
  2693. } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
  2694. device = path.slice(0, 2);
  2695. rootEnd = 2;
  2696. if (len > 2 && isPathSeparator(path.charCodeAt(2))) {
  2697. isAbsolute = true;
  2698. rootEnd = 3;
  2699. }
  2700. }
  2701. if (device.length > 0) {
  2702. if (resolvedDevice.length > 0) {
  2703. if (device.toLowerCase() !== resolvedDevice.toLowerCase()) {
  2704. continue;
  2705. }
  2706. } else {
  2707. resolvedDevice = device;
  2708. }
  2709. }
  2710. if (resolvedAbsolute) {
  2711. if (resolvedDevice.length > 0) {
  2712. break;
  2713. }
  2714. } else {
  2715. resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
  2716. resolvedAbsolute = isAbsolute;
  2717. if (isAbsolute && resolvedDevice.length > 0) {
  2718. break;
  2719. }
  2720. }
  2721. }
  2722. resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator);
  2723. return resolvedAbsolute ? `${resolvedDevice}\\${resolvedTail}` : `${resolvedDevice}${resolvedTail}` || ".";
  2724. },
  2725. normalize(path) {
  2726. validateString(path, "path");
  2727. const len = path.length;
  2728. if (len === 0) {
  2729. return ".";
  2730. }
  2731. let rootEnd = 0;
  2732. let device;
  2733. let isAbsolute = false;
  2734. const code = path.charCodeAt(0);
  2735. if (len === 1) {
  2736. return isPosixPathSeparator(code) ? "\\" : path;
  2737. }
  2738. if (isPathSeparator(code)) {
  2739. isAbsolute = true;
  2740. if (isPathSeparator(path.charCodeAt(1))) {
  2741. let j = 2;
  2742. let last = j;
  2743. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2744. j++;
  2745. }
  2746. if (j < len && j !== last) {
  2747. const firstPart = path.slice(last, j);
  2748. last = j;
  2749. while (j < len && isPathSeparator(path.charCodeAt(j))) {
  2750. j++;
  2751. }
  2752. if (j < len && j !== last) {
  2753. last = j;
  2754. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2755. j++;
  2756. }
  2757. if (j === len) {
  2758. return `\\\\${firstPart}\\${path.slice(last)}\\`;
  2759. }
  2760. if (j !== last) {
  2761. device = `\\\\${firstPart}\\${path.slice(last, j)}`;
  2762. rootEnd = j;
  2763. }
  2764. }
  2765. }
  2766. } else {
  2767. rootEnd = 1;
  2768. }
  2769. } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
  2770. device = path.slice(0, 2);
  2771. rootEnd = 2;
  2772. if (len > 2 && isPathSeparator(path.charCodeAt(2))) {
  2773. isAbsolute = true;
  2774. rootEnd = 3;
  2775. }
  2776. }
  2777. let tail = rootEnd < len ? normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator) : "";
  2778. if (tail.length === 0 && !isAbsolute) {
  2779. tail = ".";
  2780. }
  2781. if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {
  2782. tail += "\\";
  2783. }
  2784. if (device === void 0) {
  2785. return isAbsolute ? `\\${tail}` : tail;
  2786. }
  2787. return isAbsolute ? `${device}\\${tail}` : `${device}${tail}`;
  2788. },
  2789. isAbsolute(path) {
  2790. validateString(path, "path");
  2791. const len = path.length;
  2792. if (len === 0) {
  2793. return false;
  2794. }
  2795. const code = path.charCodeAt(0);
  2796. return isPathSeparator(code) || len > 2 && isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON && isPathSeparator(path.charCodeAt(2));
  2797. },
  2798. join(...paths2) {
  2799. if (paths2.length === 0) {
  2800. return ".";
  2801. }
  2802. let joined;
  2803. let firstPart;
  2804. for (let i = 0; i < paths2.length; ++i) {
  2805. const arg = paths2[i];
  2806. validateString(arg, "path");
  2807. if (arg.length > 0) {
  2808. if (joined === void 0) {
  2809. joined = firstPart = arg;
  2810. } else {
  2811. joined += `\\${arg}`;
  2812. }
  2813. }
  2814. }
  2815. if (joined === void 0) {
  2816. return ".";
  2817. }
  2818. let needsReplace = true;
  2819. let slashCount = 0;
  2820. if (typeof firstPart === "string" && isPathSeparator(firstPart.charCodeAt(0))) {
  2821. ++slashCount;
  2822. const firstLen = firstPart.length;
  2823. if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) {
  2824. ++slashCount;
  2825. if (firstLen > 2) {
  2826. if (isPathSeparator(firstPart.charCodeAt(2))) {
  2827. ++slashCount;
  2828. } else {
  2829. needsReplace = false;
  2830. }
  2831. }
  2832. }
  2833. }
  2834. if (needsReplace) {
  2835. while (slashCount < joined.length && isPathSeparator(joined.charCodeAt(slashCount))) {
  2836. slashCount++;
  2837. }
  2838. if (slashCount >= 2) {
  2839. joined = `\\${joined.slice(slashCount)}`;
  2840. }
  2841. }
  2842. return win32.normalize(joined);
  2843. },
  2844. relative(from, to) {
  2845. validateString(from, "from");
  2846. validateString(to, "to");
  2847. if (from === to) {
  2848. return "";
  2849. }
  2850. const fromOrig = win32.resolve(from);
  2851. const toOrig = win32.resolve(to);
  2852. if (fromOrig === toOrig) {
  2853. return "";
  2854. }
  2855. from = fromOrig.toLowerCase();
  2856. to = toOrig.toLowerCase();
  2857. if (from === to) {
  2858. return "";
  2859. }
  2860. let fromStart = 0;
  2861. while (fromStart < from.length && from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) {
  2862. fromStart++;
  2863. }
  2864. let fromEnd = from.length;
  2865. while (fromEnd - 1 > fromStart && from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) {
  2866. fromEnd--;
  2867. }
  2868. const fromLen = fromEnd - fromStart;
  2869. let toStart = 0;
  2870. while (toStart < to.length && to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {
  2871. toStart++;
  2872. }
  2873. let toEnd = to.length;
  2874. while (toEnd - 1 > toStart && to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) {
  2875. toEnd--;
  2876. }
  2877. const toLen = toEnd - toStart;
  2878. const length = fromLen < toLen ? fromLen : toLen;
  2879. let lastCommonSep = -1;
  2880. let i = 0;
  2881. for (; i < length; i++) {
  2882. const fromCode = from.charCodeAt(fromStart + i);
  2883. if (fromCode !== to.charCodeAt(toStart + i)) {
  2884. break;
  2885. } else if (fromCode === CHAR_BACKWARD_SLASH) {
  2886. lastCommonSep = i;
  2887. }
  2888. }
  2889. if (i !== length) {
  2890. if (lastCommonSep === -1) {
  2891. return toOrig;
  2892. }
  2893. } else {
  2894. if (toLen > length) {
  2895. if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {
  2896. return toOrig.slice(toStart + i + 1);
  2897. }
  2898. if (i === 2) {
  2899. return toOrig.slice(toStart + i);
  2900. }
  2901. }
  2902. if (fromLen > length) {
  2903. if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {
  2904. lastCommonSep = i;
  2905. } else if (i === 2) {
  2906. lastCommonSep = 3;
  2907. }
  2908. }
  2909. if (lastCommonSep === -1) {
  2910. lastCommonSep = 0;
  2911. }
  2912. }
  2913. let out = "";
  2914. for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
  2915. if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {
  2916. out += out.length === 0 ? ".." : "\\..";
  2917. }
  2918. }
  2919. toStart += lastCommonSep;
  2920. if (out.length > 0) {
  2921. return `${out}${toOrig.slice(toStart, toEnd)}`;
  2922. }
  2923. if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {
  2924. ++toStart;
  2925. }
  2926. return toOrig.slice(toStart, toEnd);
  2927. },
  2928. toNamespacedPath(path) {
  2929. if (typeof path !== "string") {
  2930. return path;
  2931. }
  2932. if (path.length === 0) {
  2933. return "";
  2934. }
  2935. const resolvedPath = win32.resolve(path);
  2936. if (resolvedPath.length <= 2) {
  2937. return path;
  2938. }
  2939. if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {
  2940. if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {
  2941. const code = resolvedPath.charCodeAt(2);
  2942. if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {
  2943. return `\\\\?\\UNC\\${resolvedPath.slice(2)}`;
  2944. }
  2945. }
  2946. } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) && resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
  2947. return `\\\\?\\${resolvedPath}`;
  2948. }
  2949. return path;
  2950. },
  2951. dirname(path) {
  2952. validateString(path, "path");
  2953. const len = path.length;
  2954. if (len === 0) {
  2955. return ".";
  2956. }
  2957. let rootEnd = -1;
  2958. let offset = 0;
  2959. const code = path.charCodeAt(0);
  2960. if (len === 1) {
  2961. return isPathSeparator(code) ? path : ".";
  2962. }
  2963. if (isPathSeparator(code)) {
  2964. rootEnd = offset = 1;
  2965. if (isPathSeparator(path.charCodeAt(1))) {
  2966. let j = 2;
  2967. let last = j;
  2968. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2969. j++;
  2970. }
  2971. if (j < len && j !== last) {
  2972. last = j;
  2973. while (j < len && isPathSeparator(path.charCodeAt(j))) {
  2974. j++;
  2975. }
  2976. if (j < len && j !== last) {
  2977. last = j;
  2978. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2979. j++;
  2980. }
  2981. if (j === len) {
  2982. return path;
  2983. }
  2984. if (j !== last) {
  2985. rootEnd = offset = j + 1;
  2986. }
  2987. }
  2988. }
  2989. }
  2990. } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
  2991. rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2;
  2992. offset = rootEnd;
  2993. }
  2994. let end = -1;
  2995. let matchedSlash = true;
  2996. for (let i = len - 1; i >= offset; --i) {
  2997. if (isPathSeparator(path.charCodeAt(i))) {
  2998. if (!matchedSlash) {
  2999. end = i;
  3000. break;
  3001. }
  3002. } else {
  3003. matchedSlash = false;
  3004. }
  3005. }
  3006. if (end === -1) {
  3007. if (rootEnd === -1) {
  3008. return ".";
  3009. }
  3010. end = rootEnd;
  3011. }
  3012. return path.slice(0, end);
  3013. },
  3014. basename(path, ext) {
  3015. if (ext !== void 0) {
  3016. validateString(ext, "ext");
  3017. }
  3018. validateString(path, "path");
  3019. let start = 0;
  3020. let end = -1;
  3021. let matchedSlash = true;
  3022. let i;
  3023. if (path.length >= 2 && isWindowsDeviceRoot(path.charCodeAt(0)) && path.charCodeAt(1) === CHAR_COLON) {
  3024. start = 2;
  3025. }
  3026. if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
  3027. if (ext === path) {
  3028. return "";
  3029. }
  3030. let extIdx = ext.length - 1;
  3031. let firstNonSlashEnd = -1;
  3032. for (i = path.length - 1; i >= start; --i) {
  3033. const code = path.charCodeAt(i);
  3034. if (isPathSeparator(code)) {
  3035. if (!matchedSlash) {
  3036. start = i + 1;
  3037. break;
  3038. }
  3039. } else {
  3040. if (firstNonSlashEnd === -1) {
  3041. matchedSlash = false;
  3042. firstNonSlashEnd = i + 1;
  3043. }
  3044. if (extIdx >= 0) {
  3045. if (code === ext.charCodeAt(extIdx)) {
  3046. if (--extIdx === -1) {
  3047. end = i;
  3048. }
  3049. } else {
  3050. extIdx = -1;
  3051. end = firstNonSlashEnd;
  3052. }
  3053. }
  3054. }
  3055. }
  3056. if (start === end) {
  3057. end = firstNonSlashEnd;
  3058. } else if (end === -1) {
  3059. end = path.length;
  3060. }
  3061. return path.slice(start, end);
  3062. }
  3063. for (i = path.length - 1; i >= start; --i) {
  3064. if (isPathSeparator(path.charCodeAt(i))) {
  3065. if (!matchedSlash) {
  3066. start = i + 1;
  3067. break;
  3068. }
  3069. } else if (end === -1) {
  3070. matchedSlash = false;
  3071. end = i + 1;
  3072. }
  3073. }
  3074. if (end === -1) {
  3075. return "";
  3076. }
  3077. return path.slice(start, end);
  3078. },
  3079. extname(path) {
  3080. validateString(path, "path");
  3081. let start = 0;
  3082. let startDot = -1;
  3083. let startPart = 0;
  3084. let end = -1;
  3085. let matchedSlash = true;
  3086. let preDotState = 0;
  3087. if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) {
  3088. start = startPart = 2;
  3089. }
  3090. for (let i = path.length - 1; i >= start; --i) {
  3091. const code = path.charCodeAt(i);
  3092. if (isPathSeparator(code)) {
  3093. if (!matchedSlash) {
  3094. startPart = i + 1;
  3095. break;
  3096. }
  3097. continue;
  3098. }
  3099. if (end === -1) {
  3100. matchedSlash = false;
  3101. end = i + 1;
  3102. }
  3103. if (code === CHAR_DOT) {
  3104. if (startDot === -1) {
  3105. startDot = i;
  3106. } else if (preDotState !== 1) {
  3107. preDotState = 1;
  3108. }
  3109. } else if (startDot !== -1) {
  3110. preDotState = -1;
  3111. }
  3112. }
  3113. if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  3114. return "";
  3115. }
  3116. return path.slice(startDot, end);
  3117. },
  3118. format: _format.bind(null, "\\"),
  3119. parse(path) {
  3120. validateString(path, "path");
  3121. const ret = {root: "", dir: "", base: "", ext: "", name: ""};
  3122. if (path.length === 0) {
  3123. return ret;
  3124. }
  3125. const len = path.length;
  3126. let rootEnd = 0;
  3127. let code = path.charCodeAt(0);
  3128. if (len === 1) {
  3129. if (isPathSeparator(code)) {
  3130. ret.root = ret.dir = path;
  3131. return ret;
  3132. }
  3133. ret.base = ret.name = path;
  3134. return ret;
  3135. }
  3136. if (isPathSeparator(code)) {
  3137. rootEnd = 1;
  3138. if (isPathSeparator(path.charCodeAt(1))) {
  3139. let j = 2;
  3140. let last = j;
  3141. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  3142. j++;
  3143. }
  3144. if (j < len && j !== last) {
  3145. last = j;
  3146. while (j < len && isPathSeparator(path.charCodeAt(j))) {
  3147. j++;
  3148. }
  3149. if (j < len && j !== last) {
  3150. last = j;
  3151. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  3152. j++;
  3153. }
  3154. if (j === len) {
  3155. rootEnd = j;
  3156. } else if (j !== last) {
  3157. rootEnd = j + 1;
  3158. }
  3159. }
  3160. }
  3161. }
  3162. } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
  3163. if (len <= 2) {
  3164. ret.root = ret.dir = path;
  3165. return ret;
  3166. }
  3167. rootEnd = 2;
  3168. if (isPathSeparator(path.charCodeAt(2))) {
  3169. if (len === 3) {
  3170. ret.root = ret.dir = path;
  3171. return ret;
  3172. }
  3173. rootEnd = 3;
  3174. }
  3175. }
  3176. if (rootEnd > 0) {
  3177. ret.root = path.slice(0, rootEnd);
  3178. }
  3179. let startDot = -1;
  3180. let startPart = rootEnd;
  3181. let end = -1;
  3182. let matchedSlash = true;
  3183. let i = path.length - 1;
  3184. let preDotState = 0;
  3185. for (; i >= rootEnd; --i) {
  3186. code = path.charCodeAt(i);
  3187. if (isPathSeparator(code)) {
  3188. if (!matchedSlash) {
  3189. startPart = i + 1;
  3190. break;
  3191. }
  3192. continue;
  3193. }
  3194. if (end === -1) {
  3195. matchedSlash = false;
  3196. end = i + 1;
  3197. }
  3198. if (code === CHAR_DOT) {
  3199. if (startDot === -1) {
  3200. startDot = i;
  3201. } else if (preDotState !== 1) {
  3202. preDotState = 1;
  3203. }
  3204. } else if (startDot !== -1) {
  3205. preDotState = -1;
  3206. }
  3207. }
  3208. if (end !== -1) {
  3209. if (startDot === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  3210. ret.base = ret.name = path.slice(startPart, end);
  3211. } else {
  3212. ret.name = path.slice(startPart, startDot);
  3213. ret.base = path.slice(startPart, end);
  3214. ret.ext = path.slice(startDot, end);
  3215. }
  3216. }
  3217. if (startPart > 0 && startPart !== rootEnd) {
  3218. ret.dir = path.slice(0, startPart - 1);
  3219. } else {
  3220. ret.dir = ret.root;
  3221. }
  3222. return ret;
  3223. },
  3224. sep: "\\",
  3225. delimiter: ";",
  3226. win32: null,
  3227. posix: null
  3228. };
  3229. var posix = {
  3230. resolve(...pathSegments) {
  3231. let resolvedPath = "";
  3232. let resolvedAbsolute = false;
  3233. for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  3234. const path = i >= 0 ? pathSegments[i] : cwd();
  3235. validateString(path, "path");
  3236. if (path.length === 0) {
  3237. continue;
  3238. }
  3239. resolvedPath = `${path}/${resolvedPath}`;
  3240. resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
  3241. }
  3242. resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator);
  3243. if (resolvedAbsolute) {
  3244. return `/${resolvedPath}`;
  3245. }
  3246. return resolvedPath.length > 0 ? resolvedPath : ".";
  3247. },
  3248. normalize(path) {
  3249. validateString(path, "path");
  3250. if (path.length === 0) {
  3251. return ".";
  3252. }
  3253. const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
  3254. const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH;
  3255. path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
  3256. if (path.length === 0) {
  3257. if (isAbsolute) {
  3258. return "/";
  3259. }
  3260. return trailingSeparator ? "./" : ".";
  3261. }
  3262. if (trailingSeparator) {
  3263. path += "/";
  3264. }
  3265. return isAbsolute ? `/${path}` : path;
  3266. },
  3267. isAbsolute(path) {
  3268. validateString(path, "path");
  3269. return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH;
  3270. },
  3271. join(...paths2) {
  3272. if (paths2.length === 0) {
  3273. return ".";
  3274. }
  3275. let joined;
  3276. for (let i = 0; i < paths2.length; ++i) {
  3277. const arg = paths2[i];
  3278. validateString(arg, "path");
  3279. if (arg.length > 0) {
  3280. if (joined === void 0) {
  3281. joined = arg;
  3282. } else {
  3283. joined += `/${arg}`;
  3284. }
  3285. }
  3286. }
  3287. if (joined === void 0) {
  3288. return ".";
  3289. }
  3290. return posix.normalize(joined);
  3291. },
  3292. relative(from, to) {
  3293. validateString(from, "from");
  3294. validateString(to, "to");
  3295. if (from === to) {
  3296. return "";
  3297. }
  3298. from = posix.resolve(from);
  3299. to = posix.resolve(to);
  3300. if (from === to) {
  3301. return "";
  3302. }
  3303. const fromStart = 1;
  3304. const fromEnd = from.length;
  3305. const fromLen = fromEnd - fromStart;
  3306. const toStart = 1;
  3307. const toLen = to.length - toStart;
  3308. const length = fromLen < toLen ? fromLen : toLen;
  3309. let lastCommonSep = -1;
  3310. let i = 0;
  3311. for (; i < length; i++) {
  3312. const fromCode = from.charCodeAt(fromStart + i);
  3313. if (fromCode !== to.charCodeAt(toStart + i)) {
  3314. break;
  3315. } else if (fromCode === CHAR_FORWARD_SLASH) {
  3316. lastCommonSep = i;
  3317. }
  3318. }
  3319. if (i === length) {
  3320. if (toLen > length) {
  3321. if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) {
  3322. return to.slice(toStart + i + 1);
  3323. }
  3324. if (i === 0) {
  3325. return to.slice(toStart + i);
  3326. }
  3327. } else if (fromLen > length) {
  3328. if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) {
  3329. lastCommonSep = i;
  3330. } else if (i === 0) {
  3331. lastCommonSep = 0;
  3332. }
  3333. }
  3334. }
  3335. let out = "";
  3336. for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
  3337. if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) {
  3338. out += out.length === 0 ? ".." : "/..";
  3339. }
  3340. }
  3341. return `${out}${to.slice(toStart + lastCommonSep)}`;
  3342. },
  3343. toNamespacedPath(path) {
  3344. return path;
  3345. },
  3346. dirname(path) {
  3347. validateString(path, "path");
  3348. if (path.length === 0) {
  3349. return ".";
  3350. }
  3351. const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
  3352. let end = -1;
  3353. let matchedSlash = true;
  3354. for (let i = path.length - 1; i >= 1; --i) {
  3355. if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {
  3356. if (!matchedSlash) {
  3357. end = i;
  3358. break;
  3359. }
  3360. } else {
  3361. matchedSlash = false;
  3362. }
  3363. }
  3364. if (end === -1) {
  3365. return hasRoot ? "/" : ".";
  3366. }
  3367. if (hasRoot && end === 1) {
  3368. return "//";
  3369. }
  3370. return path.slice(0, end);
  3371. },
  3372. basename(path, ext) {
  3373. if (ext !== void 0) {
  3374. validateString(ext, "ext");
  3375. }
  3376. validateString(path, "path");
  3377. let start = 0;
  3378. let end = -1;
  3379. let matchedSlash = true;
  3380. let i;
  3381. if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
  3382. if (ext === path) {
  3383. return "";
  3384. }
  3385. let extIdx = ext.length - 1;
  3386. let firstNonSlashEnd = -1;
  3387. for (i = path.length - 1; i >= 0; --i) {
  3388. const code = path.charCodeAt(i);
  3389. if (code === CHAR_FORWARD_SLASH) {
  3390. if (!matchedSlash) {
  3391. start = i + 1;
  3392. break;
  3393. }
  3394. } else {
  3395. if (firstNonSlashEnd === -1) {
  3396. matchedSlash = false;
  3397. firstNonSlashEnd = i + 1;
  3398. }
  3399. if (extIdx >= 0) {
  3400. if (code === ext.charCodeAt(extIdx)) {
  3401. if (--extIdx === -1) {
  3402. end = i;
  3403. }
  3404. } else {
  3405. extIdx = -1;
  3406. end = firstNonSlashEnd;
  3407. }
  3408. }
  3409. }
  3410. }
  3411. if (start === end) {
  3412. end = firstNonSlashEnd;
  3413. } else if (end === -1) {
  3414. end = path.length;
  3415. }
  3416. return path.slice(start, end);
  3417. }
  3418. for (i = path.length - 1; i >= 0; --i) {
  3419. if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {
  3420. if (!matchedSlash) {
  3421. start = i + 1;
  3422. break;
  3423. }
  3424. } else if (end === -1) {
  3425. matchedSlash = false;
  3426. end = i + 1;
  3427. }
  3428. }
  3429. if (end === -1) {
  3430. return "";
  3431. }
  3432. return path.slice(start, end);
  3433. },
  3434. extname(path) {
  3435. validateString(path, "path");
  3436. let startDot = -1;
  3437. let startPart = 0;
  3438. let end = -1;
  3439. let matchedSlash = true;
  3440. let preDotState = 0;
  3441. for (let i = path.length - 1; i >= 0; --i) {
  3442. const code = path.charCodeAt(i);
  3443. if (code === CHAR_FORWARD_SLASH) {
  3444. if (!matchedSlash) {
  3445. startPart = i + 1;
  3446. break;
  3447. }
  3448. continue;
  3449. }
  3450. if (end === -1) {
  3451. matchedSlash = false;
  3452. end = i + 1;
  3453. }
  3454. if (code === CHAR_DOT) {
  3455. if (startDot === -1) {
  3456. startDot = i;
  3457. } else if (preDotState !== 1) {
  3458. preDotState = 1;
  3459. }
  3460. } else if (startDot !== -1) {
  3461. preDotState = -1;
  3462. }
  3463. }
  3464. if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  3465. return "";
  3466. }
  3467. return path.slice(startDot, end);
  3468. },
  3469. format: _format.bind(null, "/"),
  3470. parse(path) {
  3471. validateString(path, "path");
  3472. const ret = {root: "", dir: "", base: "", ext: "", name: ""};
  3473. if (path.length === 0) {
  3474. return ret;
  3475. }
  3476. const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
  3477. let start;
  3478. if (isAbsolute) {
  3479. ret.root = "/";
  3480. start = 1;
  3481. } else {
  3482. start = 0;
  3483. }
  3484. let startDot = -1;
  3485. let startPart = 0;
  3486. let end = -1;
  3487. let matchedSlash = true;
  3488. let i = path.length - 1;
  3489. let preDotState = 0;
  3490. for (; i >= start; --i) {
  3491. const code = path.charCodeAt(i);
  3492. if (code === CHAR_FORWARD_SLASH) {
  3493. if (!matchedSlash) {
  3494. startPart = i + 1;
  3495. break;
  3496. }
  3497. continue;
  3498. }
  3499. if (end === -1) {
  3500. matchedSlash = false;
  3501. end = i + 1;
  3502. }
  3503. if (code === CHAR_DOT) {
  3504. if (startDot === -1) {
  3505. startDot = i;
  3506. } else if (preDotState !== 1) {
  3507. preDotState = 1;
  3508. }
  3509. } else if (startDot !== -1) {
  3510. preDotState = -1;
  3511. }
  3512. }
  3513. if (end !== -1) {
  3514. const start2 = startPart === 0 && isAbsolute ? 1 : startPart;
  3515. if (startDot === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  3516. ret.base = ret.name = path.slice(start2, end);
  3517. } else {
  3518. ret.name = path.slice(start2, startDot);
  3519. ret.base = path.slice(start2, end);
  3520. ret.ext = path.slice(startDot, end);
  3521. }
  3522. }
  3523. if (startPart > 0) {
  3524. ret.dir = path.slice(0, startPart - 1);
  3525. } else if (isAbsolute) {
  3526. ret.dir = "/";
  3527. }
  3528. return ret;
  3529. },
  3530. sep: "/",
  3531. delimiter: ":",
  3532. win32: null,
  3533. posix: null
  3534. };
  3535. posix.win32 = win32.win32 = win32;
  3536. posix.posix = win32.posix = posix;
  3537. var normalize = platform === "win32" ? win32.normalize : posix.normalize;
  3538. var resolve = platform === "win32" ? win32.resolve : posix.resolve;
  3539. var relative = platform === "win32" ? win32.relative : posix.relative;
  3540. var dirname = platform === "win32" ? win32.dirname : posix.dirname;
  3541. var basename = platform === "win32" ? win32.basename : posix.basename;
  3542. var extname = platform === "win32" ? win32.extname : posix.extname;
  3543. var sep = platform === "win32" ? win32.sep : posix.sep;
  3544. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/uri.js
  3545. var _schemePattern = /^\w[\w\d+.-]*$/;
  3546. var _singleSlashStart = /^\//;
  3547. var _doubleSlashStart = /^\/\//;
  3548. function _validateUri(ret, _strict) {
  3549. if (!ret.scheme && _strict) {
  3550. throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${ret.authority}", path: "${ret.path}", query: "${ret.query}", fragment: "${ret.fragment}"}`);
  3551. }
  3552. if (ret.scheme && !_schemePattern.test(ret.scheme)) {
  3553. throw new Error("[UriError]: Scheme contains illegal characters.");
  3554. }
  3555. if (ret.path) {
  3556. if (ret.authority) {
  3557. if (!_singleSlashStart.test(ret.path)) {
  3558. throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
  3559. }
  3560. } else {
  3561. if (_doubleSlashStart.test(ret.path)) {
  3562. throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
  3563. }
  3564. }
  3565. }
  3566. }
  3567. function _schemeFix(scheme, _strict) {
  3568. if (!scheme && !_strict) {
  3569. return "file";
  3570. }
  3571. return scheme;
  3572. }
  3573. function _referenceResolution(scheme, path) {
  3574. switch (scheme) {
  3575. case "https":
  3576. case "http":
  3577. case "file":
  3578. if (!path) {
  3579. path = _slash;
  3580. } else if (path[0] !== _slash) {
  3581. path = _slash + path;
  3582. }
  3583. break;
  3584. }
  3585. return path;
  3586. }
  3587. var _empty = "";
  3588. var _slash = "/";
  3589. var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
  3590. var URI = class {
  3591. constructor(schemeOrData, authority, path, query, fragment, _strict = false) {
  3592. if (typeof schemeOrData === "object") {
  3593. this.scheme = schemeOrData.scheme || _empty;
  3594. this.authority = schemeOrData.authority || _empty;
  3595. this.path = schemeOrData.path || _empty;
  3596. this.query = schemeOrData.query || _empty;
  3597. this.fragment = schemeOrData.fragment || _empty;
  3598. } else {
  3599. this.scheme = _schemeFix(schemeOrData, _strict);
  3600. this.authority = authority || _empty;
  3601. this.path = _referenceResolution(this.scheme, path || _empty);
  3602. this.query = query || _empty;
  3603. this.fragment = fragment || _empty;
  3604. _validateUri(this, _strict);
  3605. }
  3606. }
  3607. static isUri(thing) {
  3608. if (thing instanceof URI) {
  3609. return true;
  3610. }
  3611. if (!thing) {
  3612. return false;
  3613. }
  3614. return typeof thing.authority === "string" && typeof thing.fragment === "string" && typeof thing.path === "string" && typeof thing.query === "string" && typeof thing.scheme === "string" && typeof thing.fsPath === "string" && typeof thing.with === "function" && typeof thing.toString === "function";
  3615. }
  3616. get fsPath() {
  3617. return uriToFsPath(this, false);
  3618. }
  3619. with(change) {
  3620. if (!change) {
  3621. return this;
  3622. }
  3623. let {scheme, authority, path, query, fragment} = change;
  3624. if (scheme === void 0) {
  3625. scheme = this.scheme;
  3626. } else if (scheme === null) {
  3627. scheme = _empty;
  3628. }
  3629. if (authority === void 0) {
  3630. authority = this.authority;
  3631. } else if (authority === null) {
  3632. authority = _empty;
  3633. }
  3634. if (path === void 0) {
  3635. path = this.path;
  3636. } else if (path === null) {
  3637. path = _empty;
  3638. }
  3639. if (query === void 0) {
  3640. query = this.query;
  3641. } else if (query === null) {
  3642. query = _empty;
  3643. }
  3644. if (fragment === void 0) {
  3645. fragment = this.fragment;
  3646. } else if (fragment === null) {
  3647. fragment = _empty;
  3648. }
  3649. if (scheme === this.scheme && authority === this.authority && path === this.path && query === this.query && fragment === this.fragment) {
  3650. return this;
  3651. }
  3652. return new Uri(scheme, authority, path, query, fragment);
  3653. }
  3654. static parse(value, _strict = false) {
  3655. const match = _regexp.exec(value);
  3656. if (!match) {
  3657. return new Uri(_empty, _empty, _empty, _empty, _empty);
  3658. }
  3659. return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);
  3660. }
  3661. static file(path) {
  3662. let authority = _empty;
  3663. if (isWindows) {
  3664. path = path.replace(/\\/g, _slash);
  3665. }
  3666. if (path[0] === _slash && path[1] === _slash) {
  3667. const idx = path.indexOf(_slash, 2);
  3668. if (idx === -1) {
  3669. authority = path.substring(2);
  3670. path = _slash;
  3671. } else {
  3672. authority = path.substring(2, idx);
  3673. path = path.substring(idx) || _slash;
  3674. }
  3675. }
  3676. return new Uri("file", authority, path, _empty, _empty);
  3677. }
  3678. static from(components) {
  3679. const result = new Uri(components.scheme, components.authority, components.path, components.query, components.fragment);
  3680. _validateUri(result, true);
  3681. return result;
  3682. }
  3683. static joinPath(uri, ...pathFragment) {
  3684. if (!uri.path) {
  3685. throw new Error(`[UriError]: cannot call joinPath on URI without path`);
  3686. }
  3687. let newPath;
  3688. if (isWindows && uri.scheme === "file") {
  3689. newPath = URI.file(win32.join(uriToFsPath(uri, true), ...pathFragment)).path;
  3690. } else {
  3691. newPath = posix.join(uri.path, ...pathFragment);
  3692. }
  3693. return uri.with({path: newPath});
  3694. }
  3695. toString(skipEncoding = false) {
  3696. return _asFormatted(this, skipEncoding);
  3697. }
  3698. toJSON() {
  3699. return this;
  3700. }
  3701. static revive(data) {
  3702. if (!data) {
  3703. return data;
  3704. } else if (data instanceof URI) {
  3705. return data;
  3706. } else {
  3707. const result = new Uri(data);
  3708. result._formatted = data.external;
  3709. result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null;
  3710. return result;
  3711. }
  3712. }
  3713. };
  3714. var _pathSepMarker = isWindows ? 1 : void 0;
  3715. var Uri = class extends URI {
  3716. constructor() {
  3717. super(...arguments);
  3718. this._formatted = null;
  3719. this._fsPath = null;
  3720. }
  3721. get fsPath() {
  3722. if (!this._fsPath) {
  3723. this._fsPath = uriToFsPath(this, false);
  3724. }
  3725. return this._fsPath;
  3726. }
  3727. toString(skipEncoding = false) {
  3728. if (!skipEncoding) {
  3729. if (!this._formatted) {
  3730. this._formatted = _asFormatted(this, false);
  3731. }
  3732. return this._formatted;
  3733. } else {
  3734. return _asFormatted(this, true);
  3735. }
  3736. }
  3737. toJSON() {
  3738. const res = {
  3739. $mid: 1
  3740. };
  3741. if (this._fsPath) {
  3742. res.fsPath = this._fsPath;
  3743. res._sep = _pathSepMarker;
  3744. }
  3745. if (this._formatted) {
  3746. res.external = this._formatted;
  3747. }
  3748. if (this.path) {
  3749. res.path = this.path;
  3750. }
  3751. if (this.scheme) {
  3752. res.scheme = this.scheme;
  3753. }
  3754. if (this.authority) {
  3755. res.authority = this.authority;
  3756. }
  3757. if (this.query) {
  3758. res.query = this.query;
  3759. }
  3760. if (this.fragment) {
  3761. res.fragment = this.fragment;
  3762. }
  3763. return res;
  3764. }
  3765. };
  3766. var encodeTable = {
  3767. [58]: "%3A",
  3768. [47]: "%2F",
  3769. [63]: "%3F",
  3770. [35]: "%23",
  3771. [91]: "%5B",
  3772. [93]: "%5D",
  3773. [64]: "%40",
  3774. [33]: "%21",
  3775. [36]: "%24",
  3776. [38]: "%26",
  3777. [39]: "%27",
  3778. [40]: "%28",
  3779. [41]: "%29",
  3780. [42]: "%2A",
  3781. [43]: "%2B",
  3782. [44]: "%2C",
  3783. [59]: "%3B",
  3784. [61]: "%3D",
  3785. [32]: "%20"
  3786. };
  3787. function encodeURIComponentFast(uriComponent, allowSlash) {
  3788. let res = void 0;
  3789. let nativeEncodePos = -1;
  3790. for (let pos = 0; pos < uriComponent.length; pos++) {
  3791. const code = uriComponent.charCodeAt(pos);
  3792. if (code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 45 || code === 46 || code === 95 || code === 126 || allowSlash && code === 47) {
  3793. if (nativeEncodePos !== -1) {
  3794. res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
  3795. nativeEncodePos = -1;
  3796. }
  3797. if (res !== void 0) {
  3798. res += uriComponent.charAt(pos);
  3799. }
  3800. } else {
  3801. if (res === void 0) {
  3802. res = uriComponent.substr(0, pos);
  3803. }
  3804. const escaped = encodeTable[code];
  3805. if (escaped !== void 0) {
  3806. if (nativeEncodePos !== -1) {
  3807. res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
  3808. nativeEncodePos = -1;
  3809. }
  3810. res += escaped;
  3811. } else if (nativeEncodePos === -1) {
  3812. nativeEncodePos = pos;
  3813. }
  3814. }
  3815. }
  3816. if (nativeEncodePos !== -1) {
  3817. res += encodeURIComponent(uriComponent.substring(nativeEncodePos));
  3818. }
  3819. return res !== void 0 ? res : uriComponent;
  3820. }
  3821. function encodeURIComponentMinimal(path) {
  3822. let res = void 0;
  3823. for (let pos = 0; pos < path.length; pos++) {
  3824. const code = path.charCodeAt(pos);
  3825. if (code === 35 || code === 63) {
  3826. if (res === void 0) {
  3827. res = path.substr(0, pos);
  3828. }
  3829. res += encodeTable[code];
  3830. } else {
  3831. if (res !== void 0) {
  3832. res += path[pos];
  3833. }
  3834. }
  3835. }
  3836. return res !== void 0 ? res : path;
  3837. }
  3838. function uriToFsPath(uri, keepDriveLetterCasing) {
  3839. let value;
  3840. if (uri.authority && uri.path.length > 1 && uri.scheme === "file") {
  3841. value = `//${uri.authority}${uri.path}`;
  3842. } else if (uri.path.charCodeAt(0) === 47 && (uri.path.charCodeAt(1) >= 65 && uri.path.charCodeAt(1) <= 90 || uri.path.charCodeAt(1) >= 97 && uri.path.charCodeAt(1) <= 122) && uri.path.charCodeAt(2) === 58) {
  3843. if (!keepDriveLetterCasing) {
  3844. value = uri.path[1].toLowerCase() + uri.path.substr(2);
  3845. } else {
  3846. value = uri.path.substr(1);
  3847. }
  3848. } else {
  3849. value = uri.path;
  3850. }
  3851. if (isWindows) {
  3852. value = value.replace(/\//g, "\\");
  3853. }
  3854. return value;
  3855. }
  3856. function _asFormatted(uri, skipEncoding) {
  3857. const encoder = !skipEncoding ? encodeURIComponentFast : encodeURIComponentMinimal;
  3858. let res = "";
  3859. let {scheme, authority, path, query, fragment} = uri;
  3860. if (scheme) {
  3861. res += scheme;
  3862. res += ":";
  3863. }
  3864. if (authority || scheme === "file") {
  3865. res += _slash;
  3866. res += _slash;
  3867. }
  3868. if (authority) {
  3869. let idx = authority.indexOf("@");
  3870. if (idx !== -1) {
  3871. const userinfo = authority.substr(0, idx);
  3872. authority = authority.substr(idx + 1);
  3873. idx = userinfo.indexOf(":");
  3874. if (idx === -1) {
  3875. res += encoder(userinfo, false);
  3876. } else {
  3877. res += encoder(userinfo.substr(0, idx), false);
  3878. res += ":";
  3879. res += encoder(userinfo.substr(idx + 1), false);
  3880. }
  3881. res += "@";
  3882. }
  3883. authority = authority.toLowerCase();
  3884. idx = authority.indexOf(":");
  3885. if (idx === -1) {
  3886. res += encoder(authority, false);
  3887. } else {
  3888. res += encoder(authority.substr(0, idx), false);
  3889. res += authority.substr(idx);
  3890. }
  3891. }
  3892. if (path) {
  3893. if (path.length >= 3 && path.charCodeAt(0) === 47 && path.charCodeAt(2) === 58) {
  3894. const code = path.charCodeAt(1);
  3895. if (code >= 65 && code <= 90) {
  3896. path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`;
  3897. }
  3898. } else if (path.length >= 2 && path.charCodeAt(1) === 58) {
  3899. const code = path.charCodeAt(0);
  3900. if (code >= 65 && code <= 90) {
  3901. path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`;
  3902. }
  3903. }
  3904. res += encoder(path, true);
  3905. }
  3906. if (query) {
  3907. res += "?";
  3908. res += encoder(query, false);
  3909. }
  3910. if (fragment) {
  3911. res += "#";
  3912. res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;
  3913. }
  3914. return res;
  3915. }
  3916. function decodeURIComponentGraceful(str) {
  3917. try {
  3918. return decodeURIComponent(str);
  3919. } catch (_a3) {
  3920. if (str.length > 3) {
  3921. return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));
  3922. } else {
  3923. return str;
  3924. }
  3925. }
  3926. }
  3927. var _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
  3928. function percentDecode(str) {
  3929. if (!str.match(_rEncodedAsHex)) {
  3930. return str;
  3931. }
  3932. return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match));
  3933. }
  3934. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/core/position.js
  3935. var Position = class {
  3936. constructor(lineNumber, column) {
  3937. this.lineNumber = lineNumber;
  3938. this.column = column;
  3939. }
  3940. with(newLineNumber = this.lineNumber, newColumn = this.column) {
  3941. if (newLineNumber === this.lineNumber && newColumn === this.column) {
  3942. return this;
  3943. } else {
  3944. return new Position(newLineNumber, newColumn);
  3945. }
  3946. }
  3947. delta(deltaLineNumber = 0, deltaColumn = 0) {
  3948. return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn);
  3949. }
  3950. equals(other) {
  3951. return Position.equals(this, other);
  3952. }
  3953. static equals(a2, b) {
  3954. if (!a2 && !b) {
  3955. return true;
  3956. }
  3957. return !!a2 && !!b && a2.lineNumber === b.lineNumber && a2.column === b.column;
  3958. }
  3959. isBefore(other) {
  3960. return Position.isBefore(this, other);
  3961. }
  3962. static isBefore(a2, b) {
  3963. if (a2.lineNumber < b.lineNumber) {
  3964. return true;
  3965. }
  3966. if (b.lineNumber < a2.lineNumber) {
  3967. return false;
  3968. }
  3969. return a2.column < b.column;
  3970. }
  3971. isBeforeOrEqual(other) {
  3972. return Position.isBeforeOrEqual(this, other);
  3973. }
  3974. static isBeforeOrEqual(a2, b) {
  3975. if (a2.lineNumber < b.lineNumber) {
  3976. return true;
  3977. }
  3978. if (b.lineNumber < a2.lineNumber) {
  3979. return false;
  3980. }
  3981. return a2.column <= b.column;
  3982. }
  3983. static compare(a2, b) {
  3984. const aLineNumber = a2.lineNumber | 0;
  3985. const bLineNumber = b.lineNumber | 0;
  3986. if (aLineNumber === bLineNumber) {
  3987. const aColumn = a2.column | 0;
  3988. const bColumn = b.column | 0;
  3989. return aColumn - bColumn;
  3990. }
  3991. return aLineNumber - bLineNumber;
  3992. }
  3993. clone() {
  3994. return new Position(this.lineNumber, this.column);
  3995. }
  3996. toString() {
  3997. return "(" + this.lineNumber + "," + this.column + ")";
  3998. }
  3999. static lift(pos) {
  4000. return new Position(pos.lineNumber, pos.column);
  4001. }
  4002. static isIPosition(obj) {
  4003. return obj && typeof obj.lineNumber === "number" && typeof obj.column === "number";
  4004. }
  4005. };
  4006. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/core/range.js
  4007. var Range = class {
  4008. constructor(startLineNumber, startColumn, endLineNumber, endColumn) {
  4009. if (startLineNumber > endLineNumber || startLineNumber === endLineNumber && startColumn > endColumn) {
  4010. this.startLineNumber = endLineNumber;
  4011. this.startColumn = endColumn;
  4012. this.endLineNumber = startLineNumber;
  4013. this.endColumn = startColumn;
  4014. } else {
  4015. this.startLineNumber = startLineNumber;
  4016. this.startColumn = startColumn;
  4017. this.endLineNumber = endLineNumber;
  4018. this.endColumn = endColumn;
  4019. }
  4020. }
  4021. isEmpty() {
  4022. return Range.isEmpty(this);
  4023. }
  4024. static isEmpty(range) {
  4025. return range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn;
  4026. }
  4027. containsPosition(position) {
  4028. return Range.containsPosition(this, position);
  4029. }
  4030. static containsPosition(range, position) {
  4031. if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {
  4032. return false;
  4033. }
  4034. if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) {
  4035. return false;
  4036. }
  4037. if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) {
  4038. return false;
  4039. }
  4040. return true;
  4041. }
  4042. static strictContainsPosition(range, position) {
  4043. if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {
  4044. return false;
  4045. }
  4046. if (position.lineNumber === range.startLineNumber && position.column <= range.startColumn) {
  4047. return false;
  4048. }
  4049. if (position.lineNumber === range.endLineNumber && position.column >= range.endColumn) {
  4050. return false;
  4051. }
  4052. return true;
  4053. }
  4054. containsRange(range) {
  4055. return Range.containsRange(this, range);
  4056. }
  4057. static containsRange(range, otherRange) {
  4058. if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {
  4059. return false;
  4060. }
  4061. if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {
  4062. return false;
  4063. }
  4064. if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) {
  4065. return false;
  4066. }
  4067. if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) {
  4068. return false;
  4069. }
  4070. return true;
  4071. }
  4072. strictContainsRange(range) {
  4073. return Range.strictContainsRange(this, range);
  4074. }
  4075. static strictContainsRange(range, otherRange) {
  4076. if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {
  4077. return false;
  4078. }
  4079. if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {
  4080. return false;
  4081. }
  4082. if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) {
  4083. return false;
  4084. }
  4085. if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) {
  4086. return false;
  4087. }
  4088. return true;
  4089. }
  4090. plusRange(range) {
  4091. return Range.plusRange(this, range);
  4092. }
  4093. static plusRange(a2, b) {
  4094. let startLineNumber;
  4095. let startColumn;
  4096. let endLineNumber;
  4097. let endColumn;
  4098. if (b.startLineNumber < a2.startLineNumber) {
  4099. startLineNumber = b.startLineNumber;
  4100. startColumn = b.startColumn;
  4101. } else if (b.startLineNumber === a2.startLineNumber) {
  4102. startLineNumber = b.startLineNumber;
  4103. startColumn = Math.min(b.startColumn, a2.startColumn);
  4104. } else {
  4105. startLineNumber = a2.startLineNumber;
  4106. startColumn = a2.startColumn;
  4107. }
  4108. if (b.endLineNumber > a2.endLineNumber) {
  4109. endLineNumber = b.endLineNumber;
  4110. endColumn = b.endColumn;
  4111. } else if (b.endLineNumber === a2.endLineNumber) {
  4112. endLineNumber = b.endLineNumber;
  4113. endColumn = Math.max(b.endColumn, a2.endColumn);
  4114. } else {
  4115. endLineNumber = a2.endLineNumber;
  4116. endColumn = a2.endColumn;
  4117. }
  4118. return new Range(startLineNumber, startColumn, endLineNumber, endColumn);
  4119. }
  4120. intersectRanges(range) {
  4121. return Range.intersectRanges(this, range);
  4122. }
  4123. static intersectRanges(a2, b) {
  4124. let resultStartLineNumber = a2.startLineNumber;
  4125. let resultStartColumn = a2.startColumn;
  4126. let resultEndLineNumber = a2.endLineNumber;
  4127. let resultEndColumn = a2.endColumn;
  4128. let otherStartLineNumber = b.startLineNumber;
  4129. let otherStartColumn = b.startColumn;
  4130. let otherEndLineNumber = b.endLineNumber;
  4131. let otherEndColumn = b.endColumn;
  4132. if (resultStartLineNumber < otherStartLineNumber) {
  4133. resultStartLineNumber = otherStartLineNumber;
  4134. resultStartColumn = otherStartColumn;
  4135. } else if (resultStartLineNumber === otherStartLineNumber) {
  4136. resultStartColumn = Math.max(resultStartColumn, otherStartColumn);
  4137. }
  4138. if (resultEndLineNumber > otherEndLineNumber) {
  4139. resultEndLineNumber = otherEndLineNumber;
  4140. resultEndColumn = otherEndColumn;
  4141. } else if (resultEndLineNumber === otherEndLineNumber) {
  4142. resultEndColumn = Math.min(resultEndColumn, otherEndColumn);
  4143. }
  4144. if (resultStartLineNumber > resultEndLineNumber) {
  4145. return null;
  4146. }
  4147. if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) {
  4148. return null;
  4149. }
  4150. return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn);
  4151. }
  4152. equalsRange(other) {
  4153. return Range.equalsRange(this, other);
  4154. }
  4155. static equalsRange(a2, b) {
  4156. return !!a2 && !!b && a2.startLineNumber === b.startLineNumber && a2.startColumn === b.startColumn && a2.endLineNumber === b.endLineNumber && a2.endColumn === b.endColumn;
  4157. }
  4158. getEndPosition() {
  4159. return Range.getEndPosition(this);
  4160. }
  4161. static getEndPosition(range) {
  4162. return new Position(range.endLineNumber, range.endColumn);
  4163. }
  4164. getStartPosition() {
  4165. return Range.getStartPosition(this);
  4166. }
  4167. static getStartPosition(range) {
  4168. return new Position(range.startLineNumber, range.startColumn);
  4169. }
  4170. toString() {
  4171. return "[" + this.startLineNumber + "," + this.startColumn + " -> " + this.endLineNumber + "," + this.endColumn + "]";
  4172. }
  4173. setEndPosition(endLineNumber, endColumn) {
  4174. return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn);
  4175. }
  4176. setStartPosition(startLineNumber, startColumn) {
  4177. return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn);
  4178. }
  4179. collapseToStart() {
  4180. return Range.collapseToStart(this);
  4181. }
  4182. static collapseToStart(range) {
  4183. return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn);
  4184. }
  4185. static fromPositions(start, end = start) {
  4186. return new Range(start.lineNumber, start.column, end.lineNumber, end.column);
  4187. }
  4188. static lift(range) {
  4189. if (!range) {
  4190. return null;
  4191. }
  4192. return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);
  4193. }
  4194. static isIRange(obj) {
  4195. return obj && typeof obj.startLineNumber === "number" && typeof obj.startColumn === "number" && typeof obj.endLineNumber === "number" && typeof obj.endColumn === "number";
  4196. }
  4197. static areIntersectingOrTouching(a2, b) {
  4198. if (a2.endLineNumber < b.startLineNumber || a2.endLineNumber === b.startLineNumber && a2.endColumn < b.startColumn) {
  4199. return false;
  4200. }
  4201. if (b.endLineNumber < a2.startLineNumber || b.endLineNumber === a2.startLineNumber && b.endColumn < a2.startColumn) {
  4202. return false;
  4203. }
  4204. return true;
  4205. }
  4206. static areIntersecting(a2, b) {
  4207. if (a2.endLineNumber < b.startLineNumber || a2.endLineNumber === b.startLineNumber && a2.endColumn <= b.startColumn) {
  4208. return false;
  4209. }
  4210. if (b.endLineNumber < a2.startLineNumber || b.endLineNumber === a2.startLineNumber && b.endColumn <= a2.startColumn) {
  4211. return false;
  4212. }
  4213. return true;
  4214. }
  4215. static compareRangesUsingStarts(a2, b) {
  4216. if (a2 && b) {
  4217. const aStartLineNumber = a2.startLineNumber | 0;
  4218. const bStartLineNumber = b.startLineNumber | 0;
  4219. if (aStartLineNumber === bStartLineNumber) {
  4220. const aStartColumn = a2.startColumn | 0;
  4221. const bStartColumn = b.startColumn | 0;
  4222. if (aStartColumn === bStartColumn) {
  4223. const aEndLineNumber = a2.endLineNumber | 0;
  4224. const bEndLineNumber = b.endLineNumber | 0;
  4225. if (aEndLineNumber === bEndLineNumber) {
  4226. const aEndColumn = a2.endColumn | 0;
  4227. const bEndColumn = b.endColumn | 0;
  4228. return aEndColumn - bEndColumn;
  4229. }
  4230. return aEndLineNumber - bEndLineNumber;
  4231. }
  4232. return aStartColumn - bStartColumn;
  4233. }
  4234. return aStartLineNumber - bStartLineNumber;
  4235. }
  4236. const aExists = a2 ? 1 : 0;
  4237. const bExists = b ? 1 : 0;
  4238. return aExists - bExists;
  4239. }
  4240. static compareRangesUsingEnds(a2, b) {
  4241. if (a2.endLineNumber === b.endLineNumber) {
  4242. if (a2.endColumn === b.endColumn) {
  4243. if (a2.startLineNumber === b.startLineNumber) {
  4244. return a2.startColumn - b.startColumn;
  4245. }
  4246. return a2.startLineNumber - b.startLineNumber;
  4247. }
  4248. return a2.endColumn - b.endColumn;
  4249. }
  4250. return a2.endLineNumber - b.endLineNumber;
  4251. }
  4252. static spansMultipleLines(range) {
  4253. return range.endLineNumber > range.startLineNumber;
  4254. }
  4255. toJSON() {
  4256. return this;
  4257. }
  4258. };
  4259. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js
  4260. var MINIMUM_MATCHING_CHARACTER_LENGTH = 3;
  4261. function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) {
  4262. const diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);
  4263. return diffAlgo.ComputeDiff(pretty);
  4264. }
  4265. var LineSequence = class {
  4266. constructor(lines) {
  4267. const startColumns = [];
  4268. const endColumns = [];
  4269. for (let i = 0, length = lines.length; i < length; i++) {
  4270. startColumns[i] = getFirstNonBlankColumn(lines[i], 1);
  4271. endColumns[i] = getLastNonBlankColumn(lines[i], 1);
  4272. }
  4273. this.lines = lines;
  4274. this._startColumns = startColumns;
  4275. this._endColumns = endColumns;
  4276. }
  4277. getElements() {
  4278. const elements = [];
  4279. for (let i = 0, len = this.lines.length; i < len; i++) {
  4280. elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);
  4281. }
  4282. return elements;
  4283. }
  4284. getStrictElement(index) {
  4285. return this.lines[index];
  4286. }
  4287. getStartLineNumber(i) {
  4288. return i + 1;
  4289. }
  4290. getEndLineNumber(i) {
  4291. return i + 1;
  4292. }
  4293. createCharSequence(shouldIgnoreTrimWhitespace, startIndex, endIndex) {
  4294. const charCodes = [];
  4295. const lineNumbers = [];
  4296. const columns = [];
  4297. let len = 0;
  4298. for (let index = startIndex; index <= endIndex; index++) {
  4299. const lineContent = this.lines[index];
  4300. const startColumn = shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1;
  4301. const endColumn = shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1;
  4302. for (let col = startColumn; col < endColumn; col++) {
  4303. charCodes[len] = lineContent.charCodeAt(col - 1);
  4304. lineNumbers[len] = index + 1;
  4305. columns[len] = col;
  4306. len++;
  4307. }
  4308. }
  4309. return new CharSequence(charCodes, lineNumbers, columns);
  4310. }
  4311. };
  4312. var CharSequence = class {
  4313. constructor(charCodes, lineNumbers, columns) {
  4314. this._charCodes = charCodes;
  4315. this._lineNumbers = lineNumbers;
  4316. this._columns = columns;
  4317. }
  4318. getElements() {
  4319. return this._charCodes;
  4320. }
  4321. getStartLineNumber(i) {
  4322. return this._lineNumbers[i];
  4323. }
  4324. getStartColumn(i) {
  4325. return this._columns[i];
  4326. }
  4327. getEndLineNumber(i) {
  4328. return this._lineNumbers[i];
  4329. }
  4330. getEndColumn(i) {
  4331. return this._columns[i] + 1;
  4332. }
  4333. };
  4334. var CharChange = class {
  4335. constructor(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) {
  4336. this.originalStartLineNumber = originalStartLineNumber;
  4337. this.originalStartColumn = originalStartColumn;
  4338. this.originalEndLineNumber = originalEndLineNumber;
  4339. this.originalEndColumn = originalEndColumn;
  4340. this.modifiedStartLineNumber = modifiedStartLineNumber;
  4341. this.modifiedStartColumn = modifiedStartColumn;
  4342. this.modifiedEndLineNumber = modifiedEndLineNumber;
  4343. this.modifiedEndColumn = modifiedEndColumn;
  4344. }
  4345. static createFromDiffChange(diffChange, originalCharSequence, modifiedCharSequence) {
  4346. let originalStartLineNumber;
  4347. let originalStartColumn;
  4348. let originalEndLineNumber;
  4349. let originalEndColumn;
  4350. let modifiedStartLineNumber;
  4351. let modifiedStartColumn;
  4352. let modifiedEndLineNumber;
  4353. let modifiedEndColumn;
  4354. if (diffChange.originalLength === 0) {
  4355. originalStartLineNumber = 0;
  4356. originalStartColumn = 0;
  4357. originalEndLineNumber = 0;
  4358. originalEndColumn = 0;
  4359. } else {
  4360. originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart);
  4361. originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart);
  4362. originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);
  4363. originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1);
  4364. }
  4365. if (diffChange.modifiedLength === 0) {
  4366. modifiedStartLineNumber = 0;
  4367. modifiedStartColumn = 0;
  4368. modifiedEndLineNumber = 0;
  4369. modifiedEndColumn = 0;
  4370. } else {
  4371. modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart);
  4372. modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart);
  4373. modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);
  4374. modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1);
  4375. }
  4376. return new CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn);
  4377. }
  4378. };
  4379. function postProcessCharChanges(rawChanges) {
  4380. if (rawChanges.length <= 1) {
  4381. return rawChanges;
  4382. }
  4383. const result = [rawChanges[0]];
  4384. let prevChange = result[0];
  4385. for (let i = 1, len = rawChanges.length; i < len; i++) {
  4386. const currChange = rawChanges[i];
  4387. const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength);
  4388. const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength);
  4389. const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength);
  4390. if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) {
  4391. prevChange.originalLength = currChange.originalStart + currChange.originalLength - prevChange.originalStart;
  4392. prevChange.modifiedLength = currChange.modifiedStart + currChange.modifiedLength - prevChange.modifiedStart;
  4393. } else {
  4394. result.push(currChange);
  4395. prevChange = currChange;
  4396. }
  4397. }
  4398. return result;
  4399. }
  4400. var LineChange = class {
  4401. constructor(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) {
  4402. this.originalStartLineNumber = originalStartLineNumber;
  4403. this.originalEndLineNumber = originalEndLineNumber;
  4404. this.modifiedStartLineNumber = modifiedStartLineNumber;
  4405. this.modifiedEndLineNumber = modifiedEndLineNumber;
  4406. this.charChanges = charChanges;
  4407. }
  4408. static createFromDiffResult(shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) {
  4409. let originalStartLineNumber;
  4410. let originalEndLineNumber;
  4411. let modifiedStartLineNumber;
  4412. let modifiedEndLineNumber;
  4413. let charChanges = void 0;
  4414. if (diffChange.originalLength === 0) {
  4415. originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1;
  4416. originalEndLineNumber = 0;
  4417. } else {
  4418. originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart);
  4419. originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);
  4420. }
  4421. if (diffChange.modifiedLength === 0) {
  4422. modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1;
  4423. modifiedEndLineNumber = 0;
  4424. } else {
  4425. modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart);
  4426. modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);
  4427. }
  4428. if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) {
  4429. const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);
  4430. const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);
  4431. let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes;
  4432. if (shouldPostProcessCharChanges) {
  4433. rawChanges = postProcessCharChanges(rawChanges);
  4434. }
  4435. charChanges = [];
  4436. for (let i = 0, length = rawChanges.length; i < length; i++) {
  4437. charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence));
  4438. }
  4439. }
  4440. return new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges);
  4441. }
  4442. };
  4443. var DiffComputer = class {
  4444. constructor(originalLines, modifiedLines, opts) {
  4445. this.shouldComputeCharChanges = opts.shouldComputeCharChanges;
  4446. this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges;
  4447. this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace;
  4448. this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff;
  4449. this.originalLines = originalLines;
  4450. this.modifiedLines = modifiedLines;
  4451. this.original = new LineSequence(originalLines);
  4452. this.modified = new LineSequence(modifiedLines);
  4453. this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime);
  4454. this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5e3));
  4455. }
  4456. computeDiff() {
  4457. if (this.original.lines.length === 1 && this.original.lines[0].length === 0) {
  4458. if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {
  4459. return {
  4460. quitEarly: false,
  4461. changes: []
  4462. };
  4463. }
  4464. return {
  4465. quitEarly: false,
  4466. changes: [{
  4467. originalStartLineNumber: 1,
  4468. originalEndLineNumber: 1,
  4469. modifiedStartLineNumber: 1,
  4470. modifiedEndLineNumber: this.modified.lines.length,
  4471. charChanges: [{
  4472. modifiedEndColumn: 0,
  4473. modifiedEndLineNumber: 0,
  4474. modifiedStartColumn: 0,
  4475. modifiedStartLineNumber: 0,
  4476. originalEndColumn: 0,
  4477. originalEndLineNumber: 0,
  4478. originalStartColumn: 0,
  4479. originalStartLineNumber: 0
  4480. }]
  4481. }]
  4482. };
  4483. }
  4484. if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {
  4485. return {
  4486. quitEarly: false,
  4487. changes: [{
  4488. originalStartLineNumber: 1,
  4489. originalEndLineNumber: this.original.lines.length,
  4490. modifiedStartLineNumber: 1,
  4491. modifiedEndLineNumber: 1,
  4492. charChanges: [{
  4493. modifiedEndColumn: 0,
  4494. modifiedEndLineNumber: 0,
  4495. modifiedStartColumn: 0,
  4496. modifiedStartLineNumber: 0,
  4497. originalEndColumn: 0,
  4498. originalEndLineNumber: 0,
  4499. originalStartColumn: 0,
  4500. originalStartLineNumber: 0
  4501. }]
  4502. }]
  4503. };
  4504. }
  4505. const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff);
  4506. const rawChanges = diffResult.changes;
  4507. const quitEarly = diffResult.quitEarly;
  4508. if (this.shouldIgnoreTrimWhitespace) {
  4509. const lineChanges = [];
  4510. for (let i = 0, length = rawChanges.length; i < length; i++) {
  4511. lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
  4512. }
  4513. return {
  4514. quitEarly,
  4515. changes: lineChanges
  4516. };
  4517. }
  4518. const result = [];
  4519. let originalLineIndex = 0;
  4520. let modifiedLineIndex = 0;
  4521. for (let i = -1, len = rawChanges.length; i < len; i++) {
  4522. const nextChange = i + 1 < len ? rawChanges[i + 1] : null;
  4523. const originalStop = nextChange ? nextChange.originalStart : this.originalLines.length;
  4524. const modifiedStop = nextChange ? nextChange.modifiedStart : this.modifiedLines.length;
  4525. while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {
  4526. const originalLine = this.originalLines[originalLineIndex];
  4527. const modifiedLine = this.modifiedLines[modifiedLineIndex];
  4528. if (originalLine !== modifiedLine) {
  4529. {
  4530. let originalStartColumn = getFirstNonBlankColumn(originalLine, 1);
  4531. let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1);
  4532. while (originalStartColumn > 1 && modifiedStartColumn > 1) {
  4533. const originalChar = originalLine.charCodeAt(originalStartColumn - 2);
  4534. const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2);
  4535. if (originalChar !== modifiedChar) {
  4536. break;
  4537. }
  4538. originalStartColumn--;
  4539. modifiedStartColumn--;
  4540. }
  4541. if (originalStartColumn > 1 || modifiedStartColumn > 1) {
  4542. this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn);
  4543. }
  4544. }
  4545. {
  4546. let originalEndColumn = getLastNonBlankColumn(originalLine, 1);
  4547. let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1);
  4548. const originalMaxColumn = originalLine.length + 1;
  4549. const modifiedMaxColumn = modifiedLine.length + 1;
  4550. while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) {
  4551. const originalChar = originalLine.charCodeAt(originalEndColumn - 1);
  4552. const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1);
  4553. if (originalChar !== modifiedChar) {
  4554. break;
  4555. }
  4556. originalEndColumn++;
  4557. modifiedEndColumn++;
  4558. }
  4559. if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) {
  4560. this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn);
  4561. }
  4562. }
  4563. }
  4564. originalLineIndex++;
  4565. modifiedLineIndex++;
  4566. }
  4567. if (nextChange) {
  4568. result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
  4569. originalLineIndex += nextChange.originalLength;
  4570. modifiedLineIndex += nextChange.modifiedLength;
  4571. }
  4572. }
  4573. return {
  4574. quitEarly,
  4575. changes: result
  4576. };
  4577. }
  4578. _pushTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {
  4579. if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) {
  4580. return;
  4581. }
  4582. let charChanges = void 0;
  4583. if (this.shouldComputeCharChanges) {
  4584. charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)];
  4585. }
  4586. result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges));
  4587. }
  4588. _mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {
  4589. const len = result.length;
  4590. if (len === 0) {
  4591. return false;
  4592. }
  4593. const prevChange = result[len - 1];
  4594. if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) {
  4595. return false;
  4596. }
  4597. if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) {
  4598. prevChange.originalEndLineNumber = originalLineNumber;
  4599. prevChange.modifiedEndLineNumber = modifiedLineNumber;
  4600. if (this.shouldComputeCharChanges && prevChange.charChanges) {
  4601. prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn));
  4602. }
  4603. return true;
  4604. }
  4605. return false;
  4606. }
  4607. };
  4608. function getFirstNonBlankColumn(txt, defaultValue) {
  4609. const r = firstNonWhitespaceIndex(txt);
  4610. if (r === -1) {
  4611. return defaultValue;
  4612. }
  4613. return r + 1;
  4614. }
  4615. function getLastNonBlankColumn(txt, defaultValue) {
  4616. const r = lastNonWhitespaceIndex(txt);
  4617. if (r === -1) {
  4618. return defaultValue;
  4619. }
  4620. return r + 2;
  4621. }
  4622. function createContinueProcessingPredicate(maximumRuntime) {
  4623. if (maximumRuntime === 0) {
  4624. return () => true;
  4625. }
  4626. const startTime = Date.now();
  4627. return () => {
  4628. return Date.now() - startTime < maximumRuntime;
  4629. };
  4630. }
  4631. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/uint.js
  4632. function toUint8(v) {
  4633. if (v < 0) {
  4634. return 0;
  4635. }
  4636. if (v > 255) {
  4637. return 255;
  4638. }
  4639. return v | 0;
  4640. }
  4641. function toUint32(v) {
  4642. if (v < 0) {
  4643. return 0;
  4644. }
  4645. if (v > 4294967295) {
  4646. return 4294967295;
  4647. }
  4648. return v | 0;
  4649. }
  4650. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/model/prefixSumComputer.js
  4651. var PrefixSumComputer = class {
  4652. constructor(values) {
  4653. this.values = values;
  4654. this.prefixSum = new Uint32Array(values.length);
  4655. this.prefixSumValidIndex = new Int32Array(1);
  4656. this.prefixSumValidIndex[0] = -1;
  4657. }
  4658. insertValues(insertIndex, insertValues) {
  4659. insertIndex = toUint32(insertIndex);
  4660. const oldValues = this.values;
  4661. const oldPrefixSum = this.prefixSum;
  4662. const insertValuesLen = insertValues.length;
  4663. if (insertValuesLen === 0) {
  4664. return false;
  4665. }
  4666. this.values = new Uint32Array(oldValues.length + insertValuesLen);
  4667. this.values.set(oldValues.subarray(0, insertIndex), 0);
  4668. this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen);
  4669. this.values.set(insertValues, insertIndex);
  4670. if (insertIndex - 1 < this.prefixSumValidIndex[0]) {
  4671. this.prefixSumValidIndex[0] = insertIndex - 1;
  4672. }
  4673. this.prefixSum = new Uint32Array(this.values.length);
  4674. if (this.prefixSumValidIndex[0] >= 0) {
  4675. this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));
  4676. }
  4677. return true;
  4678. }
  4679. setValue(index, value) {
  4680. index = toUint32(index);
  4681. value = toUint32(value);
  4682. if (this.values[index] === value) {
  4683. return false;
  4684. }
  4685. this.values[index] = value;
  4686. if (index - 1 < this.prefixSumValidIndex[0]) {
  4687. this.prefixSumValidIndex[0] = index - 1;
  4688. }
  4689. return true;
  4690. }
  4691. removeValues(startIndex, count) {
  4692. startIndex = toUint32(startIndex);
  4693. count = toUint32(count);
  4694. const oldValues = this.values;
  4695. const oldPrefixSum = this.prefixSum;
  4696. if (startIndex >= oldValues.length) {
  4697. return false;
  4698. }
  4699. const maxCount = oldValues.length - startIndex;
  4700. if (count >= maxCount) {
  4701. count = maxCount;
  4702. }
  4703. if (count === 0) {
  4704. return false;
  4705. }
  4706. this.values = new Uint32Array(oldValues.length - count);
  4707. this.values.set(oldValues.subarray(0, startIndex), 0);
  4708. this.values.set(oldValues.subarray(startIndex + count), startIndex);
  4709. this.prefixSum = new Uint32Array(this.values.length);
  4710. if (startIndex - 1 < this.prefixSumValidIndex[0]) {
  4711. this.prefixSumValidIndex[0] = startIndex - 1;
  4712. }
  4713. if (this.prefixSumValidIndex[0] >= 0) {
  4714. this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));
  4715. }
  4716. return true;
  4717. }
  4718. getTotalSum() {
  4719. if (this.values.length === 0) {
  4720. return 0;
  4721. }
  4722. return this._getPrefixSum(this.values.length - 1);
  4723. }
  4724. getPrefixSum(index) {
  4725. if (index < 0) {
  4726. return 0;
  4727. }
  4728. index = toUint32(index);
  4729. return this._getPrefixSum(index);
  4730. }
  4731. _getPrefixSum(index) {
  4732. if (index <= this.prefixSumValidIndex[0]) {
  4733. return this.prefixSum[index];
  4734. }
  4735. let startIndex = this.prefixSumValidIndex[0] + 1;
  4736. if (startIndex === 0) {
  4737. this.prefixSum[0] = this.values[0];
  4738. startIndex++;
  4739. }
  4740. if (index >= this.values.length) {
  4741. index = this.values.length - 1;
  4742. }
  4743. for (let i = startIndex; i <= index; i++) {
  4744. this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i];
  4745. }
  4746. this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index);
  4747. return this.prefixSum[index];
  4748. }
  4749. getIndexOf(sum) {
  4750. sum = Math.floor(sum);
  4751. this.getTotalSum();
  4752. let low = 0;
  4753. let high = this.values.length - 1;
  4754. let mid = 0;
  4755. let midStop = 0;
  4756. let midStart = 0;
  4757. while (low <= high) {
  4758. mid = low + (high - low) / 2 | 0;
  4759. midStop = this.prefixSum[mid];
  4760. midStart = midStop - this.values[mid];
  4761. if (sum < midStart) {
  4762. high = mid - 1;
  4763. } else if (sum >= midStop) {
  4764. low = mid + 1;
  4765. } else {
  4766. break;
  4767. }
  4768. }
  4769. return new PrefixSumIndexOfResult(mid, sum - midStart);
  4770. }
  4771. };
  4772. var PrefixSumIndexOfResult = class {
  4773. constructor(index, remainder) {
  4774. this.index = index;
  4775. this.remainder = remainder;
  4776. this._prefixSumIndexOfResultBrand = void 0;
  4777. this.index = index;
  4778. this.remainder = remainder;
  4779. }
  4780. };
  4781. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js
  4782. var MirrorTextModel = class {
  4783. constructor(uri, lines, eol, versionId) {
  4784. this._uri = uri;
  4785. this._lines = lines;
  4786. this._eol = eol;
  4787. this._versionId = versionId;
  4788. this._lineStarts = null;
  4789. this._cachedTextValue = null;
  4790. }
  4791. dispose() {
  4792. this._lines.length = 0;
  4793. }
  4794. get version() {
  4795. return this._versionId;
  4796. }
  4797. getText() {
  4798. if (this._cachedTextValue === null) {
  4799. this._cachedTextValue = this._lines.join(this._eol);
  4800. }
  4801. return this._cachedTextValue;
  4802. }
  4803. onEvents(e) {
  4804. if (e.eol && e.eol !== this._eol) {
  4805. this._eol = e.eol;
  4806. this._lineStarts = null;
  4807. }
  4808. const changes = e.changes;
  4809. for (const change of changes) {
  4810. this._acceptDeleteRange(change.range);
  4811. this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text);
  4812. }
  4813. this._versionId = e.versionId;
  4814. this._cachedTextValue = null;
  4815. }
  4816. _ensureLineStarts() {
  4817. if (!this._lineStarts) {
  4818. const eolLength = this._eol.length;
  4819. const linesLength = this._lines.length;
  4820. const lineStartValues = new Uint32Array(linesLength);
  4821. for (let i = 0; i < linesLength; i++) {
  4822. lineStartValues[i] = this._lines[i].length + eolLength;
  4823. }
  4824. this._lineStarts = new PrefixSumComputer(lineStartValues);
  4825. }
  4826. }
  4827. _setLineText(lineIndex, newValue) {
  4828. this._lines[lineIndex] = newValue;
  4829. if (this._lineStarts) {
  4830. this._lineStarts.setValue(lineIndex, this._lines[lineIndex].length + this._eol.length);
  4831. }
  4832. }
  4833. _acceptDeleteRange(range) {
  4834. if (range.startLineNumber === range.endLineNumber) {
  4835. if (range.startColumn === range.endColumn) {
  4836. return;
  4837. }
  4838. this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) + this._lines[range.startLineNumber - 1].substring(range.endColumn - 1));
  4839. return;
  4840. }
  4841. this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) + this._lines[range.endLineNumber - 1].substring(range.endColumn - 1));
  4842. this._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber);
  4843. if (this._lineStarts) {
  4844. this._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber);
  4845. }
  4846. }
  4847. _acceptInsertText(position, insertText) {
  4848. if (insertText.length === 0) {
  4849. return;
  4850. }
  4851. const insertLines = splitLines(insertText);
  4852. if (insertLines.length === 1) {
  4853. this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) + insertLines[0] + this._lines[position.lineNumber - 1].substring(position.column - 1));
  4854. return;
  4855. }
  4856. insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1);
  4857. this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) + insertLines[0]);
  4858. const newLengths = new Uint32Array(insertLines.length - 1);
  4859. for (let i = 1; i < insertLines.length; i++) {
  4860. this._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]);
  4861. newLengths[i - 1] = insertLines[i].length + this._eol.length;
  4862. }
  4863. if (this._lineStarts) {
  4864. this._lineStarts.insertValues(position.lineNumber, newLengths);
  4865. }
  4866. }
  4867. };
  4868. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/core/wordHelper.js
  4869. var USUAL_WORD_SEPARATORS = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";
  4870. function createWordRegExp(allowInWords = "") {
  4871. let source = "(-?\\d*\\.\\d\\w*)|([^";
  4872. for (const sep2 of USUAL_WORD_SEPARATORS) {
  4873. if (allowInWords.indexOf(sep2) >= 0) {
  4874. continue;
  4875. }
  4876. source += "\\" + sep2;
  4877. }
  4878. source += "\\s]+)";
  4879. return new RegExp(source, "g");
  4880. }
  4881. var DEFAULT_WORD_REGEXP = createWordRegExp();
  4882. function ensureValidWordDefinition(wordDefinition) {
  4883. let result = DEFAULT_WORD_REGEXP;
  4884. if (wordDefinition && wordDefinition instanceof RegExp) {
  4885. if (!wordDefinition.global) {
  4886. let flags = "g";
  4887. if (wordDefinition.ignoreCase) {
  4888. flags += "i";
  4889. }
  4890. if (wordDefinition.multiline) {
  4891. flags += "m";
  4892. }
  4893. if (wordDefinition.unicode) {
  4894. flags += "u";
  4895. }
  4896. result = new RegExp(wordDefinition.source, flags);
  4897. } else {
  4898. result = wordDefinition;
  4899. }
  4900. }
  4901. result.lastIndex = 0;
  4902. return result;
  4903. }
  4904. var _defaultConfig = {
  4905. maxLen: 1e3,
  4906. windowSize: 15,
  4907. timeBudget: 150
  4908. };
  4909. function getWordAtText(column, wordDefinition, text, textOffset, config = _defaultConfig) {
  4910. if (text.length > config.maxLen) {
  4911. let start = column - config.maxLen / 2;
  4912. if (start < 0) {
  4913. start = 0;
  4914. } else {
  4915. textOffset += start;
  4916. }
  4917. text = text.substring(start, column + config.maxLen / 2);
  4918. return getWordAtText(column, wordDefinition, text, textOffset, config);
  4919. }
  4920. const t1 = Date.now();
  4921. const pos = column - 1 - textOffset;
  4922. let prevRegexIndex = -1;
  4923. let match = null;
  4924. for (let i = 1; ; i++) {
  4925. if (Date.now() - t1 >= config.timeBudget) {
  4926. break;
  4927. }
  4928. const regexIndex = pos - config.windowSize * i;
  4929. wordDefinition.lastIndex = Math.max(0, regexIndex);
  4930. const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex);
  4931. if (!thisMatch && match) {
  4932. break;
  4933. }
  4934. match = thisMatch;
  4935. if (regexIndex <= 0) {
  4936. break;
  4937. }
  4938. prevRegexIndex = regexIndex;
  4939. }
  4940. if (match) {
  4941. const result = {
  4942. word: match[0],
  4943. startColumn: textOffset + 1 + match.index,
  4944. endColumn: textOffset + 1 + match.index + match[0].length
  4945. };
  4946. wordDefinition.lastIndex = 0;
  4947. return result;
  4948. }
  4949. return null;
  4950. }
  4951. function _findRegexMatchEnclosingPosition(wordDefinition, text, pos, stopPos) {
  4952. let match;
  4953. while (match = wordDefinition.exec(text)) {
  4954. const matchIndex = match.index || 0;
  4955. if (matchIndex <= pos && wordDefinition.lastIndex >= pos) {
  4956. return match;
  4957. } else if (stopPos > 0 && matchIndex > stopPos) {
  4958. return null;
  4959. }
  4960. }
  4961. return null;
  4962. }
  4963. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js
  4964. var CharacterClassifier = class {
  4965. constructor(_defaultValue) {
  4966. const defaultValue = toUint8(_defaultValue);
  4967. this._defaultValue = defaultValue;
  4968. this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue);
  4969. this._map = new Map();
  4970. }
  4971. static _createAsciiMap(defaultValue) {
  4972. const asciiMap = new Uint8Array(256);
  4973. for (let i = 0; i < 256; i++) {
  4974. asciiMap[i] = defaultValue;
  4975. }
  4976. return asciiMap;
  4977. }
  4978. set(charCode, _value) {
  4979. const value = toUint8(_value);
  4980. if (charCode >= 0 && charCode < 256) {
  4981. this._asciiMap[charCode] = value;
  4982. } else {
  4983. this._map.set(charCode, value);
  4984. }
  4985. }
  4986. get(charCode) {
  4987. if (charCode >= 0 && charCode < 256) {
  4988. return this._asciiMap[charCode];
  4989. } else {
  4990. return this._map.get(charCode) || this._defaultValue;
  4991. }
  4992. }
  4993. };
  4994. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/languages/linkComputer.js
  4995. var Uint8Matrix = class {
  4996. constructor(rows, cols, defaultValue) {
  4997. const data = new Uint8Array(rows * cols);
  4998. for (let i = 0, len = rows * cols; i < len; i++) {
  4999. data[i] = defaultValue;
  5000. }
  5001. this._data = data;
  5002. this.rows = rows;
  5003. this.cols = cols;
  5004. }
  5005. get(row, col) {
  5006. return this._data[row * this.cols + col];
  5007. }
  5008. set(row, col, value) {
  5009. this._data[row * this.cols + col] = value;
  5010. }
  5011. };
  5012. var StateMachine = class {
  5013. constructor(edges) {
  5014. let maxCharCode = 0;
  5015. let maxState = 0;
  5016. for (let i = 0, len = edges.length; i < len; i++) {
  5017. const [from, chCode, to] = edges[i];
  5018. if (chCode > maxCharCode) {
  5019. maxCharCode = chCode;
  5020. }
  5021. if (from > maxState) {
  5022. maxState = from;
  5023. }
  5024. if (to > maxState) {
  5025. maxState = to;
  5026. }
  5027. }
  5028. maxCharCode++;
  5029. maxState++;
  5030. const states = new Uint8Matrix(maxState, maxCharCode, 0);
  5031. for (let i = 0, len = edges.length; i < len; i++) {
  5032. const [from, chCode, to] = edges[i];
  5033. states.set(from, chCode, to);
  5034. }
  5035. this._states = states;
  5036. this._maxCharCode = maxCharCode;
  5037. }
  5038. nextState(currentState, chCode) {
  5039. if (chCode < 0 || chCode >= this._maxCharCode) {
  5040. return 0;
  5041. }
  5042. return this._states.get(currentState, chCode);
  5043. }
  5044. };
  5045. var _stateMachine = null;
  5046. function getStateMachine() {
  5047. if (_stateMachine === null) {
  5048. _stateMachine = new StateMachine([
  5049. [1, 104, 2],
  5050. [1, 72, 2],
  5051. [1, 102, 6],
  5052. [1, 70, 6],
  5053. [2, 116, 3],
  5054. [2, 84, 3],
  5055. [3, 116, 4],
  5056. [3, 84, 4],
  5057. [4, 112, 5],
  5058. [4, 80, 5],
  5059. [5, 115, 9],
  5060. [5, 83, 9],
  5061. [5, 58, 10],
  5062. [6, 105, 7],
  5063. [6, 73, 7],
  5064. [7, 108, 8],
  5065. [7, 76, 8],
  5066. [8, 101, 9],
  5067. [8, 69, 9],
  5068. [9, 58, 10],
  5069. [10, 47, 11],
  5070. [11, 47, 12]
  5071. ]);
  5072. }
  5073. return _stateMachine;
  5074. }
  5075. var _classifier = null;
  5076. function getClassifier() {
  5077. if (_classifier === null) {
  5078. _classifier = new CharacterClassifier(0);
  5079. const FORCE_TERMINATION_CHARACTERS = ` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026`;
  5080. for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) {
  5081. _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1);
  5082. }
  5083. const CANNOT_END_WITH_CHARACTERS = ".,;";
  5084. for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) {
  5085. _classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), 2);
  5086. }
  5087. }
  5088. return _classifier;
  5089. }
  5090. var LinkComputer = class {
  5091. static _createLink(classifier, line, lineNumber, linkBeginIndex, linkEndIndex) {
  5092. let lastIncludedCharIndex = linkEndIndex - 1;
  5093. do {
  5094. const chCode = line.charCodeAt(lastIncludedCharIndex);
  5095. const chClass = classifier.get(chCode);
  5096. if (chClass !== 2) {
  5097. break;
  5098. }
  5099. lastIncludedCharIndex--;
  5100. } while (lastIncludedCharIndex > linkBeginIndex);
  5101. if (linkBeginIndex > 0) {
  5102. const charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1);
  5103. const lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex);
  5104. if (charCodeBeforeLink === 40 && lastCharCodeInLink === 41 || charCodeBeforeLink === 91 && lastCharCodeInLink === 93 || charCodeBeforeLink === 123 && lastCharCodeInLink === 125) {
  5105. lastIncludedCharIndex--;
  5106. }
  5107. }
  5108. return {
  5109. range: {
  5110. startLineNumber: lineNumber,
  5111. startColumn: linkBeginIndex + 1,
  5112. endLineNumber: lineNumber,
  5113. endColumn: lastIncludedCharIndex + 2
  5114. },
  5115. url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1)
  5116. };
  5117. }
  5118. static computeLinks(model, stateMachine = getStateMachine()) {
  5119. const classifier = getClassifier();
  5120. const result = [];
  5121. for (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) {
  5122. const line = model.getLineContent(i);
  5123. const len = line.length;
  5124. let j = 0;
  5125. let linkBeginIndex = 0;
  5126. let linkBeginChCode = 0;
  5127. let state = 1;
  5128. let hasOpenParens = false;
  5129. let hasOpenSquareBracket = false;
  5130. let inSquareBrackets = false;
  5131. let hasOpenCurlyBracket = false;
  5132. while (j < len) {
  5133. let resetStateMachine = false;
  5134. const chCode = line.charCodeAt(j);
  5135. if (state === 13) {
  5136. let chClass;
  5137. switch (chCode) {
  5138. case 40:
  5139. hasOpenParens = true;
  5140. chClass = 0;
  5141. break;
  5142. case 41:
  5143. chClass = hasOpenParens ? 0 : 1;
  5144. break;
  5145. case 91:
  5146. inSquareBrackets = true;
  5147. hasOpenSquareBracket = true;
  5148. chClass = 0;
  5149. break;
  5150. case 93:
  5151. inSquareBrackets = false;
  5152. chClass = hasOpenSquareBracket ? 0 : 1;
  5153. break;
  5154. case 123:
  5155. hasOpenCurlyBracket = true;
  5156. chClass = 0;
  5157. break;
  5158. case 125:
  5159. chClass = hasOpenCurlyBracket ? 0 : 1;
  5160. break;
  5161. case 39:
  5162. chClass = linkBeginChCode === 34 || linkBeginChCode === 96 ? 0 : 1;
  5163. break;
  5164. case 34:
  5165. chClass = linkBeginChCode === 39 || linkBeginChCode === 96 ? 0 : 1;
  5166. break;
  5167. case 96:
  5168. chClass = linkBeginChCode === 39 || linkBeginChCode === 34 ? 0 : 1;
  5169. break;
  5170. case 42:
  5171. chClass = linkBeginChCode === 42 ? 1 : 0;
  5172. break;
  5173. case 124:
  5174. chClass = linkBeginChCode === 124 ? 1 : 0;
  5175. break;
  5176. case 32:
  5177. chClass = inSquareBrackets ? 0 : 1;
  5178. break;
  5179. default:
  5180. chClass = classifier.get(chCode);
  5181. }
  5182. if (chClass === 1) {
  5183. result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, j));
  5184. resetStateMachine = true;
  5185. }
  5186. } else if (state === 12) {
  5187. let chClass;
  5188. if (chCode === 91) {
  5189. hasOpenSquareBracket = true;
  5190. chClass = 0;
  5191. } else {
  5192. chClass = classifier.get(chCode);
  5193. }
  5194. if (chClass === 1) {
  5195. resetStateMachine = true;
  5196. } else {
  5197. state = 13;
  5198. }
  5199. } else {
  5200. state = stateMachine.nextState(state, chCode);
  5201. if (state === 0) {
  5202. resetStateMachine = true;
  5203. }
  5204. }
  5205. if (resetStateMachine) {
  5206. state = 1;
  5207. hasOpenParens = false;
  5208. hasOpenSquareBracket = false;
  5209. hasOpenCurlyBracket = false;
  5210. linkBeginIndex = j + 1;
  5211. linkBeginChCode = chCode;
  5212. }
  5213. j++;
  5214. }
  5215. if (state === 13) {
  5216. result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, len));
  5217. }
  5218. }
  5219. return result;
  5220. }
  5221. };
  5222. function computeLinks(model) {
  5223. if (!model || typeof model.getLineCount !== "function" || typeof model.getLineContent !== "function") {
  5224. return [];
  5225. }
  5226. return LinkComputer.computeLinks(model);
  5227. }
  5228. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/languages/supports/inplaceReplaceSupport.js
  5229. var BasicInplaceReplace = class {
  5230. constructor() {
  5231. this._defaultValueSet = [
  5232. ["true", "false"],
  5233. ["True", "False"],
  5234. ["Private", "Public", "Friend", "ReadOnly", "Partial", "Protected", "WriteOnly"],
  5235. ["public", "protected", "private"]
  5236. ];
  5237. }
  5238. navigateValueSet(range1, text1, range2, text2, up) {
  5239. if (range1 && text1) {
  5240. const result = this.doNavigateValueSet(text1, up);
  5241. if (result) {
  5242. return {
  5243. range: range1,
  5244. value: result
  5245. };
  5246. }
  5247. }
  5248. if (range2 && text2) {
  5249. const result = this.doNavigateValueSet(text2, up);
  5250. if (result) {
  5251. return {
  5252. range: range2,
  5253. value: result
  5254. };
  5255. }
  5256. }
  5257. return null;
  5258. }
  5259. doNavigateValueSet(text, up) {
  5260. const numberResult = this.numberReplace(text, up);
  5261. if (numberResult !== null) {
  5262. return numberResult;
  5263. }
  5264. return this.textReplace(text, up);
  5265. }
  5266. numberReplace(value, up) {
  5267. const precision = Math.pow(10, value.length - (value.lastIndexOf(".") + 1));
  5268. let n1 = Number(value);
  5269. let n2 = parseFloat(value);
  5270. if (!isNaN(n1) && !isNaN(n2) && n1 === n2) {
  5271. if (n1 === 0 && !up) {
  5272. return null;
  5273. } else {
  5274. n1 = Math.floor(n1 * precision);
  5275. n1 += up ? precision : -precision;
  5276. return String(n1 / precision);
  5277. }
  5278. }
  5279. return null;
  5280. }
  5281. textReplace(value, up) {
  5282. return this.valueSetsReplace(this._defaultValueSet, value, up);
  5283. }
  5284. valueSetsReplace(valueSets, value, up) {
  5285. let result = null;
  5286. for (let i = 0, len = valueSets.length; result === null && i < len; i++) {
  5287. result = this.valueSetReplace(valueSets[i], value, up);
  5288. }
  5289. return result;
  5290. }
  5291. valueSetReplace(valueSet, value, up) {
  5292. let idx = valueSet.indexOf(value);
  5293. if (idx >= 0) {
  5294. idx += up ? 1 : -1;
  5295. if (idx < 0) {
  5296. idx = valueSet.length - 1;
  5297. } else {
  5298. idx %= valueSet.length;
  5299. }
  5300. return valueSet[idx];
  5301. }
  5302. return null;
  5303. }
  5304. };
  5305. BasicInplaceReplace.INSTANCE = new BasicInplaceReplace();
  5306. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/cancellation.js
  5307. var shortcutEvent = Object.freeze(function(callback, context) {
  5308. const handle = setTimeout(callback.bind(context), 0);
  5309. return {dispose() {
  5310. clearTimeout(handle);
  5311. }};
  5312. });
  5313. var CancellationToken;
  5314. (function(CancellationToken2) {
  5315. function isCancellationToken(thing) {
  5316. if (thing === CancellationToken2.None || thing === CancellationToken2.Cancelled) {
  5317. return true;
  5318. }
  5319. if (thing instanceof MutableToken) {
  5320. return true;
  5321. }
  5322. if (!thing || typeof thing !== "object") {
  5323. return false;
  5324. }
  5325. return typeof thing.isCancellationRequested === "boolean" && typeof thing.onCancellationRequested === "function";
  5326. }
  5327. CancellationToken2.isCancellationToken = isCancellationToken;
  5328. CancellationToken2.None = Object.freeze({
  5329. isCancellationRequested: false,
  5330. onCancellationRequested: Event.None
  5331. });
  5332. CancellationToken2.Cancelled = Object.freeze({
  5333. isCancellationRequested: true,
  5334. onCancellationRequested: shortcutEvent
  5335. });
  5336. })(CancellationToken || (CancellationToken = {}));
  5337. var MutableToken = class {
  5338. constructor() {
  5339. this._isCancelled = false;
  5340. this._emitter = null;
  5341. }
  5342. cancel() {
  5343. if (!this._isCancelled) {
  5344. this._isCancelled = true;
  5345. if (this._emitter) {
  5346. this._emitter.fire(void 0);
  5347. this.dispose();
  5348. }
  5349. }
  5350. }
  5351. get isCancellationRequested() {
  5352. return this._isCancelled;
  5353. }
  5354. get onCancellationRequested() {
  5355. if (this._isCancelled) {
  5356. return shortcutEvent;
  5357. }
  5358. if (!this._emitter) {
  5359. this._emitter = new Emitter();
  5360. }
  5361. return this._emitter.event;
  5362. }
  5363. dispose() {
  5364. if (this._emitter) {
  5365. this._emitter.dispose();
  5366. this._emitter = null;
  5367. }
  5368. }
  5369. };
  5370. var CancellationTokenSource = class {
  5371. constructor(parent) {
  5372. this._token = void 0;
  5373. this._parentListener = void 0;
  5374. this._parentListener = parent && parent.onCancellationRequested(this.cancel, this);
  5375. }
  5376. get token() {
  5377. if (!this._token) {
  5378. this._token = new MutableToken();
  5379. }
  5380. return this._token;
  5381. }
  5382. cancel() {
  5383. if (!this._token) {
  5384. this._token = CancellationToken.Cancelled;
  5385. } else if (this._token instanceof MutableToken) {
  5386. this._token.cancel();
  5387. }
  5388. }
  5389. dispose(cancel = false) {
  5390. if (cancel) {
  5391. this.cancel();
  5392. }
  5393. if (this._parentListener) {
  5394. this._parentListener.dispose();
  5395. }
  5396. if (!this._token) {
  5397. this._token = CancellationToken.None;
  5398. } else if (this._token instanceof MutableToken) {
  5399. this._token.dispose();
  5400. }
  5401. }
  5402. };
  5403. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/keyCodes.js
  5404. var KeyCodeStrMap = class {
  5405. constructor() {
  5406. this._keyCodeToStr = [];
  5407. this._strToKeyCode = Object.create(null);
  5408. }
  5409. define(keyCode, str) {
  5410. this._keyCodeToStr[keyCode] = str;
  5411. this._strToKeyCode[str.toLowerCase()] = keyCode;
  5412. }
  5413. keyCodeToStr(keyCode) {
  5414. return this._keyCodeToStr[keyCode];
  5415. }
  5416. strToKeyCode(str) {
  5417. return this._strToKeyCode[str.toLowerCase()] || 0;
  5418. }
  5419. };
  5420. var uiMap = new KeyCodeStrMap();
  5421. var userSettingsUSMap = new KeyCodeStrMap();
  5422. var userSettingsGeneralMap = new KeyCodeStrMap();
  5423. var EVENT_KEY_CODE_MAP = new Array(230);
  5424. var NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE = {};
  5425. var scanCodeIntToStr = [];
  5426. var scanCodeStrToInt = Object.create(null);
  5427. var scanCodeLowerCaseStrToInt = Object.create(null);
  5428. var IMMUTABLE_CODE_TO_KEY_CODE = [];
  5429. var IMMUTABLE_KEY_CODE_TO_CODE = [];
  5430. for (let i = 0; i <= 193; i++) {
  5431. IMMUTABLE_CODE_TO_KEY_CODE[i] = -1;
  5432. }
  5433. for (let i = 0; i <= 127; i++) {
  5434. IMMUTABLE_KEY_CODE_TO_CODE[i] = -1;
  5435. }
  5436. (function() {
  5437. const empty = "";
  5438. const mappings = [
  5439. [0, 1, 0, "None", 0, "unknown", 0, "VK_UNKNOWN", empty, empty],
  5440. [0, 1, 1, "Hyper", 0, empty, 0, empty, empty, empty],
  5441. [0, 1, 2, "Super", 0, empty, 0, empty, empty, empty],
  5442. [0, 1, 3, "Fn", 0, empty, 0, empty, empty, empty],
  5443. [0, 1, 4, "FnLock", 0, empty, 0, empty, empty, empty],
  5444. [0, 1, 5, "Suspend", 0, empty, 0, empty, empty, empty],
  5445. [0, 1, 6, "Resume", 0, empty, 0, empty, empty, empty],
  5446. [0, 1, 7, "Turbo", 0, empty, 0, empty, empty, empty],
  5447. [0, 1, 8, "Sleep", 0, empty, 0, "VK_SLEEP", empty, empty],
  5448. [0, 1, 9, "WakeUp", 0, empty, 0, empty, empty, empty],
  5449. [31, 0, 10, "KeyA", 31, "A", 65, "VK_A", empty, empty],
  5450. [32, 0, 11, "KeyB", 32, "B", 66, "VK_B", empty, empty],
  5451. [33, 0, 12, "KeyC", 33, "C", 67, "VK_C", empty, empty],
  5452. [34, 0, 13, "KeyD", 34, "D", 68, "VK_D", empty, empty],
  5453. [35, 0, 14, "KeyE", 35, "E", 69, "VK_E", empty, empty],
  5454. [36, 0, 15, "KeyF", 36, "F", 70, "VK_F", empty, empty],
  5455. [37, 0, 16, "KeyG", 37, "G", 71, "VK_G", empty, empty],
  5456. [38, 0, 17, "KeyH", 38, "H", 72, "VK_H", empty, empty],
  5457. [39, 0, 18, "KeyI", 39, "I", 73, "VK_I", empty, empty],
  5458. [40, 0, 19, "KeyJ", 40, "J", 74, "VK_J", empty, empty],
  5459. [41, 0, 20, "KeyK", 41, "K", 75, "VK_K", empty, empty],
  5460. [42, 0, 21, "KeyL", 42, "L", 76, "VK_L", empty, empty],
  5461. [43, 0, 22, "KeyM", 43, "M", 77, "VK_M", empty, empty],
  5462. [44, 0, 23, "KeyN", 44, "N", 78, "VK_N", empty, empty],
  5463. [45, 0, 24, "KeyO", 45, "O", 79, "VK_O", empty, empty],
  5464. [46, 0, 25, "KeyP", 46, "P", 80, "VK_P", empty, empty],
  5465. [47, 0, 26, "KeyQ", 47, "Q", 81, "VK_Q", empty, empty],
  5466. [48, 0, 27, "KeyR", 48, "R", 82, "VK_R", empty, empty],
  5467. [49, 0, 28, "KeyS", 49, "S", 83, "VK_S", empty, empty],
  5468. [50, 0, 29, "KeyT", 50, "T", 84, "VK_T", empty, empty],
  5469. [51, 0, 30, "KeyU", 51, "U", 85, "VK_U", empty, empty],
  5470. [52, 0, 31, "KeyV", 52, "V", 86, "VK_V", empty, empty],
  5471. [53, 0, 32, "KeyW", 53, "W", 87, "VK_W", empty, empty],
  5472. [54, 0, 33, "KeyX", 54, "X", 88, "VK_X", empty, empty],
  5473. [55, 0, 34, "KeyY", 55, "Y", 89, "VK_Y", empty, empty],
  5474. [56, 0, 35, "KeyZ", 56, "Z", 90, "VK_Z", empty, empty],
  5475. [22, 0, 36, "Digit1", 22, "1", 49, "VK_1", empty, empty],
  5476. [23, 0, 37, "Digit2", 23, "2", 50, "VK_2", empty, empty],
  5477. [24, 0, 38, "Digit3", 24, "3", 51, "VK_3", empty, empty],
  5478. [25, 0, 39, "Digit4", 25, "4", 52, "VK_4", empty, empty],
  5479. [26, 0, 40, "Digit5", 26, "5", 53, "VK_5", empty, empty],
  5480. [27, 0, 41, "Digit6", 27, "6", 54, "VK_6", empty, empty],
  5481. [28, 0, 42, "Digit7", 28, "7", 55, "VK_7", empty, empty],
  5482. [29, 0, 43, "Digit8", 29, "8", 56, "VK_8", empty, empty],
  5483. [30, 0, 44, "Digit9", 30, "9", 57, "VK_9", empty, empty],
  5484. [21, 0, 45, "Digit0", 21, "0", 48, "VK_0", empty, empty],
  5485. [3, 1, 46, "Enter", 3, "Enter", 13, "VK_RETURN", empty, empty],
  5486. [9, 1, 47, "Escape", 9, "Escape", 27, "VK_ESCAPE", empty, empty],
  5487. [1, 1, 48, "Backspace", 1, "Backspace", 8, "VK_BACK", empty, empty],
  5488. [2, 1, 49, "Tab", 2, "Tab", 9, "VK_TAB", empty, empty],
  5489. [10, 1, 50, "Space", 10, "Space", 32, "VK_SPACE", empty, empty],
  5490. [83, 0, 51, "Minus", 83, "-", 189, "VK_OEM_MINUS", "-", "OEM_MINUS"],
  5491. [81, 0, 52, "Equal", 81, "=", 187, "VK_OEM_PLUS", "=", "OEM_PLUS"],
  5492. [87, 0, 53, "BracketLeft", 87, "[", 219, "VK_OEM_4", "[", "OEM_4"],
  5493. [89, 0, 54, "BracketRight", 89, "]", 221, "VK_OEM_6", "]", "OEM_6"],
  5494. [88, 0, 55, "Backslash", 88, "\\", 220, "VK_OEM_5", "\\", "OEM_5"],
  5495. [0, 0, 56, "IntlHash", 0, empty, 0, empty, empty, empty],
  5496. [80, 0, 57, "Semicolon", 80, ";", 186, "VK_OEM_1", ";", "OEM_1"],
  5497. [90, 0, 58, "Quote", 90, "'", 222, "VK_OEM_7", "'", "OEM_7"],
  5498. [86, 0, 59, "Backquote", 86, "`", 192, "VK_OEM_3", "`", "OEM_3"],
  5499. [82, 0, 60, "Comma", 82, ",", 188, "VK_OEM_COMMA", ",", "OEM_COMMA"],
  5500. [84, 0, 61, "Period", 84, ".", 190, "VK_OEM_PERIOD", ".", "OEM_PERIOD"],
  5501. [85, 0, 62, "Slash", 85, "/", 191, "VK_OEM_2", "/", "OEM_2"],
  5502. [8, 1, 63, "CapsLock", 8, "CapsLock", 20, "VK_CAPITAL", empty, empty],
  5503. [59, 1, 64, "F1", 59, "F1", 112, "VK_F1", empty, empty],
  5504. [60, 1, 65, "F2", 60, "F2", 113, "VK_F2", empty, empty],
  5505. [61, 1, 66, "F3", 61, "F3", 114, "VK_F3", empty, empty],
  5506. [62, 1, 67, "F4", 62, "F4", 115, "VK_F4", empty, empty],
  5507. [63, 1, 68, "F5", 63, "F5", 116, "VK_F5", empty, empty],
  5508. [64, 1, 69, "F6", 64, "F6", 117, "VK_F6", empty, empty],
  5509. [65, 1, 70, "F7", 65, "F7", 118, "VK_F7", empty, empty],
  5510. [66, 1, 71, "F8", 66, "F8", 119, "VK_F8", empty, empty],
  5511. [67, 1, 72, "F9", 67, "F9", 120, "VK_F9", empty, empty],
  5512. [68, 1, 73, "F10", 68, "F10", 121, "VK_F10", empty, empty],
  5513. [69, 1, 74, "F11", 69, "F11", 122, "VK_F11", empty, empty],
  5514. [70, 1, 75, "F12", 70, "F12", 123, "VK_F12", empty, empty],
  5515. [0, 1, 76, "PrintScreen", 0, empty, 0, empty, empty, empty],
  5516. [79, 1, 77, "ScrollLock", 79, "ScrollLock", 145, "VK_SCROLL", empty, empty],
  5517. [7, 1, 78, "Pause", 7, "PauseBreak", 19, "VK_PAUSE", empty, empty],
  5518. [19, 1, 79, "Insert", 19, "Insert", 45, "VK_INSERT", empty, empty],
  5519. [14, 1, 80, "Home", 14, "Home", 36, "VK_HOME", empty, empty],
  5520. [11, 1, 81, "PageUp", 11, "PageUp", 33, "VK_PRIOR", empty, empty],
  5521. [20, 1, 82, "Delete", 20, "Delete", 46, "VK_DELETE", empty, empty],
  5522. [13, 1, 83, "End", 13, "End", 35, "VK_END", empty, empty],
  5523. [12, 1, 84, "PageDown", 12, "PageDown", 34, "VK_NEXT", empty, empty],
  5524. [17, 1, 85, "ArrowRight", 17, "RightArrow", 39, "VK_RIGHT", "Right", empty],
  5525. [15, 1, 86, "ArrowLeft", 15, "LeftArrow", 37, "VK_LEFT", "Left", empty],
  5526. [18, 1, 87, "ArrowDown", 18, "DownArrow", 40, "VK_DOWN", "Down", empty],
  5527. [16, 1, 88, "ArrowUp", 16, "UpArrow", 38, "VK_UP", "Up", empty],
  5528. [78, 1, 89, "NumLock", 78, "NumLock", 144, "VK_NUMLOCK", empty, empty],
  5529. [108, 1, 90, "NumpadDivide", 108, "NumPad_Divide", 111, "VK_DIVIDE", empty, empty],
  5530. [103, 1, 91, "NumpadMultiply", 103, "NumPad_Multiply", 106, "VK_MULTIPLY", empty, empty],
  5531. [106, 1, 92, "NumpadSubtract", 106, "NumPad_Subtract", 109, "VK_SUBTRACT", empty, empty],
  5532. [104, 1, 93, "NumpadAdd", 104, "NumPad_Add", 107, "VK_ADD", empty, empty],
  5533. [3, 1, 94, "NumpadEnter", 3, empty, 0, empty, empty, empty],
  5534. [94, 1, 95, "Numpad1", 94, "NumPad1", 97, "VK_NUMPAD1", empty, empty],
  5535. [95, 1, 96, "Numpad2", 95, "NumPad2", 98, "VK_NUMPAD2", empty, empty],
  5536. [96, 1, 97, "Numpad3", 96, "NumPad3", 99, "VK_NUMPAD3", empty, empty],
  5537. [97, 1, 98, "Numpad4", 97, "NumPad4", 100, "VK_NUMPAD4", empty, empty],
  5538. [98, 1, 99, "Numpad5", 98, "NumPad5", 101, "VK_NUMPAD5", empty, empty],
  5539. [99, 1, 100, "Numpad6", 99, "NumPad6", 102, "VK_NUMPAD6", empty, empty],
  5540. [100, 1, 101, "Numpad7", 100, "NumPad7", 103, "VK_NUMPAD7", empty, empty],
  5541. [101, 1, 102, "Numpad8", 101, "NumPad8", 104, "VK_NUMPAD8", empty, empty],
  5542. [102, 1, 103, "Numpad9", 102, "NumPad9", 105, "VK_NUMPAD9", empty, empty],
  5543. [93, 1, 104, "Numpad0", 93, "NumPad0", 96, "VK_NUMPAD0", empty, empty],
  5544. [107, 1, 105, "NumpadDecimal", 107, "NumPad_Decimal", 110, "VK_DECIMAL", empty, empty],
  5545. [92, 0, 106, "IntlBackslash", 92, "OEM_102", 226, "VK_OEM_102", empty, empty],
  5546. [58, 1, 107, "ContextMenu", 58, "ContextMenu", 93, empty, empty, empty],
  5547. [0, 1, 108, "Power", 0, empty, 0, empty, empty, empty],
  5548. [0, 1, 109, "NumpadEqual", 0, empty, 0, empty, empty, empty],
  5549. [71, 1, 110, "F13", 71, "F13", 124, "VK_F13", empty, empty],
  5550. [72, 1, 111, "F14", 72, "F14", 125, "VK_F14", empty, empty],
  5551. [73, 1, 112, "F15", 73, "F15", 126, "VK_F15", empty, empty],
  5552. [74, 1, 113, "F16", 74, "F16", 127, "VK_F16", empty, empty],
  5553. [75, 1, 114, "F17", 75, "F17", 128, "VK_F17", empty, empty],
  5554. [76, 1, 115, "F18", 76, "F18", 129, "VK_F18", empty, empty],
  5555. [77, 1, 116, "F19", 77, "F19", 130, "VK_F19", empty, empty],
  5556. [0, 1, 117, "F20", 0, empty, 0, "VK_F20", empty, empty],
  5557. [0, 1, 118, "F21", 0, empty, 0, "VK_F21", empty, empty],
  5558. [0, 1, 119, "F22", 0, empty, 0, "VK_F22", empty, empty],
  5559. [0, 1, 120, "F23", 0, empty, 0, "VK_F23", empty, empty],
  5560. [0, 1, 121, "F24", 0, empty, 0, "VK_F24", empty, empty],
  5561. [0, 1, 122, "Open", 0, empty, 0, empty, empty, empty],
  5562. [0, 1, 123, "Help", 0, empty, 0, empty, empty, empty],
  5563. [0, 1, 124, "Select", 0, empty, 0, empty, empty, empty],
  5564. [0, 1, 125, "Again", 0, empty, 0, empty, empty, empty],
  5565. [0, 1, 126, "Undo", 0, empty, 0, empty, empty, empty],
  5566. [0, 1, 127, "Cut", 0, empty, 0, empty, empty, empty],
  5567. [0, 1, 128, "Copy", 0, empty, 0, empty, empty, empty],
  5568. [0, 1, 129, "Paste", 0, empty, 0, empty, empty, empty],
  5569. [0, 1, 130, "Find", 0, empty, 0, empty, empty, empty],
  5570. [0, 1, 131, "AudioVolumeMute", 112, "AudioVolumeMute", 173, "VK_VOLUME_MUTE", empty, empty],
  5571. [0, 1, 132, "AudioVolumeUp", 113, "AudioVolumeUp", 175, "VK_VOLUME_UP", empty, empty],
  5572. [0, 1, 133, "AudioVolumeDown", 114, "AudioVolumeDown", 174, "VK_VOLUME_DOWN", empty, empty],
  5573. [105, 1, 134, "NumpadComma", 105, "NumPad_Separator", 108, "VK_SEPARATOR", empty, empty],
  5574. [110, 0, 135, "IntlRo", 110, "ABNT_C1", 193, "VK_ABNT_C1", empty, empty],
  5575. [0, 1, 136, "KanaMode", 0, empty, 0, empty, empty, empty],
  5576. [0, 0, 137, "IntlYen", 0, empty, 0, empty, empty, empty],
  5577. [0, 1, 138, "Convert", 0, empty, 0, empty, empty, empty],
  5578. [0, 1, 139, "NonConvert", 0, empty, 0, empty, empty, empty],
  5579. [0, 1, 140, "Lang1", 0, empty, 0, empty, empty, empty],
  5580. [0, 1, 141, "Lang2", 0, empty, 0, empty, empty, empty],
  5581. [0, 1, 142, "Lang3", 0, empty, 0, empty, empty, empty],
  5582. [0, 1, 143, "Lang4", 0, empty, 0, empty, empty, empty],
  5583. [0, 1, 144, "Lang5", 0, empty, 0, empty, empty, empty],
  5584. [0, 1, 145, "Abort", 0, empty, 0, empty, empty, empty],
  5585. [0, 1, 146, "Props", 0, empty, 0, empty, empty, empty],
  5586. [0, 1, 147, "NumpadParenLeft", 0, empty, 0, empty, empty, empty],
  5587. [0, 1, 148, "NumpadParenRight", 0, empty, 0, empty, empty, empty],
  5588. [0, 1, 149, "NumpadBackspace", 0, empty, 0, empty, empty, empty],
  5589. [0, 1, 150, "NumpadMemoryStore", 0, empty, 0, empty, empty, empty],
  5590. [0, 1, 151, "NumpadMemoryRecall", 0, empty, 0, empty, empty, empty],
  5591. [0, 1, 152, "NumpadMemoryClear", 0, empty, 0, empty, empty, empty],
  5592. [0, 1, 153, "NumpadMemoryAdd", 0, empty, 0, empty, empty, empty],
  5593. [0, 1, 154, "NumpadMemorySubtract", 0, empty, 0, empty, empty, empty],
  5594. [0, 1, 155, "NumpadClear", 126, "Clear", 12, "VK_CLEAR", empty, empty],
  5595. [0, 1, 156, "NumpadClearEntry", 0, empty, 0, empty, empty, empty],
  5596. [5, 1, 0, empty, 5, "Ctrl", 17, "VK_CONTROL", empty, empty],
  5597. [4, 1, 0, empty, 4, "Shift", 16, "VK_SHIFT", empty, empty],
  5598. [6, 1, 0, empty, 6, "Alt", 18, "VK_MENU", empty, empty],
  5599. [57, 1, 0, empty, 57, "Meta", 0, "VK_COMMAND", empty, empty],
  5600. [5, 1, 157, "ControlLeft", 5, empty, 0, "VK_LCONTROL", empty, empty],
  5601. [4, 1, 158, "ShiftLeft", 4, empty, 0, "VK_LSHIFT", empty, empty],
  5602. [6, 1, 159, "AltLeft", 6, empty, 0, "VK_LMENU", empty, empty],
  5603. [57, 1, 160, "MetaLeft", 57, empty, 0, "VK_LWIN", empty, empty],
  5604. [5, 1, 161, "ControlRight", 5, empty, 0, "VK_RCONTROL", empty, empty],
  5605. [4, 1, 162, "ShiftRight", 4, empty, 0, "VK_RSHIFT", empty, empty],
  5606. [6, 1, 163, "AltRight", 6, empty, 0, "VK_RMENU", empty, empty],
  5607. [57, 1, 164, "MetaRight", 57, empty, 0, "VK_RWIN", empty, empty],
  5608. [0, 1, 165, "BrightnessUp", 0, empty, 0, empty, empty, empty],
  5609. [0, 1, 166, "BrightnessDown", 0, empty, 0, empty, empty, empty],
  5610. [0, 1, 167, "MediaPlay", 0, empty, 0, empty, empty, empty],
  5611. [0, 1, 168, "MediaRecord", 0, empty, 0, empty, empty, empty],
  5612. [0, 1, 169, "MediaFastForward", 0, empty, 0, empty, empty, empty],
  5613. [0, 1, 170, "MediaRewind", 0, empty, 0, empty, empty, empty],
  5614. [114, 1, 171, "MediaTrackNext", 119, "MediaTrackNext", 176, "VK_MEDIA_NEXT_TRACK", empty, empty],
  5615. [115, 1, 172, "MediaTrackPrevious", 120, "MediaTrackPrevious", 177, "VK_MEDIA_PREV_TRACK", empty, empty],
  5616. [116, 1, 173, "MediaStop", 121, "MediaStop", 178, "VK_MEDIA_STOP", empty, empty],
  5617. [0, 1, 174, "Eject", 0, empty, 0, empty, empty, empty],
  5618. [117, 1, 175, "MediaPlayPause", 122, "MediaPlayPause", 179, "VK_MEDIA_PLAY_PAUSE", empty, empty],
  5619. [0, 1, 176, "MediaSelect", 123, "LaunchMediaPlayer", 181, "VK_MEDIA_LAUNCH_MEDIA_SELECT", empty, empty],
  5620. [0, 1, 177, "LaunchMail", 124, "LaunchMail", 180, "VK_MEDIA_LAUNCH_MAIL", empty, empty],
  5621. [0, 1, 178, "LaunchApp2", 125, "LaunchApp2", 183, "VK_MEDIA_LAUNCH_APP2", empty, empty],
  5622. [0, 1, 179, "LaunchApp1", 0, empty, 0, "VK_MEDIA_LAUNCH_APP1", empty, empty],
  5623. [0, 1, 180, "SelectTask", 0, empty, 0, empty, empty, empty],
  5624. [0, 1, 181, "LaunchScreenSaver", 0, empty, 0, empty, empty, empty],
  5625. [0, 1, 182, "BrowserSearch", 115, "BrowserSearch", 170, "VK_BROWSER_SEARCH", empty, empty],
  5626. [0, 1, 183, "BrowserHome", 116, "BrowserHome", 172, "VK_BROWSER_HOME", empty, empty],
  5627. [112, 1, 184, "BrowserBack", 117, "BrowserBack", 166, "VK_BROWSER_BACK", empty, empty],
  5628. [113, 1, 185, "BrowserForward", 118, "BrowserForward", 167, "VK_BROWSER_FORWARD", empty, empty],
  5629. [0, 1, 186, "BrowserStop", 0, empty, 0, "VK_BROWSER_STOP", empty, empty],
  5630. [0, 1, 187, "BrowserRefresh", 0, empty, 0, "VK_BROWSER_REFRESH", empty, empty],
  5631. [0, 1, 188, "BrowserFavorites", 0, empty, 0, "VK_BROWSER_FAVORITES", empty, empty],
  5632. [0, 1, 189, "ZoomToggle", 0, empty, 0, empty, empty, empty],
  5633. [0, 1, 190, "MailReply", 0, empty, 0, empty, empty, empty],
  5634. [0, 1, 191, "MailForward", 0, empty, 0, empty, empty, empty],
  5635. [0, 1, 192, "MailSend", 0, empty, 0, empty, empty, empty],
  5636. [109, 1, 0, empty, 109, "KeyInComposition", 229, empty, empty, empty],
  5637. [111, 1, 0, empty, 111, "ABNT_C2", 194, "VK_ABNT_C2", empty, empty],
  5638. [91, 1, 0, empty, 91, "OEM_8", 223, "VK_OEM_8", empty, empty],
  5639. [0, 1, 0, empty, 0, empty, 0, "VK_KANA", empty, empty],
  5640. [0, 1, 0, empty, 0, empty, 0, "VK_HANGUL", empty, empty],
  5641. [0, 1, 0, empty, 0, empty, 0, "VK_JUNJA", empty, empty],
  5642. [0, 1, 0, empty, 0, empty, 0, "VK_FINAL", empty, empty],
  5643. [0, 1, 0, empty, 0, empty, 0, "VK_HANJA", empty, empty],
  5644. [0, 1, 0, empty, 0, empty, 0, "VK_KANJI", empty, empty],
  5645. [0, 1, 0, empty, 0, empty, 0, "VK_CONVERT", empty, empty],
  5646. [0, 1, 0, empty, 0, empty, 0, "VK_NONCONVERT", empty, empty],
  5647. [0, 1, 0, empty, 0, empty, 0, "VK_ACCEPT", empty, empty],
  5648. [0, 1, 0, empty, 0, empty, 0, "VK_MODECHANGE", empty, empty],
  5649. [0, 1, 0, empty, 0, empty, 0, "VK_SELECT", empty, empty],
  5650. [0, 1, 0, empty, 0, empty, 0, "VK_PRINT", empty, empty],
  5651. [0, 1, 0, empty, 0, empty, 0, "VK_EXECUTE", empty, empty],
  5652. [0, 1, 0, empty, 0, empty, 0, "VK_SNAPSHOT", empty, empty],
  5653. [0, 1, 0, empty, 0, empty, 0, "VK_HELP", empty, empty],
  5654. [0, 1, 0, empty, 0, empty, 0, "VK_APPS", empty, empty],
  5655. [0, 1, 0, empty, 0, empty, 0, "VK_PROCESSKEY", empty, empty],
  5656. [0, 1, 0, empty, 0, empty, 0, "VK_PACKET", empty, empty],
  5657. [0, 1, 0, empty, 0, empty, 0, "VK_DBE_SBCSCHAR", empty, empty],
  5658. [0, 1, 0, empty, 0, empty, 0, "VK_DBE_DBCSCHAR", empty, empty],
  5659. [0, 1, 0, empty, 0, empty, 0, "VK_ATTN", empty, empty],
  5660. [0, 1, 0, empty, 0, empty, 0, "VK_CRSEL", empty, empty],
  5661. [0, 1, 0, empty, 0, empty, 0, "VK_EXSEL", empty, empty],
  5662. [0, 1, 0, empty, 0, empty, 0, "VK_EREOF", empty, empty],
  5663. [0, 1, 0, empty, 0, empty, 0, "VK_PLAY", empty, empty],
  5664. [0, 1, 0, empty, 0, empty, 0, "VK_ZOOM", empty, empty],
  5665. [0, 1, 0, empty, 0, empty, 0, "VK_NONAME", empty, empty],
  5666. [0, 1, 0, empty, 0, empty, 0, "VK_PA1", empty, empty],
  5667. [0, 1, 0, empty, 0, empty, 0, "VK_OEM_CLEAR", empty, empty]
  5668. ];
  5669. let seenKeyCode = [];
  5670. let seenScanCode = [];
  5671. for (const mapping of mappings) {
  5672. const [_keyCodeOrd, immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel] = mapping;
  5673. if (!seenScanCode[scanCode]) {
  5674. seenScanCode[scanCode] = true;
  5675. scanCodeIntToStr[scanCode] = scanCodeStr;
  5676. scanCodeStrToInt[scanCodeStr] = scanCode;
  5677. scanCodeLowerCaseStrToInt[scanCodeStr.toLowerCase()] = scanCode;
  5678. if (immutable) {
  5679. IMMUTABLE_CODE_TO_KEY_CODE[scanCode] = keyCode;
  5680. if (keyCode !== 0 && keyCode !== 3 && keyCode !== 5 && keyCode !== 4 && keyCode !== 6 && keyCode !== 57) {
  5681. IMMUTABLE_KEY_CODE_TO_CODE[keyCode] = scanCode;
  5682. }
  5683. }
  5684. }
  5685. if (!seenKeyCode[keyCode]) {
  5686. seenKeyCode[keyCode] = true;
  5687. if (!keyCodeStr) {
  5688. throw new Error(`String representation missing for key code ${keyCode} around scan code ${scanCodeStr}`);
  5689. }
  5690. uiMap.define(keyCode, keyCodeStr);
  5691. userSettingsUSMap.define(keyCode, usUserSettingsLabel || keyCodeStr);
  5692. userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel || usUserSettingsLabel || keyCodeStr);
  5693. }
  5694. if (eventKeyCode) {
  5695. EVENT_KEY_CODE_MAP[eventKeyCode] = keyCode;
  5696. }
  5697. if (vkey) {
  5698. NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE[vkey] = keyCode;
  5699. }
  5700. }
  5701. IMMUTABLE_KEY_CODE_TO_CODE[3] = 46;
  5702. })();
  5703. var KeyCodeUtils;
  5704. (function(KeyCodeUtils2) {
  5705. function toString(keyCode) {
  5706. return uiMap.keyCodeToStr(keyCode);
  5707. }
  5708. KeyCodeUtils2.toString = toString;
  5709. function fromString(key) {
  5710. return uiMap.strToKeyCode(key);
  5711. }
  5712. KeyCodeUtils2.fromString = fromString;
  5713. function toUserSettingsUS(keyCode) {
  5714. return userSettingsUSMap.keyCodeToStr(keyCode);
  5715. }
  5716. KeyCodeUtils2.toUserSettingsUS = toUserSettingsUS;
  5717. function toUserSettingsGeneral(keyCode) {
  5718. return userSettingsGeneralMap.keyCodeToStr(keyCode);
  5719. }
  5720. KeyCodeUtils2.toUserSettingsGeneral = toUserSettingsGeneral;
  5721. function fromUserSettings(key) {
  5722. return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key);
  5723. }
  5724. KeyCodeUtils2.fromUserSettings = fromUserSettings;
  5725. function toElectronAccelerator(keyCode) {
  5726. if (keyCode >= 93 && keyCode <= 108) {
  5727. return null;
  5728. }
  5729. switch (keyCode) {
  5730. case 16:
  5731. return "Up";
  5732. case 18:
  5733. return "Down";
  5734. case 15:
  5735. return "Left";
  5736. case 17:
  5737. return "Right";
  5738. }
  5739. return uiMap.keyCodeToStr(keyCode);
  5740. }
  5741. KeyCodeUtils2.toElectronAccelerator = toElectronAccelerator;
  5742. })(KeyCodeUtils || (KeyCodeUtils = {}));
  5743. function KeyChord(firstPart, secondPart) {
  5744. const chordPart = (secondPart & 65535) << 16 >>> 0;
  5745. return (firstPart | chordPart) >>> 0;
  5746. }
  5747. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/core/selection.js
  5748. var Selection = class extends Range {
  5749. constructor(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) {
  5750. super(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn);
  5751. this.selectionStartLineNumber = selectionStartLineNumber;
  5752. this.selectionStartColumn = selectionStartColumn;
  5753. this.positionLineNumber = positionLineNumber;
  5754. this.positionColumn = positionColumn;
  5755. }
  5756. toString() {
  5757. return "[" + this.selectionStartLineNumber + "," + this.selectionStartColumn + " -> " + this.positionLineNumber + "," + this.positionColumn + "]";
  5758. }
  5759. equalsSelection(other) {
  5760. return Selection.selectionsEqual(this, other);
  5761. }
  5762. static selectionsEqual(a2, b) {
  5763. return a2.selectionStartLineNumber === b.selectionStartLineNumber && a2.selectionStartColumn === b.selectionStartColumn && a2.positionLineNumber === b.positionLineNumber && a2.positionColumn === b.positionColumn;
  5764. }
  5765. getDirection() {
  5766. if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) {
  5767. return 0;
  5768. }
  5769. return 1;
  5770. }
  5771. setEndPosition(endLineNumber, endColumn) {
  5772. if (this.getDirection() === 0) {
  5773. return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn);
  5774. }
  5775. return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn);
  5776. }
  5777. getPosition() {
  5778. return new Position(this.positionLineNumber, this.positionColumn);
  5779. }
  5780. getSelectionStart() {
  5781. return new Position(this.selectionStartLineNumber, this.selectionStartColumn);
  5782. }
  5783. setStartPosition(startLineNumber, startColumn) {
  5784. if (this.getDirection() === 0) {
  5785. return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn);
  5786. }
  5787. return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn);
  5788. }
  5789. static fromPositions(start, end = start) {
  5790. return new Selection(start.lineNumber, start.column, end.lineNumber, end.column);
  5791. }
  5792. static fromRange(range, direction) {
  5793. if (direction === 0) {
  5794. return new Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);
  5795. } else {
  5796. return new Selection(range.endLineNumber, range.endColumn, range.startLineNumber, range.startColumn);
  5797. }
  5798. }
  5799. static liftSelection(sel) {
  5800. return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn);
  5801. }
  5802. static selectionsArrEqual(a2, b) {
  5803. if (a2 && !b || !a2 && b) {
  5804. return false;
  5805. }
  5806. if (!a2 && !b) {
  5807. return true;
  5808. }
  5809. if (a2.length !== b.length) {
  5810. return false;
  5811. }
  5812. for (let i = 0, len = a2.length; i < len; i++) {
  5813. if (!this.selectionsEqual(a2[i], b[i])) {
  5814. return false;
  5815. }
  5816. }
  5817. return true;
  5818. }
  5819. static isISelection(obj) {
  5820. return obj && typeof obj.selectionStartLineNumber === "number" && typeof obj.selectionStartColumn === "number" && typeof obj.positionLineNumber === "number" && typeof obj.positionColumn === "number";
  5821. }
  5822. static createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, direction) {
  5823. if (direction === 0) {
  5824. return new Selection(startLineNumber, startColumn, endLineNumber, endColumn);
  5825. }
  5826. return new Selection(endLineNumber, endColumn, startLineNumber, startColumn);
  5827. }
  5828. };
  5829. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/tokenizationRegistry.js
  5830. var __awaiter = function(thisArg, _arguments, P, generator) {
  5831. function adopt(value) {
  5832. return value instanceof P ? value : new P(function(resolve2) {
  5833. resolve2(value);
  5834. });
  5835. }
  5836. return new (P || (P = Promise))(function(resolve2, reject) {
  5837. function fulfilled(value) {
  5838. try {
  5839. step(generator.next(value));
  5840. } catch (e) {
  5841. reject(e);
  5842. }
  5843. }
  5844. function rejected(value) {
  5845. try {
  5846. step(generator["throw"](value));
  5847. } catch (e) {
  5848. reject(e);
  5849. }
  5850. }
  5851. function step(result) {
  5852. result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
  5853. }
  5854. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5855. });
  5856. };
  5857. var TokenizationRegistry = class {
  5858. constructor() {
  5859. this._map = new Map();
  5860. this._factories = new Map();
  5861. this._onDidChange = new Emitter();
  5862. this.onDidChange = this._onDidChange.event;
  5863. this._colorMap = null;
  5864. }
  5865. fire(languages) {
  5866. this._onDidChange.fire({
  5867. changedLanguages: languages,
  5868. changedColorMap: false
  5869. });
  5870. }
  5871. register(language, support) {
  5872. this._map.set(language, support);
  5873. this.fire([language]);
  5874. return toDisposable(() => {
  5875. if (this._map.get(language) !== support) {
  5876. return;
  5877. }
  5878. this._map.delete(language);
  5879. this.fire([language]);
  5880. });
  5881. }
  5882. registerFactory(languageId, factory) {
  5883. var _a3;
  5884. (_a3 = this._factories.get(languageId)) === null || _a3 === void 0 ? void 0 : _a3.dispose();
  5885. const myData = new TokenizationSupportFactoryData(this, languageId, factory);
  5886. this._factories.set(languageId, myData);
  5887. return toDisposable(() => {
  5888. const v = this._factories.get(languageId);
  5889. if (!v || v !== myData) {
  5890. return;
  5891. }
  5892. this._factories.delete(languageId);
  5893. v.dispose();
  5894. });
  5895. }
  5896. getOrCreate(languageId) {
  5897. return __awaiter(this, void 0, void 0, function* () {
  5898. const tokenizationSupport = this.get(languageId);
  5899. if (tokenizationSupport) {
  5900. return tokenizationSupport;
  5901. }
  5902. const factory = this._factories.get(languageId);
  5903. if (!factory || factory.isResolved) {
  5904. return null;
  5905. }
  5906. yield factory.resolve();
  5907. return this.get(languageId);
  5908. });
  5909. }
  5910. get(language) {
  5911. return this._map.get(language) || null;
  5912. }
  5913. isResolved(languageId) {
  5914. const tokenizationSupport = this.get(languageId);
  5915. if (tokenizationSupport) {
  5916. return true;
  5917. }
  5918. const factory = this._factories.get(languageId);
  5919. if (!factory || factory.isResolved) {
  5920. return true;
  5921. }
  5922. return false;
  5923. }
  5924. setColorMap(colorMap) {
  5925. this._colorMap = colorMap;
  5926. this._onDidChange.fire({
  5927. changedLanguages: Array.from(this._map.keys()),
  5928. changedColorMap: true
  5929. });
  5930. }
  5931. getColorMap() {
  5932. return this._colorMap;
  5933. }
  5934. getDefaultBackground() {
  5935. if (this._colorMap && this._colorMap.length > 2) {
  5936. return this._colorMap[2];
  5937. }
  5938. return null;
  5939. }
  5940. };
  5941. var TokenizationSupportFactoryData = class extends Disposable {
  5942. constructor(_registry, _languageId, _factory) {
  5943. super();
  5944. this._registry = _registry;
  5945. this._languageId = _languageId;
  5946. this._factory = _factory;
  5947. this._isDisposed = false;
  5948. this._resolvePromise = null;
  5949. this._isResolved = false;
  5950. }
  5951. get isResolved() {
  5952. return this._isResolved;
  5953. }
  5954. dispose() {
  5955. this._isDisposed = true;
  5956. super.dispose();
  5957. }
  5958. resolve() {
  5959. return __awaiter(this, void 0, void 0, function* () {
  5960. if (!this._resolvePromise) {
  5961. this._resolvePromise = this._create();
  5962. }
  5963. return this._resolvePromise;
  5964. });
  5965. }
  5966. _create() {
  5967. return __awaiter(this, void 0, void 0, function* () {
  5968. const value = yield Promise.resolve(this._factory.createTokenizationSupport());
  5969. this._isResolved = true;
  5970. if (value && !this._isDisposed) {
  5971. this._register(this._registry.register(this._languageId, value));
  5972. }
  5973. });
  5974. }
  5975. };
  5976. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/base/common/codicons.js
  5977. var Codicon = class {
  5978. constructor(id, definition, description2) {
  5979. this.id = id;
  5980. this.definition = definition;
  5981. this.description = description2;
  5982. Codicon._allCodicons.push(this);
  5983. }
  5984. get classNames() {
  5985. return "codicon codicon-" + this.id;
  5986. }
  5987. get classNamesArray() {
  5988. return ["codicon", "codicon-" + this.id];
  5989. }
  5990. get cssSelector() {
  5991. return ".codicon.codicon-" + this.id;
  5992. }
  5993. static getAll() {
  5994. return Codicon._allCodicons;
  5995. }
  5996. };
  5997. Codicon._allCodicons = [];
  5998. Codicon.add = new Codicon("add", {fontCharacter: "\\ea60"});
  5999. Codicon.plus = new Codicon("plus", Codicon.add.definition);
  6000. Codicon.gistNew = new Codicon("gist-new", Codicon.add.definition);
  6001. Codicon.repoCreate = new Codicon("repo-create", Codicon.add.definition);
  6002. Codicon.lightbulb = new Codicon("lightbulb", {fontCharacter: "\\ea61"});
  6003. Codicon.lightBulb = new Codicon("light-bulb", {fontCharacter: "\\ea61"});
  6004. Codicon.repo = new Codicon("repo", {fontCharacter: "\\ea62"});
  6005. Codicon.repoDelete = new Codicon("repo-delete", {fontCharacter: "\\ea62"});
  6006. Codicon.gistFork = new Codicon("gist-fork", {fontCharacter: "\\ea63"});
  6007. Codicon.repoForked = new Codicon("repo-forked", {fontCharacter: "\\ea63"});
  6008. Codicon.gitPullRequest = new Codicon("git-pull-request", {fontCharacter: "\\ea64"});
  6009. Codicon.gitPullRequestAbandoned = new Codicon("git-pull-request-abandoned", {fontCharacter: "\\ea64"});
  6010. Codicon.recordKeys = new Codicon("record-keys", {fontCharacter: "\\ea65"});
  6011. Codicon.keyboard = new Codicon("keyboard", {fontCharacter: "\\ea65"});
  6012. Codicon.tag = new Codicon("tag", {fontCharacter: "\\ea66"});
  6013. Codicon.tagAdd = new Codicon("tag-add", {fontCharacter: "\\ea66"});
  6014. Codicon.tagRemove = new Codicon("tag-remove", {fontCharacter: "\\ea66"});
  6015. Codicon.person = new Codicon("person", {fontCharacter: "\\ea67"});
  6016. Codicon.personFollow = new Codicon("person-follow", {fontCharacter: "\\ea67"});
  6017. Codicon.personOutline = new Codicon("person-outline", {fontCharacter: "\\ea67"});
  6018. Codicon.personFilled = new Codicon("person-filled", {fontCharacter: "\\ea67"});
  6019. Codicon.gitBranch = new Codicon("git-branch", {fontCharacter: "\\ea68"});
  6020. Codicon.gitBranchCreate = new Codicon("git-branch-create", {fontCharacter: "\\ea68"});
  6021. Codicon.gitBranchDelete = new Codicon("git-branch-delete", {fontCharacter: "\\ea68"});
  6022. Codicon.sourceControl = new Codicon("source-control", {fontCharacter: "\\ea68"});
  6023. Codicon.mirror = new Codicon("mirror", {fontCharacter: "\\ea69"});
  6024. Codicon.mirrorPublic = new Codicon("mirror-public", {fontCharacter: "\\ea69"});
  6025. Codicon.star = new Codicon("star", {fontCharacter: "\\ea6a"});
  6026. Codicon.starAdd = new Codicon("star-add", {fontCharacter: "\\ea6a"});
  6027. Codicon.starDelete = new Codicon("star-delete", {fontCharacter: "\\ea6a"});
  6028. Codicon.starEmpty = new Codicon("star-empty", {fontCharacter: "\\ea6a"});
  6029. Codicon.comment = new Codicon("comment", {fontCharacter: "\\ea6b"});
  6030. Codicon.commentAdd = new Codicon("comment-add", {fontCharacter: "\\ea6b"});
  6031. Codicon.alert = new Codicon("alert", {fontCharacter: "\\ea6c"});
  6032. Codicon.warning = new Codicon("warning", {fontCharacter: "\\ea6c"});
  6033. Codicon.search = new Codicon("search", {fontCharacter: "\\ea6d"});
  6034. Codicon.searchSave = new Codicon("search-save", {fontCharacter: "\\ea6d"});
  6035. Codicon.logOut = new Codicon("log-out", {fontCharacter: "\\ea6e"});
  6036. Codicon.signOut = new Codicon("sign-out", {fontCharacter: "\\ea6e"});
  6037. Codicon.logIn = new Codicon("log-in", {fontCharacter: "\\ea6f"});
  6038. Codicon.signIn = new Codicon("sign-in", {fontCharacter: "\\ea6f"});
  6039. Codicon.eye = new Codicon("eye", {fontCharacter: "\\ea70"});
  6040. Codicon.eyeUnwatch = new Codicon("eye-unwatch", {fontCharacter: "\\ea70"});
  6041. Codicon.eyeWatch = new Codicon("eye-watch", {fontCharacter: "\\ea70"});
  6042. Codicon.circleFilled = new Codicon("circle-filled", {fontCharacter: "\\ea71"});
  6043. Codicon.primitiveDot = new Codicon("primitive-dot", {fontCharacter: "\\ea71"});
  6044. Codicon.closeDirty = new Codicon("close-dirty", {fontCharacter: "\\ea71"});
  6045. Codicon.debugBreakpoint = new Codicon("debug-breakpoint", {fontCharacter: "\\ea71"});
  6046. Codicon.debugBreakpointDisabled = new Codicon("debug-breakpoint-disabled", {fontCharacter: "\\ea71"});
  6047. Codicon.debugHint = new Codicon("debug-hint", {fontCharacter: "\\ea71"});
  6048. Codicon.primitiveSquare = new Codicon("primitive-square", {fontCharacter: "\\ea72"});
  6049. Codicon.edit = new Codicon("edit", {fontCharacter: "\\ea73"});
  6050. Codicon.pencil = new Codicon("pencil", {fontCharacter: "\\ea73"});
  6051. Codicon.info = new Codicon("info", {fontCharacter: "\\ea74"});
  6052. Codicon.issueOpened = new Codicon("issue-opened", {fontCharacter: "\\ea74"});
  6053. Codicon.gistPrivate = new Codicon("gist-private", {fontCharacter: "\\ea75"});
  6054. Codicon.gitForkPrivate = new Codicon("git-fork-private", {fontCharacter: "\\ea75"});
  6055. Codicon.lock = new Codicon("lock", {fontCharacter: "\\ea75"});
  6056. Codicon.mirrorPrivate = new Codicon("mirror-private", {fontCharacter: "\\ea75"});
  6057. Codicon.close = new Codicon("close", {fontCharacter: "\\ea76"});
  6058. Codicon.removeClose = new Codicon("remove-close", {fontCharacter: "\\ea76"});
  6059. Codicon.x = new Codicon("x", {fontCharacter: "\\ea76"});
  6060. Codicon.repoSync = new Codicon("repo-sync", {fontCharacter: "\\ea77"});
  6061. Codicon.sync = new Codicon("sync", {fontCharacter: "\\ea77"});
  6062. Codicon.clone = new Codicon("clone", {fontCharacter: "\\ea78"});
  6063. Codicon.desktopDownload = new Codicon("desktop-download", {fontCharacter: "\\ea78"});
  6064. Codicon.beaker = new Codicon("beaker", {fontCharacter: "\\ea79"});
  6065. Codicon.microscope = new Codicon("microscope", {fontCharacter: "\\ea79"});
  6066. Codicon.vm = new Codicon("vm", {fontCharacter: "\\ea7a"});
  6067. Codicon.deviceDesktop = new Codicon("device-desktop", {fontCharacter: "\\ea7a"});
  6068. Codicon.file = new Codicon("file", {fontCharacter: "\\ea7b"});
  6069. Codicon.fileText = new Codicon("file-text", {fontCharacter: "\\ea7b"});
  6070. Codicon.more = new Codicon("more", {fontCharacter: "\\ea7c"});
  6071. Codicon.ellipsis = new Codicon("ellipsis", {fontCharacter: "\\ea7c"});
  6072. Codicon.kebabHorizontal = new Codicon("kebab-horizontal", {fontCharacter: "\\ea7c"});
  6073. Codicon.mailReply = new Codicon("mail-reply", {fontCharacter: "\\ea7d"});
  6074. Codicon.reply = new Codicon("reply", {fontCharacter: "\\ea7d"});
  6075. Codicon.organization = new Codicon("organization", {fontCharacter: "\\ea7e"});
  6076. Codicon.organizationFilled = new Codicon("organization-filled", {fontCharacter: "\\ea7e"});
  6077. Codicon.organizationOutline = new Codicon("organization-outline", {fontCharacter: "\\ea7e"});
  6078. Codicon.newFile = new Codicon("new-file", {fontCharacter: "\\ea7f"});
  6079. Codicon.fileAdd = new Codicon("file-add", {fontCharacter: "\\ea7f"});
  6080. Codicon.newFolder = new Codicon("new-folder", {fontCharacter: "\\ea80"});
  6081. Codicon.fileDirectoryCreate = new Codicon("file-directory-create", {fontCharacter: "\\ea80"});
  6082. Codicon.trash = new Codicon("trash", {fontCharacter: "\\ea81"});
  6083. Codicon.trashcan = new Codicon("trashcan", {fontCharacter: "\\ea81"});
  6084. Codicon.history = new Codicon("history", {fontCharacter: "\\ea82"});
  6085. Codicon.clock = new Codicon("clock", {fontCharacter: "\\ea82"});
  6086. Codicon.folder = new Codicon("folder", {fontCharacter: "\\ea83"});
  6087. Codicon.fileDirectory = new Codicon("file-directory", {fontCharacter: "\\ea83"});
  6088. Codicon.symbolFolder = new Codicon("symbol-folder", {fontCharacter: "\\ea83"});
  6089. Codicon.logoGithub = new Codicon("logo-github", {fontCharacter: "\\ea84"});
  6090. Codicon.markGithub = new Codicon("mark-github", {fontCharacter: "\\ea84"});
  6091. Codicon.github = new Codicon("github", {fontCharacter: "\\ea84"});
  6092. Codicon.terminal = new Codicon("terminal", {fontCharacter: "\\ea85"});
  6093. Codicon.console = new Codicon("console", {fontCharacter: "\\ea85"});
  6094. Codicon.repl = new Codicon("repl", {fontCharacter: "\\ea85"});
  6095. Codicon.zap = new Codicon("zap", {fontCharacter: "\\ea86"});
  6096. Codicon.symbolEvent = new Codicon("symbol-event", {fontCharacter: "\\ea86"});
  6097. Codicon.error = new Codicon("error", {fontCharacter: "\\ea87"});
  6098. Codicon.stop = new Codicon("stop", {fontCharacter: "\\ea87"});
  6099. Codicon.variable = new Codicon("variable", {fontCharacter: "\\ea88"});
  6100. Codicon.symbolVariable = new Codicon("symbol-variable", {fontCharacter: "\\ea88"});
  6101. Codicon.array = new Codicon("array", {fontCharacter: "\\ea8a"});
  6102. Codicon.symbolArray = new Codicon("symbol-array", {fontCharacter: "\\ea8a"});
  6103. Codicon.symbolModule = new Codicon("symbol-module", {fontCharacter: "\\ea8b"});
  6104. Codicon.symbolPackage = new Codicon("symbol-package", {fontCharacter: "\\ea8b"});
  6105. Codicon.symbolNamespace = new Codicon("symbol-namespace", {fontCharacter: "\\ea8b"});
  6106. Codicon.symbolObject = new Codicon("symbol-object", {fontCharacter: "\\ea8b"});
  6107. Codicon.symbolMethod = new Codicon("symbol-method", {fontCharacter: "\\ea8c"});
  6108. Codicon.symbolFunction = new Codicon("symbol-function", {fontCharacter: "\\ea8c"});
  6109. Codicon.symbolConstructor = new Codicon("symbol-constructor", {fontCharacter: "\\ea8c"});
  6110. Codicon.symbolBoolean = new Codicon("symbol-boolean", {fontCharacter: "\\ea8f"});
  6111. Codicon.symbolNull = new Codicon("symbol-null", {fontCharacter: "\\ea8f"});
  6112. Codicon.symbolNumeric = new Codicon("symbol-numeric", {fontCharacter: "\\ea90"});
  6113. Codicon.symbolNumber = new Codicon("symbol-number", {fontCharacter: "\\ea90"});
  6114. Codicon.symbolStructure = new Codicon("symbol-structure", {fontCharacter: "\\ea91"});
  6115. Codicon.symbolStruct = new Codicon("symbol-struct", {fontCharacter: "\\ea91"});
  6116. Codicon.symbolParameter = new Codicon("symbol-parameter", {fontCharacter: "\\ea92"});
  6117. Codicon.symbolTypeParameter = new Codicon("symbol-type-parameter", {fontCharacter: "\\ea92"});
  6118. Codicon.symbolKey = new Codicon("symbol-key", {fontCharacter: "\\ea93"});
  6119. Codicon.symbolText = new Codicon("symbol-text", {fontCharacter: "\\ea93"});
  6120. Codicon.symbolReference = new Codicon("symbol-reference", {fontCharacter: "\\ea94"});
  6121. Codicon.goToFile = new Codicon("go-to-file", {fontCharacter: "\\ea94"});
  6122. Codicon.symbolEnum = new Codicon("symbol-enum", {fontCharacter: "\\ea95"});
  6123. Codicon.symbolValue = new Codicon("symbol-value", {fontCharacter: "\\ea95"});
  6124. Codicon.symbolRuler = new Codicon("symbol-ruler", {fontCharacter: "\\ea96"});
  6125. Codicon.symbolUnit = new Codicon("symbol-unit", {fontCharacter: "\\ea96"});
  6126. Codicon.activateBreakpoints = new Codicon("activate-breakpoints", {fontCharacter: "\\ea97"});
  6127. Codicon.archive = new Codicon("archive", {fontCharacter: "\\ea98"});
  6128. Codicon.arrowBoth = new Codicon("arrow-both", {fontCharacter: "\\ea99"});
  6129. Codicon.arrowDown = new Codicon("arrow-down", {fontCharacter: "\\ea9a"});
  6130. Codicon.arrowLeft = new Codicon("arrow-left", {fontCharacter: "\\ea9b"});
  6131. Codicon.arrowRight = new Codicon("arrow-right", {fontCharacter: "\\ea9c"});
  6132. Codicon.arrowSmallDown = new Codicon("arrow-small-down", {fontCharacter: "\\ea9d"});
  6133. Codicon.arrowSmallLeft = new Codicon("arrow-small-left", {fontCharacter: "\\ea9e"});
  6134. Codicon.arrowSmallRight = new Codicon("arrow-small-right", {fontCharacter: "\\ea9f"});
  6135. Codicon.arrowSmallUp = new Codicon("arrow-small-up", {fontCharacter: "\\eaa0"});
  6136. Codicon.arrowUp = new Codicon("arrow-up", {fontCharacter: "\\eaa1"});
  6137. Codicon.bell = new Codicon("bell", {fontCharacter: "\\eaa2"});
  6138. Codicon.bold = new Codicon("bold", {fontCharacter: "\\eaa3"});
  6139. Codicon.book = new Codicon("book", {fontCharacter: "\\eaa4"});
  6140. Codicon.bookmark = new Codicon("bookmark", {fontCharacter: "\\eaa5"});
  6141. Codicon.debugBreakpointConditionalUnverified = new Codicon("debug-breakpoint-conditional-unverified", {fontCharacter: "\\eaa6"});
  6142. Codicon.debugBreakpointConditional = new Codicon("debug-breakpoint-conditional", {fontCharacter: "\\eaa7"});
  6143. Codicon.debugBreakpointConditionalDisabled = new Codicon("debug-breakpoint-conditional-disabled", {fontCharacter: "\\eaa7"});
  6144. Codicon.debugBreakpointDataUnverified = new Codicon("debug-breakpoint-data-unverified", {fontCharacter: "\\eaa8"});
  6145. Codicon.debugBreakpointData = new Codicon("debug-breakpoint-data", {fontCharacter: "\\eaa9"});
  6146. Codicon.debugBreakpointDataDisabled = new Codicon("debug-breakpoint-data-disabled", {fontCharacter: "\\eaa9"});
  6147. Codicon.debugBreakpointLogUnverified = new Codicon("debug-breakpoint-log-unverified", {fontCharacter: "\\eaaa"});
  6148. Codicon.debugBreakpointLog = new Codicon("debug-breakpoint-log", {fontCharacter: "\\eaab"});
  6149. Codicon.debugBreakpointLogDisabled = new Codicon("debug-breakpoint-log-disabled", {fontCharacter: "\\eaab"});
  6150. Codicon.briefcase = new Codicon("briefcase", {fontCharacter: "\\eaac"});
  6151. Codicon.broadcast = new Codicon("broadcast", {fontCharacter: "\\eaad"});
  6152. Codicon.browser = new Codicon("browser", {fontCharacter: "\\eaae"});
  6153. Codicon.bug = new Codicon("bug", {fontCharacter: "\\eaaf"});
  6154. Codicon.calendar = new Codicon("calendar", {fontCharacter: "\\eab0"});
  6155. Codicon.caseSensitive = new Codicon("case-sensitive", {fontCharacter: "\\eab1"});
  6156. Codicon.check = new Codicon("check", {fontCharacter: "\\eab2"});
  6157. Codicon.checklist = new Codicon("checklist", {fontCharacter: "\\eab3"});
  6158. Codicon.chevronDown = new Codicon("chevron-down", {fontCharacter: "\\eab4"});
  6159. Codicon.dropDownButton = new Codicon("drop-down-button", Codicon.chevronDown.definition);
  6160. Codicon.chevronLeft = new Codicon("chevron-left", {fontCharacter: "\\eab5"});
  6161. Codicon.chevronRight = new Codicon("chevron-right", {fontCharacter: "\\eab6"});
  6162. Codicon.chevronUp = new Codicon("chevron-up", {fontCharacter: "\\eab7"});
  6163. Codicon.chromeClose = new Codicon("chrome-close", {fontCharacter: "\\eab8"});
  6164. Codicon.chromeMaximize = new Codicon("chrome-maximize", {fontCharacter: "\\eab9"});
  6165. Codicon.chromeMinimize = new Codicon("chrome-minimize", {fontCharacter: "\\eaba"});
  6166. Codicon.chromeRestore = new Codicon("chrome-restore", {fontCharacter: "\\eabb"});
  6167. Codicon.circleOutline = new Codicon("circle-outline", {fontCharacter: "\\eabc"});
  6168. Codicon.debugBreakpointUnverified = new Codicon("debug-breakpoint-unverified", {fontCharacter: "\\eabc"});
  6169. Codicon.circleSlash = new Codicon("circle-slash", {fontCharacter: "\\eabd"});
  6170. Codicon.circuitBoard = new Codicon("circuit-board", {fontCharacter: "\\eabe"});
  6171. Codicon.clearAll = new Codicon("clear-all", {fontCharacter: "\\eabf"});
  6172. Codicon.clippy = new Codicon("clippy", {fontCharacter: "\\eac0"});
  6173. Codicon.closeAll = new Codicon("close-all", {fontCharacter: "\\eac1"});
  6174. Codicon.cloudDownload = new Codicon("cloud-download", {fontCharacter: "\\eac2"});
  6175. Codicon.cloudUpload = new Codicon("cloud-upload", {fontCharacter: "\\eac3"});
  6176. Codicon.code = new Codicon("code", {fontCharacter: "\\eac4"});
  6177. Codicon.collapseAll = new Codicon("collapse-all", {fontCharacter: "\\eac5"});
  6178. Codicon.colorMode = new Codicon("color-mode", {fontCharacter: "\\eac6"});
  6179. Codicon.commentDiscussion = new Codicon("comment-discussion", {fontCharacter: "\\eac7"});
  6180. Codicon.compareChanges = new Codicon("compare-changes", {fontCharacter: "\\eafd"});
  6181. Codicon.creditCard = new Codicon("credit-card", {fontCharacter: "\\eac9"});
  6182. Codicon.dash = new Codicon("dash", {fontCharacter: "\\eacc"});
  6183. Codicon.dashboard = new Codicon("dashboard", {fontCharacter: "\\eacd"});
  6184. Codicon.database = new Codicon("database", {fontCharacter: "\\eace"});
  6185. Codicon.debugContinue = new Codicon("debug-continue", {fontCharacter: "\\eacf"});
  6186. Codicon.debugDisconnect = new Codicon("debug-disconnect", {fontCharacter: "\\ead0"});
  6187. Codicon.debugPause = new Codicon("debug-pause", {fontCharacter: "\\ead1"});
  6188. Codicon.debugRestart = new Codicon("debug-restart", {fontCharacter: "\\ead2"});
  6189. Codicon.debugStart = new Codicon("debug-start", {fontCharacter: "\\ead3"});
  6190. Codicon.debugStepInto = new Codicon("debug-step-into", {fontCharacter: "\\ead4"});
  6191. Codicon.debugStepOut = new Codicon("debug-step-out", {fontCharacter: "\\ead5"});
  6192. Codicon.debugStepOver = new Codicon("debug-step-over", {fontCharacter: "\\ead6"});
  6193. Codicon.debugStop = new Codicon("debug-stop", {fontCharacter: "\\ead7"});
  6194. Codicon.debug = new Codicon("debug", {fontCharacter: "\\ead8"});
  6195. Codicon.deviceCameraVideo = new Codicon("device-camera-video", {fontCharacter: "\\ead9"});
  6196. Codicon.deviceCamera = new Codicon("device-camera", {fontCharacter: "\\eada"});
  6197. Codicon.deviceMobile = new Codicon("device-mobile", {fontCharacter: "\\eadb"});
  6198. Codicon.diffAdded = new Codicon("diff-added", {fontCharacter: "\\eadc"});
  6199. Codicon.diffIgnored = new Codicon("diff-ignored", {fontCharacter: "\\eadd"});
  6200. Codicon.diffModified = new Codicon("diff-modified", {fontCharacter: "\\eade"});
  6201. Codicon.diffRemoved = new Codicon("diff-removed", {fontCharacter: "\\eadf"});
  6202. Codicon.diffRenamed = new Codicon("diff-renamed", {fontCharacter: "\\eae0"});
  6203. Codicon.diff = new Codicon("diff", {fontCharacter: "\\eae1"});
  6204. Codicon.discard = new Codicon("discard", {fontCharacter: "\\eae2"});
  6205. Codicon.editorLayout = new Codicon("editor-layout", {fontCharacter: "\\eae3"});
  6206. Codicon.emptyWindow = new Codicon("empty-window", {fontCharacter: "\\eae4"});
  6207. Codicon.exclude = new Codicon("exclude", {fontCharacter: "\\eae5"});
  6208. Codicon.extensions = new Codicon("extensions", {fontCharacter: "\\eae6"});
  6209. Codicon.eyeClosed = new Codicon("eye-closed", {fontCharacter: "\\eae7"});
  6210. Codicon.fileBinary = new Codicon("file-binary", {fontCharacter: "\\eae8"});
  6211. Codicon.fileCode = new Codicon("file-code", {fontCharacter: "\\eae9"});
  6212. Codicon.fileMedia = new Codicon("file-media", {fontCharacter: "\\eaea"});
  6213. Codicon.filePdf = new Codicon("file-pdf", {fontCharacter: "\\eaeb"});
  6214. Codicon.fileSubmodule = new Codicon("file-submodule", {fontCharacter: "\\eaec"});
  6215. Codicon.fileSymlinkDirectory = new Codicon("file-symlink-directory", {fontCharacter: "\\eaed"});
  6216. Codicon.fileSymlinkFile = new Codicon("file-symlink-file", {fontCharacter: "\\eaee"});
  6217. Codicon.fileZip = new Codicon("file-zip", {fontCharacter: "\\eaef"});
  6218. Codicon.files = new Codicon("files", {fontCharacter: "\\eaf0"});
  6219. Codicon.filter = new Codicon("filter", {fontCharacter: "\\eaf1"});
  6220. Codicon.flame = new Codicon("flame", {fontCharacter: "\\eaf2"});
  6221. Codicon.foldDown = new Codicon("fold-down", {fontCharacter: "\\eaf3"});
  6222. Codicon.foldUp = new Codicon("fold-up", {fontCharacter: "\\eaf4"});
  6223. Codicon.fold = new Codicon("fold", {fontCharacter: "\\eaf5"});
  6224. Codicon.folderActive = new Codicon("folder-active", {fontCharacter: "\\eaf6"});
  6225. Codicon.folderOpened = new Codicon("folder-opened", {fontCharacter: "\\eaf7"});
  6226. Codicon.gear = new Codicon("gear", {fontCharacter: "\\eaf8"});
  6227. Codicon.gift = new Codicon("gift", {fontCharacter: "\\eaf9"});
  6228. Codicon.gistSecret = new Codicon("gist-secret", {fontCharacter: "\\eafa"});
  6229. Codicon.gist = new Codicon("gist", {fontCharacter: "\\eafb"});
  6230. Codicon.gitCommit = new Codicon("git-commit", {fontCharacter: "\\eafc"});
  6231. Codicon.gitCompare = new Codicon("git-compare", {fontCharacter: "\\eafd"});
  6232. Codicon.gitMerge = new Codicon("git-merge", {fontCharacter: "\\eafe"});
  6233. Codicon.githubAction = new Codicon("github-action", {fontCharacter: "\\eaff"});
  6234. Codicon.githubAlt = new Codicon("github-alt", {fontCharacter: "\\eb00"});
  6235. Codicon.globe = new Codicon("globe", {fontCharacter: "\\eb01"});
  6236. Codicon.grabber = new Codicon("grabber", {fontCharacter: "\\eb02"});
  6237. Codicon.graph = new Codicon("graph", {fontCharacter: "\\eb03"});
  6238. Codicon.gripper = new Codicon("gripper", {fontCharacter: "\\eb04"});
  6239. Codicon.heart = new Codicon("heart", {fontCharacter: "\\eb05"});
  6240. Codicon.home = new Codicon("home", {fontCharacter: "\\eb06"});
  6241. Codicon.horizontalRule = new Codicon("horizontal-rule", {fontCharacter: "\\eb07"});
  6242. Codicon.hubot = new Codicon("hubot", {fontCharacter: "\\eb08"});
  6243. Codicon.inbox = new Codicon("inbox", {fontCharacter: "\\eb09"});
  6244. Codicon.issueClosed = new Codicon("issue-closed", {fontCharacter: "\\eba4"});
  6245. Codicon.issueReopened = new Codicon("issue-reopened", {fontCharacter: "\\eb0b"});
  6246. Codicon.issues = new Codicon("issues", {fontCharacter: "\\eb0c"});
  6247. Codicon.italic = new Codicon("italic", {fontCharacter: "\\eb0d"});
  6248. Codicon.jersey = new Codicon("jersey", {fontCharacter: "\\eb0e"});
  6249. Codicon.json = new Codicon("json", {fontCharacter: "\\eb0f"});
  6250. Codicon.kebabVertical = new Codicon("kebab-vertical", {fontCharacter: "\\eb10"});
  6251. Codicon.key = new Codicon("key", {fontCharacter: "\\eb11"});
  6252. Codicon.law = new Codicon("law", {fontCharacter: "\\eb12"});
  6253. Codicon.lightbulbAutofix = new Codicon("lightbulb-autofix", {fontCharacter: "\\eb13"});
  6254. Codicon.linkExternal = new Codicon("link-external", {fontCharacter: "\\eb14"});
  6255. Codicon.link = new Codicon("link", {fontCharacter: "\\eb15"});
  6256. Codicon.listOrdered = new Codicon("list-ordered", {fontCharacter: "\\eb16"});
  6257. Codicon.listUnordered = new Codicon("list-unordered", {fontCharacter: "\\eb17"});
  6258. Codicon.liveShare = new Codicon("live-share", {fontCharacter: "\\eb18"});
  6259. Codicon.loading = new Codicon("loading", {fontCharacter: "\\eb19"});
  6260. Codicon.location = new Codicon("location", {fontCharacter: "\\eb1a"});
  6261. Codicon.mailRead = new Codicon("mail-read", {fontCharacter: "\\eb1b"});
  6262. Codicon.mail = new Codicon("mail", {fontCharacter: "\\eb1c"});
  6263. Codicon.markdown = new Codicon("markdown", {fontCharacter: "\\eb1d"});
  6264. Codicon.megaphone = new Codicon("megaphone", {fontCharacter: "\\eb1e"});
  6265. Codicon.mention = new Codicon("mention", {fontCharacter: "\\eb1f"});
  6266. Codicon.milestone = new Codicon("milestone", {fontCharacter: "\\eb20"});
  6267. Codicon.mortarBoard = new Codicon("mortar-board", {fontCharacter: "\\eb21"});
  6268. Codicon.move = new Codicon("move", {fontCharacter: "\\eb22"});
  6269. Codicon.multipleWindows = new Codicon("multiple-windows", {fontCharacter: "\\eb23"});
  6270. Codicon.mute = new Codicon("mute", {fontCharacter: "\\eb24"});
  6271. Codicon.noNewline = new Codicon("no-newline", {fontCharacter: "\\eb25"});
  6272. Codicon.note = new Codicon("note", {fontCharacter: "\\eb26"});
  6273. Codicon.octoface = new Codicon("octoface", {fontCharacter: "\\eb27"});
  6274. Codicon.openPreview = new Codicon("open-preview", {fontCharacter: "\\eb28"});
  6275. Codicon.package_ = new Codicon("package", {fontCharacter: "\\eb29"});
  6276. Codicon.paintcan = new Codicon("paintcan", {fontCharacter: "\\eb2a"});
  6277. Codicon.pin = new Codicon("pin", {fontCharacter: "\\eb2b"});
  6278. Codicon.play = new Codicon("play", {fontCharacter: "\\eb2c"});
  6279. Codicon.run = new Codicon("run", {fontCharacter: "\\eb2c"});
  6280. Codicon.plug = new Codicon("plug", {fontCharacter: "\\eb2d"});
  6281. Codicon.preserveCase = new Codicon("preserve-case", {fontCharacter: "\\eb2e"});
  6282. Codicon.preview = new Codicon("preview", {fontCharacter: "\\eb2f"});
  6283. Codicon.project = new Codicon("project", {fontCharacter: "\\eb30"});
  6284. Codicon.pulse = new Codicon("pulse", {fontCharacter: "\\eb31"});
  6285. Codicon.question = new Codicon("question", {fontCharacter: "\\eb32"});
  6286. Codicon.quote = new Codicon("quote", {fontCharacter: "\\eb33"});
  6287. Codicon.radioTower = new Codicon("radio-tower", {fontCharacter: "\\eb34"});
  6288. Codicon.reactions = new Codicon("reactions", {fontCharacter: "\\eb35"});
  6289. Codicon.references = new Codicon("references", {fontCharacter: "\\eb36"});
  6290. Codicon.refresh = new Codicon("refresh", {fontCharacter: "\\eb37"});
  6291. Codicon.regex = new Codicon("regex", {fontCharacter: "\\eb38"});
  6292. Codicon.remoteExplorer = new Codicon("remote-explorer", {fontCharacter: "\\eb39"});
  6293. Codicon.remote = new Codicon("remote", {fontCharacter: "\\eb3a"});
  6294. Codicon.remove = new Codicon("remove", {fontCharacter: "\\eb3b"});
  6295. Codicon.replaceAll = new Codicon("replace-all", {fontCharacter: "\\eb3c"});
  6296. Codicon.replace = new Codicon("replace", {fontCharacter: "\\eb3d"});
  6297. Codicon.repoClone = new Codicon("repo-clone", {fontCharacter: "\\eb3e"});
  6298. Codicon.repoForcePush = new Codicon("repo-force-push", {fontCharacter: "\\eb3f"});
  6299. Codicon.repoPull = new Codicon("repo-pull", {fontCharacter: "\\eb40"});
  6300. Codicon.repoPush = new Codicon("repo-push", {fontCharacter: "\\eb41"});
  6301. Codicon.report = new Codicon("report", {fontCharacter: "\\eb42"});
  6302. Codicon.requestChanges = new Codicon("request-changes", {fontCharacter: "\\eb43"});
  6303. Codicon.rocket = new Codicon("rocket", {fontCharacter: "\\eb44"});
  6304. Codicon.rootFolderOpened = new Codicon("root-folder-opened", {fontCharacter: "\\eb45"});
  6305. Codicon.rootFolder = new Codicon("root-folder", {fontCharacter: "\\eb46"});
  6306. Codicon.rss = new Codicon("rss", {fontCharacter: "\\eb47"});
  6307. Codicon.ruby = new Codicon("ruby", {fontCharacter: "\\eb48"});
  6308. Codicon.saveAll = new Codicon("save-all", {fontCharacter: "\\eb49"});
  6309. Codicon.saveAs = new Codicon("save-as", {fontCharacter: "\\eb4a"});
  6310. Codicon.save = new Codicon("save", {fontCharacter: "\\eb4b"});
  6311. Codicon.screenFull = new Codicon("screen-full", {fontCharacter: "\\eb4c"});
  6312. Codicon.screenNormal = new Codicon("screen-normal", {fontCharacter: "\\eb4d"});
  6313. Codicon.searchStop = new Codicon("search-stop", {fontCharacter: "\\eb4e"});
  6314. Codicon.server = new Codicon("server", {fontCharacter: "\\eb50"});
  6315. Codicon.settingsGear = new Codicon("settings-gear", {fontCharacter: "\\eb51"});
  6316. Codicon.settings = new Codicon("settings", {fontCharacter: "\\eb52"});
  6317. Codicon.shield = new Codicon("shield", {fontCharacter: "\\eb53"});
  6318. Codicon.smiley = new Codicon("smiley", {fontCharacter: "\\eb54"});
  6319. Codicon.sortPrecedence = new Codicon("sort-precedence", {fontCharacter: "\\eb55"});
  6320. Codicon.splitHorizontal = new Codicon("split-horizontal", {fontCharacter: "\\eb56"});
  6321. Codicon.splitVertical = new Codicon("split-vertical", {fontCharacter: "\\eb57"});
  6322. Codicon.squirrel = new Codicon("squirrel", {fontCharacter: "\\eb58"});
  6323. Codicon.starFull = new Codicon("star-full", {fontCharacter: "\\eb59"});
  6324. Codicon.starHalf = new Codicon("star-half", {fontCharacter: "\\eb5a"});
  6325. Codicon.symbolClass = new Codicon("symbol-class", {fontCharacter: "\\eb5b"});
  6326. Codicon.symbolColor = new Codicon("symbol-color", {fontCharacter: "\\eb5c"});
  6327. Codicon.symbolCustomColor = new Codicon("symbol-customcolor", {fontCharacter: "\\eb5c"});
  6328. Codicon.symbolConstant = new Codicon("symbol-constant", {fontCharacter: "\\eb5d"});
  6329. Codicon.symbolEnumMember = new Codicon("symbol-enum-member", {fontCharacter: "\\eb5e"});
  6330. Codicon.symbolField = new Codicon("symbol-field", {fontCharacter: "\\eb5f"});
  6331. Codicon.symbolFile = new Codicon("symbol-file", {fontCharacter: "\\eb60"});
  6332. Codicon.symbolInterface = new Codicon("symbol-interface", {fontCharacter: "\\eb61"});
  6333. Codicon.symbolKeyword = new Codicon("symbol-keyword", {fontCharacter: "\\eb62"});
  6334. Codicon.symbolMisc = new Codicon("symbol-misc", {fontCharacter: "\\eb63"});
  6335. Codicon.symbolOperator = new Codicon("symbol-operator", {fontCharacter: "\\eb64"});
  6336. Codicon.symbolProperty = new Codicon("symbol-property", {fontCharacter: "\\eb65"});
  6337. Codicon.wrench = new Codicon("wrench", {fontCharacter: "\\eb65"});
  6338. Codicon.wrenchSubaction = new Codicon("wrench-subaction", {fontCharacter: "\\eb65"});
  6339. Codicon.symbolSnippet = new Codicon("symbol-snippet", {fontCharacter: "\\eb66"});
  6340. Codicon.tasklist = new Codicon("tasklist", {fontCharacter: "\\eb67"});
  6341. Codicon.telescope = new Codicon("telescope", {fontCharacter: "\\eb68"});
  6342. Codicon.textSize = new Codicon("text-size", {fontCharacter: "\\eb69"});
  6343. Codicon.threeBars = new Codicon("three-bars", {fontCharacter: "\\eb6a"});
  6344. Codicon.thumbsdown = new Codicon("thumbsdown", {fontCharacter: "\\eb6b"});
  6345. Codicon.thumbsup = new Codicon("thumbsup", {fontCharacter: "\\eb6c"});
  6346. Codicon.tools = new Codicon("tools", {fontCharacter: "\\eb6d"});
  6347. Codicon.triangleDown = new Codicon("triangle-down", {fontCharacter: "\\eb6e"});
  6348. Codicon.triangleLeft = new Codicon("triangle-left", {fontCharacter: "\\eb6f"});
  6349. Codicon.triangleRight = new Codicon("triangle-right", {fontCharacter: "\\eb70"});
  6350. Codicon.triangleUp = new Codicon("triangle-up", {fontCharacter: "\\eb71"});
  6351. Codicon.twitter = new Codicon("twitter", {fontCharacter: "\\eb72"});
  6352. Codicon.unfold = new Codicon("unfold", {fontCharacter: "\\eb73"});
  6353. Codicon.unlock = new Codicon("unlock", {fontCharacter: "\\eb74"});
  6354. Codicon.unmute = new Codicon("unmute", {fontCharacter: "\\eb75"});
  6355. Codicon.unverified = new Codicon("unverified", {fontCharacter: "\\eb76"});
  6356. Codicon.verified = new Codicon("verified", {fontCharacter: "\\eb77"});
  6357. Codicon.versions = new Codicon("versions", {fontCharacter: "\\eb78"});
  6358. Codicon.vmActive = new Codicon("vm-active", {fontCharacter: "\\eb79"});
  6359. Codicon.vmOutline = new Codicon("vm-outline", {fontCharacter: "\\eb7a"});
  6360. Codicon.vmRunning = new Codicon("vm-running", {fontCharacter: "\\eb7b"});
  6361. Codicon.watch = new Codicon("watch", {fontCharacter: "\\eb7c"});
  6362. Codicon.whitespace = new Codicon("whitespace", {fontCharacter: "\\eb7d"});
  6363. Codicon.wholeWord = new Codicon("whole-word", {fontCharacter: "\\eb7e"});
  6364. Codicon.window = new Codicon("window", {fontCharacter: "\\eb7f"});
  6365. Codicon.wordWrap = new Codicon("word-wrap", {fontCharacter: "\\eb80"});
  6366. Codicon.zoomIn = new Codicon("zoom-in", {fontCharacter: "\\eb81"});
  6367. Codicon.zoomOut = new Codicon("zoom-out", {fontCharacter: "\\eb82"});
  6368. Codicon.listFilter = new Codicon("list-filter", {fontCharacter: "\\eb83"});
  6369. Codicon.listFlat = new Codicon("list-flat", {fontCharacter: "\\eb84"});
  6370. Codicon.listSelection = new Codicon("list-selection", {fontCharacter: "\\eb85"});
  6371. Codicon.selection = new Codicon("selection", {fontCharacter: "\\eb85"});
  6372. Codicon.listTree = new Codicon("list-tree", {fontCharacter: "\\eb86"});
  6373. Codicon.debugBreakpointFunctionUnverified = new Codicon("debug-breakpoint-function-unverified", {fontCharacter: "\\eb87"});
  6374. Codicon.debugBreakpointFunction = new Codicon("debug-breakpoint-function", {fontCharacter: "\\eb88"});
  6375. Codicon.debugBreakpointFunctionDisabled = new Codicon("debug-breakpoint-function-disabled", {fontCharacter: "\\eb88"});
  6376. Codicon.debugStackframeActive = new Codicon("debug-stackframe-active", {fontCharacter: "\\eb89"});
  6377. Codicon.debugStackframeDot = new Codicon("debug-stackframe-dot", {fontCharacter: "\\eb8a"});
  6378. Codicon.debugStackframe = new Codicon("debug-stackframe", {fontCharacter: "\\eb8b"});
  6379. Codicon.debugStackframeFocused = new Codicon("debug-stackframe-focused", {fontCharacter: "\\eb8b"});
  6380. Codicon.debugBreakpointUnsupported = new Codicon("debug-breakpoint-unsupported", {fontCharacter: "\\eb8c"});
  6381. Codicon.symbolString = new Codicon("symbol-string", {fontCharacter: "\\eb8d"});
  6382. Codicon.debugReverseContinue = new Codicon("debug-reverse-continue", {fontCharacter: "\\eb8e"});
  6383. Codicon.debugStepBack = new Codicon("debug-step-back", {fontCharacter: "\\eb8f"});
  6384. Codicon.debugRestartFrame = new Codicon("debug-restart-frame", {fontCharacter: "\\eb90"});
  6385. Codicon.callIncoming = new Codicon("call-incoming", {fontCharacter: "\\eb92"});
  6386. Codicon.callOutgoing = new Codicon("call-outgoing", {fontCharacter: "\\eb93"});
  6387. Codicon.menu = new Codicon("menu", {fontCharacter: "\\eb94"});
  6388. Codicon.expandAll = new Codicon("expand-all", {fontCharacter: "\\eb95"});
  6389. Codicon.feedback = new Codicon("feedback", {fontCharacter: "\\eb96"});
  6390. Codicon.groupByRefType = new Codicon("group-by-ref-type", {fontCharacter: "\\eb97"});
  6391. Codicon.ungroupByRefType = new Codicon("ungroup-by-ref-type", {fontCharacter: "\\eb98"});
  6392. Codicon.account = new Codicon("account", {fontCharacter: "\\eb99"});
  6393. Codicon.bellDot = new Codicon("bell-dot", {fontCharacter: "\\eb9a"});
  6394. Codicon.debugConsole = new Codicon("debug-console", {fontCharacter: "\\eb9b"});
  6395. Codicon.library = new Codicon("library", {fontCharacter: "\\eb9c"});
  6396. Codicon.output = new Codicon("output", {fontCharacter: "\\eb9d"});
  6397. Codicon.runAll = new Codicon("run-all", {fontCharacter: "\\eb9e"});
  6398. Codicon.syncIgnored = new Codicon("sync-ignored", {fontCharacter: "\\eb9f"});
  6399. Codicon.pinned = new Codicon("pinned", {fontCharacter: "\\eba0"});
  6400. Codicon.githubInverted = new Codicon("github-inverted", {fontCharacter: "\\eba1"});
  6401. Codicon.debugAlt = new Codicon("debug-alt", {fontCharacter: "\\eb91"});
  6402. Codicon.serverProcess = new Codicon("server-process", {fontCharacter: "\\eba2"});
  6403. Codicon.serverEnvironment = new Codicon("server-environment", {fontCharacter: "\\eba3"});
  6404. Codicon.pass = new Codicon("pass", {fontCharacter: "\\eba4"});
  6405. Codicon.stopCircle = new Codicon("stop-circle", {fontCharacter: "\\eba5"});
  6406. Codicon.playCircle = new Codicon("play-circle", {fontCharacter: "\\eba6"});
  6407. Codicon.record = new Codicon("record", {fontCharacter: "\\eba7"});
  6408. Codicon.debugAltSmall = new Codicon("debug-alt-small", {fontCharacter: "\\eba8"});
  6409. Codicon.vmConnect = new Codicon("vm-connect", {fontCharacter: "\\eba9"});
  6410. Codicon.cloud = new Codicon("cloud", {fontCharacter: "\\ebaa"});
  6411. Codicon.merge = new Codicon("merge", {fontCharacter: "\\ebab"});
  6412. Codicon.exportIcon = new Codicon("export", {fontCharacter: "\\ebac"});
  6413. Codicon.graphLeft = new Codicon("graph-left", {fontCharacter: "\\ebad"});
  6414. Codicon.magnet = new Codicon("magnet", {fontCharacter: "\\ebae"});
  6415. Codicon.notebook = new Codicon("notebook", {fontCharacter: "\\ebaf"});
  6416. Codicon.redo = new Codicon("redo", {fontCharacter: "\\ebb0"});
  6417. Codicon.checkAll = new Codicon("check-all", {fontCharacter: "\\ebb1"});
  6418. Codicon.pinnedDirty = new Codicon("pinned-dirty", {fontCharacter: "\\ebb2"});
  6419. Codicon.passFilled = new Codicon("pass-filled", {fontCharacter: "\\ebb3"});
  6420. Codicon.circleLargeFilled = new Codicon("circle-large-filled", {fontCharacter: "\\ebb4"});
  6421. Codicon.circleLargeOutline = new Codicon("circle-large-outline", {fontCharacter: "\\ebb5"});
  6422. Codicon.combine = new Codicon("combine", {fontCharacter: "\\ebb6"});
  6423. Codicon.gather = new Codicon("gather", {fontCharacter: "\\ebb6"});
  6424. Codicon.table = new Codicon("table", {fontCharacter: "\\ebb7"});
  6425. Codicon.variableGroup = new Codicon("variable-group", {fontCharacter: "\\ebb8"});
  6426. Codicon.typeHierarchy = new Codicon("type-hierarchy", {fontCharacter: "\\ebb9"});
  6427. Codicon.typeHierarchySub = new Codicon("type-hierarchy-sub", {fontCharacter: "\\ebba"});
  6428. Codicon.typeHierarchySuper = new Codicon("type-hierarchy-super", {fontCharacter: "\\ebbb"});
  6429. Codicon.gitPullRequestCreate = new Codicon("git-pull-request-create", {fontCharacter: "\\ebbc"});
  6430. Codicon.runAbove = new Codicon("run-above", {fontCharacter: "\\ebbd"});
  6431. Codicon.runBelow = new Codicon("run-below", {fontCharacter: "\\ebbe"});
  6432. Codicon.notebookTemplate = new Codicon("notebook-template", {fontCharacter: "\\ebbf"});
  6433. Codicon.debugRerun = new Codicon("debug-rerun", {fontCharacter: "\\ebc0"});
  6434. Codicon.workspaceTrusted = new Codicon("workspace-trusted", {fontCharacter: "\\ebc1"});
  6435. Codicon.workspaceUntrusted = new Codicon("workspace-untrusted", {fontCharacter: "\\ebc2"});
  6436. Codicon.workspaceUnspecified = new Codicon("workspace-unspecified", {fontCharacter: "\\ebc3"});
  6437. Codicon.terminalCmd = new Codicon("terminal-cmd", {fontCharacter: "\\ebc4"});
  6438. Codicon.terminalDebian = new Codicon("terminal-debian", {fontCharacter: "\\ebc5"});
  6439. Codicon.terminalLinux = new Codicon("terminal-linux", {fontCharacter: "\\ebc6"});
  6440. Codicon.terminalPowershell = new Codicon("terminal-powershell", {fontCharacter: "\\ebc7"});
  6441. Codicon.terminalTmux = new Codicon("terminal-tmux", {fontCharacter: "\\ebc8"});
  6442. Codicon.terminalUbuntu = new Codicon("terminal-ubuntu", {fontCharacter: "\\ebc9"});
  6443. Codicon.terminalBash = new Codicon("terminal-bash", {fontCharacter: "\\ebca"});
  6444. Codicon.arrowSwap = new Codicon("arrow-swap", {fontCharacter: "\\ebcb"});
  6445. Codicon.copy = new Codicon("copy", {fontCharacter: "\\ebcc"});
  6446. Codicon.personAdd = new Codicon("person-add", {fontCharacter: "\\ebcd"});
  6447. Codicon.filterFilled = new Codicon("filter-filled", {fontCharacter: "\\ebce"});
  6448. Codicon.wand = new Codicon("wand", {fontCharacter: "\\ebcf"});
  6449. Codicon.debugLineByLine = new Codicon("debug-line-by-line", {fontCharacter: "\\ebd0"});
  6450. Codicon.inspect = new Codicon("inspect", {fontCharacter: "\\ebd1"});
  6451. Codicon.layers = new Codicon("layers", {fontCharacter: "\\ebd2"});
  6452. Codicon.layersDot = new Codicon("layers-dot", {fontCharacter: "\\ebd3"});
  6453. Codicon.layersActive = new Codicon("layers-active", {fontCharacter: "\\ebd4"});
  6454. Codicon.compass = new Codicon("compass", {fontCharacter: "\\ebd5"});
  6455. Codicon.compassDot = new Codicon("compass-dot", {fontCharacter: "\\ebd6"});
  6456. Codicon.compassActive = new Codicon("compass-active", {fontCharacter: "\\ebd7"});
  6457. Codicon.azure = new Codicon("azure", {fontCharacter: "\\ebd8"});
  6458. Codicon.issueDraft = new Codicon("issue-draft", {fontCharacter: "\\ebd9"});
  6459. Codicon.gitPullRequestClosed = new Codicon("git-pull-request-closed", {fontCharacter: "\\ebda"});
  6460. Codicon.gitPullRequestDraft = new Codicon("git-pull-request-draft", {fontCharacter: "\\ebdb"});
  6461. Codicon.debugAll = new Codicon("debug-all", {fontCharacter: "\\ebdc"});
  6462. Codicon.debugCoverage = new Codicon("debug-coverage", {fontCharacter: "\\ebdd"});
  6463. Codicon.runErrors = new Codicon("run-errors", {fontCharacter: "\\ebde"});
  6464. Codicon.folderLibrary = new Codicon("folder-library", {fontCharacter: "\\ebdf"});
  6465. Codicon.debugContinueSmall = new Codicon("debug-continue-small", {fontCharacter: "\\ebe0"});
  6466. Codicon.beakerStop = new Codicon("beaker-stop", {fontCharacter: "\\ebe1"});
  6467. Codicon.graphLine = new Codicon("graph-line", {fontCharacter: "\\ebe2"});
  6468. Codicon.graphScatter = new Codicon("graph-scatter", {fontCharacter: "\\ebe3"});
  6469. Codicon.pieChart = new Codicon("pie-chart", {fontCharacter: "\\ebe4"});
  6470. Codicon.bracket = new Codicon("bracket", Codicon.json.definition);
  6471. Codicon.bracketDot = new Codicon("bracket-dot", {fontCharacter: "\\ebe5"});
  6472. Codicon.bracketError = new Codicon("bracket-error", {fontCharacter: "\\ebe6"});
  6473. Codicon.lockSmall = new Codicon("lock-small", {fontCharacter: "\\ebe7"});
  6474. Codicon.azureDevops = new Codicon("azure-devops", {fontCharacter: "\\ebe8"});
  6475. Codicon.verifiedFilled = new Codicon("verified-filled", {fontCharacter: "\\ebe9"});
  6476. Codicon.newLine = new Codicon("newline", {fontCharacter: "\\ebea"});
  6477. Codicon.layout = new Codicon("layout", {fontCharacter: "\\ebeb"});
  6478. Codicon.layoutActivitybarLeft = new Codicon("layout-activitybar-left", {fontCharacter: "\\ebec"});
  6479. Codicon.layoutActivitybarRight = new Codicon("layout-activitybar-right", {fontCharacter: "\\ebed"});
  6480. Codicon.layoutPanelLeft = new Codicon("layout-panel-left", {fontCharacter: "\\ebee"});
  6481. Codicon.layoutPanelCenter = new Codicon("layout-panel-center", {fontCharacter: "\\ebef"});
  6482. Codicon.layoutPanelJustify = new Codicon("layout-panel-justify", {fontCharacter: "\\ebf0"});
  6483. Codicon.layoutPanelRight = new Codicon("layout-panel-right", {fontCharacter: "\\ebf1"});
  6484. Codicon.layoutPanel = new Codicon("layout-panel", {fontCharacter: "\\ebf2"});
  6485. Codicon.layoutSidebarLeft = new Codicon("layout-sidebar-left", {fontCharacter: "\\ebf3"});
  6486. Codicon.layoutSidebarRight = new Codicon("layout-sidebar-right", {fontCharacter: "\\ebf4"});
  6487. Codicon.layoutStatusbar = new Codicon("layout-statusbar", {fontCharacter: "\\ebf5"});
  6488. Codicon.layoutMenubar = new Codicon("layout-menubar", {fontCharacter: "\\ebf6"});
  6489. Codicon.layoutCentered = new Codicon("layout-centered", {fontCharacter: "\\ebf7"});
  6490. Codicon.target = new Codicon("target", {fontCharacter: "\\ebf8"});
  6491. Codicon.indent = new Codicon("indent", {fontCharacter: "\\ebf9"});
  6492. Codicon.recordSmall = new Codicon("record-small", {fontCharacter: "\\ebfa"});
  6493. Codicon.errorSmall = new Codicon("error-small", {fontCharacter: "\\ebfb"});
  6494. Codicon.arrowCircleDown = new Codicon("arrow-circle-down", {fontCharacter: "\\ebfc"});
  6495. Codicon.arrowCircleLeft = new Codicon("arrow-circle-left", {fontCharacter: "\\ebfd"});
  6496. Codicon.arrowCircleRight = new Codicon("arrow-circle-right", {fontCharacter: "\\ebfe"});
  6497. Codicon.arrowCircleUp = new Codicon("arrow-circle-up", {fontCharacter: "\\ebff"});
  6498. Codicon.dialogError = new Codicon("dialog-error", Codicon.error.definition);
  6499. Codicon.dialogWarning = new Codicon("dialog-warning", Codicon.warning.definition);
  6500. Codicon.dialogInfo = new Codicon("dialog-info", Codicon.info.definition);
  6501. Codicon.dialogClose = new Codicon("dialog-close", Codicon.close.definition);
  6502. Codicon.treeItemExpanded = new Codicon("tree-item-expanded", Codicon.chevronDown.definition);
  6503. Codicon.treeFilterOnTypeOn = new Codicon("tree-filter-on-type-on", Codicon.listFilter.definition);
  6504. Codicon.treeFilterOnTypeOff = new Codicon("tree-filter-on-type-off", Codicon.listSelection.definition);
  6505. Codicon.treeFilterClear = new Codicon("tree-filter-clear", Codicon.close.definition);
  6506. Codicon.treeItemLoading = new Codicon("tree-item-loading", Codicon.loading.definition);
  6507. Codicon.menuSelection = new Codicon("menu-selection", Codicon.check.definition);
  6508. Codicon.menuSubmenu = new Codicon("menu-submenu", Codicon.chevronRight.definition);
  6509. Codicon.menuBarMore = new Codicon("menubar-more", Codicon.more.definition);
  6510. Codicon.scrollbarButtonLeft = new Codicon("scrollbar-button-left", Codicon.triangleLeft.definition);
  6511. Codicon.scrollbarButtonRight = new Codicon("scrollbar-button-right", Codicon.triangleRight.definition);
  6512. Codicon.scrollbarButtonUp = new Codicon("scrollbar-button-up", Codicon.triangleUp.definition);
  6513. Codicon.scrollbarButtonDown = new Codicon("scrollbar-button-down", Codicon.triangleDown.definition);
  6514. Codicon.toolBarMore = new Codicon("toolbar-more", Codicon.more.definition);
  6515. Codicon.quickInputBack = new Codicon("quick-input-back", Codicon.arrowLeft.definition);
  6516. var CSSIcon;
  6517. (function(CSSIcon2) {
  6518. CSSIcon2.iconNameSegment = "[A-Za-z0-9]+";
  6519. CSSIcon2.iconNameExpression = "[A-Za-z0-9-]+";
  6520. CSSIcon2.iconModifierExpression = "~[A-Za-z]+";
  6521. CSSIcon2.iconNameCharacter = "[A-Za-z0-9~-]";
  6522. const cssIconIdRegex = new RegExp(`^(${CSSIcon2.iconNameExpression})(${CSSIcon2.iconModifierExpression})?$`);
  6523. function asClassNameArray(icon) {
  6524. if (icon instanceof Codicon) {
  6525. return ["codicon", "codicon-" + icon.id];
  6526. }
  6527. const match = cssIconIdRegex.exec(icon.id);
  6528. if (!match) {
  6529. return asClassNameArray(Codicon.error);
  6530. }
  6531. let [, id, modifier] = match;
  6532. const classNames = ["codicon", "codicon-" + id];
  6533. if (modifier) {
  6534. classNames.push("codicon-modifier-" + modifier.substr(1));
  6535. }
  6536. return classNames;
  6537. }
  6538. CSSIcon2.asClassNameArray = asClassNameArray;
  6539. function asClassName(icon) {
  6540. return asClassNameArray(icon).join(" ");
  6541. }
  6542. CSSIcon2.asClassName = asClassName;
  6543. function asCSSSelector(icon) {
  6544. return "." + asClassNameArray(icon).join(".");
  6545. }
  6546. CSSIcon2.asCSSSelector = asCSSSelector;
  6547. })(CSSIcon || (CSSIcon = {}));
  6548. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/languages.js
  6549. var Token = class {
  6550. constructor(offset, type, language) {
  6551. this._tokenBrand = void 0;
  6552. this.offset = offset;
  6553. this.type = type;
  6554. this.language = language;
  6555. }
  6556. toString() {
  6557. return "(" + this.offset + ", " + this.type + ")";
  6558. }
  6559. };
  6560. var CompletionItemKinds;
  6561. (function(CompletionItemKinds2) {
  6562. const byKind = new Map();
  6563. byKind.set(0, Codicon.symbolMethod);
  6564. byKind.set(1, Codicon.symbolFunction);
  6565. byKind.set(2, Codicon.symbolConstructor);
  6566. byKind.set(3, Codicon.symbolField);
  6567. byKind.set(4, Codicon.symbolVariable);
  6568. byKind.set(5, Codicon.symbolClass);
  6569. byKind.set(6, Codicon.symbolStruct);
  6570. byKind.set(7, Codicon.symbolInterface);
  6571. byKind.set(8, Codicon.symbolModule);
  6572. byKind.set(9, Codicon.symbolProperty);
  6573. byKind.set(10, Codicon.symbolEvent);
  6574. byKind.set(11, Codicon.symbolOperator);
  6575. byKind.set(12, Codicon.symbolUnit);
  6576. byKind.set(13, Codicon.symbolValue);
  6577. byKind.set(15, Codicon.symbolEnum);
  6578. byKind.set(14, Codicon.symbolConstant);
  6579. byKind.set(15, Codicon.symbolEnum);
  6580. byKind.set(16, Codicon.symbolEnumMember);
  6581. byKind.set(17, Codicon.symbolKeyword);
  6582. byKind.set(27, Codicon.symbolSnippet);
  6583. byKind.set(18, Codicon.symbolText);
  6584. byKind.set(19, Codicon.symbolColor);
  6585. byKind.set(20, Codicon.symbolFile);
  6586. byKind.set(21, Codicon.symbolReference);
  6587. byKind.set(22, Codicon.symbolCustomColor);
  6588. byKind.set(23, Codicon.symbolFolder);
  6589. byKind.set(24, Codicon.symbolTypeParameter);
  6590. byKind.set(25, Codicon.account);
  6591. byKind.set(26, Codicon.issues);
  6592. function toIcon(kind) {
  6593. let codicon = byKind.get(kind);
  6594. if (!codicon) {
  6595. console.info("No codicon found for CompletionItemKind " + kind);
  6596. codicon = Codicon.symbolProperty;
  6597. }
  6598. return codicon;
  6599. }
  6600. CompletionItemKinds2.toIcon = toIcon;
  6601. const data = new Map();
  6602. data.set("method", 0);
  6603. data.set("function", 1);
  6604. data.set("constructor", 2);
  6605. data.set("field", 3);
  6606. data.set("variable", 4);
  6607. data.set("class", 5);
  6608. data.set("struct", 6);
  6609. data.set("interface", 7);
  6610. data.set("module", 8);
  6611. data.set("property", 9);
  6612. data.set("event", 10);
  6613. data.set("operator", 11);
  6614. data.set("unit", 12);
  6615. data.set("value", 13);
  6616. data.set("constant", 14);
  6617. data.set("enum", 15);
  6618. data.set("enum-member", 16);
  6619. data.set("enumMember", 16);
  6620. data.set("keyword", 17);
  6621. data.set("snippet", 27);
  6622. data.set("text", 18);
  6623. data.set("color", 19);
  6624. data.set("file", 20);
  6625. data.set("reference", 21);
  6626. data.set("customcolor", 22);
  6627. data.set("folder", 23);
  6628. data.set("type-parameter", 24);
  6629. data.set("typeParameter", 24);
  6630. data.set("account", 25);
  6631. data.set("issue", 26);
  6632. function fromString(value, strict) {
  6633. let res = data.get(value);
  6634. if (typeof res === "undefined" && !strict) {
  6635. res = 9;
  6636. }
  6637. return res;
  6638. }
  6639. CompletionItemKinds2.fromString = fromString;
  6640. })(CompletionItemKinds || (CompletionItemKinds = {}));
  6641. var InlineCompletionTriggerKind;
  6642. (function(InlineCompletionTriggerKind3) {
  6643. InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Automatic"] = 0] = "Automatic";
  6644. InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Explicit"] = 1] = "Explicit";
  6645. })(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));
  6646. var SignatureHelpTriggerKind;
  6647. (function(SignatureHelpTriggerKind3) {
  6648. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["Invoke"] = 1] = "Invoke";
  6649. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["TriggerCharacter"] = 2] = "TriggerCharacter";
  6650. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["ContentChange"] = 3] = "ContentChange";
  6651. })(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {}));
  6652. var DocumentHighlightKind;
  6653. (function(DocumentHighlightKind4) {
  6654. DocumentHighlightKind4[DocumentHighlightKind4["Text"] = 0] = "Text";
  6655. DocumentHighlightKind4[DocumentHighlightKind4["Read"] = 1] = "Read";
  6656. DocumentHighlightKind4[DocumentHighlightKind4["Write"] = 2] = "Write";
  6657. })(DocumentHighlightKind || (DocumentHighlightKind = {}));
  6658. var SymbolKinds;
  6659. (function(SymbolKinds2) {
  6660. const byKind = new Map();
  6661. byKind.set(0, Codicon.symbolFile);
  6662. byKind.set(1, Codicon.symbolModule);
  6663. byKind.set(2, Codicon.symbolNamespace);
  6664. byKind.set(3, Codicon.symbolPackage);
  6665. byKind.set(4, Codicon.symbolClass);
  6666. byKind.set(5, Codicon.symbolMethod);
  6667. byKind.set(6, Codicon.symbolProperty);
  6668. byKind.set(7, Codicon.symbolField);
  6669. byKind.set(8, Codicon.symbolConstructor);
  6670. byKind.set(9, Codicon.symbolEnum);
  6671. byKind.set(10, Codicon.symbolInterface);
  6672. byKind.set(11, Codicon.symbolFunction);
  6673. byKind.set(12, Codicon.symbolVariable);
  6674. byKind.set(13, Codicon.symbolConstant);
  6675. byKind.set(14, Codicon.symbolString);
  6676. byKind.set(15, Codicon.symbolNumber);
  6677. byKind.set(16, Codicon.symbolBoolean);
  6678. byKind.set(17, Codicon.symbolArray);
  6679. byKind.set(18, Codicon.symbolObject);
  6680. byKind.set(19, Codicon.symbolKey);
  6681. byKind.set(20, Codicon.symbolNull);
  6682. byKind.set(21, Codicon.symbolEnumMember);
  6683. byKind.set(22, Codicon.symbolStruct);
  6684. byKind.set(23, Codicon.symbolEvent);
  6685. byKind.set(24, Codicon.symbolOperator);
  6686. byKind.set(25, Codicon.symbolTypeParameter);
  6687. function toIcon(kind) {
  6688. let icon = byKind.get(kind);
  6689. if (!icon) {
  6690. console.info("No codicon found for SymbolKind " + kind);
  6691. icon = Codicon.symbolProperty;
  6692. }
  6693. return icon;
  6694. }
  6695. SymbolKinds2.toIcon = toIcon;
  6696. })(SymbolKinds || (SymbolKinds = {}));
  6697. var FoldingRangeKind = class {
  6698. constructor(value) {
  6699. this.value = value;
  6700. }
  6701. };
  6702. FoldingRangeKind.Comment = new FoldingRangeKind("comment");
  6703. FoldingRangeKind.Imports = new FoldingRangeKind("imports");
  6704. FoldingRangeKind.Region = new FoldingRangeKind("region");
  6705. var Command;
  6706. (function(Command3) {
  6707. function is(obj) {
  6708. if (!obj || typeof obj !== "object") {
  6709. return false;
  6710. }
  6711. return typeof obj.id === "string" && typeof obj.title === "string";
  6712. }
  6713. Command3.is = is;
  6714. })(Command || (Command = {}));
  6715. var InlayHintKind;
  6716. (function(InlayHintKind3) {
  6717. InlayHintKind3[InlayHintKind3["Type"] = 1] = "Type";
  6718. InlayHintKind3[InlayHintKind3["Parameter"] = 2] = "Parameter";
  6719. })(InlayHintKind || (InlayHintKind = {}));
  6720. var TokenizationRegistry2 = new TokenizationRegistry();
  6721. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js
  6722. var AccessibilitySupport;
  6723. (function(AccessibilitySupport2) {
  6724. AccessibilitySupport2[AccessibilitySupport2["Unknown"] = 0] = "Unknown";
  6725. AccessibilitySupport2[AccessibilitySupport2["Disabled"] = 1] = "Disabled";
  6726. AccessibilitySupport2[AccessibilitySupport2["Enabled"] = 2] = "Enabled";
  6727. })(AccessibilitySupport || (AccessibilitySupport = {}));
  6728. var CompletionItemInsertTextRule;
  6729. (function(CompletionItemInsertTextRule2) {
  6730. CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["KeepWhitespace"] = 1] = "KeepWhitespace";
  6731. CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["InsertAsSnippet"] = 4] = "InsertAsSnippet";
  6732. })(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {}));
  6733. var CompletionItemKind;
  6734. (function(CompletionItemKind3) {
  6735. CompletionItemKind3[CompletionItemKind3["Method"] = 0] = "Method";
  6736. CompletionItemKind3[CompletionItemKind3["Function"] = 1] = "Function";
  6737. CompletionItemKind3[CompletionItemKind3["Constructor"] = 2] = "Constructor";
  6738. CompletionItemKind3[CompletionItemKind3["Field"] = 3] = "Field";
  6739. CompletionItemKind3[CompletionItemKind3["Variable"] = 4] = "Variable";
  6740. CompletionItemKind3[CompletionItemKind3["Class"] = 5] = "Class";
  6741. CompletionItemKind3[CompletionItemKind3["Struct"] = 6] = "Struct";
  6742. CompletionItemKind3[CompletionItemKind3["Interface"] = 7] = "Interface";
  6743. CompletionItemKind3[CompletionItemKind3["Module"] = 8] = "Module";
  6744. CompletionItemKind3[CompletionItemKind3["Property"] = 9] = "Property";
  6745. CompletionItemKind3[CompletionItemKind3["Event"] = 10] = "Event";
  6746. CompletionItemKind3[CompletionItemKind3["Operator"] = 11] = "Operator";
  6747. CompletionItemKind3[CompletionItemKind3["Unit"] = 12] = "Unit";
  6748. CompletionItemKind3[CompletionItemKind3["Value"] = 13] = "Value";
  6749. CompletionItemKind3[CompletionItemKind3["Constant"] = 14] = "Constant";
  6750. CompletionItemKind3[CompletionItemKind3["Enum"] = 15] = "Enum";
  6751. CompletionItemKind3[CompletionItemKind3["EnumMember"] = 16] = "EnumMember";
  6752. CompletionItemKind3[CompletionItemKind3["Keyword"] = 17] = "Keyword";
  6753. CompletionItemKind3[CompletionItemKind3["Text"] = 18] = "Text";
  6754. CompletionItemKind3[CompletionItemKind3["Color"] = 19] = "Color";
  6755. CompletionItemKind3[CompletionItemKind3["File"] = 20] = "File";
  6756. CompletionItemKind3[CompletionItemKind3["Reference"] = 21] = "Reference";
  6757. CompletionItemKind3[CompletionItemKind3["Customcolor"] = 22] = "Customcolor";
  6758. CompletionItemKind3[CompletionItemKind3["Folder"] = 23] = "Folder";
  6759. CompletionItemKind3[CompletionItemKind3["TypeParameter"] = 24] = "TypeParameter";
  6760. CompletionItemKind3[CompletionItemKind3["User"] = 25] = "User";
  6761. CompletionItemKind3[CompletionItemKind3["Issue"] = 26] = "Issue";
  6762. CompletionItemKind3[CompletionItemKind3["Snippet"] = 27] = "Snippet";
  6763. })(CompletionItemKind || (CompletionItemKind = {}));
  6764. var CompletionItemTag;
  6765. (function(CompletionItemTag3) {
  6766. CompletionItemTag3[CompletionItemTag3["Deprecated"] = 1] = "Deprecated";
  6767. })(CompletionItemTag || (CompletionItemTag = {}));
  6768. var CompletionTriggerKind;
  6769. (function(CompletionTriggerKind2) {
  6770. CompletionTriggerKind2[CompletionTriggerKind2["Invoke"] = 0] = "Invoke";
  6771. CompletionTriggerKind2[CompletionTriggerKind2["TriggerCharacter"] = 1] = "TriggerCharacter";
  6772. CompletionTriggerKind2[CompletionTriggerKind2["TriggerForIncompleteCompletions"] = 2] = "TriggerForIncompleteCompletions";
  6773. })(CompletionTriggerKind || (CompletionTriggerKind = {}));
  6774. var ContentWidgetPositionPreference;
  6775. (function(ContentWidgetPositionPreference2) {
  6776. ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["EXACT"] = 0] = "EXACT";
  6777. ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["ABOVE"] = 1] = "ABOVE";
  6778. ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["BELOW"] = 2] = "BELOW";
  6779. })(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {}));
  6780. var CursorChangeReason;
  6781. (function(CursorChangeReason2) {
  6782. CursorChangeReason2[CursorChangeReason2["NotSet"] = 0] = "NotSet";
  6783. CursorChangeReason2[CursorChangeReason2["ContentFlush"] = 1] = "ContentFlush";
  6784. CursorChangeReason2[CursorChangeReason2["RecoverFromMarkers"] = 2] = "RecoverFromMarkers";
  6785. CursorChangeReason2[CursorChangeReason2["Explicit"] = 3] = "Explicit";
  6786. CursorChangeReason2[CursorChangeReason2["Paste"] = 4] = "Paste";
  6787. CursorChangeReason2[CursorChangeReason2["Undo"] = 5] = "Undo";
  6788. CursorChangeReason2[CursorChangeReason2["Redo"] = 6] = "Redo";
  6789. })(CursorChangeReason || (CursorChangeReason = {}));
  6790. var DefaultEndOfLine;
  6791. (function(DefaultEndOfLine2) {
  6792. DefaultEndOfLine2[DefaultEndOfLine2["LF"] = 1] = "LF";
  6793. DefaultEndOfLine2[DefaultEndOfLine2["CRLF"] = 2] = "CRLF";
  6794. })(DefaultEndOfLine || (DefaultEndOfLine = {}));
  6795. var DocumentHighlightKind2;
  6796. (function(DocumentHighlightKind4) {
  6797. DocumentHighlightKind4[DocumentHighlightKind4["Text"] = 0] = "Text";
  6798. DocumentHighlightKind4[DocumentHighlightKind4["Read"] = 1] = "Read";
  6799. DocumentHighlightKind4[DocumentHighlightKind4["Write"] = 2] = "Write";
  6800. })(DocumentHighlightKind2 || (DocumentHighlightKind2 = {}));
  6801. var EditorAutoIndentStrategy;
  6802. (function(EditorAutoIndentStrategy2) {
  6803. EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["None"] = 0] = "None";
  6804. EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Keep"] = 1] = "Keep";
  6805. EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Brackets"] = 2] = "Brackets";
  6806. EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Advanced"] = 3] = "Advanced";
  6807. EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Full"] = 4] = "Full";
  6808. })(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {}));
  6809. var EditorOption;
  6810. (function(EditorOption2) {
  6811. EditorOption2[EditorOption2["acceptSuggestionOnCommitCharacter"] = 0] = "acceptSuggestionOnCommitCharacter";
  6812. EditorOption2[EditorOption2["acceptSuggestionOnEnter"] = 1] = "acceptSuggestionOnEnter";
  6813. EditorOption2[EditorOption2["accessibilitySupport"] = 2] = "accessibilitySupport";
  6814. EditorOption2[EditorOption2["accessibilityPageSize"] = 3] = "accessibilityPageSize";
  6815. EditorOption2[EditorOption2["ariaLabel"] = 4] = "ariaLabel";
  6816. EditorOption2[EditorOption2["autoClosingBrackets"] = 5] = "autoClosingBrackets";
  6817. EditorOption2[EditorOption2["autoClosingDelete"] = 6] = "autoClosingDelete";
  6818. EditorOption2[EditorOption2["autoClosingOvertype"] = 7] = "autoClosingOvertype";
  6819. EditorOption2[EditorOption2["autoClosingQuotes"] = 8] = "autoClosingQuotes";
  6820. EditorOption2[EditorOption2["autoIndent"] = 9] = "autoIndent";
  6821. EditorOption2[EditorOption2["automaticLayout"] = 10] = "automaticLayout";
  6822. EditorOption2[EditorOption2["autoSurround"] = 11] = "autoSurround";
  6823. EditorOption2[EditorOption2["bracketPairColorization"] = 12] = "bracketPairColorization";
  6824. EditorOption2[EditorOption2["guides"] = 13] = "guides";
  6825. EditorOption2[EditorOption2["codeLens"] = 14] = "codeLens";
  6826. EditorOption2[EditorOption2["codeLensFontFamily"] = 15] = "codeLensFontFamily";
  6827. EditorOption2[EditorOption2["codeLensFontSize"] = 16] = "codeLensFontSize";
  6828. EditorOption2[EditorOption2["colorDecorators"] = 17] = "colorDecorators";
  6829. EditorOption2[EditorOption2["columnSelection"] = 18] = "columnSelection";
  6830. EditorOption2[EditorOption2["comments"] = 19] = "comments";
  6831. EditorOption2[EditorOption2["contextmenu"] = 20] = "contextmenu";
  6832. EditorOption2[EditorOption2["copyWithSyntaxHighlighting"] = 21] = "copyWithSyntaxHighlighting";
  6833. EditorOption2[EditorOption2["cursorBlinking"] = 22] = "cursorBlinking";
  6834. EditorOption2[EditorOption2["cursorSmoothCaretAnimation"] = 23] = "cursorSmoothCaretAnimation";
  6835. EditorOption2[EditorOption2["cursorStyle"] = 24] = "cursorStyle";
  6836. EditorOption2[EditorOption2["cursorSurroundingLines"] = 25] = "cursorSurroundingLines";
  6837. EditorOption2[EditorOption2["cursorSurroundingLinesStyle"] = 26] = "cursorSurroundingLinesStyle";
  6838. EditorOption2[EditorOption2["cursorWidth"] = 27] = "cursorWidth";
  6839. EditorOption2[EditorOption2["disableLayerHinting"] = 28] = "disableLayerHinting";
  6840. EditorOption2[EditorOption2["disableMonospaceOptimizations"] = 29] = "disableMonospaceOptimizations";
  6841. EditorOption2[EditorOption2["domReadOnly"] = 30] = "domReadOnly";
  6842. EditorOption2[EditorOption2["dragAndDrop"] = 31] = "dragAndDrop";
  6843. EditorOption2[EditorOption2["emptySelectionClipboard"] = 32] = "emptySelectionClipboard";
  6844. EditorOption2[EditorOption2["extraEditorClassName"] = 33] = "extraEditorClassName";
  6845. EditorOption2[EditorOption2["fastScrollSensitivity"] = 34] = "fastScrollSensitivity";
  6846. EditorOption2[EditorOption2["find"] = 35] = "find";
  6847. EditorOption2[EditorOption2["fixedOverflowWidgets"] = 36] = "fixedOverflowWidgets";
  6848. EditorOption2[EditorOption2["folding"] = 37] = "folding";
  6849. EditorOption2[EditorOption2["foldingStrategy"] = 38] = "foldingStrategy";
  6850. EditorOption2[EditorOption2["foldingHighlight"] = 39] = "foldingHighlight";
  6851. EditorOption2[EditorOption2["foldingImportsByDefault"] = 40] = "foldingImportsByDefault";
  6852. EditorOption2[EditorOption2["foldingMaximumRegions"] = 41] = "foldingMaximumRegions";
  6853. EditorOption2[EditorOption2["unfoldOnClickAfterEndOfLine"] = 42] = "unfoldOnClickAfterEndOfLine";
  6854. EditorOption2[EditorOption2["fontFamily"] = 43] = "fontFamily";
  6855. EditorOption2[EditorOption2["fontInfo"] = 44] = "fontInfo";
  6856. EditorOption2[EditorOption2["fontLigatures"] = 45] = "fontLigatures";
  6857. EditorOption2[EditorOption2["fontSize"] = 46] = "fontSize";
  6858. EditorOption2[EditorOption2["fontWeight"] = 47] = "fontWeight";
  6859. EditorOption2[EditorOption2["formatOnPaste"] = 48] = "formatOnPaste";
  6860. EditorOption2[EditorOption2["formatOnType"] = 49] = "formatOnType";
  6861. EditorOption2[EditorOption2["glyphMargin"] = 50] = "glyphMargin";
  6862. EditorOption2[EditorOption2["gotoLocation"] = 51] = "gotoLocation";
  6863. EditorOption2[EditorOption2["hideCursorInOverviewRuler"] = 52] = "hideCursorInOverviewRuler";
  6864. EditorOption2[EditorOption2["hover"] = 53] = "hover";
  6865. EditorOption2[EditorOption2["inDiffEditor"] = 54] = "inDiffEditor";
  6866. EditorOption2[EditorOption2["inlineSuggest"] = 55] = "inlineSuggest";
  6867. EditorOption2[EditorOption2["letterSpacing"] = 56] = "letterSpacing";
  6868. EditorOption2[EditorOption2["lightbulb"] = 57] = "lightbulb";
  6869. EditorOption2[EditorOption2["lineDecorationsWidth"] = 58] = "lineDecorationsWidth";
  6870. EditorOption2[EditorOption2["lineHeight"] = 59] = "lineHeight";
  6871. EditorOption2[EditorOption2["lineNumbers"] = 60] = "lineNumbers";
  6872. EditorOption2[EditorOption2["lineNumbersMinChars"] = 61] = "lineNumbersMinChars";
  6873. EditorOption2[EditorOption2["linkedEditing"] = 62] = "linkedEditing";
  6874. EditorOption2[EditorOption2["links"] = 63] = "links";
  6875. EditorOption2[EditorOption2["matchBrackets"] = 64] = "matchBrackets";
  6876. EditorOption2[EditorOption2["minimap"] = 65] = "minimap";
  6877. EditorOption2[EditorOption2["mouseStyle"] = 66] = "mouseStyle";
  6878. EditorOption2[EditorOption2["mouseWheelScrollSensitivity"] = 67] = "mouseWheelScrollSensitivity";
  6879. EditorOption2[EditorOption2["mouseWheelZoom"] = 68] = "mouseWheelZoom";
  6880. EditorOption2[EditorOption2["multiCursorMergeOverlapping"] = 69] = "multiCursorMergeOverlapping";
  6881. EditorOption2[EditorOption2["multiCursorModifier"] = 70] = "multiCursorModifier";
  6882. EditorOption2[EditorOption2["multiCursorPaste"] = 71] = "multiCursorPaste";
  6883. EditorOption2[EditorOption2["occurrencesHighlight"] = 72] = "occurrencesHighlight";
  6884. EditorOption2[EditorOption2["overviewRulerBorder"] = 73] = "overviewRulerBorder";
  6885. EditorOption2[EditorOption2["overviewRulerLanes"] = 74] = "overviewRulerLanes";
  6886. EditorOption2[EditorOption2["padding"] = 75] = "padding";
  6887. EditorOption2[EditorOption2["parameterHints"] = 76] = "parameterHints";
  6888. EditorOption2[EditorOption2["peekWidgetDefaultFocus"] = 77] = "peekWidgetDefaultFocus";
  6889. EditorOption2[EditorOption2["definitionLinkOpensInPeek"] = 78] = "definitionLinkOpensInPeek";
  6890. EditorOption2[EditorOption2["quickSuggestions"] = 79] = "quickSuggestions";
  6891. EditorOption2[EditorOption2["quickSuggestionsDelay"] = 80] = "quickSuggestionsDelay";
  6892. EditorOption2[EditorOption2["readOnly"] = 81] = "readOnly";
  6893. EditorOption2[EditorOption2["renameOnType"] = 82] = "renameOnType";
  6894. EditorOption2[EditorOption2["renderControlCharacters"] = 83] = "renderControlCharacters";
  6895. EditorOption2[EditorOption2["renderFinalNewline"] = 84] = "renderFinalNewline";
  6896. EditorOption2[EditorOption2["renderLineHighlight"] = 85] = "renderLineHighlight";
  6897. EditorOption2[EditorOption2["renderLineHighlightOnlyWhenFocus"] = 86] = "renderLineHighlightOnlyWhenFocus";
  6898. EditorOption2[EditorOption2["renderValidationDecorations"] = 87] = "renderValidationDecorations";
  6899. EditorOption2[EditorOption2["renderWhitespace"] = 88] = "renderWhitespace";
  6900. EditorOption2[EditorOption2["revealHorizontalRightPadding"] = 89] = "revealHorizontalRightPadding";
  6901. EditorOption2[EditorOption2["roundedSelection"] = 90] = "roundedSelection";
  6902. EditorOption2[EditorOption2["rulers"] = 91] = "rulers";
  6903. EditorOption2[EditorOption2["scrollbar"] = 92] = "scrollbar";
  6904. EditorOption2[EditorOption2["scrollBeyondLastColumn"] = 93] = "scrollBeyondLastColumn";
  6905. EditorOption2[EditorOption2["scrollBeyondLastLine"] = 94] = "scrollBeyondLastLine";
  6906. EditorOption2[EditorOption2["scrollPredominantAxis"] = 95] = "scrollPredominantAxis";
  6907. EditorOption2[EditorOption2["selectionClipboard"] = 96] = "selectionClipboard";
  6908. EditorOption2[EditorOption2["selectionHighlight"] = 97] = "selectionHighlight";
  6909. EditorOption2[EditorOption2["selectOnLineNumbers"] = 98] = "selectOnLineNumbers";
  6910. EditorOption2[EditorOption2["showFoldingControls"] = 99] = "showFoldingControls";
  6911. EditorOption2[EditorOption2["showUnused"] = 100] = "showUnused";
  6912. EditorOption2[EditorOption2["snippetSuggestions"] = 101] = "snippetSuggestions";
  6913. EditorOption2[EditorOption2["smartSelect"] = 102] = "smartSelect";
  6914. EditorOption2[EditorOption2["smoothScrolling"] = 103] = "smoothScrolling";
  6915. EditorOption2[EditorOption2["stickyTabStops"] = 104] = "stickyTabStops";
  6916. EditorOption2[EditorOption2["stopRenderingLineAfter"] = 105] = "stopRenderingLineAfter";
  6917. EditorOption2[EditorOption2["suggest"] = 106] = "suggest";
  6918. EditorOption2[EditorOption2["suggestFontSize"] = 107] = "suggestFontSize";
  6919. EditorOption2[EditorOption2["suggestLineHeight"] = 108] = "suggestLineHeight";
  6920. EditorOption2[EditorOption2["suggestOnTriggerCharacters"] = 109] = "suggestOnTriggerCharacters";
  6921. EditorOption2[EditorOption2["suggestSelection"] = 110] = "suggestSelection";
  6922. EditorOption2[EditorOption2["tabCompletion"] = 111] = "tabCompletion";
  6923. EditorOption2[EditorOption2["tabIndex"] = 112] = "tabIndex";
  6924. EditorOption2[EditorOption2["unicodeHighlighting"] = 113] = "unicodeHighlighting";
  6925. EditorOption2[EditorOption2["unusualLineTerminators"] = 114] = "unusualLineTerminators";
  6926. EditorOption2[EditorOption2["useShadowDOM"] = 115] = "useShadowDOM";
  6927. EditorOption2[EditorOption2["useTabStops"] = 116] = "useTabStops";
  6928. EditorOption2[EditorOption2["wordSeparators"] = 117] = "wordSeparators";
  6929. EditorOption2[EditorOption2["wordWrap"] = 118] = "wordWrap";
  6930. EditorOption2[EditorOption2["wordWrapBreakAfterCharacters"] = 119] = "wordWrapBreakAfterCharacters";
  6931. EditorOption2[EditorOption2["wordWrapBreakBeforeCharacters"] = 120] = "wordWrapBreakBeforeCharacters";
  6932. EditorOption2[EditorOption2["wordWrapColumn"] = 121] = "wordWrapColumn";
  6933. EditorOption2[EditorOption2["wordWrapOverride1"] = 122] = "wordWrapOverride1";
  6934. EditorOption2[EditorOption2["wordWrapOverride2"] = 123] = "wordWrapOverride2";
  6935. EditorOption2[EditorOption2["wrappingIndent"] = 124] = "wrappingIndent";
  6936. EditorOption2[EditorOption2["wrappingStrategy"] = 125] = "wrappingStrategy";
  6937. EditorOption2[EditorOption2["showDeprecated"] = 126] = "showDeprecated";
  6938. EditorOption2[EditorOption2["inlayHints"] = 127] = "inlayHints";
  6939. EditorOption2[EditorOption2["editorClassName"] = 128] = "editorClassName";
  6940. EditorOption2[EditorOption2["pixelRatio"] = 129] = "pixelRatio";
  6941. EditorOption2[EditorOption2["tabFocusMode"] = 130] = "tabFocusMode";
  6942. EditorOption2[EditorOption2["layoutInfo"] = 131] = "layoutInfo";
  6943. EditorOption2[EditorOption2["wrappingInfo"] = 132] = "wrappingInfo";
  6944. })(EditorOption || (EditorOption = {}));
  6945. var EndOfLinePreference;
  6946. (function(EndOfLinePreference2) {
  6947. EndOfLinePreference2[EndOfLinePreference2["TextDefined"] = 0] = "TextDefined";
  6948. EndOfLinePreference2[EndOfLinePreference2["LF"] = 1] = "LF";
  6949. EndOfLinePreference2[EndOfLinePreference2["CRLF"] = 2] = "CRLF";
  6950. })(EndOfLinePreference || (EndOfLinePreference = {}));
  6951. var EndOfLineSequence;
  6952. (function(EndOfLineSequence2) {
  6953. EndOfLineSequence2[EndOfLineSequence2["LF"] = 0] = "LF";
  6954. EndOfLineSequence2[EndOfLineSequence2["CRLF"] = 1] = "CRLF";
  6955. })(EndOfLineSequence || (EndOfLineSequence = {}));
  6956. var IndentAction;
  6957. (function(IndentAction2) {
  6958. IndentAction2[IndentAction2["None"] = 0] = "None";
  6959. IndentAction2[IndentAction2["Indent"] = 1] = "Indent";
  6960. IndentAction2[IndentAction2["IndentOutdent"] = 2] = "IndentOutdent";
  6961. IndentAction2[IndentAction2["Outdent"] = 3] = "Outdent";
  6962. })(IndentAction || (IndentAction = {}));
  6963. var InjectedTextCursorStops;
  6964. (function(InjectedTextCursorStops3) {
  6965. InjectedTextCursorStops3[InjectedTextCursorStops3["Both"] = 0] = "Both";
  6966. InjectedTextCursorStops3[InjectedTextCursorStops3["Right"] = 1] = "Right";
  6967. InjectedTextCursorStops3[InjectedTextCursorStops3["Left"] = 2] = "Left";
  6968. InjectedTextCursorStops3[InjectedTextCursorStops3["None"] = 3] = "None";
  6969. })(InjectedTextCursorStops || (InjectedTextCursorStops = {}));
  6970. var InlayHintKind2;
  6971. (function(InlayHintKind3) {
  6972. InlayHintKind3[InlayHintKind3["Type"] = 1] = "Type";
  6973. InlayHintKind3[InlayHintKind3["Parameter"] = 2] = "Parameter";
  6974. })(InlayHintKind2 || (InlayHintKind2 = {}));
  6975. var InlineCompletionTriggerKind2;
  6976. (function(InlineCompletionTriggerKind3) {
  6977. InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Automatic"] = 0] = "Automatic";
  6978. InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Explicit"] = 1] = "Explicit";
  6979. })(InlineCompletionTriggerKind2 || (InlineCompletionTriggerKind2 = {}));
  6980. var KeyCode;
  6981. (function(KeyCode2) {
  6982. KeyCode2[KeyCode2["DependsOnKbLayout"] = -1] = "DependsOnKbLayout";
  6983. KeyCode2[KeyCode2["Unknown"] = 0] = "Unknown";
  6984. KeyCode2[KeyCode2["Backspace"] = 1] = "Backspace";
  6985. KeyCode2[KeyCode2["Tab"] = 2] = "Tab";
  6986. KeyCode2[KeyCode2["Enter"] = 3] = "Enter";
  6987. KeyCode2[KeyCode2["Shift"] = 4] = "Shift";
  6988. KeyCode2[KeyCode2["Ctrl"] = 5] = "Ctrl";
  6989. KeyCode2[KeyCode2["Alt"] = 6] = "Alt";
  6990. KeyCode2[KeyCode2["PauseBreak"] = 7] = "PauseBreak";
  6991. KeyCode2[KeyCode2["CapsLock"] = 8] = "CapsLock";
  6992. KeyCode2[KeyCode2["Escape"] = 9] = "Escape";
  6993. KeyCode2[KeyCode2["Space"] = 10] = "Space";
  6994. KeyCode2[KeyCode2["PageUp"] = 11] = "PageUp";
  6995. KeyCode2[KeyCode2["PageDown"] = 12] = "PageDown";
  6996. KeyCode2[KeyCode2["End"] = 13] = "End";
  6997. KeyCode2[KeyCode2["Home"] = 14] = "Home";
  6998. KeyCode2[KeyCode2["LeftArrow"] = 15] = "LeftArrow";
  6999. KeyCode2[KeyCode2["UpArrow"] = 16] = "UpArrow";
  7000. KeyCode2[KeyCode2["RightArrow"] = 17] = "RightArrow";
  7001. KeyCode2[KeyCode2["DownArrow"] = 18] = "DownArrow";
  7002. KeyCode2[KeyCode2["Insert"] = 19] = "Insert";
  7003. KeyCode2[KeyCode2["Delete"] = 20] = "Delete";
  7004. KeyCode2[KeyCode2["Digit0"] = 21] = "Digit0";
  7005. KeyCode2[KeyCode2["Digit1"] = 22] = "Digit1";
  7006. KeyCode2[KeyCode2["Digit2"] = 23] = "Digit2";
  7007. KeyCode2[KeyCode2["Digit3"] = 24] = "Digit3";
  7008. KeyCode2[KeyCode2["Digit4"] = 25] = "Digit4";
  7009. KeyCode2[KeyCode2["Digit5"] = 26] = "Digit5";
  7010. KeyCode2[KeyCode2["Digit6"] = 27] = "Digit6";
  7011. KeyCode2[KeyCode2["Digit7"] = 28] = "Digit7";
  7012. KeyCode2[KeyCode2["Digit8"] = 29] = "Digit8";
  7013. KeyCode2[KeyCode2["Digit9"] = 30] = "Digit9";
  7014. KeyCode2[KeyCode2["KeyA"] = 31] = "KeyA";
  7015. KeyCode2[KeyCode2["KeyB"] = 32] = "KeyB";
  7016. KeyCode2[KeyCode2["KeyC"] = 33] = "KeyC";
  7017. KeyCode2[KeyCode2["KeyD"] = 34] = "KeyD";
  7018. KeyCode2[KeyCode2["KeyE"] = 35] = "KeyE";
  7019. KeyCode2[KeyCode2["KeyF"] = 36] = "KeyF";
  7020. KeyCode2[KeyCode2["KeyG"] = 37] = "KeyG";
  7021. KeyCode2[KeyCode2["KeyH"] = 38] = "KeyH";
  7022. KeyCode2[KeyCode2["KeyI"] = 39] = "KeyI";
  7023. KeyCode2[KeyCode2["KeyJ"] = 40] = "KeyJ";
  7024. KeyCode2[KeyCode2["KeyK"] = 41] = "KeyK";
  7025. KeyCode2[KeyCode2["KeyL"] = 42] = "KeyL";
  7026. KeyCode2[KeyCode2["KeyM"] = 43] = "KeyM";
  7027. KeyCode2[KeyCode2["KeyN"] = 44] = "KeyN";
  7028. KeyCode2[KeyCode2["KeyO"] = 45] = "KeyO";
  7029. KeyCode2[KeyCode2["KeyP"] = 46] = "KeyP";
  7030. KeyCode2[KeyCode2["KeyQ"] = 47] = "KeyQ";
  7031. KeyCode2[KeyCode2["KeyR"] = 48] = "KeyR";
  7032. KeyCode2[KeyCode2["KeyS"] = 49] = "KeyS";
  7033. KeyCode2[KeyCode2["KeyT"] = 50] = "KeyT";
  7034. KeyCode2[KeyCode2["KeyU"] = 51] = "KeyU";
  7035. KeyCode2[KeyCode2["KeyV"] = 52] = "KeyV";
  7036. KeyCode2[KeyCode2["KeyW"] = 53] = "KeyW";
  7037. KeyCode2[KeyCode2["KeyX"] = 54] = "KeyX";
  7038. KeyCode2[KeyCode2["KeyY"] = 55] = "KeyY";
  7039. KeyCode2[KeyCode2["KeyZ"] = 56] = "KeyZ";
  7040. KeyCode2[KeyCode2["Meta"] = 57] = "Meta";
  7041. KeyCode2[KeyCode2["ContextMenu"] = 58] = "ContextMenu";
  7042. KeyCode2[KeyCode2["F1"] = 59] = "F1";
  7043. KeyCode2[KeyCode2["F2"] = 60] = "F2";
  7044. KeyCode2[KeyCode2["F3"] = 61] = "F3";
  7045. KeyCode2[KeyCode2["F4"] = 62] = "F4";
  7046. KeyCode2[KeyCode2["F5"] = 63] = "F5";
  7047. KeyCode2[KeyCode2["F6"] = 64] = "F6";
  7048. KeyCode2[KeyCode2["F7"] = 65] = "F7";
  7049. KeyCode2[KeyCode2["F8"] = 66] = "F8";
  7050. KeyCode2[KeyCode2["F9"] = 67] = "F9";
  7051. KeyCode2[KeyCode2["F10"] = 68] = "F10";
  7052. KeyCode2[KeyCode2["F11"] = 69] = "F11";
  7053. KeyCode2[KeyCode2["F12"] = 70] = "F12";
  7054. KeyCode2[KeyCode2["F13"] = 71] = "F13";
  7055. KeyCode2[KeyCode2["F14"] = 72] = "F14";
  7056. KeyCode2[KeyCode2["F15"] = 73] = "F15";
  7057. KeyCode2[KeyCode2["F16"] = 74] = "F16";
  7058. KeyCode2[KeyCode2["F17"] = 75] = "F17";
  7059. KeyCode2[KeyCode2["F18"] = 76] = "F18";
  7060. KeyCode2[KeyCode2["F19"] = 77] = "F19";
  7061. KeyCode2[KeyCode2["NumLock"] = 78] = "NumLock";
  7062. KeyCode2[KeyCode2["ScrollLock"] = 79] = "ScrollLock";
  7063. KeyCode2[KeyCode2["Semicolon"] = 80] = "Semicolon";
  7064. KeyCode2[KeyCode2["Equal"] = 81] = "Equal";
  7065. KeyCode2[KeyCode2["Comma"] = 82] = "Comma";
  7066. KeyCode2[KeyCode2["Minus"] = 83] = "Minus";
  7067. KeyCode2[KeyCode2["Period"] = 84] = "Period";
  7068. KeyCode2[KeyCode2["Slash"] = 85] = "Slash";
  7069. KeyCode2[KeyCode2["Backquote"] = 86] = "Backquote";
  7070. KeyCode2[KeyCode2["BracketLeft"] = 87] = "BracketLeft";
  7071. KeyCode2[KeyCode2["Backslash"] = 88] = "Backslash";
  7072. KeyCode2[KeyCode2["BracketRight"] = 89] = "BracketRight";
  7073. KeyCode2[KeyCode2["Quote"] = 90] = "Quote";
  7074. KeyCode2[KeyCode2["OEM_8"] = 91] = "OEM_8";
  7075. KeyCode2[KeyCode2["IntlBackslash"] = 92] = "IntlBackslash";
  7076. KeyCode2[KeyCode2["Numpad0"] = 93] = "Numpad0";
  7077. KeyCode2[KeyCode2["Numpad1"] = 94] = "Numpad1";
  7078. KeyCode2[KeyCode2["Numpad2"] = 95] = "Numpad2";
  7079. KeyCode2[KeyCode2["Numpad3"] = 96] = "Numpad3";
  7080. KeyCode2[KeyCode2["Numpad4"] = 97] = "Numpad4";
  7081. KeyCode2[KeyCode2["Numpad5"] = 98] = "Numpad5";
  7082. KeyCode2[KeyCode2["Numpad6"] = 99] = "Numpad6";
  7083. KeyCode2[KeyCode2["Numpad7"] = 100] = "Numpad7";
  7084. KeyCode2[KeyCode2["Numpad8"] = 101] = "Numpad8";
  7085. KeyCode2[KeyCode2["Numpad9"] = 102] = "Numpad9";
  7086. KeyCode2[KeyCode2["NumpadMultiply"] = 103] = "NumpadMultiply";
  7087. KeyCode2[KeyCode2["NumpadAdd"] = 104] = "NumpadAdd";
  7088. KeyCode2[KeyCode2["NUMPAD_SEPARATOR"] = 105] = "NUMPAD_SEPARATOR";
  7089. KeyCode2[KeyCode2["NumpadSubtract"] = 106] = "NumpadSubtract";
  7090. KeyCode2[KeyCode2["NumpadDecimal"] = 107] = "NumpadDecimal";
  7091. KeyCode2[KeyCode2["NumpadDivide"] = 108] = "NumpadDivide";
  7092. KeyCode2[KeyCode2["KEY_IN_COMPOSITION"] = 109] = "KEY_IN_COMPOSITION";
  7093. KeyCode2[KeyCode2["ABNT_C1"] = 110] = "ABNT_C1";
  7094. KeyCode2[KeyCode2["ABNT_C2"] = 111] = "ABNT_C2";
  7095. KeyCode2[KeyCode2["AudioVolumeMute"] = 112] = "AudioVolumeMute";
  7096. KeyCode2[KeyCode2["AudioVolumeUp"] = 113] = "AudioVolumeUp";
  7097. KeyCode2[KeyCode2["AudioVolumeDown"] = 114] = "AudioVolumeDown";
  7098. KeyCode2[KeyCode2["BrowserSearch"] = 115] = "BrowserSearch";
  7099. KeyCode2[KeyCode2["BrowserHome"] = 116] = "BrowserHome";
  7100. KeyCode2[KeyCode2["BrowserBack"] = 117] = "BrowserBack";
  7101. KeyCode2[KeyCode2["BrowserForward"] = 118] = "BrowserForward";
  7102. KeyCode2[KeyCode2["MediaTrackNext"] = 119] = "MediaTrackNext";
  7103. KeyCode2[KeyCode2["MediaTrackPrevious"] = 120] = "MediaTrackPrevious";
  7104. KeyCode2[KeyCode2["MediaStop"] = 121] = "MediaStop";
  7105. KeyCode2[KeyCode2["MediaPlayPause"] = 122] = "MediaPlayPause";
  7106. KeyCode2[KeyCode2["LaunchMediaPlayer"] = 123] = "LaunchMediaPlayer";
  7107. KeyCode2[KeyCode2["LaunchMail"] = 124] = "LaunchMail";
  7108. KeyCode2[KeyCode2["LaunchApp2"] = 125] = "LaunchApp2";
  7109. KeyCode2[KeyCode2["Clear"] = 126] = "Clear";
  7110. KeyCode2[KeyCode2["MAX_VALUE"] = 127] = "MAX_VALUE";
  7111. })(KeyCode || (KeyCode = {}));
  7112. var MarkerSeverity;
  7113. (function(MarkerSeverity2) {
  7114. MarkerSeverity2[MarkerSeverity2["Hint"] = 1] = "Hint";
  7115. MarkerSeverity2[MarkerSeverity2["Info"] = 2] = "Info";
  7116. MarkerSeverity2[MarkerSeverity2["Warning"] = 4] = "Warning";
  7117. MarkerSeverity2[MarkerSeverity2["Error"] = 8] = "Error";
  7118. })(MarkerSeverity || (MarkerSeverity = {}));
  7119. var MarkerTag;
  7120. (function(MarkerTag2) {
  7121. MarkerTag2[MarkerTag2["Unnecessary"] = 1] = "Unnecessary";
  7122. MarkerTag2[MarkerTag2["Deprecated"] = 2] = "Deprecated";
  7123. })(MarkerTag || (MarkerTag = {}));
  7124. var MinimapPosition;
  7125. (function(MinimapPosition3) {
  7126. MinimapPosition3[MinimapPosition3["Inline"] = 1] = "Inline";
  7127. MinimapPosition3[MinimapPosition3["Gutter"] = 2] = "Gutter";
  7128. })(MinimapPosition || (MinimapPosition = {}));
  7129. var MouseTargetType;
  7130. (function(MouseTargetType2) {
  7131. MouseTargetType2[MouseTargetType2["UNKNOWN"] = 0] = "UNKNOWN";
  7132. MouseTargetType2[MouseTargetType2["TEXTAREA"] = 1] = "TEXTAREA";
  7133. MouseTargetType2[MouseTargetType2["GUTTER_GLYPH_MARGIN"] = 2] = "GUTTER_GLYPH_MARGIN";
  7134. MouseTargetType2[MouseTargetType2["GUTTER_LINE_NUMBERS"] = 3] = "GUTTER_LINE_NUMBERS";
  7135. MouseTargetType2[MouseTargetType2["GUTTER_LINE_DECORATIONS"] = 4] = "GUTTER_LINE_DECORATIONS";
  7136. MouseTargetType2[MouseTargetType2["GUTTER_VIEW_ZONE"] = 5] = "GUTTER_VIEW_ZONE";
  7137. MouseTargetType2[MouseTargetType2["CONTENT_TEXT"] = 6] = "CONTENT_TEXT";
  7138. MouseTargetType2[MouseTargetType2["CONTENT_EMPTY"] = 7] = "CONTENT_EMPTY";
  7139. MouseTargetType2[MouseTargetType2["CONTENT_VIEW_ZONE"] = 8] = "CONTENT_VIEW_ZONE";
  7140. MouseTargetType2[MouseTargetType2["CONTENT_WIDGET"] = 9] = "CONTENT_WIDGET";
  7141. MouseTargetType2[MouseTargetType2["OVERVIEW_RULER"] = 10] = "OVERVIEW_RULER";
  7142. MouseTargetType2[MouseTargetType2["SCROLLBAR"] = 11] = "SCROLLBAR";
  7143. MouseTargetType2[MouseTargetType2["OVERLAY_WIDGET"] = 12] = "OVERLAY_WIDGET";
  7144. MouseTargetType2[MouseTargetType2["OUTSIDE_EDITOR"] = 13] = "OUTSIDE_EDITOR";
  7145. })(MouseTargetType || (MouseTargetType = {}));
  7146. var OverlayWidgetPositionPreference;
  7147. (function(OverlayWidgetPositionPreference2) {
  7148. OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["TOP_RIGHT_CORNER"] = 0] = "TOP_RIGHT_CORNER";
  7149. OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["BOTTOM_RIGHT_CORNER"] = 1] = "BOTTOM_RIGHT_CORNER";
  7150. OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["TOP_CENTER"] = 2] = "TOP_CENTER";
  7151. })(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {}));
  7152. var OverviewRulerLane;
  7153. (function(OverviewRulerLane3) {
  7154. OverviewRulerLane3[OverviewRulerLane3["Left"] = 1] = "Left";
  7155. OverviewRulerLane3[OverviewRulerLane3["Center"] = 2] = "Center";
  7156. OverviewRulerLane3[OverviewRulerLane3["Right"] = 4] = "Right";
  7157. OverviewRulerLane3[OverviewRulerLane3["Full"] = 7] = "Full";
  7158. })(OverviewRulerLane || (OverviewRulerLane = {}));
  7159. var PositionAffinity;
  7160. (function(PositionAffinity2) {
  7161. PositionAffinity2[PositionAffinity2["Left"] = 0] = "Left";
  7162. PositionAffinity2[PositionAffinity2["Right"] = 1] = "Right";
  7163. PositionAffinity2[PositionAffinity2["None"] = 2] = "None";
  7164. })(PositionAffinity || (PositionAffinity = {}));
  7165. var RenderLineNumbersType;
  7166. (function(RenderLineNumbersType2) {
  7167. RenderLineNumbersType2[RenderLineNumbersType2["Off"] = 0] = "Off";
  7168. RenderLineNumbersType2[RenderLineNumbersType2["On"] = 1] = "On";
  7169. RenderLineNumbersType2[RenderLineNumbersType2["Relative"] = 2] = "Relative";
  7170. RenderLineNumbersType2[RenderLineNumbersType2["Interval"] = 3] = "Interval";
  7171. RenderLineNumbersType2[RenderLineNumbersType2["Custom"] = 4] = "Custom";
  7172. })(RenderLineNumbersType || (RenderLineNumbersType = {}));
  7173. var RenderMinimap;
  7174. (function(RenderMinimap2) {
  7175. RenderMinimap2[RenderMinimap2["None"] = 0] = "None";
  7176. RenderMinimap2[RenderMinimap2["Text"] = 1] = "Text";
  7177. RenderMinimap2[RenderMinimap2["Blocks"] = 2] = "Blocks";
  7178. })(RenderMinimap || (RenderMinimap = {}));
  7179. var ScrollType;
  7180. (function(ScrollType2) {
  7181. ScrollType2[ScrollType2["Smooth"] = 0] = "Smooth";
  7182. ScrollType2[ScrollType2["Immediate"] = 1] = "Immediate";
  7183. })(ScrollType || (ScrollType = {}));
  7184. var ScrollbarVisibility;
  7185. (function(ScrollbarVisibility2) {
  7186. ScrollbarVisibility2[ScrollbarVisibility2["Auto"] = 1] = "Auto";
  7187. ScrollbarVisibility2[ScrollbarVisibility2["Hidden"] = 2] = "Hidden";
  7188. ScrollbarVisibility2[ScrollbarVisibility2["Visible"] = 3] = "Visible";
  7189. })(ScrollbarVisibility || (ScrollbarVisibility = {}));
  7190. var SelectionDirection;
  7191. (function(SelectionDirection2) {
  7192. SelectionDirection2[SelectionDirection2["LTR"] = 0] = "LTR";
  7193. SelectionDirection2[SelectionDirection2["RTL"] = 1] = "RTL";
  7194. })(SelectionDirection || (SelectionDirection = {}));
  7195. var SignatureHelpTriggerKind2;
  7196. (function(SignatureHelpTriggerKind3) {
  7197. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["Invoke"] = 1] = "Invoke";
  7198. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["TriggerCharacter"] = 2] = "TriggerCharacter";
  7199. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["ContentChange"] = 3] = "ContentChange";
  7200. })(SignatureHelpTriggerKind2 || (SignatureHelpTriggerKind2 = {}));
  7201. var SymbolKind;
  7202. (function(SymbolKind3) {
  7203. SymbolKind3[SymbolKind3["File"] = 0] = "File";
  7204. SymbolKind3[SymbolKind3["Module"] = 1] = "Module";
  7205. SymbolKind3[SymbolKind3["Namespace"] = 2] = "Namespace";
  7206. SymbolKind3[SymbolKind3["Package"] = 3] = "Package";
  7207. SymbolKind3[SymbolKind3["Class"] = 4] = "Class";
  7208. SymbolKind3[SymbolKind3["Method"] = 5] = "Method";
  7209. SymbolKind3[SymbolKind3["Property"] = 6] = "Property";
  7210. SymbolKind3[SymbolKind3["Field"] = 7] = "Field";
  7211. SymbolKind3[SymbolKind3["Constructor"] = 8] = "Constructor";
  7212. SymbolKind3[SymbolKind3["Enum"] = 9] = "Enum";
  7213. SymbolKind3[SymbolKind3["Interface"] = 10] = "Interface";
  7214. SymbolKind3[SymbolKind3["Function"] = 11] = "Function";
  7215. SymbolKind3[SymbolKind3["Variable"] = 12] = "Variable";
  7216. SymbolKind3[SymbolKind3["Constant"] = 13] = "Constant";
  7217. SymbolKind3[SymbolKind3["String"] = 14] = "String";
  7218. SymbolKind3[SymbolKind3["Number"] = 15] = "Number";
  7219. SymbolKind3[SymbolKind3["Boolean"] = 16] = "Boolean";
  7220. SymbolKind3[SymbolKind3["Array"] = 17] = "Array";
  7221. SymbolKind3[SymbolKind3["Object"] = 18] = "Object";
  7222. SymbolKind3[SymbolKind3["Key"] = 19] = "Key";
  7223. SymbolKind3[SymbolKind3["Null"] = 20] = "Null";
  7224. SymbolKind3[SymbolKind3["EnumMember"] = 21] = "EnumMember";
  7225. SymbolKind3[SymbolKind3["Struct"] = 22] = "Struct";
  7226. SymbolKind3[SymbolKind3["Event"] = 23] = "Event";
  7227. SymbolKind3[SymbolKind3["Operator"] = 24] = "Operator";
  7228. SymbolKind3[SymbolKind3["TypeParameter"] = 25] = "TypeParameter";
  7229. })(SymbolKind || (SymbolKind = {}));
  7230. var SymbolTag;
  7231. (function(SymbolTag3) {
  7232. SymbolTag3[SymbolTag3["Deprecated"] = 1] = "Deprecated";
  7233. })(SymbolTag || (SymbolTag = {}));
  7234. var TextEditorCursorBlinkingStyle;
  7235. (function(TextEditorCursorBlinkingStyle2) {
  7236. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Hidden"] = 0] = "Hidden";
  7237. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Blink"] = 1] = "Blink";
  7238. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Smooth"] = 2] = "Smooth";
  7239. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Phase"] = 3] = "Phase";
  7240. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Expand"] = 4] = "Expand";
  7241. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Solid"] = 5] = "Solid";
  7242. })(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {}));
  7243. var TextEditorCursorStyle;
  7244. (function(TextEditorCursorStyle2) {
  7245. TextEditorCursorStyle2[TextEditorCursorStyle2["Line"] = 1] = "Line";
  7246. TextEditorCursorStyle2[TextEditorCursorStyle2["Block"] = 2] = "Block";
  7247. TextEditorCursorStyle2[TextEditorCursorStyle2["Underline"] = 3] = "Underline";
  7248. TextEditorCursorStyle2[TextEditorCursorStyle2["LineThin"] = 4] = "LineThin";
  7249. TextEditorCursorStyle2[TextEditorCursorStyle2["BlockOutline"] = 5] = "BlockOutline";
  7250. TextEditorCursorStyle2[TextEditorCursorStyle2["UnderlineThin"] = 6] = "UnderlineThin";
  7251. })(TextEditorCursorStyle || (TextEditorCursorStyle = {}));
  7252. var TrackedRangeStickiness;
  7253. (function(TrackedRangeStickiness2) {
  7254. TrackedRangeStickiness2[TrackedRangeStickiness2["AlwaysGrowsWhenTypingAtEdges"] = 0] = "AlwaysGrowsWhenTypingAtEdges";
  7255. TrackedRangeStickiness2[TrackedRangeStickiness2["NeverGrowsWhenTypingAtEdges"] = 1] = "NeverGrowsWhenTypingAtEdges";
  7256. TrackedRangeStickiness2[TrackedRangeStickiness2["GrowsOnlyWhenTypingBefore"] = 2] = "GrowsOnlyWhenTypingBefore";
  7257. TrackedRangeStickiness2[TrackedRangeStickiness2["GrowsOnlyWhenTypingAfter"] = 3] = "GrowsOnlyWhenTypingAfter";
  7258. })(TrackedRangeStickiness || (TrackedRangeStickiness = {}));
  7259. var WrappingIndent;
  7260. (function(WrappingIndent2) {
  7261. WrappingIndent2[WrappingIndent2["None"] = 0] = "None";
  7262. WrappingIndent2[WrappingIndent2["Same"] = 1] = "Same";
  7263. WrappingIndent2[WrappingIndent2["Indent"] = 2] = "Indent";
  7264. WrappingIndent2[WrappingIndent2["DeepIndent"] = 3] = "DeepIndent";
  7265. })(WrappingIndent || (WrappingIndent = {}));
  7266. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/services/editorBaseApi.js
  7267. var KeyMod = class {
  7268. static chord(firstPart, secondPart) {
  7269. return KeyChord(firstPart, secondPart);
  7270. }
  7271. };
  7272. KeyMod.CtrlCmd = 2048;
  7273. KeyMod.Shift = 1024;
  7274. KeyMod.Alt = 512;
  7275. KeyMod.WinCtrl = 256;
  7276. function createMonacoBaseAPI() {
  7277. return {
  7278. editor: void 0,
  7279. languages: void 0,
  7280. CancellationTokenSource,
  7281. Emitter,
  7282. KeyCode,
  7283. KeyMod,
  7284. Position,
  7285. Range,
  7286. Selection,
  7287. SelectionDirection,
  7288. MarkerSeverity,
  7289. MarkerTag,
  7290. Uri: URI,
  7291. Token
  7292. };
  7293. }
  7294. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/core/wordCharacterClassifier.js
  7295. var WordCharacterClassifier = class extends CharacterClassifier {
  7296. constructor(wordSeparators) {
  7297. super(0);
  7298. for (let i = 0, len = wordSeparators.length; i < len; i++) {
  7299. this.set(wordSeparators.charCodeAt(i), 2);
  7300. }
  7301. this.set(32, 1);
  7302. this.set(9, 1);
  7303. }
  7304. };
  7305. function once2(computeFn) {
  7306. const cache = {};
  7307. return (input) => {
  7308. if (!cache.hasOwnProperty(input)) {
  7309. cache[input] = computeFn(input);
  7310. }
  7311. return cache[input];
  7312. };
  7313. }
  7314. var getMapForWordSeparators = once2((input) => new WordCharacterClassifier(input));
  7315. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/model.js
  7316. var OverviewRulerLane2;
  7317. (function(OverviewRulerLane3) {
  7318. OverviewRulerLane3[OverviewRulerLane3["Left"] = 1] = "Left";
  7319. OverviewRulerLane3[OverviewRulerLane3["Center"] = 2] = "Center";
  7320. OverviewRulerLane3[OverviewRulerLane3["Right"] = 4] = "Right";
  7321. OverviewRulerLane3[OverviewRulerLane3["Full"] = 7] = "Full";
  7322. })(OverviewRulerLane2 || (OverviewRulerLane2 = {}));
  7323. var MinimapPosition2;
  7324. (function(MinimapPosition3) {
  7325. MinimapPosition3[MinimapPosition3["Inline"] = 1] = "Inline";
  7326. MinimapPosition3[MinimapPosition3["Gutter"] = 2] = "Gutter";
  7327. })(MinimapPosition2 || (MinimapPosition2 = {}));
  7328. var InjectedTextCursorStops2;
  7329. (function(InjectedTextCursorStops3) {
  7330. InjectedTextCursorStops3[InjectedTextCursorStops3["Both"] = 0] = "Both";
  7331. InjectedTextCursorStops3[InjectedTextCursorStops3["Right"] = 1] = "Right";
  7332. InjectedTextCursorStops3[InjectedTextCursorStops3["Left"] = 2] = "Left";
  7333. InjectedTextCursorStops3[InjectedTextCursorStops3["None"] = 3] = "None";
  7334. })(InjectedTextCursorStops2 || (InjectedTextCursorStops2 = {}));
  7335. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/model/textModelSearch.js
  7336. function leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) {
  7337. if (matchStartIndex === 0) {
  7338. return true;
  7339. }
  7340. const charBefore = text.charCodeAt(matchStartIndex - 1);
  7341. if (wordSeparators.get(charBefore) !== 0) {
  7342. return true;
  7343. }
  7344. if (charBefore === 13 || charBefore === 10) {
  7345. return true;
  7346. }
  7347. if (matchLength > 0) {
  7348. const firstCharInMatch = text.charCodeAt(matchStartIndex);
  7349. if (wordSeparators.get(firstCharInMatch) !== 0) {
  7350. return true;
  7351. }
  7352. }
  7353. return false;
  7354. }
  7355. function rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) {
  7356. if (matchStartIndex + matchLength === textLength) {
  7357. return true;
  7358. }
  7359. const charAfter = text.charCodeAt(matchStartIndex + matchLength);
  7360. if (wordSeparators.get(charAfter) !== 0) {
  7361. return true;
  7362. }
  7363. if (charAfter === 13 || charAfter === 10) {
  7364. return true;
  7365. }
  7366. if (matchLength > 0) {
  7367. const lastCharInMatch = text.charCodeAt(matchStartIndex + matchLength - 1);
  7368. if (wordSeparators.get(lastCharInMatch) !== 0) {
  7369. return true;
  7370. }
  7371. }
  7372. return false;
  7373. }
  7374. function isValidMatch(wordSeparators, text, textLength, matchStartIndex, matchLength) {
  7375. return leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) && rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength);
  7376. }
  7377. var Searcher = class {
  7378. constructor(wordSeparators, searchRegex) {
  7379. this._wordSeparators = wordSeparators;
  7380. this._searchRegex = searchRegex;
  7381. this._prevMatchStartIndex = -1;
  7382. this._prevMatchLength = 0;
  7383. }
  7384. reset(lastIndex) {
  7385. this._searchRegex.lastIndex = lastIndex;
  7386. this._prevMatchStartIndex = -1;
  7387. this._prevMatchLength = 0;
  7388. }
  7389. next(text) {
  7390. const textLength = text.length;
  7391. let m;
  7392. do {
  7393. if (this._prevMatchStartIndex + this._prevMatchLength === textLength) {
  7394. return null;
  7395. }
  7396. m = this._searchRegex.exec(text);
  7397. if (!m) {
  7398. return null;
  7399. }
  7400. const matchStartIndex = m.index;
  7401. const matchLength = m[0].length;
  7402. if (matchStartIndex === this._prevMatchStartIndex && matchLength === this._prevMatchLength) {
  7403. if (matchLength === 0) {
  7404. if (getNextCodePoint(text, textLength, this._searchRegex.lastIndex) > 65535) {
  7405. this._searchRegex.lastIndex += 2;
  7406. } else {
  7407. this._searchRegex.lastIndex += 1;
  7408. }
  7409. continue;
  7410. }
  7411. return null;
  7412. }
  7413. this._prevMatchStartIndex = matchStartIndex;
  7414. this._prevMatchLength = matchLength;
  7415. if (!this._wordSeparators || isValidMatch(this._wordSeparators, text, textLength, matchStartIndex, matchLength)) {
  7416. return m;
  7417. }
  7418. } while (m);
  7419. return null;
  7420. }
  7421. };
  7422. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/services/unicodeTextModelHighlighter.js
  7423. var UnicodeTextModelHighlighter = class {
  7424. static computeUnicodeHighlights(model, options, range) {
  7425. const startLine = range ? range.startLineNumber : 1;
  7426. const endLine = range ? range.endLineNumber : model.getLineCount();
  7427. const codePointHighlighter = new CodePointHighlighter(options);
  7428. const candidates = codePointHighlighter.getCandidateCodePoints();
  7429. let regex;
  7430. if (candidates === "allNonBasicAscii") {
  7431. regex = new RegExp("[^\\t\\n\\r\\x20-\\x7E]", "g");
  7432. } else {
  7433. regex = new RegExp(`${buildRegExpCharClassExpr(Array.from(candidates))}`, "g");
  7434. }
  7435. const searcher = new Searcher(null, regex);
  7436. const ranges = [];
  7437. let hasMore = false;
  7438. let m;
  7439. let ambiguousCharacterCount = 0;
  7440. let invisibleCharacterCount = 0;
  7441. let nonBasicAsciiCharacterCount = 0;
  7442. forLoop:
  7443. for (let lineNumber = startLine, lineCount = endLine; lineNumber <= lineCount; lineNumber++) {
  7444. const lineContent = model.getLineContent(lineNumber);
  7445. const lineLength = lineContent.length;
  7446. searcher.reset(0);
  7447. do {
  7448. m = searcher.next(lineContent);
  7449. if (m) {
  7450. let startIndex = m.index;
  7451. let endIndex = m.index + m[0].length;
  7452. if (startIndex > 0) {
  7453. const charCodeBefore = lineContent.charCodeAt(startIndex - 1);
  7454. if (isHighSurrogate(charCodeBefore)) {
  7455. startIndex--;
  7456. }
  7457. }
  7458. if (endIndex + 1 < lineLength) {
  7459. const charCodeBefore = lineContent.charCodeAt(endIndex - 1);
  7460. if (isHighSurrogate(charCodeBefore)) {
  7461. endIndex++;
  7462. }
  7463. }
  7464. const str = lineContent.substring(startIndex, endIndex);
  7465. const word = getWordAtText(startIndex + 1, DEFAULT_WORD_REGEXP, lineContent, 0);
  7466. const highlightReason = codePointHighlighter.shouldHighlightNonBasicASCII(str, word ? word.word : null);
  7467. if (highlightReason !== 0) {
  7468. if (highlightReason === 3) {
  7469. ambiguousCharacterCount++;
  7470. } else if (highlightReason === 2) {
  7471. invisibleCharacterCount++;
  7472. } else if (highlightReason === 1) {
  7473. nonBasicAsciiCharacterCount++;
  7474. } else {
  7475. assertNever(highlightReason);
  7476. }
  7477. const MAX_RESULT_LENGTH = 1e3;
  7478. if (ranges.length >= MAX_RESULT_LENGTH) {
  7479. hasMore = true;
  7480. break forLoop;
  7481. }
  7482. ranges.push(new Range(lineNumber, startIndex + 1, lineNumber, endIndex + 1));
  7483. }
  7484. }
  7485. } while (m);
  7486. }
  7487. return {
  7488. ranges,
  7489. hasMore,
  7490. ambiguousCharacterCount,
  7491. invisibleCharacterCount,
  7492. nonBasicAsciiCharacterCount
  7493. };
  7494. }
  7495. static computeUnicodeHighlightReason(char, options) {
  7496. const codePointHighlighter = new CodePointHighlighter(options);
  7497. const reason = codePointHighlighter.shouldHighlightNonBasicASCII(char, null);
  7498. switch (reason) {
  7499. case 0:
  7500. return null;
  7501. case 2:
  7502. return {kind: 1};
  7503. case 3: {
  7504. const codePoint = char.codePointAt(0);
  7505. const primaryConfusable = codePointHighlighter.ambiguousCharacters.getPrimaryConfusable(codePoint);
  7506. const notAmbiguousInLocales = AmbiguousCharacters.getLocales().filter((l) => !AmbiguousCharacters.getInstance(new Set([...options.allowedLocales, l])).isAmbiguous(codePoint));
  7507. return {kind: 0, confusableWith: String.fromCodePoint(primaryConfusable), notAmbiguousInLocales};
  7508. }
  7509. case 1:
  7510. return {kind: 2};
  7511. }
  7512. }
  7513. };
  7514. function buildRegExpCharClassExpr(codePoints, flags) {
  7515. const src = `[${escapeRegExpCharacters(codePoints.map((i) => String.fromCodePoint(i)).join(""))}]`;
  7516. return src;
  7517. }
  7518. var CodePointHighlighter = class {
  7519. constructor(options) {
  7520. this.options = options;
  7521. this.allowedCodePoints = new Set(options.allowedCodePoints);
  7522. this.ambiguousCharacters = AmbiguousCharacters.getInstance(new Set(options.allowedLocales));
  7523. }
  7524. getCandidateCodePoints() {
  7525. if (this.options.nonBasicASCII) {
  7526. return "allNonBasicAscii";
  7527. }
  7528. const set = new Set();
  7529. if (this.options.invisibleCharacters) {
  7530. for (const cp of InvisibleCharacters.codePoints) {
  7531. if (!isAllowedInvisibleCharacter(String.fromCodePoint(cp))) {
  7532. set.add(cp);
  7533. }
  7534. }
  7535. }
  7536. if (this.options.ambiguousCharacters) {
  7537. for (const cp of this.ambiguousCharacters.getConfusableCodePoints()) {
  7538. set.add(cp);
  7539. }
  7540. }
  7541. for (const cp of this.allowedCodePoints) {
  7542. set.delete(cp);
  7543. }
  7544. return set;
  7545. }
  7546. shouldHighlightNonBasicASCII(character, wordContext) {
  7547. const codePoint = character.codePointAt(0);
  7548. if (this.allowedCodePoints.has(codePoint)) {
  7549. return 0;
  7550. }
  7551. if (this.options.nonBasicASCII) {
  7552. return 1;
  7553. }
  7554. let hasBasicASCIICharacters = false;
  7555. let hasNonConfusableNonBasicAsciiCharacter = false;
  7556. if (wordContext) {
  7557. for (let char of wordContext) {
  7558. const codePoint2 = char.codePointAt(0);
  7559. const isBasicASCII2 = isBasicASCII(char);
  7560. hasBasicASCIICharacters = hasBasicASCIICharacters || isBasicASCII2;
  7561. if (!isBasicASCII2 && !this.ambiguousCharacters.isAmbiguous(codePoint2) && !InvisibleCharacters.isInvisibleCharacter(codePoint2)) {
  7562. hasNonConfusableNonBasicAsciiCharacter = true;
  7563. }
  7564. }
  7565. }
  7566. if (!hasBasicASCIICharacters && hasNonConfusableNonBasicAsciiCharacter) {
  7567. return 0;
  7568. }
  7569. if (this.options.invisibleCharacters) {
  7570. if (!isAllowedInvisibleCharacter(character) && InvisibleCharacters.isInvisibleCharacter(codePoint)) {
  7571. return 2;
  7572. }
  7573. }
  7574. if (this.options.ambiguousCharacters) {
  7575. if (this.ambiguousCharacters.isAmbiguous(codePoint)) {
  7576. return 3;
  7577. }
  7578. }
  7579. return 0;
  7580. }
  7581. };
  7582. function isAllowedInvisibleCharacter(character) {
  7583. return character === " " || character === "\n" || character === " ";
  7584. }
  7585. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js
  7586. var __awaiter2 = function(thisArg, _arguments, P, generator) {
  7587. function adopt(value) {
  7588. return value instanceof P ? value : new P(function(resolve2) {
  7589. resolve2(value);
  7590. });
  7591. }
  7592. return new (P || (P = Promise))(function(resolve2, reject) {
  7593. function fulfilled(value) {
  7594. try {
  7595. step(generator.next(value));
  7596. } catch (e) {
  7597. reject(e);
  7598. }
  7599. }
  7600. function rejected(value) {
  7601. try {
  7602. step(generator["throw"](value));
  7603. } catch (e) {
  7604. reject(e);
  7605. }
  7606. }
  7607. function step(result) {
  7608. result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
  7609. }
  7610. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7611. });
  7612. };
  7613. var MirrorModel = class extends MirrorTextModel {
  7614. get uri() {
  7615. return this._uri;
  7616. }
  7617. get eol() {
  7618. return this._eol;
  7619. }
  7620. getValue() {
  7621. return this.getText();
  7622. }
  7623. getLinesContent() {
  7624. return this._lines.slice(0);
  7625. }
  7626. getLineCount() {
  7627. return this._lines.length;
  7628. }
  7629. getLineContent(lineNumber) {
  7630. return this._lines[lineNumber - 1];
  7631. }
  7632. getWordAtPosition(position, wordDefinition) {
  7633. const wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0);
  7634. if (wordAtText) {
  7635. return new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn);
  7636. }
  7637. return null;
  7638. }
  7639. words(wordDefinition) {
  7640. const lines = this._lines;
  7641. const wordenize = this._wordenize.bind(this);
  7642. let lineNumber = 0;
  7643. let lineText = "";
  7644. let wordRangesIdx = 0;
  7645. let wordRanges = [];
  7646. return {
  7647. *[Symbol.iterator]() {
  7648. while (true) {
  7649. if (wordRangesIdx < wordRanges.length) {
  7650. const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end);
  7651. wordRangesIdx += 1;
  7652. yield value;
  7653. } else {
  7654. if (lineNumber < lines.length) {
  7655. lineText = lines[lineNumber];
  7656. wordRanges = wordenize(lineText, wordDefinition);
  7657. wordRangesIdx = 0;
  7658. lineNumber += 1;
  7659. } else {
  7660. break;
  7661. }
  7662. }
  7663. }
  7664. }
  7665. };
  7666. }
  7667. getLineWords(lineNumber, wordDefinition) {
  7668. const content = this._lines[lineNumber - 1];
  7669. const ranges = this._wordenize(content, wordDefinition);
  7670. const words = [];
  7671. for (const range of ranges) {
  7672. words.push({
  7673. word: content.substring(range.start, range.end),
  7674. startColumn: range.start + 1,
  7675. endColumn: range.end + 1
  7676. });
  7677. }
  7678. return words;
  7679. }
  7680. _wordenize(content, wordDefinition) {
  7681. const result = [];
  7682. let match;
  7683. wordDefinition.lastIndex = 0;
  7684. while (match = wordDefinition.exec(content)) {
  7685. if (match[0].length === 0) {
  7686. break;
  7687. }
  7688. result.push({start: match.index, end: match.index + match[0].length});
  7689. }
  7690. return result;
  7691. }
  7692. getValueInRange(range) {
  7693. range = this._validateRange(range);
  7694. if (range.startLineNumber === range.endLineNumber) {
  7695. return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1);
  7696. }
  7697. const lineEnding = this._eol;
  7698. const startLineIndex = range.startLineNumber - 1;
  7699. const endLineIndex = range.endLineNumber - 1;
  7700. const resultLines = [];
  7701. resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1));
  7702. for (let i = startLineIndex + 1; i < endLineIndex; i++) {
  7703. resultLines.push(this._lines[i]);
  7704. }
  7705. resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1));
  7706. return resultLines.join(lineEnding);
  7707. }
  7708. offsetAt(position) {
  7709. position = this._validatePosition(position);
  7710. this._ensureLineStarts();
  7711. return this._lineStarts.getPrefixSum(position.lineNumber - 2) + (position.column - 1);
  7712. }
  7713. positionAt(offset) {
  7714. offset = Math.floor(offset);
  7715. offset = Math.max(0, offset);
  7716. this._ensureLineStarts();
  7717. const out = this._lineStarts.getIndexOf(offset);
  7718. const lineLength = this._lines[out.index].length;
  7719. return {
  7720. lineNumber: 1 + out.index,
  7721. column: 1 + Math.min(out.remainder, lineLength)
  7722. };
  7723. }
  7724. _validateRange(range) {
  7725. const start = this._validatePosition({lineNumber: range.startLineNumber, column: range.startColumn});
  7726. const end = this._validatePosition({lineNumber: range.endLineNumber, column: range.endColumn});
  7727. if (start.lineNumber !== range.startLineNumber || start.column !== range.startColumn || end.lineNumber !== range.endLineNumber || end.column !== range.endColumn) {
  7728. return {
  7729. startLineNumber: start.lineNumber,
  7730. startColumn: start.column,
  7731. endLineNumber: end.lineNumber,
  7732. endColumn: end.column
  7733. };
  7734. }
  7735. return range;
  7736. }
  7737. _validatePosition(position) {
  7738. if (!Position.isIPosition(position)) {
  7739. throw new Error("bad position");
  7740. }
  7741. let {lineNumber, column} = position;
  7742. let hasChanged = false;
  7743. if (lineNumber < 1) {
  7744. lineNumber = 1;
  7745. column = 1;
  7746. hasChanged = true;
  7747. } else if (lineNumber > this._lines.length) {
  7748. lineNumber = this._lines.length;
  7749. column = this._lines[lineNumber - 1].length + 1;
  7750. hasChanged = true;
  7751. } else {
  7752. const maxCharacter = this._lines[lineNumber - 1].length + 1;
  7753. if (column < 1) {
  7754. column = 1;
  7755. hasChanged = true;
  7756. } else if (column > maxCharacter) {
  7757. column = maxCharacter;
  7758. hasChanged = true;
  7759. }
  7760. }
  7761. if (!hasChanged) {
  7762. return position;
  7763. } else {
  7764. return {lineNumber, column};
  7765. }
  7766. }
  7767. };
  7768. var EditorSimpleWorker = class {
  7769. constructor(host, foreignModuleFactory) {
  7770. this._host = host;
  7771. this._models = Object.create(null);
  7772. this._foreignModuleFactory = foreignModuleFactory;
  7773. this._foreignModule = null;
  7774. }
  7775. dispose() {
  7776. this._models = Object.create(null);
  7777. }
  7778. _getModel(uri) {
  7779. return this._models[uri];
  7780. }
  7781. _getModels() {
  7782. const all = [];
  7783. Object.keys(this._models).forEach((key) => all.push(this._models[key]));
  7784. return all;
  7785. }
  7786. acceptNewModel(data) {
  7787. this._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId);
  7788. }
  7789. acceptModelChanged(strURL, e) {
  7790. if (!this._models[strURL]) {
  7791. return;
  7792. }
  7793. const model = this._models[strURL];
  7794. model.onEvents(e);
  7795. }
  7796. acceptRemovedModel(strURL) {
  7797. if (!this._models[strURL]) {
  7798. return;
  7799. }
  7800. delete this._models[strURL];
  7801. }
  7802. computeUnicodeHighlights(url, options, range) {
  7803. return __awaiter2(this, void 0, void 0, function* () {
  7804. const model = this._getModel(url);
  7805. if (!model) {
  7806. return {ranges: [], hasMore: false, ambiguousCharacterCount: 0, invisibleCharacterCount: 0, nonBasicAsciiCharacterCount: 0};
  7807. }
  7808. return UnicodeTextModelHighlighter.computeUnicodeHighlights(model, options, range);
  7809. });
  7810. }
  7811. computeDiff(originalUrl, modifiedUrl, ignoreTrimWhitespace, maxComputationTime) {
  7812. return __awaiter2(this, void 0, void 0, function* () {
  7813. const original = this._getModel(originalUrl);
  7814. const modified = this._getModel(modifiedUrl);
  7815. if (!original || !modified) {
  7816. return null;
  7817. }
  7818. const originalLines = original.getLinesContent();
  7819. const modifiedLines = modified.getLinesContent();
  7820. const diffComputer = new DiffComputer(originalLines, modifiedLines, {
  7821. shouldComputeCharChanges: true,
  7822. shouldPostProcessCharChanges: true,
  7823. shouldIgnoreTrimWhitespace: ignoreTrimWhitespace,
  7824. shouldMakePrettyDiff: true,
  7825. maxComputationTime
  7826. });
  7827. const diffResult = diffComputer.computeDiff();
  7828. const identical = diffResult.changes.length > 0 ? false : this._modelsAreIdentical(original, modified);
  7829. return {
  7830. quitEarly: diffResult.quitEarly,
  7831. identical,
  7832. changes: diffResult.changes
  7833. };
  7834. });
  7835. }
  7836. _modelsAreIdentical(original, modified) {
  7837. const originalLineCount = original.getLineCount();
  7838. const modifiedLineCount = modified.getLineCount();
  7839. if (originalLineCount !== modifiedLineCount) {
  7840. return false;
  7841. }
  7842. for (let line = 1; line <= originalLineCount; line++) {
  7843. const originalLine = original.getLineContent(line);
  7844. const modifiedLine = modified.getLineContent(line);
  7845. if (originalLine !== modifiedLine) {
  7846. return false;
  7847. }
  7848. }
  7849. return true;
  7850. }
  7851. computeMoreMinimalEdits(modelUrl, edits) {
  7852. return __awaiter2(this, void 0, void 0, function* () {
  7853. const model = this._getModel(modelUrl);
  7854. if (!model) {
  7855. return edits;
  7856. }
  7857. const result = [];
  7858. let lastEol = void 0;
  7859. edits = edits.slice(0).sort((a2, b) => {
  7860. if (a2.range && b.range) {
  7861. return Range.compareRangesUsingStarts(a2.range, b.range);
  7862. }
  7863. const aRng = a2.range ? 0 : 1;
  7864. const bRng = b.range ? 0 : 1;
  7865. return aRng - bRng;
  7866. });
  7867. for (let {range, text, eol} of edits) {
  7868. if (typeof eol === "number") {
  7869. lastEol = eol;
  7870. }
  7871. if (Range.isEmpty(range) && !text) {
  7872. continue;
  7873. }
  7874. const original = model.getValueInRange(range);
  7875. text = text.replace(/\r\n|\n|\r/g, model.eol);
  7876. if (original === text) {
  7877. continue;
  7878. }
  7879. if (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) {
  7880. result.push({range, text});
  7881. continue;
  7882. }
  7883. const changes = stringDiff(original, text, false);
  7884. const editOffset = model.offsetAt(Range.lift(range).getStartPosition());
  7885. for (const change of changes) {
  7886. const start = model.positionAt(editOffset + change.originalStart);
  7887. const end = model.positionAt(editOffset + change.originalStart + change.originalLength);
  7888. const newEdit = {
  7889. text: text.substr(change.modifiedStart, change.modifiedLength),
  7890. range: {startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column}
  7891. };
  7892. if (model.getValueInRange(newEdit.range) !== newEdit.text) {
  7893. result.push(newEdit);
  7894. }
  7895. }
  7896. }
  7897. if (typeof lastEol === "number") {
  7898. result.push({eol: lastEol, text: "", range: {startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0}});
  7899. }
  7900. return result;
  7901. });
  7902. }
  7903. computeLinks(modelUrl) {
  7904. return __awaiter2(this, void 0, void 0, function* () {
  7905. const model = this._getModel(modelUrl);
  7906. if (!model) {
  7907. return null;
  7908. }
  7909. return computeLinks(model);
  7910. });
  7911. }
  7912. textualSuggest(modelUrls, leadingWord, wordDef, wordDefFlags) {
  7913. return __awaiter2(this, void 0, void 0, function* () {
  7914. const sw = new StopWatch(true);
  7915. const wordDefRegExp = new RegExp(wordDef, wordDefFlags);
  7916. const seen = new Set();
  7917. outer:
  7918. for (let url of modelUrls) {
  7919. const model = this._getModel(url);
  7920. if (!model) {
  7921. continue;
  7922. }
  7923. for (let word of model.words(wordDefRegExp)) {
  7924. if (word === leadingWord || !isNaN(Number(word))) {
  7925. continue;
  7926. }
  7927. seen.add(word);
  7928. if (seen.size > EditorSimpleWorker._suggestionsLimit) {
  7929. break outer;
  7930. }
  7931. }
  7932. }
  7933. return {words: Array.from(seen), duration: sw.elapsed()};
  7934. });
  7935. }
  7936. computeWordRanges(modelUrl, range, wordDef, wordDefFlags) {
  7937. return __awaiter2(this, void 0, void 0, function* () {
  7938. const model = this._getModel(modelUrl);
  7939. if (!model) {
  7940. return Object.create(null);
  7941. }
  7942. const wordDefRegExp = new RegExp(wordDef, wordDefFlags);
  7943. const result = Object.create(null);
  7944. for (let line = range.startLineNumber; line < range.endLineNumber; line++) {
  7945. const words = model.getLineWords(line, wordDefRegExp);
  7946. for (const word of words) {
  7947. if (!isNaN(Number(word.word))) {
  7948. continue;
  7949. }
  7950. let array = result[word.word];
  7951. if (!array) {
  7952. array = [];
  7953. result[word.word] = array;
  7954. }
  7955. array.push({
  7956. startLineNumber: line,
  7957. startColumn: word.startColumn,
  7958. endLineNumber: line,
  7959. endColumn: word.endColumn
  7960. });
  7961. }
  7962. }
  7963. return result;
  7964. });
  7965. }
  7966. navigateValueSet(modelUrl, range, up, wordDef, wordDefFlags) {
  7967. return __awaiter2(this, void 0, void 0, function* () {
  7968. const model = this._getModel(modelUrl);
  7969. if (!model) {
  7970. return null;
  7971. }
  7972. const wordDefRegExp = new RegExp(wordDef, wordDefFlags);
  7973. if (range.startColumn === range.endColumn) {
  7974. range = {
  7975. startLineNumber: range.startLineNumber,
  7976. startColumn: range.startColumn,
  7977. endLineNumber: range.endLineNumber,
  7978. endColumn: range.endColumn + 1
  7979. };
  7980. }
  7981. const selectionText = model.getValueInRange(range);
  7982. const wordRange = model.getWordAtPosition({lineNumber: range.startLineNumber, column: range.startColumn}, wordDefRegExp);
  7983. if (!wordRange) {
  7984. return null;
  7985. }
  7986. const word = model.getValueInRange(wordRange);
  7987. const result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up);
  7988. return result;
  7989. });
  7990. }
  7991. loadForeignModule(moduleId, createData, foreignHostMethods) {
  7992. const proxyMethodRequest = (method, args) => {
  7993. return this._host.fhr(method, args);
  7994. };
  7995. const foreignHost = createProxyObject(foreignHostMethods, proxyMethodRequest);
  7996. const ctx = {
  7997. host: foreignHost,
  7998. getMirrorModels: () => {
  7999. return this._getModels();
  8000. }
  8001. };
  8002. if (this._foreignModuleFactory) {
  8003. this._foreignModule = this._foreignModuleFactory(ctx, createData);
  8004. return Promise.resolve(getAllMethodNames(this._foreignModule));
  8005. }
  8006. return Promise.reject(new Error(`Unexpected usage`));
  8007. }
  8008. fmr(method, args) {
  8009. if (!this._foreignModule || typeof this._foreignModule[method] !== "function") {
  8010. return Promise.reject(new Error("Missing requestHandler or method: " + method));
  8011. }
  8012. try {
  8013. return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args));
  8014. } catch (e) {
  8015. return Promise.reject(e);
  8016. }
  8017. }
  8018. };
  8019. EditorSimpleWorker._diffLimit = 1e5;
  8020. EditorSimpleWorker._suggestionsLimit = 1e4;
  8021. if (typeof importScripts === "function") {
  8022. globals.monaco = createMonacoBaseAPI();
  8023. }
  8024. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/editor.worker.js
  8025. var initialized = false;
  8026. function initialize(foreignModule) {
  8027. if (initialized) {
  8028. return;
  8029. }
  8030. initialized = true;
  8031. const simpleWorker = new SimpleWorkerServer((msg) => {
  8032. self.postMessage(msg);
  8033. }, (host) => new EditorSimpleWorker(host, foreignModule));
  8034. self.onmessage = (e) => {
  8035. simpleWorker.onmessage(e.data);
  8036. };
  8037. }
  8038. self.onmessage = (e) => {
  8039. if (!initialized) {
  8040. initialize(null);
  8041. }
  8042. };
  8043. // node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/language/json/json.worker.js
  8044. /*!-----------------------------------------------------------------------------
  8045. * Copyright (c) Microsoft Corporation. All rights reserved.
  8046. * Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)
  8047. * Released under the MIT license
  8048. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  8049. *-----------------------------------------------------------------------------*/
  8050. function createScanner(text, ignoreTrivia) {
  8051. if (ignoreTrivia === void 0) {
  8052. ignoreTrivia = false;
  8053. }
  8054. var len = text.length;
  8055. var pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
  8056. function scanHexDigits(count, exact) {
  8057. var digits = 0;
  8058. var value2 = 0;
  8059. while (digits < count || !exact) {
  8060. var ch = text.charCodeAt(pos);
  8061. if (ch >= 48 && ch <= 57) {
  8062. value2 = value2 * 16 + ch - 48;
  8063. } else if (ch >= 65 && ch <= 70) {
  8064. value2 = value2 * 16 + ch - 65 + 10;
  8065. } else if (ch >= 97 && ch <= 102) {
  8066. value2 = value2 * 16 + ch - 97 + 10;
  8067. } else {
  8068. break;
  8069. }
  8070. pos++;
  8071. digits++;
  8072. }
  8073. if (digits < count) {
  8074. value2 = -1;
  8075. }
  8076. return value2;
  8077. }
  8078. function setPosition(newPosition) {
  8079. pos = newPosition;
  8080. value = "";
  8081. tokenOffset = 0;
  8082. token = 16;
  8083. scanError = 0;
  8084. }
  8085. function scanNumber() {
  8086. var start = pos;
  8087. if (text.charCodeAt(pos) === 48) {
  8088. pos++;
  8089. } else {
  8090. pos++;
  8091. while (pos < text.length && isDigit(text.charCodeAt(pos))) {
  8092. pos++;
  8093. }
  8094. }
  8095. if (pos < text.length && text.charCodeAt(pos) === 46) {
  8096. pos++;
  8097. if (pos < text.length && isDigit(text.charCodeAt(pos))) {
  8098. pos++;
  8099. while (pos < text.length && isDigit(text.charCodeAt(pos))) {
  8100. pos++;
  8101. }
  8102. } else {
  8103. scanError = 3;
  8104. return text.substring(start, pos);
  8105. }
  8106. }
  8107. var end = pos;
  8108. if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
  8109. pos++;
  8110. if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
  8111. pos++;
  8112. }
  8113. if (pos < text.length && isDigit(text.charCodeAt(pos))) {
  8114. pos++;
  8115. while (pos < text.length && isDigit(text.charCodeAt(pos))) {
  8116. pos++;
  8117. }
  8118. end = pos;
  8119. } else {
  8120. scanError = 3;
  8121. }
  8122. }
  8123. return text.substring(start, end);
  8124. }
  8125. function scanString() {
  8126. var result = "", start = pos;
  8127. while (true) {
  8128. if (pos >= len) {
  8129. result += text.substring(start, pos);
  8130. scanError = 2;
  8131. break;
  8132. }
  8133. var ch = text.charCodeAt(pos);
  8134. if (ch === 34) {
  8135. result += text.substring(start, pos);
  8136. pos++;
  8137. break;
  8138. }
  8139. if (ch === 92) {
  8140. result += text.substring(start, pos);
  8141. pos++;
  8142. if (pos >= len) {
  8143. scanError = 2;
  8144. break;
  8145. }
  8146. var ch2 = text.charCodeAt(pos++);
  8147. switch (ch2) {
  8148. case 34:
  8149. result += '"';
  8150. break;
  8151. case 92:
  8152. result += "\\";
  8153. break;
  8154. case 47:
  8155. result += "/";
  8156. break;
  8157. case 98:
  8158. result += "\b";
  8159. break;
  8160. case 102:
  8161. result += "\f";
  8162. break;
  8163. case 110:
  8164. result += "\n";
  8165. break;
  8166. case 114:
  8167. result += "\r";
  8168. break;
  8169. case 116:
  8170. result += " ";
  8171. break;
  8172. case 117:
  8173. var ch3 = scanHexDigits(4, true);
  8174. if (ch3 >= 0) {
  8175. result += String.fromCharCode(ch3);
  8176. } else {
  8177. scanError = 4;
  8178. }
  8179. break;
  8180. default:
  8181. scanError = 5;
  8182. }
  8183. start = pos;
  8184. continue;
  8185. }
  8186. if (ch >= 0 && ch <= 31) {
  8187. if (isLineBreak(ch)) {
  8188. result += text.substring(start, pos);
  8189. scanError = 2;
  8190. break;
  8191. } else {
  8192. scanError = 6;
  8193. }
  8194. }
  8195. pos++;
  8196. }
  8197. return result;
  8198. }
  8199. function scanNext() {
  8200. value = "";
  8201. scanError = 0;
  8202. tokenOffset = pos;
  8203. lineStartOffset = lineNumber;
  8204. prevTokenLineStartOffset = tokenLineStartOffset;
  8205. if (pos >= len) {
  8206. tokenOffset = len;
  8207. return token = 17;
  8208. }
  8209. var code = text.charCodeAt(pos);
  8210. if (isWhiteSpace(code)) {
  8211. do {
  8212. pos++;
  8213. value += String.fromCharCode(code);
  8214. code = text.charCodeAt(pos);
  8215. } while (isWhiteSpace(code));
  8216. return token = 15;
  8217. }
  8218. if (isLineBreak(code)) {
  8219. pos++;
  8220. value += String.fromCharCode(code);
  8221. if (code === 13 && text.charCodeAt(pos) === 10) {
  8222. pos++;
  8223. value += "\n";
  8224. }
  8225. lineNumber++;
  8226. tokenLineStartOffset = pos;
  8227. return token = 14;
  8228. }
  8229. switch (code) {
  8230. case 123:
  8231. pos++;
  8232. return token = 1;
  8233. case 125:
  8234. pos++;
  8235. return token = 2;
  8236. case 91:
  8237. pos++;
  8238. return token = 3;
  8239. case 93:
  8240. pos++;
  8241. return token = 4;
  8242. case 58:
  8243. pos++;
  8244. return token = 6;
  8245. case 44:
  8246. pos++;
  8247. return token = 5;
  8248. case 34:
  8249. pos++;
  8250. value = scanString();
  8251. return token = 10;
  8252. case 47:
  8253. var start = pos - 1;
  8254. if (text.charCodeAt(pos + 1) === 47) {
  8255. pos += 2;
  8256. while (pos < len) {
  8257. if (isLineBreak(text.charCodeAt(pos))) {
  8258. break;
  8259. }
  8260. pos++;
  8261. }
  8262. value = text.substring(start, pos);
  8263. return token = 12;
  8264. }
  8265. if (text.charCodeAt(pos + 1) === 42) {
  8266. pos += 2;
  8267. var safeLength = len - 1;
  8268. var commentClosed = false;
  8269. while (pos < safeLength) {
  8270. var ch = text.charCodeAt(pos);
  8271. if (ch === 42 && text.charCodeAt(pos + 1) === 47) {
  8272. pos += 2;
  8273. commentClosed = true;
  8274. break;
  8275. }
  8276. pos++;
  8277. if (isLineBreak(ch)) {
  8278. if (ch === 13 && text.charCodeAt(pos) === 10) {
  8279. pos++;
  8280. }
  8281. lineNumber++;
  8282. tokenLineStartOffset = pos;
  8283. }
  8284. }
  8285. if (!commentClosed) {
  8286. pos++;
  8287. scanError = 1;
  8288. }
  8289. value = text.substring(start, pos);
  8290. return token = 13;
  8291. }
  8292. value += String.fromCharCode(code);
  8293. pos++;
  8294. return token = 16;
  8295. case 45:
  8296. value += String.fromCharCode(code);
  8297. pos++;
  8298. if (pos === len || !isDigit(text.charCodeAt(pos))) {
  8299. return token = 16;
  8300. }
  8301. case 48:
  8302. case 49:
  8303. case 50:
  8304. case 51:
  8305. case 52:
  8306. case 53:
  8307. case 54:
  8308. case 55:
  8309. case 56:
  8310. case 57:
  8311. value += scanNumber();
  8312. return token = 11;
  8313. default:
  8314. while (pos < len && isUnknownContentCharacter(code)) {
  8315. pos++;
  8316. code = text.charCodeAt(pos);
  8317. }
  8318. if (tokenOffset !== pos) {
  8319. value = text.substring(tokenOffset, pos);
  8320. switch (value) {
  8321. case "true":
  8322. return token = 8;
  8323. case "false":
  8324. return token = 9;
  8325. case "null":
  8326. return token = 7;
  8327. }
  8328. return token = 16;
  8329. }
  8330. value += String.fromCharCode(code);
  8331. pos++;
  8332. return token = 16;
  8333. }
  8334. }
  8335. function isUnknownContentCharacter(code) {
  8336. if (isWhiteSpace(code) || isLineBreak(code)) {
  8337. return false;
  8338. }
  8339. switch (code) {
  8340. case 125:
  8341. case 93:
  8342. case 123:
  8343. case 91:
  8344. case 34:
  8345. case 58:
  8346. case 44:
  8347. case 47:
  8348. return false;
  8349. }
  8350. return true;
  8351. }
  8352. function scanNextNonTrivia() {
  8353. var result;
  8354. do {
  8355. result = scanNext();
  8356. } while (result >= 12 && result <= 15);
  8357. return result;
  8358. }
  8359. return {
  8360. setPosition,
  8361. getPosition: function() {
  8362. return pos;
  8363. },
  8364. scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
  8365. getToken: function() {
  8366. return token;
  8367. },
  8368. getTokenValue: function() {
  8369. return value;
  8370. },
  8371. getTokenOffset: function() {
  8372. return tokenOffset;
  8373. },
  8374. getTokenLength: function() {
  8375. return pos - tokenOffset;
  8376. },
  8377. getTokenStartLine: function() {
  8378. return lineStartOffset;
  8379. },
  8380. getTokenStartCharacter: function() {
  8381. return tokenOffset - prevTokenLineStartOffset;
  8382. },
  8383. getTokenError: function() {
  8384. return scanError;
  8385. }
  8386. };
  8387. }
  8388. function isWhiteSpace(ch) {
  8389. return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279;
  8390. }
  8391. function isLineBreak(ch) {
  8392. return ch === 10 || ch === 13 || ch === 8232 || ch === 8233;
  8393. }
  8394. function isDigit(ch) {
  8395. return ch >= 48 && ch <= 57;
  8396. }
  8397. function format(documentText, range, options) {
  8398. var initialIndentLevel;
  8399. var formatText;
  8400. var formatTextStart;
  8401. var rangeStart;
  8402. var rangeEnd;
  8403. if (range) {
  8404. rangeStart = range.offset;
  8405. rangeEnd = rangeStart + range.length;
  8406. formatTextStart = rangeStart;
  8407. while (formatTextStart > 0 && !isEOL(documentText, formatTextStart - 1)) {
  8408. formatTextStart--;
  8409. }
  8410. var endOffset = rangeEnd;
  8411. while (endOffset < documentText.length && !isEOL(documentText, endOffset)) {
  8412. endOffset++;
  8413. }
  8414. formatText = documentText.substring(formatTextStart, endOffset);
  8415. initialIndentLevel = computeIndentLevel(formatText, options);
  8416. } else {
  8417. formatText = documentText;
  8418. initialIndentLevel = 0;
  8419. formatTextStart = 0;
  8420. rangeStart = 0;
  8421. rangeEnd = documentText.length;
  8422. }
  8423. var eol = getEOL(options, documentText);
  8424. var lineBreak = false;
  8425. var indentLevel = 0;
  8426. var indentValue;
  8427. if (options.insertSpaces) {
  8428. indentValue = repeat(" ", options.tabSize || 4);
  8429. } else {
  8430. indentValue = " ";
  8431. }
  8432. var scanner = createScanner(formatText, false);
  8433. var hasError = false;
  8434. function newLineAndIndent() {
  8435. return eol + repeat(indentValue, initialIndentLevel + indentLevel);
  8436. }
  8437. function scanNext() {
  8438. var token = scanner.scan();
  8439. lineBreak = false;
  8440. while (token === 15 || token === 14) {
  8441. lineBreak = lineBreak || token === 14;
  8442. token = scanner.scan();
  8443. }
  8444. hasError = token === 16 || scanner.getTokenError() !== 0;
  8445. return token;
  8446. }
  8447. var editOperations = [];
  8448. function addEdit(text, startOffset, endOffset2) {
  8449. if (!hasError && (!range || startOffset < rangeEnd && endOffset2 > rangeStart) && documentText.substring(startOffset, endOffset2) !== text) {
  8450. editOperations.push({offset: startOffset, length: endOffset2 - startOffset, content: text});
  8451. }
  8452. }
  8453. var firstToken = scanNext();
  8454. if (firstToken !== 17) {
  8455. var firstTokenStart = scanner.getTokenOffset() + formatTextStart;
  8456. var initialIndent = repeat(indentValue, initialIndentLevel);
  8457. addEdit(initialIndent, formatTextStart, firstTokenStart);
  8458. }
  8459. while (firstToken !== 17) {
  8460. var firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;
  8461. var secondToken = scanNext();
  8462. var replaceContent = "";
  8463. var needsLineBreak = false;
  8464. while (!lineBreak && (secondToken === 12 || secondToken === 13)) {
  8465. var commentTokenStart = scanner.getTokenOffset() + formatTextStart;
  8466. addEdit(" ", firstTokenEnd, commentTokenStart);
  8467. firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;
  8468. needsLineBreak = secondToken === 12;
  8469. replaceContent = needsLineBreak ? newLineAndIndent() : "";
  8470. secondToken = scanNext();
  8471. }
  8472. if (secondToken === 2) {
  8473. if (firstToken !== 1) {
  8474. indentLevel--;
  8475. replaceContent = newLineAndIndent();
  8476. }
  8477. } else if (secondToken === 4) {
  8478. if (firstToken !== 3) {
  8479. indentLevel--;
  8480. replaceContent = newLineAndIndent();
  8481. }
  8482. } else {
  8483. switch (firstToken) {
  8484. case 3:
  8485. case 1:
  8486. indentLevel++;
  8487. replaceContent = newLineAndIndent();
  8488. break;
  8489. case 5:
  8490. case 12:
  8491. replaceContent = newLineAndIndent();
  8492. break;
  8493. case 13:
  8494. if (lineBreak) {
  8495. replaceContent = newLineAndIndent();
  8496. } else if (!needsLineBreak) {
  8497. replaceContent = " ";
  8498. }
  8499. break;
  8500. case 6:
  8501. if (!needsLineBreak) {
  8502. replaceContent = " ";
  8503. }
  8504. break;
  8505. case 10:
  8506. if (secondToken === 6) {
  8507. if (!needsLineBreak) {
  8508. replaceContent = "";
  8509. }
  8510. break;
  8511. }
  8512. case 7:
  8513. case 8:
  8514. case 9:
  8515. case 11:
  8516. case 2:
  8517. case 4:
  8518. if (secondToken === 12 || secondToken === 13) {
  8519. if (!needsLineBreak) {
  8520. replaceContent = " ";
  8521. }
  8522. } else if (secondToken !== 5 && secondToken !== 17) {
  8523. hasError = true;
  8524. }
  8525. break;
  8526. case 16:
  8527. hasError = true;
  8528. break;
  8529. }
  8530. if (lineBreak && (secondToken === 12 || secondToken === 13)) {
  8531. replaceContent = newLineAndIndent();
  8532. }
  8533. }
  8534. if (secondToken === 17) {
  8535. replaceContent = options.insertFinalNewline ? eol : "";
  8536. }
  8537. var secondTokenStart = scanner.getTokenOffset() + formatTextStart;
  8538. addEdit(replaceContent, firstTokenEnd, secondTokenStart);
  8539. firstToken = secondToken;
  8540. }
  8541. return editOperations;
  8542. }
  8543. function repeat(s, count) {
  8544. var result = "";
  8545. for (var i = 0; i < count; i++) {
  8546. result += s;
  8547. }
  8548. return result;
  8549. }
  8550. function computeIndentLevel(content, options) {
  8551. var i = 0;
  8552. var nChars = 0;
  8553. var tabSize = options.tabSize || 4;
  8554. while (i < content.length) {
  8555. var ch = content.charAt(i);
  8556. if (ch === " ") {
  8557. nChars++;
  8558. } else if (ch === " ") {
  8559. nChars += tabSize;
  8560. } else {
  8561. break;
  8562. }
  8563. i++;
  8564. }
  8565. return Math.floor(nChars / tabSize);
  8566. }
  8567. function getEOL(options, text) {
  8568. for (var i = 0; i < text.length; i++) {
  8569. var ch = text.charAt(i);
  8570. if (ch === "\r") {
  8571. if (i + 1 < text.length && text.charAt(i + 1) === "\n") {
  8572. return "\r\n";
  8573. }
  8574. return "\r";
  8575. } else if (ch === "\n") {
  8576. return "\n";
  8577. }
  8578. }
  8579. return options && options.eol || "\n";
  8580. }
  8581. function isEOL(text, offset) {
  8582. return "\r\n".indexOf(text.charAt(offset)) !== -1;
  8583. }
  8584. var ParseOptions;
  8585. (function(ParseOptions2) {
  8586. ParseOptions2.DEFAULT = {
  8587. allowTrailingComma: false
  8588. };
  8589. })(ParseOptions || (ParseOptions = {}));
  8590. function parse(text, errors, options) {
  8591. if (errors === void 0) {
  8592. errors = [];
  8593. }
  8594. if (options === void 0) {
  8595. options = ParseOptions.DEFAULT;
  8596. }
  8597. var currentProperty = null;
  8598. var currentParent = [];
  8599. var previousParents = [];
  8600. function onValue(value) {
  8601. if (Array.isArray(currentParent)) {
  8602. currentParent.push(value);
  8603. } else if (currentProperty !== null) {
  8604. currentParent[currentProperty] = value;
  8605. }
  8606. }
  8607. var visitor = {
  8608. onObjectBegin: function() {
  8609. var object = {};
  8610. onValue(object);
  8611. previousParents.push(currentParent);
  8612. currentParent = object;
  8613. currentProperty = null;
  8614. },
  8615. onObjectProperty: function(name) {
  8616. currentProperty = name;
  8617. },
  8618. onObjectEnd: function() {
  8619. currentParent = previousParents.pop();
  8620. },
  8621. onArrayBegin: function() {
  8622. var array = [];
  8623. onValue(array);
  8624. previousParents.push(currentParent);
  8625. currentParent = array;
  8626. currentProperty = null;
  8627. },
  8628. onArrayEnd: function() {
  8629. currentParent = previousParents.pop();
  8630. },
  8631. onLiteralValue: onValue,
  8632. onError: function(error, offset, length) {
  8633. errors.push({error, offset, length});
  8634. }
  8635. };
  8636. visit(text, visitor, options);
  8637. return currentParent[0];
  8638. }
  8639. function getNodePath(node) {
  8640. if (!node.parent || !node.parent.children) {
  8641. return [];
  8642. }
  8643. var path = getNodePath(node.parent);
  8644. if (node.parent.type === "property") {
  8645. var key = node.parent.children[0].value;
  8646. path.push(key);
  8647. } else if (node.parent.type === "array") {
  8648. var index = node.parent.children.indexOf(node);
  8649. if (index !== -1) {
  8650. path.push(index);
  8651. }
  8652. }
  8653. return path;
  8654. }
  8655. function getNodeValue(node) {
  8656. switch (node.type) {
  8657. case "array":
  8658. return node.children.map(getNodeValue);
  8659. case "object":
  8660. var obj = /* @__PURE__ */ Object.create(null);
  8661. for (var _i = 0, _a3 = node.children; _i < _a3.length; _i++) {
  8662. var prop = _a3[_i];
  8663. var valueNode = prop.children[1];
  8664. if (valueNode) {
  8665. obj[prop.children[0].value] = getNodeValue(valueNode);
  8666. }
  8667. }
  8668. return obj;
  8669. case "null":
  8670. case "string":
  8671. case "number":
  8672. case "boolean":
  8673. return node.value;
  8674. default:
  8675. return void 0;
  8676. }
  8677. }
  8678. function contains(node, offset, includeRightBound) {
  8679. if (includeRightBound === void 0) {
  8680. includeRightBound = false;
  8681. }
  8682. return offset >= node.offset && offset < node.offset + node.length || includeRightBound && offset === node.offset + node.length;
  8683. }
  8684. function findNodeAtOffset(node, offset, includeRightBound) {
  8685. if (includeRightBound === void 0) {
  8686. includeRightBound = false;
  8687. }
  8688. if (contains(node, offset, includeRightBound)) {
  8689. var children = node.children;
  8690. if (Array.isArray(children)) {
  8691. for (var i = 0; i < children.length && children[i].offset <= offset; i++) {
  8692. var item = findNodeAtOffset(children[i], offset, includeRightBound);
  8693. if (item) {
  8694. return item;
  8695. }
  8696. }
  8697. }
  8698. return node;
  8699. }
  8700. return void 0;
  8701. }
  8702. function visit(text, visitor, options) {
  8703. if (options === void 0) {
  8704. options = ParseOptions.DEFAULT;
  8705. }
  8706. var _scanner = createScanner(text, false);
  8707. function toNoArgVisit(visitFunction) {
  8708. return visitFunction ? function() {
  8709. return visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter());
  8710. } : function() {
  8711. return true;
  8712. };
  8713. }
  8714. function toOneArgVisit(visitFunction) {
  8715. return visitFunction ? function(arg) {
  8716. return visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter());
  8717. } : function() {
  8718. return true;
  8719. };
  8720. }
  8721. var onObjectBegin = toNoArgVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisit(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisit(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisit(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
  8722. var disallowComments = options && options.disallowComments;
  8723. var allowTrailingComma = options && options.allowTrailingComma;
  8724. function scanNext() {
  8725. while (true) {
  8726. var token = _scanner.scan();
  8727. switch (_scanner.getTokenError()) {
  8728. case 4:
  8729. handleError(14);
  8730. break;
  8731. case 5:
  8732. handleError(15);
  8733. break;
  8734. case 3:
  8735. handleError(13);
  8736. break;
  8737. case 1:
  8738. if (!disallowComments) {
  8739. handleError(11);
  8740. }
  8741. break;
  8742. case 2:
  8743. handleError(12);
  8744. break;
  8745. case 6:
  8746. handleError(16);
  8747. break;
  8748. }
  8749. switch (token) {
  8750. case 12:
  8751. case 13:
  8752. if (disallowComments) {
  8753. handleError(10);
  8754. } else {
  8755. onComment();
  8756. }
  8757. break;
  8758. case 16:
  8759. handleError(1);
  8760. break;
  8761. case 15:
  8762. case 14:
  8763. break;
  8764. default:
  8765. return token;
  8766. }
  8767. }
  8768. }
  8769. function handleError(error, skipUntilAfter, skipUntil) {
  8770. if (skipUntilAfter === void 0) {
  8771. skipUntilAfter = [];
  8772. }
  8773. if (skipUntil === void 0) {
  8774. skipUntil = [];
  8775. }
  8776. onError(error);
  8777. if (skipUntilAfter.length + skipUntil.length > 0) {
  8778. var token = _scanner.getToken();
  8779. while (token !== 17) {
  8780. if (skipUntilAfter.indexOf(token) !== -1) {
  8781. scanNext();
  8782. break;
  8783. } else if (skipUntil.indexOf(token) !== -1) {
  8784. break;
  8785. }
  8786. token = scanNext();
  8787. }
  8788. }
  8789. }
  8790. function parseString(isValue) {
  8791. var value = _scanner.getTokenValue();
  8792. if (isValue) {
  8793. onLiteralValue(value);
  8794. } else {
  8795. onObjectProperty(value);
  8796. }
  8797. scanNext();
  8798. return true;
  8799. }
  8800. function parseLiteral() {
  8801. switch (_scanner.getToken()) {
  8802. case 11:
  8803. var tokenValue = _scanner.getTokenValue();
  8804. var value = Number(tokenValue);
  8805. if (isNaN(value)) {
  8806. handleError(2);
  8807. value = 0;
  8808. }
  8809. onLiteralValue(value);
  8810. break;
  8811. case 7:
  8812. onLiteralValue(null);
  8813. break;
  8814. case 8:
  8815. onLiteralValue(true);
  8816. break;
  8817. case 9:
  8818. onLiteralValue(false);
  8819. break;
  8820. default:
  8821. return false;
  8822. }
  8823. scanNext();
  8824. return true;
  8825. }
  8826. function parseProperty() {
  8827. if (_scanner.getToken() !== 10) {
  8828. handleError(3, [], [2, 5]);
  8829. return false;
  8830. }
  8831. parseString(false);
  8832. if (_scanner.getToken() === 6) {
  8833. onSeparator(":");
  8834. scanNext();
  8835. if (!parseValue()) {
  8836. handleError(4, [], [2, 5]);
  8837. }
  8838. } else {
  8839. handleError(5, [], [2, 5]);
  8840. }
  8841. return true;
  8842. }
  8843. function parseObject() {
  8844. onObjectBegin();
  8845. scanNext();
  8846. var needsComma = false;
  8847. while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
  8848. if (_scanner.getToken() === 5) {
  8849. if (!needsComma) {
  8850. handleError(4, [], []);
  8851. }
  8852. onSeparator(",");
  8853. scanNext();
  8854. if (_scanner.getToken() === 2 && allowTrailingComma) {
  8855. break;
  8856. }
  8857. } else if (needsComma) {
  8858. handleError(6, [], []);
  8859. }
  8860. if (!parseProperty()) {
  8861. handleError(4, [], [2, 5]);
  8862. }
  8863. needsComma = true;
  8864. }
  8865. onObjectEnd();
  8866. if (_scanner.getToken() !== 2) {
  8867. handleError(7, [2], []);
  8868. } else {
  8869. scanNext();
  8870. }
  8871. return true;
  8872. }
  8873. function parseArray() {
  8874. onArrayBegin();
  8875. scanNext();
  8876. var needsComma = false;
  8877. while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
  8878. if (_scanner.getToken() === 5) {
  8879. if (!needsComma) {
  8880. handleError(4, [], []);
  8881. }
  8882. onSeparator(",");
  8883. scanNext();
  8884. if (_scanner.getToken() === 4 && allowTrailingComma) {
  8885. break;
  8886. }
  8887. } else if (needsComma) {
  8888. handleError(6, [], []);
  8889. }
  8890. if (!parseValue()) {
  8891. handleError(4, [], [4, 5]);
  8892. }
  8893. needsComma = true;
  8894. }
  8895. onArrayEnd();
  8896. if (_scanner.getToken() !== 4) {
  8897. handleError(8, [4], []);
  8898. } else {
  8899. scanNext();
  8900. }
  8901. return true;
  8902. }
  8903. function parseValue() {
  8904. switch (_scanner.getToken()) {
  8905. case 3:
  8906. return parseArray();
  8907. case 1:
  8908. return parseObject();
  8909. case 10:
  8910. return parseString(true);
  8911. default:
  8912. return parseLiteral();
  8913. }
  8914. }
  8915. scanNext();
  8916. if (_scanner.getToken() === 17) {
  8917. if (options.allowEmptyContent) {
  8918. return true;
  8919. }
  8920. handleError(4, [], []);
  8921. return false;
  8922. }
  8923. if (!parseValue()) {
  8924. handleError(4, [], []);
  8925. return false;
  8926. }
  8927. if (_scanner.getToken() !== 17) {
  8928. handleError(9, [], []);
  8929. }
  8930. return true;
  8931. }
  8932. var createScanner2 = createScanner;
  8933. var parse2 = parse;
  8934. var findNodeAtOffset2 = findNodeAtOffset;
  8935. var getNodePath2 = getNodePath;
  8936. var getNodeValue2 = getNodeValue;
  8937. function format2(documentText, range, options) {
  8938. return format(documentText, range, options);
  8939. }
  8940. function equals2(one, other) {
  8941. if (one === other) {
  8942. return true;
  8943. }
  8944. if (one === null || one === void 0 || other === null || other === void 0) {
  8945. return false;
  8946. }
  8947. if (typeof one !== typeof other) {
  8948. return false;
  8949. }
  8950. if (typeof one !== "object") {
  8951. return false;
  8952. }
  8953. if (Array.isArray(one) !== Array.isArray(other)) {
  8954. return false;
  8955. }
  8956. var i, key;
  8957. if (Array.isArray(one)) {
  8958. if (one.length !== other.length) {
  8959. return false;
  8960. }
  8961. for (i = 0; i < one.length; i++) {
  8962. if (!equals2(one[i], other[i])) {
  8963. return false;
  8964. }
  8965. }
  8966. } else {
  8967. var oneKeys = [];
  8968. for (key in one) {
  8969. oneKeys.push(key);
  8970. }
  8971. oneKeys.sort();
  8972. var otherKeys = [];
  8973. for (key in other) {
  8974. otherKeys.push(key);
  8975. }
  8976. otherKeys.sort();
  8977. if (!equals2(oneKeys, otherKeys)) {
  8978. return false;
  8979. }
  8980. for (i = 0; i < oneKeys.length; i++) {
  8981. if (!equals2(one[oneKeys[i]], other[oneKeys[i]])) {
  8982. return false;
  8983. }
  8984. }
  8985. }
  8986. return true;
  8987. }
  8988. function isNumber(val) {
  8989. return typeof val === "number";
  8990. }
  8991. function isDefined(val) {
  8992. return typeof val !== "undefined";
  8993. }
  8994. function isBoolean(val) {
  8995. return typeof val === "boolean";
  8996. }
  8997. function isString(val) {
  8998. return typeof val === "string";
  8999. }
  9000. function startsWith(haystack, needle) {
  9001. if (haystack.length < needle.length) {
  9002. return false;
  9003. }
  9004. for (var i = 0; i < needle.length; i++) {
  9005. if (haystack[i] !== needle[i]) {
  9006. return false;
  9007. }
  9008. }
  9009. return true;
  9010. }
  9011. function endsWith(haystack, needle) {
  9012. var diff = haystack.length - needle.length;
  9013. if (diff > 0) {
  9014. return haystack.lastIndexOf(needle) === diff;
  9015. } else if (diff === 0) {
  9016. return haystack === needle;
  9017. } else {
  9018. return false;
  9019. }
  9020. }
  9021. function extendedRegExp(pattern) {
  9022. var flags = "";
  9023. if (startsWith(pattern, "(?i)")) {
  9024. pattern = pattern.substring(4);
  9025. flags = "i";
  9026. }
  9027. try {
  9028. return new RegExp(pattern, flags + "u");
  9029. } catch (e) {
  9030. try {
  9031. return new RegExp(pattern, flags);
  9032. } catch (e2) {
  9033. return void 0;
  9034. }
  9035. }
  9036. }
  9037. var integer;
  9038. (function(integer2) {
  9039. integer2.MIN_VALUE = -2147483648;
  9040. integer2.MAX_VALUE = 2147483647;
  9041. })(integer || (integer = {}));
  9042. var uinteger;
  9043. (function(uinteger2) {
  9044. uinteger2.MIN_VALUE = 0;
  9045. uinteger2.MAX_VALUE = 2147483647;
  9046. })(uinteger || (uinteger = {}));
  9047. var Position2;
  9048. (function(Position22) {
  9049. function create(line, character) {
  9050. if (line === Number.MAX_VALUE) {
  9051. line = uinteger.MAX_VALUE;
  9052. }
  9053. if (character === Number.MAX_VALUE) {
  9054. character = uinteger.MAX_VALUE;
  9055. }
  9056. return {line, character};
  9057. }
  9058. Position22.create = create;
  9059. function is(value) {
  9060. var candidate = value;
  9061. return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
  9062. }
  9063. Position22.is = is;
  9064. })(Position2 || (Position2 = {}));
  9065. var Range2;
  9066. (function(Range22) {
  9067. function create(one, two, three, four) {
  9068. if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
  9069. return {start: Position2.create(one, two), end: Position2.create(three, four)};
  9070. } else if (Position2.is(one) && Position2.is(two)) {
  9071. return {start: one, end: two};
  9072. } else {
  9073. throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
  9074. }
  9075. }
  9076. Range22.create = create;
  9077. function is(value) {
  9078. var candidate = value;
  9079. return Is.objectLiteral(candidate) && Position2.is(candidate.start) && Position2.is(candidate.end);
  9080. }
  9081. Range22.is = is;
  9082. })(Range2 || (Range2 = {}));
  9083. var Location;
  9084. (function(Location2) {
  9085. function create(uri, range) {
  9086. return {uri, range};
  9087. }
  9088. Location2.create = create;
  9089. function is(value) {
  9090. var candidate = value;
  9091. return Is.defined(candidate) && Range2.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
  9092. }
  9093. Location2.is = is;
  9094. })(Location || (Location = {}));
  9095. var LocationLink;
  9096. (function(LocationLink2) {
  9097. function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
  9098. return {targetUri, targetRange, targetSelectionRange, originSelectionRange};
  9099. }
  9100. LocationLink2.create = create;
  9101. function is(value) {
  9102. var candidate = value;
  9103. return Is.defined(candidate) && Range2.is(candidate.targetRange) && Is.string(candidate.targetUri) && (Range2.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) && (Range2.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
  9104. }
  9105. LocationLink2.is = is;
  9106. })(LocationLink || (LocationLink = {}));
  9107. var Color;
  9108. (function(Color2) {
  9109. function create(red, green, blue, alpha) {
  9110. return {
  9111. red,
  9112. green,
  9113. blue,
  9114. alpha
  9115. };
  9116. }
  9117. Color2.create = create;
  9118. function is(value) {
  9119. var candidate = value;
  9120. return Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);
  9121. }
  9122. Color2.is = is;
  9123. })(Color || (Color = {}));
  9124. var ColorInformation;
  9125. (function(ColorInformation2) {
  9126. function create(range, color) {
  9127. return {
  9128. range,
  9129. color
  9130. };
  9131. }
  9132. ColorInformation2.create = create;
  9133. function is(value) {
  9134. var candidate = value;
  9135. return Range2.is(candidate.range) && Color.is(candidate.color);
  9136. }
  9137. ColorInformation2.is = is;
  9138. })(ColorInformation || (ColorInformation = {}));
  9139. var ColorPresentation;
  9140. (function(ColorPresentation2) {
  9141. function create(label, textEdit, additionalTextEdits) {
  9142. return {
  9143. label,
  9144. textEdit,
  9145. additionalTextEdits
  9146. };
  9147. }
  9148. ColorPresentation2.create = create;
  9149. function is(value) {
  9150. var candidate = value;
  9151. return Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
  9152. }
  9153. ColorPresentation2.is = is;
  9154. })(ColorPresentation || (ColorPresentation = {}));
  9155. var FoldingRangeKind2;
  9156. (function(FoldingRangeKind22) {
  9157. FoldingRangeKind22["Comment"] = "comment";
  9158. FoldingRangeKind22["Imports"] = "imports";
  9159. FoldingRangeKind22["Region"] = "region";
  9160. })(FoldingRangeKind2 || (FoldingRangeKind2 = {}));
  9161. var FoldingRange;
  9162. (function(FoldingRange2) {
  9163. function create(startLine, endLine, startCharacter, endCharacter, kind) {
  9164. var result = {
  9165. startLine,
  9166. endLine
  9167. };
  9168. if (Is.defined(startCharacter)) {
  9169. result.startCharacter = startCharacter;
  9170. }
  9171. if (Is.defined(endCharacter)) {
  9172. result.endCharacter = endCharacter;
  9173. }
  9174. if (Is.defined(kind)) {
  9175. result.kind = kind;
  9176. }
  9177. return result;
  9178. }
  9179. FoldingRange2.create = create;
  9180. function is(value) {
  9181. var candidate = value;
  9182. return Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
  9183. }
  9184. FoldingRange2.is = is;
  9185. })(FoldingRange || (FoldingRange = {}));
  9186. var DiagnosticRelatedInformation;
  9187. (function(DiagnosticRelatedInformation2) {
  9188. function create(location, message) {
  9189. return {
  9190. location,
  9191. message
  9192. };
  9193. }
  9194. DiagnosticRelatedInformation2.create = create;
  9195. function is(value) {
  9196. var candidate = value;
  9197. return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
  9198. }
  9199. DiagnosticRelatedInformation2.is = is;
  9200. })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
  9201. var DiagnosticSeverity;
  9202. (function(DiagnosticSeverity2) {
  9203. DiagnosticSeverity2.Error = 1;
  9204. DiagnosticSeverity2.Warning = 2;
  9205. DiagnosticSeverity2.Information = 3;
  9206. DiagnosticSeverity2.Hint = 4;
  9207. })(DiagnosticSeverity || (DiagnosticSeverity = {}));
  9208. var DiagnosticTag;
  9209. (function(DiagnosticTag2) {
  9210. DiagnosticTag2.Unnecessary = 1;
  9211. DiagnosticTag2.Deprecated = 2;
  9212. })(DiagnosticTag || (DiagnosticTag = {}));
  9213. var CodeDescription;
  9214. (function(CodeDescription2) {
  9215. function is(value) {
  9216. var candidate = value;
  9217. return candidate !== void 0 && candidate !== null && Is.string(candidate.href);
  9218. }
  9219. CodeDescription2.is = is;
  9220. })(CodeDescription || (CodeDescription = {}));
  9221. var Diagnostic;
  9222. (function(Diagnostic2) {
  9223. function create(range, message, severity, code, source, relatedInformation) {
  9224. var result = {range, message};
  9225. if (Is.defined(severity)) {
  9226. result.severity = severity;
  9227. }
  9228. if (Is.defined(code)) {
  9229. result.code = code;
  9230. }
  9231. if (Is.defined(source)) {
  9232. result.source = source;
  9233. }
  9234. if (Is.defined(relatedInformation)) {
  9235. result.relatedInformation = relatedInformation;
  9236. }
  9237. return result;
  9238. }
  9239. Diagnostic2.create = create;
  9240. function is(value) {
  9241. var _a3;
  9242. var candidate = value;
  9243. return Is.defined(candidate) && Range2.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a3 = candidate.codeDescription) === null || _a3 === void 0 ? void 0 : _a3.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
  9244. }
  9245. Diagnostic2.is = is;
  9246. })(Diagnostic || (Diagnostic = {}));
  9247. var Command2;
  9248. (function(Command22) {
  9249. function create(title, command) {
  9250. var args = [];
  9251. for (var _i = 2; _i < arguments.length; _i++) {
  9252. args[_i - 2] = arguments[_i];
  9253. }
  9254. var result = {title, command};
  9255. if (Is.defined(args) && args.length > 0) {
  9256. result.arguments = args;
  9257. }
  9258. return result;
  9259. }
  9260. Command22.create = create;
  9261. function is(value) {
  9262. var candidate = value;
  9263. return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
  9264. }
  9265. Command22.is = is;
  9266. })(Command2 || (Command2 = {}));
  9267. var TextEdit;
  9268. (function(TextEdit2) {
  9269. function replace(range, newText) {
  9270. return {range, newText};
  9271. }
  9272. TextEdit2.replace = replace;
  9273. function insert(position, newText) {
  9274. return {range: {start: position, end: position}, newText};
  9275. }
  9276. TextEdit2.insert = insert;
  9277. function del(range) {
  9278. return {range, newText: ""};
  9279. }
  9280. TextEdit2.del = del;
  9281. function is(value) {
  9282. var candidate = value;
  9283. return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range2.is(candidate.range);
  9284. }
  9285. TextEdit2.is = is;
  9286. })(TextEdit || (TextEdit = {}));
  9287. var ChangeAnnotation;
  9288. (function(ChangeAnnotation2) {
  9289. function create(label, needsConfirmation, description2) {
  9290. var result = {label};
  9291. if (needsConfirmation !== void 0) {
  9292. result.needsConfirmation = needsConfirmation;
  9293. }
  9294. if (description2 !== void 0) {
  9295. result.description = description2;
  9296. }
  9297. return result;
  9298. }
  9299. ChangeAnnotation2.create = create;
  9300. function is(value) {
  9301. var candidate = value;
  9302. return candidate !== void 0 && Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
  9303. }
  9304. ChangeAnnotation2.is = is;
  9305. })(ChangeAnnotation || (ChangeAnnotation = {}));
  9306. var ChangeAnnotationIdentifier;
  9307. (function(ChangeAnnotationIdentifier2) {
  9308. function is(value) {
  9309. var candidate = value;
  9310. return typeof candidate === "string";
  9311. }
  9312. ChangeAnnotationIdentifier2.is = is;
  9313. })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
  9314. var AnnotatedTextEdit;
  9315. (function(AnnotatedTextEdit2) {
  9316. function replace(range, newText, annotation) {
  9317. return {range, newText, annotationId: annotation};
  9318. }
  9319. AnnotatedTextEdit2.replace = replace;
  9320. function insert(position, newText, annotation) {
  9321. return {range: {start: position, end: position}, newText, annotationId: annotation};
  9322. }
  9323. AnnotatedTextEdit2.insert = insert;
  9324. function del(range, annotation) {
  9325. return {range, newText: "", annotationId: annotation};
  9326. }
  9327. AnnotatedTextEdit2.del = del;
  9328. function is(value) {
  9329. var candidate = value;
  9330. return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
  9331. }
  9332. AnnotatedTextEdit2.is = is;
  9333. })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
  9334. var TextDocumentEdit;
  9335. (function(TextDocumentEdit2) {
  9336. function create(textDocument, edits) {
  9337. return {textDocument, edits};
  9338. }
  9339. TextDocumentEdit2.create = create;
  9340. function is(value) {
  9341. var candidate = value;
  9342. return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
  9343. }
  9344. TextDocumentEdit2.is = is;
  9345. })(TextDocumentEdit || (TextDocumentEdit = {}));
  9346. var CreateFile;
  9347. (function(CreateFile2) {
  9348. function create(uri, options, annotation) {
  9349. var result = {
  9350. kind: "create",
  9351. uri
  9352. };
  9353. if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
  9354. result.options = options;
  9355. }
  9356. if (annotation !== void 0) {
  9357. result.annotationId = annotation;
  9358. }
  9359. return result;
  9360. }
  9361. CreateFile2.create = create;
  9362. function is(value) {
  9363. var candidate = value;
  9364. return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
  9365. }
  9366. CreateFile2.is = is;
  9367. })(CreateFile || (CreateFile = {}));
  9368. var RenameFile;
  9369. (function(RenameFile2) {
  9370. function create(oldUri, newUri, options, annotation) {
  9371. var result = {
  9372. kind: "rename",
  9373. oldUri,
  9374. newUri
  9375. };
  9376. if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
  9377. result.options = options;
  9378. }
  9379. if (annotation !== void 0) {
  9380. result.annotationId = annotation;
  9381. }
  9382. return result;
  9383. }
  9384. RenameFile2.create = create;
  9385. function is(value) {
  9386. var candidate = value;
  9387. return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
  9388. }
  9389. RenameFile2.is = is;
  9390. })(RenameFile || (RenameFile = {}));
  9391. var DeleteFile;
  9392. (function(DeleteFile2) {
  9393. function create(uri, options, annotation) {
  9394. var result = {
  9395. kind: "delete",
  9396. uri
  9397. };
  9398. if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
  9399. result.options = options;
  9400. }
  9401. if (annotation !== void 0) {
  9402. result.annotationId = annotation;
  9403. }
  9404. return result;
  9405. }
  9406. DeleteFile2.create = create;
  9407. function is(value) {
  9408. var candidate = value;
  9409. return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
  9410. }
  9411. DeleteFile2.is = is;
  9412. })(DeleteFile || (DeleteFile = {}));
  9413. var WorkspaceEdit;
  9414. (function(WorkspaceEdit2) {
  9415. function is(value) {
  9416. var candidate = value;
  9417. return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every(function(change) {
  9418. if (Is.string(change.kind)) {
  9419. return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
  9420. } else {
  9421. return TextDocumentEdit.is(change);
  9422. }
  9423. }));
  9424. }
  9425. WorkspaceEdit2.is = is;
  9426. })(WorkspaceEdit || (WorkspaceEdit = {}));
  9427. var TextEditChangeImpl = function() {
  9428. function TextEditChangeImpl2(edits, changeAnnotations) {
  9429. this.edits = edits;
  9430. this.changeAnnotations = changeAnnotations;
  9431. }
  9432. TextEditChangeImpl2.prototype.insert = function(position, newText, annotation) {
  9433. var edit;
  9434. var id;
  9435. if (annotation === void 0) {
  9436. edit = TextEdit.insert(position, newText);
  9437. } else if (ChangeAnnotationIdentifier.is(annotation)) {
  9438. id = annotation;
  9439. edit = AnnotatedTextEdit.insert(position, newText, annotation);
  9440. } else {
  9441. this.assertChangeAnnotations(this.changeAnnotations);
  9442. id = this.changeAnnotations.manage(annotation);
  9443. edit = AnnotatedTextEdit.insert(position, newText, id);
  9444. }
  9445. this.edits.push(edit);
  9446. if (id !== void 0) {
  9447. return id;
  9448. }
  9449. };
  9450. TextEditChangeImpl2.prototype.replace = function(range, newText, annotation) {
  9451. var edit;
  9452. var id;
  9453. if (annotation === void 0) {
  9454. edit = TextEdit.replace(range, newText);
  9455. } else if (ChangeAnnotationIdentifier.is(annotation)) {
  9456. id = annotation;
  9457. edit = AnnotatedTextEdit.replace(range, newText, annotation);
  9458. } else {
  9459. this.assertChangeAnnotations(this.changeAnnotations);
  9460. id = this.changeAnnotations.manage(annotation);
  9461. edit = AnnotatedTextEdit.replace(range, newText, id);
  9462. }
  9463. this.edits.push(edit);
  9464. if (id !== void 0) {
  9465. return id;
  9466. }
  9467. };
  9468. TextEditChangeImpl2.prototype.delete = function(range, annotation) {
  9469. var edit;
  9470. var id;
  9471. if (annotation === void 0) {
  9472. edit = TextEdit.del(range);
  9473. } else if (ChangeAnnotationIdentifier.is(annotation)) {
  9474. id = annotation;
  9475. edit = AnnotatedTextEdit.del(range, annotation);
  9476. } else {
  9477. this.assertChangeAnnotations(this.changeAnnotations);
  9478. id = this.changeAnnotations.manage(annotation);
  9479. edit = AnnotatedTextEdit.del(range, id);
  9480. }
  9481. this.edits.push(edit);
  9482. if (id !== void 0) {
  9483. return id;
  9484. }
  9485. };
  9486. TextEditChangeImpl2.prototype.add = function(edit) {
  9487. this.edits.push(edit);
  9488. };
  9489. TextEditChangeImpl2.prototype.all = function() {
  9490. return this.edits;
  9491. };
  9492. TextEditChangeImpl2.prototype.clear = function() {
  9493. this.edits.splice(0, this.edits.length);
  9494. };
  9495. TextEditChangeImpl2.prototype.assertChangeAnnotations = function(value) {
  9496. if (value === void 0) {
  9497. throw new Error("Text edit change is not configured to manage change annotations.");
  9498. }
  9499. };
  9500. return TextEditChangeImpl2;
  9501. }();
  9502. var ChangeAnnotations = function() {
  9503. function ChangeAnnotations2(annotations) {
  9504. this._annotations = annotations === void 0 ? /* @__PURE__ */ Object.create(null) : annotations;
  9505. this._counter = 0;
  9506. this._size = 0;
  9507. }
  9508. ChangeAnnotations2.prototype.all = function() {
  9509. return this._annotations;
  9510. };
  9511. Object.defineProperty(ChangeAnnotations2.prototype, "size", {
  9512. get: function() {
  9513. return this._size;
  9514. },
  9515. enumerable: false,
  9516. configurable: true
  9517. });
  9518. ChangeAnnotations2.prototype.manage = function(idOrAnnotation, annotation) {
  9519. var id;
  9520. if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
  9521. id = idOrAnnotation;
  9522. } else {
  9523. id = this.nextId();
  9524. annotation = idOrAnnotation;
  9525. }
  9526. if (this._annotations[id] !== void 0) {
  9527. throw new Error("Id " + id + " is already in use.");
  9528. }
  9529. if (annotation === void 0) {
  9530. throw new Error("No annotation provided for id " + id);
  9531. }
  9532. this._annotations[id] = annotation;
  9533. this._size++;
  9534. return id;
  9535. };
  9536. ChangeAnnotations2.prototype.nextId = function() {
  9537. this._counter++;
  9538. return this._counter.toString();
  9539. };
  9540. return ChangeAnnotations2;
  9541. }();
  9542. var WorkspaceChange = function() {
  9543. function WorkspaceChange2(workspaceEdit) {
  9544. var _this = this;
  9545. this._textEditChanges = /* @__PURE__ */ Object.create(null);
  9546. if (workspaceEdit !== void 0) {
  9547. this._workspaceEdit = workspaceEdit;
  9548. if (workspaceEdit.documentChanges) {
  9549. this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
  9550. workspaceEdit.changeAnnotations = this._changeAnnotations.all();
  9551. workspaceEdit.documentChanges.forEach(function(change) {
  9552. if (TextDocumentEdit.is(change)) {
  9553. var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
  9554. _this._textEditChanges[change.textDocument.uri] = textEditChange;
  9555. }
  9556. });
  9557. } else if (workspaceEdit.changes) {
  9558. Object.keys(workspaceEdit.changes).forEach(function(key) {
  9559. var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
  9560. _this._textEditChanges[key] = textEditChange;
  9561. });
  9562. }
  9563. } else {
  9564. this._workspaceEdit = {};
  9565. }
  9566. }
  9567. Object.defineProperty(WorkspaceChange2.prototype, "edit", {
  9568. get: function() {
  9569. this.initDocumentChanges();
  9570. if (this._changeAnnotations !== void 0) {
  9571. if (this._changeAnnotations.size === 0) {
  9572. this._workspaceEdit.changeAnnotations = void 0;
  9573. } else {
  9574. this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
  9575. }
  9576. }
  9577. return this._workspaceEdit;
  9578. },
  9579. enumerable: false,
  9580. configurable: true
  9581. });
  9582. WorkspaceChange2.prototype.getTextEditChange = function(key) {
  9583. if (OptionalVersionedTextDocumentIdentifier.is(key)) {
  9584. this.initDocumentChanges();
  9585. if (this._workspaceEdit.documentChanges === void 0) {
  9586. throw new Error("Workspace edit is not configured for document changes.");
  9587. }
  9588. var textDocument = {uri: key.uri, version: key.version};
  9589. var result = this._textEditChanges[textDocument.uri];
  9590. if (!result) {
  9591. var edits = [];
  9592. var textDocumentEdit = {
  9593. textDocument,
  9594. edits
  9595. };
  9596. this._workspaceEdit.documentChanges.push(textDocumentEdit);
  9597. result = new TextEditChangeImpl(edits, this._changeAnnotations);
  9598. this._textEditChanges[textDocument.uri] = result;
  9599. }
  9600. return result;
  9601. } else {
  9602. this.initChanges();
  9603. if (this._workspaceEdit.changes === void 0) {
  9604. throw new Error("Workspace edit is not configured for normal text edit changes.");
  9605. }
  9606. var result = this._textEditChanges[key];
  9607. if (!result) {
  9608. var edits = [];
  9609. this._workspaceEdit.changes[key] = edits;
  9610. result = new TextEditChangeImpl(edits);
  9611. this._textEditChanges[key] = result;
  9612. }
  9613. return result;
  9614. }
  9615. };
  9616. WorkspaceChange2.prototype.initDocumentChanges = function() {
  9617. if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
  9618. this._changeAnnotations = new ChangeAnnotations();
  9619. this._workspaceEdit.documentChanges = [];
  9620. this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
  9621. }
  9622. };
  9623. WorkspaceChange2.prototype.initChanges = function() {
  9624. if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
  9625. this._workspaceEdit.changes = /* @__PURE__ */ Object.create(null);
  9626. }
  9627. };
  9628. WorkspaceChange2.prototype.createFile = function(uri, optionsOrAnnotation, options) {
  9629. this.initDocumentChanges();
  9630. if (this._workspaceEdit.documentChanges === void 0) {
  9631. throw new Error("Workspace edit is not configured for document changes.");
  9632. }
  9633. var annotation;
  9634. if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
  9635. annotation = optionsOrAnnotation;
  9636. } else {
  9637. options = optionsOrAnnotation;
  9638. }
  9639. var operation;
  9640. var id;
  9641. if (annotation === void 0) {
  9642. operation = CreateFile.create(uri, options);
  9643. } else {
  9644. id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
  9645. operation = CreateFile.create(uri, options, id);
  9646. }
  9647. this._workspaceEdit.documentChanges.push(operation);
  9648. if (id !== void 0) {
  9649. return id;
  9650. }
  9651. };
  9652. WorkspaceChange2.prototype.renameFile = function(oldUri, newUri, optionsOrAnnotation, options) {
  9653. this.initDocumentChanges();
  9654. if (this._workspaceEdit.documentChanges === void 0) {
  9655. throw new Error("Workspace edit is not configured for document changes.");
  9656. }
  9657. var annotation;
  9658. if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
  9659. annotation = optionsOrAnnotation;
  9660. } else {
  9661. options = optionsOrAnnotation;
  9662. }
  9663. var operation;
  9664. var id;
  9665. if (annotation === void 0) {
  9666. operation = RenameFile.create(oldUri, newUri, options);
  9667. } else {
  9668. id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
  9669. operation = RenameFile.create(oldUri, newUri, options, id);
  9670. }
  9671. this._workspaceEdit.documentChanges.push(operation);
  9672. if (id !== void 0) {
  9673. return id;
  9674. }
  9675. };
  9676. WorkspaceChange2.prototype.deleteFile = function(uri, optionsOrAnnotation, options) {
  9677. this.initDocumentChanges();
  9678. if (this._workspaceEdit.documentChanges === void 0) {
  9679. throw new Error("Workspace edit is not configured for document changes.");
  9680. }
  9681. var annotation;
  9682. if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
  9683. annotation = optionsOrAnnotation;
  9684. } else {
  9685. options = optionsOrAnnotation;
  9686. }
  9687. var operation;
  9688. var id;
  9689. if (annotation === void 0) {
  9690. operation = DeleteFile.create(uri, options);
  9691. } else {
  9692. id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
  9693. operation = DeleteFile.create(uri, options, id);
  9694. }
  9695. this._workspaceEdit.documentChanges.push(operation);
  9696. if (id !== void 0) {
  9697. return id;
  9698. }
  9699. };
  9700. return WorkspaceChange2;
  9701. }();
  9702. var TextDocumentIdentifier;
  9703. (function(TextDocumentIdentifier2) {
  9704. function create(uri) {
  9705. return {uri};
  9706. }
  9707. TextDocumentIdentifier2.create = create;
  9708. function is(value) {
  9709. var candidate = value;
  9710. return Is.defined(candidate) && Is.string(candidate.uri);
  9711. }
  9712. TextDocumentIdentifier2.is = is;
  9713. })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
  9714. var VersionedTextDocumentIdentifier;
  9715. (function(VersionedTextDocumentIdentifier2) {
  9716. function create(uri, version) {
  9717. return {uri, version};
  9718. }
  9719. VersionedTextDocumentIdentifier2.create = create;
  9720. function is(value) {
  9721. var candidate = value;
  9722. return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
  9723. }
  9724. VersionedTextDocumentIdentifier2.is = is;
  9725. })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
  9726. var OptionalVersionedTextDocumentIdentifier;
  9727. (function(OptionalVersionedTextDocumentIdentifier2) {
  9728. function create(uri, version) {
  9729. return {uri, version};
  9730. }
  9731. OptionalVersionedTextDocumentIdentifier2.create = create;
  9732. function is(value) {
  9733. var candidate = value;
  9734. return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
  9735. }
  9736. OptionalVersionedTextDocumentIdentifier2.is = is;
  9737. })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
  9738. var TextDocumentItem;
  9739. (function(TextDocumentItem2) {
  9740. function create(uri, languageId, version, text) {
  9741. return {uri, languageId, version, text};
  9742. }
  9743. TextDocumentItem2.create = create;
  9744. function is(value) {
  9745. var candidate = value;
  9746. return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
  9747. }
  9748. TextDocumentItem2.is = is;
  9749. })(TextDocumentItem || (TextDocumentItem = {}));
  9750. var MarkupKind;
  9751. (function(MarkupKind2) {
  9752. MarkupKind2.PlainText = "plaintext";
  9753. MarkupKind2.Markdown = "markdown";
  9754. })(MarkupKind || (MarkupKind = {}));
  9755. (function(MarkupKind2) {
  9756. function is(value) {
  9757. var candidate = value;
  9758. return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;
  9759. }
  9760. MarkupKind2.is = is;
  9761. })(MarkupKind || (MarkupKind = {}));
  9762. var MarkupContent;
  9763. (function(MarkupContent2) {
  9764. function is(value) {
  9765. var candidate = value;
  9766. return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
  9767. }
  9768. MarkupContent2.is = is;
  9769. })(MarkupContent || (MarkupContent = {}));
  9770. var CompletionItemKind2;
  9771. (function(CompletionItemKind22) {
  9772. CompletionItemKind22.Text = 1;
  9773. CompletionItemKind22.Method = 2;
  9774. CompletionItemKind22.Function = 3;
  9775. CompletionItemKind22.Constructor = 4;
  9776. CompletionItemKind22.Field = 5;
  9777. CompletionItemKind22.Variable = 6;
  9778. CompletionItemKind22.Class = 7;
  9779. CompletionItemKind22.Interface = 8;
  9780. CompletionItemKind22.Module = 9;
  9781. CompletionItemKind22.Property = 10;
  9782. CompletionItemKind22.Unit = 11;
  9783. CompletionItemKind22.Value = 12;
  9784. CompletionItemKind22.Enum = 13;
  9785. CompletionItemKind22.Keyword = 14;
  9786. CompletionItemKind22.Snippet = 15;
  9787. CompletionItemKind22.Color = 16;
  9788. CompletionItemKind22.File = 17;
  9789. CompletionItemKind22.Reference = 18;
  9790. CompletionItemKind22.Folder = 19;
  9791. CompletionItemKind22.EnumMember = 20;
  9792. CompletionItemKind22.Constant = 21;
  9793. CompletionItemKind22.Struct = 22;
  9794. CompletionItemKind22.Event = 23;
  9795. CompletionItemKind22.Operator = 24;
  9796. CompletionItemKind22.TypeParameter = 25;
  9797. })(CompletionItemKind2 || (CompletionItemKind2 = {}));
  9798. var InsertTextFormat;
  9799. (function(InsertTextFormat2) {
  9800. InsertTextFormat2.PlainText = 1;
  9801. InsertTextFormat2.Snippet = 2;
  9802. })(InsertTextFormat || (InsertTextFormat = {}));
  9803. var CompletionItemTag2;
  9804. (function(CompletionItemTag22) {
  9805. CompletionItemTag22.Deprecated = 1;
  9806. })(CompletionItemTag2 || (CompletionItemTag2 = {}));
  9807. var InsertReplaceEdit;
  9808. (function(InsertReplaceEdit2) {
  9809. function create(newText, insert, replace) {
  9810. return {newText, insert, replace};
  9811. }
  9812. InsertReplaceEdit2.create = create;
  9813. function is(value) {
  9814. var candidate = value;
  9815. return candidate && Is.string(candidate.newText) && Range2.is(candidate.insert) && Range2.is(candidate.replace);
  9816. }
  9817. InsertReplaceEdit2.is = is;
  9818. })(InsertReplaceEdit || (InsertReplaceEdit = {}));
  9819. var InsertTextMode;
  9820. (function(InsertTextMode2) {
  9821. InsertTextMode2.asIs = 1;
  9822. InsertTextMode2.adjustIndentation = 2;
  9823. })(InsertTextMode || (InsertTextMode = {}));
  9824. var CompletionItem;
  9825. (function(CompletionItem2) {
  9826. function create(label) {
  9827. return {label};
  9828. }
  9829. CompletionItem2.create = create;
  9830. })(CompletionItem || (CompletionItem = {}));
  9831. var CompletionList;
  9832. (function(CompletionList2) {
  9833. function create(items, isIncomplete) {
  9834. return {items: items ? items : [], isIncomplete: !!isIncomplete};
  9835. }
  9836. CompletionList2.create = create;
  9837. })(CompletionList || (CompletionList = {}));
  9838. var MarkedString;
  9839. (function(MarkedString2) {
  9840. function fromPlainText(plainText) {
  9841. return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
  9842. }
  9843. MarkedString2.fromPlainText = fromPlainText;
  9844. function is(value) {
  9845. var candidate = value;
  9846. return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
  9847. }
  9848. MarkedString2.is = is;
  9849. })(MarkedString || (MarkedString = {}));
  9850. var Hover;
  9851. (function(Hover2) {
  9852. function is(value) {
  9853. var candidate = value;
  9854. return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range2.is(value.range));
  9855. }
  9856. Hover2.is = is;
  9857. })(Hover || (Hover = {}));
  9858. var ParameterInformation;
  9859. (function(ParameterInformation2) {
  9860. function create(label, documentation) {
  9861. return documentation ? {label, documentation} : {label};
  9862. }
  9863. ParameterInformation2.create = create;
  9864. })(ParameterInformation || (ParameterInformation = {}));
  9865. var SignatureInformation;
  9866. (function(SignatureInformation2) {
  9867. function create(label, documentation) {
  9868. var parameters = [];
  9869. for (var _i = 2; _i < arguments.length; _i++) {
  9870. parameters[_i - 2] = arguments[_i];
  9871. }
  9872. var result = {label};
  9873. if (Is.defined(documentation)) {
  9874. result.documentation = documentation;
  9875. }
  9876. if (Is.defined(parameters)) {
  9877. result.parameters = parameters;
  9878. } else {
  9879. result.parameters = [];
  9880. }
  9881. return result;
  9882. }
  9883. SignatureInformation2.create = create;
  9884. })(SignatureInformation || (SignatureInformation = {}));
  9885. var DocumentHighlightKind3;
  9886. (function(DocumentHighlightKind22) {
  9887. DocumentHighlightKind22.Text = 1;
  9888. DocumentHighlightKind22.Read = 2;
  9889. DocumentHighlightKind22.Write = 3;
  9890. })(DocumentHighlightKind3 || (DocumentHighlightKind3 = {}));
  9891. var DocumentHighlight;
  9892. (function(DocumentHighlight2) {
  9893. function create(range, kind) {
  9894. var result = {range};
  9895. if (Is.number(kind)) {
  9896. result.kind = kind;
  9897. }
  9898. return result;
  9899. }
  9900. DocumentHighlight2.create = create;
  9901. })(DocumentHighlight || (DocumentHighlight = {}));
  9902. var SymbolKind2;
  9903. (function(SymbolKind22) {
  9904. SymbolKind22.File = 1;
  9905. SymbolKind22.Module = 2;
  9906. SymbolKind22.Namespace = 3;
  9907. SymbolKind22.Package = 4;
  9908. SymbolKind22.Class = 5;
  9909. SymbolKind22.Method = 6;
  9910. SymbolKind22.Property = 7;
  9911. SymbolKind22.Field = 8;
  9912. SymbolKind22.Constructor = 9;
  9913. SymbolKind22.Enum = 10;
  9914. SymbolKind22.Interface = 11;
  9915. SymbolKind22.Function = 12;
  9916. SymbolKind22.Variable = 13;
  9917. SymbolKind22.Constant = 14;
  9918. SymbolKind22.String = 15;
  9919. SymbolKind22.Number = 16;
  9920. SymbolKind22.Boolean = 17;
  9921. SymbolKind22.Array = 18;
  9922. SymbolKind22.Object = 19;
  9923. SymbolKind22.Key = 20;
  9924. SymbolKind22.Null = 21;
  9925. SymbolKind22.EnumMember = 22;
  9926. SymbolKind22.Struct = 23;
  9927. SymbolKind22.Event = 24;
  9928. SymbolKind22.Operator = 25;
  9929. SymbolKind22.TypeParameter = 26;
  9930. })(SymbolKind2 || (SymbolKind2 = {}));
  9931. var SymbolTag2;
  9932. (function(SymbolTag22) {
  9933. SymbolTag22.Deprecated = 1;
  9934. })(SymbolTag2 || (SymbolTag2 = {}));
  9935. var SymbolInformation;
  9936. (function(SymbolInformation2) {
  9937. function create(name, kind, range, uri, containerName) {
  9938. var result = {
  9939. name,
  9940. kind,
  9941. location: {uri, range}
  9942. };
  9943. if (containerName) {
  9944. result.containerName = containerName;
  9945. }
  9946. return result;
  9947. }
  9948. SymbolInformation2.create = create;
  9949. })(SymbolInformation || (SymbolInformation = {}));
  9950. var DocumentSymbol;
  9951. (function(DocumentSymbol2) {
  9952. function create(name, detail, kind, range, selectionRange, children) {
  9953. var result = {
  9954. name,
  9955. detail,
  9956. kind,
  9957. range,
  9958. selectionRange
  9959. };
  9960. if (children !== void 0) {
  9961. result.children = children;
  9962. }
  9963. return result;
  9964. }
  9965. DocumentSymbol2.create = create;
  9966. function is(value) {
  9967. var candidate = value;
  9968. return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range2.is(candidate.range) && Range2.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags));
  9969. }
  9970. DocumentSymbol2.is = is;
  9971. })(DocumentSymbol || (DocumentSymbol = {}));
  9972. var CodeActionKind;
  9973. (function(CodeActionKind2) {
  9974. CodeActionKind2.Empty = "";
  9975. CodeActionKind2.QuickFix = "quickfix";
  9976. CodeActionKind2.Refactor = "refactor";
  9977. CodeActionKind2.RefactorExtract = "refactor.extract";
  9978. CodeActionKind2.RefactorInline = "refactor.inline";
  9979. CodeActionKind2.RefactorRewrite = "refactor.rewrite";
  9980. CodeActionKind2.Source = "source";
  9981. CodeActionKind2.SourceOrganizeImports = "source.organizeImports";
  9982. CodeActionKind2.SourceFixAll = "source.fixAll";
  9983. })(CodeActionKind || (CodeActionKind = {}));
  9984. var CodeActionContext;
  9985. (function(CodeActionContext2) {
  9986. function create(diagnostics, only) {
  9987. var result = {diagnostics};
  9988. if (only !== void 0 && only !== null) {
  9989. result.only = only;
  9990. }
  9991. return result;
  9992. }
  9993. CodeActionContext2.create = create;
  9994. function is(value) {
  9995. var candidate = value;
  9996. return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));
  9997. }
  9998. CodeActionContext2.is = is;
  9999. })(CodeActionContext || (CodeActionContext = {}));
  10000. var CodeAction;
  10001. (function(CodeAction2) {
  10002. function create(title, kindOrCommandOrEdit, kind) {
  10003. var result = {title};
  10004. var checkKind = true;
  10005. if (typeof kindOrCommandOrEdit === "string") {
  10006. checkKind = false;
  10007. result.kind = kindOrCommandOrEdit;
  10008. } else if (Command2.is(kindOrCommandOrEdit)) {
  10009. result.command = kindOrCommandOrEdit;
  10010. } else {
  10011. result.edit = kindOrCommandOrEdit;
  10012. }
  10013. if (checkKind && kind !== void 0) {
  10014. result.kind = kind;
  10015. }
  10016. return result;
  10017. }
  10018. CodeAction2.create = create;
  10019. function is(value) {
  10020. var candidate = value;
  10021. return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command2.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
  10022. }
  10023. CodeAction2.is = is;
  10024. })(CodeAction || (CodeAction = {}));
  10025. var CodeLens;
  10026. (function(CodeLens2) {
  10027. function create(range, data) {
  10028. var result = {range};
  10029. if (Is.defined(data)) {
  10030. result.data = data;
  10031. }
  10032. return result;
  10033. }
  10034. CodeLens2.create = create;
  10035. function is(value) {
  10036. var candidate = value;
  10037. return Is.defined(candidate) && Range2.is(candidate.range) && (Is.undefined(candidate.command) || Command2.is(candidate.command));
  10038. }
  10039. CodeLens2.is = is;
  10040. })(CodeLens || (CodeLens = {}));
  10041. var FormattingOptions;
  10042. (function(FormattingOptions2) {
  10043. function create(tabSize, insertSpaces) {
  10044. return {tabSize, insertSpaces};
  10045. }
  10046. FormattingOptions2.create = create;
  10047. function is(value) {
  10048. var candidate = value;
  10049. return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
  10050. }
  10051. FormattingOptions2.is = is;
  10052. })(FormattingOptions || (FormattingOptions = {}));
  10053. var DocumentLink;
  10054. (function(DocumentLink2) {
  10055. function create(range, target, data) {
  10056. return {range, target, data};
  10057. }
  10058. DocumentLink2.create = create;
  10059. function is(value) {
  10060. var candidate = value;
  10061. return Is.defined(candidate) && Range2.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
  10062. }
  10063. DocumentLink2.is = is;
  10064. })(DocumentLink || (DocumentLink = {}));
  10065. var SelectionRange;
  10066. (function(SelectionRange2) {
  10067. function create(range, parent) {
  10068. return {range, parent};
  10069. }
  10070. SelectionRange2.create = create;
  10071. function is(value) {
  10072. var candidate = value;
  10073. return candidate !== void 0 && Range2.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
  10074. }
  10075. SelectionRange2.is = is;
  10076. })(SelectionRange || (SelectionRange = {}));
  10077. var TextDocument;
  10078. (function(TextDocument3) {
  10079. function create(uri, languageId, version, content) {
  10080. return new FullTextDocument(uri, languageId, version, content);
  10081. }
  10082. TextDocument3.create = create;
  10083. function is(value) {
  10084. var candidate = value;
  10085. return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
  10086. }
  10087. TextDocument3.is = is;
  10088. function applyEdits(document, edits) {
  10089. var text = document.getText();
  10090. var sortedEdits = mergeSort2(edits, function(a2, b) {
  10091. var diff = a2.range.start.line - b.range.start.line;
  10092. if (diff === 0) {
  10093. return a2.range.start.character - b.range.start.character;
  10094. }
  10095. return diff;
  10096. });
  10097. var lastModifiedOffset = text.length;
  10098. for (var i = sortedEdits.length - 1; i >= 0; i--) {
  10099. var e = sortedEdits[i];
  10100. var startOffset = document.offsetAt(e.range.start);
  10101. var endOffset = document.offsetAt(e.range.end);
  10102. if (endOffset <= lastModifiedOffset) {
  10103. text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
  10104. } else {
  10105. throw new Error("Overlapping edit");
  10106. }
  10107. lastModifiedOffset = startOffset;
  10108. }
  10109. return text;
  10110. }
  10111. TextDocument3.applyEdits = applyEdits;
  10112. function mergeSort2(data, compare) {
  10113. if (data.length <= 1) {
  10114. return data;
  10115. }
  10116. var p = data.length / 2 | 0;
  10117. var left = data.slice(0, p);
  10118. var right = data.slice(p);
  10119. mergeSort2(left, compare);
  10120. mergeSort2(right, compare);
  10121. var leftIdx = 0;
  10122. var rightIdx = 0;
  10123. var i = 0;
  10124. while (leftIdx < left.length && rightIdx < right.length) {
  10125. var ret = compare(left[leftIdx], right[rightIdx]);
  10126. if (ret <= 0) {
  10127. data[i++] = left[leftIdx++];
  10128. } else {
  10129. data[i++] = right[rightIdx++];
  10130. }
  10131. }
  10132. while (leftIdx < left.length) {
  10133. data[i++] = left[leftIdx++];
  10134. }
  10135. while (rightIdx < right.length) {
  10136. data[i++] = right[rightIdx++];
  10137. }
  10138. return data;
  10139. }
  10140. })(TextDocument || (TextDocument = {}));
  10141. var FullTextDocument = function() {
  10142. function FullTextDocument3(uri, languageId, version, content) {
  10143. this._uri = uri;
  10144. this._languageId = languageId;
  10145. this._version = version;
  10146. this._content = content;
  10147. this._lineOffsets = void 0;
  10148. }
  10149. Object.defineProperty(FullTextDocument3.prototype, "uri", {
  10150. get: function() {
  10151. return this._uri;
  10152. },
  10153. enumerable: false,
  10154. configurable: true
  10155. });
  10156. Object.defineProperty(FullTextDocument3.prototype, "languageId", {
  10157. get: function() {
  10158. return this._languageId;
  10159. },
  10160. enumerable: false,
  10161. configurable: true
  10162. });
  10163. Object.defineProperty(FullTextDocument3.prototype, "version", {
  10164. get: function() {
  10165. return this._version;
  10166. },
  10167. enumerable: false,
  10168. configurable: true
  10169. });
  10170. FullTextDocument3.prototype.getText = function(range) {
  10171. if (range) {
  10172. var start = this.offsetAt(range.start);
  10173. var end = this.offsetAt(range.end);
  10174. return this._content.substring(start, end);
  10175. }
  10176. return this._content;
  10177. };
  10178. FullTextDocument3.prototype.update = function(event, version) {
  10179. this._content = event.text;
  10180. this._version = version;
  10181. this._lineOffsets = void 0;
  10182. };
  10183. FullTextDocument3.prototype.getLineOffsets = function() {
  10184. if (this._lineOffsets === void 0) {
  10185. var lineOffsets = [];
  10186. var text = this._content;
  10187. var isLineStart = true;
  10188. for (var i = 0; i < text.length; i++) {
  10189. if (isLineStart) {
  10190. lineOffsets.push(i);
  10191. isLineStart = false;
  10192. }
  10193. var ch = text.charAt(i);
  10194. isLineStart = ch === "\r" || ch === "\n";
  10195. if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") {
  10196. i++;
  10197. }
  10198. }
  10199. if (isLineStart && text.length > 0) {
  10200. lineOffsets.push(text.length);
  10201. }
  10202. this._lineOffsets = lineOffsets;
  10203. }
  10204. return this._lineOffsets;
  10205. };
  10206. FullTextDocument3.prototype.positionAt = function(offset) {
  10207. offset = Math.max(Math.min(offset, this._content.length), 0);
  10208. var lineOffsets = this.getLineOffsets();
  10209. var low = 0, high = lineOffsets.length;
  10210. if (high === 0) {
  10211. return Position2.create(0, offset);
  10212. }
  10213. while (low < high) {
  10214. var mid = Math.floor((low + high) / 2);
  10215. if (lineOffsets[mid] > offset) {
  10216. high = mid;
  10217. } else {
  10218. low = mid + 1;
  10219. }
  10220. }
  10221. var line = low - 1;
  10222. return Position2.create(line, offset - lineOffsets[line]);
  10223. };
  10224. FullTextDocument3.prototype.offsetAt = function(position) {
  10225. var lineOffsets = this.getLineOffsets();
  10226. if (position.line >= lineOffsets.length) {
  10227. return this._content.length;
  10228. } else if (position.line < 0) {
  10229. return 0;
  10230. }
  10231. var lineOffset = lineOffsets[position.line];
  10232. var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
  10233. return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
  10234. };
  10235. Object.defineProperty(FullTextDocument3.prototype, "lineCount", {
  10236. get: function() {
  10237. return this.getLineOffsets().length;
  10238. },
  10239. enumerable: false,
  10240. configurable: true
  10241. });
  10242. return FullTextDocument3;
  10243. }();
  10244. var Is;
  10245. (function(Is2) {
  10246. var toString = Object.prototype.toString;
  10247. function defined(value) {
  10248. return typeof value !== "undefined";
  10249. }
  10250. Is2.defined = defined;
  10251. function undefined2(value) {
  10252. return typeof value === "undefined";
  10253. }
  10254. Is2.undefined = undefined2;
  10255. function boolean(value) {
  10256. return value === true || value === false;
  10257. }
  10258. Is2.boolean = boolean;
  10259. function string(value) {
  10260. return toString.call(value) === "[object String]";
  10261. }
  10262. Is2.string = string;
  10263. function number(value) {
  10264. return toString.call(value) === "[object Number]";
  10265. }
  10266. Is2.number = number;
  10267. function numberRange(value, min, max) {
  10268. return toString.call(value) === "[object Number]" && min <= value && value <= max;
  10269. }
  10270. Is2.numberRange = numberRange;
  10271. function integer2(value) {
  10272. return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
  10273. }
  10274. Is2.integer = integer2;
  10275. function uinteger2(value) {
  10276. return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
  10277. }
  10278. Is2.uinteger = uinteger2;
  10279. function func(value) {
  10280. return toString.call(value) === "[object Function]";
  10281. }
  10282. Is2.func = func;
  10283. function objectLiteral(value) {
  10284. return value !== null && typeof value === "object";
  10285. }
  10286. Is2.objectLiteral = objectLiteral;
  10287. function typedArray(value, check) {
  10288. return Array.isArray(value) && value.every(check);
  10289. }
  10290. Is2.typedArray = typedArray;
  10291. })(Is || (Is = {}));
  10292. var FullTextDocument2 = class {
  10293. constructor(uri, languageId, version, content) {
  10294. this._uri = uri;
  10295. this._languageId = languageId;
  10296. this._version = version;
  10297. this._content = content;
  10298. this._lineOffsets = void 0;
  10299. }
  10300. get uri() {
  10301. return this._uri;
  10302. }
  10303. get languageId() {
  10304. return this._languageId;
  10305. }
  10306. get version() {
  10307. return this._version;
  10308. }
  10309. getText(range) {
  10310. if (range) {
  10311. const start = this.offsetAt(range.start);
  10312. const end = this.offsetAt(range.end);
  10313. return this._content.substring(start, end);
  10314. }
  10315. return this._content;
  10316. }
  10317. update(changes, version) {
  10318. for (let change of changes) {
  10319. if (FullTextDocument2.isIncremental(change)) {
  10320. const range = getWellformedRange(change.range);
  10321. const startOffset = this.offsetAt(range.start);
  10322. const endOffset = this.offsetAt(range.end);
  10323. this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length);
  10324. const startLine = Math.max(range.start.line, 0);
  10325. const endLine = Math.max(range.end.line, 0);
  10326. let lineOffsets = this._lineOffsets;
  10327. const addedLineOffsets = computeLineOffsets(change.text, false, startOffset);
  10328. if (endLine - startLine === addedLineOffsets.length) {
  10329. for (let i = 0, len = addedLineOffsets.length; i < len; i++) {
  10330. lineOffsets[i + startLine + 1] = addedLineOffsets[i];
  10331. }
  10332. } else {
  10333. if (addedLineOffsets.length < 1e4) {
  10334. lineOffsets.splice(startLine + 1, endLine - startLine, ...addedLineOffsets);
  10335. } else {
  10336. this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1));
  10337. }
  10338. }
  10339. const diff = change.text.length - (endOffset - startOffset);
  10340. if (diff !== 0) {
  10341. for (let i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) {
  10342. lineOffsets[i] = lineOffsets[i] + diff;
  10343. }
  10344. }
  10345. } else if (FullTextDocument2.isFull(change)) {
  10346. this._content = change.text;
  10347. this._lineOffsets = void 0;
  10348. } else {
  10349. throw new Error("Unknown change event received");
  10350. }
  10351. }
  10352. this._version = version;
  10353. }
  10354. getLineOffsets() {
  10355. if (this._lineOffsets === void 0) {
  10356. this._lineOffsets = computeLineOffsets(this._content, true);
  10357. }
  10358. return this._lineOffsets;
  10359. }
  10360. positionAt(offset) {
  10361. offset = Math.max(Math.min(offset, this._content.length), 0);
  10362. let lineOffsets = this.getLineOffsets();
  10363. let low = 0, high = lineOffsets.length;
  10364. if (high === 0) {
  10365. return {line: 0, character: offset};
  10366. }
  10367. while (low < high) {
  10368. let mid = Math.floor((low + high) / 2);
  10369. if (lineOffsets[mid] > offset) {
  10370. high = mid;
  10371. } else {
  10372. low = mid + 1;
  10373. }
  10374. }
  10375. let line = low - 1;
  10376. return {line, character: offset - lineOffsets[line]};
  10377. }
  10378. offsetAt(position) {
  10379. let lineOffsets = this.getLineOffsets();
  10380. if (position.line >= lineOffsets.length) {
  10381. return this._content.length;
  10382. } else if (position.line < 0) {
  10383. return 0;
  10384. }
  10385. let lineOffset = lineOffsets[position.line];
  10386. let nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
  10387. return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
  10388. }
  10389. get lineCount() {
  10390. return this.getLineOffsets().length;
  10391. }
  10392. static isIncremental(event) {
  10393. let candidate = event;
  10394. return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number");
  10395. }
  10396. static isFull(event) {
  10397. let candidate = event;
  10398. return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0;
  10399. }
  10400. };
  10401. var TextDocument2;
  10402. (function(TextDocument3) {
  10403. function create(uri, languageId, version, content) {
  10404. return new FullTextDocument2(uri, languageId, version, content);
  10405. }
  10406. TextDocument3.create = create;
  10407. function update(document, changes, version) {
  10408. if (document instanceof FullTextDocument2) {
  10409. document.update(changes, version);
  10410. return document;
  10411. } else {
  10412. throw new Error("TextDocument.update: document must be created by TextDocument.create");
  10413. }
  10414. }
  10415. TextDocument3.update = update;
  10416. function applyEdits(document, edits) {
  10417. let text = document.getText();
  10418. let sortedEdits = mergeSort(edits.map(getWellformedEdit), (a2, b) => {
  10419. let diff = a2.range.start.line - b.range.start.line;
  10420. if (diff === 0) {
  10421. return a2.range.start.character - b.range.start.character;
  10422. }
  10423. return diff;
  10424. });
  10425. let lastModifiedOffset = 0;
  10426. const spans = [];
  10427. for (const e of sortedEdits) {
  10428. let startOffset = document.offsetAt(e.range.start);
  10429. if (startOffset < lastModifiedOffset) {
  10430. throw new Error("Overlapping edit");
  10431. } else if (startOffset > lastModifiedOffset) {
  10432. spans.push(text.substring(lastModifiedOffset, startOffset));
  10433. }
  10434. if (e.newText.length) {
  10435. spans.push(e.newText);
  10436. }
  10437. lastModifiedOffset = document.offsetAt(e.range.end);
  10438. }
  10439. spans.push(text.substr(lastModifiedOffset));
  10440. return spans.join("");
  10441. }
  10442. TextDocument3.applyEdits = applyEdits;
  10443. })(TextDocument2 || (TextDocument2 = {}));
  10444. function mergeSort(data, compare) {
  10445. if (data.length <= 1) {
  10446. return data;
  10447. }
  10448. const p = data.length / 2 | 0;
  10449. const left = data.slice(0, p);
  10450. const right = data.slice(p);
  10451. mergeSort(left, compare);
  10452. mergeSort(right, compare);
  10453. let leftIdx = 0;
  10454. let rightIdx = 0;
  10455. let i = 0;
  10456. while (leftIdx < left.length && rightIdx < right.length) {
  10457. let ret = compare(left[leftIdx], right[rightIdx]);
  10458. if (ret <= 0) {
  10459. data[i++] = left[leftIdx++];
  10460. } else {
  10461. data[i++] = right[rightIdx++];
  10462. }
  10463. }
  10464. while (leftIdx < left.length) {
  10465. data[i++] = left[leftIdx++];
  10466. }
  10467. while (rightIdx < right.length) {
  10468. data[i++] = right[rightIdx++];
  10469. }
  10470. return data;
  10471. }
  10472. function computeLineOffsets(text, isAtLineStart, textOffset = 0) {
  10473. const result = isAtLineStart ? [textOffset] : [];
  10474. for (let i = 0; i < text.length; i++) {
  10475. let ch = text.charCodeAt(i);
  10476. if (ch === 13 || ch === 10) {
  10477. if (ch === 13 && i + 1 < text.length && text.charCodeAt(i + 1) === 10) {
  10478. i++;
  10479. }
  10480. result.push(textOffset + i + 1);
  10481. }
  10482. }
  10483. return result;
  10484. }
  10485. function getWellformedRange(range) {
  10486. const start = range.start;
  10487. const end = range.end;
  10488. if (start.line > end.line || start.line === end.line && start.character > end.character) {
  10489. return {start: end, end: start};
  10490. }
  10491. return range;
  10492. }
  10493. function getWellformedEdit(textEdit) {
  10494. const range = getWellformedRange(textEdit.range);
  10495. if (range !== textEdit.range) {
  10496. return {newText: textEdit.newText, range};
  10497. }
  10498. return textEdit;
  10499. }
  10500. var ErrorCode;
  10501. (function(ErrorCode2) {
  10502. ErrorCode2[ErrorCode2["Undefined"] = 0] = "Undefined";
  10503. ErrorCode2[ErrorCode2["EnumValueMismatch"] = 1] = "EnumValueMismatch";
  10504. ErrorCode2[ErrorCode2["Deprecated"] = 2] = "Deprecated";
  10505. ErrorCode2[ErrorCode2["UnexpectedEndOfComment"] = 257] = "UnexpectedEndOfComment";
  10506. ErrorCode2[ErrorCode2["UnexpectedEndOfString"] = 258] = "UnexpectedEndOfString";
  10507. ErrorCode2[ErrorCode2["UnexpectedEndOfNumber"] = 259] = "UnexpectedEndOfNumber";
  10508. ErrorCode2[ErrorCode2["InvalidUnicode"] = 260] = "InvalidUnicode";
  10509. ErrorCode2[ErrorCode2["InvalidEscapeCharacter"] = 261] = "InvalidEscapeCharacter";
  10510. ErrorCode2[ErrorCode2["InvalidCharacter"] = 262] = "InvalidCharacter";
  10511. ErrorCode2[ErrorCode2["PropertyExpected"] = 513] = "PropertyExpected";
  10512. ErrorCode2[ErrorCode2["CommaExpected"] = 514] = "CommaExpected";
  10513. ErrorCode2[ErrorCode2["ColonExpected"] = 515] = "ColonExpected";
  10514. ErrorCode2[ErrorCode2["ValueExpected"] = 516] = "ValueExpected";
  10515. ErrorCode2[ErrorCode2["CommaOrCloseBacketExpected"] = 517] = "CommaOrCloseBacketExpected";
  10516. ErrorCode2[ErrorCode2["CommaOrCloseBraceExpected"] = 518] = "CommaOrCloseBraceExpected";
  10517. ErrorCode2[ErrorCode2["TrailingComma"] = 519] = "TrailingComma";
  10518. ErrorCode2[ErrorCode2["DuplicateKey"] = 520] = "DuplicateKey";
  10519. ErrorCode2[ErrorCode2["CommentNotPermitted"] = 521] = "CommentNotPermitted";
  10520. ErrorCode2[ErrorCode2["SchemaResolveError"] = 768] = "SchemaResolveError";
  10521. })(ErrorCode || (ErrorCode = {}));
  10522. var ClientCapabilities;
  10523. (function(ClientCapabilities2) {
  10524. ClientCapabilities2.LATEST = {
  10525. textDocument: {
  10526. completion: {
  10527. completionItem: {
  10528. documentationFormat: [MarkupKind.Markdown, MarkupKind.PlainText],
  10529. commitCharactersSupport: true
  10530. }
  10531. }
  10532. }
  10533. };
  10534. })(ClientCapabilities || (ClientCapabilities = {}));
  10535. function format3(message, args) {
  10536. let result;
  10537. if (args.length === 0) {
  10538. result = message;
  10539. } else {
  10540. result = message.replace(/\{(\d+)\}/g, (match, rest) => {
  10541. let index = rest[0];
  10542. return typeof args[index] !== "undefined" ? args[index] : match;
  10543. });
  10544. }
  10545. return result;
  10546. }
  10547. function localize(key, message, ...args) {
  10548. return format3(message, args);
  10549. }
  10550. function loadMessageBundle(file) {
  10551. return localize;
  10552. }
  10553. var __extends = function() {
  10554. var extendStatics = function(d, b) {
  10555. extendStatics = Object.setPrototypeOf || {__proto__: []} instanceof Array && function(d2, b2) {
  10556. d2.__proto__ = b2;
  10557. } || function(d2, b2) {
  10558. for (var p in b2)
  10559. if (Object.prototype.hasOwnProperty.call(b2, p))
  10560. d2[p] = b2[p];
  10561. };
  10562. return extendStatics(d, b);
  10563. };
  10564. return function(d, b) {
  10565. if (typeof b !== "function" && b !== null)
  10566. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  10567. extendStatics(d, b);
  10568. function __() {
  10569. this.constructor = d;
  10570. }
  10571. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  10572. };
  10573. }();
  10574. var localize2 = loadMessageBundle();
  10575. var formats = {
  10576. "color-hex": {errorMessage: localize2("colorHexFormatWarning", "Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA."), pattern: /^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},
  10577. "date-time": {errorMessage: localize2("dateTimeFormatWarning", "String is not a RFC3339 date-time."), pattern: /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},
  10578. date: {errorMessage: localize2("dateFormatWarning", "String is not a RFC3339 date."), pattern: /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},
  10579. time: {errorMessage: localize2("timeFormatWarning", "String is not a RFC3339 time."), pattern: /^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},
  10580. email: {errorMessage: localize2("emailFormatWarning", "String is not an e-mail address."), pattern: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}))$/},
  10581. hostname: {errorMessage: localize2("hostnameFormatWarning", "String is not a hostname."), pattern: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i},
  10582. ipv4: {errorMessage: localize2("ipv4FormatWarning", "String is not an IPv4 address."), pattern: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/},
  10583. ipv6: {errorMessage: localize2("ipv6FormatWarning", "String is not an IPv6 address."), pattern: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i}
  10584. };
  10585. var ASTNodeImpl = function() {
  10586. function ASTNodeImpl2(parent, offset, length) {
  10587. if (length === void 0) {
  10588. length = 0;
  10589. }
  10590. this.offset = offset;
  10591. this.length = length;
  10592. this.parent = parent;
  10593. }
  10594. Object.defineProperty(ASTNodeImpl2.prototype, "children", {
  10595. get: function() {
  10596. return [];
  10597. },
  10598. enumerable: false,
  10599. configurable: true
  10600. });
  10601. ASTNodeImpl2.prototype.toString = function() {
  10602. return "type: " + this.type + " (" + this.offset + "/" + this.length + ")" + (this.parent ? " parent: {" + this.parent.toString() + "}" : "");
  10603. };
  10604. return ASTNodeImpl2;
  10605. }();
  10606. var NullASTNodeImpl = function(_super) {
  10607. __extends(NullASTNodeImpl2, _super);
  10608. function NullASTNodeImpl2(parent, offset) {
  10609. var _this = _super.call(this, parent, offset) || this;
  10610. _this.type = "null";
  10611. _this.value = null;
  10612. return _this;
  10613. }
  10614. return NullASTNodeImpl2;
  10615. }(ASTNodeImpl);
  10616. var BooleanASTNodeImpl = function(_super) {
  10617. __extends(BooleanASTNodeImpl2, _super);
  10618. function BooleanASTNodeImpl2(parent, boolValue, offset) {
  10619. var _this = _super.call(this, parent, offset) || this;
  10620. _this.type = "boolean";
  10621. _this.value = boolValue;
  10622. return _this;
  10623. }
  10624. return BooleanASTNodeImpl2;
  10625. }(ASTNodeImpl);
  10626. var ArrayASTNodeImpl = function(_super) {
  10627. __extends(ArrayASTNodeImpl2, _super);
  10628. function ArrayASTNodeImpl2(parent, offset) {
  10629. var _this = _super.call(this, parent, offset) || this;
  10630. _this.type = "array";
  10631. _this.items = [];
  10632. return _this;
  10633. }
  10634. Object.defineProperty(ArrayASTNodeImpl2.prototype, "children", {
  10635. get: function() {
  10636. return this.items;
  10637. },
  10638. enumerable: false,
  10639. configurable: true
  10640. });
  10641. return ArrayASTNodeImpl2;
  10642. }(ASTNodeImpl);
  10643. var NumberASTNodeImpl = function(_super) {
  10644. __extends(NumberASTNodeImpl2, _super);
  10645. function NumberASTNodeImpl2(parent, offset) {
  10646. var _this = _super.call(this, parent, offset) || this;
  10647. _this.type = "number";
  10648. _this.isInteger = true;
  10649. _this.value = Number.NaN;
  10650. return _this;
  10651. }
  10652. return NumberASTNodeImpl2;
  10653. }(ASTNodeImpl);
  10654. var StringASTNodeImpl = function(_super) {
  10655. __extends(StringASTNodeImpl2, _super);
  10656. function StringASTNodeImpl2(parent, offset, length) {
  10657. var _this = _super.call(this, parent, offset, length) || this;
  10658. _this.type = "string";
  10659. _this.value = "";
  10660. return _this;
  10661. }
  10662. return StringASTNodeImpl2;
  10663. }(ASTNodeImpl);
  10664. var PropertyASTNodeImpl = function(_super) {
  10665. __extends(PropertyASTNodeImpl2, _super);
  10666. function PropertyASTNodeImpl2(parent, offset, keyNode) {
  10667. var _this = _super.call(this, parent, offset) || this;
  10668. _this.type = "property";
  10669. _this.colonOffset = -1;
  10670. _this.keyNode = keyNode;
  10671. return _this;
  10672. }
  10673. Object.defineProperty(PropertyASTNodeImpl2.prototype, "children", {
  10674. get: function() {
  10675. return this.valueNode ? [this.keyNode, this.valueNode] : [this.keyNode];
  10676. },
  10677. enumerable: false,
  10678. configurable: true
  10679. });
  10680. return PropertyASTNodeImpl2;
  10681. }(ASTNodeImpl);
  10682. var ObjectASTNodeImpl = function(_super) {
  10683. __extends(ObjectASTNodeImpl2, _super);
  10684. function ObjectASTNodeImpl2(parent, offset) {
  10685. var _this = _super.call(this, parent, offset) || this;
  10686. _this.type = "object";
  10687. _this.properties = [];
  10688. return _this;
  10689. }
  10690. Object.defineProperty(ObjectASTNodeImpl2.prototype, "children", {
  10691. get: function() {
  10692. return this.properties;
  10693. },
  10694. enumerable: false,
  10695. configurable: true
  10696. });
  10697. return ObjectASTNodeImpl2;
  10698. }(ASTNodeImpl);
  10699. function asSchema(schema2) {
  10700. if (isBoolean(schema2)) {
  10701. return schema2 ? {} : {not: {}};
  10702. }
  10703. return schema2;
  10704. }
  10705. var EnumMatch;
  10706. (function(EnumMatch2) {
  10707. EnumMatch2[EnumMatch2["Key"] = 0] = "Key";
  10708. EnumMatch2[EnumMatch2["Enum"] = 1] = "Enum";
  10709. })(EnumMatch || (EnumMatch = {}));
  10710. var SchemaCollector = function() {
  10711. function SchemaCollector2(focusOffset, exclude) {
  10712. if (focusOffset === void 0) {
  10713. focusOffset = -1;
  10714. }
  10715. this.focusOffset = focusOffset;
  10716. this.exclude = exclude;
  10717. this.schemas = [];
  10718. }
  10719. SchemaCollector2.prototype.add = function(schema2) {
  10720. this.schemas.push(schema2);
  10721. };
  10722. SchemaCollector2.prototype.merge = function(other) {
  10723. Array.prototype.push.apply(this.schemas, other.schemas);
  10724. };
  10725. SchemaCollector2.prototype.include = function(node) {
  10726. return (this.focusOffset === -1 || contains2(node, this.focusOffset)) && node !== this.exclude;
  10727. };
  10728. SchemaCollector2.prototype.newSub = function() {
  10729. return new SchemaCollector2(-1, this.exclude);
  10730. };
  10731. return SchemaCollector2;
  10732. }();
  10733. var NoOpSchemaCollector = function() {
  10734. function NoOpSchemaCollector2() {
  10735. }
  10736. Object.defineProperty(NoOpSchemaCollector2.prototype, "schemas", {
  10737. get: function() {
  10738. return [];
  10739. },
  10740. enumerable: false,
  10741. configurable: true
  10742. });
  10743. NoOpSchemaCollector2.prototype.add = function(schema2) {
  10744. };
  10745. NoOpSchemaCollector2.prototype.merge = function(other) {
  10746. };
  10747. NoOpSchemaCollector2.prototype.include = function(node) {
  10748. return true;
  10749. };
  10750. NoOpSchemaCollector2.prototype.newSub = function() {
  10751. return this;
  10752. };
  10753. NoOpSchemaCollector2.instance = new NoOpSchemaCollector2();
  10754. return NoOpSchemaCollector2;
  10755. }();
  10756. var ValidationResult = function() {
  10757. function ValidationResult2() {
  10758. this.problems = [];
  10759. this.propertiesMatches = 0;
  10760. this.propertiesValueMatches = 0;
  10761. this.primaryValueMatches = 0;
  10762. this.enumValueMatch = false;
  10763. this.enumValues = void 0;
  10764. }
  10765. ValidationResult2.prototype.hasProblems = function() {
  10766. return !!this.problems.length;
  10767. };
  10768. ValidationResult2.prototype.mergeAll = function(validationResults) {
  10769. for (var _i = 0, validationResults_1 = validationResults; _i < validationResults_1.length; _i++) {
  10770. var validationResult = validationResults_1[_i];
  10771. this.merge(validationResult);
  10772. }
  10773. };
  10774. ValidationResult2.prototype.merge = function(validationResult) {
  10775. this.problems = this.problems.concat(validationResult.problems);
  10776. };
  10777. ValidationResult2.prototype.mergeEnumValues = function(validationResult) {
  10778. if (!this.enumValueMatch && !validationResult.enumValueMatch && this.enumValues && validationResult.enumValues) {
  10779. this.enumValues = this.enumValues.concat(validationResult.enumValues);
  10780. for (var _i = 0, _a3 = this.problems; _i < _a3.length; _i++) {
  10781. var error = _a3[_i];
  10782. if (error.code === ErrorCode.EnumValueMismatch) {
  10783. error.message = localize2("enumWarning", "Value is not accepted. Valid values: {0}.", this.enumValues.map(function(v) {
  10784. return JSON.stringify(v);
  10785. }).join(", "));
  10786. }
  10787. }
  10788. }
  10789. };
  10790. ValidationResult2.prototype.mergePropertyMatch = function(propertyValidationResult) {
  10791. this.merge(propertyValidationResult);
  10792. this.propertiesMatches++;
  10793. if (propertyValidationResult.enumValueMatch || !propertyValidationResult.hasProblems() && propertyValidationResult.propertiesMatches) {
  10794. this.propertiesValueMatches++;
  10795. }
  10796. if (propertyValidationResult.enumValueMatch && propertyValidationResult.enumValues && propertyValidationResult.enumValues.length === 1) {
  10797. this.primaryValueMatches++;
  10798. }
  10799. };
  10800. ValidationResult2.prototype.compare = function(other) {
  10801. var hasProblems = this.hasProblems();
  10802. if (hasProblems !== other.hasProblems()) {
  10803. return hasProblems ? -1 : 1;
  10804. }
  10805. if (this.enumValueMatch !== other.enumValueMatch) {
  10806. return other.enumValueMatch ? -1 : 1;
  10807. }
  10808. if (this.primaryValueMatches !== other.primaryValueMatches) {
  10809. return this.primaryValueMatches - other.primaryValueMatches;
  10810. }
  10811. if (this.propertiesValueMatches !== other.propertiesValueMatches) {
  10812. return this.propertiesValueMatches - other.propertiesValueMatches;
  10813. }
  10814. return this.propertiesMatches - other.propertiesMatches;
  10815. };
  10816. return ValidationResult2;
  10817. }();
  10818. function newJSONDocument(root, diagnostics) {
  10819. if (diagnostics === void 0) {
  10820. diagnostics = [];
  10821. }
  10822. return new JSONDocument(root, diagnostics, []);
  10823. }
  10824. function getNodeValue3(node) {
  10825. return getNodeValue2(node);
  10826. }
  10827. function getNodePath3(node) {
  10828. return getNodePath2(node);
  10829. }
  10830. function contains2(node, offset, includeRightBound) {
  10831. if (includeRightBound === void 0) {
  10832. includeRightBound = false;
  10833. }
  10834. return offset >= node.offset && offset < node.offset + node.length || includeRightBound && offset === node.offset + node.length;
  10835. }
  10836. var JSONDocument = function() {
  10837. function JSONDocument2(root, syntaxErrors, comments) {
  10838. if (syntaxErrors === void 0) {
  10839. syntaxErrors = [];
  10840. }
  10841. if (comments === void 0) {
  10842. comments = [];
  10843. }
  10844. this.root = root;
  10845. this.syntaxErrors = syntaxErrors;
  10846. this.comments = comments;
  10847. }
  10848. JSONDocument2.prototype.getNodeFromOffset = function(offset, includeRightBound) {
  10849. if (includeRightBound === void 0) {
  10850. includeRightBound = false;
  10851. }
  10852. if (this.root) {
  10853. return findNodeAtOffset2(this.root, offset, includeRightBound);
  10854. }
  10855. return void 0;
  10856. };
  10857. JSONDocument2.prototype.visit = function(visitor) {
  10858. if (this.root) {
  10859. var doVisit_1 = function(node) {
  10860. var ctn = visitor(node);
  10861. var children = node.children;
  10862. if (Array.isArray(children)) {
  10863. for (var i = 0; i < children.length && ctn; i++) {
  10864. ctn = doVisit_1(children[i]);
  10865. }
  10866. }
  10867. return ctn;
  10868. };
  10869. doVisit_1(this.root);
  10870. }
  10871. };
  10872. JSONDocument2.prototype.validate = function(textDocument, schema2, severity) {
  10873. if (severity === void 0) {
  10874. severity = DiagnosticSeverity.Warning;
  10875. }
  10876. if (this.root && schema2) {
  10877. var validationResult = new ValidationResult();
  10878. validate(this.root, schema2, validationResult, NoOpSchemaCollector.instance);
  10879. return validationResult.problems.map(function(p) {
  10880. var _a3;
  10881. var range = Range2.create(textDocument.positionAt(p.location.offset), textDocument.positionAt(p.location.offset + p.location.length));
  10882. return Diagnostic.create(range, p.message, (_a3 = p.severity) !== null && _a3 !== void 0 ? _a3 : severity, p.code);
  10883. });
  10884. }
  10885. return void 0;
  10886. };
  10887. JSONDocument2.prototype.getMatchingSchemas = function(schema2, focusOffset, exclude) {
  10888. if (focusOffset === void 0) {
  10889. focusOffset = -1;
  10890. }
  10891. var matchingSchemas = new SchemaCollector(focusOffset, exclude);
  10892. if (this.root && schema2) {
  10893. validate(this.root, schema2, new ValidationResult(), matchingSchemas);
  10894. }
  10895. return matchingSchemas.schemas;
  10896. };
  10897. return JSONDocument2;
  10898. }();
  10899. function validate(n, schema2, validationResult, matchingSchemas) {
  10900. if (!n || !matchingSchemas.include(n)) {
  10901. return;
  10902. }
  10903. var node = n;
  10904. switch (node.type) {
  10905. case "object":
  10906. _validateObjectNode(node, schema2, validationResult, matchingSchemas);
  10907. break;
  10908. case "array":
  10909. _validateArrayNode(node, schema2, validationResult, matchingSchemas);
  10910. break;
  10911. case "string":
  10912. _validateStringNode(node, schema2, validationResult, matchingSchemas);
  10913. break;
  10914. case "number":
  10915. _validateNumberNode(node, schema2, validationResult, matchingSchemas);
  10916. break;
  10917. case "property":
  10918. return validate(node.valueNode, schema2, validationResult, matchingSchemas);
  10919. }
  10920. _validateNode();
  10921. matchingSchemas.add({node, schema: schema2});
  10922. function _validateNode() {
  10923. function matchesType(type) {
  10924. return node.type === type || type === "integer" && node.type === "number" && node.isInteger;
  10925. }
  10926. if (Array.isArray(schema2.type)) {
  10927. if (!schema2.type.some(matchesType)) {
  10928. validationResult.problems.push({
  10929. location: {offset: node.offset, length: node.length},
  10930. message: schema2.errorMessage || localize2("typeArrayMismatchWarning", "Incorrect type. Expected one of {0}.", schema2.type.join(", "))
  10931. });
  10932. }
  10933. } else if (schema2.type) {
  10934. if (!matchesType(schema2.type)) {
  10935. validationResult.problems.push({
  10936. location: {offset: node.offset, length: node.length},
  10937. message: schema2.errorMessage || localize2("typeMismatchWarning", 'Incorrect type. Expected "{0}".', schema2.type)
  10938. });
  10939. }
  10940. }
  10941. if (Array.isArray(schema2.allOf)) {
  10942. for (var _i = 0, _a3 = schema2.allOf; _i < _a3.length; _i++) {
  10943. var subSchemaRef = _a3[_i];
  10944. validate(node, asSchema(subSchemaRef), validationResult, matchingSchemas);
  10945. }
  10946. }
  10947. var notSchema = asSchema(schema2.not);
  10948. if (notSchema) {
  10949. var subValidationResult = new ValidationResult();
  10950. var subMatchingSchemas = matchingSchemas.newSub();
  10951. validate(node, notSchema, subValidationResult, subMatchingSchemas);
  10952. if (!subValidationResult.hasProblems()) {
  10953. validationResult.problems.push({
  10954. location: {offset: node.offset, length: node.length},
  10955. message: localize2("notSchemaWarning", "Matches a schema that is not allowed.")
  10956. });
  10957. }
  10958. for (var _b = 0, _c = subMatchingSchemas.schemas; _b < _c.length; _b++) {
  10959. var ms = _c[_b];
  10960. ms.inverted = !ms.inverted;
  10961. matchingSchemas.add(ms);
  10962. }
  10963. }
  10964. var testAlternatives = function(alternatives, maxOneMatch) {
  10965. var matches = [];
  10966. var bestMatch = void 0;
  10967. for (var _i2 = 0, alternatives_1 = alternatives; _i2 < alternatives_1.length; _i2++) {
  10968. var subSchemaRef2 = alternatives_1[_i2];
  10969. var subSchema = asSchema(subSchemaRef2);
  10970. var subValidationResult2 = new ValidationResult();
  10971. var subMatchingSchemas2 = matchingSchemas.newSub();
  10972. validate(node, subSchema, subValidationResult2, subMatchingSchemas2);
  10973. if (!subValidationResult2.hasProblems()) {
  10974. matches.push(subSchema);
  10975. }
  10976. if (!bestMatch) {
  10977. bestMatch = {schema: subSchema, validationResult: subValidationResult2, matchingSchemas: subMatchingSchemas2};
  10978. } else {
  10979. if (!maxOneMatch && !subValidationResult2.hasProblems() && !bestMatch.validationResult.hasProblems()) {
  10980. bestMatch.matchingSchemas.merge(subMatchingSchemas2);
  10981. bestMatch.validationResult.propertiesMatches += subValidationResult2.propertiesMatches;
  10982. bestMatch.validationResult.propertiesValueMatches += subValidationResult2.propertiesValueMatches;
  10983. } else {
  10984. var compareResult = subValidationResult2.compare(bestMatch.validationResult);
  10985. if (compareResult > 0) {
  10986. bestMatch = {schema: subSchema, validationResult: subValidationResult2, matchingSchemas: subMatchingSchemas2};
  10987. } else if (compareResult === 0) {
  10988. bestMatch.matchingSchemas.merge(subMatchingSchemas2);
  10989. bestMatch.validationResult.mergeEnumValues(subValidationResult2);
  10990. }
  10991. }
  10992. }
  10993. }
  10994. if (matches.length > 1 && maxOneMatch) {
  10995. validationResult.problems.push({
  10996. location: {offset: node.offset, length: 1},
  10997. message: localize2("oneOfWarning", "Matches multiple schemas when only one must validate.")
  10998. });
  10999. }
  11000. if (bestMatch) {
  11001. validationResult.merge(bestMatch.validationResult);
  11002. validationResult.propertiesMatches += bestMatch.validationResult.propertiesMatches;
  11003. validationResult.propertiesValueMatches += bestMatch.validationResult.propertiesValueMatches;
  11004. matchingSchemas.merge(bestMatch.matchingSchemas);
  11005. }
  11006. return matches.length;
  11007. };
  11008. if (Array.isArray(schema2.anyOf)) {
  11009. testAlternatives(schema2.anyOf, false);
  11010. }
  11011. if (Array.isArray(schema2.oneOf)) {
  11012. testAlternatives(schema2.oneOf, true);
  11013. }
  11014. var testBranch = function(schema22) {
  11015. var subValidationResult2 = new ValidationResult();
  11016. var subMatchingSchemas2 = matchingSchemas.newSub();
  11017. validate(node, asSchema(schema22), subValidationResult2, subMatchingSchemas2);
  11018. validationResult.merge(subValidationResult2);
  11019. validationResult.propertiesMatches += subValidationResult2.propertiesMatches;
  11020. validationResult.propertiesValueMatches += subValidationResult2.propertiesValueMatches;
  11021. matchingSchemas.merge(subMatchingSchemas2);
  11022. };
  11023. var testCondition = function(ifSchema2, thenSchema, elseSchema) {
  11024. var subSchema = asSchema(ifSchema2);
  11025. var subValidationResult2 = new ValidationResult();
  11026. var subMatchingSchemas2 = matchingSchemas.newSub();
  11027. validate(node, subSchema, subValidationResult2, subMatchingSchemas2);
  11028. matchingSchemas.merge(subMatchingSchemas2);
  11029. if (!subValidationResult2.hasProblems()) {
  11030. if (thenSchema) {
  11031. testBranch(thenSchema);
  11032. }
  11033. } else if (elseSchema) {
  11034. testBranch(elseSchema);
  11035. }
  11036. };
  11037. var ifSchema = asSchema(schema2.if);
  11038. if (ifSchema) {
  11039. testCondition(ifSchema, asSchema(schema2.then), asSchema(schema2.else));
  11040. }
  11041. if (Array.isArray(schema2.enum)) {
  11042. var val = getNodeValue3(node);
  11043. var enumValueMatch = false;
  11044. for (var _d = 0, _e = schema2.enum; _d < _e.length; _d++) {
  11045. var e = _e[_d];
  11046. if (equals2(val, e)) {
  11047. enumValueMatch = true;
  11048. break;
  11049. }
  11050. }
  11051. validationResult.enumValues = schema2.enum;
  11052. validationResult.enumValueMatch = enumValueMatch;
  11053. if (!enumValueMatch) {
  11054. validationResult.problems.push({
  11055. location: {offset: node.offset, length: node.length},
  11056. code: ErrorCode.EnumValueMismatch,
  11057. message: schema2.errorMessage || localize2("enumWarning", "Value is not accepted. Valid values: {0}.", schema2.enum.map(function(v) {
  11058. return JSON.stringify(v);
  11059. }).join(", "))
  11060. });
  11061. }
  11062. }
  11063. if (isDefined(schema2.const)) {
  11064. var val = getNodeValue3(node);
  11065. if (!equals2(val, schema2.const)) {
  11066. validationResult.problems.push({
  11067. location: {offset: node.offset, length: node.length},
  11068. code: ErrorCode.EnumValueMismatch,
  11069. message: schema2.errorMessage || localize2("constWarning", "Value must be {0}.", JSON.stringify(schema2.const))
  11070. });
  11071. validationResult.enumValueMatch = false;
  11072. } else {
  11073. validationResult.enumValueMatch = true;
  11074. }
  11075. validationResult.enumValues = [schema2.const];
  11076. }
  11077. if (schema2.deprecationMessage && node.parent) {
  11078. validationResult.problems.push({
  11079. location: {offset: node.parent.offset, length: node.parent.length},
  11080. severity: DiagnosticSeverity.Warning,
  11081. message: schema2.deprecationMessage,
  11082. code: ErrorCode.Deprecated
  11083. });
  11084. }
  11085. }
  11086. function _validateNumberNode(node2, schema22, validationResult2, matchingSchemas2) {
  11087. var val = node2.value;
  11088. function normalizeFloats(float) {
  11089. var _a3;
  11090. var parts = /^(-?\d+)(?:\.(\d+))?(?:e([-+]\d+))?$/.exec(float.toString());
  11091. return parts && {
  11092. value: Number(parts[1] + (parts[2] || "")),
  11093. multiplier: (((_a3 = parts[2]) === null || _a3 === void 0 ? void 0 : _a3.length) || 0) - (parseInt(parts[3]) || 0)
  11094. };
  11095. }
  11096. ;
  11097. if (isNumber(schema22.multipleOf)) {
  11098. var remainder = -1;
  11099. if (Number.isInteger(schema22.multipleOf)) {
  11100. remainder = val % schema22.multipleOf;
  11101. } else {
  11102. var normMultipleOf = normalizeFloats(schema22.multipleOf);
  11103. var normValue = normalizeFloats(val);
  11104. if (normMultipleOf && normValue) {
  11105. var multiplier = Math.pow(10, Math.abs(normValue.multiplier - normMultipleOf.multiplier));
  11106. if (normValue.multiplier < normMultipleOf.multiplier) {
  11107. normValue.value *= multiplier;
  11108. } else {
  11109. normMultipleOf.value *= multiplier;
  11110. }
  11111. remainder = normValue.value % normMultipleOf.value;
  11112. }
  11113. }
  11114. if (remainder !== 0) {
  11115. validationResult2.problems.push({
  11116. location: {offset: node2.offset, length: node2.length},
  11117. message: localize2("multipleOfWarning", "Value is not divisible by {0}.", schema22.multipleOf)
  11118. });
  11119. }
  11120. }
  11121. function getExclusiveLimit(limit, exclusive) {
  11122. if (isNumber(exclusive)) {
  11123. return exclusive;
  11124. }
  11125. if (isBoolean(exclusive) && exclusive) {
  11126. return limit;
  11127. }
  11128. return void 0;
  11129. }
  11130. function getLimit(limit, exclusive) {
  11131. if (!isBoolean(exclusive) || !exclusive) {
  11132. return limit;
  11133. }
  11134. return void 0;
  11135. }
  11136. var exclusiveMinimum = getExclusiveLimit(schema22.minimum, schema22.exclusiveMinimum);
  11137. if (isNumber(exclusiveMinimum) && val <= exclusiveMinimum) {
  11138. validationResult2.problems.push({
  11139. location: {offset: node2.offset, length: node2.length},
  11140. message: localize2("exclusiveMinimumWarning", "Value is below the exclusive minimum of {0}.", exclusiveMinimum)
  11141. });
  11142. }
  11143. var exclusiveMaximum = getExclusiveLimit(schema22.maximum, schema22.exclusiveMaximum);
  11144. if (isNumber(exclusiveMaximum) && val >= exclusiveMaximum) {
  11145. validationResult2.problems.push({
  11146. location: {offset: node2.offset, length: node2.length},
  11147. message: localize2("exclusiveMaximumWarning", "Value is above the exclusive maximum of {0}.", exclusiveMaximum)
  11148. });
  11149. }
  11150. var minimum = getLimit(schema22.minimum, schema22.exclusiveMinimum);
  11151. if (isNumber(minimum) && val < minimum) {
  11152. validationResult2.problems.push({
  11153. location: {offset: node2.offset, length: node2.length},
  11154. message: localize2("minimumWarning", "Value is below the minimum of {0}.", minimum)
  11155. });
  11156. }
  11157. var maximum = getLimit(schema22.maximum, schema22.exclusiveMaximum);
  11158. if (isNumber(maximum) && val > maximum) {
  11159. validationResult2.problems.push({
  11160. location: {offset: node2.offset, length: node2.length},
  11161. message: localize2("maximumWarning", "Value is above the maximum of {0}.", maximum)
  11162. });
  11163. }
  11164. }
  11165. function _validateStringNode(node2, schema22, validationResult2, matchingSchemas2) {
  11166. if (isNumber(schema22.minLength) && node2.value.length < schema22.minLength) {
  11167. validationResult2.problems.push({
  11168. location: {offset: node2.offset, length: node2.length},
  11169. message: localize2("minLengthWarning", "String is shorter than the minimum length of {0}.", schema22.minLength)
  11170. });
  11171. }
  11172. if (isNumber(schema22.maxLength) && node2.value.length > schema22.maxLength) {
  11173. validationResult2.problems.push({
  11174. location: {offset: node2.offset, length: node2.length},
  11175. message: localize2("maxLengthWarning", "String is longer than the maximum length of {0}.", schema22.maxLength)
  11176. });
  11177. }
  11178. if (isString(schema22.pattern)) {
  11179. var regex = extendedRegExp(schema22.pattern);
  11180. if (!(regex === null || regex === void 0 ? void 0 : regex.test(node2.value))) {
  11181. validationResult2.problems.push({
  11182. location: {offset: node2.offset, length: node2.length},
  11183. message: schema22.patternErrorMessage || schema22.errorMessage || localize2("patternWarning", 'String does not match the pattern of "{0}".', schema22.pattern)
  11184. });
  11185. }
  11186. }
  11187. if (schema22.format) {
  11188. switch (schema22.format) {
  11189. case "uri":
  11190. case "uri-reference":
  11191. {
  11192. var errorMessage = void 0;
  11193. if (!node2.value) {
  11194. errorMessage = localize2("uriEmpty", "URI expected.");
  11195. } else {
  11196. var match = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(node2.value);
  11197. if (!match) {
  11198. errorMessage = localize2("uriMissing", "URI is expected.");
  11199. } else if (!match[2] && schema22.format === "uri") {
  11200. errorMessage = localize2("uriSchemeMissing", "URI with a scheme is expected.");
  11201. }
  11202. }
  11203. if (errorMessage) {
  11204. validationResult2.problems.push({
  11205. location: {offset: node2.offset, length: node2.length},
  11206. message: schema22.patternErrorMessage || schema22.errorMessage || localize2("uriFormatWarning", "String is not a URI: {0}", errorMessage)
  11207. });
  11208. }
  11209. }
  11210. break;
  11211. case "color-hex":
  11212. case "date-time":
  11213. case "date":
  11214. case "time":
  11215. case "email":
  11216. case "hostname":
  11217. case "ipv4":
  11218. case "ipv6":
  11219. var format4 = formats[schema22.format];
  11220. if (!node2.value || !format4.pattern.exec(node2.value)) {
  11221. validationResult2.problems.push({
  11222. location: {offset: node2.offset, length: node2.length},
  11223. message: schema22.patternErrorMessage || schema22.errorMessage || format4.errorMessage
  11224. });
  11225. }
  11226. default:
  11227. }
  11228. }
  11229. }
  11230. function _validateArrayNode(node2, schema22, validationResult2, matchingSchemas2) {
  11231. if (Array.isArray(schema22.items)) {
  11232. var subSchemas = schema22.items;
  11233. for (var index = 0; index < subSchemas.length; index++) {
  11234. var subSchemaRef = subSchemas[index];
  11235. var subSchema = asSchema(subSchemaRef);
  11236. var itemValidationResult = new ValidationResult();
  11237. var item = node2.items[index];
  11238. if (item) {
  11239. validate(item, subSchema, itemValidationResult, matchingSchemas2);
  11240. validationResult2.mergePropertyMatch(itemValidationResult);
  11241. } else if (node2.items.length >= subSchemas.length) {
  11242. validationResult2.propertiesValueMatches++;
  11243. }
  11244. }
  11245. if (node2.items.length > subSchemas.length) {
  11246. if (typeof schema22.additionalItems === "object") {
  11247. for (var i = subSchemas.length; i < node2.items.length; i++) {
  11248. var itemValidationResult = new ValidationResult();
  11249. validate(node2.items[i], schema22.additionalItems, itemValidationResult, matchingSchemas2);
  11250. validationResult2.mergePropertyMatch(itemValidationResult);
  11251. }
  11252. } else if (schema22.additionalItems === false) {
  11253. validationResult2.problems.push({
  11254. location: {offset: node2.offset, length: node2.length},
  11255. message: localize2("additionalItemsWarning", "Array has too many items according to schema. Expected {0} or fewer.", subSchemas.length)
  11256. });
  11257. }
  11258. }
  11259. } else {
  11260. var itemSchema = asSchema(schema22.items);
  11261. if (itemSchema) {
  11262. for (var _i = 0, _a3 = node2.items; _i < _a3.length; _i++) {
  11263. var item = _a3[_i];
  11264. var itemValidationResult = new ValidationResult();
  11265. validate(item, itemSchema, itemValidationResult, matchingSchemas2);
  11266. validationResult2.mergePropertyMatch(itemValidationResult);
  11267. }
  11268. }
  11269. }
  11270. var containsSchema = asSchema(schema22.contains);
  11271. if (containsSchema) {
  11272. var doesContain = node2.items.some(function(item2) {
  11273. var itemValidationResult2 = new ValidationResult();
  11274. validate(item2, containsSchema, itemValidationResult2, NoOpSchemaCollector.instance);
  11275. return !itemValidationResult2.hasProblems();
  11276. });
  11277. if (!doesContain) {
  11278. validationResult2.problems.push({
  11279. location: {offset: node2.offset, length: node2.length},
  11280. message: schema22.errorMessage || localize2("requiredItemMissingWarning", "Array does not contain required item.")
  11281. });
  11282. }
  11283. }
  11284. if (isNumber(schema22.minItems) && node2.items.length < schema22.minItems) {
  11285. validationResult2.problems.push({
  11286. location: {offset: node2.offset, length: node2.length},
  11287. message: localize2("minItemsWarning", "Array has too few items. Expected {0} or more.", schema22.minItems)
  11288. });
  11289. }
  11290. if (isNumber(schema22.maxItems) && node2.items.length > schema22.maxItems) {
  11291. validationResult2.problems.push({
  11292. location: {offset: node2.offset, length: node2.length},
  11293. message: localize2("maxItemsWarning", "Array has too many items. Expected {0} or fewer.", schema22.maxItems)
  11294. });
  11295. }
  11296. if (schema22.uniqueItems === true) {
  11297. var values_1 = getNodeValue3(node2);
  11298. var duplicates = values_1.some(function(value, index2) {
  11299. return index2 !== values_1.lastIndexOf(value);
  11300. });
  11301. if (duplicates) {
  11302. validationResult2.problems.push({
  11303. location: {offset: node2.offset, length: node2.length},
  11304. message: localize2("uniqueItemsWarning", "Array has duplicate items.")
  11305. });
  11306. }
  11307. }
  11308. }
  11309. function _validateObjectNode(node2, schema22, validationResult2, matchingSchemas2) {
  11310. var seenKeys = /* @__PURE__ */ Object.create(null);
  11311. var unprocessedProperties = [];
  11312. for (var _i = 0, _a3 = node2.properties; _i < _a3.length; _i++) {
  11313. var propertyNode = _a3[_i];
  11314. var key = propertyNode.keyNode.value;
  11315. seenKeys[key] = propertyNode.valueNode;
  11316. unprocessedProperties.push(key);
  11317. }
  11318. if (Array.isArray(schema22.required)) {
  11319. for (var _b = 0, _c = schema22.required; _b < _c.length; _b++) {
  11320. var propertyName = _c[_b];
  11321. if (!seenKeys[propertyName]) {
  11322. var keyNode = node2.parent && node2.parent.type === "property" && node2.parent.keyNode;
  11323. var location = keyNode ? {offset: keyNode.offset, length: keyNode.length} : {offset: node2.offset, length: 1};
  11324. validationResult2.problems.push({
  11325. location,
  11326. message: localize2("MissingRequiredPropWarning", 'Missing property "{0}".', propertyName)
  11327. });
  11328. }
  11329. }
  11330. }
  11331. var propertyProcessed = function(prop2) {
  11332. var index = unprocessedProperties.indexOf(prop2);
  11333. while (index >= 0) {
  11334. unprocessedProperties.splice(index, 1);
  11335. index = unprocessedProperties.indexOf(prop2);
  11336. }
  11337. };
  11338. if (schema22.properties) {
  11339. for (var _d = 0, _e = Object.keys(schema22.properties); _d < _e.length; _d++) {
  11340. var propertyName = _e[_d];
  11341. propertyProcessed(propertyName);
  11342. var propertySchema = schema22.properties[propertyName];
  11343. var child = seenKeys[propertyName];
  11344. if (child) {
  11345. if (isBoolean(propertySchema)) {
  11346. if (!propertySchema) {
  11347. var propertyNode = child.parent;
  11348. validationResult2.problems.push({
  11349. location: {offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length},
  11350. message: schema22.errorMessage || localize2("DisallowedExtraPropWarning", "Property {0} is not allowed.", propertyName)
  11351. });
  11352. } else {
  11353. validationResult2.propertiesMatches++;
  11354. validationResult2.propertiesValueMatches++;
  11355. }
  11356. } else {
  11357. var propertyValidationResult = new ValidationResult();
  11358. validate(child, propertySchema, propertyValidationResult, matchingSchemas2);
  11359. validationResult2.mergePropertyMatch(propertyValidationResult);
  11360. }
  11361. }
  11362. }
  11363. }
  11364. if (schema22.patternProperties) {
  11365. for (var _f = 0, _g = Object.keys(schema22.patternProperties); _f < _g.length; _f++) {
  11366. var propertyPattern = _g[_f];
  11367. var regex = extendedRegExp(propertyPattern);
  11368. for (var _h = 0, _j = unprocessedProperties.slice(0); _h < _j.length; _h++) {
  11369. var propertyName = _j[_h];
  11370. if (regex === null || regex === void 0 ? void 0 : regex.test(propertyName)) {
  11371. propertyProcessed(propertyName);
  11372. var child = seenKeys[propertyName];
  11373. if (child) {
  11374. var propertySchema = schema22.patternProperties[propertyPattern];
  11375. if (isBoolean(propertySchema)) {
  11376. if (!propertySchema) {
  11377. var propertyNode = child.parent;
  11378. validationResult2.problems.push({
  11379. location: {offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length},
  11380. message: schema22.errorMessage || localize2("DisallowedExtraPropWarning", "Property {0} is not allowed.", propertyName)
  11381. });
  11382. } else {
  11383. validationResult2.propertiesMatches++;
  11384. validationResult2.propertiesValueMatches++;
  11385. }
  11386. } else {
  11387. var propertyValidationResult = new ValidationResult();
  11388. validate(child, propertySchema, propertyValidationResult, matchingSchemas2);
  11389. validationResult2.mergePropertyMatch(propertyValidationResult);
  11390. }
  11391. }
  11392. }
  11393. }
  11394. }
  11395. }
  11396. if (typeof schema22.additionalProperties === "object") {
  11397. for (var _k = 0, unprocessedProperties_1 = unprocessedProperties; _k < unprocessedProperties_1.length; _k++) {
  11398. var propertyName = unprocessedProperties_1[_k];
  11399. var child = seenKeys[propertyName];
  11400. if (child) {
  11401. var propertyValidationResult = new ValidationResult();
  11402. validate(child, schema22.additionalProperties, propertyValidationResult, matchingSchemas2);
  11403. validationResult2.mergePropertyMatch(propertyValidationResult);
  11404. }
  11405. }
  11406. } else if (schema22.additionalProperties === false) {
  11407. if (unprocessedProperties.length > 0) {
  11408. for (var _l = 0, unprocessedProperties_2 = unprocessedProperties; _l < unprocessedProperties_2.length; _l++) {
  11409. var propertyName = unprocessedProperties_2[_l];
  11410. var child = seenKeys[propertyName];
  11411. if (child) {
  11412. var propertyNode = child.parent;
  11413. validationResult2.problems.push({
  11414. location: {offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length},
  11415. message: schema22.errorMessage || localize2("DisallowedExtraPropWarning", "Property {0} is not allowed.", propertyName)
  11416. });
  11417. }
  11418. }
  11419. }
  11420. }
  11421. if (isNumber(schema22.maxProperties)) {
  11422. if (node2.properties.length > schema22.maxProperties) {
  11423. validationResult2.problems.push({
  11424. location: {offset: node2.offset, length: node2.length},
  11425. message: localize2("MaxPropWarning", "Object has more properties than limit of {0}.", schema22.maxProperties)
  11426. });
  11427. }
  11428. }
  11429. if (isNumber(schema22.minProperties)) {
  11430. if (node2.properties.length < schema22.minProperties) {
  11431. validationResult2.problems.push({
  11432. location: {offset: node2.offset, length: node2.length},
  11433. message: localize2("MinPropWarning", "Object has fewer properties than the required number of {0}", schema22.minProperties)
  11434. });
  11435. }
  11436. }
  11437. if (schema22.dependencies) {
  11438. for (var _m = 0, _o = Object.keys(schema22.dependencies); _m < _o.length; _m++) {
  11439. var key = _o[_m];
  11440. var prop = seenKeys[key];
  11441. if (prop) {
  11442. var propertyDep = schema22.dependencies[key];
  11443. if (Array.isArray(propertyDep)) {
  11444. for (var _p = 0, propertyDep_1 = propertyDep; _p < propertyDep_1.length; _p++) {
  11445. var requiredProp = propertyDep_1[_p];
  11446. if (!seenKeys[requiredProp]) {
  11447. validationResult2.problems.push({
  11448. location: {offset: node2.offset, length: node2.length},
  11449. message: localize2("RequiredDependentPropWarning", "Object is missing property {0} required by property {1}.", requiredProp, key)
  11450. });
  11451. } else {
  11452. validationResult2.propertiesValueMatches++;
  11453. }
  11454. }
  11455. } else {
  11456. var propertySchema = asSchema(propertyDep);
  11457. if (propertySchema) {
  11458. var propertyValidationResult = new ValidationResult();
  11459. validate(node2, propertySchema, propertyValidationResult, matchingSchemas2);
  11460. validationResult2.mergePropertyMatch(propertyValidationResult);
  11461. }
  11462. }
  11463. }
  11464. }
  11465. }
  11466. var propertyNames = asSchema(schema22.propertyNames);
  11467. if (propertyNames) {
  11468. for (var _q = 0, _r = node2.properties; _q < _r.length; _q++) {
  11469. var f2 = _r[_q];
  11470. var key = f2.keyNode;
  11471. if (key) {
  11472. validate(key, propertyNames, validationResult2, NoOpSchemaCollector.instance);
  11473. }
  11474. }
  11475. }
  11476. }
  11477. }
  11478. function parse3(textDocument, config) {
  11479. var problems = [];
  11480. var lastProblemOffset = -1;
  11481. var text = textDocument.getText();
  11482. var scanner = createScanner2(text, false);
  11483. var commentRanges = config && config.collectComments ? [] : void 0;
  11484. function _scanNext() {
  11485. while (true) {
  11486. var token_1 = scanner.scan();
  11487. _checkScanError();
  11488. switch (token_1) {
  11489. case 12:
  11490. case 13:
  11491. if (Array.isArray(commentRanges)) {
  11492. commentRanges.push(Range2.create(textDocument.positionAt(scanner.getTokenOffset()), textDocument.positionAt(scanner.getTokenOffset() + scanner.getTokenLength())));
  11493. }
  11494. break;
  11495. case 15:
  11496. case 14:
  11497. break;
  11498. default:
  11499. return token_1;
  11500. }
  11501. }
  11502. }
  11503. function _accept(token2) {
  11504. if (scanner.getToken() === token2) {
  11505. _scanNext();
  11506. return true;
  11507. }
  11508. return false;
  11509. }
  11510. function _errorAtRange(message, code, startOffset, endOffset, severity) {
  11511. if (severity === void 0) {
  11512. severity = DiagnosticSeverity.Error;
  11513. }
  11514. if (problems.length === 0 || startOffset !== lastProblemOffset) {
  11515. var range = Range2.create(textDocument.positionAt(startOffset), textDocument.positionAt(endOffset));
  11516. problems.push(Diagnostic.create(range, message, severity, code, textDocument.languageId));
  11517. lastProblemOffset = startOffset;
  11518. }
  11519. }
  11520. function _error(message, code, node, skipUntilAfter, skipUntil) {
  11521. if (node === void 0) {
  11522. node = void 0;
  11523. }
  11524. if (skipUntilAfter === void 0) {
  11525. skipUntilAfter = [];
  11526. }
  11527. if (skipUntil === void 0) {
  11528. skipUntil = [];
  11529. }
  11530. var start = scanner.getTokenOffset();
  11531. var end = scanner.getTokenOffset() + scanner.getTokenLength();
  11532. if (start === end && start > 0) {
  11533. start--;
  11534. while (start > 0 && /\s/.test(text.charAt(start))) {
  11535. start--;
  11536. }
  11537. end = start + 1;
  11538. }
  11539. _errorAtRange(message, code, start, end);
  11540. if (node) {
  11541. _finalize(node, false);
  11542. }
  11543. if (skipUntilAfter.length + skipUntil.length > 0) {
  11544. var token_2 = scanner.getToken();
  11545. while (token_2 !== 17) {
  11546. if (skipUntilAfter.indexOf(token_2) !== -1) {
  11547. _scanNext();
  11548. break;
  11549. } else if (skipUntil.indexOf(token_2) !== -1) {
  11550. break;
  11551. }
  11552. token_2 = _scanNext();
  11553. }
  11554. }
  11555. return node;
  11556. }
  11557. function _checkScanError() {
  11558. switch (scanner.getTokenError()) {
  11559. case 4:
  11560. _error(localize2("InvalidUnicode", "Invalid unicode sequence in string."), ErrorCode.InvalidUnicode);
  11561. return true;
  11562. case 5:
  11563. _error(localize2("InvalidEscapeCharacter", "Invalid escape character in string."), ErrorCode.InvalidEscapeCharacter);
  11564. return true;
  11565. case 3:
  11566. _error(localize2("UnexpectedEndOfNumber", "Unexpected end of number."), ErrorCode.UnexpectedEndOfNumber);
  11567. return true;
  11568. case 1:
  11569. _error(localize2("UnexpectedEndOfComment", "Unexpected end of comment."), ErrorCode.UnexpectedEndOfComment);
  11570. return true;
  11571. case 2:
  11572. _error(localize2("UnexpectedEndOfString", "Unexpected end of string."), ErrorCode.UnexpectedEndOfString);
  11573. return true;
  11574. case 6:
  11575. _error(localize2("InvalidCharacter", "Invalid characters in string. Control characters must be escaped."), ErrorCode.InvalidCharacter);
  11576. return true;
  11577. }
  11578. return false;
  11579. }
  11580. function _finalize(node, scanNext) {
  11581. node.length = scanner.getTokenOffset() + scanner.getTokenLength() - node.offset;
  11582. if (scanNext) {
  11583. _scanNext();
  11584. }
  11585. return node;
  11586. }
  11587. function _parseArray(parent) {
  11588. if (scanner.getToken() !== 3) {
  11589. return void 0;
  11590. }
  11591. var node = new ArrayASTNodeImpl(parent, scanner.getTokenOffset());
  11592. _scanNext();
  11593. var count = 0;
  11594. var needsComma = false;
  11595. while (scanner.getToken() !== 4 && scanner.getToken() !== 17) {
  11596. if (scanner.getToken() === 5) {
  11597. if (!needsComma) {
  11598. _error(localize2("ValueExpected", "Value expected"), ErrorCode.ValueExpected);
  11599. }
  11600. var commaOffset = scanner.getTokenOffset();
  11601. _scanNext();
  11602. if (scanner.getToken() === 4) {
  11603. if (needsComma) {
  11604. _errorAtRange(localize2("TrailingComma", "Trailing comma"), ErrorCode.TrailingComma, commaOffset, commaOffset + 1);
  11605. }
  11606. continue;
  11607. }
  11608. } else if (needsComma) {
  11609. _error(localize2("ExpectedComma", "Expected comma"), ErrorCode.CommaExpected);
  11610. }
  11611. var item = _parseValue(node);
  11612. if (!item) {
  11613. _error(localize2("PropertyExpected", "Value expected"), ErrorCode.ValueExpected, void 0, [], [4, 5]);
  11614. } else {
  11615. node.items.push(item);
  11616. }
  11617. needsComma = true;
  11618. }
  11619. if (scanner.getToken() !== 4) {
  11620. return _error(localize2("ExpectedCloseBracket", "Expected comma or closing bracket"), ErrorCode.CommaOrCloseBacketExpected, node);
  11621. }
  11622. return _finalize(node, true);
  11623. }
  11624. var keyPlaceholder = new StringASTNodeImpl(void 0, 0, 0);
  11625. function _parseProperty(parent, keysSeen) {
  11626. var node = new PropertyASTNodeImpl(parent, scanner.getTokenOffset(), keyPlaceholder);
  11627. var key = _parseString(node);
  11628. if (!key) {
  11629. if (scanner.getToken() === 16) {
  11630. _error(localize2("DoubleQuotesExpected", "Property keys must be doublequoted"), ErrorCode.Undefined);
  11631. var keyNode = new StringASTNodeImpl(node, scanner.getTokenOffset(), scanner.getTokenLength());
  11632. keyNode.value = scanner.getTokenValue();
  11633. key = keyNode;
  11634. _scanNext();
  11635. } else {
  11636. return void 0;
  11637. }
  11638. }
  11639. node.keyNode = key;
  11640. var seen = keysSeen[key.value];
  11641. if (seen) {
  11642. _errorAtRange(localize2("DuplicateKeyWarning", "Duplicate object key"), ErrorCode.DuplicateKey, node.keyNode.offset, node.keyNode.offset + node.keyNode.length, DiagnosticSeverity.Warning);
  11643. if (typeof seen === "object") {
  11644. _errorAtRange(localize2("DuplicateKeyWarning", "Duplicate object key"), ErrorCode.DuplicateKey, seen.keyNode.offset, seen.keyNode.offset + seen.keyNode.length, DiagnosticSeverity.Warning);
  11645. }
  11646. keysSeen[key.value] = true;
  11647. } else {
  11648. keysSeen[key.value] = node;
  11649. }
  11650. if (scanner.getToken() === 6) {
  11651. node.colonOffset = scanner.getTokenOffset();
  11652. _scanNext();
  11653. } else {
  11654. _error(localize2("ColonExpected", "Colon expected"), ErrorCode.ColonExpected);
  11655. if (scanner.getToken() === 10 && textDocument.positionAt(key.offset + key.length).line < textDocument.positionAt(scanner.getTokenOffset()).line) {
  11656. node.length = key.length;
  11657. return node;
  11658. }
  11659. }
  11660. var value = _parseValue(node);
  11661. if (!value) {
  11662. return _error(localize2("ValueExpected", "Value expected"), ErrorCode.ValueExpected, node, [], [2, 5]);
  11663. }
  11664. node.valueNode = value;
  11665. node.length = value.offset + value.length - node.offset;
  11666. return node;
  11667. }
  11668. function _parseObject(parent) {
  11669. if (scanner.getToken() !== 1) {
  11670. return void 0;
  11671. }
  11672. var node = new ObjectASTNodeImpl(parent, scanner.getTokenOffset());
  11673. var keysSeen = /* @__PURE__ */ Object.create(null);
  11674. _scanNext();
  11675. var needsComma = false;
  11676. while (scanner.getToken() !== 2 && scanner.getToken() !== 17) {
  11677. if (scanner.getToken() === 5) {
  11678. if (!needsComma) {
  11679. _error(localize2("PropertyExpected", "Property expected"), ErrorCode.PropertyExpected);
  11680. }
  11681. var commaOffset = scanner.getTokenOffset();
  11682. _scanNext();
  11683. if (scanner.getToken() === 2) {
  11684. if (needsComma) {
  11685. _errorAtRange(localize2("TrailingComma", "Trailing comma"), ErrorCode.TrailingComma, commaOffset, commaOffset + 1);
  11686. }
  11687. continue;
  11688. }
  11689. } else if (needsComma) {
  11690. _error(localize2("ExpectedComma", "Expected comma"), ErrorCode.CommaExpected);
  11691. }
  11692. var property2 = _parseProperty(node, keysSeen);
  11693. if (!property2) {
  11694. _error(localize2("PropertyExpected", "Property expected"), ErrorCode.PropertyExpected, void 0, [], [2, 5]);
  11695. } else {
  11696. node.properties.push(property2);
  11697. }
  11698. needsComma = true;
  11699. }
  11700. if (scanner.getToken() !== 2) {
  11701. return _error(localize2("ExpectedCloseBrace", "Expected comma or closing brace"), ErrorCode.CommaOrCloseBraceExpected, node);
  11702. }
  11703. return _finalize(node, true);
  11704. }
  11705. function _parseString(parent) {
  11706. if (scanner.getToken() !== 10) {
  11707. return void 0;
  11708. }
  11709. var node = new StringASTNodeImpl(parent, scanner.getTokenOffset());
  11710. node.value = scanner.getTokenValue();
  11711. return _finalize(node, true);
  11712. }
  11713. function _parseNumber(parent) {
  11714. if (scanner.getToken() !== 11) {
  11715. return void 0;
  11716. }
  11717. var node = new NumberASTNodeImpl(parent, scanner.getTokenOffset());
  11718. if (scanner.getTokenError() === 0) {
  11719. var tokenValue = scanner.getTokenValue();
  11720. try {
  11721. var numberValue = JSON.parse(tokenValue);
  11722. if (!isNumber(numberValue)) {
  11723. return _error(localize2("InvalidNumberFormat", "Invalid number format."), ErrorCode.Undefined, node);
  11724. }
  11725. node.value = numberValue;
  11726. } catch (e) {
  11727. return _error(localize2("InvalidNumberFormat", "Invalid number format."), ErrorCode.Undefined, node);
  11728. }
  11729. node.isInteger = tokenValue.indexOf(".") === -1;
  11730. }
  11731. return _finalize(node, true);
  11732. }
  11733. function _parseLiteral(parent) {
  11734. var node;
  11735. switch (scanner.getToken()) {
  11736. case 7:
  11737. return _finalize(new NullASTNodeImpl(parent, scanner.getTokenOffset()), true);
  11738. case 8:
  11739. return _finalize(new BooleanASTNodeImpl(parent, true, scanner.getTokenOffset()), true);
  11740. case 9:
  11741. return _finalize(new BooleanASTNodeImpl(parent, false, scanner.getTokenOffset()), true);
  11742. default:
  11743. return void 0;
  11744. }
  11745. }
  11746. function _parseValue(parent) {
  11747. return _parseArray(parent) || _parseObject(parent) || _parseString(parent) || _parseNumber(parent) || _parseLiteral(parent);
  11748. }
  11749. var _root = void 0;
  11750. var token = _scanNext();
  11751. if (token !== 17) {
  11752. _root = _parseValue(_root);
  11753. if (!_root) {
  11754. _error(localize2("Invalid symbol", "Expected a JSON object, array or literal."), ErrorCode.Undefined);
  11755. } else if (scanner.getToken() !== 17) {
  11756. _error(localize2("End of file expected", "End of file expected."), ErrorCode.Undefined);
  11757. }
  11758. }
  11759. return new JSONDocument(_root, problems, commentRanges);
  11760. }
  11761. function stringifyObject(obj, indent, stringifyLiteral) {
  11762. if (obj !== null && typeof obj === "object") {
  11763. var newIndent = indent + " ";
  11764. if (Array.isArray(obj)) {
  11765. if (obj.length === 0) {
  11766. return "[]";
  11767. }
  11768. var result = "[\n";
  11769. for (var i = 0; i < obj.length; i++) {
  11770. result += newIndent + stringifyObject(obj[i], newIndent, stringifyLiteral);
  11771. if (i < obj.length - 1) {
  11772. result += ",";
  11773. }
  11774. result += "\n";
  11775. }
  11776. result += indent + "]";
  11777. return result;
  11778. } else {
  11779. var keys = Object.keys(obj);
  11780. if (keys.length === 0) {
  11781. return "{}";
  11782. }
  11783. var result = "{\n";
  11784. for (var i = 0; i < keys.length; i++) {
  11785. var key = keys[i];
  11786. result += newIndent + JSON.stringify(key) + ": " + stringifyObject(obj[key], newIndent, stringifyLiteral);
  11787. if (i < keys.length - 1) {
  11788. result += ",";
  11789. }
  11790. result += "\n";
  11791. }
  11792. result += indent + "}";
  11793. return result;
  11794. }
  11795. }
  11796. return stringifyLiteral(obj);
  11797. }
  11798. var localize3 = loadMessageBundle();
  11799. var valueCommitCharacters = [",", "}", "]"];
  11800. var propertyCommitCharacters = [":"];
  11801. var JSONCompletion = function() {
  11802. function JSONCompletion2(schemaService, contributions, promiseConstructor, clientCapabilities) {
  11803. if (contributions === void 0) {
  11804. contributions = [];
  11805. }
  11806. if (promiseConstructor === void 0) {
  11807. promiseConstructor = Promise;
  11808. }
  11809. if (clientCapabilities === void 0) {
  11810. clientCapabilities = {};
  11811. }
  11812. this.schemaService = schemaService;
  11813. this.contributions = contributions;
  11814. this.promiseConstructor = promiseConstructor;
  11815. this.clientCapabilities = clientCapabilities;
  11816. }
  11817. JSONCompletion2.prototype.doResolve = function(item) {
  11818. for (var i = this.contributions.length - 1; i >= 0; i--) {
  11819. var resolveCompletion = this.contributions[i].resolveCompletion;
  11820. if (resolveCompletion) {
  11821. var resolver = resolveCompletion(item);
  11822. if (resolver) {
  11823. return resolver;
  11824. }
  11825. }
  11826. }
  11827. return this.promiseConstructor.resolve(item);
  11828. };
  11829. JSONCompletion2.prototype.doComplete = function(document, position, doc) {
  11830. var _this = this;
  11831. var result = {
  11832. items: [],
  11833. isIncomplete: false
  11834. };
  11835. var text = document.getText();
  11836. var offset = document.offsetAt(position);
  11837. var node = doc.getNodeFromOffset(offset, true);
  11838. if (this.isInComment(document, node ? node.offset : 0, offset)) {
  11839. return Promise.resolve(result);
  11840. }
  11841. if (node && offset === node.offset + node.length && offset > 0) {
  11842. var ch = text[offset - 1];
  11843. if (node.type === "object" && ch === "}" || node.type === "array" && ch === "]") {
  11844. node = node.parent;
  11845. }
  11846. }
  11847. var currentWord = this.getCurrentWord(document, offset);
  11848. var overwriteRange;
  11849. if (node && (node.type === "string" || node.type === "number" || node.type === "boolean" || node.type === "null")) {
  11850. overwriteRange = Range2.create(document.positionAt(node.offset), document.positionAt(node.offset + node.length));
  11851. } else {
  11852. var overwriteStart = offset - currentWord.length;
  11853. if (overwriteStart > 0 && text[overwriteStart - 1] === '"') {
  11854. overwriteStart--;
  11855. }
  11856. overwriteRange = Range2.create(document.positionAt(overwriteStart), position);
  11857. }
  11858. var supportsCommitCharacters = false;
  11859. var proposed = {};
  11860. var collector = {
  11861. add: function(suggestion) {
  11862. var label = suggestion.label;
  11863. var existing = proposed[label];
  11864. if (!existing) {
  11865. label = label.replace(/[\n]/g, "\u21B5");
  11866. if (label.length > 60) {
  11867. var shortendedLabel = label.substr(0, 57).trim() + "...";
  11868. if (!proposed[shortendedLabel]) {
  11869. label = shortendedLabel;
  11870. }
  11871. }
  11872. if (overwriteRange && suggestion.insertText !== void 0) {
  11873. suggestion.textEdit = TextEdit.replace(overwriteRange, suggestion.insertText);
  11874. }
  11875. if (supportsCommitCharacters) {
  11876. suggestion.commitCharacters = suggestion.kind === CompletionItemKind2.Property ? propertyCommitCharacters : valueCommitCharacters;
  11877. }
  11878. suggestion.label = label;
  11879. proposed[label] = suggestion;
  11880. result.items.push(suggestion);
  11881. } else {
  11882. if (!existing.documentation) {
  11883. existing.documentation = suggestion.documentation;
  11884. }
  11885. if (!existing.detail) {
  11886. existing.detail = suggestion.detail;
  11887. }
  11888. }
  11889. },
  11890. setAsIncomplete: function() {
  11891. result.isIncomplete = true;
  11892. },
  11893. error: function(message) {
  11894. console.error(message);
  11895. },
  11896. log: function(message) {
  11897. console.log(message);
  11898. },
  11899. getNumberOfProposals: function() {
  11900. return result.items.length;
  11901. }
  11902. };
  11903. return this.schemaService.getSchemaForResource(document.uri, doc).then(function(schema2) {
  11904. var collectionPromises = [];
  11905. var addValue = true;
  11906. var currentKey = "";
  11907. var currentProperty = void 0;
  11908. if (node) {
  11909. if (node.type === "string") {
  11910. var parent = node.parent;
  11911. if (parent && parent.type === "property" && parent.keyNode === node) {
  11912. addValue = !parent.valueNode;
  11913. currentProperty = parent;
  11914. currentKey = text.substr(node.offset + 1, node.length - 2);
  11915. if (parent) {
  11916. node = parent.parent;
  11917. }
  11918. }
  11919. }
  11920. }
  11921. if (node && node.type === "object") {
  11922. if (node.offset === offset) {
  11923. return result;
  11924. }
  11925. var properties = node.properties;
  11926. properties.forEach(function(p) {
  11927. if (!currentProperty || currentProperty !== p) {
  11928. proposed[p.keyNode.value] = CompletionItem.create("__");
  11929. }
  11930. });
  11931. var separatorAfter_1 = "";
  11932. if (addValue) {
  11933. separatorAfter_1 = _this.evaluateSeparatorAfter(document, document.offsetAt(overwriteRange.end));
  11934. }
  11935. if (schema2) {
  11936. _this.getPropertyCompletions(schema2, doc, node, addValue, separatorAfter_1, collector);
  11937. } else {
  11938. _this.getSchemaLessPropertyCompletions(doc, node, currentKey, collector);
  11939. }
  11940. var location_1 = getNodePath3(node);
  11941. _this.contributions.forEach(function(contribution) {
  11942. var collectPromise = contribution.collectPropertyCompletions(document.uri, location_1, currentWord, addValue, separatorAfter_1 === "", collector);
  11943. if (collectPromise) {
  11944. collectionPromises.push(collectPromise);
  11945. }
  11946. });
  11947. if (!schema2 && currentWord.length > 0 && text.charAt(offset - currentWord.length - 1) !== '"') {
  11948. collector.add({
  11949. kind: CompletionItemKind2.Property,
  11950. label: _this.getLabelForValue(currentWord),
  11951. insertText: _this.getInsertTextForProperty(currentWord, void 0, false, separatorAfter_1),
  11952. insertTextFormat: InsertTextFormat.Snippet,
  11953. documentation: ""
  11954. });
  11955. collector.setAsIncomplete();
  11956. }
  11957. }
  11958. var types3 = {};
  11959. if (schema2) {
  11960. _this.getValueCompletions(schema2, doc, node, offset, document, collector, types3);
  11961. } else {
  11962. _this.getSchemaLessValueCompletions(doc, node, offset, document, collector);
  11963. }
  11964. if (_this.contributions.length > 0) {
  11965. _this.getContributedValueCompletions(doc, node, offset, document, collector, collectionPromises);
  11966. }
  11967. return _this.promiseConstructor.all(collectionPromises).then(function() {
  11968. if (collector.getNumberOfProposals() === 0) {
  11969. var offsetForSeparator = offset;
  11970. if (node && (node.type === "string" || node.type === "number" || node.type === "boolean" || node.type === "null")) {
  11971. offsetForSeparator = node.offset + node.length;
  11972. }
  11973. var separatorAfter = _this.evaluateSeparatorAfter(document, offsetForSeparator);
  11974. _this.addFillerValueCompletions(types3, separatorAfter, collector);
  11975. }
  11976. return result;
  11977. });
  11978. });
  11979. };
  11980. JSONCompletion2.prototype.getPropertyCompletions = function(schema2, doc, node, addValue, separatorAfter, collector) {
  11981. var _this = this;
  11982. var matchingSchemas = doc.getMatchingSchemas(schema2.schema, node.offset);
  11983. matchingSchemas.forEach(function(s) {
  11984. if (s.node === node && !s.inverted) {
  11985. var schemaProperties_1 = s.schema.properties;
  11986. if (schemaProperties_1) {
  11987. Object.keys(schemaProperties_1).forEach(function(key) {
  11988. var propertySchema = schemaProperties_1[key];
  11989. if (typeof propertySchema === "object" && !propertySchema.deprecationMessage && !propertySchema.doNotSuggest) {
  11990. var proposal = {
  11991. kind: CompletionItemKind2.Property,
  11992. label: key,
  11993. insertText: _this.getInsertTextForProperty(key, propertySchema, addValue, separatorAfter),
  11994. insertTextFormat: InsertTextFormat.Snippet,
  11995. filterText: _this.getFilterTextForValue(key),
  11996. documentation: _this.fromMarkup(propertySchema.markdownDescription) || propertySchema.description || ""
  11997. };
  11998. if (propertySchema.suggestSortText !== void 0) {
  11999. proposal.sortText = propertySchema.suggestSortText;
  12000. }
  12001. if (proposal.insertText && endsWith(proposal.insertText, "$1".concat(separatorAfter))) {
  12002. proposal.command = {
  12003. title: "Suggest",
  12004. command: "editor.action.triggerSuggest"
  12005. };
  12006. }
  12007. collector.add(proposal);
  12008. }
  12009. });
  12010. }
  12011. var schemaPropertyNames_1 = s.schema.propertyNames;
  12012. if (typeof schemaPropertyNames_1 === "object" && !schemaPropertyNames_1.deprecationMessage && !schemaPropertyNames_1.doNotSuggest) {
  12013. var propertyNameCompletionItem = function(name, enumDescription2) {
  12014. if (enumDescription2 === void 0) {
  12015. enumDescription2 = void 0;
  12016. }
  12017. var proposal = {
  12018. kind: CompletionItemKind2.Property,
  12019. label: name,
  12020. insertText: _this.getInsertTextForProperty(name, void 0, addValue, separatorAfter),
  12021. insertTextFormat: InsertTextFormat.Snippet,
  12022. filterText: _this.getFilterTextForValue(name),
  12023. documentation: enumDescription2 || _this.fromMarkup(schemaPropertyNames_1.markdownDescription) || schemaPropertyNames_1.description || ""
  12024. };
  12025. if (schemaPropertyNames_1.suggestSortText !== void 0) {
  12026. proposal.sortText = schemaPropertyNames_1.suggestSortText;
  12027. }
  12028. if (proposal.insertText && endsWith(proposal.insertText, "$1".concat(separatorAfter))) {
  12029. proposal.command = {
  12030. title: "Suggest",
  12031. command: "editor.action.triggerSuggest"
  12032. };
  12033. }
  12034. collector.add(proposal);
  12035. };
  12036. if (schemaPropertyNames_1.enum) {
  12037. for (var i = 0; i < schemaPropertyNames_1.enum.length; i++) {
  12038. var enumDescription = void 0;
  12039. if (schemaPropertyNames_1.markdownEnumDescriptions && i < schemaPropertyNames_1.markdownEnumDescriptions.length) {
  12040. enumDescription = _this.fromMarkup(schemaPropertyNames_1.markdownEnumDescriptions[i]);
  12041. } else if (schemaPropertyNames_1.enumDescriptions && i < schemaPropertyNames_1.enumDescriptions.length) {
  12042. enumDescription = schemaPropertyNames_1.enumDescriptions[i];
  12043. }
  12044. propertyNameCompletionItem(schemaPropertyNames_1.enum[i], enumDescription);
  12045. }
  12046. }
  12047. if (schemaPropertyNames_1.const) {
  12048. propertyNameCompletionItem(schemaPropertyNames_1.const);
  12049. }
  12050. }
  12051. }
  12052. });
  12053. };
  12054. JSONCompletion2.prototype.getSchemaLessPropertyCompletions = function(doc, node, currentKey, collector) {
  12055. var _this = this;
  12056. var collectCompletionsForSimilarObject = function(obj) {
  12057. obj.properties.forEach(function(p) {
  12058. var key = p.keyNode.value;
  12059. collector.add({
  12060. kind: CompletionItemKind2.Property,
  12061. label: key,
  12062. insertText: _this.getInsertTextForValue(key, ""),
  12063. insertTextFormat: InsertTextFormat.Snippet,
  12064. filterText: _this.getFilterTextForValue(key),
  12065. documentation: ""
  12066. });
  12067. });
  12068. };
  12069. if (node.parent) {
  12070. if (node.parent.type === "property") {
  12071. var parentKey_1 = node.parent.keyNode.value;
  12072. doc.visit(function(n) {
  12073. if (n.type === "property" && n !== node.parent && n.keyNode.value === parentKey_1 && n.valueNode && n.valueNode.type === "object") {
  12074. collectCompletionsForSimilarObject(n.valueNode);
  12075. }
  12076. return true;
  12077. });
  12078. } else if (node.parent.type === "array") {
  12079. node.parent.items.forEach(function(n) {
  12080. if (n.type === "object" && n !== node) {
  12081. collectCompletionsForSimilarObject(n);
  12082. }
  12083. });
  12084. }
  12085. } else if (node.type === "object") {
  12086. collector.add({
  12087. kind: CompletionItemKind2.Property,
  12088. label: "$schema",
  12089. insertText: this.getInsertTextForProperty("$schema", void 0, true, ""),
  12090. insertTextFormat: InsertTextFormat.Snippet,
  12091. documentation: "",
  12092. filterText: this.getFilterTextForValue("$schema")
  12093. });
  12094. }
  12095. };
  12096. JSONCompletion2.prototype.getSchemaLessValueCompletions = function(doc, node, offset, document, collector) {
  12097. var _this = this;
  12098. var offsetForSeparator = offset;
  12099. if (node && (node.type === "string" || node.type === "number" || node.type === "boolean" || node.type === "null")) {
  12100. offsetForSeparator = node.offset + node.length;
  12101. node = node.parent;
  12102. }
  12103. if (!node) {
  12104. collector.add({
  12105. kind: this.getSuggestionKind("object"),
  12106. label: "Empty object",
  12107. insertText: this.getInsertTextForValue({}, ""),
  12108. insertTextFormat: InsertTextFormat.Snippet,
  12109. documentation: ""
  12110. });
  12111. collector.add({
  12112. kind: this.getSuggestionKind("array"),
  12113. label: "Empty array",
  12114. insertText: this.getInsertTextForValue([], ""),
  12115. insertTextFormat: InsertTextFormat.Snippet,
  12116. documentation: ""
  12117. });
  12118. return;
  12119. }
  12120. var separatorAfter = this.evaluateSeparatorAfter(document, offsetForSeparator);
  12121. var collectSuggestionsForValues = function(value) {
  12122. if (value.parent && !contains2(value.parent, offset, true)) {
  12123. collector.add({
  12124. kind: _this.getSuggestionKind(value.type),
  12125. label: _this.getLabelTextForMatchingNode(value, document),
  12126. insertText: _this.getInsertTextForMatchingNode(value, document, separatorAfter),
  12127. insertTextFormat: InsertTextFormat.Snippet,
  12128. documentation: ""
  12129. });
  12130. }
  12131. if (value.type === "boolean") {
  12132. _this.addBooleanValueCompletion(!value.value, separatorAfter, collector);
  12133. }
  12134. };
  12135. if (node.type === "property") {
  12136. if (offset > (node.colonOffset || 0)) {
  12137. var valueNode = node.valueNode;
  12138. if (valueNode && (offset > valueNode.offset + valueNode.length || valueNode.type === "object" || valueNode.type === "array")) {
  12139. return;
  12140. }
  12141. var parentKey_2 = node.keyNode.value;
  12142. doc.visit(function(n) {
  12143. if (n.type === "property" && n.keyNode.value === parentKey_2 && n.valueNode) {
  12144. collectSuggestionsForValues(n.valueNode);
  12145. }
  12146. return true;
  12147. });
  12148. if (parentKey_2 === "$schema" && node.parent && !node.parent.parent) {
  12149. this.addDollarSchemaCompletions(separatorAfter, collector);
  12150. }
  12151. }
  12152. }
  12153. if (node.type === "array") {
  12154. if (node.parent && node.parent.type === "property") {
  12155. var parentKey_3 = node.parent.keyNode.value;
  12156. doc.visit(function(n) {
  12157. if (n.type === "property" && n.keyNode.value === parentKey_3 && n.valueNode && n.valueNode.type === "array") {
  12158. n.valueNode.items.forEach(collectSuggestionsForValues);
  12159. }
  12160. return true;
  12161. });
  12162. } else {
  12163. node.items.forEach(collectSuggestionsForValues);
  12164. }
  12165. }
  12166. };
  12167. JSONCompletion2.prototype.getValueCompletions = function(schema2, doc, node, offset, document, collector, types3) {
  12168. var offsetForSeparator = offset;
  12169. var parentKey = void 0;
  12170. var valueNode = void 0;
  12171. if (node && (node.type === "string" || node.type === "number" || node.type === "boolean" || node.type === "null")) {
  12172. offsetForSeparator = node.offset + node.length;
  12173. valueNode = node;
  12174. node = node.parent;
  12175. }
  12176. if (!node) {
  12177. this.addSchemaValueCompletions(schema2.schema, "", collector, types3);
  12178. return;
  12179. }
  12180. if (node.type === "property" && offset > (node.colonOffset || 0)) {
  12181. var valueNode_1 = node.valueNode;
  12182. if (valueNode_1 && offset > valueNode_1.offset + valueNode_1.length) {
  12183. return;
  12184. }
  12185. parentKey = node.keyNode.value;
  12186. node = node.parent;
  12187. }
  12188. if (node && (parentKey !== void 0 || node.type === "array")) {
  12189. var separatorAfter = this.evaluateSeparatorAfter(document, offsetForSeparator);
  12190. var matchingSchemas = doc.getMatchingSchemas(schema2.schema, node.offset, valueNode);
  12191. for (var _i = 0, matchingSchemas_1 = matchingSchemas; _i < matchingSchemas_1.length; _i++) {
  12192. var s = matchingSchemas_1[_i];
  12193. if (s.node === node && !s.inverted && s.schema) {
  12194. if (node.type === "array" && s.schema.items) {
  12195. if (Array.isArray(s.schema.items)) {
  12196. var index = this.findItemAtOffset(node, document, offset);
  12197. if (index < s.schema.items.length) {
  12198. this.addSchemaValueCompletions(s.schema.items[index], separatorAfter, collector, types3);
  12199. }
  12200. } else {
  12201. this.addSchemaValueCompletions(s.schema.items, separatorAfter, collector, types3);
  12202. }
  12203. }
  12204. if (parentKey !== void 0) {
  12205. var propertyMatched = false;
  12206. if (s.schema.properties) {
  12207. var propertySchema = s.schema.properties[parentKey];
  12208. if (propertySchema) {
  12209. propertyMatched = true;
  12210. this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types3);
  12211. }
  12212. }
  12213. if (s.schema.patternProperties && !propertyMatched) {
  12214. for (var _a3 = 0, _b = Object.keys(s.schema.patternProperties); _a3 < _b.length; _a3++) {
  12215. var pattern = _b[_a3];
  12216. var regex = extendedRegExp(pattern);
  12217. if (regex === null || regex === void 0 ? void 0 : regex.test(parentKey)) {
  12218. propertyMatched = true;
  12219. var propertySchema = s.schema.patternProperties[pattern];
  12220. this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types3);
  12221. }
  12222. }
  12223. }
  12224. if (s.schema.additionalProperties && !propertyMatched) {
  12225. var propertySchema = s.schema.additionalProperties;
  12226. this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types3);
  12227. }
  12228. }
  12229. }
  12230. }
  12231. if (parentKey === "$schema" && !node.parent) {
  12232. this.addDollarSchemaCompletions(separatorAfter, collector);
  12233. }
  12234. if (types3["boolean"]) {
  12235. this.addBooleanValueCompletion(true, separatorAfter, collector);
  12236. this.addBooleanValueCompletion(false, separatorAfter, collector);
  12237. }
  12238. if (types3["null"]) {
  12239. this.addNullValueCompletion(separatorAfter, collector);
  12240. }
  12241. }
  12242. };
  12243. JSONCompletion2.prototype.getContributedValueCompletions = function(doc, node, offset, document, collector, collectionPromises) {
  12244. if (!node) {
  12245. this.contributions.forEach(function(contribution) {
  12246. var collectPromise = contribution.collectDefaultCompletions(document.uri, collector);
  12247. if (collectPromise) {
  12248. collectionPromises.push(collectPromise);
  12249. }
  12250. });
  12251. } else {
  12252. if (node.type === "string" || node.type === "number" || node.type === "boolean" || node.type === "null") {
  12253. node = node.parent;
  12254. }
  12255. if (node && node.type === "property" && offset > (node.colonOffset || 0)) {
  12256. var parentKey_4 = node.keyNode.value;
  12257. var valueNode = node.valueNode;
  12258. if ((!valueNode || offset <= valueNode.offset + valueNode.length) && node.parent) {
  12259. var location_2 = getNodePath3(node.parent);
  12260. this.contributions.forEach(function(contribution) {
  12261. var collectPromise = contribution.collectValueCompletions(document.uri, location_2, parentKey_4, collector);
  12262. if (collectPromise) {
  12263. collectionPromises.push(collectPromise);
  12264. }
  12265. });
  12266. }
  12267. }
  12268. }
  12269. };
  12270. JSONCompletion2.prototype.addSchemaValueCompletions = function(schema2, separatorAfter, collector, types3) {
  12271. var _this = this;
  12272. if (typeof schema2 === "object") {
  12273. this.addEnumValueCompletions(schema2, separatorAfter, collector);
  12274. this.addDefaultValueCompletions(schema2, separatorAfter, collector);
  12275. this.collectTypes(schema2, types3);
  12276. if (Array.isArray(schema2.allOf)) {
  12277. schema2.allOf.forEach(function(s) {
  12278. return _this.addSchemaValueCompletions(s, separatorAfter, collector, types3);
  12279. });
  12280. }
  12281. if (Array.isArray(schema2.anyOf)) {
  12282. schema2.anyOf.forEach(function(s) {
  12283. return _this.addSchemaValueCompletions(s, separatorAfter, collector, types3);
  12284. });
  12285. }
  12286. if (Array.isArray(schema2.oneOf)) {
  12287. schema2.oneOf.forEach(function(s) {
  12288. return _this.addSchemaValueCompletions(s, separatorAfter, collector, types3);
  12289. });
  12290. }
  12291. }
  12292. };
  12293. JSONCompletion2.prototype.addDefaultValueCompletions = function(schema2, separatorAfter, collector, arrayDepth) {
  12294. var _this = this;
  12295. if (arrayDepth === void 0) {
  12296. arrayDepth = 0;
  12297. }
  12298. var hasProposals = false;
  12299. if (isDefined(schema2.default)) {
  12300. var type = schema2.type;
  12301. var value = schema2.default;
  12302. for (var i = arrayDepth; i > 0; i--) {
  12303. value = [value];
  12304. type = "array";
  12305. }
  12306. collector.add({
  12307. kind: this.getSuggestionKind(type),
  12308. label: this.getLabelForValue(value),
  12309. insertText: this.getInsertTextForValue(value, separatorAfter),
  12310. insertTextFormat: InsertTextFormat.Snippet,
  12311. detail: localize3("json.suggest.default", "Default value")
  12312. });
  12313. hasProposals = true;
  12314. }
  12315. if (Array.isArray(schema2.examples)) {
  12316. schema2.examples.forEach(function(example) {
  12317. var type2 = schema2.type;
  12318. var value2 = example;
  12319. for (var i2 = arrayDepth; i2 > 0; i2--) {
  12320. value2 = [value2];
  12321. type2 = "array";
  12322. }
  12323. collector.add({
  12324. kind: _this.getSuggestionKind(type2),
  12325. label: _this.getLabelForValue(value2),
  12326. insertText: _this.getInsertTextForValue(value2, separatorAfter),
  12327. insertTextFormat: InsertTextFormat.Snippet
  12328. });
  12329. hasProposals = true;
  12330. });
  12331. }
  12332. if (Array.isArray(schema2.defaultSnippets)) {
  12333. schema2.defaultSnippets.forEach(function(s) {
  12334. var type2 = schema2.type;
  12335. var value2 = s.body;
  12336. var label = s.label;
  12337. var insertText;
  12338. var filterText;
  12339. if (isDefined(value2)) {
  12340. var type_1 = schema2.type;
  12341. for (var i2 = arrayDepth; i2 > 0; i2--) {
  12342. value2 = [value2];
  12343. type_1 = "array";
  12344. }
  12345. insertText = _this.getInsertTextForSnippetValue(value2, separatorAfter);
  12346. filterText = _this.getFilterTextForSnippetValue(value2);
  12347. label = label || _this.getLabelForSnippetValue(value2);
  12348. } else if (typeof s.bodyText === "string") {
  12349. var prefix = "", suffix = "", indent = "";
  12350. for (var i2 = arrayDepth; i2 > 0; i2--) {
  12351. prefix = prefix + indent + "[\n";
  12352. suffix = suffix + "\n" + indent + "]";
  12353. indent += " ";
  12354. type2 = "array";
  12355. }
  12356. insertText = prefix + indent + s.bodyText.split("\n").join("\n" + indent) + suffix + separatorAfter;
  12357. label = label || insertText, filterText = insertText.replace(/[\n]/g, "");
  12358. } else {
  12359. return;
  12360. }
  12361. collector.add({
  12362. kind: _this.getSuggestionKind(type2),
  12363. label,
  12364. documentation: _this.fromMarkup(s.markdownDescription) || s.description,
  12365. insertText,
  12366. insertTextFormat: InsertTextFormat.Snippet,
  12367. filterText
  12368. });
  12369. hasProposals = true;
  12370. });
  12371. }
  12372. if (!hasProposals && typeof schema2.items === "object" && !Array.isArray(schema2.items) && arrayDepth < 5) {
  12373. this.addDefaultValueCompletions(schema2.items, separatorAfter, collector, arrayDepth + 1);
  12374. }
  12375. };
  12376. JSONCompletion2.prototype.addEnumValueCompletions = function(schema2, separatorAfter, collector) {
  12377. if (isDefined(schema2.const)) {
  12378. collector.add({
  12379. kind: this.getSuggestionKind(schema2.type),
  12380. label: this.getLabelForValue(schema2.const),
  12381. insertText: this.getInsertTextForValue(schema2.const, separatorAfter),
  12382. insertTextFormat: InsertTextFormat.Snippet,
  12383. documentation: this.fromMarkup(schema2.markdownDescription) || schema2.description
  12384. });
  12385. }
  12386. if (Array.isArray(schema2.enum)) {
  12387. for (var i = 0, length = schema2.enum.length; i < length; i++) {
  12388. var enm = schema2.enum[i];
  12389. var documentation = this.fromMarkup(schema2.markdownDescription) || schema2.description;
  12390. if (schema2.markdownEnumDescriptions && i < schema2.markdownEnumDescriptions.length && this.doesSupportMarkdown()) {
  12391. documentation = this.fromMarkup(schema2.markdownEnumDescriptions[i]);
  12392. } else if (schema2.enumDescriptions && i < schema2.enumDescriptions.length) {
  12393. documentation = schema2.enumDescriptions[i];
  12394. }
  12395. collector.add({
  12396. kind: this.getSuggestionKind(schema2.type),
  12397. label: this.getLabelForValue(enm),
  12398. insertText: this.getInsertTextForValue(enm, separatorAfter),
  12399. insertTextFormat: InsertTextFormat.Snippet,
  12400. documentation
  12401. });
  12402. }
  12403. }
  12404. };
  12405. JSONCompletion2.prototype.collectTypes = function(schema2, types3) {
  12406. if (Array.isArray(schema2.enum) || isDefined(schema2.const)) {
  12407. return;
  12408. }
  12409. var type = schema2.type;
  12410. if (Array.isArray(type)) {
  12411. type.forEach(function(t) {
  12412. return types3[t] = true;
  12413. });
  12414. } else if (type) {
  12415. types3[type] = true;
  12416. }
  12417. };
  12418. JSONCompletion2.prototype.addFillerValueCompletions = function(types3, separatorAfter, collector) {
  12419. if (types3["object"]) {
  12420. collector.add({
  12421. kind: this.getSuggestionKind("object"),
  12422. label: "{}",
  12423. insertText: this.getInsertTextForGuessedValue({}, separatorAfter),
  12424. insertTextFormat: InsertTextFormat.Snippet,
  12425. detail: localize3("defaults.object", "New object"),
  12426. documentation: ""
  12427. });
  12428. }
  12429. if (types3["array"]) {
  12430. collector.add({
  12431. kind: this.getSuggestionKind("array"),
  12432. label: "[]",
  12433. insertText: this.getInsertTextForGuessedValue([], separatorAfter),
  12434. insertTextFormat: InsertTextFormat.Snippet,
  12435. detail: localize3("defaults.array", "New array"),
  12436. documentation: ""
  12437. });
  12438. }
  12439. };
  12440. JSONCompletion2.prototype.addBooleanValueCompletion = function(value, separatorAfter, collector) {
  12441. collector.add({
  12442. kind: this.getSuggestionKind("boolean"),
  12443. label: value ? "true" : "false",
  12444. insertText: this.getInsertTextForValue(value, separatorAfter),
  12445. insertTextFormat: InsertTextFormat.Snippet,
  12446. documentation: ""
  12447. });
  12448. };
  12449. JSONCompletion2.prototype.addNullValueCompletion = function(separatorAfter, collector) {
  12450. collector.add({
  12451. kind: this.getSuggestionKind("null"),
  12452. label: "null",
  12453. insertText: "null" + separatorAfter,
  12454. insertTextFormat: InsertTextFormat.Snippet,
  12455. documentation: ""
  12456. });
  12457. };
  12458. JSONCompletion2.prototype.addDollarSchemaCompletions = function(separatorAfter, collector) {
  12459. var _this = this;
  12460. var schemaIds = this.schemaService.getRegisteredSchemaIds(function(schema2) {
  12461. return schema2 === "http" || schema2 === "https";
  12462. });
  12463. schemaIds.forEach(function(schemaId) {
  12464. return collector.add({
  12465. kind: CompletionItemKind2.Module,
  12466. label: _this.getLabelForValue(schemaId),
  12467. filterText: _this.getFilterTextForValue(schemaId),
  12468. insertText: _this.getInsertTextForValue(schemaId, separatorAfter),
  12469. insertTextFormat: InsertTextFormat.Snippet,
  12470. documentation: ""
  12471. });
  12472. });
  12473. };
  12474. JSONCompletion2.prototype.getLabelForValue = function(value) {
  12475. return JSON.stringify(value);
  12476. };
  12477. JSONCompletion2.prototype.getFilterTextForValue = function(value) {
  12478. return JSON.stringify(value);
  12479. };
  12480. JSONCompletion2.prototype.getFilterTextForSnippetValue = function(value) {
  12481. return JSON.stringify(value).replace(/\$\{\d+:([^}]+)\}|\$\d+/g, "$1");
  12482. };
  12483. JSONCompletion2.prototype.getLabelForSnippetValue = function(value) {
  12484. var label = JSON.stringify(value);
  12485. return label.replace(/\$\{\d+:([^}]+)\}|\$\d+/g, "$1");
  12486. };
  12487. JSONCompletion2.prototype.getInsertTextForPlainText = function(text) {
  12488. return text.replace(/[\\\$\}]/g, "\\$&");
  12489. };
  12490. JSONCompletion2.prototype.getInsertTextForValue = function(value, separatorAfter) {
  12491. var text = JSON.stringify(value, null, " ");
  12492. if (text === "{}") {
  12493. return "{$1}" + separatorAfter;
  12494. } else if (text === "[]") {
  12495. return "[$1]" + separatorAfter;
  12496. }
  12497. return this.getInsertTextForPlainText(text + separatorAfter);
  12498. };
  12499. JSONCompletion2.prototype.getInsertTextForSnippetValue = function(value, separatorAfter) {
  12500. var replacer = function(value2) {
  12501. if (typeof value2 === "string") {
  12502. if (value2[0] === "^") {
  12503. return value2.substr(1);
  12504. }
  12505. }
  12506. return JSON.stringify(value2);
  12507. };
  12508. return stringifyObject(value, "", replacer) + separatorAfter;
  12509. };
  12510. JSONCompletion2.prototype.getInsertTextForGuessedValue = function(value, separatorAfter) {
  12511. switch (typeof value) {
  12512. case "object":
  12513. if (value === null) {
  12514. return "${1:null}" + separatorAfter;
  12515. }
  12516. return this.getInsertTextForValue(value, separatorAfter);
  12517. case "string":
  12518. var snippetValue = JSON.stringify(value);
  12519. snippetValue = snippetValue.substr(1, snippetValue.length - 2);
  12520. snippetValue = this.getInsertTextForPlainText(snippetValue);
  12521. return '"${1:' + snippetValue + '}"' + separatorAfter;
  12522. case "number":
  12523. case "boolean":
  12524. return "${1:" + JSON.stringify(value) + "}" + separatorAfter;
  12525. }
  12526. return this.getInsertTextForValue(value, separatorAfter);
  12527. };
  12528. JSONCompletion2.prototype.getSuggestionKind = function(type) {
  12529. if (Array.isArray(type)) {
  12530. var array = type;
  12531. type = array.length > 0 ? array[0] : void 0;
  12532. }
  12533. if (!type) {
  12534. return CompletionItemKind2.Value;
  12535. }
  12536. switch (type) {
  12537. case "string":
  12538. return CompletionItemKind2.Value;
  12539. case "object":
  12540. return CompletionItemKind2.Module;
  12541. case "property":
  12542. return CompletionItemKind2.Property;
  12543. default:
  12544. return CompletionItemKind2.Value;
  12545. }
  12546. };
  12547. JSONCompletion2.prototype.getLabelTextForMatchingNode = function(node, document) {
  12548. switch (node.type) {
  12549. case "array":
  12550. return "[]";
  12551. case "object":
  12552. return "{}";
  12553. default:
  12554. var content = document.getText().substr(node.offset, node.length);
  12555. return content;
  12556. }
  12557. };
  12558. JSONCompletion2.prototype.getInsertTextForMatchingNode = function(node, document, separatorAfter) {
  12559. switch (node.type) {
  12560. case "array":
  12561. return this.getInsertTextForValue([], separatorAfter);
  12562. case "object":
  12563. return this.getInsertTextForValue({}, separatorAfter);
  12564. default:
  12565. var content = document.getText().substr(node.offset, node.length) + separatorAfter;
  12566. return this.getInsertTextForPlainText(content);
  12567. }
  12568. };
  12569. JSONCompletion2.prototype.getInsertTextForProperty = function(key, propertySchema, addValue, separatorAfter) {
  12570. var propertyText = this.getInsertTextForValue(key, "");
  12571. if (!addValue) {
  12572. return propertyText;
  12573. }
  12574. var resultText = propertyText + ": ";
  12575. var value;
  12576. var nValueProposals = 0;
  12577. if (propertySchema) {
  12578. if (Array.isArray(propertySchema.defaultSnippets)) {
  12579. if (propertySchema.defaultSnippets.length === 1) {
  12580. var body = propertySchema.defaultSnippets[0].body;
  12581. if (isDefined(body)) {
  12582. value = this.getInsertTextForSnippetValue(body, "");
  12583. }
  12584. }
  12585. nValueProposals += propertySchema.defaultSnippets.length;
  12586. }
  12587. if (propertySchema.enum) {
  12588. if (!value && propertySchema.enum.length === 1) {
  12589. value = this.getInsertTextForGuessedValue(propertySchema.enum[0], "");
  12590. }
  12591. nValueProposals += propertySchema.enum.length;
  12592. }
  12593. if (isDefined(propertySchema.default)) {
  12594. if (!value) {
  12595. value = this.getInsertTextForGuessedValue(propertySchema.default, "");
  12596. }
  12597. nValueProposals++;
  12598. }
  12599. if (Array.isArray(propertySchema.examples) && propertySchema.examples.length) {
  12600. if (!value) {
  12601. value = this.getInsertTextForGuessedValue(propertySchema.examples[0], "");
  12602. }
  12603. nValueProposals += propertySchema.examples.length;
  12604. }
  12605. if (nValueProposals === 0) {
  12606. var type = Array.isArray(propertySchema.type) ? propertySchema.type[0] : propertySchema.type;
  12607. if (!type) {
  12608. if (propertySchema.properties) {
  12609. type = "object";
  12610. } else if (propertySchema.items) {
  12611. type = "array";
  12612. }
  12613. }
  12614. switch (type) {
  12615. case "boolean":
  12616. value = "$1";
  12617. break;
  12618. case "string":
  12619. value = '"$1"';
  12620. break;
  12621. case "object":
  12622. value = "{$1}";
  12623. break;
  12624. case "array":
  12625. value = "[$1]";
  12626. break;
  12627. case "number":
  12628. case "integer":
  12629. value = "${1:0}";
  12630. break;
  12631. case "null":
  12632. value = "${1:null}";
  12633. break;
  12634. default:
  12635. return propertyText;
  12636. }
  12637. }
  12638. }
  12639. if (!value || nValueProposals > 1) {
  12640. value = "$1";
  12641. }
  12642. return resultText + value + separatorAfter;
  12643. };
  12644. JSONCompletion2.prototype.getCurrentWord = function(document, offset) {
  12645. var i = offset - 1;
  12646. var text = document.getText();
  12647. while (i >= 0 && ' \n\r\v":{[,]}'.indexOf(text.charAt(i)) === -1) {
  12648. i--;
  12649. }
  12650. return text.substring(i + 1, offset);
  12651. };
  12652. JSONCompletion2.prototype.evaluateSeparatorAfter = function(document, offset) {
  12653. var scanner = createScanner2(document.getText(), true);
  12654. scanner.setPosition(offset);
  12655. var token = scanner.scan();
  12656. switch (token) {
  12657. case 5:
  12658. case 2:
  12659. case 4:
  12660. case 17:
  12661. return "";
  12662. default:
  12663. return ",";
  12664. }
  12665. };
  12666. JSONCompletion2.prototype.findItemAtOffset = function(node, document, offset) {
  12667. var scanner = createScanner2(document.getText(), true);
  12668. var children = node.items;
  12669. for (var i = children.length - 1; i >= 0; i--) {
  12670. var child = children[i];
  12671. if (offset > child.offset + child.length) {
  12672. scanner.setPosition(child.offset + child.length);
  12673. var token = scanner.scan();
  12674. if (token === 5 && offset >= scanner.getTokenOffset() + scanner.getTokenLength()) {
  12675. return i + 1;
  12676. }
  12677. return i;
  12678. } else if (offset >= child.offset) {
  12679. return i;
  12680. }
  12681. }
  12682. return 0;
  12683. };
  12684. JSONCompletion2.prototype.isInComment = function(document, start, offset) {
  12685. var scanner = createScanner2(document.getText(), false);
  12686. scanner.setPosition(start);
  12687. var token = scanner.scan();
  12688. while (token !== 17 && scanner.getTokenOffset() + scanner.getTokenLength() < offset) {
  12689. token = scanner.scan();
  12690. }
  12691. return (token === 12 || token === 13) && scanner.getTokenOffset() <= offset;
  12692. };
  12693. JSONCompletion2.prototype.fromMarkup = function(markupString) {
  12694. if (markupString && this.doesSupportMarkdown()) {
  12695. return {
  12696. kind: MarkupKind.Markdown,
  12697. value: markupString
  12698. };
  12699. }
  12700. return void 0;
  12701. };
  12702. JSONCompletion2.prototype.doesSupportMarkdown = function() {
  12703. if (!isDefined(this.supportsMarkdown)) {
  12704. var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion;
  12705. this.supportsMarkdown = completion && completion.completionItem && Array.isArray(completion.completionItem.documentationFormat) && completion.completionItem.documentationFormat.indexOf(MarkupKind.Markdown) !== -1;
  12706. }
  12707. return this.supportsMarkdown;
  12708. };
  12709. JSONCompletion2.prototype.doesSupportsCommitCharacters = function() {
  12710. if (!isDefined(this.supportsCommitCharacters)) {
  12711. var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion;
  12712. this.supportsCommitCharacters = completion && completion.completionItem && !!completion.completionItem.commitCharactersSupport;
  12713. }
  12714. return this.supportsCommitCharacters;
  12715. };
  12716. return JSONCompletion2;
  12717. }();
  12718. var JSONHover = function() {
  12719. function JSONHover2(schemaService, contributions, promiseConstructor) {
  12720. if (contributions === void 0) {
  12721. contributions = [];
  12722. }
  12723. this.schemaService = schemaService;
  12724. this.contributions = contributions;
  12725. this.promise = promiseConstructor || Promise;
  12726. }
  12727. JSONHover2.prototype.doHover = function(document, position, doc) {
  12728. var offset = document.offsetAt(position);
  12729. var node = doc.getNodeFromOffset(offset);
  12730. if (!node || (node.type === "object" || node.type === "array") && offset > node.offset + 1 && offset < node.offset + node.length - 1) {
  12731. return this.promise.resolve(null);
  12732. }
  12733. var hoverRangeNode = node;
  12734. if (node.type === "string") {
  12735. var parent = node.parent;
  12736. if (parent && parent.type === "property" && parent.keyNode === node) {
  12737. node = parent.valueNode;
  12738. if (!node) {
  12739. return this.promise.resolve(null);
  12740. }
  12741. }
  12742. }
  12743. var hoverRange = Range2.create(document.positionAt(hoverRangeNode.offset), document.positionAt(hoverRangeNode.offset + hoverRangeNode.length));
  12744. var createHover = function(contents) {
  12745. var result = {
  12746. contents,
  12747. range: hoverRange
  12748. };
  12749. return result;
  12750. };
  12751. var location = getNodePath3(node);
  12752. for (var i = this.contributions.length - 1; i >= 0; i--) {
  12753. var contribution = this.contributions[i];
  12754. var promise = contribution.getInfoContribution(document.uri, location);
  12755. if (promise) {
  12756. return promise.then(function(htmlContent) {
  12757. return createHover(htmlContent);
  12758. });
  12759. }
  12760. }
  12761. return this.schemaService.getSchemaForResource(document.uri, doc).then(function(schema2) {
  12762. if (schema2 && node) {
  12763. var matchingSchemas = doc.getMatchingSchemas(schema2.schema, node.offset);
  12764. var title_1 = void 0;
  12765. var markdownDescription_1 = void 0;
  12766. var markdownEnumValueDescription_1 = void 0, enumValue_1 = void 0;
  12767. matchingSchemas.every(function(s) {
  12768. if (s.node === node && !s.inverted && s.schema) {
  12769. title_1 = title_1 || s.schema.title;
  12770. markdownDescription_1 = markdownDescription_1 || s.schema.markdownDescription || toMarkdown(s.schema.description);
  12771. if (s.schema.enum) {
  12772. var idx = s.schema.enum.indexOf(getNodeValue3(node));
  12773. if (s.schema.markdownEnumDescriptions) {
  12774. markdownEnumValueDescription_1 = s.schema.markdownEnumDescriptions[idx];
  12775. } else if (s.schema.enumDescriptions) {
  12776. markdownEnumValueDescription_1 = toMarkdown(s.schema.enumDescriptions[idx]);
  12777. }
  12778. if (markdownEnumValueDescription_1) {
  12779. enumValue_1 = s.schema.enum[idx];
  12780. if (typeof enumValue_1 !== "string") {
  12781. enumValue_1 = JSON.stringify(enumValue_1);
  12782. }
  12783. }
  12784. }
  12785. }
  12786. return true;
  12787. });
  12788. var result = "";
  12789. if (title_1) {
  12790. result = toMarkdown(title_1);
  12791. }
  12792. if (markdownDescription_1) {
  12793. if (result.length > 0) {
  12794. result += "\n\n";
  12795. }
  12796. result += markdownDescription_1;
  12797. }
  12798. if (markdownEnumValueDescription_1) {
  12799. if (result.length > 0) {
  12800. result += "\n\n";
  12801. }
  12802. result += "`".concat(toMarkdownCodeBlock(enumValue_1), "`: ").concat(markdownEnumValueDescription_1);
  12803. }
  12804. return createHover([result]);
  12805. }
  12806. return null;
  12807. });
  12808. };
  12809. return JSONHover2;
  12810. }();
  12811. function toMarkdown(plain) {
  12812. if (plain) {
  12813. var res = plain.replace(/([^\n\r])(\r?\n)([^\n\r])/gm, "$1\n\n$3");
  12814. return res.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
  12815. }
  12816. return void 0;
  12817. }
  12818. function toMarkdownCodeBlock(content) {
  12819. if (content.indexOf("`") !== -1) {
  12820. return "`` " + content + " ``";
  12821. }
  12822. return content;
  12823. }
  12824. var localize4 = loadMessageBundle();
  12825. var JSONValidation = function() {
  12826. function JSONValidation2(jsonSchemaService, promiseConstructor) {
  12827. this.jsonSchemaService = jsonSchemaService;
  12828. this.promise = promiseConstructor;
  12829. this.validationEnabled = true;
  12830. }
  12831. JSONValidation2.prototype.configure = function(raw) {
  12832. if (raw) {
  12833. this.validationEnabled = raw.validate !== false;
  12834. this.commentSeverity = raw.allowComments ? void 0 : DiagnosticSeverity.Error;
  12835. }
  12836. };
  12837. JSONValidation2.prototype.doValidation = function(textDocument, jsonDocument, documentSettings, schema2) {
  12838. var _this = this;
  12839. if (!this.validationEnabled) {
  12840. return this.promise.resolve([]);
  12841. }
  12842. var diagnostics = [];
  12843. var added = {};
  12844. var addProblem = function(problem) {
  12845. var signature = problem.range.start.line + " " + problem.range.start.character + " " + problem.message;
  12846. if (!added[signature]) {
  12847. added[signature] = true;
  12848. diagnostics.push(problem);
  12849. }
  12850. };
  12851. var getDiagnostics = function(schema22) {
  12852. var trailingCommaSeverity = (documentSettings === null || documentSettings === void 0 ? void 0 : documentSettings.trailingCommas) ? toDiagnosticSeverity(documentSettings.trailingCommas) : DiagnosticSeverity.Error;
  12853. var commentSeverity = (documentSettings === null || documentSettings === void 0 ? void 0 : documentSettings.comments) ? toDiagnosticSeverity(documentSettings.comments) : _this.commentSeverity;
  12854. var schemaValidation = (documentSettings === null || documentSettings === void 0 ? void 0 : documentSettings.schemaValidation) ? toDiagnosticSeverity(documentSettings.schemaValidation) : DiagnosticSeverity.Warning;
  12855. var schemaRequest = (documentSettings === null || documentSettings === void 0 ? void 0 : documentSettings.schemaRequest) ? toDiagnosticSeverity(documentSettings.schemaRequest) : DiagnosticSeverity.Warning;
  12856. if (schema22) {
  12857. if (schema22.errors.length && jsonDocument.root && schemaRequest) {
  12858. var astRoot = jsonDocument.root;
  12859. var property2 = astRoot.type === "object" ? astRoot.properties[0] : void 0;
  12860. if (property2 && property2.keyNode.value === "$schema") {
  12861. var node = property2.valueNode || property2;
  12862. var range = Range2.create(textDocument.positionAt(node.offset), textDocument.positionAt(node.offset + node.length));
  12863. addProblem(Diagnostic.create(range, schema22.errors[0], schemaRequest, ErrorCode.SchemaResolveError));
  12864. } else {
  12865. var range = Range2.create(textDocument.positionAt(astRoot.offset), textDocument.positionAt(astRoot.offset + 1));
  12866. addProblem(Diagnostic.create(range, schema22.errors[0], schemaRequest, ErrorCode.SchemaResolveError));
  12867. }
  12868. } else if (schemaValidation) {
  12869. var semanticErrors = jsonDocument.validate(textDocument, schema22.schema, schemaValidation);
  12870. if (semanticErrors) {
  12871. semanticErrors.forEach(addProblem);
  12872. }
  12873. }
  12874. if (schemaAllowsComments(schema22.schema)) {
  12875. commentSeverity = void 0;
  12876. }
  12877. if (schemaAllowsTrailingCommas(schema22.schema)) {
  12878. trailingCommaSeverity = void 0;
  12879. }
  12880. }
  12881. for (var _i = 0, _a3 = jsonDocument.syntaxErrors; _i < _a3.length; _i++) {
  12882. var p = _a3[_i];
  12883. if (p.code === ErrorCode.TrailingComma) {
  12884. if (typeof trailingCommaSeverity !== "number") {
  12885. continue;
  12886. }
  12887. p.severity = trailingCommaSeverity;
  12888. }
  12889. addProblem(p);
  12890. }
  12891. if (typeof commentSeverity === "number") {
  12892. var message_1 = localize4("InvalidCommentToken", "Comments are not permitted in JSON.");
  12893. jsonDocument.comments.forEach(function(c) {
  12894. addProblem(Diagnostic.create(c, message_1, commentSeverity, ErrorCode.CommentNotPermitted));
  12895. });
  12896. }
  12897. return diagnostics;
  12898. };
  12899. if (schema2) {
  12900. var id = schema2.id || "schemaservice://untitled/" + idCounter++;
  12901. var handle = this.jsonSchemaService.registerExternalSchema(id, [], schema2);
  12902. return handle.getResolvedSchema().then(function(resolvedSchema) {
  12903. return getDiagnostics(resolvedSchema);
  12904. });
  12905. }
  12906. return this.jsonSchemaService.getSchemaForResource(textDocument.uri, jsonDocument).then(function(schema22) {
  12907. return getDiagnostics(schema22);
  12908. });
  12909. };
  12910. JSONValidation2.prototype.getLanguageStatus = function(textDocument, jsonDocument) {
  12911. return {schemas: this.jsonSchemaService.getSchemaURIsForResource(textDocument.uri, jsonDocument)};
  12912. };
  12913. return JSONValidation2;
  12914. }();
  12915. var idCounter = 0;
  12916. function schemaAllowsComments(schemaRef) {
  12917. if (schemaRef && typeof schemaRef === "object") {
  12918. if (isBoolean(schemaRef.allowComments)) {
  12919. return schemaRef.allowComments;
  12920. }
  12921. if (schemaRef.allOf) {
  12922. for (var _i = 0, _a3 = schemaRef.allOf; _i < _a3.length; _i++) {
  12923. var schema2 = _a3[_i];
  12924. var allow = schemaAllowsComments(schema2);
  12925. if (isBoolean(allow)) {
  12926. return allow;
  12927. }
  12928. }
  12929. }
  12930. }
  12931. return void 0;
  12932. }
  12933. function schemaAllowsTrailingCommas(schemaRef) {
  12934. if (schemaRef && typeof schemaRef === "object") {
  12935. if (isBoolean(schemaRef.allowTrailingCommas)) {
  12936. return schemaRef.allowTrailingCommas;
  12937. }
  12938. var deprSchemaRef = schemaRef;
  12939. if (isBoolean(deprSchemaRef["allowsTrailingCommas"])) {
  12940. return deprSchemaRef["allowsTrailingCommas"];
  12941. }
  12942. if (schemaRef.allOf) {
  12943. for (var _i = 0, _a3 = schemaRef.allOf; _i < _a3.length; _i++) {
  12944. var schema2 = _a3[_i];
  12945. var allow = schemaAllowsTrailingCommas(schema2);
  12946. if (isBoolean(allow)) {
  12947. return allow;
  12948. }
  12949. }
  12950. }
  12951. }
  12952. return void 0;
  12953. }
  12954. function toDiagnosticSeverity(severityLevel) {
  12955. switch (severityLevel) {
  12956. case "error":
  12957. return DiagnosticSeverity.Error;
  12958. case "warning":
  12959. return DiagnosticSeverity.Warning;
  12960. case "ignore":
  12961. return void 0;
  12962. }
  12963. return void 0;
  12964. }
  12965. var Digit0 = 48;
  12966. var Digit9 = 57;
  12967. var A = 65;
  12968. var a = 97;
  12969. var f = 102;
  12970. function hexDigit(charCode) {
  12971. if (charCode < Digit0) {
  12972. return 0;
  12973. }
  12974. if (charCode <= Digit9) {
  12975. return charCode - Digit0;
  12976. }
  12977. if (charCode < a) {
  12978. charCode += a - A;
  12979. }
  12980. if (charCode >= a && charCode <= f) {
  12981. return charCode - a + 10;
  12982. }
  12983. return 0;
  12984. }
  12985. function colorFromHex(text) {
  12986. if (text[0] !== "#") {
  12987. return void 0;
  12988. }
  12989. switch (text.length) {
  12990. case 4:
  12991. return {
  12992. red: hexDigit(text.charCodeAt(1)) * 17 / 255,
  12993. green: hexDigit(text.charCodeAt(2)) * 17 / 255,
  12994. blue: hexDigit(text.charCodeAt(3)) * 17 / 255,
  12995. alpha: 1
  12996. };
  12997. case 5:
  12998. return {
  12999. red: hexDigit(text.charCodeAt(1)) * 17 / 255,
  13000. green: hexDigit(text.charCodeAt(2)) * 17 / 255,
  13001. blue: hexDigit(text.charCodeAt(3)) * 17 / 255,
  13002. alpha: hexDigit(text.charCodeAt(4)) * 17 / 255
  13003. };
  13004. case 7:
  13005. return {
  13006. red: (hexDigit(text.charCodeAt(1)) * 16 + hexDigit(text.charCodeAt(2))) / 255,
  13007. green: (hexDigit(text.charCodeAt(3)) * 16 + hexDigit(text.charCodeAt(4))) / 255,
  13008. blue: (hexDigit(text.charCodeAt(5)) * 16 + hexDigit(text.charCodeAt(6))) / 255,
  13009. alpha: 1
  13010. };
  13011. case 9:
  13012. return {
  13013. red: (hexDigit(text.charCodeAt(1)) * 16 + hexDigit(text.charCodeAt(2))) / 255,
  13014. green: (hexDigit(text.charCodeAt(3)) * 16 + hexDigit(text.charCodeAt(4))) / 255,
  13015. blue: (hexDigit(text.charCodeAt(5)) * 16 + hexDigit(text.charCodeAt(6))) / 255,
  13016. alpha: (hexDigit(text.charCodeAt(7)) * 16 + hexDigit(text.charCodeAt(8))) / 255
  13017. };
  13018. }
  13019. return void 0;
  13020. }
  13021. var JSONDocumentSymbols = function() {
  13022. function JSONDocumentSymbols2(schemaService) {
  13023. this.schemaService = schemaService;
  13024. }
  13025. JSONDocumentSymbols2.prototype.findDocumentSymbols = function(document, doc, context) {
  13026. var _this = this;
  13027. if (context === void 0) {
  13028. context = {resultLimit: Number.MAX_VALUE};
  13029. }
  13030. var root = doc.root;
  13031. if (!root) {
  13032. return [];
  13033. }
  13034. var limit = context.resultLimit || Number.MAX_VALUE;
  13035. var resourceString = document.uri;
  13036. if (resourceString === "vscode://defaultsettings/keybindings.json" || endsWith(resourceString.toLowerCase(), "/user/keybindings.json")) {
  13037. if (root.type === "array") {
  13038. var result_1 = [];
  13039. for (var _i = 0, _a3 = root.items; _i < _a3.length; _i++) {
  13040. var item = _a3[_i];
  13041. if (item.type === "object") {
  13042. for (var _b = 0, _c = item.properties; _b < _c.length; _b++) {
  13043. var property2 = _c[_b];
  13044. if (property2.keyNode.value === "key" && property2.valueNode) {
  13045. var location = Location.create(document.uri, getRange(document, item));
  13046. result_1.push({name: getNodeValue3(property2.valueNode), kind: SymbolKind2.Function, location});
  13047. limit--;
  13048. if (limit <= 0) {
  13049. if (context && context.onResultLimitExceeded) {
  13050. context.onResultLimitExceeded(resourceString);
  13051. }
  13052. return result_1;
  13053. }
  13054. }
  13055. }
  13056. }
  13057. }
  13058. return result_1;
  13059. }
  13060. }
  13061. var toVisit = [
  13062. {node: root, containerName: ""}
  13063. ];
  13064. var nextToVisit = 0;
  13065. var limitExceeded = false;
  13066. var result = [];
  13067. var collectOutlineEntries = function(node, containerName) {
  13068. if (node.type === "array") {
  13069. node.items.forEach(function(node2) {
  13070. if (node2) {
  13071. toVisit.push({node: node2, containerName});
  13072. }
  13073. });
  13074. } else if (node.type === "object") {
  13075. node.properties.forEach(function(property22) {
  13076. var valueNode = property22.valueNode;
  13077. if (valueNode) {
  13078. if (limit > 0) {
  13079. limit--;
  13080. var location2 = Location.create(document.uri, getRange(document, property22));
  13081. var childContainerName = containerName ? containerName + "." + property22.keyNode.value : property22.keyNode.value;
  13082. result.push({name: _this.getKeyLabel(property22), kind: _this.getSymbolKind(valueNode.type), location: location2, containerName});
  13083. toVisit.push({node: valueNode, containerName: childContainerName});
  13084. } else {
  13085. limitExceeded = true;
  13086. }
  13087. }
  13088. });
  13089. }
  13090. };
  13091. while (nextToVisit < toVisit.length) {
  13092. var next = toVisit[nextToVisit++];
  13093. collectOutlineEntries(next.node, next.containerName);
  13094. }
  13095. if (limitExceeded && context && context.onResultLimitExceeded) {
  13096. context.onResultLimitExceeded(resourceString);
  13097. }
  13098. return result;
  13099. };
  13100. JSONDocumentSymbols2.prototype.findDocumentSymbols2 = function(document, doc, context) {
  13101. var _this = this;
  13102. if (context === void 0) {
  13103. context = {resultLimit: Number.MAX_VALUE};
  13104. }
  13105. var root = doc.root;
  13106. if (!root) {
  13107. return [];
  13108. }
  13109. var limit = context.resultLimit || Number.MAX_VALUE;
  13110. var resourceString = document.uri;
  13111. if (resourceString === "vscode://defaultsettings/keybindings.json" || endsWith(resourceString.toLowerCase(), "/user/keybindings.json")) {
  13112. if (root.type === "array") {
  13113. var result_2 = [];
  13114. for (var _i = 0, _a3 = root.items; _i < _a3.length; _i++) {
  13115. var item = _a3[_i];
  13116. if (item.type === "object") {
  13117. for (var _b = 0, _c = item.properties; _b < _c.length; _b++) {
  13118. var property2 = _c[_b];
  13119. if (property2.keyNode.value === "key" && property2.valueNode) {
  13120. var range = getRange(document, item);
  13121. var selectionRange = getRange(document, property2.keyNode);
  13122. result_2.push({name: getNodeValue3(property2.valueNode), kind: SymbolKind2.Function, range, selectionRange});
  13123. limit--;
  13124. if (limit <= 0) {
  13125. if (context && context.onResultLimitExceeded) {
  13126. context.onResultLimitExceeded(resourceString);
  13127. }
  13128. return result_2;
  13129. }
  13130. }
  13131. }
  13132. }
  13133. }
  13134. return result_2;
  13135. }
  13136. }
  13137. var result = [];
  13138. var toVisit = [
  13139. {node: root, result}
  13140. ];
  13141. var nextToVisit = 0;
  13142. var limitExceeded = false;
  13143. var collectOutlineEntries = function(node, result2) {
  13144. if (node.type === "array") {
  13145. node.items.forEach(function(node2, index) {
  13146. if (node2) {
  13147. if (limit > 0) {
  13148. limit--;
  13149. var range2 = getRange(document, node2);
  13150. var selectionRange2 = range2;
  13151. var name = String(index);
  13152. var symbol = {name, kind: _this.getSymbolKind(node2.type), range: range2, selectionRange: selectionRange2, children: []};
  13153. result2.push(symbol);
  13154. toVisit.push({result: symbol.children, node: node2});
  13155. } else {
  13156. limitExceeded = true;
  13157. }
  13158. }
  13159. });
  13160. } else if (node.type === "object") {
  13161. node.properties.forEach(function(property22) {
  13162. var valueNode = property22.valueNode;
  13163. if (valueNode) {
  13164. if (limit > 0) {
  13165. limit--;
  13166. var range2 = getRange(document, property22);
  13167. var selectionRange2 = getRange(document, property22.keyNode);
  13168. var children = [];
  13169. var symbol = {name: _this.getKeyLabel(property22), kind: _this.getSymbolKind(valueNode.type), range: range2, selectionRange: selectionRange2, children, detail: _this.getDetail(valueNode)};
  13170. result2.push(symbol);
  13171. toVisit.push({result: children, node: valueNode});
  13172. } else {
  13173. limitExceeded = true;
  13174. }
  13175. }
  13176. });
  13177. }
  13178. };
  13179. while (nextToVisit < toVisit.length) {
  13180. var next = toVisit[nextToVisit++];
  13181. collectOutlineEntries(next.node, next.result);
  13182. }
  13183. if (limitExceeded && context && context.onResultLimitExceeded) {
  13184. context.onResultLimitExceeded(resourceString);
  13185. }
  13186. return result;
  13187. };
  13188. JSONDocumentSymbols2.prototype.getSymbolKind = function(nodeType) {
  13189. switch (nodeType) {
  13190. case "object":
  13191. return SymbolKind2.Module;
  13192. case "string":
  13193. return SymbolKind2.String;
  13194. case "number":
  13195. return SymbolKind2.Number;
  13196. case "array":
  13197. return SymbolKind2.Array;
  13198. case "boolean":
  13199. return SymbolKind2.Boolean;
  13200. default:
  13201. return SymbolKind2.Variable;
  13202. }
  13203. };
  13204. JSONDocumentSymbols2.prototype.getKeyLabel = function(property2) {
  13205. var name = property2.keyNode.value;
  13206. if (name) {
  13207. name = name.replace(/[\n]/g, "\u21B5");
  13208. }
  13209. if (name && name.trim()) {
  13210. return name;
  13211. }
  13212. return '"'.concat(name, '"');
  13213. };
  13214. JSONDocumentSymbols2.prototype.getDetail = function(node) {
  13215. if (!node) {
  13216. return void 0;
  13217. }
  13218. if (node.type === "boolean" || node.type === "number" || node.type === "null" || node.type === "string") {
  13219. return String(node.value);
  13220. } else {
  13221. if (node.type === "array") {
  13222. return node.children.length ? void 0 : "[]";
  13223. } else if (node.type === "object") {
  13224. return node.children.length ? void 0 : "{}";
  13225. }
  13226. }
  13227. return void 0;
  13228. };
  13229. JSONDocumentSymbols2.prototype.findDocumentColors = function(document, doc, context) {
  13230. return this.schemaService.getSchemaForResource(document.uri, doc).then(function(schema2) {
  13231. var result = [];
  13232. if (schema2) {
  13233. var limit = context && typeof context.resultLimit === "number" ? context.resultLimit : Number.MAX_VALUE;
  13234. var matchingSchemas = doc.getMatchingSchemas(schema2.schema);
  13235. var visitedNode = {};
  13236. for (var _i = 0, matchingSchemas_1 = matchingSchemas; _i < matchingSchemas_1.length; _i++) {
  13237. var s = matchingSchemas_1[_i];
  13238. if (!s.inverted && s.schema && (s.schema.format === "color" || s.schema.format === "color-hex") && s.node && s.node.type === "string") {
  13239. var nodeId = String(s.node.offset);
  13240. if (!visitedNode[nodeId]) {
  13241. var color = colorFromHex(getNodeValue3(s.node));
  13242. if (color) {
  13243. var range = getRange(document, s.node);
  13244. result.push({color, range});
  13245. }
  13246. visitedNode[nodeId] = true;
  13247. limit--;
  13248. if (limit <= 0) {
  13249. if (context && context.onResultLimitExceeded) {
  13250. context.onResultLimitExceeded(document.uri);
  13251. }
  13252. return result;
  13253. }
  13254. }
  13255. }
  13256. }
  13257. }
  13258. return result;
  13259. });
  13260. };
  13261. JSONDocumentSymbols2.prototype.getColorPresentations = function(document, doc, color, range) {
  13262. var result = [];
  13263. var red256 = Math.round(color.red * 255), green256 = Math.round(color.green * 255), blue256 = Math.round(color.blue * 255);
  13264. function toTwoDigitHex(n) {
  13265. var r = n.toString(16);
  13266. return r.length !== 2 ? "0" + r : r;
  13267. }
  13268. var label;
  13269. if (color.alpha === 1) {
  13270. label = "#".concat(toTwoDigitHex(red256)).concat(toTwoDigitHex(green256)).concat(toTwoDigitHex(blue256));
  13271. } else {
  13272. label = "#".concat(toTwoDigitHex(red256)).concat(toTwoDigitHex(green256)).concat(toTwoDigitHex(blue256)).concat(toTwoDigitHex(Math.round(color.alpha * 255)));
  13273. }
  13274. result.push({label, textEdit: TextEdit.replace(range, JSON.stringify(label))});
  13275. return result;
  13276. };
  13277. return JSONDocumentSymbols2;
  13278. }();
  13279. function getRange(document, node) {
  13280. return Range2.create(document.positionAt(node.offset), document.positionAt(node.offset + node.length));
  13281. }
  13282. var localize5 = loadMessageBundle();
  13283. var schemaContributions = {
  13284. schemaAssociations: [],
  13285. schemas: {
  13286. "http://json-schema.org/schema#": {
  13287. $ref: "http://json-schema.org/draft-07/schema#"
  13288. },
  13289. "http://json-schema.org/draft-04/schema#": {
  13290. $schema: "http://json-schema.org/draft-04/schema#",
  13291. definitions: {
  13292. schemaArray: {
  13293. type: "array",
  13294. minItems: 1,
  13295. items: {
  13296. $ref: "#"
  13297. }
  13298. },
  13299. positiveInteger: {
  13300. type: "integer",
  13301. minimum: 0
  13302. },
  13303. positiveIntegerDefault0: {
  13304. allOf: [
  13305. {
  13306. $ref: "#/definitions/positiveInteger"
  13307. },
  13308. {
  13309. default: 0
  13310. }
  13311. ]
  13312. },
  13313. simpleTypes: {
  13314. type: "string",
  13315. enum: [
  13316. "array",
  13317. "boolean",
  13318. "integer",
  13319. "null",
  13320. "number",
  13321. "object",
  13322. "string"
  13323. ]
  13324. },
  13325. stringArray: {
  13326. type: "array",
  13327. items: {
  13328. type: "string"
  13329. },
  13330. minItems: 1,
  13331. uniqueItems: true
  13332. }
  13333. },
  13334. type: "object",
  13335. properties: {
  13336. id: {
  13337. type: "string",
  13338. format: "uri"
  13339. },
  13340. $schema: {
  13341. type: "string",
  13342. format: "uri"
  13343. },
  13344. title: {
  13345. type: "string"
  13346. },
  13347. description: {
  13348. type: "string"
  13349. },
  13350. default: {},
  13351. multipleOf: {
  13352. type: "number",
  13353. minimum: 0,
  13354. exclusiveMinimum: true
  13355. },
  13356. maximum: {
  13357. type: "number"
  13358. },
  13359. exclusiveMaximum: {
  13360. type: "boolean",
  13361. default: false
  13362. },
  13363. minimum: {
  13364. type: "number"
  13365. },
  13366. exclusiveMinimum: {
  13367. type: "boolean",
  13368. default: false
  13369. },
  13370. maxLength: {
  13371. allOf: [
  13372. {
  13373. $ref: "#/definitions/positiveInteger"
  13374. }
  13375. ]
  13376. },
  13377. minLength: {
  13378. allOf: [
  13379. {
  13380. $ref: "#/definitions/positiveIntegerDefault0"
  13381. }
  13382. ]
  13383. },
  13384. pattern: {
  13385. type: "string",
  13386. format: "regex"
  13387. },
  13388. additionalItems: {
  13389. anyOf: [
  13390. {
  13391. type: "boolean"
  13392. },
  13393. {
  13394. $ref: "#"
  13395. }
  13396. ],
  13397. default: {}
  13398. },
  13399. items: {
  13400. anyOf: [
  13401. {
  13402. $ref: "#"
  13403. },
  13404. {
  13405. $ref: "#/definitions/schemaArray"
  13406. }
  13407. ],
  13408. default: {}
  13409. },
  13410. maxItems: {
  13411. allOf: [
  13412. {
  13413. $ref: "#/definitions/positiveInteger"
  13414. }
  13415. ]
  13416. },
  13417. minItems: {
  13418. allOf: [
  13419. {
  13420. $ref: "#/definitions/positiveIntegerDefault0"
  13421. }
  13422. ]
  13423. },
  13424. uniqueItems: {
  13425. type: "boolean",
  13426. default: false
  13427. },
  13428. maxProperties: {
  13429. allOf: [
  13430. {
  13431. $ref: "#/definitions/positiveInteger"
  13432. }
  13433. ]
  13434. },
  13435. minProperties: {
  13436. allOf: [
  13437. {
  13438. $ref: "#/definitions/positiveIntegerDefault0"
  13439. }
  13440. ]
  13441. },
  13442. required: {
  13443. allOf: [
  13444. {
  13445. $ref: "#/definitions/stringArray"
  13446. }
  13447. ]
  13448. },
  13449. additionalProperties: {
  13450. anyOf: [
  13451. {
  13452. type: "boolean"
  13453. },
  13454. {
  13455. $ref: "#"
  13456. }
  13457. ],
  13458. default: {}
  13459. },
  13460. definitions: {
  13461. type: "object",
  13462. additionalProperties: {
  13463. $ref: "#"
  13464. },
  13465. default: {}
  13466. },
  13467. properties: {
  13468. type: "object",
  13469. additionalProperties: {
  13470. $ref: "#"
  13471. },
  13472. default: {}
  13473. },
  13474. patternProperties: {
  13475. type: "object",
  13476. additionalProperties: {
  13477. $ref: "#"
  13478. },
  13479. default: {}
  13480. },
  13481. dependencies: {
  13482. type: "object",
  13483. additionalProperties: {
  13484. anyOf: [
  13485. {
  13486. $ref: "#"
  13487. },
  13488. {
  13489. $ref: "#/definitions/stringArray"
  13490. }
  13491. ]
  13492. }
  13493. },
  13494. enum: {
  13495. type: "array",
  13496. minItems: 1,
  13497. uniqueItems: true
  13498. },
  13499. type: {
  13500. anyOf: [
  13501. {
  13502. $ref: "#/definitions/simpleTypes"
  13503. },
  13504. {
  13505. type: "array",
  13506. items: {
  13507. $ref: "#/definitions/simpleTypes"
  13508. },
  13509. minItems: 1,
  13510. uniqueItems: true
  13511. }
  13512. ]
  13513. },
  13514. format: {
  13515. anyOf: [
  13516. {
  13517. type: "string",
  13518. enum: [
  13519. "date-time",
  13520. "uri",
  13521. "email",
  13522. "hostname",
  13523. "ipv4",
  13524. "ipv6",
  13525. "regex"
  13526. ]
  13527. },
  13528. {
  13529. type: "string"
  13530. }
  13531. ]
  13532. },
  13533. allOf: {
  13534. allOf: [
  13535. {
  13536. $ref: "#/definitions/schemaArray"
  13537. }
  13538. ]
  13539. },
  13540. anyOf: {
  13541. allOf: [
  13542. {
  13543. $ref: "#/definitions/schemaArray"
  13544. }
  13545. ]
  13546. },
  13547. oneOf: {
  13548. allOf: [
  13549. {
  13550. $ref: "#/definitions/schemaArray"
  13551. }
  13552. ]
  13553. },
  13554. not: {
  13555. allOf: [
  13556. {
  13557. $ref: "#"
  13558. }
  13559. ]
  13560. }
  13561. },
  13562. dependencies: {
  13563. exclusiveMaximum: [
  13564. "maximum"
  13565. ],
  13566. exclusiveMinimum: [
  13567. "minimum"
  13568. ]
  13569. },
  13570. default: {}
  13571. },
  13572. "http://json-schema.org/draft-07/schema#": {
  13573. definitions: {
  13574. schemaArray: {
  13575. type: "array",
  13576. minItems: 1,
  13577. items: {$ref: "#"}
  13578. },
  13579. nonNegativeInteger: {
  13580. type: "integer",
  13581. minimum: 0
  13582. },
  13583. nonNegativeIntegerDefault0: {
  13584. allOf: [
  13585. {$ref: "#/definitions/nonNegativeInteger"},
  13586. {default: 0}
  13587. ]
  13588. },
  13589. simpleTypes: {
  13590. enum: [
  13591. "array",
  13592. "boolean",
  13593. "integer",
  13594. "null",
  13595. "number",
  13596. "object",
  13597. "string"
  13598. ]
  13599. },
  13600. stringArray: {
  13601. type: "array",
  13602. items: {type: "string"},
  13603. uniqueItems: true,
  13604. default: []
  13605. }
  13606. },
  13607. type: ["object", "boolean"],
  13608. properties: {
  13609. $id: {
  13610. type: "string",
  13611. format: "uri-reference"
  13612. },
  13613. $schema: {
  13614. type: "string",
  13615. format: "uri"
  13616. },
  13617. $ref: {
  13618. type: "string",
  13619. format: "uri-reference"
  13620. },
  13621. $comment: {
  13622. type: "string"
  13623. },
  13624. title: {
  13625. type: "string"
  13626. },
  13627. description: {
  13628. type: "string"
  13629. },
  13630. default: true,
  13631. readOnly: {
  13632. type: "boolean",
  13633. default: false
  13634. },
  13635. examples: {
  13636. type: "array",
  13637. items: true
  13638. },
  13639. multipleOf: {
  13640. type: "number",
  13641. exclusiveMinimum: 0
  13642. },
  13643. maximum: {
  13644. type: "number"
  13645. },
  13646. exclusiveMaximum: {
  13647. type: "number"
  13648. },
  13649. minimum: {
  13650. type: "number"
  13651. },
  13652. exclusiveMinimum: {
  13653. type: "number"
  13654. },
  13655. maxLength: {$ref: "#/definitions/nonNegativeInteger"},
  13656. minLength: {$ref: "#/definitions/nonNegativeIntegerDefault0"},
  13657. pattern: {
  13658. type: "string",
  13659. format: "regex"
  13660. },
  13661. additionalItems: {$ref: "#"},
  13662. items: {
  13663. anyOf: [
  13664. {$ref: "#"},
  13665. {$ref: "#/definitions/schemaArray"}
  13666. ],
  13667. default: true
  13668. },
  13669. maxItems: {$ref: "#/definitions/nonNegativeInteger"},
  13670. minItems: {$ref: "#/definitions/nonNegativeIntegerDefault0"},
  13671. uniqueItems: {
  13672. type: "boolean",
  13673. default: false
  13674. },
  13675. contains: {$ref: "#"},
  13676. maxProperties: {$ref: "#/definitions/nonNegativeInteger"},
  13677. minProperties: {$ref: "#/definitions/nonNegativeIntegerDefault0"},
  13678. required: {$ref: "#/definitions/stringArray"},
  13679. additionalProperties: {$ref: "#"},
  13680. definitions: {
  13681. type: "object",
  13682. additionalProperties: {$ref: "#"},
  13683. default: {}
  13684. },
  13685. properties: {
  13686. type: "object",
  13687. additionalProperties: {$ref: "#"},
  13688. default: {}
  13689. },
  13690. patternProperties: {
  13691. type: "object",
  13692. additionalProperties: {$ref: "#"},
  13693. propertyNames: {format: "regex"},
  13694. default: {}
  13695. },
  13696. dependencies: {
  13697. type: "object",
  13698. additionalProperties: {
  13699. anyOf: [
  13700. {$ref: "#"},
  13701. {$ref: "#/definitions/stringArray"}
  13702. ]
  13703. }
  13704. },
  13705. propertyNames: {$ref: "#"},
  13706. const: true,
  13707. enum: {
  13708. type: "array",
  13709. items: true,
  13710. minItems: 1,
  13711. uniqueItems: true
  13712. },
  13713. type: {
  13714. anyOf: [
  13715. {$ref: "#/definitions/simpleTypes"},
  13716. {
  13717. type: "array",
  13718. items: {$ref: "#/definitions/simpleTypes"},
  13719. minItems: 1,
  13720. uniqueItems: true
  13721. }
  13722. ]
  13723. },
  13724. format: {type: "string"},
  13725. contentMediaType: {type: "string"},
  13726. contentEncoding: {type: "string"},
  13727. if: {$ref: "#"},
  13728. then: {$ref: "#"},
  13729. else: {$ref: "#"},
  13730. allOf: {$ref: "#/definitions/schemaArray"},
  13731. anyOf: {$ref: "#/definitions/schemaArray"},
  13732. oneOf: {$ref: "#/definitions/schemaArray"},
  13733. not: {$ref: "#"}
  13734. },
  13735. default: true
  13736. }
  13737. }
  13738. };
  13739. var descriptions = {
  13740. id: localize5("schema.json.id", "A unique identifier for the schema."),
  13741. $schema: localize5("schema.json.$schema", "The schema to verify this document against."),
  13742. title: localize5("schema.json.title", "A descriptive title of the element."),
  13743. description: localize5("schema.json.description", "A long description of the element. Used in hover menus and suggestions."),
  13744. default: localize5("schema.json.default", "A default value. Used by suggestions."),
  13745. multipleOf: localize5("schema.json.multipleOf", "A number that should cleanly divide the current value (i.e. have no remainder)."),
  13746. maximum: localize5("schema.json.maximum", "The maximum numerical value, inclusive by default."),
  13747. exclusiveMaximum: localize5("schema.json.exclusiveMaximum", "Makes the maximum property exclusive."),
  13748. minimum: localize5("schema.json.minimum", "The minimum numerical value, inclusive by default."),
  13749. exclusiveMinimum: localize5("schema.json.exclusiveMininum", "Makes the minimum property exclusive."),
  13750. maxLength: localize5("schema.json.maxLength", "The maximum length of a string."),
  13751. minLength: localize5("schema.json.minLength", "The minimum length of a string."),
  13752. pattern: localize5("schema.json.pattern", "A regular expression to match the string against. It is not implicitly anchored."),
  13753. additionalItems: localize5("schema.json.additionalItems", "For arrays, only when items is set as an array. If it is a schema, then this schema validates items after the ones specified by the items array. If it is false, then additional items will cause validation to fail."),
  13754. items: localize5("schema.json.items", "For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on."),
  13755. maxItems: localize5("schema.json.maxItems", "The maximum number of items that can be inside an array. Inclusive."),
  13756. minItems: localize5("schema.json.minItems", "The minimum number of items that can be inside an array. Inclusive."),
  13757. uniqueItems: localize5("schema.json.uniqueItems", "If all of the items in the array must be unique. Defaults to false."),
  13758. maxProperties: localize5("schema.json.maxProperties", "The maximum number of properties an object can have. Inclusive."),
  13759. minProperties: localize5("schema.json.minProperties", "The minimum number of properties an object can have. Inclusive."),
  13760. required: localize5("schema.json.required", "An array of strings that lists the names of all properties required on this object."),
  13761. additionalProperties: localize5("schema.json.additionalProperties", "Either a schema or a boolean. If a schema, then used to validate all properties not matched by 'properties' or 'patternProperties'. If false, then any properties not matched by either will cause this schema to fail."),
  13762. definitions: localize5("schema.json.definitions", "Not used for validation. Place subschemas here that you wish to reference inline with $ref."),
  13763. properties: localize5("schema.json.properties", "A map of property names to schemas for each property."),
  13764. patternProperties: localize5("schema.json.patternProperties", "A map of regular expressions on property names to schemas for matching properties."),
  13765. dependencies: localize5("schema.json.dependencies", "A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object."),
  13766. enum: localize5("schema.json.enum", "The set of literal values that are valid."),
  13767. type: localize5("schema.json.type", "Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types."),
  13768. format: localize5("schema.json.format", "Describes the format expected for the value."),
  13769. allOf: localize5("schema.json.allOf", "An array of schemas, all of which must match."),
  13770. anyOf: localize5("schema.json.anyOf", "An array of schemas, where at least one must match."),
  13771. oneOf: localize5("schema.json.oneOf", "An array of schemas, exactly one of which must match."),
  13772. not: localize5("schema.json.not", "A schema which must not match."),
  13773. $id: localize5("schema.json.$id", "A unique identifier for the schema."),
  13774. $ref: localize5("schema.json.$ref", "Reference a definition hosted on any location."),
  13775. $comment: localize5("schema.json.$comment", "Comments from schema authors to readers or maintainers of the schema."),
  13776. readOnly: localize5("schema.json.readOnly", "Indicates that the value of the instance is managed exclusively by the owning authority."),
  13777. examples: localize5("schema.json.examples", "Sample JSON values associated with a particular schema, for the purpose of illustrating usage."),
  13778. contains: localize5("schema.json.contains", 'An array instance is valid against "contains" if at least one of its elements is valid against the given schema.'),
  13779. propertyNames: localize5("schema.json.propertyNames", "If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema."),
  13780. const: localize5("schema.json.const", "An instance validates successfully against this keyword if its value is equal to the value of the keyword."),
  13781. contentMediaType: localize5("schema.json.contentMediaType", "Describes the media type of a string property."),
  13782. contentEncoding: localize5("schema.json.contentEncoding", "Describes the content encoding of a string property."),
  13783. if: localize5("schema.json.if", 'The validation outcome of the "if" subschema controls which of the "then" or "else" keywords are evaluated.'),
  13784. then: localize5("schema.json.then", 'The "if" subschema is used for validation when the "if" subschema succeeds.'),
  13785. else: localize5("schema.json.else", 'The "else" subschema is used for validation when the "if" subschema fails.')
  13786. };
  13787. for (schemaName in schemaContributions.schemas) {
  13788. schema = schemaContributions.schemas[schemaName];
  13789. for (property in schema.properties) {
  13790. propertyObject = schema.properties[property];
  13791. if (typeof propertyObject === "boolean") {
  13792. propertyObject = schema.properties[property] = {};
  13793. }
  13794. description = descriptions[property];
  13795. if (description) {
  13796. propertyObject["description"] = description;
  13797. } else {
  13798. console.log("".concat(property, ": localize('schema.json.").concat(property, `', "")`));
  13799. }
  13800. }
  13801. }
  13802. var schema;
  13803. var propertyObject;
  13804. var description;
  13805. var property;
  13806. var schemaName;
  13807. var LIB;
  13808. LIB = (() => {
  13809. "use strict";
  13810. var t = {470: (t2) => {
  13811. function e2(t3) {
  13812. if (typeof t3 != "string")
  13813. throw new TypeError("Path must be a string. Received " + JSON.stringify(t3));
  13814. }
  13815. function r2(t3, e3) {
  13816. for (var r3, n2 = "", o = 0, i = -1, a2 = 0, h = 0; h <= t3.length; ++h) {
  13817. if (h < t3.length)
  13818. r3 = t3.charCodeAt(h);
  13819. else {
  13820. if (r3 === 47)
  13821. break;
  13822. r3 = 47;
  13823. }
  13824. if (r3 === 47) {
  13825. if (i === h - 1 || a2 === 1)
  13826. ;
  13827. else if (i !== h - 1 && a2 === 2) {
  13828. if (n2.length < 2 || o !== 2 || n2.charCodeAt(n2.length - 1) !== 46 || n2.charCodeAt(n2.length - 2) !== 46) {
  13829. if (n2.length > 2) {
  13830. var s = n2.lastIndexOf("/");
  13831. if (s !== n2.length - 1) {
  13832. s === -1 ? (n2 = "", o = 0) : o = (n2 = n2.slice(0, s)).length - 1 - n2.lastIndexOf("/"), i = h, a2 = 0;
  13833. continue;
  13834. }
  13835. } else if (n2.length === 2 || n2.length === 1) {
  13836. n2 = "", o = 0, i = h, a2 = 0;
  13837. continue;
  13838. }
  13839. }
  13840. e3 && (n2.length > 0 ? n2 += "/.." : n2 = "..", o = 2);
  13841. } else
  13842. n2.length > 0 ? n2 += "/" + t3.slice(i + 1, h) : n2 = t3.slice(i + 1, h), o = h - i - 1;
  13843. i = h, a2 = 0;
  13844. } else
  13845. r3 === 46 && a2 !== -1 ? ++a2 : a2 = -1;
  13846. }
  13847. return n2;
  13848. }
  13849. var n = {resolve: function() {
  13850. for (var t3, n2 = "", o = false, i = arguments.length - 1; i >= -1 && !o; i--) {
  13851. var a2;
  13852. i >= 0 ? a2 = arguments[i] : (t3 === void 0 && (t3 = process.cwd()), a2 = t3), e2(a2), a2.length !== 0 && (n2 = a2 + "/" + n2, o = a2.charCodeAt(0) === 47);
  13853. }
  13854. return n2 = r2(n2, !o), o ? n2.length > 0 ? "/" + n2 : "/" : n2.length > 0 ? n2 : ".";
  13855. }, normalize: function(t3) {
  13856. if (e2(t3), t3.length === 0)
  13857. return ".";
  13858. var n2 = t3.charCodeAt(0) === 47, o = t3.charCodeAt(t3.length - 1) === 47;
  13859. return (t3 = r2(t3, !n2)).length !== 0 || n2 || (t3 = "."), t3.length > 0 && o && (t3 += "/"), n2 ? "/" + t3 : t3;
  13860. }, isAbsolute: function(t3) {
  13861. return e2(t3), t3.length > 0 && t3.charCodeAt(0) === 47;
  13862. }, join: function() {
  13863. if (arguments.length === 0)
  13864. return ".";
  13865. for (var t3, r3 = 0; r3 < arguments.length; ++r3) {
  13866. var o = arguments[r3];
  13867. e2(o), o.length > 0 && (t3 === void 0 ? t3 = o : t3 += "/" + o);
  13868. }
  13869. return t3 === void 0 ? "." : n.normalize(t3);
  13870. }, relative: function(t3, r3) {
  13871. if (e2(t3), e2(r3), t3 === r3)
  13872. return "";
  13873. if ((t3 = n.resolve(t3)) === (r3 = n.resolve(r3)))
  13874. return "";
  13875. for (var o = 1; o < t3.length && t3.charCodeAt(o) === 47; ++o)
  13876. ;
  13877. for (var i = t3.length, a2 = i - o, h = 1; h < r3.length && r3.charCodeAt(h) === 47; ++h)
  13878. ;
  13879. for (var s = r3.length - h, c = a2 < s ? a2 : s, f2 = -1, u = 0; u <= c; ++u) {
  13880. if (u === c) {
  13881. if (s > c) {
  13882. if (r3.charCodeAt(h + u) === 47)
  13883. return r3.slice(h + u + 1);
  13884. if (u === 0)
  13885. return r3.slice(h + u);
  13886. } else
  13887. a2 > c && (t3.charCodeAt(o + u) === 47 ? f2 = u : u === 0 && (f2 = 0));
  13888. break;
  13889. }
  13890. var l = t3.charCodeAt(o + u);
  13891. if (l !== r3.charCodeAt(h + u))
  13892. break;
  13893. l === 47 && (f2 = u);
  13894. }
  13895. var p = "";
  13896. for (u = o + f2 + 1; u <= i; ++u)
  13897. u !== i && t3.charCodeAt(u) !== 47 || (p.length === 0 ? p += ".." : p += "/..");
  13898. return p.length > 0 ? p + r3.slice(h + f2) : (h += f2, r3.charCodeAt(h) === 47 && ++h, r3.slice(h));
  13899. }, _makeLong: function(t3) {
  13900. return t3;
  13901. }, dirname: function(t3) {
  13902. if (e2(t3), t3.length === 0)
  13903. return ".";
  13904. for (var r3 = t3.charCodeAt(0), n2 = r3 === 47, o = -1, i = true, a2 = t3.length - 1; a2 >= 1; --a2)
  13905. if ((r3 = t3.charCodeAt(a2)) === 47) {
  13906. if (!i) {
  13907. o = a2;
  13908. break;
  13909. }
  13910. } else
  13911. i = false;
  13912. return o === -1 ? n2 ? "/" : "." : n2 && o === 1 ? "//" : t3.slice(0, o);
  13913. }, basename: function(t3, r3) {
  13914. if (r3 !== void 0 && typeof r3 != "string")
  13915. throw new TypeError('"ext" argument must be a string');
  13916. e2(t3);
  13917. var n2, o = 0, i = -1, a2 = true;
  13918. if (r3 !== void 0 && r3.length > 0 && r3.length <= t3.length) {
  13919. if (r3.length === t3.length && r3 === t3)
  13920. return "";
  13921. var h = r3.length - 1, s = -1;
  13922. for (n2 = t3.length - 1; n2 >= 0; --n2) {
  13923. var c = t3.charCodeAt(n2);
  13924. if (c === 47) {
  13925. if (!a2) {
  13926. o = n2 + 1;
  13927. break;
  13928. }
  13929. } else
  13930. s === -1 && (a2 = false, s = n2 + 1), h >= 0 && (c === r3.charCodeAt(h) ? --h == -1 && (i = n2) : (h = -1, i = s));
  13931. }
  13932. return o === i ? i = s : i === -1 && (i = t3.length), t3.slice(o, i);
  13933. }
  13934. for (n2 = t3.length - 1; n2 >= 0; --n2)
  13935. if (t3.charCodeAt(n2) === 47) {
  13936. if (!a2) {
  13937. o = n2 + 1;
  13938. break;
  13939. }
  13940. } else
  13941. i === -1 && (a2 = false, i = n2 + 1);
  13942. return i === -1 ? "" : t3.slice(o, i);
  13943. }, extname: function(t3) {
  13944. e2(t3);
  13945. for (var r3 = -1, n2 = 0, o = -1, i = true, a2 = 0, h = t3.length - 1; h >= 0; --h) {
  13946. var s = t3.charCodeAt(h);
  13947. if (s !== 47)
  13948. o === -1 && (i = false, o = h + 1), s === 46 ? r3 === -1 ? r3 = h : a2 !== 1 && (a2 = 1) : r3 !== -1 && (a2 = -1);
  13949. else if (!i) {
  13950. n2 = h + 1;
  13951. break;
  13952. }
  13953. }
  13954. return r3 === -1 || o === -1 || a2 === 0 || a2 === 1 && r3 === o - 1 && r3 === n2 + 1 ? "" : t3.slice(r3, o);
  13955. }, format: function(t3) {
  13956. if (t3 === null || typeof t3 != "object")
  13957. throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t3);
  13958. return function(t4, e3) {
  13959. var r3 = e3.dir || e3.root, n2 = e3.base || (e3.name || "") + (e3.ext || "");
  13960. return r3 ? r3 === e3.root ? r3 + n2 : r3 + "/" + n2 : n2;
  13961. }(0, t3);
  13962. }, parse: function(t3) {
  13963. e2(t3);
  13964. var r3 = {root: "", dir: "", base: "", ext: "", name: ""};
  13965. if (t3.length === 0)
  13966. return r3;
  13967. var n2, o = t3.charCodeAt(0), i = o === 47;
  13968. i ? (r3.root = "/", n2 = 1) : n2 = 0;
  13969. for (var a2 = -1, h = 0, s = -1, c = true, f2 = t3.length - 1, u = 0; f2 >= n2; --f2)
  13970. if ((o = t3.charCodeAt(f2)) !== 47)
  13971. s === -1 && (c = false, s = f2 + 1), o === 46 ? a2 === -1 ? a2 = f2 : u !== 1 && (u = 1) : a2 !== -1 && (u = -1);
  13972. else if (!c) {
  13973. h = f2 + 1;
  13974. break;
  13975. }
  13976. return a2 === -1 || s === -1 || u === 0 || u === 1 && a2 === s - 1 && a2 === h + 1 ? s !== -1 && (r3.base = r3.name = h === 0 && i ? t3.slice(1, s) : t3.slice(h, s)) : (h === 0 && i ? (r3.name = t3.slice(1, a2), r3.base = t3.slice(1, s)) : (r3.name = t3.slice(h, a2), r3.base = t3.slice(h, s)), r3.ext = t3.slice(a2, s)), h > 0 ? r3.dir = t3.slice(0, h - 1) : i && (r3.dir = "/"), r3;
  13977. }, sep: "/", delimiter: ":", win32: null, posix: null};
  13978. n.posix = n, t2.exports = n;
  13979. }, 447: (t2, e2, r2) => {
  13980. var n;
  13981. if (r2.r(e2), r2.d(e2, {URI: () => d, Utils: () => P}), typeof process == "object")
  13982. n = process.platform === "win32";
  13983. else if (typeof navigator == "object") {
  13984. var o = navigator.userAgent;
  13985. n = o.indexOf("Windows") >= 0;
  13986. }
  13987. var i, a2, h = (i = function(t3, e3) {
  13988. return (i = Object.setPrototypeOf || {__proto__: []} instanceof Array && function(t4, e4) {
  13989. t4.__proto__ = e4;
  13990. } || function(t4, e4) {
  13991. for (var r3 in e4)
  13992. Object.prototype.hasOwnProperty.call(e4, r3) && (t4[r3] = e4[r3]);
  13993. })(t3, e3);
  13994. }, function(t3, e3) {
  13995. if (typeof e3 != "function" && e3 !== null)
  13996. throw new TypeError("Class extends value " + String(e3) + " is not a constructor or null");
  13997. function r3() {
  13998. this.constructor = t3;
  13999. }
  14000. i(t3, e3), t3.prototype = e3 === null ? Object.create(e3) : (r3.prototype = e3.prototype, new r3());
  14001. }), s = /^\w[\w\d+.-]*$/, c = /^\//, f2 = /^\/\//;
  14002. function u(t3, e3) {
  14003. if (!t3.scheme && e3)
  14004. throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(t3.authority, '", path: "').concat(t3.path, '", query: "').concat(t3.query, '", fragment: "').concat(t3.fragment, '"}'));
  14005. if (t3.scheme && !s.test(t3.scheme))
  14006. throw new Error("[UriError]: Scheme contains illegal characters.");
  14007. if (t3.path) {
  14008. if (t3.authority) {
  14009. if (!c.test(t3.path))
  14010. throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
  14011. } else if (f2.test(t3.path))
  14012. throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
  14013. }
  14014. }
  14015. var l = "", p = "/", g = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/, d = function() {
  14016. function t3(t4, e3, r3, n2, o2, i2) {
  14017. i2 === void 0 && (i2 = false), typeof t4 == "object" ? (this.scheme = t4.scheme || l, this.authority = t4.authority || l, this.path = t4.path || l, this.query = t4.query || l, this.fragment = t4.fragment || l) : (this.scheme = function(t5, e4) {
  14018. return t5 || e4 ? t5 : "file";
  14019. }(t4, i2), this.authority = e3 || l, this.path = function(t5, e4) {
  14020. switch (t5) {
  14021. case "https":
  14022. case "http":
  14023. case "file":
  14024. e4 ? e4[0] !== p && (e4 = p + e4) : e4 = p;
  14025. }
  14026. return e4;
  14027. }(this.scheme, r3 || l), this.query = n2 || l, this.fragment = o2 || l, u(this, i2));
  14028. }
  14029. return t3.isUri = function(e3) {
  14030. return e3 instanceof t3 || !!e3 && typeof e3.authority == "string" && typeof e3.fragment == "string" && typeof e3.path == "string" && typeof e3.query == "string" && typeof e3.scheme == "string" && typeof e3.fsPath == "string" && typeof e3.with == "function" && typeof e3.toString == "function";
  14031. }, Object.defineProperty(t3.prototype, "fsPath", {get: function() {
  14032. return A2(this, false);
  14033. }, enumerable: false, configurable: true}), t3.prototype.with = function(t4) {
  14034. if (!t4)
  14035. return this;
  14036. var e3 = t4.scheme, r3 = t4.authority, n2 = t4.path, o2 = t4.query, i2 = t4.fragment;
  14037. return e3 === void 0 ? e3 = this.scheme : e3 === null && (e3 = l), r3 === void 0 ? r3 = this.authority : r3 === null && (r3 = l), n2 === void 0 ? n2 = this.path : n2 === null && (n2 = l), o2 === void 0 ? o2 = this.query : o2 === null && (o2 = l), i2 === void 0 ? i2 = this.fragment : i2 === null && (i2 = l), e3 === this.scheme && r3 === this.authority && n2 === this.path && o2 === this.query && i2 === this.fragment ? this : new y(e3, r3, n2, o2, i2);
  14038. }, t3.parse = function(t4, e3) {
  14039. e3 === void 0 && (e3 = false);
  14040. var r3 = g.exec(t4);
  14041. return r3 ? new y(r3[2] || l, O(r3[4] || l), O(r3[5] || l), O(r3[7] || l), O(r3[9] || l), e3) : new y(l, l, l, l, l);
  14042. }, t3.file = function(t4) {
  14043. var e3 = l;
  14044. if (n && (t4 = t4.replace(/\\/g, p)), t4[0] === p && t4[1] === p) {
  14045. var r3 = t4.indexOf(p, 2);
  14046. r3 === -1 ? (e3 = t4.substring(2), t4 = p) : (e3 = t4.substring(2, r3), t4 = t4.substring(r3) || p);
  14047. }
  14048. return new y("file", e3, t4, l, l);
  14049. }, t3.from = function(t4) {
  14050. var e3 = new y(t4.scheme, t4.authority, t4.path, t4.query, t4.fragment);
  14051. return u(e3, true), e3;
  14052. }, t3.prototype.toString = function(t4) {
  14053. return t4 === void 0 && (t4 = false), w(this, t4);
  14054. }, t3.prototype.toJSON = function() {
  14055. return this;
  14056. }, t3.revive = function(e3) {
  14057. if (e3) {
  14058. if (e3 instanceof t3)
  14059. return e3;
  14060. var r3 = new y(e3);
  14061. return r3._formatted = e3.external, r3._fsPath = e3._sep === v ? e3.fsPath : null, r3;
  14062. }
  14063. return e3;
  14064. }, t3;
  14065. }(), v = n ? 1 : void 0, y = function(t3) {
  14066. function e3() {
  14067. var e4 = t3 !== null && t3.apply(this, arguments) || this;
  14068. return e4._formatted = null, e4._fsPath = null, e4;
  14069. }
  14070. return h(e3, t3), Object.defineProperty(e3.prototype, "fsPath", {get: function() {
  14071. return this._fsPath || (this._fsPath = A2(this, false)), this._fsPath;
  14072. }, enumerable: false, configurable: true}), e3.prototype.toString = function(t4) {
  14073. return t4 === void 0 && (t4 = false), t4 ? w(this, true) : (this._formatted || (this._formatted = w(this, false)), this._formatted);
  14074. }, e3.prototype.toJSON = function() {
  14075. var t4 = {$mid: 1};
  14076. return this._fsPath && (t4.fsPath = this._fsPath, t4._sep = v), this._formatted && (t4.external = this._formatted), this.path && (t4.path = this.path), this.scheme && (t4.scheme = this.scheme), this.authority && (t4.authority = this.authority), this.query && (t4.query = this.query), this.fragment && (t4.fragment = this.fragment), t4;
  14077. }, e3;
  14078. }(d), m = ((a2 = {})[58] = "%3A", a2[47] = "%2F", a2[63] = "%3F", a2[35] = "%23", a2[91] = "%5B", a2[93] = "%5D", a2[64] = "%40", a2[33] = "%21", a2[36] = "%24", a2[38] = "%26", a2[39] = "%27", a2[40] = "%28", a2[41] = "%29", a2[42] = "%2A", a2[43] = "%2B", a2[44] = "%2C", a2[59] = "%3B", a2[61] = "%3D", a2[32] = "%20", a2);
  14079. function b(t3, e3) {
  14080. for (var r3 = void 0, n2 = -1, o2 = 0; o2 < t3.length; o2++) {
  14081. var i2 = t3.charCodeAt(o2);
  14082. if (i2 >= 97 && i2 <= 122 || i2 >= 65 && i2 <= 90 || i2 >= 48 && i2 <= 57 || i2 === 45 || i2 === 46 || i2 === 95 || i2 === 126 || e3 && i2 === 47)
  14083. n2 !== -1 && (r3 += encodeURIComponent(t3.substring(n2, o2)), n2 = -1), r3 !== void 0 && (r3 += t3.charAt(o2));
  14084. else {
  14085. r3 === void 0 && (r3 = t3.substr(0, o2));
  14086. var a3 = m[i2];
  14087. a3 !== void 0 ? (n2 !== -1 && (r3 += encodeURIComponent(t3.substring(n2, o2)), n2 = -1), r3 += a3) : n2 === -1 && (n2 = o2);
  14088. }
  14089. }
  14090. return n2 !== -1 && (r3 += encodeURIComponent(t3.substring(n2))), r3 !== void 0 ? r3 : t3;
  14091. }
  14092. function C(t3) {
  14093. for (var e3 = void 0, r3 = 0; r3 < t3.length; r3++) {
  14094. var n2 = t3.charCodeAt(r3);
  14095. n2 === 35 || n2 === 63 ? (e3 === void 0 && (e3 = t3.substr(0, r3)), e3 += m[n2]) : e3 !== void 0 && (e3 += t3[r3]);
  14096. }
  14097. return e3 !== void 0 ? e3 : t3;
  14098. }
  14099. function A2(t3, e3) {
  14100. var r3;
  14101. return r3 = t3.authority && t3.path.length > 1 && t3.scheme === "file" ? "//".concat(t3.authority).concat(t3.path) : t3.path.charCodeAt(0) === 47 && (t3.path.charCodeAt(1) >= 65 && t3.path.charCodeAt(1) <= 90 || t3.path.charCodeAt(1) >= 97 && t3.path.charCodeAt(1) <= 122) && t3.path.charCodeAt(2) === 58 ? e3 ? t3.path.substr(1) : t3.path[1].toLowerCase() + t3.path.substr(2) : t3.path, n && (r3 = r3.replace(/\//g, "\\")), r3;
  14102. }
  14103. function w(t3, e3) {
  14104. var r3 = e3 ? C : b, n2 = "", o2 = t3.scheme, i2 = t3.authority, a3 = t3.path, h2 = t3.query, s2 = t3.fragment;
  14105. if (o2 && (n2 += o2, n2 += ":"), (i2 || o2 === "file") && (n2 += p, n2 += p), i2) {
  14106. var c2 = i2.indexOf("@");
  14107. if (c2 !== -1) {
  14108. var f3 = i2.substr(0, c2);
  14109. i2 = i2.substr(c2 + 1), (c2 = f3.indexOf(":")) === -1 ? n2 += r3(f3, false) : (n2 += r3(f3.substr(0, c2), false), n2 += ":", n2 += r3(f3.substr(c2 + 1), false)), n2 += "@";
  14110. }
  14111. (c2 = (i2 = i2.toLowerCase()).indexOf(":")) === -1 ? n2 += r3(i2, false) : (n2 += r3(i2.substr(0, c2), false), n2 += i2.substr(c2));
  14112. }
  14113. if (a3) {
  14114. if (a3.length >= 3 && a3.charCodeAt(0) === 47 && a3.charCodeAt(2) === 58)
  14115. (u2 = a3.charCodeAt(1)) >= 65 && u2 <= 90 && (a3 = "/".concat(String.fromCharCode(u2 + 32), ":").concat(a3.substr(3)));
  14116. else if (a3.length >= 2 && a3.charCodeAt(1) === 58) {
  14117. var u2;
  14118. (u2 = a3.charCodeAt(0)) >= 65 && u2 <= 90 && (a3 = "".concat(String.fromCharCode(u2 + 32), ":").concat(a3.substr(2)));
  14119. }
  14120. n2 += r3(a3, true);
  14121. }
  14122. return h2 && (n2 += "?", n2 += r3(h2, false)), s2 && (n2 += "#", n2 += e3 ? s2 : b(s2, false)), n2;
  14123. }
  14124. function x(t3) {
  14125. try {
  14126. return decodeURIComponent(t3);
  14127. } catch (e3) {
  14128. return t3.length > 3 ? t3.substr(0, 3) + x(t3.substr(3)) : t3;
  14129. }
  14130. }
  14131. var _ = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
  14132. function O(t3) {
  14133. return t3.match(_) ? t3.replace(_, function(t4) {
  14134. return x(t4);
  14135. }) : t3;
  14136. }
  14137. var P, j = r2(470), U = function(t3, e3, r3) {
  14138. if (r3 || arguments.length === 2)
  14139. for (var n2, o2 = 0, i2 = e3.length; o2 < i2; o2++)
  14140. !n2 && o2 in e3 || (n2 || (n2 = Array.prototype.slice.call(e3, 0, o2)), n2[o2] = e3[o2]);
  14141. return t3.concat(n2 || Array.prototype.slice.call(e3));
  14142. }, I = j.posix || j;
  14143. !function(t3) {
  14144. t3.joinPath = function(t4) {
  14145. for (var e3 = [], r3 = 1; r3 < arguments.length; r3++)
  14146. e3[r3 - 1] = arguments[r3];
  14147. return t4.with({path: I.join.apply(I, U([t4.path], e3, false))});
  14148. }, t3.resolvePath = function(t4) {
  14149. for (var e3 = [], r3 = 1; r3 < arguments.length; r3++)
  14150. e3[r3 - 1] = arguments[r3];
  14151. var n2 = t4.path || "/";
  14152. return t4.with({path: I.resolve.apply(I, U([n2], e3, false))});
  14153. }, t3.dirname = function(t4) {
  14154. var e3 = I.dirname(t4.path);
  14155. return e3.length === 1 && e3.charCodeAt(0) === 46 ? t4 : t4.with({path: e3});
  14156. }, t3.basename = function(t4) {
  14157. return I.basename(t4.path);
  14158. }, t3.extname = function(t4) {
  14159. return I.extname(t4.path);
  14160. };
  14161. }(P || (P = {}));
  14162. }}, e = {};
  14163. function r(n) {
  14164. if (e[n])
  14165. return e[n].exports;
  14166. var o = e[n] = {exports: {}};
  14167. return t[n](o, o.exports, r), o.exports;
  14168. }
  14169. return r.d = (t2, e2) => {
  14170. for (var n in e2)
  14171. r.o(e2, n) && !r.o(t2, n) && Object.defineProperty(t2, n, {enumerable: true, get: e2[n]});
  14172. }, r.o = (t2, e2) => Object.prototype.hasOwnProperty.call(t2, e2), r.r = (t2) => {
  14173. typeof Symbol != "undefined" && Symbol.toStringTag && Object.defineProperty(t2, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(t2, "__esModule", {value: true});
  14174. }, r(447);
  14175. })();
  14176. var {URI: URI2, Utils} = LIB;
  14177. function createRegex(glob, opts) {
  14178. if (typeof glob !== "string") {
  14179. throw new TypeError("Expected a string");
  14180. }
  14181. var str = String(glob);
  14182. var reStr = "";
  14183. var extended = opts ? !!opts.extended : false;
  14184. var globstar = opts ? !!opts.globstar : false;
  14185. var inGroup = false;
  14186. var flags = opts && typeof opts.flags === "string" ? opts.flags : "";
  14187. var c;
  14188. for (var i = 0, len = str.length; i < len; i++) {
  14189. c = str[i];
  14190. switch (c) {
  14191. case "/":
  14192. case "$":
  14193. case "^":
  14194. case "+":
  14195. case ".":
  14196. case "(":
  14197. case ")":
  14198. case "=":
  14199. case "!":
  14200. case "|":
  14201. reStr += "\\" + c;
  14202. break;
  14203. case "?":
  14204. if (extended) {
  14205. reStr += ".";
  14206. break;
  14207. }
  14208. case "[":
  14209. case "]":
  14210. if (extended) {
  14211. reStr += c;
  14212. break;
  14213. }
  14214. case "{":
  14215. if (extended) {
  14216. inGroup = true;
  14217. reStr += "(";
  14218. break;
  14219. }
  14220. case "}":
  14221. if (extended) {
  14222. inGroup = false;
  14223. reStr += ")";
  14224. break;
  14225. }
  14226. case ",":
  14227. if (inGroup) {
  14228. reStr += "|";
  14229. break;
  14230. }
  14231. reStr += "\\" + c;
  14232. break;
  14233. case "*":
  14234. var prevChar = str[i - 1];
  14235. var starCount = 1;
  14236. while (str[i + 1] === "*") {
  14237. starCount++;
  14238. i++;
  14239. }
  14240. var nextChar = str[i + 1];
  14241. if (!globstar) {
  14242. reStr += ".*";
  14243. } else {
  14244. var isGlobstar = starCount > 1 && (prevChar === "/" || prevChar === void 0 || prevChar === "{" || prevChar === ",") && (nextChar === "/" || nextChar === void 0 || nextChar === "," || nextChar === "}");
  14245. if (isGlobstar) {
  14246. if (nextChar === "/") {
  14247. i++;
  14248. } else if (prevChar === "/" && reStr.endsWith("\\/")) {
  14249. reStr = reStr.substr(0, reStr.length - 2);
  14250. }
  14251. reStr += "((?:[^/]*(?:/|$))*)";
  14252. } else {
  14253. reStr += "([^/]*)";
  14254. }
  14255. }
  14256. break;
  14257. default:
  14258. reStr += c;
  14259. }
  14260. }
  14261. if (!flags || !~flags.indexOf("g")) {
  14262. reStr = "^" + reStr + "$";
  14263. }
  14264. return new RegExp(reStr, flags);
  14265. }
  14266. var localize6 = loadMessageBundle();
  14267. var BANG = "!";
  14268. var PATH_SEP = "/";
  14269. var FilePatternAssociation = function() {
  14270. function FilePatternAssociation2(pattern, uris) {
  14271. this.globWrappers = [];
  14272. try {
  14273. for (var _i = 0, pattern_1 = pattern; _i < pattern_1.length; _i++) {
  14274. var patternString = pattern_1[_i];
  14275. var include = patternString[0] !== BANG;
  14276. if (!include) {
  14277. patternString = patternString.substring(1);
  14278. }
  14279. if (patternString.length > 0) {
  14280. if (patternString[0] === PATH_SEP) {
  14281. patternString = patternString.substring(1);
  14282. }
  14283. this.globWrappers.push({
  14284. regexp: createRegex("**/" + patternString, {extended: true, globstar: true}),
  14285. include
  14286. });
  14287. }
  14288. }
  14289. ;
  14290. this.uris = uris;
  14291. } catch (e) {
  14292. this.globWrappers.length = 0;
  14293. this.uris = [];
  14294. }
  14295. }
  14296. FilePatternAssociation2.prototype.matchesPattern = function(fileName) {
  14297. var match = false;
  14298. for (var _i = 0, _a3 = this.globWrappers; _i < _a3.length; _i++) {
  14299. var _b = _a3[_i], regexp = _b.regexp, include = _b.include;
  14300. if (regexp.test(fileName)) {
  14301. match = include;
  14302. }
  14303. }
  14304. return match;
  14305. };
  14306. FilePatternAssociation2.prototype.getURIs = function() {
  14307. return this.uris;
  14308. };
  14309. return FilePatternAssociation2;
  14310. }();
  14311. var SchemaHandle = function() {
  14312. function SchemaHandle2(service, uri, unresolvedSchemaContent) {
  14313. this.service = service;
  14314. this.uri = uri;
  14315. this.dependencies = /* @__PURE__ */ new Set();
  14316. this.anchors = void 0;
  14317. if (unresolvedSchemaContent) {
  14318. this.unresolvedSchema = this.service.promise.resolve(new UnresolvedSchema(unresolvedSchemaContent));
  14319. }
  14320. }
  14321. SchemaHandle2.prototype.getUnresolvedSchema = function() {
  14322. if (!this.unresolvedSchema) {
  14323. this.unresolvedSchema = this.service.loadSchema(this.uri);
  14324. }
  14325. return this.unresolvedSchema;
  14326. };
  14327. SchemaHandle2.prototype.getResolvedSchema = function() {
  14328. var _this = this;
  14329. if (!this.resolvedSchema) {
  14330. this.resolvedSchema = this.getUnresolvedSchema().then(function(unresolved) {
  14331. return _this.service.resolveSchemaContent(unresolved, _this);
  14332. });
  14333. }
  14334. return this.resolvedSchema;
  14335. };
  14336. SchemaHandle2.prototype.clearSchema = function() {
  14337. var hasChanges = !!this.unresolvedSchema;
  14338. this.resolvedSchema = void 0;
  14339. this.unresolvedSchema = void 0;
  14340. this.dependencies.clear();
  14341. this.anchors = void 0;
  14342. return hasChanges;
  14343. };
  14344. return SchemaHandle2;
  14345. }();
  14346. var UnresolvedSchema = function() {
  14347. function UnresolvedSchema2(schema2, errors) {
  14348. if (errors === void 0) {
  14349. errors = [];
  14350. }
  14351. this.schema = schema2;
  14352. this.errors = errors;
  14353. }
  14354. return UnresolvedSchema2;
  14355. }();
  14356. var ResolvedSchema = function() {
  14357. function ResolvedSchema2(schema2, errors) {
  14358. if (errors === void 0) {
  14359. errors = [];
  14360. }
  14361. this.schema = schema2;
  14362. this.errors = errors;
  14363. }
  14364. ResolvedSchema2.prototype.getSection = function(path) {
  14365. var schemaRef = this.getSectionRecursive(path, this.schema);
  14366. if (schemaRef) {
  14367. return asSchema(schemaRef);
  14368. }
  14369. return void 0;
  14370. };
  14371. ResolvedSchema2.prototype.getSectionRecursive = function(path, schema2) {
  14372. if (!schema2 || typeof schema2 === "boolean" || path.length === 0) {
  14373. return schema2;
  14374. }
  14375. var next = path.shift();
  14376. if (schema2.properties && typeof schema2.properties[next]) {
  14377. return this.getSectionRecursive(path, schema2.properties[next]);
  14378. } else if (schema2.patternProperties) {
  14379. for (var _i = 0, _a3 = Object.keys(schema2.patternProperties); _i < _a3.length; _i++) {
  14380. var pattern = _a3[_i];
  14381. var regex = extendedRegExp(pattern);
  14382. if (regex === null || regex === void 0 ? void 0 : regex.test(next)) {
  14383. return this.getSectionRecursive(path, schema2.patternProperties[pattern]);
  14384. }
  14385. }
  14386. } else if (typeof schema2.additionalProperties === "object") {
  14387. return this.getSectionRecursive(path, schema2.additionalProperties);
  14388. } else if (next.match("[0-9]+")) {
  14389. if (Array.isArray(schema2.items)) {
  14390. var index = parseInt(next, 10);
  14391. if (!isNaN(index) && schema2.items[index]) {
  14392. return this.getSectionRecursive(path, schema2.items[index]);
  14393. }
  14394. } else if (schema2.items) {
  14395. return this.getSectionRecursive(path, schema2.items);
  14396. }
  14397. }
  14398. return void 0;
  14399. };
  14400. return ResolvedSchema2;
  14401. }();
  14402. var JSONSchemaService = function() {
  14403. function JSONSchemaService2(requestService, contextService, promiseConstructor) {
  14404. this.contextService = contextService;
  14405. this.requestService = requestService;
  14406. this.promiseConstructor = promiseConstructor || Promise;
  14407. this.callOnDispose = [];
  14408. this.contributionSchemas = {};
  14409. this.contributionAssociations = [];
  14410. this.schemasById = {};
  14411. this.filePatternAssociations = [];
  14412. this.registeredSchemasIds = {};
  14413. }
  14414. JSONSchemaService2.prototype.getRegisteredSchemaIds = function(filter) {
  14415. return Object.keys(this.registeredSchemasIds).filter(function(id) {
  14416. var scheme = URI2.parse(id).scheme;
  14417. return scheme !== "schemaservice" && (!filter || filter(scheme));
  14418. });
  14419. };
  14420. Object.defineProperty(JSONSchemaService2.prototype, "promise", {
  14421. get: function() {
  14422. return this.promiseConstructor;
  14423. },
  14424. enumerable: false,
  14425. configurable: true
  14426. });
  14427. JSONSchemaService2.prototype.dispose = function() {
  14428. while (this.callOnDispose.length > 0) {
  14429. this.callOnDispose.pop()();
  14430. }
  14431. };
  14432. JSONSchemaService2.prototype.onResourceChange = function(uri) {
  14433. var _this = this;
  14434. this.cachedSchemaForResource = void 0;
  14435. var hasChanges = false;
  14436. uri = normalizeId(uri);
  14437. var toWalk = [uri];
  14438. var all = Object.keys(this.schemasById).map(function(key) {
  14439. return _this.schemasById[key];
  14440. });
  14441. while (toWalk.length) {
  14442. var curr = toWalk.pop();
  14443. for (var i = 0; i < all.length; i++) {
  14444. var handle = all[i];
  14445. if (handle && (handle.uri === curr || handle.dependencies.has(curr))) {
  14446. if (handle.uri !== curr) {
  14447. toWalk.push(handle.uri);
  14448. }
  14449. if (handle.clearSchema()) {
  14450. hasChanges = true;
  14451. }
  14452. all[i] = void 0;
  14453. }
  14454. }
  14455. }
  14456. return hasChanges;
  14457. };
  14458. JSONSchemaService2.prototype.setSchemaContributions = function(schemaContributions2) {
  14459. if (schemaContributions2.schemas) {
  14460. var schemas = schemaContributions2.schemas;
  14461. for (var id in schemas) {
  14462. var normalizedId = normalizeId(id);
  14463. this.contributionSchemas[normalizedId] = this.addSchemaHandle(normalizedId, schemas[id]);
  14464. }
  14465. }
  14466. if (Array.isArray(schemaContributions2.schemaAssociations)) {
  14467. var schemaAssociations = schemaContributions2.schemaAssociations;
  14468. for (var _i = 0, schemaAssociations_1 = schemaAssociations; _i < schemaAssociations_1.length; _i++) {
  14469. var schemaAssociation = schemaAssociations_1[_i];
  14470. var uris = schemaAssociation.uris.map(normalizeId);
  14471. var association = this.addFilePatternAssociation(schemaAssociation.pattern, uris);
  14472. this.contributionAssociations.push(association);
  14473. }
  14474. }
  14475. };
  14476. JSONSchemaService2.prototype.addSchemaHandle = function(id, unresolvedSchemaContent) {
  14477. var schemaHandle = new SchemaHandle(this, id, unresolvedSchemaContent);
  14478. this.schemasById[id] = schemaHandle;
  14479. return schemaHandle;
  14480. };
  14481. JSONSchemaService2.prototype.getOrAddSchemaHandle = function(id, unresolvedSchemaContent) {
  14482. return this.schemasById[id] || this.addSchemaHandle(id, unresolvedSchemaContent);
  14483. };
  14484. JSONSchemaService2.prototype.addFilePatternAssociation = function(pattern, uris) {
  14485. var fpa = new FilePatternAssociation(pattern, uris);
  14486. this.filePatternAssociations.push(fpa);
  14487. return fpa;
  14488. };
  14489. JSONSchemaService2.prototype.registerExternalSchema = function(uri, filePatterns, unresolvedSchemaContent) {
  14490. var id = normalizeId(uri);
  14491. this.registeredSchemasIds[id] = true;
  14492. this.cachedSchemaForResource = void 0;
  14493. if (filePatterns) {
  14494. this.addFilePatternAssociation(filePatterns, [id]);
  14495. }
  14496. return unresolvedSchemaContent ? this.addSchemaHandle(id, unresolvedSchemaContent) : this.getOrAddSchemaHandle(id);
  14497. };
  14498. JSONSchemaService2.prototype.clearExternalSchemas = function() {
  14499. this.schemasById = {};
  14500. this.filePatternAssociations = [];
  14501. this.registeredSchemasIds = {};
  14502. this.cachedSchemaForResource = void 0;
  14503. for (var id in this.contributionSchemas) {
  14504. this.schemasById[id] = this.contributionSchemas[id];
  14505. this.registeredSchemasIds[id] = true;
  14506. }
  14507. for (var _i = 0, _a3 = this.contributionAssociations; _i < _a3.length; _i++) {
  14508. var contributionAssociation = _a3[_i];
  14509. this.filePatternAssociations.push(contributionAssociation);
  14510. }
  14511. };
  14512. JSONSchemaService2.prototype.getResolvedSchema = function(schemaId) {
  14513. var id = normalizeId(schemaId);
  14514. var schemaHandle = this.schemasById[id];
  14515. if (schemaHandle) {
  14516. return schemaHandle.getResolvedSchema();
  14517. }
  14518. return this.promise.resolve(void 0);
  14519. };
  14520. JSONSchemaService2.prototype.loadSchema = function(url) {
  14521. if (!this.requestService) {
  14522. var errorMessage = localize6("json.schema.norequestservice", "Unable to load schema from '{0}'. No schema request service available", toDisplayString(url));
  14523. return this.promise.resolve(new UnresolvedSchema({}, [errorMessage]));
  14524. }
  14525. return this.requestService(url).then(function(content) {
  14526. if (!content) {
  14527. var errorMessage2 = localize6("json.schema.nocontent", "Unable to load schema from '{0}': No content.", toDisplayString(url));
  14528. return new UnresolvedSchema({}, [errorMessage2]);
  14529. }
  14530. var schemaContent = {};
  14531. var jsonErrors = [];
  14532. schemaContent = parse2(content, jsonErrors);
  14533. var errors = jsonErrors.length ? [localize6("json.schema.invalidFormat", "Unable to parse content from '{0}': Parse error at offset {1}.", toDisplayString(url), jsonErrors[0].offset)] : [];
  14534. return new UnresolvedSchema(schemaContent, errors);
  14535. }, function(error) {
  14536. var errorMessage2 = error.toString();
  14537. var errorSplit = error.toString().split("Error: ");
  14538. if (errorSplit.length > 1) {
  14539. errorMessage2 = errorSplit[1];
  14540. }
  14541. if (endsWith(errorMessage2, ".")) {
  14542. errorMessage2 = errorMessage2.substr(0, errorMessage2.length - 1);
  14543. }
  14544. return new UnresolvedSchema({}, [localize6("json.schema.nocontent", "Unable to load schema from '{0}': {1}.", toDisplayString(url), errorMessage2)]);
  14545. });
  14546. };
  14547. JSONSchemaService2.prototype.resolveSchemaContent = function(schemaToResolve, handle) {
  14548. var _this = this;
  14549. var resolveErrors = schemaToResolve.errors.slice(0);
  14550. var schema2 = schemaToResolve.schema;
  14551. if (schema2.$schema) {
  14552. var id = normalizeId(schema2.$schema);
  14553. if (id === "http://json-schema.org/draft-03/schema") {
  14554. return this.promise.resolve(new ResolvedSchema({}, [localize6("json.schema.draft03.notsupported", "Draft-03 schemas are not supported.")]));
  14555. } else if (id === "https://json-schema.org/draft/2019-09/schema") {
  14556. resolveErrors.push(localize6("json.schema.draft201909.notsupported", "Draft 2019-09 schemas are not yet fully supported."));
  14557. } else if (id === "https://json-schema.org/draft/2020-12/schema") {
  14558. resolveErrors.push(localize6("json.schema.draft202012.notsupported", "Draft 2020-12 schemas are not yet fully supported."));
  14559. }
  14560. }
  14561. var contextService = this.contextService;
  14562. var findSectionByJSONPointer = function(schema22, path) {
  14563. path = decodeURIComponent(path);
  14564. var current = schema22;
  14565. if (path[0] === "/") {
  14566. path = path.substring(1);
  14567. }
  14568. path.split("/").some(function(part) {
  14569. part = part.replace(/~1/g, "/").replace(/~0/g, "~");
  14570. current = current[part];
  14571. return !current;
  14572. });
  14573. return current;
  14574. };
  14575. var findSchemaById = function(schema22, handle2, id2) {
  14576. if (!handle2.anchors) {
  14577. handle2.anchors = collectAnchors(schema22);
  14578. }
  14579. return handle2.anchors.get(id2);
  14580. };
  14581. var merge = function(target, section) {
  14582. for (var key in section) {
  14583. if (section.hasOwnProperty(key) && !target.hasOwnProperty(key) && key !== "id" && key !== "$id") {
  14584. target[key] = section[key];
  14585. }
  14586. }
  14587. };
  14588. var mergeRef = function(target, sourceRoot, sourceHandle, refSegment) {
  14589. var section;
  14590. if (refSegment === void 0 || refSegment.length === 0) {
  14591. section = sourceRoot;
  14592. } else if (refSegment.charAt(0) === "/") {
  14593. section = findSectionByJSONPointer(sourceRoot, refSegment);
  14594. } else {
  14595. section = findSchemaById(sourceRoot, sourceHandle, refSegment);
  14596. }
  14597. if (section) {
  14598. merge(target, section);
  14599. } else {
  14600. resolveErrors.push(localize6("json.schema.invalidid", "$ref '{0}' in '{1}' can not be resolved.", refSegment, sourceHandle.uri));
  14601. }
  14602. };
  14603. var resolveExternalLink = function(node, uri, refSegment, parentHandle) {
  14604. if (contextService && !/^[A-Za-z][A-Za-z0-9+\-.+]*:\/\/.*/.test(uri)) {
  14605. uri = contextService.resolveRelativePath(uri, parentHandle.uri);
  14606. }
  14607. uri = normalizeId(uri);
  14608. var referencedHandle = _this.getOrAddSchemaHandle(uri);
  14609. return referencedHandle.getUnresolvedSchema().then(function(unresolvedSchema) {
  14610. parentHandle.dependencies.add(uri);
  14611. if (unresolvedSchema.errors.length) {
  14612. var loc = refSegment ? uri + "#" + refSegment : uri;
  14613. resolveErrors.push(localize6("json.schema.problemloadingref", "Problems loading reference '{0}': {1}", loc, unresolvedSchema.errors[0]));
  14614. }
  14615. mergeRef(node, unresolvedSchema.schema, referencedHandle, refSegment);
  14616. return resolveRefs(node, unresolvedSchema.schema, referencedHandle);
  14617. });
  14618. };
  14619. var resolveRefs = function(node, parentSchema, parentHandle) {
  14620. var openPromises = [];
  14621. _this.traverseNodes(node, function(next) {
  14622. var seenRefs = /* @__PURE__ */ new Set();
  14623. while (next.$ref) {
  14624. var ref = next.$ref;
  14625. var segments = ref.split("#", 2);
  14626. delete next.$ref;
  14627. if (segments[0].length > 0) {
  14628. openPromises.push(resolveExternalLink(next, segments[0], segments[1], parentHandle));
  14629. return;
  14630. } else {
  14631. if (!seenRefs.has(ref)) {
  14632. var id2 = segments[1];
  14633. mergeRef(next, parentSchema, parentHandle, id2);
  14634. seenRefs.add(ref);
  14635. }
  14636. }
  14637. }
  14638. });
  14639. return _this.promise.all(openPromises);
  14640. };
  14641. var collectAnchors = function(root) {
  14642. var result = /* @__PURE__ */ new Map();
  14643. _this.traverseNodes(root, function(next) {
  14644. var id2 = next.$id || next.id;
  14645. if (typeof id2 === "string" && id2.charAt(0) === "#") {
  14646. var anchor = id2.substring(1);
  14647. if (result.has(anchor)) {
  14648. resolveErrors.push(localize6("json.schema.duplicateid", "Duplicate id declaration: '{0}'", id2));
  14649. } else {
  14650. result.set(anchor, next);
  14651. }
  14652. }
  14653. });
  14654. return result;
  14655. };
  14656. return resolveRefs(schema2, schema2, handle).then(function(_) {
  14657. return new ResolvedSchema(schema2, resolveErrors);
  14658. });
  14659. };
  14660. JSONSchemaService2.prototype.traverseNodes = function(root, handle) {
  14661. if (!root || typeof root !== "object") {
  14662. return Promise.resolve(null);
  14663. }
  14664. var seen = /* @__PURE__ */ new Set();
  14665. var collectEntries = function() {
  14666. var entries = [];
  14667. for (var _i = 0; _i < arguments.length; _i++) {
  14668. entries[_i] = arguments[_i];
  14669. }
  14670. for (var _a3 = 0, entries_1 = entries; _a3 < entries_1.length; _a3++) {
  14671. var entry = entries_1[_a3];
  14672. if (typeof entry === "object") {
  14673. toWalk.push(entry);
  14674. }
  14675. }
  14676. };
  14677. var collectMapEntries = function() {
  14678. var maps = [];
  14679. for (var _i = 0; _i < arguments.length; _i++) {
  14680. maps[_i] = arguments[_i];
  14681. }
  14682. for (var _a3 = 0, maps_1 = maps; _a3 < maps_1.length; _a3++) {
  14683. var map = maps_1[_a3];
  14684. if (typeof map === "object") {
  14685. for (var k in map) {
  14686. var key = k;
  14687. var entry = map[key];
  14688. if (typeof entry === "object") {
  14689. toWalk.push(entry);
  14690. }
  14691. }
  14692. }
  14693. }
  14694. };
  14695. var collectArrayEntries = function() {
  14696. var arrays = [];
  14697. for (var _i = 0; _i < arguments.length; _i++) {
  14698. arrays[_i] = arguments[_i];
  14699. }
  14700. for (var _a3 = 0, arrays_1 = arrays; _a3 < arrays_1.length; _a3++) {
  14701. var array = arrays_1[_a3];
  14702. if (Array.isArray(array)) {
  14703. for (var _b = 0, array_1 = array; _b < array_1.length; _b++) {
  14704. var entry = array_1[_b];
  14705. if (typeof entry === "object") {
  14706. toWalk.push(entry);
  14707. }
  14708. }
  14709. }
  14710. }
  14711. };
  14712. var toWalk = [root];
  14713. var next = toWalk.pop();
  14714. while (next) {
  14715. if (!seen.has(next)) {
  14716. seen.add(next);
  14717. handle(next);
  14718. collectEntries(next.items, next.additionalItems, next.additionalProperties, next.not, next.contains, next.propertyNames, next.if, next.then, next.else);
  14719. collectMapEntries(next.definitions, next.properties, next.patternProperties, next.dependencies);
  14720. collectArrayEntries(next.anyOf, next.allOf, next.oneOf, next.items);
  14721. }
  14722. next = toWalk.pop();
  14723. }
  14724. };
  14725. ;
  14726. JSONSchemaService2.prototype.getSchemaFromProperty = function(resource, document) {
  14727. var _a3, _b;
  14728. if (((_a3 = document.root) === null || _a3 === void 0 ? void 0 : _a3.type) === "object") {
  14729. for (var _i = 0, _c = document.root.properties; _i < _c.length; _i++) {
  14730. var p = _c[_i];
  14731. if (p.keyNode.value === "$schema" && ((_b = p.valueNode) === null || _b === void 0 ? void 0 : _b.type) === "string") {
  14732. var schemaId = p.valueNode.value;
  14733. if (this.contextService && !/^\w[\w\d+.-]*:/.test(schemaId)) {
  14734. schemaId = this.contextService.resolveRelativePath(schemaId, resource);
  14735. }
  14736. return schemaId;
  14737. }
  14738. }
  14739. }
  14740. return void 0;
  14741. };
  14742. JSONSchemaService2.prototype.getAssociatedSchemas = function(resource) {
  14743. var seen = /* @__PURE__ */ Object.create(null);
  14744. var schemas = [];
  14745. var normalizedResource = normalizeResourceForMatching(resource);
  14746. for (var _i = 0, _a3 = this.filePatternAssociations; _i < _a3.length; _i++) {
  14747. var entry = _a3[_i];
  14748. if (entry.matchesPattern(normalizedResource)) {
  14749. for (var _b = 0, _c = entry.getURIs(); _b < _c.length; _b++) {
  14750. var schemaId = _c[_b];
  14751. if (!seen[schemaId]) {
  14752. schemas.push(schemaId);
  14753. seen[schemaId] = true;
  14754. }
  14755. }
  14756. }
  14757. }
  14758. return schemas;
  14759. };
  14760. JSONSchemaService2.prototype.getSchemaURIsForResource = function(resource, document) {
  14761. var schemeId = document && this.getSchemaFromProperty(resource, document);
  14762. if (schemeId) {
  14763. return [schemeId];
  14764. }
  14765. return this.getAssociatedSchemas(resource);
  14766. };
  14767. JSONSchemaService2.prototype.getSchemaForResource = function(resource, document) {
  14768. if (document) {
  14769. var schemeId = this.getSchemaFromProperty(resource, document);
  14770. if (schemeId) {
  14771. var id = normalizeId(schemeId);
  14772. return this.getOrAddSchemaHandle(id).getResolvedSchema();
  14773. }
  14774. }
  14775. if (this.cachedSchemaForResource && this.cachedSchemaForResource.resource === resource) {
  14776. return this.cachedSchemaForResource.resolvedSchema;
  14777. }
  14778. var schemas = this.getAssociatedSchemas(resource);
  14779. var resolvedSchema = schemas.length > 0 ? this.createCombinedSchema(resource, schemas).getResolvedSchema() : this.promise.resolve(void 0);
  14780. this.cachedSchemaForResource = {resource, resolvedSchema};
  14781. return resolvedSchema;
  14782. };
  14783. JSONSchemaService2.prototype.createCombinedSchema = function(resource, schemaIds) {
  14784. if (schemaIds.length === 1) {
  14785. return this.getOrAddSchemaHandle(schemaIds[0]);
  14786. } else {
  14787. var combinedSchemaId = "schemaservice://combinedSchema/" + encodeURIComponent(resource);
  14788. var combinedSchema = {
  14789. allOf: schemaIds.map(function(schemaId) {
  14790. return {$ref: schemaId};
  14791. })
  14792. };
  14793. return this.addSchemaHandle(combinedSchemaId, combinedSchema);
  14794. }
  14795. };
  14796. JSONSchemaService2.prototype.getMatchingSchemas = function(document, jsonDocument, schema2) {
  14797. if (schema2) {
  14798. var id = schema2.id || "schemaservice://untitled/matchingSchemas/" + idCounter2++;
  14799. var handle = this.addSchemaHandle(id, schema2);
  14800. return handle.getResolvedSchema().then(function(resolvedSchema) {
  14801. return jsonDocument.getMatchingSchemas(resolvedSchema.schema).filter(function(s) {
  14802. return !s.inverted;
  14803. });
  14804. });
  14805. }
  14806. return this.getSchemaForResource(document.uri, jsonDocument).then(function(schema22) {
  14807. if (schema22) {
  14808. return jsonDocument.getMatchingSchemas(schema22.schema).filter(function(s) {
  14809. return !s.inverted;
  14810. });
  14811. }
  14812. return [];
  14813. });
  14814. };
  14815. return JSONSchemaService2;
  14816. }();
  14817. var idCounter2 = 0;
  14818. function normalizeId(id) {
  14819. try {
  14820. return URI2.parse(id).toString();
  14821. } catch (e) {
  14822. return id;
  14823. }
  14824. }
  14825. function normalizeResourceForMatching(resource) {
  14826. try {
  14827. return URI2.parse(resource).with({fragment: null, query: null}).toString();
  14828. } catch (e) {
  14829. return resource;
  14830. }
  14831. }
  14832. function toDisplayString(url) {
  14833. try {
  14834. var uri = URI2.parse(url);
  14835. if (uri.scheme === "file") {
  14836. return uri.fsPath;
  14837. }
  14838. } catch (e) {
  14839. }
  14840. return url;
  14841. }
  14842. function getFoldingRanges(document, context) {
  14843. var ranges = [];
  14844. var nestingLevels = [];
  14845. var stack = [];
  14846. var prevStart = -1;
  14847. var scanner = createScanner2(document.getText(), false);
  14848. var token = scanner.scan();
  14849. function addRange(range2) {
  14850. ranges.push(range2);
  14851. nestingLevels.push(stack.length);
  14852. }
  14853. while (token !== 17) {
  14854. switch (token) {
  14855. case 1:
  14856. case 3: {
  14857. var startLine = document.positionAt(scanner.getTokenOffset()).line;
  14858. var range = {startLine, endLine: startLine, kind: token === 1 ? "object" : "array"};
  14859. stack.push(range);
  14860. break;
  14861. }
  14862. case 2:
  14863. case 4: {
  14864. var kind = token === 2 ? "object" : "array";
  14865. if (stack.length > 0 && stack[stack.length - 1].kind === kind) {
  14866. var range = stack.pop();
  14867. var line = document.positionAt(scanner.getTokenOffset()).line;
  14868. if (range && line > range.startLine + 1 && prevStart !== range.startLine) {
  14869. range.endLine = line - 1;
  14870. addRange(range);
  14871. prevStart = range.startLine;
  14872. }
  14873. }
  14874. break;
  14875. }
  14876. case 13: {
  14877. var startLine = document.positionAt(scanner.getTokenOffset()).line;
  14878. var endLine = document.positionAt(scanner.getTokenOffset() + scanner.getTokenLength()).line;
  14879. if (scanner.getTokenError() === 1 && startLine + 1 < document.lineCount) {
  14880. scanner.setPosition(document.offsetAt(Position2.create(startLine + 1, 0)));
  14881. } else {
  14882. if (startLine < endLine) {
  14883. addRange({startLine, endLine, kind: FoldingRangeKind2.Comment});
  14884. prevStart = startLine;
  14885. }
  14886. }
  14887. break;
  14888. }
  14889. case 12: {
  14890. var text = document.getText().substr(scanner.getTokenOffset(), scanner.getTokenLength());
  14891. var m = text.match(/^\/\/\s*#(region\b)|(endregion\b)/);
  14892. if (m) {
  14893. var line = document.positionAt(scanner.getTokenOffset()).line;
  14894. if (m[1]) {
  14895. var range = {startLine: line, endLine: line, kind: FoldingRangeKind2.Region};
  14896. stack.push(range);
  14897. } else {
  14898. var i = stack.length - 1;
  14899. while (i >= 0 && stack[i].kind !== FoldingRangeKind2.Region) {
  14900. i--;
  14901. }
  14902. if (i >= 0) {
  14903. var range = stack[i];
  14904. stack.length = i;
  14905. if (line > range.startLine && prevStart !== range.startLine) {
  14906. range.endLine = line;
  14907. addRange(range);
  14908. prevStart = range.startLine;
  14909. }
  14910. }
  14911. }
  14912. }
  14913. break;
  14914. }
  14915. }
  14916. token = scanner.scan();
  14917. }
  14918. var rangeLimit = context && context.rangeLimit;
  14919. if (typeof rangeLimit !== "number" || ranges.length <= rangeLimit) {
  14920. return ranges;
  14921. }
  14922. if (context && context.onRangeLimitExceeded) {
  14923. context.onRangeLimitExceeded(document.uri);
  14924. }
  14925. var counts = [];
  14926. for (var _i = 0, nestingLevels_1 = nestingLevels; _i < nestingLevels_1.length; _i++) {
  14927. var level = nestingLevels_1[_i];
  14928. if (level < 30) {
  14929. counts[level] = (counts[level] || 0) + 1;
  14930. }
  14931. }
  14932. var entries = 0;
  14933. var maxLevel = 0;
  14934. for (var i = 0; i < counts.length; i++) {
  14935. var n = counts[i];
  14936. if (n) {
  14937. if (n + entries > rangeLimit) {
  14938. maxLevel = i;
  14939. break;
  14940. }
  14941. entries += n;
  14942. }
  14943. }
  14944. var result = [];
  14945. for (var i = 0; i < ranges.length; i++) {
  14946. var level = nestingLevels[i];
  14947. if (typeof level === "number") {
  14948. if (level < maxLevel || level === maxLevel && entries++ < rangeLimit) {
  14949. result.push(ranges[i]);
  14950. }
  14951. }
  14952. }
  14953. return result;
  14954. }
  14955. function getSelectionRanges(document, positions, doc) {
  14956. function getSelectionRange(position) {
  14957. var offset = document.offsetAt(position);
  14958. var node = doc.getNodeFromOffset(offset, true);
  14959. var result = [];
  14960. while (node) {
  14961. switch (node.type) {
  14962. case "string":
  14963. case "object":
  14964. case "array":
  14965. var cStart = node.offset + 1, cEnd = node.offset + node.length - 1;
  14966. if (cStart < cEnd && offset >= cStart && offset <= cEnd) {
  14967. result.push(newRange(cStart, cEnd));
  14968. }
  14969. result.push(newRange(node.offset, node.offset + node.length));
  14970. break;
  14971. case "number":
  14972. case "boolean":
  14973. case "null":
  14974. case "property":
  14975. result.push(newRange(node.offset, node.offset + node.length));
  14976. break;
  14977. }
  14978. if (node.type === "property" || node.parent && node.parent.type === "array") {
  14979. var afterCommaOffset = getOffsetAfterNextToken(node.offset + node.length, 5);
  14980. if (afterCommaOffset !== -1) {
  14981. result.push(newRange(node.offset, afterCommaOffset));
  14982. }
  14983. }
  14984. node = node.parent;
  14985. }
  14986. var current = void 0;
  14987. for (var index = result.length - 1; index >= 0; index--) {
  14988. current = SelectionRange.create(result[index], current);
  14989. }
  14990. if (!current) {
  14991. current = SelectionRange.create(Range2.create(position, position));
  14992. }
  14993. return current;
  14994. }
  14995. function newRange(start, end) {
  14996. return Range2.create(document.positionAt(start), document.positionAt(end));
  14997. }
  14998. var scanner = createScanner2(document.getText(), true);
  14999. function getOffsetAfterNextToken(offset, expectedToken) {
  15000. scanner.setPosition(offset);
  15001. var token = scanner.scan();
  15002. if (token === expectedToken) {
  15003. return scanner.getTokenOffset() + scanner.getTokenLength();
  15004. }
  15005. return -1;
  15006. }
  15007. return positions.map(getSelectionRange);
  15008. }
  15009. function findLinks(document, doc) {
  15010. var links = [];
  15011. doc.visit(function(node) {
  15012. var _a3;
  15013. if (node.type === "property" && node.keyNode.value === "$ref" && ((_a3 = node.valueNode) === null || _a3 === void 0 ? void 0 : _a3.type) === "string") {
  15014. var path = node.valueNode.value;
  15015. var targetNode = findTargetNode(doc, path);
  15016. if (targetNode) {
  15017. var targetPos = document.positionAt(targetNode.offset);
  15018. links.push({
  15019. target: "".concat(document.uri, "#").concat(targetPos.line + 1, ",").concat(targetPos.character + 1),
  15020. range: createRange(document, node.valueNode)
  15021. });
  15022. }
  15023. }
  15024. return true;
  15025. });
  15026. return Promise.resolve(links);
  15027. }
  15028. function createRange(document, node) {
  15029. return Range2.create(document.positionAt(node.offset + 1), document.positionAt(node.offset + node.length - 1));
  15030. }
  15031. function findTargetNode(doc, path) {
  15032. var tokens = parseJSONPointer(path);
  15033. if (!tokens) {
  15034. return null;
  15035. }
  15036. return findNode(tokens, doc.root);
  15037. }
  15038. function findNode(pointer, node) {
  15039. if (!node) {
  15040. return null;
  15041. }
  15042. if (pointer.length === 0) {
  15043. return node;
  15044. }
  15045. var token = pointer.shift();
  15046. if (node && node.type === "object") {
  15047. var propertyNode = node.properties.find(function(propertyNode2) {
  15048. return propertyNode2.keyNode.value === token;
  15049. });
  15050. if (!propertyNode) {
  15051. return null;
  15052. }
  15053. return findNode(pointer, propertyNode.valueNode);
  15054. } else if (node && node.type === "array") {
  15055. if (token.match(/^(0|[1-9][0-9]*)$/)) {
  15056. var index = Number.parseInt(token);
  15057. var arrayItem = node.items[index];
  15058. if (!arrayItem) {
  15059. return null;
  15060. }
  15061. return findNode(pointer, arrayItem);
  15062. }
  15063. }
  15064. return null;
  15065. }
  15066. function parseJSONPointer(path) {
  15067. if (path === "#") {
  15068. return [];
  15069. }
  15070. if (path[0] !== "#" || path[1] !== "/") {
  15071. return null;
  15072. }
  15073. return path.substring(2).split(/\//).map(unescape);
  15074. }
  15075. function unescape(str) {
  15076. return str.replace(/~1/g, "/").replace(/~0/g, "~");
  15077. }
  15078. function getLanguageService(params) {
  15079. var promise = params.promiseConstructor || Promise;
  15080. var jsonSchemaService = new JSONSchemaService(params.schemaRequestService, params.workspaceContext, promise);
  15081. jsonSchemaService.setSchemaContributions(schemaContributions);
  15082. var jsonCompletion = new JSONCompletion(jsonSchemaService, params.contributions, promise, params.clientCapabilities);
  15083. var jsonHover = new JSONHover(jsonSchemaService, params.contributions, promise);
  15084. var jsonDocumentSymbols = new JSONDocumentSymbols(jsonSchemaService);
  15085. var jsonValidation = new JSONValidation(jsonSchemaService, promise);
  15086. return {
  15087. configure: function(settings) {
  15088. jsonSchemaService.clearExternalSchemas();
  15089. if (settings.schemas) {
  15090. settings.schemas.forEach(function(settings2) {
  15091. jsonSchemaService.registerExternalSchema(settings2.uri, settings2.fileMatch, settings2.schema);
  15092. });
  15093. }
  15094. jsonValidation.configure(settings);
  15095. },
  15096. resetSchema: function(uri) {
  15097. return jsonSchemaService.onResourceChange(uri);
  15098. },
  15099. doValidation: jsonValidation.doValidation.bind(jsonValidation),
  15100. getLanguageStatus: jsonValidation.getLanguageStatus.bind(jsonValidation),
  15101. parseJSONDocument: function(document) {
  15102. return parse3(document, {collectComments: true});
  15103. },
  15104. newJSONDocument: function(root, diagnostics) {
  15105. return newJSONDocument(root, diagnostics);
  15106. },
  15107. getMatchingSchemas: jsonSchemaService.getMatchingSchemas.bind(jsonSchemaService),
  15108. doResolve: jsonCompletion.doResolve.bind(jsonCompletion),
  15109. doComplete: jsonCompletion.doComplete.bind(jsonCompletion),
  15110. findDocumentSymbols: jsonDocumentSymbols.findDocumentSymbols.bind(jsonDocumentSymbols),
  15111. findDocumentSymbols2: jsonDocumentSymbols.findDocumentSymbols2.bind(jsonDocumentSymbols),
  15112. findDocumentColors: jsonDocumentSymbols.findDocumentColors.bind(jsonDocumentSymbols),
  15113. getColorPresentations: jsonDocumentSymbols.getColorPresentations.bind(jsonDocumentSymbols),
  15114. doHover: jsonHover.doHover.bind(jsonHover),
  15115. getFoldingRanges,
  15116. getSelectionRanges,
  15117. findDefinition: function() {
  15118. return Promise.resolve([]);
  15119. },
  15120. findLinks,
  15121. format: function(d, r, o) {
  15122. var range = void 0;
  15123. if (r) {
  15124. var offset = d.offsetAt(r.start);
  15125. var length = d.offsetAt(r.end) - offset;
  15126. range = {offset, length};
  15127. }
  15128. var options = {tabSize: o ? o.tabSize : 4, insertSpaces: (o === null || o === void 0 ? void 0 : o.insertSpaces) === true, insertFinalNewline: (o === null || o === void 0 ? void 0 : o.insertFinalNewline) === true, eol: "\n"};
  15129. return format2(d.getText(), range, options).map(function(e) {
  15130. return TextEdit.replace(Range2.create(d.positionAt(e.offset), d.positionAt(e.offset + e.length)), e.content);
  15131. });
  15132. }
  15133. };
  15134. }
  15135. var defaultSchemaRequestService;
  15136. if (typeof fetch !== "undefined") {
  15137. defaultSchemaRequestService = function(url) {
  15138. return fetch(url).then((response) => response.text());
  15139. };
  15140. }
  15141. var JSONWorker = class {
  15142. _ctx;
  15143. _languageService;
  15144. _languageSettings;
  15145. _languageId;
  15146. constructor(ctx, createData) {
  15147. this._ctx = ctx;
  15148. this._languageSettings = createData.languageSettings;
  15149. this._languageId = createData.languageId;
  15150. this._languageService = getLanguageService({
  15151. workspaceContext: {
  15152. resolveRelativePath: (relativePath, resource) => {
  15153. const base = resource.substr(0, resource.lastIndexOf("/") + 1);
  15154. return resolvePath(base, relativePath);
  15155. }
  15156. },
  15157. schemaRequestService: createData.enableSchemaRequest ? defaultSchemaRequestService : void 0
  15158. });
  15159. this._languageService.configure(this._languageSettings);
  15160. }
  15161. async doValidation(uri) {
  15162. let document = this._getTextDocument(uri);
  15163. if (document) {
  15164. let jsonDocument = this._languageService.parseJSONDocument(document);
  15165. return this._languageService.doValidation(document, jsonDocument, this._languageSettings);
  15166. }
  15167. return Promise.resolve([]);
  15168. }
  15169. async doComplete(uri, position) {
  15170. let document = this._getTextDocument(uri);
  15171. if (!document) {
  15172. return null;
  15173. }
  15174. let jsonDocument = this._languageService.parseJSONDocument(document);
  15175. return this._languageService.doComplete(document, position, jsonDocument);
  15176. }
  15177. async doResolve(item) {
  15178. return this._languageService.doResolve(item);
  15179. }
  15180. async doHover(uri, position) {
  15181. let document = this._getTextDocument(uri);
  15182. if (!document) {
  15183. return null;
  15184. }
  15185. let jsonDocument = this._languageService.parseJSONDocument(document);
  15186. return this._languageService.doHover(document, position, jsonDocument);
  15187. }
  15188. async format(uri, range, options) {
  15189. let document = this._getTextDocument(uri);
  15190. if (!document) {
  15191. return [];
  15192. }
  15193. let textEdits = this._languageService.format(document, range, options);
  15194. return Promise.resolve(textEdits);
  15195. }
  15196. async resetSchema(uri) {
  15197. return Promise.resolve(this._languageService.resetSchema(uri));
  15198. }
  15199. async findDocumentSymbols(uri) {
  15200. let document = this._getTextDocument(uri);
  15201. if (!document) {
  15202. return [];
  15203. }
  15204. let jsonDocument = this._languageService.parseJSONDocument(document);
  15205. let symbols = this._languageService.findDocumentSymbols(document, jsonDocument);
  15206. return Promise.resolve(symbols);
  15207. }
  15208. async findDocumentColors(uri) {
  15209. let document = this._getTextDocument(uri);
  15210. if (!document) {
  15211. return [];
  15212. }
  15213. let jsonDocument = this._languageService.parseJSONDocument(document);
  15214. let colorSymbols = this._languageService.findDocumentColors(document, jsonDocument);
  15215. return Promise.resolve(colorSymbols);
  15216. }
  15217. async getColorPresentations(uri, color, range) {
  15218. let document = this._getTextDocument(uri);
  15219. if (!document) {
  15220. return [];
  15221. }
  15222. let jsonDocument = this._languageService.parseJSONDocument(document);
  15223. let colorPresentations = this._languageService.getColorPresentations(document, jsonDocument, color, range);
  15224. return Promise.resolve(colorPresentations);
  15225. }
  15226. async getFoldingRanges(uri, context) {
  15227. let document = this._getTextDocument(uri);
  15228. if (!document) {
  15229. return [];
  15230. }
  15231. let ranges = this._languageService.getFoldingRanges(document, context);
  15232. return Promise.resolve(ranges);
  15233. }
  15234. async getSelectionRanges(uri, positions) {
  15235. let document = this._getTextDocument(uri);
  15236. if (!document) {
  15237. return [];
  15238. }
  15239. let jsonDocument = this._languageService.parseJSONDocument(document);
  15240. let ranges = this._languageService.getSelectionRanges(document, positions, jsonDocument);
  15241. return Promise.resolve(ranges);
  15242. }
  15243. _getTextDocument(uri) {
  15244. let models = this._ctx.getMirrorModels();
  15245. for (let model of models) {
  15246. if (model.uri.toString() === uri) {
  15247. return TextDocument2.create(uri, this._languageId, model.version, model.getValue());
  15248. }
  15249. }
  15250. return null;
  15251. }
  15252. };
  15253. var Slash = "/".charCodeAt(0);
  15254. var Dot = ".".charCodeAt(0);
  15255. function isAbsolutePath(path) {
  15256. return path.charCodeAt(0) === Slash;
  15257. }
  15258. function resolvePath(uriString, path) {
  15259. if (isAbsolutePath(path)) {
  15260. const uri = URI2.parse(uriString);
  15261. const parts = path.split("/");
  15262. return uri.with({path: normalizePath(parts)}).toString();
  15263. }
  15264. return joinPath(uriString, path);
  15265. }
  15266. function normalizePath(parts) {
  15267. const newParts = [];
  15268. for (const part of parts) {
  15269. if (part.length === 0 || part.length === 1 && part.charCodeAt(0) === Dot) {
  15270. } else if (part.length === 2 && part.charCodeAt(0) === Dot && part.charCodeAt(1) === Dot) {
  15271. newParts.pop();
  15272. } else {
  15273. newParts.push(part);
  15274. }
  15275. }
  15276. if (parts.length > 1 && parts[parts.length - 1].length === 0) {
  15277. newParts.push("");
  15278. }
  15279. let res = newParts.join("/");
  15280. if (parts[0].length === 0) {
  15281. res = "/" + res;
  15282. }
  15283. return res;
  15284. }
  15285. function joinPath(uriString, ...paths2) {
  15286. const uri = URI2.parse(uriString);
  15287. const parts = uri.path.split("/");
  15288. for (let path of paths2) {
  15289. parts.push(...path.split("/"));
  15290. }
  15291. return uri.with({path: normalizePath(parts)}).toString();
  15292. }
  15293. self.onmessage = () => {
  15294. initialize((ctx, createData) => {
  15295. return new JSONWorker(ctx, createData);
  15296. });
  15297. };
  15298. })();