index.js 475 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502
  1. import {getServerConf} from "./ljw.js?v=7"
  2. import {ids as langIds, lang} from './lang.js?v=7'
  3. import {F as ka, J as H4, L as K4, l as Le, m as r, P as ha, s as ga, z as e4} from "./vendor.js?v=0b990c6e";
  4. var _a = Object.defineProperty;
  5. var va = (u, e, i) => e in u ? _a(u, e, {enumerable: !0, configurable: !0, writable: !0, value: i}) : u[e] = i;
  6. var D = (u, e, i) => (va(u, typeof e != "symbol" ? e + "" : e, i), i), o4 = (u, e, i) => {
  7. if (!e.has(u)) throw TypeError("Cannot " + i)
  8. };
  9. var h = (u, e, i) => (o4(u, e, "read from private field"), i ? i.call(u) : e.get(u)), Cu = (u, e, i) => {
  10. if (e.has(u)) throw TypeError("Cannot add the same private member more than once");
  11. e instanceof WeakSet ? e.add(u) : e.set(u, i)
  12. }, _e = (u, e, i, n) => (o4(u, e, "write to private field"), n ? n.call(u, i) : e.set(u, i), i), V4 = (u, e, i, n) => ({
  13. set _(a) {
  14. _e(u, e, a, i)
  15. }, get _() {
  16. return h(u, e, n)
  17. }
  18. }), q4 = (u, e, i) => (o4(u, e, "access private method"), i);
  19. const fa = function () {
  20. const e = document.createElement("link").relList;
  21. if (e && e.supports && e.supports("modulepreload")) return;
  22. for (const a of document.querySelectorAll('link[rel="modulepreload"]')) n(a);
  23. new MutationObserver(a => {
  24. for (const t of a) if (t.type === "childList") for (const s of t.addedNodes) s.tagName === "LINK" && s.rel === "modulepreload" && n(s)
  25. }).observe(document, {childList: !0, subtree: !0});
  26. function i(a) {
  27. const t = {};
  28. return a.integrity && (t.integrity = a.integrity), a.referrerpolicy && (t.referrerPolicy = a.referrerpolicy), a.crossorigin === "use-credentials" ? t.credentials = "include" : a.crossorigin === "anonymous" ? t.credentials = "omit" : t.credentials = "same-origin", t
  29. }
  30. function n(a) {
  31. if (a.ep) return;
  32. a.ep = !0;
  33. const t = i(a);
  34. fetch(a.href, t)
  35. }
  36. };
  37. fa();
  38. var l4 = (u => (u[u.I420 = 0] = "I420", u[u.I444 = 1] = "I444", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(l4 || {});
  39. function xa(u) {
  40. switch (u) {
  41. case 0:
  42. case"I420":
  43. return 0;
  44. case 1:
  45. case"I444":
  46. return 1;
  47. case-1:
  48. case"UNRECOGNIZED":
  49. default:
  50. return -1
  51. }
  52. }
  53. function ya(u) {
  54. switch (u) {
  55. case 0:
  56. return "I420";
  57. case 1:
  58. return "I444";
  59. case-1:
  60. default:
  61. return "UNRECOGNIZED"
  62. }
  63. }
  64. var Fe = (u => (u[u.Legacy = 0] = "Legacy", u[u.Map = 1] = "Map", u[u.Translate = 2] = "Translate", u[u.Auto = 3] = "Auto", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(Fe || {});
  65. function ba(u) {
  66. switch (u) {
  67. case 0:
  68. case"Legacy":
  69. return 0;
  70. case 1:
  71. case"Map":
  72. return 1;
  73. case 2:
  74. case"Translate":
  75. return 2;
  76. case 3:
  77. case"Auto":
  78. return 3;
  79. case-1:
  80. case"UNRECOGNIZED":
  81. default:
  82. return -1
  83. }
  84. }
  85. function wa(u) {
  86. switch (u) {
  87. case 0:
  88. return "Legacy";
  89. case 1:
  90. return "Map";
  91. case 2:
  92. return "Translate";
  93. case 3:
  94. return "Auto";
  95. case-1:
  96. default:
  97. return "UNRECOGNIZED"
  98. }
  99. }
  100. var j = (u => (u[u.Unknown = 0] = "Unknown", u[u.Alt = 1] = "Alt", u[u.Backspace = 2] = "Backspace", u[u.CapsLock = 3] = "CapsLock", u[u.Control = 4] = "Control", u[u.Delete = 5] = "Delete", u[u.DownArrow = 6] = "DownArrow", u[u.End = 7] = "End", u[u.Escape = 8] = "Escape", u[u.F1 = 9] = "F1", u[u.F10 = 10] = "F10", u[u.F11 = 11] = "F11", u[u.F12 = 12] = "F12", u[u.F2 = 13] = "F2", u[u.F3 = 14] = "F3", u[u.F4 = 15] = "F4", u[u.F5 = 16] = "F5", u[u.F6 = 17] = "F6", u[u.F7 = 18] = "F7", u[u.F8 = 19] = "F8", u[u.F9 = 20] = "F9", u[u.Home = 21] = "Home", u[u.LeftArrow = 22] = "LeftArrow", u[u.Meta = 23] = "Meta", u[u.Option = 24] = "Option", u[u.PageDown = 25] = "PageDown", u[u.PageUp = 26] = "PageUp", u[u.Return = 27] = "Return", u[u.RightArrow = 28] = "RightArrow", u[u.Shift = 29] = "Shift", u[u.Space = 30] = "Space", u[u.Tab = 31] = "Tab", u[u.UpArrow = 32] = "UpArrow", u[u.Numpad0 = 33] = "Numpad0", u[u.Numpad1 = 34] = "Numpad1", u[u.Numpad2 = 35] = "Numpad2", u[u.Numpad3 = 36] = "Numpad3", u[u.Numpad4 = 37] = "Numpad4", u[u.Numpad5 = 38] = "Numpad5", u[u.Numpad6 = 39] = "Numpad6", u[u.Numpad7 = 40] = "Numpad7", u[u.Numpad8 = 41] = "Numpad8", u[u.Numpad9 = 42] = "Numpad9", u[u.Cancel = 43] = "Cancel", u[u.Clear = 44] = "Clear", u[u.Menu = 45] = "Menu", u[u.Pause = 46] = "Pause", u[u.Kana = 47] = "Kana", u[u.Hangul = 48] = "Hangul", u[u.Junja = 49] = "Junja", u[u.Final = 50] = "Final", u[u.Hanja = 51] = "Hanja", u[u.Kanji = 52] = "Kanji", u[u.Convert = 53] = "Convert", u[u.Select = 54] = "Select", u[u.Print = 55] = "Print", u[u.Execute = 56] = "Execute", u[u.Snapshot = 57] = "Snapshot", u[u.Insert = 58] = "Insert", u[u.Help = 59] = "Help", u[u.Sleep = 60] = "Sleep", u[u.Separator = 61] = "Separator", u[u.Scroll = 62] = "Scroll", u[u.NumLock = 63] = "NumLock", u[u.RWin = 64] = "RWin", u[u.Apps = 65] = "Apps", u[u.Multiply = 66] = "Multiply", u[u.Add = 67] = "Add", u[u.Subtract = 68] = "Subtract", u[u.Decimal = 69] = "Decimal", u[u.Divide = 70] = "Divide", u[u.Equals = 71] = "Equals", u[u.NumpadEnter = 72] = "NumpadEnter", u[u.RShift = 73] = "RShift", u[u.RControl = 74] = "RControl", u[u.RAlt = 75] = "RAlt", u[u.VolumeMute = 76] = "VolumeMute", u[u.VolumeUp = 77] = "VolumeUp", u[u.VolumeDown = 78] = "VolumeDown", u[u.Power = 79] = "Power", u[u.CtrlAltDel = 100] = "CtrlAltDel", u[u.LockScreen = 101] = "LockScreen", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(j || {});
  101. function fe(u) {
  102. switch (u) {
  103. case 0:
  104. case"Unknown":
  105. return 0;
  106. case 1:
  107. case"Alt":
  108. return 1;
  109. case 2:
  110. case"Backspace":
  111. return 2;
  112. case 3:
  113. case"CapsLock":
  114. return 3;
  115. case 4:
  116. case"Control":
  117. return 4;
  118. case 5:
  119. case"Delete":
  120. return 5;
  121. case 6:
  122. case"DownArrow":
  123. return 6;
  124. case 7:
  125. case"End":
  126. return 7;
  127. case 8:
  128. case"Escape":
  129. return 8;
  130. case 9:
  131. case"F1":
  132. return 9;
  133. case 10:
  134. case"F10":
  135. return 10;
  136. case 11:
  137. case"F11":
  138. return 11;
  139. case 12:
  140. case"F12":
  141. return 12;
  142. case 13:
  143. case"F2":
  144. return 13;
  145. case 14:
  146. case"F3":
  147. return 14;
  148. case 15:
  149. case"F4":
  150. return 15;
  151. case 16:
  152. case"F5":
  153. return 16;
  154. case 17:
  155. case"F6":
  156. return 17;
  157. case 18:
  158. case"F7":
  159. return 18;
  160. case 19:
  161. case"F8":
  162. return 19;
  163. case 20:
  164. case"F9":
  165. return 20;
  166. case 21:
  167. case"Home":
  168. return 21;
  169. case 22:
  170. case"LeftArrow":
  171. return 22;
  172. case 23:
  173. case"Meta":
  174. return 23;
  175. case 24:
  176. case"Option":
  177. return 24;
  178. case 25:
  179. case"PageDown":
  180. return 25;
  181. case 26:
  182. case"PageUp":
  183. return 26;
  184. case 27:
  185. case"Return":
  186. return 27;
  187. case 28:
  188. case"RightArrow":
  189. return 28;
  190. case 29:
  191. case"Shift":
  192. return 29;
  193. case 30:
  194. case"Space":
  195. return 30;
  196. case 31:
  197. case"Tab":
  198. return 31;
  199. case 32:
  200. case"UpArrow":
  201. return 32;
  202. case 33:
  203. case"Numpad0":
  204. return 33;
  205. case 34:
  206. case"Numpad1":
  207. return 34;
  208. case 35:
  209. case"Numpad2":
  210. return 35;
  211. case 36:
  212. case"Numpad3":
  213. return 36;
  214. case 37:
  215. case"Numpad4":
  216. return 37;
  217. case 38:
  218. case"Numpad5":
  219. return 38;
  220. case 39:
  221. case"Numpad6":
  222. return 39;
  223. case 40:
  224. case"Numpad7":
  225. return 40;
  226. case 41:
  227. case"Numpad8":
  228. return 41;
  229. case 42:
  230. case"Numpad9":
  231. return 42;
  232. case 43:
  233. case"Cancel":
  234. return 43;
  235. case 44:
  236. case"Clear":
  237. return 44;
  238. case 45:
  239. case"Menu":
  240. return 45;
  241. case 46:
  242. case"Pause":
  243. return 46;
  244. case 47:
  245. case"Kana":
  246. return 47;
  247. case 48:
  248. case"Hangul":
  249. return 48;
  250. case 49:
  251. case"Junja":
  252. return 49;
  253. case 50:
  254. case"Final":
  255. return 50;
  256. case 51:
  257. case"Hanja":
  258. return 51;
  259. case 52:
  260. case"Kanji":
  261. return 52;
  262. case 53:
  263. case"Convert":
  264. return 53;
  265. case 54:
  266. case"Select":
  267. return 54;
  268. case 55:
  269. case"Print":
  270. return 55;
  271. case 56:
  272. case"Execute":
  273. return 56;
  274. case 57:
  275. case"Snapshot":
  276. return 57;
  277. case 58:
  278. case"Insert":
  279. return 58;
  280. case 59:
  281. case"Help":
  282. return 59;
  283. case 60:
  284. case"Sleep":
  285. return 60;
  286. case 61:
  287. case"Separator":
  288. return 61;
  289. case 62:
  290. case"Scroll":
  291. return 62;
  292. case 63:
  293. case"NumLock":
  294. return 63;
  295. case 64:
  296. case"RWin":
  297. return 64;
  298. case 65:
  299. case"Apps":
  300. return 65;
  301. case 66:
  302. case"Multiply":
  303. return 66;
  304. case 67:
  305. case"Add":
  306. return 67;
  307. case 68:
  308. case"Subtract":
  309. return 68;
  310. case 69:
  311. case"Decimal":
  312. return 69;
  313. case 70:
  314. case"Divide":
  315. return 70;
  316. case 71:
  317. case"Equals":
  318. return 71;
  319. case 72:
  320. case"NumpadEnter":
  321. return 72;
  322. case 73:
  323. case"RShift":
  324. return 73;
  325. case 74:
  326. case"RControl":
  327. return 74;
  328. case 75:
  329. case"RAlt":
  330. return 75;
  331. case 76:
  332. case"VolumeMute":
  333. return 76;
  334. case 77:
  335. case"VolumeUp":
  336. return 77;
  337. case 78:
  338. case"VolumeDown":
  339. return 78;
  340. case 79:
  341. case"Power":
  342. return 79;
  343. case 100:
  344. case"CtrlAltDel":
  345. return 100;
  346. case 101:
  347. case"LockScreen":
  348. return 101;
  349. case-1:
  350. case"UNRECOGNIZED":
  351. default:
  352. return -1
  353. }
  354. }
  355. function We(u) {
  356. switch (u) {
  357. case 0:
  358. return "Unknown";
  359. case 1:
  360. return "Alt";
  361. case 2:
  362. return "Backspace";
  363. case 3:
  364. return "CapsLock";
  365. case 4:
  366. return "Control";
  367. case 5:
  368. return "Delete";
  369. case 6:
  370. return "DownArrow";
  371. case 7:
  372. return "End";
  373. case 8:
  374. return "Escape";
  375. case 9:
  376. return "F1";
  377. case 10:
  378. return "F10";
  379. case 11:
  380. return "F11";
  381. case 12:
  382. return "F12";
  383. case 13:
  384. return "F2";
  385. case 14:
  386. return "F3";
  387. case 15:
  388. return "F4";
  389. case 16:
  390. return "F5";
  391. case 17:
  392. return "F6";
  393. case 18:
  394. return "F7";
  395. case 19:
  396. return "F8";
  397. case 20:
  398. return "F9";
  399. case 21:
  400. return "Home";
  401. case 22:
  402. return "LeftArrow";
  403. case 23:
  404. return "Meta";
  405. case 24:
  406. return "Option";
  407. case 25:
  408. return "PageDown";
  409. case 26:
  410. return "PageUp";
  411. case 27:
  412. return "Return";
  413. case 28:
  414. return "RightArrow";
  415. case 29:
  416. return "Shift";
  417. case 30:
  418. return "Space";
  419. case 31:
  420. return "Tab";
  421. case 32:
  422. return "UpArrow";
  423. case 33:
  424. return "Numpad0";
  425. case 34:
  426. return "Numpad1";
  427. case 35:
  428. return "Numpad2";
  429. case 36:
  430. return "Numpad3";
  431. case 37:
  432. return "Numpad4";
  433. case 38:
  434. return "Numpad5";
  435. case 39:
  436. return "Numpad6";
  437. case 40:
  438. return "Numpad7";
  439. case 41:
  440. return "Numpad8";
  441. case 42:
  442. return "Numpad9";
  443. case 43:
  444. return "Cancel";
  445. case 44:
  446. return "Clear";
  447. case 45:
  448. return "Menu";
  449. case 46:
  450. return "Pause";
  451. case 47:
  452. return "Kana";
  453. case 48:
  454. return "Hangul";
  455. case 49:
  456. return "Junja";
  457. case 50:
  458. return "Final";
  459. case 51:
  460. return "Hanja";
  461. case 52:
  462. return "Kanji";
  463. case 53:
  464. return "Convert";
  465. case 54:
  466. return "Select";
  467. case 55:
  468. return "Print";
  469. case 56:
  470. return "Execute";
  471. case 57:
  472. return "Snapshot";
  473. case 58:
  474. return "Insert";
  475. case 59:
  476. return "Help";
  477. case 60:
  478. return "Sleep";
  479. case 61:
  480. return "Separator";
  481. case 62:
  482. return "Scroll";
  483. case 63:
  484. return "NumLock";
  485. case 64:
  486. return "RWin";
  487. case 65:
  488. return "Apps";
  489. case 66:
  490. return "Multiply";
  491. case 67:
  492. return "Add";
  493. case 68:
  494. return "Subtract";
  495. case 69:
  496. return "Decimal";
  497. case 70:
  498. return "Divide";
  499. case 71:
  500. return "Equals";
  501. case 72:
  502. return "NumpadEnter";
  503. case 73:
  504. return "RShift";
  505. case 74:
  506. return "RControl";
  507. case 75:
  508. return "RAlt";
  509. case 76:
  510. return "VolumeMute";
  511. case 77:
  512. return "VolumeUp";
  513. case 78:
  514. return "VolumeDown";
  515. case 79:
  516. return "Power";
  517. case 100:
  518. return "CtrlAltDel";
  519. case 101:
  520. return "LockScreen";
  521. case-1:
  522. default:
  523. return "UNRECOGNIZED"
  524. }
  525. }
  526. var Du = (u => (u[u.Text = 0] = "Text", u[u.Rtf = 1] = "Rtf", u[u.Html = 2] = "Html", u[u.ImageRgba = 21] = "ImageRgba", u[u.ImagePng = 22] = "ImagePng", u[u.ImageSvg = 23] = "ImageSvg", u[u.Special = 31] = "Special", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(Du || {});
  527. function Sa(u) {
  528. switch (u) {
  529. case 0:
  530. case"Text":
  531. return 0;
  532. case 1:
  533. case"Rtf":
  534. return 1;
  535. case 2:
  536. case"Html":
  537. return 2;
  538. case 21:
  539. case"ImageRgba":
  540. return 21;
  541. case 22:
  542. case"ImagePng":
  543. return 22;
  544. case 23:
  545. case"ImageSvg":
  546. return 23;
  547. case 31:
  548. case"Special":
  549. return 31;
  550. case-1:
  551. case"UNRECOGNIZED":
  552. default:
  553. return -1
  554. }
  555. }
  556. function za(u) {
  557. switch (u) {
  558. case 0:
  559. return "Text";
  560. case 1:
  561. return "Rtf";
  562. case 2:
  563. return "Html";
  564. case 21:
  565. return "ImageRgba";
  566. case 22:
  567. return "ImagePng";
  568. case 23:
  569. return "ImageSvg";
  570. case 31:
  571. return "Special";
  572. case-1:
  573. default:
  574. return "UNRECOGNIZED"
  575. }
  576. }
  577. var ft = (u => (u[u.Dir = 0] = "Dir", u[u.DirLink = 2] = "DirLink", u[u.DirDrive = 3] = "DirDrive", u[u.File = 4] = "File", u[u.FileLink = 5] = "FileLink", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(ft || {});
  578. function Pa(u) {
  579. switch (u) {
  580. case 0:
  581. case"Dir":
  582. return 0;
  583. case 2:
  584. case"DirLink":
  585. return 2;
  586. case 3:
  587. case"DirDrive":
  588. return 3;
  589. case 4:
  590. case"File":
  591. return 4;
  592. case 5:
  593. case"FileLink":
  594. return 5;
  595. case-1:
  596. case"UNRECOGNIZED":
  597. default:
  598. return -1
  599. }
  600. }
  601. function Ra(u) {
  602. switch (u) {
  603. case 0:
  604. return "Dir";
  605. case 2:
  606. return "DirLink";
  607. case 3:
  608. return "DirDrive";
  609. case 4:
  610. return "File";
  611. case 5:
  612. return "FileLink";
  613. case-1:
  614. default:
  615. return "UNRECOGNIZED"
  616. }
  617. }
  618. var Te = (u => (u[u.NotSet = 0] = "NotSet", u[u.Low = 2] = "Low", u[u.Balanced = 3] = "Balanced", u[u.Best = 4] = "Best", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(Te || {});
  619. function Ia(u) {
  620. switch (u) {
  621. case 0:
  622. case"NotSet":
  623. return 0;
  624. case 2:
  625. case"Low":
  626. return 2;
  627. case 3:
  628. case"Balanced":
  629. return 3;
  630. case 4:
  631. case"Best":
  632. return 4;
  633. case-1:
  634. case"UNRECOGNIZED":
  635. default:
  636. return -1
  637. }
  638. }
  639. function Ta(u) {
  640. switch (u) {
  641. case 0:
  642. return "NotSet";
  643. case 2:
  644. return "Low";
  645. case 3:
  646. return "Balanced";
  647. case 4:
  648. return "Best";
  649. case-1:
  650. default:
  651. return "UNRECOGNIZED"
  652. }
  653. }
  654. function ja(u) {
  655. switch (u) {
  656. case 0:
  657. case"Generic":
  658. return 0;
  659. case 1:
  660. case"Printer":
  661. return 1;
  662. case-1:
  663. case"UNRECOGNIZED":
  664. default:
  665. return -1
  666. }
  667. }
  668. function Na(u) {
  669. switch (u) {
  670. case 0:
  671. return "Generic";
  672. case 1:
  673. return "Printer";
  674. case-1:
  675. default:
  676. return "UNRECOGNIZED"
  677. }
  678. }
  679. var a0 = (u => (u[u.Keyboard = 0] = "Keyboard", u[u.Clipboard = 2] = "Clipboard", u[u.Audio = 3] = "Audio", u[u.File = 4] = "File", u[u.Restart = 5] = "Restart", u[u.Recording = 6] = "Recording", u[u.BlockInput = 7] = "BlockInput", u[u.Camera = 8] = "Camera", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(a0 || {});
  680. function Oa(u) {
  681. switch (u) {
  682. case 0:
  683. case"Keyboard":
  684. return 0;
  685. case 2:
  686. case"Clipboard":
  687. return 2;
  688. case 3:
  689. case"Audio":
  690. return 3;
  691. case 4:
  692. case"File":
  693. return 4;
  694. case 5:
  695. case"Restart":
  696. return 5;
  697. case 6:
  698. case"Recording":
  699. return 6;
  700. case 7:
  701. case"BlockInput":
  702. return 7;
  703. case 8:
  704. case"Camera":
  705. return 8;
  706. case-1:
  707. case"UNRECOGNIZED":
  708. default:
  709. return -1
  710. }
  711. }
  712. function Ua(u) {
  713. switch (u) {
  714. case 0:
  715. return "Keyboard";
  716. case 2:
  717. return "Clipboard";
  718. case 3:
  719. return "Audio";
  720. case 4:
  721. return "File";
  722. case 5:
  723. return "Restart";
  724. case 6:
  725. return "Recording";
  726. case 7:
  727. return "BlockInput";
  728. case 8:
  729. return "Camera";
  730. case-1:
  731. default:
  732. return "UNRECOGNIZED"
  733. }
  734. }
  735. var mu = (u => (u[u.Auto = 0] = "Auto", u[u.VP9 = 1] = "VP9", u[u.H264 = 2] = "H264", u[u.H265 = 3] = "H265", u[u.VP8 = 4] = "VP8", u[u.AV1 = 5] = "AV1", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(mu || {});
  736. function Ma(u) {
  737. switch (u) {
  738. case 0:
  739. case"Auto":
  740. return 0;
  741. case 1:
  742. case"VP9":
  743. return 1;
  744. case 2:
  745. case"H264":
  746. return 2;
  747. case 3:
  748. case"H265":
  749. return 3;
  750. case 4:
  751. case"VP8":
  752. return 4;
  753. case 5:
  754. case"AV1":
  755. return 5;
  756. case-1:
  757. case"UNRECOGNIZED":
  758. default:
  759. return -1
  760. }
  761. }
  762. function La(u) {
  763. switch (u) {
  764. case 0:
  765. return "Auto";
  766. case 1:
  767. return "VP9";
  768. case 2:
  769. return "H264";
  770. case 3:
  771. return "H265";
  772. case 4:
  773. return "VP8";
  774. case 5:
  775. return "AV1";
  776. case-1:
  777. default:
  778. return "UNRECOGNIZED"
  779. }
  780. }
  781. var y = (u => (u[u.NotSet = 0] = "NotSet", u[u.No = 1] = "No", u[u.Yes = 2] = "Yes", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(y || {});
  782. function X(u) {
  783. switch (u) {
  784. case 0:
  785. case"NotSet":
  786. return 0;
  787. case 1:
  788. case"No":
  789. return 1;
  790. case 2:
  791. case"Yes":
  792. return 2;
  793. case-1:
  794. case"UNRECOGNIZED":
  795. default:
  796. return -1
  797. }
  798. }
  799. function Y(u) {
  800. switch (u) {
  801. case 0:
  802. return "NotSet";
  803. case 1:
  804. return "No";
  805. case 2:
  806. return "Yes";
  807. case-1:
  808. default:
  809. return "UNRECOGNIZED"
  810. }
  811. }
  812. var ge = (u => (u[u.BlkStateUnknown = 0] = "BlkStateUnknown", u[u.BlkOnSucceeded = 2] = "BlkOnSucceeded", u[u.BlkOnFailed = 3] = "BlkOnFailed", u[u.BlkOffSucceeded = 4] = "BlkOffSucceeded", u[u.BlkOffFailed = 5] = "BlkOffFailed", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(ge || {});
  813. function Wa(u) {
  814. switch (u) {
  815. case 0:
  816. case"BlkStateUnknown":
  817. return 0;
  818. case 2:
  819. case"BlkOnSucceeded":
  820. return 2;
  821. case 3:
  822. case"BlkOnFailed":
  823. return 3;
  824. case 4:
  825. case"BlkOffSucceeded":
  826. return 4;
  827. case 5:
  828. case"BlkOffFailed":
  829. return 5;
  830. case-1:
  831. case"UNRECOGNIZED":
  832. default:
  833. return -1
  834. }
  835. }
  836. function Va(u) {
  837. switch (u) {
  838. case 0:
  839. return "BlkStateUnknown";
  840. case 2:
  841. return "BlkOnSucceeded";
  842. case 3:
  843. return "BlkOnFailed";
  844. case 4:
  845. return "BlkOffSucceeded";
  846. case 5:
  847. return "BlkOffFailed";
  848. case-1:
  849. default:
  850. return "UNRECOGNIZED"
  851. }
  852. }
  853. var nu = (u => (u[u.PrvStateUnknown = 0] = "PrvStateUnknown", u[u.PrvOnByOther = 2] = "PrvOnByOther", u[u.PrvNotSupported = 3] = "PrvNotSupported", u[u.PrvOnSucceeded = 4] = "PrvOnSucceeded", u[u.PrvOnFailedDenied = 5] = "PrvOnFailedDenied", u[u.PrvOnFailedPlugin = 6] = "PrvOnFailedPlugin", u[u.PrvOnFailed = 7] = "PrvOnFailed", u[u.PrvOffSucceeded = 8] = "PrvOffSucceeded", u[u.PrvOffByPeer = 9] = "PrvOffByPeer", u[u.PrvOffFailed = 10] = "PrvOffFailed", u[u.PrvOffUnknown = 11] = "PrvOffUnknown", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(nu || {});
  854. function qa(u) {
  855. switch (u) {
  856. case 0:
  857. case"PrvStateUnknown":
  858. return 0;
  859. case 2:
  860. case"PrvOnByOther":
  861. return 2;
  862. case 3:
  863. case"PrvNotSupported":
  864. return 3;
  865. case 4:
  866. case"PrvOnSucceeded":
  867. return 4;
  868. case 5:
  869. case"PrvOnFailedDenied":
  870. return 5;
  871. case 6:
  872. case"PrvOnFailedPlugin":
  873. return 6;
  874. case 7:
  875. case"PrvOnFailed":
  876. return 7;
  877. case 8:
  878. case"PrvOffSucceeded":
  879. return 8;
  880. case 9:
  881. case"PrvOffByPeer":
  882. return 9;
  883. case 10:
  884. case"PrvOffFailed":
  885. return 10;
  886. case 11:
  887. case"PrvOffUnknown":
  888. return 11;
  889. case-1:
  890. case"UNRECOGNIZED":
  891. default:
  892. return -1
  893. }
  894. }
  895. function Ka(u) {
  896. switch (u) {
  897. case 0:
  898. return "PrvStateUnknown";
  899. case 2:
  900. return "PrvOnByOther";
  901. case 3:
  902. return "PrvNotSupported";
  903. case 4:
  904. return "PrvOnSucceeded";
  905. case 5:
  906. return "PrvOnFailedDenied";
  907. case 6:
  908. return "PrvOnFailedPlugin";
  909. case 7:
  910. return "PrvOnFailed";
  911. case 8:
  912. return "PrvOffSucceeded";
  913. case 9:
  914. return "PrvOffByPeer";
  915. case 10:
  916. return "PrvOffFailed";
  917. case 11:
  918. return "PrvOffUnknown";
  919. case-1:
  920. default:
  921. return "UNRECOGNIZED"
  922. }
  923. }
  924. function J4() {
  925. return {data: new Uint8Array(0), key: !1, pts: 0}
  926. }
  927. const n0 = {
  928. encode(u, e = r.Writer.create()) {
  929. return u.data.length !== 0 && e.uint32(10).bytes(u.data), u.key !== !1 && e.uint32(16).bool(u.key), u.pts !== 0 && e.uint32(24).int64(u.pts), e
  930. }, decode(u, e) {
  931. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  932. let n = e === void 0 ? i.len : i.pos + e;
  933. const a = J4();
  934. for (; i.pos < n;) {
  935. const t = i.uint32();
  936. switch (t >>> 3) {
  937. case 1:
  938. if (t !== 10) break;
  939. a.data = i.bytes();
  940. continue;
  941. case 2:
  942. if (t !== 16) break;
  943. a.key = i.bool();
  944. continue;
  945. case 3:
  946. if (t !== 24) break;
  947. a.pts = q(i.int64());
  948. continue
  949. }
  950. if ((t & 7) === 4 || t === 0) break;
  951. i.skipType(t & 7)
  952. }
  953. return a
  954. }, fromJSON(u) {
  955. return {
  956. data: o(u.data) ? z(u.data) : new Uint8Array(0),
  957. key: o(u.key) ? globalThis.Boolean(u.key) : !1,
  958. pts: o(u.pts) ? globalThis.Number(u.pts) : 0
  959. }
  960. }, toJSON(u) {
  961. const e = {};
  962. return u.data.length !== 0 && (e.data = P(u.data)), u.key !== !1 && (e.key = u.key), u.pts !== 0 && (e.pts = Math.round(u.pts)), e
  963. }, create(u) {
  964. return n0.fromPartial(u != null ? u : {})
  965. }, fromPartial(u) {
  966. var i, n, a;
  967. const e = J4();
  968. return e.data = (i = u.data) != null ? i : new Uint8Array(0), e.key = (n = u.key) != null ? n : !1, e.pts = (a = u.pts) != null ? a : 0, e
  969. }
  970. };
  971. function G4() {
  972. return {frames: []}
  973. }
  974. const g = {
  975. encode(u, e = r.Writer.create()) {
  976. for (const i of u.frames) n0.encode(i, e.uint32(10).fork()).ldelim();
  977. return e
  978. }, decode(u, e) {
  979. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  980. let n = e === void 0 ? i.len : i.pos + e;
  981. const a = G4();
  982. for (; i.pos < n;) {
  983. const t = i.uint32();
  984. switch (t >>> 3) {
  985. case 1:
  986. if (t !== 10) break;
  987. a.frames.push(n0.decode(i, i.uint32()));
  988. continue
  989. }
  990. if ((t & 7) === 4 || t === 0) break;
  991. i.skipType(t & 7)
  992. }
  993. return a
  994. }, fromJSON(u) {
  995. return {frames: globalThis.Array.isArray(u == null ? void 0 : u.frames) ? u.frames.map(e => n0.fromJSON(e)) : []}
  996. }, toJSON(u) {
  997. var i;
  998. const e = {};
  999. return (i = u.frames) != null && i.length && (e.frames = u.frames.map(n => n0.toJSON(n))), e
  1000. }, create(u) {
  1001. return g.fromPartial(u != null ? u : {})
  1002. }, fromPartial(u) {
  1003. var i;
  1004. const e = G4();
  1005. return e.frames = ((i = u.frames) == null ? void 0 : i.map(n => n0.fromPartial(n))) || [], e
  1006. }
  1007. };
  1008. function Z4() {
  1009. return {compress: !1}
  1010. }
  1011. const o0 = {
  1012. encode(u, e = r.Writer.create()) {
  1013. return u.compress !== !1 && e.uint32(8).bool(u.compress), e
  1014. }, decode(u, e) {
  1015. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1016. let n = e === void 0 ? i.len : i.pos + e;
  1017. const a = Z4();
  1018. for (; i.pos < n;) {
  1019. const t = i.uint32();
  1020. switch (t >>> 3) {
  1021. case 1:
  1022. if (t !== 8) break;
  1023. a.compress = i.bool();
  1024. continue
  1025. }
  1026. if ((t & 7) === 4 || t === 0) break;
  1027. i.skipType(t & 7)
  1028. }
  1029. return a
  1030. }, fromJSON(u) {
  1031. return {compress: o(u.compress) ? globalThis.Boolean(u.compress) : !1}
  1032. }, toJSON(u) {
  1033. const e = {};
  1034. return u.compress !== !1 && (e.compress = u.compress), e
  1035. }, create(u) {
  1036. return o0.fromPartial(u != null ? u : {})
  1037. }, fromPartial(u) {
  1038. var i;
  1039. const e = Z4();
  1040. return e.compress = (i = u.compress) != null ? i : !1, e
  1041. }
  1042. };
  1043. function Q4() {
  1044. return {compress: !1, stride: 0}
  1045. }
  1046. const r0 = {
  1047. encode(u, e = r.Writer.create()) {
  1048. return u.compress !== !1 && e.uint32(8).bool(u.compress), u.stride !== 0 && e.uint32(16).int32(u.stride), e
  1049. }, decode(u, e) {
  1050. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1051. let n = e === void 0 ? i.len : i.pos + e;
  1052. const a = Q4();
  1053. for (; i.pos < n;) {
  1054. const t = i.uint32();
  1055. switch (t >>> 3) {
  1056. case 1:
  1057. if (t !== 8) break;
  1058. a.compress = i.bool();
  1059. continue;
  1060. case 2:
  1061. if (t !== 16) break;
  1062. a.stride = i.int32();
  1063. continue
  1064. }
  1065. if ((t & 7) === 4 || t === 0) break;
  1066. i.skipType(t & 7)
  1067. }
  1068. return a
  1069. }, fromJSON(u) {
  1070. return {
  1071. compress: o(u.compress) ? globalThis.Boolean(u.compress) : !1,
  1072. stride: o(u.stride) ? globalThis.Number(u.stride) : 0
  1073. }
  1074. }, toJSON(u) {
  1075. const e = {};
  1076. return u.compress !== !1 && (e.compress = u.compress), u.stride !== 0 && (e.stride = Math.round(u.stride)), e
  1077. }, create(u) {
  1078. return r0.fromPartial(u != null ? u : {})
  1079. }, fromPartial(u) {
  1080. var i, n;
  1081. const e = Q4();
  1082. return e.compress = (i = u.compress) != null ? i : !1, e.stride = (n = u.stride) != null ? n : 0, e
  1083. }
  1084. };
  1085. function X4() {
  1086. return {
  1087. vp9s: void 0,
  1088. rgb: void 0,
  1089. yuv: void 0,
  1090. h264s: void 0,
  1091. h265s: void 0,
  1092. vp8s: void 0,
  1093. av1s: void 0,
  1094. display: 0
  1095. }
  1096. }
  1097. const s0 = {
  1098. encode(u, e = r.Writer.create()) {
  1099. return u.vp9s !== void 0 && g.encode(u.vp9s, e.uint32(50).fork()).ldelim(), u.rgb !== void 0 && o0.encode(u.rgb, e.uint32(58).fork()).ldelim(), u.yuv !== void 0 && r0.encode(u.yuv, e.uint32(66).fork()).ldelim(), u.h264s !== void 0 && g.encode(u.h264s, e.uint32(82).fork()).ldelim(), u.h265s !== void 0 && g.encode(u.h265s, e.uint32(90).fork()).ldelim(), u.vp8s !== void 0 && g.encode(u.vp8s, e.uint32(98).fork()).ldelim(), u.av1s !== void 0 && g.encode(u.av1s, e.uint32(106).fork()).ldelim(), u.display !== 0 && e.uint32(112).int32(u.display), e
  1100. }, decode(u, e) {
  1101. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1102. let n = e === void 0 ? i.len : i.pos + e;
  1103. const a = X4();
  1104. for (; i.pos < n;) {
  1105. const t = i.uint32();
  1106. switch (t >>> 3) {
  1107. case 6:
  1108. if (t !== 50) break;
  1109. a.vp9s = g.decode(i, i.uint32());
  1110. continue;
  1111. case 7:
  1112. if (t !== 58) break;
  1113. a.rgb = o0.decode(i, i.uint32());
  1114. continue;
  1115. case 8:
  1116. if (t !== 66) break;
  1117. a.yuv = r0.decode(i, i.uint32());
  1118. continue;
  1119. case 10:
  1120. if (t !== 82) break;
  1121. a.h264s = g.decode(i, i.uint32());
  1122. continue;
  1123. case 11:
  1124. if (t !== 90) break;
  1125. a.h265s = g.decode(i, i.uint32());
  1126. continue;
  1127. case 12:
  1128. if (t !== 98) break;
  1129. a.vp8s = g.decode(i, i.uint32());
  1130. continue;
  1131. case 13:
  1132. if (t !== 106) break;
  1133. a.av1s = g.decode(i, i.uint32());
  1134. continue;
  1135. case 14:
  1136. if (t !== 112) break;
  1137. a.display = i.int32();
  1138. continue
  1139. }
  1140. if ((t & 7) === 4 || t === 0) break;
  1141. i.skipType(t & 7)
  1142. }
  1143. return a
  1144. }, fromJSON(u) {
  1145. return {
  1146. vp9s: o(u.vp9s) ? g.fromJSON(u.vp9s) : void 0,
  1147. rgb: o(u.rgb) ? o0.fromJSON(u.rgb) : void 0,
  1148. yuv: o(u.yuv) ? r0.fromJSON(u.yuv) : void 0,
  1149. h264s: o(u.h264s) ? g.fromJSON(u.h264s) : void 0,
  1150. h265s: o(u.h265s) ? g.fromJSON(u.h265s) : void 0,
  1151. vp8s: o(u.vp8s) ? g.fromJSON(u.vp8s) : void 0,
  1152. av1s: o(u.av1s) ? g.fromJSON(u.av1s) : void 0,
  1153. display: o(u.display) ? globalThis.Number(u.display) : 0
  1154. }
  1155. }, toJSON(u) {
  1156. const e = {};
  1157. return u.vp9s !== void 0 && (e.vp9s = g.toJSON(u.vp9s)), u.rgb !== void 0 && (e.rgb = o0.toJSON(u.rgb)), u.yuv !== void 0 && (e.yuv = r0.toJSON(u.yuv)), u.h264s !== void 0 && (e.h264s = g.toJSON(u.h264s)), u.h265s !== void 0 && (e.h265s = g.toJSON(u.h265s)), u.vp8s !== void 0 && (e.vp8s = g.toJSON(u.vp8s)), u.av1s !== void 0 && (e.av1s = g.toJSON(u.av1s)), u.display !== 0 && (e.display = Math.round(u.display)), e
  1158. }, create(u) {
  1159. return s0.fromPartial(u != null ? u : {})
  1160. }, fromPartial(u) {
  1161. var i;
  1162. const e = X4();
  1163. return e.vp9s = u.vp9s !== void 0 && u.vp9s !== null ? g.fromPartial(u.vp9s) : void 0, e.rgb = u.rgb !== void 0 && u.rgb !== null ? o0.fromPartial(u.rgb) : void 0, e.yuv = u.yuv !== void 0 && u.yuv !== null ? r0.fromPartial(u.yuv) : void 0, e.h264s = u.h264s !== void 0 && u.h264s !== null ? g.fromPartial(u.h264s) : void 0, e.h265s = u.h265s !== void 0 && u.h265s !== null ? g.fromPartial(u.h265s) : void 0, e.vp8s = u.vp8s !== void 0 && u.vp8s !== null ? g.fromPartial(u.vp8s) : void 0, e.av1s = u.av1s !== void 0 && u.av1s !== null ? g.fromPartial(u.av1s) : void 0, e.display = (i = u.display) != null ? i : 0, e
  1164. }
  1165. };
  1166. function Y4() {
  1167. return {id: "", pk: new Uint8Array(0)}
  1168. }
  1169. const D4 = {
  1170. encode(u, e = r.Writer.create()) {
  1171. return u.id !== "" && e.uint32(10).string(u.id), u.pk.length !== 0 && e.uint32(18).bytes(u.pk), e
  1172. }, decode(u, e) {
  1173. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1174. let n = e === void 0 ? i.len : i.pos + e;
  1175. const a = Y4();
  1176. for (; i.pos < n;) {
  1177. const t = i.uint32();
  1178. switch (t >>> 3) {
  1179. case 1:
  1180. if (t !== 10) break;
  1181. a.id = i.string();
  1182. continue;
  1183. case 2:
  1184. if (t !== 18) break;
  1185. a.pk = i.bytes();
  1186. continue
  1187. }
  1188. if ((t & 7) === 4 || t === 0) break;
  1189. i.skipType(t & 7)
  1190. }
  1191. return a
  1192. }, fromJSON(u) {
  1193. return {id: o(u.id) ? globalThis.String(u.id) : "", pk: o(u.pk) ? z(u.pk) : new Uint8Array(0)}
  1194. }, toJSON(u) {
  1195. const e = {};
  1196. return u.id !== "" && (e.id = u.id), u.pk.length !== 0 && (e.pk = P(u.pk)), e
  1197. }, create(u) {
  1198. return D4.fromPartial(u != null ? u : {})
  1199. }, fromPartial(u) {
  1200. var i, n;
  1201. const e = Y4();
  1202. return e.id = (i = u.id) != null ? i : "", e.pk = (n = u.pk) != null ? n : new Uint8Array(0), e
  1203. }
  1204. };
  1205. function $4() {
  1206. return {
  1207. x: 0,
  1208. y: 0,
  1209. width: 0,
  1210. height: 0,
  1211. name: "",
  1212. online: !1,
  1213. cursor_embedded: !1,
  1214. original_resolution: void 0,
  1215. scale: 0
  1216. }
  1217. }
  1218. const E0 = {
  1219. encode(u, e = r.Writer.create()) {
  1220. return u.x !== 0 && e.uint32(8).sint32(u.x), u.y !== 0 && e.uint32(16).sint32(u.y), u.width !== 0 && e.uint32(24).int32(u.width), u.height !== 0 && e.uint32(32).int32(u.height), u.name !== "" && e.uint32(42).string(u.name), u.online !== !1 && e.uint32(48).bool(u.online), u.cursor_embedded !== !1 && e.uint32(56).bool(u.cursor_embedded), u.original_resolution !== void 0 && v.encode(u.original_resolution, e.uint32(66).fork()).ldelim(), u.scale !== 0 && e.uint32(73).double(u.scale), e
  1221. }, decode(u, e) {
  1222. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1223. let n = e === void 0 ? i.len : i.pos + e;
  1224. const a = $4();
  1225. for (; i.pos < n;) {
  1226. const t = i.uint32();
  1227. switch (t >>> 3) {
  1228. case 1:
  1229. if (t !== 8) break;
  1230. a.x = i.sint32();
  1231. continue;
  1232. case 2:
  1233. if (t !== 16) break;
  1234. a.y = i.sint32();
  1235. continue;
  1236. case 3:
  1237. if (t !== 24) break;
  1238. a.width = i.int32();
  1239. continue;
  1240. case 4:
  1241. if (t !== 32) break;
  1242. a.height = i.int32();
  1243. continue;
  1244. case 5:
  1245. if (t !== 42) break;
  1246. a.name = i.string();
  1247. continue;
  1248. case 6:
  1249. if (t !== 48) break;
  1250. a.online = i.bool();
  1251. continue;
  1252. case 7:
  1253. if (t !== 56) break;
  1254. a.cursor_embedded = i.bool();
  1255. continue;
  1256. case 8:
  1257. if (t !== 66) break;
  1258. a.original_resolution = v.decode(i, i.uint32());
  1259. continue;
  1260. case 9:
  1261. if (t !== 73) break;
  1262. a.scale = i.double();
  1263. continue
  1264. }
  1265. if ((t & 7) === 4 || t === 0) break;
  1266. i.skipType(t & 7)
  1267. }
  1268. return a
  1269. }, fromJSON(u) {
  1270. return {
  1271. x: o(u.x) ? globalThis.Number(u.x) : 0,
  1272. y: o(u.y) ? globalThis.Number(u.y) : 0,
  1273. width: o(u.width) ? globalThis.Number(u.width) : 0,
  1274. height: o(u.height) ? globalThis.Number(u.height) : 0,
  1275. name: o(u.name) ? globalThis.String(u.name) : "",
  1276. online: o(u.online) ? globalThis.Boolean(u.online) : !1,
  1277. cursor_embedded: o(u.cursor_embedded) ? globalThis.Boolean(u.cursor_embedded) : !1,
  1278. original_resolution: o(u.original_resolution) ? v.fromJSON(u.original_resolution) : void 0,
  1279. scale: o(u.scale) ? globalThis.Number(u.scale) : 0
  1280. }
  1281. }, toJSON(u) {
  1282. const e = {};
  1283. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.name !== "" && (e.name = u.name), u.online !== !1 && (e.online = u.online), u.cursor_embedded !== !1 && (e.cursor_embedded = u.cursor_embedded), u.original_resolution !== void 0 && (e.original_resolution = v.toJSON(u.original_resolution)), u.scale !== 0 && (e.scale = u.scale), e
  1284. }, create(u) {
  1285. return E0.fromPartial(u != null ? u : {})
  1286. }, fromPartial(u) {
  1287. var i, n, a, t, s, E, l, d;
  1288. const e = $4();
  1289. return e.x = (i = u.x) != null ? i : 0, e.y = (n = u.y) != null ? n : 0, e.width = (a = u.width) != null ? a : 0, e.height = (t = u.height) != null ? t : 0, e.name = (s = u.name) != null ? s : "", e.online = (E = u.online) != null ? E : !1, e.cursor_embedded = (l = u.cursor_embedded) != null ? l : !1, e.original_resolution = u.original_resolution !== void 0 && u.original_resolution !== null ? v.fromPartial(u.original_resolution) : void 0, e.scale = (d = u.scale) != null ? d : 0, e
  1290. }
  1291. };
  1292. function u3() {
  1293. return {host: "", port: 0}
  1294. }
  1295. const l0 = {
  1296. encode(u, e = r.Writer.create()) {
  1297. return u.host !== "" && e.uint32(10).string(u.host), u.port !== 0 && e.uint32(16).int32(u.port), e
  1298. }, decode(u, e) {
  1299. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1300. let n = e === void 0 ? i.len : i.pos + e;
  1301. const a = u3();
  1302. for (; i.pos < n;) {
  1303. const t = i.uint32();
  1304. switch (t >>> 3) {
  1305. case 1:
  1306. if (t !== 10) break;
  1307. a.host = i.string();
  1308. continue;
  1309. case 2:
  1310. if (t !== 16) break;
  1311. a.port = i.int32();
  1312. continue
  1313. }
  1314. if ((t & 7) === 4 || t === 0) break;
  1315. i.skipType(t & 7)
  1316. }
  1317. return a
  1318. }, fromJSON(u) {
  1319. return {host: o(u.host) ? globalThis.String(u.host) : "", port: o(u.port) ? globalThis.Number(u.port) : 0}
  1320. }, toJSON(u) {
  1321. const e = {};
  1322. return u.host !== "" && (e.host = u.host), u.port !== 0 && (e.port = Math.round(u.port)), e
  1323. }, create(u) {
  1324. return l0.fromPartial(u != null ? u : {})
  1325. }, fromPartial(u) {
  1326. var i, n;
  1327. const e = u3();
  1328. return e.host = (i = u.host) != null ? i : "", e.port = (n = u.port) != null ? n : 0, e
  1329. }
  1330. };
  1331. function e3() {
  1332. return {dir: "", show_hidden: !1}
  1333. }
  1334. const Fu = {
  1335. encode(u, e = r.Writer.create()) {
  1336. return u.dir !== "" && e.uint32(10).string(u.dir), u.show_hidden !== !1 && e.uint32(16).bool(u.show_hidden), e
  1337. }, decode(u, e) {
  1338. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1339. let n = e === void 0 ? i.len : i.pos + e;
  1340. const a = e3();
  1341. for (; i.pos < n;) {
  1342. const t = i.uint32();
  1343. switch (t >>> 3) {
  1344. case 1:
  1345. if (t !== 10) break;
  1346. a.dir = i.string();
  1347. continue;
  1348. case 2:
  1349. if (t !== 16) break;
  1350. a.show_hidden = i.bool();
  1351. continue
  1352. }
  1353. if ((t & 7) === 4 || t === 0) break;
  1354. i.skipType(t & 7)
  1355. }
  1356. return a
  1357. }, fromJSON(u) {
  1358. return {
  1359. dir: o(u.dir) ? globalThis.String(u.dir) : "",
  1360. show_hidden: o(u.show_hidden) ? globalThis.Boolean(u.show_hidden) : !1
  1361. }
  1362. }, toJSON(u) {
  1363. const e = {};
  1364. return u.dir !== "" && (e.dir = u.dir), u.show_hidden !== !1 && (e.show_hidden = u.show_hidden), e
  1365. }, create(u) {
  1366. return Fu.fromPartial(u != null ? u : {})
  1367. }, fromPartial(u) {
  1368. var i, n;
  1369. const e = e3();
  1370. return e.dir = (i = u.dir) != null ? i : "", e.show_hidden = (n = u.show_hidden) != null ? n : !1, e
  1371. }
  1372. };
  1373. function i3() {
  1374. return {}
  1375. }
  1376. const _u = {
  1377. encode(u, e = r.Writer.create()) {
  1378. return e
  1379. }, decode(u, e) {
  1380. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1381. let n = e === void 0 ? i.len : i.pos + e;
  1382. const a = i3();
  1383. for (; i.pos < n;) {
  1384. const t = i.uint32();
  1385. if ((t & 7) === 4 || t === 0) break;
  1386. i.skipType(t & 7)
  1387. }
  1388. return a
  1389. }, fromJSON(u) {
  1390. return {}
  1391. }, toJSON(u) {
  1392. return {}
  1393. }, create(u) {
  1394. return _u.fromPartial(u != null ? u : {})
  1395. }, fromPartial(u) {
  1396. return i3()
  1397. }
  1398. };
  1399. function t3() {
  1400. return {username: "", password: ""}
  1401. }
  1402. const D0 = {
  1403. encode(u, e = r.Writer.create()) {
  1404. return u.username !== "" && e.uint32(10).string(u.username), u.password !== "" && e.uint32(18).string(u.password), e
  1405. }, decode(u, e) {
  1406. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1407. let n = e === void 0 ? i.len : i.pos + e;
  1408. const a = t3();
  1409. for (; i.pos < n;) {
  1410. const t = i.uint32();
  1411. switch (t >>> 3) {
  1412. case 1:
  1413. if (t !== 10) break;
  1414. a.username = i.string();
  1415. continue;
  1416. case 2:
  1417. if (t !== 18) break;
  1418. a.password = i.string();
  1419. continue
  1420. }
  1421. if ((t & 7) === 4 || t === 0) break;
  1422. i.skipType(t & 7)
  1423. }
  1424. return a
  1425. }, fromJSON(u) {
  1426. return {
  1427. username: o(u.username) ? globalThis.String(u.username) : "",
  1428. password: o(u.password) ? globalThis.String(u.password) : ""
  1429. }
  1430. }, toJSON(u) {
  1431. const e = {};
  1432. return u.username !== "" && (e.username = u.username), u.password !== "" && (e.password = u.password), e
  1433. }, create(u) {
  1434. return D0.fromPartial(u != null ? u : {})
  1435. }, fromPartial(u) {
  1436. var i, n;
  1437. const e = t3();
  1438. return e.username = (i = u.username) != null ? i : "", e.password = (n = u.password) != null ? n : "", e
  1439. }
  1440. };
  1441. function a3() {
  1442. return {
  1443. username: "",
  1444. password: new Uint8Array(0),
  1445. my_id: "",
  1446. my_name: "",
  1447. option: void 0,
  1448. file_transfer: void 0,
  1449. port_forward: void 0,
  1450. view_camera: void 0,
  1451. video_ack_required: !1,
  1452. session_id: 0,
  1453. version: "",
  1454. os_login: void 0,
  1455. my_platform: "",
  1456. hwid: new Uint8Array(0)
  1457. }
  1458. }
  1459. const J = {
  1460. encode(u, e = r.Writer.create()) {
  1461. return u.username !== "" && e.uint32(10).string(u.username), u.password.length !== 0 && e.uint32(18).bytes(u.password), u.my_id !== "" && e.uint32(34).string(u.my_id), u.my_name !== "" && e.uint32(42).string(u.my_name), u.option !== void 0 && R.encode(u.option, e.uint32(50).fork()).ldelim(), u.file_transfer !== void 0 && Fu.encode(u.file_transfer, e.uint32(58).fork()).ldelim(), u.port_forward !== void 0 && l0.encode(u.port_forward, e.uint32(66).fork()).ldelim(), u.view_camera !== void 0 && _u.encode(u.view_camera, e.uint32(122).fork()).ldelim(), u.video_ack_required !== !1 && e.uint32(72).bool(u.video_ack_required), u.session_id !== 0 && e.uint32(80).uint64(u.session_id), u.version !== "" && e.uint32(90).string(u.version), u.os_login !== void 0 && D0.encode(u.os_login, e.uint32(98).fork()).ldelim(), u.my_platform !== "" && e.uint32(106).string(u.my_platform), u.hwid.length !== 0 && e.uint32(114).bytes(u.hwid), e
  1462. }, decode(u, e) {
  1463. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1464. let n = e === void 0 ? i.len : i.pos + e;
  1465. const a = a3();
  1466. for (; i.pos < n;) {
  1467. const t = i.uint32();
  1468. switch (t >>> 3) {
  1469. case 1:
  1470. if (t !== 10) break;
  1471. a.username = i.string();
  1472. continue;
  1473. case 2:
  1474. if (t !== 18) break;
  1475. a.password = i.bytes();
  1476. continue;
  1477. case 4:
  1478. if (t !== 34) break;
  1479. a.my_id = i.string();
  1480. continue;
  1481. case 5:
  1482. if (t !== 42) break;
  1483. a.my_name = i.string();
  1484. continue;
  1485. case 6:
  1486. if (t !== 50) break;
  1487. a.option = R.decode(i, i.uint32());
  1488. continue;
  1489. case 7:
  1490. if (t !== 58) break;
  1491. a.file_transfer = Fu.decode(i, i.uint32());
  1492. continue;
  1493. case 8:
  1494. if (t !== 66) break;
  1495. a.port_forward = l0.decode(i, i.uint32());
  1496. continue;
  1497. case 15:
  1498. if (t !== 122) break;
  1499. a.view_camera = _u.decode(i, i.uint32());
  1500. continue;
  1501. case 9:
  1502. if (t !== 72) break;
  1503. a.video_ack_required = i.bool();
  1504. continue;
  1505. case 10:
  1506. if (t !== 80) break;
  1507. a.session_id = q(i.uint64());
  1508. continue;
  1509. case 11:
  1510. if (t !== 90) break;
  1511. a.version = i.string();
  1512. continue;
  1513. case 12:
  1514. if (t !== 98) break;
  1515. a.os_login = D0.decode(i, i.uint32());
  1516. continue;
  1517. case 13:
  1518. if (t !== 106) break;
  1519. a.my_platform = i.string();
  1520. continue;
  1521. case 14:
  1522. if (t !== 114) break;
  1523. a.hwid = i.bytes();
  1524. continue
  1525. }
  1526. if ((t & 7) === 4 || t === 0) break;
  1527. i.skipType(t & 7)
  1528. }
  1529. return a
  1530. }, fromJSON(u) {
  1531. return {
  1532. username: o(u.username) ? globalThis.String(u.username) : "",
  1533. password: o(u.password) ? z(u.password) : new Uint8Array(0),
  1534. my_id: o(u.my_id) ? globalThis.String(u.my_id) : "",
  1535. my_name: o(u.my_name) ? globalThis.String(u.my_name) : "",
  1536. option: o(u.option) ? R.fromJSON(u.option) : void 0,
  1537. file_transfer: o(u.file_transfer) ? Fu.fromJSON(u.file_transfer) : void 0,
  1538. port_forward: o(u.port_forward) ? l0.fromJSON(u.port_forward) : void 0,
  1539. view_camera: o(u.view_camera) ? _u.fromJSON(u.view_camera) : void 0,
  1540. video_ack_required: o(u.video_ack_required) ? globalThis.Boolean(u.video_ack_required) : !1,
  1541. session_id: o(u.session_id) ? globalThis.Number(u.session_id) : 0,
  1542. version: o(u.version) ? globalThis.String(u.version) : "",
  1543. os_login: o(u.os_login) ? D0.fromJSON(u.os_login) : void 0,
  1544. my_platform: o(u.my_platform) ? globalThis.String(u.my_platform) : "",
  1545. hwid: o(u.hwid) ? z(u.hwid) : new Uint8Array(0)
  1546. }
  1547. }, toJSON(u) {
  1548. const e = {};
  1549. return u.username !== "" && (e.username = u.username), u.password.length !== 0 && (e.password = P(u.password)), u.my_id !== "" && (e.my_id = u.my_id), u.my_name !== "" && (e.my_name = u.my_name), u.option !== void 0 && (e.option = R.toJSON(u.option)), u.file_transfer !== void 0 && (e.file_transfer = Fu.toJSON(u.file_transfer)), u.port_forward !== void 0 && (e.port_forward = l0.toJSON(u.port_forward)), u.view_camera !== void 0 && (e.view_camera = _u.toJSON(u.view_camera)), u.video_ack_required !== !1 && (e.video_ack_required = u.video_ack_required), u.session_id !== 0 && (e.session_id = Math.round(u.session_id)), u.version !== "" && (e.version = u.version), u.os_login !== void 0 && (e.os_login = D0.toJSON(u.os_login)), u.my_platform !== "" && (e.my_platform = u.my_platform), u.hwid.length !== 0 && (e.hwid = P(u.hwid)), e
  1550. }, create(u) {
  1551. return J.fromPartial(u != null ? u : {})
  1552. }, fromPartial(u) {
  1553. var i, n, a, t, s, E, l, d, c;
  1554. const e = a3();
  1555. return e.username = (i = u.username) != null ? i : "", e.password = (n = u.password) != null ? n : new Uint8Array(0), e.my_id = (a = u.my_id) != null ? a : "", e.my_name = (t = u.my_name) != null ? t : "", e.option = u.option !== void 0 && u.option !== null ? R.fromPartial(u.option) : void 0, e.file_transfer = u.file_transfer !== void 0 && u.file_transfer !== null ? Fu.fromPartial(u.file_transfer) : void 0, e.port_forward = u.port_forward !== void 0 && u.port_forward !== null ? l0.fromPartial(u.port_forward) : void 0, e.view_camera = u.view_camera !== void 0 && u.view_camera !== null ? _u.fromPartial(u.view_camera) : void 0, e.video_ack_required = (s = u.video_ack_required) != null ? s : !1, e.session_id = (E = u.session_id) != null ? E : 0, e.version = (l = u.version) != null ? l : "", e.os_login = u.os_login !== void 0 && u.os_login !== null ? D0.fromPartial(u.os_login) : void 0, e.my_platform = (d = u.my_platform) != null ? d : "", e.hwid = (c = u.hwid) != null ? c : new Uint8Array(0), e
  1556. }
  1557. };
  1558. function n3() {
  1559. return {code: "", hwid: new Uint8Array(0)}
  1560. }
  1561. const vu = {
  1562. encode(u, e = r.Writer.create()) {
  1563. return u.code !== "" && e.uint32(10).string(u.code), u.hwid.length !== 0 && e.uint32(18).bytes(u.hwid), e
  1564. }, decode(u, e) {
  1565. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1566. let n = e === void 0 ? i.len : i.pos + e;
  1567. const a = n3();
  1568. for (; i.pos < n;) {
  1569. const t = i.uint32();
  1570. switch (t >>> 3) {
  1571. case 1:
  1572. if (t !== 10) break;
  1573. a.code = i.string();
  1574. continue;
  1575. case 2:
  1576. if (t !== 18) break;
  1577. a.hwid = i.bytes();
  1578. continue
  1579. }
  1580. if ((t & 7) === 4 || t === 0) break;
  1581. i.skipType(t & 7)
  1582. }
  1583. return a
  1584. }, fromJSON(u) {
  1585. return {code: o(u.code) ? globalThis.String(u.code) : "", hwid: o(u.hwid) ? z(u.hwid) : new Uint8Array(0)}
  1586. }, toJSON(u) {
  1587. const e = {};
  1588. return u.code !== "" && (e.code = u.code), u.hwid.length !== 0 && (e.hwid = P(u.hwid)), e
  1589. }, create(u) {
  1590. return vu.fromPartial(u != null ? u : {})
  1591. }, fromPartial(u) {
  1592. var i, n;
  1593. const e = n3();
  1594. return e.code = (i = u.code) != null ? i : "", e.hwid = (n = u.hwid) != null ? n : new Uint8Array(0), e
  1595. }
  1596. };
  1597. function o3() {
  1598. return {text: ""}
  1599. }
  1600. const gu = {
  1601. encode(u, e = r.Writer.create()) {
  1602. return u.text !== "" && e.uint32(10).string(u.text), e
  1603. }, decode(u, e) {
  1604. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1605. let n = e === void 0 ? i.len : i.pos + e;
  1606. const a = o3();
  1607. for (; i.pos < n;) {
  1608. const t = i.uint32();
  1609. switch (t >>> 3) {
  1610. case 1:
  1611. if (t !== 10) break;
  1612. a.text = i.string();
  1613. continue
  1614. }
  1615. if ((t & 7) === 4 || t === 0) break;
  1616. i.skipType(t & 7)
  1617. }
  1618. return a
  1619. }, fromJSON(u) {
  1620. return {text: o(u.text) ? globalThis.String(u.text) : ""}
  1621. }, toJSON(u) {
  1622. const e = {};
  1623. return u.text !== "" && (e.text = u.text), e
  1624. }, create(u) {
  1625. return gu.fromPartial(u != null ? u : {})
  1626. }, fromPartial(u) {
  1627. var i;
  1628. const e = o3();
  1629. return e.text = (i = u.text) != null ? i : "", e
  1630. }
  1631. };
  1632. function r3() {
  1633. return {privacy_mode: !1}
  1634. }
  1635. const d0 = {
  1636. encode(u, e = r.Writer.create()) {
  1637. return u.privacy_mode !== !1 && e.uint32(8).bool(u.privacy_mode), e
  1638. }, decode(u, e) {
  1639. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1640. let n = e === void 0 ? i.len : i.pos + e;
  1641. const a = r3();
  1642. for (; i.pos < n;) {
  1643. const t = i.uint32();
  1644. switch (t >>> 3) {
  1645. case 1:
  1646. if (t !== 8) break;
  1647. a.privacy_mode = i.bool();
  1648. continue
  1649. }
  1650. if ((t & 7) === 4 || t === 0) break;
  1651. i.skipType(t & 7)
  1652. }
  1653. return a
  1654. }, fromJSON(u) {
  1655. return {privacy_mode: o(u.privacy_mode) ? globalThis.Boolean(u.privacy_mode) : !1}
  1656. }, toJSON(u) {
  1657. const e = {};
  1658. return u.privacy_mode !== !1 && (e.privacy_mode = u.privacy_mode), e
  1659. }, create(u) {
  1660. return d0.fromPartial(u != null ? u : {})
  1661. }, fromPartial(u) {
  1662. var i;
  1663. const e = r3();
  1664. return e.privacy_mode = (i = u.privacy_mode) != null ? i : !1, e
  1665. }
  1666. };
  1667. function s3() {
  1668. return {vp8: !1, vp9: !1, av1: !1, h264: !1, h265: !1}
  1669. }
  1670. const G = {
  1671. encode(u, e = r.Writer.create()) {
  1672. return u.vp8 !== !1 && e.uint32(8).bool(u.vp8), u.vp9 !== !1 && e.uint32(16).bool(u.vp9), u.av1 !== !1 && e.uint32(24).bool(u.av1), u.h264 !== !1 && e.uint32(32).bool(u.h264), u.h265 !== !1 && e.uint32(40).bool(u.h265), e
  1673. }, decode(u, e) {
  1674. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1675. let n = e === void 0 ? i.len : i.pos + e;
  1676. const a = s3();
  1677. for (; i.pos < n;) {
  1678. const t = i.uint32();
  1679. switch (t >>> 3) {
  1680. case 1:
  1681. if (t !== 8) break;
  1682. a.vp8 = i.bool();
  1683. continue;
  1684. case 2:
  1685. if (t !== 16) break;
  1686. a.vp9 = i.bool();
  1687. continue;
  1688. case 3:
  1689. if (t !== 24) break;
  1690. a.av1 = i.bool();
  1691. continue;
  1692. case 4:
  1693. if (t !== 32) break;
  1694. a.h264 = i.bool();
  1695. continue;
  1696. case 5:
  1697. if (t !== 40) break;
  1698. a.h265 = i.bool();
  1699. continue
  1700. }
  1701. if ((t & 7) === 4 || t === 0) break;
  1702. i.skipType(t & 7)
  1703. }
  1704. return a
  1705. }, fromJSON(u) {
  1706. return {
  1707. vp8: o(u.vp8) ? globalThis.Boolean(u.vp8) : !1,
  1708. vp9: o(u.vp9) ? globalThis.Boolean(u.vp9) : !1,
  1709. av1: o(u.av1) ? globalThis.Boolean(u.av1) : !1,
  1710. h264: o(u.h264) ? globalThis.Boolean(u.h264) : !1,
  1711. h265: o(u.h265) ? globalThis.Boolean(u.h265) : !1
  1712. }
  1713. }, toJSON(u) {
  1714. const e = {};
  1715. return u.vp8 !== !1 && (e.vp8 = u.vp8), u.vp9 !== !1 && (e.vp9 = u.vp9), u.av1 !== !1 && (e.av1 = u.av1), u.h264 !== !1 && (e.h264 = u.h264), u.h265 !== !1 && (e.h265 = u.h265), e
  1716. }, create(u) {
  1717. return G.fromPartial(u != null ? u : {})
  1718. }, fromPartial(u) {
  1719. var i, n, a, t, s;
  1720. const e = s3();
  1721. return e.vp8 = (i = u.vp8) != null ? i : !1, e.vp9 = (n = u.vp9) != null ? n : !1, e.av1 = (a = u.av1) != null ? a : !1, e.h264 = (t = u.h264) != null ? t : !1, e.h265 = (s = u.h265) != null ? s : !1, e
  1722. }
  1723. };
  1724. function E3() {
  1725. return {h264: !1, h265: !1, vp8: !1, av1: !1, i444: void 0}
  1726. }
  1727. const Z = {
  1728. encode(u, e = r.Writer.create()) {
  1729. return u.h264 !== !1 && e.uint32(8).bool(u.h264), u.h265 !== !1 && e.uint32(16).bool(u.h265), u.vp8 !== !1 && e.uint32(24).bool(u.vp8), u.av1 !== !1 && e.uint32(32).bool(u.av1), u.i444 !== void 0 && G.encode(u.i444, e.uint32(42).fork()).ldelim(), e
  1730. }, decode(u, e) {
  1731. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1732. let n = e === void 0 ? i.len : i.pos + e;
  1733. const a = E3();
  1734. for (; i.pos < n;) {
  1735. const t = i.uint32();
  1736. switch (t >>> 3) {
  1737. case 1:
  1738. if (t !== 8) break;
  1739. a.h264 = i.bool();
  1740. continue;
  1741. case 2:
  1742. if (t !== 16) break;
  1743. a.h265 = i.bool();
  1744. continue;
  1745. case 3:
  1746. if (t !== 24) break;
  1747. a.vp8 = i.bool();
  1748. continue;
  1749. case 4:
  1750. if (t !== 32) break;
  1751. a.av1 = i.bool();
  1752. continue;
  1753. case 5:
  1754. if (t !== 42) break;
  1755. a.i444 = G.decode(i, i.uint32());
  1756. continue
  1757. }
  1758. if ((t & 7) === 4 || t === 0) break;
  1759. i.skipType(t & 7)
  1760. }
  1761. return a
  1762. }, fromJSON(u) {
  1763. return {
  1764. h264: o(u.h264) ? globalThis.Boolean(u.h264) : !1,
  1765. h265: o(u.h265) ? globalThis.Boolean(u.h265) : !1,
  1766. vp8: o(u.vp8) ? globalThis.Boolean(u.vp8) : !1,
  1767. av1: o(u.av1) ? globalThis.Boolean(u.av1) : !1,
  1768. i444: o(u.i444) ? G.fromJSON(u.i444) : void 0
  1769. }
  1770. }, toJSON(u) {
  1771. const e = {};
  1772. return u.h264 !== !1 && (e.h264 = u.h264), u.h265 !== !1 && (e.h265 = u.h265), u.vp8 !== !1 && (e.vp8 = u.vp8), u.av1 !== !1 && (e.av1 = u.av1), u.i444 !== void 0 && (e.i444 = G.toJSON(u.i444)), e
  1773. }, create(u) {
  1774. return Z.fromPartial(u != null ? u : {})
  1775. }, fromPartial(u) {
  1776. var i, n, a, t;
  1777. const e = E3();
  1778. return e.h264 = (i = u.h264) != null ? i : !1, e.h265 = (n = u.h265) != null ? n : !1, e.vp8 = (a = u.vp8) != null ? a : !1, e.av1 = (t = u.av1) != null ? t : !1, e.i444 = u.i444 !== void 0 && u.i444 !== null ? G.fromPartial(u.i444) : void 0, e
  1779. }
  1780. };
  1781. function l3() {
  1782. return {
  1783. username: "",
  1784. hostname: "",
  1785. platform: "",
  1786. displays: [],
  1787. current_display: 0,
  1788. sas_enabled: !1,
  1789. version: "",
  1790. features: void 0,
  1791. encoding: void 0,
  1792. resolutions: void 0,
  1793. platform_additions: "",
  1794. windows_sessions: void 0
  1795. }
  1796. }
  1797. const uu = {
  1798. encode(u, e = r.Writer.create()) {
  1799. u.username !== "" && e.uint32(10).string(u.username), u.hostname !== "" && e.uint32(18).string(u.hostname), u.platform !== "" && e.uint32(26).string(u.platform);
  1800. for (const i of u.displays) E0.encode(i, e.uint32(34).fork()).ldelim();
  1801. return u.current_display !== 0 && e.uint32(40).int32(u.current_display), u.sas_enabled !== !1 && e.uint32(48).bool(u.sas_enabled), u.version !== "" && e.uint32(58).string(u.version), u.features !== void 0 && d0.encode(u.features, e.uint32(74).fork()).ldelim(), u.encoding !== void 0 && Z.encode(u.encoding, e.uint32(82).fork()).ldelim(), u.resolutions !== void 0 && iu.encode(u.resolutions, e.uint32(90).fork()).ldelim(), u.platform_additions !== "" && e.uint32(98).string(u.platform_additions), u.windows_sessions !== void 0 && J0.encode(u.windows_sessions, e.uint32(106).fork()).ldelim(), e
  1802. }, decode(u, e) {
  1803. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1804. let n = e === void 0 ? i.len : i.pos + e;
  1805. const a = l3();
  1806. for (; i.pos < n;) {
  1807. const t = i.uint32();
  1808. switch (t >>> 3) {
  1809. case 1:
  1810. if (t !== 10) break;
  1811. a.username = i.string();
  1812. continue;
  1813. case 2:
  1814. if (t !== 18) break;
  1815. a.hostname = i.string();
  1816. continue;
  1817. case 3:
  1818. if (t !== 26) break;
  1819. a.platform = i.string();
  1820. continue;
  1821. case 4:
  1822. if (t !== 34) break;
  1823. a.displays.push(E0.decode(i, i.uint32()));
  1824. continue;
  1825. case 5:
  1826. if (t !== 40) break;
  1827. a.current_display = i.int32();
  1828. continue;
  1829. case 6:
  1830. if (t !== 48) break;
  1831. a.sas_enabled = i.bool();
  1832. continue;
  1833. case 7:
  1834. if (t !== 58) break;
  1835. a.version = i.string();
  1836. continue;
  1837. case 9:
  1838. if (t !== 74) break;
  1839. a.features = d0.decode(i, i.uint32());
  1840. continue;
  1841. case 10:
  1842. if (t !== 82) break;
  1843. a.encoding = Z.decode(i, i.uint32());
  1844. continue;
  1845. case 11:
  1846. if (t !== 90) break;
  1847. a.resolutions = iu.decode(i, i.uint32());
  1848. continue;
  1849. case 12:
  1850. if (t !== 98) break;
  1851. a.platform_additions = i.string();
  1852. continue;
  1853. case 13:
  1854. if (t !== 106) break;
  1855. a.windows_sessions = J0.decode(i, i.uint32());
  1856. continue
  1857. }
  1858. if ((t & 7) === 4 || t === 0) break;
  1859. i.skipType(t & 7)
  1860. }
  1861. return a
  1862. }, fromJSON(u) {
  1863. return {
  1864. username: o(u.username) ? globalThis.String(u.username) : "",
  1865. hostname: o(u.hostname) ? globalThis.String(u.hostname) : "",
  1866. platform: o(u.platform) ? globalThis.String(u.platform) : "",
  1867. displays: globalThis.Array.isArray(u == null ? void 0 : u.displays) ? u.displays.map(e => E0.fromJSON(e)) : [],
  1868. current_display: o(u.current_display) ? globalThis.Number(u.current_display) : 0,
  1869. sas_enabled: o(u.sas_enabled) ? globalThis.Boolean(u.sas_enabled) : !1,
  1870. version: o(u.version) ? globalThis.String(u.version) : "",
  1871. features: o(u.features) ? d0.fromJSON(u.features) : void 0,
  1872. encoding: o(u.encoding) ? Z.fromJSON(u.encoding) : void 0,
  1873. resolutions: o(u.resolutions) ? iu.fromJSON(u.resolutions) : void 0,
  1874. platform_additions: o(u.platform_additions) ? globalThis.String(u.platform_additions) : "",
  1875. windows_sessions: o(u.windows_sessions) ? J0.fromJSON(u.windows_sessions) : void 0
  1876. }
  1877. }, toJSON(u) {
  1878. var i;
  1879. const e = {};
  1880. return u.username !== "" && (e.username = u.username), u.hostname !== "" && (e.hostname = u.hostname), u.platform !== "" && (e.platform = u.platform), (i = u.displays) != null && i.length && (e.displays = u.displays.map(n => E0.toJSON(n))), u.current_display !== 0 && (e.current_display = Math.round(u.current_display)), u.sas_enabled !== !1 && (e.sas_enabled = u.sas_enabled), u.version !== "" && (e.version = u.version), u.features !== void 0 && (e.features = d0.toJSON(u.features)), u.encoding !== void 0 && (e.encoding = Z.toJSON(u.encoding)), u.resolutions !== void 0 && (e.resolutions = iu.toJSON(u.resolutions)), u.platform_additions !== "" && (e.platform_additions = u.platform_additions), u.windows_sessions !== void 0 && (e.windows_sessions = J0.toJSON(u.windows_sessions)), e
  1881. }, create(u) {
  1882. return uu.fromPartial(u != null ? u : {})
  1883. }, fromPartial(u) {
  1884. var i, n, a, t, s, E, l, d;
  1885. const e = l3();
  1886. return e.username = (i = u.username) != null ? i : "", e.hostname = (n = u.hostname) != null ? n : "", e.platform = (a = u.platform) != null ? a : "", e.displays = ((t = u.displays) == null ? void 0 : t.map(c => E0.fromPartial(c))) || [], e.current_display = (s = u.current_display) != null ? s : 0, e.sas_enabled = (E = u.sas_enabled) != null ? E : !1, e.version = (l = u.version) != null ? l : "", e.features = u.features !== void 0 && u.features !== null ? d0.fromPartial(u.features) : void 0, e.encoding = u.encoding !== void 0 && u.encoding !== null ? Z.fromPartial(u.encoding) : void 0, e.resolutions = u.resolutions !== void 0 && u.resolutions !== null ? iu.fromPartial(u.resolutions) : void 0, e.platform_additions = (d = u.platform_additions) != null ? d : "", e.windows_sessions = u.windows_sessions !== void 0 && u.windows_sessions !== null ? J0.fromPartial(u.windows_sessions) : void 0, e
  1887. }
  1888. };
  1889. function D3() {
  1890. return {sid: 0, name: ""}
  1891. }
  1892. const c0 = {
  1893. encode(u, e = r.Writer.create()) {
  1894. return u.sid !== 0 && e.uint32(8).uint32(u.sid), u.name !== "" && e.uint32(18).string(u.name), e
  1895. }, decode(u, e) {
  1896. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1897. let n = e === void 0 ? i.len : i.pos + e;
  1898. const a = D3();
  1899. for (; i.pos < n;) {
  1900. const t = i.uint32();
  1901. switch (t >>> 3) {
  1902. case 1:
  1903. if (t !== 8) break;
  1904. a.sid = i.uint32();
  1905. continue;
  1906. case 2:
  1907. if (t !== 18) break;
  1908. a.name = i.string();
  1909. continue
  1910. }
  1911. if ((t & 7) === 4 || t === 0) break;
  1912. i.skipType(t & 7)
  1913. }
  1914. return a
  1915. }, fromJSON(u) {
  1916. return {sid: o(u.sid) ? globalThis.Number(u.sid) : 0, name: o(u.name) ? globalThis.String(u.name) : ""}
  1917. }, toJSON(u) {
  1918. const e = {};
  1919. return u.sid !== 0 && (e.sid = Math.round(u.sid)), u.name !== "" && (e.name = u.name), e
  1920. }, create(u) {
  1921. return c0.fromPartial(u != null ? u : {})
  1922. }, fromPartial(u) {
  1923. var i, n;
  1924. const e = D3();
  1925. return e.sid = (i = u.sid) != null ? i : 0, e.name = (n = u.name) != null ? n : "", e
  1926. }
  1927. };
  1928. function d3() {
  1929. return {error: void 0, peer_info: void 0, enable_trusted_devices: !1}
  1930. }
  1931. const C0 = {
  1932. encode(u, e = r.Writer.create()) {
  1933. return u.error !== void 0 && e.uint32(10).string(u.error), u.peer_info !== void 0 && uu.encode(u.peer_info, e.uint32(18).fork()).ldelim(), u.enable_trusted_devices !== !1 && e.uint32(24).bool(u.enable_trusted_devices), e
  1934. }, decode(u, e) {
  1935. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1936. let n = e === void 0 ? i.len : i.pos + e;
  1937. const a = d3();
  1938. for (; i.pos < n;) {
  1939. const t = i.uint32();
  1940. switch (t >>> 3) {
  1941. case 1:
  1942. if (t !== 10) break;
  1943. a.error = i.string();
  1944. continue;
  1945. case 2:
  1946. if (t !== 18) break;
  1947. a.peer_info = uu.decode(i, i.uint32());
  1948. continue;
  1949. case 3:
  1950. if (t !== 24) break;
  1951. a.enable_trusted_devices = i.bool();
  1952. continue
  1953. }
  1954. if ((t & 7) === 4 || t === 0) break;
  1955. i.skipType(t & 7)
  1956. }
  1957. return a
  1958. }, fromJSON(u) {
  1959. return {
  1960. error: o(u.error) ? globalThis.String(u.error) : void 0,
  1961. peer_info: o(u.peer_info) ? uu.fromJSON(u.peer_info) : void 0,
  1962. enable_trusted_devices: o(u.enable_trusted_devices) ? globalThis.Boolean(u.enable_trusted_devices) : !1
  1963. }
  1964. }, toJSON(u) {
  1965. const e = {};
  1966. return u.error !== void 0 && (e.error = u.error), u.peer_info !== void 0 && (e.peer_info = uu.toJSON(u.peer_info)), u.enable_trusted_devices !== !1 && (e.enable_trusted_devices = u.enable_trusted_devices), e
  1967. }, create(u) {
  1968. return C0.fromPartial(u != null ? u : {})
  1969. }, fromPartial(u) {
  1970. var i, n;
  1971. const e = d3();
  1972. return e.error = (i = u.error) != null ? i : void 0, e.peer_info = u.peer_info !== void 0 && u.peer_info !== null ? uu.fromPartial(u.peer_info) : void 0, e.enable_trusted_devices = (n = u.enable_trusted_devices) != null ? n : !1, e
  1973. }
  1974. };
  1975. function c3() {
  1976. return {scale: 0}
  1977. }
  1978. const p0 = {
  1979. encode(u, e = r.Writer.create()) {
  1980. return u.scale !== 0 && e.uint32(8).int32(u.scale), e
  1981. }, decode(u, e) {
  1982. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1983. let n = e === void 0 ? i.len : i.pos + e;
  1984. const a = c3();
  1985. for (; i.pos < n;) {
  1986. const t = i.uint32();
  1987. switch (t >>> 3) {
  1988. case 1:
  1989. if (t !== 8) break;
  1990. a.scale = i.int32();
  1991. continue
  1992. }
  1993. if ((t & 7) === 4 || t === 0) break;
  1994. i.skipType(t & 7)
  1995. }
  1996. return a
  1997. }, fromJSON(u) {
  1998. return {scale: o(u.scale) ? globalThis.Number(u.scale) : 0}
  1999. }, toJSON(u) {
  2000. const e = {};
  2001. return u.scale !== 0 && (e.scale = Math.round(u.scale)), e
  2002. }, create(u) {
  2003. return p0.fromPartial(u != null ? u : {})
  2004. }, fromPartial(u) {
  2005. var i;
  2006. const e = c3();
  2007. return e.scale = (i = u.scale) != null ? i : 0, e
  2008. }
  2009. };
  2010. function C3() {
  2011. return {x: 0, y: 0}
  2012. }
  2013. const B0 = {
  2014. encode(u, e = r.Writer.create()) {
  2015. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  2016. }, decode(u, e) {
  2017. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2018. let n = e === void 0 ? i.len : i.pos + e;
  2019. const a = C3();
  2020. for (; i.pos < n;) {
  2021. const t = i.uint32();
  2022. switch (t >>> 3) {
  2023. case 1:
  2024. if (t !== 8) break;
  2025. a.x = i.int32();
  2026. continue;
  2027. case 2:
  2028. if (t !== 16) break;
  2029. a.y = i.int32();
  2030. continue
  2031. }
  2032. if ((t & 7) === 4 || t === 0) break;
  2033. i.skipType(t & 7)
  2034. }
  2035. return a
  2036. }, fromJSON(u) {
  2037. return {x: o(u.x) ? globalThis.Number(u.x) : 0, y: o(u.y) ? globalThis.Number(u.y) : 0}
  2038. }, toJSON(u) {
  2039. const e = {};
  2040. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2041. }, create(u) {
  2042. return B0.fromPartial(u != null ? u : {})
  2043. }, fromPartial(u) {
  2044. var i, n;
  2045. const e = C3();
  2046. return e.x = (i = u.x) != null ? i : 0, e.y = (n = u.y) != null ? n : 0, e
  2047. }
  2048. };
  2049. function p3() {
  2050. return {x: 0, y: 0}
  2051. }
  2052. const A0 = {
  2053. encode(u, e = r.Writer.create()) {
  2054. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  2055. }, decode(u, e) {
  2056. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2057. let n = e === void 0 ? i.len : i.pos + e;
  2058. const a = p3();
  2059. for (; i.pos < n;) {
  2060. const t = i.uint32();
  2061. switch (t >>> 3) {
  2062. case 1:
  2063. if (t !== 8) break;
  2064. a.x = i.int32();
  2065. continue;
  2066. case 2:
  2067. if (t !== 16) break;
  2068. a.y = i.int32();
  2069. continue
  2070. }
  2071. if ((t & 7) === 4 || t === 0) break;
  2072. i.skipType(t & 7)
  2073. }
  2074. return a
  2075. }, fromJSON(u) {
  2076. return {x: o(u.x) ? globalThis.Number(u.x) : 0, y: o(u.y) ? globalThis.Number(u.y) : 0}
  2077. }, toJSON(u) {
  2078. const e = {};
  2079. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2080. }, create(u) {
  2081. return A0.fromPartial(u != null ? u : {})
  2082. }, fromPartial(u) {
  2083. var i, n;
  2084. const e = p3();
  2085. return e.x = (i = u.x) != null ? i : 0, e.y = (n = u.y) != null ? n : 0, e
  2086. }
  2087. };
  2088. function B3() {
  2089. return {x: 0, y: 0}
  2090. }
  2091. const m0 = {
  2092. encode(u, e = r.Writer.create()) {
  2093. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  2094. }, decode(u, e) {
  2095. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2096. let n = e === void 0 ? i.len : i.pos + e;
  2097. const a = B3();
  2098. for (; i.pos < n;) {
  2099. const t = i.uint32();
  2100. switch (t >>> 3) {
  2101. case 1:
  2102. if (t !== 8) break;
  2103. a.x = i.int32();
  2104. continue;
  2105. case 2:
  2106. if (t !== 16) break;
  2107. a.y = i.int32();
  2108. continue
  2109. }
  2110. if ((t & 7) === 4 || t === 0) break;
  2111. i.skipType(t & 7)
  2112. }
  2113. return a
  2114. }, fromJSON(u) {
  2115. return {x: o(u.x) ? globalThis.Number(u.x) : 0, y: o(u.y) ? globalThis.Number(u.y) : 0}
  2116. }, toJSON(u) {
  2117. const e = {};
  2118. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2119. }, create(u) {
  2120. return m0.fromPartial(u != null ? u : {})
  2121. }, fromPartial(u) {
  2122. var i, n;
  2123. const e = B3();
  2124. return e.x = (i = u.x) != null ? i : 0, e.y = (n = u.y) != null ? n : 0, e
  2125. }
  2126. };
  2127. function A3() {
  2128. return {scale_update: void 0, pan_start: void 0, pan_update: void 0, pan_end: void 0}
  2129. }
  2130. const F0 = {
  2131. encode(u, e = r.Writer.create()) {
  2132. return u.scale_update !== void 0 && p0.encode(u.scale_update, e.uint32(10).fork()).ldelim(), u.pan_start !== void 0 && B0.encode(u.pan_start, e.uint32(18).fork()).ldelim(), u.pan_update !== void 0 && A0.encode(u.pan_update, e.uint32(26).fork()).ldelim(), u.pan_end !== void 0 && m0.encode(u.pan_end, e.uint32(34).fork()).ldelim(), e
  2133. }, decode(u, e) {
  2134. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2135. let n = e === void 0 ? i.len : i.pos + e;
  2136. const a = A3();
  2137. for (; i.pos < n;) {
  2138. const t = i.uint32();
  2139. switch (t >>> 3) {
  2140. case 1:
  2141. if (t !== 10) break;
  2142. a.scale_update = p0.decode(i, i.uint32());
  2143. continue;
  2144. case 2:
  2145. if (t !== 18) break;
  2146. a.pan_start = B0.decode(i, i.uint32());
  2147. continue;
  2148. case 3:
  2149. if (t !== 26) break;
  2150. a.pan_update = A0.decode(i, i.uint32());
  2151. continue;
  2152. case 4:
  2153. if (t !== 34) break;
  2154. a.pan_end = m0.decode(i, i.uint32());
  2155. continue
  2156. }
  2157. if ((t & 7) === 4 || t === 0) break;
  2158. i.skipType(t & 7)
  2159. }
  2160. return a
  2161. }, fromJSON(u) {
  2162. return {
  2163. scale_update: o(u.scale_update) ? p0.fromJSON(u.scale_update) : void 0,
  2164. pan_start: o(u.pan_start) ? B0.fromJSON(u.pan_start) : void 0,
  2165. pan_update: o(u.pan_update) ? A0.fromJSON(u.pan_update) : void 0,
  2166. pan_end: o(u.pan_end) ? m0.fromJSON(u.pan_end) : void 0
  2167. }
  2168. }, toJSON(u) {
  2169. const e = {};
  2170. return u.scale_update !== void 0 && (e.scale_update = p0.toJSON(u.scale_update)), u.pan_start !== void 0 && (e.pan_start = B0.toJSON(u.pan_start)), u.pan_update !== void 0 && (e.pan_update = A0.toJSON(u.pan_update)), u.pan_end !== void 0 && (e.pan_end = m0.toJSON(u.pan_end)), e
  2171. }, create(u) {
  2172. return F0.fromPartial(u != null ? u : {})
  2173. }, fromPartial(u) {
  2174. const e = A3();
  2175. return e.scale_update = u.scale_update !== void 0 && u.scale_update !== null ? p0.fromPartial(u.scale_update) : void 0, e.pan_start = u.pan_start !== void 0 && u.pan_start !== null ? B0.fromPartial(u.pan_start) : void 0, e.pan_update = u.pan_update !== void 0 && u.pan_update !== null ? A0.fromPartial(u.pan_update) : void 0, e.pan_end = u.pan_end !== void 0 && u.pan_end !== null ? m0.fromPartial(u.pan_end) : void 0, e
  2176. }
  2177. };
  2178. function m3() {
  2179. return {touch_event: void 0, modifiers: []}
  2180. }
  2181. const _0 = {
  2182. encode(u, e = r.Writer.create()) {
  2183. u.touch_event !== void 0 && F0.encode(u.touch_event, e.uint32(10).fork()).ldelim(), e.uint32(18).fork();
  2184. for (const i of u.modifiers) e.int32(i);
  2185. return e.ldelim(), e
  2186. }, decode(u, e) {
  2187. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2188. let n = e === void 0 ? i.len : i.pos + e;
  2189. const a = m3();
  2190. for (; i.pos < n;) {
  2191. const t = i.uint32();
  2192. switch (t >>> 3) {
  2193. case 1:
  2194. if (t !== 10) break;
  2195. a.touch_event = F0.decode(i, i.uint32());
  2196. continue;
  2197. case 2:
  2198. if (t === 16) {
  2199. a.modifiers.push(i.int32());
  2200. continue
  2201. }
  2202. if (t === 18) {
  2203. const s = i.uint32() + i.pos;
  2204. for (; i.pos < s;) a.modifiers.push(i.int32());
  2205. continue
  2206. }
  2207. break
  2208. }
  2209. if ((t & 7) === 4 || t === 0) break;
  2210. i.skipType(t & 7)
  2211. }
  2212. return a
  2213. }, fromJSON(u) {
  2214. return {
  2215. touch_event: o(u.touch_event) ? F0.fromJSON(u.touch_event) : void 0,
  2216. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => fe(e)) : []
  2217. }
  2218. }, toJSON(u) {
  2219. var i;
  2220. const e = {};
  2221. return u.touch_event !== void 0 && (e.touch_event = F0.toJSON(u.touch_event)), (i = u.modifiers) != null && i.length && (e.modifiers = u.modifiers.map(n => We(n))), e
  2222. }, create(u) {
  2223. return _0.fromPartial(u != null ? u : {})
  2224. }, fromPartial(u) {
  2225. var i;
  2226. const e = m3();
  2227. return e.touch_event = u.touch_event !== void 0 && u.touch_event !== null ? F0.fromPartial(u.touch_event) : void 0, e.modifiers = ((i = u.modifiers) == null ? void 0 : i.map(n => n)) || [], e
  2228. }
  2229. };
  2230. function F3() {
  2231. return {mask: 0, x: 0, y: 0, modifiers: []}
  2232. }
  2233. const ku = {
  2234. encode(u, e = r.Writer.create()) {
  2235. u.mask !== 0 && e.uint32(8).int32(u.mask), u.x !== 0 && e.uint32(16).sint32(u.x), u.y !== 0 && e.uint32(24).sint32(u.y), e.uint32(34).fork();
  2236. for (const i of u.modifiers) e.int32(i);
  2237. return e.ldelim(), e
  2238. }, decode(u, e) {
  2239. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2240. let n = e === void 0 ? i.len : i.pos + e;
  2241. const a = F3();
  2242. for (; i.pos < n;) {
  2243. const t = i.uint32();
  2244. switch (t >>> 3) {
  2245. case 1:
  2246. if (t !== 8) break;
  2247. a.mask = i.int32();
  2248. continue;
  2249. case 2:
  2250. if (t !== 16) break;
  2251. a.x = i.sint32();
  2252. continue;
  2253. case 3:
  2254. if (t !== 24) break;
  2255. a.y = i.sint32();
  2256. continue;
  2257. case 4:
  2258. if (t === 32) {
  2259. a.modifiers.push(i.int32());
  2260. continue
  2261. }
  2262. if (t === 34) {
  2263. const s = i.uint32() + i.pos;
  2264. for (; i.pos < s;) a.modifiers.push(i.int32());
  2265. continue
  2266. }
  2267. break
  2268. }
  2269. if ((t & 7) === 4 || t === 0) break;
  2270. i.skipType(t & 7)
  2271. }
  2272. return a
  2273. }, fromJSON(u) {
  2274. return {
  2275. mask: o(u.mask) ? globalThis.Number(u.mask) : 0,
  2276. x: o(u.x) ? globalThis.Number(u.x) : 0,
  2277. y: o(u.y) ? globalThis.Number(u.y) : 0,
  2278. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => fe(e)) : []
  2279. }
  2280. }, toJSON(u) {
  2281. var i;
  2282. const e = {};
  2283. return u.mask !== 0 && (e.mask = Math.round(u.mask)), u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), (i = u.modifiers) != null && i.length && (e.modifiers = u.modifiers.map(n => We(n))), e
  2284. }, create(u) {
  2285. return ku.fromPartial(u != null ? u : {})
  2286. }, fromPartial(u) {
  2287. var i, n, a, t;
  2288. const e = F3();
  2289. return e.mask = (i = u.mask) != null ? i : 0, e.x = (n = u.x) != null ? n : 0, e.y = (a = u.y) != null ? a : 0, e.modifiers = ((t = u.modifiers) == null ? void 0 : t.map(s => s)) || [], e
  2290. }
  2291. };
  2292. function _3() {
  2293. return {
  2294. down: !1,
  2295. press: !1,
  2296. control_key: void 0,
  2297. chr: void 0,
  2298. unicode: void 0,
  2299. seq: void 0,
  2300. win2win_hotkey: void 0,
  2301. modifiers: [],
  2302. mode: 0
  2303. }
  2304. }
  2305. const S = {
  2306. encode(u, e = r.Writer.create()) {
  2307. u.down !== !1 && e.uint32(8).bool(u.down), u.press !== !1 && e.uint32(16).bool(u.press), u.control_key !== void 0 && e.uint32(24).int32(u.control_key), u.chr !== void 0 && e.uint32(32).uint32(u.chr), u.unicode !== void 0 && e.uint32(40).uint32(u.unicode), u.seq !== void 0 && e.uint32(50).string(u.seq), u.win2win_hotkey !== void 0 && e.uint32(56).uint32(u.win2win_hotkey), e.uint32(66).fork();
  2308. for (const i of u.modifiers) e.int32(i);
  2309. return e.ldelim(), u.mode !== 0 && e.uint32(72).int32(u.mode), e
  2310. }, decode(u, e) {
  2311. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2312. let n = e === void 0 ? i.len : i.pos + e;
  2313. const a = _3();
  2314. for (; i.pos < n;) {
  2315. const t = i.uint32();
  2316. switch (t >>> 3) {
  2317. case 1:
  2318. if (t !== 8) break;
  2319. a.down = i.bool();
  2320. continue;
  2321. case 2:
  2322. if (t !== 16) break;
  2323. a.press = i.bool();
  2324. continue;
  2325. case 3:
  2326. if (t !== 24) break;
  2327. a.control_key = i.int32();
  2328. continue;
  2329. case 4:
  2330. if (t !== 32) break;
  2331. a.chr = i.uint32();
  2332. continue;
  2333. case 5:
  2334. if (t !== 40) break;
  2335. a.unicode = i.uint32();
  2336. continue;
  2337. case 6:
  2338. if (t !== 50) break;
  2339. a.seq = i.string();
  2340. continue;
  2341. case 7:
  2342. if (t !== 56) break;
  2343. a.win2win_hotkey = i.uint32();
  2344. continue;
  2345. case 8:
  2346. if (t === 64) {
  2347. a.modifiers.push(i.int32());
  2348. continue
  2349. }
  2350. if (t === 66) {
  2351. const s = i.uint32() + i.pos;
  2352. for (; i.pos < s;) a.modifiers.push(i.int32());
  2353. continue
  2354. }
  2355. break;
  2356. case 9:
  2357. if (t !== 72) break;
  2358. a.mode = i.int32();
  2359. continue
  2360. }
  2361. if ((t & 7) === 4 || t === 0) break;
  2362. i.skipType(t & 7)
  2363. }
  2364. return a
  2365. }, fromJSON(u) {
  2366. return {
  2367. down: o(u.down) ? globalThis.Boolean(u.down) : !1,
  2368. press: o(u.press) ? globalThis.Boolean(u.press) : !1,
  2369. control_key: o(u.control_key) ? fe(u.control_key) : void 0,
  2370. chr: o(u.chr) ? globalThis.Number(u.chr) : void 0,
  2371. unicode: o(u.unicode) ? globalThis.Number(u.unicode) : void 0,
  2372. seq: o(u.seq) ? globalThis.String(u.seq) : void 0,
  2373. win2win_hotkey: o(u.win2win_hotkey) ? globalThis.Number(u.win2win_hotkey) : void 0,
  2374. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => fe(e)) : [],
  2375. mode: o(u.mode) ? ba(u.mode) : 0
  2376. }
  2377. }, toJSON(u) {
  2378. var i;
  2379. const e = {};
  2380. return u.down !== !1 && (e.down = u.down), u.press !== !1 && (e.press = u.press), u.control_key !== void 0 && (e.control_key = We(u.control_key)), u.chr !== void 0 && (e.chr = Math.round(u.chr)), u.unicode !== void 0 && (e.unicode = Math.round(u.unicode)), u.seq !== void 0 && (e.seq = u.seq), u.win2win_hotkey !== void 0 && (e.win2win_hotkey = Math.round(u.win2win_hotkey)), (i = u.modifiers) != null && i.length && (e.modifiers = u.modifiers.map(n => We(n))), u.mode !== 0 && (e.mode = wa(u.mode)), e
  2381. }, create(u) {
  2382. return S.fromPartial(u != null ? u : {})
  2383. }, fromPartial(u) {
  2384. var i, n, a, t, s, E, l, d, c;
  2385. const e = _3();
  2386. return e.down = (i = u.down) != null ? i : !1, e.press = (n = u.press) != null ? n : !1, e.control_key = (a = u.control_key) != null ? a : void 0, e.chr = (t = u.chr) != null ? t : void 0, e.unicode = (s = u.unicode) != null ? s : void 0, e.seq = (E = u.seq) != null ? E : void 0, e.win2win_hotkey = (l = u.win2win_hotkey) != null ? l : void 0, e.modifiers = ((d = u.modifiers) == null ? void 0 : d.map(p => p)) || [], e.mode = (c = u.mode) != null ? c : 0, e
  2387. }
  2388. };
  2389. function v3() {
  2390. return {id: 0, hotx: 0, hoty: 0, width: 0, height: 0, colors: new Uint8Array(0)}
  2391. }
  2392. const v0 = {
  2393. encode(u, e = r.Writer.create()) {
  2394. return u.id !== 0 && e.uint32(8).uint64(u.id), u.hotx !== 0 && e.uint32(16).sint32(u.hotx), u.hoty !== 0 && e.uint32(24).sint32(u.hoty), u.width !== 0 && e.uint32(32).int32(u.width), u.height !== 0 && e.uint32(40).int32(u.height), u.colors.length !== 0 && e.uint32(50).bytes(u.colors), e
  2395. }, decode(u, e) {
  2396. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2397. let n = e === void 0 ? i.len : i.pos + e;
  2398. const a = v3();
  2399. for (; i.pos < n;) {
  2400. const t = i.uint32();
  2401. switch (t >>> 3) {
  2402. case 1:
  2403. if (t !== 8) break;
  2404. a.id = q(i.uint64());
  2405. continue;
  2406. case 2:
  2407. if (t !== 16) break;
  2408. a.hotx = i.sint32();
  2409. continue;
  2410. case 3:
  2411. if (t !== 24) break;
  2412. a.hoty = i.sint32();
  2413. continue;
  2414. case 4:
  2415. if (t !== 32) break;
  2416. a.width = i.int32();
  2417. continue;
  2418. case 5:
  2419. if (t !== 40) break;
  2420. a.height = i.int32();
  2421. continue;
  2422. case 6:
  2423. if (t !== 50) break;
  2424. a.colors = i.bytes();
  2425. continue
  2426. }
  2427. if ((t & 7) === 4 || t === 0) break;
  2428. i.skipType(t & 7)
  2429. }
  2430. return a
  2431. }, fromJSON(u) {
  2432. return {
  2433. id: o(u.id) ? globalThis.Number(u.id) : 0,
  2434. hotx: o(u.hotx) ? globalThis.Number(u.hotx) : 0,
  2435. hoty: o(u.hoty) ? globalThis.Number(u.hoty) : 0,
  2436. width: o(u.width) ? globalThis.Number(u.width) : 0,
  2437. height: o(u.height) ? globalThis.Number(u.height) : 0,
  2438. colors: o(u.colors) ? z(u.colors) : new Uint8Array(0)
  2439. }
  2440. }, toJSON(u) {
  2441. const e = {};
  2442. return u.id !== 0 && (e.id = Math.round(u.id)), u.hotx !== 0 && (e.hotx = Math.round(u.hotx)), u.hoty !== 0 && (e.hoty = Math.round(u.hoty)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.colors.length !== 0 && (e.colors = P(u.colors)), e
  2443. }, create(u) {
  2444. return v0.fromPartial(u != null ? u : {})
  2445. }, fromPartial(u) {
  2446. var i, n, a, t, s, E;
  2447. const e = v3();
  2448. return e.id = (i = u.id) != null ? i : 0, e.hotx = (n = u.hotx) != null ? n : 0, e.hoty = (a = u.hoty) != null ? a : 0, e.width = (t = u.width) != null ? t : 0, e.height = (s = u.height) != null ? s : 0, e.colors = (E = u.colors) != null ? E : new Uint8Array(0), e
  2449. }
  2450. };
  2451. function g3() {
  2452. return {x: 0, y: 0}
  2453. }
  2454. const g0 = {
  2455. encode(u, e = r.Writer.create()) {
  2456. return u.x !== 0 && e.uint32(8).sint32(u.x), u.y !== 0 && e.uint32(16).sint32(u.y), e
  2457. }, decode(u, e) {
  2458. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2459. let n = e === void 0 ? i.len : i.pos + e;
  2460. const a = g3();
  2461. for (; i.pos < n;) {
  2462. const t = i.uint32();
  2463. switch (t >>> 3) {
  2464. case 1:
  2465. if (t !== 8) break;
  2466. a.x = i.sint32();
  2467. continue;
  2468. case 2:
  2469. if (t !== 16) break;
  2470. a.y = i.sint32();
  2471. continue
  2472. }
  2473. if ((t & 7) === 4 || t === 0) break;
  2474. i.skipType(t & 7)
  2475. }
  2476. return a
  2477. }, fromJSON(u) {
  2478. return {x: o(u.x) ? globalThis.Number(u.x) : 0, y: o(u.y) ? globalThis.Number(u.y) : 0}
  2479. }, toJSON(u) {
  2480. const e = {};
  2481. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2482. }, create(u) {
  2483. return g0.fromPartial(u != null ? u : {})
  2484. }, fromPartial(u) {
  2485. var i, n;
  2486. const e = g3();
  2487. return e.x = (i = u.x) != null ? i : 0, e.y = (n = u.y) != null ? n : 0, e
  2488. }
  2489. };
  2490. function k3() {
  2491. return {salt: "", challenge: ""}
  2492. }
  2493. const k0 = {
  2494. encode(u, e = r.Writer.create()) {
  2495. return u.salt !== "" && e.uint32(10).string(u.salt), u.challenge !== "" && e.uint32(18).string(u.challenge), e
  2496. }, decode(u, e) {
  2497. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2498. let n = e === void 0 ? i.len : i.pos + e;
  2499. const a = k3();
  2500. for (; i.pos < n;) {
  2501. const t = i.uint32();
  2502. switch (t >>> 3) {
  2503. case 1:
  2504. if (t !== 10) break;
  2505. a.salt = i.string();
  2506. continue;
  2507. case 2:
  2508. if (t !== 18) break;
  2509. a.challenge = i.string();
  2510. continue
  2511. }
  2512. if ((t & 7) === 4 || t === 0) break;
  2513. i.skipType(t & 7)
  2514. }
  2515. return a
  2516. }, fromJSON(u) {
  2517. return {
  2518. salt: o(u.salt) ? globalThis.String(u.salt) : "",
  2519. challenge: o(u.challenge) ? globalThis.String(u.challenge) : ""
  2520. }
  2521. }, toJSON(u) {
  2522. const e = {};
  2523. return u.salt !== "" && (e.salt = u.salt), u.challenge !== "" && (e.challenge = u.challenge), e
  2524. }, create(u) {
  2525. return k0.fromPartial(u != null ? u : {})
  2526. }, fromPartial(u) {
  2527. var i, n;
  2528. const e = k3();
  2529. return e.salt = (i = u.salt) != null ? i : "", e.challenge = (n = u.challenge) != null ? n : "", e
  2530. }
  2531. };
  2532. function h3() {
  2533. return {compress: !1, content: new Uint8Array(0), width: 0, height: 0, format: 0, special_name: ""}
  2534. }
  2535. const W = {
  2536. encode(u, e = r.Writer.create()) {
  2537. return u.compress !== !1 && e.uint32(8).bool(u.compress), u.content.length !== 0 && e.uint32(18).bytes(u.content), u.width !== 0 && e.uint32(24).int32(u.width), u.height !== 0 && e.uint32(32).int32(u.height), u.format !== 0 && e.uint32(40).int32(u.format), u.special_name !== "" && e.uint32(50).string(u.special_name), e
  2538. }, decode(u, e) {
  2539. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2540. let n = e === void 0 ? i.len : i.pos + e;
  2541. const a = h3();
  2542. for (; i.pos < n;) {
  2543. const t = i.uint32();
  2544. switch (t >>> 3) {
  2545. case 1:
  2546. if (t !== 8) break;
  2547. a.compress = i.bool();
  2548. continue;
  2549. case 2:
  2550. if (t !== 18) break;
  2551. a.content = i.bytes();
  2552. continue;
  2553. case 3:
  2554. if (t !== 24) break;
  2555. a.width = i.int32();
  2556. continue;
  2557. case 4:
  2558. if (t !== 32) break;
  2559. a.height = i.int32();
  2560. continue;
  2561. case 5:
  2562. if (t !== 40) break;
  2563. a.format = i.int32();
  2564. continue;
  2565. case 6:
  2566. if (t !== 50) break;
  2567. a.special_name = i.string();
  2568. continue
  2569. }
  2570. if ((t & 7) === 4 || t === 0) break;
  2571. i.skipType(t & 7)
  2572. }
  2573. return a
  2574. }, fromJSON(u) {
  2575. return {
  2576. compress: o(u.compress) ? globalThis.Boolean(u.compress) : !1,
  2577. content: o(u.content) ? z(u.content) : new Uint8Array(0),
  2578. width: o(u.width) ? globalThis.Number(u.width) : 0,
  2579. height: o(u.height) ? globalThis.Number(u.height) : 0,
  2580. format: o(u.format) ? Sa(u.format) : 0,
  2581. special_name: o(u.special_name) ? globalThis.String(u.special_name) : ""
  2582. }
  2583. }, toJSON(u) {
  2584. const e = {};
  2585. return u.compress !== !1 && (e.compress = u.compress), u.content.length !== 0 && (e.content = P(u.content)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.format !== 0 && (e.format = za(u.format)), u.special_name !== "" && (e.special_name = u.special_name), e
  2586. }, create(u) {
  2587. return W.fromPartial(u != null ? u : {})
  2588. }, fromPartial(u) {
  2589. var i, n, a, t, s, E;
  2590. const e = h3();
  2591. return e.compress = (i = u.compress) != null ? i : !1, e.content = (n = u.content) != null ? n : new Uint8Array(0), e.width = (a = u.width) != null ? a : 0, e.height = (t = u.height) != null ? t : 0, e.format = (s = u.format) != null ? s : 0, e.special_name = (E = u.special_name) != null ? E : "", e
  2592. }
  2593. };
  2594. function f3() {
  2595. return {clipboards: []}
  2596. }
  2597. const hu = {
  2598. encode(u, e = r.Writer.create()) {
  2599. for (const i of u.clipboards) W.encode(i, e.uint32(10).fork()).ldelim();
  2600. return e
  2601. }, decode(u, e) {
  2602. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2603. let n = e === void 0 ? i.len : i.pos + e;
  2604. const a = f3();
  2605. for (; i.pos < n;) {
  2606. const t = i.uint32();
  2607. switch (t >>> 3) {
  2608. case 1:
  2609. if (t !== 10) break;
  2610. a.clipboards.push(W.decode(i, i.uint32()));
  2611. continue
  2612. }
  2613. if ((t & 7) === 4 || t === 0) break;
  2614. i.skipType(t & 7)
  2615. }
  2616. return a
  2617. }, fromJSON(u) {
  2618. return {clipboards: globalThis.Array.isArray(u == null ? void 0 : u.clipboards) ? u.clipboards.map(e => W.fromJSON(e)) : []}
  2619. }, toJSON(u) {
  2620. var i;
  2621. const e = {};
  2622. return (i = u.clipboards) != null && i.length && (e.clipboards = u.clipboards.map(n => W.toJSON(n))), e
  2623. }, create(u) {
  2624. return hu.fromPartial(u != null ? u : {})
  2625. }, fromPartial(u) {
  2626. var i;
  2627. const e = f3();
  2628. return e.clipboards = ((i = u.clipboards) == null ? void 0 : i.map(n => W.fromPartial(n))) || [], e
  2629. }
  2630. };
  2631. function x3() {
  2632. return {entry_type: 0, name: "", is_hidden: !1, size: 0, modified_time: 0}
  2633. }
  2634. const V = {
  2635. encode(u, e = r.Writer.create()) {
  2636. return u.entry_type !== 0 && e.uint32(8).int32(u.entry_type), u.name !== "" && e.uint32(18).string(u.name), u.is_hidden !== !1 && e.uint32(24).bool(u.is_hidden), u.size !== 0 && e.uint32(32).uint64(u.size), u.modified_time !== 0 && e.uint32(40).uint64(u.modified_time), e
  2637. }, decode(u, e) {
  2638. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2639. let n = e === void 0 ? i.len : i.pos + e;
  2640. const a = x3();
  2641. for (; i.pos < n;) {
  2642. const t = i.uint32();
  2643. switch (t >>> 3) {
  2644. case 1:
  2645. if (t !== 8) break;
  2646. a.entry_type = i.int32();
  2647. continue;
  2648. case 2:
  2649. if (t !== 18) break;
  2650. a.name = i.string();
  2651. continue;
  2652. case 3:
  2653. if (t !== 24) break;
  2654. a.is_hidden = i.bool();
  2655. continue;
  2656. case 4:
  2657. if (t !== 32) break;
  2658. a.size = q(i.uint64());
  2659. continue;
  2660. case 5:
  2661. if (t !== 40) break;
  2662. a.modified_time = q(i.uint64());
  2663. continue
  2664. }
  2665. if ((t & 7) === 4 || t === 0) break;
  2666. i.skipType(t & 7)
  2667. }
  2668. return a
  2669. }, fromJSON(u) {
  2670. return {
  2671. entry_type: o(u.entry_type) ? Pa(u.entry_type) : 0,
  2672. name: o(u.name) ? globalThis.String(u.name) : "",
  2673. is_hidden: o(u.is_hidden) ? globalThis.Boolean(u.is_hidden) : !1,
  2674. size: o(u.size) ? globalThis.Number(u.size) : 0,
  2675. modified_time: o(u.modified_time) ? globalThis.Number(u.modified_time) : 0
  2676. }
  2677. }, toJSON(u) {
  2678. const e = {};
  2679. return u.entry_type !== 0 && (e.entry_type = Ra(u.entry_type)), u.name !== "" && (e.name = u.name), u.is_hidden !== !1 && (e.is_hidden = u.is_hidden), u.size !== 0 && (e.size = Math.round(u.size)), u.modified_time !== 0 && (e.modified_time = Math.round(u.modified_time)), e
  2680. }, create(u) {
  2681. return V.fromPartial(u != null ? u : {})
  2682. }, fromPartial(u) {
  2683. var i, n, a, t, s;
  2684. const e = x3();
  2685. return e.entry_type = (i = u.entry_type) != null ? i : 0, e.name = (n = u.name) != null ? n : "", e.is_hidden = (a = u.is_hidden) != null ? a : !1, e.size = (t = u.size) != null ? t : 0, e.modified_time = (s = u.modified_time) != null ? s : 0, e
  2686. }
  2687. };
  2688. function y3() {
  2689. return {id: 0, path: "", entries: []}
  2690. }
  2691. const eu = {
  2692. encode(u, e = r.Writer.create()) {
  2693. u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path);
  2694. for (const i of u.entries) V.encode(i, e.uint32(26).fork()).ldelim();
  2695. return e
  2696. }, decode(u, e) {
  2697. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2698. let n = e === void 0 ? i.len : i.pos + e;
  2699. const a = y3();
  2700. for (; i.pos < n;) {
  2701. const t = i.uint32();
  2702. switch (t >>> 3) {
  2703. case 1:
  2704. if (t !== 8) break;
  2705. a.id = i.int32();
  2706. continue;
  2707. case 2:
  2708. if (t !== 18) break;
  2709. a.path = i.string();
  2710. continue;
  2711. case 3:
  2712. if (t !== 26) break;
  2713. a.entries.push(V.decode(i, i.uint32()));
  2714. continue
  2715. }
  2716. if ((t & 7) === 4 || t === 0) break;
  2717. i.skipType(t & 7)
  2718. }
  2719. return a
  2720. }, fromJSON(u) {
  2721. return {
  2722. id: o(u.id) ? globalThis.Number(u.id) : 0,
  2723. path: o(u.path) ? globalThis.String(u.path) : "",
  2724. entries: globalThis.Array.isArray(u == null ? void 0 : u.entries) ? u.entries.map(e => V.fromJSON(e)) : []
  2725. }
  2726. }, toJSON(u) {
  2727. var i;
  2728. const e = {};
  2729. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), (i = u.entries) != null && i.length && (e.entries = u.entries.map(n => V.toJSON(n))), e
  2730. }, create(u) {
  2731. return eu.fromPartial(u != null ? u : {})
  2732. }, fromPartial(u) {
  2733. var i, n, a;
  2734. const e = y3();
  2735. return e.id = (i = u.id) != null ? i : 0, e.path = (n = u.path) != null ? n : "", e.entries = ((a = u.entries) == null ? void 0 : a.map(t => V.fromPartial(t))) || [], e
  2736. }
  2737. };
  2738. function b3() {
  2739. return {path: "", include_hidden: !1}
  2740. }
  2741. const fu = {
  2742. encode(u, e = r.Writer.create()) {
  2743. return u.path !== "" && e.uint32(10).string(u.path), u.include_hidden !== !1 && e.uint32(16).bool(u.include_hidden), e
  2744. }, decode(u, e) {
  2745. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2746. let n = e === void 0 ? i.len : i.pos + e;
  2747. const a = b3();
  2748. for (; i.pos < n;) {
  2749. const t = i.uint32();
  2750. switch (t >>> 3) {
  2751. case 1:
  2752. if (t !== 10) break;
  2753. a.path = i.string();
  2754. continue;
  2755. case 2:
  2756. if (t !== 16) break;
  2757. a.include_hidden = i.bool();
  2758. continue
  2759. }
  2760. if ((t & 7) === 4 || t === 0) break;
  2761. i.skipType(t & 7)
  2762. }
  2763. return a
  2764. }, fromJSON(u) {
  2765. return {
  2766. path: o(u.path) ? globalThis.String(u.path) : "",
  2767. include_hidden: o(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2768. }
  2769. }, toJSON(u) {
  2770. const e = {};
  2771. return u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2772. }, create(u) {
  2773. return fu.fromPartial(u != null ? u : {})
  2774. }, fromPartial(u) {
  2775. var i, n;
  2776. const e = b3();
  2777. return e.path = (i = u.path) != null ? i : "", e.include_hidden = (n = u.include_hidden) != null ? n : !1, e
  2778. }
  2779. };
  2780. function w3() {
  2781. return {path: "", include_hidden: !1}
  2782. }
  2783. const xu = {
  2784. encode(u, e = r.Writer.create()) {
  2785. return u.path !== "" && e.uint32(10).string(u.path), u.include_hidden !== !1 && e.uint32(16).bool(u.include_hidden), e
  2786. }, decode(u, e) {
  2787. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2788. let n = e === void 0 ? i.len : i.pos + e;
  2789. const a = w3();
  2790. for (; i.pos < n;) {
  2791. const t = i.uint32();
  2792. switch (t >>> 3) {
  2793. case 1:
  2794. if (t !== 10) break;
  2795. a.path = i.string();
  2796. continue;
  2797. case 2:
  2798. if (t !== 16) break;
  2799. a.include_hidden = i.bool();
  2800. continue
  2801. }
  2802. if ((t & 7) === 4 || t === 0) break;
  2803. i.skipType(t & 7)
  2804. }
  2805. return a
  2806. }, fromJSON(u) {
  2807. return {
  2808. path: o(u.path) ? globalThis.String(u.path) : "",
  2809. include_hidden: o(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2810. }
  2811. }, toJSON(u) {
  2812. const e = {};
  2813. return u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2814. }, create(u) {
  2815. return xu.fromPartial(u != null ? u : {})
  2816. }, fromPartial(u) {
  2817. var i, n;
  2818. const e = w3();
  2819. return e.path = (i = u.path) != null ? i : "", e.include_hidden = (n = u.include_hidden) != null ? n : !1, e
  2820. }
  2821. };
  2822. function S3() {
  2823. return {path: "", empty_dirs: []}
  2824. }
  2825. const h0 = {
  2826. encode(u, e = r.Writer.create()) {
  2827. u.path !== "" && e.uint32(10).string(u.path);
  2828. for (const i of u.empty_dirs) eu.encode(i, e.uint32(18).fork()).ldelim();
  2829. return e
  2830. }, decode(u, e) {
  2831. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2832. let n = e === void 0 ? i.len : i.pos + e;
  2833. const a = S3();
  2834. for (; i.pos < n;) {
  2835. const t = i.uint32();
  2836. switch (t >>> 3) {
  2837. case 1:
  2838. if (t !== 10) break;
  2839. a.path = i.string();
  2840. continue;
  2841. case 2:
  2842. if (t !== 18) break;
  2843. a.empty_dirs.push(eu.decode(i, i.uint32()));
  2844. continue
  2845. }
  2846. if ((t & 7) === 4 || t === 0) break;
  2847. i.skipType(t & 7)
  2848. }
  2849. return a
  2850. }, fromJSON(u) {
  2851. return {
  2852. path: o(u.path) ? globalThis.String(u.path) : "",
  2853. empty_dirs: globalThis.Array.isArray(u == null ? void 0 : u.empty_dirs) ? u.empty_dirs.map(e => eu.fromJSON(e)) : []
  2854. }
  2855. }, toJSON(u) {
  2856. var i;
  2857. const e = {};
  2858. return u.path !== "" && (e.path = u.path), (i = u.empty_dirs) != null && i.length && (e.empty_dirs = u.empty_dirs.map(n => eu.toJSON(n))), e
  2859. }, create(u) {
  2860. return h0.fromPartial(u != null ? u : {})
  2861. }, fromPartial(u) {
  2862. var i, n;
  2863. const e = S3();
  2864. return e.path = (i = u.path) != null ? i : "", e.empty_dirs = ((n = u.empty_dirs) == null ? void 0 : n.map(a => eu.fromPartial(a))) || [], e
  2865. }
  2866. };
  2867. function z3() {
  2868. return {id: 0, path: "", include_hidden: !1}
  2869. }
  2870. const yu = {
  2871. encode(u, e = r.Writer.create()) {
  2872. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.include_hidden !== !1 && e.uint32(24).bool(u.include_hidden), e
  2873. }, decode(u, e) {
  2874. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2875. let n = e === void 0 ? i.len : i.pos + e;
  2876. const a = z3();
  2877. for (; i.pos < n;) {
  2878. const t = i.uint32();
  2879. switch (t >>> 3) {
  2880. case 1:
  2881. if (t !== 8) break;
  2882. a.id = i.int32();
  2883. continue;
  2884. case 2:
  2885. if (t !== 18) break;
  2886. a.path = i.string();
  2887. continue;
  2888. case 3:
  2889. if (t !== 24) break;
  2890. a.include_hidden = i.bool();
  2891. continue
  2892. }
  2893. if ((t & 7) === 4 || t === 0) break;
  2894. i.skipType(t & 7)
  2895. }
  2896. return a
  2897. }, fromJSON(u) {
  2898. return {
  2899. id: o(u.id) ? globalThis.Number(u.id) : 0,
  2900. path: o(u.path) ? globalThis.String(u.path) : "",
  2901. include_hidden: o(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2902. }
  2903. }, toJSON(u) {
  2904. const e = {};
  2905. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2906. }, create(u) {
  2907. return yu.fromPartial(u != null ? u : {})
  2908. }, fromPartial(u) {
  2909. var i, n, a;
  2910. const e = z3();
  2911. return e.id = (i = u.id) != null ? i : 0, e.path = (n = u.path) != null ? n : "", e.include_hidden = (a = u.include_hidden) != null ? a : !1, e
  2912. }
  2913. };
  2914. function P3() {
  2915. return {id: 0, path: "", new_name: ""}
  2916. }
  2917. const bu = {
  2918. encode(u, e = r.Writer.create()) {
  2919. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.new_name !== "" && e.uint32(26).string(u.new_name), e
  2920. }, decode(u, e) {
  2921. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2922. let n = e === void 0 ? i.len : i.pos + e;
  2923. const a = P3();
  2924. for (; i.pos < n;) {
  2925. const t = i.uint32();
  2926. switch (t >>> 3) {
  2927. case 1:
  2928. if (t !== 8) break;
  2929. a.id = i.int32();
  2930. continue;
  2931. case 2:
  2932. if (t !== 18) break;
  2933. a.path = i.string();
  2934. continue;
  2935. case 3:
  2936. if (t !== 26) break;
  2937. a.new_name = i.string();
  2938. continue
  2939. }
  2940. if ((t & 7) === 4 || t === 0) break;
  2941. i.skipType(t & 7)
  2942. }
  2943. return a
  2944. }, fromJSON(u) {
  2945. return {
  2946. id: o(u.id) ? globalThis.Number(u.id) : 0,
  2947. path: o(u.path) ? globalThis.String(u.path) : "",
  2948. new_name: o(u.new_name) ? globalThis.String(u.new_name) : ""
  2949. }
  2950. }, toJSON(u) {
  2951. const e = {};
  2952. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.new_name !== "" && (e.new_name = u.new_name), e
  2953. }, create(u) {
  2954. return bu.fromPartial(u != null ? u : {})
  2955. }, fromPartial(u) {
  2956. var i, n, a;
  2957. const e = P3();
  2958. return e.id = (i = u.id) != null ? i : 0, e.path = (n = u.path) != null ? n : "", e.new_name = (a = u.new_name) != null ? a : "", e
  2959. }
  2960. };
  2961. function R3() {
  2962. return {
  2963. read_dir: void 0,
  2964. send: void 0,
  2965. receive: void 0,
  2966. create: void 0,
  2967. remove_dir: void 0,
  2968. remove_file: void 0,
  2969. all_files: void 0,
  2970. cancel: void 0,
  2971. send_confirm: void 0,
  2972. rename: void 0,
  2973. read_empty_dirs: void 0
  2974. }
  2975. }
  2976. const I = {
  2977. encode(u, e = r.Writer.create()) {
  2978. return u.read_dir !== void 0 && fu.encode(u.read_dir, e.uint32(10).fork()).ldelim(), u.send !== void 0 && Ru.encode(u.send, e.uint32(18).fork()).ldelim(), u.receive !== void 0 && Tu.encode(u.receive, e.uint32(26).fork()).ldelim(), u.create !== void 0 && Ou.encode(u.create, e.uint32(34).fork()).ldelim(), u.remove_dir !== void 0 && ju.encode(u.remove_dir, e.uint32(42).fork()).ldelim(), u.remove_file !== void 0 && Nu.encode(u.remove_file, e.uint32(50).fork()).ldelim(), u.all_files !== void 0 && yu.encode(u.all_files, e.uint32(58).fork()).ldelim(), u.cancel !== void 0 && wu.encode(u.cancel, e.uint32(66).fork()).ldelim(), u.send_confirm !== void 0 && du.encode(u.send_confirm, e.uint32(74).fork()).ldelim(), u.rename !== void 0 && bu.encode(u.rename, e.uint32(82).fork()).ldelim(), u.read_empty_dirs !== void 0 && xu.encode(u.read_empty_dirs, e.uint32(90).fork()).ldelim(), e
  2979. }, decode(u, e) {
  2980. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2981. let n = e === void 0 ? i.len : i.pos + e;
  2982. const a = R3();
  2983. for (; i.pos < n;) {
  2984. const t = i.uint32();
  2985. switch (t >>> 3) {
  2986. case 1:
  2987. if (t !== 10) break;
  2988. a.read_dir = fu.decode(i, i.uint32());
  2989. continue;
  2990. case 2:
  2991. if (t !== 18) break;
  2992. a.send = Ru.decode(i, i.uint32());
  2993. continue;
  2994. case 3:
  2995. if (t !== 26) break;
  2996. a.receive = Tu.decode(i, i.uint32());
  2997. continue;
  2998. case 4:
  2999. if (t !== 34) break;
  3000. a.create = Ou.decode(i, i.uint32());
  3001. continue;
  3002. case 5:
  3003. if (t !== 42) break;
  3004. a.remove_dir = ju.decode(i, i.uint32());
  3005. continue;
  3006. case 6:
  3007. if (t !== 50) break;
  3008. a.remove_file = Nu.decode(i, i.uint32());
  3009. continue;
  3010. case 7:
  3011. if (t !== 58) break;
  3012. a.all_files = yu.decode(i, i.uint32());
  3013. continue;
  3014. case 8:
  3015. if (t !== 66) break;
  3016. a.cancel = wu.decode(i, i.uint32());
  3017. continue;
  3018. case 9:
  3019. if (t !== 74) break;
  3020. a.send_confirm = du.decode(i, i.uint32());
  3021. continue;
  3022. case 10:
  3023. if (t !== 82) break;
  3024. a.rename = bu.decode(i, i.uint32());
  3025. continue;
  3026. case 11:
  3027. if (t !== 90) break;
  3028. a.read_empty_dirs = xu.decode(i, i.uint32());
  3029. continue
  3030. }
  3031. if ((t & 7) === 4 || t === 0) break;
  3032. i.skipType(t & 7)
  3033. }
  3034. return a
  3035. }, fromJSON(u) {
  3036. return {
  3037. read_dir: o(u.read_dir) ? fu.fromJSON(u.read_dir) : void 0,
  3038. send: o(u.send) ? Ru.fromJSON(u.send) : void 0,
  3039. receive: o(u.receive) ? Tu.fromJSON(u.receive) : void 0,
  3040. create: o(u.create) ? Ou.fromJSON(u.create) : void 0,
  3041. remove_dir: o(u.remove_dir) ? ju.fromJSON(u.remove_dir) : void 0,
  3042. remove_file: o(u.remove_file) ? Nu.fromJSON(u.remove_file) : void 0,
  3043. all_files: o(u.all_files) ? yu.fromJSON(u.all_files) : void 0,
  3044. cancel: o(u.cancel) ? wu.fromJSON(u.cancel) : void 0,
  3045. send_confirm: o(u.send_confirm) ? du.fromJSON(u.send_confirm) : void 0,
  3046. rename: o(u.rename) ? bu.fromJSON(u.rename) : void 0,
  3047. read_empty_dirs: o(u.read_empty_dirs) ? xu.fromJSON(u.read_empty_dirs) : void 0
  3048. }
  3049. }, toJSON(u) {
  3050. const e = {};
  3051. return u.read_dir !== void 0 && (e.read_dir = fu.toJSON(u.read_dir)), u.send !== void 0 && (e.send = Ru.toJSON(u.send)), u.receive !== void 0 && (e.receive = Tu.toJSON(u.receive)), u.create !== void 0 && (e.create = Ou.toJSON(u.create)), u.remove_dir !== void 0 && (e.remove_dir = ju.toJSON(u.remove_dir)), u.remove_file !== void 0 && (e.remove_file = Nu.toJSON(u.remove_file)), u.all_files !== void 0 && (e.all_files = yu.toJSON(u.all_files)), u.cancel !== void 0 && (e.cancel = wu.toJSON(u.cancel)), u.send_confirm !== void 0 && (e.send_confirm = du.toJSON(u.send_confirm)), u.rename !== void 0 && (e.rename = bu.toJSON(u.rename)), u.read_empty_dirs !== void 0 && (e.read_empty_dirs = xu.toJSON(u.read_empty_dirs)), e
  3052. }, create(u) {
  3053. return I.fromPartial(u != null ? u : {})
  3054. }, fromPartial(u) {
  3055. const e = R3();
  3056. return e.read_dir = u.read_dir !== void 0 && u.read_dir !== null ? fu.fromPartial(u.read_dir) : void 0, e.send = u.send !== void 0 && u.send !== null ? Ru.fromPartial(u.send) : void 0, e.receive = u.receive !== void 0 && u.receive !== null ? Tu.fromPartial(u.receive) : void 0, e.create = u.create !== void 0 && u.create !== null ? Ou.fromPartial(u.create) : void 0, e.remove_dir = u.remove_dir !== void 0 && u.remove_dir !== null ? ju.fromPartial(u.remove_dir) : void 0, e.remove_file = u.remove_file !== void 0 && u.remove_file !== null ? Nu.fromPartial(u.remove_file) : void 0, e.all_files = u.all_files !== void 0 && u.all_files !== null ? yu.fromPartial(u.all_files) : void 0, e.cancel = u.cancel !== void 0 && u.cancel !== null ? wu.fromPartial(u.cancel) : void 0, e.send_confirm = u.send_confirm !== void 0 && u.send_confirm !== null ? du.fromPartial(u.send_confirm) : void 0, e.rename = u.rename !== void 0 && u.rename !== null ? bu.fromPartial(u.rename) : void 0, e.read_empty_dirs = u.read_empty_dirs !== void 0 && u.read_empty_dirs !== null ? xu.fromPartial(u.read_empty_dirs) : void 0, e
  3057. }
  3058. };
  3059. function I3() {
  3060. return {id: 0}
  3061. }
  3062. const wu = {
  3063. encode(u, e = r.Writer.create()) {
  3064. return u.id !== 0 && e.uint32(8).int32(u.id), e
  3065. }, decode(u, e) {
  3066. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3067. let n = e === void 0 ? i.len : i.pos + e;
  3068. const a = I3();
  3069. for (; i.pos < n;) {
  3070. const t = i.uint32();
  3071. switch (t >>> 3) {
  3072. case 1:
  3073. if (t !== 8) break;
  3074. a.id = i.int32();
  3075. continue
  3076. }
  3077. if ((t & 7) === 4 || t === 0) break;
  3078. i.skipType(t & 7)
  3079. }
  3080. return a
  3081. }, fromJSON(u) {
  3082. return {id: o(u.id) ? globalThis.Number(u.id) : 0}
  3083. }, toJSON(u) {
  3084. const e = {};
  3085. return u.id !== 0 && (e.id = Math.round(u.id)), e
  3086. }, create(u) {
  3087. return wu.fromPartial(u != null ? u : {})
  3088. }, fromPartial(u) {
  3089. var i;
  3090. const e = I3();
  3091. return e.id = (i = u.id) != null ? i : 0, e
  3092. }
  3093. };
  3094. function T3() {
  3095. return {dir: void 0, block: void 0, error: void 0, done: void 0, digest: void 0, empty_dirs: void 0}
  3096. }
  3097. const ou = {
  3098. encode(u, e = r.Writer.create()) {
  3099. return u.dir !== void 0 && eu.encode(u.dir, e.uint32(10).fork()).ldelim(), u.block !== void 0 && zu.encode(u.block, e.uint32(18).fork()).ldelim(), u.error !== void 0 && Pu.encode(u.error, e.uint32(26).fork()).ldelim(), u.done !== void 0 && Iu.encode(u.done, e.uint32(34).fork()).ldelim(), u.digest !== void 0 && Su.encode(u.digest, e.uint32(42).fork()).ldelim(), u.empty_dirs !== void 0 && h0.encode(u.empty_dirs, e.uint32(50).fork()).ldelim(), e
  3100. }, decode(u, e) {
  3101. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3102. let n = e === void 0 ? i.len : i.pos + e;
  3103. const a = T3();
  3104. for (; i.pos < n;) {
  3105. const t = i.uint32();
  3106. switch (t >>> 3) {
  3107. case 1:
  3108. if (t !== 10) break;
  3109. a.dir = eu.decode(i, i.uint32());
  3110. continue;
  3111. case 2:
  3112. if (t !== 18) break;
  3113. a.block = zu.decode(i, i.uint32());
  3114. continue;
  3115. case 3:
  3116. if (t !== 26) break;
  3117. a.error = Pu.decode(i, i.uint32());
  3118. continue;
  3119. case 4:
  3120. if (t !== 34) break;
  3121. a.done = Iu.decode(i, i.uint32());
  3122. continue;
  3123. case 5:
  3124. if (t !== 42) break;
  3125. a.digest = Su.decode(i, i.uint32());
  3126. continue;
  3127. case 6:
  3128. if (t !== 50) break;
  3129. a.empty_dirs = h0.decode(i, i.uint32());
  3130. continue
  3131. }
  3132. if ((t & 7) === 4 || t === 0) break;
  3133. i.skipType(t & 7)
  3134. }
  3135. return a
  3136. }, fromJSON(u) {
  3137. return {
  3138. dir: o(u.dir) ? eu.fromJSON(u.dir) : void 0,
  3139. block: o(u.block) ? zu.fromJSON(u.block) : void 0,
  3140. error: o(u.error) ? Pu.fromJSON(u.error) : void 0,
  3141. done: o(u.done) ? Iu.fromJSON(u.done) : void 0,
  3142. digest: o(u.digest) ? Su.fromJSON(u.digest) : void 0,
  3143. empty_dirs: o(u.empty_dirs) ? h0.fromJSON(u.empty_dirs) : void 0
  3144. }
  3145. }, toJSON(u) {
  3146. const e = {};
  3147. return u.dir !== void 0 && (e.dir = eu.toJSON(u.dir)), u.block !== void 0 && (e.block = zu.toJSON(u.block)), u.error !== void 0 && (e.error = Pu.toJSON(u.error)), u.done !== void 0 && (e.done = Iu.toJSON(u.done)), u.digest !== void 0 && (e.digest = Su.toJSON(u.digest)), u.empty_dirs !== void 0 && (e.empty_dirs = h0.toJSON(u.empty_dirs)), e
  3148. }, create(u) {
  3149. return ou.fromPartial(u != null ? u : {})
  3150. }, fromPartial(u) {
  3151. const e = T3();
  3152. return e.dir = u.dir !== void 0 && u.dir !== null ? eu.fromPartial(u.dir) : void 0, e.block = u.block !== void 0 && u.block !== null ? zu.fromPartial(u.block) : void 0, e.error = u.error !== void 0 && u.error !== null ? Pu.fromPartial(u.error) : void 0, e.done = u.done !== void 0 && u.done !== null ? Iu.fromPartial(u.done) : void 0, e.digest = u.digest !== void 0 && u.digest !== null ? Su.fromPartial(u.digest) : void 0, e.empty_dirs = u.empty_dirs !== void 0 && u.empty_dirs !== null ? h0.fromPartial(u.empty_dirs) : void 0, e
  3153. }
  3154. };
  3155. function j3() {
  3156. return {id: 0, file_num: 0, last_modified: 0, file_size: 0, is_upload: !1, is_identical: !1}
  3157. }
  3158. const Su = {
  3159. encode(u, e = r.Writer.create()) {
  3160. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), u.last_modified !== 0 && e.uint32(24).uint64(u.last_modified), u.file_size !== 0 && e.uint32(32).uint64(u.file_size), u.is_upload !== !1 && e.uint32(40).bool(u.is_upload), u.is_identical !== !1 && e.uint32(48).bool(u.is_identical), e
  3161. }, decode(u, e) {
  3162. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3163. let n = e === void 0 ? i.len : i.pos + e;
  3164. const a = j3();
  3165. for (; i.pos < n;) {
  3166. const t = i.uint32();
  3167. switch (t >>> 3) {
  3168. case 1:
  3169. if (t !== 8) break;
  3170. a.id = i.int32();
  3171. continue;
  3172. case 2:
  3173. if (t !== 16) break;
  3174. a.file_num = i.sint32();
  3175. continue;
  3176. case 3:
  3177. if (t !== 24) break;
  3178. a.last_modified = q(i.uint64());
  3179. continue;
  3180. case 4:
  3181. if (t !== 32) break;
  3182. a.file_size = q(i.uint64());
  3183. continue;
  3184. case 5:
  3185. if (t !== 40) break;
  3186. a.is_upload = i.bool();
  3187. continue;
  3188. case 6:
  3189. if (t !== 48) break;
  3190. a.is_identical = i.bool();
  3191. continue
  3192. }
  3193. if ((t & 7) === 4 || t === 0) break;
  3194. i.skipType(t & 7)
  3195. }
  3196. return a
  3197. }, fromJSON(u) {
  3198. return {
  3199. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3200. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3201. last_modified: o(u.last_modified) ? globalThis.Number(u.last_modified) : 0,
  3202. file_size: o(u.file_size) ? globalThis.Number(u.file_size) : 0,
  3203. is_upload: o(u.is_upload) ? globalThis.Boolean(u.is_upload) : !1,
  3204. is_identical: o(u.is_identical) ? globalThis.Boolean(u.is_identical) : !1
  3205. }
  3206. }, toJSON(u) {
  3207. const e = {};
  3208. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.last_modified !== 0 && (e.last_modified = Math.round(u.last_modified)), u.file_size !== 0 && (e.file_size = Math.round(u.file_size)), u.is_upload !== !1 && (e.is_upload = u.is_upload), u.is_identical !== !1 && (e.is_identical = u.is_identical), e
  3209. }, create(u) {
  3210. return Su.fromPartial(u != null ? u : {})
  3211. }, fromPartial(u) {
  3212. var i, n, a, t, s, E;
  3213. const e = j3();
  3214. return e.id = (i = u.id) != null ? i : 0, e.file_num = (n = u.file_num) != null ? n : 0, e.last_modified = (a = u.last_modified) != null ? a : 0, e.file_size = (t = u.file_size) != null ? t : 0, e.is_upload = (s = u.is_upload) != null ? s : !1, e.is_identical = (E = u.is_identical) != null ? E : !1, e
  3215. }
  3216. };
  3217. function N3() {
  3218. return {id: 0, file_num: 0, data: new Uint8Array(0), compressed: !1, blk_id: 0}
  3219. }
  3220. const zu = {
  3221. encode(u, e = r.Writer.create()) {
  3222. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), u.data.length !== 0 && e.uint32(26).bytes(u.data), u.compressed !== !1 && e.uint32(32).bool(u.compressed), u.blk_id !== 0 && e.uint32(40).uint32(u.blk_id), e
  3223. }, decode(u, e) {
  3224. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3225. let n = e === void 0 ? i.len : i.pos + e;
  3226. const a = N3();
  3227. for (; i.pos < n;) {
  3228. const t = i.uint32();
  3229. switch (t >>> 3) {
  3230. case 1:
  3231. if (t !== 8) break;
  3232. a.id = i.int32();
  3233. continue;
  3234. case 2:
  3235. if (t !== 16) break;
  3236. a.file_num = i.sint32();
  3237. continue;
  3238. case 3:
  3239. if (t !== 26) break;
  3240. a.data = i.bytes();
  3241. continue;
  3242. case 4:
  3243. if (t !== 32) break;
  3244. a.compressed = i.bool();
  3245. continue;
  3246. case 5:
  3247. if (t !== 40) break;
  3248. a.blk_id = i.uint32();
  3249. continue
  3250. }
  3251. if ((t & 7) === 4 || t === 0) break;
  3252. i.skipType(t & 7)
  3253. }
  3254. return a
  3255. }, fromJSON(u) {
  3256. return {
  3257. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3258. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3259. data: o(u.data) ? z(u.data) : new Uint8Array(0),
  3260. compressed: o(u.compressed) ? globalThis.Boolean(u.compressed) : !1,
  3261. blk_id: o(u.blk_id) ? globalThis.Number(u.blk_id) : 0
  3262. }
  3263. }, toJSON(u) {
  3264. const e = {};
  3265. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.data.length !== 0 && (e.data = P(u.data)), u.compressed !== !1 && (e.compressed = u.compressed), u.blk_id !== 0 && (e.blk_id = Math.round(u.blk_id)), e
  3266. }, create(u) {
  3267. return zu.fromPartial(u != null ? u : {})
  3268. }, fromPartial(u) {
  3269. var i, n, a, t, s;
  3270. const e = N3();
  3271. return e.id = (i = u.id) != null ? i : 0, e.file_num = (n = u.file_num) != null ? n : 0, e.data = (a = u.data) != null ? a : new Uint8Array(0), e.compressed = (t = u.compressed) != null ? t : !1, e.blk_id = (s = u.blk_id) != null ? s : 0, e
  3272. }
  3273. };
  3274. function O3() {
  3275. return {id: 0, error: "", file_num: 0}
  3276. }
  3277. const Pu = {
  3278. encode(u, e = r.Writer.create()) {
  3279. return u.id !== 0 && e.uint32(8).int32(u.id), u.error !== "" && e.uint32(18).string(u.error), u.file_num !== 0 && e.uint32(24).sint32(u.file_num), e
  3280. }, decode(u, e) {
  3281. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3282. let n = e === void 0 ? i.len : i.pos + e;
  3283. const a = O3();
  3284. for (; i.pos < n;) {
  3285. const t = i.uint32();
  3286. switch (t >>> 3) {
  3287. case 1:
  3288. if (t !== 8) break;
  3289. a.id = i.int32();
  3290. continue;
  3291. case 2:
  3292. if (t !== 18) break;
  3293. a.error = i.string();
  3294. continue;
  3295. case 3:
  3296. if (t !== 24) break;
  3297. a.file_num = i.sint32();
  3298. continue
  3299. }
  3300. if ((t & 7) === 4 || t === 0) break;
  3301. i.skipType(t & 7)
  3302. }
  3303. return a
  3304. }, fromJSON(u) {
  3305. return {
  3306. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3307. error: o(u.error) ? globalThis.String(u.error) : "",
  3308. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0
  3309. }
  3310. }, toJSON(u) {
  3311. const e = {};
  3312. return u.id !== 0 && (e.id = Math.round(u.id)), u.error !== "" && (e.error = u.error), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3313. }, create(u) {
  3314. return Pu.fromPartial(u != null ? u : {})
  3315. }, fromPartial(u) {
  3316. var i, n, a;
  3317. const e = O3();
  3318. return e.id = (i = u.id) != null ? i : 0, e.error = (n = u.error) != null ? n : "", e.file_num = (a = u.file_num) != null ? a : 0, e
  3319. }
  3320. };
  3321. function U3() {
  3322. return {id: 0, path: "", include_hidden: !1, file_num: 0, file_type: 0}
  3323. }
  3324. const Ru = {
  3325. encode(u, e = r.Writer.create()) {
  3326. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.include_hidden !== !1 && e.uint32(24).bool(u.include_hidden), u.file_num !== 0 && e.uint32(32).int32(u.file_num), u.file_type !== 0 && e.uint32(40).int32(u.file_type), e
  3327. }, decode(u, e) {
  3328. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3329. let n = e === void 0 ? i.len : i.pos + e;
  3330. const a = U3();
  3331. for (; i.pos < n;) {
  3332. const t = i.uint32();
  3333. switch (t >>> 3) {
  3334. case 1:
  3335. if (t !== 8) break;
  3336. a.id = i.int32();
  3337. continue;
  3338. case 2:
  3339. if (t !== 18) break;
  3340. a.path = i.string();
  3341. continue;
  3342. case 3:
  3343. if (t !== 24) break;
  3344. a.include_hidden = i.bool();
  3345. continue;
  3346. case 4:
  3347. if (t !== 32) break;
  3348. a.file_num = i.int32();
  3349. continue;
  3350. case 5:
  3351. if (t !== 40) break;
  3352. a.file_type = i.int32();
  3353. continue
  3354. }
  3355. if ((t & 7) === 4 || t === 0) break;
  3356. i.skipType(t & 7)
  3357. }
  3358. return a
  3359. }, fromJSON(u) {
  3360. return {
  3361. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3362. path: o(u.path) ? globalThis.String(u.path) : "",
  3363. include_hidden: o(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1,
  3364. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3365. file_type: o(u.file_type) ? ja(u.file_type) : 0
  3366. }
  3367. }, toJSON(u) {
  3368. const e = {};
  3369. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.file_type !== 0 && (e.file_type = Na(u.file_type)), e
  3370. }, create(u) {
  3371. return Ru.fromPartial(u != null ? u : {})
  3372. }, fromPartial(u) {
  3373. var i, n, a, t, s;
  3374. const e = U3();
  3375. return e.id = (i = u.id) != null ? i : 0, e.path = (n = u.path) != null ? n : "", e.include_hidden = (a = u.include_hidden) != null ? a : !1, e.file_num = (t = u.file_num) != null ? t : 0, e.file_type = (s = u.file_type) != null ? s : 0, e
  3376. }
  3377. };
  3378. function M3() {
  3379. return {id: 0, file_num: 0, skip: void 0, offset_blk: void 0}
  3380. }
  3381. const du = {
  3382. encode(u, e = r.Writer.create()) {
  3383. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), u.skip !== void 0 && e.uint32(24).bool(u.skip), u.offset_blk !== void 0 && e.uint32(32).uint32(u.offset_blk), e
  3384. }, decode(u, e) {
  3385. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3386. let n = e === void 0 ? i.len : i.pos + e;
  3387. const a = M3();
  3388. for (; i.pos < n;) {
  3389. const t = i.uint32();
  3390. switch (t >>> 3) {
  3391. case 1:
  3392. if (t !== 8) break;
  3393. a.id = i.int32();
  3394. continue;
  3395. case 2:
  3396. if (t !== 16) break;
  3397. a.file_num = i.sint32();
  3398. continue;
  3399. case 3:
  3400. if (t !== 24) break;
  3401. a.skip = i.bool();
  3402. continue;
  3403. case 4:
  3404. if (t !== 32) break;
  3405. a.offset_blk = i.uint32();
  3406. continue
  3407. }
  3408. if ((t & 7) === 4 || t === 0) break;
  3409. i.skipType(t & 7)
  3410. }
  3411. return a
  3412. }, fromJSON(u) {
  3413. return {
  3414. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3415. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3416. skip: o(u.skip) ? globalThis.Boolean(u.skip) : void 0,
  3417. offset_blk: o(u.offset_blk) ? globalThis.Number(u.offset_blk) : void 0
  3418. }
  3419. }, toJSON(u) {
  3420. const e = {};
  3421. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.skip !== void 0 && (e.skip = u.skip), u.offset_blk !== void 0 && (e.offset_blk = Math.round(u.offset_blk)), e
  3422. }, create(u) {
  3423. return du.fromPartial(u != null ? u : {})
  3424. }, fromPartial(u) {
  3425. var i, n, a, t;
  3426. const e = M3();
  3427. return e.id = (i = u.id) != null ? i : 0, e.file_num = (n = u.file_num) != null ? n : 0, e.skip = (a = u.skip) != null ? a : void 0, e.offset_blk = (t = u.offset_blk) != null ? t : void 0, e
  3428. }
  3429. };
  3430. function L3() {
  3431. return {id: 0, file_num: 0}
  3432. }
  3433. const Iu = {
  3434. encode(u, e = r.Writer.create()) {
  3435. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), e
  3436. }, decode(u, e) {
  3437. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3438. let n = e === void 0 ? i.len : i.pos + e;
  3439. const a = L3();
  3440. for (; i.pos < n;) {
  3441. const t = i.uint32();
  3442. switch (t >>> 3) {
  3443. case 1:
  3444. if (t !== 8) break;
  3445. a.id = i.int32();
  3446. continue;
  3447. case 2:
  3448. if (t !== 16) break;
  3449. a.file_num = i.sint32();
  3450. continue
  3451. }
  3452. if ((t & 7) === 4 || t === 0) break;
  3453. i.skipType(t & 7)
  3454. }
  3455. return a
  3456. }, fromJSON(u) {
  3457. return {id: o(u.id) ? globalThis.Number(u.id) : 0, file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0}
  3458. }, toJSON(u) {
  3459. const e = {};
  3460. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3461. }, create(u) {
  3462. return Iu.fromPartial(u != null ? u : {})
  3463. }, fromPartial(u) {
  3464. var i, n;
  3465. const e = L3();
  3466. return e.id = (i = u.id) != null ? i : 0, e.file_num = (n = u.file_num) != null ? n : 0, e
  3467. }
  3468. };
  3469. function W3() {
  3470. return {id: 0, path: "", files: [], file_num: 0, total_size: 0}
  3471. }
  3472. const Tu = {
  3473. encode(u, e = r.Writer.create()) {
  3474. u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path);
  3475. for (const i of u.files) V.encode(i, e.uint32(26).fork()).ldelim();
  3476. return u.file_num !== 0 && e.uint32(32).int32(u.file_num), u.total_size !== 0 && e.uint32(40).uint64(u.total_size), e
  3477. }, decode(u, e) {
  3478. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3479. let n = e === void 0 ? i.len : i.pos + e;
  3480. const a = W3();
  3481. for (; i.pos < n;) {
  3482. const t = i.uint32();
  3483. switch (t >>> 3) {
  3484. case 1:
  3485. if (t !== 8) break;
  3486. a.id = i.int32();
  3487. continue;
  3488. case 2:
  3489. if (t !== 18) break;
  3490. a.path = i.string();
  3491. continue;
  3492. case 3:
  3493. if (t !== 26) break;
  3494. a.files.push(V.decode(i, i.uint32()));
  3495. continue;
  3496. case 4:
  3497. if (t !== 32) break;
  3498. a.file_num = i.int32();
  3499. continue;
  3500. case 5:
  3501. if (t !== 40) break;
  3502. a.total_size = q(i.uint64());
  3503. continue
  3504. }
  3505. if ((t & 7) === 4 || t === 0) break;
  3506. i.skipType(t & 7)
  3507. }
  3508. return a
  3509. }, fromJSON(u) {
  3510. return {
  3511. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3512. path: o(u.path) ? globalThis.String(u.path) : "",
  3513. files: globalThis.Array.isArray(u == null ? void 0 : u.files) ? u.files.map(e => V.fromJSON(e)) : [],
  3514. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3515. total_size: o(u.total_size) ? globalThis.Number(u.total_size) : 0
  3516. }
  3517. }, toJSON(u) {
  3518. var i;
  3519. const e = {};
  3520. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), (i = u.files) != null && i.length && (e.files = u.files.map(n => V.toJSON(n))), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.total_size !== 0 && (e.total_size = Math.round(u.total_size)), e
  3521. }, create(u) {
  3522. return Tu.fromPartial(u != null ? u : {})
  3523. }, fromPartial(u) {
  3524. var i, n, a, t, s;
  3525. const e = W3();
  3526. return e.id = (i = u.id) != null ? i : 0, e.path = (n = u.path) != null ? n : "", e.files = ((a = u.files) == null ? void 0 : a.map(E => V.fromPartial(E))) || [], e.file_num = (t = u.file_num) != null ? t : 0, e.total_size = (s = u.total_size) != null ? s : 0, e
  3527. }
  3528. };
  3529. function V3() {
  3530. return {id: 0, path: "", recursive: !1}
  3531. }
  3532. const ju = {
  3533. encode(u, e = r.Writer.create()) {
  3534. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.recursive !== !1 && e.uint32(24).bool(u.recursive), e
  3535. }, decode(u, e) {
  3536. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3537. let n = e === void 0 ? i.len : i.pos + e;
  3538. const a = V3();
  3539. for (; i.pos < n;) {
  3540. const t = i.uint32();
  3541. switch (t >>> 3) {
  3542. case 1:
  3543. if (t !== 8) break;
  3544. a.id = i.int32();
  3545. continue;
  3546. case 2:
  3547. if (t !== 18) break;
  3548. a.path = i.string();
  3549. continue;
  3550. case 3:
  3551. if (t !== 24) break;
  3552. a.recursive = i.bool();
  3553. continue
  3554. }
  3555. if ((t & 7) === 4 || t === 0) break;
  3556. i.skipType(t & 7)
  3557. }
  3558. return a
  3559. }, fromJSON(u) {
  3560. return {
  3561. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3562. path: o(u.path) ? globalThis.String(u.path) : "",
  3563. recursive: o(u.recursive) ? globalThis.Boolean(u.recursive) : !1
  3564. }
  3565. }, toJSON(u) {
  3566. const e = {};
  3567. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.recursive !== !1 && (e.recursive = u.recursive), e
  3568. }, create(u) {
  3569. return ju.fromPartial(u != null ? u : {})
  3570. }, fromPartial(u) {
  3571. var i, n, a;
  3572. const e = V3();
  3573. return e.id = (i = u.id) != null ? i : 0, e.path = (n = u.path) != null ? n : "", e.recursive = (a = u.recursive) != null ? a : !1, e
  3574. }
  3575. };
  3576. function q3() {
  3577. return {id: 0, path: "", file_num: 0}
  3578. }
  3579. const Nu = {
  3580. encode(u, e = r.Writer.create()) {
  3581. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.file_num !== 0 && e.uint32(24).sint32(u.file_num), e
  3582. }, decode(u, e) {
  3583. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3584. let n = e === void 0 ? i.len : i.pos + e;
  3585. const a = q3();
  3586. for (; i.pos < n;) {
  3587. const t = i.uint32();
  3588. switch (t >>> 3) {
  3589. case 1:
  3590. if (t !== 8) break;
  3591. a.id = i.int32();
  3592. continue;
  3593. case 2:
  3594. if (t !== 18) break;
  3595. a.path = i.string();
  3596. continue;
  3597. case 3:
  3598. if (t !== 24) break;
  3599. a.file_num = i.sint32();
  3600. continue
  3601. }
  3602. if ((t & 7) === 4 || t === 0) break;
  3603. i.skipType(t & 7)
  3604. }
  3605. return a
  3606. }, fromJSON(u) {
  3607. return {
  3608. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3609. path: o(u.path) ? globalThis.String(u.path) : "",
  3610. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0
  3611. }
  3612. }, toJSON(u) {
  3613. const e = {};
  3614. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3615. }, create(u) {
  3616. return Nu.fromPartial(u != null ? u : {})
  3617. }, fromPartial(u) {
  3618. var i, n, a;
  3619. const e = q3();
  3620. return e.id = (i = u.id) != null ? i : 0, e.path = (n = u.path) != null ? n : "", e.file_num = (a = u.file_num) != null ? a : 0, e
  3621. }
  3622. };
  3623. function K3() {
  3624. return {id: 0, path: ""}
  3625. }
  3626. const Ou = {
  3627. encode(u, e = r.Writer.create()) {
  3628. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), e
  3629. }, decode(u, e) {
  3630. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3631. let n = e === void 0 ? i.len : i.pos + e;
  3632. const a = K3();
  3633. for (; i.pos < n;) {
  3634. const t = i.uint32();
  3635. switch (t >>> 3) {
  3636. case 1:
  3637. if (t !== 8) break;
  3638. a.id = i.int32();
  3639. continue;
  3640. case 2:
  3641. if (t !== 18) break;
  3642. a.path = i.string();
  3643. continue
  3644. }
  3645. if ((t & 7) === 4 || t === 0) break;
  3646. i.skipType(t & 7)
  3647. }
  3648. return a
  3649. }, fromJSON(u) {
  3650. return {id: o(u.id) ? globalThis.Number(u.id) : 0, path: o(u.path) ? globalThis.String(u.path) : ""}
  3651. }, toJSON(u) {
  3652. const e = {};
  3653. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), e
  3654. }, create(u) {
  3655. return Ou.fromPartial(u != null ? u : {})
  3656. }, fromPartial(u) {
  3657. var i, n;
  3658. const e = K3();
  3659. return e.id = (i = u.id) != null ? i : 0, e.path = (n = u.path) != null ? n : "", e
  3660. }
  3661. };
  3662. function H3() {
  3663. return {}
  3664. }
  3665. const f0 = {
  3666. encode(u, e = r.Writer.create()) {
  3667. return e
  3668. }, decode(u, e) {
  3669. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3670. let n = e === void 0 ? i.len : i.pos + e;
  3671. const a = H3();
  3672. for (; i.pos < n;) {
  3673. const t = i.uint32();
  3674. if ((t & 7) === 4 || t === 0) break;
  3675. i.skipType(t & 7)
  3676. }
  3677. return a
  3678. }, fromJSON(u) {
  3679. return {}
  3680. }, toJSON(u) {
  3681. return {}
  3682. }, create(u) {
  3683. return f0.fromPartial(u != null ? u : {})
  3684. }, fromPartial(u) {
  3685. return H3()
  3686. }
  3687. };
  3688. function J3() {
  3689. return {id: 0, format: ""}
  3690. }
  3691. const x0 = {
  3692. encode(u, e = r.Writer.create()) {
  3693. return u.id !== 0 && e.uint32(16).int32(u.id), u.format !== "" && e.uint32(26).string(u.format), e
  3694. }, decode(u, e) {
  3695. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3696. let n = e === void 0 ? i.len : i.pos + e;
  3697. const a = J3();
  3698. for (; i.pos < n;) {
  3699. const t = i.uint32();
  3700. switch (t >>> 3) {
  3701. case 2:
  3702. if (t !== 16) break;
  3703. a.id = i.int32();
  3704. continue;
  3705. case 3:
  3706. if (t !== 26) break;
  3707. a.format = i.string();
  3708. continue
  3709. }
  3710. if ((t & 7) === 4 || t === 0) break;
  3711. i.skipType(t & 7)
  3712. }
  3713. return a
  3714. }, fromJSON(u) {
  3715. return {id: o(u.id) ? globalThis.Number(u.id) : 0, format: o(u.format) ? globalThis.String(u.format) : ""}
  3716. }, toJSON(u) {
  3717. const e = {};
  3718. return u.id !== 0 && (e.id = Math.round(u.id)), u.format !== "" && (e.format = u.format), e
  3719. }, create(u) {
  3720. return x0.fromPartial(u != null ? u : {})
  3721. }, fromPartial(u) {
  3722. var i, n;
  3723. const e = J3();
  3724. return e.id = (i = u.id) != null ? i : 0, e.format = (n = u.format) != null ? n : "", e
  3725. }
  3726. };
  3727. function G3() {
  3728. return {formats: []}
  3729. }
  3730. const y0 = {
  3731. encode(u, e = r.Writer.create()) {
  3732. for (const i of u.formats) x0.encode(i, e.uint32(18).fork()).ldelim();
  3733. return e
  3734. }, decode(u, e) {
  3735. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3736. let n = e === void 0 ? i.len : i.pos + e;
  3737. const a = G3();
  3738. for (; i.pos < n;) {
  3739. const t = i.uint32();
  3740. switch (t >>> 3) {
  3741. case 2:
  3742. if (t !== 18) break;
  3743. a.formats.push(x0.decode(i, i.uint32()));
  3744. continue
  3745. }
  3746. if ((t & 7) === 4 || t === 0) break;
  3747. i.skipType(t & 7)
  3748. }
  3749. return a
  3750. }, fromJSON(u) {
  3751. return {formats: globalThis.Array.isArray(u == null ? void 0 : u.formats) ? u.formats.map(e => x0.fromJSON(e)) : []}
  3752. }, toJSON(u) {
  3753. var i;
  3754. const e = {};
  3755. return (i = u.formats) != null && i.length && (e.formats = u.formats.map(n => x0.toJSON(n))), e
  3756. }, create(u) {
  3757. return y0.fromPartial(u != null ? u : {})
  3758. }, fromPartial(u) {
  3759. var i;
  3760. const e = G3();
  3761. return e.formats = ((i = u.formats) == null ? void 0 : i.map(n => x0.fromPartial(n))) || [], e
  3762. }
  3763. };
  3764. function Z3() {
  3765. return {msg_flags: 0}
  3766. }
  3767. const b0 = {
  3768. encode(u, e = r.Writer.create()) {
  3769. return u.msg_flags !== 0 && e.uint32(16).int32(u.msg_flags), e
  3770. }, decode(u, e) {
  3771. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3772. let n = e === void 0 ? i.len : i.pos + e;
  3773. const a = Z3();
  3774. for (; i.pos < n;) {
  3775. const t = i.uint32();
  3776. switch (t >>> 3) {
  3777. case 2:
  3778. if (t !== 16) break;
  3779. a.msg_flags = i.int32();
  3780. continue
  3781. }
  3782. if ((t & 7) === 4 || t === 0) break;
  3783. i.skipType(t & 7)
  3784. }
  3785. return a
  3786. }, fromJSON(u) {
  3787. return {msg_flags: o(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0}
  3788. }, toJSON(u) {
  3789. const e = {};
  3790. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), e
  3791. }, create(u) {
  3792. return b0.fromPartial(u != null ? u : {})
  3793. }, fromPartial(u) {
  3794. var i;
  3795. const e = Z3();
  3796. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e
  3797. }
  3798. };
  3799. function Q3() {
  3800. return {requested_format_id: 0}
  3801. }
  3802. const w0 = {
  3803. encode(u, e = r.Writer.create()) {
  3804. return u.requested_format_id !== 0 && e.uint32(16).int32(u.requested_format_id), e
  3805. }, decode(u, e) {
  3806. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3807. let n = e === void 0 ? i.len : i.pos + e;
  3808. const a = Q3();
  3809. for (; i.pos < n;) {
  3810. const t = i.uint32();
  3811. switch (t >>> 3) {
  3812. case 2:
  3813. if (t !== 16) break;
  3814. a.requested_format_id = i.int32();
  3815. continue
  3816. }
  3817. if ((t & 7) === 4 || t === 0) break;
  3818. i.skipType(t & 7)
  3819. }
  3820. return a
  3821. }, fromJSON(u) {
  3822. return {requested_format_id: o(u.requested_format_id) ? globalThis.Number(u.requested_format_id) : 0}
  3823. }, toJSON(u) {
  3824. const e = {};
  3825. return u.requested_format_id !== 0 && (e.requested_format_id = Math.round(u.requested_format_id)), e
  3826. }, create(u) {
  3827. return w0.fromPartial(u != null ? u : {})
  3828. }, fromPartial(u) {
  3829. var i;
  3830. const e = Q3();
  3831. return e.requested_format_id = (i = u.requested_format_id) != null ? i : 0, e
  3832. }
  3833. };
  3834. function X3() {
  3835. return {msg_flags: 0, format_data: new Uint8Array(0)}
  3836. }
  3837. const S0 = {
  3838. encode(u, e = r.Writer.create()) {
  3839. return u.msg_flags !== 0 && e.uint32(16).int32(u.msg_flags), u.format_data.length !== 0 && e.uint32(26).bytes(u.format_data), e
  3840. }, decode(u, e) {
  3841. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3842. let n = e === void 0 ? i.len : i.pos + e;
  3843. const a = X3();
  3844. for (; i.pos < n;) {
  3845. const t = i.uint32();
  3846. switch (t >>> 3) {
  3847. case 2:
  3848. if (t !== 16) break;
  3849. a.msg_flags = i.int32();
  3850. continue;
  3851. case 3:
  3852. if (t !== 26) break;
  3853. a.format_data = i.bytes();
  3854. continue
  3855. }
  3856. if ((t & 7) === 4 || t === 0) break;
  3857. i.skipType(t & 7)
  3858. }
  3859. return a
  3860. }, fromJSON(u) {
  3861. return {
  3862. msg_flags: o(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0,
  3863. format_data: o(u.format_data) ? z(u.format_data) : new Uint8Array(0)
  3864. }
  3865. }, toJSON(u) {
  3866. const e = {};
  3867. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), u.format_data.length !== 0 && (e.format_data = P(u.format_data)), e
  3868. }, create(u) {
  3869. return S0.fromPartial(u != null ? u : {})
  3870. }, fromPartial(u) {
  3871. var i, n;
  3872. const e = X3();
  3873. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e.format_data = (n = u.format_data) != null ? n : new Uint8Array(0), e
  3874. }
  3875. };
  3876. function Y3() {
  3877. return {
  3878. stream_id: 0,
  3879. list_index: 0,
  3880. dw_flags: 0,
  3881. n_position_low: 0,
  3882. n_position_high: 0,
  3883. cb_requested: 0,
  3884. have_clip_data_id: !1,
  3885. clip_data_id: 0
  3886. }
  3887. }
  3888. const z0 = {
  3889. encode(u, e = r.Writer.create()) {
  3890. return u.stream_id !== 0 && e.uint32(16).int32(u.stream_id), u.list_index !== 0 && e.uint32(24).int32(u.list_index), u.dw_flags !== 0 && e.uint32(32).int32(u.dw_flags), u.n_position_low !== 0 && e.uint32(40).int32(u.n_position_low), u.n_position_high !== 0 && e.uint32(48).int32(u.n_position_high), u.cb_requested !== 0 && e.uint32(56).int32(u.cb_requested), u.have_clip_data_id !== !1 && e.uint32(64).bool(u.have_clip_data_id), u.clip_data_id !== 0 && e.uint32(72).int32(u.clip_data_id), e
  3891. }, decode(u, e) {
  3892. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3893. let n = e === void 0 ? i.len : i.pos + e;
  3894. const a = Y3();
  3895. for (; i.pos < n;) {
  3896. const t = i.uint32();
  3897. switch (t >>> 3) {
  3898. case 2:
  3899. if (t !== 16) break;
  3900. a.stream_id = i.int32();
  3901. continue;
  3902. case 3:
  3903. if (t !== 24) break;
  3904. a.list_index = i.int32();
  3905. continue;
  3906. case 4:
  3907. if (t !== 32) break;
  3908. a.dw_flags = i.int32();
  3909. continue;
  3910. case 5:
  3911. if (t !== 40) break;
  3912. a.n_position_low = i.int32();
  3913. continue;
  3914. case 6:
  3915. if (t !== 48) break;
  3916. a.n_position_high = i.int32();
  3917. continue;
  3918. case 7:
  3919. if (t !== 56) break;
  3920. a.cb_requested = i.int32();
  3921. continue;
  3922. case 8:
  3923. if (t !== 64) break;
  3924. a.have_clip_data_id = i.bool();
  3925. continue;
  3926. case 9:
  3927. if (t !== 72) break;
  3928. a.clip_data_id = i.int32();
  3929. continue
  3930. }
  3931. if ((t & 7) === 4 || t === 0) break;
  3932. i.skipType(t & 7)
  3933. }
  3934. return a
  3935. }, fromJSON(u) {
  3936. return {
  3937. stream_id: o(u.stream_id) ? globalThis.Number(u.stream_id) : 0,
  3938. list_index: o(u.list_index) ? globalThis.Number(u.list_index) : 0,
  3939. dw_flags: o(u.dw_flags) ? globalThis.Number(u.dw_flags) : 0,
  3940. n_position_low: o(u.n_position_low) ? globalThis.Number(u.n_position_low) : 0,
  3941. n_position_high: o(u.n_position_high) ? globalThis.Number(u.n_position_high) : 0,
  3942. cb_requested: o(u.cb_requested) ? globalThis.Number(u.cb_requested) : 0,
  3943. have_clip_data_id: o(u.have_clip_data_id) ? globalThis.Boolean(u.have_clip_data_id) : !1,
  3944. clip_data_id: o(u.clip_data_id) ? globalThis.Number(u.clip_data_id) : 0
  3945. }
  3946. }, toJSON(u) {
  3947. const e = {};
  3948. return u.stream_id !== 0 && (e.stream_id = Math.round(u.stream_id)), u.list_index !== 0 && (e.list_index = Math.round(u.list_index)), u.dw_flags !== 0 && (e.dw_flags = Math.round(u.dw_flags)), u.n_position_low !== 0 && (e.n_position_low = Math.round(u.n_position_low)), u.n_position_high !== 0 && (e.n_position_high = Math.round(u.n_position_high)), u.cb_requested !== 0 && (e.cb_requested = Math.round(u.cb_requested)), u.have_clip_data_id !== !1 && (e.have_clip_data_id = u.have_clip_data_id), u.clip_data_id !== 0 && (e.clip_data_id = Math.round(u.clip_data_id)), e
  3949. }, create(u) {
  3950. return z0.fromPartial(u != null ? u : {})
  3951. }, fromPartial(u) {
  3952. var i, n, a, t, s, E, l, d;
  3953. const e = Y3();
  3954. return e.stream_id = (i = u.stream_id) != null ? i : 0, e.list_index = (n = u.list_index) != null ? n : 0, e.dw_flags = (a = u.dw_flags) != null ? a : 0, e.n_position_low = (t = u.n_position_low) != null ? t : 0, e.n_position_high = (s = u.n_position_high) != null ? s : 0, e.cb_requested = (E = u.cb_requested) != null ? E : 0, e.have_clip_data_id = (l = u.have_clip_data_id) != null ? l : !1, e.clip_data_id = (d = u.clip_data_id) != null ? d : 0, e
  3955. }
  3956. };
  3957. function $3() {
  3958. return {msg_flags: 0, stream_id: 0, requested_data: new Uint8Array(0)}
  3959. }
  3960. const P0 = {
  3961. encode(u, e = r.Writer.create()) {
  3962. return u.msg_flags !== 0 && e.uint32(24).int32(u.msg_flags), u.stream_id !== 0 && e.uint32(32).int32(u.stream_id), u.requested_data.length !== 0 && e.uint32(42).bytes(u.requested_data), e
  3963. }, decode(u, e) {
  3964. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3965. let n = e === void 0 ? i.len : i.pos + e;
  3966. const a = $3();
  3967. for (; i.pos < n;) {
  3968. const t = i.uint32();
  3969. switch (t >>> 3) {
  3970. case 3:
  3971. if (t !== 24) break;
  3972. a.msg_flags = i.int32();
  3973. continue;
  3974. case 4:
  3975. if (t !== 32) break;
  3976. a.stream_id = i.int32();
  3977. continue;
  3978. case 5:
  3979. if (t !== 42) break;
  3980. a.requested_data = i.bytes();
  3981. continue
  3982. }
  3983. if ((t & 7) === 4 || t === 0) break;
  3984. i.skipType(t & 7)
  3985. }
  3986. return a
  3987. }, fromJSON(u) {
  3988. return {
  3989. msg_flags: o(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0,
  3990. stream_id: o(u.stream_id) ? globalThis.Number(u.stream_id) : 0,
  3991. requested_data: o(u.requested_data) ? z(u.requested_data) : new Uint8Array(0)
  3992. }
  3993. }, toJSON(u) {
  3994. const e = {};
  3995. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), u.stream_id !== 0 && (e.stream_id = Math.round(u.stream_id)), u.requested_data.length !== 0 && (e.requested_data = P(u.requested_data)), e
  3996. }, create(u) {
  3997. return P0.fromPartial(u != null ? u : {})
  3998. }, fromPartial(u) {
  3999. var i, n, a;
  4000. const e = $3();
  4001. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e.stream_id = (n = u.stream_id) != null ? n : 0, e.requested_data = (a = u.requested_data) != null ? a : new Uint8Array(0), e
  4002. }
  4003. };
  4004. function ui() {
  4005. return {}
  4006. }
  4007. const R0 = {
  4008. encode(u, e = r.Writer.create()) {
  4009. return e
  4010. }, decode(u, e) {
  4011. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4012. let n = e === void 0 ? i.len : i.pos + e;
  4013. const a = ui();
  4014. for (; i.pos < n;) {
  4015. const t = i.uint32();
  4016. if ((t & 7) === 4 || t === 0) break;
  4017. i.skipType(t & 7)
  4018. }
  4019. return a
  4020. }, fromJSON(u) {
  4021. return {}
  4022. }, toJSON(u) {
  4023. return {}
  4024. }, create(u) {
  4025. return R0.fromPartial(u != null ? u : {})
  4026. }, fromPartial(u) {
  4027. return ui()
  4028. }
  4029. };
  4030. function ei() {
  4031. return {
  4032. ready: void 0,
  4033. format_list: void 0,
  4034. format_list_response: void 0,
  4035. format_data_request: void 0,
  4036. format_data_response: void 0,
  4037. file_contents_request: void 0,
  4038. file_contents_response: void 0,
  4039. try_empty: void 0
  4040. }
  4041. }
  4042. const I0 = {
  4043. encode(u, e = r.Writer.create()) {
  4044. return u.ready !== void 0 && f0.encode(u.ready, e.uint32(10).fork()).ldelim(), u.format_list !== void 0 && y0.encode(u.format_list, e.uint32(18).fork()).ldelim(), u.format_list_response !== void 0 && b0.encode(u.format_list_response, e.uint32(26).fork()).ldelim(), u.format_data_request !== void 0 && w0.encode(u.format_data_request, e.uint32(34).fork()).ldelim(), u.format_data_response !== void 0 && S0.encode(u.format_data_response, e.uint32(42).fork()).ldelim(), u.file_contents_request !== void 0 && z0.encode(u.file_contents_request, e.uint32(50).fork()).ldelim(), u.file_contents_response !== void 0 && P0.encode(u.file_contents_response, e.uint32(58).fork()).ldelim(), u.try_empty !== void 0 && R0.encode(u.try_empty, e.uint32(66).fork()).ldelim(), e
  4045. }, decode(u, e) {
  4046. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4047. let n = e === void 0 ? i.len : i.pos + e;
  4048. const a = ei();
  4049. for (; i.pos < n;) {
  4050. const t = i.uint32();
  4051. switch (t >>> 3) {
  4052. case 1:
  4053. if (t !== 10) break;
  4054. a.ready = f0.decode(i, i.uint32());
  4055. continue;
  4056. case 2:
  4057. if (t !== 18) break;
  4058. a.format_list = y0.decode(i, i.uint32());
  4059. continue;
  4060. case 3:
  4061. if (t !== 26) break;
  4062. a.format_list_response = b0.decode(i, i.uint32());
  4063. continue;
  4064. case 4:
  4065. if (t !== 34) break;
  4066. a.format_data_request = w0.decode(i, i.uint32());
  4067. continue;
  4068. case 5:
  4069. if (t !== 42) break;
  4070. a.format_data_response = S0.decode(i, i.uint32());
  4071. continue;
  4072. case 6:
  4073. if (t !== 50) break;
  4074. a.file_contents_request = z0.decode(i, i.uint32());
  4075. continue;
  4076. case 7:
  4077. if (t !== 58) break;
  4078. a.file_contents_response = P0.decode(i, i.uint32());
  4079. continue;
  4080. case 8:
  4081. if (t !== 66) break;
  4082. a.try_empty = R0.decode(i, i.uint32());
  4083. continue
  4084. }
  4085. if ((t & 7) === 4 || t === 0) break;
  4086. i.skipType(t & 7)
  4087. }
  4088. return a
  4089. }, fromJSON(u) {
  4090. return {
  4091. ready: o(u.ready) ? f0.fromJSON(u.ready) : void 0,
  4092. format_list: o(u.format_list) ? y0.fromJSON(u.format_list) : void 0,
  4093. format_list_response: o(u.format_list_response) ? b0.fromJSON(u.format_list_response) : void 0,
  4094. format_data_request: o(u.format_data_request) ? w0.fromJSON(u.format_data_request) : void 0,
  4095. format_data_response: o(u.format_data_response) ? S0.fromJSON(u.format_data_response) : void 0,
  4096. file_contents_request: o(u.file_contents_request) ? z0.fromJSON(u.file_contents_request) : void 0,
  4097. file_contents_response: o(u.file_contents_response) ? P0.fromJSON(u.file_contents_response) : void 0,
  4098. try_empty: o(u.try_empty) ? R0.fromJSON(u.try_empty) : void 0
  4099. }
  4100. }, toJSON(u) {
  4101. const e = {};
  4102. return u.ready !== void 0 && (e.ready = f0.toJSON(u.ready)), u.format_list !== void 0 && (e.format_list = y0.toJSON(u.format_list)), u.format_list_response !== void 0 && (e.format_list_response = b0.toJSON(u.format_list_response)), u.format_data_request !== void 0 && (e.format_data_request = w0.toJSON(u.format_data_request)), u.format_data_response !== void 0 && (e.format_data_response = S0.toJSON(u.format_data_response)), u.file_contents_request !== void 0 && (e.file_contents_request = z0.toJSON(u.file_contents_request)), u.file_contents_response !== void 0 && (e.file_contents_response = P0.toJSON(u.file_contents_response)), u.try_empty !== void 0 && (e.try_empty = R0.toJSON(u.try_empty)), e
  4103. }, create(u) {
  4104. return I0.fromPartial(u != null ? u : {})
  4105. }, fromPartial(u) {
  4106. const e = ei();
  4107. return e.ready = u.ready !== void 0 && u.ready !== null ? f0.fromPartial(u.ready) : void 0, e.format_list = u.format_list !== void 0 && u.format_list !== null ? y0.fromPartial(u.format_list) : void 0, e.format_list_response = u.format_list_response !== void 0 && u.format_list_response !== null ? b0.fromPartial(u.format_list_response) : void 0, e.format_data_request = u.format_data_request !== void 0 && u.format_data_request !== null ? w0.fromPartial(u.format_data_request) : void 0, e.format_data_response = u.format_data_response !== void 0 && u.format_data_response !== null ? S0.fromPartial(u.format_data_response) : void 0, e.file_contents_request = u.file_contents_request !== void 0 && u.file_contents_request !== null ? z0.fromPartial(u.file_contents_request) : void 0, e.file_contents_response = u.file_contents_response !== void 0 && u.file_contents_response !== null ? P0.fromPartial(u.file_contents_response) : void 0, e.try_empty = u.try_empty !== void 0 && u.try_empty !== null ? R0.fromPartial(u.try_empty) : void 0, e
  4108. }
  4109. };
  4110. function ii() {
  4111. return {width: 0, height: 0}
  4112. }
  4113. const v = {
  4114. encode(u, e = r.Writer.create()) {
  4115. return u.width !== 0 && e.uint32(8).int32(u.width), u.height !== 0 && e.uint32(16).int32(u.height), e
  4116. }, decode(u, e) {
  4117. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4118. let n = e === void 0 ? i.len : i.pos + e;
  4119. const a = ii();
  4120. for (; i.pos < n;) {
  4121. const t = i.uint32();
  4122. switch (t >>> 3) {
  4123. case 1:
  4124. if (t !== 8) break;
  4125. a.width = i.int32();
  4126. continue;
  4127. case 2:
  4128. if (t !== 16) break;
  4129. a.height = i.int32();
  4130. continue
  4131. }
  4132. if ((t & 7) === 4 || t === 0) break;
  4133. i.skipType(t & 7)
  4134. }
  4135. return a
  4136. }, fromJSON(u) {
  4137. return {
  4138. width: o(u.width) ? globalThis.Number(u.width) : 0,
  4139. height: o(u.height) ? globalThis.Number(u.height) : 0
  4140. }
  4141. }, toJSON(u) {
  4142. const e = {};
  4143. return u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), e
  4144. }, create(u) {
  4145. return v.fromPartial(u != null ? u : {})
  4146. }, fromPartial(u) {
  4147. var i, n;
  4148. const e = ii();
  4149. return e.width = (i = u.width) != null ? i : 0, e.height = (n = u.height) != null ? n : 0, e
  4150. }
  4151. };
  4152. function ti() {
  4153. return {display: 0, resolution: void 0}
  4154. }
  4155. const Uu = {
  4156. encode(u, e = r.Writer.create()) {
  4157. return u.display !== 0 && e.uint32(8).int32(u.display), u.resolution !== void 0 && v.encode(u.resolution, e.uint32(18).fork()).ldelim(), e
  4158. }, decode(u, e) {
  4159. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4160. let n = e === void 0 ? i.len : i.pos + e;
  4161. const a = ti();
  4162. for (; i.pos < n;) {
  4163. const t = i.uint32();
  4164. switch (t >>> 3) {
  4165. case 1:
  4166. if (t !== 8) break;
  4167. a.display = i.int32();
  4168. continue;
  4169. case 2:
  4170. if (t !== 18) break;
  4171. a.resolution = v.decode(i, i.uint32());
  4172. continue
  4173. }
  4174. if ((t & 7) === 4 || t === 0) break;
  4175. i.skipType(t & 7)
  4176. }
  4177. return a
  4178. }, fromJSON(u) {
  4179. return {
  4180. display: o(u.display) ? globalThis.Number(u.display) : 0,
  4181. resolution: o(u.resolution) ? v.fromJSON(u.resolution) : void 0
  4182. }
  4183. }, toJSON(u) {
  4184. const e = {};
  4185. return u.display !== 0 && (e.display = Math.round(u.display)), u.resolution !== void 0 && (e.resolution = v.toJSON(u.resolution)), e
  4186. }, create(u) {
  4187. return Uu.fromPartial(u != null ? u : {})
  4188. }, fromPartial(u) {
  4189. var i;
  4190. const e = ti();
  4191. return e.display = (i = u.display) != null ? i : 0, e.resolution = u.resolution !== void 0 && u.resolution !== null ? v.fromPartial(u.resolution) : void 0, e
  4192. }
  4193. };
  4194. function ai() {
  4195. return {resolutions: []}
  4196. }
  4197. const iu = {
  4198. encode(u, e = r.Writer.create()) {
  4199. for (const i of u.resolutions) v.encode(i, e.uint32(10).fork()).ldelim();
  4200. return e
  4201. }, decode(u, e) {
  4202. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4203. let n = e === void 0 ? i.len : i.pos + e;
  4204. const a = ai();
  4205. for (; i.pos < n;) {
  4206. const t = i.uint32();
  4207. switch (t >>> 3) {
  4208. case 1:
  4209. if (t !== 10) break;
  4210. a.resolutions.push(v.decode(i, i.uint32()));
  4211. continue
  4212. }
  4213. if ((t & 7) === 4 || t === 0) break;
  4214. i.skipType(t & 7)
  4215. }
  4216. return a
  4217. }, fromJSON(u) {
  4218. return {resolutions: globalThis.Array.isArray(u == null ? void 0 : u.resolutions) ? u.resolutions.map(e => v.fromJSON(e)) : []}
  4219. }, toJSON(u) {
  4220. var i;
  4221. const e = {};
  4222. return (i = u.resolutions) != null && i.length && (e.resolutions = u.resolutions.map(n => v.toJSON(n))), e
  4223. }, create(u) {
  4224. return iu.fromPartial(u != null ? u : {})
  4225. }, fromPartial(u) {
  4226. var i;
  4227. const e = ai();
  4228. return e.resolutions = ((i = u.resolutions) == null ? void 0 : i.map(n => v.fromPartial(n))) || [], e
  4229. }
  4230. };
  4231. function ni() {
  4232. return {
  4233. display: 0,
  4234. x: 0,
  4235. y: 0,
  4236. width: 0,
  4237. height: 0,
  4238. cursor_embedded: !1,
  4239. resolutions: void 0,
  4240. original_resolution: void 0
  4241. }
  4242. }
  4243. const Mu = {
  4244. encode(u, e = r.Writer.create()) {
  4245. return u.display !== 0 && e.uint32(8).int32(u.display), u.x !== 0 && e.uint32(16).sint32(u.x), u.y !== 0 && e.uint32(24).sint32(u.y), u.width !== 0 && e.uint32(32).int32(u.width), u.height !== 0 && e.uint32(40).int32(u.height), u.cursor_embedded !== !1 && e.uint32(48).bool(u.cursor_embedded), u.resolutions !== void 0 && iu.encode(u.resolutions, e.uint32(58).fork()).ldelim(), u.original_resolution !== void 0 && v.encode(u.original_resolution, e.uint32(66).fork()).ldelim(), e
  4246. }, decode(u, e) {
  4247. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4248. let n = e === void 0 ? i.len : i.pos + e;
  4249. const a = ni();
  4250. for (; i.pos < n;) {
  4251. const t = i.uint32();
  4252. switch (t >>> 3) {
  4253. case 1:
  4254. if (t !== 8) break;
  4255. a.display = i.int32();
  4256. continue;
  4257. case 2:
  4258. if (t !== 16) break;
  4259. a.x = i.sint32();
  4260. continue;
  4261. case 3:
  4262. if (t !== 24) break;
  4263. a.y = i.sint32();
  4264. continue;
  4265. case 4:
  4266. if (t !== 32) break;
  4267. a.width = i.int32();
  4268. continue;
  4269. case 5:
  4270. if (t !== 40) break;
  4271. a.height = i.int32();
  4272. continue;
  4273. case 6:
  4274. if (t !== 48) break;
  4275. a.cursor_embedded = i.bool();
  4276. continue;
  4277. case 7:
  4278. if (t !== 58) break;
  4279. a.resolutions = iu.decode(i, i.uint32());
  4280. continue;
  4281. case 8:
  4282. if (t !== 66) break;
  4283. a.original_resolution = v.decode(i, i.uint32());
  4284. continue
  4285. }
  4286. if ((t & 7) === 4 || t === 0) break;
  4287. i.skipType(t & 7)
  4288. }
  4289. return a
  4290. }, fromJSON(u) {
  4291. return {
  4292. display: o(u.display) ? globalThis.Number(u.display) : 0,
  4293. x: o(u.x) ? globalThis.Number(u.x) : 0,
  4294. y: o(u.y) ? globalThis.Number(u.y) : 0,
  4295. width: o(u.width) ? globalThis.Number(u.width) : 0,
  4296. height: o(u.height) ? globalThis.Number(u.height) : 0,
  4297. cursor_embedded: o(u.cursor_embedded) ? globalThis.Boolean(u.cursor_embedded) : !1,
  4298. resolutions: o(u.resolutions) ? iu.fromJSON(u.resolutions) : void 0,
  4299. original_resolution: o(u.original_resolution) ? v.fromJSON(u.original_resolution) : void 0
  4300. }
  4301. }, toJSON(u) {
  4302. const e = {};
  4303. return u.display !== 0 && (e.display = Math.round(u.display)), u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.cursor_embedded !== !1 && (e.cursor_embedded = u.cursor_embedded), u.resolutions !== void 0 && (e.resolutions = iu.toJSON(u.resolutions)), u.original_resolution !== void 0 && (e.original_resolution = v.toJSON(u.original_resolution)), e
  4304. }, create(u) {
  4305. return Mu.fromPartial(u != null ? u : {})
  4306. }, fromPartial(u) {
  4307. var i, n, a, t, s, E;
  4308. const e = ni();
  4309. return e.display = (i = u.display) != null ? i : 0, e.x = (n = u.x) != null ? n : 0, e.y = (a = u.y) != null ? a : 0, e.width = (t = u.width) != null ? t : 0, e.height = (s = u.height) != null ? s : 0, e.cursor_embedded = (E = u.cursor_embedded) != null ? E : !1, e.resolutions = u.resolutions !== void 0 && u.resolutions !== null ? iu.fromPartial(u.resolutions) : void 0, e.original_resolution = u.original_resolution !== void 0 && u.original_resolution !== null ? v.fromPartial(u.original_resolution) : void 0, e
  4310. }
  4311. };
  4312. function oi() {
  4313. return {add: [], sub: [], set: []}
  4314. }
  4315. const Lu = {
  4316. encode(u, e = r.Writer.create()) {
  4317. e.uint32(10).fork();
  4318. for (const i of u.add) e.int32(i);
  4319. e.ldelim(), e.uint32(18).fork();
  4320. for (const i of u.sub) e.int32(i);
  4321. e.ldelim(), e.uint32(26).fork();
  4322. for (const i of u.set) e.int32(i);
  4323. return e.ldelim(), e
  4324. }, decode(u, e) {
  4325. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4326. let n = e === void 0 ? i.len : i.pos + e;
  4327. const a = oi();
  4328. for (; i.pos < n;) {
  4329. const t = i.uint32();
  4330. switch (t >>> 3) {
  4331. case 1:
  4332. if (t === 8) {
  4333. a.add.push(i.int32());
  4334. continue
  4335. }
  4336. if (t === 10) {
  4337. const s = i.uint32() + i.pos;
  4338. for (; i.pos < s;) a.add.push(i.int32());
  4339. continue
  4340. }
  4341. break;
  4342. case 2:
  4343. if (t === 16) {
  4344. a.sub.push(i.int32());
  4345. continue
  4346. }
  4347. if (t === 18) {
  4348. const s = i.uint32() + i.pos;
  4349. for (; i.pos < s;) a.sub.push(i.int32());
  4350. continue
  4351. }
  4352. break;
  4353. case 3:
  4354. if (t === 24) {
  4355. a.set.push(i.int32());
  4356. continue
  4357. }
  4358. if (t === 26) {
  4359. const s = i.uint32() + i.pos;
  4360. for (; i.pos < s;) a.set.push(i.int32());
  4361. continue
  4362. }
  4363. break
  4364. }
  4365. if ((t & 7) === 4 || t === 0) break;
  4366. i.skipType(t & 7)
  4367. }
  4368. return a
  4369. }, fromJSON(u) {
  4370. return {
  4371. add: globalThis.Array.isArray(u == null ? void 0 : u.add) ? u.add.map(e => globalThis.Number(e)) : [],
  4372. sub: globalThis.Array.isArray(u == null ? void 0 : u.sub) ? u.sub.map(e => globalThis.Number(e)) : [],
  4373. set: globalThis.Array.isArray(u == null ? void 0 : u.set) ? u.set.map(e => globalThis.Number(e)) : []
  4374. }
  4375. }, toJSON(u) {
  4376. var i, n, a;
  4377. const e = {};
  4378. return (i = u.add) != null && i.length && (e.add = u.add.map(t => Math.round(t))), (n = u.sub) != null && n.length && (e.sub = u.sub.map(t => Math.round(t))), (a = u.set) != null && a.length && (e.set = u.set.map(t => Math.round(t))), e
  4379. }, create(u) {
  4380. return Lu.fromPartial(u != null ? u : {})
  4381. }, fromPartial(u) {
  4382. var i, n, a;
  4383. const e = oi();
  4384. return e.add = ((i = u.add) == null ? void 0 : i.map(t => t)) || [], e.sub = ((n = u.sub) == null ? void 0 : n.map(t => t)) || [], e.set = ((a = u.set) == null ? void 0 : a.map(t => t)) || [], e
  4385. }
  4386. };
  4387. function ri() {
  4388. return {display: 0, on: !1}
  4389. }
  4390. const Wu = {
  4391. encode(u, e = r.Writer.create()) {
  4392. return u.display !== 0 && e.uint32(8).int32(u.display), u.on !== !1 && e.uint32(16).bool(u.on), e
  4393. }, decode(u, e) {
  4394. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4395. let n = e === void 0 ? i.len : i.pos + e;
  4396. const a = ri();
  4397. for (; i.pos < n;) {
  4398. const t = i.uint32();
  4399. switch (t >>> 3) {
  4400. case 1:
  4401. if (t !== 8) break;
  4402. a.display = i.int32();
  4403. continue;
  4404. case 2:
  4405. if (t !== 16) break;
  4406. a.on = i.bool();
  4407. continue
  4408. }
  4409. if ((t & 7) === 4 || t === 0) break;
  4410. i.skipType(t & 7)
  4411. }
  4412. return a
  4413. }, fromJSON(u) {
  4414. return {display: o(u.display) ? globalThis.Number(u.display) : 0, on: o(u.on) ? globalThis.Boolean(u.on) : !1}
  4415. }, toJSON(u) {
  4416. const e = {};
  4417. return u.display !== 0 && (e.display = Math.round(u.display)), u.on !== !1 && (e.on = u.on), e
  4418. }, create(u) {
  4419. return Wu.fromPartial(u != null ? u : {})
  4420. }, fromPartial(u) {
  4421. var i, n;
  4422. const e = ri();
  4423. return e.display = (i = u.display) != null ? i : 0, e.on = (n = u.on) != null ? n : !1, e
  4424. }
  4425. };
  4426. function si() {
  4427. return {impl_key: "", on: !1}
  4428. }
  4429. const Vu = {
  4430. encode(u, e = r.Writer.create()) {
  4431. return u.impl_key !== "" && e.uint32(10).string(u.impl_key), u.on !== !1 && e.uint32(16).bool(u.on), e
  4432. }, decode(u, e) {
  4433. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4434. let n = e === void 0 ? i.len : i.pos + e;
  4435. const a = si();
  4436. for (; i.pos < n;) {
  4437. const t = i.uint32();
  4438. switch (t >>> 3) {
  4439. case 1:
  4440. if (t !== 10) break;
  4441. a.impl_key = i.string();
  4442. continue;
  4443. case 2:
  4444. if (t !== 16) break;
  4445. a.on = i.bool();
  4446. continue
  4447. }
  4448. if ((t & 7) === 4 || t === 0) break;
  4449. i.skipType(t & 7)
  4450. }
  4451. return a
  4452. }, fromJSON(u) {
  4453. return {
  4454. impl_key: o(u.impl_key) ? globalThis.String(u.impl_key) : "",
  4455. on: o(u.on) ? globalThis.Boolean(u.on) : !1
  4456. }
  4457. }, toJSON(u) {
  4458. const e = {};
  4459. return u.impl_key !== "" && (e.impl_key = u.impl_key), u.on !== !1 && (e.on = u.on), e
  4460. }, create(u) {
  4461. return Vu.fromPartial(u != null ? u : {})
  4462. }, fromPartial(u) {
  4463. var i, n;
  4464. const e = si();
  4465. return e.impl_key = (i = u.impl_key) != null ? i : "", e.on = (n = u.on) != null ? n : !1, e
  4466. }
  4467. };
  4468. function Ei() {
  4469. return {permission: 0, enabled: !1}
  4470. }
  4471. const T0 = {
  4472. encode(u, e = r.Writer.create()) {
  4473. return u.permission !== 0 && e.uint32(8).int32(u.permission), u.enabled !== !1 && e.uint32(16).bool(u.enabled), e
  4474. }, decode(u, e) {
  4475. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4476. let n = e === void 0 ? i.len : i.pos + e;
  4477. const a = Ei();
  4478. for (; i.pos < n;) {
  4479. const t = i.uint32();
  4480. switch (t >>> 3) {
  4481. case 1:
  4482. if (t !== 8) break;
  4483. a.permission = i.int32();
  4484. continue;
  4485. case 2:
  4486. if (t !== 16) break;
  4487. a.enabled = i.bool();
  4488. continue
  4489. }
  4490. if ((t & 7) === 4 || t === 0) break;
  4491. i.skipType(t & 7)
  4492. }
  4493. return a
  4494. }, fromJSON(u) {
  4495. return {
  4496. permission: o(u.permission) ? Oa(u.permission) : 0,
  4497. enabled: o(u.enabled) ? globalThis.Boolean(u.enabled) : !1
  4498. }
  4499. }, toJSON(u) {
  4500. const e = {};
  4501. return u.permission !== 0 && (e.permission = Ua(u.permission)), u.enabled !== !1 && (e.enabled = u.enabled), e
  4502. }, create(u) {
  4503. return T0.fromPartial(u != null ? u : {})
  4504. }, fromPartial(u) {
  4505. var i, n;
  4506. const e = Ei();
  4507. return e.permission = (i = u.permission) != null ? i : 0, e.enabled = (n = u.enabled) != null ? n : !1, e
  4508. }
  4509. };
  4510. function li() {
  4511. return {
  4512. ability_vp9: 0,
  4513. ability_h264: 0,
  4514. ability_h265: 0,
  4515. prefer: 0,
  4516. ability_vp8: 0,
  4517. ability_av1: 0,
  4518. i444: void 0,
  4519. prefer_chroma: 0
  4520. }
  4521. }
  4522. const qu = {
  4523. encode(u, e = r.Writer.create()) {
  4524. return u.ability_vp9 !== 0 && e.uint32(8).int32(u.ability_vp9), u.ability_h264 !== 0 && e.uint32(16).int32(u.ability_h264), u.ability_h265 !== 0 && e.uint32(24).int32(u.ability_h265), u.prefer !== 0 && e.uint32(32).int32(u.prefer), u.ability_vp8 !== 0 && e.uint32(40).int32(u.ability_vp8), u.ability_av1 !== 0 && e.uint32(48).int32(u.ability_av1), u.i444 !== void 0 && G.encode(u.i444, e.uint32(58).fork()).ldelim(), u.prefer_chroma !== 0 && e.uint32(64).int32(u.prefer_chroma), e
  4525. }, decode(u, e) {
  4526. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4527. let n = e === void 0 ? i.len : i.pos + e;
  4528. const a = li();
  4529. for (; i.pos < n;) {
  4530. const t = i.uint32();
  4531. switch (t >>> 3) {
  4532. case 1:
  4533. if (t !== 8) break;
  4534. a.ability_vp9 = i.int32();
  4535. continue;
  4536. case 2:
  4537. if (t !== 16) break;
  4538. a.ability_h264 = i.int32();
  4539. continue;
  4540. case 3:
  4541. if (t !== 24) break;
  4542. a.ability_h265 = i.int32();
  4543. continue;
  4544. case 4:
  4545. if (t !== 32) break;
  4546. a.prefer = i.int32();
  4547. continue;
  4548. case 5:
  4549. if (t !== 40) break;
  4550. a.ability_vp8 = i.int32();
  4551. continue;
  4552. case 6:
  4553. if (t !== 48) break;
  4554. a.ability_av1 = i.int32();
  4555. continue;
  4556. case 7:
  4557. if (t !== 58) break;
  4558. a.i444 = G.decode(i, i.uint32());
  4559. continue;
  4560. case 8:
  4561. if (t !== 64) break;
  4562. a.prefer_chroma = i.int32();
  4563. continue
  4564. }
  4565. if ((t & 7) === 4 || t === 0) break;
  4566. i.skipType(t & 7)
  4567. }
  4568. return a
  4569. }, fromJSON(u) {
  4570. return {
  4571. ability_vp9: o(u.ability_vp9) ? globalThis.Number(u.ability_vp9) : 0,
  4572. ability_h264: o(u.ability_h264) ? globalThis.Number(u.ability_h264) : 0,
  4573. ability_h265: o(u.ability_h265) ? globalThis.Number(u.ability_h265) : 0,
  4574. prefer: o(u.prefer) ? Ma(u.prefer) : 0,
  4575. ability_vp8: o(u.ability_vp8) ? globalThis.Number(u.ability_vp8) : 0,
  4576. ability_av1: o(u.ability_av1) ? globalThis.Number(u.ability_av1) : 0,
  4577. i444: o(u.i444) ? G.fromJSON(u.i444) : void 0,
  4578. prefer_chroma: o(u.prefer_chroma) ? xa(u.prefer_chroma) : 0
  4579. }
  4580. }, toJSON(u) {
  4581. const e = {};
  4582. return u.ability_vp9 !== 0 && (e.ability_vp9 = Math.round(u.ability_vp9)), u.ability_h264 !== 0 && (e.ability_h264 = Math.round(u.ability_h264)), u.ability_h265 !== 0 && (e.ability_h265 = Math.round(u.ability_h265)), u.prefer !== 0 && (e.prefer = La(u.prefer)), u.ability_vp8 !== 0 && (e.ability_vp8 = Math.round(u.ability_vp8)), u.ability_av1 !== 0 && (e.ability_av1 = Math.round(u.ability_av1)), u.i444 !== void 0 && (e.i444 = G.toJSON(u.i444)), u.prefer_chroma !== 0 && (e.prefer_chroma = ya(u.prefer_chroma)), e
  4583. }, create(u) {
  4584. return qu.fromPartial(u != null ? u : {})
  4585. }, fromPartial(u) {
  4586. var i, n, a, t, s, E, l;
  4587. const e = li();
  4588. return e.ability_vp9 = (i = u.ability_vp9) != null ? i : 0, e.ability_h264 = (n = u.ability_h264) != null ? n : 0, e.ability_h265 = (a = u.ability_h265) != null ? a : 0, e.prefer = (t = u.prefer) != null ? t : 0, e.ability_vp8 = (s = u.ability_vp8) != null ? s : 0, e.ability_av1 = (E = u.ability_av1) != null ? E : 0, e.i444 = u.i444 !== void 0 && u.i444 !== null ? G.fromPartial(u.i444) : void 0, e.prefer_chroma = (l = u.prefer_chroma) != null ? l : 0, e
  4589. }
  4590. };
  4591. function Di() {
  4592. return {
  4593. image_quality: 0,
  4594. lock_after_session_end: 0,
  4595. show_remote_cursor: 0,
  4596. privacy_mode: 0,
  4597. block_input: 0,
  4598. custom_image_quality: 0,
  4599. disable_audio: 0,
  4600. disable_clipboard: 0,
  4601. enable_file_transfer: 0,
  4602. supported_decoding: void 0,
  4603. custom_fps: 0,
  4604. disable_keyboard: 0,
  4605. follow_remote_cursor: 0,
  4606. follow_remote_window: 0,
  4607. disable_camera: 0
  4608. }
  4609. }
  4610. const R = {
  4611. encode(u, e = r.Writer.create()) {
  4612. return u.image_quality !== 0 && e.uint32(8).int32(u.image_quality), u.lock_after_session_end !== 0 && e.uint32(16).int32(u.lock_after_session_end), u.show_remote_cursor !== 0 && e.uint32(24).int32(u.show_remote_cursor), u.privacy_mode !== 0 && e.uint32(32).int32(u.privacy_mode), u.block_input !== 0 && e.uint32(40).int32(u.block_input), u.custom_image_quality !== 0 && e.uint32(48).int32(u.custom_image_quality), u.disable_audio !== 0 && e.uint32(56).int32(u.disable_audio), u.disable_clipboard !== 0 && e.uint32(64).int32(u.disable_clipboard), u.enable_file_transfer !== 0 && e.uint32(72).int32(u.enable_file_transfer), u.supported_decoding !== void 0 && qu.encode(u.supported_decoding, e.uint32(82).fork()).ldelim(), u.custom_fps !== 0 && e.uint32(88).int32(u.custom_fps), u.disable_keyboard !== 0 && e.uint32(96).int32(u.disable_keyboard), u.follow_remote_cursor !== 0 && e.uint32(120).int32(u.follow_remote_cursor), u.follow_remote_window !== 0 && e.uint32(128).int32(u.follow_remote_window), u.disable_camera !== 0 && e.uint32(136).int32(u.disable_camera), e
  4613. }, decode(u, e) {
  4614. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4615. let n = e === void 0 ? i.len : i.pos + e;
  4616. const a = Di();
  4617. for (; i.pos < n;) {
  4618. const t = i.uint32();
  4619. switch (t >>> 3) {
  4620. case 1:
  4621. if (t !== 8) break;
  4622. a.image_quality = i.int32();
  4623. continue;
  4624. case 2:
  4625. if (t !== 16) break;
  4626. a.lock_after_session_end = i.int32();
  4627. continue;
  4628. case 3:
  4629. if (t !== 24) break;
  4630. a.show_remote_cursor = i.int32();
  4631. continue;
  4632. case 4:
  4633. if (t !== 32) break;
  4634. a.privacy_mode = i.int32();
  4635. continue;
  4636. case 5:
  4637. if (t !== 40) break;
  4638. a.block_input = i.int32();
  4639. continue;
  4640. case 6:
  4641. if (t !== 48) break;
  4642. a.custom_image_quality = i.int32();
  4643. continue;
  4644. case 7:
  4645. if (t !== 56) break;
  4646. a.disable_audio = i.int32();
  4647. continue;
  4648. case 8:
  4649. if (t !== 64) break;
  4650. a.disable_clipboard = i.int32();
  4651. continue;
  4652. case 9:
  4653. if (t !== 72) break;
  4654. a.enable_file_transfer = i.int32();
  4655. continue;
  4656. case 10:
  4657. if (t !== 82) break;
  4658. a.supported_decoding = qu.decode(i, i.uint32());
  4659. continue;
  4660. case 11:
  4661. if (t !== 88) break;
  4662. a.custom_fps = i.int32();
  4663. continue;
  4664. case 12:
  4665. if (t !== 96) break;
  4666. a.disable_keyboard = i.int32();
  4667. continue;
  4668. case 15:
  4669. if (t !== 120) break;
  4670. a.follow_remote_cursor = i.int32();
  4671. continue;
  4672. case 16:
  4673. if (t !== 128) break;
  4674. a.follow_remote_window = i.int32();
  4675. continue;
  4676. case 17:
  4677. if (t !== 136) break;
  4678. a.disable_camera = i.int32();
  4679. continue
  4680. }
  4681. if ((t & 7) === 4 || t === 0) break;
  4682. i.skipType(t & 7)
  4683. }
  4684. return a
  4685. }, fromJSON(u) {
  4686. return {
  4687. image_quality: o(u.image_quality) ? Ia(u.image_quality) : 0,
  4688. lock_after_session_end: o(u.lock_after_session_end) ? X(u.lock_after_session_end) : 0,
  4689. show_remote_cursor: o(u.show_remote_cursor) ? X(u.show_remote_cursor) : 0,
  4690. privacy_mode: o(u.privacy_mode) ? X(u.privacy_mode) : 0,
  4691. block_input: o(u.block_input) ? X(u.block_input) : 0,
  4692. custom_image_quality: o(u.custom_image_quality) ? globalThis.Number(u.custom_image_quality) : 0,
  4693. disable_audio: o(u.disable_audio) ? X(u.disable_audio) : 0,
  4694. disable_clipboard: o(u.disable_clipboard) ? X(u.disable_clipboard) : 0,
  4695. enable_file_transfer: o(u.enable_file_transfer) ? X(u.enable_file_transfer) : 0,
  4696. supported_decoding: o(u.supported_decoding) ? qu.fromJSON(u.supported_decoding) : void 0,
  4697. custom_fps: o(u.custom_fps) ? globalThis.Number(u.custom_fps) : 0,
  4698. disable_keyboard: o(u.disable_keyboard) ? X(u.disable_keyboard) : 0,
  4699. follow_remote_cursor: o(u.follow_remote_cursor) ? X(u.follow_remote_cursor) : 0,
  4700. follow_remote_window: o(u.follow_remote_window) ? X(u.follow_remote_window) : 0,
  4701. disable_camera: o(u.disable_camera) ? X(u.disable_camera) : 0
  4702. }
  4703. }, toJSON(u) {
  4704. const e = {};
  4705. return u.image_quality !== 0 && (e.image_quality = Ta(u.image_quality)), u.lock_after_session_end !== 0 && (e.lock_after_session_end = Y(u.lock_after_session_end)), u.show_remote_cursor !== 0 && (e.show_remote_cursor = Y(u.show_remote_cursor)), u.privacy_mode !== 0 && (e.privacy_mode = Y(u.privacy_mode)), u.block_input !== 0 && (e.block_input = Y(u.block_input)), u.custom_image_quality !== 0 && (e.custom_image_quality = Math.round(u.custom_image_quality)), u.disable_audio !== 0 && (e.disable_audio = Y(u.disable_audio)), u.disable_clipboard !== 0 && (e.disable_clipboard = Y(u.disable_clipboard)), u.enable_file_transfer !== 0 && (e.enable_file_transfer = Y(u.enable_file_transfer)), u.supported_decoding !== void 0 && (e.supported_decoding = qu.toJSON(u.supported_decoding)), u.custom_fps !== 0 && (e.custom_fps = Math.round(u.custom_fps)), u.disable_keyboard !== 0 && (e.disable_keyboard = Y(u.disable_keyboard)), u.follow_remote_cursor !== 0 && (e.follow_remote_cursor = Y(u.follow_remote_cursor)), u.follow_remote_window !== 0 && (e.follow_remote_window = Y(u.follow_remote_window)), u.disable_camera !== 0 && (e.disable_camera = Y(u.disable_camera)), e
  4706. }, create(u) {
  4707. return R.fromPartial(u != null ? u : {})
  4708. }, fromPartial(u) {
  4709. var i, n, a, t, s, E, l, d, c, p, B, F, b, x;
  4710. const e = Di();
  4711. return e.image_quality = (i = u.image_quality) != null ? i : 0, e.lock_after_session_end = (n = u.lock_after_session_end) != null ? n : 0, e.show_remote_cursor = (a = u.show_remote_cursor) != null ? a : 0, e.privacy_mode = (t = u.privacy_mode) != null ? t : 0, e.block_input = (s = u.block_input) != null ? s : 0, e.custom_image_quality = (E = u.custom_image_quality) != null ? E : 0, e.disable_audio = (l = u.disable_audio) != null ? l : 0, e.disable_clipboard = (d = u.disable_clipboard) != null ? d : 0, e.enable_file_transfer = (c = u.enable_file_transfer) != null ? c : 0, e.supported_decoding = u.supported_decoding !== void 0 && u.supported_decoding !== null ? qu.fromPartial(u.supported_decoding) : void 0, e.custom_fps = (p = u.custom_fps) != null ? p : 0, e.disable_keyboard = (B = u.disable_keyboard) != null ? B : 0, e.follow_remote_cursor = (F = u.follow_remote_cursor) != null ? F : 0, e.follow_remote_window = (b = u.follow_remote_window) != null ? b : 0, e.disable_camera = (x = u.disable_camera) != null ? x : 0, e
  4712. }
  4713. };
  4714. function di() {
  4715. return {time: 0, from_client: !1, last_delay: 0, target_bitrate: 0}
  4716. }
  4717. const j0 = {
  4718. encode(u, e = r.Writer.create()) {
  4719. return u.time !== 0 && e.uint32(8).int64(u.time), u.from_client !== !1 && e.uint32(16).bool(u.from_client), u.last_delay !== 0 && e.uint32(24).uint32(u.last_delay), u.target_bitrate !== 0 && e.uint32(32).uint32(u.target_bitrate), e
  4720. }, decode(u, e) {
  4721. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4722. let n = e === void 0 ? i.len : i.pos + e;
  4723. const a = di();
  4724. for (; i.pos < n;) {
  4725. const t = i.uint32();
  4726. switch (t >>> 3) {
  4727. case 1:
  4728. if (t !== 8) break;
  4729. a.time = q(i.int64());
  4730. continue;
  4731. case 2:
  4732. if (t !== 16) break;
  4733. a.from_client = i.bool();
  4734. continue;
  4735. case 3:
  4736. if (t !== 24) break;
  4737. a.last_delay = i.uint32();
  4738. continue;
  4739. case 4:
  4740. if (t !== 32) break;
  4741. a.target_bitrate = i.uint32();
  4742. continue
  4743. }
  4744. if ((t & 7) === 4 || t === 0) break;
  4745. i.skipType(t & 7)
  4746. }
  4747. return a
  4748. }, fromJSON(u) {
  4749. return {
  4750. time: o(u.time) ? globalThis.Number(u.time) : 0,
  4751. from_client: o(u.from_client) ? globalThis.Boolean(u.from_client) : !1,
  4752. last_delay: o(u.last_delay) ? globalThis.Number(u.last_delay) : 0,
  4753. target_bitrate: o(u.target_bitrate) ? globalThis.Number(u.target_bitrate) : 0
  4754. }
  4755. }, toJSON(u) {
  4756. const e = {};
  4757. return u.time !== 0 && (e.time = Math.round(u.time)), u.from_client !== !1 && (e.from_client = u.from_client), u.last_delay !== 0 && (e.last_delay = Math.round(u.last_delay)), u.target_bitrate !== 0 && (e.target_bitrate = Math.round(u.target_bitrate)), e
  4758. }, create(u) {
  4759. return j0.fromPartial(u != null ? u : {})
  4760. }, fromPartial(u) {
  4761. var i, n, a, t;
  4762. const e = di();
  4763. return e.time = (i = u.time) != null ? i : 0, e.from_client = (n = u.from_client) != null ? n : !1, e.last_delay = (a = u.last_delay) != null ? a : 0, e.target_bitrate = (t = u.target_bitrate) != null ? t : 0, e
  4764. }
  4765. };
  4766. function ci() {
  4767. return {asymmetric_value: new Uint8Array(0), symmetric_value: new Uint8Array(0)}
  4768. }
  4769. const H = {
  4770. encode(u, e = r.Writer.create()) {
  4771. return u.asymmetric_value.length !== 0 && e.uint32(10).bytes(u.asymmetric_value), u.symmetric_value.length !== 0 && e.uint32(18).bytes(u.symmetric_value), e
  4772. }, decode(u, e) {
  4773. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4774. let n = e === void 0 ? i.len : i.pos + e;
  4775. const a = ci();
  4776. for (; i.pos < n;) {
  4777. const t = i.uint32();
  4778. switch (t >>> 3) {
  4779. case 1:
  4780. if (t !== 10) break;
  4781. a.asymmetric_value = i.bytes();
  4782. continue;
  4783. case 2:
  4784. if (t !== 18) break;
  4785. a.symmetric_value = i.bytes();
  4786. continue
  4787. }
  4788. if ((t & 7) === 4 || t === 0) break;
  4789. i.skipType(t & 7)
  4790. }
  4791. return a
  4792. }, fromJSON(u) {
  4793. return {
  4794. asymmetric_value: o(u.asymmetric_value) ? z(u.asymmetric_value) : new Uint8Array(0),
  4795. symmetric_value: o(u.symmetric_value) ? z(u.symmetric_value) : new Uint8Array(0)
  4796. }
  4797. }, toJSON(u) {
  4798. const e = {};
  4799. return u.asymmetric_value.length !== 0 && (e.asymmetric_value = P(u.asymmetric_value)), u.symmetric_value.length !== 0 && (e.symmetric_value = P(u.symmetric_value)), e
  4800. }, create(u) {
  4801. return H.fromPartial(u != null ? u : {})
  4802. }, fromPartial(u) {
  4803. var i, n;
  4804. const e = ci();
  4805. return e.asymmetric_value = (i = u.asymmetric_value) != null ? i : new Uint8Array(0), e.symmetric_value = (n = u.symmetric_value) != null ? n : new Uint8Array(0), e
  4806. }
  4807. };
  4808. function Ci() {
  4809. return {id: new Uint8Array(0)}
  4810. }
  4811. const N0 = {
  4812. encode(u, e = r.Writer.create()) {
  4813. return u.id.length !== 0 && e.uint32(10).bytes(u.id), e
  4814. }, decode(u, e) {
  4815. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4816. let n = e === void 0 ? i.len : i.pos + e;
  4817. const a = Ci();
  4818. for (; i.pos < n;) {
  4819. const t = i.uint32();
  4820. switch (t >>> 3) {
  4821. case 1:
  4822. if (t !== 10) break;
  4823. a.id = i.bytes();
  4824. continue
  4825. }
  4826. if ((t & 7) === 4 || t === 0) break;
  4827. i.skipType(t & 7)
  4828. }
  4829. return a
  4830. }, fromJSON(u) {
  4831. return {id: o(u.id) ? z(u.id) : new Uint8Array(0)}
  4832. }, toJSON(u) {
  4833. const e = {};
  4834. return u.id.length !== 0 && (e.id = P(u.id)), e
  4835. }, create(u) {
  4836. return N0.fromPartial(u != null ? u : {})
  4837. }, fromPartial(u) {
  4838. var i;
  4839. const e = Ci();
  4840. return e.id = (i = u.id) != null ? i : new Uint8Array(0), e
  4841. }
  4842. };
  4843. function pi() {
  4844. return {sample_rate: 0, channels: 0}
  4845. }
  4846. const O0 = {
  4847. encode(u, e = r.Writer.create()) {
  4848. return u.sample_rate !== 0 && e.uint32(8).uint32(u.sample_rate), u.channels !== 0 && e.uint32(16).uint32(u.channels), e
  4849. }, decode(u, e) {
  4850. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4851. let n = e === void 0 ? i.len : i.pos + e;
  4852. const a = pi();
  4853. for (; i.pos < n;) {
  4854. const t = i.uint32();
  4855. switch (t >>> 3) {
  4856. case 1:
  4857. if (t !== 8) break;
  4858. a.sample_rate = i.uint32();
  4859. continue;
  4860. case 2:
  4861. if (t !== 16) break;
  4862. a.channels = i.uint32();
  4863. continue
  4864. }
  4865. if ((t & 7) === 4 || t === 0) break;
  4866. i.skipType(t & 7)
  4867. }
  4868. return a
  4869. }, fromJSON(u) {
  4870. return {
  4871. sample_rate: o(u.sample_rate) ? globalThis.Number(u.sample_rate) : 0,
  4872. channels: o(u.channels) ? globalThis.Number(u.channels) : 0
  4873. }
  4874. }, toJSON(u) {
  4875. const e = {};
  4876. return u.sample_rate !== 0 && (e.sample_rate = Math.round(u.sample_rate)), u.channels !== 0 && (e.channels = Math.round(u.channels)), e
  4877. }, create(u) {
  4878. return O0.fromPartial(u != null ? u : {})
  4879. }, fromPartial(u) {
  4880. var i, n;
  4881. const e = pi();
  4882. return e.sample_rate = (i = u.sample_rate) != null ? i : 0, e.channels = (n = u.channels) != null ? n : 0, e
  4883. }
  4884. };
  4885. function Bi() {
  4886. return {data: new Uint8Array(0)}
  4887. }
  4888. const U0 = {
  4889. encode(u, e = r.Writer.create()) {
  4890. return u.data.length !== 0 && e.uint32(10).bytes(u.data), e
  4891. }, decode(u, e) {
  4892. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4893. let n = e === void 0 ? i.len : i.pos + e;
  4894. const a = Bi();
  4895. for (; i.pos < n;) {
  4896. const t = i.uint32();
  4897. switch (t >>> 3) {
  4898. case 1:
  4899. if (t !== 10) break;
  4900. a.data = i.bytes();
  4901. continue
  4902. }
  4903. if ((t & 7) === 4 || t === 0) break;
  4904. i.skipType(t & 7)
  4905. }
  4906. return a
  4907. }, fromJSON(u) {
  4908. return {data: o(u.data) ? z(u.data) : new Uint8Array(0)}
  4909. }, toJSON(u) {
  4910. const e = {};
  4911. return u.data.length !== 0 && (e.data = P(u.data)), e
  4912. }, create(u) {
  4913. return U0.fromPartial(u != null ? u : {})
  4914. }, fromPartial(u) {
  4915. var i;
  4916. const e = Bi();
  4917. return e.data = (i = u.data) != null ? i : new Uint8Array(0), e
  4918. }
  4919. };
  4920. function Ai() {
  4921. return {msgtype: "", title: "", text: "", link: ""}
  4922. }
  4923. const M0 = {
  4924. encode(u, e = r.Writer.create()) {
  4925. return u.msgtype !== "" && e.uint32(10).string(u.msgtype), u.title !== "" && e.uint32(18).string(u.title), u.text !== "" && e.uint32(26).string(u.text), u.link !== "" && e.uint32(34).string(u.link), e
  4926. }, decode(u, e) {
  4927. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4928. let n = e === void 0 ? i.len : i.pos + e;
  4929. const a = Ai();
  4930. for (; i.pos < n;) {
  4931. const t = i.uint32();
  4932. switch (t >>> 3) {
  4933. case 1:
  4934. if (t !== 10) break;
  4935. a.msgtype = i.string();
  4936. continue;
  4937. case 2:
  4938. if (t !== 18) break;
  4939. a.title = i.string();
  4940. continue;
  4941. case 3:
  4942. if (t !== 26) break;
  4943. a.text = i.string();
  4944. continue;
  4945. case 4:
  4946. if (t !== 34) break;
  4947. a.link = i.string();
  4948. continue
  4949. }
  4950. if ((t & 7) === 4 || t === 0) break;
  4951. i.skipType(t & 7)
  4952. }
  4953. return a
  4954. }, fromJSON(u) {
  4955. return {
  4956. msgtype: o(u.msgtype) ? globalThis.String(u.msgtype) : "",
  4957. title: o(u.title) ? globalThis.String(u.title) : "",
  4958. text: o(u.text) ? globalThis.String(u.text) : "",
  4959. link: o(u.link) ? globalThis.String(u.link) : ""
  4960. }
  4961. }, toJSON(u) {
  4962. const e = {};
  4963. return u.msgtype !== "" && (e.msgtype = u.msgtype), u.title !== "" && (e.title = u.title), u.text !== "" && (e.text = u.text), u.link !== "" && (e.link = u.link), e
  4964. }, create(u) {
  4965. return M0.fromPartial(u != null ? u : {})
  4966. }, fromPartial(u) {
  4967. var i, n, a, t;
  4968. const e = Ai();
  4969. return e.msgtype = (i = u.msgtype) != null ? i : "", e.title = (n = u.title) != null ? n : "", e.text = (a = u.text) != null ? a : "", e.link = (t = u.link) != null ? t : "", e
  4970. }
  4971. };
  4972. function mi() {
  4973. return {privacy_mode_state: void 0, block_input_state: void 0, details: "", impl_key: ""}
  4974. }
  4975. const L0 = {
  4976. encode(u, e = r.Writer.create()) {
  4977. return u.privacy_mode_state !== void 0 && e.uint32(8).int32(u.privacy_mode_state), u.block_input_state !== void 0 && e.uint32(16).int32(u.block_input_state), u.details !== "" && e.uint32(26).string(u.details), u.impl_key !== "" && e.uint32(34).string(u.impl_key), e
  4978. }, decode(u, e) {
  4979. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4980. let n = e === void 0 ? i.len : i.pos + e;
  4981. const a = mi();
  4982. for (; i.pos < n;) {
  4983. const t = i.uint32();
  4984. switch (t >>> 3) {
  4985. case 1:
  4986. if (t !== 8) break;
  4987. a.privacy_mode_state = i.int32();
  4988. continue;
  4989. case 2:
  4990. if (t !== 16) break;
  4991. a.block_input_state = i.int32();
  4992. continue;
  4993. case 3:
  4994. if (t !== 26) break;
  4995. a.details = i.string();
  4996. continue;
  4997. case 4:
  4998. if (t !== 34) break;
  4999. a.impl_key = i.string();
  5000. continue
  5001. }
  5002. if ((t & 7) === 4 || t === 0) break;
  5003. i.skipType(t & 7)
  5004. }
  5005. return a
  5006. }, fromJSON(u) {
  5007. return {
  5008. privacy_mode_state: o(u.privacy_mode_state) ? qa(u.privacy_mode_state) : void 0,
  5009. block_input_state: o(u.block_input_state) ? Wa(u.block_input_state) : void 0,
  5010. details: o(u.details) ? globalThis.String(u.details) : "",
  5011. impl_key: o(u.impl_key) ? globalThis.String(u.impl_key) : ""
  5012. }
  5013. }, toJSON(u) {
  5014. const e = {};
  5015. return u.privacy_mode_state !== void 0 && (e.privacy_mode_state = Ka(u.privacy_mode_state)), u.block_input_state !== void 0 && (e.block_input_state = Va(u.block_input_state)), u.details !== "" && (e.details = u.details), u.impl_key !== "" && (e.impl_key = u.impl_key), e
  5016. }, create(u) {
  5017. return L0.fromPartial(u != null ? u : {})
  5018. }, fromPartial(u) {
  5019. var i, n, a, t;
  5020. const e = mi();
  5021. return e.privacy_mode_state = (i = u.privacy_mode_state) != null ? i : void 0, e.block_input_state = (n = u.block_input_state) != null ? n : void 0, e.details = (a = u.details) != null ? a : "", e.impl_key = (t = u.impl_key) != null ? t : "", e
  5022. }
  5023. };
  5024. function Fi() {
  5025. return {username: "", password: ""}
  5026. }
  5027. const Ku = {
  5028. encode(u, e = r.Writer.create()) {
  5029. return u.username !== "" && e.uint32(10).string(u.username), u.password !== "" && e.uint32(18).string(u.password), e
  5030. }, decode(u, e) {
  5031. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5032. let n = e === void 0 ? i.len : i.pos + e;
  5033. const a = Fi();
  5034. for (; i.pos < n;) {
  5035. const t = i.uint32();
  5036. switch (t >>> 3) {
  5037. case 1:
  5038. if (t !== 10) break;
  5039. a.username = i.string();
  5040. continue;
  5041. case 2:
  5042. if (t !== 18) break;
  5043. a.password = i.string();
  5044. continue
  5045. }
  5046. if ((t & 7) === 4 || t === 0) break;
  5047. i.skipType(t & 7)
  5048. }
  5049. return a
  5050. }, fromJSON(u) {
  5051. return {
  5052. username: o(u.username) ? globalThis.String(u.username) : "",
  5053. password: o(u.password) ? globalThis.String(u.password) : ""
  5054. }
  5055. }, toJSON(u) {
  5056. const e = {};
  5057. return u.username !== "" && (e.username = u.username), u.password !== "" && (e.password = u.password), e
  5058. }, create(u) {
  5059. return Ku.fromPartial(u != null ? u : {})
  5060. }, fromPartial(u) {
  5061. var i, n;
  5062. const e = Fi();
  5063. return e.username = (i = u.username) != null ? i : "", e.password = (n = u.password) != null ? n : "", e
  5064. }
  5065. };
  5066. function _i() {
  5067. return {direct: void 0, logon: void 0}
  5068. }
  5069. const pu = {
  5070. encode(u, e = r.Writer.create()) {
  5071. return u.direct !== void 0 && e.uint32(8).bool(u.direct), u.logon !== void 0 && Ku.encode(u.logon, e.uint32(18).fork()).ldelim(), e
  5072. }, decode(u, e) {
  5073. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5074. let n = e === void 0 ? i.len : i.pos + e;
  5075. const a = _i();
  5076. for (; i.pos < n;) {
  5077. const t = i.uint32();
  5078. switch (t >>> 3) {
  5079. case 1:
  5080. if (t !== 8) break;
  5081. a.direct = i.bool();
  5082. continue;
  5083. case 2:
  5084. if (t !== 18) break;
  5085. a.logon = Ku.decode(i, i.uint32());
  5086. continue
  5087. }
  5088. if ((t & 7) === 4 || t === 0) break;
  5089. i.skipType(t & 7)
  5090. }
  5091. return a
  5092. }, fromJSON(u) {
  5093. return {
  5094. direct: o(u.direct) ? globalThis.Boolean(u.direct) : void 0,
  5095. logon: o(u.logon) ? Ku.fromJSON(u.logon) : void 0
  5096. }
  5097. }, toJSON(u) {
  5098. const e = {};
  5099. return u.direct !== void 0 && (e.direct = u.direct), u.logon !== void 0 && (e.logon = Ku.toJSON(u.logon)), e
  5100. }, create(u) {
  5101. return pu.fromPartial(u != null ? u : {})
  5102. }, fromPartial(u) {
  5103. var i;
  5104. const e = _i();
  5105. return e.direct = (i = u.direct) != null ? i : void 0, e.logon = u.logon !== void 0 && u.logon !== null ? Ku.fromPartial(u.logon) : void 0, e
  5106. }
  5107. };
  5108. function vi() {
  5109. return {uuid: new Uint8Array(0)}
  5110. }
  5111. const W0 = {
  5112. encode(u, e = r.Writer.create()) {
  5113. return u.uuid.length !== 0 && e.uint32(10).bytes(u.uuid), e
  5114. }, decode(u, e) {
  5115. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5116. let n = e === void 0 ? i.len : i.pos + e;
  5117. const a = vi();
  5118. for (; i.pos < n;) {
  5119. const t = i.uint32();
  5120. switch (t >>> 3) {
  5121. case 1:
  5122. if (t !== 10) break;
  5123. a.uuid = i.bytes();
  5124. continue
  5125. }
  5126. if ((t & 7) === 4 || t === 0) break;
  5127. i.skipType(t & 7)
  5128. }
  5129. return a
  5130. }, fromJSON(u) {
  5131. return {uuid: o(u.uuid) ? z(u.uuid) : new Uint8Array(0)}
  5132. }, toJSON(u) {
  5133. const e = {};
  5134. return u.uuid.length !== 0 && (e.uuid = P(u.uuid)), e
  5135. }, create(u) {
  5136. return W0.fromPartial(u != null ? u : {})
  5137. }, fromPartial(u) {
  5138. var i;
  5139. const e = vi();
  5140. return e.uuid = (i = u.uuid) != null ? i : new Uint8Array(0), e
  5141. }
  5142. };
  5143. function gi() {
  5144. return {uuid: new Uint8Array(0), lr: void 0}
  5145. }
  5146. const V0 = {
  5147. encode(u, e = r.Writer.create()) {
  5148. return u.uuid.length !== 0 && e.uint32(10).bytes(u.uuid), u.lr !== void 0 && J.encode(u.lr, e.uint32(18).fork()).ldelim(), e
  5149. }, decode(u, e) {
  5150. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5151. let n = e === void 0 ? i.len : i.pos + e;
  5152. const a = gi();
  5153. for (; i.pos < n;) {
  5154. const t = i.uint32();
  5155. switch (t >>> 3) {
  5156. case 1:
  5157. if (t !== 10) break;
  5158. a.uuid = i.bytes();
  5159. continue;
  5160. case 2:
  5161. if (t !== 18) break;
  5162. a.lr = J.decode(i, i.uint32());
  5163. continue
  5164. }
  5165. if ((t & 7) === 4 || t === 0) break;
  5166. i.skipType(t & 7)
  5167. }
  5168. return a
  5169. }, fromJSON(u) {
  5170. return {uuid: o(u.uuid) ? z(u.uuid) : new Uint8Array(0), lr: o(u.lr) ? J.fromJSON(u.lr) : void 0}
  5171. }, toJSON(u) {
  5172. const e = {};
  5173. return u.uuid.length !== 0 && (e.uuid = P(u.uuid)), u.lr !== void 0 && (e.lr = J.toJSON(u.lr)), e
  5174. }, create(u) {
  5175. return V0.fromPartial(u != null ? u : {})
  5176. }, fromPartial(u) {
  5177. var i;
  5178. const e = gi();
  5179. return e.uuid = (i = u.uuid) != null ? i : new Uint8Array(0), e.lr = u.lr !== void 0 && u.lr !== null ? J.fromPartial(u.lr) : void 0, e
  5180. }
  5181. };
  5182. function ki() {
  5183. return {}
  5184. }
  5185. const q0 = {
  5186. encode(u, e = r.Writer.create()) {
  5187. return e
  5188. }, decode(u, e) {
  5189. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5190. let n = e === void 0 ? i.len : i.pos + e;
  5191. const a = ki();
  5192. for (; i.pos < n;) {
  5193. const t = i.uint32();
  5194. if ((t & 7) === 4 || t === 0) break;
  5195. i.skipType(t & 7)
  5196. }
  5197. return a
  5198. }, fromJSON(u) {
  5199. return {}
  5200. }, toJSON(u) {
  5201. return {}
  5202. }, create(u) {
  5203. return q0.fromPartial(u != null ? u : {})
  5204. }, fromPartial(u) {
  5205. return ki()
  5206. }
  5207. };
  5208. function hi() {
  5209. return {id: "", content: new Uint8Array(0)}
  5210. }
  5211. const K0 = {
  5212. encode(u, e = r.Writer.create()) {
  5213. return u.id !== "" && e.uint32(10).string(u.id), u.content.length !== 0 && e.uint32(18).bytes(u.content), e
  5214. }, decode(u, e) {
  5215. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5216. let n = e === void 0 ? i.len : i.pos + e;
  5217. const a = hi();
  5218. for (; i.pos < n;) {
  5219. const t = i.uint32();
  5220. switch (t >>> 3) {
  5221. case 1:
  5222. if (t !== 10) break;
  5223. a.id = i.string();
  5224. continue;
  5225. case 2:
  5226. if (t !== 18) break;
  5227. a.content = i.bytes();
  5228. continue
  5229. }
  5230. if ((t & 7) === 4 || t === 0) break;
  5231. i.skipType(t & 7)
  5232. }
  5233. return a
  5234. }, fromJSON(u) {
  5235. return {id: o(u.id) ? globalThis.String(u.id) : "", content: o(u.content) ? z(u.content) : new Uint8Array(0)}
  5236. }, toJSON(u) {
  5237. const e = {};
  5238. return u.id !== "" && (e.id = u.id), u.content.length !== 0 && (e.content = P(u.content)), e
  5239. }, create(u) {
  5240. return K0.fromPartial(u != null ? u : {})
  5241. }, fromPartial(u) {
  5242. var i, n;
  5243. const e = hi();
  5244. return e.id = (i = u.id) != null ? i : "", e.content = (n = u.content) != null ? n : new Uint8Array(0), e
  5245. }
  5246. };
  5247. function fi() {
  5248. return {id: "", name: "", msg: ""}
  5249. }
  5250. const H0 = {
  5251. encode(u, e = r.Writer.create()) {
  5252. return u.id !== "" && e.uint32(10).string(u.id), u.name !== "" && e.uint32(18).string(u.name), u.msg !== "" && e.uint32(26).string(u.msg), e
  5253. }, decode(u, e) {
  5254. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5255. let n = e === void 0 ? i.len : i.pos + e;
  5256. const a = fi();
  5257. for (; i.pos < n;) {
  5258. const t = i.uint32();
  5259. switch (t >>> 3) {
  5260. case 1:
  5261. if (t !== 10) break;
  5262. a.id = i.string();
  5263. continue;
  5264. case 2:
  5265. if (t !== 18) break;
  5266. a.name = i.string();
  5267. continue;
  5268. case 3:
  5269. if (t !== 26) break;
  5270. a.msg = i.string();
  5271. continue
  5272. }
  5273. if ((t & 7) === 4 || t === 0) break;
  5274. i.skipType(t & 7)
  5275. }
  5276. return a
  5277. }, fromJSON(u) {
  5278. return {
  5279. id: o(u.id) ? globalThis.String(u.id) : "",
  5280. name: o(u.name) ? globalThis.String(u.name) : "",
  5281. msg: o(u.msg) ? globalThis.String(u.msg) : ""
  5282. }
  5283. }, toJSON(u) {
  5284. const e = {};
  5285. return u.id !== "" && (e.id = u.id), u.name !== "" && (e.name = u.name), u.msg !== "" && (e.msg = u.msg), e
  5286. }, create(u) {
  5287. return H0.fromPartial(u != null ? u : {})
  5288. }, fromPartial(u) {
  5289. var i, n, a;
  5290. const e = fi();
  5291. return e.id = (i = u.id) != null ? i : "", e.name = (n = u.name) != null ? n : "", e.msg = (a = u.msg) != null ? a : "", e
  5292. }
  5293. };
  5294. function xi() {
  5295. return {sessions: [], current_sid: 0}
  5296. }
  5297. const J0 = {
  5298. encode(u, e = r.Writer.create()) {
  5299. for (const i of u.sessions) c0.encode(i, e.uint32(10).fork()).ldelim();
  5300. return u.current_sid !== 0 && e.uint32(16).uint32(u.current_sid), e
  5301. }, decode(u, e) {
  5302. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5303. let n = e === void 0 ? i.len : i.pos + e;
  5304. const a = xi();
  5305. for (; i.pos < n;) {
  5306. const t = i.uint32();
  5307. switch (t >>> 3) {
  5308. case 1:
  5309. if (t !== 10) break;
  5310. a.sessions.push(c0.decode(i, i.uint32()));
  5311. continue;
  5312. case 2:
  5313. if (t !== 16) break;
  5314. a.current_sid = i.uint32();
  5315. continue
  5316. }
  5317. if ((t & 7) === 4 || t === 0) break;
  5318. i.skipType(t & 7)
  5319. }
  5320. return a
  5321. }, fromJSON(u) {
  5322. return {
  5323. sessions: globalThis.Array.isArray(u == null ? void 0 : u.sessions) ? u.sessions.map(e => c0.fromJSON(e)) : [],
  5324. current_sid: o(u.current_sid) ? globalThis.Number(u.current_sid) : 0
  5325. }
  5326. }, toJSON(u) {
  5327. var i;
  5328. const e = {};
  5329. return (i = u.sessions) != null && i.length && (e.sessions = u.sessions.map(n => c0.toJSON(n))), u.current_sid !== 0 && (e.current_sid = Math.round(u.current_sid)), e
  5330. }, create(u) {
  5331. return J0.fromPartial(u != null ? u : {})
  5332. }, fromPartial(u) {
  5333. var i, n;
  5334. const e = xi();
  5335. return e.sessions = ((i = u.sessions) == null ? void 0 : i.map(a => c0.fromPartial(a))) || [], e.current_sid = (n = u.current_sid) != null ? n : 0, e
  5336. }
  5337. };
  5338. function yi() {
  5339. return {switch_display: 0}
  5340. }
  5341. const G0 = {
  5342. encode(u, e = r.Writer.create()) {
  5343. return u.switch_display !== 0 && e.uint32(8).int32(u.switch_display), e
  5344. }, decode(u, e) {
  5345. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5346. let n = e === void 0 ? i.len : i.pos + e;
  5347. const a = yi();
  5348. for (; i.pos < n;) {
  5349. const t = i.uint32();
  5350. switch (t >>> 3) {
  5351. case 1:
  5352. if (t !== 8) break;
  5353. a.switch_display = i.int32();
  5354. continue
  5355. }
  5356. if ((t & 7) === 4 || t === 0) break;
  5357. i.skipType(t & 7)
  5358. }
  5359. return a
  5360. }, fromJSON(u) {
  5361. return {switch_display: o(u.switch_display) ? globalThis.Number(u.switch_display) : 0}
  5362. }, toJSON(u) {
  5363. const e = {};
  5364. return u.switch_display !== 0 && (e.switch_display = Math.round(u.switch_display)), e
  5365. }, create(u) {
  5366. return G0.fromPartial(u != null ? u : {})
  5367. }, fromPartial(u) {
  5368. var i;
  5369. const e = yi();
  5370. return e.switch_display = (i = u.switch_display) != null ? i : 0, e
  5371. }
  5372. };
  5373. function bi() {
  5374. return {
  5375. chat_message: void 0,
  5376. switch_display: void 0,
  5377. permission_info: void 0,
  5378. option: void 0,
  5379. audio_format: void 0,
  5380. close_reason: void 0,
  5381. refresh_video: void 0,
  5382. video_received: void 0,
  5383. back_notification: void 0,
  5384. restart_remote_device: void 0,
  5385. uac: void 0,
  5386. foreground_window_elevated: void 0,
  5387. stop_service: void 0,
  5388. elevation_request: void 0,
  5389. elevation_response: void 0,
  5390. portable_service_running: void 0,
  5391. switch_sides_request: void 0,
  5392. switch_back: void 0,
  5393. change_resolution: void 0,
  5394. plugin_request: void 0,
  5395. plugin_failure: void 0,
  5396. full_speed_fps: void 0,
  5397. auto_adjust_fps: void 0,
  5398. client_record_status: void 0,
  5399. capture_displays: void 0,
  5400. refresh_video_display: void 0,
  5401. toggle_virtual_display: void 0,
  5402. toggle_privacy_mode: void 0,
  5403. supported_encoding: void 0,
  5404. selected_sid: void 0,
  5405. change_display_resolution: void 0,
  5406. message_query: void 0,
  5407. follow_current_display: void 0
  5408. }
  5409. }
  5410. const f = {
  5411. encode(u, e = r.Writer.create()) {
  5412. return u.chat_message !== void 0 && gu.encode(u.chat_message, e.uint32(34).fork()).ldelim(), u.switch_display !== void 0 && Mu.encode(u.switch_display, e.uint32(42).fork()).ldelim(), u.permission_info !== void 0 && T0.encode(u.permission_info, e.uint32(50).fork()).ldelim(), u.option !== void 0 && R.encode(u.option, e.uint32(58).fork()).ldelim(), u.audio_format !== void 0 && O0.encode(u.audio_format, e.uint32(66).fork()).ldelim(), u.close_reason !== void 0 && e.uint32(74).string(u.close_reason), u.refresh_video !== void 0 && e.uint32(80).bool(u.refresh_video), u.video_received !== void 0 && e.uint32(96).bool(u.video_received), u.back_notification !== void 0 && L0.encode(u.back_notification, e.uint32(106).fork()).ldelim(), u.restart_remote_device !== void 0 && e.uint32(112).bool(u.restart_remote_device), u.uac !== void 0 && e.uint32(120).bool(u.uac), u.foreground_window_elevated !== void 0 && e.uint32(128).bool(u.foreground_window_elevated), u.stop_service !== void 0 && e.uint32(136).bool(u.stop_service), u.elevation_request !== void 0 && pu.encode(u.elevation_request, e.uint32(146).fork()).ldelim(), u.elevation_response !== void 0 && e.uint32(154).string(u.elevation_response), u.portable_service_running !== void 0 && e.uint32(160).bool(u.portable_service_running), u.switch_sides_request !== void 0 && W0.encode(u.switch_sides_request, e.uint32(170).fork()).ldelim(), u.switch_back !== void 0 && q0.encode(u.switch_back, e.uint32(178).fork()).ldelim(), u.change_resolution !== void 0 && v.encode(u.change_resolution, e.uint32(194).fork()).ldelim(), u.plugin_request !== void 0 && K0.encode(u.plugin_request, e.uint32(202).fork()).ldelim(), u.plugin_failure !== void 0 && H0.encode(u.plugin_failure, e.uint32(210).fork()).ldelim(), u.full_speed_fps !== void 0 && e.uint32(216).uint32(u.full_speed_fps), u.auto_adjust_fps !== void 0 && e.uint32(224).uint32(u.auto_adjust_fps), u.client_record_status !== void 0 && e.uint32(232).bool(u.client_record_status), u.capture_displays !== void 0 && Lu.encode(u.capture_displays, e.uint32(242).fork()).ldelim(), u.refresh_video_display !== void 0 && e.uint32(248).int32(u.refresh_video_display), u.toggle_virtual_display !== void 0 && Wu.encode(u.toggle_virtual_display, e.uint32(258).fork()).ldelim(), u.toggle_privacy_mode !== void 0 && Vu.encode(u.toggle_privacy_mode, e.uint32(266).fork()).ldelim(), u.supported_encoding !== void 0 && Z.encode(u.supported_encoding, e.uint32(274).fork()).ldelim(), u.selected_sid !== void 0 && e.uint32(280).uint32(u.selected_sid), u.change_display_resolution !== void 0 && Uu.encode(u.change_display_resolution, e.uint32(290).fork()).ldelim(), u.message_query !== void 0 && G0.encode(u.message_query, e.uint32(298).fork()).ldelim(), u.follow_current_display !== void 0 && e.uint32(304).int32(u.follow_current_display), e
  5413. }, decode(u, e) {
  5414. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5415. let n = e === void 0 ? i.len : i.pos + e;
  5416. const a = bi();
  5417. for (; i.pos < n;) {
  5418. const t = i.uint32();
  5419. switch (t >>> 3) {
  5420. case 4:
  5421. if (t !== 34) break;
  5422. a.chat_message = gu.decode(i, i.uint32());
  5423. continue;
  5424. case 5:
  5425. if (t !== 42) break;
  5426. a.switch_display = Mu.decode(i, i.uint32());
  5427. continue;
  5428. case 6:
  5429. if (t !== 50) break;
  5430. a.permission_info = T0.decode(i, i.uint32());
  5431. continue;
  5432. case 7:
  5433. if (t !== 58) break;
  5434. a.option = R.decode(i, i.uint32());
  5435. continue;
  5436. case 8:
  5437. if (t !== 66) break;
  5438. a.audio_format = O0.decode(i, i.uint32());
  5439. continue;
  5440. case 9:
  5441. if (t !== 74) break;
  5442. a.close_reason = i.string();
  5443. continue;
  5444. case 10:
  5445. if (t !== 80) break;
  5446. a.refresh_video = i.bool();
  5447. continue;
  5448. case 12:
  5449. if (t !== 96) break;
  5450. a.video_received = i.bool();
  5451. continue;
  5452. case 13:
  5453. if (t !== 106) break;
  5454. a.back_notification = L0.decode(i, i.uint32());
  5455. continue;
  5456. case 14:
  5457. if (t !== 112) break;
  5458. a.restart_remote_device = i.bool();
  5459. continue;
  5460. case 15:
  5461. if (t !== 120) break;
  5462. a.uac = i.bool();
  5463. continue;
  5464. case 16:
  5465. if (t !== 128) break;
  5466. a.foreground_window_elevated = i.bool();
  5467. continue;
  5468. case 17:
  5469. if (t !== 136) break;
  5470. a.stop_service = i.bool();
  5471. continue;
  5472. case 18:
  5473. if (t !== 146) break;
  5474. a.elevation_request = pu.decode(i, i.uint32());
  5475. continue;
  5476. case 19:
  5477. if (t !== 154) break;
  5478. a.elevation_response = i.string();
  5479. continue;
  5480. case 20:
  5481. if (t !== 160) break;
  5482. a.portable_service_running = i.bool();
  5483. continue;
  5484. case 21:
  5485. if (t !== 170) break;
  5486. a.switch_sides_request = W0.decode(i, i.uint32());
  5487. continue;
  5488. case 22:
  5489. if (t !== 178) break;
  5490. a.switch_back = q0.decode(i, i.uint32());
  5491. continue;
  5492. case 24:
  5493. if (t !== 194) break;
  5494. a.change_resolution = v.decode(i, i.uint32());
  5495. continue;
  5496. case 25:
  5497. if (t !== 202) break;
  5498. a.plugin_request = K0.decode(i, i.uint32());
  5499. continue;
  5500. case 26:
  5501. if (t !== 210) break;
  5502. a.plugin_failure = H0.decode(i, i.uint32());
  5503. continue;
  5504. case 27:
  5505. if (t !== 216) break;
  5506. a.full_speed_fps = i.uint32();
  5507. continue;
  5508. case 28:
  5509. if (t !== 224) break;
  5510. a.auto_adjust_fps = i.uint32();
  5511. continue;
  5512. case 29:
  5513. if (t !== 232) break;
  5514. a.client_record_status = i.bool();
  5515. continue;
  5516. case 30:
  5517. if (t !== 242) break;
  5518. a.capture_displays = Lu.decode(i, i.uint32());
  5519. continue;
  5520. case 31:
  5521. if (t !== 248) break;
  5522. a.refresh_video_display = i.int32();
  5523. continue;
  5524. case 32:
  5525. if (t !== 258) break;
  5526. a.toggle_virtual_display = Wu.decode(i, i.uint32());
  5527. continue;
  5528. case 33:
  5529. if (t !== 266) break;
  5530. a.toggle_privacy_mode = Vu.decode(i, i.uint32());
  5531. continue;
  5532. case 34:
  5533. if (t !== 274) break;
  5534. a.supported_encoding = Z.decode(i, i.uint32());
  5535. continue;
  5536. case 35:
  5537. if (t !== 280) break;
  5538. a.selected_sid = i.uint32();
  5539. continue;
  5540. case 36:
  5541. if (t !== 290) break;
  5542. a.change_display_resolution = Uu.decode(i, i.uint32());
  5543. continue;
  5544. case 37:
  5545. if (t !== 298) break;
  5546. a.message_query = G0.decode(i, i.uint32());
  5547. continue;
  5548. case 38:
  5549. if (t !== 304) break;
  5550. a.follow_current_display = i.int32();
  5551. continue
  5552. }
  5553. if ((t & 7) === 4 || t === 0) break;
  5554. i.skipType(t & 7)
  5555. }
  5556. return a
  5557. }, fromJSON(u) {
  5558. return {
  5559. chat_message: o(u.chat_message) ? gu.fromJSON(u.chat_message) : void 0,
  5560. switch_display: o(u.switch_display) ? Mu.fromJSON(u.switch_display) : void 0,
  5561. permission_info: o(u.permission_info) ? T0.fromJSON(u.permission_info) : void 0,
  5562. option: o(u.option) ? R.fromJSON(u.option) : void 0,
  5563. audio_format: o(u.audio_format) ? O0.fromJSON(u.audio_format) : void 0,
  5564. close_reason: o(u.close_reason) ? globalThis.String(u.close_reason) : void 0,
  5565. refresh_video: o(u.refresh_video) ? globalThis.Boolean(u.refresh_video) : void 0,
  5566. video_received: o(u.video_received) ? globalThis.Boolean(u.video_received) : void 0,
  5567. back_notification: o(u.back_notification) ? L0.fromJSON(u.back_notification) : void 0,
  5568. restart_remote_device: o(u.restart_remote_device) ? globalThis.Boolean(u.restart_remote_device) : void 0,
  5569. uac: o(u.uac) ? globalThis.Boolean(u.uac) : void 0,
  5570. foreground_window_elevated: o(u.foreground_window_elevated) ? globalThis.Boolean(u.foreground_window_elevated) : void 0,
  5571. stop_service: o(u.stop_service) ? globalThis.Boolean(u.stop_service) : void 0,
  5572. elevation_request: o(u.elevation_request) ? pu.fromJSON(u.elevation_request) : void 0,
  5573. elevation_response: o(u.elevation_response) ? globalThis.String(u.elevation_response) : void 0,
  5574. portable_service_running: o(u.portable_service_running) ? globalThis.Boolean(u.portable_service_running) : void 0,
  5575. switch_sides_request: o(u.switch_sides_request) ? W0.fromJSON(u.switch_sides_request) : void 0,
  5576. switch_back: o(u.switch_back) ? q0.fromJSON(u.switch_back) : void 0,
  5577. change_resolution: o(u.change_resolution) ? v.fromJSON(u.change_resolution) : void 0,
  5578. plugin_request: o(u.plugin_request) ? K0.fromJSON(u.plugin_request) : void 0,
  5579. plugin_failure: o(u.plugin_failure) ? H0.fromJSON(u.plugin_failure) : void 0,
  5580. full_speed_fps: o(u.full_speed_fps) ? globalThis.Number(u.full_speed_fps) : void 0,
  5581. auto_adjust_fps: o(u.auto_adjust_fps) ? globalThis.Number(u.auto_adjust_fps) : void 0,
  5582. client_record_status: o(u.client_record_status) ? globalThis.Boolean(u.client_record_status) : void 0,
  5583. capture_displays: o(u.capture_displays) ? Lu.fromJSON(u.capture_displays) : void 0,
  5584. refresh_video_display: o(u.refresh_video_display) ? globalThis.Number(u.refresh_video_display) : void 0,
  5585. toggle_virtual_display: o(u.toggle_virtual_display) ? Wu.fromJSON(u.toggle_virtual_display) : void 0,
  5586. toggle_privacy_mode: o(u.toggle_privacy_mode) ? Vu.fromJSON(u.toggle_privacy_mode) : void 0,
  5587. supported_encoding: o(u.supported_encoding) ? Z.fromJSON(u.supported_encoding) : void 0,
  5588. selected_sid: o(u.selected_sid) ? globalThis.Number(u.selected_sid) : void 0,
  5589. change_display_resolution: o(u.change_display_resolution) ? Uu.fromJSON(u.change_display_resolution) : void 0,
  5590. message_query: o(u.message_query) ? G0.fromJSON(u.message_query) : void 0,
  5591. follow_current_display: o(u.follow_current_display) ? globalThis.Number(u.follow_current_display) : void 0
  5592. }
  5593. }, toJSON(u) {
  5594. const e = {};
  5595. return u.chat_message !== void 0 && (e.chat_message = gu.toJSON(u.chat_message)), u.switch_display !== void 0 && (e.switch_display = Mu.toJSON(u.switch_display)), u.permission_info !== void 0 && (e.permission_info = T0.toJSON(u.permission_info)), u.option !== void 0 && (e.option = R.toJSON(u.option)), u.audio_format !== void 0 && (e.audio_format = O0.toJSON(u.audio_format)), u.close_reason !== void 0 && (e.close_reason = u.close_reason), u.refresh_video !== void 0 && (e.refresh_video = u.refresh_video), u.video_received !== void 0 && (e.video_received = u.video_received), u.back_notification !== void 0 && (e.back_notification = L0.toJSON(u.back_notification)), u.restart_remote_device !== void 0 && (e.restart_remote_device = u.restart_remote_device), u.uac !== void 0 && (e.uac = u.uac), u.foreground_window_elevated !== void 0 && (e.foreground_window_elevated = u.foreground_window_elevated), u.stop_service !== void 0 && (e.stop_service = u.stop_service), u.elevation_request !== void 0 && (e.elevation_request = pu.toJSON(u.elevation_request)), u.elevation_response !== void 0 && (e.elevation_response = u.elevation_response), u.portable_service_running !== void 0 && (e.portable_service_running = u.portable_service_running), u.switch_sides_request !== void 0 && (e.switch_sides_request = W0.toJSON(u.switch_sides_request)), u.switch_back !== void 0 && (e.switch_back = q0.toJSON(u.switch_back)), u.change_resolution !== void 0 && (e.change_resolution = v.toJSON(u.change_resolution)), u.plugin_request !== void 0 && (e.plugin_request = K0.toJSON(u.plugin_request)), u.plugin_failure !== void 0 && (e.plugin_failure = H0.toJSON(u.plugin_failure)), u.full_speed_fps !== void 0 && (e.full_speed_fps = Math.round(u.full_speed_fps)), u.auto_adjust_fps !== void 0 && (e.auto_adjust_fps = Math.round(u.auto_adjust_fps)), u.client_record_status !== void 0 && (e.client_record_status = u.client_record_status), u.capture_displays !== void 0 && (e.capture_displays = Lu.toJSON(u.capture_displays)), u.refresh_video_display !== void 0 && (e.refresh_video_display = Math.round(u.refresh_video_display)), u.toggle_virtual_display !== void 0 && (e.toggle_virtual_display = Wu.toJSON(u.toggle_virtual_display)), u.toggle_privacy_mode !== void 0 && (e.toggle_privacy_mode = Vu.toJSON(u.toggle_privacy_mode)), u.supported_encoding !== void 0 && (e.supported_encoding = Z.toJSON(u.supported_encoding)), u.selected_sid !== void 0 && (e.selected_sid = Math.round(u.selected_sid)), u.change_display_resolution !== void 0 && (e.change_display_resolution = Uu.toJSON(u.change_display_resolution)), u.message_query !== void 0 && (e.message_query = G0.toJSON(u.message_query)), u.follow_current_display !== void 0 && (e.follow_current_display = Math.round(u.follow_current_display)), e
  5596. }, create(u) {
  5597. return f.fromPartial(u != null ? u : {})
  5598. }, fromPartial(u) {
  5599. var i, n, a, t, s, E, l, d, c, p, B, F, b, x, k;
  5600. const e = bi();
  5601. return e.chat_message = u.chat_message !== void 0 && u.chat_message !== null ? gu.fromPartial(u.chat_message) : void 0, e.switch_display = u.switch_display !== void 0 && u.switch_display !== null ? Mu.fromPartial(u.switch_display) : void 0, e.permission_info = u.permission_info !== void 0 && u.permission_info !== null ? T0.fromPartial(u.permission_info) : void 0, e.option = u.option !== void 0 && u.option !== null ? R.fromPartial(u.option) : void 0, e.audio_format = u.audio_format !== void 0 && u.audio_format !== null ? O0.fromPartial(u.audio_format) : void 0, e.close_reason = (i = u.close_reason) != null ? i : void 0, e.refresh_video = (n = u.refresh_video) != null ? n : void 0, e.video_received = (a = u.video_received) != null ? a : void 0, e.back_notification = u.back_notification !== void 0 && u.back_notification !== null ? L0.fromPartial(u.back_notification) : void 0, e.restart_remote_device = (t = u.restart_remote_device) != null ? t : void 0, e.uac = (s = u.uac) != null ? s : void 0, e.foreground_window_elevated = (E = u.foreground_window_elevated) != null ? E : void 0, e.stop_service = (l = u.stop_service) != null ? l : void 0, e.elevation_request = u.elevation_request !== void 0 && u.elevation_request !== null ? pu.fromPartial(u.elevation_request) : void 0, e.elevation_response = (d = u.elevation_response) != null ? d : void 0, e.portable_service_running = (c = u.portable_service_running) != null ? c : void 0, e.switch_sides_request = u.switch_sides_request !== void 0 && u.switch_sides_request !== null ? W0.fromPartial(u.switch_sides_request) : void 0, e.switch_back = u.switch_back !== void 0 && u.switch_back !== null ? q0.fromPartial(u.switch_back) : void 0, e.change_resolution = u.change_resolution !== void 0 && u.change_resolution !== null ? v.fromPartial(u.change_resolution) : void 0, e.plugin_request = u.plugin_request !== void 0 && u.plugin_request !== null ? K0.fromPartial(u.plugin_request) : void 0, e.plugin_failure = u.plugin_failure !== void 0 && u.plugin_failure !== null ? H0.fromPartial(u.plugin_failure) : void 0, e.full_speed_fps = (p = u.full_speed_fps) != null ? p : void 0, e.auto_adjust_fps = (B = u.auto_adjust_fps) != null ? B : void 0, e.client_record_status = (F = u.client_record_status) != null ? F : void 0, e.capture_displays = u.capture_displays !== void 0 && u.capture_displays !== null ? Lu.fromPartial(u.capture_displays) : void 0, e.refresh_video_display = (b = u.refresh_video_display) != null ? b : void 0, e.toggle_virtual_display = u.toggle_virtual_display !== void 0 && u.toggle_virtual_display !== null ? Wu.fromPartial(u.toggle_virtual_display) : void 0, e.toggle_privacy_mode = u.toggle_privacy_mode !== void 0 && u.toggle_privacy_mode !== null ? Vu.fromPartial(u.toggle_privacy_mode) : void 0, e.supported_encoding = u.supported_encoding !== void 0 && u.supported_encoding !== null ? Z.fromPartial(u.supported_encoding) : void 0, e.selected_sid = (x = u.selected_sid) != null ? x : void 0, e.change_display_resolution = u.change_display_resolution !== void 0 && u.change_display_resolution !== null ? Uu.fromPartial(u.change_display_resolution) : void 0, e.message_query = u.message_query !== void 0 && u.message_query !== null ? G0.fromPartial(u.message_query) : void 0, e.follow_current_display = (k = u.follow_current_display) != null ? k : void 0, e
  5602. }
  5603. };
  5604. function wi() {
  5605. return {req_timestamp: 0, is_connect: !1}
  5606. }
  5607. const Z0 = {
  5608. encode(u, e = r.Writer.create()) {
  5609. return u.req_timestamp !== 0 && e.uint32(8).int64(u.req_timestamp), u.is_connect !== !1 && e.uint32(16).bool(u.is_connect), e
  5610. }, decode(u, e) {
  5611. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5612. let n = e === void 0 ? i.len : i.pos + e;
  5613. const a = wi();
  5614. for (; i.pos < n;) {
  5615. const t = i.uint32();
  5616. switch (t >>> 3) {
  5617. case 1:
  5618. if (t !== 8) break;
  5619. a.req_timestamp = q(i.int64());
  5620. continue;
  5621. case 2:
  5622. if (t !== 16) break;
  5623. a.is_connect = i.bool();
  5624. continue
  5625. }
  5626. if ((t & 7) === 4 || t === 0) break;
  5627. i.skipType(t & 7)
  5628. }
  5629. return a
  5630. }, fromJSON(u) {
  5631. return {
  5632. req_timestamp: o(u.req_timestamp) ? globalThis.Number(u.req_timestamp) : 0,
  5633. is_connect: o(u.is_connect) ? globalThis.Boolean(u.is_connect) : !1
  5634. }
  5635. }, toJSON(u) {
  5636. const e = {};
  5637. return u.req_timestamp !== 0 && (e.req_timestamp = Math.round(u.req_timestamp)), u.is_connect !== !1 && (e.is_connect = u.is_connect), e
  5638. }, create(u) {
  5639. return Z0.fromPartial(u != null ? u : {})
  5640. }, fromPartial(u) {
  5641. var i, n;
  5642. const e = wi();
  5643. return e.req_timestamp = (i = u.req_timestamp) != null ? i : 0, e.is_connect = (n = u.is_connect) != null ? n : !1, e
  5644. }
  5645. };
  5646. function Si() {
  5647. return {accepted: !1, req_timestamp: 0, ack_timestamp: 0}
  5648. }
  5649. const Q0 = {
  5650. encode(u, e = r.Writer.create()) {
  5651. return u.accepted !== !1 && e.uint32(8).bool(u.accepted), u.req_timestamp !== 0 && e.uint32(16).int64(u.req_timestamp), u.ack_timestamp !== 0 && e.uint32(24).int64(u.ack_timestamp), e
  5652. }, decode(u, e) {
  5653. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5654. let n = e === void 0 ? i.len : i.pos + e;
  5655. const a = Si();
  5656. for (; i.pos < n;) {
  5657. const t = i.uint32();
  5658. switch (t >>> 3) {
  5659. case 1:
  5660. if (t !== 8) break;
  5661. a.accepted = i.bool();
  5662. continue;
  5663. case 2:
  5664. if (t !== 16) break;
  5665. a.req_timestamp = q(i.int64());
  5666. continue;
  5667. case 3:
  5668. if (t !== 24) break;
  5669. a.ack_timestamp = q(i.int64());
  5670. continue
  5671. }
  5672. if ((t & 7) === 4 || t === 0) break;
  5673. i.skipType(t & 7)
  5674. }
  5675. return a
  5676. }, fromJSON(u) {
  5677. return {
  5678. accepted: o(u.accepted) ? globalThis.Boolean(u.accepted) : !1,
  5679. req_timestamp: o(u.req_timestamp) ? globalThis.Number(u.req_timestamp) : 0,
  5680. ack_timestamp: o(u.ack_timestamp) ? globalThis.Number(u.ack_timestamp) : 0
  5681. }
  5682. }, toJSON(u) {
  5683. const e = {};
  5684. return u.accepted !== !1 && (e.accepted = u.accepted), u.req_timestamp !== 0 && (e.req_timestamp = Math.round(u.req_timestamp)), u.ack_timestamp !== 0 && (e.ack_timestamp = Math.round(u.ack_timestamp)), e
  5685. }, create(u) {
  5686. return Q0.fromPartial(u != null ? u : {})
  5687. }, fromPartial(u) {
  5688. var i, n, a;
  5689. const e = Si();
  5690. return e.accepted = (i = u.accepted) != null ? i : !1, e.req_timestamp = (n = u.req_timestamp) != null ? n : 0, e.ack_timestamp = (a = u.ack_timestamp) != null ? a : 0, e
  5691. }
  5692. };
  5693. function zi() {
  5694. return {display: 0, sid: ""}
  5695. }
  5696. const X0 = {
  5697. encode(u, e = r.Writer.create()) {
  5698. return u.display !== 0 && e.uint32(8).int32(u.display), u.sid !== "" && e.uint32(18).string(u.sid), e
  5699. }, decode(u, e) {
  5700. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5701. let n = e === void 0 ? i.len : i.pos + e;
  5702. const a = zi();
  5703. for (; i.pos < n;) {
  5704. const t = i.uint32();
  5705. switch (t >>> 3) {
  5706. case 1:
  5707. if (t !== 8) break;
  5708. a.display = i.int32();
  5709. continue;
  5710. case 2:
  5711. if (t !== 18) break;
  5712. a.sid = i.string();
  5713. continue
  5714. }
  5715. if ((t & 7) === 4 || t === 0) break;
  5716. i.skipType(t & 7)
  5717. }
  5718. return a
  5719. }, fromJSON(u) {
  5720. return {display: o(u.display) ? globalThis.Number(u.display) : 0, sid: o(u.sid) ? globalThis.String(u.sid) : ""}
  5721. }, toJSON(u) {
  5722. const e = {};
  5723. return u.display !== 0 && (e.display = Math.round(u.display)), u.sid !== "" && (e.sid = u.sid), e
  5724. }, create(u) {
  5725. return X0.fromPartial(u != null ? u : {})
  5726. }, fromPartial(u) {
  5727. var i, n;
  5728. const e = zi();
  5729. return e.display = (i = u.display) != null ? i : 0, e.sid = (n = u.sid) != null ? n : "", e
  5730. }
  5731. };
  5732. function Pi() {
  5733. return {sid: "", msg: "", data: new Uint8Array(0)}
  5734. }
  5735. const Y0 = {
  5736. encode(u, e = r.Writer.create()) {
  5737. return u.sid !== "" && e.uint32(10).string(u.sid), u.msg !== "" && e.uint32(18).string(u.msg), u.data.length !== 0 && e.uint32(26).bytes(u.data), e
  5738. }, decode(u, e) {
  5739. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5740. let n = e === void 0 ? i.len : i.pos + e;
  5741. const a = Pi();
  5742. for (; i.pos < n;) {
  5743. const t = i.uint32();
  5744. switch (t >>> 3) {
  5745. case 1:
  5746. if (t !== 10) break;
  5747. a.sid = i.string();
  5748. continue;
  5749. case 2:
  5750. if (t !== 18) break;
  5751. a.msg = i.string();
  5752. continue;
  5753. case 3:
  5754. if (t !== 26) break;
  5755. a.data = i.bytes();
  5756. continue
  5757. }
  5758. if ((t & 7) === 4 || t === 0) break;
  5759. i.skipType(t & 7)
  5760. }
  5761. return a
  5762. }, fromJSON(u) {
  5763. return {
  5764. sid: o(u.sid) ? globalThis.String(u.sid) : "",
  5765. msg: o(u.msg) ? globalThis.String(u.msg) : "",
  5766. data: o(u.data) ? z(u.data) : new Uint8Array(0)
  5767. }
  5768. }, toJSON(u) {
  5769. const e = {};
  5770. return u.sid !== "" && (e.sid = u.sid), u.msg !== "" && (e.msg = u.msg), u.data.length !== 0 && (e.data = P(u.data)), e
  5771. }, create(u) {
  5772. return Y0.fromPartial(u != null ? u : {})
  5773. }, fromPartial(u) {
  5774. var i, n, a;
  5775. const e = Pi();
  5776. return e.sid = (i = u.sid) != null ? i : "", e.msg = (n = u.msg) != null ? n : "", e.data = (a = u.data) != null ? a : new Uint8Array(0), e
  5777. }
  5778. };
  5779. function Ri() {
  5780. return {
  5781. signed_id: void 0,
  5782. public_key: void 0,
  5783. test_delay: void 0,
  5784. video_frame: void 0,
  5785. login_request: void 0,
  5786. login_response: void 0,
  5787. hash: void 0,
  5788. mouse_event: void 0,
  5789. audio_frame: void 0,
  5790. cursor_data: void 0,
  5791. cursor_position: void 0,
  5792. cursor_id: void 0,
  5793. key_event: void 0,
  5794. clipboard: void 0,
  5795. file_action: void 0,
  5796. file_response: void 0,
  5797. misc: void 0,
  5798. cliprdr: void 0,
  5799. message_box: void 0,
  5800. switch_sides_response: void 0,
  5801. voice_call_request: void 0,
  5802. voice_call_response: void 0,
  5803. peer_info: void 0,
  5804. pointer_device_event: void 0,
  5805. auth_2fa: void 0,
  5806. multi_clipboards: void 0,
  5807. screenshot_request: void 0,
  5808. screenshot_response: void 0
  5809. }
  5810. }
  5811. const au = {
  5812. encode(u, e = r.Writer.create()) {
  5813. return u.signed_id !== void 0 && N0.encode(u.signed_id, e.uint32(26).fork()).ldelim(), u.public_key !== void 0 && H.encode(u.public_key, e.uint32(34).fork()).ldelim(), u.test_delay !== void 0 && j0.encode(u.test_delay, e.uint32(42).fork()).ldelim(), u.video_frame !== void 0 && s0.encode(u.video_frame, e.uint32(50).fork()).ldelim(), u.login_request !== void 0 && J.encode(u.login_request, e.uint32(58).fork()).ldelim(), u.login_response !== void 0 && C0.encode(u.login_response, e.uint32(66).fork()).ldelim(), u.hash !== void 0 && k0.encode(u.hash, e.uint32(74).fork()).ldelim(), u.mouse_event !== void 0 && ku.encode(u.mouse_event, e.uint32(82).fork()).ldelim(), u.audio_frame !== void 0 && U0.encode(u.audio_frame, e.uint32(90).fork()).ldelim(), u.cursor_data !== void 0 && v0.encode(u.cursor_data, e.uint32(98).fork()).ldelim(), u.cursor_position !== void 0 && g0.encode(u.cursor_position, e.uint32(106).fork()).ldelim(), u.cursor_id !== void 0 && e.uint32(112).uint64(u.cursor_id), u.key_event !== void 0 && S.encode(u.key_event, e.uint32(122).fork()).ldelim(), u.clipboard !== void 0 && W.encode(u.clipboard, e.uint32(130).fork()).ldelim(), u.file_action !== void 0 && I.encode(u.file_action, e.uint32(138).fork()).ldelim(), u.file_response !== void 0 && ou.encode(u.file_response, e.uint32(146).fork()).ldelim(), u.misc !== void 0 && f.encode(u.misc, e.uint32(154).fork()).ldelim(), u.cliprdr !== void 0 && I0.encode(u.cliprdr, e.uint32(162).fork()).ldelim(), u.message_box !== void 0 && M0.encode(u.message_box, e.uint32(170).fork()).ldelim(), u.switch_sides_response !== void 0 && V0.encode(u.switch_sides_response, e.uint32(178).fork()).ldelim(), u.voice_call_request !== void 0 && Z0.encode(u.voice_call_request, e.uint32(186).fork()).ldelim(), u.voice_call_response !== void 0 && Q0.encode(u.voice_call_response, e.uint32(194).fork()).ldelim(), u.peer_info !== void 0 && uu.encode(u.peer_info, e.uint32(202).fork()).ldelim(), u.pointer_device_event !== void 0 && _0.encode(u.pointer_device_event, e.uint32(210).fork()).ldelim(), u.auth_2fa !== void 0 && vu.encode(u.auth_2fa, e.uint32(218).fork()).ldelim(), u.multi_clipboards !== void 0 && hu.encode(u.multi_clipboards, e.uint32(226).fork()).ldelim(), u.screenshot_request !== void 0 && X0.encode(u.screenshot_request, e.uint32(234).fork()).ldelim(), u.screenshot_response !== void 0 && Y0.encode(u.screenshot_response, e.uint32(242).fork()).ldelim(), e
  5814. }, decode(u, e) {
  5815. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5816. let n = e === void 0 ? i.len : i.pos + e;
  5817. const a = Ri();
  5818. for (; i.pos < n;) {
  5819. const t = i.uint32();
  5820. switch (t >>> 3) {
  5821. case 3:
  5822. if (t !== 26) break;
  5823. a.signed_id = N0.decode(i, i.uint32());
  5824. continue;
  5825. case 4:
  5826. if (t !== 34) break;
  5827. a.public_key = H.decode(i, i.uint32());
  5828. continue;
  5829. case 5:
  5830. if (t !== 42) break;
  5831. a.test_delay = j0.decode(i, i.uint32());
  5832. continue;
  5833. case 6:
  5834. if (t !== 50) break;
  5835. a.video_frame = s0.decode(i, i.uint32());
  5836. continue;
  5837. case 7:
  5838. if (t !== 58) break;
  5839. a.login_request = J.decode(i, i.uint32());
  5840. continue;
  5841. case 8:
  5842. if (t !== 66) break;
  5843. a.login_response = C0.decode(i, i.uint32());
  5844. continue;
  5845. case 9:
  5846. if (t !== 74) break;
  5847. a.hash = k0.decode(i, i.uint32());
  5848. continue;
  5849. case 10:
  5850. if (t !== 82) break;
  5851. a.mouse_event = ku.decode(i, i.uint32());
  5852. continue;
  5853. case 11:
  5854. if (t !== 90) break;
  5855. a.audio_frame = U0.decode(i, i.uint32());
  5856. continue;
  5857. case 12:
  5858. if (t !== 98) break;
  5859. a.cursor_data = v0.decode(i, i.uint32());
  5860. continue;
  5861. case 13:
  5862. if (t !== 106) break;
  5863. a.cursor_position = g0.decode(i, i.uint32());
  5864. continue;
  5865. case 14:
  5866. if (t !== 112) break;
  5867. a.cursor_id = q(i.uint64());
  5868. continue;
  5869. case 15:
  5870. if (t !== 122) break;
  5871. a.key_event = S.decode(i, i.uint32());
  5872. continue;
  5873. case 16:
  5874. if (t !== 130) break;
  5875. a.clipboard = W.decode(i, i.uint32());
  5876. continue;
  5877. case 17:
  5878. if (t !== 138) break;
  5879. a.file_action = I.decode(i, i.uint32());
  5880. continue;
  5881. case 18:
  5882. if (t !== 146) break;
  5883. a.file_response = ou.decode(i, i.uint32());
  5884. continue;
  5885. case 19:
  5886. if (t !== 154) break;
  5887. a.misc = f.decode(i, i.uint32());
  5888. continue;
  5889. case 20:
  5890. if (t !== 162) break;
  5891. a.cliprdr = I0.decode(i, i.uint32());
  5892. continue;
  5893. case 21:
  5894. if (t !== 170) break;
  5895. a.message_box = M0.decode(i, i.uint32());
  5896. continue;
  5897. case 22:
  5898. if (t !== 178) break;
  5899. a.switch_sides_response = V0.decode(i, i.uint32());
  5900. continue;
  5901. case 23:
  5902. if (t !== 186) break;
  5903. a.voice_call_request = Z0.decode(i, i.uint32());
  5904. continue;
  5905. case 24:
  5906. if (t !== 194) break;
  5907. a.voice_call_response = Q0.decode(i, i.uint32());
  5908. continue;
  5909. case 25:
  5910. if (t !== 202) break;
  5911. a.peer_info = uu.decode(i, i.uint32());
  5912. continue;
  5913. case 26:
  5914. if (t !== 210) break;
  5915. a.pointer_device_event = _0.decode(i, i.uint32());
  5916. continue;
  5917. case 27:
  5918. if (t !== 218) break;
  5919. a.auth_2fa = vu.decode(i, i.uint32());
  5920. continue;
  5921. case 28:
  5922. if (t !== 226) break;
  5923. a.multi_clipboards = hu.decode(i, i.uint32());
  5924. continue;
  5925. case 29:
  5926. if (t !== 234) break;
  5927. a.screenshot_request = X0.decode(i, i.uint32());
  5928. continue;
  5929. case 30:
  5930. if (t !== 242) break;
  5931. a.screenshot_response = Y0.decode(i, i.uint32());
  5932. continue
  5933. }
  5934. if ((t & 7) === 4 || t === 0) break;
  5935. i.skipType(t & 7)
  5936. }
  5937. return a
  5938. }, fromJSON(u) {
  5939. return {
  5940. signed_id: o(u.signed_id) ? N0.fromJSON(u.signed_id) : void 0,
  5941. public_key: o(u.public_key) ? H.fromJSON(u.public_key) : void 0,
  5942. test_delay: o(u.test_delay) ? j0.fromJSON(u.test_delay) : void 0,
  5943. video_frame: o(u.video_frame) ? s0.fromJSON(u.video_frame) : void 0,
  5944. login_request: o(u.login_request) ? J.fromJSON(u.login_request) : void 0,
  5945. login_response: o(u.login_response) ? C0.fromJSON(u.login_response) : void 0,
  5946. hash: o(u.hash) ? k0.fromJSON(u.hash) : void 0,
  5947. mouse_event: o(u.mouse_event) ? ku.fromJSON(u.mouse_event) : void 0,
  5948. audio_frame: o(u.audio_frame) ? U0.fromJSON(u.audio_frame) : void 0,
  5949. cursor_data: o(u.cursor_data) ? v0.fromJSON(u.cursor_data) : void 0,
  5950. cursor_position: o(u.cursor_position) ? g0.fromJSON(u.cursor_position) : void 0,
  5951. cursor_id: o(u.cursor_id) ? globalThis.Number(u.cursor_id) : void 0,
  5952. key_event: o(u.key_event) ? S.fromJSON(u.key_event) : void 0,
  5953. clipboard: o(u.clipboard) ? W.fromJSON(u.clipboard) : void 0,
  5954. file_action: o(u.file_action) ? I.fromJSON(u.file_action) : void 0,
  5955. file_response: o(u.file_response) ? ou.fromJSON(u.file_response) : void 0,
  5956. misc: o(u.misc) ? f.fromJSON(u.misc) : void 0,
  5957. cliprdr: o(u.cliprdr) ? I0.fromJSON(u.cliprdr) : void 0,
  5958. message_box: o(u.message_box) ? M0.fromJSON(u.message_box) : void 0,
  5959. switch_sides_response: o(u.switch_sides_response) ? V0.fromJSON(u.switch_sides_response) : void 0,
  5960. voice_call_request: o(u.voice_call_request) ? Z0.fromJSON(u.voice_call_request) : void 0,
  5961. voice_call_response: o(u.voice_call_response) ? Q0.fromJSON(u.voice_call_response) : void 0,
  5962. peer_info: o(u.peer_info) ? uu.fromJSON(u.peer_info) : void 0,
  5963. pointer_device_event: o(u.pointer_device_event) ? _0.fromJSON(u.pointer_device_event) : void 0,
  5964. auth_2fa: o(u.auth_2fa) ? vu.fromJSON(u.auth_2fa) : void 0,
  5965. multi_clipboards: o(u.multi_clipboards) ? hu.fromJSON(u.multi_clipboards) : void 0,
  5966. screenshot_request: o(u.screenshot_request) ? X0.fromJSON(u.screenshot_request) : void 0,
  5967. screenshot_response: o(u.screenshot_response) ? Y0.fromJSON(u.screenshot_response) : void 0
  5968. }
  5969. }, toJSON(u) {
  5970. const e = {};
  5971. return u.signed_id !== void 0 && (e.signed_id = N0.toJSON(u.signed_id)), u.public_key !== void 0 && (e.public_key = H.toJSON(u.public_key)), u.test_delay !== void 0 && (e.test_delay = j0.toJSON(u.test_delay)), u.video_frame !== void 0 && (e.video_frame = s0.toJSON(u.video_frame)), u.login_request !== void 0 && (e.login_request = J.toJSON(u.login_request)), u.login_response !== void 0 && (e.login_response = C0.toJSON(u.login_response)), u.hash !== void 0 && (e.hash = k0.toJSON(u.hash)), u.mouse_event !== void 0 && (e.mouse_event = ku.toJSON(u.mouse_event)), u.audio_frame !== void 0 && (e.audio_frame = U0.toJSON(u.audio_frame)), u.cursor_data !== void 0 && (e.cursor_data = v0.toJSON(u.cursor_data)), u.cursor_position !== void 0 && (e.cursor_position = g0.toJSON(u.cursor_position)), u.cursor_id !== void 0 && (e.cursor_id = Math.round(u.cursor_id)), u.key_event !== void 0 && (e.key_event = S.toJSON(u.key_event)), u.clipboard !== void 0 && (e.clipboard = W.toJSON(u.clipboard)), u.file_action !== void 0 && (e.file_action = I.toJSON(u.file_action)), u.file_response !== void 0 && (e.file_response = ou.toJSON(u.file_response)), u.misc !== void 0 && (e.misc = f.toJSON(u.misc)), u.cliprdr !== void 0 && (e.cliprdr = I0.toJSON(u.cliprdr)), u.message_box !== void 0 && (e.message_box = M0.toJSON(u.message_box)), u.switch_sides_response !== void 0 && (e.switch_sides_response = V0.toJSON(u.switch_sides_response)), u.voice_call_request !== void 0 && (e.voice_call_request = Z0.toJSON(u.voice_call_request)), u.voice_call_response !== void 0 && (e.voice_call_response = Q0.toJSON(u.voice_call_response)), u.peer_info !== void 0 && (e.peer_info = uu.toJSON(u.peer_info)), u.pointer_device_event !== void 0 && (e.pointer_device_event = _0.toJSON(u.pointer_device_event)), u.auth_2fa !== void 0 && (e.auth_2fa = vu.toJSON(u.auth_2fa)), u.multi_clipboards !== void 0 && (e.multi_clipboards = hu.toJSON(u.multi_clipboards)), u.screenshot_request !== void 0 && (e.screenshot_request = X0.toJSON(u.screenshot_request)), u.screenshot_response !== void 0 && (e.screenshot_response = Y0.toJSON(u.screenshot_response)), e
  5972. }, create(u) {
  5973. return au.fromPartial(u != null ? u : {})
  5974. }, fromPartial(u) {
  5975. var i;
  5976. const e = Ri();
  5977. return e.signed_id = u.signed_id !== void 0 && u.signed_id !== null ? N0.fromPartial(u.signed_id) : void 0, e.public_key = u.public_key !== void 0 && u.public_key !== null ? H.fromPartial(u.public_key) : void 0, e.test_delay = u.test_delay !== void 0 && u.test_delay !== null ? j0.fromPartial(u.test_delay) : void 0, e.video_frame = u.video_frame !== void 0 && u.video_frame !== null ? s0.fromPartial(u.video_frame) : void 0, e.login_request = u.login_request !== void 0 && u.login_request !== null ? J.fromPartial(u.login_request) : void 0, e.login_response = u.login_response !== void 0 && u.login_response !== null ? C0.fromPartial(u.login_response) : void 0, e.hash = u.hash !== void 0 && u.hash !== null ? k0.fromPartial(u.hash) : void 0, e.mouse_event = u.mouse_event !== void 0 && u.mouse_event !== null ? ku.fromPartial(u.mouse_event) : void 0, e.audio_frame = u.audio_frame !== void 0 && u.audio_frame !== null ? U0.fromPartial(u.audio_frame) : void 0, e.cursor_data = u.cursor_data !== void 0 && u.cursor_data !== null ? v0.fromPartial(u.cursor_data) : void 0, e.cursor_position = u.cursor_position !== void 0 && u.cursor_position !== null ? g0.fromPartial(u.cursor_position) : void 0, e.cursor_id = (i = u.cursor_id) != null ? i : void 0, e.key_event = u.key_event !== void 0 && u.key_event !== null ? S.fromPartial(u.key_event) : void 0, e.clipboard = u.clipboard !== void 0 && u.clipboard !== null ? W.fromPartial(u.clipboard) : void 0, e.file_action = u.file_action !== void 0 && u.file_action !== null ? I.fromPartial(u.file_action) : void 0, e.file_response = u.file_response !== void 0 && u.file_response !== null ? ou.fromPartial(u.file_response) : void 0, e.misc = u.misc !== void 0 && u.misc !== null ? f.fromPartial(u.misc) : void 0, e.cliprdr = u.cliprdr !== void 0 && u.cliprdr !== null ? I0.fromPartial(u.cliprdr) : void 0, e.message_box = u.message_box !== void 0 && u.message_box !== null ? M0.fromPartial(u.message_box) : void 0, e.switch_sides_response = u.switch_sides_response !== void 0 && u.switch_sides_response !== null ? V0.fromPartial(u.switch_sides_response) : void 0, e.voice_call_request = u.voice_call_request !== void 0 && u.voice_call_request !== null ? Z0.fromPartial(u.voice_call_request) : void 0, e.voice_call_response = u.voice_call_response !== void 0 && u.voice_call_response !== null ? Q0.fromPartial(u.voice_call_response) : void 0, e.peer_info = u.peer_info !== void 0 && u.peer_info !== null ? uu.fromPartial(u.peer_info) : void 0, e.pointer_device_event = u.pointer_device_event !== void 0 && u.pointer_device_event !== null ? _0.fromPartial(u.pointer_device_event) : void 0, e.auth_2fa = u.auth_2fa !== void 0 && u.auth_2fa !== null ? vu.fromPartial(u.auth_2fa) : void 0, e.multi_clipboards = u.multi_clipboards !== void 0 && u.multi_clipboards !== null ? hu.fromPartial(u.multi_clipboards) : void 0, e.screenshot_request = u.screenshot_request !== void 0 && u.screenshot_request !== null ? X0.fromPartial(u.screenshot_request) : void 0, e.screenshot_response = u.screenshot_response !== void 0 && u.screenshot_response !== null ? Y0.fromPartial(u.screenshot_response) : void 0, e
  5978. }
  5979. };
  5980. function z(u) {
  5981. if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(u, "base64"));
  5982. {
  5983. const e = globalThis.atob(u), i = new Uint8Array(e.length);
  5984. for (let n = 0; n < e.length; ++n) i[n] = e.charCodeAt(n);
  5985. return i
  5986. }
  5987. }
  5988. function P(u) {
  5989. if (globalThis.Buffer) return globalThis.Buffer.from(u).toString("base64");
  5990. {
  5991. const e = [];
  5992. return u.forEach(i => {
  5993. e.push(globalThis.String.fromCharCode(i))
  5994. }), globalThis.btoa(e.join(""))
  5995. }
  5996. }
  5997. function q(u) {
  5998. if (u.gt(globalThis.Number.MAX_SAFE_INTEGER)) throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
  5999. if (u.lt(globalThis.Number.MIN_SAFE_INTEGER)) throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
  6000. return u.toNumber()
  6001. }
  6002. r.util.Long !== K4 && (r.util.Long = K4, r.configure());
  6003. function o(u) {
  6004. return u != null
  6005. }
  6006. var je = (u => (u[u.DEFAULT_CONN = 0] = "DEFAULT_CONN", u[u.FILE_TRANSFER = 1] = "FILE_TRANSFER", u[u.PORT_FORWARD = 2] = "PORT_FORWARD", u[u.RDP = 3] = "RDP", u[u.VIEW_CAMERA = 4] = "VIEW_CAMERA", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(je || {});
  6007. function xt(u) {
  6008. switch (u) {
  6009. case 0:
  6010. case"DEFAULT_CONN":
  6011. return 0;
  6012. case 1:
  6013. case"FILE_TRANSFER":
  6014. return 1;
  6015. case 2:
  6016. case"PORT_FORWARD":
  6017. return 2;
  6018. case 3:
  6019. case"RDP":
  6020. return 3;
  6021. case 4:
  6022. case"VIEW_CAMERA":
  6023. return 4;
  6024. case-1:
  6025. case"UNRECOGNIZED":
  6026. default:
  6027. return -1
  6028. }
  6029. }
  6030. function yt(u) {
  6031. switch (u) {
  6032. case 0:
  6033. return "DEFAULT_CONN";
  6034. case 1:
  6035. return "FILE_TRANSFER";
  6036. case 2:
  6037. return "PORT_FORWARD";
  6038. case 3:
  6039. return "RDP";
  6040. case 4:
  6041. return "VIEW_CAMERA";
  6042. case-1:
  6043. default:
  6044. return "UNRECOGNIZED"
  6045. }
  6046. }
  6047. var bt = (u => (u[u.UNKNOWN_NAT = 0] = "UNKNOWN_NAT", u[u.ASYMMETRIC = 1] = "ASYMMETRIC", u[u.SYMMETRIC = 2] = "SYMMETRIC", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(bt || {});
  6048. function i4(u) {
  6049. switch (u) {
  6050. case 0:
  6051. case"UNKNOWN_NAT":
  6052. return 0;
  6053. case 1:
  6054. case"ASYMMETRIC":
  6055. return 1;
  6056. case 2:
  6057. case"SYMMETRIC":
  6058. return 2;
  6059. case-1:
  6060. case"UNRECOGNIZED":
  6061. default:
  6062. return -1
  6063. }
  6064. }
  6065. function t4(u) {
  6066. switch (u) {
  6067. case 0:
  6068. return "UNKNOWN_NAT";
  6069. case 1:
  6070. return "ASYMMETRIC";
  6071. case 2:
  6072. return "SYMMETRIC";
  6073. case-1:
  6074. default:
  6075. return "UNRECOGNIZED"
  6076. }
  6077. }
  6078. function Ha(u) {
  6079. switch (u) {
  6080. case 0:
  6081. case"OK":
  6082. return 0;
  6083. case 2:
  6084. case"UUID_MISMATCH":
  6085. return 2;
  6086. case 3:
  6087. case"ID_EXISTS":
  6088. return 3;
  6089. case 4:
  6090. case"TOO_FREQUENT":
  6091. return 4;
  6092. case 5:
  6093. case"INVALID_ID_FORMAT":
  6094. return 5;
  6095. case 6:
  6096. case"NOT_SUPPORT":
  6097. return 6;
  6098. case 7:
  6099. case"SERVER_ERROR":
  6100. return 7;
  6101. case-1:
  6102. case"UNRECOGNIZED":
  6103. default:
  6104. return -1
  6105. }
  6106. }
  6107. function Ja(u) {
  6108. switch (u) {
  6109. case 0:
  6110. return "OK";
  6111. case 2:
  6112. return "UUID_MISMATCH";
  6113. case 3:
  6114. return "ID_EXISTS";
  6115. case 4:
  6116. return "TOO_FREQUENT";
  6117. case 5:
  6118. return "INVALID_ID_FORMAT";
  6119. case 6:
  6120. return "NOT_SUPPORT";
  6121. case 7:
  6122. return "SERVER_ERROR";
  6123. case-1:
  6124. default:
  6125. return "UNRECOGNIZED"
  6126. }
  6127. }
  6128. var $0 = (u => (u[u.ID_NOT_EXIST = 0] = "ID_NOT_EXIST", u[u.OFFLINE = 2] = "OFFLINE", u[u.LICENSE_MISMATCH = 3] = "LICENSE_MISMATCH", u[u.LICENSE_OVERUSE = 4] = "LICENSE_OVERUSE", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))($0 || {});
  6129. function Ga(u) {
  6130. switch (u) {
  6131. case 0:
  6132. case"ID_NOT_EXIST":
  6133. return 0;
  6134. case 2:
  6135. case"OFFLINE":
  6136. return 2;
  6137. case 3:
  6138. case"LICENSE_MISMATCH":
  6139. return 3;
  6140. case 4:
  6141. case"LICENSE_OVERUSE":
  6142. return 4;
  6143. case-1:
  6144. case"UNRECOGNIZED":
  6145. default:
  6146. return -1
  6147. }
  6148. }
  6149. function Za(u) {
  6150. switch (u) {
  6151. case 0:
  6152. return "ID_NOT_EXIST";
  6153. case 2:
  6154. return "OFFLINE";
  6155. case 3:
  6156. return "LICENSE_MISMATCH";
  6157. case 4:
  6158. return "LICENSE_OVERUSE";
  6159. case-1:
  6160. default:
  6161. return "UNRECOGNIZED"
  6162. }
  6163. }
  6164. function Ii() {
  6165. return {id: "", serial: 0}
  6166. }
  6167. const ue = {
  6168. encode(u, e = r.Writer.create()) {
  6169. return u.id !== "" && e.uint32(10).string(u.id), u.serial !== 0 && e.uint32(16).int32(u.serial), e
  6170. }, decode(u, e) {
  6171. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6172. let n = e === void 0 ? i.len : i.pos + e;
  6173. const a = Ii();
  6174. for (; i.pos < n;) {
  6175. const t = i.uint32();
  6176. switch (t >>> 3) {
  6177. case 1:
  6178. if (t !== 10) break;
  6179. a.id = i.string();
  6180. continue;
  6181. case 2:
  6182. if (t !== 16) break;
  6183. a.serial = i.int32();
  6184. continue
  6185. }
  6186. if ((t & 7) === 4 || t === 0) break;
  6187. i.skipType(t & 7)
  6188. }
  6189. return a
  6190. }, fromJSON(u) {
  6191. return {id: C(u.id) ? globalThis.String(u.id) : "", serial: C(u.serial) ? globalThis.Number(u.serial) : 0}
  6192. }, toJSON(u) {
  6193. const e = {};
  6194. return u.id !== "" && (e.id = u.id), u.serial !== 0 && (e.serial = Math.round(u.serial)), e
  6195. }, create(u) {
  6196. return ue.fromPartial(u != null ? u : {})
  6197. }, fromPartial(u) {
  6198. var i, n;
  6199. const e = Ii();
  6200. return e.id = (i = u.id) != null ? i : "", e.serial = (n = u.serial) != null ? n : 0, e
  6201. }
  6202. };
  6203. function Ti() {
  6204. return {request_pk: !1}
  6205. }
  6206. const ee = {
  6207. encode(u, e = r.Writer.create()) {
  6208. return u.request_pk !== !1 && e.uint32(16).bool(u.request_pk), e
  6209. }, decode(u, e) {
  6210. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6211. let n = e === void 0 ? i.len : i.pos + e;
  6212. const a = Ti();
  6213. for (; i.pos < n;) {
  6214. const t = i.uint32();
  6215. switch (t >>> 3) {
  6216. case 2:
  6217. if (t !== 16) break;
  6218. a.request_pk = i.bool();
  6219. continue
  6220. }
  6221. if ((t & 7) === 4 || t === 0) break;
  6222. i.skipType(t & 7)
  6223. }
  6224. return a
  6225. }, fromJSON(u) {
  6226. return {request_pk: C(u.request_pk) ? globalThis.Boolean(u.request_pk) : !1}
  6227. }, toJSON(u) {
  6228. const e = {};
  6229. return u.request_pk !== !1 && (e.request_pk = u.request_pk), e
  6230. }, create(u) {
  6231. return ee.fromPartial(u != null ? u : {})
  6232. }, fromPartial(u) {
  6233. var i;
  6234. const e = Ti();
  6235. return e.request_pk = (i = u.request_pk) != null ? i : !1, e
  6236. }
  6237. };
  6238. function ji() {
  6239. return {id: "", nat_type: 0, licence_key: "", conn_type: 0, token: "", version: ""}
  6240. }
  6241. const Hu = {
  6242. encode(u, e = r.Writer.create()) {
  6243. return u.id !== "" && e.uint32(10).string(u.id), u.nat_type !== 0 && e.uint32(16).int32(u.nat_type), u.licence_key !== "" && e.uint32(26).string(u.licence_key), u.conn_type !== 0 && e.uint32(32).int32(u.conn_type), u.token !== "" && e.uint32(42).string(u.token), u.version !== "" && e.uint32(50).string(u.version), e
  6244. }, decode(u, e) {
  6245. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6246. let n = e === void 0 ? i.len : i.pos + e;
  6247. const a = ji();
  6248. for (; i.pos < n;) {
  6249. const t = i.uint32();
  6250. switch (t >>> 3) {
  6251. case 1:
  6252. if (t !== 10) break;
  6253. a.id = i.string();
  6254. continue;
  6255. case 2:
  6256. if (t !== 16) break;
  6257. a.nat_type = i.int32();
  6258. continue;
  6259. case 3:
  6260. if (t !== 26) break;
  6261. a.licence_key = i.string();
  6262. continue;
  6263. case 4:
  6264. if (t !== 32) break;
  6265. a.conn_type = i.int32();
  6266. continue;
  6267. case 5:
  6268. if (t !== 42) break;
  6269. a.token = i.string();
  6270. continue;
  6271. case 6:
  6272. if (t !== 50) break;
  6273. a.version = i.string();
  6274. continue
  6275. }
  6276. if ((t & 7) === 4 || t === 0) break;
  6277. i.skipType(t & 7)
  6278. }
  6279. return a
  6280. }, fromJSON(u) {
  6281. return {
  6282. id: C(u.id) ? globalThis.String(u.id) : "",
  6283. nat_type: C(u.nat_type) ? i4(u.nat_type) : 0,
  6284. licence_key: C(u.licence_key) ? globalThis.String(u.licence_key) : "",
  6285. conn_type: C(u.conn_type) ? xt(u.conn_type) : 0,
  6286. token: C(u.token) ? globalThis.String(u.token) : "",
  6287. version: C(u.version) ? globalThis.String(u.version) : ""
  6288. }
  6289. }, toJSON(u) {
  6290. const e = {};
  6291. return u.id !== "" && (e.id = u.id), u.nat_type !== 0 && (e.nat_type = t4(u.nat_type)), u.licence_key !== "" && (e.licence_key = u.licence_key), u.conn_type !== 0 && (e.conn_type = yt(u.conn_type)), u.token !== "" && (e.token = u.token), u.version !== "" && (e.version = u.version), e
  6292. }, create(u) {
  6293. return Hu.fromPartial(u != null ? u : {})
  6294. }, fromPartial(u) {
  6295. var i, n, a, t, s, E;
  6296. const e = ji();
  6297. return e.id = (i = u.id) != null ? i : "", e.nat_type = (n = u.nat_type) != null ? n : 0, e.licence_key = (a = u.licence_key) != null ? a : "", e.conn_type = (t = u.conn_type) != null ? t : 0, e.token = (s = u.token) != null ? s : "", e.version = (E = u.version) != null ? E : "", e
  6298. }
  6299. };
  6300. function Ni() {
  6301. return {socket_addr: new Uint8Array(0), relay_server: "", nat_type: 0}
  6302. }
  6303. const ie = {
  6304. encode(u, e = r.Writer.create()) {
  6305. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.relay_server !== "" && e.uint32(18).string(u.relay_server), u.nat_type !== 0 && e.uint32(24).int32(u.nat_type), e
  6306. }, decode(u, e) {
  6307. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6308. let n = e === void 0 ? i.len : i.pos + e;
  6309. const a = Ni();
  6310. for (; i.pos < n;) {
  6311. const t = i.uint32();
  6312. switch (t >>> 3) {
  6313. case 1:
  6314. if (t !== 10) break;
  6315. a.socket_addr = i.bytes();
  6316. continue;
  6317. case 2:
  6318. if (t !== 18) break;
  6319. a.relay_server = i.string();
  6320. continue;
  6321. case 3:
  6322. if (t !== 24) break;
  6323. a.nat_type = i.int32();
  6324. continue
  6325. }
  6326. if ((t & 7) === 4 || t === 0) break;
  6327. i.skipType(t & 7)
  6328. }
  6329. return a
  6330. }, fromJSON(u) {
  6331. return {
  6332. socket_addr: C(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6333. relay_server: C(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6334. nat_type: C(u.nat_type) ? i4(u.nat_type) : 0
  6335. }
  6336. }, toJSON(u) {
  6337. const e = {};
  6338. return u.socket_addr.length !== 0 && (e.socket_addr = U(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== 0 && (e.nat_type = t4(u.nat_type)), e
  6339. }, create(u) {
  6340. return ie.fromPartial(u != null ? u : {})
  6341. }, fromPartial(u) {
  6342. var i, n, a;
  6343. const e = Ni();
  6344. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.relay_server = (n = u.relay_server) != null ? n : "", e.nat_type = (a = u.nat_type) != null ? a : 0, e
  6345. }
  6346. };
  6347. function Oi() {
  6348. return {serial: 0}
  6349. }
  6350. const te = {
  6351. encode(u, e = r.Writer.create()) {
  6352. return u.serial !== 0 && e.uint32(8).int32(u.serial), e
  6353. }, decode(u, e) {
  6354. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6355. let n = e === void 0 ? i.len : i.pos + e;
  6356. const a = Oi();
  6357. for (; i.pos < n;) {
  6358. const t = i.uint32();
  6359. switch (t >>> 3) {
  6360. case 1:
  6361. if (t !== 8) break;
  6362. a.serial = i.int32();
  6363. continue
  6364. }
  6365. if ((t & 7) === 4 || t === 0) break;
  6366. i.skipType(t & 7)
  6367. }
  6368. return a
  6369. }, fromJSON(u) {
  6370. return {serial: C(u.serial) ? globalThis.Number(u.serial) : 0}
  6371. }, toJSON(u) {
  6372. const e = {};
  6373. return u.serial !== 0 && (e.serial = Math.round(u.serial)), e
  6374. }, create(u) {
  6375. return te.fromPartial(u != null ? u : {})
  6376. }, fromPartial(u) {
  6377. var i;
  6378. const e = Oi();
  6379. return e.serial = (i = u.serial) != null ? i : 0, e
  6380. }
  6381. };
  6382. function Ui() {
  6383. return {port: 0, cu: void 0}
  6384. }
  6385. const ae = {
  6386. encode(u, e = r.Writer.create()) {
  6387. return u.port !== 0 && e.uint32(8).int32(u.port), u.cu !== void 0 && tu.encode(u.cu, e.uint32(18).fork()).ldelim(), e
  6388. }, decode(u, e) {
  6389. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6390. let n = e === void 0 ? i.len : i.pos + e;
  6391. const a = Ui();
  6392. for (; i.pos < n;) {
  6393. const t = i.uint32();
  6394. switch (t >>> 3) {
  6395. case 1:
  6396. if (t !== 8) break;
  6397. a.port = i.int32();
  6398. continue;
  6399. case 2:
  6400. if (t !== 18) break;
  6401. a.cu = tu.decode(i, i.uint32());
  6402. continue
  6403. }
  6404. if ((t & 7) === 4 || t === 0) break;
  6405. i.skipType(t & 7)
  6406. }
  6407. return a
  6408. }, fromJSON(u) {
  6409. return {port: C(u.port) ? globalThis.Number(u.port) : 0, cu: C(u.cu) ? tu.fromJSON(u.cu) : void 0}
  6410. }, toJSON(u) {
  6411. const e = {};
  6412. return u.port !== 0 && (e.port = Math.round(u.port)), u.cu !== void 0 && (e.cu = tu.toJSON(u.cu)), e
  6413. }, create(u) {
  6414. return ae.fromPartial(u != null ? u : {})
  6415. }, fromPartial(u) {
  6416. var i;
  6417. const e = Ui();
  6418. return e.port = (i = u.port) != null ? i : 0, e.cu = u.cu !== void 0 && u.cu !== null ? tu.fromPartial(u.cu) : void 0, e
  6419. }
  6420. };
  6421. function Mi() {
  6422. return {socket_addr: new Uint8Array(0), id: "", relay_server: "", nat_type: 0, version: ""}
  6423. }
  6424. const ne = {
  6425. encode(u, e = r.Writer.create()) {
  6426. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.id !== "" && e.uint32(18).string(u.id), u.relay_server !== "" && e.uint32(26).string(u.relay_server), u.nat_type !== 0 && e.uint32(32).int32(u.nat_type), u.version !== "" && e.uint32(42).string(u.version), e
  6427. }, decode(u, e) {
  6428. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6429. let n = e === void 0 ? i.len : i.pos + e;
  6430. const a = Mi();
  6431. for (; i.pos < n;) {
  6432. const t = i.uint32();
  6433. switch (t >>> 3) {
  6434. case 1:
  6435. if (t !== 10) break;
  6436. a.socket_addr = i.bytes();
  6437. continue;
  6438. case 2:
  6439. if (t !== 18) break;
  6440. a.id = i.string();
  6441. continue;
  6442. case 3:
  6443. if (t !== 26) break;
  6444. a.relay_server = i.string();
  6445. continue;
  6446. case 4:
  6447. if (t !== 32) break;
  6448. a.nat_type = i.int32();
  6449. continue;
  6450. case 5:
  6451. if (t !== 42) break;
  6452. a.version = i.string();
  6453. continue
  6454. }
  6455. if ((t & 7) === 4 || t === 0) break;
  6456. i.skipType(t & 7)
  6457. }
  6458. return a
  6459. }, fromJSON(u) {
  6460. return {
  6461. socket_addr: C(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6462. id: C(u.id) ? globalThis.String(u.id) : "",
  6463. relay_server: C(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6464. nat_type: C(u.nat_type) ? i4(u.nat_type) : 0,
  6465. version: C(u.version) ? globalThis.String(u.version) : ""
  6466. }
  6467. }, toJSON(u) {
  6468. const e = {};
  6469. return u.socket_addr.length !== 0 && (e.socket_addr = U(u.socket_addr)), u.id !== "" && (e.id = u.id), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== 0 && (e.nat_type = t4(u.nat_type)), u.version !== "" && (e.version = u.version), e
  6470. }, create(u) {
  6471. return ne.fromPartial(u != null ? u : {})
  6472. }, fromPartial(u) {
  6473. var i, n, a, t, s;
  6474. const e = Mi();
  6475. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.id = (n = u.id) != null ? n : "", e.relay_server = (a = u.relay_server) != null ? a : "", e.nat_type = (t = u.nat_type) != null ? t : 0, e.version = (s = u.version) != null ? s : "", e
  6476. }
  6477. };
  6478. function Li() {
  6479. return {id: "", uuid: new Uint8Array(0), pk: new Uint8Array(0), old_id: ""}
  6480. }
  6481. const oe = {
  6482. encode(u, e = r.Writer.create()) {
  6483. return u.id !== "" && e.uint32(10).string(u.id), u.uuid.length !== 0 && e.uint32(18).bytes(u.uuid), u.pk.length !== 0 && e.uint32(26).bytes(u.pk), u.old_id !== "" && e.uint32(34).string(u.old_id), e
  6484. }, decode(u, e) {
  6485. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6486. let n = e === void 0 ? i.len : i.pos + e;
  6487. const a = Li();
  6488. for (; i.pos < n;) {
  6489. const t = i.uint32();
  6490. switch (t >>> 3) {
  6491. case 1:
  6492. if (t !== 10) break;
  6493. a.id = i.string();
  6494. continue;
  6495. case 2:
  6496. if (t !== 18) break;
  6497. a.uuid = i.bytes();
  6498. continue;
  6499. case 3:
  6500. if (t !== 26) break;
  6501. a.pk = i.bytes();
  6502. continue;
  6503. case 4:
  6504. if (t !== 34) break;
  6505. a.old_id = i.string();
  6506. continue
  6507. }
  6508. if ((t & 7) === 4 || t === 0) break;
  6509. i.skipType(t & 7)
  6510. }
  6511. return a
  6512. }, fromJSON(u) {
  6513. return {
  6514. id: C(u.id) ? globalThis.String(u.id) : "",
  6515. uuid: C(u.uuid) ? O(u.uuid) : new Uint8Array(0),
  6516. pk: C(u.pk) ? O(u.pk) : new Uint8Array(0),
  6517. old_id: C(u.old_id) ? globalThis.String(u.old_id) : ""
  6518. }
  6519. }, toJSON(u) {
  6520. const e = {};
  6521. return u.id !== "" && (e.id = u.id), u.uuid.length !== 0 && (e.uuid = U(u.uuid)), u.pk.length !== 0 && (e.pk = U(u.pk)), u.old_id !== "" && (e.old_id = u.old_id), e
  6522. }, create(u) {
  6523. return oe.fromPartial(u != null ? u : {})
  6524. }, fromPartial(u) {
  6525. var i, n, a, t;
  6526. const e = Li();
  6527. return e.id = (i = u.id) != null ? i : "", e.uuid = (n = u.uuid) != null ? n : new Uint8Array(0), e.pk = (a = u.pk) != null ? a : new Uint8Array(0), e.old_id = (t = u.old_id) != null ? t : "", e
  6528. }
  6529. };
  6530. function Wi() {
  6531. return {result: 0, keep_alive: 0}
  6532. }
  6533. const re = {
  6534. encode(u, e = r.Writer.create()) {
  6535. return u.result !== 0 && e.uint32(8).int32(u.result), u.keep_alive !== 0 && e.uint32(16).int32(u.keep_alive), e
  6536. }, decode(u, e) {
  6537. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6538. let n = e === void 0 ? i.len : i.pos + e;
  6539. const a = Wi();
  6540. for (; i.pos < n;) {
  6541. const t = i.uint32();
  6542. switch (t >>> 3) {
  6543. case 1:
  6544. if (t !== 8) break;
  6545. a.result = i.int32();
  6546. continue;
  6547. case 2:
  6548. if (t !== 16) break;
  6549. a.keep_alive = i.int32();
  6550. continue
  6551. }
  6552. if ((t & 7) === 4 || t === 0) break;
  6553. i.skipType(t & 7)
  6554. }
  6555. return a
  6556. }, fromJSON(u) {
  6557. return {
  6558. result: C(u.result) ? Ha(u.result) : 0,
  6559. keep_alive: C(u.keep_alive) ? globalThis.Number(u.keep_alive) : 0
  6560. }
  6561. }, toJSON(u) {
  6562. const e = {};
  6563. return u.result !== 0 && (e.result = Ja(u.result)), u.keep_alive !== 0 && (e.keep_alive = Math.round(u.keep_alive)), e
  6564. }, create(u) {
  6565. return re.fromPartial(u != null ? u : {})
  6566. }, fromPartial(u) {
  6567. var i, n;
  6568. const e = Wi();
  6569. return e.result = (i = u.result) != null ? i : 0, e.keep_alive = (n = u.keep_alive) != null ? n : 0, e
  6570. }
  6571. };
  6572. function Vi() {
  6573. return {
  6574. socket_addr: new Uint8Array(0),
  6575. pk: new Uint8Array(0),
  6576. failure: 0,
  6577. relay_server: "",
  6578. nat_type: void 0,
  6579. is_local: void 0,
  6580. other_failure: "",
  6581. feedback: 0
  6582. }
  6583. }
  6584. const se = {
  6585. encode(u, e = r.Writer.create()) {
  6586. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.pk.length !== 0 && e.uint32(18).bytes(u.pk), u.failure !== 0 && e.uint32(24).int32(u.failure), u.relay_server !== "" && e.uint32(34).string(u.relay_server), u.nat_type !== void 0 && e.uint32(40).int32(u.nat_type), u.is_local !== void 0 && e.uint32(48).bool(u.is_local), u.other_failure !== "" && e.uint32(58).string(u.other_failure), u.feedback !== 0 && e.uint32(64).int32(u.feedback), e
  6587. }, decode(u, e) {
  6588. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6589. let n = e === void 0 ? i.len : i.pos + e;
  6590. const a = Vi();
  6591. for (; i.pos < n;) {
  6592. const t = i.uint32();
  6593. switch (t >>> 3) {
  6594. case 1:
  6595. if (t !== 10) break;
  6596. a.socket_addr = i.bytes();
  6597. continue;
  6598. case 2:
  6599. if (t !== 18) break;
  6600. a.pk = i.bytes();
  6601. continue;
  6602. case 3:
  6603. if (t !== 24) break;
  6604. a.failure = i.int32();
  6605. continue;
  6606. case 4:
  6607. if (t !== 34) break;
  6608. a.relay_server = i.string();
  6609. continue;
  6610. case 5:
  6611. if (t !== 40) break;
  6612. a.nat_type = i.int32();
  6613. continue;
  6614. case 6:
  6615. if (t !== 48) break;
  6616. a.is_local = i.bool();
  6617. continue;
  6618. case 7:
  6619. if (t !== 58) break;
  6620. a.other_failure = i.string();
  6621. continue;
  6622. case 8:
  6623. if (t !== 64) break;
  6624. a.feedback = i.int32();
  6625. continue
  6626. }
  6627. if ((t & 7) === 4 || t === 0) break;
  6628. i.skipType(t & 7)
  6629. }
  6630. return a
  6631. }, fromJSON(u) {
  6632. return {
  6633. socket_addr: C(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6634. pk: C(u.pk) ? O(u.pk) : new Uint8Array(0),
  6635. failure: C(u.failure) ? Ga(u.failure) : 0,
  6636. relay_server: C(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6637. nat_type: C(u.nat_type) ? i4(u.nat_type) : void 0,
  6638. is_local: C(u.is_local) ? globalThis.Boolean(u.is_local) : void 0,
  6639. other_failure: C(u.other_failure) ? globalThis.String(u.other_failure) : "",
  6640. feedback: C(u.feedback) ? globalThis.Number(u.feedback) : 0
  6641. }
  6642. }, toJSON(u) {
  6643. const e = {};
  6644. return u.socket_addr.length !== 0 && (e.socket_addr = U(u.socket_addr)), u.pk.length !== 0 && (e.pk = U(u.pk)), u.failure !== 0 && (e.failure = Za(u.failure)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== void 0 && (e.nat_type = t4(u.nat_type)), u.is_local !== void 0 && (e.is_local = u.is_local), u.other_failure !== "" && (e.other_failure = u.other_failure), u.feedback !== 0 && (e.feedback = Math.round(u.feedback)), e
  6645. }, create(u) {
  6646. return se.fromPartial(u != null ? u : {})
  6647. }, fromPartial(u) {
  6648. var i, n, a, t, s, E, l, d;
  6649. const e = Vi();
  6650. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.pk = (n = u.pk) != null ? n : new Uint8Array(0), e.failure = (a = u.failure) != null ? a : 0, e.relay_server = (t = u.relay_server) != null ? t : "", e.nat_type = (s = u.nat_type) != null ? s : void 0, e.is_local = (E = u.is_local) != null ? E : void 0, e.other_failure = (l = u.other_failure) != null ? l : "", e.feedback = (d = u.feedback) != null ? d : 0, e
  6651. }
  6652. };
  6653. function qi() {
  6654. return {serial: 0, rendezvous_servers: []}
  6655. }
  6656. const tu = {
  6657. encode(u, e = r.Writer.create()) {
  6658. u.serial !== 0 && e.uint32(8).int32(u.serial);
  6659. for (const i of u.rendezvous_servers) e.uint32(18).string(i);
  6660. return e
  6661. }, decode(u, e) {
  6662. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6663. let n = e === void 0 ? i.len : i.pos + e;
  6664. const a = qi();
  6665. for (; i.pos < n;) {
  6666. const t = i.uint32();
  6667. switch (t >>> 3) {
  6668. case 1:
  6669. if (t !== 8) break;
  6670. a.serial = i.int32();
  6671. continue;
  6672. case 2:
  6673. if (t !== 18) break;
  6674. a.rendezvous_servers.push(i.string());
  6675. continue
  6676. }
  6677. if ((t & 7) === 4 || t === 0) break;
  6678. i.skipType(t & 7)
  6679. }
  6680. return a
  6681. }, fromJSON(u) {
  6682. return {
  6683. serial: C(u.serial) ? globalThis.Number(u.serial) : 0,
  6684. rendezvous_servers: globalThis.Array.isArray(u == null ? void 0 : u.rendezvous_servers) ? u.rendezvous_servers.map(e => globalThis.String(e)) : []
  6685. }
  6686. }, toJSON(u) {
  6687. var i;
  6688. const e = {};
  6689. return u.serial !== 0 && (e.serial = Math.round(u.serial)), (i = u.rendezvous_servers) != null && i.length && (e.rendezvous_servers = u.rendezvous_servers), e
  6690. }, create(u) {
  6691. return tu.fromPartial(u != null ? u : {})
  6692. }, fromPartial(u) {
  6693. var i, n;
  6694. const e = qi();
  6695. return e.serial = (i = u.serial) != null ? i : 0, e.rendezvous_servers = ((n = u.rendezvous_servers) == null ? void 0 : n.map(a => a)) || [], e
  6696. }
  6697. };
  6698. function Ki() {
  6699. return {
  6700. id: "",
  6701. uuid: "",
  6702. socket_addr: new Uint8Array(0),
  6703. relay_server: "",
  6704. secure: !1,
  6705. licence_key: "",
  6706. conn_type: 0,
  6707. token: ""
  6708. }
  6709. }
  6710. const Ju = {
  6711. encode(u, e = r.Writer.create()) {
  6712. return u.id !== "" && e.uint32(10).string(u.id), u.uuid !== "" && e.uint32(18).string(u.uuid), u.socket_addr.length !== 0 && e.uint32(26).bytes(u.socket_addr), u.relay_server !== "" && e.uint32(34).string(u.relay_server), u.secure !== !1 && e.uint32(40).bool(u.secure), u.licence_key !== "" && e.uint32(50).string(u.licence_key), u.conn_type !== 0 && e.uint32(56).int32(u.conn_type), u.token !== "" && e.uint32(66).string(u.token), e
  6713. }, decode(u, e) {
  6714. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6715. let n = e === void 0 ? i.len : i.pos + e;
  6716. const a = Ki();
  6717. for (; i.pos < n;) {
  6718. const t = i.uint32();
  6719. switch (t >>> 3) {
  6720. case 1:
  6721. if (t !== 10) break;
  6722. a.id = i.string();
  6723. continue;
  6724. case 2:
  6725. if (t !== 18) break;
  6726. a.uuid = i.string();
  6727. continue;
  6728. case 3:
  6729. if (t !== 26) break;
  6730. a.socket_addr = i.bytes();
  6731. continue;
  6732. case 4:
  6733. if (t !== 34) break;
  6734. a.relay_server = i.string();
  6735. continue;
  6736. case 5:
  6737. if (t !== 40) break;
  6738. a.secure = i.bool();
  6739. continue;
  6740. case 6:
  6741. if (t !== 50) break;
  6742. a.licence_key = i.string();
  6743. continue;
  6744. case 7:
  6745. if (t !== 56) break;
  6746. a.conn_type = i.int32();
  6747. continue;
  6748. case 8:
  6749. if (t !== 66) break;
  6750. a.token = i.string();
  6751. continue
  6752. }
  6753. if ((t & 7) === 4 || t === 0) break;
  6754. i.skipType(t & 7)
  6755. }
  6756. return a
  6757. }, fromJSON(u) {
  6758. return {
  6759. id: C(u.id) ? globalThis.String(u.id) : "",
  6760. uuid: C(u.uuid) ? globalThis.String(u.uuid) : "",
  6761. socket_addr: C(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6762. relay_server: C(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6763. secure: C(u.secure) ? globalThis.Boolean(u.secure) : !1,
  6764. licence_key: C(u.licence_key) ? globalThis.String(u.licence_key) : "",
  6765. conn_type: C(u.conn_type) ? xt(u.conn_type) : 0,
  6766. token: C(u.token) ? globalThis.String(u.token) : ""
  6767. }
  6768. }, toJSON(u) {
  6769. const e = {};
  6770. return u.id !== "" && (e.id = u.id), u.uuid !== "" && (e.uuid = u.uuid), u.socket_addr.length !== 0 && (e.socket_addr = U(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.secure !== !1 && (e.secure = u.secure), u.licence_key !== "" && (e.licence_key = u.licence_key), u.conn_type !== 0 && (e.conn_type = yt(u.conn_type)), u.token !== "" && (e.token = u.token), e
  6771. }, create(u) {
  6772. return Ju.fromPartial(u != null ? u : {})
  6773. }, fromPartial(u) {
  6774. var i, n, a, t, s, E, l, d;
  6775. const e = Ki();
  6776. return e.id = (i = u.id) != null ? i : "", e.uuid = (n = u.uuid) != null ? n : "", e.socket_addr = (a = u.socket_addr) != null ? a : new Uint8Array(0), e.relay_server = (t = u.relay_server) != null ? t : "", e.secure = (s = u.secure) != null ? s : !1, e.licence_key = (E = u.licence_key) != null ? E : "", e.conn_type = (l = u.conn_type) != null ? l : 0, e.token = (d = u.token) != null ? d : "", e
  6777. }
  6778. };
  6779. function Hi() {
  6780. return {
  6781. socket_addr: new Uint8Array(0),
  6782. uuid: "",
  6783. relay_server: "",
  6784. id: void 0,
  6785. pk: void 0,
  6786. refuse_reason: "",
  6787. version: "",
  6788. feedback: 0
  6789. }
  6790. }
  6791. const Ee = {
  6792. encode(u, e = r.Writer.create()) {
  6793. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.uuid !== "" && e.uint32(18).string(u.uuid), u.relay_server !== "" && e.uint32(26).string(u.relay_server), u.id !== void 0 && e.uint32(34).string(u.id), u.pk !== void 0 && e.uint32(42).bytes(u.pk), u.refuse_reason !== "" && e.uint32(50).string(u.refuse_reason), u.version !== "" && e.uint32(58).string(u.version), u.feedback !== 0 && e.uint32(72).int32(u.feedback), e
  6794. }, decode(u, e) {
  6795. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6796. let n = e === void 0 ? i.len : i.pos + e;
  6797. const a = Hi();
  6798. for (; i.pos < n;) {
  6799. const t = i.uint32();
  6800. switch (t >>> 3) {
  6801. case 1:
  6802. if (t !== 10) break;
  6803. a.socket_addr = i.bytes();
  6804. continue;
  6805. case 2:
  6806. if (t !== 18) break;
  6807. a.uuid = i.string();
  6808. continue;
  6809. case 3:
  6810. if (t !== 26) break;
  6811. a.relay_server = i.string();
  6812. continue;
  6813. case 4:
  6814. if (t !== 34) break;
  6815. a.id = i.string();
  6816. continue;
  6817. case 5:
  6818. if (t !== 42) break;
  6819. a.pk = i.bytes();
  6820. continue;
  6821. case 6:
  6822. if (t !== 50) break;
  6823. a.refuse_reason = i.string();
  6824. continue;
  6825. case 7:
  6826. if (t !== 58) break;
  6827. a.version = i.string();
  6828. continue;
  6829. case 9:
  6830. if (t !== 72) break;
  6831. a.feedback = i.int32();
  6832. continue
  6833. }
  6834. if ((t & 7) === 4 || t === 0) break;
  6835. i.skipType(t & 7)
  6836. }
  6837. return a
  6838. }, fromJSON(u) {
  6839. return {
  6840. socket_addr: C(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6841. uuid: C(u.uuid) ? globalThis.String(u.uuid) : "",
  6842. relay_server: C(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6843. id: C(u.id) ? globalThis.String(u.id) : void 0,
  6844. pk: C(u.pk) ? O(u.pk) : void 0,
  6845. refuse_reason: C(u.refuse_reason) ? globalThis.String(u.refuse_reason) : "",
  6846. version: C(u.version) ? globalThis.String(u.version) : "",
  6847. feedback: C(u.feedback) ? globalThis.Number(u.feedback) : 0
  6848. }
  6849. }, toJSON(u) {
  6850. const e = {};
  6851. return u.socket_addr.length !== 0 && (e.socket_addr = U(u.socket_addr)), u.uuid !== "" && (e.uuid = u.uuid), u.relay_server !== "" && (e.relay_server = u.relay_server), u.id !== void 0 && (e.id = u.id), u.pk !== void 0 && (e.pk = U(u.pk)), u.refuse_reason !== "" && (e.refuse_reason = u.refuse_reason), u.version !== "" && (e.version = u.version), u.feedback !== 0 && (e.feedback = Math.round(u.feedback)), e
  6852. }, create(u) {
  6853. return Ee.fromPartial(u != null ? u : {})
  6854. }, fromPartial(u) {
  6855. var i, n, a, t, s, E, l, d;
  6856. const e = Hi();
  6857. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.uuid = (n = u.uuid) != null ? n : "", e.relay_server = (a = u.relay_server) != null ? a : "", e.id = (t = u.id) != null ? t : void 0, e.pk = (s = u.pk) != null ? s : void 0, e.refuse_reason = (E = u.refuse_reason) != null ? E : "", e.version = (l = u.version) != null ? l : "", e.feedback = (d = u.feedback) != null ? d : 0, e
  6858. }
  6859. };
  6860. function Ji() {
  6861. return {url: ""}
  6862. }
  6863. const le = {
  6864. encode(u, e = r.Writer.create()) {
  6865. return u.url !== "" && e.uint32(10).string(u.url), e
  6866. }, decode(u, e) {
  6867. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6868. let n = e === void 0 ? i.len : i.pos + e;
  6869. const a = Ji();
  6870. for (; i.pos < n;) {
  6871. const t = i.uint32();
  6872. switch (t >>> 3) {
  6873. case 1:
  6874. if (t !== 10) break;
  6875. a.url = i.string();
  6876. continue
  6877. }
  6878. if ((t & 7) === 4 || t === 0) break;
  6879. i.skipType(t & 7)
  6880. }
  6881. return a
  6882. }, fromJSON(u) {
  6883. return {url: C(u.url) ? globalThis.String(u.url) : ""}
  6884. }, toJSON(u) {
  6885. const e = {};
  6886. return u.url !== "" && (e.url = u.url), e
  6887. }, create(u) {
  6888. return le.fromPartial(u != null ? u : {})
  6889. }, fromPartial(u) {
  6890. var i;
  6891. const e = Ji();
  6892. return e.url = (i = u.url) != null ? i : "", e
  6893. }
  6894. };
  6895. function Gi() {
  6896. return {socket_addr: new Uint8Array(0), relay_server: ""}
  6897. }
  6898. const De = {
  6899. encode(u, e = r.Writer.create()) {
  6900. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.relay_server !== "" && e.uint32(18).string(u.relay_server), e
  6901. }, decode(u, e) {
  6902. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6903. let n = e === void 0 ? i.len : i.pos + e;
  6904. const a = Gi();
  6905. for (; i.pos < n;) {
  6906. const t = i.uint32();
  6907. switch (t >>> 3) {
  6908. case 1:
  6909. if (t !== 10) break;
  6910. a.socket_addr = i.bytes();
  6911. continue;
  6912. case 2:
  6913. if (t !== 18) break;
  6914. a.relay_server = i.string();
  6915. continue
  6916. }
  6917. if ((t & 7) === 4 || t === 0) break;
  6918. i.skipType(t & 7)
  6919. }
  6920. return a
  6921. }, fromJSON(u) {
  6922. return {
  6923. socket_addr: C(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6924. relay_server: C(u.relay_server) ? globalThis.String(u.relay_server) : ""
  6925. }
  6926. }, toJSON(u) {
  6927. const e = {};
  6928. return u.socket_addr.length !== 0 && (e.socket_addr = U(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), e
  6929. }, create(u) {
  6930. return De.fromPartial(u != null ? u : {})
  6931. }, fromPartial(u) {
  6932. var i, n;
  6933. const e = Gi();
  6934. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.relay_server = (n = u.relay_server) != null ? n : "", e
  6935. }
  6936. };
  6937. function Zi() {
  6938. return {socket_addr: new Uint8Array(0), local_addr: new Uint8Array(0), relay_server: "", id: "", version: ""}
  6939. }
  6940. const de = {
  6941. encode(u, e = r.Writer.create()) {
  6942. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.local_addr.length !== 0 && e.uint32(18).bytes(u.local_addr), u.relay_server !== "" && e.uint32(26).string(u.relay_server), u.id !== "" && e.uint32(34).string(u.id), u.version !== "" && e.uint32(42).string(u.version), e
  6943. }, decode(u, e) {
  6944. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6945. let n = e === void 0 ? i.len : i.pos + e;
  6946. const a = Zi();
  6947. for (; i.pos < n;) {
  6948. const t = i.uint32();
  6949. switch (t >>> 3) {
  6950. case 1:
  6951. if (t !== 10) break;
  6952. a.socket_addr = i.bytes();
  6953. continue;
  6954. case 2:
  6955. if (t !== 18) break;
  6956. a.local_addr = i.bytes();
  6957. continue;
  6958. case 3:
  6959. if (t !== 26) break;
  6960. a.relay_server = i.string();
  6961. continue;
  6962. case 4:
  6963. if (t !== 34) break;
  6964. a.id = i.string();
  6965. continue;
  6966. case 5:
  6967. if (t !== 42) break;
  6968. a.version = i.string();
  6969. continue
  6970. }
  6971. if ((t & 7) === 4 || t === 0) break;
  6972. i.skipType(t & 7)
  6973. }
  6974. return a
  6975. }, fromJSON(u) {
  6976. return {
  6977. socket_addr: C(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6978. local_addr: C(u.local_addr) ? O(u.local_addr) : new Uint8Array(0),
  6979. relay_server: C(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6980. id: C(u.id) ? globalThis.String(u.id) : "",
  6981. version: C(u.version) ? globalThis.String(u.version) : ""
  6982. }
  6983. }, toJSON(u) {
  6984. const e = {};
  6985. return u.socket_addr.length !== 0 && (e.socket_addr = U(u.socket_addr)), u.local_addr.length !== 0 && (e.local_addr = U(u.local_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.id !== "" && (e.id = u.id), u.version !== "" && (e.version = u.version), e
  6986. }, create(u) {
  6987. return de.fromPartial(u != null ? u : {})
  6988. }, fromPartial(u) {
  6989. var i, n, a, t, s;
  6990. const e = Zi();
  6991. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.local_addr = (n = u.local_addr) != null ? n : new Uint8Array(0), e.relay_server = (a = u.relay_server) != null ? a : "", e.id = (t = u.id) != null ? t : "", e.version = (s = u.version) != null ? s : "", e
  6992. }
  6993. };
  6994. function Qi() {
  6995. return {cmd: "", mac: "", id: "", username: "", hostname: "", platform: "", misc: ""}
  6996. }
  6997. const ce = {
  6998. encode(u, e = r.Writer.create()) {
  6999. return u.cmd !== "" && e.uint32(10).string(u.cmd), u.mac !== "" && e.uint32(18).string(u.mac), u.id !== "" && e.uint32(26).string(u.id), u.username !== "" && e.uint32(34).string(u.username), u.hostname !== "" && e.uint32(42).string(u.hostname), u.platform !== "" && e.uint32(50).string(u.platform), u.misc !== "" && e.uint32(58).string(u.misc), e
  7000. }, decode(u, e) {
  7001. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7002. let n = e === void 0 ? i.len : i.pos + e;
  7003. const a = Qi();
  7004. for (; i.pos < n;) {
  7005. const t = i.uint32();
  7006. switch (t >>> 3) {
  7007. case 1:
  7008. if (t !== 10) break;
  7009. a.cmd = i.string();
  7010. continue;
  7011. case 2:
  7012. if (t !== 18) break;
  7013. a.mac = i.string();
  7014. continue;
  7015. case 3:
  7016. if (t !== 26) break;
  7017. a.id = i.string();
  7018. continue;
  7019. case 4:
  7020. if (t !== 34) break;
  7021. a.username = i.string();
  7022. continue;
  7023. case 5:
  7024. if (t !== 42) break;
  7025. a.hostname = i.string();
  7026. continue;
  7027. case 6:
  7028. if (t !== 50) break;
  7029. a.platform = i.string();
  7030. continue;
  7031. case 7:
  7032. if (t !== 58) break;
  7033. a.misc = i.string();
  7034. continue
  7035. }
  7036. if ((t & 7) === 4 || t === 0) break;
  7037. i.skipType(t & 7)
  7038. }
  7039. return a
  7040. }, fromJSON(u) {
  7041. return {
  7042. cmd: C(u.cmd) ? globalThis.String(u.cmd) : "",
  7043. mac: C(u.mac) ? globalThis.String(u.mac) : "",
  7044. id: C(u.id) ? globalThis.String(u.id) : "",
  7045. username: C(u.username) ? globalThis.String(u.username) : "",
  7046. hostname: C(u.hostname) ? globalThis.String(u.hostname) : "",
  7047. platform: C(u.platform) ? globalThis.String(u.platform) : "",
  7048. misc: C(u.misc) ? globalThis.String(u.misc) : ""
  7049. }
  7050. }, toJSON(u) {
  7051. const e = {};
  7052. return u.cmd !== "" && (e.cmd = u.cmd), u.mac !== "" && (e.mac = u.mac), u.id !== "" && (e.id = u.id), u.username !== "" && (e.username = u.username), u.hostname !== "" && (e.hostname = u.hostname), u.platform !== "" && (e.platform = u.platform), u.misc !== "" && (e.misc = u.misc), e
  7053. }, create(u) {
  7054. return ce.fromPartial(u != null ? u : {})
  7055. }, fromPartial(u) {
  7056. var i, n, a, t, s, E, l;
  7057. const e = Qi();
  7058. return e.cmd = (i = u.cmd) != null ? i : "", e.mac = (n = u.mac) != null ? n : "", e.id = (a = u.id) != null ? a : "", e.username = (t = u.username) != null ? t : "", e.hostname = (s = u.hostname) != null ? s : "", e.platform = (E = u.platform) != null ? E : "", e.misc = (l = u.misc) != null ? l : "", e
  7059. }
  7060. };
  7061. function Xi() {
  7062. return {id: "", peers: []}
  7063. }
  7064. const Gu = {
  7065. encode(u, e = r.Writer.create()) {
  7066. u.id !== "" && e.uint32(10).string(u.id);
  7067. for (const i of u.peers) e.uint32(18).string(i);
  7068. return e
  7069. }, decode(u, e) {
  7070. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7071. let n = e === void 0 ? i.len : i.pos + e;
  7072. const a = Xi();
  7073. for (; i.pos < n;) {
  7074. const t = i.uint32();
  7075. switch (t >>> 3) {
  7076. case 1:
  7077. if (t !== 10) break;
  7078. a.id = i.string();
  7079. continue;
  7080. case 2:
  7081. if (t !== 18) break;
  7082. a.peers.push(i.string());
  7083. continue
  7084. }
  7085. if ((t & 7) === 4 || t === 0) break;
  7086. i.skipType(t & 7)
  7087. }
  7088. return a
  7089. }, fromJSON(u) {
  7090. return {
  7091. id: C(u.id) ? globalThis.String(u.id) : "",
  7092. peers: globalThis.Array.isArray(u == null ? void 0 : u.peers) ? u.peers.map(e => globalThis.String(e)) : []
  7093. }
  7094. }, toJSON(u) {
  7095. var i;
  7096. const e = {};
  7097. return u.id !== "" && (e.id = u.id), (i = u.peers) != null && i.length && (e.peers = u.peers), e
  7098. }, create(u) {
  7099. return Gu.fromPartial(u != null ? u : {})
  7100. }, fromPartial(u) {
  7101. var i, n;
  7102. const e = Xi();
  7103. return e.id = (i = u.id) != null ? i : "", e.peers = ((n = u.peers) == null ? void 0 : n.map(a => a)) || [], e
  7104. }
  7105. };
  7106. function Yi() {
  7107. return {states: new Uint8Array(0)}
  7108. }
  7109. const Ce = {
  7110. encode(u, e = r.Writer.create()) {
  7111. return u.states.length !== 0 && e.uint32(10).bytes(u.states), e
  7112. }, decode(u, e) {
  7113. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7114. let n = e === void 0 ? i.len : i.pos + e;
  7115. const a = Yi();
  7116. for (; i.pos < n;) {
  7117. const t = i.uint32();
  7118. switch (t >>> 3) {
  7119. case 1:
  7120. if (t !== 10) break;
  7121. a.states = i.bytes();
  7122. continue
  7123. }
  7124. if ((t & 7) === 4 || t === 0) break;
  7125. i.skipType(t & 7)
  7126. }
  7127. return a
  7128. }, fromJSON(u) {
  7129. return {states: C(u.states) ? O(u.states) : new Uint8Array(0)}
  7130. }, toJSON(u) {
  7131. const e = {};
  7132. return u.states.length !== 0 && (e.states = U(u.states)), e
  7133. }, create(u) {
  7134. return Ce.fromPartial(u != null ? u : {})
  7135. }, fromPartial(u) {
  7136. var i;
  7137. const e = Yi();
  7138. return e.states = (i = u.states) != null ? i : new Uint8Array(0), e
  7139. }
  7140. };
  7141. function $i() {
  7142. return {keys: []}
  7143. }
  7144. const pe = {
  7145. encode(u, e = r.Writer.create()) {
  7146. for (const i of u.keys) e.uint32(10).bytes(i);
  7147. return e
  7148. }, decode(u, e) {
  7149. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7150. let n = e === void 0 ? i.len : i.pos + e;
  7151. const a = $i();
  7152. for (; i.pos < n;) {
  7153. const t = i.uint32();
  7154. switch (t >>> 3) {
  7155. case 1:
  7156. if (t !== 10) break;
  7157. a.keys.push(i.bytes());
  7158. continue
  7159. }
  7160. if ((t & 7) === 4 || t === 0) break;
  7161. i.skipType(t & 7)
  7162. }
  7163. return a
  7164. }, fromJSON(u) {
  7165. return {keys: globalThis.Array.isArray(u == null ? void 0 : u.keys) ? u.keys.map(e => O(e)) : []}
  7166. }, toJSON(u) {
  7167. var i;
  7168. const e = {};
  7169. return (i = u.keys) != null && i.length && (e.keys = u.keys.map(n => U(n))), e
  7170. }, create(u) {
  7171. return pe.fromPartial(u != null ? u : {})
  7172. }, fromPartial(u) {
  7173. var i;
  7174. const e = $i();
  7175. return e.keys = ((i = u.keys) == null ? void 0 : i.map(n => n)) || [], e
  7176. }
  7177. };
  7178. function ut() {
  7179. return {token: ""}
  7180. }
  7181. const Zu = {
  7182. encode(u, e = r.Writer.create()) {
  7183. return u.token !== "" && e.uint32(10).string(u.token), e
  7184. }, decode(u, e) {
  7185. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7186. let n = e === void 0 ? i.len : i.pos + e;
  7187. const a = ut();
  7188. for (; i.pos < n;) {
  7189. const t = i.uint32();
  7190. switch (t >>> 3) {
  7191. case 1:
  7192. if (t !== 10) break;
  7193. a.token = i.string();
  7194. continue
  7195. }
  7196. if ((t & 7) === 4 || t === 0) break;
  7197. i.skipType(t & 7)
  7198. }
  7199. return a
  7200. }, fromJSON(u) {
  7201. return {token: C(u.token) ? globalThis.String(u.token) : ""}
  7202. }, toJSON(u) {
  7203. const e = {};
  7204. return u.token !== "" && (e.token = u.token), e
  7205. }, create(u) {
  7206. return Zu.fromPartial(u != null ? u : {})
  7207. }, fromPartial(u) {
  7208. var i;
  7209. const e = ut();
  7210. return e.token = (i = u.token) != null ? i : "", e
  7211. }
  7212. };
  7213. function et() {
  7214. return {
  7215. register_peer: void 0,
  7216. register_peer_response: void 0,
  7217. punch_hole_request: void 0,
  7218. punch_hole: void 0,
  7219. punch_hole_sent: void 0,
  7220. punch_hole_response: void 0,
  7221. fetch_local_addr: void 0,
  7222. local_addr: void 0,
  7223. configure_update: void 0,
  7224. register_pk: void 0,
  7225. register_pk_response: void 0,
  7226. software_update: void 0,
  7227. request_relay: void 0,
  7228. relay_response: void 0,
  7229. test_nat_request: void 0,
  7230. test_nat_response: void 0,
  7231. peer_discovery: void 0,
  7232. online_request: void 0,
  7233. online_response: void 0,
  7234. key_exchange: void 0,
  7235. hc: void 0
  7236. }
  7237. }
  7238. const Ne = {
  7239. encode(u, e = r.Writer.create()) {
  7240. return u.register_peer !== void 0 && ue.encode(u.register_peer, e.uint32(50).fork()).ldelim(), u.register_peer_response !== void 0 && ee.encode(u.register_peer_response, e.uint32(58).fork()).ldelim(), u.punch_hole_request !== void 0 && Hu.encode(u.punch_hole_request, e.uint32(66).fork()).ldelim(), u.punch_hole !== void 0 && ie.encode(u.punch_hole, e.uint32(74).fork()).ldelim(), u.punch_hole_sent !== void 0 && ne.encode(u.punch_hole_sent, e.uint32(82).fork()).ldelim(), u.punch_hole_response !== void 0 && se.encode(u.punch_hole_response, e.uint32(90).fork()).ldelim(), u.fetch_local_addr !== void 0 && De.encode(u.fetch_local_addr, e.uint32(98).fork()).ldelim(), u.local_addr !== void 0 && de.encode(u.local_addr, e.uint32(106).fork()).ldelim(), u.configure_update !== void 0 && tu.encode(u.configure_update, e.uint32(114).fork()).ldelim(), u.register_pk !== void 0 && oe.encode(u.register_pk, e.uint32(122).fork()).ldelim(), u.register_pk_response !== void 0 && re.encode(u.register_pk_response, e.uint32(130).fork()).ldelim(), u.software_update !== void 0 && le.encode(u.software_update, e.uint32(138).fork()).ldelim(), u.request_relay !== void 0 && Ju.encode(u.request_relay, e.uint32(146).fork()).ldelim(), u.relay_response !== void 0 && Ee.encode(u.relay_response, e.uint32(154).fork()).ldelim(), u.test_nat_request !== void 0 && te.encode(u.test_nat_request, e.uint32(162).fork()).ldelim(), u.test_nat_response !== void 0 && ae.encode(u.test_nat_response, e.uint32(170).fork()).ldelim(), u.peer_discovery !== void 0 && ce.encode(u.peer_discovery, e.uint32(178).fork()).ldelim(), u.online_request !== void 0 && Gu.encode(u.online_request, e.uint32(186).fork()).ldelim(), u.online_response !== void 0 && Ce.encode(u.online_response, e.uint32(194).fork()).ldelim(), u.key_exchange !== void 0 && pe.encode(u.key_exchange, e.uint32(202).fork()).ldelim(), u.hc !== void 0 && Zu.encode(u.hc, e.uint32(210).fork()).ldelim(), e
  7241. }, decode(u, e) {
  7242. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7243. let n = e === void 0 ? i.len : i.pos + e;
  7244. const a = et();
  7245. for (; i.pos < n;) {
  7246. const t = i.uint32();
  7247. switch (t >>> 3) {
  7248. case 6:
  7249. if (t !== 50) break;
  7250. a.register_peer = ue.decode(i, i.uint32());
  7251. continue;
  7252. case 7:
  7253. if (t !== 58) break;
  7254. a.register_peer_response = ee.decode(i, i.uint32());
  7255. continue;
  7256. case 8:
  7257. if (t !== 66) break;
  7258. a.punch_hole_request = Hu.decode(i, i.uint32());
  7259. continue;
  7260. case 9:
  7261. if (t !== 74) break;
  7262. a.punch_hole = ie.decode(i, i.uint32());
  7263. continue;
  7264. case 10:
  7265. if (t !== 82) break;
  7266. a.punch_hole_sent = ne.decode(i, i.uint32());
  7267. continue;
  7268. case 11:
  7269. if (t !== 90) break;
  7270. a.punch_hole_response = se.decode(i, i.uint32());
  7271. continue;
  7272. case 12:
  7273. if (t !== 98) break;
  7274. a.fetch_local_addr = De.decode(i, i.uint32());
  7275. continue;
  7276. case 13:
  7277. if (t !== 106) break;
  7278. a.local_addr = de.decode(i, i.uint32());
  7279. continue;
  7280. case 14:
  7281. if (t !== 114) break;
  7282. a.configure_update = tu.decode(i, i.uint32());
  7283. continue;
  7284. case 15:
  7285. if (t !== 122) break;
  7286. a.register_pk = oe.decode(i, i.uint32());
  7287. continue;
  7288. case 16:
  7289. if (t !== 130) break;
  7290. a.register_pk_response = re.decode(i, i.uint32());
  7291. continue;
  7292. case 17:
  7293. if (t !== 138) break;
  7294. a.software_update = le.decode(i, i.uint32());
  7295. continue;
  7296. case 18:
  7297. if (t !== 146) break;
  7298. a.request_relay = Ju.decode(i, i.uint32());
  7299. continue;
  7300. case 19:
  7301. if (t !== 154) break;
  7302. a.relay_response = Ee.decode(i, i.uint32());
  7303. continue;
  7304. case 20:
  7305. if (t !== 162) break;
  7306. a.test_nat_request = te.decode(i, i.uint32());
  7307. continue;
  7308. case 21:
  7309. if (t !== 170) break;
  7310. a.test_nat_response = ae.decode(i, i.uint32());
  7311. continue;
  7312. case 22:
  7313. if (t !== 178) break;
  7314. a.peer_discovery = ce.decode(i, i.uint32());
  7315. continue;
  7316. case 23:
  7317. if (t !== 186) break;
  7318. a.online_request = Gu.decode(i, i.uint32());
  7319. continue;
  7320. case 24:
  7321. if (t !== 194) break;
  7322. a.online_response = Ce.decode(i, i.uint32());
  7323. continue;
  7324. case 25:
  7325. if (t !== 202) break;
  7326. a.key_exchange = pe.decode(i, i.uint32());
  7327. continue;
  7328. case 26:
  7329. if (t !== 210) break;
  7330. a.hc = Zu.decode(i, i.uint32());
  7331. continue
  7332. }
  7333. if ((t & 7) === 4 || t === 0) break;
  7334. i.skipType(t & 7)
  7335. }
  7336. return a
  7337. }, fromJSON(u) {
  7338. return {
  7339. register_peer: C(u.register_peer) ? ue.fromJSON(u.register_peer) : void 0,
  7340. register_peer_response: C(u.register_peer_response) ? ee.fromJSON(u.register_peer_response) : void 0,
  7341. punch_hole_request: C(u.punch_hole_request) ? Hu.fromJSON(u.punch_hole_request) : void 0,
  7342. punch_hole: C(u.punch_hole) ? ie.fromJSON(u.punch_hole) : void 0,
  7343. punch_hole_sent: C(u.punch_hole_sent) ? ne.fromJSON(u.punch_hole_sent) : void 0,
  7344. punch_hole_response: C(u.punch_hole_response) ? se.fromJSON(u.punch_hole_response) : void 0,
  7345. fetch_local_addr: C(u.fetch_local_addr) ? De.fromJSON(u.fetch_local_addr) : void 0,
  7346. local_addr: C(u.local_addr) ? de.fromJSON(u.local_addr) : void 0,
  7347. configure_update: C(u.configure_update) ? tu.fromJSON(u.configure_update) : void 0,
  7348. register_pk: C(u.register_pk) ? oe.fromJSON(u.register_pk) : void 0,
  7349. register_pk_response: C(u.register_pk_response) ? re.fromJSON(u.register_pk_response) : void 0,
  7350. software_update: C(u.software_update) ? le.fromJSON(u.software_update) : void 0,
  7351. request_relay: C(u.request_relay) ? Ju.fromJSON(u.request_relay) : void 0,
  7352. relay_response: C(u.relay_response) ? Ee.fromJSON(u.relay_response) : void 0,
  7353. test_nat_request: C(u.test_nat_request) ? te.fromJSON(u.test_nat_request) : void 0,
  7354. test_nat_response: C(u.test_nat_response) ? ae.fromJSON(u.test_nat_response) : void 0,
  7355. peer_discovery: C(u.peer_discovery) ? ce.fromJSON(u.peer_discovery) : void 0,
  7356. online_request: C(u.online_request) ? Gu.fromJSON(u.online_request) : void 0,
  7357. online_response: C(u.online_response) ? Ce.fromJSON(u.online_response) : void 0,
  7358. key_exchange: C(u.key_exchange) ? pe.fromJSON(u.key_exchange) : void 0,
  7359. hc: C(u.hc) ? Zu.fromJSON(u.hc) : void 0
  7360. }
  7361. }, toJSON(u) {
  7362. const e = {};
  7363. return u.register_peer !== void 0 && (e.register_peer = ue.toJSON(u.register_peer)), u.register_peer_response !== void 0 && (e.register_peer_response = ee.toJSON(u.register_peer_response)), u.punch_hole_request !== void 0 && (e.punch_hole_request = Hu.toJSON(u.punch_hole_request)), u.punch_hole !== void 0 && (e.punch_hole = ie.toJSON(u.punch_hole)), u.punch_hole_sent !== void 0 && (e.punch_hole_sent = ne.toJSON(u.punch_hole_sent)), u.punch_hole_response !== void 0 && (e.punch_hole_response = se.toJSON(u.punch_hole_response)), u.fetch_local_addr !== void 0 && (e.fetch_local_addr = De.toJSON(u.fetch_local_addr)), u.local_addr !== void 0 && (e.local_addr = de.toJSON(u.local_addr)), u.configure_update !== void 0 && (e.configure_update = tu.toJSON(u.configure_update)), u.register_pk !== void 0 && (e.register_pk = oe.toJSON(u.register_pk)), u.register_pk_response !== void 0 && (e.register_pk_response = re.toJSON(u.register_pk_response)), u.software_update !== void 0 && (e.software_update = le.toJSON(u.software_update)), u.request_relay !== void 0 && (e.request_relay = Ju.toJSON(u.request_relay)), u.relay_response !== void 0 && (e.relay_response = Ee.toJSON(u.relay_response)), u.test_nat_request !== void 0 && (e.test_nat_request = te.toJSON(u.test_nat_request)), u.test_nat_response !== void 0 && (e.test_nat_response = ae.toJSON(u.test_nat_response)), u.peer_discovery !== void 0 && (e.peer_discovery = ce.toJSON(u.peer_discovery)), u.online_request !== void 0 && (e.online_request = Gu.toJSON(u.online_request)), u.online_response !== void 0 && (e.online_response = Ce.toJSON(u.online_response)), u.key_exchange !== void 0 && (e.key_exchange = pe.toJSON(u.key_exchange)), u.hc !== void 0 && (e.hc = Zu.toJSON(u.hc)), e
  7364. }, create(u) {
  7365. return Ne.fromPartial(u != null ? u : {})
  7366. }, fromPartial(u) {
  7367. const e = et();
  7368. return e.register_peer = u.register_peer !== void 0 && u.register_peer !== null ? ue.fromPartial(u.register_peer) : void 0, e.register_peer_response = u.register_peer_response !== void 0 && u.register_peer_response !== null ? ee.fromPartial(u.register_peer_response) : void 0, e.punch_hole_request = u.punch_hole_request !== void 0 && u.punch_hole_request !== null ? Hu.fromPartial(u.punch_hole_request) : void 0, e.punch_hole = u.punch_hole !== void 0 && u.punch_hole !== null ? ie.fromPartial(u.punch_hole) : void 0, e.punch_hole_sent = u.punch_hole_sent !== void 0 && u.punch_hole_sent !== null ? ne.fromPartial(u.punch_hole_sent) : void 0, e.punch_hole_response = u.punch_hole_response !== void 0 && u.punch_hole_response !== null ? se.fromPartial(u.punch_hole_response) : void 0, e.fetch_local_addr = u.fetch_local_addr !== void 0 && u.fetch_local_addr !== null ? De.fromPartial(u.fetch_local_addr) : void 0, e.local_addr = u.local_addr !== void 0 && u.local_addr !== null ? de.fromPartial(u.local_addr) : void 0, e.configure_update = u.configure_update !== void 0 && u.configure_update !== null ? tu.fromPartial(u.configure_update) : void 0, e.register_pk = u.register_pk !== void 0 && u.register_pk !== null ? oe.fromPartial(u.register_pk) : void 0, e.register_pk_response = u.register_pk_response !== void 0 && u.register_pk_response !== null ? re.fromPartial(u.register_pk_response) : void 0, e.software_update = u.software_update !== void 0 && u.software_update !== null ? le.fromPartial(u.software_update) : void 0, e.request_relay = u.request_relay !== void 0 && u.request_relay !== null ? Ju.fromPartial(u.request_relay) : void 0, e.relay_response = u.relay_response !== void 0 && u.relay_response !== null ? Ee.fromPartial(u.relay_response) : void 0, e.test_nat_request = u.test_nat_request !== void 0 && u.test_nat_request !== null ? te.fromPartial(u.test_nat_request) : void 0, e.test_nat_response = u.test_nat_response !== void 0 && u.test_nat_response !== null ? ae.fromPartial(u.test_nat_response) : void 0, e.peer_discovery = u.peer_discovery !== void 0 && u.peer_discovery !== null ? ce.fromPartial(u.peer_discovery) : void 0, e.online_request = u.online_request !== void 0 && u.online_request !== null ? Gu.fromPartial(u.online_request) : void 0, e.online_response = u.online_response !== void 0 && u.online_response !== null ? Ce.fromPartial(u.online_response) : void 0, e.key_exchange = u.key_exchange !== void 0 && u.key_exchange !== null ? pe.fromPartial(u.key_exchange) : void 0, e.hc = u.hc !== void 0 && u.hc !== null ? Zu.fromPartial(u.hc) : void 0, e
  7369. }
  7370. };
  7371. function O(u) {
  7372. if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(u, "base64"));
  7373. {
  7374. const e = globalThis.atob(u), i = new Uint8Array(e.length);
  7375. for (let n = 0; n < e.length; ++n) i[n] = e.charCodeAt(n);
  7376. return i
  7377. }
  7378. }
  7379. function U(u) {
  7380. if (globalThis.Buffer) return globalThis.Buffer.from(u).toString("base64");
  7381. {
  7382. const e = [];
  7383. return u.forEach(i => {
  7384. e.push(globalThis.String.fromCharCode(i))
  7385. }), globalThis.btoa(e.join(""))
  7386. }
  7387. }
  7388. function C(u) {
  7389. return u != null
  7390. }
  7391. class Ve {
  7392. constructor(e, i = !0, n = "") {
  7393. D(this, "_websocket");
  7394. D(this, "_eventHandlers");
  7395. D(this, "_buf");
  7396. D(this, "_status");
  7397. D(this, "_latency");
  7398. D(this, "_secretKey");
  7399. D(this, "_uri");
  7400. D(this, "_isRendezvous");
  7401. D(this, "_recvDataCount");
  7402. D(this, "_tag");
  7403. D(this, "_isProcessing");
  7404. this._eventHandlers = {
  7405. message: void 0,
  7406. open: void 0,
  7407. close: void 0,
  7408. error: void 0,
  7409. status_change: void 0
  7410. }, this._uri = e, this._status = "", this._buf = [], this._websocket = new WebSocket(e), this._websocket.onmessage = this._recv_message.bind(this), this._websocket.binaryType = "arraybuffer", this._latency = new Date().getTime(), this._isRendezvous = i, this._recvDataCount = 0, this._tag = n, this._isProcessing = !1
  7411. }
  7412. resetRecvDataCount() {
  7413. this._recvDataCount = 0
  7414. }
  7415. getRecvDataCount() {
  7416. return this._recvDataCount
  7417. }
  7418. latency() {
  7419. return this._latency
  7420. }
  7421. setSecretKey(e) {
  7422. this._secretKey = [e, 0, 0]
  7423. }
  7424. sendMessage(e) {
  7425. let i = au.encode(au.fromPartial(e)).finish(), n = this._secretKey;
  7426. n && (n[1] += 1, i = vt(i, n[1], n[0])), this._websocket.send(i)
  7427. }
  7428. sendRendezvous(e) {
  7429. this._websocket.send(Ne.encode(Ne.fromPartial(e)).finish())
  7430. }
  7431. sendBytes(e) {
  7432. let i = this._secretKey;
  7433. i && (i[1] += 1, e = vt(e, i[1], i[0])), this._websocket.send(e)
  7434. }
  7435. parseMessage(e) {
  7436. return au.decode(e)
  7437. }
  7438. parseRendezvous(e) {
  7439. return Ne.decode(e)
  7440. }
  7441. off(e) {
  7442. this._eventHandlers[e] = void 0
  7443. }
  7444. on(e, i) {
  7445. this._eventHandlers[e] = i
  7446. }
  7447. setStatus(e) {
  7448. this._status = e, this._eventHandlers.status_change && this._eventHandlers.status_change(e)
  7449. }
  7450. async open(e = 12e3) {
  7451. return new Promise((i, n) => {
  7452. setTimeout(() => {
  7453. this._status != "open" && n(this._status || "Timeout")
  7454. }, e), this._websocket.onopen = () => {
  7455. var a;
  7456. this._latency = new Date().getTime() - this._latency, this.setStatus("open"), console.debug(">> WebSock.onopen " + this._tag), (a = this._websocket) != null && a.protocol && console.info("Server " + this._tag + " choose sub-protocol: " + this._websocket.protocol), this._eventHandlers.open && this._eventHandlers.open(), console.info("WebSock.onopen " + this._tag), i(this)
  7457. }, this._websocket.onclose = a => {
  7458. this._status == "open", this.setStatus(a), this._tag == "query onlines" ? console.info("WebSock.onclose " + this._tag) : a.code == 1e3 ? console.info("WebSock.onclose " + this._tag + ": " + a.reason) : (console.error("WebSock.onclose: " + this._tag), console.error(a)), this._eventHandlers.close && this._eventHandlers.close(a), n("Reset by the peer")
  7459. }, this._websocket.onerror = a => {
  7460. if (!this._status) {
  7461. n("Failed to connect to " + (this._isRendezvous ? "rendezvous" : "relay") + " server, " + this._uri);
  7462. return
  7463. }
  7464. this.setStatus(a), console.error("WebSock.onerror: " + this._tag), console.error(a), this._eventHandlers.error && this._eventHandlers.error(a)
  7465. }
  7466. })
  7467. }
  7468. async next(e = 12e3) {
  7469. let i = this._eventHandlers.message;
  7470. this.off("message");
  7471. try {
  7472. let n = await this._next(e);
  7473. return this.on("message", i), n
  7474. } catch (n) {
  7475. throw this.on("message", i), n
  7476. }
  7477. }
  7478. async _next(e = 12e3) {
  7479. const i = (n, a, t) => {
  7480. if (this._buf.length) n(this._buf[0]), this._buf.splice(0, 1); else {
  7481. if (this._status != "open") {
  7482. a(this._status);
  7483. return
  7484. }
  7485. new Date().getTime() > t + e ? a("Timeout") : setTimeout(() => i(n, a, t), 1)
  7486. }
  7487. };
  7488. return new Promise((n, a) => {
  7489. i(n, a, new Date().getTime())
  7490. })
  7491. }
  7492. close() {
  7493. this.setStatus(""), this._websocket && ((this._websocket.readyState === WebSocket.OPEN || this._websocket.readyState === WebSocket.CONNECTING) && (console.info("Closing WebSocket(" + this._tag + ") connection"), this._websocket.close(1e3, "Normal closure")), this._websocket.onmessage = () => {
  7494. })
  7495. }
  7496. _recv_message(e) {
  7497. if (e.data instanceof window.ArrayBuffer) {
  7498. let i = new Uint8Array(e.data);
  7499. this._recvDataCount += i.length;
  7500. const n = this._secretKey;
  7501. n && (n[2] += 1, i = _r(i, n[2], n[0]));
  7502. let a;
  7503. i.length == 0 ? a = new Uint8Array : a = this._isRendezvous ? this.parseRendezvous(i) : this.parseMessage(i), this._buf.push(a), this._eventHandlers.message && (this._isProcessing || this.processQueue())
  7504. }
  7505. }
  7506. async processQueue() {
  7507. this._isProcessing = !0;
  7508. try {
  7509. for (; this._buf.length > 0 && this._eventHandlers.message;) {
  7510. const e = this._buf.shift();
  7511. await this._eventHandlers.message(e)
  7512. }
  7513. } catch (e) {
  7514. console.log("Error in processQueue: " + e)
  7515. }
  7516. this._isProcessing = !1
  7517. }
  7518. }
  7519. let Au = null;
  7520. const it = ".";
  7521. var $, Bu, u0, $e, lu, u4, wt, we;
  7522. class Qa {
  7523. constructor() {
  7524. Cu(this, u4);
  7525. Cu(this, $, null);
  7526. Cu(this, Bu, {});
  7527. Cu(this, u0, {});
  7528. Cu(this, $e, 0);
  7529. Cu(this, lu, []);
  7530. Cu(this, we, async (e, i) => {
  7531. const n = await (await fetch(e)).arrayBuffer(), a = new Blob([n], {type: i});
  7532. return URL.createObjectURL(a)
  7533. })
  7534. }
  7535. async load() {
  7536. if (!h(this, $)) {
  7537. _e(this, $, new Worker("./ffmpeg.js?v=dddac33a", {type: "module"})), q4(this, u4, wt).call(this);
  7538. const e = await h(this, we).call(this, `${it}/ffmpeg-core.js?v=16fa4bb1`, "text/javascript"),
  7539. i = await h(this, we).call(this, `${it}/ffmpeg-core.wasm?v=241ebe18`, "application/wasm");
  7540. return this.send({type: "LOAD", data: {coreURL: e, wasmURL: i}})
  7541. }
  7542. }
  7543. async decode(e, i) {
  7544. let n = [i];
  7545. var a = null;
  7546. return h(this, lu).length > 0 && (a = h(this, lu).pop(), n.push(a)), this.send({
  7547. type: "DECODE",
  7548. data: {codec: e, data: i, arrayBuffer: a}
  7549. }, n)
  7550. }
  7551. async send({type: e, data: i}, n) {
  7552. return h(this, $) ? new Promise((a, t) => {
  7553. const s = V4(this, $e)._++;
  7554. h(this, Bu)[s] = a, h(this, u0)[s] = t, h(this, $).postMessage({id: s, type: e, data: i}, n)
  7555. }) : Promise.reject("FFmpeg not loaded")
  7556. }
  7557. close() {
  7558. h(this, $) && (this.send({type: "CLOSE", data: {}}), h(this, $).terminate(), _e(this, $, null))
  7559. }
  7560. }
  7561. $ = new WeakMap, Bu = new WeakMap, u0 = new WeakMap, $e = new WeakMap, lu = new WeakMap, u4 = new WeakSet, wt = function () {
  7562. h(this, $).onmessage = ({data: {id: e, type: i, data: n}}) => {
  7563. i == "LOAD" ? (console.log("FFmpeg loaded"), h(this, Bu)[e](n)) : i == "DECODE" ? (h(this, lu).push(n.data.data), h(this, lu).length > 8 && h(this, lu).shift(), h(this, Bu)[e](n)) : i == "CLOSE" ? (_e(this, lu, []), h(this, Bu)[e](n)) : i == "ERROR" ? h(this, u0)[e](n) : h(this, u0)[e](n), delete h(this, Bu)[e], delete h(this, u0)[e]
  7564. }
  7565. }, we = new WeakMap;
  7566. async function Xa() {
  7567. try {
  7568. return Au = new Qa, Au ? Au.load() : Promise.reject("Failed to create FFmpeg instance")
  7569. } catch (u) {
  7570. return console.log("Failed to load FFmpeg", u), Promise.reject("Failed to load FFmpeg")
  7571. }
  7572. }
  7573. async function Ya(u, e) {
  7574. return Au ? Au.decode(u, e) : Promise.reject("FFmpeg is uninitialized")
  7575. }
  7576. async function $a() {
  7577. Au && (Au.close(), Au = null)
  7578. }
  7579. const un = "Desktop session not ready", en = "Desktop xsession failed", tn = "Desktop session another user login",
  7580. an = "Desktop xorg not found", nn = "Desktop none", on = "Desktop session not ready, password empty",
  7581. rn = "Desktop session not ready, password wrong", sn = "Empty Password", En = "Wrong Password",
  7582. ln = "Wrong 2FA Code", tt = "2FA Required", Dn = "No Password Access", dn = "Wayland login screen is not supported",
  7583. cn = "x11 expected", St = "https://rustdesk.com/docs/en/manual/linux/#x11-required",
  7584. Cn = "https://rustdesk.com/docs/en/", pn = St,
  7585. Bn = "https://github.com/rustdesk/rustdesk/wiki/Headless-Linux-Support",
  7586. at = {"rustdesk docs home": Cn, "rustdesk docs x11-required": pn, "rustdesk x11 headless": Bn},
  7587. nt = "Input source 1", An = "map", ot = "translate", mn = "ShiftLeft", Fn = "ShiftRight", ke = "ControlLeft",
  7588. zt = "ControlRight", v4 = "AltLeft", Pt = "AltRight", Rt = "MetaLeft", It = "MetaRight", a4 = "Windows",
  7589. g4 = "Linux", k4 = "Mac OS", Tt = "Android", _n = "iOS", vn = "web", gn = "ISO", kn = 1, hn = 2, rt = 3, st = 4,
  7590. Pe = 1, Re = 2, fn = 4, xn = 8, yn = 16, r4 = "public", Et = "OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=",
  7591. bn = 1e3, wn = 6e4, d4 = lang, Sn = langIds;
  7592. function zn(u, e, i, n) {
  7593. return u == "error" && e == "Connection Error" && ((i.indexOf("10054") < 0 || i.indexOf("104") < 0) && n || i.toLowerCase().indexOf("offline") < 0 && i.toLowerCase().indexOf("exist") < 0 && i.toLowerCase().indexOf("handshake") < 0 && i.toLowerCase().indexOf("failed") < 0 && i.toLowerCase().indexOf("resolve") < 0 && i.toLowerCase().indexOf("mismatch") < 0 && i.toLowerCase().indexOf("manually") < 0 && i.toLowerCase().indexOf("not allowed") < 0)
  7594. }
  7595. const Pn = {
  7596. VK_A: "a",
  7597. VK_B: "b",
  7598. VK_C: "c",
  7599. VK_D: "d",
  7600. VK_E: "e",
  7601. VK_F: "f",
  7602. VK_G: "g",
  7603. VK_H: "h",
  7604. VK_I: "i",
  7605. VK_J: "j",
  7606. VK_K: "k",
  7607. VK_L: "l",
  7608. VK_M: "m",
  7609. VK_N: "n",
  7610. VK_O: "o",
  7611. VK_P: "p",
  7612. VK_Q: "q",
  7613. VK_R: "r",
  7614. VK_S: "s",
  7615. VK_T: "t",
  7616. VK_U: "u",
  7617. VK_V: "v",
  7618. VK_W: "w",
  7619. VK_X: "x",
  7620. VK_Y: "y",
  7621. VK_Z: "z",
  7622. VK_0: "0",
  7623. VK_1: "1",
  7624. VK_2: "2",
  7625. VK_3: "3",
  7626. VK_4: "4",
  7627. VK_5: "5",
  7628. VK_6: "6",
  7629. VK_7: "7",
  7630. VK_8: "8",
  7631. VK_9: "9",
  7632. VK_COMMA: ",",
  7633. VK_SLASH: "/",
  7634. VK_SEMICOLON: ";",
  7635. VK_QUOTE: "'",
  7636. VK_LBRACKET: "[",
  7637. VK_RBRACKET: "]",
  7638. VK_BACKSLASH: "\\",
  7639. VK_MINUS: "-",
  7640. VK_PLUS: "=",
  7641. VK_DIVIDE: "Divide",
  7642. VK_MULTIPLY: "Multiply",
  7643. VK_SUBTRACT: "Subtract",
  7644. VK_ADD: "Add",
  7645. VK_DECIMAL: "Decimal",
  7646. VK_F1: "F1",
  7647. VK_F2: "F2",
  7648. VK_F3: "F3",
  7649. VK_F4: "F4",
  7650. VK_F5: "F5",
  7651. VK_F6: "F6",
  7652. VK_F7: "F7",
  7653. VK_F8: "F8",
  7654. VK_F9: "F9",
  7655. VK_F10: "F10",
  7656. VK_F11: "F11",
  7657. VK_F12: "F12",
  7658. VK_ENTER: "Return",
  7659. VK_CANCEL: "Cancel",
  7660. VK_BACK: "Backspace",
  7661. VK_TAB: "Tab",
  7662. VK_CLEAR: "Clear",
  7663. VK_RETURN: "Return",
  7664. VK_SHIFT: "Shift",
  7665. VK_CONTROL: "Control",
  7666. VK_MENU: "Alt",
  7667. VK_PAUSE: "Pause",
  7668. VK_CAPITAL: "CapsLock",
  7669. VK_KANA: "Kana",
  7670. VK_HANGUL: "Hangul",
  7671. VK_JUNJA: "Junja",
  7672. VK_FINAL: "Final",
  7673. VK_HANJA: "Hanja",
  7674. VK_KANJI: "Kanji",
  7675. VK_ESCAPE: "Escape",
  7676. VK_CONVERT: "Convert",
  7677. VK_SPACE: "Space",
  7678. VK_PRIOR: "PageUp",
  7679. VK_NEXT: "PageDown",
  7680. VK_END: "End",
  7681. VK_HOME: "Home",
  7682. VK_LEFT: "LeftArrow",
  7683. VK_UP: "UpArrow",
  7684. VK_RIGHT: "RightArrow",
  7685. VK_DOWN: "DownArrow",
  7686. VK_SELECT: "Select",
  7687. VK_PRINT: "Print",
  7688. VK_EXECUTE: "Execute",
  7689. VK_SNAPSHOT: "Snapshot",
  7690. VK_SCROLL: "Scroll",
  7691. VK_INSERT: "Insert",
  7692. VK_DELETE: "Delete",
  7693. VK_HELP: "Help",
  7694. VK_SLEEP: "Sleep",
  7695. VK_SEPARATOR: "Separator",
  7696. VK_NUMPAD0: "Numpad0",
  7697. VK_NUMPAD1: "Numpad1",
  7698. VK_NUMPAD2: "Numpad2",
  7699. VK_NUMPAD3: "Numpad3",
  7700. VK_NUMPAD4: "Numpad4",
  7701. VK_NUMPAD5: "Numpad5",
  7702. VK_NUMPAD6: "Numpad6",
  7703. VK_NUMPAD7: "Numpad7",
  7704. VK_NUMPAD8: "Numpad8",
  7705. VK_NUMPAD9: "Numpad9",
  7706. Apps: "Apps",
  7707. Meta: "Meta",
  7708. RAlt: "RAlt",
  7709. RWin: "RWin",
  7710. RControl: "RControl",
  7711. RShift: "RShift",
  7712. CTRL_ALT_DEL: "CtrlAltDel",
  7713. LOCK_SCREEN: "LockScreen"
  7714. }, c4 = "1.4.0", Rn = "2025-05-11 20:56";
  7715. class m {
  7716. static setItem(e, i) {
  7717. localStorage.setItem(this.prefix + e, i)
  7718. }
  7719. static getItem(e) {
  7720. return localStorage.getItem(this.prefix + e)
  7721. }
  7722. static removeItem(e) {
  7723. localStorage.removeItem(this.prefix + e)
  7724. }
  7725. static clear() {
  7726. for (let e = localStorage.length - 1; e >= 0; e--) {
  7727. const i = localStorage.key(e);
  7728. i && i.startsWith(this.prefix) && localStorage.removeItem(i)
  7729. }
  7730. }
  7731. }
  7732. D(m, "prefix", "wc-");
  7733. class N {
  7734. static async init() {
  7735. if (!this.db) return new Promise((e, i) => {
  7736. const n = indexedDB.open(this.dbName, 1);
  7737. n.onupgradeneeded = a => {
  7738. const t = a.target.result;
  7739. t.objectStoreNames.contains(this.storeName) || t.createObjectStore(this.storeName)
  7740. }, n.onsuccess = async a => {
  7741. this.db = a.target.result;
  7742. try {
  7743. await this.loadCache(), e()
  7744. } catch (t) {
  7745. i(t)
  7746. }
  7747. }, n.onerror = a => {
  7748. i(a.target.error)
  7749. }
  7750. })
  7751. }
  7752. static async loadCache() {
  7753. return new Promise((e, i) => {
  7754. const a = this.db.transaction([this.storeName], "readonly").objectStore(this.storeName), t = a.getAllKeys();
  7755. t.onsuccess = s => {
  7756. const l = s.target.result.map(d => new Promise((c, p) => {
  7757. const B = a.get(d);
  7758. B.onsuccess = F => {
  7759. this.cache[d] = F.target.result, c()
  7760. }, B.onerror = F => {
  7761. p(F.target.error)
  7762. }
  7763. }));
  7764. Promise.all(l).then(() => e()).catch(i)
  7765. }, t.onerror = s => {
  7766. i(s.target.error)
  7767. }
  7768. })
  7769. }
  7770. static setItem(e, i) {
  7771. this.cache[this.prefix + e] = i;
  7772. const t = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).put(i, this.prefix + e);
  7773. t.onerror = s => {
  7774. console.error("IndexedDB setItem error:", s.target.error)
  7775. }
  7776. }
  7777. static getItem(e) {
  7778. var i;
  7779. return (i = this.cache[this.prefix + e]) != null ? i : null
  7780. }
  7781. static removeItem(e) {
  7782. delete this.cache[this.prefix + e];
  7783. const a = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).delete(this.prefix + e);
  7784. a.onerror = t => {
  7785. console.error("IndexedDB removeItem error:", t.target.error)
  7786. }
  7787. }
  7788. static clear() {
  7789. this.cache = {};
  7790. const n = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).clear();
  7791. n.onerror = a => {
  7792. console.error("IndexedDB clear error:", a.target.error)
  7793. }
  7794. }
  7795. }
  7796. D(N, "dbName", "wc-database"), D(N, "storeName", "wc-store"), D(N, "prefix", "wc-"), D(N, "db", null), D(N, "cache", {});
  7797. const cu = () => {
  7798. try {
  7799. return JSON.parse(N.getItem("peers")) || {}
  7800. } catch {
  7801. return {}
  7802. }
  7803. }, h4 = u => {
  7804. N.setItem("peers", JSON.stringify(u))
  7805. }, In = u => {
  7806. const e = cu();
  7807. delete e[u], h4(e)
  7808. }, C4 = u => cu()[u], Tn = (u, e) => {
  7809. const i = cu();
  7810. i[u] = e, h4(i)
  7811. }, jn = (u, e) => {
  7812. var n;
  7813. return (n = C4(u)[e]) != null ? n : e0(e)
  7814. }, jt = (u, e, i) => {
  7815. const n = cu(), a = n[u] || {};
  7816. i == null ? delete a[e] : a[e] = i, a.tm = new Date().getTime(), n[u] = a, h4(n)
  7817. }, f4 = u => m.getItem(`option:local:${u}`), Nt = (u, e) => {
  7818. m.setItem(`option:local:${u}`, e)
  7819. }, Nn = u => m.getItem(`option:flutter:local:${u}`), On = (u, e) => {
  7820. m.setItem(`option:flutter:local:${u}`, e)
  7821. }, Ot = async u => {
  7822. const e = Ea(), i = Yu.publicKey, n = n4(0), a = e.from_string(u), t = await ca(a),
  7823. s = e.crypto_secretbox_easy(t, n, i);
  7824. return Q(s)
  7825. }, Ut = async u => {
  7826. const e = Ea(), i = Yu.publicKey, n = Be(u), a = e.crypto_secretbox_open_easy(n, n4(0), i), t = await Ca(a);
  7827. return e.to_string(t)
  7828. }, Un = async u => {
  7829. let e = await Ot(u);
  7830. N.setItem("ab", e)
  7831. }, Mt = async () => {
  7832. try {
  7833. let u = N.getItem("ab");
  7834. if (u) return JSON.parse(await Ut(u))
  7835. } catch (u) {
  7836. console.error("loadAb error", u)
  7837. }
  7838. return {access_token: "", ab_entries: []}
  7839. }, Mn = () => {
  7840. N.removeItem("ab")
  7841. }, Ln = async u => {
  7842. let e = await Ot(u);
  7843. N.setItem("group", e)
  7844. }, Wn = async () => {
  7845. try {
  7846. let u = N.getItem("group");
  7847. if (u) return JSON.parse(await Ut(u))
  7848. } catch (u) {
  7849. console.error("loadGroup error", u)
  7850. }
  7851. return {access_token: "", users: [], peers: []}
  7852. }, Vn = () => {
  7853. N.removeItem("group")
  7854. }, qn = u => u.name == "My address book" || u.name == "Legacy address book";
  7855. var Lt = Vt();
  7856. function Kn() {
  7857. Lt = Vt()
  7858. }
  7859. const Wt = {};
  7860. function Hn(u) {
  7861. const e = /\{(.*?)\}/, i = u.match(e);
  7862. if (i && i[1] !== void 0) {
  7863. const n = u.replace(e, "{}"), a = i[1];
  7864. return [n, a]
  7865. }
  7866. return [u, null]
  7867. }
  7868. function Jn(u, e) {
  7869. var l;
  7870. let i = (Lt || "").toLowerCase();
  7871. i || (u = u.toLowerCase(), u.startsWith("zh") ? i = u.includes("tw") ? "zh-tw" : "zh-cn" : i = ((l = u.split("-")[0]) == null ? void 0 : l.split("_")[0]) || "en");
  7872. const [n, a] = Hn(e);
  7873. let t = d4[i];
  7874. const s = d4.en;
  7875. let E = "";
  7876. return t && t[n] ? E = t[n] : i !== "en" && s[n] ? E = s[n] : E = n, a !== null && (E = E.replace("{}", a)), E
  7877. }
  7878. const Gn = "z".charCodeAt(0), Zn = "a".charCodeAt(0);
  7879. function Qn(u, e) {
  7880. const i = Pn[u] || u;
  7881. if (i.length == 1) {
  7882. const a = i.charCodeAt(0);
  7883. return !e && (a > Gn || a < Zn) ? S.fromPartial({unicode: a}) : S.fromPartial({chr: a})
  7884. }
  7885. const n = fe(i);
  7886. return n == j.UNRECOGNIZED && console.error("Unknown control key " + i), S.fromPartial({control_key: n})
  7887. }
  7888. async function s4(u) {
  7889. await new Promise(e => setTimeout(e, u))
  7890. }
  7891. function Vt() {
  7892. let u = m.getItem("option:local:lang");
  7893. if (u && (u.includes("-") && (u = u.split("-")[1]), u.includes("_") && (u = u.split("_")[1]), d4.hasOwnProperty(u))) return u;
  7894. try {
  7895. const e = window.location.search;
  7896. return new URLSearchParams(e).get("lang") || ""
  7897. } catch {
  7898. return ""
  7899. }
  7900. }
  7901. var Yu = {privateKey: new Uint8Array([]), publicKey: new Uint8Array([])};
  7902. async function Xn() {
  7903. try {
  7904. const u = "app-data";
  7905. try {
  7906. const i = m.getItem(u);
  7907. if (i) {
  7908. const n = JSON.parse(i);
  7909. if (Yu = {
  7910. privateKey: new Uint8Array(Be(n.a)),
  7911. publicKey: new Uint8Array(Be(n.b))
  7912. }, Yu.publicKey.length === 32 && Yu.privateKey.length === 64) return
  7913. }
  7914. } catch (i) {
  7915. console.error(i)
  7916. }
  7917. const e = await Yn();
  7918. m.setItem(u, JSON.stringify({a: Q(e.privateKey), b: Q(e.publicKey)})), Yu = e
  7919. } catch (u) {
  7920. console.error("failed to init key pair", u)
  7921. }
  7922. }
  7923. function Q(u) {
  7924. return Br(u)
  7925. }
  7926. function Be(u) {
  7927. return be(u)
  7928. }
  7929. async function Yn() {
  7930. return await br()
  7931. }
  7932. function qe() {
  7933. return "web"
  7934. }
  7935. function qt() {
  7936. return "web"
  7937. }
  7938. function Kt() {
  7939. return Q(Yu.publicKey)
  7940. }
  7941. function $n() {
  7942. return Qu([Kt()])
  7943. }
  7944. function Qu(u) {
  7945. const e = new ga.exports.Hash;
  7946. return u.forEach(i => (typeof i == "string" && (i = new TextEncoder().encode(i)), e.update(i))), e.digest()
  7947. }
  7948. function Ht() {
  7949. const u = navigator.userAgent.toLowerCase();
  7950. return u.includes("win") ? a4 : u.includes("mac") ? k4 : u.includes("linux") ? g4 : u.includes("android") ? Tt : u.includes("iphone") || u.includes("ipad") ? _n : "Unknown OS"
  7951. }
  7952. async function uo(u, e) {
  7953. for (let i = 0; i < 2; i++) {
  7954. const a = e === void 0 ? await u.next() : await u.next(e);
  7955. if (!(!a || (a == null ? void 0 : a.key_exchange))) return a
  7956. }
  7957. }
  7958. function Jt() {
  7959. return eo() || Wt.key || void 0
  7960. }
  7961. function eo() {
  7962. return m.getItem("key") || void 0
  7963. }
  7964. function Gt() {
  7965. return m.getItem("option:local:access_token") || void 0
  7966. }
  7967. function io() {
  7968. return m.getItem("option:local:user_info") || void 0
  7969. }
  7970. function he() {
  7971. return $u
  7972. }
  7973. function lt(u) {
  7974. Wt.key = u
  7975. }
  7976. const x4 = {
  7977. Alt: 56,
  7978. AltGr: 57400,
  7979. Backspace: 14,
  7980. CapsLock: 58,
  7981. ControlLeft: 29,
  7982. ControlRight: 57373,
  7983. Delete: 57427,
  7984. UpArrow: 57416,
  7985. DownArrow: 57424,
  7986. LeftArrow: 57419,
  7987. RightArrow: 57421,
  7988. End: 57423,
  7989. Escape: 1,
  7990. F1: 59,
  7991. F2: 60,
  7992. F3: 61,
  7993. F4: 62,
  7994. F5: 63,
  7995. F6: 64,
  7996. F7: 65,
  7997. F8: 66,
  7998. F9: 67,
  7999. F10: 68,
  8000. F11: 87,
  8001. F12: 88,
  8002. F13: 100,
  8003. F14: 101,
  8004. F15: 102,
  8005. F16: 103,
  8006. F17: 104,
  8007. F18: 105,
  8008. F19: 106,
  8009. F20: 107,
  8010. F21: 108,
  8011. F22: 109,
  8012. F23: 110,
  8013. F24: 118,
  8014. Home: 57415,
  8015. MetaLeft: 57435,
  8016. PageDown: 57425,
  8017. PageUp: 57417,
  8018. Return: 28,
  8019. ShiftLeft: 42,
  8020. ShiftRight: 54,
  8021. Space: 57,
  8022. Tab: 15,
  8023. PrintScreen: 57399,
  8024. ScrollLock: 70,
  8025. NumLock: 69,
  8026. BackQuote: 41,
  8027. Num1: 2,
  8028. Num2: 3,
  8029. Num3: 4,
  8030. Num4: 5,
  8031. Num5: 6,
  8032. Num6: 7,
  8033. Num7: 8,
  8034. Num8: 9,
  8035. Num9: 10,
  8036. Num0: 11,
  8037. Minus: 12,
  8038. Equal: 13,
  8039. KeyQ: 16,
  8040. KeyW: 17,
  8041. KeyE: 18,
  8042. KeyR: 19,
  8043. KeyT: 20,
  8044. KeyY: 21,
  8045. KeyU: 22,
  8046. KeyI: 23,
  8047. KeyO: 24,
  8048. KeyP: 25,
  8049. LeftBracket: 26,
  8050. RightBracket: 27,
  8051. BackSlash: 43,
  8052. KeyA: 30,
  8053. KeyS: 31,
  8054. KeyD: 32,
  8055. KeyF: 33,
  8056. KeyG: 34,
  8057. KeyH: 35,
  8058. KeyJ: 36,
  8059. KeyK: 37,
  8060. KeyL: 38,
  8061. SemiColon: 39,
  8062. Quote: 40,
  8063. IntlBackslash: 86,
  8064. IntlRo: 115,
  8065. IntlYen: 125,
  8066. KanaMode: 112,
  8067. KeyZ: 44,
  8068. KeyX: 45,
  8069. KeyC: 46,
  8070. KeyV: 47,
  8071. KeyB: 48,
  8072. KeyN: 49,
  8073. KeyM: 50,
  8074. Comma: 51,
  8075. Dot: 52,
  8076. Slash: 53,
  8077. Insert: 57426,
  8078. KpMinus: 74,
  8079. KpPlus: 78,
  8080. KpMultiply: 55,
  8081. KpDivide: 57397,
  8082. KpDecimal: 83,
  8083. KpReturn: 57372,
  8084. KpEqual: 89,
  8085. KpComma: 126,
  8086. Kp0: 82,
  8087. Kp1: 79,
  8088. Kp2: 80,
  8089. Kp3: 81,
  8090. Kp4: 75,
  8091. Kp5: 76,
  8092. Kp6: 77,
  8093. Kp7: 71,
  8094. Kp8: 72,
  8095. Kp9: 73,
  8096. MetaRight: 57436,
  8097. Apps: 57437,
  8098. VolumeUp: 57392,
  8099. VolumeDown: 57390,
  8100. VolumeMute: 57376,
  8101. Lang1: 123,
  8102. Lang2: 121,
  8103. Lang3: 120,
  8104. Lang4: 119,
  8105. Lang5: 118,
  8106. Kana: 128,
  8107. Hanja: 241
  8108. }, to = {
  8109. Alt: 64,
  8110. AltGr: 108,
  8111. Backspace: 22,
  8112. CapsLock: 66,
  8113. ControlLeft: 37,
  8114. ControlRight: 105,
  8115. Delete: 119,
  8116. DownArrow: 116,
  8117. End: 115,
  8118. Escape: 9,
  8119. F1: 67,
  8120. F10: 76,
  8121. F11: 95,
  8122. F12: 96,
  8123. F13: 191,
  8124. F14: 192,
  8125. F15: 193,
  8126. F16: 194,
  8127. F17: 195,
  8128. F18: 196,
  8129. F19: 197,
  8130. F20: 198,
  8131. F21: 199,
  8132. F22: 200,
  8133. F23: 201,
  8134. F24: 202,
  8135. F2: 68,
  8136. F3: 69,
  8137. F4: 70,
  8138. F5: 71,
  8139. F6: 72,
  8140. F7: 73,
  8141. F8: 74,
  8142. F9: 75,
  8143. Home: 110,
  8144. LeftArrow: 113,
  8145. MetaLeft: 133,
  8146. PageDown: 117,
  8147. PageUp: 112,
  8148. Return: 36,
  8149. RightArrow: 114,
  8150. ShiftLeft: 50,
  8151. ShiftRight: 62,
  8152. Space: 65,
  8153. Tab: 23,
  8154. UpArrow: 111,
  8155. PrintScreen: 107,
  8156. ScrollLock: 78,
  8157. Pause: 127,
  8158. NumLock: 77,
  8159. BackQuote: 49,
  8160. Num1: 10,
  8161. Num2: 11,
  8162. Num3: 12,
  8163. Num4: 13,
  8164. Num5: 14,
  8165. Num6: 15,
  8166. Num7: 16,
  8167. Num8: 17,
  8168. Num9: 18,
  8169. Num0: 19,
  8170. Minus: 20,
  8171. Equal: 21,
  8172. KeyQ: 24,
  8173. KeyW: 25,
  8174. KeyE: 26,
  8175. KeyR: 27,
  8176. KeyT: 28,
  8177. KeyY: 29,
  8178. KeyU: 30,
  8179. KeyI: 31,
  8180. KeyO: 32,
  8181. KeyP: 33,
  8182. LeftBracket: 34,
  8183. RightBracket: 35,
  8184. KeyA: 38,
  8185. KeyS: 39,
  8186. KeyD: 40,
  8187. KeyF: 41,
  8188. KeyG: 42,
  8189. KeyH: 43,
  8190. KeyJ: 44,
  8191. KeyK: 45,
  8192. KeyL: 46,
  8193. SemiColon: 47,
  8194. Quote: 48,
  8195. BackSlash: 51,
  8196. IntlBackslash: 94,
  8197. IntlRo: 97,
  8198. IntlYen: 132,
  8199. KanaMode: 101,
  8200. KeyZ: 52,
  8201. KeyX: 53,
  8202. KeyC: 54,
  8203. KeyV: 55,
  8204. KeyB: 56,
  8205. KeyN: 57,
  8206. KeyM: 58,
  8207. Comma: 59,
  8208. Dot: 60,
  8209. Slash: 61,
  8210. Insert: 118,
  8211. KpDecimal: 91,
  8212. KpReturn: 104,
  8213. KpMinus: 82,
  8214. KpPlus: 86,
  8215. KpMultiply: 63,
  8216. KpDivide: 106,
  8217. KpEqual: 125,
  8218. KpComma: 129,
  8219. Kp0: 90,
  8220. Kp1: 87,
  8221. Kp2: 88,
  8222. Kp3: 89,
  8223. Kp4: 83,
  8224. Kp5: 84,
  8225. Kp6: 85,
  8226. Kp7: 79,
  8227. Kp8: 80,
  8228. Kp9: 81,
  8229. MetaRight: 134,
  8230. Apps: 135,
  8231. VolumeUp: 123,
  8232. VolumeDown: 122,
  8233. VolumeMute: 121,
  8234. Lang1: 102,
  8235. Lang2: 100,
  8236. Lang3: 98,
  8237. Lang4: 99,
  8238. Lang5: 93
  8239. }, ao = {
  8240. Alt: 57,
  8241. AltGr: 58,
  8242. Backspace: 67,
  8243. CapsLock: 115,
  8244. ControlLeft: 113,
  8245. ControlRight: 114,
  8246. Delete: 112,
  8247. DownArrow: 20,
  8248. End: 123,
  8249. Escape: 111,
  8250. F1: 131,
  8251. F10: 140,
  8252. F11: 141,
  8253. F12: 142,
  8254. F2: 132,
  8255. F3: 133,
  8256. F4: 134,
  8257. F5: 135,
  8258. F6: 136,
  8259. F7: 137,
  8260. F8: 138,
  8261. F9: 139,
  8262. Home: 3,
  8263. LeftArrow: 21,
  8264. MetaLeft: 117,
  8265. PageDown: 93,
  8266. PageUp: 92,
  8267. Return: 66,
  8268. RightArrow: 22,
  8269. ShiftLeft: 59,
  8270. ShiftRight: 60,
  8271. Space: 62,
  8272. Tab: 61,
  8273. UpArrow: 19,
  8274. PrintScreen: 120,
  8275. ScrollLock: 116,
  8276. NumLock: 143,
  8277. Pause: 121,
  8278. BackQuote: 75,
  8279. Num1: 8,
  8280. Num2: 9,
  8281. Num3: 10,
  8282. Num4: 11,
  8283. Num5: 12,
  8284. Num6: 13,
  8285. Num7: 14,
  8286. Num8: 15,
  8287. Num9: 16,
  8288. Num0: 7,
  8289. Minus: 69,
  8290. Equal: 70,
  8291. KeyA: 29,
  8292. KeyB: 30,
  8293. KeyC: 31,
  8294. KeyD: 32,
  8295. KeyE: 33,
  8296. KeyF: 34,
  8297. KeyG: 35,
  8298. KeyH: 36,
  8299. KeyI: 37,
  8300. KeyJ: 38,
  8301. KeyK: 39,
  8302. KeyL: 40,
  8303. KeyM: 41,
  8304. KeyN: 42,
  8305. KeyO: 43,
  8306. KeyP: 44,
  8307. KeyQ: 45,
  8308. KeyR: 46,
  8309. KeyS: 47,
  8310. KeyT: 48,
  8311. KeyU: 49,
  8312. KeyV: 50,
  8313. KeyW: 51,
  8314. KeyX: 52,
  8315. KeyY: 53,
  8316. KeyZ: 54,
  8317. LeftBracket: 71,
  8318. RightBracket: 72,
  8319. SemiColon: 74,
  8320. Quote: 75,
  8321. BackSlash: 73,
  8322. KanaMode: 218,
  8323. Comma: 55,
  8324. Dot: 56,
  8325. Slash: 76,
  8326. Insert: 124
  8327. }, no = {
  8328. 226: "Alt",
  8329. 230: "AltGr",
  8330. 42: "Backspace",
  8331. 57: "CapsLock",
  8332. 224: "ControlLeft",
  8333. 228: "ControlRight",
  8334. 76: "Delete",
  8335. 82: "UpArrow",
  8336. 81: "DownArrow",
  8337. 80: "LeftArrow",
  8338. 79: "RightArrow",
  8339. 77: "End",
  8340. 41: "Escape",
  8341. 58: "F1",
  8342. 59: "F2",
  8343. 60: "F3",
  8344. 61: "F4",
  8345. 62: "F5",
  8346. 63: "F6",
  8347. 64: "F7",
  8348. 65: "F8",
  8349. 66: "F9",
  8350. 67: "F10",
  8351. 68: "F11",
  8352. 69: "F12",
  8353. 104: "F13",
  8354. 105: "F14",
  8355. 106: "F15",
  8356. 107: "F16",
  8357. 108: "F17",
  8358. 109: "F18",
  8359. 110: "F19",
  8360. 111: "F20",
  8361. 112: "F21",
  8362. 113: "F22",
  8363. 114: "F23",
  8364. 115: "F24",
  8365. 74: "Home",
  8366. 227: "MetaLeft",
  8367. 78: "PageDown",
  8368. 75: "PageUp",
  8369. 40: "Return",
  8370. 225: "ShiftLeft",
  8371. 229: "ShiftRight",
  8372. 44: "Space",
  8373. 43: "Tab",
  8374. 70: "PrintScreen",
  8375. 71: "ScrollLock",
  8376. 83: "NumLock",
  8377. 53: "BackQuote",
  8378. 30: "Num1",
  8379. 31: "Num2",
  8380. 32: "Num3",
  8381. 33: "Num4",
  8382. 34: "Num5",
  8383. 35: "Num6",
  8384. 36: "Num7",
  8385. 37: "Num8",
  8386. 38: "Num9",
  8387. 39: "Num0",
  8388. 45: "Minus",
  8389. 46: "Equal",
  8390. 20: "KeyQ",
  8391. 26: "KeyW",
  8392. 8: "KeyE",
  8393. 21: "KeyR",
  8394. 23: "KeyT",
  8395. 28: "KeyY",
  8396. 24: "KeyU",
  8397. 12: "KeyI",
  8398. 18: "KeyO",
  8399. 19: "KeyP",
  8400. 47: "LeftBracket",
  8401. 48: "RightBracket",
  8402. 49: "BackSlash",
  8403. 4: "KeyA",
  8404. 22: "KeyS",
  8405. 7: "KeyD",
  8406. 9: "KeyF",
  8407. 10: "KeyG",
  8408. 11: "KeyH",
  8409. 13: "KeyJ",
  8410. 14: "KeyK",
  8411. 15: "KeyL",
  8412. 51: "SemiColon",
  8413. 52: "Quote",
  8414. 100: "IntlBackslash",
  8415. 135: "IntlRo",
  8416. 137: "IntlYen",
  8417. 29: "KeyZ",
  8418. 27: "KeyX",
  8419. 6: "KeyC",
  8420. 25: "KeyV",
  8421. 5: "KeyB",
  8422. 17: "KeyN",
  8423. 16: "KeyM",
  8424. 54: "Comma",
  8425. 55: "Dot",
  8426. 56: "Slash",
  8427. 73: "Insert",
  8428. 86: "KpMinus",
  8429. 87: "KpPlus",
  8430. 85: "KpMultiply",
  8431. 84: "KpDivide",
  8432. 99: "KpDecimal",
  8433. 88: "KpReturn",
  8434. 103: "KpEqual",
  8435. 133: "KpComma",
  8436. 98: "Kp0",
  8437. 89: "Kp1",
  8438. 90: "Kp2",
  8439. 91: "Kp3",
  8440. 92: "Kp4",
  8441. 93: "Kp5",
  8442. 94: "Kp6",
  8443. 95: "Kp7",
  8444. 96: "Kp8",
  8445. 97: "Kp9",
  8446. 231: "MetaRight",
  8447. 128: "VolumeUp",
  8448. 129: "VolumeDown",
  8449. 127: "VolumeMute",
  8450. 139: "Lang1",
  8451. 138: "Lang2",
  8452. 146: "Lang3",
  8453. 147: "Lang4",
  8454. 148: "Lang5",
  8455. 155: "Cancel",
  8456. 156: "Clear",
  8457. 136: "Kana",
  8458. 145: "Hanja",
  8459. 119: "Select",
  8460. 116: "Execute",
  8461. 117: "Help",
  8462. 159: "Separator"
  8463. }, oo = {
  8464. KeyA: 0,
  8465. KeyS: 1,
  8466. KeyD: 2,
  8467. KeyF: 3,
  8468. KeyH: 4,
  8469. KeyG: 5,
  8470. KeyZ: 6,
  8471. KeyX: 7,
  8472. KeyC: 8,
  8473. KeyV: 9,
  8474. IntlBackslash: 10,
  8475. KeyB: 11,
  8476. KeyQ: 12,
  8477. KeyW: 13,
  8478. KeyE: 14,
  8479. KeyR: 15,
  8480. KeyY: 16,
  8481. KeyT: 17,
  8482. Num1: 18,
  8483. Num2: 19,
  8484. Num3: 20,
  8485. Num4: 21,
  8486. Num6: 22,
  8487. Num5: 23,
  8488. Equal: 24,
  8489. Num9: 25,
  8490. Num7: 26,
  8491. Minus: 27,
  8492. Num8: 28,
  8493. Num0: 29,
  8494. RightBracket: 30,
  8495. KeyO: 31,
  8496. KeyU: 32,
  8497. LeftBracket: 33,
  8498. KeyI: 34,
  8499. KeyP: 35,
  8500. Return: 36,
  8501. KeyL: 37,
  8502. KeyJ: 38,
  8503. Quote: 39,
  8504. KeyK: 40,
  8505. SemiColon: 41,
  8506. BackSlash: 42,
  8507. Comma: 43,
  8508. Slash: 44,
  8509. KeyN: 45,
  8510. KeyM: 46,
  8511. Dot: 47,
  8512. Tab: 48,
  8513. Space: 49,
  8514. BackQuote: 50,
  8515. Backspace: 51,
  8516. Escape: 53,
  8517. MetaRight: 54,
  8518. MetaLeft: 55,
  8519. ShiftLeft: 56,
  8520. CapsLock: 57,
  8521. Alt: 58,
  8522. ControlLeft: 59,
  8523. ShiftRight: 60,
  8524. AltGr: 61,
  8525. ControlRight: 62,
  8526. Function: 63,
  8527. F17: 64,
  8528. KpDecimal: 65,
  8529. KpMultiply: 67,
  8530. KpPlus: 69,
  8531. NumLock: 71,
  8532. VolumeUp: 72,
  8533. VolumeDown: 73,
  8534. VolumeMute: 74,
  8535. KpDivide: 75,
  8536. KpReturn: 76,
  8537. KpMinus: 78,
  8538. F18: 79,
  8539. F19: 80,
  8540. KpEqual: 81,
  8541. Kp0: 82,
  8542. Kp1: 83,
  8543. Kp2: 84,
  8544. Kp3: 85,
  8545. Kp4: 86,
  8546. Kp5: 87,
  8547. Kp6: 88,
  8548. Kp7: 89,
  8549. F20: 90,
  8550. Kp8: 91,
  8551. Kp9: 92,
  8552. IntlYen: 93,
  8553. IntlRo: 94,
  8554. KpComma: 95,
  8555. F5: 96,
  8556. F6: 97,
  8557. F7: 98,
  8558. F3: 99,
  8559. F8: 100,
  8560. F9: 101,
  8561. Lang2: 102,
  8562. F11: 103,
  8563. Lang1: 104,
  8564. F13: 105,
  8565. F16: 106,
  8566. F14: 107,
  8567. F10: 109,
  8568. F12: 111,
  8569. F15: 113,
  8570. Insert: 114,
  8571. Home: 115,
  8572. PageUp: 116,
  8573. Delete: 117,
  8574. F4: 118,
  8575. End: 119,
  8576. F2: 120,
  8577. PageDown: 121,
  8578. F1: 122,
  8579. LeftArrow: 123,
  8580. RightArrow: 124,
  8581. DownArrow: 125,
  8582. UpArrow: 126,
  8583. Apps: 110
  8584. }, ro = {
  8585. AltLeft: "Alt",
  8586. AltRight: "AltGr",
  8587. Backspace: "Backspace",
  8588. CapsLock: "CapsLock",
  8589. ControlLeft: "ControlLeft",
  8590. ControlRight: "ControlRight",
  8591. Delete: "Delete",
  8592. ArrowUp: "UpArrow",
  8593. ArrowDown: "DownArrow",
  8594. ArrowLeft: "LeftArrow",
  8595. ArrowRight: "RightArrow",
  8596. End: "End",
  8597. Escape: "Escape",
  8598. F1: "F1",
  8599. F2: "F2",
  8600. F3: "F3",
  8601. F4: "F4",
  8602. F5: "F5",
  8603. F6: "F6",
  8604. F7: "F7",
  8605. F8: "F8",
  8606. F9: "F9",
  8607. F10: "F10",
  8608. F11: "F11",
  8609. F12: "F12",
  8610. F13: "F13",
  8611. F14: "F14",
  8612. F15: "F15",
  8613. F16: "F16",
  8614. F17: "F17",
  8615. F18: "F18",
  8616. F19: "F19",
  8617. F20: "F20",
  8618. F21: "F21",
  8619. F22: "F22",
  8620. F23: "F23",
  8621. F24: "F24",
  8622. Home: "Home",
  8623. MetaLeft: "MetaLeft",
  8624. PageDown: "PageDown",
  8625. PageUp: "PageUp",
  8626. Enter: "Return",
  8627. ShiftLeft: "ShiftLeft",
  8628. ShiftRight: "ShiftRight",
  8629. Space: "Space",
  8630. Tab: "Tab",
  8631. PrintScreen: "PrintScreen",
  8632. ScrollLock: "ScrollLock",
  8633. NumLock: "NumLock",
  8634. Backquote: "BackQuote",
  8635. Digit1: "Num1",
  8636. Digit2: "Num2",
  8637. Digit3: "Num3",
  8638. Digit4: "Num4",
  8639. Digit5: "Num5",
  8640. Digit6: "Num6",
  8641. Digit7: "Num7",
  8642. Digit8: "Num8",
  8643. Digit9: "Num9",
  8644. Digit0: "Num0",
  8645. Minus: "Minus",
  8646. Equal: "Equal",
  8647. KeyQ: "KeyQ",
  8648. KeyW: "KeyW",
  8649. KeyE: "KeyE",
  8650. KeyR: "KeyR",
  8651. KeyT: "KeyT",
  8652. KeyY: "KeyY",
  8653. KeyU: "KeyU",
  8654. KeyI: "KeyI",
  8655. KeyO: "KeyO",
  8656. KeyP: "KeyP",
  8657. BracketLeft: "LeftBracket",
  8658. BracketRight: "RightBracket",
  8659. Backslash: "BackSlash",
  8660. KeyA: "KeyA",
  8661. KeyS: "KeyS",
  8662. KeyD: "KeyD",
  8663. KeyF: "KeyF",
  8664. KeyG: "KeyG",
  8665. KeyH: "KeyH",
  8666. KeyJ: "KeyJ",
  8667. KeyK: "KeyK",
  8668. KeyL: "KeyL",
  8669. Semicolon: "SemiColon",
  8670. Quote: "Quote",
  8671. IntlBackslash: "IntlBackslash",
  8672. IntlRo: "IntlRo",
  8673. IntlYen: "IntlYen",
  8674. KanaMode: "KanaMode",
  8675. KeyZ: "KeyZ",
  8676. KeyX: "KeyX",
  8677. KeyC: "KeyC",
  8678. KeyV: "KeyV",
  8679. KeyB: "KeyB",
  8680. KeyN: "KeyN",
  8681. KeyM: "KeyM",
  8682. Comma: "Comma",
  8683. Period: "Dot",
  8684. Slash: "Slash",
  8685. Insert: "Insert",
  8686. NumpadSubtract: "KpMinus",
  8687. NumpadAdd: "KpPlus",
  8688. NumpadMultiply: "KpMultiply",
  8689. NumpadDivide: "KpDivide",
  8690. NumpadDecimal: "KpDecimal",
  8691. NumpadEnter: "KpReturn",
  8692. NumpadEqual: "KpEqual",
  8693. NumpadComma: "KpComma",
  8694. Numpad0: "Kp0",
  8695. Numpad1: "Kp1",
  8696. Numpad2: "Kp2",
  8697. Numpad3: "Kp3",
  8698. Numpad4: "Kp4",
  8699. Numpad5: "Kp5",
  8700. Numpad6: "Kp6",
  8701. Numpad7: "Kp7",
  8702. Numpad8: "Kp8",
  8703. Numpad9: "Kp9",
  8704. MetaRight: "MetaRight",
  8705. ContextMenu: "Apps",
  8706. AudioVolumeUp: "VolumeUp",
  8707. AudioVolumeDown: "VolumeDown",
  8708. AudioVolumeMute: "VolumeMute",
  8709. NonConvert: "Lang1",
  8710. Convert: "Lang2",
  8711. Lang3: "Lang3",
  8712. Lang4: "Lang4",
  8713. Lang5: "Lang5"
  8714. },
  8715. so = new Set(["BackQuote", "Num1", "Num2", "Num3", "Num4", "Num5", "Num6", "Num7", "Num8", "Num9", "Num0", "Minus", "Equal", "KeyA", "KeyB", "KeyC", "KeyD", "KeyE", "KeyF", "KeyG", "KeyH", "KeyI", "KeyJ", "KeyK", "KeyL", "KeyM", "KeyN", "KeyO", "KeyP", "KeyQ", "KeyR", "KeyS", "KeyT", "KeyU", "KeyV", "KeyW", "KeyX", "KeyY", "KeyZ", "LeftBracket", "RightBracket", "BackSlash", "SemiColon", "Quote", "Comma", "Dot", "Slash", "IntlBackslash", "Space"]),
  8716. Eo = new Set(["Kp0", "Kp1", "Kp2", "Kp3", "Kp4", "Kp5", "Kp6", "Kp7", "Kp8", "Kp9", "KpMinus", "KpMultiply", "KpDivide", "KpPlus", "KpDecimal"]);
  8717. let ve = !1, ru = !1;
  8718. const w = {};
  8719. w[mn] = !1;
  8720. w[Fn] = !1;
  8721. w[ke] = !1;
  8722. w[zt] = !1;
  8723. w[v4] = !1;
  8724. w[Pt] = !1;
  8725. w[Rt] = !1;
  8726. w[It] = !1;
  8727. const xe = {}, y4 = u => Eo.has(u), b4 = u => so.has(u), lo = () => w[ke] || w[zt] || w[v4] || w[Pt] || w[Rt] || w[It];
  8728. let _, Ke = !1;
  8729. function Do() {
  8730. if (Ke) {
  8731. console.info("Keyboard event listener is already started");
  8732. return
  8733. }
  8734. document.addEventListener("keydown", He), document.addEventListener("keyup", He), _ || (_ = document.createElement("div"), _.setAttribute("contenteditable", "true"), _.id = "hiddenInput", _.style.position = "absolute", _.style.left = "-9999px", _.style.height = "1px", _.style.width = "1px", document.body.appendChild(_), $u ? _.addEventListener("input", Je) : (Ye || Xu) && _.addEventListener("compositionend", Je), _.focus()), Ke = !0, console.info("Keyboard event listener started")
  8735. }
  8736. function p4() {
  8737. if (!Ke) {
  8738. console.info("Keyboard event listener is not started");
  8739. return
  8740. }
  8741. document.removeEventListener("keydown", He), document.removeEventListener("keyup", He), _ && ($u || Ye ? _.removeEventListener("input", Je) : Xu && _.removeEventListener("compositionend", Je), _.remove(), _ = void 0), Ke = !1, console.info("Keyboard event listener stopped")
  8742. }
  8743. function w4(u, e) {
  8744. u.sendMessage({key_event: e})
  8745. }
  8746. function He(u) {
  8747. const e = i0();
  8748. if (!e) return;
  8749. const i = u.type === "keydown";
  8750. i && !ru && u.preventDefault(), Zt(e, u, i)
  8751. }
  8752. function Je(u) {
  8753. var a, t;
  8754. const e = i0();
  8755. if (!e) return;
  8756. u.preventDefault();
  8757. let i = null;
  8758. if ((u instanceof InputEvent || u instanceof CompositionEvent) && (i = u.data), !i) return;
  8759. const n = S.fromPartial({seq: i, mode: Fe.Translate, down: !0, press: !1});
  8760. w4(e, n), ((t = (a = _ == null ? void 0 : _.textContent) == null ? void 0 : a.length) != null ? t : 0) > 10 && (_.textContent = "")
  8761. }
  8762. function Zt(u, e, i) {
  8763. const n = po(u, e, i);
  8764. for (const a of n) w4(u, a)
  8765. }
  8766. function co(u, e, i, n) {
  8767. const a = no[e];
  8768. if (!a) {
  8769. console.error("Unknown USB HID code " + e);
  8770. return
  8771. }
  8772. const t = Ge(u, a, i);
  8773. if (!t) return;
  8774. const s = y4(a), E = b4(a);
  8775. (E || s) && Qt(t, n, s, E);
  8776. for (const l of t) w4(u, l)
  8777. }
  8778. function Co() {
  8779. const u = i0();
  8780. if (!!u) for (const e in xe) {
  8781. const i = xe[e];
  8782. i && Zt(u, i, !1)
  8783. }
  8784. }
  8785. function po(u, e, i) {
  8786. var d;
  8787. const n = e.code, a = ro[n];
  8788. if (!a) return console.error("Key code is not supported " + n), [];
  8789. const t = u.getOption("keyboard_mode"), s = Bo(e);
  8790. mo(e, i), i ? xe[n] = e : delete xe[n];
  8791. let E = [];
  8792. switch (t) {
  8793. case An:
  8794. E = (d = Ge(u, a, i)) != null ? d : [];
  8795. break;
  8796. case ot:
  8797. E = Fo(u, e, a, i);
  8798. break
  8799. }
  8800. if (!E) return [];
  8801. const l = y4(a);
  8802. if (t !== ot || l) {
  8803. const c = b4(a);
  8804. Qt(E, s, l, c)
  8805. }
  8806. return E
  8807. }
  8808. function Qt(u, e, i, n) {
  8809. for (const s of u) n && (e & 1 << 1) != 0 && s.modifiers.push(j.CapsLock), i && (e & 1 << 2) != 0 && s.modifiers.push(j.NumLock)
  8810. }
  8811. function Bo(u) {
  8812. let a = 0;
  8813. return u.getModifierState("CapsLock") && (a |= 1 << 1), u.getModifierState("NumLock") && (a |= 1 << 2), u.getModifierState("ScrollLock") && (a |= 1 << 3), a
  8814. }
  8815. function Ao(u, e) {
  8816. return u == a4 ? x4[e] : u == g4 ? to[e] : u == Tt ? ao[e] : u == k4 ? (m.getItem("option:local:kb_layout") == gn && (e == "IntlBackslash" ? e = "BackQuote" : e == "BackQuote" && (e = "IntlBackslash")), oo[e]) : null
  8817. }
  8818. function mo(u, e) {
  8819. const i = u.code;
  8820. i in w && (w[i] = e)
  8821. }
  8822. function Ge(u, e, i) {
  8823. const n = u.getPeerPlatform(), a = u.isSwapControlCommand();
  8824. e == "ControlLeft" || e == "ControlRight" ? a && (e = "MetaLeft") : (e == "MetaLeft" || e == "MetaRight") && a && (e = "ControlLeft");
  8825. const t = Ao(n, e);
  8826. return t == null ? (console.error("Unknown key code " + e + " for platform " + n), []) : [S.fromPartial({
  8827. chr: t,
  8828. mode: Fe.Map,
  8829. down: i,
  8830. press: !1
  8831. })]
  8832. }
  8833. function Fo(u, e, i, n) {
  8834. const a = _ === document.activeElement;
  8835. if (_ && _.focus(), Ye && _ && a && e.key === "Process") return [];
  8836. const t = b4(i), s = e.key === "Dead";
  8837. if (n && ru && t) return Xu ? ru = s : ru = !1, [];
  8838. if (s) return n && (Xu ? ru = !0 : ru = !ru), ru && _ && !a && $u && _.dispatchEvent(new KeyboardEvent(e.type, {...e})), [];
  8839. if (ru = !1, !Xu && y4(i)) return Ge(u, i, n);
  8840. if (Xu && e.code === "AltRight") return [];
  8841. if (e.key === "AltGraph") return ve && !n && (ve = !1), !ve && n && w[ke] ? (ve = !0, w[ke] = !1, delete xe[ke], [S.fromPartial({
  8842. chr: x4.ControlLeft,
  8843. mode: Fe.Map,
  8844. down: !1,
  8845. press: !1
  8846. })]) : [];
  8847. const l = u.getPeerPlatform();
  8848. let d = [];
  8849. return $u && (d = _o(l, e, n)), ($u || Ye) && d.length === 0 && n && t && (d = Dt(e, n)), $u && ve || (Xu && n && t && !w[v4] && d.push(...Dt(e, n)), d.length === 0 && d.push(...Ge(u, i, n))), d
  8850. }
  8851. function _o(u, e, i) {
  8852. if (u !== a4 || !lo()) return [];
  8853. let n;
  8854. const a = x4[e.code];
  8855. return a === void 0 ? (console.error("Key code cannot be converted to scan code: " + e.code), []) : (i ? e.key.length === 1 && (n = e.key.charCodeAt(0) & 65535 | a << 16) : n = a << 16, n === void 0 ? [] : [S.fromPartial({
  8856. win2win_hotkey: n,
  8857. mode: Fe.Translate,
  8858. down: i,
  8859. press: !1
  8860. })])
  8861. }
  8862. function Dt(u, e) {
  8863. return u.key ? [S.fromPartial({seq: u.key, mode: Fe.Translate, down: e, press: !1})] : []
  8864. }
  8865. class vo {
  8866. constructor(e, i, n, a) {
  8867. D(this, "_uri");
  8868. D(this, "_feedback");
  8869. D(this, "_key");
  8870. D(this, "_token");
  8871. D(this, "_ws");
  8872. D(this, "_interval");
  8873. D(this, "_keepAlive");
  8874. D(this, "_lastRecvMsg");
  8875. D(this, "_aliveFailed");
  8876. this._uri = e, this._feedback = i, this._key = n, this._token = a, this._keepAlive = wn, this._lastRecvMsg = new Date, this._aliveFailed = !1
  8877. }
  8878. close() {
  8879. var e;
  8880. this._interval && (clearInterval(this._interval), this._interval = void 0), (e = this._ws) == null || e.close(), this._ws = void 0
  8881. }
  8882. async start() {
  8883. if (this._feedback == 0 || !this._uri || !this._token || !this._key) return;
  8884. const e = new Ve(this._uri, !0, "health check");
  8885. await e.open(), console.log(new Date + ": Connected to relay server"), this._ws = e;
  8886. const i = Zu.fromPartial({token: this._token});
  8887. e.sendRendezvous({hc: i}), this.startInterval(), await this.msgLoop(), this.close()
  8888. }
  8889. startInterval() {
  8890. this._interval = setInterval(() => {
  8891. new Date().getTime() - this._lastRecvMsg.getTime() > this._keepAlive * 3 / 2 && (this._aliveFailed = !0)
  8892. }, bn)
  8893. }
  8894. async msgLoop() {
  8895. var e;
  8896. for (this._lastRecvMsg = new Date; ;) {
  8897. if (!this._ws) {
  8898. console.info("HC connection is closed as controlling connection exits");
  8899. break
  8900. }
  8901. try {
  8902. const i = await ((e = this._ws) == null ? void 0 : e.next(300));
  8903. i && (this._lastRecvMsg = new Date, this.handleMsg(i))
  8904. } catch (i) {
  8905. if (i === "Timeout") {
  8906. if (this._aliveFailed) {
  8907. console.error("HC connection is timeout");
  8908. break
  8909. }
  8910. } else {
  8911. console.error("An error occurred on health check:", i);
  8912. break
  8913. }
  8914. }
  8915. }
  8916. }
  8917. handleMsg(e) {
  8918. var i;
  8919. if (e instanceof Uint8Array) {
  8920. (i = this._ws) == null || i.sendBytes(new Uint8Array);
  8921. return
  8922. } else {
  8923. const n = e.register_pk_response;
  8924. n && n.keep_alive > 0 && (this._keepAlive = n.keep_alive * 1e3, console.log("keep_alive: " + this._keepAlive + "ms"))
  8925. }
  8926. }
  8927. }
  8928. let Ae = [], me = "", Ze = [], ye = [], Qe, B4 = !1;
  8929. const S4 = ["text/plain", "text/html", "image/svg+xml", "image/png"];
  8930. function z4() {
  8931. Ze = [], ye = [], Qe = void 0
  8932. }
  8933. function go(u) {
  8934. B4 = u
  8935. }
  8936. async function ko() {
  8937. try {
  8938. Ae = await navigator.clipboard.read(), Ae.length === 0 && (me = await navigator.clipboard.readText())
  8939. } catch (u) {
  8940. console.error("Failed to read clipboard items before connection, ", u)
  8941. }
  8942. }
  8943. async function Xt(u) {
  8944. if (!B4) {
  8945. var e = [], i = "";
  8946. for (let n = 0; n < 3; n++) try {
  8947. e = await navigator.clipboard.read(), e.length === 0 && (i = await navigator.clipboard.readText());
  8948. break
  8949. } catch (a) {
  8950. if (a.name === "NotAllowedError" && a.message.includes("Document is not focused")) await new Promise(t => setTimeout(t, 300)); else return
  8951. }
  8952. e.length === 0 && i === "" || (B4 = !0, await ho(e) ? (Ae = e, await xo(u)) : i !== me && (me = i, await yo(u)))
  8953. }
  8954. }
  8955. async function ho(u) {
  8956. if (u.length !== Ae.length) return !0;
  8957. for (let e = 0; e < u.length; e++) {
  8958. const i = u[e], n = Ae[e];
  8959. if (!await fo(i, n)) return !0
  8960. }
  8961. return !1
  8962. }
  8963. async function fo(u, e) {
  8964. if (u.types.length !== e.types.length) return !1;
  8965. for (let i = 0; i < u.types.length; i++) {
  8966. if (u.types[i] !== e.types[i]) return !1;
  8967. if (!S4.includes(u.types[i])) continue;
  8968. const n = await u.getType(u.types[i]), a = await e.getType(e.types[i]);
  8969. if (n.size !== a.size) return !1;
  8970. const t = new Uint8Array(await n.arrayBuffer()), s = new Uint8Array(await a.arrayBuffer());
  8971. for (let E = 0; E < t.length; E++) if (t[E] !== s[E]) return !1
  8972. }
  8973. return !0
  8974. }
  8975. function Yt(u) {
  8976. switch (u) {
  8977. case"text/plain":
  8978. return Du.Text;
  8979. case"text/html":
  8980. return Du.Html;
  8981. case"image/svg+xml":
  8982. return Du.ImageSvg;
  8983. case"image/png":
  8984. return Du.ImagePng;
  8985. default:
  8986. return Du.UNRECOGNIZED
  8987. }
  8988. }
  8989. async function xo(u) {
  8990. const e = [], i = (await Promise.all(Ae.map(async n => {
  8991. const a = [];
  8992. for (const t of n.types) {
  8993. if (!S4.includes(t)) continue;
  8994. const s = await n.getType(t);
  8995. e.push(t), a.push(new Uint8Array(await s.arrayBuffer()))
  8996. }
  8997. return a
  8998. }))).flat();
  8999. e.length !== 0 && da(i, !0, n => {
  9000. const a = n.map((t, s) => {
  9001. let E = !1;
  9002. t && (E = t.length < me.length);
  9003. const l = E && t != null ? t : i[s];
  9004. return W.fromPartial({content: l, compress: E, format: Yt(e[s])})
  9005. });
  9006. u.sendMessage(au.fromPartial({multi_clipboards: hu.fromPartial({clipboards: a})}))
  9007. })
  9008. }
  9009. async function yo(u) {
  9010. const e = new TextEncoder().encode(me);
  9011. da(e, !1, i => {
  9012. let n = !1;
  9013. i && (n = i.length < me.length);
  9014. const a = n && i != null ? i : e;
  9015. let t = W.fromPartial({content: a, compress: n, format: Du.Text});
  9016. u.sendMessage(au.fromPartial({clipboard: t}))
  9017. })
  9018. }
  9019. function P4(u, e = void 0) {
  9020. const i = () => {
  9021. try {
  9022. xr(new TextDecoder().decode(u.content)), z4(), e == null || e()
  9023. } catch (n) {
  9024. console.error("Failed to copy to clipboard, ", n), document.hasFocus() || (Qe = u)
  9025. }
  9026. };
  9027. u.compress ? M4(u.content, !1, n => {
  9028. n && (u.content = n, i())
  9029. }) : i()
  9030. }
  9031. const Oe = document.createElement("canvas"), E4 = Oe.getContext("2d");
  9032. function bo(u, e, i) {
  9033. if (Oe.width = e, Oe.height = i, !E4) return new Uint8Array(0);
  9034. const n = E4.createImageData(e, i);
  9035. return n.data.set(u), E4.putImageData(n, 0, 0), Uint8Array.from(atob(Oe.toDataURL("image/png").split(",")[1]), a => a.charCodeAt(0))
  9036. }
  9037. function wo(u, e = void 0) {
  9038. z4();
  9039. const i = u.clipboards, n = i.filter(a => a.compress).map(a => a.content);
  9040. M4(n, !0, async a => {
  9041. var d;
  9042. let t = 0;
  9043. for (const c of i) c.compress && (c.content = (d = a[t]) != null ? d : c.content, t++), c.compress = !1;
  9044. const s = {};
  9045. for (const c of i) {
  9046. const p = S4.find(B => c.format === Yt(B));
  9047. if (p) {
  9048. const B = new Blob([c.content], {type: p});
  9049. s[p] = B
  9050. }
  9051. }
  9052. if (!(s["image/png"] !== void 0)) {
  9053. for (const c of i) if (c.format === Du.ImageRgba) {
  9054. const p = bo(c.content, c.width, c.height);
  9055. p.length > 0 && (s["image/png"] = new Blob([p], {type: "image/png"}));
  9056. break
  9057. }
  9058. }
  9059. if (Object.keys(s).length === 0) return;
  9060. const l = new ClipboardItem(s);
  9061. await $t(i, l, e)
  9062. })
  9063. }
  9064. async function $t(u, e, i = void 0) {
  9065. if (!document.hasFocus()) {
  9066. Ze = u, ye = [e];
  9067. return
  9068. }
  9069. try {
  9070. await navigator.clipboard.write([e]), z4(), i == null || i()
  9071. } catch (n) {
  9072. if (console.error("Failed to write to clipboard, ", n), !document.hasFocus()) {
  9073. Ze = u, ye = [e];
  9074. return
  9075. }
  9076. const a = u.find(t => t.format === Du.Text);
  9077. a && P4(a, i)
  9078. }
  9079. }
  9080. function dt() {
  9081. pr("info", "Clipboard is synchronized", 2e3)
  9082. }
  9083. window.addEventListener("focus", function () {
  9084. ye.length > 0 ? $t(Ze, ye[0], dt) : Qe && P4(Qe, dt)
  9085. });
  9086. class So {
  9087. constructor({id: e, path: i}) {
  9088. D(this, "id");
  9089. D(this, "path");
  9090. D(this, "empty_dirs");
  9091. this.id = e, this.path = i, this.empty_dirs = void 0
  9092. }
  9093. }
  9094. const su = class {
  9095. constructor({
  9096. id: e,
  9097. remote: i,
  9098. path: n,
  9099. show_hidden: a,
  9100. is_remote: t,
  9101. is_last_job: s,
  9102. file_num: E,
  9103. files: l,
  9104. conn_id: d,
  9105. total_size: c,
  9106. finished_size: p,
  9107. transferred: B,
  9108. enable_overwrite_detection: F,
  9109. file_confirmed: b,
  9110. file_skipped: x,
  9111. file_is_waiting: k,
  9112. is_dir: M
  9113. }) {
  9114. D(this, "id");
  9115. D(this, "remote");
  9116. D(this, "path");
  9117. D(this, "show_hidden");
  9118. D(this, "is_remote");
  9119. D(this, "is_last_job");
  9120. D(this, "file_num");
  9121. D(this, "files");
  9122. D(this, "conn_id");
  9123. D(this, "total_size");
  9124. D(this, "finished_size");
  9125. D(this, "transferred");
  9126. D(this, "lastTransferred");
  9127. D(this, "enable_overwrite_detection");
  9128. D(this, "file_confirmed");
  9129. D(this, "file_skipped");
  9130. D(this, "file_is_waiting");
  9131. D(this, "default_overwrite_strategy");
  9132. D(this, "is_dir");
  9133. D(this, "stream");
  9134. D(this, "writer");
  9135. D(this, "zip");
  9136. D(this, "currentData");
  9137. D(this, "fileHandles");
  9138. D(this, "currentReader");
  9139. D(this, "write", async (e, i) => {
  9140. var t;
  9141. if (e.id !== this.id) throw new Error("Wrong id");
  9142. const n = e.file_num;
  9143. if (n >= this.files.length) throw new Error("Wrong file number");
  9144. const a = this.is_dir;
  9145. if (n !== this.file_num || a && !this.zip || !a && !this.writer) if (a) {
  9146. if (this.zip || (this.zip = new H4), this.currentData) {
  9147. const s = this.files[this.file_num];
  9148. this.zip.file(s.name, this.currentData), this.currentData = void 0
  9149. }
  9150. this.file_num = e.file_num
  9151. } else {
  9152. this.writer && await this.writer.close(), this.stream && (this.stream = void 0), this.file_num = e.file_num;
  9153. const s = this.files[n], E = su.join(this.path, s.name);
  9154. this.stream = streamSaver.createWriteStream(E, {size: s.size}), this.writer = (t = this.stream) == null ? void 0 : t.getWriter()
  9155. }
  9156. if (e.compressed) {
  9157. const s = await Ca(e.data);
  9158. if (!s) throw new Error("Failed to decompress");
  9159. if (a) this.currentData ? this.currentData = new Uint8Array([...this.currentData, ...s]) : this.currentData = s; else {
  9160. if (!this.writer) throw new Error("file is None");
  9161. try {
  9162. await this.writer.write(s)
  9163. } catch (E) {
  9164. throw A4(this.id, "write failed", this.file_num), i(), E
  9165. }
  9166. }
  9167. this.finished_size += s.length
  9168. } else {
  9169. if (a) this.currentData ? this.currentData = new Uint8Array([...this.currentData, ...e.data]) : this.currentData = e.data; else {
  9170. if (!this.writer) throw new Error("file is None");
  9171. try {
  9172. await this.writer.write(e.data)
  9173. } catch (s) {
  9174. throw A4(this.id, "write failed", this.file_num), i(), s
  9175. }
  9176. }
  9177. this.finished_size += e.data.length
  9178. }
  9179. this.transferred += e.data.length
  9180. });
  9181. D(this, "read", async e => {
  9182. var d;
  9183. let i = this.file_num;
  9184. if (i >= this.files.length) {
  9185. (d = this.currentReader) == null || d.cancel(), this.currentReader = void 0;
  9186. return
  9187. }
  9188. let n = this.files[i];
  9189. if (!this.currentReader) {
  9190. if (!this.fileHandles || !this.fileHandles[i]) throw new Error("file is None");
  9191. let p = (await this.fileHandles[i].getFile()).stream();
  9192. this.currentReader = p.getReader({mode: "byob"}), this.file_confirmed = !1, this.file_is_waiting = !1
  9193. }
  9194. if (this.enable_overwrite_detection && !this.file_confirmed) {
  9195. this.file_is_waiting || (this.send_current_digest(e), this.file_is_waiting = !0);
  9196. return
  9197. }
  9198. const a = 128 * 1024;
  9199. let t = new ArrayBuffer(a), s = !1, E = 0;
  9200. for (; E < t.byteLength;) {
  9201. const {value: c, done: p} = await this.currentReader.read(new Uint8Array(t, E, t.byteLength - E));
  9202. if (!c) {
  9203. this.file_num += 1, this.file_confirmed = !1, this.file_is_waiting = !1, this.currentReader = void 0, t = new ArrayBuffer(0);
  9204. break
  9205. }
  9206. if (E += c.byteLength, t = c.buffer, p) break
  9207. }
  9208. let l = new Uint8Array(t, 0, E);
  9209. if (E === 0) this.file_num += 1, this.currentReader = void 0, this.file_confirmed = !1, this.file_is_waiting = !1; else {
  9210. if (this.finished_size += E, !Jo(su.join(this.path, n.name))) {
  9211. const c = await ca(new Uint8Array(t, 0, E));
  9212. if (c) c.length < E && (l = new Uint8Array(c), s = !0); else throw new Error("Failed to compress")
  9213. }
  9214. this.transferred += E
  9215. }
  9216. return zu.fromPartial({id: this.id, file_num: i, data: l, compressed: s})
  9217. });
  9218. D(this, "send_current_digest", async e => {
  9219. if (!this.fileHandles || !this.fileHandles[this.file_num]) throw new Error("file is None");
  9220. let i = await this.fileHandles[this.file_num].getFile();
  9221. if (!i) throw new Error("file is None");
  9222. let n = Math.floor(i.lastModified / 1e3), a = i.size,
  9223. t = Su.fromPartial({id: this.id, file_num: this.file_num, last_modified: n, file_size: a}),
  9224. s = ou.fromPartial({digest: t}), E = au.fromPartial({file_response: s});
  9225. e(E)
  9226. });
  9227. D(this, "read_digest", e => {
  9228. let i = this.files[e.file_num], n = su.join(this.path, i.name), a = this.default_overwrite_strategy;
  9229. if (a !== void 0) {
  9230. let t = du.fromPartial({
  9231. id: e.id,
  9232. file_num: e.file_num,
  9233. offset_blk: a ? 0 : void 0,
  9234. skip: a ? void 0 : !0
  9235. });
  9236. return this.confirm(t), su.new_send_confirm(t)
  9237. } else {
  9238. Go(e.id, e.file_num, n, !0, e.is_identical);
  9239. return
  9240. }
  9241. });
  9242. D(this, "write_digest", e => {
  9243. let i = du.fromPartial({id: e.id, file_num: e.file_num, offset_blk: 0});
  9244. return this.confirm(i), su.new_send_confirm(i)
  9245. });
  9246. D(this, "write_done", (e, i, n) => {
  9247. if (this.writer) {
  9248. this.writer.close();
  9249. return
  9250. }
  9251. if (this.zip || (this.zip = new H4), this.currentData) {
  9252. const t = this.files[this.file_num];
  9253. this.zip.file(t.name, this.currentData), this.currentData = void 0
  9254. }
  9255. if (i != null) {
  9256. const t = i();
  9257. if (t != null) if (t.empty_dirs != null) for (let s of t.empty_dirs) {
  9258. var a = s.substring(t.path.length + 1);
  9259. he() ? a = a.replace(/\//g, "\\") : a = a.replace(/\\/g, "/"), this.zip.folder(a)
  9260. } else {
  9261. setTimeout(() => {
  9262. this.write_done(e, i, n)
  9263. }, 1e3);
  9264. return
  9265. }
  9266. }
  9267. this.zip.generateAsync({type: "blob"}).then(t => {
  9268. ka.exports.saveAs(t, `${this.path}.zip`)
  9269. }), n()
  9270. });
  9271. D(this, "confirm", e => (this.file_num !== e.file_num ? console.log("file num truncated, ignoring") : e.skip !== void 0 ? e.skip ? this.set_file_skipped() : this.set_file_confirmed(!0) : e.offset_blk !== void 0 && this.set_file_confirmed(!0), !0));
  9272. D(this, "set_file_skipped", () => {
  9273. var e;
  9274. (e = this.writer) == null || e.abort(), this.writer = void 0, this.stream = void 0, this.set_file_confirmed(!1), this.set_file_is_waiting(!1), this.file_num += 1, this.file_skipped = !0
  9275. });
  9276. D(this, "set_file_confirmed", e => {
  9277. this.file_confirmed = e, this.file_skipped = !1
  9278. });
  9279. D(this, "set_file_is_waiting", e => {
  9280. this.file_is_waiting = e
  9281. });
  9282. D(this, "update_job_status", e => {
  9283. if (e <= 0) return;
  9284. let i = Math.floor((this.transferred - this.lastTransferred) / (e * 1 / 1e3));
  9285. this.lastTransferred = this.transferred;
  9286. let n = this.file_num - 1;
  9287. this.job_progress(this.id, n, i, this.finished_size)
  9288. });
  9289. D(this, "job_progress", (e, i, n, a) => {
  9290. A("job_progress", {
  9291. id: e.toString(),
  9292. file_num: i.toString(),
  9293. speed: n.toString(),
  9294. finished_size: a.toString()
  9295. })
  9296. });
  9297. D(this, "job_skipped", () => this.file_skipped && this.files.length === 1);
  9298. D(this, "job_error", () => {
  9299. if (this.job_skipped()) return "skipped"
  9300. });
  9301. D(this, "job_completed", () => !this.enable_overwrite_detection || !this.file_confirmed && !this.file_is_waiting);
  9302. D(this, "remove_download_file", () => {
  9303. if (this.writer) try {
  9304. this.writer.abort()
  9305. } catch {
  9306. }
  9307. this.writer = void 0, this.stream = void 0, this.currentData = void 0, this.zip = void 0
  9308. });
  9309. this.id = e, this.remote = i, this.path = n, this.show_hidden = a, this.is_remote = t, this.is_last_job = s, this.file_num = E, this.files = l, this.conn_id = d, this.total_size = c, this.finished_size = p, this.transferred = B, this.lastTransferred = 0, this.enable_overwrite_detection = F, this.file_confirmed = b, this.file_skipped = x, this.file_is_waiting = k, this.is_dir = M
  9310. }
  9311. };
  9312. let Eu = su;
  9313. D(Eu, "newWrite", (e, i, n, a, t, s, E, l, d) => {
  9314. let c = E.reduce((B, F) => B + F.size, 0);
  9315. return new su({
  9316. id: e,
  9317. remote: i,
  9318. path: n,
  9319. file_num: a,
  9320. show_hidden: t,
  9321. is_remote: s,
  9322. files: E,
  9323. total_size: c,
  9324. enable_overwrite_detection: l,
  9325. is_dir: d,
  9326. is_last_job: !1,
  9327. conn_id: 0,
  9328. finished_size: 0,
  9329. transferred: 0,
  9330. file_confirmed: !1,
  9331. file_skipped: !1,
  9332. file_is_waiting: !1
  9333. })
  9334. }), D(Eu, "newRead", (e, i, n, a, t, s, E, l, d) => {
  9335. let c = E.reduce((B, F) => B + F.size, 0), p = new su({
  9336. id: e,
  9337. remote: i,
  9338. path: n,
  9339. file_num: a,
  9340. show_hidden: t,
  9341. is_remote: s,
  9342. files: E,
  9343. total_size: c,
  9344. enable_overwrite_detection: l,
  9345. is_dir: !1,
  9346. is_last_job: !1,
  9347. conn_id: 0,
  9348. finished_size: 0,
  9349. transferred: 0,
  9350. file_confirmed: !1,
  9351. file_skipped: !1,
  9352. file_is_waiting: !1
  9353. });
  9354. return p.fileHandles = d, p
  9355. }), D(Eu, "new_send_confirm", e => au.fromPartial({file_action: I.fromPartial({send_confirm: e})})), D(Eu, "join", (e, i) => i === "" ? e : e.endsWith("/") || e.endsWith("\\") ? e + i : he() ? e + "\\" + i : e + "/" + i);
  9356. const zo = (u, e, i, n) => {
  9357. let a = Ru.fromPartial({id: u, path: e, include_hidden: n, file_num: i});
  9358. return I.fromPartial({send: a})
  9359. }, ct = (u, e, i, n) => {
  9360. if (!n) return;
  9361. let a = Nu.fromPartial({id: u, path: e, file_num: i});
  9362. return I.fromPartial({remove_file: a})
  9363. }, Po = (u, e, i) => {
  9364. let n = yu.fromPartial({id: u, path: e, include_hidden: i});
  9365. return I.fromPartial({all_files: n})
  9366. }, Ro = (u, e) => {
  9367. let i = Ou.fromPartial({id: u, path: e});
  9368. return I.fromPartial({create: i})
  9369. }, Io = u => {
  9370. let e = wu.fromPartial({id: u});
  9371. return I.fromPartial({cancel: e})
  9372. }, To = (u, e) => {
  9373. let i = ju.fromPartial({id: u, path: e, recursive: !0});
  9374. return I.fromPartial({remove_dir: i})
  9375. }, jo = (u, e, i) => {
  9376. let n = bu.fromPartial({id: u, path: e, new_name: i});
  9377. return I.fromPartial({rename: n})
  9378. }, No = (u, e, i, n, a) => {
  9379. let t = Tu.fromPartial({id: u, path: e, file_num: i, files: n, total_size: a});
  9380. return I.fromPartial({receive: t})
  9381. }, Oo = u => {
  9382. let e = ou.fromPartial({block: u});
  9383. return au.fromPartial({file_response: e})
  9384. }, Ct = (u, e, i) => {
  9385. let n = ou.fromPartial({error: Pu.fromPartial({id: u, error: e, file_num: i})});
  9386. return au.fromPartial({file_response: n})
  9387. }, Uo = (u, e) => {
  9388. let i = ou.fromPartial({done: Iu.fromPartial({id: u, file_num: e})});
  9389. return au.fromPartial({file_response: i})
  9390. }, Mo = (u, e) => {
  9391. let i = xu.fromPartial({path: u, include_hidden: e});
  9392. return I.fromPartial({read_empty_dirs: i})
  9393. }, pt = (u, e, i, n, a) => {
  9394. a ? A("update_folder_files", {info: Lo(u, e, a)}) : A("file_dir", {is_local: "false", value: Wo(u, i, e)})
  9395. }, Lo = (u, e, i) => {
  9396. let n = {
  9397. id: u,
  9398. entries: e.map(a => ({name: a.name, type: a.entry_type, time: a.modified_time, size: a.size})),
  9399. total_size: e.reduce((a, t) => a + t.size, 0)
  9400. };
  9401. return i && (n.num_entries = e.length, delete n.entries), JSON.stringify(n)
  9402. }, Wo = (u, e, i) => {
  9403. let n = {
  9404. id: u,
  9405. path: e,
  9406. entries: i.map(a => ({entry_type: a.entry_type, name: a.name, size: a.size, modified_time: a.modified_time}))
  9407. };
  9408. return JSON.stringify(n)
  9409. }, A4 = (u, e, i) => {
  9410. A("job_error", {id: u.toString(), err: e, file_num: i.toString()})
  9411. }, Vo = (u, e) => {
  9412. A("job_done", {id: u.toString(), file_num: e.toString()})
  9413. };
  9414. var t0 = 0;
  9415. const qo = async (u, e) => {
  9416. try {
  9417. if (u) {
  9418. const i = await window.showDirectoryPicker();
  9419. let n = {name: i.name, size: 0, entry_type: 2, modified_time: 0};
  9420. t0++, e(t0, i), A("selected_files", {handleIndex: t0, file: n})
  9421. } else {
  9422. const i = {multiple: !0}, n = await window.showOpenFilePicker(i);
  9423. for (const a of n) {
  9424. const t = await a.getFile();
  9425. let s = {name: t.name, size: t.size, entry_type: 4, modified_time: Math.floor(t.lastModified / 1e3)};
  9426. t0++, e(t0, a), A("selected_files", {handleIndex: t0, file: s})
  9427. }
  9428. }
  9429. } catch (i) {
  9430. console.error("Failed to choose file:", i)
  9431. }
  9432. }, Ko = async (u, e) => {
  9433. let i = [];
  9434. for (let n of u) if (!n.is_last_job) try {
  9435. let a = await n.read(e);
  9436. if (a) e(Oo(a)); else if (n.job_completed()) {
  9437. i.push(n.id);
  9438. let t = n.job_error();
  9439. e(t ? Ct(n.id, t, n.file_num) : Uo(n.id, n.file_num))
  9440. }
  9441. } catch (a) {
  9442. e(Ct(n.id, (a != null ? a : "read failed").toString(), n.file_num))
  9443. }
  9444. return i
  9445. }, Ho = u => {
  9446. let e = u.lastIndexOf(".");
  9447. return e >= 0 ? u.substring(e + 1) : ""
  9448. }, Jo = u => {
  9449. let e = Ho(u);
  9450. return e === "xz" || e === "gz" || e === "zip" || e === "7z" || e === "rar" || e === "bz2" || e === "tgz" || e === "png" || e === "jpg"
  9451. }, Go = (u, e, i, n, a) => {
  9452. A("override_file_confirm", {
  9453. id: u.toString(),
  9454. file_num: e.toString(),
  9455. read_path: i,
  9456. is_upload: n.toString(),
  9457. is_identical: a.toString()
  9458. })
  9459. }, Xe = (u, e) => u === "" ? e : Eu.join(u, e), ua = async (u, e) => {
  9460. const i = [];
  9461. let n = [];
  9462. for await(const a of u.values()) if (a.kind === "file") i.push(a.getFile().then(t => {
  9463. n.push({
  9464. entry: V.fromPartial({
  9465. name: Xe(e, t.name),
  9466. size: t.size,
  9467. entry_type: ft.File,
  9468. modified_time: Math.floor(t.lastModified / 1e3)
  9469. }), handle: a
  9470. })
  9471. })); else if (a.kind === "directory") {
  9472. let t = Xe(e, a.name);
  9473. const s = await ua(a, t);
  9474. n = n.concat(s)
  9475. }
  9476. return await Promise.all(i), n
  9477. }, ea = async (u, e) => {
  9478. let i = [], n = !0;
  9479. for await(const a of u.values()) {
  9480. if (a.kind === "directory") {
  9481. let t = Xe(e, a.name);
  9482. const s = await ea(a, t);
  9483. i = i.concat(s)
  9484. }
  9485. n = !1
  9486. }
  9487. return n && i.push(Xe(e, "")), i
  9488. }, Bt = 21116,defaultIdServerPort = 21116, ia = "rs-ny.rustdesk.com";
  9489. function Zo() {
  9490. const u = window.location.host;
  9491. if (u.indexOf("rustdesk.com") >= 0) return ia;
  9492. if (window.location.host.indexOf("localhost:") == 0) return "127.0.0.1";
  9493. const e = u.split(":");
  9494. return e.length > 1 ? e[0] + ":" + (parseInt(e[1]) + 2) : u
  9495. }
  9496. const Qo = Zo(), At = 100, Ie = "trust-this-device";
  9497. class ta {
  9498. constructor() {
  9499. D(this, "_msgs");
  9500. D(this, "_ws");
  9501. D(this, "_interval");
  9502. D(this, "_updateInterval");
  9503. D(this, "_id");
  9504. D(this, "_otherServer");
  9505. D(this, "_hash");
  9506. D(this, "_msgbox");
  9507. D(this, "_draw");
  9508. D(this, "_peerInfo");
  9509. D(this, "_firstFrame");
  9510. D(this, "_frameCount");
  9511. D(this, "_videoFormat");
  9512. D(this, "_password");
  9513. D(this, "_presetPassword");
  9514. D(this, "_sharedPassword");
  9515. D(this, "_passwordSource");
  9516. D(this, "_options");
  9517. D(this, "_fpsCalc");
  9518. D(this, "_updateTs");
  9519. D(this, "_serverPerms");
  9520. D(this, "_elevationRequested");
  9521. D(this, "_supportedEncoding");
  9522. D(this, "_i444");
  9523. D(this, "_healthCheck");
  9524. D(this, "_sessionId");
  9525. D(this, "_isFileTransfer");
  9526. D(this, "_isViewCamera");
  9527. D(this, "_readJobs");
  9528. D(this, "_writeJobs");
  9529. D(this, "_removeJobs");
  9530. D(this, "_readRemoteEmptyDirsJobs");
  9531. D(this, "_last_update_jobs_ms");
  9532. D(this, "_fileHandles");
  9533. D(this, "_ftTimer");
  9534. D(this, "_restartingRemoteDevice");
  9535. D(this, "_enableTrustedDevices");
  9536. D(this, "_lastChangeDisplay");
  9537. D(this, "_lastSendFps");
  9538. D(this, "_videoQueue");
  9539. D(this, "_decodingVideo");
  9540. D(this, "_selectedWindowsSessionId");
  9541. D(this, "enableEmptyDirs", () => {
  9542. var e;
  9543. return L((e = this._peerInfo) == null ? void 0 : e.version) >= L("1.3.3")
  9544. });
  9545. D(this, "enableOverwriteDetection", () => {
  9546. var e;
  9547. return L((e = this._peerInfo) == null ? void 0 : e.version) >= L("1.1.10")
  9548. });
  9549. this._msgbox = aa, this._draw = F4, this._msgs = [], this._id = "", this._frameCount = {}, this._fpsCalc = {
  9550. videoTestSpeed: [0, 0],
  9551. skipBegining: 0,
  9552. fps: void 0
  9553. }, this._updateTs = new Date().getTime(), this._serverPerms = {
  9554. keyboardEnabled: !0,
  9555. fileTransferEnabled: !0,
  9556. clipboardEnabled: !0
  9557. }, this._elevationRequested = !1, this._supportedEncoding = Z.fromPartial({}), this._sessionId = 0, this._isFileTransfer = !1, this._isViewCamera = !1, this._readJobs = [], this._writeJobs = [], this._removeJobs = {}, this._readRemoteEmptyDirsJobs = [], this._last_update_jobs_ms = 0, this._fileHandles = {}, this._restartingRemoteDevice = !1, this._enableTrustedDevices = !1, this._passwordSource = {type: "Undefined"}, this._videoQueue = [], this._decodingVideo = !1
  9558. }
  9559. getPeerPlatform() {
  9560. var e, i;
  9561. return (i = (e = this._peerInfo) == null ? void 0 : e.platform) != null ? i : ""
  9562. }
  9563. isSupportVirtualDisplay() {
  9564. if (!this._peerInfo || !this._peerInfo.platform_additions) return !1;
  9565. try {
  9566. const e = JSON.parse(this._peerInfo.platform_additions), i = e.is_installed, n = e.idd_impl;
  9567. return i && this._peerInfo.platform == "Windows" && (n == "rustdesk_idd" || n == "amyuni_idd")
  9568. } catch (e) {
  9569. return console.error("Failed to check virtual display support, ", e), !1
  9570. }
  9571. }
  9572. isSupportViewCamera() {
  9573. if (!this._peerInfo || !this._peerInfo.platform_additions) return !1;
  9574. try {
  9575. return JSON.parse(this._peerInfo.platform_additions).support_view_camera
  9576. } catch (e) {
  9577. return console.error("Failed to check view camera support, ", e), !1
  9578. }
  9579. }
  9580. sendMessage(e) {
  9581. var i;
  9582. (i = this._ws) == null || i.sendMessage(e)
  9583. }
  9584. handleRelayId(e) {
  9585. return e.endsWith("\\r") || e.endsWith("/r") ? e.substring(0, e.length - 2) : e
  9586. }
  9587. setRemoteId(e) {
  9588. var n, a, t, s, E;
  9589. let i = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
  9590. if (i == 0 && (i = 1), this._sessionId = i, this._restartingRemoteDevice = !1, this._id = e, e.includes("@")) {
  9591. const l = e.split("@"), d = l[0], c = ((n = l[1]) != null ? n : "").split("?"),
  9592. p = (a = c[0]) != null ? a : "", B = (t = c[1]) != null ? t : "",
  9593. F = p == r4 ? Et : (s = B.split("&").reduce((x, k) => {
  9594. const M = k.indexOf("=");
  9595. if (M != -1) {
  9596. const Se = k.substring(0, M).toLowerCase(), ze = k.substring(M + 1);
  9597. x[Se] = ze
  9598. }
  9599. return x
  9600. }, {}).key) != null ? s : "", b = this.handleRelayId(d);
  9601. this._otherServer = {realId: b, server: p, key: F}, this._id = `${b}@${p}`
  9602. } else this._id = this.handleRelayId(e);
  9603. if (this._options = (E = cu()[this._id]) != null ? E : this.getUserDefaultToggleOptions(), this._otherServer && !this._otherServer.key) {
  9604. const l = this.getOption("other-server-key");
  9605. l && (this._otherServer.key = l)
  9606. }
  9607. }
  9608. setSessionInfo(e) {
  9609. this._isFileTransfer = e.isFileTransfer, this._isViewCamera = e.isViewCamera, e.is_shared_password ? this._sharedPassword = e.password : this._presetPassword = e.password
  9610. }
  9611. async start() {
  9612. if (Ba(!1)) {
  9613. qr(), ma();
  9614. return
  9615. }
  9616. try {
  9617. ko(), await this._start()
  9618. } catch (e) {
  9619. this.msgbox("error", "Connection Error", e.type == "close" ? "Reset by the peer" : String(e))
  9620. }
  9621. }
  9622. getId() {
  9623. var e, i;
  9624. return (i = (e = this._otherServer) == null ? void 0 : e.realId) != null ? i : this._id
  9625. }
  9626. async _start() {
  9627. var F, b;
  9628. let e = this.getId(), i = Jt(), n = Gt(), a = (F = this._otherServer) == null ? void 0 : F.server;
  9629. this._otherServer && (i = this._otherServer.key, n = "");
  9630. let t = "";
  9631. a ? a == r4 ? t = Me(ia) : t = Me(a) : t = Ue(), this._options || (this._options = (b = cu()[this._id]) != null ? b : this.getUserDefaultToggleOptions()), this._interval = setInterval(() => {
  9632. var x;
  9633. for (; this._msgs.length;) (x = this._ws) == null || x.sendMessage(this._msgs[0]), this._msgs.splice(0, 1)
  9634. }, 1);
  9635. const s = new Ve(t, !0, "rendezvous");
  9636. this._ws = s, console.log(new Date + ": Connecting to rendezvous server: " + t + ", for " + e), await s.open(), console.log(new Date + ": Connected to rendezvous server");
  9637. const E = this._isFileTransfer ? je.FILE_TRANSFER : this._isViewCamera ? je.VIEW_CAMERA : je.DEFAULT_CONN,
  9638. l = bt.SYMMETRIC,
  9639. d = Hu.fromPartial({id: e, licence_key: i, conn_type: E, nat_type: l, token: n, version: c4});
  9640. s.sendRendezvous({punch_hole_request: d});
  9641. const c = await s.next();
  9642. s.close(), console.log(new Date + ": Got relay response");
  9643. const p = c.punch_hole_response, B = c.relay_response;
  9644. if (p) {
  9645. if (p != null && p.other_failure) {
  9646. this.msgbox("error", "Error", p == null ? void 0 : p.other_failure);
  9647. return
  9648. }
  9649. if (p.failure != $0.UNRECOGNIZED) switch (p == null ? void 0 : p.failure) {
  9650. case $0.ID_NOT_EXIST:
  9651. this.msgbox("error", "Error", "ID does not exist");
  9652. break;
  9653. case $0.OFFLINE:
  9654. this.msgbox("error", "Error", "Remote desktop is offline");
  9655. break;
  9656. case $0.LICENSE_MISMATCH:
  9657. this.msgbox("error", "Error", "Key mismatch");
  9658. break;
  9659. case $0.LICENSE_OVERUSE:
  9660. this.msgbox("error", "Error", "Key overuse");
  9661. break
  9662. }
  9663. } else if (B) {
  9664. if (!B.version) {
  9665. this.msgbox("error", "Error", "Remote version is low, not support web");
  9666. return
  9667. }
  9668. this._healthCheck = new vo(t, B.feedback, i, n), this._healthCheck.start(), await this.connectRelay(B, i)
  9669. }
  9670. }
  9671. async connectRelay(e, i) {
  9672. var d, c;
  9673. const n = e.pk;
  9674. let a = e.relay_server;
  9675. a ? a = Me(a, !0) : a = Ue(!0);
  9676. const t = e.uuid;
  9677. console.log(new Date + ": Connecting to relay server: " + a);
  9678. const s = new Ve(a, !1, "relay");
  9679. await s.open(), console.log(new Date + ": Connected to relay server"), this._ws = s;
  9680. const E = Ju.fromPartial({licence_key: i, uuid: t});
  9681. s.sendRendezvous({request_relay: E});
  9682. const l = await this.secure(n, i) || !1;
  9683. A("connection_ready", {secure: l, direct: !1}), this._updateInterval = setInterval(() => {
  9684. this.updateStatus()
  9685. }, 1e3), (d = this._ws) == null || d.on("message", this.msgHandler.bind(this)), (c = this._ws) == null || c.on("status_change", this.onStatusChange.bind(this))
  9686. }
  9687. async secure(e, i) {
  9688. var F, b, x, k, M, Se, ze, W4;
  9689. if (e) {
  9690. try {
  9691. if (e = await _4(e, i || Et), e) {
  9692. const T = D4.decode(e);
  9693. T.id == this.getId() && (e = T.pk)
  9694. }
  9695. (e == null ? void 0 : e.length) != 32 && (e = void 0)
  9696. } catch (T) {
  9697. console.error("Failed to verify id pk, ", T), e = void 0
  9698. }
  9699. e || console.error("Handshake failed: invalid public key from rendezvous server")
  9700. }
  9701. if (!e) {
  9702. const T = H.fromPartial({});
  9703. (F = this._ws) == null || F.sendMessage({public_key: T});
  9704. return
  9705. }
  9706. const n = await ((b = this._ws) == null ? void 0 : b.next());
  9707. let a = n == null ? void 0 : n.signed_id;
  9708. if (!a) {
  9709. console.error("Handshake failed: invalid message type");
  9710. const T = H.fromPartial({});
  9711. (x = this._ws) == null || x.sendMessage({public_key: T});
  9712. return
  9713. }
  9714. try {
  9715. a = await _4(a.id, Uint8Array.from(e))
  9716. } catch (T) {
  9717. console.error("Failed to verify signed id pk, ", T), console.error("pk mismatch, fall back to non-secure");
  9718. const Fa = H.fromPartial({});
  9719. (k = this._ws) == null || k.sendMessage({public_key: Fa});
  9720. return
  9721. }
  9722. const t = D4.decode(a), s = t.id, E = t.pk;
  9723. if (s != this.getId()) {
  9724. console.error("Handshake failed: sign failure");
  9725. const T = H.fromPartial({});
  9726. (M = this._ws) == null || M.sendMessage({public_key: T});
  9727. return
  9728. }
  9729. if (E.length != 32) {
  9730. console.error("Handshake failed: invalid public box key length from peer");
  9731. const T = H.fromPartial({});
  9732. (Se = this._ws) == null || Se.sendMessage({public_key: T});
  9733. return
  9734. }
  9735. const [l, d] = Ar(), c = mr(), p = Fr(c, E, l), B = H.fromPartial({asymmetric_value: d, symmetric_value: p});
  9736. return (ze = this._ws) == null || ze.sendMessage({public_key: B}), (W4 = this._ws) == null || W4.setSecretKey(c), console.log("secured"), !0
  9737. }
  9738. async msgHandler(e) {
  9739. var i;
  9740. if (this._ws) {
  9741. if (e != null && e.hash) await this.handleHash(e.hash); else if (e != null && e.test_delay) {
  9742. const n = e == null ? void 0 : e.test_delay;
  9743. n.from_client || (A("update_quality_status", {
  9744. delay: `${n.last_delay}`,
  9745. target_bitrate: `${n.target_bitrate}`
  9746. }), (i = this._ws) == null || i.sendMessage({test_delay: n}))
  9747. } else if (e != null && e.login_response) this.handleLoginResponse(e == null ? void 0 : e.login_response); else if (e != null && e.video_frame) this.handleVideoFrame(e == null ? void 0 : e.video_frame); else if (e != null && e.clipboard) P4(e == null ? void 0 : e.clipboard); else if (e != null && e.multi_clipboards) wo(e == null ? void 0 : e.multi_clipboards); else if (e != null && e.cursor_data) {
  9748. const n = e == null ? void 0 : e.cursor_data;
  9749. M4(n.colors, !1, a => {
  9750. a && (n.colors = a, A("cursor_data", n))
  9751. })
  9752. } else if (e != null && e.cursor_id) A("cursor_id", {id: e == null ? void 0 : e.cursor_id}); else if (e != null && e.cursor_position) A("cursor_position", e == null ? void 0 : e.cursor_position); else if (e != null && e.misc) this.handleMisc(e == null ? void 0 : e.misc); else if (e != null && e.audio_frame) hr(e == null ? void 0 : e.audio_frame.data); else if (e != null && e.message_box) this.handleMsgBox(e == null ? void 0 : e.message_box); else if (e != null && e.peer_info) this.handleSyncPeerInfo(e.peer_info); else if (e.file_response) await this.handleFileResponse(e.file_response); else if (e.file_action) {
  9753. const n = e.file_action;
  9754. await this.handleFileAction(n)
  9755. }
  9756. }
  9757. }
  9758. onStatusChange(e) {
  9759. if (e === "" || e === "open") return;
  9760. if (this._restartingRemoteDevice) {
  9761. this.msgbox("restarting", "Restarting remote device", "remote_restarting_tip", "");
  9762. return
  9763. }
  9764. if (e instanceof CloseEvent && e.code == 1e3 || !this._ws) return;
  9765. e && console.error("msgLoop error: ", e);
  9766. const i = "Connection Error";
  9767. let n = "";
  9768. if (e === "Timeout") n = "Connection timeout"; else if (e instanceof CloseEvent) {
  9769. let a = `code: ${e.code}`;
  9770. e.reason && (a += `, reason: ${e.reason}`), n = `Connection closed, ${a}`
  9771. } else e instanceof Error ? n = e.message : typeof e.toString == "function" ? n = e.toString() : n = "";
  9772. this.msgbox("error", i, n, "")
  9773. }
  9774. enterOrLeave(e) {
  9775. e === !1 ? (Co(), p4(), go(!1)) : (m4(), Xt(this))
  9776. }
  9777. makeDisplaysMsg(e) {
  9778. let i = [];
  9779. return e.forEach(n => {
  9780. let a = {};
  9781. a.x = n.x, a.y = n.y, a.width = n.width, a.height = n.height, a.cursor_embedded = n.cursor_embedded ? 1 : 0, n.original_resolution && (a.original_width = n.original_resolution.width, a.original_height = n.original_resolution.height), a.scale = Math.floor(n.scale * 100), i.push(a)
  9782. }), JSON.stringify(i)
  9783. }
  9784. handleSyncPeerInfo(e) {
  9785. this._peerInfo && (this._peerInfo.displays = e.displays), A("sync_peer_info", {displays: this.makeDisplaysMsg(e.displays)}), A("sync_platform_additions", {platform_additions: e.platform_additions})
  9786. }
  9787. handleMsgBox(e) {
  9788. let i = e.link;
  9789. i in at ? i = at[i] : (console.warn("Message box ignore link " + i + " for security"), i = ""), this.msgbox(e.msgtype, e.title, e.text, i)
  9790. }
  9791. updateStatus() {
  9792. var s, E;
  9793. const e = new Date().getTime(), i = e - this._updateTs;
  9794. if (i < 1e3) return;
  9795. this._updateTs = e;
  9796. const n = ((s = this._ws) == null ? void 0 : s.getRecvDataCount()) || 0;
  9797. (E = this._ws) == null || E.resetRecvDataCount();
  9798. const a = `${(n / 1024 / i * 1e3).toFixed(2)} kb/s`, t = {};
  9799. for (const l in this._frameCount) if (this._frameCount.hasOwnProperty(l)) {
  9800. const d = this._frameCount[l];
  9801. t[l] = Math.floor(d / (i / 1e3))
  9802. }
  9803. this._frameCount = {}, A("update_quality_status", {speed: a, fps: JSON.stringify(t)})
  9804. }
  9805. handleLoginResponse(e) {
  9806. const i = {
  9807. [dn]: {
  9808. msgtype: "error",
  9809. title: "Login Error",
  9810. text: "Login screen using Wayland is not supported",
  9811. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9812. try_again: !0
  9813. },
  9814. [un]: {msgtype: "session-login", title: "", text: "", link: "", try_again: !0},
  9815. [en]: {msgtype: "session-re-login", title: "", text: "", link: "", try_again: !0},
  9816. [tn]: {
  9817. msgtype: "info-nocancel",
  9818. title: "another_user_login_title_tip",
  9819. text: "another_user_login_text_tip",
  9820. link: "",
  9821. try_again: !1
  9822. },
  9823. [an]: {
  9824. msgtype: "info-nocancel",
  9825. title: "xorg_not_found_title_tip",
  9826. text: "xorg_not_found_text_tip",
  9827. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9828. try_again: !0
  9829. },
  9830. [nn]: {
  9831. msgtype: "info-nocancel",
  9832. title: "no_desktop_title_tip",
  9833. text: "no_desktop_text_tip",
  9834. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9835. try_again: !0
  9836. },
  9837. [on]: {msgtype: "session-login-password", title: "", text: "", link: "", try_again: !0},
  9838. [rn]: {msgtype: "session-login-re-password", title: "", text: "", link: "", try_again: !0},
  9839. [Dn]: {
  9840. msgtype: "wait-remote-accept-nook",
  9841. title: "Prompt",
  9842. text: "Please wait for the remote side to accept your session request...",
  9843. link: "",
  9844. try_again: !0
  9845. }
  9846. }, n = e.error;
  9847. if (n) if (n == tt && (this._enableTrustedDevices = e.enable_trusted_devices), n == sn && (this._password = void 0, this.msgbox("input-password", "Password Required", "", "")), n == En) this._password = void 0, this.msgbox("re-input-password", n, "Do you want to enter again?"); else if (n == ln || n == tt) this.getOption(Ie) == "Y" && this.setOption(Ie, void 0), this.msgbox("input-2fa", n, ""); else if (n in i) {
  9848. const a = i[n];
  9849. this.msgbox(a.msgtype, a.title, a.text, a.link)
  9850. } else n.includes(cn) ? this.msgbox("error", "Login Error", n, St) : this.msgbox("error", "Login Error", n); else e.peer_info && (this._firstFrame = !1, this.handlePeerInfo(e.peer_info))
  9851. }
  9852. enableTrustedDevices() {
  9853. return this._enableTrustedDevices
  9854. }
  9855. msgbox(e, i, n, a = "") {
  9856. var t;
  9857. (t = this._msgbox) == null || t.call(this, e, i, n, a)
  9858. }
  9859. cancelMsgbox(e) {
  9860. A("cancel_msgbox", {tag: e})
  9861. }
  9862. draw(e, i) {
  9863. F4(e, new Uint8Array(i.data))
  9864. }
  9865. close() {
  9866. var e, i;
  9867. this._msgs = [], this._interval && (clearInterval(this._interval), this._interval = void 0), this._updateInterval && (clearInterval(this._updateInterval), this._updateInterval = void 0), this._ftTimer && (clearTimeout(this._ftTimer), this._ftTimer = void 0), (e = this._ws) == null || e.close(), this._ws = void 0, (i = this._healthCheck) == null || i.close(), this._healthCheck = void 0, this._readJobs = [], this._writeJobs = [], this._removeJobs = {}, this._fileHandles = {}, this._readRemoteEmptyDirsJobs = [], p4(), this._lastChangeDisplay = void 0, this._lastSendFps = void 0, this._videoQueue = [], this._decodingVideo = !1
  9868. }
  9869. refresh() {
  9870. var i;
  9871. const e = f.fromPartial({refresh_video: !0});
  9872. (i = this._ws) == null || i.sendMessage({misc: e})
  9873. }
  9874. setMsgbox(e) {
  9875. this._msgbox = e
  9876. }
  9877. setDraw(e) {
  9878. this._draw = e
  9879. }
  9880. async handleHash(e) {
  9881. this._hash = e;
  9882. let i = this._password;
  9883. (!i || i.length === 0) && this._presetPassword && (i = Qu([this._presetPassword, e.salt]), this._passwordSource = {type: "Undefined"});
  9884. let n = this._sharedPassword;
  9885. if (this._sharedPassword = void 0, n && (i = Qu([n, e.salt]), this._passwordSource = {
  9886. type: "SharedAb",
  9887. value: n
  9888. }), !i || i.length === 0) {
  9889. const E = this.getOption("password");
  9890. typeof E == "string" && E.length > 0 && (i = Be(E), this._passwordSource = {type: "Undefined"})
  9891. }
  9892. if (!i || i.length === 0) {
  9893. let E = f4("access_token"), l = await Mt();
  9894. if (E && E === l.access_token) {
  9895. let d = l.ab_entries.find(c => qn(c));
  9896. if (d) {
  9897. let c = d.peers.find(p => p.id == this._id);
  9898. if (c) {
  9899. let p = Be(c.hash);
  9900. p.length > 0 && (i = p, this._passwordSource = {type: "PersonalAb", value: p})
  9901. }
  9902. }
  9903. }
  9904. }
  9905. this._password = i;
  9906. let a;
  9907. !i || i.length === 0 ? (a = new Uint8Array(0), this.msgbox("input-password", "Password Required", "")) : a = Qu([i, e.challenge]);
  9908. let t = this.getOption("os-username") || "", s = this.getOption("os-password") || "";
  9909. this._sendLoginMessage({os_login: {username: t, password: s}, password: a})
  9910. }
  9911. handle_login_from_ui(e, i, n, a) {
  9912. let t;
  9913. if (n === "") {
  9914. let E = this._password;
  9915. if (!E || E.length === 0) {
  9916. const l = this.getOption("password");
  9917. typeof l == "string" && l.length > 0 && (E = Be(l), this._passwordSource = {type: "Undefined"})
  9918. }
  9919. t = E
  9920. } else this._passwordSource = {type: "Undefined"}, t = Qu([n, this._hash.salt]), this.setRemember(a);
  9921. this._password = t;
  9922. let s = Qu([t != null ? t : Uint8Array.from([]), this._hash.challenge]);
  9923. this._sendLoginMessage({os_login: {username: e, password: i}, password: s})
  9924. }
  9925. changePreferCodec() {
  9926. var a;
  9927. const e = this.getSupportedDecoding(), i = R.fromPartial({supported_decoding: e}),
  9928. n = f.fromPartial({option: i});
  9929. (a = this._ws) == null || a.sendMessage({misc: n})
  9930. }
  9931. async reconnect() {
  9932. this.close(), await this.start()
  9933. }
  9934. _getHwid(e = void 0) {
  9935. return (e != null ? e : this.getOption(Ie) == "Y") ? $n() : new Uint8Array
  9936. }
  9937. _sendLoginMessage(e) {
  9938. var d;
  9939. const i = this._otherServer ? `${qe()}@${Ue()}` : qe(), n = io();
  9940. let a = qt();
  9941. if (n) try {
  9942. const c = JSON.parse(n);
  9943. c.name && (a = c.name)
  9944. } catch (c) {
  9945. console.error("Failed to get user info, ", c)
  9946. }
  9947. let t;
  9948. if (this._isFileTransfer) {
  9949. let c = this.getOption("remote_dir"), p = this.getOption("remote_show_hidden") === "Y";
  9950. t = Fu.fromPartial({dir: c, show_hidden: p})
  9951. }
  9952. let s;
  9953. this._isViewCamera && (s = _u.fromPartial({}));
  9954. const E = this._getHwid(), l = J.fromPartial({
  9955. username: this.getId(),
  9956. my_id: i,
  9957. my_name: a,
  9958. session_id: this._sessionId,
  9959. password: e.password,
  9960. option: this.getOptionMessage(),
  9961. video_ack_required: !0,
  9962. os_login: e.os_login,
  9963. version: c4,
  9964. my_platform: vn,
  9965. file_transfer: t,
  9966. view_camera: s,
  9967. hwid: E
  9968. });
  9969. (d = this._ws) == null || d.sendMessage({login_request: l})
  9970. }
  9971. getOptionMessage() {
  9972. if (this._isFileTransfer) return;
  9973. let e = 0;
  9974. const i = R.fromPartial({}), n = this.getImageQuality(), a = this.getImageQualityEnum(n, !0), t = y.Yes;
  9975. if (a != null) i.image_quality = a, e += 1; else if (n === "custom") {
  9976. let E = 50, l = this.getOption("custom_image_quality");
  9977. if (l) try {
  9978. E = parseInt(l)
  9979. } catch {
  9980. }
  9981. i.custom_image_quality = E << 8, e += 1;
  9982. let d = this.getOption("custom-fps");
  9983. if (d) try {
  9984. i.custom_fps = parseInt(d), this._lastSendFps = i.custom_fps, e += 1
  9985. } catch {
  9986. }
  9987. }
  9988. const s = this.getOption("view-only");
  9989. return s && (i.disable_keyboard = t), (s || this._options["show-remote-cursor"]) && (i.show_remote_cursor = t, e += 1), this._options["follow-remote-cursor"] && (i.follow_remote_cursor = t, e += 1), this._options["follow-remote-window"] && (i.follow_remote_window = t, e += 1), !s && this._options["lock-after-session-end"] && (i.lock_after_session_end = t, e += 1), this._options["disable-audio"] && (i.disable_audio = t, e += 1), (s || this._options["disable-clipboard"]) && (i.disable_clipboard = t, e += 1), i.supported_decoding = this.getSupportedDecoding(), e += 1, e > 0 ? i : void 0
  9990. }
  9991. sendVideoReceived() {
  9992. var i;
  9993. const e = f.fromPartial({video_received: !0});
  9994. (i = this._ws) == null || i.sendMessage({misc: e})
  9995. }
  9996. getCodecFormat(e) {
  9997. return e.vp9s ? "VP9" : e.vp8s ? "VP8" : e.av1s ? "AV1" : e.h264s ? "H264" : e.h265s ? "H265" : "Unknown"
  9998. }
  9999. getSupportedEncoding() {
  10000. return this._supportedEncoding
  10001. }
  10002. getSupportedDecoding() {
  10003. let e = this.getOption("codec-preference");
  10004. e == "vp8" ? e = mu.VP8 : e == "vp9" ? e = mu.VP9 : e == "av1" ? e = mu.AV1 : e == "h264" ? e = mu.H264 : e == "h265" ? e = mu.H265 : e = mu.Auto;
  10005. let i = this.getOption("i444") == "Y" ? l4.I444 : l4.I420;
  10006. return qu.fromPartial({
  10007. ability_vp8: 1,
  10008. ability_vp9: 1,
  10009. ability_av1: 1,
  10010. ability_h264: 1,
  10011. ability_h265: 1,
  10012. prefer: e,
  10013. prefer_chroma: i,
  10014. i444: G.fromPartial({vp9: !0, av1: !0})
  10015. })
  10016. }
  10017. getAlternativeCodecs() {
  10018. const e = this.getSupportedEncoding(), i = this.getSupportedDecoding();
  10019. return JSON.stringify({
  10020. vp8: e.vp8 && i.ability_vp8 == 1,
  10021. av1: e.av1 && i.ability_av1 == 1,
  10022. h264: e.h264 && i.ability_h264 == 1,
  10023. h265: e.h265 && i.ability_h265 == 1
  10024. })
  10025. }
  10026. fpsCalculate(e, i) {
  10027. if (e) {
  10028. this._fpsCalc.skipBegining = 0, this._fpsCalc.videoTestSpeed = [0, 0];
  10029. return
  10030. }
  10031. if (this._fpsCalc.skipBegining < 3) {
  10032. this._fpsCalc.skipBegining += 1;
  10033. return
  10034. }
  10035. this._fpsCalc.videoTestSpeed[1] += i, this._fpsCalc.videoTestSpeed[0] += 1, this._fpsCalc.videoTestSpeed[0] % 10 == 0 && i > 0 && (this._fpsCalc.fps = Math.floor(this._fpsCalc.videoTestSpeed[0] * 1e3 / this._fpsCalc.videoTestSpeed[1]), console.log("max decode fps: " + this._fpsCalc.fps)), this._fpsCalc.videoTestSpeed[0] >= 30 && (this._fpsCalc.videoTestSpeed = [0, 0])
  10036. }
  10037. handleVideoFrame(e) {
  10038. if (!this._firstFrame) {
  10039. this.msgbox("", "", ""), this._firstFrame = !0, this.sendToggleVirtualDisplayMsg(), this.sendTogglePrivacyModeMsg(), m4();
  10040. const i = 0;
  10041. for (let n = 0; n < i; n++) this.sendVideoReceived();
  10042. console.log(`send ${i} video received in advance for high fps`)
  10043. }
  10044. this._videoQueue.push(e), this._decodingVideo || this.processVideoQueue()
  10045. }
  10046. async processVideoQueue() {
  10047. this._decodingVideo = !0;
  10048. try {
  10049. for (; this._videoQueue.length > 0;) await this.handleOneVideoFrame(this._videoQueue.shift())
  10050. } catch (e) {
  10051. console.error("deal video queue failed", e)
  10052. }
  10053. this._decodingVideo = !1
  10054. }
  10055. async handleOneVideoFrame(e) {
  10056. const i = this.getCodecFormat(e), n = this._videoFormat != i;
  10057. n && (this._videoFormat = i, A("update_quality_status", {codec_format: i}));
  10058. var a = new Date().getTime(), t = 0, s = void 0;
  10059. if (e.vp8s) t = 0, s = e.vp8s; else if (e.vp9s) t = 1, s = e.vp9s; else if (e.av1s) t = 2, s = e.av1s; else if (e.h264s) t = 3, s = e.h264s; else if (e.h265s) t = 4, s = e.h265s; else {
  10060. console.log("unknown codec");
  10061. return
  10062. }
  10063. const E = s == null ? void 0 : s.frames.length;
  10064. this._frameCount[e.display] = (this._frameCount[e.display] || 0) + E, this.sendVideoReceived();
  10065. try {
  10066. for (let l = 0; l < E; l++) {
  10067. let d = s.frames[l];
  10068. const c = await Ya(t, d.data.slice(0).buffer);
  10069. if (c.data && E - 1 == l) {
  10070. this.draw(e.display, c.data);
  10071. const p = new Date().getTime();
  10072. this.fpsCalculate(n, p - a);
  10073. const B = c.data.yuvFormat == 5;
  10074. this._i444 != B && (this._i444 = B, A("update_quality_status", {chroma: B ? "4:4:4" : "4:2:0"}))
  10075. }
  10076. }
  10077. } catch (l) {
  10078. console.error("decode error: ", l)
  10079. }
  10080. }
  10081. sendToggleVirtualDisplayMsg() {
  10082. if (!this.isSupportVirtualDisplay()) return;
  10083. const e = this.getOption("virtual-display");
  10084. !e || e.split(",").forEach(i => {
  10085. const n = Number(i);
  10086. isNaN(n) || this._sendToggleVirtualDisplayMsg(n, !0)
  10087. })
  10088. }
  10089. sendTogglePrivacyModeMsg() {
  10090. if (!!this._peerInfo && !(L(this._peerInfo.version) < L("1.2.4")) && this.getOption("privacy-mode")) {
  10091. const e = this.getOption("privacy-mode-impl-key");
  10092. if (e == "privacy_mode_impl_virtual_display" && this.isSupportVirtualDisplay()) return;
  10093. this._sendTogglePrivacyModeMsg(e, !0)
  10094. }
  10095. }
  10096. handlePeerInfo(e) {
  10097. var a, t, s;
  10098. if (this._peerInfo = e, this._isViewCamera && !this.isSupportViewCamera()) {
  10099. L(e.version) < L("1.3.9") && (e.platform == "Windows" || e.platform == "Linux") ? this.msgbox("error", "Download new version", "upgrade_remote_rustdesk_client_to_{1.3.9}_tip") : this.msgbox("error", "Error", "view_camera_unsupported_tip"), this.lcHandlePeerInfo(e), this.close();
  10100. return
  10101. }
  10102. if (e.current_display > e.displays.length && (e.current_display = 0), L(e.version) < L("1.1.10") && this.setPermission("restart", !1), this._isFileTransfer) {
  10103. if (!e.username.length && !((a = e.windows_sessions) != null && a.sessions.length)) {
  10104. this.msgbox("error", "Error", "No active console user logged on, please connect and logon first.");
  10105. return
  10106. }
  10107. } else if (e.displays.length == 0) {
  10108. this.lcHandlePeerInfo(e), A("update_privacy_mode", {}), this.msgbox("error", "Remote Error", "No Display");
  10109. return
  10110. }
  10111. A("peer_info", {
  10112. ...e,
  10113. displays: this.makeDisplaysMsg(e.displays),
  10114. resolutions: JSON.stringify(e.resolutions)
  10115. }), this._isFileTransfer || (this.msgbox("success", "Successful", "Connected, waiting for image..."), this.tryChangeInitResolution(e.current_display));
  10116. const i = this.shouldAutoLogin();
  10117. i && this.inputOsPassword(i);
  10118. const n = (t = this.getOption("info")) == null ? void 0 : t.username;
  10119. n && !e.username && (e.username = n), A("update_privacy_mode", {}), this.lcHandlePeerInfo(e), (s = e.windows_sessions) != null && s.sessions.length && (this._selectedWindowsSessionId == e.windows_sessions.current_sid ? this.sendSelectedSessionId(e.windows_sessions.current_sid.toString()) : this.setMultipleWindowsSession(e.windows_sessions.sessions))
  10120. }
  10121. lcHandlePeerInfo(e) {
  10122. var E;
  10123. let i = C4(this._id) || {};
  10124. i.info = {username: e.username, hostname: e.hostname, platform: e.platform};
  10125. let n = this._password, a = i.password, t = this.getRemember(), s = this._hash;
  10126. t ? n && n.length > 0 && Q(n) !== a && !mt(this._passwordSource, n, s) && (i.password = Q(n), console.log("remember password of " + this._id)) : n && n.length > 0 && Ft(this._passwordSource, n) ? (i.password = Q(n), console.log("save ab password of " + this._id + " to recent")) : a && (i.password = void 0, console.log("remove password of " + this._id)), (E = this._otherServer) != null && E.server && this._otherServer.server != r4 && this.setOption("other-server-key", this._otherServer.key), i.password && n && n.length > 0 && !mt(this._passwordSource, n, s) && !Ft(this._passwordSource, n) && A("sync_peer_hash_password_to_personal_ab", {
  10127. id: this._id,
  10128. hash: Q(n)
  10129. }), this.saveConfig(i), e.encoding && (this._supportedEncoding = e.encoding)
  10130. }
  10131. setPermission(e, i) {
  10132. A("permission", {[e]: i})
  10133. }
  10134. shouldAutoLogin() {
  10135. const e = this.getOption("lock-after-session-end"), i = !!this.getOption("auto-login"),
  10136. n = this.getOption("os-password");
  10137. return n && e && i ? n : ""
  10138. }
  10139. handleMisc(e) {
  10140. if (e.audio_format) kr(e.audio_format.channels, e.audio_format.sample_rate); else if (e.chat_message) A("chat_client_mode", {text: e.chat_message.text}); else if (e.permission_info) {
  10141. const i = e.permission_info;
  10142. console.info("Change permission " + i.permission + " -> " + i.enabled);
  10143. let n;
  10144. switch (i.permission) {
  10145. case a0.Keyboard:
  10146. this._serverPerms.keyboardEnabled = i.enabled, n = "keyboard";
  10147. break;
  10148. case a0.Clipboard:
  10149. this._serverPerms.clipboardEnabled = i.enabled, n = "clipboard";
  10150. break;
  10151. case a0.Audio:
  10152. n = "audio";
  10153. break;
  10154. case a0.Restart:
  10155. n = "restart";
  10156. break;
  10157. case a0.BlockInput:
  10158. n = "block_input";
  10159. break;
  10160. default:
  10161. return !0
  10162. }
  10163. this.setPermission(n, i.enabled)
  10164. } else if (e.switch_display) A("switch_display", e.switch_display), this.setCustomResolution(e.switch_display); else {
  10165. if (e.close_reason) return this.msgbox("error", "Connection Error", e.close_reason), this.close(), !1;
  10166. if (e.back_notification) {
  10167. if (!this.handleBackNotification(e.back_notification)) return this.close(), !1
  10168. } else e.uac !== void 0 ? e.uac && this._serverPerms.keyboardEnabled ? this.msgbox("on-uac", "Prompt", "Please wait for confirmation of UAC...", "") : (this.cancelMsgbox("on-uac"), this.cancelMsgbox("wait-uac"), this.cancelMsgbox("elevation-error")) : e.foreground_window_elevated !== void 0 ? e.foreground_window_elevated && this._serverPerms.keyboardEnabled ? this.msgbox("on-foreground-elevated", "Prompt", "elevated_foreground_window_tip", "") : (this.cancelMsgbox("on-foreground-elevated"), this.cancelMsgbox("wait-uac"), this.cancelMsgbox("elevation-error")) : e.elevation_response !== void 0 ? e.elevation_response === "" ? this.msgbox("wait-uac", "", "", "") : (this.cancelMsgbox("wait-uac"), this.msgbox("elevation-error", "Elevation Error", e.elevation_response, "")) : e.portable_service_running !== void 0 ? (this.portableServiceRunning(e.portable_service_running), this._elevationRequested && e.portable_service_running && this.msgbox("custom-nocancel-success", "Successful", "Elevate successfully", "")) : e.supported_encoding ? this._supportedEncoding = e.supported_encoding : e.follow_current_display !== void 0 && this.handleFollowCurrentDisplay(e.follow_current_display)
  10169. }
  10170. return !0
  10171. }
  10172. portableServiceRunning(e) {
  10173. A("portable_service_running", {running: e.toString()})
  10174. }
  10175. handleFollowCurrentDisplay(e) {
  10176. A("follow_current_display", {display_idx: e.toString()})
  10177. }
  10178. handleBackNotification(e) {
  10179. if (e.block_input_state) this.handleBackMsgBlockInput(e.block_input_state, e.details); else if (e.privacy_mode_state) return this.handleBackMsgPrivacyMode(e.privacy_mode_state, e.details, e.impl_key);
  10180. return !0
  10181. }
  10182. updateBlockInputState(e) {
  10183. A("update_block_input_state", {input_state: e ? "on" : "off"})
  10184. }
  10185. handleBackMsgBlockInput(e, i) {
  10186. switch (e) {
  10187. case ge.BlkOnSucceeded:
  10188. this.updateBlockInputState(!0);
  10189. break;
  10190. case ge.BlkOnFailed:
  10191. this.msgbox("custom-error", "Block user input", i == "" ? "Failed" : i, ""), this.updateBlockInputState(!1);
  10192. break;
  10193. case ge.BlkOffSucceeded:
  10194. this.updateBlockInputState(!1);
  10195. break;
  10196. case ge.BlkOffFailed:
  10197. this.msgbox("custom-error", "Unblock user input", i == "" ? "Failed" : i, "");
  10198. break
  10199. }
  10200. }
  10201. updatePrivacyMode(e, i) {
  10202. i && (e == "" && (e = "privacy_mode_impl_mag"), this.setOption("privacy-mode-impl-key", e)), this.setOption("privacy-mode", i), A("update_privacy_mode", {})
  10203. }
  10204. handleBackMsgPrivacyMode(e, i, n) {
  10205. switch (e) {
  10206. case nu.PrvOnByOther:
  10207. return this.msgbox("error", "Connecting...", "Someone turns on privacy mode, exit", ""), !1;
  10208. case nu.PrvNotSupported:
  10209. this.msgbox("custom-error", "Privacy mode", "Unsupported", ""), this.updatePrivacyMode(n, !1);
  10210. break;
  10211. case nu.PrvOnSucceeded:
  10212. this.msgbox("custom-nocancel", "Privacy mode", "Enter privacy mode", ""), this.updatePrivacyMode(n, !0);
  10213. break;
  10214. case nu.PrvOnFailedDenied:
  10215. this.msgbox("custom-error", "Privacy mode", "Peer denied", ""), this.updatePrivacyMode(n, !1);
  10216. break;
  10217. case nu.PrvOnFailedPlugin:
  10218. this.msgbox("custom-error", "Privacy mode", "Please install plugins", ""), this.updatePrivacyMode(n, !1);
  10219. break;
  10220. case nu.PrvOnFailed:
  10221. this.msgbox("custom-error", "Privacy mode", i == "" ? "Failed" : i, ""), this.updatePrivacyMode(n, !1);
  10222. break;
  10223. case nu.PrvOffSucceeded:
  10224. this.msgbox("custom-nocancel", "Privacy mode", "Exit privacy mode", ""), this.updatePrivacyMode(n, !1);
  10225. break;
  10226. case nu.PrvOffFailed:
  10227. this.msgbox("custom-error", "Privacy mode", i == "" ? "Failed to turn off" : i, "");
  10228. break;
  10229. case nu.PrvOffUnknown:
  10230. this.msgbox("custom-error", "Privacy mode", "Turned off", ""), this.updatePrivacyMode(n, !1);
  10231. break
  10232. }
  10233. return !0
  10234. }
  10235. getRemember() {
  10236. return this._options.remember || !1
  10237. }
  10238. setRemember(e) {
  10239. this.setOption("remember", e)
  10240. }
  10241. getOption(e) {
  10242. var i;
  10243. return (i = this._options[e]) != null ? i : e0(e)
  10244. }
  10245. getUserDefaultToggleOptions() {
  10246. const e = {}, i = {
  10247. "show-remote-cursor": "show_remote_cursor",
  10248. "lock-after-session-end": "lock_after_session_end",
  10249. "privacy-mode": "privacy_mode",
  10250. "enable-file-copy-paste": "enable-file-copy-paste",
  10251. "disable-audio": "disable_audio",
  10252. "disable-clipboard": "disable_clipboard",
  10253. "show-quality-monitor": "show_quality_monitor",
  10254. allow_swap_key: "allow_swap_key",
  10255. "view-only": "view_only",
  10256. "follow-remote-cursor": "follow_remote_cursor",
  10257. "follow-remote-window": "follow_remote_window"
  10258. };
  10259. for (const [a, t] of Object.entries(i)) e[a] = e0(t) == "Y";
  10260. const n = ["codec-preference", "custom-fps", "zoom-cursor", "touch-mode", "i444", "swap-left-right-mouse", "collapse_toolbar"];
  10261. for (const a of n) e[a] = e0(a);
  10262. return e
  10263. }
  10264. getToggleOption(e) {
  10265. const i = ["show-remote-cursor", "privacy-mode", "enable-file-copy-paste"], n = this._options[e];
  10266. return typeof n == "string" ? n != "" : n != null ? n : !!i.includes(e)
  10267. }
  10268. getStatus() {
  10269. return JSON.stringify({status_num: 10})
  10270. }
  10271. checkConnStatus() {
  10272. }
  10273. saveConfig(e) {
  10274. this._options = e, this._options.tm = new Date().getTime(), Tn(this._id, e)
  10275. }
  10276. loadConfig() {
  10277. return C4(this._id) || {}
  10278. }
  10279. setOption(e, i) {
  10280. i == null ? delete this._options[e] : this._options[e] = i, this._options.tm = new Date().getTime(), jt(this._id, e, i)
  10281. }
  10282. setFlutterUiOption(e, i) {
  10283. this.setOption(`flutter_ui:${e}`, i)
  10284. }
  10285. getFlutterUiOption(e) {
  10286. return this.getOption(`flutter_ui:${e}`)
  10287. }
  10288. inputKey(e, i, n, a, t, s, E) {
  10289. var d;
  10290. const l = Qn(e, Cr());
  10291. !l || (a && (e == "VK_MENU" || e == "RAlt") && (a = !1), t && (e == "VK_CONTROL" || e == "RControl") && (t = !1), s && (e == "VK_SHIFT" || e == "RShift") && (s = !1), E && (e == "Meta" || e == "RWin") && (E = !1), l.down = i, l.press = n, l.modifiers = this.getMod(a, t, s, E), (d = this._ws) == null || d.sendMessage({key_event: l}))
  10292. }
  10293. ctrlAltDel() {
  10294. var i, n;
  10295. const e = S.fromPartial({down: !0});
  10296. ((i = this._peerInfo) == null ? void 0 : i.platform) == "Windows" ? e.control_key = j.CtrlAltDel : (e.control_key = j.Delete, e.modifiers = this.getMod(!0, !0, !1, !1)), (n = this._ws) == null || n.sendMessage({key_event: e})
  10297. }
  10298. restart() {
  10299. var i;
  10300. this._restartingRemoteDevice = !0;
  10301. const e = f.fromPartial({});
  10302. e.restart_remote_device = !0, (i = this._ws) == null || i.sendMessage({misc: e})
  10303. }
  10304. inputString(e) {
  10305. var n;
  10306. const i = S.fromPartial({seq: e});
  10307. (n = this._ws) == null || n.sendMessage({key_event: i})
  10308. }
  10309. send2fa(e) {
  10310. var i;
  10311. try {
  10312. const n = JSON.parse(e), a = n.code, t = n.trust_this_device;
  10313. t && this.setOption(Ie, "Y");
  10314. const s = this._getHwid(t), E = vu.fromPartial({code: a, hwid: s});
  10315. (i = this._ws) == null || i.sendMessage({auth_2fa: E})
  10316. } catch {
  10317. console.log('Failed to switch display, invalid param "' + e + '"')
  10318. }
  10319. }
  10320. _captureDisplays({add: e, sub: i, set: n}) {
  10321. var s;
  10322. const a = Lu.fromPartial({add: e, sub: i, set: n}), t = f.fromPartial({capture_displays: a});
  10323. (s = this._ws) == null || s.sendMessage({misc: t})
  10324. }
  10325. switchDisplay(e) {
  10326. var i;
  10327. try {
  10328. const n = JSON.parse(e), a = n.value, t = n.isDesktop;
  10329. if (a.length == 1) {
  10330. let s = this.getCustomResolution(a[0]);
  10331. const E = Mu.fromPartial({display: a[0], width: s ? s[0] : void 0, height: s ? s[1] : void 0}),
  10332. l = f.fromPartial({switch_display: E});
  10333. (i = this._ws) == null || i.sendMessage({misc: l}), t || this._captureDisplays({set: a})
  10334. } else this._captureDisplays({set: a})
  10335. } catch {
  10336. console.log('Failed to switch display, invalid param "' + e + '"')
  10337. }
  10338. }
  10339. elevateDirect() {
  10340. var n;
  10341. const e = pu.fromPartial({direct: !0}), i = f.fromPartial({elevation_request: e});
  10342. (n = this._ws) == null || n.sendMessage({misc: i}), this._elevationRequested = !0
  10343. }
  10344. elevateWithLogon(e) {
  10345. var i;
  10346. try {
  10347. const n = JSON.parse(e), a = Ku.fromPartial({username: n.username, password: n.password}),
  10348. t = pu.fromPartial({logon: a}), s = f.fromPartial({elevation_request: t});
  10349. (i = this._ws) == null || i.sendMessage({misc: s}), this._elevationRequested = !0
  10350. } catch {
  10351. console.log('Failed to elevate with logon, invalid param "' + e + '"')
  10352. }
  10353. }
  10354. async inputOsPassword(e) {
  10355. var a, t;
  10356. this.inputMouse(), await s4(50), this.inputMouse(0, 3, 3), await s4(50), this.inputMouse(1 | 1 << 3), this.inputMouse(2 | 1 << 3), await s4(1200);
  10357. const i = S.fromPartial({press: !0, seq: e});
  10358. (a = this._ws) == null || a.sendMessage({key_event: i});
  10359. const n = S.fromPartial({press: !0, control_key: j.Return});
  10360. (t = this._ws) == null || t.sendMessage({key_event: n})
  10361. }
  10362. lockScreen() {
  10363. var i;
  10364. const e = S.fromPartial({down: !0, control_key: j.LockScreen});
  10365. (i = this._ws) == null || i.sendMessage({key_event: e})
  10366. }
  10367. isSwapControlCommand() {
  10368. return this.getToggleOption("allow_swap_key")
  10369. }
  10370. getMod(e, i, n, a) {
  10371. const t = [];
  10372. return e && t.push(j.Alt), i && (this.isSwapControlCommand() ? t.push(j.Meta) : t.push(j.Control)), n && t.push(j.Shift), a && (this.isSwapControlCommand() ? t.push(j.Control) : t.push(j.Meta)), t
  10373. }
  10374. inputMouse(e = 0, i = 0, n = 0, a = !1, t = !1, s = !1, E = !1) {
  10375. var d;
  10376. const l = ku.fromPartial({mask: e, x: i, y: n, modifiers: this.getMod(a, t, s, E)});
  10377. (d = this._ws) == null || d.sendMessage({mouse_event: l})
  10378. }
  10379. toggleOption(e) {
  10380. var s;
  10381. const i = !this._options[e], n = R.fromPartial({}), a = i ? y.Yes : y.No;
  10382. switch (e) {
  10383. case"show-remote-cursor":
  10384. n.show_remote_cursor = a;
  10385. break;
  10386. case"follow-remote-cursor":
  10387. n.follow_remote_cursor = a;
  10388. break;
  10389. case"follow-remote-window":
  10390. n.follow_remote_window = a;
  10391. break;
  10392. case"disable-audio":
  10393. n.disable_audio = a;
  10394. break;
  10395. case"disable-clipboard":
  10396. n.disable_clipboard = a;
  10397. break;
  10398. case"lock-after-session-end":
  10399. n.lock_after_session_end = a;
  10400. break;
  10401. case"privacy-mode":
  10402. n.privacy_mode = a;
  10403. break;
  10404. case"enable-file-copy-paste":
  10405. n.enable_file_transfer = a;
  10406. break;
  10407. case"block-input":
  10408. n.block_input = y.Yes;
  10409. break;
  10410. case"unblock-input":
  10411. n.block_input = y.No;
  10412. break;
  10413. case"show-quality-monitor":
  10414. case"allow_swap_key":
  10415. break;
  10416. case"view-only":
  10417. i ? (n.disable_keyboard = y.Yes, n.disable_clipboard = y.Yes, n.show_remote_cursor = y.Yes, n.enable_file_transfer = y.No, n.lock_after_session_end = y.No) : (n.disable_keyboard = y.No, n.disable_clipboard = this.getToggleOption("disable-clipboard") ? y.Yes : y.No, n.show_remote_cursor = this.getToggleOption("show-remote-cursor") ? y.Yes : y.No, n.enable_file_transfer = this.getToggleOption("enable-file-copy-paste") ? y.Yes : y.No, n.lock_after_session_end = this.getToggleOption("lock-after-session-end") ? y.Yes : y.No);
  10418. break;
  10419. default:
  10420. this.setOption(e, this._options[e] ? void 0 : "Y");
  10421. return
  10422. }
  10423. e.indexOf("block-input") < 0 && this.setOption(e, i);
  10424. const t = f.fromPartial({option: n});
  10425. (s = this._ws) == null || s.sendMessage({misc: t})
  10426. }
  10427. toggleVirtualDisplay(e) {
  10428. try {
  10429. const i = JSON.parse(e);
  10430. this._sendToggleVirtualDisplayMsg(i.index, i.on), this.updateVirtualDisplay(i.index, i.on)
  10431. } catch {
  10432. console.log('Failed to toggle virtual display, invalid param "' + e + '"')
  10433. }
  10434. }
  10435. togglePrivacyMode(e) {
  10436. try {
  10437. const i = JSON.parse(e);
  10438. this._sendTogglePrivacyModeMsg(i.impl_key, i.on)
  10439. } catch {
  10440. console.log('Failed to toggle privacy mode, invalid param "' + e + '"')
  10441. }
  10442. }
  10443. _sendToggleVirtualDisplayMsg(e, i) {
  10444. var t;
  10445. const n = Wu.fromPartial({display: e, on: i}), a = f.fromPartial({toggle_virtual_display: n});
  10446. (t = this._ws) == null || t.sendMessage({misc: a})
  10447. }
  10448. _sendTogglePrivacyModeMsg(e, i) {
  10449. var t;
  10450. const n = Vu.fromPartial({impl_key: e, on: i}), a = f.fromPartial({toggle_privacy_mode: n});
  10451. (t = this._ws) == null || t.sendMessage({misc: a})
  10452. }
  10453. updateVirtualDisplay(e, i) {
  10454. const n = "virtual-display", a = this.getOption(n);
  10455. if (i) {
  10456. const t = a.split(","), s = t.length;
  10457. e == 0 ? t.splice(0, t.length) : t.indexOf(e.toString()) < 0 && t.push(e.toString()), t.length != s && this.setOption(n, t.join(","))
  10458. } else if (e == -1) a != "" && this.setOption(n, ""); else {
  10459. const t = a.split(","), s = t.length;
  10460. if (e == 0) t.pop(); else {
  10461. const E = t.indexOf(e.toString());
  10462. E >= 0 && t.splice(E, 1)
  10463. }
  10464. t.length != s && this.setOption(n, t.join(","))
  10465. }
  10466. }
  10467. getImageQuality() {
  10468. return this.getOption("image_quality")
  10469. }
  10470. getImageQualityEnum(e, i) {
  10471. switch (e) {
  10472. case"low":
  10473. return Te.Low;
  10474. case"best":
  10475. return Te.Best;
  10476. case"balanced":
  10477. return i ? void 0 : Te.Balanced;
  10478. default:
  10479. return
  10480. }
  10481. }
  10482. setImageQuality(e) {
  10483. var t;
  10484. this.setOption("image_quality", e);
  10485. const i = this.getImageQualityEnum(e, !1);
  10486. if (i == null) return;
  10487. const n = R.fromPartial({image_quality: i}), a = f.fromPartial({option: n});
  10488. (t = this._ws) == null || t.sendMessage({misc: a}), this._lastSendFps != 30 && this.setCustomFps(30, !1)
  10489. }
  10490. setCustomImageQuality(e) {
  10491. var t;
  10492. const i = e << 8, n = R.fromPartial({custom_image_quality: i}), a = f.fromPartial({option: n});
  10493. (t = this._ws) == null || t.sendMessage({misc: a}), this.setOption("custom_image_quality", e.toString()), this.setOption("image_quality", "custom")
  10494. }
  10495. setCustomFps(e, i) {
  10496. var s;
  10497. const n = e, a = R.fromPartial({custom_fps: n}), t = f.fromPartial({option: a});
  10498. (s = this._ws) == null || s.sendMessage({misc: t}), this._lastSendFps = n, i && this.setOption("custom-fps", e.toString())
  10499. }
  10500. sendNote(e, i) {
  10501. let n = i;
  10502. fetch(e, {
  10503. method: "POST",
  10504. headers: {"Content-Type": "application/json"},
  10505. body: JSON.stringify({id: this._id, session_id: this._sessionId, note: n})
  10506. }).then(a => {
  10507. if (!a.ok) throw new Error(a.statusText);
  10508. return a.text()
  10509. }).then(a => {
  10510. console.log("Send note response:", a)
  10511. }).catch(a => {
  10512. console.error("Failed to send note:", a)
  10513. })
  10514. }
  10515. getPlatform() {
  10516. var e;
  10517. return ((e = this._peerInfo) == null ? void 0 : e.platform) || ""
  10518. }
  10519. async handleFileResponse(e) {
  10520. var i, n;
  10521. if (e.dir) {
  10522. let a = e.dir, t = a.entries;
  10523. if (!he() && this.getPeerPlatform() == "Windows") for (let s = 0; s < t.length; s++) t[s].name = t[s].name.replace(/\\/g, "/");
  10524. pt(a.id, t, a.path, !1, !1), this._writeJobs.forEach(s => {
  10525. s.id == a.id && (s.files = t)
  10526. }), this._removeJobs[a.id] && (this._removeJobs[a.id].files = t)
  10527. } else if (e.empty_dirs != null) {
  10528. const a = e.empty_dirs;
  10529. for (let t = 0; t < this._readRemoteEmptyDirsJobs.length; t++) this._readRemoteEmptyDirsJobs[t].path == a.path && (this._readRemoteEmptyDirsJobs[t].empty_dirs = a.empty_dirs.map(s => s.path))
  10530. } else if (e.block) {
  10531. const a = e.block, t = this._writeJobs.find(s => s.id == a.id);
  10532. if (t) try {
  10533. await t.write(a, () => {
  10534. console.log(`cancel job ${t.id} due to write failed`), this.cancelJob(t.id)
  10535. })
  10536. } catch (s) {
  10537. console.log("write file failed", s)
  10538. }
  10539. this.update_jobs_status()
  10540. } else if (e.digest) {
  10541. const a = e.digest;
  10542. if (a.is_upload) {
  10543. const t = this._readJobs.find(s => s.id == a.id);
  10544. if (t) {
  10545. const s = t.read_digest(a);
  10546. s && ((i = this._ws) == null || i.sendMessage(s))
  10547. }
  10548. } else {
  10549. const t = this._writeJobs.find(s => s.id == a.id);
  10550. if (t) {
  10551. const s = t.write_digest(a);
  10552. s && ((n = this._ws) == null || n.sendMessage(s))
  10553. }
  10554. }
  10555. } else if (e.done) {
  10556. const a = e.done, t = this._writeJobs.find(E => E.id == a.id);
  10557. let s;
  10558. t && (t.write_done(a, () => this._readRemoteEmptyDirsJobs.find(E => E.id == a.id), () => this.removeReadRemoteEmptryDirJob(a.id)), s = t.job_error(), this._writeJobs = this._writeJobs.filter(E => E.id != a.id)), this.handle_job_status(a.id, a.file_num, s)
  10559. } else if (e.error) {
  10560. const a = e.error;
  10561. this._writeJobs = this._writeJobs.filter(t => t.id != a.id), this.removeReadRemoteEmptryDirJob(a.id), this.handle_job_status(a.id, a.file_num, a.error)
  10562. }
  10563. }
  10564. removeReadRemoteEmptryDirJob(e) {
  10565. this._readRemoteEmptyDirsJobs = this._readRemoteEmptyDirsJobs.filter(i => i.id != e)
  10566. }
  10567. readRemoteDir(e) {
  10568. var i;
  10569. try {
  10570. const n = JSON.parse(e),
  10571. a = I.fromPartial({read_dir: fu.fromPartial({path: n.path, include_hidden: n.include_hidden})});
  10572. (i = this._ws) == null || i.sendMessage({file_action: a})
  10573. } catch (n) {
  10574. console.error("Failed to read remote dir:", n)
  10575. }
  10576. }
  10577. async sendFiles(e) {
  10578. var i;
  10579. try {
  10580. const n = JSON.parse(e), {
  10581. id: a,
  10582. path: t,
  10583. to: s,
  10584. file_num: E,
  10585. include_hidden: l,
  10586. is_remote: d,
  10587. is_dir: c
  10588. } = n, p = this.enableOverwriteDetection();
  10589. if (d) {
  10590. this._writeJobs.push(Eu.newWrite(a, t, s, E, l, d, [], p, c));
  10591. const B = zo(a, t, E, l);
  10592. (i = this._ws) == null || i.sendMessage({file_action: B}), c && this.enableEmptyDirs() && (this._readRemoteEmptyDirsJobs.find(F => F.id == a) == null && this._readRemoteEmptyDirsJobs.push(new So({
  10593. id: a,
  10594. path: t
  10595. })), this.sendMessage({file_action: Mo(t, l)}))
  10596. }
  10597. } catch (n) {
  10598. console.error("Failed to send files:", n)
  10599. }
  10600. }
  10601. async sendLocalFiles(e) {
  10602. try {
  10603. const i = JSON.parse(e), {
  10604. handle_index: n,
  10605. id: a,
  10606. path: t,
  10607. to: s,
  10608. file_num: E,
  10609. include_hidden: l,
  10610. is_remote: d
  10611. } = i, c = this.enableOverwriteDetection();
  10612. if (!d) try {
  10613. let p = this._fileHandles[n];
  10614. if (!p) throw new Error("Failed to get file handle");
  10615. let B = [], F = [];
  10616. if (p instanceof FileSystemFileHandle) {
  10617. let k = await p.getFile();
  10618. B = [V.fromPartial({
  10619. size: k.size,
  10620. entry_type: 4,
  10621. modified_time: Math.floor(k.lastModified / 1e3)
  10622. })], F = [p]
  10623. } else {
  10624. let k = await ua(p, "");
  10625. B = k.map(M => M.entry), F = k.map(M => M.handle)
  10626. }
  10627. let b = Eu.newRead(a, t, s, E, l, d, B, c, F);
  10628. pt(a, B, t, !d, !0), this._readJobs.push(b), this._ftTimer || (this._ftTimer = setTimeout(this.readJobTimerCallback.bind(this), At));
  10629. let x = [...B];
  10630. if (he() && this.getPeerPlatform() != "Windows") for (let k = 0; k < x.length; k++) x[k].name = x[k].name.replace(/\\/g, "/");
  10631. if (this.sendMessage({file_action: No(a, s, E, x, b.total_size)}), this.enableEmptyDirs()) {
  10632. const k = await ea(p, p.name);
  10633. k.length > 0 && A("send_emptry_dirs", {dirs: k})
  10634. }
  10635. } catch (p) {
  10636. console.error("Failed to send files:", p), this.handle_job_status(a, -1, (p != null ? p : "Failed to send files").toString())
  10637. }
  10638. } catch (i) {
  10639. console.error("Failed to send files:", i)
  10640. }
  10641. }
  10642. async readJobTimerCallback() {
  10643. let e = await Ko(this._readJobs, this.sendMessage.bind(this));
  10644. this._readJobs = this._readJobs.filter(i => !e.includes(i.id)), this.update_jobs_status(), this._readJobs.length == 0 ? (clearTimeout(this._ftTimer), this._ftTimer = void 0) : this._ftTimer = setTimeout(this.readJobTimerCallback.bind(this), At)
  10645. }
  10646. update_jobs_status() {
  10647. const e = new Date().getTime() - this._last_update_jobs_ms;
  10648. e >= 1e3 && (this._readJobs.forEach(i => {
  10649. i.update_job_status(e)
  10650. }), this._writeJobs.forEach(i => {
  10651. i.update_job_status(e)
  10652. }), this._last_update_jobs_ms = new Date().getTime())
  10653. }
  10654. handle_job_status(e, i, n) {
  10655. var a;
  10656. if (this._removeJobs[e] && this._removeJobs[e].no_confirm) {
  10657. const t = this._removeJobs[e].files;
  10658. if (i + 1 < t.length) {
  10659. const s = this._removeJobs[e].path + this._removeJobs[e].sep + t[i + 1].name;
  10660. if ((a = this._ws) == null || a.sendMessage({file_action: ct(e, s, i + 1, this._removeJobs[e].is_remote)}), new Date().getTime() - this._removeJobs[e].last_update_job_status >= 1e3) this._removeJobs[e].last_update_job_status = new Date().getTime(); else return
  10661. } else delete this._removeJobs[e], console.log("remove jobs:", this._removeJobs)
  10662. }
  10663. n ? A4(e, n, i) : Vo(e, i)
  10664. }
  10665. cancelJob(e) {
  10666. var n;
  10667. (n = this._ws) == null || n.sendMessage({file_action: Io(e)});
  10668. let i = this._writeJobs.find(a => a.id == e);
  10669. i && i.remove_download_file(), this._writeJobs = this._writeJobs.filter(a => a.id != e), this._readJobs = this._readJobs.filter(a => a.id != e), delete this._removeJobs[e]
  10670. }
  10671. removeAllEmptyDirs(e) {
  10672. var i;
  10673. try {
  10674. const n = JSON.parse(e);
  10675. (i = this._ws) == null || i.sendMessage({file_action: To(n.id, n.path)})
  10676. } catch (n) {
  10677. console.error("Failed to remove all empty dirs:", n)
  10678. }
  10679. }
  10680. removeFile(e) {
  10681. var i;
  10682. try {
  10683. const n = JSON.parse(e), {id: a, path: t, file_num: s, is_remote: E} = n;
  10684. E && ((i = this._ws) == null || i.sendMessage({file_action: ct(a, t, s, E)}))
  10685. } catch (n) {
  10686. console.error("Failed to remove files:", n)
  10687. }
  10688. }
  10689. readDirToRemoveRecursive(e) {
  10690. var i;
  10691. try {
  10692. const n = JSON.parse(e), {id: a, path: t, is_remote: s, show_hidden: E} = n;
  10693. if (s) {
  10694. (i = this._ws) == null || i.sendMessage({file_action: Po(a, t, E)});
  10695. const l = (d, c) => (d ? c === "Windows" : he()) ? "\\" : "/";
  10696. this._removeJobs[a] = {
  10697. path: t,
  10698. files: [],
  10699. no_confirm: !1,
  10700. is_remote: s,
  10701. sep: l(s, this.getPeerPlatform()),
  10702. last_update_job_status: new Date().getTime()
  10703. }
  10704. }
  10705. } catch (n) {
  10706. console.error("Failed to read dir to remove recursive:", n)
  10707. }
  10708. }
  10709. createDir(e) {
  10710. var i;
  10711. try {
  10712. const n = JSON.parse(e), {id: a, path: t, is_remote: s} = n;
  10713. s && ((i = this._ws) == null || i.sendMessage({file_action: Ro(a, t)}))
  10714. } catch (n) {
  10715. console.error("Failed to create dir:", n)
  10716. }
  10717. }
  10718. renameFile(e) {
  10719. var i;
  10720. try {
  10721. const n = JSON.parse(e), {id: a, path: t, new_name: s, is_remote: E} = n;
  10722. E && ((i = this._ws) == null || i.sendMessage({file_action: jo(a, t, s)}))
  10723. } catch (n) {
  10724. console.error("Failed to rename file:", n)
  10725. }
  10726. }
  10727. async seletFiles(e) {
  10728. await qo(e, (i, n) => {
  10729. this._fileHandles[i] = n
  10730. })
  10731. }
  10732. async handleFileAction(e) {
  10733. if (e.send_confirm) {
  10734. const i = e.send_confirm, n = this._readJobs.find(a => a.id == i.id);
  10735. n && n.confirm(i)
  10736. }
  10737. }
  10738. async confirmOverrideFile(e) {
  10739. try {
  10740. const i = JSON.parse(e), {id: n, file_num: a, need_override: t, remember: s, is_upload: E} = i;
  10741. if (E) {
  10742. const l = this._readJobs.find(d => d.id == n);
  10743. l && (s && (l.default_overwrite_strategy = t), l.confirm(du.fromPartial({
  10744. id: n,
  10745. file_num: a,
  10746. offset_blk: t ? 0 : void 0,
  10747. skip: t ? void 0 : !0
  10748. })))
  10749. }
  10750. } catch (i) {
  10751. console.error("Failed to confirm override file:", i)
  10752. }
  10753. }
  10754. sendChat(e) {
  10755. const i = gu.fromPartial({text: e}), n = f.fromPartial({chat_message: i});
  10756. this.sendMessage({misc: n})
  10757. }
  10758. changeResolution(e) {
  10759. var i;
  10760. try {
  10761. const n = JSON.parse(e), a = v.fromPartial({width: n.width, height: n.height});
  10762. let t;
  10763. this._peerInfo && L(this._peerInfo.version) >= L("1.2.4") ? t = f.fromPartial({
  10764. change_display_resolution: Uu.fromPartial({
  10765. display: n.display,
  10766. resolution: a
  10767. })
  10768. }) : t = f.fromPartial({change_resolution: a}), (i = this._ws) == null || i.sendMessage({misc: t}), this._lastChangeDisplay = {
  10769. display: n.display,
  10770. width: n.width,
  10771. height: n.height,
  10772. time: new Date().getTime()
  10773. }
  10774. } catch (n) {
  10775. console.error("Failed to change resolution:", n)
  10776. }
  10777. }
  10778. setCustomResolution(e) {
  10779. var a, t;
  10780. const i = (s, E) => {
  10781. const l = s.toString(), d = this.loadConfig();
  10782. d.custom_resolutions || (d.custom_resolutions = {}), E ? d.custom_resolutions[l] = {
  10783. w: E[0],
  10784. h: E[1]
  10785. } : delete d.custom_resolutions[l], this.saveConfig(d)
  10786. }, n = () => {
  10787. var s, E, l;
  10788. return ((s = this._lastChangeDisplay) == null ? void 0 : s.display) == e.display && ((E = this._lastChangeDisplay) == null ? void 0 : E.width) == e.width && ((l = this._lastChangeDisplay) == null ? void 0 : l.height) == e.height && new Date().getTime() - this._lastChangeDisplay.time < 15e3
  10789. };
  10790. if (e.width == ((a = e.original_resolution) == null ? void 0 : a.width) && e.height == ((t = e.original_resolution) == null ? void 0 : t.height)) i(e.display, void 0); else {
  10791. const s = this._lastChangeDisplay;
  10792. if ((s == null ? void 0 : s.display) == e.display) {
  10793. const E = n() ? [e.width, e.height] : void 0;
  10794. i(e.display, E)
  10795. }
  10796. }
  10797. }
  10798. getCustomResolution(e) {
  10799. const n = this.loadConfig().custom_resolutions;
  10800. if (n) {
  10801. const a = n[e.toString()];
  10802. if (a && a.w && a.h) return [a.w, a.h]
  10803. }
  10804. }
  10805. tryChangeInitResolution(e) {
  10806. const i = this.getCustomResolution(e);
  10807. i && this.changeResolution(JSON.stringify({display: e, width: i[0], height: i[1]}))
  10808. }
  10809. setMultipleWindowsSession(e) {
  10810. let i = [];
  10811. e.forEach(n => {
  10812. let a = {};
  10813. a.sid = n.sid.toString(), a.name = n.name, i.push(a)
  10814. }), A("set_multiple_windows_session", {windows_sessions: JSON.stringify(i)})
  10815. }
  10816. sendSelectedSessionId(e) {
  10817. var n, a;
  10818. const i = parseInt(e);
  10819. if (isNaN(i)) console.error("selected invalid sid: ", e); else {
  10820. this._selectedWindowsSessionId = i;
  10821. const t = f.fromPartial({selected_sid: i});
  10822. (n = this._ws) == null || n.sendMessage({misc: t});
  10823. const s = this._peerInfo;
  10824. s && ((a = s.windows_sessions) == null ? void 0 : a.current_sid) == i && (this._isFileTransfer ? s.username || this.msgbox("error", "Error", "No active console user logged on, please connect and logon first.") : this.msgbox("success", "Successful", "Connected, waiting for image..."))
  10825. }
  10826. }
  10827. }
  10828. function Ue(u = !1) {
  10829. const e = m.getItem("custom-rendezvous-server");
  10830. return Me(e || Qo, u)
  10831. }
  10832. const Xo = 21118, Yo = 21119;
  10833. function $o(u) {
  10834. return /^(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:\d+)?$/.test(u)
  10835. }
  10836. function ur(u) {
  10837. return /^((([a-fA-F0-9]{1,4}:{1,2})+[a-fA-F0-9]{1,4})|(\[([a-fA-F0-9]{1,4}:{1,2})+[a-fA-F0-9]{1,4}\]:\d+))$/.test(u)
  10838. }
  10839. function er(u) {
  10840. return /^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z][a-z-]{0,61}[a-z]:\d{1,5}$/i.test(u)
  10841. }
  10842. function ir(u) {
  10843. return /^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z][a-z-]{0,61}[a-z]$/i.test(u)
  10844. }
  10845. function tr(u) {
  10846. return u.startsWith("ws://") || u.startsWith("wss://")
  10847. }
  10848. function ar() {
  10849. return window.location.protocol === "https:"
  10850. }
  10851. function isHttps() {
  10852. return window.location.protocol === "https:"
  10853. }
  10854. function getUriFromRs(uri, isRelay = false) {
  10855. if (window.ws_host) {
  10856. return window.ws_host + "/ws/" + (isRelay ? "relay" : "id")
  10857. }
  10858. const p = isHttps() ? "wss://" : "ws://"
  10859. const [domain, uriport] = uri.split(":")
  10860. if (!isHttps()) {
  10861. // http 直接走端口
  10862. if (uriport) {
  10863. const port = parseInt(uriport)
  10864. return p + domain + ":" + (port + 2)
  10865. }
  10866. return p + domain + ":" + (defaultIdServerPort + (isRelay ? 3 : 2))
  10867. }
  10868. // https 分情况
  10869. if (!window.location.port) {
  10870. // 443
  10871. return p + domain + "/ws/" + (isRelay ? "relay" : "id")
  10872. }
  10873. // 非443
  10874. return p + domain + ":" + window.location.port + "/ws/" + (isRelay ? "relay" : "id")
  10875. }
  10876. function Me(u, e = !1) {
  10877. if (tr(u)) return u;
  10878. return getUriFromRs(u, e)
  10879. const i = e ? Yo : Xo, n = e ? "/ws/relay" : "/ws/id", a = ar() ? "wss" : "ws";
  10880. if ($o(u)) { //是纯ip
  10881. const t = u.indexOf(":");
  10882. if (t !== -1) {
  10883. //带端口
  10884. const s = u.substring(0, t), E = u.substring(t + 1), l = parseInt(E);
  10885. return isNaN(l) ? `${a}://${s}:${i}` : `${a}://${s}:${l + 2}`
  10886. } else return `${a}://${u}:${i}`
  10887. }
  10888. if (ur(u)) {
  10889. const t = u.lastIndexOf("]");
  10890. if (t !== -1) {
  10891. const s = u.substring(0, t + 1), E = u.substring(t + 2), l = parseInt(E);
  10892. return isNaN(l) ? `${a}://${s}:${i}` : `${a}://${s}:${l + 2}`
  10893. } else return u.startsWith("[") ? `${a}://${u}:${i}` : `${a}://[${u}]:${i}`
  10894. }
  10895. if (u.includes(":")) {
  10896. const [t, s] = u.split(":");
  10897. if (er(u)) return `${a}://${t}${n}`
  10898. } else if (ir(u)) return `${a}://${u}${n}`;
  10899. return u
  10900. }
  10901. const mt = (u, e, i) => e && u.type == "SharedAb" ? Q(Qu([u.value, i.salt])) === Q(e) : !1,
  10902. Ft = (u, e) => e && u.type == "PersonalAb" ? Q(u.value) === Q(e) : !1;
  10903. function nr() {
  10904. return Ue()
  10905. }
  10906. function _t(u, e) {
  10907. I4("callback_query_onlines", {onlines: u.join(","), offlines: e.join(",")})
  10908. }
  10909. const onlineCache = {}
  10910. // Query onlines
  10911. async function myQueryOnline(id) {
  10912. const last_online = onlineCache[id]
  10913. if (last_online && new Date().getTime() - last_online < 20 * 1000) {
  10914. return true
  10915. }
  10916. // 映射 方便后期更新
  10917. const maps = {
  10918. uri: Ue(),
  10919. ws: Ve,
  10920. conn_type: je.DEFAULT_CONN,
  10921. nat_type: bt.SYMMETRIC,
  10922. token: Gt(),
  10923. version: c4,
  10924. licence_key: Jt(),
  10925. rendezvousPunchHoleRequest: Hu,
  10926. rendezvousPunchHoleResponse_Failure: $0
  10927. }
  10928. const s = new maps.ws(maps.uri, !0, "rendezvous");
  10929. await s.open();
  10930. const punch_hole_request = maps.rendezvousPunchHoleRequest.fromPartial({
  10931. id: id,
  10932. licence_key: maps.licence_key,
  10933. conn_type: maps.conn_type,
  10934. nat_type: maps.nat_type,
  10935. token: maps.token,
  10936. version: maps.version
  10937. });
  10938. s.sendRendezvous({punch_hole_request: punch_hole_request});
  10939. const msg = await s.next();
  10940. s.close();
  10941. let online = false
  10942. const phr = msg.punch_hole_response, rr = msg.relay_response;
  10943. if (phr) {
  10944. online = true
  10945. if (phr != null && phr.other_failure) {
  10946. online = false
  10947. return online
  10948. }
  10949. if (phr.failure != maps.rendezvousPunchHoleResponse_Failure.UNRECOGNIZED) switch (phr == null ? void 0 : phr.failure) {
  10950. case maps.rendezvousPunchHoleResponse_Failure.ID_NOT_EXIST:
  10951. case maps.rendezvousPunchHoleResponse_Failure.OFFLINE:
  10952. case maps.rendezvousPunchHoleResponse_Failure.LICENSE_MISMATCH:
  10953. case maps.rendezvousPunchHoleResponse_Failure.LICENSE_OVERUSE:
  10954. online = false
  10955. break
  10956. }
  10957. } else if (rr) {
  10958. online = true
  10959. if (!rr.version) {
  10960. online = false
  10961. return online
  10962. }
  10963. }
  10964. if (online) {
  10965. onlineCache[id] = new Date().getTime()
  10966. } else if (onlineCache[id]) {
  10967. delete onlineCache[id]
  10968. }
  10969. return online
  10970. }
  10971. async function or(u) {
  10972. let e = [];
  10973. try {
  10974. e = JSON.parse(u)
  10975. } catch (a) {
  10976. console.error("Failed to query onlines, ", a);
  10977. return
  10978. }
  10979. if (e.length === 0) return;
  10980. if (window.webclient_magic_queryonline) {
  10981. const onlines = []
  10982. const offlines = []
  10983. for (let i = 0; i < e.length; i++) {
  10984. let online = await myQueryOnline(e[i])
  10985. if (online) {
  10986. onlines.push(e[i])
  10987. } else {
  10988. offlines.push(e[i])
  10989. }
  10990. }
  10991. _t(onlines, offlines)
  10992. } else {
  10993. const i = nr(), n = new Ve(i, !0, "query onlines");
  10994. try {
  10995. await n.open();
  10996. const a = Gu.fromPartial({id: qe(), peers: e});
  10997. n.sendRendezvous({online_request: a})
  10998. } catch (a) {
  10999. console.error("Failed to query onlines, ", a), _t([], e), n.close();
  11000. return
  11001. }
  11002. for (let a = 0; a < 2; a++) {
  11003. const t = await uo(n, 3e3);
  11004. if (!t || (t == null ? void 0 : t.key_exchange) || (t == null ? void 0 : t.online_response) === void 0) continue;
  11005. const s = t.online_response.states;
  11006. let E = [], l = [];
  11007. for (let d = 0; d < e.length; d++) {
  11008. const c = 1 << 7 - d % 8;
  11009. (s[Math.floor(d / 8)] & c) === c ? E.push(e[d]) : l.push(e[d])
  11010. }
  11011. _t(E, l), n.close();
  11012. return
  11013. }
  11014. n.close(), console.error("Failed to query online states, no online response")
  11015. }
  11016. }
  11017. const rr = "rustdesk-client";
  11018. function sr() {
  11019. if (typeof navigator != "undefined") {
  11020. const u = navigator.platform.toLowerCase();
  11021. return u.includes("win") ? "windows" : u.includes("mac") ? "macos" : u.includes("linux") ? "linux" : u
  11022. }
  11023. return "unknown"
  11024. }
  11025. function Er() {
  11026. const u = sr();
  11027. return u === "windows" ? navigator.userAgent.includes("Win64") ? "x86_64" : "x86" : u === "macos" ? navigator.userAgent.includes("Intel") ? "x86_64" : "arm64" : navigator.userAgent.includes("x64") ? "x86_64" : "x86"
  11028. }
  11029. function lr() {
  11030. const u = navigator.userAgent;
  11031. let e = "", i = "";
  11032. if (u.includes("Windows")) {
  11033. e = "windows";
  11034. const n = u.match(/Windows NT (\d+\.\d+)/);
  11035. n && (i = n[1])
  11036. } else if (u.includes("Mac OS X")) {
  11037. e = "macos";
  11038. const n = u.match(/Mac OS X (\d+[._]\d+[._]\d+)/);
  11039. n && (i = n[1].replace(/_/g, "."))
  11040. } else if (u.includes("Linux")) {
  11041. e = "linux";
  11042. const n = u.match(/Linux\s*([\d.]+)?/);
  11043. n && n[1] && (i = n[1])
  11044. } else e = "unknown", i = "";
  11045. return e += "-" + navigator.userAgent, {os: e, os_version: i}
  11046. }
  11047. async function Dr(u) {
  11048. const e = "https://api.rustdesk.com/version/latest", {os: i, os_version: n} = lr(), a = Er();
  11049. return [{os: i, os_version: n, arch: a, device_id: [], typ: u, host: window.location.host}, e]
  11050. }
  11051. async function dr() {
  11052. try {
  11053. const [u, e] = await Dr(rr);
  11054. return await (await fetch(e, {
  11055. method: "POST",
  11056. headers: {"Content-Type": "application/json"},
  11057. body: JSON.stringify(u)
  11058. })).json()
  11059. } catch {
  11060. return null
  11061. }
  11062. }
  11063. window.curConn = void 0;
  11064. window.isMobile = () => /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0, 4));
  11065. const R4 = Ht(), $u = R4 === a4, Ye = R4 === g4, Xu = R4 === k4, cr = window.location.host;
  11066. function Cr() {
  11067. return !isMobile()
  11068. }
  11069. function aa(u, e, i, n) {
  11070. if (!(!u || u == "error" && !i)) {
  11071. i.toLowerCase();
  11072. var a = zn(u, e, i) ? "true" : "";
  11073. onGlobalEvent(JSON.stringify({
  11074. name: "msgbox",
  11075. type: u,
  11076. title: e,
  11077. text: i,
  11078. link: n != null ? n : "",
  11079. hasRetry: a
  11080. }))
  11081. }
  11082. }
  11083. function pr(u, e, i) {
  11084. onGlobalEvent(JSON.stringify({name: "toast", type: u, text: e, dur_msec: i}))
  11085. }
  11086. function na(u) {
  11087. var e = {};
  11088. for (const [i, n] of Object.entries(u)) !i || (n instanceof String || typeof n == "string" ? e[i] = n : n instanceof Uint8Array ? e[i] = "[" + n.toString() + "]" : e[i] = JSON.stringify(n));
  11089. return e
  11090. }
  11091. function A(u, e) {
  11092. e = na(e), e.name = u, onGlobalEvent(JSON.stringify(e))
  11093. }
  11094. function m4() {
  11095. var e;
  11096. ((e = f4("input-source")) != null ? e : nt) === nt ? Do() : p4()
  11097. }
  11098. function I4(u, e) {
  11099. e = na(e), e.name = u, onRegisteredEvent(JSON.stringify(e))
  11100. }
  11101. function F4(u, e) {
  11102. onRgba(u, e)
  11103. }
  11104. function T4(u) {
  11105. window.curConn = u
  11106. }
  11107. function i0() {
  11108. return window.curConn
  11109. }
  11110. async function oa() {
  11111. await curConn.start()
  11112. }
  11113. function j4() {
  11114. var u;
  11115. (u = i0()) == null || u.close(), T4(void 0)
  11116. }
  11117. function ra() {
  11118. var e;
  11119. (e = window.curConn) == null || e.close();
  11120. const u = new ta;
  11121. return T4(u), u
  11122. }
  11123. let K;
  11124. async function sa() {
  11125. try {
  11126. K || (await Le.ready, K = Le)
  11127. } catch (u) {
  11128. console.error("Failed to init sodium: " + u.message)
  11129. }
  11130. }
  11131. function Ea() {
  11132. return K
  11133. }
  11134. async function _4(u, e) {
  11135. return await sa(), typeof u == "string" && (u = be(u)), typeof e == "string" && (e = be(e)), K.crypto_sign_open(u, e)
  11136. }
  11137. function be(u) {
  11138. return K.from_base64(u, K.base64_variants.ORIGINAL)
  11139. }
  11140. function Br(u) {
  11141. return K.to_base64(u, K.base64_variants.ORIGINAL)
  11142. }
  11143. function Ar() {
  11144. const u = K.crypto_box_keypair(), e = u.privateKey, i = u.publicKey;
  11145. return [e, i]
  11146. }
  11147. function mr() {
  11148. return K.crypto_secretbox_keygen()
  11149. }
  11150. function Fr(u, e, i) {
  11151. const n = Uint8Array.from(Array(24).fill(0));
  11152. return K.crypto_box_easy(u, n, e, i)
  11153. }
  11154. function n4(u) {
  11155. for (var e = Array(24).fill(0), i = 0; i < e.length && u > 0; i++) {
  11156. var n = u & 255;
  11157. e[i] = n, u = (u - n) / 256
  11158. }
  11159. return Uint8Array.from(e)
  11160. }
  11161. function vt(u, e, i) {
  11162. return K.crypto_secretbox_easy(u, n4(e), i)
  11163. }
  11164. function _r(u, e, i) {
  11165. return K.crypto_secretbox_open_easy(u, n4(e), i)
  11166. }
  11167. window.setByName = (u, e) => {
  11168. switch (u) {
  11169. case"connect":
  11170. ra(), oa();
  11171. break;
  11172. case"login":
  11173. e = JSON.parse(e), curConn.handle_login_from_ui(e.os_username, e.os_password, e.password, e.remember);
  11174. break;
  11175. case"close":
  11176. j4();
  11177. break;
  11178. case"refresh":
  11179. curConn.refresh();
  11180. break;
  11181. case"reconnect":
  11182. curConn == null || curConn.reconnect();
  11183. break;
  11184. case"toggle_virtual_display":
  11185. curConn.toggleVirtualDisplay(e);
  11186. break;
  11187. case"toggle_privacy_mode":
  11188. curConn.togglePrivacyMode(e);
  11189. break;
  11190. case"image_quality":
  11191. curConn.setImageQuality(e);
  11192. break;
  11193. case"custom_image_quality":
  11194. curConn.setCustomImageQuality(e);
  11195. break;
  11196. case"custom-fps":
  11197. curConn.setCustomFps(e, !0);
  11198. break;
  11199. case"lock_screen":
  11200. curConn.lockScreen();
  11201. break;
  11202. case"ctrl_alt_del":
  11203. curConn.ctrlAltDel();
  11204. break;
  11205. case"switch_display":
  11206. curConn.switchDisplay(e);
  11207. break;
  11208. case"remove_peer":
  11209. In(e);
  11210. break;
  11211. case"input_key":
  11212. e = JSON.parse(e), curConn.inputKey(e.name, e.down == "true", e.press == "true", e.alt == "true", e.ctrl == "true", e.shift == "true", e.command == "true");
  11213. break;
  11214. case"input_string":
  11215. curConn.inputString(e);
  11216. break;
  11217. case"flutter_key_event":
  11218. e = JSON.parse(e), co(curConn, e.usb_hid, e.down == "true", e.lock_modes);
  11219. break;
  11220. case"send_mouse":
  11221. vr(e);
  11222. break;
  11223. case"send_2fa":
  11224. curConn == null || curConn.send2fa(e);
  11225. break;
  11226. case"option":
  11227. e = JSON.parse(e), m.setItem(e.name, e.value);
  11228. break;
  11229. case"options":
  11230. e = JSON.parse(e);
  11231. for (const [n, a] of Object.entries(a)) m.setItem(n, a);
  11232. break;
  11233. case"option:local": {
  11234. let n = JSON.parse(e);
  11235. if (n.name == 'access_token' && n.value) {
  11236. getServerConf(n.value)
  11237. }
  11238. n.name === "verifier" && kt(n.value), n.name === "user_info" && (n.value || kt("")), Nt(n.name, n.value), n.name === "input-source" && m4(), n.name == "lang" && Kn()
  11239. }
  11240. break;
  11241. case"option:flutter:local":
  11242. e = JSON.parse(e), On(e.name, e.value);
  11243. break;
  11244. case"option:flutter:peer":
  11245. e = JSON.parse(e), curConn.setFlutterUiOption(e.name, e.value);
  11246. break;
  11247. case"option:user:default":
  11248. wr(e);
  11249. break;
  11250. case"option:session":
  11251. e = JSON.parse(e), curConn.setOption(e.name, e.value);
  11252. break;
  11253. case"option:peer":
  11254. try {
  11255. e = JSON.parse(e), jt(e.id, e.name, e.value)
  11256. } catch (n) {
  11257. console.error('Failed to set peer option: "' + e + '", ' + n.message)
  11258. }
  11259. break;
  11260. case"option:toggle":
  11261. return curConn.toggleOption(e);
  11262. case"input_os_password":
  11263. curConn.inputOsPassword(e);
  11264. break;
  11265. case"session_add_sync":
  11266. return Pr(e);
  11267. case"session_start":
  11268. Rr();
  11269. break;
  11270. case"session_close":
  11271. Ir();
  11272. break;
  11273. case"elevate_direct":
  11274. curConn.elevateDirect();
  11275. break;
  11276. case"elevate_with_logon":
  11277. curConn.elevateWithLogon(e);
  11278. break;
  11279. case"peer_exists":
  11280. return !!cu()[e];
  11281. case"restart":
  11282. curConn.restart();
  11283. break;
  11284. case"fav":
  11285. return m.setItem("fav", e);
  11286. case"query_onlines":
  11287. or(e);
  11288. break;
  11289. case"change_prefer_codec":
  11290. curConn.changePreferCodec(e);
  11291. break;
  11292. case"cursor":
  11293. yr(e);
  11294. break;
  11295. case"enter_or_leave":
  11296. curConn == null || curConn.enterOrLeave(e);
  11297. break;
  11298. case"fullscreen":
  11299. e == "Y" ? jr() : Nr();
  11300. break;
  11301. case"send_note":
  11302. const i = Da("conn");
  11303. i && (curConn == null || curConn.sendNote(i, e));
  11304. break;
  11305. case"read_remote_dir":
  11306. curConn == null || curConn.readRemoteDir(e);
  11307. break;
  11308. case"send_files":
  11309. curConn == null || curConn.sendFiles(e);
  11310. break;
  11311. case"send_local_files":
  11312. curConn == null || curConn.sendLocalFiles(e);
  11313. break;
  11314. case"cancel_job":
  11315. curConn == null || curConn.cancelJob(e);
  11316. break;
  11317. case"remove_all_empty_dirs":
  11318. curConn == null || curConn.removeAllEmptyDirs(e);
  11319. break;
  11320. case"remove_file":
  11321. curConn == null || curConn.removeFile(e);
  11322. break;
  11323. case"create_dir":
  11324. curConn == null || curConn.createDir(e);
  11325. break;
  11326. case"rename_file":
  11327. curConn == null || curConn.renameFile(e);
  11328. break;
  11329. case"read_dir_to_remove_recursive":
  11330. curConn == null || curConn.readDirToRemoveRecursive(e);
  11331. break;
  11332. case"select_files":
  11333. curConn == null || curConn.seletFiles(e);
  11334. break;
  11335. case"confirm_override_file":
  11336. curConn == null || curConn.confirmOverrideFile(e);
  11337. break;
  11338. case"send_chat":
  11339. curConn == null || curConn.sendChat(e);
  11340. break;
  11341. case"load_ab":
  11342. Mr();
  11343. break;
  11344. case"save_ab":
  11345. Un(e);
  11346. break;
  11347. case"clear_ab":
  11348. Mn();
  11349. break;
  11350. case"load_group":
  11351. Lr();
  11352. break;
  11353. case"save_group":
  11354. Ln(e);
  11355. break;
  11356. case"clear_group":
  11357. Vn();
  11358. break;
  11359. case"change_resolution":
  11360. curConn == null || curConn.changeResolution(e);
  11361. break;
  11362. case"selected_sid":
  11363. curConn == null || curConn.sendSelectedSessionId(e);
  11364. break
  11365. }
  11366. };
  11367. function vr(u) {
  11368. if (!curConn) return;
  11369. let e = 0;
  11370. switch (u = JSON.parse(u), u.type) {
  11371. case"down":
  11372. e = kn, setTimeout(() => {
  11373. Xt(curConn)
  11374. }, 100);
  11375. break;
  11376. case"up":
  11377. e = hn;
  11378. break;
  11379. case"wheel":
  11380. e = rt;
  11381. break;
  11382. case"trackpad":
  11383. e = st;
  11384. break
  11385. }
  11386. switch (u.buttons) {
  11387. case"left":
  11388. e |= Pe << 3;
  11389. break;
  11390. case"right":
  11391. e |= Re << 3;
  11392. break;
  11393. case"wheel":
  11394. e |= fn << 3;
  11395. break;
  11396. case"back":
  11397. e |= xn << 3;
  11398. break;
  11399. case"forward":
  11400. e |= yn << 3;
  11401. break
  11402. }
  11403. let i = parseInt(u.x || "0"), n = parseInt(u.y || "0");
  11404. (e == rt || e == st) && curConn.getOption("reverse_mouse_wheel") == "Y" && (i = -i, n = -n);
  11405. const a = (e & Pe << 3) > 0 ? 1 : 0, t = (e & Re << 3) > 0 ? 1 : 0;
  11406. a ^ t && curConn.getToggleOption("swap-left-right-mouse") && (a ? e = e & ~(Pe << 3) | Re << 3 : e = e & ~(Re << 3) | Pe << 3), curConn.inputMouse(e, i, n, u.alt == "true", u.ctrl == "true", u.shift == "true", u.command == "true")
  11407. }
  11408. window.getByName = (u, e) => {
  11409. let i = gr(u, e);
  11410. return typeof i == "string" || i instanceof String ? i : i == null || i == null ? "" : JSON.stringify(i)
  11411. };
  11412. function gr(u, e) {
  11413. var n, a, t, s;
  11414. switch (u) {
  11415. case"remember":
  11416. return curConn.getRemember();
  11417. case"option":
  11418. return m.getItem(e);
  11419. case"options":
  11420. const E = ["custom-rendezvous-server", "relay-server", "api-server", "key"], l = {};
  11421. return E.forEach(c => {
  11422. const p = m.getItem(c);
  11423. p && (l[c] = p)
  11424. }), JSON.stringify(l);
  11425. case"option:local":
  11426. const res = f4(e) || "";
  11427. if (e == 'access_token' && res) {
  11428. getServerConf(res)
  11429. }
  11430. return res;
  11431. case"option:flutter:local":
  11432. return Nn(e) || "";
  11433. case"option:flutter:peer":
  11434. return curConn.getFlutterUiOption(e) || "";
  11435. case"image_quality":
  11436. return curConn.getImageQuality();
  11437. case"translate":
  11438. return e = JSON.parse(e), Jn(e.locale, e.text);
  11439. case"option:user:default":
  11440. return e0(e);
  11441. case"option:session":
  11442. return curConn ? curConn.getOption(e) : e0(e);
  11443. case"option:peer":
  11444. try {
  11445. const c = JSON.parse(e);
  11446. return (n = jn(c.id, c.name)) != null ? n : e0(c.name)
  11447. } catch (c) {
  11448. return console.error('Failed to get peer option: "' + e + '", ' + c.message), ""
  11449. }
  11450. case"option:toggle":
  11451. return curConn == null ? void 0 : curConn.getToggleOption(e);
  11452. case"get_conn_status":
  11453. return curConn ? curConn.getStatus() : JSON.stringify({status_num: 0});
  11454. case"test_if_valid_server":
  11455. break;
  11456. case"version":
  11457. return c4;
  11458. case"load_recent_peers":
  11459. Sr();
  11460. break;
  11461. case"load_fav_peers":
  11462. zr();
  11463. break;
  11464. case"fav":
  11465. return (a = m.getItem("fav")) != null ? a : "[]";
  11466. case"load_recent_peers_sync":
  11467. return JSON.stringify({peers: JSON.stringify(O4())});
  11468. case"api_server":
  11469. return U4();
  11470. case"is_using_public_server":
  11471. return !m.getItem("custom-rendezvous-server");
  11472. case"get_version_number":
  11473. return L(e);
  11474. case"audit_server":
  11475. return Da(e);
  11476. case"alternative_codecs":
  11477. return curConn.getAlternativeCodecs();
  11478. case"screen_info":
  11479. return JSON.stringify({
  11480. frame: {
  11481. l: window.screenX,
  11482. t: window.screenY,
  11483. r: window.screenX + window.innerWidth,
  11484. b: window.screenY + window.innerHeight
  11485. },
  11486. visibleFrame: {
  11487. l: window.screen.availLeft,
  11488. t: window.screen.availTop,
  11489. r: window.screen.availLeft + window.screen.availWidth,
  11490. b: window.screen.availTop + window.screen.availHeight
  11491. },
  11492. scaleFactor: window.devicePixelRatio
  11493. });
  11494. case"main_display":
  11495. return JSON.stringify({
  11496. w: window.screen.availWidth,
  11497. h: window.screen.availHeight,
  11498. scaleFactor: window.devicePixelRatio
  11499. });
  11500. case"langs":
  11501. var i = Object.entries(Sn).map(([c, p]) => [c, `${p} (${c})`]);
  11502. return i.sort((c, p) => c[0].localeCompare(p[0])), JSON.stringify(i);
  11503. case"build_date":
  11504. return Rn;
  11505. case"my_id":
  11506. return qe();
  11507. case"my_name":
  11508. return qt();
  11509. case"uuid":
  11510. return Kt();
  11511. case"local_os":
  11512. return Ht();
  11513. case"peer_has_password":
  11514. return ((t = (cu()[e] || {}).password) != null ? t : "") !== "";
  11515. case"fullscreen":
  11516. return Or() ? "Y" : "N";
  11517. case"platform":
  11518. return curConn.getPlatform();
  11519. case"enable_trusted_devices":
  11520. return (s = curConn == null ? void 0 : curConn.enableTrustedDevices()) != null && s ? "Y" : "N"
  11521. }
  11522. return ""
  11523. }
  11524. let N4 = new Worker("./libopus.js?v=02816afa"), la;
  11525. function kr(u, e) {
  11526. la = fr(u, e), N4.postMessage({channels: u, sampleRate: e})
  11527. }
  11528. function hr(u) {
  11529. N4.postMessage(u, [u.buffer])
  11530. }
  11531. window.init = async () => {
  11532. try {
  11533. N4.onmessage = u => {
  11534. la.feed(u.data)
  11535. }, await sa(), await Xn(), await Xa(), await N.init(), console.log("init done"), onInitFinished(), dr(), await Vr(), Ba(!0)
  11536. } catch (u) {
  11537. console.error("Failed to init: " + u.message), onInitFinished()
  11538. }
  11539. };
  11540. window.onunload = () => {
  11541. console.log("window close"), $a()
  11542. };
  11543. function fr(u, e) {
  11544. return new ha({channels: u, sampleRate: e, flushingTime: 2e3})
  11545. }
  11546. function xr(u) {
  11547. if (window.clipboardData && window.clipboardData.setData) return window.clipboardData.setData("Text", u);
  11548. if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
  11549. var e = document.createElement("textarea");
  11550. e.textContent = u, e.style.position = "fixed", document.body.appendChild(e), e.select();
  11551. try {
  11552. return document.execCommand("copy")
  11553. } catch (i) {
  11554. console.warn("Copy to clipboard failed.", i)
  11555. } finally {
  11556. document.body.removeChild(e)
  11557. }
  11558. }
  11559. }
  11560. function L(u) {
  11561. try {
  11562. let e = u.split("-"), i = 0;
  11563. if (e.length > 0) {
  11564. let n = 0;
  11565. for (let a of e[0].split(".")) n = parseInt(a) || 0, i = i * 1e3 + n;
  11566. i -= n, i += n * 10
  11567. }
  11568. return e.length > 1 && (i += parseInt(e[1]) || 0), i
  11569. } catch (e) {
  11570. return console.error('Failed to parse version number: "' + u + '" ' + e.message), 0
  11571. }
  11572. }
  11573. function yr(u) {
  11574. let e = "auto";
  11575. if (u != "auto") try {
  11576. const t = JSON.parse(u);
  11577. if (!t.url) return;
  11578. e = `url(${t.url}) ${t.hotx} ${t.hoty}, auto`
  11579. } catch (t) {
  11580. console.error("Failed to set custom cursor: " + t.message);
  11581. return
  11582. }
  11583. for (var i = document.body, n = 0; n < i.children.length; n++) {
  11584. var a = i.children[n];
  11585. a.tagName == "FLUTTER-VIEW" && (a.style.cursor = e)
  11586. }
  11587. }
  11588. async function br() {
  11589. await Le.ready;
  11590. const u = Le.crypto_sign_keypair();
  11591. return {publicKey: u.publicKey, privateKey: u.privateKey}
  11592. }
  11593. function wr(u) {
  11594. try {
  11595. const e = JSON.parse(u), i = JSON.parse(m.getItem("user-default-options")) || {};
  11596. i[e.name] = e.value, m.setItem("user-default-options", JSON.stringify(i))
  11597. } catch (e) {
  11598. console.error("Failed to set user default options: " + e.message)
  11599. }
  11600. }
  11601. function e0(u) {
  11602. var i, n, a;
  11603. const e = {
  11604. view_style: "original",
  11605. scroll_style: "scrollauto",
  11606. image_quality: "balanced",
  11607. "codec-preference": "auto",
  11608. custom_image_quality: "50",
  11609. "custom-fps": "30"
  11610. };
  11611. try {
  11612. return (n = (i = (JSON.parse(m.getItem("user-default-options")) || {})[u]) != null ? i : e[u]) != null ? n : ""
  11613. } catch (t) {
  11614. return console.error("Failed to get user default options: " + t.message), (a = e[u]) != null ? a : ""
  11615. }
  11616. }
  11617. function O4() {
  11618. const u = [];
  11619. for (const [e, i] of Object.entries(cu())) {
  11620. if (!e) continue;
  11621. const n = i.tm, a = i.info, t = {
  11622. id: e,
  11623. username: a.username || "",
  11624. hostname: a.hostname || "",
  11625. platform: a.platform || "",
  11626. alias: i.alias || ""
  11627. };
  11628. !n || !t || u.push([n, e, t])
  11629. }
  11630. return u.sort().reverse().map(e => e[2])
  11631. }
  11632. function Sr() {
  11633. const u = O4();
  11634. u && I4("load_recent_peers", {peers: JSON.stringify(u)})
  11635. }
  11636. function zr() {
  11637. var u;
  11638. try {
  11639. const e = (u = m.getItem("fav")) != null ? u : "[]", i = JSON.parse(e), n = O4().filter(a => i.includes(a.id));
  11640. n && I4("load_fav_peers", {peers: JSON.stringify(n)})
  11641. } catch (e) {
  11642. console.error("Failed to load fav peers: " + e.message)
  11643. }
  11644. }
  11645. function Pr(u) {
  11646. var e;
  11647. try {
  11648. const i = JSON.parse(u), n = i.id;
  11649. if (n) {
  11650. (e = window.curConn) == null || e.close();
  11651. const a = new ta;
  11652. return a.setRemoteId(n), a.setSessionInfo(i), T4(a), Nt("last_remote_id", n), ""
  11653. } else return "No id found in session data " + u
  11654. } catch (i) {
  11655. return i.message
  11656. }
  11657. }
  11658. function Rr(u) {
  11659. try {
  11660. if (!i0()) return;
  11661. oa()
  11662. } catch (e) {
  11663. aa("error", "Error", e.message, "")
  11664. }
  11665. }
  11666. function Ir(u) {
  11667. j4()
  11668. }
  11669. function Tr(u, e) {
  11670. function i(n) {
  11671. return /^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$/.test(n)
  11672. }
  11673. if (i(u)) {
  11674. if (u.startsWith("[")) {
  11675. let n = u.split("]:");
  11676. if (n.length === 2) {
  11677. let a = parseInt(n[1]) || 0;
  11678. if (a > 0) return `${n[0]}]:${a + e}`
  11679. }
  11680. }
  11681. } else if (u.includes(":")) {
  11682. let n = u.split(":");
  11683. if (n.length === 2) {
  11684. let a = parseInt(n[1]) || 0;
  11685. if (a > 0) return `${n[0]}:${a + e}`
  11686. }
  11687. }
  11688. return u
  11689. }
  11690. function U4() {
  11691. const u = m.getItem("api-server");
  11692. if (u) return u;
  11693. const e = m.getItem("custom-rendezvous-server");
  11694. if (e) {
  11695. let i = Tr(e, -2);
  11696. return i == e ? `http://${i}:${Bt - 2}` : `http://${i}`
  11697. }
  11698. return window.location.host.indexOf("localhost:") == 0 ? `http://localhost:${Bt - 2}` : window.location.origin
  11699. }
  11700. function Da(u) {
  11701. return U4() + "/api/audit/" + u
  11702. }
  11703. function da(u, e, i) {
  11704. try {
  11705. e4.exports.ZstdCodec.run(a => {
  11706. var t = new a.Simple;
  11707. i(e ? u.map(s => t.compress(s, 3)) : t.compress(u, 3))
  11708. })
  11709. } catch (n) {
  11710. console.error("Compress failed: ", n)
  11711. }
  11712. }
  11713. function M4(u, e, i) {
  11714. try {
  11715. e4.exports.ZstdCodec.run(n => {
  11716. var a = new n.Simple;
  11717. i(e ? u.map(t => a.decompress(t)) : a.decompress(u))
  11718. })
  11719. } catch (n) {
  11720. console.error("Decompress failed: ", n)
  11721. }
  11722. }
  11723. async function ca(u, e) {
  11724. return new Promise((i, n) => {
  11725. try {
  11726. e4.exports.ZstdCodec.run(a => {
  11727. var t = new a.Simple;
  11728. i(t.compress(u, 3))
  11729. })
  11730. } catch (a) {
  11731. n(a)
  11732. }
  11733. })
  11734. }
  11735. async function Ca(u, e) {
  11736. return new Promise((i, n) => {
  11737. try {
  11738. e4.exports.ZstdCodec.run(a => {
  11739. var t = new a.Simple;
  11740. i(t.decompress(u))
  11741. })
  11742. } catch (a) {
  11743. n(a)
  11744. }
  11745. })
  11746. }
  11747. function jr() {
  11748. const u = document.documentElement;
  11749. u.requestFullscreen ? u.requestFullscreen() : u.mozRequestFullScreen ? u.mozRequestFullScreen() : u.webkitRequestFullscreen ? u.webkitRequestFullscreen() : u.msRequestFullscreen && u.msRequestFullscreen()
  11750. }
  11751. function Nr() {
  11752. document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen()
  11753. }
  11754. function Or() {
  11755. return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement
  11756. }
  11757. var gt = !1;
  11758. function Ur() {
  11759. gt || (console.log("listen fullscreen"), gt = !0, document.addEventListener("fullscreenchange", () => onFullscreenChanged(!!document.fullscreenElement)), document.addEventListener("mozfullscreenchange", () => onFullscreenChanged(!!document.mozFullScreen)), document.addEventListener("webkitfullscreenchange", () => onFullscreenChanged(!!document.webkitFullscreenElement)), document.addEventListener("msfullscreenchange", () => onFullscreenChanged(!!document.msFullscreenElement)))
  11760. }
  11761. Ur();
  11762. async function Mr() {
  11763. try {
  11764. let u = await Mt();
  11765. onLoadAbFinished(JSON.stringify(u))
  11766. } catch (u) {
  11767. console.error("Failed to load ab: " + u.message), onLoadAbFinished("")
  11768. }
  11769. }
  11770. async function Lr() {
  11771. try {
  11772. let u = await Wn();
  11773. onLoadGroupFinished(JSON.stringify(u))
  11774. } catch (u) {
  11775. console.error("Failed to load group: " + u.message), onLoadGroupFinished("")
  11776. }
  11777. }
  11778. function pa() {
  11779. // return cr.indexOf(new TextDecoder().decode(be("cnVzdGRlc2suY29t"))) < 0
  11780. return false
  11781. }
  11782. function Ba(u) {
  11783. return pa() && (!Gt() && !Jt() || L4 < 400) ? (u && setTimeout(ma, 100), !0) : !1
  11784. }
  11785. let L4 = 0;
  11786. function Wr() {
  11787. return new TextDecoder().decode(be("L2FwaS9saWMvd2M="))
  11788. }
  11789. async function Vr() {
  11790. if (pa()) try {
  11791. const u = U4() + Wr(), i = await (await fetch(u)).text(), n = await Aa(i);
  11792. L4 = parseInt(n[0])
  11793. } catch {
  11794. }
  11795. }
  11796. async function kt(u) {
  11797. if (!u) {
  11798. lt("");
  11799. return
  11800. }
  11801. try {
  11802. const i = (await Aa(u))[2];
  11803. lt(i)
  11804. } catch (e) {
  11805. console.error("Failed to decode verifier: " + e.message)
  11806. }
  11807. }
  11808. async function Aa(u) {
  11809. try {
  11810. return new TextDecoder().decode(await _4(u, "IycjQd4TmWvjjLnYd796Rd+XkK+KG+7GU1Ia7u4+vSw=")).split(":")
  11811. } catch (e) {
  11812. return console.error("Failed to decode: " + e.message), []
  11813. }
  11814. }
  11815. function qr() {
  11816. window.closeConnection()
  11817. }
  11818. function ma() {
  11819. if (L4 < 400) {
  11820. window.dialog("error", "License Warning", "To run the web client, you need a license supporting at least 10 users and 300 devices, or an equivalent plan.");
  11821. return
  11822. }
  11823. window.loginDialog()
  11824. }
  11825. const ht = document.querySelector("#app");
  11826. if (ht) {
  11827. let e = function (i, n, a) {
  11828. !i0() || (i == "input-password" ? (document.querySelector("div#status").style.display = "none", document.querySelector("div#password").style.display = "block") : i ? i == "error" ? (document.querySelector("div#status").style.display = "block", document.querySelector("div#canvas").style.display = "none", document.querySelector("div#text").innerHTML = '<div style="color: red; font-weight: bold;">' + a + "</div>") : (document.querySelector("div#password").style.display = "none", document.querySelector("div#status").style.display = "block", document.querySelector("div#text").innerHTML = '<div style="font-weight: bold;">' + a + "</div>") : (document.querySelector("div#canvas").style.display = "block", document.querySelector("div#password").style.display = "none", document.querySelector("div#status").style.display = "none"))
  11829. };
  11830. ht.innerHTML = `
  11831. <div id="connect" style="text-align: center"><table style="display: inline-block">
  11832. <tr><td><span>Host: </span></td><td><input id="host" /></td></tr>
  11833. <tr><td><span>Key: </span></td><td><input id="key" /></td></tr>
  11834. <tr><td><span>Id: </span></td><td><input id="id" /></td></tr>
  11835. <tr><td></td><td><button onclick="connect();">Connect</button></td></tr>
  11836. </table></div>
  11837. <div id="password" style="display: none;">
  11838. <input type="password" id="password" />
  11839. <button id="confirm" onclick="confirm()">Confirm</button>
  11840. <button id="cancel" onclick="cancel();">Cancel</button>
  11841. </div>
  11842. <div id="status" style="display: none;">
  11843. <div id="text" style="line-height: 2em"></div>
  11844. <button id="cancel" onclick="cancel();">Cancel</button>
  11845. </div>
  11846. <div id="canvas" style="display: none;">
  11847. <button id="cancel" onclick="cancel();">Cancel</button>
  11848. <canvas id="player"></canvas>
  11849. <canvas id="test-yuv-decoder-canvas"></canvas>
  11850. </div>
  11851. `;
  11852. let u;
  11853. window.init(), document.body.onload = () => {
  11854. const i = document.querySelector("#host");
  11855. i.value = m.getItem("custom-rendezvous-server");
  11856. const n = document.querySelector("#id");
  11857. n.value = m.getItem("id");
  11858. const a = document.querySelector("#key");
  11859. a.value = m.getItem("key"), u = YUVCanvas.attach(document.getElementById("player"))
  11860. }, window.connect = () => {
  11861. const i = document.querySelector("#host");
  11862. m.setItem("custom-rendezvous-server", i.value);
  11863. const n = document.querySelector("#id");
  11864. m.setItem("id", n.value);
  11865. const a = document.querySelector("#key");
  11866. m.setItem("key", a.value), (async () => {
  11867. const s = ra();
  11868. s.setMsgbox(e), s.setDraw(E => {
  11869. F4(E), u.drawFrame(E)
  11870. }), document.querySelector("div#status").style.display = "block", document.querySelector("div#connect").style.display = "none", document.querySelector("div#text").innerHTML = "Connecting ...", s.setPeerId(n.value), await s.start()
  11871. })()
  11872. }, window.cancel = () => {
  11873. j4(), document.querySelector("div#connect").style.display = "block", document.querySelector("div#password").style.display = "none", document.querySelector("div#status").style.display = "none", document.querySelector("div#canvas").style.display = "none"
  11874. }, window.confirm = () => {
  11875. const i = document.querySelector("input#password").value;
  11876. i && (document.querySelector("div#password").style.display = "none", i0().login(i))
  11877. }
  11878. }